{
  "version": 3,
  "sources": ["../../../node_modules/@rails/actioncable/src/adapters.js", "../../../node_modules/@rails/actioncable/src/logger.js", "../../../node_modules/@rails/actioncable/src/connection_monitor.js", "../../../node_modules/@rails/actioncable/src/internal.js", "../../../node_modules/@rails/actioncable/src/connection.js", "../../../node_modules/@rails/actioncable/src/subscription.js", "../../../node_modules/@rails/actioncable/src/subscription_guarantor.js", "../../../node_modules/@rails/actioncable/src/subscriptions.js", "../../../node_modules/@rails/actioncable/src/consumer.js", "../../../node_modules/@rails/actioncable/src/index.js", "../../../node_modules/tslib/tslib.js", "../../../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/node_modules/gl-matrix/esm/common.js", "../../../node_modules/maplibre-gl/node_modules/gl-matrix/esm/mat3.js", "../../../node_modules/maplibre-gl/node_modules/gl-matrix/esm/mat4.js", "../../../node_modules/maplibre-gl/node_modules/gl-matrix/esm/vec3.js", "../../../node_modules/maplibre-gl/node_modules/gl-matrix/esm/vec4.js", "../../../node_modules/maplibre-gl/node_modules/gl-matrix/esm/quat.js", "../../../node_modules/maplibre-gl/node_modules/gl-matrix/esm/vec2.js", "../../../node_modules/maplibre-gl/src/data/extent.ts", "../../../node_modules/maplibre-gl/src/source/pixels_to_tile_units.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/unicode_properties.g.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/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/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/src/data/bucket/dash_attributes.ts", "../../../node_modules/maplibre-gl/node_modules/murmurhash-js/index.js", "../../../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/src/data/feature_position_map.ts", "../../../node_modules/maplibre-gl/src/webgl/uniform_binding.ts", "../../../node_modules/maplibre-gl/src/data/program_configuration.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/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/style/style_layer/color_relief_style_layer_properties.g.ts", "../../../node_modules/maplibre-gl/src/webgl/texture.ts", "../../../node_modules/maplibre-gl/src/data/dem_data.ts", "../../../node_modules/maplibre-gl/src/style/style_layer/color_relief_style_layer.ts", "../../../node_modules/maplibre-gl/src/data/bucket/fill_attributes.ts", "../../../node_modules/maplibre-gl/src/data/bucket/pattern_bucket_features.ts", "../../../node_modules/maplibre-gl/node_modules/earcut/src/earcut.js", "../../../node_modules/maplibre-gl/src/render/subdivision_granularity_settings.ts", "../../../node_modules/maplibre-gl/src/render/subdivision.ts", "../../../node_modules/maplibre-gl/src/render/fill_large_mesh_arrays.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/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/node_modules/kdbush/index.js", "../../../node_modules/maplibre-gl/node_modules/@maplibre/geojson-vt/dist/geojson-vt.mjs", "../../../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/symbol/one_em.ts", "../../../node_modules/maplibre-gl/src/util/verticalize_punctuation.ts", "../../../node_modules/maplibre-gl/src/symbol/tagged_string.ts", "../../../node_modules/maplibre-gl/node_modules/pbf/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/custom_style_layer.ts", "../../../node_modules/maplibre-gl/src/util/throttled_invoker.ts", "../../../node_modules/maplibre-gl/src/util/actor.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/tile/tile_id.ts", "../../../node_modules/maplibre-gl/src/util/world_bounds.ts", "../../../node_modules/maplibre-gl/src/geo/bounds.ts", "../../../node_modules/maplibre-gl/src/util/dictionary_coder.ts", "../../../node_modules/maplibre-gl/src/util/vectortile_to_geojson.ts", "../../../node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/vector/vector.js", "../../../node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/vector/fixedSizeVector.js", "../../../node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/vector/flat/int32FlatVector.js", "../../../node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/vector/flat/doubleFlatVector.js", "../../../node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/vector/sequence/sequenceVector.js", "../../../node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/vector/sequence/int32SequenceVector.js", "../../../node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/vector/constant/int32ConstVector.js", "../../../node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/vector/featureTable.js", "../../../node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/decoding/intWrapper.js", "../../../node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/metadata/tile/logicalLevelTechnique.js", "../../../node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/metadata/tile/physicalLevelTechnique.js", "../../../node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/decoding/fastPforShared.js", "../../../node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/decoding/fastPforDecoder.js", "../../../node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/decoding/fastPforUnpack.js", "../../../node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/decoding/integerDecodingUtils.js", "../../../node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/metadata/tile/physicalStreamType.js", "../../../node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/metadata/tile/dictionaryType.js", "../../../node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/metadata/tile/offsetType.js", "../../../node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/metadata/tile/lengthType.js", "../../../node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/vector/vectorType.js", "../../../node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/vector/geometry/geometryType.js", "../../../node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/vector/geometry/vertexBufferType.js", "../../../node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/metadata/tile/streamMetadataDecoder.js", "../../../node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/vector/flat/bitVector.js", "../../../node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/decoding/unpackNullableUtils.js", "../../../node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/decoding/integerStreamDecoder.js", "../../../node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/decoding/bigEndianDecode.js", "../../../node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/vector/flat/int64FlatVector.js", "../../../node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/vector/sequence/int64SequenceVector.js", "../../../node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/vector/geometry/zOrderCurve.js", "../../../node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/vector/geometry/geometryVectorConverter.js", "../../../node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/vector/geometry/geometryVector.js", "../../../node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/vector/geometry/constGeometryVector.js", "../../../node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/vector/geometry/flatGeometryVector.js", "../../../node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/vector/geometry/gpuVector.js", "../../../node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/vector/geometry/constGpuVector.js", "../../../node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/vector/geometry/flatGpuVector.js", "../../../node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/decoding/geometryDecoder.js", "../../../node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/vector/flat/booleanFlatVector.js", "../../../node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/vector/flat/floatFlatVector.js", "../../../node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/vector/constant/int64ConstVector.js", "../../../node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/decoding/decodingUtils.js", "../../../node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/vector/variableSizeVector.js", "../../../node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/vector/flat/stringFlatVector.js", "../../../node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/vector/dictionary/stringDictionaryVector.js", "../../../node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/vector/fsst-dictionary/stringFsstDictionaryVector.js", "../../../node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/decoding/fsstDecoder.js", "../../../node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/decoding/propertyDecoder.js", "../../../node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/metadata/tileset/tilesetMetadata.js", "../../../node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/decoding/stringDecoder.js", "../../../node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/metadata/tileset/typeMap.js", "../../../node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/metadata/tileset/embeddedTilesetMetadataDecoder.js", "../../../node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/mltDecoder.js", "../../../node_modules/maplibre-gl/src/source/vector_tile_mlt.ts", "../../../node_modules/maplibre-gl/node_modules/@maplibre/vt-pbf/dist/index.es.js", "../../../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/src/tile/tile_cache.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/worker_tile_state.ts", "../../../node_modules/maplibre-gl/src/util/request_performance.ts", "../../../node_modules/maplibre-gl/src/source/vector_tile_overzoomed.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/src/source/geojson_worker_source.ts", "../../../node_modules/maplibre-gl/src/source/worker.ts", "../../../node_modules/maplibre-gl/node_modules/gl-matrix/esm/mat2.js", "../../../node_modules/maplibre-gl/src/util/browser.ts", "../../../node_modules/maplibre-gl/src/util/time_control.ts", "../../../node_modules/maplibre-gl/src/util/image_request.ts", "../../../node_modules/maplibre-gl/src/util/dom.ts", "../../../node_modules/maplibre-gl/src/util/request_manager.ts", "../../../node_modules/maplibre-gl/src/util/style.ts", "../../../node_modules/maplibre-gl/src/style/load_sprite.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/tile/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_diff.ts", "../../../node_modules/maplibre-gl/src/util/geojson_bounds.ts", "../../../node_modules/maplibre-gl/src/source/geojson_source.ts", "../../../node_modules/maplibre-gl/src/tile/tile_id_to_lng_lat_bounds.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/tile/tile.ts", "../../../node_modules/maplibre-gl/src/data/bucket.ts", "../../../node_modules/maplibre-gl/src/source/source_state.ts", "../../../node_modules/maplibre-gl/src/geo/projection/mercator_utils.ts", "../../../node_modules/maplibre-gl/src/geo/projection/covering_tiles.ts", "../../../node_modules/maplibre-gl/src/data/extent_bounds.ts", "../../../node_modules/maplibre-gl/src/tile/tile_manager_raster.ts", "../../../node_modules/maplibre-gl/src/tile/tile_manager_raster_dem.ts", "../../../node_modules/maplibre-gl/src/tile/tile_manager_in_view_tiles.ts", "../../../node_modules/maplibre-gl/src/tile/tile_manager.ts", "../../../node_modules/maplibre-gl/src/symbol/path_interpolator.ts", "../../../node_modules/maplibre-gl/src/symbol/grid_index.ts", "../../../node_modules/maplibre-gl/src/util/fast_maths.ts", "../../../node_modules/maplibre-gl/src/symbol/projection.ts", "../../../node_modules/maplibre-gl/src/symbol/collision_index.ts", "../../../node_modules/maplibre-gl/src/symbol/placement.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/shaders/glsl/_prelude.fragment.glsl.g.ts", "../../../node_modules/maplibre-gl/src/shaders/glsl/clipping_mask.fragment.glsl.g.ts", "../../../node_modules/maplibre-gl/src/shaders/shaders.ts", "../../../node_modules/maplibre-gl/src/shaders/glsl/_prelude.vertex.glsl.g.ts", "../../../node_modules/maplibre-gl/src/shaders/glsl/_projection_mercator.vertex.glsl.g.ts", "../../../node_modules/maplibre-gl/src/shaders/glsl/_projection_globe.vertex.glsl.g.ts", "../../../node_modules/maplibre-gl/src/shaders/glsl/background.fragment.glsl.g.ts", "../../../node_modules/maplibre-gl/src/shaders/glsl/background.vertex.glsl.g.ts", "../../../node_modules/maplibre-gl/src/shaders/glsl/background_pattern.fragment.glsl.g.ts", "../../../node_modules/maplibre-gl/src/shaders/glsl/background_pattern.vertex.glsl.g.ts", "../../../node_modules/maplibre-gl/src/shaders/glsl/circle.fragment.glsl.g.ts", "../../../node_modules/maplibre-gl/src/shaders/glsl/circle.vertex.glsl.g.ts", "../../../node_modules/maplibre-gl/src/shaders/glsl/clipping_mask.vertex.glsl.g.ts", "../../../node_modules/maplibre-gl/src/shaders/glsl/heatmap.fragment.glsl.g.ts", "../../../node_modules/maplibre-gl/src/shaders/glsl/heatmap.vertex.glsl.g.ts", "../../../node_modules/maplibre-gl/src/shaders/glsl/heatmap_texture.fragment.glsl.g.ts", "../../../node_modules/maplibre-gl/src/shaders/glsl/heatmap_texture.vertex.glsl.g.ts", "../../../node_modules/maplibre-gl/src/shaders/glsl/collision_box.fragment.glsl.g.ts", "../../../node_modules/maplibre-gl/src/shaders/glsl/collision_box.vertex.glsl.g.ts", "../../../node_modules/maplibre-gl/src/shaders/glsl/collision_circle.fragment.glsl.g.ts", "../../../node_modules/maplibre-gl/src/shaders/glsl/collision_circle.vertex.glsl.g.ts", "../../../node_modules/maplibre-gl/src/shaders/glsl/color_relief.fragment.glsl.g.ts", "../../../node_modules/maplibre-gl/src/shaders/glsl/color_relief.vertex.glsl.g.ts", "../../../node_modules/maplibre-gl/src/shaders/glsl/debug.fragment.glsl.g.ts", "../../../node_modules/maplibre-gl/src/shaders/glsl/debug.vertex.glsl.g.ts", "../../../node_modules/maplibre-gl/src/shaders/glsl/depth.vertex.glsl.g.ts", "../../../node_modules/maplibre-gl/src/shaders/glsl/fill.fragment.glsl.g.ts", "../../../node_modules/maplibre-gl/src/shaders/glsl/fill.vertex.glsl.g.ts", "../../../node_modules/maplibre-gl/src/shaders/glsl/fill_outline.fragment.glsl.g.ts", "../../../node_modules/maplibre-gl/src/shaders/glsl/fill_outline.vertex.glsl.g.ts", "../../../node_modules/maplibre-gl/src/shaders/glsl/fill_outline_pattern.fragment.glsl.g.ts", "../../../node_modules/maplibre-gl/src/shaders/glsl/fill_outline_pattern.vertex.glsl.g.ts", "../../../node_modules/maplibre-gl/src/shaders/glsl/fill_pattern.fragment.glsl.g.ts", "../../../node_modules/maplibre-gl/src/shaders/glsl/fill_pattern.vertex.glsl.g.ts", "../../../node_modules/maplibre-gl/src/shaders/glsl/fill_extrusion.fragment.glsl.g.ts", "../../../node_modules/maplibre-gl/src/shaders/glsl/fill_extrusion.vertex.glsl.g.ts", "../../../node_modules/maplibre-gl/src/shaders/glsl/fill_extrusion_pattern.fragment.glsl.g.ts", "../../../node_modules/maplibre-gl/src/shaders/glsl/fill_extrusion_pattern.vertex.glsl.g.ts", "../../../node_modules/maplibre-gl/src/shaders/glsl/hillshade_prepare.fragment.glsl.g.ts", "../../../node_modules/maplibre-gl/src/shaders/glsl/hillshade_prepare.vertex.glsl.g.ts", "../../../node_modules/maplibre-gl/src/shaders/glsl/hillshade.fragment.glsl.g.ts", "../../../node_modules/maplibre-gl/src/shaders/glsl/hillshade.vertex.glsl.g.ts", "../../../node_modules/maplibre-gl/src/shaders/glsl/line.fragment.glsl.g.ts", "../../../node_modules/maplibre-gl/src/shaders/glsl/line.vertex.glsl.g.ts", "../../../node_modules/maplibre-gl/src/shaders/glsl/line_gradient.fragment.glsl.g.ts", "../../../node_modules/maplibre-gl/src/shaders/glsl/line_gradient.vertex.glsl.g.ts", "../../../node_modules/maplibre-gl/src/shaders/glsl/line_pattern.fragment.glsl.g.ts", "../../../node_modules/maplibre-gl/src/shaders/glsl/line_pattern.vertex.glsl.g.ts", "../../../node_modules/maplibre-gl/src/shaders/glsl/line_sdf.fragment.glsl.g.ts", "../../../node_modules/maplibre-gl/src/shaders/glsl/line_sdf.vertex.glsl.g.ts", "../../../node_modules/maplibre-gl/src/shaders/glsl/line_gradient_sdf.fragment.glsl.g.ts", "../../../node_modules/maplibre-gl/src/shaders/glsl/line_gradient_sdf.vertex.glsl.g.ts", "../../../node_modules/maplibre-gl/src/shaders/glsl/raster.fragment.glsl.g.ts", "../../../node_modules/maplibre-gl/src/shaders/glsl/raster.vertex.glsl.g.ts", "../../../node_modules/maplibre-gl/src/shaders/glsl/symbol_icon.fragment.glsl.g.ts", "../../../node_modules/maplibre-gl/src/shaders/glsl/symbol_icon.vertex.glsl.g.ts", "../../../node_modules/maplibre-gl/src/shaders/glsl/symbol_sdf.fragment.glsl.g.ts", "../../../node_modules/maplibre-gl/src/shaders/glsl/symbol_sdf.vertex.glsl.g.ts", "../../../node_modules/maplibre-gl/src/shaders/glsl/symbol_text_and_icon.fragment.glsl.g.ts", "../../../node_modules/maplibre-gl/src/shaders/glsl/symbol_text_and_icon.vertex.glsl.g.ts", "../../../node_modules/maplibre-gl/src/shaders/glsl/terrain.fragment.glsl.g.ts", "../../../node_modules/maplibre-gl/src/shaders/glsl/terrain.vertex.glsl.g.ts", "../../../node_modules/maplibre-gl/src/shaders/glsl/terrain_depth.fragment.glsl.g.ts", "../../../node_modules/maplibre-gl/src/shaders/glsl/terrain_depth.vertex.glsl.g.ts", "../../../node_modules/maplibre-gl/src/shaders/glsl/terrain_coords.fragment.glsl.g.ts", "../../../node_modules/maplibre-gl/src/shaders/glsl/terrain_coords.vertex.glsl.g.ts", "../../../node_modules/maplibre-gl/src/shaders/glsl/projection_error_measurement.fragment.glsl.g.ts", "../../../node_modules/maplibre-gl/src/shaders/glsl/projection_error_measurement.vertex.glsl.g.ts", "../../../node_modules/maplibre-gl/src/shaders/glsl/atmosphere.fragment.glsl.g.ts", "../../../node_modules/maplibre-gl/src/shaders/glsl/atmosphere.vertex.glsl.g.ts", "../../../node_modules/maplibre-gl/src/shaders/glsl/sky.fragment.glsl.g.ts", "../../../node_modules/maplibre-gl/src/shaders/glsl/sky.vertex.glsl.g.ts", "../../../node_modules/maplibre-gl/src/render/mesh.ts", "../../../node_modules/maplibre-gl/src/data/pos_attributes.ts", "../../../node_modules/maplibre-gl/src/geo/projection/mercator_projection.ts", "../../../node_modules/maplibre-gl/src/geo/edge_insets.ts", "../../../node_modules/maplibre-gl/src/geo/transform_helper.ts", "../../../node_modules/maplibre-gl/src/util/primitives/aabb.ts", "../../../node_modules/maplibre-gl/src/geo/projection/mercator_covering_tiles_details_provider.ts", "../../../node_modules/maplibre-gl/src/util/primitives/frustum.ts", "../../../node_modules/maplibre-gl/src/geo/projection/mercator_transform.ts", "../../../node_modules/maplibre-gl/src/geo/projection/camera_helper.ts", "../../../node_modules/maplibre-gl/src/geo/projection/mercator_camera_helper.ts", "../../../node_modules/maplibre-gl/src/webgl/color_mode.ts", "../../../node_modules/maplibre-gl/src/webgl/cull_face_mode.ts", "../../../node_modules/maplibre-gl/src/webgl/depth_mode.ts", "../../../node_modules/maplibre-gl/src/webgl/stencil_mode.ts", "../../../node_modules/maplibre-gl/src/webgl/webgl2.ts", "../../../node_modules/maplibre-gl/src/geo/projection/globe_projection_error_measurement.ts", "../../../node_modules/maplibre-gl/src/webgl/program/projection_error_measurement_program.ts", "../../../node_modules/maplibre-gl/src/util/create_tile_mesh.ts", "../../../node_modules/maplibre-gl/src/geo/projection/vertical_perspective_projection.ts", "../../../node_modules/maplibre-gl/src/geo/projection/globe_projection.ts", "../../../node_modules/maplibre-gl/src/geo/projection/globe_utils.ts", "../../../node_modules/maplibre-gl/src/util/primitives/bounding_volume_cache.ts", "../../../node_modules/maplibre-gl/src/util/primitives/convex_volume.ts", "../../../node_modules/maplibre-gl/src/geo/projection/globe_covering_tiles_details_provider.ts", "../../../node_modules/maplibre-gl/src/geo/projection/vertical_perspective_transform.ts", "../../../node_modules/maplibre-gl/src/geo/projection/globe_transform.ts", "../../../node_modules/maplibre-gl/src/geo/projection/vertical_perspective_camera_helper.ts", "../../../node_modules/maplibre-gl/src/geo/projection/globe_camera_helper.ts", "../../../node_modules/maplibre-gl/src/style/style.ts", "../../../node_modules/maplibre-gl/src/geo/projection/projection_factory.ts", "../../../node_modules/maplibre-gl/src/data/raster_bounds_attributes.ts", "../../../node_modules/maplibre-gl/src/webgl/vertex_array_object.ts", "../../../node_modules/maplibre-gl/src/webgl/program/terrain_program.ts", "../../../node_modules/maplibre-gl/src/webgl/program/projection_program.ts", "../../../node_modules/maplibre-gl/src/webgl/program.ts", "../../../node_modules/maplibre-gl/src/webgl/program/pattern.ts", "../../../node_modules/maplibre-gl/src/webgl/program/fill_extrusion_program.ts", "../../../node_modules/maplibre-gl/src/webgl/program/fill_program.ts", "../../../node_modules/maplibre-gl/src/webgl/program/circle_program.ts", "../../../node_modules/maplibre-gl/src/webgl/program/collision_program.ts", "../../../node_modules/maplibre-gl/src/webgl/program/debug_program.ts", "../../../node_modules/maplibre-gl/src/webgl/program/heatmap_program.ts", "../../../node_modules/maplibre-gl/src/webgl/program/hillshade_program.ts", "../../../node_modules/maplibre-gl/src/webgl/program/color_relief_program.ts", "../../../node_modules/maplibre-gl/src/webgl/program/line_program.ts", "../../../node_modules/maplibre-gl/src/webgl/program/raster_program.ts", "../../../node_modules/maplibre-gl/src/webgl/program/symbol_program.ts", "../../../node_modules/maplibre-gl/src/webgl/program/background_program.ts", "../../../node_modules/maplibre-gl/src/webgl/program/program_uniforms.ts", "../../../node_modules/maplibre-gl/src/webgl/program/atmosphere_program.ts", "../../../node_modules/maplibre-gl/src/webgl/program/sky_program.ts", "../../../node_modules/maplibre-gl/src/webgl/index_buffer.ts", "../../../node_modules/maplibre-gl/src/webgl/vertex_buffer.ts", "../../../node_modules/maplibre-gl/src/webgl/value.ts", "../../../node_modules/maplibre-gl/src/util/framebuffer_error.ts", "../../../node_modules/maplibre-gl/src/webgl/framebuffer.ts", "../../../node_modules/maplibre-gl/src/webgl/context.ts", "../../../node_modules/maplibre-gl/src/webgl/draw/draw_collision_debug.ts", "../../../node_modules/maplibre-gl/src/webgl/draw/draw_symbol.ts", "../../../node_modules/maplibre-gl/src/webgl/draw/draw_heatmap.ts", "../../../node_modules/maplibre-gl/src/webgl/draw/draw_line.ts", "../../../node_modules/maplibre-gl/src/render/update_pattern_positions_in_program.ts", "../../../node_modules/maplibre-gl/src/webgl/draw/draw_fill.ts", "../../../node_modules/maplibre-gl/src/webgl/draw/draw_fill_extrusion.ts", "../../../node_modules/maplibre-gl/src/webgl/draw/draw_hillshade.ts", "../../../node_modules/maplibre-gl/src/webgl/draw/draw_color_relief.ts", "../../../node_modules/maplibre-gl/src/webgl/draw/draw_raster.ts", "../../../node_modules/maplibre-gl/src/webgl/draw/draw_debug.ts", "../../../node_modules/maplibre-gl/src/webgl/draw/draw_terrain.ts", "../../../node_modules/maplibre-gl/src/webgl/draw/draw_sky.ts", "../../../node_modules/maplibre-gl/src/webgl/draw/index.ts", "../../../node_modules/maplibre-gl/src/webgl/draw/draw_circle.ts", "../../../node_modules/maplibre-gl/src/webgl/draw/draw_background.ts", "../../../node_modules/maplibre-gl/src/webgl/draw/draw_custom.ts", "../../../node_modules/maplibre-gl/src/render/painter.ts", "../../../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/tile/terrain_tile_manager.ts", "../../../node_modules/maplibre-gl/src/render/terrain.ts", "../../../node_modules/maplibre-gl/src/webgl/render_pool.ts", "../../../node_modules/maplibre-gl/src/webgl/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/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/globe_control.ts", "../../../node_modules/maplibre-gl/src/ui/control/terrain_control.ts", "../../../node_modules/maplibre-gl/build/rollup/maplibregl.js", "../../../node_modules/jquery/dist/jquery.js", "../../../node_modules/bootstrap/js/src/dom/data.js", "../../../node_modules/bootstrap/js/src/util/index.js", "../../../node_modules/bootstrap/js/src/dom/event-handler.js", "../../../node_modules/bootstrap/js/src/dom/manipulator.js", "../../../node_modules/bootstrap/js/src/util/config.js", "../../../node_modules/bootstrap/js/src/base-component.js", "../../../node_modules/bootstrap/js/src/dom/selector-engine.js", "../../../node_modules/bootstrap/js/src/util/component-functions.js", "../../../node_modules/bootstrap/js/src/alert.js", "../../../node_modules/bootstrap/js/src/button.js", "../../../node_modules/bootstrap/js/src/util/swipe.js", "../../../node_modules/bootstrap/js/src/carousel.js", "../../../node_modules/bootstrap/js/src/collapse.js", "../../../node_modules/bootstrap/node_modules/@popperjs/core/lib/enums.js", "../../../node_modules/bootstrap/node_modules/@popperjs/core/lib/dom-utils/getNodeName.js", "../../../node_modules/bootstrap/node_modules/@popperjs/core/lib/dom-utils/getWindow.js", "../../../node_modules/bootstrap/node_modules/@popperjs/core/lib/dom-utils/instanceOf.js", "../../../node_modules/bootstrap/node_modules/@popperjs/core/lib/modifiers/applyStyles.js", "../../../node_modules/bootstrap/node_modules/@popperjs/core/lib/utils/getBasePlacement.js", "../../../node_modules/bootstrap/node_modules/@popperjs/core/lib/utils/math.js", "../../../node_modules/bootstrap/node_modules/@popperjs/core/lib/utils/userAgent.js", "../../../node_modules/bootstrap/node_modules/@popperjs/core/lib/dom-utils/isLayoutViewport.js", "../../../node_modules/bootstrap/node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js", "../../../node_modules/bootstrap/node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js", "../../../node_modules/bootstrap/node_modules/@popperjs/core/lib/dom-utils/contains.js", "../../../node_modules/bootstrap/node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js", "../../../node_modules/bootstrap/node_modules/@popperjs/core/lib/dom-utils/isTableElement.js", "../../../node_modules/bootstrap/node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js", "../../../node_modules/bootstrap/node_modules/@popperjs/core/lib/dom-utils/getParentNode.js", "../../../node_modules/bootstrap/node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js", "../../../node_modules/bootstrap/node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js", "../../../node_modules/bootstrap/node_modules/@popperjs/core/lib/utils/within.js", "../../../node_modules/bootstrap/node_modules/@popperjs/core/lib/utils/getFreshSideObject.js", "../../../node_modules/bootstrap/node_modules/@popperjs/core/lib/utils/mergePaddingObject.js", "../../../node_modules/bootstrap/node_modules/@popperjs/core/lib/utils/expandToHashMap.js", "../../../node_modules/bootstrap/node_modules/@popperjs/core/lib/modifiers/arrow.js", "../../../node_modules/bootstrap/node_modules/@popperjs/core/lib/utils/getVariation.js", "../../../node_modules/bootstrap/node_modules/@popperjs/core/lib/modifiers/computeStyles.js", "../../../node_modules/bootstrap/node_modules/@popperjs/core/lib/modifiers/eventListeners.js", "../../../node_modules/bootstrap/node_modules/@popperjs/core/lib/utils/getOppositePlacement.js", "../../../node_modules/bootstrap/node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js", "../../../node_modules/bootstrap/node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js", "../../../node_modules/bootstrap/node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js", "../../../node_modules/bootstrap/node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js", "../../../node_modules/bootstrap/node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js", "../../../node_modules/bootstrap/node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js", "../../../node_modules/bootstrap/node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js", "../../../node_modules/bootstrap/node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js", "../../../node_modules/bootstrap/node_modules/@popperjs/core/lib/utils/rectToClientRect.js", "../../../node_modules/bootstrap/node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js", "../../../node_modules/bootstrap/node_modules/@popperjs/core/lib/utils/computeOffsets.js", "../../../node_modules/bootstrap/node_modules/@popperjs/core/lib/utils/detectOverflow.js", "../../../node_modules/bootstrap/node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js", "../../../node_modules/bootstrap/node_modules/@popperjs/core/lib/modifiers/flip.js", "../../../node_modules/bootstrap/node_modules/@popperjs/core/lib/modifiers/hide.js", "../../../node_modules/bootstrap/node_modules/@popperjs/core/lib/modifiers/offset.js", "../../../node_modules/bootstrap/node_modules/@popperjs/core/lib/modifiers/popperOffsets.js", "../../../node_modules/bootstrap/node_modules/@popperjs/core/lib/utils/getAltAxis.js", "../../../node_modules/bootstrap/node_modules/@popperjs/core/lib/modifiers/preventOverflow.js", "../../../node_modules/bootstrap/node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js", "../../../node_modules/bootstrap/node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js", "../../../node_modules/bootstrap/node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js", "../../../node_modules/bootstrap/node_modules/@popperjs/core/lib/utils/orderModifiers.js", "../../../node_modules/bootstrap/node_modules/@popperjs/core/lib/utils/debounce.js", "../../../node_modules/bootstrap/node_modules/@popperjs/core/lib/utils/mergeByName.js", "../../../node_modules/bootstrap/node_modules/@popperjs/core/lib/createPopper.js", "../../../node_modules/bootstrap/node_modules/@popperjs/core/lib/popper-lite.js", "../../../node_modules/bootstrap/node_modules/@popperjs/core/lib/popper.js", "../../../node_modules/bootstrap/js/src/dropdown.js", "../../../node_modules/bootstrap/js/src/util/backdrop.js", "../../../node_modules/bootstrap/js/src/util/focustrap.js", "../../../node_modules/bootstrap/js/src/util/scrollbar.js", "../../../node_modules/bootstrap/js/src/modal.js", "../../../node_modules/bootstrap/js/src/offcanvas.js", "../../../node_modules/bootstrap/js/src/util/sanitizer.js", "../../../node_modules/bootstrap/js/src/util/template-factory.js", "../../../node_modules/bootstrap/js/src/tooltip.js", "../../../node_modules/bootstrap/js/src/popover.js", "../../../node_modules/bootstrap/js/src/scrollspy.js", "../../../node_modules/bootstrap/js/src/tab.js", "../../../node_modules/bootstrap/js/src/toast.js", "../../../node_modules/bootstrap/js/index.umd.js", "../../javascript/custom/mappe_jquery.js", "../../../node_modules/@hotwired/turbo/dist/turbo.es2017-esm.js", "../../../node_modules/@hotwired/turbo-rails/app/javascript/turbo/cable.js", "../../../node_modules/@hotwired/turbo-rails/app/javascript/turbo/snakeize.js", "../../../node_modules/@hotwired/turbo-rails/app/javascript/turbo/cable_stream_source_element.js", "../../../node_modules/@hotwired/turbo-rails/app/javascript/turbo/fetch_requests.js", "../../../node_modules/@hotwired/turbo-rails/app/javascript/turbo/index.js", "../../../node_modules/@hotwired/stimulus/dist/stimulus.js", "../../javascript/controllers/application.js", "../../javascript/controllers/hello_controller.js", "../../../node_modules/tslib/modules/index.js", "../../../node_modules/zrender/lib/zrender.js", "../../../node_modules/zrender/lib/core/env.js", "../../../node_modules/zrender/lib/core/util.js", "../../../node_modules/zrender/lib/core/platform.js", "../../../node_modules/zrender/lib/core/vector.js", "../../../node_modules/zrender/lib/mixin/Draggable.js", "../../../node_modules/zrender/lib/core/Eventful.js", "../../../node_modules/zrender/lib/core/fourPointsTransform.js", "../../../node_modules/zrender/lib/core/dom.js", "../../../node_modules/zrender/lib/core/event.js", "../../../node_modules/zrender/lib/core/GestureMgr.js", "../../../node_modules/zrender/lib/core/matrix.js", "../../../node_modules/zrender/lib/core/Point.js", "../../../node_modules/zrender/lib/core/BoundingRect.js", "../../../node_modules/zrender/lib/Handler.js", "../../../node_modules/zrender/lib/core/timsort.js", "../../../node_modules/zrender/lib/graphic/constants.js", "../../../node_modules/zrender/lib/Storage.js", "../../../node_modules/zrender/lib/animation/requestAnimationFrame.js", "../../../node_modules/zrender/lib/animation/easing.js", "../../../node_modules/zrender/lib/core/curve.js", "../../../node_modules/zrender/lib/animation/cubicEasing.js", "../../../node_modules/zrender/lib/animation/Clip.js", "../../../node_modules/zrender/lib/tool/color.js", "../../../node_modules/zrender/lib/core/LRU.js", "../../../node_modules/zrender/lib/svg/helper.js", "../../../node_modules/zrender/lib/animation/Animator.js", "../../../node_modules/zrender/lib/animation/Animation.js", "../../../node_modules/zrender/lib/dom/HandlerProxy.js", "../../../node_modules/zrender/lib/config.js", "../../../node_modules/zrender/lib/core/Transformable.js", "../../../node_modules/zrender/lib/contain/text.js", "../../../node_modules/zrender/lib/Element.js", "../../../node_modules/zrender/lib/graphic/Group.js", "../../../node_modules/echarts/lib/util/number.js", "../../../node_modules/echarts/lib/util/log.js", "../../../node_modules/echarts/lib/util/model.js", "../../../node_modules/echarts/lib/util/clazz.js", "../../../node_modules/echarts/lib/model/mixin/makeStyleMapper.js", "../../../node_modules/echarts/lib/model/mixin/areaStyle.js", "../../../node_modules/zrender/lib/graphic/helper/image.js", "../../../node_modules/zrender/lib/graphic/helper/parseText.js", "../../../node_modules/zrender/lib/graphic/Displayable.js", "../../../node_modules/zrender/lib/core/bbox.js", "../../../node_modules/zrender/lib/core/PathProxy.js", "../../../node_modules/zrender/lib/contain/line.js", "../../../node_modules/zrender/lib/contain/cubic.js", "../../../node_modules/zrender/lib/contain/quadratic.js", "../../../node_modules/zrender/lib/contain/util.js", "../../../node_modules/zrender/lib/contain/arc.js", "../../../node_modules/zrender/lib/contain/windingLine.js", "../../../node_modules/zrender/lib/contain/path.js", "../../../node_modules/zrender/lib/graphic/Path.js", "../../../node_modules/zrender/lib/graphic/TSpan.js", "../../../node_modules/zrender/lib/graphic/Image.js", "../../../node_modules/zrender/lib/graphic/helper/roundRect.js", "../../../node_modules/zrender/lib/graphic/helper/subPixelOptimize.js", "../../../node_modules/zrender/lib/graphic/shape/Rect.js", "../../../node_modules/zrender/lib/graphic/Text.js", "../../../node_modules/echarts/lib/util/innerStore.js", "../../../node_modules/echarts/lib/util/states.js", "../../../node_modules/echarts/lib/util/graphic.js", "../../../node_modules/zrender/lib/tool/transformPath.js", "../../../node_modules/zrender/lib/tool/path.js", "../../../node_modules/zrender/lib/graphic/shape/Circle.js", "../../../node_modules/zrender/lib/graphic/shape/Ellipse.js", "../../../node_modules/zrender/lib/graphic/helper/roundSector.js", "../../../node_modules/zrender/lib/graphic/shape/Sector.js", "../../../node_modules/zrender/lib/graphic/shape/Ring.js", "../../../node_modules/zrender/lib/graphic/helper/smoothBezier.js", "../../../node_modules/zrender/lib/graphic/helper/poly.js", "../../../node_modules/zrender/lib/graphic/shape/Polygon.js", "../../../node_modules/zrender/lib/graphic/shape/Polyline.js", "../../../node_modules/zrender/lib/graphic/shape/Line.js", "../../../node_modules/zrender/lib/graphic/shape/BezierCurve.js", "../../../node_modules/zrender/lib/graphic/shape/Arc.js", "../../../node_modules/zrender/lib/graphic/CompoundPath.js", "../../../node_modules/zrender/lib/graphic/Gradient.js", "../../../node_modules/zrender/lib/graphic/LinearGradient.js", "../../../node_modules/zrender/lib/graphic/RadialGradient.js", "../../../node_modules/zrender/lib/core/OrientedBoundingRect.js", "../../../node_modules/zrender/lib/graphic/IncrementalDisplayable.js", "../../../node_modules/echarts/lib/animation/basicTransition.js", "../../../node_modules/echarts/lib/label/labelStyle.js", "../../../node_modules/echarts/lib/model/mixin/textStyle.js", "../../../node_modules/echarts/lib/model/mixin/lineStyle.js", "../../../node_modules/echarts/lib/model/mixin/itemStyle.js", "../../../node_modules/echarts/lib/model/Model.js", "../../../node_modules/echarts/lib/util/component.js", "../../../node_modules/echarts/lib/i18n/langEN.js", "../../../node_modules/echarts/lib/i18n/langZH.js", "../../../node_modules/echarts/lib/core/locale.js", "../../../node_modules/echarts/lib/scale/break.js", "../../../node_modules/echarts/lib/util/time.js", "../../../node_modules/echarts/lib/legacy/getTextRect.js", "../../../node_modules/echarts/lib/util/format.js", "../../../node_modules/echarts/lib/core/CoordinateSystem.js", "../../../node_modules/echarts/lib/util/layout.js", "../../../node_modules/echarts/lib/model/Component.js", "../../../node_modules/echarts/lib/visual/tokens.js", "../../../node_modules/echarts/lib/model/globalDefault.js", "../../../node_modules/echarts/lib/util/types.js", "../../../node_modules/echarts/lib/data/helper/sourceHelper.js", "../../../node_modules/echarts/lib/model/internalComponentCreator.js", "../../../node_modules/echarts/lib/model/mixin/palette.js", "../../../node_modules/echarts/lib/model/Global.js", "../../../node_modules/echarts/lib/core/ExtensionAPI.js", "../../../node_modules/echarts/lib/model/OptionManager.js", "../../../node_modules/echarts/lib/preprocessor/helper/compatStyle.js", "../../../node_modules/echarts/lib/preprocessor/backwardCompat.js", "../../../node_modules/echarts/lib/processor/dataStack.js", "../../../node_modules/echarts/lib/data/Source.js", "../../../node_modules/echarts/lib/data/helper/dataProvider.js", "../../../node_modules/echarts/lib/model/mixin/dataFormat.js", "../../../node_modules/echarts/lib/core/task.js", "../../../node_modules/echarts/lib/data/helper/dataValueHelper.js", "../../../node_modules/echarts/lib/data/helper/transform.js", "../../../node_modules/echarts/lib/data/DataStore.js", "../../../node_modules/echarts/lib/data/helper/sourceManager.js", "../../../node_modules/echarts/lib/component/tooltip/tooltipMarkup.js", "../../../node_modules/echarts/lib/component/tooltip/seriesFormatTooltip.js", "../../../node_modules/echarts/lib/model/Series.js", "../../../node_modules/echarts/lib/view/Component.js", "../../../node_modules/echarts/lib/chart/helper/createRenderPlanner.js", "../../../node_modules/echarts/lib/view/Chart.js", "../../../node_modules/echarts/lib/util/throttle.js", "../../../node_modules/echarts/lib/visual/style.js", "../../../node_modules/echarts/lib/loading/default.js", "../../../node_modules/echarts/lib/core/Scheduler.js", "../../../node_modules/echarts/lib/theme/dark.js", "../../../node_modules/echarts/lib/util/ECEventProcessor.js", "../../../node_modules/echarts/lib/visual/symbol.js", "../../../node_modules/echarts/lib/visual/helper.js", "../../../node_modules/echarts/lib/legacy/dataSelectAction.js", "../../../node_modules/echarts/lib/util/event.js", "../../../node_modules/zrender/lib/core/WeakMap.js", "../../../node_modules/echarts/lib/util/symbol.js", "../../../node_modules/zrender/lib/canvas/helper.js", "../../../node_modules/zrender/lib/canvas/dashStyle.js", "../../../node_modules/zrender/lib/canvas/graphic.js", "../../../node_modules/echarts/lib/util/decal.js", "../../../node_modules/echarts/lib/visual/decal.js", "../../../node_modules/echarts/lib/core/lifecycle.js", "../../../node_modules/echarts/lib/core/impl.js", "../../../node_modules/echarts/lib/chart/custom/customSeriesRegister.js", "../../../node_modules/echarts/lib/core/echarts.js", "../../../node_modules/echarts/lib/data/DataDiffer.js", "../../../node_modules/echarts/lib/data/helper/dimensionHelper.js", "../../../node_modules/echarts/lib/data/SeriesDimensionDefine.js", "../../../node_modules/echarts/lib/data/helper/SeriesDataSchema.js", "../../../node_modules/echarts/lib/data/SeriesData.js", "../../../node_modules/echarts/lib/export/api/helper.js", "../../../node_modules/echarts/lib/data/helper/createDimensions.js", "../../../node_modules/echarts/lib/model/referHelper.js", "../../../node_modules/echarts/lib/data/helper/dataStackHelper.js", "../../../node_modules/echarts/lib/chart/helper/createSeriesData.js", "../../../node_modules/echarts/lib/scale/helper.js", "../../../node_modules/echarts/lib/scale/Scale.js", "../../../node_modules/echarts/lib/data/OrdinalMeta.js", "../../../node_modules/echarts/lib/scale/Ordinal.js", "../../../node_modules/echarts/lib/scale/Interval.js", "../../../node_modules/echarts/lib/util/vendor.js", "../../../node_modules/echarts/lib/layout/barGrid.js", "../../../node_modules/echarts/lib/scale/Time.js", "../../../node_modules/echarts/lib/scale/Log.js", "../../../node_modules/echarts/lib/coord/scaleRawExtentInfo.js", "../../../node_modules/echarts/lib/coord/axisHelper.js", "../../../node_modules/echarts/lib/coord/axisModelCommonMixin.js", "../../../node_modules/echarts/lib/extension.js", "../../../node_modules/zrender/lib/contain/polygon.js", "../../../node_modules/echarts/lib/coord/geo/Region.js", "../../../node_modules/echarts/lib/coord/geo/parseGeoJson.js", "../../../node_modules/echarts/lib/export/api/number.js", "../../../node_modules/echarts/lib/export/api/time.js", "../../../node_modules/echarts/lib/export/api/graphic.js", "../../../node_modules/echarts/lib/export/api/format.js", "../../../node_modules/echarts/lib/export/api/util.js", "../../../node_modules/echarts/lib/coord/axisTickLabelBuilder.js", "../../../node_modules/echarts/lib/coord/Axis.js", "../../../node_modules/echarts/lib/export/api.js", "../../../node_modules/echarts/lib/label/labelGuideHelper.js", "../../../node_modules/echarts/lib/label/labelLayoutHelper.js", "../../../node_modules/echarts/lib/label/LabelManager.js", "../../../node_modules/echarts/lib/label/installLabelLayout.js", "../../../node_modules/echarts/lib/chart/line/LineSeries.js", "../../../node_modules/echarts/lib/chart/helper/labelHelper.js", "../../../node_modules/echarts/lib/chart/helper/Symbol.js", "../../../node_modules/echarts/lib/chart/helper/SymbolDraw.js", "../../../node_modules/echarts/lib/chart/line/helper.js", "../../../node_modules/echarts/lib/chart/line/lineAnimationDiff.js", "../../../node_modules/echarts/lib/chart/line/poly.js", "../../../node_modules/echarts/lib/chart/helper/createClipPathFromCoordSys.js", "../../../node_modules/echarts/lib/coord/CoordinateSystem.js", "../../../node_modules/echarts/lib/chart/line/LineView.js", "../../../node_modules/echarts/lib/layout/points.js", "../../../node_modules/echarts/lib/processor/dataSample.js", "../../../node_modules/echarts/lib/chart/line/install.js", "../../../node_modules/echarts/lib/chart/bar/BaseBarSeries.js", "../../../node_modules/echarts/lib/chart/bar/BarSeries.js", "../../../node_modules/echarts/lib/util/shape/sausage.js", "../../../node_modules/echarts/lib/label/sectorLabel.js", "../../../node_modules/echarts/lib/chart/helper/sectorHelper.js", "../../../node_modules/echarts/lib/chart/bar/BarView.js", "../../../node_modules/echarts/lib/chart/bar/install.js", "../../../node_modules/echarts/lib/chart/pie/pieLayout.js", "../../../node_modules/echarts/lib/processor/dataFilter.js", "../../../node_modules/echarts/lib/chart/pie/labelLayout.js", "../../../node_modules/echarts/lib/chart/pie/PieView.js", "../../../node_modules/echarts/lib/chart/helper/createSeriesDataSimply.js", "../../../node_modules/echarts/lib/visual/LegendVisualProvider.js", "../../../node_modules/echarts/lib/chart/pie/PieSeries.js", "../../../node_modules/echarts/lib/processor/negativeDataFilter.js", "../../../node_modules/echarts/lib/chart/pie/install.js", "../../../node_modules/echarts/lib/chart/scatter/ScatterSeries.js", "../../../node_modules/echarts/lib/chart/helper/LargeSymbolDraw.js", "../../../node_modules/echarts/lib/chart/scatter/ScatterView.js", "../../../node_modules/echarts/lib/coord/cartesian/GridModel.js", "../../../node_modules/echarts/lib/coord/cartesian/AxisModel.js", "../../../node_modules/echarts/lib/coord/axisDefault.js", "../../../node_modules/echarts/lib/coord/axisCommonTypes.js", "../../../node_modules/echarts/lib/component/axis/axisBreakHelper.js", "../../../node_modules/echarts/lib/coord/axisModelCreator.js", "../../../node_modules/echarts/lib/coord/cartesian/Cartesian.js", "../../../node_modules/echarts/lib/coord/cartesian/Cartesian2D.js", "../../../node_modules/echarts/lib/coord/cartesian/Axis2D.js", "../../../node_modules/echarts/lib/component/axis/axisAction.js", "../../../node_modules/echarts/lib/component/axis/AxisBuilder.js", "../../../node_modules/echarts/lib/coord/cartesian/cartesianAxisHelper.js", "../../../node_modules/echarts/lib/coord/axisAlignTicks.js", "../../../node_modules/echarts/lib/coord/cartesian/Grid.js", "../../../node_modules/echarts/lib/component/axisPointer/modelHelper.js", "../../../node_modules/echarts/lib/component/axis/AxisView.js", "../../../node_modules/echarts/lib/component/axis/axisSplitHelper.js", "../../../node_modules/echarts/lib/component/axis/CartesianAxisView.js", "../../../node_modules/echarts/lib/component/grid/installSimple.js", "../../../node_modules/echarts/lib/util/jitter.js", "../../../node_modules/echarts/lib/chart/scatter/jitterLayout.js", "../../../node_modules/echarts/lib/chart/scatter/install.js", "../../../node_modules/echarts/lib/chart/radar/radarLayout.js", "../../../node_modules/echarts/lib/chart/radar/backwardCompat.js", "../../../node_modules/echarts/lib/chart/radar/RadarView.js", "../../../node_modules/echarts/lib/chart/radar/RadarSeries.js", "../../../node_modules/echarts/lib/coord/radar/RadarModel.js", "../../../node_modules/echarts/lib/component/radar/RadarView.js", "../../../node_modules/echarts/lib/coord/radar/IndicatorAxis.js", "../../../node_modules/echarts/lib/coord/radar/Radar.js", "../../../node_modules/echarts/lib/component/radar/install.js", "../../../node_modules/echarts/lib/chart/radar/install.js", "../../../node_modules/echarts/lib/component/helper/interactionMutex.js", "../../../node_modules/echarts/lib/component/helper/cursorHelper.js", "../../../node_modules/echarts/lib/component/helper/RoamController.js", "../../../node_modules/echarts/lib/component/helper/roamHelper.js", "../../../node_modules/zrender/lib/tool/parseXML.js", "../../../node_modules/zrender/lib/tool/parseSVG.js", "../../../node_modules/echarts/lib/coord/geo/GeoSVGResource.js", "../../../node_modules/echarts/lib/coord/geo/fix/nanhai.js", "../../../node_modules/echarts/lib/coord/geo/fix/textCoord.js", "../../../node_modules/echarts/lib/coord/geo/fix/diaoyuIsland.js", "../../../node_modules/echarts/lib/coord/geo/GeoJSONResource.js", "../../../node_modules/echarts/lib/coord/geo/geoSourceManager.js", "../../../node_modules/echarts/lib/component/helper/MapDraw.js", "../../../node_modules/echarts/lib/chart/map/MapView.js", "../../../node_modules/echarts/lib/chart/map/MapSeries.js", "../../../node_modules/echarts/lib/chart/map/mapDataStatistic.js", "../../../node_modules/echarts/lib/chart/map/mapSymbolLayout.js", "../../../node_modules/echarts/lib/coord/View.js", "../../../node_modules/echarts/lib/coord/geo/Geo.js", "../../../node_modules/echarts/lib/coord/geo/geoCreator.js", "../../../node_modules/echarts/lib/coord/geo/GeoModel.js", "../../../node_modules/echarts/lib/component/geo/GeoView.js", "../../../node_modules/echarts/lib/component/geo/install.js", "../../../node_modules/echarts/lib/chart/map/install.js", "../../../node_modules/echarts/lib/chart/tree/layoutHelper.js", "../../../node_modules/echarts/lib/chart/tree/TreeView.js", "../../../node_modules/echarts/lib/data/helper/linkSeriesData.js", "../../../node_modules/echarts/lib/data/Tree.js", "../../../node_modules/echarts/lib/chart/helper/treeHelper.js", "../../../node_modules/echarts/lib/chart/tree/TreeSeries.js", "../../../node_modules/echarts/lib/chart/tree/traversalHelper.js", "../../../node_modules/echarts/lib/chart/tree/treeLayout.js", "../../../node_modules/echarts/lib/chart/tree/treeVisual.js", "../../../node_modules/echarts/lib/chart/tree/treeAction.js", "../../../node_modules/echarts/lib/chart/tree/install.js", "../../../node_modules/echarts/lib/chart/treemap/treemapAction.js", "../../../node_modules/echarts/lib/chart/helper/enableAriaDecalForTree.js", "../../../node_modules/echarts/lib/chart/treemap/TreemapSeries.js", "../../../node_modules/echarts/lib/chart/treemap/Breadcrumb.js", "../../../node_modules/echarts/lib/util/animation.js", "../../../node_modules/echarts/lib/chart/treemap/TreemapView.js", "../../../node_modules/echarts/lib/visual/VisualMapping.js", "../../../node_modules/echarts/lib/chart/treemap/treemapVisual.js", "../../../node_modules/echarts/lib/chart/treemap/treemapLayout.js", "../../../node_modules/echarts/lib/chart/treemap/install.js", "../../../node_modules/echarts/lib/chart/graph/categoryFilter.js", "../../../node_modules/echarts/lib/chart/graph/categoryVisual.js", "../../../node_modules/echarts/lib/chart/graph/edgeVisual.js", "../../../node_modules/echarts/lib/chart/helper/multipleGraphEdgeHelper.js", "../../../node_modules/echarts/lib/chart/graph/simpleLayoutHelper.js", "../../../node_modules/echarts/lib/chart/graph/simpleLayout.js", "../../../node_modules/echarts/lib/chart/graph/graphHelper.js", "../../../node_modules/echarts/lib/chart/graph/circularLayoutHelper.js", "../../../node_modules/echarts/lib/chart/graph/circularLayout.js", "../../../node_modules/echarts/lib/chart/graph/forceHelper.js", "../../../node_modules/echarts/lib/chart/graph/forceLayout.js", "../../../node_modules/echarts/lib/chart/graph/createView.js", "../../../node_modules/echarts/lib/chart/helper/LinePath.js", "../../../node_modules/echarts/lib/chart/helper/Line.js", "../../../node_modules/echarts/lib/chart/helper/LineDraw.js", "../../../node_modules/echarts/lib/chart/graph/adjustEdge.js", "../../../node_modules/echarts/lib/component/helper/thumbnailBridge.js", "../../../node_modules/echarts/lib/chart/graph/GraphView.js", "../../../node_modules/echarts/lib/data/Graph.js", "../../../node_modules/echarts/lib/chart/helper/createGraphFromNodeEdge.js", "../../../node_modules/echarts/lib/chart/graph/GraphSeries.js", "../../../node_modules/echarts/lib/chart/graph/install.js", "../../../node_modules/echarts/lib/chart/chord/ChordPiece.js", "../../../node_modules/echarts/lib/chart/chord/ChordEdge.js", "../../../node_modules/echarts/lib/chart/chord/ChordView.js", "../../../node_modules/echarts/lib/chart/chord/ChordSeries.js", "../../../node_modules/echarts/lib/chart/chord/chordLayout.js", "../../../node_modules/echarts/lib/chart/chord/install.js", "../../../node_modules/echarts/lib/chart/gauge/PointerPath.js", "../../../node_modules/echarts/lib/chart/gauge/GaugeView.js", "../../../node_modules/echarts/lib/chart/gauge/GaugeSeries.js", "../../../node_modules/echarts/lib/chart/gauge/install.js", "../../../node_modules/echarts/lib/chart/funnel/FunnelView.js", "../../../node_modules/echarts/lib/chart/funnel/FunnelSeries.js", "../../../node_modules/echarts/lib/chart/funnel/funnelLayout.js", "../../../node_modules/echarts/lib/chart/funnel/install.js", "../../../node_modules/echarts/lib/chart/parallel/ParallelView.js", "../../../node_modules/echarts/lib/chart/parallel/ParallelSeries.js", "../../../node_modules/echarts/lib/chart/parallel/parallelVisual.js", "../../../node_modules/echarts/lib/coord/parallel/parallelPreprocessor.js", "../../../node_modules/echarts/lib/component/parallel/ParallelView.js", "../../../node_modules/echarts/lib/coord/parallel/ParallelModel.js", "../../../node_modules/echarts/lib/coord/parallel/ParallelAxis.js", "../../../node_modules/echarts/lib/component/helper/sliderMove.js", "../../../node_modules/echarts/lib/coord/parallel/Parallel.js", "../../../node_modules/echarts/lib/coord/parallel/parallelCreator.js", "../../../node_modules/echarts/lib/coord/parallel/AxisModel.js", "../../../node_modules/echarts/lib/component/helper/BrushController.js", "../../../node_modules/echarts/lib/component/helper/brushHelper.js", "../../../node_modules/echarts/lib/component/axis/ParallelAxisView.js", "../../../node_modules/echarts/lib/component/axis/parallelAxisAction.js", "../../../node_modules/echarts/lib/component/parallel/install.js", "../../../node_modules/echarts/lib/chart/parallel/install.js", "../../../node_modules/echarts/lib/chart/sankey/SankeyView.js", "../../../node_modules/echarts/lib/chart/sankey/SankeySeries.js", "../../../node_modules/echarts/lib/chart/sankey/sankeyLayout.js", "../../../node_modules/echarts/lib/chart/sankey/sankeyVisual.js", "../../../node_modules/echarts/lib/chart/sankey/install.js", "../../../node_modules/echarts/lib/chart/helper/whiskerBoxCommon.js", "../../../node_modules/echarts/lib/chart/boxplot/BoxplotSeries.js", "../../../node_modules/echarts/lib/chart/boxplot/BoxplotView.js", "../../../node_modules/echarts/lib/chart/boxplot/boxplotLayout.js", "../../../node_modules/echarts/lib/chart/boxplot/prepareBoxplotData.js", "../../../node_modules/echarts/lib/chart/boxplot/boxplotTransform.js", "../../../node_modules/echarts/lib/chart/boxplot/install.js", "../../../node_modules/echarts/lib/chart/candlestick/candlestickVisual.js", "../../../node_modules/echarts/lib/chart/candlestick/CandlestickView.js", "../../../node_modules/echarts/lib/chart/candlestick/CandlestickSeries.js", "../../../node_modules/echarts/lib/chart/candlestick/preprocessor.js", "../../../node_modules/echarts/lib/chart/candlestick/candlestickLayout.js", "../../../node_modules/echarts/lib/chart/candlestick/install.js", "../../../node_modules/echarts/lib/chart/helper/EffectSymbol.js", "../../../node_modules/echarts/lib/chart/effectScatter/EffectScatterView.js", "../../../node_modules/echarts/lib/chart/effectScatter/EffectScatterSeries.js", "../../../node_modules/echarts/lib/chart/effectScatter/install.js", "../../../node_modules/echarts/lib/chart/helper/EffectLine.js", "../../../node_modules/echarts/lib/chart/helper/Polyline.js", "../../../node_modules/echarts/lib/chart/helper/EffectPolyline.js", "../../../node_modules/echarts/lib/chart/helper/LargeLineDraw.js", "../../../node_modules/echarts/lib/chart/lines/linesLayout.js", "../../../node_modules/echarts/lib/chart/lines/LinesView.js", "../../../node_modules/echarts/lib/chart/lines/LinesSeries.js", "../../../node_modules/echarts/lib/chart/lines/linesVisual.js", "../../../node_modules/echarts/lib/chart/lines/install.js", "../../../node_modules/echarts/lib/chart/heatmap/HeatmapLayer.js", "../../../node_modules/echarts/lib/chart/heatmap/HeatmapView.js", "../../../node_modules/echarts/lib/chart/heatmap/HeatmapSeries.js", "../../../node_modules/echarts/lib/chart/heatmap/install.js", "../../../node_modules/echarts/lib/chart/bar/PictorialBarView.js", "../../../node_modules/echarts/lib/chart/bar/PictorialBarSeries.js", "../../../node_modules/echarts/lib/chart/bar/installPictorialBar.js", "../../../node_modules/echarts/lib/chart/themeRiver/ThemeRiverView.js", "../../../node_modules/echarts/lib/chart/themeRiver/ThemeRiverSeries.js", "../../../node_modules/echarts/lib/chart/themeRiver/themeRiverLayout.js", "../../../node_modules/echarts/lib/chart/themeRiver/install.js", "../../../node_modules/echarts/lib/chart/sunburst/SunburstPiece.js", "../../../node_modules/echarts/lib/chart/sunburst/sunburstAction.js", "../../../node_modules/echarts/lib/chart/sunburst/SunburstView.js", "../../../node_modules/echarts/lib/chart/sunburst/SunburstSeries.js", "../../../node_modules/echarts/lib/chart/sunburst/sunburstLayout.js", "../../../node_modules/echarts/lib/chart/sunburst/sunburstVisual.js", "../../../node_modules/echarts/lib/chart/sunburst/install.js", "../../../node_modules/echarts/lib/chart/custom/CustomSeries.js", "../../../node_modules/echarts/lib/coord/cartesian/prepareCustom.js", "../../../node_modules/echarts/lib/coord/geo/prepareCustom.js", "../../../node_modules/echarts/lib/coord/single/prepareCustom.js", "../../../node_modules/echarts/lib/coord/polar/prepareCustom.js", "../../../node_modules/echarts/lib/coord/calendar/prepareCustom.js", "../../../node_modules/echarts/lib/coord/matrix/prepareCustom.js", "../../../node_modules/echarts/lib/util/styleCompat.js", "../../../node_modules/echarts/lib/animation/customGraphicTransition.js", "../../../node_modules/echarts/lib/animation/customGraphicKeyframeAnimation.js", "../../../node_modules/echarts/lib/chart/custom/CustomView.js", "../../../node_modules/echarts/lib/chart/custom/install.js", "../../../node_modules/echarts/lib/component/axisPointer/BaseAxisPointer.js", "../../../node_modules/echarts/lib/component/axisPointer/viewHelper.js", "../../../node_modules/echarts/lib/component/axisPointer/CartesianAxisPointer.js", "../../../node_modules/echarts/lib/component/axisPointer/AxisPointerModel.js", "../../../node_modules/echarts/lib/component/axisPointer/globalListener.js", "../../../node_modules/echarts/lib/component/axisPointer/AxisPointerView.js", "../../../node_modules/echarts/lib/component/axisPointer/findPointFromSeries.js", "../../../node_modules/echarts/lib/component/axisPointer/axisTrigger.js", "../../../node_modules/echarts/lib/component/axisPointer/install.js", "../../../node_modules/echarts/lib/component/grid/install.js", "../../../node_modules/echarts/lib/component/axisPointer/PolarAxisPointer.js", "../../../node_modules/echarts/lib/coord/polar/PolarModel.js", "../../../node_modules/echarts/lib/coord/polar/AxisModel.js", "../../../node_modules/echarts/lib/coord/polar/RadiusAxis.js", "../../../node_modules/echarts/lib/coord/polar/AngleAxis.js", "../../../node_modules/echarts/lib/coord/polar/Polar.js", "../../../node_modules/echarts/lib/coord/polar/polarCreator.js", "../../../node_modules/echarts/lib/component/axis/AngleAxisView.js", "../../../node_modules/echarts/lib/component/axis/RadiusAxisView.js", "../../../node_modules/echarts/lib/layout/barPolar.js", "../../../node_modules/echarts/lib/component/polar/install.js", "../../../node_modules/echarts/lib/coord/single/singleAxisHelper.js", "../../../node_modules/echarts/lib/component/axis/SingleAxisView.js", "../../../node_modules/echarts/lib/coord/single/AxisModel.js", "../../../node_modules/echarts/lib/coord/single/SingleAxis.js", "../../../node_modules/echarts/lib/coord/single/Single.js", "../../../node_modules/echarts/lib/coord/single/singleCreator.js", "../../../node_modules/echarts/lib/component/axisPointer/SingleAxisPointer.js", "../../../node_modules/echarts/lib/component/singleAxis/install.js", "../../../node_modules/echarts/lib/coord/calendar/CalendarModel.js", "../../../node_modules/echarts/lib/component/calendar/CalendarView.js", "../../../node_modules/echarts/lib/coord/calendar/Calendar.js", "../../../node_modules/echarts/lib/component/calendar/install.js", "../../../node_modules/echarts/lib/coord/matrix/matrixCoordHelper.js", "../../../node_modules/echarts/lib/coord/matrix/MatrixDim.js", "../../../node_modules/echarts/lib/coord/matrix/MatrixBodyCorner.js", "../../../node_modules/echarts/lib/coord/matrix/MatrixModel.js", "../../../node_modules/echarts/lib/component/matrix/MatrixView.js", "../../../node_modules/echarts/lib/coord/matrix/Matrix.js", "../../../node_modules/echarts/lib/component/matrix/install.js", "../../../node_modules/echarts/lib/component/graphic/GraphicModel.js", "../../../node_modules/echarts/lib/component/graphic/GraphicView.js", "../../../node_modules/echarts/lib/component/graphic/install.js", "../../../node_modules/echarts/lib/component/dataZoom/helper.js", "../../../node_modules/echarts/lib/component/dataZoom/DataZoomModel.js", "../../../node_modules/echarts/lib/component/dataZoom/SelectZoomModel.js", "../../../node_modules/echarts/lib/component/dataZoom/DataZoomView.js", "../../../node_modules/echarts/lib/component/dataZoom/SelectZoomView.js", "../../../node_modules/echarts/lib/component/dataZoom/AxisProxy.js", "../../../node_modules/echarts/lib/component/dataZoom/dataZoomProcessor.js", "../../../node_modules/echarts/lib/component/dataZoom/dataZoomAction.js", "../../../node_modules/echarts/lib/component/dataZoom/installCommon.js", "../../../node_modules/echarts/lib/component/dataZoom/installDataZoomSelect.js", "../../../node_modules/echarts/lib/component/toolbox/featureManager.js", "../../../node_modules/echarts/lib/component/toolbox/ToolboxModel.js", "../../../node_modules/echarts/lib/component/helper/listComponent.js", "../../../node_modules/echarts/lib/component/toolbox/ToolboxView.js", "../../../node_modules/echarts/lib/component/toolbox/feature/SaveAsImage.js", "../../../node_modules/echarts/lib/component/toolbox/feature/MagicType.js", "../../../node_modules/echarts/lib/component/toolbox/feature/DataView.js", "../../../node_modules/echarts/lib/component/dataZoom/history.js", "../../../node_modules/echarts/lib/component/toolbox/feature/Restore.js", "../../../node_modules/echarts/lib/component/helper/BrushTargetManager.js", "../../../node_modules/echarts/lib/component/toolbox/feature/DataZoom.js", "../../../node_modules/echarts/lib/component/toolbox/install.js", "../../../node_modules/echarts/lib/component/tooltip/TooltipModel.js", "../../../node_modules/echarts/lib/component/tooltip/helper.js", "../../../node_modules/echarts/lib/component/tooltip/TooltipHTMLContent.js", "../../../node_modules/echarts/lib/component/tooltip/TooltipRichContent.js", "../../../node_modules/echarts/lib/component/tooltip/TooltipView.js", "../../../node_modules/echarts/lib/component/tooltip/install.js", "../../../node_modules/echarts/lib/component/brush/preprocessor.js", "../../../node_modules/echarts/lib/visual/visualSolution.js", "../../../node_modules/echarts/lib/component/brush/selector.js", "../../../node_modules/echarts/lib/component/brush/visualEncoding.js", "../../../node_modules/echarts/lib/component/brush/BrushView.js", "../../../node_modules/echarts/lib/component/brush/BrushModel.js", "../../../node_modules/echarts/lib/component/toolbox/feature/Brush.js", "../../../node_modules/echarts/lib/component/brush/install.js", "../../../node_modules/echarts/lib/component/title/install.js", "../../../node_modules/echarts/lib/component/timeline/TimelineModel.js", "../../../node_modules/echarts/lib/component/timeline/SliderTimelineModel.js", "../../../node_modules/echarts/lib/component/timeline/TimelineView.js", "../../../node_modules/echarts/lib/component/timeline/TimelineAxis.js", "../../../node_modules/echarts/lib/component/timeline/SliderTimelineView.js", "../../../node_modules/echarts/lib/component/timeline/timelineAction.js", "../../../node_modules/echarts/lib/component/timeline/preprocessor.js", "../../../node_modules/echarts/lib/component/timeline/install.js", "../../../node_modules/echarts/lib/component/marker/checkMarkerInSeries.js", "../../../node_modules/echarts/lib/component/marker/MarkerModel.js", "../../../node_modules/echarts/lib/component/marker/MarkPointModel.js", "../../../node_modules/echarts/lib/component/marker/markerHelper.js", "../../../node_modules/echarts/lib/component/marker/MarkerView.js", "../../../node_modules/echarts/lib/component/marker/MarkPointView.js", "../../../node_modules/echarts/lib/component/marker/installMarkPoint.js", "../../../node_modules/echarts/lib/component/marker/MarkLineModel.js", "../../../node_modules/echarts/lib/component/marker/MarkLineView.js", "../../../node_modules/echarts/lib/component/marker/installMarkLine.js", "../../../node_modules/echarts/lib/component/marker/MarkAreaModel.js", "../../../node_modules/echarts/lib/component/marker/MarkAreaView.js", "../../../node_modules/echarts/lib/component/marker/installMarkArea.js", "../../../node_modules/echarts/lib/component/legend/LegendModel.js", "../../../node_modules/echarts/lib/component/legend/LegendView.js", "../../../node_modules/echarts/lib/component/legend/legendFilter.js", "../../../node_modules/echarts/lib/component/legend/legendAction.js", "../../../node_modules/echarts/lib/component/legend/installLegendPlain.js", "../../../node_modules/echarts/lib/component/legend/ScrollableLegendModel.js", "../../../node_modules/echarts/lib/component/legend/ScrollableLegendView.js", "../../../node_modules/echarts/lib/component/legend/scrollableLegendAction.js", "../../../node_modules/echarts/lib/component/legend/installLegendScroll.js", "../../../node_modules/echarts/lib/component/legend/install.js", "../../../node_modules/echarts/lib/component/dataZoom/InsideZoomModel.js", "../../../node_modules/echarts/lib/component/dataZoom/roams.js", "../../../node_modules/echarts/lib/component/dataZoom/InsideZoomView.js", "../../../node_modules/echarts/lib/component/dataZoom/installDataZoomInside.js", "../../../node_modules/echarts/lib/component/dataZoom/SliderZoomModel.js", "../../../node_modules/echarts/lib/component/dataZoom/SliderZoomView.js", "../../../node_modules/echarts/lib/component/dataZoom/installDataZoomSlider.js", "../../../node_modules/echarts/lib/component/dataZoom/install.js", "../../../node_modules/echarts/lib/visual/visualDefault.js", "../../../node_modules/echarts/lib/component/visualMap/VisualMapModel.js", "../../../node_modules/echarts/lib/component/visualMap/ContinuousModel.js", "../../../node_modules/echarts/lib/component/visualMap/VisualMapView.js", "../../../node_modules/echarts/lib/component/visualMap/helper.js", "../../../node_modules/echarts/lib/component/visualMap/ContinuousView.js", "../../../node_modules/echarts/lib/component/visualMap/visualMapAction.js", "../../../node_modules/echarts/lib/component/visualMap/visualEncoding.js", "../../../node_modules/echarts/lib/component/visualMap/preprocessor.js", "../../../node_modules/echarts/lib/component/visualMap/installCommon.js", "../../../node_modules/echarts/lib/component/visualMap/installVisualMapContinuous.js", "../../../node_modules/echarts/lib/component/visualMap/PiecewiseModel.js", "../../../node_modules/echarts/lib/component/visualMap/PiecewiseView.js", "../../../node_modules/echarts/lib/component/visualMap/installVisualMapPiecewise.js", "../../../node_modules/echarts/lib/component/visualMap/install.js", "../../../node_modules/echarts/lib/component/thumbnail/ThumbnailBridgeImpl.js", "../../../node_modules/echarts/lib/component/thumbnail/ThumbnailModel.js", "../../../node_modules/echarts/lib/component/thumbnail/ThumbnailView.js", "../../../node_modules/echarts/lib/component/thumbnail/install.js", "../../../node_modules/echarts/lib/visual/aria.js", "../../../node_modules/echarts/lib/component/aria/preprocessor.js", "../../../node_modules/echarts/lib/component/aria/install.js", "../../../node_modules/echarts/lib/util/conditionalExpression.js", "../../../node_modules/echarts/lib/component/transform/filterTransform.js", "../../../node_modules/echarts/lib/component/transform/sortTransform.js", "../../../node_modules/echarts/lib/component/transform/install.js", "../../../node_modules/echarts/lib/component/dataset/install.js", "../../../node_modules/zrender/lib/svg/SVGPathRebuilder.js", "../../../node_modules/zrender/lib/svg/mapStyleToAttrs.js", "../../../node_modules/zrender/lib/svg/core.js", "../../../node_modules/zrender/lib/svg/cssClassId.js", "../../../node_modules/zrender/lib/svg/cssAnimation.js", "../../../node_modules/zrender/lib/svg/cssEmphasis.js", "../../../node_modules/zrender/lib/svg/graphic.js", "../../../node_modules/zrender/lib/svg/domapi.js", "../../../node_modules/zrender/lib/svg/patch.js", "../../../node_modules/zrender/lib/svg/Painter.js", "../../../node_modules/echarts/lib/renderer/installSVGRenderer.js", "../../../node_modules/zrender/lib/canvas/Layer.js", "../../../node_modules/zrender/lib/canvas/Painter.js", "../../../node_modules/echarts/lib/renderer/installCanvasRenderer.js", "../../javascript/custom/chart_colors.js", "../../javascript/controllers/echarts_chart_controller.js", "../../javascript/controllers/simple_echarts_chart_controller.js", "../../javascript/controllers/index.js", "../../../node_modules/@popperjs/core/lib/index.js", "../../../node_modules/@popperjs/core/lib/enums.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getNodeName.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getWindow.js", "../../../node_modules/@popperjs/core/lib/dom-utils/instanceOf.js", "../../../node_modules/@popperjs/core/lib/modifiers/applyStyles.js", "../../../node_modules/@popperjs/core/lib/utils/getBasePlacement.js", "../../../node_modules/@popperjs/core/lib/utils/math.js", "../../../node_modules/@popperjs/core/lib/utils/userAgent.js", "../../../node_modules/@popperjs/core/lib/dom-utils/isLayoutViewport.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js", "../../../node_modules/@popperjs/core/lib/dom-utils/contains.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js", "../../../node_modules/@popperjs/core/lib/dom-utils/isTableElement.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getParentNode.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js", "../../../node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js", "../../../node_modules/@popperjs/core/lib/utils/within.js", "../../../node_modules/@popperjs/core/lib/utils/getFreshSideObject.js", "../../../node_modules/@popperjs/core/lib/utils/mergePaddingObject.js", "../../../node_modules/@popperjs/core/lib/utils/expandToHashMap.js", "../../../node_modules/@popperjs/core/lib/modifiers/arrow.js", "../../../node_modules/@popperjs/core/lib/utils/getVariation.js", "../../../node_modules/@popperjs/core/lib/modifiers/computeStyles.js", "../../../node_modules/@popperjs/core/lib/modifiers/eventListeners.js", "../../../node_modules/@popperjs/core/lib/utils/getOppositePlacement.js", "../../../node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js", "../../../node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js", "../../../node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js", "../../../node_modules/@popperjs/core/lib/utils/rectToClientRect.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js", "../../../node_modules/@popperjs/core/lib/utils/computeOffsets.js", "../../../node_modules/@popperjs/core/lib/utils/detectOverflow.js", "../../../node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js", "../../../node_modules/@popperjs/core/lib/modifiers/flip.js", "../../../node_modules/@popperjs/core/lib/modifiers/hide.js", "../../../node_modules/@popperjs/core/lib/modifiers/offset.js", "../../../node_modules/@popperjs/core/lib/modifiers/popperOffsets.js", "../../../node_modules/@popperjs/core/lib/utils/getAltAxis.js", "../../../node_modules/@popperjs/core/lib/modifiers/preventOverflow.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js", "../../../node_modules/@popperjs/core/lib/utils/orderModifiers.js", "../../../node_modules/@popperjs/core/lib/utils/debounce.js", "../../../node_modules/@popperjs/core/lib/utils/mergeByName.js", "../../../node_modules/@popperjs/core/lib/createPopper.js", "../../../node_modules/@popperjs/core/lib/popper-lite.js", "../../../node_modules/@popperjs/core/lib/popper.js", "../../../node_modules/bootstrap/js/src/dom/data.js", "../../../node_modules/bootstrap/js/src/util/index.js", "../../../node_modules/bootstrap/js/src/dom/event-handler.js", "../../../node_modules/bootstrap/js/src/dom/manipulator.js", "../../../node_modules/bootstrap/js/src/util/config.js", "../../../node_modules/bootstrap/js/src/base-component.js", "../../../node_modules/bootstrap/js/src/dom/selector-engine.js", "../../../node_modules/bootstrap/js/src/util/component-functions.js", "../../../node_modules/bootstrap/js/src/alert.js", "../../../node_modules/bootstrap/js/src/button.js", "../../../node_modules/bootstrap/js/src/util/swipe.js", "../../../node_modules/bootstrap/js/src/carousel.js", "../../../node_modules/bootstrap/js/src/collapse.js", "../../../node_modules/bootstrap/js/src/dropdown.js", "../../../node_modules/bootstrap/js/src/util/backdrop.js", "../../../node_modules/bootstrap/js/src/util/focustrap.js", "../../../node_modules/bootstrap/js/src/util/scrollbar.js", "../../../node_modules/bootstrap/js/src/modal.js", "../../../node_modules/bootstrap/js/src/offcanvas.js", "../../../node_modules/bootstrap/js/src/util/sanitizer.js", "../../../node_modules/bootstrap/js/src/util/template-factory.js", "../../../node_modules/bootstrap/js/src/tooltip.js", "../../../node_modules/bootstrap/js/src/popover.js", "../../../node_modules/bootstrap/js/src/scrollspy.js", "../../../node_modules/bootstrap/js/src/tab.js", "../../../node_modules/bootstrap/js/src/toast.js", "../../../node_modules/echarts/index.js", "../../../node_modules/zrender/lib/tool/convertPath.js", "../../../node_modules/zrender/lib/tool/dividePath.js", "../../../node_modules/zrender/lib/tool/morphPath.js", "../../../node_modules/echarts/lib/animation/morphTransitionHelper.js", "../../../node_modules/echarts/lib/animation/universalTransition.js", "../../../node_modules/echarts/lib/scale/breakImpl.js", "../../../node_modules/echarts/lib/component/axis/axisBreakHelperImpl.js", "../../../node_modules/echarts/lib/component/axis/installBreak.js", "../../../node_modules/echarts/lib/coord/cartesian/legacyContainLabel.js", "../../javascript/application.js", "../../javascript/custom/add_jquery.js", "../../javascript/falcon/utils.js", "../../javascript/falcon/navbar-vertical.js", "../../javascript/falcon/detector.js", "../../javascript/falcon/tooltip.js", "../../javascript/falcon/popover.js", "../../javascript/falcon/navbar-top.js", "../../javascript/falcon/toast.js", "../../javascript/falcon/progress.js", "../../javascript/falcon/glightbox.js", "../../javascript/falcon/plyr.js", "../../javascript/falcon/googleMap.js", "../../javascript/falcon/dropzone.js", "../../javascript/falcon/choices.js", "../../javascript/falcon/charts/chartjs/chartjs-utils.js", "../../javascript/falcon/charts/chartjs/chart-bar.js", "../../javascript/falcon/form-validation.js", "../../javascript/falcon/leaflet-active-user.js", "../../javascript/falcon/countup.js", "../../javascript/falcon/copy-link.js", "../../javascript/falcon/typed.js", "../../javascript/falcon/navbar-darken-on-scroll.js", "../../javascript/falcon/scroll-to-top.js", "../../javascript/falcon/tinymce.js", "../../javascript/falcon/node.js", "../../javascript/falcon/bulk-select.js", "../../javascript/falcon/quantity.js", "../../javascript/falcon/navbar-combo.js", "../../javascript/falcon/list.js", "../../javascript/falcon/chat.js", "../../javascript/falcon/draggable.js", "../../javascript/falcon/kanban.js", "../../javascript/falcon/wizard.js", "../../javascript/falcon/swiper.js", "../../javascript/falcon/rater.js", "../../javascript/falcon/search.js", "../../javascript/falcon/cookie-notice.js", "../../javascript/falcon/config.js", "../../javascript/falcon/theme-control.js", "../../javascript/falcon/dropdown-on-hover.js", "../../javascript/falcon/charts/chartjs/product-share-doughnut.js", "../../javascript/falcon/charts/echarts/echarts-utils.js", "../../javascript/falcon/charts/echarts/total-sales-ecommerce.js", "../../javascript/falcon/charts/echarts/sales-by-pos-location.js", "../../javascript/falcon/charts/echarts/returning-customer-rate.js", "../../javascript/falcon/charts/echarts/top-products.js", "../../javascript/falcon/charts/echarts/market-share-ecommerce.js", "../../javascript/falcon/charts/echarts/total-sales.js", "../../javascript/falcon/charts/echarts/weekly-sales.js", "../../javascript/falcon/charts/echarts/market-share.js", "../../javascript/falcon/charts/echarts/total-order.js", "../../javascript/falcon/charts/echarts/candle-chart.js", "../../javascript/falcon/charts/echarts/gross-revenue.js", "../../javascript/falcon/scrollbar.js", "../../javascript/falcon/icons.js", "../../javascript/falcon/charts/echarts/report-for-this-week.js", "../../javascript/falcon/charts/echarts/basic-echarts.js", "../../javascript/falcon/charts/chartjs/chart-scatter.js", "../../javascript/falcon/charts/chartjs/chart-doughnut.js", "../../javascript/falcon/charts/chartjs/chart-pie.js", "../../javascript/falcon/charts/chartjs/chart-polar.js", "../../javascript/falcon/charts/chartjs/chart-radar.js", "../../javascript/falcon/charts/chartjs/chart-combo.js", "../../javascript/falcon/charts/chartjs/chart-bubble.js", "../../javascript/falcon/dropdown-menu.js", "../../javascript/falcon/charts/echarts/audience.js", "../../javascript/falcon/charts/echarts/session-by-browser.js", "../../javascript/falcon/charts/echarts/session-by-country.js", "../../javascript/falcon/charts/echarts/active-users-report.js", "../../javascript/falcon/charts/echarts/traffic-channels.js", "../../javascript/falcon/charts/echarts/bounce-rate.js", "../../javascript/falcon/charts/echarts/users-by-time.js", "../../javascript/falcon/charts/echarts/session-by-country-map.js", "../../javascript/falcon/charts/echarts/most-leads.js", "../../javascript/falcon/charts/echarts/closed-vs-goal.js", "../../javascript/falcon/charts/echarts/lead-conversion.js", "../../javascript/falcon/charts/echarts/deal-storage-funnel.js", "../../javascript/falcon/charts/echarts/crm-revenue.js", "../../javascript/falcon/charts/echarts/location-by-session-crm.js", "../../javascript/falcon/charts/echarts/real-time-users.js", "../../javascript/falcon/charts/echarts/line-payment.js", "../../javascript/falcon/charts/chartjs/chart-line.js", "../../javascript/falcon/charts/echarts/bandwidth-saved.js", "../../javascript/falcon/treeview.js", "../../javascript/falcon/scroll.js", "../../javascript/falcon/theme.js", "../../javascript/custom/general_jquery.js", "../../javascript/custom/vincoli_jquery.js", "../../javascript/custom/catasto_jquery.js", "../../javascript/jquery/flexdatalist/jquery.flexdatalist.min.js"],
  "sourcesContent": ["export default {\n  logger: typeof console !== \"undefined\" ? console : undefined,\n  WebSocket: typeof WebSocket !== \"undefined\" ? WebSocket : undefined,\n}\n", "import adapters from \"./adapters\"\n\n// The logger is disabled by default. You can enable it with:\n//\n//   ActionCable.logger.enabled = true\n//\n//   Example:\n//\n//   import * as ActionCable from '@rails/actioncable'\n//\n//   ActionCable.logger.enabled = true\n//   ActionCable.logger.log('Connection Established.')\n//\n\nexport default {\n  log(...messages) {\n    if (this.enabled) {\n      messages.push(Date.now())\n      adapters.logger.log(\"[ActionCable]\", ...messages)\n    }\n  },\n}\n", "import logger from \"./logger\"\n\n// Responsible for ensuring the cable connection is in good health by validating the heartbeat pings sent from the server, and attempting\n// revival reconnections if things go astray. Internal class, not intended for direct user manipulation.\n\nconst now = () => new Date().getTime()\n\nconst secondsSince = time => (now() - time) / 1000\n\nclass ConnectionMonitor {\n  constructor(connection) {\n    this.visibilityDidChange = this.visibilityDidChange.bind(this)\n    this.connection = connection\n    this.reconnectAttempts = 0\n  }\n\n  start() {\n    if (!this.isRunning()) {\n      this.startedAt = now()\n      delete this.stoppedAt\n      this.startPolling()\n      addEventListener(\"visibilitychange\", this.visibilityDidChange)\n      logger.log(`ConnectionMonitor started. stale threshold = ${this.constructor.staleThreshold} s`)\n    }\n  }\n\n  stop() {\n    if (this.isRunning()) {\n      this.stoppedAt = now()\n      this.stopPolling()\n      removeEventListener(\"visibilitychange\", this.visibilityDidChange)\n      logger.log(\"ConnectionMonitor stopped\")\n    }\n  }\n\n  isRunning() {\n    return this.startedAt && !this.stoppedAt\n  }\n\n  recordMessage() {\n    this.pingedAt = now()\n  }\n\n  recordConnect() {\n    this.reconnectAttempts = 0\n    delete this.disconnectedAt\n    logger.log(\"ConnectionMonitor recorded connect\")\n  }\n\n  recordDisconnect() {\n    this.disconnectedAt = now()\n    logger.log(\"ConnectionMonitor recorded disconnect\")\n  }\n\n  // Private\n\n  startPolling() {\n    this.stopPolling()\n    this.poll()\n  }\n\n  stopPolling() {\n    clearTimeout(this.pollTimeout)\n  }\n\n  poll() {\n    this.pollTimeout = setTimeout(() => {\n      this.reconnectIfStale()\n      this.poll()\n    }\n    , this.getPollInterval())\n  }\n\n  getPollInterval() {\n    const { staleThreshold, reconnectionBackoffRate } = this.constructor\n    const backoff = Math.pow(1 + reconnectionBackoffRate, Math.min(this.reconnectAttempts, 10))\n    const jitterMax = this.reconnectAttempts === 0 ? 1.0 : reconnectionBackoffRate\n    const jitter = jitterMax * Math.random()\n    return staleThreshold * 1000 * backoff * (1 + jitter)\n  }\n\n  reconnectIfStale() {\n    if (this.connectionIsStale()) {\n      logger.log(`ConnectionMonitor detected stale connection. reconnectAttempts = ${this.reconnectAttempts}, time stale = ${secondsSince(this.refreshedAt)} s, stale threshold = ${this.constructor.staleThreshold} s`)\n      this.reconnectAttempts++\n      if (this.disconnectedRecently()) {\n        logger.log(`ConnectionMonitor skipping reopening recent disconnect. time disconnected = ${secondsSince(this.disconnectedAt)} s`)\n      } else {\n        logger.log(\"ConnectionMonitor reopening\")\n        this.connection.reopen()\n      }\n    }\n  }\n\n  get refreshedAt() {\n    return this.pingedAt ? this.pingedAt : this.startedAt\n  }\n\n  connectionIsStale() {\n    return secondsSince(this.refreshedAt) > this.constructor.staleThreshold\n  }\n\n  disconnectedRecently() {\n    return this.disconnectedAt && (secondsSince(this.disconnectedAt) < this.constructor.staleThreshold)\n  }\n\n  visibilityDidChange() {\n    if (document.visibilityState === \"visible\") {\n      setTimeout(() => {\n        if (this.connectionIsStale() || !this.connection.isOpen()) {\n          logger.log(`ConnectionMonitor reopening stale connection on visibilitychange. visibilityState = ${document.visibilityState}`)\n          this.connection.reopen()\n        }\n      }\n      , 200)\n    }\n  }\n\n}\n\nConnectionMonitor.staleThreshold = 6 // Server::Connections::BEAT_INTERVAL * 2 (missed two pings)\nConnectionMonitor.reconnectionBackoffRate = 0.15\n\nexport default ConnectionMonitor\n", "export default {\n  \"message_types\": {\n    \"welcome\": \"welcome\",\n    \"disconnect\": \"disconnect\",\n    \"ping\": \"ping\",\n    \"confirmation\": \"confirm_subscription\",\n    \"rejection\": \"reject_subscription\"\n  },\n  \"disconnect_reasons\": {\n    \"unauthorized\": \"unauthorized\",\n    \"invalid_request\": \"invalid_request\",\n    \"server_restart\": \"server_restart\",\n    \"remote\": \"remote\"\n  },\n  \"default_mount_path\": \"/cable\",\n  \"protocols\": [\n    \"actioncable-v1-json\",\n    \"actioncable-unsupported\"\n  ]\n}\n", "import adapters from \"./adapters\"\nimport ConnectionMonitor from \"./connection_monitor\"\nimport INTERNAL from \"./internal\"\nimport logger from \"./logger\"\n\n// Encapsulate the cable connection held by the consumer. This is an internal class not intended for direct user manipulation.\n\nconst {message_types, protocols} = INTERNAL\nconst supportedProtocols = protocols.slice(0, protocols.length - 1)\n\nconst indexOf = [].indexOf\n\nclass Connection {\n  constructor(consumer) {\n    this.open = this.open.bind(this)\n    this.consumer = consumer\n    this.subscriptions = this.consumer.subscriptions\n    this.monitor = new ConnectionMonitor(this)\n    this.disconnected = true\n  }\n\n  send(data) {\n    if (this.isOpen()) {\n      this.webSocket.send(JSON.stringify(data))\n      return true\n    } else {\n      return false\n    }\n  }\n\n  open() {\n    if (this.isActive()) {\n      logger.log(`Attempted to open WebSocket, but existing socket is ${this.getState()}`)\n      return false\n    } else {\n      const socketProtocols = [...protocols, ...this.consumer.subprotocols || []]\n      logger.log(`Opening WebSocket, current state is ${this.getState()}, subprotocols: ${socketProtocols}`)\n      if (this.webSocket) { this.uninstallEventHandlers() }\n      this.webSocket = new adapters.WebSocket(this.consumer.url, socketProtocols)\n      this.installEventHandlers()\n      this.monitor.start()\n      return true\n    }\n  }\n\n  close({allowReconnect} = {allowReconnect: true}) {\n    if (!allowReconnect) { this.monitor.stop() }\n    // Avoid closing websockets in a \"connecting\" state due to Safari 15.1+ bug. See: https://github.com/rails/rails/issues/43835#issuecomment-1002288478\n    if (this.isOpen()) {\n      return this.webSocket.close()\n    }\n  }\n\n  reopen() {\n    logger.log(`Reopening WebSocket, current state is ${this.getState()}`)\n    if (this.isActive()) {\n      try {\n        return this.close()\n      } catch (error) {\n        logger.log(\"Failed to reopen WebSocket\", error)\n      }\n      finally {\n        logger.log(`Reopening WebSocket in ${this.constructor.reopenDelay}ms`)\n        setTimeout(this.open, this.constructor.reopenDelay)\n      }\n    } else {\n      return this.open()\n    }\n  }\n\n  getProtocol() {\n    if (this.webSocket) {\n      return this.webSocket.protocol\n    }\n  }\n\n  isOpen() {\n    return this.isState(\"open\")\n  }\n\n  isActive() {\n    return this.isState(\"open\", \"connecting\")\n  }\n\n  triedToReconnect() {\n    return this.monitor.reconnectAttempts > 0\n  }\n\n  // Private\n\n  isProtocolSupported() {\n    return indexOf.call(supportedProtocols, this.getProtocol()) >= 0\n  }\n\n  isState(...states) {\n    return indexOf.call(states, this.getState()) >= 0\n  }\n\n  getState() {\n    if (this.webSocket) {\n      for (let state in adapters.WebSocket) {\n        if (adapters.WebSocket[state] === this.webSocket.readyState) {\n          return state.toLowerCase()\n        }\n      }\n    }\n    return null\n  }\n\n  installEventHandlers() {\n    for (let eventName in this.events) {\n      const handler = this.events[eventName].bind(this)\n      this.webSocket[`on${eventName}`] = handler\n    }\n  }\n\n  uninstallEventHandlers() {\n    for (let eventName in this.events) {\n      this.webSocket[`on${eventName}`] = function() {}\n    }\n  }\n\n}\n\nConnection.reopenDelay = 500\n\nConnection.prototype.events = {\n  message(event) {\n    if (!this.isProtocolSupported()) { return }\n    const {identifier, message, reason, reconnect, type} = JSON.parse(event.data)\n    this.monitor.recordMessage()\n    switch (type) {\n      case message_types.welcome:\n        if (this.triedToReconnect()) {\n          this.reconnectAttempted = true\n        }\n        this.monitor.recordConnect()\n        return this.subscriptions.reload()\n      case message_types.disconnect:\n        logger.log(`Disconnecting. Reason: ${reason}`)\n        return this.close({allowReconnect: reconnect})\n      case message_types.ping:\n        return null\n      case message_types.confirmation:\n        this.subscriptions.confirmSubscription(identifier)\n        if (this.reconnectAttempted) {\n          this.reconnectAttempted = false\n          return this.subscriptions.notify(identifier, \"connected\", {reconnected: true})\n        } else {\n          return this.subscriptions.notify(identifier, \"connected\", {reconnected: false})\n        }\n      case message_types.rejection:\n        return this.subscriptions.reject(identifier)\n      default:\n        return this.subscriptions.notify(identifier, \"received\", message)\n    }\n  },\n\n  open() {\n    logger.log(`WebSocket onopen event, using '${this.getProtocol()}' subprotocol`)\n    this.disconnected = false\n    if (!this.isProtocolSupported()) {\n      logger.log(\"Protocol is unsupported. Stopping monitor and disconnecting.\")\n      return this.close({allowReconnect: false})\n    }\n  },\n\n  close(event) {\n    logger.log(\"WebSocket onclose event\")\n    if (this.disconnected) { return }\n    this.disconnected = true\n    this.monitor.recordDisconnect()\n    return this.subscriptions.notifyAll(\"disconnected\", {willAttemptReconnect: this.monitor.isRunning()})\n  },\n\n  error() {\n    logger.log(\"WebSocket onerror event\")\n  }\n}\n\nexport default Connection\n", "// A new subscription is created through the ActionCable.Subscriptions instance available on the consumer.\n// It provides a number of callbacks and a method for calling remote procedure calls on the corresponding\n// Channel instance on the server side.\n//\n// An example demonstrates the basic functionality:\n//\n//   App.appearance = App.cable.subscriptions.create(\"AppearanceChannel\", {\n//     connected() {\n//       // Called once the subscription has been successfully completed\n//     },\n//\n//     disconnected({ willAttemptReconnect: boolean }) {\n//       // Called when the client has disconnected with the server.\n//       // The object will have an `willAttemptReconnect` property which\n//       // says whether the client has the intention of attempting\n//       // to reconnect.\n//     },\n//\n//     appear() {\n//       this.perform('appear', {appearing_on: this.appearingOn()})\n//     },\n//\n//     away() {\n//       this.perform('away')\n//     },\n//\n//     appearingOn() {\n//       $('main').data('appearing-on')\n//     }\n//   })\n//\n// The methods #appear and #away forward their intent to the remote AppearanceChannel instance on the server\n// by calling the `perform` method with the first parameter being the action (which maps to AppearanceChannel#appear/away).\n// The second parameter is a hash that'll get JSON encoded and made available on the server in the data parameter.\n//\n// This is how the server component would look:\n//\n//   class AppearanceChannel < ApplicationActionCable::Channel\n//     def subscribed\n//       current_user.appear\n//     end\n//\n//     def unsubscribed\n//       current_user.disappear\n//     end\n//\n//     def appear(data)\n//       current_user.appear on: data['appearing_on']\n//     end\n//\n//     def away\n//       current_user.away\n//     end\n//   end\n//\n// The \"AppearanceChannel\" name is automatically mapped between the client-side subscription creation and the server-side Ruby class name.\n// The AppearanceChannel#appear/away public methods are exposed automatically to client-side invocation through the perform method.\n\nconst extend = function(object, properties) {\n  if (properties != null) {\n    for (let key in properties) {\n      const value = properties[key]\n      object[key] = value\n    }\n  }\n  return object\n}\n\nexport default class Subscription {\n  constructor(consumer, params = {}, mixin) {\n    this.consumer = consumer\n    this.identifier = JSON.stringify(params)\n    extend(this, mixin)\n  }\n\n  // Perform a channel action with the optional data passed as an attribute\n  perform(action, data = {}) {\n    data.action = action\n    return this.send(data)\n  }\n\n  send(data) {\n    return this.consumer.send({command: \"message\", identifier: this.identifier, data: JSON.stringify(data)})\n  }\n\n  unsubscribe() {\n    return this.consumer.subscriptions.remove(this)\n  }\n}\n", "import logger from \"./logger\"\n\n// Responsible for ensuring channel subscribe command is confirmed, retrying until confirmation is received.\n// Internal class, not intended for direct user manipulation.\n\nclass SubscriptionGuarantor {\n  constructor(subscriptions) {\n    this.subscriptions = subscriptions\n    this.pendingSubscriptions = []\n  }\n\n  guarantee(subscription) {\n    if(this.pendingSubscriptions.indexOf(subscription) == -1){ \n      logger.log(`SubscriptionGuarantor guaranteeing ${subscription.identifier}`)\n      this.pendingSubscriptions.push(subscription) \n    }\n    else {\n      logger.log(`SubscriptionGuarantor already guaranteeing ${subscription.identifier}`)\n    }\n    this.startGuaranteeing()\n  }\n\n  forget(subscription) {\n    logger.log(`SubscriptionGuarantor forgetting ${subscription.identifier}`)\n    this.pendingSubscriptions = (this.pendingSubscriptions.filter((s) => s !== subscription))\n  }\n\n  startGuaranteeing() {\n    this.stopGuaranteeing()\n    this.retrySubscribing()\n  }\n  \n  stopGuaranteeing() {\n    clearTimeout(this.retryTimeout)\n  }\n\n  retrySubscribing() {\n    this.retryTimeout = setTimeout(() => {\n      if (this.subscriptions && typeof(this.subscriptions.subscribe) === \"function\") {\n        this.pendingSubscriptions.map((subscription) => {\n          logger.log(`SubscriptionGuarantor resubscribing ${subscription.identifier}`)\n          this.subscriptions.subscribe(subscription)\n        })\n      }\n    }\n    , 500)\n  }\n}\n\nexport default SubscriptionGuarantor", "import Subscription from \"./subscription\"\nimport SubscriptionGuarantor from \"./subscription_guarantor\"\nimport logger from \"./logger\"\n\n// Collection class for creating (and internally managing) channel subscriptions.\n// The only method intended to be triggered by the user is ActionCable.Subscriptions#create,\n// and it should be called through the consumer like so:\n//\n//   App = {}\n//   App.cable = ActionCable.createConsumer(\"ws://example.com/accounts/1\")\n//   App.appearance = App.cable.subscriptions.create(\"AppearanceChannel\")\n//\n// For more details on how you'd configure an actual channel subscription, see ActionCable.Subscription.\n\nexport default class Subscriptions {\n  constructor(consumer) {\n    this.consumer = consumer\n    this.guarantor = new SubscriptionGuarantor(this)\n    this.subscriptions = []\n  }\n\n  create(channelName, mixin) {\n    const channel = channelName\n    const params = typeof channel === \"object\" ? channel : {channel}\n    const subscription = new Subscription(this.consumer, params, mixin)\n    return this.add(subscription)\n  }\n\n  // Private\n\n  add(subscription) {\n    this.subscriptions.push(subscription)\n    this.consumer.ensureActiveConnection()\n    this.notify(subscription, \"initialized\")\n    this.subscribe(subscription)\n    return subscription\n  }\n\n  remove(subscription) {\n    this.forget(subscription)\n    if (!this.findAll(subscription.identifier).length) {\n      this.sendCommand(subscription, \"unsubscribe\")\n    }\n    return subscription\n  }\n\n  reject(identifier) {\n    return this.findAll(identifier).map((subscription) => {\n      this.forget(subscription)\n      this.notify(subscription, \"rejected\")\n      return subscription\n    })\n  }\n\n  forget(subscription) {\n    this.guarantor.forget(subscription)\n    this.subscriptions = (this.subscriptions.filter((s) => s !== subscription))\n    return subscription\n  }\n\n  findAll(identifier) {\n    return this.subscriptions.filter((s) => s.identifier === identifier)\n  }\n\n  reload() {\n    return this.subscriptions.map((subscription) =>\n      this.subscribe(subscription))\n  }\n\n  notifyAll(callbackName, ...args) {\n    return this.subscriptions.map((subscription) =>\n      this.notify(subscription, callbackName, ...args))\n  }\n\n  notify(subscription, callbackName, ...args) {\n    let subscriptions\n    if (typeof subscription === \"string\") {\n      subscriptions = this.findAll(subscription)\n    } else {\n      subscriptions = [subscription]\n    }\n\n    return subscriptions.map((subscription) =>\n      (typeof subscription[callbackName] === \"function\" ? subscription[callbackName](...args) : undefined))\n  }\n\n  subscribe(subscription) {\n    if (this.sendCommand(subscription, \"subscribe\")) {\n      this.guarantor.guarantee(subscription)\n    }\n  }\n\n  confirmSubscription(identifier) {\n    logger.log(`Subscription confirmed ${identifier}`)\n    this.findAll(identifier).map((subscription) =>\n      this.guarantor.forget(subscription))\n  }\n\n  sendCommand(subscription, command) {\n    const {identifier} = subscription\n    return this.consumer.send({command, identifier})\n  }\n}\n", "import Connection from \"./connection\"\nimport Subscriptions from \"./subscriptions\"\n\n// The ActionCable.Consumer establishes the connection to a server-side Ruby Connection object. Once established,\n// the ActionCable.ConnectionMonitor will ensure that its properly maintained through heartbeats and checking for stale updates.\n// The Consumer instance is also the gateway to establishing subscriptions to desired channels through the #createSubscription\n// method.\n//\n// The following example shows how this can be set up:\n//\n//   App = {}\n//   App.cable = ActionCable.createConsumer(\"ws://example.com/accounts/1\")\n//   App.appearance = App.cable.subscriptions.create(\"AppearanceChannel\")\n//\n// For more details on how you'd configure an actual channel subscription, see ActionCable.Subscription.\n//\n// When a consumer is created, it automatically connects with the server.\n//\n// To disconnect from the server, call\n//\n//   App.cable.disconnect()\n//\n// and to restart the connection:\n//\n//   App.cable.connect()\n//\n// Any channel subscriptions which existed prior to disconnecting will\n// automatically resubscribe.\n\nexport default class Consumer {\n  constructor(url) {\n    this._url = url\n    this.subscriptions = new Subscriptions(this)\n    this.connection = new Connection(this)\n    this.subprotocols = []\n  }\n\n  get url() {\n    return createWebSocketURL(this._url)\n  }\n\n  send(data) {\n    return this.connection.send(data)\n  }\n\n  connect() {\n    return this.connection.open()\n  }\n\n  disconnect() {\n    return this.connection.close({allowReconnect: false})\n  }\n\n  ensureActiveConnection() {\n    if (!this.connection.isActive()) {\n      return this.connection.open()\n    }\n  }\n\n  addSubProtocol(subprotocol) {\n    this.subprotocols = [...this.subprotocols, subprotocol]\n  }\n}\n\nexport function createWebSocketURL(url) {\n  if (typeof url === \"function\") {\n    url = url()\n  }\n\n  if (url && !/^wss?:/i.test(url)) {\n    const a = document.createElement(\"a\")\n    a.href = url\n    // Fix populating Location properties in IE. Otherwise, protocol will be blank.\n    a.href = a.href\n    a.protocol = a.protocol.replace(\"http\", \"ws\")\n    return a.href\n  } else {\n    return url\n  }\n}\n", "import Connection from \"./connection\"\nimport ConnectionMonitor from \"./connection_monitor\"\nimport Consumer, { createWebSocketURL } from \"./consumer\"\nimport INTERNAL from \"./internal\"\nimport Subscription from \"./subscription\"\nimport Subscriptions from \"./subscriptions\"\nimport SubscriptionGuarantor from \"./subscription_guarantor\"\nimport adapters from \"./adapters\"\nimport logger from \"./logger\"\n\nexport {\n  Connection,\n  ConnectionMonitor,\n  Consumer,\n  INTERNAL,\n  Subscription,\n  Subscriptions,\n  SubscriptionGuarantor,\n  adapters,\n  createWebSocketURL,\n  logger,\n}\n\nexport function createConsumer(url = getConfig(\"url\") || INTERNAL.default_mount_path) {\n  return new Consumer(url)\n}\n\nexport function getConfig(name) {\n  const element = document.head.querySelector(`meta[name='action-cable-${name}']`)\n  if (element) {\n    return element.getAttribute(\"content\")\n  }\n}\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 global, define, System, Reflect, Promise */\r\nvar __extends;\r\nvar __assign;\r\nvar __rest;\r\nvar __decorate;\r\nvar __param;\r\nvar __metadata;\r\nvar __awaiter;\r\nvar __generator;\r\nvar __exportStar;\r\nvar __values;\r\nvar __read;\r\nvar __spread;\r\nvar __spreadArrays;\r\nvar __spreadArray;\r\nvar __await;\r\nvar __asyncGenerator;\r\nvar __asyncDelegator;\r\nvar __asyncValues;\r\nvar __makeTemplateObject;\r\nvar __importStar;\r\nvar __importDefault;\r\nvar __classPrivateFieldGet;\r\nvar __classPrivateFieldSet;\r\nvar __createBinding;\r\n(function (factory) {\r\n    var root = typeof global === \"object\" ? global : typeof self === \"object\" ? self : typeof this === \"object\" ? this : {};\r\n    if (typeof define === \"function\" && define.amd) {\r\n        define(\"tslib\", [\"exports\"], function (exports) { factory(createExporter(root, createExporter(exports))); });\r\n    }\r\n    else if (typeof module === \"object\" && typeof module.exports === \"object\") {\r\n        factory(createExporter(root, createExporter(module.exports)));\r\n    }\r\n    else {\r\n        factory(createExporter(root));\r\n    }\r\n    function createExporter(exports, previous) {\r\n        if (exports !== root) {\r\n            if (typeof Object.create === \"function\") {\r\n                Object.defineProperty(exports, \"__esModule\", { value: true });\r\n            }\r\n            else {\r\n                exports.__esModule = true;\r\n            }\r\n        }\r\n        return function (id, v) { return exports[id] = previous ? previous(id, v) : v; };\r\n    }\r\n})\r\n(function (exporter) {\r\n    var 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\r\n    __extends = function (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\n    __assign = Object.assign || function (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\r\n    __rest = function (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\n    __decorate = function (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\n    __param = function (paramIndex, decorator) {\r\n        return function (target, key) { decorator(target, key, paramIndex); }\r\n    };\r\n\r\n    __metadata = function (metadataKey, metadataValue) {\r\n        if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n    };\r\n\r\n    __awaiter = function (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\n    __generator = function (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;\r\n        return g = { next: verb(0), \"throw\": verb(1), \"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 (_) 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\n    __exportStar = function(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\n    __createBinding = Object.create ? (function(o, m, k, k2) {\r\n        if (k2 === undefined) k2 = k;\r\n        Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\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\n    __values = function (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\n    __read = function (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\n    __spread = function () {\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\n    __spreadArrays = function () {\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\n    __spreadArray = function (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 || from);\r\n    };\r\n\r\n    __await = function (v) {\r\n        return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n    };\r\n\r\n    __asyncGenerator = function (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 = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n        function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\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\n    __asyncDelegator = function (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: n === \"return\" } : f ? f(v) : v; } : f; }\r\n    };\r\n\r\n    __asyncValues = function (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\n    __makeTemplateObject = function (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\n    var __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\n    __importStar = function (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\n    __importDefault = function (mod) {\r\n        return (mod && mod.__esModule) ? mod : { \"default\": mod };\r\n    };\r\n\r\n    __classPrivateFieldGet = function (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\n    __classPrivateFieldSet = function (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\n    exporter(\"__extends\", __extends);\r\n    exporter(\"__assign\", __assign);\r\n    exporter(\"__rest\", __rest);\r\n    exporter(\"__decorate\", __decorate);\r\n    exporter(\"__param\", __param);\r\n    exporter(\"__metadata\", __metadata);\r\n    exporter(\"__awaiter\", __awaiter);\r\n    exporter(\"__generator\", __generator);\r\n    exporter(\"__exportStar\", __exportStar);\r\n    exporter(\"__createBinding\", __createBinding);\r\n    exporter(\"__values\", __values);\r\n    exporter(\"__read\", __read);\r\n    exporter(\"__spread\", __spread);\r\n    exporter(\"__spreadArrays\", __spreadArrays);\r\n    exporter(\"__spreadArray\", __spreadArray);\r\n    exporter(\"__await\", __await);\r\n    exporter(\"__asyncGenerator\", __asyncGenerator);\r\n    exporter(\"__asyncDelegator\", __asyncDelegator);\r\n    exporter(\"__asyncValues\", __asyncValues);\r\n    exporter(\"__makeTemplateObject\", __makeTemplateObject);\r\n    exporter(\"__importStar\", __importStar);\r\n    exporter(\"__importDefault\", __importDefault);\r\n    exporter(\"__classPrivateFieldGet\", __classPrivateFieldGet);\r\n    exporter(\"__classPrivateFieldSet\", __classPrivateFieldSet);\r\n});\r\n", "/*\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, \u2026): 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 \u2014 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 \u2014 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(\u2026): this\r\n\t// Behaves as [`on(\u2026)`](#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(\u2026): this\r\n// Alias to [`on(\u2026)`](#evented-on)\r\nEvents.addEventListener = Events.on;\r\n\r\n// @method removeEventListener(\u2026): this\r\n// Alias to [`off(\u2026)`](#evented-off)\r\n\r\n// @method clearAllEventListeners(\u2026): this\r\n// Alias to [`off()`](#evented-off)\r\nEvents.removeEventListener = Events.clearAllEventListeners = Events.off;\r\n\r\n// @method addOneTimeEventListener(\u2026): this\r\n// Alias to [`once(\u2026)`](#evented-once)\r\nEvents.addOneTimeEventListener = Events.once;\r\n\r\n// @method fireEvent(\u2026): this\r\n// Alias to [`fire(\u2026)`](#evented-fire)\r\nEvents.fireEvent = Events.fire;\r\n\r\n// @method hasEventListeners(\u2026): Boolean\r\n// Alias to [`listens(\u2026)`](#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 \u2014 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(\u2026): this\r\n// Alias to [`L.DomEvent.on`](#domevent-on)\r\nexport {on as addListener};\r\n\r\n// @function removeListener(\u2026): 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 \u2014 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 \u2014\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 \u2014\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 \u2014 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 \u2014 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. \"\u00A9 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, \u2026): 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 \u2014 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}` \u2014 zoom level, `{x}` and `{y}` \u2014 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 \u00A9 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\u00B2.\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\nvar ownKeys = function(o) {\r\n    ownKeys = Object.getOwnPropertyNames || function (o) {\r\n        var ar = [];\r\n        for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\r\n        return ar;\r\n    };\r\n    return ownKeys(o);\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 = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\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 function __rewriteRelativeImportExtension(path, preserveJsx) {\r\n    if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\r\n        return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\r\n            return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\r\n        });\r\n    }\r\n    return path;\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    __esDecorate: __esDecorate,\r\n    __runInitializers: __runInitializers,\r\n    __propKey: __propKey,\r\n    __setFunctionName: __setFunctionName,\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    __rewriteRelativeImportExtension: __rewriteRelativeImportExtension,\r\n};\r\n", "/**\n * A standalone point geometry with useful accessor, comparison, and\n * modification methods.\n *\n * @class\n * @param {number} x the x-coordinate. This could be longitude or screen pixels, or any other sort of unit.\n * @param {number} y the y-coordinate. This could be latitude or screen pixels, or any other sort of unit.\n *\n * @example\n * const point = new Point(-77, 38);\n */\nexport default function Point(x, y) {\n    this.x = x;\n    this.y = y;\n}\n\nPoint.prototype = {\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() { 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(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(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(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(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 {number} k factor\n     * @return {Point} output point\n     */\n    mult(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 {number} k factor\n     * @return {Point} output point\n     */\n    div(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(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(a, p) { return this.clone()._rotateAround(a, p); },\n\n    /**\n     * Multiply this point by a 4x1 transformation matrix\n     * @param {[number, number, number, number]} m transformation matrix\n     * @return {Point} output point\n     */\n    matMult(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() { 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() { 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() { return this.clone()._round(); },\n\n    /**\n     * Return the magnitude 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() {\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(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(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(p) {\n        const 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() {\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(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(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(\u03B8) for \u03B8.\n     * @param {number} x the x-coordinate\n     * @param {number} y the y-coordinate\n     * @return {number} the angle in radians\n     */\n    angleWithSep(x, y) {\n        return Math.atan2(\n            this.x * y - this.y * x,\n            this.x * x + this.y * y);\n    },\n\n    /** @param {[number, number, number, number]} m */\n    _matMult(m) {\n        const 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    /** @param {Point} p */\n    _add(p) {\n        this.x += p.x;\n        this.y += p.y;\n        return this;\n    },\n\n    /** @param {Point} p */\n    _sub(p) {\n        this.x -= p.x;\n        this.y -= p.y;\n        return this;\n    },\n\n    /** @param {number} k */\n    _mult(k) {\n        this.x *= k;\n        this.y *= k;\n        return this;\n    },\n\n    /** @param {number} k */\n    _div(k) {\n        this.x /= k;\n        this.y /= k;\n        return this;\n    },\n\n    /** @param {Point} p */\n    _multByPoint(p) {\n        this.x *= p.x;\n        this.y *= p.y;\n        return this;\n    },\n\n    /** @param {Point} p */\n    _divByPoint(p) {\n        this.x /= p.x;\n        this.y /= p.y;\n        return this;\n    },\n\n    _unit() {\n        this._div(this.mag());\n        return this;\n    },\n\n    _perp() {\n        const y = this.y;\n        this.y = this.x;\n        this.x = -y;\n        return this;\n    },\n\n    /** @param {number} angle */\n    _rotate(angle) {\n        const 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    /**\n     * @param {number} angle\n     * @param {Point} p\n     */\n    _rotateAround(angle, p) {\n        const 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() {\n        this.x = Math.round(this.x);\n        this.y = Math.round(this.y);\n        return this;\n    },\n\n    constructor: Point\n};\n\n/**\n * Construct a point from an array if necessary, otherwise if the input\n * is already a Point, return it unchanged.\n * @param {Point | [number, number] | {x: number, y: number}} p input value\n * @return {Point} constructed point.\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 (p) {\n    if (p instanceof Point) {\n        return /** @type {Point} */ (p);\n    }\n    if (Array.isArray(p)) {\n        return new Point(+p[0], +p[1]);\n    }\n    if (p.x !== undefined && p.y !== undefined) {\n        return new Point(+p.x, +p.y);\n    }\n    throw new Error('Expected [x, y] or {x, y} point format');\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    supportsOffscreenCanvas ??= typeof OffscreenCanvas !== 'undefined' &&\n            new OffscreenCanvas(1, 1).getContext('2d') &&\n            typeof createImageBitmap === 'function';\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", "/**\n * Common utilities\n * @module glMatrix\n */\n\n// Configuration Constants\nexport var EPSILON = 0.000001;\nexport var ARRAY_TYPE = typeof Float32Array !== \"undefined\" ? Float32Array : Array;\nexport var RANDOM = Math.random;\nexport var ANGLE_ORDER = \"zyx\";\n\n/**\n * Symmetric round\n * see https://www.npmjs.com/package/round-half-up-symmetric#user-content-detailed-background\n *\n * @param {Number} a value to round\n */\nexport function round(a) {\n  if (a >= 0) return Math.round(a);\n  return a % 0.5 === 0 ? Math.floor(a) : Math.round(a);\n}\n\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 */\nexport function setMatrixArrayType(type) {\n  ARRAY_TYPE = type;\n}\nvar degree = Math.PI / 180;\nvar radian = 180 / Math.PI;\n\n/**\n * Convert Degree To Radian\n *\n * @param {Number} a Angle in Degrees\n */\nexport function toRadian(a) {\n  return a * degree;\n}\n\n/**\n * Convert Radian To Degree\n *\n * @param {Number} a Angle in Radians\n */\nexport function toDegree(a) {\n  return a * radian;\n}\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 * @param {Number} tolerance  Absolute or relative tolerance (default glMatrix.EPSILON)\n * @returns {Boolean} True if the numbers are approximately equal, false otherwise.\n */\nexport function equals(a, b) {\n  var tolerance = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : EPSILON;\n  return Math.abs(a - b) <= tolerance * Math.max(1, Math.abs(a), Math.abs(b));\n}", "import * as glMatrix from \"./common.js\";\n\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 */\nexport function create() {\n  var out = new glMatrix.ARRAY_TYPE(9);\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  out[0] = 1;\n  out[4] = 1;\n  out[8] = 1;\n  return out;\n}\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 */\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/**\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 */\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/**\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 */\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/**\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 */\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/**\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 */\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/**\n * Set a mat3 to the identity matrix\n *\n * @param {mat3} out the receiving matrix\n * @returns {mat3} out\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/**\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 */\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  return out;\n}\n\n/**\n * Inverts a mat3\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the source matrix\n * @returns {mat3 | null} out, or null if source matrix is not invertible\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;\n\n  // Calculate the determinant\n  var det = a00 * b01 + a01 * b11 + a02 * b21;\n  if (!det) {\n    return null;\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/**\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 */\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/**\n * Calculates the determinant of a mat3\n *\n * @param {ReadonlyMat3} a the source matrix\n * @returns {Number} determinant of a\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/**\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 */\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/**\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 */\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/**\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 */\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/**\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 scale\n * @param {ReadonlyVec2} v the vec2 to scale the matrix by\n * @returns {mat3} out\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/**\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 */\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/**\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 */\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/**\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 */\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/**\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 **/\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/**\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 */\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/**\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 */\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;\n\n  // Calculate the determinant\n  var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n  if (!det) {\n    return null;\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/**\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 */\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/**\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 */\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/**\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 */\nexport function frob(a) {\n  return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + a[6] * a[6] + a[7] * a[7] + a[8] * a[8]);\n}\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 */\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/**\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 */\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/**\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 */\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/**\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 */\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/**\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 */\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/**\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 */\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/**\n * Alias for {@link mat3.multiply}\n * @function\n */\nexport var mul = multiply;\n\n/**\n * Alias for {@link mat3.subtract}\n * @function\n */\nexport var sub = subtract;", "import * as glMatrix from \"./common.js\";\n\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 */\nexport function create() {\n  var out = new glMatrix.ARRAY_TYPE(16);\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  out[0] = 1;\n  out[5] = 1;\n  out[10] = 1;\n  out[15] = 1;\n  return out;\n}\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 */\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/**\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 */\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/**\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 */\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/**\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 */\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/**\n * Set a mat4 to the identity matrix\n *\n * @param {mat4} out the receiving matrix\n * @returns {mat4} out\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/**\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 */\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  return out;\n}\n\n/**\n * Inverts a mat4\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the source matrix\n * @returns {mat4 | null} out, or null if source matrix is not invertible\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;\n\n  // Calculate the determinant\n  var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n  if (!det) {\n    return null;\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/**\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 */\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  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;\n  out[0] = a11 * b11 - a12 * b10 + a13 * b09;\n  out[1] = a02 * b10 - a01 * b11 - a03 * b09;\n  out[2] = a31 * b05 - a32 * b04 + a33 * b03;\n  out[3] = a22 * b04 - a21 * b05 - a23 * b03;\n  out[4] = a12 * b08 - a10 * b11 - a13 * b07;\n  out[5] = a00 * b11 - a02 * b08 + a03 * b07;\n  out[6] = a32 * b02 - a30 * b05 - a33 * b01;\n  out[7] = a20 * b05 - a22 * b02 + a23 * b01;\n  out[8] = a10 * b10 - a11 * b08 + a13 * b06;\n  out[9] = a01 * b08 - a00 * b10 - a03 * b06;\n  out[10] = a30 * b04 - a31 * b02 + a33 * b00;\n  out[11] = a21 * b02 - a20 * b04 - a23 * b00;\n  out[12] = a11 * b07 - a10 * b09 - a12 * b06;\n  out[13] = a00 * b09 - a01 * b07 + a02 * b06;\n  out[14] = a31 * b01 - a30 * b03 - a32 * b00;\n  out[15] = a20 * b03 - a21 * b01 + a22 * b00;\n  return out;\n}\n\n/**\n * Calculates the determinant of a mat4\n *\n * @param {ReadonlyMat4} a the source matrix\n * @returns {Number} determinant of a\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 b0 = a00 * a11 - a01 * a10;\n  var b1 = a00 * a12 - a02 * a10;\n  var b2 = a01 * a12 - a02 * a11;\n  var b3 = a20 * a31 - a21 * a30;\n  var b4 = a20 * a32 - a22 * a30;\n  var b5 = a21 * a32 - a22 * a31;\n  var b6 = a00 * b5 - a01 * b4 + a02 * b3;\n  var b7 = a10 * b5 - a11 * b4 + a12 * b3;\n  var b8 = a20 * b2 - a21 * b1 + a22 * b0;\n  var b9 = a30 * b2 - a31 * b1 + a32 * b0;\n\n  // Calculate the determinant\n  return a13 * b6 - a03 * b7 + a33 * b8 - a23 * b9;\n}\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 */\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];\n\n  // Cache only the current line of the second matrix\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/**\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 */\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  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  return out;\n}\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 **/\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/**\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 */\nexport function rotate(out, a, rad, axis) {\n  var x = axis[0],\n    y = axis[1],\n    z = axis[2];\n  var len = Math.sqrt(x * x + y * y + z * 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  if (len < glMatrix.EPSILON) {\n    return null;\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];\n\n  // Construct the elements of the rotation matrix\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;\n\n  // Perform rotation-specific matrix multiplication\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  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  return out;\n}\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 */\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  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  }\n\n  // Perform axis-specific matrix multiplication\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/**\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 */\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  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  }\n\n  // Perform axis-specific matrix multiplication\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/**\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 */\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  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  }\n\n  // Perform axis-specific matrix multiplication\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/**\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 */\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/**\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 */\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/**\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 */\nexport function fromRotation(out, rad, axis) {\n  var x = axis[0],\n    y = axis[1],\n    z = axis[2];\n  var len = Math.sqrt(x * x + y * y + z * z);\n  var s, c, t;\n  if (len < glMatrix.EPSILON) {\n    return null;\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\n  // Perform rotation-specific matrix multiplication\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/**\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 */\nexport function fromXRotation(out, rad) {\n  var s = Math.sin(rad);\n  var c = Math.cos(rad);\n\n  // Perform axis-specific matrix multiplication\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/**\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 */\nexport function fromYRotation(out, rad) {\n  var s = Math.sin(rad);\n  var c = Math.cos(rad);\n\n  // Perform axis-specific matrix multiplication\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/**\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 */\nexport function fromZRotation(out, rad) {\n  var s = Math.sin(rad);\n  var c = Math.cos(rad);\n\n  // Perform axis-specific matrix multiplication\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/**\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, dest, vec);\n *     let quatMat = mat4.create();\n *     mat4.fromQuat(quatMat, quat);\n *     mat4.multiply(dest, dest, quatMat);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {quat} q Rotation quaternion\n * @param {ReadonlyVec3} v Translation vector\n * @returns {mat4} out\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/**\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 */\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;\n  //Only scale if it makes sense\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  fromRotationTranslation(out, a, translation);\n  return out;\n}\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 */\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/**\n * Returns the scaling factor component of a transformation\n *  matrix. If a matrix is built with fromRotationTranslationScale\n *  with a normalized Quaternion parameter, 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 */\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.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\n  out[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\n  out[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\n  return out;\n}\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 */\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  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  return out;\n}\n\n/**\n * Decomposes a transformation matrix into its rotation, translation\n * and scale components. Returns only the rotation component\n * @param  {quat} out_r Quaternion to receive the rotation component\n * @param  {vec3} out_t Vector to receive the translation vector\n * @param  {vec3} out_s Vector to receive the scaling factor\n * @param  {ReadonlyMat4} mat Matrix to be decomposed (input)\n * @returns {quat} out_r\n */\nexport function decompose(out_r, out_t, out_s, mat) {\n  out_t[0] = mat[12];\n  out_t[1] = mat[13];\n  out_t[2] = mat[14];\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_s[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\n  out_s[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\n  out_s[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\n  var is1 = 1 / out_s[0];\n  var is2 = 1 / out_s[1];\n  var is3 = 1 / out_s[2];\n  var sm11 = m11 * is1;\n  var sm12 = m12 * is2;\n  var sm13 = m13 * is3;\n  var sm21 = m21 * is1;\n  var sm22 = m22 * is2;\n  var sm23 = m23 * is3;\n  var sm31 = m31 * is1;\n  var sm32 = m32 * is2;\n  var sm33 = m33 * is3;\n  var trace = sm11 + sm22 + sm33;\n  var S = 0;\n  if (trace > 0) {\n    S = Math.sqrt(trace + 1.0) * 2;\n    out_r[3] = 0.25 * S;\n    out_r[0] = (sm23 - sm32) / S;\n    out_r[1] = (sm31 - sm13) / S;\n    out_r[2] = (sm12 - sm21) / S;\n  } else if (sm11 > sm22 && sm11 > sm33) {\n    S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\n    out_r[3] = (sm23 - sm32) / S;\n    out_r[0] = 0.25 * S;\n    out_r[1] = (sm12 + sm21) / S;\n    out_r[2] = (sm31 + sm13) / S;\n  } else if (sm22 > sm33) {\n    S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\n    out_r[3] = (sm31 - sm13) / S;\n    out_r[0] = (sm12 + sm21) / S;\n    out_r[1] = 0.25 * S;\n    out_r[2] = (sm23 + sm32) / S;\n  } else {\n    S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\n    out_r[3] = (sm12 - sm21) / S;\n    out_r[0] = (sm31 + sm13) / S;\n    out_r[1] = (sm23 + sm32) / S;\n    out_r[2] = 0.25 * S;\n  }\n  return out_r;\n}\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, dest, vec);\n *     let quatMat = mat4.create();\n *     mat4.fromQuat(quatMat, quat);\n *     mat4.multiply(dest, dest, quatMat);\n *     mat4.scale(dest, dest, scale)\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {quat} q Rotation quaternion\n * @param {ReadonlyVec3} v Translation vector\n * @param {ReadonlyVec3} s Scaling vector\n * @returns {mat4} out\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/**\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, dest, vec);\n *     mat4.translate(dest, dest, origin);\n *     let quatMat = mat4.create();\n *     mat4.fromQuat(quatMat, quat);\n *     mat4.multiply(dest, dest, quatMat);\n *     mat4.scale(dest, dest, scale)\n *     mat4.translate(dest, dest, negativeOrigin);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {quat} 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 */\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/**\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 */\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/**\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 */\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/**\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 */\nexport function perspectiveNO(out, fovy, aspect, near, far) {\n  var f = 1.0 / Math.tan(fovy / 2);\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  if (far != null && far !== Infinity) {\n    var 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  return out;\n}\n\n/**\n * Alias for {@link mat4.perspectiveNO}\n * @function\n */\nexport var perspective = perspectiveNO;\n\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 */\nexport function perspectiveZO(out, fovy, aspect, near, far) {\n  var f = 1.0 / Math.tan(fovy / 2);\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  if (far != null && far !== Infinity) {\n    var 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  return out;\n}\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 */\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/**\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 */\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/**\n * Alias for {@link mat4.orthoNO}\n * @function\n */\nexport var ortho = orthoNO;\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 [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 */\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/**\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 */\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  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  z0 = eyex - centerx;\n  z1 = eyey - centery;\n  z2 = eyez - centerz;\n  len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * 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.sqrt(x0 * x0 + x1 * x1 + x2 * x2);\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  y0 = z1 * x2 - z2 * x1;\n  y1 = z2 * x0 - z0 * x2;\n  y2 = z0 * x1 - z1 * x0;\n  len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2);\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  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/**\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} target Point the viewer is looking at\n * @param {ReadonlyVec3} up vec3 pointing up\n * @returns {mat4} out\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  if (len > 0) {\n    len = 1 / Math.sqrt(len);\n    z0 *= len;\n    z1 *= len;\n    z2 *= len;\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  if (len > 0) {\n    len = 1 / Math.sqrt(len);\n    x0 *= len;\n    x1 *= len;\n    x2 *= len;\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/**\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 */\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/**\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 */\nexport function frob(a) {\n  return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + a[6] * a[6] + a[7] * a[7] + a[8] * a[8] + a[9] * a[9] + a[10] * a[10] + a[11] * a[11] + a[12] * a[12] + a[13] * a[13] + a[14] * a[14] + a[15] * a[15]);\n}\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 */\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/**\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 */\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/**\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 */\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/**\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 */\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/**\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 */\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/**\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 */\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/**\n * Alias for {@link mat4.multiply}\n * @function\n */\nexport var mul = multiply;\n\n/**\n * Alias for {@link mat4.subtract}\n * @function\n */\nexport var sub = subtract;", "import * as glMatrix from \"./common.js\";\n\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 */\nexport function create() {\n  var out = new glMatrix.ARRAY_TYPE(3);\n  if (glMatrix.ARRAY_TYPE != Float32Array) {\n    out[0] = 0;\n    out[1] = 0;\n    out[2] = 0;\n  }\n  return out;\n}\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 */\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/**\n * Calculates the length of a vec3\n *\n * @param {ReadonlyVec3} a vector to calculate length of\n * @returns {Number} length of a\n */\nexport function length(a) {\n  var x = a[0];\n  var y = a[1];\n  var z = a[2];\n  return Math.sqrt(x * x + y * y + z * z);\n}\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 */\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/**\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 */\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/**\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 */\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/**\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 */\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/**\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 */\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/**\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 */\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/**\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 */\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/**\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 */\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/**\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 */\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/**\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 */\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/**\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 */\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/**\n * symmetric 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 */\nexport function round(out, a) {\n  out[0] = glMatrix.round(a[0]);\n  out[1] = glMatrix.round(a[1]);\n  out[2] = glMatrix.round(a[2]);\n  return out;\n}\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 */\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/**\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 */\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/**\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 */\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.sqrt(x * x + y * y + z * z);\n}\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 */\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/**\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 */\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/**\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 */\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/**\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 */\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/**\n * Normalize a vec3\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a vector to normalize\n * @returns {vec3} out\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  if (len > 0) {\n    //TODO: evaluate use of glm_invsqrt here?\n    len = 1 / Math.sqrt(len);\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/**\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 */\nexport function dot(a, b) {\n  return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\n}\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 */\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/**\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 */\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/**\n * Performs a spherical 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 */\nexport function slerp(out, a, b, t) {\n  var angle = Math.acos(Math.min(Math.max(dot(a, b), -1), 1));\n  var sinTotal = Math.sin(angle);\n  var ratioA = Math.sin((1 - t) * angle) / sinTotal;\n  var ratioB = Math.sin(t * angle) / sinTotal;\n  out[0] = ratioA * a[0] + ratioB * b[0];\n  out[1] = ratioA * a[1] + ratioB * b[1];\n  out[2] = ratioA * a[2] + ratioB * b[2];\n  return out;\n}\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 */\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/**\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 */\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/**\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 omitted, a unit vector will be returned\n * @returns {vec3} out\n */\nexport function random(out, scale) {\n  scale = scale === undefined ? 1.0 : scale;\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/**\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 */\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/**\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 */\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/**\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 normalized quaternion to transform with\n * @returns {vec3} out\n */\nexport function transformQuat(out, a, q) {\n  // Fast Vector Rotation using Quaternions by Robert Eisele\n  // https://raw.org/proof/vector-rotation-using-quaternions/\n\n  var qx = q[0],\n    qy = q[1],\n    qz = q[2],\n    qw = q[3];\n  var vx = a[0],\n    vy = a[1],\n    vz = a[2];\n\n  // t = q x v\n  var tx = qy * vz - qz * vy;\n  var ty = qz * vx - qx * vz;\n  var tz = qx * vy - qy * vx;\n\n  // t = 2t\n  tx = tx + tx;\n  ty = ty + ty;\n  tz = tz + tz;\n\n  // v + w t + q x t\n  out[0] = vx + qw * tx + qy * tz - qz * ty;\n  out[1] = vy + qw * ty + qz * tx - qx * tz;\n  out[2] = vz + qw * tz + qx * ty - qy * tx;\n  return out;\n}\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 */\nexport function rotateX(out, a, b, rad) {\n  var p = [],\n    r = [];\n  //Translate point to the origin\n  p[0] = a[0] - b[0];\n  p[1] = a[1] - b[1];\n  p[2] = a[2] - b[2];\n\n  //perform rotation\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);\n\n  //translate to correct position\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/**\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 */\nexport function rotateY(out, a, b, rad) {\n  var p = [],\n    r = [];\n  //Translate point to the origin\n  p[0] = a[0] - b[0];\n  p[1] = a[1] - b[1];\n  p[2] = a[2] - b[2];\n\n  //perform rotation\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);\n\n  //translate to correct position\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/**\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 */\nexport function rotateZ(out, a, b, rad) {\n  var p = [],\n    r = [];\n  //Translate point to the origin\n  p[0] = a[0] - b[0];\n  p[1] = a[1] - b[1];\n  p[2] = a[2] - b[2];\n\n  //perform rotation\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];\n\n  //translate to correct position\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/**\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 */\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    mag = Math.sqrt((ax * ax + ay * ay + az * az) * (bx * bx + by * by + bz * bz)),\n    cosine = mag && dot(a, b) / mag;\n  return Math.acos(Math.min(Math.max(cosine, -1), 1));\n}\n\n/**\n * Set the components of a vec3 to zero\n *\n * @param {vec3} out the receiving vector\n * @returns {vec3} out\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/**\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 */\nexport function str(a) {\n  return \"vec3(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \")\";\n}\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 */\nexport function exactEquals(a, b) {\n  return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\n}\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 */\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/**\n * Alias for {@link vec3.subtract}\n * @function\n */\nexport var sub = subtract;\n\n/**\n * Alias for {@link vec3.multiply}\n * @function\n */\nexport var mul = multiply;\n\n/**\n * Alias for {@link vec3.divide}\n * @function\n */\nexport var div = divide;\n\n/**\n * Alias for {@link vec3.distance}\n * @function\n */\nexport var dist = distance;\n\n/**\n * Alias for {@link vec3.squaredDistance}\n * @function\n */\nexport var sqrDist = squaredDistance;\n\n/**\n * Alias for {@link vec3.length}\n * @function\n */\nexport var len = length;\n\n/**\n * Alias for {@link vec3.squaredLength}\n * @function\n */\nexport var sqrLen = squaredLength;\n\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 */\nexport var forEach = function () {\n  var vec = create();\n  return function (a, stride, offset, count, fn, arg) {\n    var i, l;\n    if (!stride) {\n      stride = 3;\n    }\n    if (!offset) {\n      offset = 0;\n    }\n    if (count) {\n      l = Math.min(count * stride + offset, a.length);\n    } else {\n      l = a.length;\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    return a;\n  };\n}();", "import * as glMatrix from \"./common.js\";\n\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 */\nexport function create() {\n  var out = new glMatrix.ARRAY_TYPE(4);\n  if (glMatrix.ARRAY_TYPE != Float32Array) {\n    out[0] = 0;\n    out[1] = 0;\n    out[2] = 0;\n    out[3] = 0;\n  }\n  return out;\n}\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 */\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/**\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 */\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/**\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 */\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/**\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 */\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/**\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 */\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/**\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 */\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/**\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 */\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/**\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 */\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/**\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 */\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/**\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 */\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/**\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 */\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/**\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 */\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/**\n * symmetric 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 */\nexport function round(out, a) {\n  out[0] = glMatrix.round(a[0]);\n  out[1] = glMatrix.round(a[1]);\n  out[2] = glMatrix.round(a[2]);\n  out[3] = glMatrix.round(a[3]);\n  return out;\n}\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 */\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/**\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 */\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/**\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 */\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.sqrt(x * x + y * y + z * z + w * w);\n}\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 */\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/**\n * Calculates the length of a vec4\n *\n * @param {ReadonlyVec4} a vector to calculate length of\n * @returns {Number} length of a\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.sqrt(x * x + y * y + z * z + w * w);\n}\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 */\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/**\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 */\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/**\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 */\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/**\n * Normalize a vec4\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a vector to normalize\n * @returns {vec4} out\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  if (len > 0) {\n    len = 1 / Math.sqrt(len);\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/**\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 */\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/**\n * Returns the cross-product of three vectors in a 4-dimensional space\n *\n * @param {ReadonlyVec4} out 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 */\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/**\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 */\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/**\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 omitted, a unit vector will be returned\n * @returns {vec4} out\n */\nexport function random(out, scale) {\n  scale = scale === undefined ? 1.0 : scale;\n\n  // 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  var v1, v2, v3, v4;\n  var s1, s2;\n  var rand;\n  rand = glMatrix.RANDOM();\n  v1 = rand * 2 - 1;\n  v2 = (4 * glMatrix.RANDOM() - 2) * Math.sqrt(rand * -rand + rand);\n  s1 = v1 * v1 + v2 * v2;\n  rand = glMatrix.RANDOM();\n  v3 = rand * 2 - 1;\n  v4 = (4 * glMatrix.RANDOM() - 2) * Math.sqrt(rand * -rand + rand);\n  s2 = v3 * v3 + v4 * v4;\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/**\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 */\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/**\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 normalized quaternion to transform with\n * @returns {vec4} out\n */\nexport function transformQuat(out, a, q) {\n  // Fast Vector Rotation using Quaternions by Robert Eisele\n  // https://raw.org/proof/vector-rotation-using-quaternions/\n\n  var qx = q[0],\n    qy = q[1],\n    qz = q[2],\n    qw = q[3];\n  var vx = a[0],\n    vy = a[1],\n    vz = a[2];\n\n  // t = q x v\n  var tx = qy * vz - qz * vy;\n  var ty = qz * vx - qx * vz;\n  var tz = qx * vy - qy * vx;\n\n  // t = 2t\n  tx = tx + tx;\n  ty = ty + ty;\n  tz = tz + tz;\n\n  // v + w t + q x t\n  out[0] = vx + qw * tx + qy * tz - qz * ty;\n  out[1] = vy + qw * ty + qz * tx - qx * tz;\n  out[2] = vz + qw * tz + qx * ty - qy * tx;\n  out[3] = a[3];\n  return out;\n}\n\n/**\n * Set the components of a vec4 to zero\n *\n * @param {vec4} out the receiving vector\n * @returns {vec4} out\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/**\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 */\nexport function str(a) {\n  return \"vec4(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \")\";\n}\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 */\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/**\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 */\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/**\n * Alias for {@link vec4.subtract}\n * @function\n */\nexport var sub = subtract;\n\n/**\n * Alias for {@link vec4.multiply}\n * @function\n */\nexport var mul = multiply;\n\n/**\n * Alias for {@link vec4.divide}\n * @function\n */\nexport var div = divide;\n\n/**\n * Alias for {@link vec4.distance}\n * @function\n */\nexport var dist = distance;\n\n/**\n * Alias for {@link vec4.squaredDistance}\n * @function\n */\nexport var sqrDist = squaredDistance;\n\n/**\n * Alias for {@link vec4.length}\n * @function\n */\nexport var len = length;\n\n/**\n * Alias for {@link vec4.squaredLength}\n * @function\n */\nexport var sqrLen = squaredLength;\n\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 */\nexport var forEach = function () {\n  var vec = create();\n  return function (a, stride, offset, count, fn, arg) {\n    var i, l;\n    if (!stride) {\n      stride = 4;\n    }\n    if (!offset) {\n      offset = 0;\n    }\n    if (count) {\n      l = Math.min(count * stride + offset, a.length);\n    } else {\n      l = a.length;\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    return a;\n  };\n}();", "import * as glMatrix from \"./common.js\";\nimport * as mat3 from \"./mat3.js\";\nimport * as vec3 from \"./vec3.js\";\nimport * as vec4 from \"./vec4.js\";\n\n/**\n * Quaternion in the format XYZW\n * @module quat\n */\n\n/**\n * Creates a new identity quat\n *\n * @returns {quat} a new quaternion\n */\nexport function create() {\n  var out = new glMatrix.ARRAY_TYPE(4);\n  if (glMatrix.ARRAY_TYPE != Float32Array) {\n    out[0] = 0;\n    out[1] = 0;\n    out[2] = 0;\n  }\n  out[3] = 1;\n  return out;\n}\n\n/**\n * Set a quat to the identity quaternion\n *\n * @param {quat} out the receiving quaternion\n * @returns {quat} out\n */\nexport function identity(out) {\n  out[0] = 0;\n  out[1] = 0;\n  out[2] = 0;\n  out[3] = 1;\n  return out;\n}\n\n/**\n * Sets a quat from the given angle and rotation axis,\n * then returns it.\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyVec3} axis the axis around which to rotate\n * @param {Number} rad the angle in radians\n * @returns {quat} out\n **/\nexport function setAxisAngle(out, axis, rad) {\n  rad = rad * 0.5;\n  var s = Math.sin(rad);\n  out[0] = s * axis[0];\n  out[1] = s * axis[1];\n  out[2] = s * axis[2];\n  out[3] = Math.cos(rad);\n  return out;\n}\n\n/**\n * Gets the rotation axis and angle for a given\n *  quaternion. If a quaternion is created with\n *  setAxisAngle, this method will return the same\n *  values as providied in the original parameter list\n *  OR functionally equivalent values.\n * Example: The quaternion formed by axis [0, 0, 1] and\n *  angle -90 is the same as the quaternion formed by\n *  [0, 0, 1] and 270. This method favors the latter.\n * @param  {vec3} out_axis  Vector receiving the axis of rotation\n * @param  {ReadonlyQuat} q     Quaternion to be decomposed\n * @return {Number}     Angle, in radians, of the rotation\n */\nexport function getAxisAngle(out_axis, q) {\n  var rad = Math.acos(q[3]) * 2.0;\n  var s = Math.sin(rad / 2.0);\n  if (s > glMatrix.EPSILON) {\n    out_axis[0] = q[0] / s;\n    out_axis[1] = q[1] / s;\n    out_axis[2] = q[2] / s;\n  } else {\n    // If s is zero, return any axis (no rotation - axis does not matter)\n    out_axis[0] = 1;\n    out_axis[1] = 0;\n    out_axis[2] = 0;\n  }\n  return rad;\n}\n\n/**\n * Gets the angular distance between two unit quaternions\n *\n * @param  {ReadonlyQuat} a     Origin unit quaternion\n * @param  {ReadonlyQuat} b     Destination unit quaternion\n * @return {Number}     Angle, in radians, between the two quaternions\n */\nexport function getAngle(a, b) {\n  var dotproduct = dot(a, b);\n  return Math.acos(2 * dotproduct * dotproduct - 1);\n}\n\n/**\n * Multiplies two quat's\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a the first operand\n * @param {ReadonlyQuat} b the second operand\n * @returns {quat} out\n */\nexport function multiply(out, a, b) {\n  var ax = a[0],\n    ay = a[1],\n    az = a[2],\n    aw = a[3];\n  var bx = b[0],\n    by = b[1],\n    bz = b[2],\n    bw = b[3];\n  out[0] = ax * bw + aw * bx + ay * bz - az * by;\n  out[1] = ay * bw + aw * by + az * bx - ax * bz;\n  out[2] = az * bw + aw * bz + ax * by - ay * bx;\n  out[3] = aw * bw - ax * bx - ay * by - az * bz;\n  return out;\n}\n\n/**\n * Rotates a quaternion by the given angle about the X axis\n *\n * @param {quat} out quat receiving operation result\n * @param {ReadonlyQuat} a quat to rotate\n * @param {number} rad angle (in radians) to rotate\n * @returns {quat} out\n */\nexport function rotateX(out, a, rad) {\n  rad *= 0.5;\n  var ax = a[0],\n    ay = a[1],\n    az = a[2],\n    aw = a[3];\n  var bx = Math.sin(rad),\n    bw = Math.cos(rad);\n  out[0] = ax * bw + aw * bx;\n  out[1] = ay * bw + az * bx;\n  out[2] = az * bw - ay * bx;\n  out[3] = aw * bw - ax * bx;\n  return out;\n}\n\n/**\n * Rotates a quaternion by the given angle about the Y axis\n *\n * @param {quat} out quat receiving operation result\n * @param {ReadonlyQuat} a quat to rotate\n * @param {number} rad angle (in radians) to rotate\n * @returns {quat} out\n */\nexport function rotateY(out, a, rad) {\n  rad *= 0.5;\n  var ax = a[0],\n    ay = a[1],\n    az = a[2],\n    aw = a[3];\n  var by = Math.sin(rad),\n    bw = Math.cos(rad);\n  out[0] = ax * bw - az * by;\n  out[1] = ay * bw + aw * by;\n  out[2] = az * bw + ax * by;\n  out[3] = aw * bw - ay * by;\n  return out;\n}\n\n/**\n * Rotates a quaternion by the given angle about the Z axis\n *\n * @param {quat} out quat receiving operation result\n * @param {ReadonlyQuat} a quat to rotate\n * @param {number} rad angle (in radians) to rotate\n * @returns {quat} out\n */\nexport function rotateZ(out, a, rad) {\n  rad *= 0.5;\n  var ax = a[0],\n    ay = a[1],\n    az = a[2],\n    aw = a[3];\n  var bz = Math.sin(rad),\n    bw = Math.cos(rad);\n  out[0] = ax * bw + ay * bz;\n  out[1] = ay * bw - ax * bz;\n  out[2] = az * bw + aw * bz;\n  out[3] = aw * bw - az * bz;\n  return out;\n}\n\n/**\n * Calculates the W component of a quat from the X, Y, and Z components.\n * Assumes that quaternion is 1 unit in length.\n * Any existing W component will be ignored.\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a quat to calculate W component of\n * @returns {quat} out\n */\nexport function calculateW(out, a) {\n  var x = a[0],\n    y = a[1],\n    z = a[2];\n  out[0] = x;\n  out[1] = y;\n  out[2] = z;\n  out[3] = Math.sqrt(Math.abs(1.0 - x * x - y * y - z * z));\n  return out;\n}\n\n/**\n * Calculate the exponential of a unit quaternion.\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a quat to calculate the exponential of\n * @returns {quat} out\n */\nexport function exp(out, a) {\n  var x = a[0],\n    y = a[1],\n    z = a[2],\n    w = a[3];\n  var r = Math.sqrt(x * x + y * y + z * z);\n  var et = Math.exp(w);\n  var s = r > 0 ? et * Math.sin(r) / r : 0;\n  out[0] = x * s;\n  out[1] = y * s;\n  out[2] = z * s;\n  out[3] = et * Math.cos(r);\n  return out;\n}\n\n/**\n * Calculate the natural logarithm of a unit quaternion.\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a quat to calculate the exponential of\n * @returns {quat} out\n */\nexport function ln(out, a) {\n  var x = a[0],\n    y = a[1],\n    z = a[2],\n    w = a[3];\n  var r = Math.sqrt(x * x + y * y + z * z);\n  var t = r > 0 ? Math.atan2(r, w) / r : 0;\n  out[0] = x * t;\n  out[1] = y * t;\n  out[2] = z * t;\n  out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w);\n  return out;\n}\n\n/**\n * Calculate the scalar power of a unit quaternion.\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a quat to calculate the exponential of\n * @param {Number} b amount to scale the quaternion by\n * @returns {quat} out\n */\nexport function pow(out, a, b) {\n  ln(out, a);\n  scale(out, out, b);\n  exp(out, out);\n  return out;\n}\n\n/**\n * Performs a spherical linear interpolation between two quat\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a the first operand\n * @param {ReadonlyQuat} b the second operand\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\n * @returns {quat} out\n */\nexport function slerp(out, a, b, t) {\n  // benchmarks:\n  //    http://jsperf.com/quaternion-slerp-implementations\n  var ax = a[0],\n    ay = a[1],\n    az = a[2],\n    aw = a[3];\n  var bx = b[0],\n    by = b[1],\n    bz = b[2],\n    bw = b[3];\n  var omega, cosom, sinom, scale0, scale1;\n\n  // calc cosine\n  cosom = ax * bx + ay * by + az * bz + aw * bw;\n  // adjust signs (if necessary)\n  if (cosom < 0.0) {\n    cosom = -cosom;\n    bx = -bx;\n    by = -by;\n    bz = -bz;\n    bw = -bw;\n  }\n  // calculate coefficients\n  if (1.0 - cosom > glMatrix.EPSILON) {\n    // standard case (slerp)\n    omega = Math.acos(cosom);\n    sinom = Math.sin(omega);\n    scale0 = Math.sin((1.0 - t) * omega) / sinom;\n    scale1 = Math.sin(t * omega) / sinom;\n  } else {\n    // \"from\" and \"to\" quaternions are very close\n    //  ... so we can do a linear interpolation\n    scale0 = 1.0 - t;\n    scale1 = t;\n  }\n  // calculate final values\n  out[0] = scale0 * ax + scale1 * bx;\n  out[1] = scale0 * ay + scale1 * by;\n  out[2] = scale0 * az + scale1 * bz;\n  out[3] = scale0 * aw + scale1 * bw;\n  return out;\n}\n\n/**\n * Generates a random unit quaternion\n *\n * @param {quat} out the receiving quaternion\n * @returns {quat} out\n */\nexport function random(out) {\n  // Implementation of http://planning.cs.uiuc.edu/node198.html\n  // TODO: Calling random 3 times is probably not the fastest solution\n  var u1 = glMatrix.RANDOM();\n  var u2 = glMatrix.RANDOM();\n  var u3 = glMatrix.RANDOM();\n  var sqrt1MinusU1 = Math.sqrt(1 - u1);\n  var sqrtU1 = Math.sqrt(u1);\n  out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2);\n  out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2);\n  out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3);\n  out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3);\n  return out;\n}\n\n/**\n * Calculates the inverse of a quat\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a quat to calculate inverse of\n * @returns {quat} out\n */\nexport function invert(out, a) {\n  var a0 = a[0],\n    a1 = a[1],\n    a2 = a[2],\n    a3 = a[3];\n  var dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\n  var invDot = dot ? 1.0 / dot : 0;\n\n  // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0\n\n  out[0] = -a0 * invDot;\n  out[1] = -a1 * invDot;\n  out[2] = -a2 * invDot;\n  out[3] = a3 * invDot;\n  return out;\n}\n\n/**\n * Calculates the conjugate of a quat\n * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result.\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a quat to calculate conjugate of\n * @returns {quat} out\n */\nexport function conjugate(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/**\n * Creates a quaternion from the given 3x3 rotation matrix.\n *\n * NOTE: The resultant quaternion is not normalized, so you should be sure\n * to renormalize the quaternion yourself where necessary.\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyMat3} m rotation matrix\n * @returns {quat} out\n * @function\n */\nexport function fromMat3(out, m) {\n  // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes\n  // article \"Quaternion Calculus and Fast Animation\".\n  var fTrace = m[0] + m[4] + m[8];\n  var fRoot;\n  if (fTrace > 0.0) {\n    // |w| > 1/2, may as well choose w > 1/2\n    fRoot = Math.sqrt(fTrace + 1.0); // 2w\n    out[3] = 0.5 * fRoot;\n    fRoot = 0.5 / fRoot; // 1/(4w)\n    out[0] = (m[5] - m[7]) * fRoot;\n    out[1] = (m[6] - m[2]) * fRoot;\n    out[2] = (m[1] - m[3]) * fRoot;\n  } else {\n    // |w| <= 1/2\n    var i = 0;\n    if (m[4] > m[0]) i = 1;\n    if (m[8] > m[i * 3 + i]) i = 2;\n    var j = (i + 1) % 3;\n    var k = (i + 2) % 3;\n    fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1.0);\n    out[i] = 0.5 * fRoot;\n    fRoot = 0.5 / fRoot;\n    out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot;\n    out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot;\n    out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot;\n  }\n  return out;\n}\n\n/**\n * Creates a quaternion from the given euler angle x, y, z using the provided intrinsic order for the conversion.\n *\n * @param {quat} out the receiving quaternion\n * @param {Number} x Angle to rotate around X axis in degrees.\n * @param {Number} y Angle to rotate around Y axis in degrees.\n * @param {Number} z Angle to rotate around Z axis in degrees.\n * @param {'xyz'|'xzy'|'yxz'|'yzx'|'zxy'|'zyx'} order Intrinsic order for conversion, default is zyx.\n * @returns {quat} out\n * @function\n */\nexport function fromEuler(out, x, y, z) {\n  var order = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : glMatrix.ANGLE_ORDER;\n  var halfToRad = Math.PI / 360;\n  x *= halfToRad;\n  z *= halfToRad;\n  y *= halfToRad;\n  var sx = Math.sin(x);\n  var cx = Math.cos(x);\n  var sy = Math.sin(y);\n  var cy = Math.cos(y);\n  var sz = Math.sin(z);\n  var cz = Math.cos(z);\n  switch (order) {\n    case \"xyz\":\n      out[0] = sx * cy * cz + cx * sy * sz;\n      out[1] = cx * sy * cz - sx * cy * sz;\n      out[2] = cx * cy * sz + sx * sy * cz;\n      out[3] = cx * cy * cz - sx * sy * sz;\n      break;\n    case \"xzy\":\n      out[0] = sx * cy * cz - cx * sy * sz;\n      out[1] = cx * sy * cz - sx * cy * sz;\n      out[2] = cx * cy * sz + sx * sy * cz;\n      out[3] = cx * cy * cz + sx * sy * sz;\n      break;\n    case \"yxz\":\n      out[0] = sx * cy * cz + cx * sy * sz;\n      out[1] = cx * sy * cz - sx * cy * sz;\n      out[2] = cx * cy * sz - sx * sy * cz;\n      out[3] = cx * cy * cz + sx * sy * sz;\n      break;\n    case \"yzx\":\n      out[0] = sx * cy * cz + cx * sy * sz;\n      out[1] = cx * sy * cz + sx * cy * sz;\n      out[2] = cx * cy * sz - sx * sy * cz;\n      out[3] = cx * cy * cz - sx * sy * sz;\n      break;\n    case \"zxy\":\n      out[0] = sx * cy * cz - cx * sy * sz;\n      out[1] = cx * sy * cz + sx * cy * sz;\n      out[2] = cx * cy * sz + sx * sy * cz;\n      out[3] = cx * cy * cz - sx * sy * sz;\n      break;\n    case \"zyx\":\n      out[0] = sx * cy * cz - cx * sy * sz;\n      out[1] = cx * sy * cz + sx * cy * sz;\n      out[2] = cx * cy * sz - sx * sy * cz;\n      out[3] = cx * cy * cz + sx * sy * sz;\n      break;\n    default:\n      throw new Error('Unknown angle order ' + order);\n  }\n  return out;\n}\n\n/**\n * Returns a string representation of a quaternion\n *\n * @param {ReadonlyQuat} a vector to represent as a string\n * @returns {String} string representation of the vector\n */\nexport function str(a) {\n  return \"quat(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \")\";\n}\n\n/**\n * Creates a new quat initialized with values from an existing quaternion\n *\n * @param {ReadonlyQuat} a quaternion to clone\n * @returns {quat} a new quaternion\n * @function\n */\nexport var clone = vec4.clone;\n\n/**\n * Creates a new quat 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 {quat} a new quaternion\n * @function\n */\nexport var fromValues = vec4.fromValues;\n\n/**\n * Copy the values from one quat to another\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a the source quaternion\n * @returns {quat} out\n * @function\n */\nexport var copy = vec4.copy;\n\n/**\n * Set the components of a quat to the given values\n *\n * @param {quat} out the receiving quaternion\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 {quat} out\n * @function\n */\nexport var set = vec4.set;\n\n/**\n * Adds two quat's\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a the first operand\n * @param {ReadonlyQuat} b the second operand\n * @returns {quat} out\n * @function\n */\nexport var add = vec4.add;\n\n/**\n * Alias for {@link quat.multiply}\n * @function\n */\nexport var mul = multiply;\n\n/**\n * Scales a quat by a scalar number\n *\n * @param {quat} out the receiving vector\n * @param {ReadonlyQuat} a the vector to scale\n * @param {Number} b amount to scale the vector by\n * @returns {quat} out\n * @function\n */\nexport var scale = vec4.scale;\n\n/**\n * Calculates the dot product of two quat's\n *\n * @param {ReadonlyQuat} a the first operand\n * @param {ReadonlyQuat} b the second operand\n * @returns {Number} dot product of a and b\n * @function\n */\nexport var dot = vec4.dot;\n\n/**\n * Performs a linear interpolation between two quat's\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a the first operand\n * @param {ReadonlyQuat} b the second operand\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\n * @returns {quat} out\n * @function\n */\nexport var lerp = vec4.lerp;\n\n/**\n * Calculates the length of a quat\n *\n * @param {ReadonlyQuat} a vector to calculate length of\n * @returns {Number} length of a\n */\nexport var length = vec4.length;\n\n/**\n * Alias for {@link quat.length}\n * @function\n */\nexport var len = length;\n\n/**\n * Calculates the squared length of a quat\n *\n * @param {ReadonlyQuat} a vector to calculate squared length of\n * @returns {Number} squared length of a\n * @function\n */\nexport var squaredLength = vec4.squaredLength;\n\n/**\n * Alias for {@link quat.squaredLength}\n * @function\n */\nexport var sqrLen = squaredLength;\n\n/**\n * Normalize a quat\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a quaternion to normalize\n * @returns {quat} out\n * @function\n */\nexport var normalize = vec4.normalize;\n\n/**\n * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===)\n *\n * @param {ReadonlyQuat} a The first quaternion.\n * @param {ReadonlyQuat} b The second quaternion.\n * @returns {Boolean} True if the vectors are equal, false otherwise.\n */\nexport var exactEquals = vec4.exactEquals;\n\n/**\n * Returns whether or not the quaternions point approximately to the same direction.\n *\n * Both quaternions are assumed to be unit length.\n *\n * @param {ReadonlyQuat} a The first unit quaternion.\n * @param {ReadonlyQuat} b The second unit quaternion.\n * @returns {Boolean} True if the quaternions are equal, false otherwise.\n */\nexport function equals(a, b) {\n  return Math.abs(vec4.dot(a, b)) >= 1 - glMatrix.EPSILON;\n}\n\n/**\n * Sets a quaternion to represent the shortest rotation from one\n * vector to another.\n *\n * Both vectors are assumed to be unit length.\n *\n * @param {quat} out the receiving quaternion.\n * @param {ReadonlyVec3} a the initial vector\n * @param {ReadonlyVec3} b the destination vector\n * @returns {quat} out\n */\nexport var rotationTo = function () {\n  var tmpvec3 = vec3.create();\n  var xUnitVec3 = vec3.fromValues(1, 0, 0);\n  var yUnitVec3 = vec3.fromValues(0, 1, 0);\n  return function (out, a, b) {\n    var dot = vec3.dot(a, b);\n    if (dot < -0.999999) {\n      vec3.cross(tmpvec3, xUnitVec3, a);\n      if (vec3.len(tmpvec3) < 0.000001) vec3.cross(tmpvec3, yUnitVec3, a);\n      vec3.normalize(tmpvec3, tmpvec3);\n      setAxisAngle(out, tmpvec3, Math.PI);\n      return out;\n    } else if (dot > 0.999999) {\n      out[0] = 0;\n      out[1] = 0;\n      out[2] = 0;\n      out[3] = 1;\n      return out;\n    } else {\n      vec3.cross(tmpvec3, a, b);\n      out[0] = tmpvec3[0];\n      out[1] = tmpvec3[1];\n      out[2] = tmpvec3[2];\n      out[3] = 1 + dot;\n      return normalize(out, out);\n    }\n  };\n}();\n\n/**\n * Performs a spherical linear interpolation with two control points\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a the first operand\n * @param {ReadonlyQuat} b the second operand\n * @param {ReadonlyQuat} c the third operand\n * @param {ReadonlyQuat} d the fourth operand\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\n * @returns {quat} out\n */\nexport var sqlerp = function () {\n  var temp1 = create();\n  var temp2 = create();\n  return function (out, a, b, c, d, t) {\n    slerp(temp1, a, d, t);\n    slerp(temp2, b, c, t);\n    slerp(out, temp1, temp2, 2 * t * (1 - t));\n    return out;\n  };\n}();\n\n/**\n * Sets the specified quaternion with values corresponding to the given\n * axes. Each axis is a vec3 and is expected to be unit length and\n * perpendicular to all other specified axes.\n *\n * @param {ReadonlyVec3} view  the vector representing the viewing direction\n * @param {ReadonlyVec3} right the vector representing the local \"right\" direction\n * @param {ReadonlyVec3} up    the vector representing the local \"up\" direction\n * @returns {quat} out\n */\nexport var setAxes = function () {\n  var matr = mat3.create();\n  return function (out, view, right, up) {\n    matr[0] = right[0];\n    matr[3] = right[1];\n    matr[6] = right[2];\n    matr[1] = up[0];\n    matr[4] = up[1];\n    matr[7] = up[2];\n    matr[2] = -view[0];\n    matr[5] = -view[1];\n    matr[8] = -view[2];\n    return normalize(out, fromMat3(out, matr));\n  };\n}();", "import * as glMatrix from \"./common.js\";\n\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 */\nexport function create() {\n  var out = new glMatrix.ARRAY_TYPE(2);\n  if (glMatrix.ARRAY_TYPE != Float32Array) {\n    out[0] = 0;\n    out[1] = 0;\n  }\n  return out;\n}\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 */\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/**\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 */\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/**\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 */\nexport function copy(out, a) {\n  out[0] = a[0];\n  out[1] = a[1];\n  return out;\n}\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 */\nexport function set(out, x, y) {\n  out[0] = x;\n  out[1] = y;\n  return out;\n}\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 */\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/**\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 */\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/**\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 */\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/**\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 */\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/**\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 */\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/**\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 */\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/**\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 */\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/**\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 */\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/**\n * symmetric 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 */\nexport function round(out, a) {\n  out[0] = glMatrix.round(a[0]);\n  out[1] = glMatrix.round(a[1]);\n  return out;\n}\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 */\nexport function scale(out, a, b) {\n  out[0] = a[0] * b;\n  out[1] = a[1] * b;\n  return out;\n}\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 */\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/**\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 */\nexport function distance(a, b) {\n  var x = b[0] - a[0],\n    y = b[1] - a[1];\n  return Math.sqrt(x * x + y * y);\n}\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 */\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/**\n * Calculates the length of a vec2\n *\n * @param {ReadonlyVec2} a vector to calculate length of\n * @returns {Number} length of a\n */\nexport function length(a) {\n  var x = a[0],\n    y = a[1];\n  return Math.sqrt(x * x + y * y);\n}\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 */\nexport function squaredLength(a) {\n  var x = a[0],\n    y = a[1];\n  return x * x + y * y;\n}\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 */\nexport function negate(out, a) {\n  out[0] = -a[0];\n  out[1] = -a[1];\n  return out;\n}\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 */\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/**\n * Normalize a vec2\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a vector to normalize\n * @returns {vec2} out\n */\nexport function normalize(out, a) {\n  var x = a[0],\n    y = a[1];\n  var len = x * x + y * y;\n  if (len > 0) {\n    //TODO: evaluate use of glm_invsqrt here?\n    len = 1 / Math.sqrt(len);\n  }\n  out[0] = a[0] * len;\n  out[1] = a[1] * len;\n  return out;\n}\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 */\nexport function dot(a, b) {\n  return a[0] * b[0] + a[1] * b[1];\n}\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 */\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/**\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 */\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/**\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 omitted, a unit vector will be returned\n * @returns {vec2} out\n */\nexport function random(out, scale) {\n  scale = scale === undefined ? 1.0 : scale;\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/**\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 */\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/**\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 */\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/**\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 */\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/**\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 */\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/**\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 */\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);\n\n  //perform rotation and translate to correct position\n  out[0] = p0 * cosC - p1 * sinC + b[0];\n  out[1] = p0 * sinC + p1 * cosC + b[1];\n  return out;\n}\n\n/**\n * Get the smallest 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 */\nexport function angle(a, b) {\n  var ax = a[0],\n    ay = a[1],\n    bx = b[0],\n    by = b[1];\n  return Math.abs(Math.atan2(ay * bx - ax * by, ax * bx + ay * by));\n}\n\n/**\n * Get the signed angle in the interval [-pi,pi] between two 2D vectors (positive if `a` is to the right of `b`)\n * \n * @param {ReadonlyVec2} a The first vector\n * @param {ReadonlyVec2} b The second vector\n * @returns {number} The signed angle in radians\n */\nexport function signedAngle(a, b) {\n  var ax = a[0],\n    ay = a[1],\n    bx = b[0],\n    by = b[1];\n  return Math.atan2(ax * by - ay * bx, ax * bx + ay * by);\n}\n\n/**\n * Set the components of a vec2 to zero\n *\n * @param {vec2} out the receiving vector\n * @returns {vec2} out\n */\nexport function zero(out) {\n  out[0] = 0.0;\n  out[1] = 0.0;\n  return out;\n}\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 */\nexport function str(a) {\n  return \"vec2(\" + a[0] + \", \" + a[1] + \")\";\n}\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 */\nexport function exactEquals(a, b) {\n  return a[0] === b[0] && a[1] === b[1];\n}\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 */\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/**\n * Alias for {@link vec2.length}\n * @function\n */\nexport var len = length;\n\n/**\n * Alias for {@link vec2.subtract}\n * @function\n */\nexport var sub = subtract;\n\n/**\n * Alias for {@link vec2.multiply}\n * @function\n */\nexport var mul = multiply;\n\n/**\n * Alias for {@link vec2.divide}\n * @function\n */\nexport var div = divide;\n\n/**\n * Alias for {@link vec2.distance}\n * @function\n */\nexport var dist = distance;\n\n/**\n * Alias for {@link vec2.squaredDistance}\n * @function\n */\nexport var sqrDist = squaredDistance;\n\n/**\n * Alias for {@link vec2.squaredLength}\n * @function\n */\nexport var sqrLen = squaredLength;\n\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 */\nexport var forEach = function () {\n  var vec = create();\n  return function (a, stride, offset, count, fn, arg) {\n    var i, l;\n    if (!stride) {\n      stride = 2;\n    }\n    if (!offset) {\n      offset = 0;\n    }\n    if (count) {\n      l = Math.min(count * stride + offset, a.length);\n    } else {\n      l = a.length;\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    return a;\n  };\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;", "import {EXTENT} from '../data/extent';\n\nimport type {OverscaledTileID} from '../tile/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 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';\nimport {mat3, mat4, quat, vec2, vec3, type vec4} from 'gl-matrix';\nimport {pixelsToTileUnits} from '../source/pixels_to_tile_units';\nimport {type OverscaledTileID} from '../tile/tile_id';\nimport type {Event} from './evented';\n\n/**\n * Ensures that a value is an `Error` instance.\n * If the value is already an `Error`, it is returned as-is.\n * Otherwise, a new `Error` is created from its string representation.\n */\nexport function ensureError(e: unknown): Error {\n    if (e instanceof Error) return e;\n    return new Error(typeof e === 'string' ? e : String(e));\n}\n\n/**\n * Returns a new 64 bit float vec4 of zeroes.\n */\nexport function createVec4f64(): vec4 { return new Float64Array(4) as any; }\n/**\n * Returns a new 64 bit float vec3 of zeroes.\n */\nexport function createVec3f64(): vec3 { return new Float64Array(3) as any; }\n/**\n * Returns a new 64 bit float mat4 of zeroes.\n */\nexport function createMat4f64(): mat4 { return new Float64Array(16) as any; }\n/**\n * Returns a new 32 bit float mat4 of zeroes.\n */\nexport function createMat4f32(): mat4 { return new Float32Array(16) as any; }\n/**\n * Returns a new 64 bit float mat4 set to identity.\n */\nexport function createIdentityMat4f64(): mat4 {\n    const m = new Float64Array(16) as any;\n    mat4.identity(m);\n    return m;\n}\n/**\n * Returns a new 32 bit float mat4 set to identity.\n */\nexport function createIdentityMat4f32(): mat4 {\n    const m = new Float32Array(16) as any;\n    mat4.identity(m);\n    return m;\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 */\nexport function translatePosition(\n    transform: { bearingInRadians: number; zoom: number },\n    tile: { tileID: OverscaledTileID; tileSize: number },\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.bearingInRadians : 0) :\n        (translateAnchor === 'viewport' ? transform.bearingInRadians : 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\n/**\n * Returns the signed distance between a point and a plane.\n * @param plane - The plane equation, in the form where the first three components are the normal and the fourth component is the plane's distance from origin along normal.\n * @param point - The point whose distance from plane is returned.\n * @returns Signed distance of the point from the plane. Positive distances are in the half space where the plane normal points to, negative otherwise.\n */\nexport function pointPlaneSignedDistance(\n    plane: vec4 | [number, number, number, number],\n    point: vec3 | [number, number, number]\n): number {\n    return plane[0] * point[0] + plane[1] * point[1] + plane[2] * point[2] + plane[3];\n}\n\n/**\n * Finds an intersection points of three planes. Returns `null` if no such (single) point exists.\n * The planes *must* be in Hessian normal form - their xyz components must form a unit vector.\n */\nexport function threePlaneIntersection(plane0: vec4, plane1: vec4, plane2: vec4): vec3 | null {\n    // https://mathworld.wolfram.com/Plane-PlaneIntersection.html\n    const det = mat3.determinant([\n        plane0[0], plane0[1], plane0[2],\n        plane1[0], plane1[1], plane1[2],\n        plane2[0], plane2[1], plane2[2]\n    ] as mat3);\n    if (det === 0) {\n        return null;\n    }\n    const cross12 = vec3.cross([] as any, [plane1[0], plane1[1], plane1[2]], [plane2[0], plane2[1], plane2[2]]);\n    const cross20 = vec3.cross([] as any, [plane2[0], plane2[1], plane2[2]], [plane0[0], plane0[1], plane0[2]]);\n    const cross01 = vec3.cross([] as any, [plane0[0], plane0[1], plane0[2]], [plane1[0], plane1[1], plane1[2]]);\n    const sum = vec3.scale([] as any, cross12, -plane0[3]);\n    vec3.add(sum, sum, vec3.scale([] as any, cross20, -plane1[3]));\n    vec3.add(sum, sum, vec3.scale([] as any, cross01, -plane2[3]));\n    vec3.scale(sum, sum, 1.0 / det);\n    return sum;\n}\n\n/**\n * Returns a parameter `t` such that the point obtained by\n * `origin + direction * t` lies on the given plane.\n * If the ray is parallel to the plane, returns null.\n * Returns a negative value if the ray is pointing away from the plane.\n * Direction does not need to be normalized.\n */\nexport function rayPlaneIntersection(origin: vec3, direction: vec3, plane: vec4): number | null {\n    const dotOriginPlane = origin[0] * plane[0] + origin[1] * plane[1] + origin[2] * plane[2];\n    const dotDirectionPlane = direction[0] * plane[0] + direction[1] * plane[1] + direction[2] * plane[2];\n    if (dotDirectionPlane === 0) {\n        return null;\n    }\n    return (-dotOriginPlane -plane[3]) / dotDirectionPlane;\n}\n\n/**\n * Solves a quadratic equation in the form ax^2 + bx + c = 0 and returns its roots in no particular order.\n * Returns null if the equation has no roots or if it has infinitely many roots.\n */\nexport function solveQuadratic(a: number, b: number, c: number): {\n    t0: number;\n    t1: number;\n} {\n    const d = b * b - 4 * a * c;\n    if (d < 0 || (a === 0 && b === 0)) {\n        return null;\n    }\n\n    // Uses a more precise solution from the book Ray Tracing Gems, chapter 7.\n    // https://www.realtimerendering.com/raytracinggems/rtg/index.html\n    const q = -0.5 * (b + Math.sign(b) * Math.sqrt(d));\n    if (Math.abs(q) > 1e-12) {\n        return {\n            t0: c / q,\n            t1: q / a\n        };\n    } else {\n        // Use the schoolbook way if q is too small\n        return {\n            t0: (-b + Math.sqrt(d)) * 0.5 / a,\n            t1: (-b + Math.sqrt(d)) * 0.5 / a\n        };\n    }\n}\n\n/**\n * Returns the angle in radians between two 2D vectors.\n * The angle is signed and describes how much the first vector would need to be be rotated clockwise\n * (assuming X is right and Y is down) so that it points in the same direction as the second vector.\n * @param vec1x - The X component of the first vector.\n * @param vec1y - The Y component of the first vector.\n * @param vec2x - The X component of the second vector.\n * @param vec2y - The Y component of the second vector.\n * @returns The signed angle between the two vectors, in range -PI..PI.\n */\nexport function angleToRotateBetweenVectors2D(vec1x: number, vec1y: number, vec2x: number, vec2y: number): number {\n    // Normalize both vectors\n    const length1 = Math.sqrt(vec1x * vec1x + vec1y * vec1y);\n    const length2 = Math.sqrt(vec2x * vec2x + vec2y * vec2y);\n    vec1x /= length1;\n    vec1y /= length1;\n    vec2x /= length2;\n    vec2y /= length2;\n    const dot = vec1x * vec2x + vec1y * vec2y;\n    const angle = Math.acos(dot);\n    // dot second vector with vector to the right of first (-vec1y, vec1x)\n    const isVec2RightOfVec1 = (-vec1y * vec2x + vec1x * vec2y) > 0;\n    if (isVec2RightOfVec1) {\n        return angle;\n    } else {\n        return -angle;\n    }\n}\n\n/**\n * For two angles in degrees, returns how many degrees to add to the first angle in order to obtain the second angle.\n * The returned difference value is always the shorted of the two - its absolute value is never greater than 180\u00B0.\n */\nexport function differenceOfAnglesDegrees(degreesA: number, degreesB: number): number {\n    const a = mod(degreesA, 360);\n    const b = mod(degreesB, 360);\n    const diff1 = b - a;\n    const diff2 = (b > a) ? (diff1 - 360) : (diff1 + 360);\n    if (Math.abs(diff1) < Math.abs(diff2)) {\n        return diff1;\n    } else {\n        return diff2;\n    }\n}\n\n/**\n * For two angles in radians, returns how many radians to add to the first angle in order to obtain the second angle.\n * The returned difference value is always the shorted of the two - its absolute value is never greater than PI.\n */\nexport function differenceOfAnglesRadians(degreesA: number, degreesB: number): number {\n    const a = mod(degreesA, Math.PI * 2);\n    const b = mod(degreesB, Math.PI * 2);\n    const diff1 = b - a;\n    const diff2 = (b > a) ? (diff1 - Math.PI * 2) : (diff1 + Math.PI * 2);\n    if (Math.abs(diff1) < Math.abs(diff2)) {\n        return diff1;\n    } else {\n        return diff2;\n    }\n}\n\n/**\n * When given two angles in degrees, returns the angular distance between them - the shorter one of the two possible arcs.\n */\nexport function distanceOfAnglesDegrees(degreesA: number, degreesB: number): number {\n    const a = mod(degreesA, 360);\n    const b = mod(degreesB, 360);\n    return Math.min(\n        Math.abs(a - b),\n        Math.abs(a - b + 360),\n        Math.abs(a - b - 360)\n    );\n}\n\n/**\n * When given two angles in radians, returns the angular distance between them - the shorter one of the two possible arcs.\n */\nexport function distanceOfAnglesRadians(radiansA: number, radiansB: number): number {\n    const a = mod(radiansA, Math.PI * 2);\n    const b = mod(radiansB, Math.PI * 2);\n    return Math.min(\n        Math.abs(a - b),\n        Math.abs(a - b + Math.PI * 2),\n        Math.abs(a - b - Math.PI * 2)\n    );\n}\n\n/**\n * Modulo function, as opposed to javascript's `%`, which is a remainder.\n * This functions will return positive values, even if the first operand is negative.\n */\nexport function mod(n, m) {\n    return ((n % m) + m) % m;\n}\n\n/**\n * Takes a value in *old range*, linearly maps that range to *new range*, and returns the value in that new range.\n * Additionally, if the value is outside *old range*, it is clamped inside it.\n * Also works if one of the ranges is flipped (its `min` being larger than `max`).\n */\nexport function remapSaturate(value: number, oldRangeMin: number, oldRangeMax: number, newRangeMin: number, newRangeMax: number): number {\n    const inOldRange = clamp((value - oldRangeMin) / (oldRangeMax - oldRangeMin), 0.0, 1.0);\n    return lerp(newRangeMin, newRangeMax, inOldRange);\n}\n\n/**\n * Linearly interpolate between two values, similar to `mix` function from GLSL. No clamping is done.\n * @param a - The first value to interpolate. This value is returned when mix=0.\n * @param b - The second value to interpolate. This value is returned when mix=1.\n * @param mix - The interpolation factor. Range 0..1 interpolates between `a` and `b`, but values outside this range are also accepted.\n */\nexport function lerp(a: number, b: number, mix: number): number {\n    return a * (1.0 - mix) + b * mix;\n}\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: 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 * For a given set of tile ids, returns the edge tile ids for the bounding box.\n */\nexport function getEdgeTiles(tileIDs: OverscaledTileID[]): Set<OverscaledTileID> {\n    if (!tileIDs.length) return new Set<OverscaledTileID>();\n\n    // set a common zoom for calculation (highest zoom) to reproject all tiles to this same zoom\n    const targetZ = Math.max(...tileIDs.map(id => id.canonical.z));\n\n    // vars to store the min and max tile x/y coordinates for edge finding\n    let minX = Infinity, maxX = -Infinity;\n    let minY = Infinity, maxY = -Infinity;\n\n    // project all tiles to targetZ while maintaining the reference to the original tile\n    const projected: Array<{id: OverscaledTileID; x: number; y: number}> = [];\n    for (const id of tileIDs) {\n        const {x, y, z} = id.canonical;\n        const scale = Math.pow(2, targetZ - z);\n        const px = x * scale;\n        const py = y * scale;\n\n        projected.push({id, x: px, y: py});\n\n        if (px < minX) minX = px;\n        if (px > maxX) maxX = px;\n        if (py < minY) minY = py;\n        if (py > maxY) maxY = py;\n    }\n\n    // find edge tiles using the reprojected tile ids\n    const edgeTiles: Set<OverscaledTileID> = new Set<OverscaledTileID>();\n    for (const p of projected) {\n        if (p.x === minX || p.x === maxX || p.y === minY || p.y === maxY) {\n            edgeTiles.add(p.id);\n        }\n    }\n\n    return edgeTiles;\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): 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: any[]): any;\nexport function extend(dest: object, ...sources: 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 (const k of properties) {\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 * Computes scaling from zoom level.\n */\nexport function zoomScale(zoom: number) { return Math.pow(2, zoom); }\n\n/**\n * Computes zoom level from scaling.\n */\nexport function scaleZoom(scale: number) { return Math.log(scale) / Math.LN2; }\n\n/**\n * Evaluates the snapped zoom level based on zoomSnap. If zoomSnap is 0 or less, the zoom level is returned unchanged.\n * If delta is provided, it performs directional snapping (ceil for zoom-in, floor for zoom-out).\n * @param zoom - The input zoom level\n * @param zoomSnap - The grid interval to snap to, e.g. 1.0 for 1.0 zoom levels, 0.5 for 0.5 zoom levels, etc.\n * @param delta - Optional scroll delta or direction. If positive, snaps up; if negative, snaps down.\n * @returns The snapped zoom level\n */\nexport function evaluateZoomSnap(zoom: number, zoomSnap: number, delta?: number): number {\n    if (zoomSnap <= 0) return zoom;\n    const inv = 1 / zoomSnap;\n    if (delta === undefined || Math.abs(delta) < 1e-10) {\n        return Math.round(zoom * inv) / inv;\n    }\n    return (delta > 0 ? Math.ceil(zoom * inv - 1e-9) : Math.floor(zoom * inv + 1e-10)) / inv;\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 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: T[], b: T[]): boolean {\n    for (const element of a) {\n        if (b.includes(element)) 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\u00B0 when really this is 90\u00B0 (\u03C0/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 {\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 ${ensureError(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 * \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n * \u2502  dest     \u2502\n * \u2502       \u250C\u2500\u2500\u2500\u253C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n * \u2502offset\u2192\u2502\u2593\u2593\u2593\u2502 source\u2502\n * \u2502       \u2502\u2593\u2593\u2593\u2502       \u2502\n * \u2502       \u2514\u2500\u2500\u2500\u253C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n * \u2502stride \u21E0\u254C\u254C\u254C\u2502\n * \u2502\u254C\u254C\u254C\u254C\u254C\u254C\u2192    \u2502\n * \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\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 {\n            // fall back to OffscreenCanvas\n        }\n    }\n    return readImageDataUsingOffscreenCanvas(image, x, y, width, height);\n}\n\n/**\n * Allows to unsubscribe from events without the need to store the method reference.\n */\nexport interface Subscription {\n    /**\n     * Unsubscribes from the event.\n     */\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 * This method converts radians to degrees.\n * The return value is the degrees value.\n * @param degrees - The number of radians\n * @returns degrees\n */\nexport function radiansToDegrees(degrees: number): number {\n    return degrees / Math.PI * 180;\n}\n\nexport type RollPitchBearing = {\n    roll: number;\n    pitch: number;\n    bearing: number;\n};\n\nexport function rollPitchBearingEqual(a: RollPitchBearing, b: RollPitchBearing): boolean {\n    return a.roll == b.roll && a.pitch == b.pitch && a.bearing == b.bearing;\n}\n\n/**\n * This method converts a rotation quaternion to roll, pitch, and bearing angles in degrees.\n * @param rotation - The rotation quaternion\n * @returns roll, pitch, and bearing angles in degrees\n */\nexport function getRollPitchBearing(rotation: quat): RollPitchBearing {\n    const m: mat3 = new Float64Array(9) as any;\n    mat3.fromQuat(m, rotation);\n\n    const xAngle = radiansToDegrees(-Math.asin(clamp(m[2], -1, 1)));\n    let roll: number;\n    let bearing: number;\n    if (Math.hypot(m[5], m[8]) < 1.0e-3) {\n        roll = 0.0;\n        bearing = -radiansToDegrees(Math.atan2(m[3], m[4]));\n    } else {\n        roll = radiansToDegrees((m[5] === 0.0 && m[8] === 0.0) ? 0.0 :  Math.atan2(m[5], m[8]));\n        bearing = radiansToDegrees((m[1] === 0.0 && m[0] === 0.0) ? 0.0 : Math.atan2(m[1], m[0]));\n    }\n\n    return {roll, pitch: xAngle + 90.0, bearing};\n}\n\nexport function getAngleDelta(lastPoint: Point, currentPoint: Point, center: Point): number {\n    const pointVect = vec2.fromValues(currentPoint.x - center.x, currentPoint.y - center.y);\n    const lastPointVec = vec2.fromValues(lastPoint.x - center.x, lastPoint.y - center.y);\n\n    const crossProduct = pointVect[0] * lastPointVec[1] - pointVect[1] * lastPointVec[0];\n    const angleRadians = Math.atan2(crossProduct, vec2.dot(pointVect, lastPointVec));\n    return radiansToDegrees(angleRadians);\n}\n\n/**\n * This method converts roll, pitch, and bearing angles in degrees to a rotation quaternion.\n * @param roll - Roll angle in degrees\n * @param pitch - Pitch angle in degrees\n * @param bearing - Bearing angle in degrees\n * @returns The rotation quaternion\n */\nexport function rollPitchBearingToQuat(roll: number, pitch: number, bearing: number): quat {\n    const rotation: quat = new Float64Array(4) as any;\n    quat.fromEuler(rotation, roll, pitch - 90.0, bearing);\n    return rotation;\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\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* A helper to allow require exactly one one property\n */\nexport type ExactlyOne<T, Keys extends keyof T = keyof T> = {\n    [K in Keys]: Required<Pick<T, K>> & { [P in Exclude<Keys, K>]?: never }\n}[Keys];\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: string[];\n    grids?: string[];\n    data?: 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\nexport const MAX_VALID_LATITUDE = 85.051129;\n\nconst touchableEvents = {\n    touchstart: true,\n    touchmove: true,\n    touchmoveWindow: true,\n    touchend: true,\n    touchcancel: true\n};\n\nconst pointableEvents = {\n    dblclick: true,\n    click: true,\n    mouseover: true,\n    mouseout: true,\n    mousedown: true,\n    mousemove: true,\n    mousemoveWindow: true,\n    mouseup: true,\n    mouseupWindow: true,\n    contextmenu: true,\n    wheel: true\n};\n\nexport function isTouchableEvent(event: Event, eventType: string): event is TouchEvent {\n    return touchableEvents[eventType] && 'touches' in event;\n}\n\n/**\n * Checks if an event is a pointable event (mouse or wheel event).\n * Uses the event target's window context for cross-window support.\n */\nexport function isPointableEvent(event: Event, eventType: string): event is MouseEvent {\n    if (!pointableEvents[eventType]) return false;\n\n    // Get the window context from the event target to use the correct constructor.\n    const domEvent = event as globalThis.Event;\n    const target = domEvent?.target as Element | null;\n    const targetWindow = target?.ownerDocument?.defaultView || window;\n    return domEvent instanceof targetWindow.MouseEvent || domEvent instanceof targetWindow.WheelEvent;\n}\n\nexport function isTouchableOrPointableType(eventType: string): boolean {\n    return touchableEvents[eventType] || pointableEvents[eventType];\n}\n", "/**\n * An error message to use when an operation is aborted\n */\nexport const ABORT_ERROR = 'AbortError';\n\nexport class AbortError extends Error {\n    name = ABORT_ERROR;\n\n    constructor(messageOrError: string | Error = ABORT_ERROR) {\n        super(messageOrError instanceof Error ? messageOrError.message : messageOrError);\n        if (messageOrError instanceof Error && messageOrError.stack) {\n            this.stack = messageOrError.stack;\n        }\n    }\n}\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: unknown): boolean {\n    return error instanceof Error && error.name === ABORT_ERROR;\n}\n\n/**\n * Throws an AbortError if the provided abort signal has already been aborted.\n *\n * @param signal - The abort signal to check.\n * @throws AbortError If the signal is aborted.\n */\nexport function throwIfAborted(signal: AbortSignal): void {\n    if (signal.aborted) {\n        throw new AbortError(signal.reason);\n    }\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 {type 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 * @see [Add a COG raster source](https://maplibre.org/maplibre-gl-js/docs/examples/add-a-cog-raster-source/)\n * @see [Add Contour Lines](https://maplibre.org/maplibre-gl-js/docs/examples/add-contour-lines/)\n * @see [PMTiles source and protocol](https://maplibre.org/maplibre-gl-js/docs/examples/pmtiles-source-and-protocol/)\n * @see [Use addProtocol to Transform Feature Properties](https://maplibre.org/maplibre-gl-js/docs/examples/use-addprotocol-to-transform-feature-properties/)\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 {ensureError, extend, isWorker} from './util';\nimport {AbortError, isAbortError, throwIfAborted} 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; etag?: string};\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     * The referrer policy to use for the request. Controls how much referrer information is sent. (https://developer.mozilla.org/en-US/docs/Web/API/Request/referrerPolicy)\n     */\n    referrerPolicy?: ReferrerPolicy;\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?.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 => url.startsWith('file:') || (getReferrer()?.startsWith('file:') && !/^\\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        referrerPolicy: requestParameters.referrerPolicy,\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    let response: Response;\n    try {\n        response = await fetch(request);\n    } catch (e) {\n        // Pass through AbortErrors for upstream handling\n        if (isAbortError(e)) {\n            throw e;\n        }\n\n        // When the error is due to CORS policy, DNS issue or malformed URL, the fetch call does not resolve but throws a generic TypeError instead.\n        // It is preferable to throw an AJAXError so that the Map event \"error\" can catch it and still have\n        // access to the faulty url. In such case, we provide the arbitrary HTTP error code of `0`.\n        throw new AJAXError(0, ensureError(e).message, requestParameters.url, new Blob());\n    }\n\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    throwIfAborted(abortController.signal);\n    return {data: result, cacheControl: response.headers.get('Cache-Control'), expires: response.headers.get('Expires'), etag: response.headers.get('ETag')};\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'), etag: xhr.getResponseHeader('ETag')});\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(new AbortError(abortController.signal.reason));\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 = async function(requestParameters: RequestParameters, abortController: AbortController): Promise<GetResourceResponse<any>> {\n    if (requestParameters.url.includes('://') && !(/^https?:|^file:/.test(requestParameters.url))) {\n        const protocolLoadFn = getProtocol(requestParameters.url);\n        if (protocolLoadFn) {\n            const response = await protocolLoadFn(requestParameters, abortController);\n            if (!response.data && requestParameters.type === 'arrayBuffer') {\n                // A successful array buffer request should always return data even if empty\n                return extend(response, {data: new ArrayBuffer(0)});\n            }\n            return response;\n        }\n        if (isWorker(self) && 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.hasOwn(Request.prototype, 'signal')) {\n            return makeFetchRequest(requestParameters, abortController);\n        }\n        if (isWorker(self) && 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.startsWith('data:image/') || // data image URL\n        inComingUrl.startsWith('blob:')) { // 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: 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, type Subscription} 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]: Listener[]};\n\nfunction _addEventListener(type: string, listener: Listener, listenerList: Listeners) {\n    const listenerExists = listenerList[type]?.includes(listener);\n    if (!listenerExists) {\n        listenerList[type] ||= [];\n        listenerList[type].push(listener);\n    }\n}\n\nfunction _removeEventListener(type: string, listener: Listener, listenerList: Listeners) {\n    if (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\ntype 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): Subscription {\n        this._listeners ||= {};\n        _addEventListener(type, listener, this._listeners);\n\n        return {\n            unsubscribe: () => {\n                this.off(type, listener);\n            }\n        };\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 ||= {};\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?.[type] ? this._listeners[type].slice() : [];\n            for (const listener of listeners) {\n                listener.call(this, event);\n            }\n\n            const 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?.[type]?.length > 0) ||\n            (this._oneTimeListeners?.[type]?.length > 0) ||\n            (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\tlength: 2\n\t},\n\tcenterAltitude: {\n\t\ttype: \"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\troll: {\n\t\ttype: \"number\",\n\t\t\"default\": 0,\n\t\tunits: \"degrees\"\n\t},\n\tstate: {\n\t\ttype: \"state\",\n\t\t\"default\": {\n\t\t}\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\t\"font-faces\": {\n\t\ttype: \"fontFaces\"\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\tencoding: {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tmvt: {\n\t\t\t},\n\t\t\tmlt: {\n\t\t\t}\n\t\t},\n\t\t\"default\": \"mvt\"\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: \"filter\"\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\t\"color-relief\": {\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_color-relief\",\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\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"global-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-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\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"global-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-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\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"global-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-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\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"global-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-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\t\"feature\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\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\t\"feature\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\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\t\"feature\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\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\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"global-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-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\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"global-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-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\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"global-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-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\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"global-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t}\n};\nvar filter = {\n\ttype: \"boolean\",\n\texpression: {\n\t\tinterpolated: false,\n\t\tparameters: [\n\t\t\t\"zoom\",\n\t\t\t\"feature\"\n\t\t]\n\t},\n\t\"property-type\": \"data-driven\"\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: \"expression_name\",\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: \"projectionDefinition\",\n\t\t\"default\": \"mercator\",\n\t\t\"property-type\": \"data-constant\",\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}\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_color-relief\",\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\t\"feature\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"cross-faded-data-driven\"\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\tresampling: {\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-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: \"numberArray\",\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-altitude\": {\n\t\ttype: \"numberArray\",\n\t\t\"default\": 45,\n\t\tminimum: 0,\n\t\tmaximum: 90,\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: \"colorArray\",\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: \"colorArray\",\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\t\"hillshade-method\": {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tstandard: {\n\t\t\t},\n\t\t\tbasic: {\n\t\t\t},\n\t\t\tcombined: {\n\t\t\t},\n\t\t\tigor: {\n\t\t\t},\n\t\t\tmultidirectional: {\n\t\t\t}\n\t\t},\n\t\t\"default\": \"standard\",\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\tresampling: {\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};\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 interpolation = {\n\ttype: \"array\",\n\tvalue: \"interpolation_name\",\n\tminimum: 1\n};\nvar interpolation_name = {\n\ttype: \"enum\",\n\tvalues: {\n\t\tlinear: {\n\t\t\tsyntax: {\n\t\t\t\toverloads: [\n\t\t\t\t\t{\n\t\t\t\t\t\tparameters: [\n\t\t\t\t\t\t],\n\t\t\t\t\t\t\"output-type\": \"interpolation\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\tparameters: [\n\t\t\t\t]\n\t\t\t}\n\t\t},\n\t\texponential: {\n\t\t\tsyntax: {\n\t\t\t\toverloads: [\n\t\t\t\t\t{\n\t\t\t\t\t\tparameters: [\n\t\t\t\t\t\t\t\"base\"\n\t\t\t\t\t\t],\n\t\t\t\t\t\t\"output-type\": \"interpolation\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\tparameters: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"base\",\n\t\t\t\t\t\ttype: \"number literal\"\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t},\n\t\t\"cubic-bezier\": {\n\t\t\tsyntax: {\n\t\t\t\toverloads: [\n\t\t\t\t\t{\n\t\t\t\t\t\tparameters: [\n\t\t\t\t\t\t\t\"x1\",\n\t\t\t\t\t\t\t\"y1\",\n\t\t\t\t\t\t\t\"x2\",\n\t\t\t\t\t\t\t\"y2\"\n\t\t\t\t\t\t],\n\t\t\t\t\t\t\"output-type\": \"interpolation\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\tparameters: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"x1\",\n\t\t\t\t\t\ttype: \"number literal\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"y1\",\n\t\t\t\t\t\ttype: \"number literal\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"x2\",\n\t\t\t\t\t\ttype: \"number literal\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"y2\",\n\t\t\t\t\t\ttype: \"number literal\"\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t}\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\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"global-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-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\t\"layout_color-relief\": {\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\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"global-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t}\n},\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\t\"paint_color-relief\": {\n\t\"color-relief-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\"color-relief-color\": {\n\t\ttype: \"color\",\n\t\ttransition: false,\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"elevation\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"color-ramp\"\n\t},\n\tresampling: {\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},\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\tinterpolation: interpolation,\n\tinterpolation_name: interpolation_name\n};\n\nconst refProperties = [\n    'type',\n    'source',\n    'source-layer',\n    'minzoom',\n    'maxzoom',\n    'filter',\n    'layout'\n];\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 *\n * The input is not modified. The output may contain references to portions\n * of the input.\n *\n * @param layers - array of layers, some of which may contain `ref` properties\n * whose value is the `id` of another property\n * @returns a new array where such layers have been augmented with the 'type', 'source', etc. properties\n * from the parent layer, and the `ref` property has been removed.\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' &&\n                after[sourceId].type === 'geojson' &&\n                canUpdateGeoJSON(before, after, sourceId)) {\n                addCommand(commands, {\n                    command: 'setGeoJSONSourceData',\n                    args: [sourceId, after[sourceId].data]\n                });\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) ||\n            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, {\n            command: 'addLayer',\n            args: [afterIndex[layerId], insertBeforeLayerId]\n        });\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) ||\n            !deepEqual(beforeLayer['source-layer'], afterLayer['source-layer']) ||\n            !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) ||\n            !deepEqual(beforeLayer.maxzoom, afterLayer.maxzoom)) {\n            addCommand(commands, {\n                command: 'setLayerZoomRange',\n                args: [layerId, afterLayer.minzoom, afterLayer.maxzoom]\n            });\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' ||\n                prop === 'paint' ||\n                prop === 'filter' ||\n                prop === 'metadata' ||\n                prop === 'minzoom' ||\n                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, {\n                    command: 'setLayerProperty',\n                    args: [layerId, prop, afterLayer[prop]]\n                });\n            }\n        }\n        for (prop in afterLayer) {\n            if (!Object.prototype.hasOwnProperty.call(afterLayer, prop) ||\n                Object.prototype.hasOwnProperty.call(beforeLayer, prop))\n                continue;\n            if (prop === 'layout' ||\n                prop === 'paint' ||\n                prop === 'filter' ||\n                prop === 'metadata' ||\n                prop === 'minzoom' ||\n                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, {\n                    command: 'setLayerProperty',\n                    args: [layerId, prop, afterLayer[prop]]\n                });\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 diff(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.state, after.state)) {\n            commands.push({ command: 'setGlobalState', args: [after.state] });\n        }\n        if (!deepEqual(before.centerAltitude, after.centerAltitude)) {\n            commands.push({ command: 'setCenterAltitude', args: [after.centerAltitude] });\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.roll, after.roll)) {\n            commands.push({ command: 'setRoll', args: [after.roll] });\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 ProjectionDefinitionType = {\n    kind: 'projectionDefinition'\n};\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 ColorArrayType = { kind: 'colorArray' };\nconst NumberArrayType = { kind: 'numberArray' };\nconst ResolvedImageType = { kind: 'resolvedImage' };\nconst VariableAnchorOffsetCollectionType = {\n    kind: 'variableAnchorOffsetCollection'\n};\nfunction array(itemType, N) {\n    return {\n        kind: 'array',\n        itemType,\n        N\n    };\n}\nfunction typeToString(type) {\n    if (type.kind === 'array') {\n        const itemType = typeToString(type.itemType);\n        return typeof type.N === 'number'\n            ? `array<${itemType}, ${type.N}>`\n            : type.itemType.kind === 'value'\n                ? 'array'\n                : `array<${itemType}>`;\n    }\n    else {\n        return type.kind;\n    }\n}\nconst valueMemberTypes = [\n    NullType,\n    NumberType,\n    StringType,\n    BooleanType,\n    ColorType,\n    ProjectionDefinitionType,\n    FormattedType,\n    ObjectType,\n    array(ValueType),\n    PaddingType,\n    NumberArrayType,\n    ColorArrayType,\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') ||\n                !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 ${typeToString(expected)} but found ${typeToString(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.033454 * 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// polyfill for Object.hasOwn\nconst hasOwnProperty = Object.hasOwn ||\n    function hasOwnProperty(object, key) {\n        return Object.prototype.hasOwnProperty.call(object, key);\n    };\nfunction getOwn(object, key) {\n    return hasOwnProperty(object, key) ? object[key] : undefined;\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 = getOwn(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 : 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\nfunction interpolateNumber(from, to, t) {\n    return from + t * (to - from);\n}\nfunction interpolateArray(from, to, t) {\n    return from.map((d, i) => {\n        return interpolateNumber(d, to[i], t);\n    });\n}\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 * 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    static interpolate(from, to, t, spaceKey = 'rgb') {\n        switch (spaceKey) {\n            case 'rgb': {\n                const [r, g, b, alpha] = interpolateArray(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 : interpolateNumber(chroma0, chroma1, t),\n                    interpolateNumber(light0, light1, t),\n                    interpolateNumber(alphaF, alphaT, t)\n                ]);\n                return new Color(r, g, b, alpha, false);\n            }\n            case 'lab': {\n                const [r, g, b, alpha] = labToRgb(interpolateArray(from.lab, to.lab, t));\n                return new Color(r, g, b, alpha, false);\n            }\n        }\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\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 : [], {\n            sensitivity: this.sensitivity,\n            usage: 'search'\n        });\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 : []).resolvedOptions().locale;\n    }\n}\n\nconst VERTICAL_ALIGN_OPTIONS = ['bottom', 'center', 'top'];\nclass FormattedSection {\n    constructor(text, image, scale, fontStack, textColor, verticalAlign) {\n        this.text = text;\n        this.image = image;\n        this.scale = scale;\n        this.fontStack = fontStack;\n        this.textColor = textColor;\n        this.verticalAlign = verticalAlign;\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, null)]);\n    }\n    isEmpty() {\n        if (this.sections.length === 0)\n            return true;\n        return !this.sections.some((section) => section.text.length !== 0 || (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    static interpolate(from, to, t) {\n        return new Padding(interpolateArray(from.values, to.values, t));\n    }\n}\n\n/**\n * An array of numbers. Create instances from\n * bare arrays or numeric values using the static method `NumberArray.parse`.\n * @private\n */\nclass NumberArray {\n    constructor(values) {\n        this.values = values.slice();\n    }\n    /**\n     * Numeric NumberArray values\n     * @param input A NumberArray value\n     * @returns A `NumberArray` instance, or `undefined` if the input is not a valid NumberArray value.\n     */\n    static parse(input) {\n        if (input instanceof NumberArray) {\n            return input;\n        }\n        // Backwards compatibility (e.g. hillshade-illumination-direction): bare number is treated the same as array with single value.\n        if (typeof input === 'number') {\n            return new NumberArray([input]);\n        }\n        if (!Array.isArray(input)) {\n            return undefined;\n        }\n        for (const val of input) {\n            if (typeof val !== 'number') {\n                return undefined;\n            }\n        }\n        return new NumberArray(input);\n    }\n    toString() {\n        return JSON.stringify(this.values);\n    }\n    static interpolate(from, to, t) {\n        return new NumberArray(interpolateArray(from.values, to.values, t));\n    }\n}\n\n/**\n * An array of colors. Create instances from\n * bare arrays or strings using the static method `ColorArray.parse`.\n * @private\n */\nclass ColorArray {\n    constructor(values) {\n        this.values = values.slice();\n    }\n    /**\n     * ColorArray values\n     * @param input A ColorArray value\n     * @returns A `ColorArray` instance, or `undefined` if the input is not a valid ColorArray value.\n     */\n    static parse(input) {\n        if (input instanceof ColorArray) {\n            return input;\n        }\n        // Backwards compatibility (e.g. hillshade-shadow-color): bare Color is treated the same as array with single value.\n        if (typeof input === 'string') {\n            const parsed_val = Color.parse(input);\n            if (!parsed_val) {\n                return undefined;\n            }\n            return new ColorArray([parsed_val]);\n        }\n        if (!Array.isArray(input)) {\n            return undefined;\n        }\n        const colors = [];\n        for (const val of input) {\n            if (typeof val !== 'string') {\n                return undefined;\n            }\n            const parsed_val = Color.parse(val);\n            if (!parsed_val) {\n                return undefined;\n            }\n            colors.push(parsed_val);\n        }\n        return new ColorArray(colors);\n    }\n    toString() {\n        return JSON.stringify(this.values);\n    }\n    static interpolate(from, to, t, spaceKey = 'rgb') {\n        const colors = [];\n        if (from.values.length != to.values.length) {\n            throw new Error(`colorArray: Arrays have mismatched length (${from.values.length} vs. ${to.values.length}), cannot interpolate.`);\n        }\n        for (let i = 0; i < from.values.length; i++) {\n            colors.push(Color.interpolate(from.values[i], to.values[i], t, spaceKey));\n        }\n        return new ColorArray(colors);\n    }\n}\n\nclass RuntimeError extends Error {\n    constructor(message) {\n        super(message);\n        this.name = 'RuntimeError';\n    }\n    toJSON() {\n        return this.message;\n    }\n}\n\n/** Set of valid anchor positions, as a set for validation */\nconst anchors = new Set([\n    'center',\n    'left',\n    'right',\n    'top',\n    'bottom',\n    'top-left',\n    'top-right',\n    'bottom-left',\n    'bottom-right'\n]);\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) || input.length < 1 || 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) ||\n                offsetValue.length !== 2 ||\n                typeof offsetValue[0] !== 'number' ||\n                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    static interpolate(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([interpolateNumber(fx, tx, t), interpolateNumber(fy, ty, t)]);\n        }\n        return new VariableAnchorOffsetCollection(output);\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\nclass ProjectionDefinition {\n    constructor(from, to, transition) {\n        this.from = from;\n        this.to = to;\n        this.transition = transition;\n    }\n    static interpolate(from, to, t) {\n        return new ProjectionDefinition(from, to, t);\n    }\n    static parse(input) {\n        if (input instanceof ProjectionDefinition) {\n            return input;\n        }\n        if (Array.isArray(input) &&\n            input.length === 3 &&\n            typeof input[0] === 'string' &&\n            typeof input[1] === 'string' &&\n            typeof input[2] === 'number') {\n            return new ProjectionDefinition(input[0], input[1], input[2]);\n        }\n        if (typeof input === 'object' &&\n            typeof input.from === 'string' &&\n            typeof input.to === 'string' &&\n            typeof input.transition === 'number') {\n            return new ProjectionDefinition(input.from, input.to, input.transition);\n        }\n        if (typeof input === 'string') {\n            return new ProjectionDefinition(input, input, 1);\n        }\n        return undefined;\n    }\n}\n\nfunction validateRGBA(r, g, b, a) {\n    if (!(typeof r === 'number' &&\n        r >= 0 &&\n        r <= 255 &&\n        typeof g === 'number' &&\n        g >= 0 &&\n        g <= 255 &&\n        typeof b === 'number' &&\n        b >= 0 &&\n        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 ProjectionDefinition ||\n        mixed instanceof Color ||\n        mixed instanceof Collator ||\n        mixed instanceof Formatted ||\n        mixed instanceof Padding ||\n        mixed instanceof NumberArray ||\n        mixed instanceof ColorArray ||\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 ProjectionDefinition) {\n        return ProjectionDefinitionType;\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 NumberArray) {\n        return NumberArrayType;\n    }\n    else if (value instanceof ColorArray) {\n        return ColorArrayType;\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(itemType || ValueType, length);\n    }\n    else {\n        return ObjectType;\n    }\n}\nfunction valueToString(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 ||\n        value instanceof ProjectionDefinition ||\n        value instanceof Formatted ||\n        value instanceof Padding ||\n        value instanceof NumberArray ||\n        value instanceof ColorArray ||\n        value instanceof VariableAnchorOffsetCollection ||\n        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\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' || args[2] < 0 || 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(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 ${typeToString(this.type)}, but found ${typeToString(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 rgba 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 ||\n                    `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 'numberArray': {\n                let input;\n                for (const arg of this.args) {\n                    input = arg.evaluate(ctx);\n                    const val = NumberArray.parse(input);\n                    if (val) {\n                        return val;\n                    }\n                }\n                throw new RuntimeError(`Could not parse numberArray from value '${typeof input === 'string' ? input : JSON.stringify(input)}'`);\n            }\n            case 'colorArray': {\n                let input;\n                for (const arg of this.args) {\n                    input = arg.evaluate(ctx);\n                    const val = ColorArray.parse(input);\n                    if (val) {\n                        return val;\n                    }\n                }\n                throw new RuntimeError(`Could not parse colorArray 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(valueToString(this.args[0].evaluate(ctx)));\n            case 'resolvedImage':\n                return ResolvedImage.fromString(valueToString(this.args[0].evaluate(ctx)));\n            case 'projectionDefinition':\n                return this.args[0].evaluate(ctx);\n            default:\n                return valueToString(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 = new Map();\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\n            ? typeof this.feature.type === 'number'\n                ? geometryTypes[this.feature.type]\n                : this.feature.type\n            : 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.get(input);\n        if (!cached) {\n            cached = Color.parse(input);\n            this._parseColorCache.set(input, cached);\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 ||\n            typeof expr === 'string' ||\n            typeof expr === 'boolean' ||\n            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' ||\n                        expected.kind === 'number' ||\n                        expected.kind === 'boolean' ||\n                        expected.kind === 'object' ||\n                        expected.kind === 'array') &&\n                        actual.kind === 'value') {\n                        parsed = annotate(parsed, expected, options.typeAnnotation || 'assert');\n                    }\n                    else if (('projectionDefinition' === expected.kind &&\n                        ['string', 'array'].includes(actual.kind)) ||\n                        (['color', 'formatted', 'resolvedImage'].includes(expected.kind) &&\n                            ['value', 'string'].includes(actual.kind)) ||\n                        (['padding', 'numberArray'].includes(expected.kind) &&\n                            ['value', 'number', 'array'].includes(actual.kind)) ||\n                        ('colorArray' === expected.kind &&\n                            ['value', 'string', 'array'].includes(actual.kind)) ||\n                        ('variableAnchorOffsetCollection' === expected.kind &&\n                            ['value', 'array'].includes(actual.kind))) {\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) &&\n                    parsed.type.kind !== 'resolvedImage' &&\n                    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(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 ${typeToString(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 ${typeToString(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 ${typeToString(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 2 or 3 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 ${typeToString(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 ${typeToString(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 ${typeToString(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' &&\n            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 2 or 3 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(ValueType), StringType, ValueType])) {\n            return context.error(`Expected first argument to be of type array or string, but found ${typeToString(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 ${typeToString(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) {\n                // 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;\nvar hasRequiredUnitbezier;\n\nfunction requireUnitbezier () {\n\tif (hasRequiredUnitbezier) return unitbezier;\n\thasRequiredUnitbezier = 1;\n\n\tunitbezier = UnitBezier;\n\n\tfunction UnitBezier(p1x, p1y, p2x, p2y) {\n\t    // Calculate the polynomial coefficients, implicit first and last control points are (0,0) and (1,1).\n\t    this.cx = 3.0 * p1x;\n\t    this.bx = 3.0 * (p2x - p1x) - this.cx;\n\t    this.ax = 1.0 - this.cx - this.bx;\n\n\t    this.cy = 3.0 * p1y;\n\t    this.by = 3.0 * (p2y - p1y) - this.cy;\n\t    this.ay = 1.0 - this.cy - this.by;\n\n\t    this.p1x = p1x;\n\t    this.p1y = p1y;\n\t    this.p2x = p2x;\n\t    this.p2y = p2y;\n\t}\n\n\tUnitBezier.prototype = {\n\t    sampleCurveX: function (t) {\n\t        // `ax t^3 + bx t^2 + cx t' expanded using Horner's rule.\n\t        return ((this.ax * t + this.bx) * t + this.cx) * t;\n\t    },\n\n\t    sampleCurveY: function (t) {\n\t        return ((this.ay * t + this.by) * t + this.cy) * t;\n\t    },\n\n\t    sampleCurveDerivativeX: function (t) {\n\t        return (3.0 * this.ax * t + 2.0 * this.bx) * t + this.cx;\n\t    },\n\n\t    solveCurveX: function (x, epsilon) {\n\t        if (epsilon === undefined) epsilon = 1e-6;\n\n\t        if (x < 0.0) return 0.0;\n\t        if (x > 1.0) return 1.0;\n\n\t        var t = x;\n\n\t        // First try a few iterations of Newton's method - normally very fast.\n\t        for (var i = 0; i < 8; i++) {\n\t            var x2 = this.sampleCurveX(t) - x;\n\t            if (Math.abs(x2) < epsilon) return t;\n\n\t            var d2 = this.sampleCurveDerivativeX(t);\n\t            if (Math.abs(d2) < 1e-6) break;\n\n\t            t = t - x2 / d2;\n\t        }\n\n\t        // Fall back to the bisection method for reliability.\n\t        var t0 = 0.0;\n\t        var t1 = 1.0;\n\t        t = x;\n\n\t        for (i = 0; i < 20; i++) {\n\t            x2 = this.sampleCurveX(t);\n\t            if (Math.abs(x2 - x) < epsilon) break;\n\n\t            if (x > x2) {\n\t                t0 = t;\n\t            } else {\n\t                t1 = t;\n\t            }\n\n\t            t = (t1 - t0) * 0.5 + t0;\n\t        }\n\n\t        return t;\n\t    },\n\n\t    solve: function (x, epsilon) {\n\t        return this.sampleCurveY(this.solveCurveX(x, epsilon));\n\t    }\n\t};\n\treturn unitbezier;\n}\n\nvar unitbezierExports = requireUnitbezier();\nvar UnitBezier = /*@__PURE__*/getDefaultExportFromCjs(unitbezierExports);\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(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            context.expectedType != ColorArrayType) {\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, ProjectionDefinitionType) &&\n            !verifyType(outputType, ColorType) &&\n            !verifyType(outputType, PaddingType) &&\n            !verifyType(outputType, NumberArrayType) &&\n            !verifyType(outputType, ColorArrayType) &&\n            !verifyType(outputType, VariableAnchorOffsetCollectionType) &&\n            !verifyType(outputType, array(NumberType))) {\n            return context.error(`Type ${typeToString(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                switch (this.type.kind) {\n                    case 'number':\n                        return interpolateNumber(outputLower, outputUpper, t);\n                    case 'color':\n                        return Color.interpolate(outputLower, outputUpper, t);\n                    case 'padding':\n                        return Padding.interpolate(outputLower, outputUpper, t);\n                    case 'colorArray':\n                        return ColorArray.interpolate(outputLower, outputUpper, t);\n                    case 'numberArray':\n                        return NumberArray.interpolate(outputLower, outputUpper, t);\n                    case 'variableAnchorOffsetCollection':\n                        return VariableAnchorOffsetCollection.interpolate(outputLower, outputUpper, t);\n                    case 'array':\n                        return interpolateArray(outputLower, outputUpper, t);\n                    case 'projectionDefinition':\n                        return ProjectionDefinition.interpolate(outputLower, outputUpper, t);\n                }\n            case 'interpolate-hcl':\n                switch (this.type.kind) {\n                    case 'color':\n                        return Color.interpolate(outputLower, outputUpper, t, 'hcl');\n                    case 'colorArray':\n                        return ColorArray.interpolate(outputLower, outputUpper, t, 'hcl');\n                }\n            case 'interpolate-lab':\n                switch (this.type.kind) {\n                    case 'color':\n                        return Color.interpolate(outputLower, outputUpper, t, 'lab');\n                    case 'colorArray':\n                        return ColorArray.interpolate(outputLower, outputUpper, t, 'lab');\n                }\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}\nconst interpolateFactory = {\n    color: Color.interpolate,\n    number: interpolateNumber,\n    padding: Padding.interpolate,\n    numberArray: NumberArray.interpolate,\n    colorArray: ColorArray.interpolate,\n    variableAnchorOffsetCollection: VariableAnchorOffsetCollection.interpolate,\n    array: interpolateArray\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('Expected 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, {\n                typeAnnotation: 'omit'\n            });\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 && 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' || type.kind === 'number' || type.kind === 'value';\n    }\n}\nfunction eq(ctx, a, b) {\n    return a === b;\n}\nfunction neq(ctx, a, b) {\n    return a !== b;\n}\nfunction lt(ctx, a, b) {\n    return a < b;\n}\nfunction gt(ctx, a, b) {\n    return a > b;\n}\nfunction lteq(ctx, a, b) {\n    return a <= b;\n}\nfunction gteq(ctx, a, b) {\n    return a >= b;\n}\nfunction eqCollate(ctx, a, b, c) {\n    return c.compare(a, b) === 0;\n}\nfunction neqCollate(ctx, a, b, c) {\n    return !eqCollate(ctx, a, b, c);\n}\nfunction ltCollate(ctx, a, b, c) {\n    return c.compare(a, b) < 0;\n}\nfunction gtCollate(ctx, a, b, c) {\n    return c.compare(a, b) > 0;\n}\nfunction lteqCollate(ctx, a, b, c) {\n    return c.compare(a, b) <= 0;\n}\nfunction gteqCollate(ctx, a, b, c) {\n    return c.compare(a, b) >= 0;\n}\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\n                    .concat(1)\n                    .error(`\"${op}\" comparisons are not supported for type '${typeToString(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\n                    .concat(2)\n                    .error(`\"${op}\" comparisons are not supported for type '${typeToString(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 '${typeToString(lhs.type)}' and '${typeToString(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, unit, minFractionDigits, maxFractionDigits) {\n        this.type = StringType;\n        this.number = number;\n        this.locale = locale;\n        this.currency = currency;\n        this.unit = unit;\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 unit = null;\n        if (options['unit']) {\n            unit = context.parse(options['unit'], 1, StringType);\n            if (!unit)\n                return null;\n        }\n        if (currency && unit) {\n            return context.error('NumberFormat options `currency` and `unit` are mutually exclusive');\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, unit, minFractionDigits, maxFractionDigits);\n    }\n    evaluate(ctx) {\n        return new Intl.NumberFormat(this.locale ? this.locale.evaluate(ctx) : [], {\n            style: this.currency ? 'currency' : this.unit ? 'unit' : 'decimal',\n            currency: this.currency ? this.currency.evaluate(ctx) : undefined,\n            unit: this.unit ? this.unit.evaluate(ctx) : undefined,\n            minimumFractionDigits: this.minFractionDigits\n                ? this.minFractionDigits.evaluate(ctx)\n                : undefined,\n            maximumFractionDigits: this.maxFractionDigits\n                ? this.maxFractionDigits.evaluate(ctx)\n                : 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.unit) {\n            fn(this.unit);\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(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                let verticalAlign = null;\n                if (arg['vertical-align']) {\n                    if (typeof arg['vertical-align'] === 'string' &&\n                        !VERTICAL_ALIGN_OPTIONS.includes(arg['vertical-align'])) {\n                        return context.error(`'vertical-align' must be one of: 'bottom', 'center', 'top' but found '${arg['vertical-align']}' instead.`);\n                    }\n                    verticalAlign = context.parse(arg['vertical-align'], 1, StringType);\n                    if (!verticalAlign)\n                        return null;\n                }\n                const lastExpression = sections[sections.length - 1];\n                lastExpression.scale = scale;\n                lastExpression.font = font;\n                lastExpression.textColor = textColor;\n                lastExpression.verticalAlign = verticalAlign;\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' &&\n                    kind !== 'value' &&\n                    kind !== 'null' &&\n                    kind !== 'resolvedImage')\n                    return context.error(\"Formatted text type must be 'string', 'value', 'image' or 'null'.\");\n                nextTokenMayBeObject = true;\n                sections.push({\n                    content,\n                    scale: null,\n                    font: null,\n                    textColor: null,\n                    verticalAlign: null\n                });\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, section.verticalAlign ? section.verticalAlign.evaluate(ctx) : null);\n            }\n            return new FormattedSection(valueToString(evaluatedContent), null, section.scale ? section.scale.evaluate(ctx) : null, section.font ? section.font.evaluate(ctx).join(',') : null, section.textColor ? section.textColor.evaluate(ctx) : null, section.verticalAlign ? section.verticalAlign.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            if (section.verticalAlign) {\n                fn(section.verticalAlign);\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' &&\n            input.type.kind !== 'string' &&\n            input.type.kind !== 'value')\n            return context.error(`Expected argument of type string or array, but found ${typeToString(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 ${typeToString(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] &&\n        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\n            ? -worldSize\n            : polyBBox[0] - p[0] > halfWorldSize\n                ? worldSize\n                : 0;\n        if (shift === 0) {\n            shift =\n                p[0] - polyBBox[2] > halfWorldSize\n                    ? -worldSize\n                    : polyBBox[2] - p[0] > halfWorldSize\n                        ? worldSize\n                        : 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\n/**\n * Rearranges items so that all items in the [left, k] are the smallest.\n * The k-th element will have the (k - left + 1)-th smallest value in [left, right].\n *\n * @template T\n * @param {T[]} arr the array to partially sort (in place)\n * @param {number} k middle index for partial sorting (as defined above)\n * @param {number} [left=0] left index of the range to sort\n * @param {number} [right=arr.length-1] right index\n * @param {(a: T, b: T) => number} [compare = (a, b) => a - b] compare function\n */\nfunction quickselect(arr, k, left = 0, right = arr.length - 1, compare = defaultCompare) {\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            quickselect(arr, k, newLeft, newRight, compare);\n        }\n\n        const t = arr[k];\n        let i = left;\n        /** @type {number} */\n        let 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\n/**\n * @template T\n * @param {T[]} 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 * @template T\n * @param {T} a\n * @param {T} b\n * @returns {number}\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 meridional 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 =\n                    (this.wrap(p[0] - x) * this.kx * dx + (p[1] - y) * this.ky * dy) /\n                        (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 [\n            [range[0], range[0] + size1],\n            [range[0] + size1, range[1]]\n        ];\n    }\n    if (size === 1) {\n        return [range, null];\n    }\n    const size1 = Math.floor(size / 2) - 1;\n    return [\n        [range[0], range[0] + size1],\n        [range[0] + size1 + 1, range[1]]\n    ];\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 &&\n        bbox[1] !== -Infinity &&\n        bbox[2] !== Infinity &&\n        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 &&\n        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\n        .flat()\n        .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\n        .flat()\n        .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\nclass GlobalState {\n    constructor(key) {\n        this.type = ValueType;\n        this.key = key;\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        }\n        const key = args[1];\n        if (key === undefined || key === null) {\n            return context.error('Global state property must be defined.');\n        }\n        if (typeof key !== 'string') {\n            return context.error(`Global state property must be string, but found ${typeof args[1]} instead.`);\n        }\n        return new GlobalState(key);\n    }\n    evaluate(ctx) {\n        var _a;\n        const globalState = (_a = ctx.globals) === null || _a === void 0 ? void 0 : _a.globalState;\n        if (!globalState || Object.keys(globalState).length === 0)\n            return null;\n        return getOwn(globalState, this.key);\n    }\n    eachChild() { }\n    outputDefined() {\n        return false;\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    'global-state': GlobalState\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) ? 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(typeToString(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]) => {\n            throw new RuntimeError(v.evaluate(ctx));\n        }\n    ],\n    typeof: [StringType, [ValueType], (ctx, [v]) => typeToString(typeOf(v.evaluate(ctx)))],\n    'to-rgba': [\n        array(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: [ColorType, [NumberType, NumberType, NumberType], rgba],\n    rgba: [ColorType, [NumberType, NumberType, NumberType, NumberType], rgba],\n    has: {\n        type: BooleanType,\n        overloads: [\n            [[StringType], (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            [[StringType], (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: [ObjectType, [], (ctx) => ctx.properties()],\n    'geometry-type': [StringType, [], (ctx) => ctx.geometryType()],\n    id: [ValueType, [], (ctx) => ctx.id()],\n    zoom: [NumberType, [], (ctx) => ctx.globals.zoom],\n    'heatmap-density': [NumberType, [], (ctx) => ctx.globals.heatmapDensity || 0],\n    elevation: [NumberType, [], (ctx) => ctx.globals.elevation || 0],\n    'line-progress': [NumberType, [], (ctx) => ctx.globals.lineProgress || 0],\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            [[NumberType, NumberType], (ctx, [a, b]) => a.evaluate(ctx) - b.evaluate(ctx)],\n            [[NumberType], (ctx, [a]) => -a.evaluate(ctx)]\n        ]\n    },\n    '/': [NumberType, [NumberType, NumberType], (ctx, [a, b]) => a.evaluate(ctx) / b.evaluate(ctx)],\n    '%': [NumberType, [NumberType, NumberType], (ctx, [a, b]) => a.evaluate(ctx) % b.evaluate(ctx)],\n    ln2: [NumberType, [], () => Math.LN2],\n    pi: [NumberType, [], () => Math.PI],\n    e: [NumberType, [], () => Math.E],\n    '^': [\n        NumberType,\n        [NumberType, NumberType],\n        (ctx, [b, e]) => Math.pow(b.evaluate(ctx), e.evaluate(ctx))\n    ],\n    sqrt: [NumberType, [NumberType], (ctx, [x]) => Math.sqrt(x.evaluate(ctx))],\n    log10: [NumberType, [NumberType], (ctx, [n]) => Math.log(n.evaluate(ctx)) / Math.LN10],\n    ln: [NumberType, [NumberType], (ctx, [n]) => Math.log(n.evaluate(ctx))],\n    log2: [NumberType, [NumberType], (ctx, [n]) => Math.log(n.evaluate(ctx)) / Math.LN2],\n    sin: [NumberType, [NumberType], (ctx, [n]) => Math.sin(n.evaluate(ctx))],\n    cos: [NumberType, [NumberType], (ctx, [n]) => Math.cos(n.evaluate(ctx))],\n    tan: [NumberType, [NumberType], (ctx, [n]) => Math.tan(n.evaluate(ctx))],\n    asin: [NumberType, [NumberType], (ctx, [n]) => Math.asin(n.evaluate(ctx))],\n    acos: [NumberType, [NumberType], (ctx, [n]) => Math.acos(n.evaluate(ctx))],\n    atan: [NumberType, [NumberType], (ctx, [n]) => Math.atan(n.evaluate(ctx))],\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: [NumberType, [NumberType], (ctx, [n]) => Math.abs(n.evaluate(ctx))],\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: [NumberType, [NumberType], (ctx, [n]) => Math.floor(n.evaluate(ctx))],\n    ceil: [NumberType, [NumberType], (ctx, [n]) => Math.ceil(n.evaluate(ctx))],\n    'filter-==': [\n        BooleanType,\n        [StringType, ValueType],\n        (ctx, [k, v]) => ctx.properties()[k.value] === v.value\n    ],\n    'filter-id-==': [BooleanType, [ValueType], (ctx, [v]) => ctx.id() === v.value],\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': [BooleanType, [ValueType], (ctx, [k]) => k.value in ctx.properties()],\n    'filter-has-id': [BooleanType, [], (ctx) => ctx.id() !== null && ctx.id() !== undefined],\n    'filter-type-in': [\n        BooleanType,\n        [array(StringType)],\n        (ctx, [v]) => v.value.indexOf(ctx.geometryType()) >= 0\n    ],\n    'filter-id-in': [\n        BooleanType,\n        [array(ValueType)],\n        (ctx, [v]) => v.value.indexOf(ctx.id()) >= 0\n    ],\n    'filter-in-small': [\n        BooleanType,\n        [StringType, array(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(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            [[BooleanType, BooleanType], (ctx, [a, b]) => a.evaluate(ctx) && b.evaluate(ctx)],\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            [[BooleanType, BooleanType], (ctx, [a, b]) => a.evaluate(ctx) || b.evaluate(ctx)],\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    '!': [BooleanType, [BooleanType], (ctx, [b]) => !b.evaluate(ctx)],\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: [StringType, [StringType], (ctx, [s]) => s.evaluate(ctx).toUpperCase()],\n    downcase: [StringType, [StringType], (ctx, [s]) => s.evaluate(ctx).toLowerCase()],\n    concat: [\n        StringType,\n        varargs(ValueType),\n        (ctx, args) => args.map((arg) => valueToString(arg.evaluate(ctx))).join('')\n    ],\n    split: [\n        array(StringType),\n        [StringType, StringType],\n        (ctx, [s, delim]) => s.evaluate(ctx).split(delim.evaluate(ctx))\n    ],\n    join: [\n        StringType,\n        [array(StringType), StringType],\n        (ctx, [arr, delim]) => arr.evaluate(ctx).join(delim.evaluate(ctx))\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(typeToString).join(', ')})`;\n    }\n    else {\n        return `(${typeToString(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    else if (expression instanceof GlobalState) {\n        return false;\n    }\n    const isTypeAnnotation = expression instanceof Coercion || 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, [\n            'zoom',\n            'heatmap-density',\n            'elevation',\n            'line-progress',\n            'accumulated',\n            'is-supported-script'\n        ]));\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' || e.name === 'geometry-type' || 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' ||\n        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' &&\n        value !== null &&\n        !Array.isArray(value) &&\n        typeOf(value) === ObjectType);\n}\nfunction identityFunction(x) {\n    return x;\n}\nfunction getParseFunction(propertySpec) {\n    switch (propertySpec.type) {\n        case 'color':\n            return Color.parse;\n        case 'padding':\n            return Padding.parse;\n        case 'numberArray':\n            return NumberArray.parse;\n        case 'colorArray':\n            return ColorArray.parse;\n        default:\n            return null;\n    }\n}\nfunction getInnerFunction(type) {\n    switch (type) {\n        case 'exponential':\n            return evaluateExponentialFunction;\n        case 'interval':\n            return evaluateIntervalFunction;\n        case 'categorical':\n            return evaluateCategoricalFunction;\n        case 'identity':\n            return evaluateIdentityFunction;\n        default:\n            throw new Error(`Unknown function type \"${type}\"`);\n    }\n}\nfunction createFunction(parameters, propertySpec) {\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    const parseFn = getParseFunction(propertySpec);\n    if (parseFn) {\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    const innerFun = getInnerFunction(type);\n    let hashedStops;\n    let categoricalKeyType;\n    if (type === 'categorical') {\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    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([\n                featureFunctions[z].zoom,\n                createFunction(featureFunctions[z], propertySpec)\n            ]);\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 }\n            : 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\n                    ? feature.properties[parameters.property]\n                    : 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 = interpolateFactory[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        case 'colorArray':\n            input = ColorArray.parse(input);\n            break;\n        case 'numberArray':\n            input = NumberArray.parse(input);\n            break;\n        default:\n            if (getType(input) !== propertySpec.type &&\n                (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, globalState) {\n        this.expression = expression;\n        this._warningHistory = {};\n        this._evaluator = new EvaluationContext();\n        this._defaultValue = propertySpec ? getDefaultValue(propertySpec) : null;\n        this._enumValues =\n            propertySpec && propertySpec.type === 'enum' ? propertySpec.values : null;\n        this._globalState = globalState;\n    }\n    evaluateWithoutErrorHandling(globals, feature, featureState, canonical, availableImages, formattedSection) {\n        if (this._globalState) {\n            globals = addGlobalState(globals, this._globalState);\n        }\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        if (this._globalState) {\n            globals = addGlobalState(globals, this._globalState);\n        }\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            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)\n                    .map((v) => JSON.stringify(v))\n                    .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) &&\n        expression.length > 0 &&\n        typeof expression[0] === 'string' &&\n        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, globalState) {\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, globalState));\n}\nclass ZoomConstantExpression {\n    constructor(kind, expression, globalState) {\n        this.kind = kind;\n        this._styleExpression = expression;\n        this.isStateDependent =\n            kind !== 'constant' && !isStateConstant(expression.expression);\n        this.globalStateRefs = findGlobalStateRefs(expression.expression);\n        this._globalState = globalState;\n    }\n    evaluateWithoutErrorHandling(globals, feature, featureState, canonical, availableImages, formattedSection) {\n        if (this._globalState) {\n            globals = addGlobalState(globals, this._globalState);\n        }\n        return this._styleExpression.evaluateWithoutErrorHandling(globals, feature, featureState, canonical, availableImages, formattedSection);\n    }\n    evaluate(globals, feature, featureState, canonical, availableImages, formattedSection) {\n        if (this._globalState) {\n            globals = addGlobalState(globals, this._globalState);\n        }\n        return this._styleExpression.evaluate(globals, feature, featureState, canonical, availableImages, formattedSection);\n    }\n}\nclass ZoomDependentExpression {\n    constructor(kind, expression, zoomStops, interpolationType, globalState) {\n        this.kind = kind;\n        this.zoomStops = zoomStops;\n        this._styleExpression = expression;\n        this.isStateDependent =\n            kind !== 'camera' && !isStateConstant(expression.expression);\n        this.globalStateRefs = findGlobalStateRefs(expression.expression);\n        this.interpolationType = interpolationType;\n        this._globalState = globalState;\n    }\n    evaluateWithoutErrorHandling(globals, feature, featureState, canonical, availableImages, formattedSection) {\n        if (this._globalState) {\n            globals = addGlobalState(globals, this._globalState);\n        }\n        return this._styleExpression.evaluateWithoutErrorHandling(globals, feature, featureState, canonical, availableImages, formattedSection);\n    }\n    evaluate(globals, feature, featureState, canonical, availableImages, formattedSection) {\n        if (this._globalState) {\n            globals = addGlobalState(globals, this._globalState);\n        }\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, globalState) {\n    const expression = createExpression(expressionInput, propertySpec, globalState);\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([\n            new ExpressionParsingError('', '\"zoom\" expression may only be used as input to a top-level \"step\" or \"interpolate\" expression.')\n        ]);\n    }\n    else if (zoomCurve instanceof ExpressionParsingError) {\n        return error([zoomCurve]);\n    }\n    else if (zoomCurve instanceof Interpolate && !supportsInterpolation(propertySpec)) {\n        return error([\n            new ExpressionParsingError('', '\"interpolate\" expressions cannot be used with this property')\n        ]);\n    }\n    if (!zoomCurve) {\n        return success(isFeatureConstantResult\n            ? new ZoomConstantExpression('constant', expression.value, globalState)\n            : new ZoomConstantExpression('source', expression.value, globalState));\n    }\n    const interpolationType = zoomCurve instanceof Interpolate ? zoomCurve.interpolation : undefined;\n    return success(isFeatureConstantResult\n        ? new ZoomDependentExpression('camera', expression.value, zoomCurve.labels, interpolationType, globalState)\n        : new ZoomDependentExpression('composite', expression.value, zoomCurve.labels, interpolationType, globalState));\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, globalState) {\n    if (isFunction$1(value)) {\n        return new StylePropertyFunction(value, specification);\n    }\n    else if (isExpression(value)) {\n        const expression = createPropertyExpression(value, specification, globalState);\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' &&\n            (typeof value === 'number' || Array.isArray(value))) {\n            constant = Padding.parse(value);\n        }\n        else if (specification.type === 'numberArray' &&\n            (typeof value === 'number' || Array.isArray(value))) {\n            constant = NumberArray.parse(value);\n        }\n        else if (specification.type === 'colorArray' &&\n            (typeof value === 'string' || Array.isArray(value))) {\n            constant = ColorArray.parse(value);\n        }\n        else if (specification.type === 'variableAnchorOffsetCollection' &&\n            Array.isArray(value)) {\n            constant = VariableAnchorOffsetCollection.parse(value);\n        }\n        else if (specification.type === 'projectionDefinition' && typeof value === 'string') {\n            constant = ProjectionDefinition.parse(value);\n        }\n        return {\n            globalStateRefs: new Set(),\n            _globalState: null,\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 findGlobalStateRefs(expression, results = new Set()) {\n    if (expression instanceof GlobalState) {\n        results.add(expression.key);\n    }\n    expression.eachChild((childExpression) => {\n        findGlobalStateRefs(childExpression, results);\n    });\n    return results;\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        numberArray: NumberArrayType,\n        colorArray: ColorArrayType,\n        projectionDefinition: ProjectionDefinitionType,\n        resolvedImage: ResolvedImageType,\n        variableAnchorOffsetCollection: VariableAnchorOffsetCollectionType\n    };\n    if (spec.type === 'array') {\n        return array(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    switch (spec.type) {\n        case 'color':\n            return Color.parse(spec.default) || null;\n        case 'padding':\n            return Padding.parse(spec.default) || null;\n        case 'numberArray':\n            return NumberArray.parse(spec.default) || null;\n        case 'colorArray':\n            return ColorArray.parse(spec.default) || null;\n        case 'variableAnchorOffsetCollection':\n            return VariableAnchorOffsetCollection.parse(spec.default) || null;\n        case 'projectionDefinition':\n            return ProjectionDefinition.parse(spec.default) || null;\n        default:\n            return spec.default === undefined ? null : spec.default;\n    }\n}\nfunction addGlobalState(globals, globalState) {\n    const { zoom, heatmapDensity, elevation, lineProgress, isSupportedScript, accumulated } = globals !== null && globals !== void 0 ? globals : {};\n    return {\n        zoom,\n        heatmapDensity,\n        elevation,\n        lineProgress,\n        isSupportedScript,\n        accumulated,\n        globalState\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 filter MapLibre filter\n * @param [globalState] Global state object to be used for evaluating 'global-state' expressions\n * @returns filter-evaluating function\n */\nfunction featureFilter(filter, globalState) {\n    if (filter === null || filter === undefined) {\n        return { filter: () => true, needGeometry: false, getGlobalStateRefs: () => new Set() };\n    }\n    if (!isExpressionFilter(filter)) {\n        filter = convertFilter$1(filter);\n    }\n    const compiled = createExpression(filter, filterSpec, globalState);\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 {\n            filter: (globalProperties, feature, canonical) => compiled.value.evaluate(globalProperties, feature, {}, canonical),\n            needGeometry,\n            getGlobalStateRefs: () => findGlobalStateRefs(compiled.value.expression)\n        };\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 === '=='\n        ? convertComparisonOp$1(filter[1], filter[2], '==')\n        : op === '!='\n            ? convertNegation(convertComparisonOp$1(filter[1], filter[2], '=='))\n            : op === '<' || op === '>' || op === '<=' || op === '>='\n                ? convertComparisonOp$1(filter[1], filter[2], op)\n                : op === 'any'\n                    ? convertDisjunctionOp(filter.slice(1))\n                    : op === 'all'\n                        ? ['all'].concat(filter.slice(1).map(convertFilter$1))\n                        : op === 'none'\n                            ? ['all'].concat(filter.slice(1).map(convertFilter$1).map(convertNegation))\n                            : op === 'in'\n                                ? convertInOp$1(filter[1], filter.slice(2))\n                                : op === '!in'\n                                    ? convertNegation(convertInOp$1(filter[1], filter.slice(2)))\n                                    : op === 'has'\n                                        ? convertHasOp$1(filter[1])\n                                        : op === '!has'\n                                            ? 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 evaluation 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\n                    ? child\n                    : ['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 ['match', get, Object.keys(propertySpec.values), get, parameters.default];\n    }\n    else {\n        const expression = [\n            propertySpec.type === 'color' ? 'to-color' : propertySpec.type,\n            get,\n            convertLiteral(parameters.default)\n        ];\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':\n            return 'interpolate-hcl';\n        case 'lab':\n            return 'interpolate-lab';\n        default:\n            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\n            ? expression\n            : [\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\n            ? expression\n            : [\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 = [\n            getInterpolateOperator(parameters),\n            base === 1 ? ['linear'] : ['exponential', base],\n            input\n        ];\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' ||\n        type === 'boolean' ||\n        type === 'string' ||\n        obj === undefined ||\n        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 * Groups layers by their layout-affecting properties.\n * These 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 * @param layers - an array of {@link LayerSpecification}.\n * @param cachedKeys - an object to keep already calculated keys.\n * @returns an array of arrays of {@link LayerSpecification} objects, where each inner array\n * contains layers that share the same layout-affecting properties.\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 specification = v8Spec['$root'][styleKey];\n        if (specification.required) {\n            let value = null;\n            if (styleKey === 'version') {\n                value = version;\n            }\n            else {\n                if (specification.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 &&\n        !(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        // objectKey comes from the user controlled style input, so elementSpecKey may be e.g. \"__proto__\"\n        const elementSpec = getOwn(elementSpecs, elementSpecKey) || elementSpecs['*'];\n        let validateElement;\n        if (getOwn(elementValidators, elementSpecKey)) {\n            validateElement = elementValidators[elementSpecKey];\n        }\n        else if (getOwn(elementSpecs, elementSpecKey)) {\n            if (object[objectKey] === undefined) {\n                // property is possible, set but set to undefined\n                // we only check it if it is required and not defaulted in the next loop\n                // without skipping here, we would alert to properties being set to undefined\n                continue;\n            }\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 &&\n            elementSpecs[elementSpecKey]['default'] === undefined &&\n            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 [\n            new ValidationError(key, array, `array length ${arraySpec.length} expected, length ${array.length} found`)\n        ];\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    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 [\n            new ValidationError(key, value, `${value} is less than the minimum value ${valueSpec.minimum}`)\n        ];\n    }\n    if ('maximum' in valueSpec && value > valueSpec.maximum) {\n        return [\n            new ValidationError(key, value, `${value} is greater than the maximum value ${valueSpec.maximum}`)\n        ];\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' &&\n        options.valueSpec.expression &&\n        !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) &&\n        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 [\n                new ValidationError(options.key, options.value, 'identity function may not have a \"stops\" property')\n            ];\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 [\n                new ValidationError(key, value, `array length 2 expected, length ${value.length} found`)\n            ];\n        }\n        if (isZoomAndPropertyFunction) {\n            if (getType(value[0]) !== 'object') {\n                return [\n                    new ValidationError(key, value, `object expected, ${getType(value[0])} found`)\n                ];\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 [\n                    new ValidationError(key, value[0].zoom, 'stop zoom values must appear in ascending order')\n                ];\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: {\n                    zoom: validateNumber,\n                    value: validateStopDomainValue\n                }\n            }));\n        }\n        else {\n            errors = errors.concat(validateStopDomainValue({\n                key: `${key}[0]`,\n                value: value[0],\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([\n                new ValidationError(`${key}[1]`, value[1], 'expressions are not allowed in function stops.')\n            ]);\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 [\n                new ValidationError(options.key, reportValue, `${type} stop domain type must match previous stop domain type ${stopKeyType}`)\n            ];\n        }\n        if (type !== 'number' && type !== 'string' && type !== 'boolean') {\n            return [\n                new ValidationError(options.key, reportValue, 'stop domain value must be a number, string, or boolean')\n            ];\n        }\n        if (type !== 'number' && functionType !== 'categorical') {\n            let message = `number expected, ${type} found`;\n            if (supportsPropertyExpression(functionValueSpec) && functionType === undefined) {\n                message +=\n                    '\\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' &&\n            type === 'number' &&\n            (!isFinite(value) || Math.floor(value) !== value)) {\n            return [\n                new ValidationError(options.key, reportValue, `integer expected, found ${value}`)\n            ];\n        }\n        if (functionType !== 'categorical' &&\n            type === 'number' &&\n            previousStopDomainValue !== undefined &&\n            value < previousStopDomainValue) {\n            return [\n                new ValidationError(options.key, reportValue, 'stop domain values must appear in ascending order')\n            ];\n        }\n        else {\n            previousStopDomainValue = value;\n        }\n        if (functionType === 'categorical' && value in stopDomainValues) {\n            return [\n                new ValidationError(options.key, reportValue, 'stop domain values must be unique')\n            ];\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 ||\n        expression.value._styleExpression.expression;\n    if (options.expressionContext === 'property' &&\n        options.propertyKey === 'text-font' &&\n        !expressionObj.outputDefined()) {\n        return [\n            new ValidationError(options.key, options.value, `Invalid data expression for \"${options.propertyKey}\". Output values must be contained as literals within the expression.`)\n        ];\n    }\n    if (options.expressionContext === 'property' &&\n        options.propertyType === 'layout' &&\n        !isStateConstant(expressionObj)) {\n        return [\n            new ValidationError(options.key, options.value, '\"feature-state\" data expressions are not supported with layout properties.')\n        ];\n    }\n    if (options.expressionContext === 'filter' && !isStateConstant(expressionObj)) {\n        return [\n            new ValidationError(options.key, options.value, '\"feature-state\" data expressions are not supported with filters.')\n        ];\n    }\n    if (options.expressionContext && options.expressionContext.indexOf('cluster') === 0) {\n        if (!isGlobalPropertyConstant(expressionObj, ['zoom', 'feature-state'])) {\n            return [\n                new ValidationError(options.key, options.value, '\"zoom\" and \"feature-state\" expressions are not supported with cluster properties.')\n            ];\n        }\n        if (options.expressionContext === 'cluster-initial' && !isFeatureConstant(expressionObj)) {\n            return [\n                new ValidationError(options.key, options.value, 'Feature data expressions are not supported with initial expression part of cluster properties.')\n            ];\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))) {\n        // 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)) {\n        // <=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 {\n        // >=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' &&\n        transitionMatch &&\n        layerSpec[transitionMatch[1]] &&\n        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' &&\n        supportsPropertyExpression(valueSpec) &&\n        !valueSpec.tokens &&\n        (tokenMatch = /^{([^}]+)}$/.exec(value))) {\n        return [\n            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    }\n    const errors = [];\n    if (options.layerType === 'symbol') {\n        if (propertyKey === 'text-font' &&\n            isFunction$1(deepUnbundle(value)) &&\n            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    var _a, _b;\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 (getType(layer) !== 'object') {\n        return [new ValidationError(key, layer, `object expected, ${getType(layer)} found`)];\n    }\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-dem' && type === 'color-relief') {\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' &&\n                type !== 'hillshade' &&\n                type !== 'color-relief') {\n                errors.push(new ValidationError(key, layer.source, \"raster-dem source can only be used with layer type 'hillshade' or 'color-relief'.\"));\n            }\n            else if (type === 'line' &&\n                layer.paint &&\n                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    if (type === 'raster' && ((_a = layer.paint) === null || _a === void 0 ? void 0 : _a.resampling) && ((_b = layer.paint) === null || _b === void 0 ? void 0 : _b['raster-resampling'])) {\n        errors.push(new ValidationError(key, layer.paint, `layer \"${layer.id}\" redundantly specifies \"resampling\" and \"raster-resampling\" paint properties, but only one is allowed. It is advised to use \"resampling\".`));\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'\n                        ? [operator, ['accumulated'], ['get', prop]]\n                        : operator;\n                    errors.push(...validateExpression({\n                        key: `${key}.${prop}.map`,\n                        value: mapExpr,\n                        expressionContext: 'cluster-map'\n                    }));\n                    errors.push(...validateExpression({\n                        key: `${key}.${prop}.reduce`,\n                        value: reduceExpr,\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 [\n                new ValidationError(key, null, 'Please use runtime APIs to add canvas sources, rather than including them in stylesheets.', 'source.canvas')\n            ];\n        default:\n            return validateEnum({\n                key: `${key}.type`,\n                value: value.type,\n                valueSpec: {\n                    values: ['vector', 'raster', 'raster-dem', 'geojson', 'video', 'image']\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([\n            new ValidationError('light', light, `object expected, ${rootType} found`)\n        ]);\n        return errors;\n    }\n    for (const key in light) {\n        const transitionMatch = key.match(/^(.*)-transition$/);\n        if (transitionMatch &&\n            lightSpec[transitionMatch[1]] &&\n            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([\n                new ValidationError(key, light[key], `unknown property \"${key}\"`)\n            ]);\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([\n                new ValidationError(key, sky[key], `unknown property \"${key}\"`)\n            ]);\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([\n            new ValidationError('terrain', terrain, `object expected, ${rootType} found`)\n        ]);\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([\n                new ValidationError(key, terrain[key], `unknown property \"${key}\"`)\n            ]);\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 [\n                new ValidationError(key, value, `padding requires 1 to 4 values; ${value.length} values found`)\n            ];\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 validateNumberArray(options) {\n    const key = options.key;\n    const value = options.value;\n    const type = getType(value);\n    if (type === 'array') {\n        const arrayElementSpec = {\n            type: 'number'\n        };\n        if (value.length < 1) {\n            return [\n                new ValidationError(key, value, 'array length at least 1 expected, length 0 found')\n            ];\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 validateColorArray(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) {\n            return [\n                new ValidationError(key, value, 'array length at least 1 expected, length 0 found')\n            ];\n        }\n        let errors = [];\n        for (let i = 0; i < value.length; i++) {\n            errors = errors.concat(validateColor({\n                key: `${key}[${i}]`,\n                value: value[i]}));\n        }\n        return errors;\n    }\n    else {\n        return validateColor({\n            key,\n            value});\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 [\n            new ValidationError(key, value, 'variableAnchorOffsetCollection requires a non-empty array of even length')\n        ];\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 [\n            new ValidationError('projection', projection, `object expected, ${rootType} found`)\n        ];\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([\n                new ValidationError(key, projection[key], `unknown property \"${key}\"`)\n            ]);\n        }\n    }\n    return errors;\n}\n\nfunction validateProjectionDefinition(options) {\n    const key = options.key;\n    let value = options.value;\n    value = value instanceof String ? value.valueOf() : value;\n    const type = getType(value);\n    if (type === 'array' &&\n        !isProjectionDefinitionValue(value) &&\n        !isPropertyValueSpecification(value)) {\n        return [\n            new ValidationError(key, value, `projection expected, invalid array ${JSON.stringify(value)} found`)\n        ];\n    }\n    else if (!['array', 'string'].includes(type)) {\n        return [\n            new ValidationError(key, value, `projection expected, invalid type \"${type}\" found`)\n        ];\n    }\n    return [];\n}\nfunction isPropertyValueSpecification(value) {\n    if (['interpolate', 'step', 'literal'].includes(value[0])) {\n        return true;\n    }\n    return false;\n}\nfunction isProjectionDefinitionValue(value) {\n    return (Array.isArray(value) &&\n        value.length === 3 &&\n        typeof value[0] === 'string' &&\n        typeof value[1] === 'string' &&\n        typeof value[2] === 'number');\n}\n\nfunction isObjectLiteral(anything) {\n    return Boolean(anything) && anything.constructor === Object;\n}\n\nfunction validateState(options) {\n    if (!isObjectLiteral(options.value)) {\n        return [\n            new ValidationError(options.key, options.value, `object expected, ${getType(options.value)} found`)\n        ];\n    }\n    return [];\n}\n\nfunction validateFontFaces(options) {\n    const key = options.key;\n    const value = options.value;\n    const validateSpec = options.validateSpec;\n    const styleSpec = options.styleSpec;\n    const style = options.style;\n    if (!isObjectLiteral(value)) {\n        return [new ValidationError(key, value, `object expected, ${getType(value)} found`)];\n    }\n    const errors = [];\n    for (const fontName in value) {\n        const fontValue = value[fontName];\n        const fontValueType = getType(fontValue);\n        if (fontValueType === 'string') {\n            // Validate as a string URL\n            errors.push(...validateString({\n                key: `${key}.${fontName}`,\n                value: fontValue\n            }));\n        }\n        else if (fontValueType === 'array') {\n            // Validate as an array of font face objects\n            const fontFaceSpec = {\n                url: {\n                    type: 'string',\n                    required: true\n                },\n                'unicode-range': {\n                    type: 'array',\n                    value: 'string'\n                }\n            };\n            for (const [i, fontFace] of fontValue.entries()) {\n                errors.push(...validateObject({\n                    key: `${key}.${fontName}[${i}]`,\n                    value: fontFace,\n                    valueSpec: fontFaceSpec,\n                    styleSpec,\n                    style,\n                    validateSpec\n                }));\n            }\n        }\n        else {\n            errors.push(new ValidationError(`${key}.${fontName}`, fontValue, `string or array expected, ${fontValueType} found`));\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    projectionDefinition: validateProjectionDefinition,\n    string: validateString,\n    formatted: validateFormatted,\n    resolvedImage: validateImage,\n    padding: validatePadding,\n    numberArray: validateNumberArray,\n    colorArray: validateColorArray,\n    variableAnchorOffsetCollection: validateVariableAnchorOffsetCollection,\n    sprite: validateSprite,\n    state: validateState,\n    fontFaces: validateFontFaces\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    }\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.state = wrapCleanErrors(injectValidateSpec(validateState));\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(Object.assign({}, options, { validateSpec: validate }));\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\u2019re\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\u2019t 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, key, value, reference, set }) => {\n        if (isExpression(value) || key.endsWith('-transition') || reference === null)\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 * const 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 === null || reference === void 0 ? void 0 : 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 visibilitySpec = {\n    type: 'enum',\n    'property-type': 'data-constant',\n    expression: {\n        interpolated: false,\n        parameters: ['global-state']\n    },\n    values: { visible: {}, none: {} },\n    transition: false,\n    default: 'visible'\n};\nclass VisibilityExpressionClass {\n    constructor(visibility, globalState) {\n        this._globalState = globalState;\n        this.setValue(visibility);\n    }\n    evaluate() {\n        var _a;\n        return (_a = this._literalValue) !== null && _a !== void 0 ? _a : this._compiledValue.evaluate({});\n    }\n    setValue(visibility) {\n        if (visibility === null ||\n            visibility === undefined ||\n            visibility === 'visible' ||\n            visibility === 'none') {\n            this._literalValue = visibility === 'none' ? 'none' : 'visible';\n            this._compiledValue = undefined;\n            this._globalStateRefs = new Set();\n            return;\n        }\n        const compiled = createExpression(visibility, visibilitySpec, this._globalState);\n        if (compiled.result === 'error') {\n            this._literalValue = 'visible';\n            this._compiledValue = undefined;\n            throw new Error(compiled.value.map((err) => `${err.key}: ${err.message}`).join(', '));\n        }\n        this._literalValue = undefined;\n        this._compiledValue = compiled.value;\n        this._globalStateRefs = findGlobalStateRefs(compiled.value.expression);\n    }\n    getGlobalStateRefs() {\n        return this._globalStateRefs;\n    }\n}\n/**\n * Creates a visibility expression from a visibility specification.\n * @param visibility - the visibility specification, literal or expression\n * @param globalState - the global state object\n * @returns visibility expression object\n */\nfunction createVisibility(visibility, globalState) {\n    return new VisibilityExpressionClass(visibility, globalState);\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, ColorArray, ColorType, CompoundExpression, EvaluationContext, FormatExpression, Formatted, FormattedSection, FormattedType, Interpolate, Literal, NullType, NumberArray, Padding, ParsingError, ProjectionDefinition, ProjectionDefinitionType, ResolvedImage, Step, StyleExpression, StylePropertyFunction, ValidationError, VariableAnchorOffsetCollection, ZoomConstantExpression, ZoomDependentExpression, classifyRings, convertFilter, convertFunction, createExpression, createFunction, createPropertyExpression, createVisibility as createVisibilityExpression, derefLayers, diff, emptyStyle, expression, expressions$1 as expressions, featureFilter, format, styleFunction as function, groupByLayout, interpolateFactory as interpolates, isExpression, isFunction$1 as isFunction, isZoomExpression, v8Spec as latest, migrate, normalizePropertyExpression, supportsPropertyExpression, typeToString 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) => readonly 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): readonly 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?.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            return [...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 (const uid of cell) {\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 (const cell of this.cells) {\n            totalCellLength += cell.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?: 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 | 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: readonly string[];\n        shallow: readonly 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 readonly string[] || [],\n        shallow: options.shallow as readonly string[] || []\n    };\n}\n\nregister('Object', Object);\nregister('Set', Set);\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?.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    return classRegistryKey && classRegistryKey !== 'Object';\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?: 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            if (transferables) {\n                transferables.push(input.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: 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) : {};\n\n    if (!klass.serialize) {\n        for (const key in input) {\n            if (!input.hasOwnProperty(key)) continue;\n            if (registry[classRegistryKey].omit.includes(key)) continue;\n            const property = input[key];\n            properties[key] = registry[classRegistryKey].shallow.includes(key) ?\n                property :\n                serialize(property, transferables);\n        }\n        if (input instanceof Error) {\n            properties.message = input.message;\n        }\n    } else {\n        if (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.includes(key) ? 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", "// This file is generated. Edit build/generate-unicode-data.ts, then run `npm run generate-unicode-data`.\n\n/**\n * Returns whether the fallback fonts specified by the\n * `localIdeographFontFamily` map option apply to the given codepoint. \n */\nexport function codePointUsesLocalIdeographFontFamily(codePoint: number): boolean {\n    return /[\\u02EA\\u02EB\\u1100-\\u11FF\\u2E80-\\u2FDF\\u3000-\\u30FF\\u3105-\\u312F\\u3131-\\u318E\\u31A0-\\u4DBF\\u4E00-\\uA48C\\uA490-\\uA4C6\\uA960-\\uA97C\\uAC00-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFE10-\\uFE1F\\uFE30-\\uFE4F\\uFF00-\\uFFEF]|\\uD81B[\\uDFE0-\\uDFFF]|[\\uD81C-\\uD822\\uD840-\\uD868\\uD86A-\\uD86D\\uD86F-\\uD872\\uD874-\\uD879\\uD880-\\uD883\\uD885-\\uD88C][\\uDC00-\\uDFFF]|\\uD823[\\uDC00-\\uDCD5\\uDCFF-\\uDD1E\\uDD80-\\uDDF2]|\\uD82B[\\uDFF0-\\uDFFF]|\\uD82C[\\uDC00-\\uDEFB]|\\uD83C[\\uDE00-\\uDEFF]|\\uD869[\\uDC00-\\uDEDF\\uDF00-\\uDFFF]|\\uD86E[\\uDC00-\\uDC1D\\uDC20-\\uDFFF]|\\uD873[\\uDC00-\\uDEAD\\uDEB0-\\uDFFF]|\\uD87A[\\uDC00-\\uDFE0\\uDFF0-\\uDFFF]|\\uD87B[\\uDC00-\\uDE5D]|\\uD87E[\\uDC00-\\uDE1D]|\\uD884[\\uDC00-\\uDF4A\\uDF50-\\uDFFF]|\\uD88D[\\uDC00-\\uDC79]/gim.test(String.fromCodePoint(codePoint));\n}\n\n/**\n * Returns whether the given codepoint participates in ideographic line\n * breaking.\n */\nexport function codePointAllowsIdeographicBreaking(codePoint: number): boolean {\n    return /[\\u02EA\\u02EB\\u2E80-\\u2FDF\\u2FF0-\\u303F\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FD-\\u30FF\\u3105-\\u312F\\u31A0-\\u4DBF\\u4E00-\\uA48C\\uA490-\\uA4C6\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFE10-\\uFE1F\\uFE30-\\uFE4F\\uFF00-\\uFFEF]|\\uD81B[\\uDFE0-\\uDFFF]|[\\uD81C-\\uD822\\uD840-\\uD868\\uD86A-\\uD86D\\uD86F-\\uD872\\uD874-\\uD879\\uD880-\\uD883\\uD885-\\uD88C][\\uDC00-\\uDFFF]|\\uD823[\\uDC00-\\uDCD5\\uDCFF-\\uDD1E\\uDD80-\\uDDF2]|\\uD82B[\\uDFF0-\\uDFFF]|\\uD82C[\\uDC00-\\uDEFB]|\\uD83C[\\uDE00-\\uDEFF]|\\uD869[\\uDC00-\\uDEDF\\uDF00-\\uDFFF]|\\uD86E[\\uDC00-\\uDC1D\\uDC20-\\uDFFF]|\\uD873[\\uDC00-\\uDEAD\\uDEB0-\\uDFFF]|\\uD87A[\\uDC00-\\uDFE0\\uDFF0-\\uDFFF]|\\uD87B[\\uDC00-\\uDE5D]|\\uD87E[\\uDC00-\\uDE1D]|\\uD884[\\uDC00-\\uDF4A\\uDF50-\\uDFFF]|\\uD88D[\\uDC00-\\uDC79]/gim.test(String.fromCodePoint(codePoint));\n}\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 * \u201Cneutral\u201D character to be drawn upright as well.\n */\nexport function codePointHasUprightVerticalOrientation(codePoint: number): boolean {\n    return /[\\u02EA\\u02EB\\u1100-\\u11FF\\u1400-\\u167F\\u18B0-\\u18F5\\u2E80-\\u2E99\\u2E9B-\\u2EF3\\u2F00-\\u2FD5\\u2FF0-\\u3007\\u3012\\u3013\\u3020-\\u302F\\u3031-\\u303F\\u3041-\\u3096\\u309D-\\u30FB\\u30FD-\\u30FF\\u3105-\\u312F\\u3131-\\u318E\\u3190-\\uA48C\\uA490-\\uA4C6\\uA960-\\uA97C\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFE10-\\uFE1F\\uFE30-\\uFE48\\uFE50-\\uFE57\\uFE5F-\\uFE62\\uFE67-\\uFE6F\\uFF00-\\uFF07\\uFF0A-\\uFF0C\\uFF0E-\\uFF19\\uFF1F-\\uFF3A\\uFF3C\\uFF3E\\uFF40-\\uFF5A\\uFFE0-\\uFFE2\\uFFE4-\\uFFE7]|\\uD802[\\uDD80-\\uDD9F]|\\uD805[\\uDD80-\\uDDFF]|\\uD806[\\uDE00-\\uDEBF]|\\uD811[\\uDC00-\\uDE7F]|\\uD81B[\\uDFE0-\\uDFE4\\uDFF0-\\uDFF6]|[\\uD81C-\\uD822\\uD83D\\uD840-\\uD868\\uD86A-\\uD86D\\uD86F-\\uD872\\uD874-\\uD879\\uD880-\\uD883\\uD885-\\uD88C][\\uDC00-\\uDFFF]|\\uD823[\\uDC00-\\uDCD5\\uDCFF-\\uDD1E\\uDD80-\\uDDF2]|\\uD82B[\\uDFF0-\\uDFF3\\uDFF5-\\uDFFB\\uDFFD\\uDFFE]|\\uD82C[\\uDC00-\\uDD22\\uDD30-\\uDEFB]|\\uD833[\\uDEC0-\\uDFCF]|\\uD834[\\uDC00-\\uDDFF\\uDEE0-\\uDF7F]|\\uD836[\\uDC00-\\uDEAF]|\\uD83C[\\uDC00-\\uDE00\\uDF00-\\uDFFF]|\\uD83E[\\uDD00-\\uDEFF]|\\uD869[\\uDC00-\\uDEDF\\uDF00-\\uDFFF]|\\uD86E[\\uDC00-\\uDC1D\\uDC20-\\uDFFF]|\\uD873[\\uDC00-\\uDEAD\\uDEB0-\\uDFFF]|\\uD87A[\\uDC00-\\uDFE0\\uDFF0-\\uDFFF]|\\uD87B[\\uDC00-\\uDE5D]|\\uD87E[\\uDC00-\\uDE1D]|\\uD884[\\uDC00-\\uDF4A\\uDF50-\\uDFFF]|\\uD88D[\\uDC00-\\uDC79]/gim.test(String.fromCodePoint(codePoint));\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\n * vulgar fraction \u00BD is drawn upright among Chinese characters but rotated among\n * Latin letters. A neutrally oriented character does not influence whether an\n * adjacent character is drawn upright or rotated.\n */\nexport function codePointHasNeutralVerticalOrientation(codePoint: number): boolean {\n    return /[\\xA7\\xA9\\xAE\\xB1\\xBC-\\xBE\\xD7\\xF7\\u2016\\u2020\\u2021\\u2030\\u2031\\u203B\\u203C\\u2042\\u2047-\\u2049\\u2051\\u2100-\\u218F\\u221E\\u2234\\u2235\\u2300-\\u2307\\u230C-\\u231F\\u2324-\\u2328\\u232B\\u237D-\\u239A\\u23BE-\\u23CD\\u23CF\\u23D1-\\u23DB\\u23E2-\\u2422\\u2424-\\u24FF\\u25A0-\\u2619\\u2620-\\u2767\\u2776-\\u2793\\u2B12-\\u2B2F\\u2B50-\\u2B59\\u2BB8-\\u2BEB\\u3000-\\u303F\\u30A0-\\u30FF\\uE000-\\uF8FF\\uFE30-\\uFE6F\\uFF00-\\uFFEF\\uFFFC\\uFFFD]|[\\uDB80-\\uDBFF][\\uDC00-\\uDFFF]/gim.test(String.fromCodePoint(codePoint));\n}\n\n/**\n * Returns whether the give codepoint is likely to require complex text shaping.\n */\nexport function codePointRequiresComplexTextShaping(codePoint: number): boolean {\n    return /[\\u0900-\\u0DFF\\u0F00-\\u109F\\u1780-\\u17FF]/gim.test(String.fromCodePoint(codePoint));\n}\n", "import {\n    codePointAllowsIdeographicBreaking,\n    codePointHasUprightVerticalOrientation,\n    codePointHasNeutralVerticalOrientation,\n    codePointRequiresComplexTextShaping\n} from '../util/unicode_properties.g';\n\nexport function charIsWhitespace(char: number) {\n    return /\\s/u.test(String.fromCodePoint(char));\n}\n\nexport function allowsIdeographicBreaking(chars: string) {\n    for (const char of chars) {\n        if (!codePointAllowsIdeographicBreaking(char.codePointAt(0))) return false;\n    }\n    return true;\n}\n\nexport function allowsVerticalWritingMode(chars: string) {\n    for (const char of chars) {\n        if (codePointHasUprightVerticalOrientation(char.codePointAt(0))) return true;\n    }\n    return false;\n}\n\nexport function allowsLetterSpacing(chars: string) {\n    for (const char of chars) {\n        if (!charAllowsLetterSpacing(char.codePointAt(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: string[]): RegExp {\n    const supportedPropertyEscapes = scriptCodes.map(code => {\n        try {\n            return new RegExp(`\\\\p{sc=${code}}`, 'u').source;\n        } catch {\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 * 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 \u201Cneutral\u201D character to be drawn rotated as well.\n */\nexport function charHasRotatedVerticalOrientation(char: number) {\n    return !(codePointHasUprightVerticalOrientation(char) ||\n             codePointHasNeutralVerticalOrientation(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    return !codePointRequiresComplexTextShaping(char);\n\n}\n\nexport function stringContainsRTLText(chars: string): boolean {\n    for (const char of chars) {\n        if (charInRTLScript(char.codePointAt(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.codePointAt(0), canRenderRTL)) {\n            return false;\n        }\n    }\n    return true;\n}\n", "import {type PluginState, type RTLPluginStatus} from './rtl_text_plugin_status';\n\nexport interface RTLTextPlugin {\n    applyArabicShaping: (a: string) => string;\n    processBidirectionalText: ((b: string, a: number[]) => string[]);\n    processStyledBidirectionalText: ((c: string, b: number[], a: number[]) => Array<[string, number[]]>);\n}\n\nclass RTLWorkerPlugin implements RTLTextPlugin {\n    readonly TIMEOUT = 5000;\n\n    applyArabicShaping: (a: string) => string = null;\n    processBidirectionalText: ((b: string, a: number[]) => string[]) = null;\n    processStyledBidirectionalText: ((c: string, b: number[], a: number[]) => Array<[string, number[]]>) = null;\n    pluginStatus: RTLPluginStatus = 'unavailable';\n    pluginURL: string = null;\n    loadScriptResolve: () => void = () => {};\n\n    private setState(state: PluginState) {\n        this.pluginStatus = state.pluginStatus;\n        this.pluginURL = state.pluginURL;\n    }\n\n    private getState(): PluginState {\n        return {\n            pluginStatus: this.pluginStatus,\n            pluginURL: this.pluginURL\n        };\n    }\n\n    public setMethods(rtlTextPlugin: RTLTextPlugin) {\n        if (rtlWorkerPlugin.isParsed()) {\n            throw new Error('RTL text plugin already registered.');\n        }\n        this.applyArabicShaping = rtlTextPlugin.applyArabicShaping;\n        this.processBidirectionalText = rtlTextPlugin.processBidirectionalText;\n        this.processStyledBidirectionalText = rtlTextPlugin.processStyledBidirectionalText;\n        this.loadScriptResolve();\n    }\n\n    public isParsed(): boolean {\n        return this.applyArabicShaping != null &&\n            this.processBidirectionalText != null &&\n            this.processStyledBidirectionalText != null;\n    }\n\n    public getRTLTextPluginStatus() {\n        return this.pluginStatus;\n    }\n\n    public async syncState(incomingState: PluginState, importScripts: (url: string) => void): Promise<PluginState> {\n        // Parsed plugin cannot be changed, so just return its current state.\n        if (this.isParsed()) {\n            return this.getState();\n        }\n\n        if (incomingState.pluginStatus !== 'loading') {\n            // simply sync and done\n            this.setState(incomingState);\n            return incomingState;\n        }\n        const urlToLoad = incomingState.pluginURL;\n        const loadScriptPromise = new Promise<void>((resolve) => {\n            this.loadScriptResolve = resolve;\n        });\n        importScripts(urlToLoad);\n        const dontWaitForeverTimeoutPromise = new Promise<void>((resolve) => setTimeout(() => resolve(), this.TIMEOUT));\n        await Promise.race([loadScriptPromise, dontWaitForeverTimeoutPromise]);\n        const complete = this.isParsed();\n        if (complete) {\n            const loadedState: PluginState = {\n                pluginStatus: 'loaded',\n                pluginURL: urlToLoad\n            };\n            this.setState(loadedState);\n            return loadedState;\n        }\n\n        // error case\n        this.setState({\n            pluginStatus: 'error',\n            pluginURL: ''\n        });\n        throw new Error(`RTL Text Plugin failed to import scripts from ${urlToLoad}`);\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 {GlobalProperties, 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 * It's main purpose is a parameter to expression `evaluate` methods.\n */\nexport class EvaluationParameters implements GlobalProperties {\n    zoom: number;\n    now: number;\n    fadeDuration: number;\n    zoomHistory: ZoomHistory;\n    transition: TransitionSpecification;\n    // has to be an own property of an object to be used in expressions\n    // if defined as class method, it'll hidden from operations\n    // that iterate over own enumerable properties\n    // (i..e spread operator (...), Object.keys(), for...in statement, etc.)\n    isSupportedScript: (_: string) => boolean = isSupportedScript;\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 || 0;\n            this.fadeDuration = options.fadeDuration || 0;\n            this.zoomHistory = options.zoomHistory || new 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    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\nfunction isSupportedScript(str: string): boolean {\n    return isStringInSupportedScript(str, rtlWorkerPlugin.getRTLTextPluginStatus() === 'loaded');\n}\n", "import {clone, extend, easeCubicInOut} from '../util/util';\nimport {interpolates, type Color, type StylePropertySpecification, normalizePropertyExpression,\n    type Feature,\n    type FeatureState,\n    type StylePropertyExpression,\n    type SourceExpression,\n    type CompositeExpression, type TransitionSpecification,\n    type PropertyValueSpecification} from '@maplibre/maplibre-gl-style-spec';\nimport {register} from '../util/web_worker_transfer';\nimport {EvaluationParameters} from './evaluation_parameters';\n\nimport {type CanonicalTileID} from '../tile/tile_id';\n\ntype TimePoint = number;\n\nexport const TRANSITION_SUFFIX = '-transition';\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?: 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, globalState: Record<string, any>) {\n        this.property = property;\n        this.value = value;\n        this.expression = normalizePropertyExpression(value === undefined ? property.specification.default : value, property.specification, globalState);\n    }\n\n    isDataDriven(): boolean {\n        return this.expression.kind === 'source' || this.expression.kind === 'composite';\n    }\n\n    getGlobalStateRefs(): Set<string> {\n        return this.expression.globalStateRefs || new Set<string>();\n    }\n\n    possiblyEvaluate(\n        parameters: EvaluationParameters,\n        canonical?: CanonicalTileID,\n        availableImages?: 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>, globalState: Record<string, any>) {\n        this.property = property;\n        this.value = new PropertyValue(property, undefined, globalState);\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    private _globalState: Record<string, any>;\n\n    constructor(properties: Properties<Props>, globalState: Record<string, any>) {\n        this._properties = properties;\n        this._values = (Object.create(properties.defaultTransitionablePropertyValues));\n        this._globalState = globalState;\n    }\n\n    hasProperty(name: string): boolean {\n        return name in this._properties.defaultTransitionablePropertyValues;\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.hasOwn(this._values, name)) {\n            this._values[name] = new TransitionablePropertyValue(this._values[name].property, this._globalState);\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), this._globalState);\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.hasOwn(this._values, name)) {\n            this._values[name] = new TransitionablePropertyValue(this._values[name].property, this._globalState);\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_SUFFIX}`] = 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: 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));\n    }\n\n    possiblyEvaluate(\n        parameters: EvaluationParameters,\n        canonical?: CanonicalTileID,\n        availableImages?: 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    private _globalState: Record<string, any>; // reference to global state\n\n    constructor(properties: Properties<Props>, globalState: Record<string, any>) {\n        this._properties = properties;\n        this._values = (Object.create(properties.defaultPropertyValues));\n        this._globalState = globalState;\n    }\n\n    hasValue<S extends keyof Props>(name: S) {\n        return this._values[name].value !== undefined;\n    }\n\n    hasProperty(name: string): boolean {\n        return name in this._properties.defaultPropertyValues;\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), this._globalState) 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?: 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?: 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?: 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?: 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?: 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?: 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?: 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?: 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: 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, undefined);\n            const defaultTransitionablePropertyValue = this.defaultTransitionablePropertyValues[property] =\n                new TransitionablePropertyValue(prop, undefined);\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 {createVisibilityExpression, featureFilter, 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, ErrorEvent} from '../util/evented';\nimport {Layout, Transitionable, type Transitioning, type Properties, PossiblyEvaluated, PossiblyEvaluatedPropertyValue, TRANSITION_SUFFIX} from './properties';\n\nimport type {Bucket, BucketParameters} from '../data/bucket';\nimport type Point from '@mapbox/point-geometry';\nimport type {\n    FeatureFilter,\n    FeatureState,\n    LayerSpecification,\n    FilterSpecification,\n    VisibilitySpecification,\n    VisibilityExpression\n} from '@maplibre/maplibre-gl-style-spec';\nimport type {TransitionParameters, PropertyValue} from './properties';\nimport {type EvaluationParameters} from './evaluation_parameters';\nimport type {CrossfadeParameters} from './evaluation_parameters';\n\nimport type {IReadonlyTransform} from '../geo/transform_interface';\nimport type {CustomLayerInterface} from './style_layer/custom_style_layer';\nimport type {Map} from '../ui/map';\nimport type {StyleSetterOptions} from './style';\nimport {type mat4} from 'gl-matrix';\nimport type {UnwrappedTileID} from '../tile/tile_id';\nimport type {VectorTileFeatureLike} from '@maplibre/vt-pbf';\n\nexport type QueryIntersectsFeatureParams = {\n    /**\n     * The geometry to check intersection with.\n     * This geometry is in tile coordinates.\n     */\n    queryGeometry: Point[];\n    /**\n     * The feature to allow expression evaluation.\n     */\n    feature: VectorTileFeatureLike;\n    /**\n     * The feature state to allow expression evaluation.\n     */\n    featureState: FeatureState;\n    /**\n     * The geometry of the feature.\n     * This geometry is in tile coordinates.\n     */\n    geometry: Point[][];\n    /**\n     * The current zoom level.\n     */\n    zoom: number;\n    /**\n     * The transform to convert from tile coordinates to pixels.\n     */\n    transform: IReadonlyTransform;\n    /**\n     * The number of pixels per tile unit.\n     */\n    pixelsToTileUnits: number;\n    /**\n     * The matrix to convert from tile coordinates to pixel coordinates.\n     * The pixel coordinates are relative to the center of the screen.\n     */\n    pixelPosMatrix: mat4;\n    /**\n     * The unwrapped tile ID for the tile being queried.\n     */\n    unwrappedTileID: UnwrappedTileID;\n    /**\n     * A function to get the elevation of a point in tile coordinates.\n     */\n    getElevation: undefined | ((x: number, y: number) => number);\n};\n\nconst ERROR_PAINT_NOT_LAYOUT = ' is a PAINT property not a LAYOUT property. Use get/setPaintProperty instead?';\nconst ERROR_LAYOUT_NOT_PAINT = ' is a LAYOUT property not a PAINT property. Use get/setLayoutProperty instead?';\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: VisibilitySpecification;\n    private _evaluatedVisibility: 'visible' | 'none' | void;\n\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    _visibilityExpression: VisibilityExpression;\n\n    readonly onAdd: ((map: Map) => void);\n    readonly onRemove: ((map: Map) => void);\n\n    queryRadius?(bucket: Bucket): number;\n    queryIntersectsFeature?(params: QueryIntersectsFeatureParams): boolean | number;\n    createBucket?(parameters: BucketParameters<any>): Bucket;\n\n    private _globalState: Record<string, any>; // reference to global state\n\n    constructor(layer: LayerSpecification | CustomLayerInterface, properties: Readonly<{\n        layout?: Properties<any>;\n        paint?: Properties<any>;\n    }>, globalState: Record<string, any>) {\n        super();\n\n        this.id = layer.id;\n        this.type = layer.type;\n        this._globalState = globalState;\n        this._featureFilter = {filter: () => true, needGeometry: false, getGlobalStateRefs: () => new Set<string>()};\n        this._visibilityExpression = createVisibilityExpression(this.visibility, globalState);\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            this._featureFilter = featureFilter(layer.filter, globalState);\n        }\n\n        if (properties.layout) {\n            this._unevaluatedLayout = new Layout(properties.layout, globalState);\n        }\n\n        if (properties.paint) {\n            this._transitionablePaint = new Transitionable(properties.paint, globalState);\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    setFilter(filter: FilterSpecification | void) {\n        this.filter = filter;\n        this._featureFilter = featureFilter(filter, this._globalState);\n    }\n\n    getCrossfadeParameters() {\n        return this._crossfadeParameters;\n    }\n\n    getLayoutProperty(name: string) {\n        if (name === 'visibility') {\n            return this.visibility;\n        }\n        if (this._transitionablePaint?.hasProperty(name)) {\n            throw new Error(name + ERROR_PAINT_NOT_LAYOUT);\n        }\n        if (!this._unevaluatedLayout) {\n            throw new Error(`Cannot get layout property \"${name}\" on layer type \"${this.type}\" which has no layout properties.`);\n        }\n        return this._unevaluatedLayout.getValue(name);\n    }\n\n    /**\n     * Get list of global state references that are used within layout or filter properties.\n     * This is used to determine if layer source need to be reloaded when global state property changes.\n     *\n     */\n    getLayoutAffectingGlobalStateRefs(): Set<string> {\n        const globalStateRefs = new Set<string>();\n\n        for (const globalStateRef of this._visibilityExpression.getGlobalStateRefs()) {\n            globalStateRefs.add(globalStateRef);\n        }\n\n        if (this._unevaluatedLayout) {\n            for (const propertyName in this._unevaluatedLayout._values) {\n                const value = this._unevaluatedLayout._values[propertyName];\n\n                for (const globalStateRef of value.getGlobalStateRefs()) {\n                    globalStateRefs.add(globalStateRef);\n                }\n            }\n        }\n\n        for (const globalStateRef of this._featureFilter.getGlobalStateRefs()) {\n            globalStateRefs.add(globalStateRef);\n        }\n\n        return globalStateRefs;\n    }\n\n    /**\n     * Get list of global state references that are used within paint properties.\n     * This is used to determine if layer needs to be repainted when global state property changes.\n     *\n     */\n    getPaintAffectingGlobalStateRefs(): globalThis.Map<string, Array<{name: string; value: any}>> {\n        const globalStateRefs = new globalThis.Map<string, Array<{name: string; value: any}>>();\n\n        if (this._transitionablePaint) {\n            for (const propertyName in this._transitionablePaint._values) {\n                const value = this._transitionablePaint._values[propertyName].value;\n\n                for (const globalStateRef of value.getGlobalStateRefs()) {\n                    const properties = globalStateRefs.get(globalStateRef) ?? [];\n                    properties.push({name: propertyName, value: value.value});\n                    globalStateRefs.set(globalStateRef, properties);\n                }\n            }\n        }\n\n        return globalStateRefs;\n    }\n\n    /**\n     * Get list of global state references that are used within visibility expression.\n     * This is used to determine if layer visibility needs to be updated when global state property changes.\n     */\n    getVisibilityAffectingGlobalStateRefs() {\n        return this._visibilityExpression.getGlobalStateRefs();\n    }\n\n    setLayoutProperty(name: string, value: any, options: StyleSetterOptions = {}) {\n        if (name === 'visibility') {\n            this.visibility = value;\n            this._visibilityExpression.setValue(value);\n            this.recalculateVisibility();\n            return;\n        }\n\n        if (this._transitionablePaint?.hasProperty(name)) {\n            this.fire(new ErrorEvent(new Error(name + ERROR_PAINT_NOT_LAYOUT)));\n            return;\n        }\n\n        if (value !== null && value !== undefined && this._validate(validateLayoutProperty, `layers.${this.id}.layout.${name}`, name, value, options))  return;\n\n        this._unevaluatedLayout.setValue(name, value);\n    }\n\n    getPaintProperty(name: string) {\n        if (name.endsWith(TRANSITION_SUFFIX)) {\n            const baseName = name.slice(0, -TRANSITION_SUFFIX.length);\n            if (baseName === 'visibility' || this._unevaluatedLayout?.hasProperty(baseName)) {\n                throw new Error(name + ERROR_LAYOUT_NOT_PAINT);\n            }\n            return this._transitionablePaint.getTransition(baseName);\n        } else {\n            if (name === 'visibility' || this._unevaluatedLayout?.hasProperty(name)) {\n                throw new Error(name + ERROR_LAYOUT_NOT_PAINT);\n            }\n            return this._transitionablePaint.getValue(name);\n        }\n    }\n\n    setPaintProperty(name: string, value: unknown, options: StyleSetterOptions = {}) {\n        if (name === 'visibility' || (this._unevaluatedLayout?.hasProperty(name))) {\n            this.fire(new ErrorEvent(new Error(name + ERROR_LAYOUT_NOT_PAINT)));\n            return false;\n        }\n\n        if (value !== null && value !== undefined && this._validate(validatePaintProperty, `layers.${this.id}.paint.${name}`, name, value, options)) return false;\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 = this.minzoom, roundMinZoom: boolean = false) {\n        if (this.minzoom && zoom < (roundMinZoom ? Math.floor(this.minzoom) : this.minzoom)) return true;\n        if (this.maxzoom && zoom >= this.maxzoom) return true;\n        return this._evaluatedVisibility === '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    recalculateVisibility() {\n        this._evaluatedVisibility = this._visibilityExpression.evaluate();\n    }\n\n    recalculate(parameters: EvaluationParameters, availableImages: 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?.serialize(),\n            'paint': this._transitionablePaint?.serialize()\n        };\n\n        if (this.visibility) {\n            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?.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", "// 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, NumberArray, ColorArray, 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    \"resampling\": DataConstantProperty<\"linear\" | \"nearest\">,\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    \"resampling\": \"linear\" | \"nearest\",\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    \"resampling\": new DataConstantProperty(styleSpec[\"paint_raster\"][\"resampling\"] 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, {type RasterPaintPropsPossiblyEvaluated} from './raster_style_layer_properties.g';\nimport {type Transitionable, type Transitioning, type PossiblyEvaluated} from '../properties';\n\nimport type {RasterPaintProps} from './raster_style_layer_properties.g';\nimport type {LayerSpecification} from '@maplibre/maplibre-gl-style-spec';\n\nexport const isRasterStyleLayer = (layer: StyleLayer): layer is RasterStyleLayer => layer.type === 'raster';\n\nexport class RasterStyleLayer extends StyleLayer {\n    _transitionablePaint: Transitionable<RasterPaintProps>;\n    _transitioningPaint: Transitioning<RasterPaintProps>;\n    paint: PossiblyEvaluated<RasterPaintProps, RasterPaintPropsPossiblyEvaluated>;\n\n    constructor(layer: LayerSpecification, globalState: Record<string, any>) {\n        super(layer, properties, globalState);\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: 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: 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?: 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     * Replace the buffer with an empty one so typed views release the original ArrayBuffer for GC.\n     */\n    freeBufferAfterUpload() {\n        this.arrayBuffer = new ArrayBuffer(0);\n        this._refreshViews();\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] - Uint16[8]\n *\n */\nclass StructArrayLayout8ui16 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) {\n        const i = this.length;\n        this.resize(i + 1);\n        return this.emplace(i, v0, v1, v2, v3, v4, v5, v6, v7);\n    }\n\n    public emplace(i: number, v0: number, v1: number, v2: number, v3: number, v4: number, v5: number, v6: number, v7: number) {\n        const o2 = i * 8;\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        return i;\n    }\n}\n\nStructArrayLayout8ui16.prototype.bytesPerElement = 16;\nregister('StructArrayLayout8ui16', StructArrayLayout8ui16);\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 DashLayoutArray extends StructArrayLayout8ui16 {}\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    StructArrayLayout8ui16,\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 '../webgl/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: Segment[];\n    private _forceNewSegmentOnNextPrepare: boolean = false;\n\n    constructor(segments: Segment[] = []) {\n        this.segments = segments;\n    }\n\n    /**\n     * Returns the last segment if `numVertices` fits into it.\n     * If there are no segments yet or `numVertices` doesn't fit into the last one, creates a new empty segment and returns it.\n     */\n    prepareSegment(\n        numVertices: number,\n        layoutVertexArray: StructArray,\n        indexArray: StructArray,\n        sortKey?: number\n    ): Segment {\n        const lastSegment: Segment = this.segments[this.segments.length - 1];\n\n        if (numVertices > SegmentVector.MAX_VERTEX_ARRAY_LENGTH) {\n            warnOnce(`Max vertices per segment is ${SegmentVector.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${numVertices}. Consider using the \\`fillLargeMeshArrays\\` function if you require meshes with more than ${SegmentVector.MAX_VERTEX_ARRAY_LENGTH} vertices.`);\n        }\n\n        if (this._forceNewSegmentOnNextPrepare || !lastSegment || lastSegment.vertexLength + numVertices > SegmentVector.MAX_VERTEX_ARRAY_LENGTH || lastSegment.sortKey !== sortKey) {\n            return this.createNewSegment(layoutVertexArray, indexArray, sortKey);\n        } else {\n            return lastSegment;\n        }\n    }\n\n    /**\n     * Creates a new empty segment and returns it.\n     */\n    createNewSegment(\n        layoutVertexArray: StructArray,\n        indexArray: StructArray,\n        sortKey?: number\n    ): Segment {\n        const segment: Segment = {\n            vertexOffset: layoutVertexArray.length,\n            primitiveOffset: indexArray.length,\n            vertexLength: 0,\n            primitiveLength: 0,\n            vaos: {}\n        };\n\n        if (sortKey !== undefined) {\n            segment.sortKey = sortKey;\n        }\n\n        // If this was set, we have no need to create a new segment on next prepareSegment call,\n        // since this function already created a new, empty segment.\n        this._forceNewSegmentOnNextPrepare = false;\n        this.segments.push(segment);\n        return segment;\n    }\n\n    /**\n     * Returns the last segment, or creates a new segments if there are no segments yet.\n     */\n    getOrCreateLatestSegment(\n        layoutVertexArray: StructArray,\n        indexArray: StructArray,\n        sortKey?: number\n    ): Segment {\n        return this.prepareSegment(0, layoutVertexArray, indexArray, sortKey);\n    }\n\n    /**\n     * Causes the next call to {@link prepareSegment} to always return a new segment,\n     * not reusing the current segment even if the new geometry would fit it.\n     */\n    forceNewSegmentOnNextPrepare() {\n        this._forceNewSegmentOnNextPrepare = true;\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", "import {createLayout} from '../../util/struct_array';\n\nexport const dashAttributes = createLayout([\n    // [0, y, height, width]\n    {name: 'a_dasharray_from', components: 4, type: 'Uint16'},\n    {name: 'a_dasharray_to', components: 4, type: 'Uint16'},\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", "/**\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", "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: number[];\n    positions: 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): 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: 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 './context';\nimport {type mat4, type vec2, type vec3, type 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\nclass UniformColorArray extends Uniform<Color[]> {\n    constructor(context: Context, location: WebGLUniformLocation) {\n        super(context, location);\n        this.current = new Array<Color>();\n    }\n\n    set(v: Color[]): void {\n        if (v != this.current) {\n            this.current = v;\n            const values = new Float32Array(v.length*4);\n            for( let i = 0; i < v.length; i++) {\n                values[4*i] = v[i].r;\n                values[4*i+1] = v[i].g;\n                values[4*i+2] = v[i].b;\n                values[4*i+3] = v[i].a;\n            }\n            this.gl.uniform4fv(this.location, values);\n        }\n    }\n}\n\nclass UniformFloatArray extends Uniform<number[]> {\n    constructor(context: Context, location: WebGLUniformLocation) {\n        super(context, location);\n        this.current = new Array<number>();\n    }\n\n    set(v: number[]): void {\n        if (v != this.current) {\n            this.current = v;\n            const values = new Float32Array(v);\n            this.gl.uniform1fv(this.location, values);\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    UniformColorArray,\n    UniformFloatArray,\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 {type 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, DashLayoutArray} from './array_types.g';\nimport {clamp} from '../util/util';\nimport {patternAttributes} from './bucket/pattern_attributes';\nimport {dashAttributes} from './bucket/dash_attributes';\nimport {EvaluationParameters} from '../style/evaluation_parameters';\nimport {FeaturePositionMap} from './feature_position_map';\nimport {type Uniform, Uniform1f, UniformColor, Uniform4f} from '../webgl/uniform_binding';\n\nimport type {UniformLocations} from '../webgl/uniform_binding';\n\nimport type {CanonicalTileID} from '../tile/tile_id';\nimport type {Context} from '../webgl/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 '../webgl/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 {DashEntry} from '../render/line_atlas';\nimport type {VectorTileLayerLike} from '@maplibre/vt-pbf';\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\ntype PaintOptions = {\n    imagePositions: {\n        [_: string]: ImagePosition;\n    };\n    dashPositions?: {\n        [_: string]: DashEntry;\n    };\n    canonical?: CanonicalTileID;\n    formattedSection?: FormattedSection;\n    globalState?: Record<string, any>;\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        options: PaintOptions\n    ): void;\n    updatePaintArray(\n        start: number,\n        length: number,\n        feature: Feature,\n        featureState: FeatureState,\n        options: PaintOptions\n    ): void;\n    upload(a: Context): void;\n    destroy(): void;\n}\n\ninterface UniformBinder {\n    uniformNames: 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: string[];\n\n    constructor(value: unknown, names: 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: string[];\n    patternFrom: number[];\n    patternTo: number[];\n    dashFrom: number[];\n    dashTo: number[];\n    pixelRatioFrom: number;\n    pixelRatioTo: number;\n\n    constructor(value: unknown, names: 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    setConstantDashPositions(dashTo: DashEntry, dashFrom: DashEntry) {\n        this.dashTo = [0, dashTo.y, dashTo.height, dashTo.width];\n        this.dashFrom = [0, dashFrom.y, dashFrom.height, dashFrom.width];\n    }\n\n    setUniform(uniform: Uniform<any>, globals: GlobalProperties, currentValue: PossiblyEvaluatedPropertyValue<unknown>, uniformName: string) {\n        let value = null;\n\n        if (uniformName === 'u_pattern_to') {\n            value = this.patternTo;\n        } else if (uniformName === 'u_pattern_from') {\n            value = this.patternFrom;\n        } else if (uniformName === 'u_dasharray_to') {\n            value = this.dashTo;\n        } else if (uniformName === 'u_dasharray_from') {\n            value = this.dashFrom;\n        } else if (uniformName === 'u_pixel_ratio_to') {\n            value = this.pixelRatioTo;\n        } else if (uniformName === 'u_pixel_ratio_from') {\n            value = this.pixelRatioFrom;\n        }\n\n        if (value !== null) {\n            uniform.set(value);\n        }\n    }\n\n    getBinding(context: Context, location: WebGLUniformLocation, name: string): Partial<Uniform<any>> {\n        return (name.startsWith('u_pattern') || name.startsWith('u_dasharray_')) ?\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: StructArrayMember[];\n    paintVertexBuffer: VertexBuffer;\n\n    constructor(expression: SourceExpression, names: 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, options: PaintOptions) {\n        const start = this.paintVertexArray.length;\n        const value = this.expression.evaluate(new EvaluationParameters(0, options), feature, {}, options.canonical, [], options.formattedSection);\n        this.paintVertexArray.resize(newLength);\n        this._setPaintValue(start, newLength, value);\n    }\n\n    updatePaintArray(start: number, end: number, feature: Feature, featureState: FeatureState, options: PaintOptions) {\n        const value = this.expression.evaluate(new EvaluationParameters(0, options), 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?.arrayBuffer.byteLength) {\n            if (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: string[];\n    type: string;\n    useIntegerZoom: boolean;\n    zoom: number;\n    maxValue: number;\n\n    paintVertexArray: StructArray;\n    paintVertexAttributes: StructArrayMember[];\n    paintVertexBuffer: VertexBuffer;\n\n    constructor(expression: CompositeExpression, names: 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, options: PaintOptions) {\n        const min = this.expression.evaluate(new EvaluationParameters(this.zoom, options), feature, {}, options.canonical, [], options.formattedSection);\n        const max = this.expression.evaluate(new EvaluationParameters(this.zoom + 1, options), feature, {}, options.canonical, [], options.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, options: PaintOptions) {\n        const min = this.expression.evaluate(new EvaluationParameters(this.zoom, options), feature, featureState);\n        const max = this.expression.evaluate(new EvaluationParameters(this.zoom + 1, options), 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?.arrayBuffer.byteLength) {\n            if (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\nabstract class CrossFadedBinder<T> 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: 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, options: PaintOptions) {\n        const start = this.zoomInPaintVertexArray.length;\n        this.zoomInPaintVertexArray.resize(length);\n        this.zoomOutPaintVertexArray.resize(length);\n        this._setPaintValues(start, length, this.getPositionIds(feature), options);\n    }\n\n    updatePaintArray(start: number, end: number, feature: Feature, featureState: FeatureState, options: PaintOptions) {\n        this._setPaintValues(start, end, this.getPositionIds(feature), options);\n    }\n\n    abstract getVertexAttributes(): StructArrayMember[];\n\n    protected abstract getPositionIds(feature: Feature): {min: string; mid: string; max: string};\n    protected abstract getPositions(options: PaintOptions): {[_: string]: T};\n    protected abstract emplace(array: StructArray, index: number, midPos: T, minMaxPos: T): void;\n\n    protected _setPaintValues(start: number, end: number, positionIds: {min: string; mid: string; max: string}, options: PaintOptions) {\n        const positions = this.getPositions(options);\n        if (!positions || !positionIds) return;\n        const min = positions[positionIds.min];\n        const mid = positions[positionIds.mid];\n        const max = positions[positionIds.max];\n        if (!min || !mid || !max) 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.emplace(this.zoomInPaintVertexArray, i, mid, min);\n            this.emplace(this.zoomOutPaintVertexArray, i, mid, max);\n        }\n    }\n\n    upload(context: Context) {\n        if (this.zoomInPaintVertexArray?.arrayBuffer.byteLength && this.zoomOutPaintVertexArray?.arrayBuffer.byteLength) {\n            const attributes = this.getVertexAttributes();\n            this.zoomInPaintVertexBuffer = context.createVertexBuffer(this.zoomInPaintVertexArray, attributes, this.expression.isStateDependent);\n            this.zoomOutPaintVertexBuffer = context.createVertexBuffer(this.zoomOutPaintVertexArray, attributes, 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\nclass CrossFadedPatternBinder extends CrossFadedBinder<ImagePosition> {\n    protected getPositions(options: PaintOptions): {[_: string]: ImagePosition} {\n        return options.imagePositions;\n    }\n\n    protected getPositionIds(feature: Feature) {\n        return feature.patterns?.[this.layerId];\n    }\n\n    getVertexAttributes(): StructArrayMember[] {\n        return patternAttributes.members;\n    }\n\n    protected emplace(array: StructArray, index: number, midPos: ImagePosition, minMaxPos: ImagePosition): void {\n        array.emplace(index,\n            midPos.tlbr[0], midPos.tlbr[1], midPos.tlbr[2], midPos.tlbr[3],\n            minMaxPos.tlbr[0], minMaxPos.tlbr[1], minMaxPos.tlbr[2], minMaxPos.tlbr[3],\n            midPos.pixelRatio,\n            minMaxPos.pixelRatio,\n        );\n    }\n}\n\nclass CrossFadedDasharrayBinder extends CrossFadedBinder<DashEntry> {\n    protected getPositions(options: PaintOptions): {[_: string]: DashEntry} {\n        return options.dashPositions;\n    }\n\n    protected getPositionIds(feature: Feature) {\n        return feature.dashes?.[this.layerId];\n    }\n\n    getVertexAttributes(): StructArrayMember[] {\n        return dashAttributes.members;\n    }\n\n    protected emplace(array: StructArray, index: number, midPos: DashEntry, minMaxPos: DashEntry): void {\n        array.emplace(index,\n            0, midPos.y, midPos.height, midPos.width,\n            0, minMaxPos.y, minMaxPos.height, minMaxPos.width,\n        );\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: 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                    property === 'line-dasharray' ?\n                        new CrossFadedDasharrayBinder(expression as CompositeExpression, type, useIntegerZoom, zoom, StructArrayLayout, layer.id) :\n                        new CrossFadedPatternBinder(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, options: PaintOptions) {\n        for (const property in this.binders) {\n            const binder = this.binders[property];\n            if (binder instanceof SourceExpressionBinder || binder instanceof CompositeExpressionBinder || binder instanceof CrossFadedBinder)\n                binder.populatePaintArray(newLength, feature, options);\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    setConstantDashPositions(dashTo: DashEntry, dashFrom: DashEntry) {\n        for (const property in this.binders) {\n            const binder = this.binders[property];\n            if (binder instanceof CrossFadedConstantBinder)\n                binder.setConstantDashPositions(dashTo, dashFrom);\n        }\n    }\n\n    updatePaintArrays(\n        featureStates: FeatureStates,\n        featureMap: FeaturePositionMap,\n        vtLayer: VectorTileLayerLike,\n        layer: TypedStyleLayer,\n        options: PaintOptions\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 CrossFadedBinder) && binder.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.expression = value.value;\n                        binder.updatePaintArray(pos.start, pos.end, feature, featureStates[id], options);\n                        dirty = true;\n                    }\n                }\n            }\n        }\n        return dirty;\n    }\n\n    defines(): 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(): 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 (const attribute of binder.paintVertexAttributes) {\n                    result.push(attribute.name);\n                }\n            } else if (binder instanceof CrossFadedBinder) {\n                const attributes = binder.getVertexAttributes();\n                for (const attribute of attributes) {\n                    result.push(attribute.name);\n                }\n            }\n        }\n        return result;\n    }\n\n    getBinderUniforms(): 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(): VertexBuffer[] {\n        return this._buffers;\n    }\n\n    getUniforms(context: Context, locations: UniformLocations): 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: 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 CrossFadedBinder) {\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 CrossFadedBinder)\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 CrossFadedBinder)\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: readonly 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, options: PaintOptions) {\n        for (const key in this.programConfigurations) {\n            this.programConfigurations[key].populatePaintArrays(length, feature, options);\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: VectorTileLayerLike, layers: readonly TypedStyleLayer[], options: PaintOptions) {\n        for (const layer of layers) {\n            this.needsUpload = this.programConfigurations[layer.id].updatePaintArrays(featureStates, this._featureMap, vtLayer, layer, options) || 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: string, type: string) {\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-dasharray': ['dasharray_to', 'dasharray_from'],\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: string) {\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        'line-dasharray': {\n            'source': DashLayoutArray,\n            'composite': DashLayoutArray\n        },\n    };\n\n    return propertyExceptions[property];\n}\n\nfunction layoutType(property: string, type: string, binderType: string) {\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?.[binderType] || defaultLayouts[type][binderType];\n}\n\nregister('ConstantBinder', ConstantBinder);\nregister('CrossFadedConstantBinder', CrossFadedConstantBinder);\nregister('SourceExpressionBinder', SourceExpressionBinder);\nregister('CrossFadedPatternBinder', CrossFadedPatternBinder);\nregister('CrossFadedDasharrayBinder', CrossFadedDasharrayBinder);\nregister('CompositeExpressionBinder', CompositeExpressionBinder);\nregister('ProgramConfiguration', ProgramConfiguration, {omit: ['_buffers']});\nregister('ProgramConfigurationSet', ProgramConfigurationSet);\n", "import {warnOnce, clamp} from '../util/util';\n\nimport {EXTENT} from './extent';\n\nimport type Point from '@mapbox/point-geometry';\nimport type {VectorTileFeatureLike} from '@maplibre/vt-pbf';\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 VectorTileFeatureLike and scales it to the common extent\n * used internally.\n * @param feature - the vector tile feature to load\n */\nexport function loadGeometry(feature: VectorTileFeatureLike): Point[][] {\n    const scale = EXTENT / feature.extent;\n    const geometry = feature.loadGeometry();\n    for (const ring of geometry) {\n        for (const point of ring) {\n            // round here because mapbox-gl-native uses integers to represent\n            // points and we need to do the same to avoid rendering 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 {Feature} from '@maplibre/maplibre-gl-style-spec';\nimport type {VectorTileFeatureLike} from '@maplibre/vt-pbf';\n\ntype EvaluationFeature = Feature & { geometry: Point[][] };\n/**\n * Construct a new feature based on a VectorTileFeatureLike 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: VectorTileFeatureLike, 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 '../../tile/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 '../../webgl/context';\nimport type {IndexBuffer} from '../../webgl/index_buffer';\nimport type {VertexBuffer} from '../../webgl/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 CircleGranularity} from '../../render/subdivision_granularity_settings';\nimport type {VectorTileLayerLike} from '@maplibre/vt-pbf';\n\nconst VERTEX_MIN_VALUE = -32768; // -(2^15)\n\n// Extrude is in range 0..7, which will be mapped to -1..1 in the shader.\nfunction addCircleVertex(layoutVertexArray, x, y, extrudeX, extrudeY) {\n    // We pack circle position and extrude into range 0..65535, but vertices are stored as *signed* 16-bit integers, so we need to offset the number by 2^15.\n    layoutVertexArray.emplaceBack(\n        VERTEX_MIN_VALUE + (x * 8) + extrudeX,\n        VERTEX_MIN_VALUE + (y * 8) + extrudeY);\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: string[];\n    layers: Layer[];\n    stateDependentLayers: Layer[];\n    stateDependentLayerIds: string[];\n\n    layoutVertexArray: CircleLayoutArray;\n    layoutVertexBuffer: VertexBuffer;\n\n    indexArray: TriangleIndexArray;\n    indexBuffer: IndexBuffer;\n\n    hasDependencies: 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.hasDependencies = 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: 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 circles are usually large (and map-pitch-aligned), tessellate them to allow curvature along the globe.\n        let subdivide = styleLayer.type === 'heatmap';\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            const circleStyle = (styleLayer as CircleStyleLayer);\n            circleSortKey = circleStyle.layout.get('circle-sort-key');\n            sortFeaturesByKey = !circleSortKey.isConstant();\n\n            // Circles that are \"printed\" onto the map surface should be tessellated to follow the globe's curvature.\n            subdivide ||= circleStyle.paint.get('circle-pitch-alignment') === 'map';\n        }\n\n        const granularity = subdivide ? options.subdivisionGranularity.circle : 1;\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, granularity);\n            options.featureIndex.insert(feature, geometry, index, sourceLayerIndex, this.index);\n        }\n    }\n\n    update(states: FeatureStates, vtLayer: VectorTileLayerLike, imagePositions: {[_: string]: ImagePosition}) {\n        if (!this.stateDependentLayers.length) return;\n        this.programConfigurations.updatePaintArrays(states, vtLayer, this.stateDependentLayers, {\n            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            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: Point[][], index: number, canonical: CanonicalTileID, granularity: CircleGranularity = 1) {\n        // Since we store the circle's center in each vertex, we only have 3 bits for actual vertex position in each axis.\n        // Thus the valid range of positions is 0..7.\n        // This gives us 4 possible granularity settings that are symmetrical.\n\n        // This array stores vertex positions that should by used by the tessellated quad.\n        let extrudes: number[];\n\n        switch (granularity) {\n            case 1:\n                extrudes = [0, 7];\n                break;\n            case 3:\n                extrudes = [0, 2, 5, 7];\n                break;\n            case 5:\n                extrudes = [0, 1, 3, 4, 6, 7];\n                break;\n            case 7:\n                extrudes = [0, 1, 2, 3, 4, 5, 6, 7];\n                break;\n            default:\n                throw new Error(`Invalid circle bucket granularity: ${granularity}; valid values are 1, 3, 5, 7.`);\n        }\n\n        const verticesPerAxis = extrudes.length;\n\n        for (const ring of geometry) {\n            for (const point of ring) {\n                const vx = point.x;\n                const vy = point.y;\n\n                // Do not include points that are outside the tile boundaries.\n                if (vx < 0 || vx >= EXTENT || vy < 0 || vy >= EXTENT) {\n                    continue;\n                }\n\n                const segment = this.segments.prepareSegment(verticesPerAxis * verticesPerAxis, this.layoutVertexArray, this.indexArray, feature.sortKey);\n                const index = segment.vertexLength;\n\n                for (let y = 0; y < verticesPerAxis; y++) {\n                    for (let x = 0; x < verticesPerAxis; x++) {\n                        addCircleVertex(this.layoutVertexArray, vx, vy, extrudes[x], extrudes[y]);\n                    }\n                }\n\n                for (let y = 0; y < verticesPerAxis - 1; y++) {\n                    for (let x = 0; x < verticesPerAxis - 1; x++) {\n                        const lowerIndex = index + y * verticesPerAxis + x;\n                        const upperIndex = index + (y + 1) * verticesPerAxis + x;\n                        this.indexArray.emplaceBack(lowerIndex, upperIndex + 1, lowerIndex + 1);\n                        this.indexArray.emplaceBack(lowerIndex, upperIndex, upperIndex + 1);\n                    }\n                }\n\n                segment.vertexLength += verticesPerAxis * verticesPerAxis;\n                segment.primitiveLength += (verticesPerAxis - 1) * (verticesPerAxis - 1) * 2;\n            }\n        }\n\n        this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length, feature, index, {imagePositions: {}, 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 = Point[];\ntype MultiLine = Line[];\ntype Ring = Point[];\ntype Polygon = Point[];\ntype MultiPolygon = Polygon[];\n\nfunction polygonIntersectsPolygon(polygonA: Polygon, polygonB: Polygon) {\n    for (const point of polygonA) {\n        if (polygonContainsPoint(polygonB, point)) return true;\n    }\n\n    for (const point of polygonB) {\n        if (polygonContainsPoint(polygonA, point)) return true;\n    }\n\n    return lineIntersectsLine(polygonA, polygonB);\n}\n\nfunction polygonIntersectsBufferedPoint(polygon: Polygon, point: Point, radius: number) {\n    if (polygonContainsPoint(polygon, point)) return true;\n    return pointIntersectsBufferedLine(point, polygon, radius);\n}\n\nfunction polygonIntersectsMultiPolygon(polygon: Polygon, multiPolygon: MultiPolygon) {\n\n    if (polygon.length === 1) {\n        return multiPolygonContainsPoint(multiPolygon, polygon[0]);\n    }\n\n    for (const ring of multiPolygon) {\n        for (const point of ring) {\n            if (polygonContainsPoint(polygon, point)) return true;\n        }\n    }\n\n    for (const point of polygon) {\n        if (multiPolygonContainsPoint(multiPolygon, point)) return true;\n    }\n\n    for (const ring of multiPolygon) {\n        if (lineIntersectsLine(polygon, ring)) return true;\n    }\n\n    return false;\n}\n\nfunction polygonIntersectsBufferedMultiLine(polygon: Polygon, multiLine: MultiLine, radius: number) {\n    for (const line of multiLine) {\n\n        if (polygon.length >= 3) {\n            for (const point of line) {\n                if (polygonContainsPoint(polygon, point)) 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 (const point of lineB) {\n            if (pointIntersectsBufferedLine(point, lineA, radius)) return true;\n        }\n    }\n\n    for (const point of lineA) {\n        if (pointIntersectsBufferedLine(point, 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: Ring[], p: Point) {\n    let c = false,\n        ring, p1, p2;\n\n    for (const currentRing of rings) {\n        ring = currentRing;\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: 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';\nimport {polygonIntersectsBufferedPoint} from '../util/intersection_tests';\nimport type {IReadonlyTransform} from '../geo/transform_interface';\nimport type {UnwrappedTileID} from '../tile/tile_id';\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\n/**\n * @internal\n * Translates a geometry by a certain pixels in tile coordinates\n * @param queryGeometry - The geometry to translate in tile coordinates\n * @param translate - The translation in pixels\n * @param translateAnchor - The anchor of the translation\n * @param bearing - The bearing of the map\n * @param pixelsToTileUnits - The scale factor from pixels to tile units\n * @returns the translated geometry in tile coordinates\n */\nexport function translate(queryGeometry: Point[],\n    translate: [number, number],\n    translateAnchor: 'viewport' | 'map',\n    bearing: number,\n    pixelsToTileUnits: number): Point[] {\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: Point[] = [];\n    for (const point of queryGeometry) {\n        translated.push(point.sub(pt));\n    }\n    return translated;\n}\n\n/**\n * Filter out consecutive duplicate points from a line\n */\nfunction _stripDuplicates(ring: Point[]): Point[] {\n    const filteredRing: Point[] = [];\n    for (let index = 0; index < ring.length; index++) {\n        const point = ring[index];\n        const prevPoint = filteredRing.at(-1);\n        if (index === 0 || (prevPoint && !(point.equals(prevPoint)))) {\n            filteredRing.push(point);\n        }\n    }\n    return filteredRing;\n}\n\nexport function offsetLine(rings: Point[][], offset: number) {\n    const newRings: Point[][] = [];\n    for (const rawRing of rings) {\n        const ring = _stripDuplicates(rawRing);\n        const newRing: Point[] = [];\n        for (let index = 0; index < ring.length; index++) {\n            const point = ring[index];\n            const prevPoint = ring[index - 1];\n            const nextPoint = ring[index + 1];\n            // perpendicular unit vectors (outward unit normal vector):\n            // these indicate which direction the segments should be offset in\n            const unitNormalAB: Point = index === 0 ? new Point(0, 0) : point.sub(prevPoint)._unit()._perp();\n            const unitNormalBC: Point = index === ring.length - 1 ? new Point(0, 0) : nextPoint.sub(point)._unit()._perp();\n            // unit bisector direction\n            const bisectorDir = unitNormalAB._add(unitNormalBC)._unit();\n            const cosHalfAngle = bisectorDir.x * unitNormalBC.x + bisectorDir.y * unitNormalBC.y;\n            if (cosHalfAngle !== 0) {\n                bisectorDir._mult(1 / cosHalfAngle);\n            }\n            newRing.push(bisectorDir._mult(offset)._add(point));\n        }\n        newRings.push(newRing);\n    }\n    return newRings;\n}\n\ntype CircleIntersectionTestParams = {\n    queryGeometry: Point[];\n    size: number;\n    transform: IReadonlyTransform;\n    unwrappedTileID: UnwrappedTileID;\n    getElevation: undefined | ((x: number, y: number) => number);\n    pitchAlignment?: 'map' | 'viewport';\n    pitchScale?: 'map' | 'viewport';\n};\n\nfunction intersectionTestMapMap({queryGeometry, size}: CircleIntersectionTestParams, point: Point): boolean {\n    return polygonIntersectsBufferedPoint(queryGeometry, point, size);\n}\n\nfunction intersectionTestMapViewport({queryGeometry, size, transform, unwrappedTileID, getElevation}: CircleIntersectionTestParams, point: Point): boolean {\n    const w = transform.projectTileCoordinates(point.x, point.y, unwrappedTileID, getElevation).signedDistanceFromCamera;\n    const adjustedSize = size * (w / transform.cameraToCenterDistance);\n    return polygonIntersectsBufferedPoint(queryGeometry, point, adjustedSize);\n}\n\nfunction intersectionTestViewportMap({queryGeometry, size, transform, unwrappedTileID, getElevation}: CircleIntersectionTestParams, point: Point): boolean {\n    const w = transform.projectTileCoordinates(point.x, point.y, unwrappedTileID, getElevation).signedDistanceFromCamera;\n    const adjustedSize = size * (transform.cameraToCenterDistance / w);\n    return polygonIntersectsBufferedPoint(queryGeometry, projectPoint(point, transform, unwrappedTileID, getElevation), adjustedSize);\n}\n\nfunction intersectionTestViewportViewport({queryGeometry, size, transform, unwrappedTileID, getElevation}: CircleIntersectionTestParams, point: Point): boolean {\n    return polygonIntersectsBufferedPoint(queryGeometry, projectPoint(point, transform, unwrappedTileID, getElevation), size);\n}\n\nexport function circleIntersection({\n    queryGeometry,\n    size,\n    transform,\n    unwrappedTileID,\n    getElevation,\n    pitchAlignment = 'map',\n    pitchScale = 'map'\n}: CircleIntersectionTestParams, geometry): boolean {\n    const intersectionTest = pitchAlignment === 'map'\n        ? (pitchScale === 'map' ? intersectionTestMapMap : intersectionTestMapViewport)\n        : (pitchScale === 'map' ? intersectionTestViewportMap : intersectionTestViewportViewport);\n\n    const param = {queryGeometry, size, transform, unwrappedTileID, getElevation} as CircleIntersectionTestParams;\n    for (const ring of geometry) {\n        for (const point of ring) {\n            if (intersectionTest(param, point)) {\n                return true;\n            }\n        }\n    }\n    return false;\n}\n\nfunction projectPoint(tilePoint: Point, transform: IReadonlyTransform, unwrappedTileID: UnwrappedTileID, getElevation: undefined | ((x: number, y: number) => number)): Point {\n    // Convert `tilePoint` from tile coordinates to clip coordinates.\n    const clipPoint = transform.projectTileCoordinates(tilePoint.x, tilePoint.y, unwrappedTileID, getElevation).point;\n    // Convert `clipPoint` from clip coordinates into pixel/screen coordinates.\n    return new Point(\n        (clipPoint.x * 0.5 + 0.5) * transform.width,\n        (-clipPoint.y * 0.5 + 0.5) * transform.height\n    );\n}\n\nexport function projectQueryGeometry(queryGeometry: Point[], transform: IReadonlyTransform, unwrappedTileID: UnwrappedTileID, getElevation: undefined | ((x: number, y: number) => number)) {\n    return queryGeometry.map((p) => {\n        return projectPoint(p, transform, unwrappedTileID, getElevation);\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, NumberArray, ColorArray, 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() } });", "import type Point from '@mapbox/point-geometry';\nimport {StyleLayer, type QueryIntersectsFeatureParams} from '../style_layer';\n\nimport {CircleBucket} from '../../data/bucket/circle_bucket';\nimport {circleIntersection, getMaximumPaintValue, projectQueryGeometry, translateDistance, translate} from '../query_utils';\nimport properties, {type CircleLayoutPropsPossiblyEvaluated, type CirclePaintPropsPossiblyEvaluated} from './circle_style_layer_properties.g';\nimport {type Transitionable, type Transitioning, type Layout, type PossiblyEvaluated} from '../properties';\nimport type {LayerSpecification} from '@maplibre/maplibre-gl-style-spec';\nimport type {Bucket, BucketParameters} from '../../data/bucket';\nimport type {CircleLayoutProps, CirclePaintProps} from './circle_style_layer_properties.g';\n\nexport const isCircleStyleLayer = (layer: StyleLayer): layer is CircleStyleLayer => layer.type === 'circle';\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, globalState: Record<string, any>) {\n        super(layer, properties, globalState);\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,\n        feature,\n        featureState,\n        geometry,\n        transform,\n        pixelsToTileUnits,\n        unwrappedTileID,\n        getElevation}: QueryIntersectsFeatureParams\n    ): boolean {\n        const translatedPolygon = translate(queryGeometry,\n            this.paint.get('circle-translate'),\n            this.paint.get('circle-translate-anchor'),\n            -transform.bearingInRadians, 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\n        const pitchScale = this.paint.get('circle-pitch-scale');\n        const pitchAlignment = this.paint.get('circle-pitch-alignment');\n\n        let transformedPolygon: Point[];\n        let transformedSize: number;\n        if (pitchAlignment === 'map') {\n            transformedPolygon = translatedPolygon;\n            transformedSize = size * pixelsToTileUnits;\n        } else {\n            transformedPolygon = projectQueryGeometry(translatedPolygon, transform, unwrappedTileID, getElevation);\n            transformedSize = size;\n        }\n\n        return circleIntersection({\n            queryGeometry: transformedPolygon,\n            size: transformedSize,\n            transform,\n            unwrappedTileID,\n            getElevation,\n            pitchAlignment,\n            pitchScale\n        }, geometry);\n    }\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: 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, NumberArray, ColorArray, 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 {type Color} from '@maplibre/maplibre-gl-style-spec';\nimport {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 * Premultiplication is applied in JS before 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    setPixel(row: number, col: number, value: Color) {\n        const rLocation = (row * this.width + col) * 4;\n        this.data[rLocation + 0] = Math.round(value.r * 255 / value.a);\n        this.data[rLocation + 1] = Math.round(value.g * 255 / value.a);\n        this.data[rLocation + 2] = Math.round(value.b * 255 / value.a);\n        this.data[rLocation + 3] = Math.round(value.a * 255);\n    }\n}\n\n/** Returns a copy of RGBA data with premultiplied alpha. */\nexport function premultiplyAlpha(data: Uint8Array): Uint8Array {\n    const out = new Uint8Array(data.length);\n    for (let i = 0; i < data.length; i += 4) {\n        const a = data[i + 3];\n        out[i + 0] = Math.round(data[i + 0] * a / 255);\n        out[i + 1] = Math.round(data[i + 1] * a / 255);\n        out[i + 2] = Math.round(data[i + 2] * a / 255);\n        out[i + 3] = a;\n    }\n    return out;\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?: 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        image.setPixel(stride / 4 / width, index / 4, pxColor);\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 {type QueryIntersectsFeatureParams, StyleLayer} from '../style_layer';\n\nimport {HeatmapBucket} from '../../data/bucket/heatmap_bucket';\nimport {type RGBAImage} from '../../util/image';\nimport properties, {type HeatmapPaintPropsPossiblyEvaluated} from './heatmap_style_layer_properties.g';\nimport {renderColorRamp} from '../../util/color_ramp';\nimport {type Transitionable, type Transitioning, type PossiblyEvaluated} from '../properties';\n\nimport type {Texture} from '../../webgl/texture';\nimport type {Framebuffer} from '../../webgl/framebuffer';\nimport type {HeatmapPaintProps} from './heatmap_style_layer_properties.g';\nimport type {LayerSpecification} from '@maplibre/maplibre-gl-style-spec';\n\nimport {circleIntersection, getMaximumPaintValue} from '../query_utils';\nimport type {Bucket} from '../../data/bucket';\n\nexport const HEATMAP_FULL_RENDER_FBO_KEY = 'big-fb';\n\nexport const isHeatmapStyleLayer = (layer: StyleLayer): layer is HeatmapStyleLayer => layer.type === 'heatmap';\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, globalState: Record<string, any>) {\n        super(layer, properties, globalState);\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(bucket: Bucket): number {\n        return getMaximumPaintValue('heatmap-radius', this, bucket as HeatmapBucket);\n    }\n\n    queryIntersectsFeature({\n        queryGeometry,\n        feature,\n        featureState,\n        geometry,\n        transform,\n        pixelsToTileUnits,\n        unwrappedTileID,\n        getElevation}: QueryIntersectsFeatureParams\n    ): boolean {\n        return circleIntersection({\n            queryGeometry,\n            size: this.paint.get('heatmap-radius').evaluate(feature, featureState) * pixelsToTileUnits,\n            transform,\n            unwrappedTileID,\n            getElevation\n        }, geometry);\n    }\n\n    hasOffscreenPass() {\n        return this.paint.get('heatmap-opacity') !== 0 && !this.isHidden();\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, NumberArray, ColorArray, 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<NumberArray>,\n    \"hillshade-illumination-altitude\": DataConstantProperty<NumberArray>,\n    \"hillshade-illumination-anchor\": DataConstantProperty<\"map\" | \"viewport\">,\n    \"hillshade-exaggeration\": DataConstantProperty<number>,\n    \"hillshade-shadow-color\": DataConstantProperty<ColorArray>,\n    \"hillshade-highlight-color\": DataConstantProperty<ColorArray>,\n    \"hillshade-accent-color\": DataConstantProperty<Color>,\n    \"hillshade-method\": DataConstantProperty<\"standard\" | \"basic\" | \"combined\" | \"igor\" | \"multidirectional\">,\n    \"resampling\": DataConstantProperty<\"linear\" | \"nearest\">,\n};\n\nexport type HillshadePaintPropsPossiblyEvaluated = {\n    \"hillshade-illumination-direction\": NumberArray,\n    \"hillshade-illumination-altitude\": NumberArray,\n    \"hillshade-illumination-anchor\": \"map\" | \"viewport\",\n    \"hillshade-exaggeration\": number,\n    \"hillshade-shadow-color\": ColorArray,\n    \"hillshade-highlight-color\": ColorArray,\n    \"hillshade-accent-color\": Color,\n    \"hillshade-method\": \"standard\" | \"basic\" | \"combined\" | \"igor\" | \"multidirectional\",\n    \"resampling\": \"linear\" | \"nearest\",\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-altitude\": new DataConstantProperty(styleSpec[\"paint_hillshade\"][\"hillshade-illumination-altitude\"] 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    \"hillshade-method\": new DataConstantProperty(styleSpec[\"paint_hillshade\"][\"hillshade-method\"] as any as StylePropertySpecification),\n    \"resampling\": new DataConstantProperty(styleSpec[\"paint_hillshade\"][\"resampling\"] as any as StylePropertySpecification),\n});\n\nexport default ({ get paint() { return getPaint() } });", "import {StyleLayer} from '../style_layer';\n\nimport properties, {type HillshadePaintPropsPossiblyEvaluated} from './hillshade_style_layer_properties.g';\nimport {type Transitionable, type Transitioning, type PossiblyEvaluated} from '../properties';\n\nimport type {HillshadePaintProps} from './hillshade_style_layer_properties.g';\nimport type {Color, LayerSpecification} from '@maplibre/maplibre-gl-style-spec';\nimport {degreesToRadians} from '../../util/util';\nimport type {EvaluationParameters} from '../evaluation_parameters';\n\nexport const isHillshadeStyleLayer = (layer: StyleLayer): layer is HillshadeStyleLayer => layer.type === 'hillshade';\n\nexport class HillshadeStyleLayer extends StyleLayer {\n    _transitionablePaint: Transitionable<HillshadePaintProps>;\n    _transitioningPaint: Transitioning<HillshadePaintProps>;\n    paint: PossiblyEvaluated<HillshadePaintProps, HillshadePaintPropsPossiblyEvaluated>;\n\n    constructor(layer: LayerSpecification, globalState: Record<string, any>) {\n        super(layer, properties, globalState);\n        this.recalculate({zoom: 0, zoomHistory: {}} as EvaluationParameters, undefined);\n    }\n\n    getIlluminationProperties(): {directionRadians: number[]; altitudeRadians: number[]; shadowColor: Color[]; highlightColor: Color[]} {\n        let direction = this.paint.get('hillshade-illumination-direction').values;\n        let altitude = this.paint.get('hillshade-illumination-altitude').values;\n        let highlightColor = this.paint.get('hillshade-highlight-color').values;\n        let shadowColor = this.paint.get('hillshade-shadow-color').values;\n\n        // ensure all illumination properties have the same length\n        const numIlluminationSources = Math.max(direction.length, altitude.length, highlightColor.length, shadowColor.length);\n        direction = direction.concat(Array(numIlluminationSources - direction.length).fill(direction.at(-1)));\n        altitude = altitude.concat(Array(numIlluminationSources - altitude.length).fill(altitude.at(-1)));\n        highlightColor = highlightColor.concat(Array(numIlluminationSources - highlightColor.length).fill(highlightColor.at(-1)));\n        shadowColor = shadowColor.concat(Array(numIlluminationSources - shadowColor.length).fill(shadowColor.at(-1)));\n\n        const altitudeRadians = altitude.map(degreesToRadians);\n        const directionRadians = direction.map(degreesToRadians);\n\n        return {directionRadians, altitudeRadians, shadowColor, highlightColor};\n    }\n\n    hasOffscreenPass() {\n        return this.paint.get('hillshade-exaggeration') !== 0 && !this.isHidden();\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, NumberArray, ColorArray, ResolvedImage, VariableAnchorOffsetCollection} from '@maplibre/maplibre-gl-style-spec';\nimport {StylePropertySpecification} from '@maplibre/maplibre-gl-style-spec';\n\n\nexport type ColorReliefPaintProps = {\n    \"color-relief-opacity\": DataConstantProperty<number>,\n    \"color-relief-color\": ColorRampProperty,\n    \"resampling\": DataConstantProperty<\"linear\" | \"nearest\">,\n};\n\nexport type ColorReliefPaintPropsPossiblyEvaluated = {\n    \"color-relief-opacity\": number,\n    \"color-relief-color\": ColorRampProperty,\n    \"resampling\": \"linear\" | \"nearest\",\n};\n\nlet paint: Properties<ColorReliefPaintProps>;\nconst getPaint = () => paint = paint || new Properties({\n    \"color-relief-opacity\": new DataConstantProperty(styleSpec[\"paint_color-relief\"][\"color-relief-opacity\"] as any as StylePropertySpecification),\n    \"color-relief-color\": new ColorRampProperty(styleSpec[\"paint_color-relief\"][\"color-relief-color\"] as any as StylePropertySpecification),\n    \"resampling\": new DataConstantProperty(styleSpec[\"paint_color-relief\"][\"resampling\"] as any as StylePropertySpecification),\n});\n\nexport default ({ get paint() { return getPaint() } });", "import type {Context} from './context';\nimport type {RGBAImage, AlphaImage} from '../util/image';\nimport {premultiplyAlpha} from '../util/image';\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\nfunction hasDataProperty(image: TextureImage): image is DataTextureImage {\n    return 'data' in image;\n}\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    /** Tracks the original handle to detect corruption after context loss (#2811) */\n    private _ownedHandle: WebGLTexture;\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._ownedHandle = this.texture;\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?.[0] !== width || this.size[1] !== height) && !position;\n        const {context} = this;\n        const {gl} = context;\n\n        this.useMipmap = Boolean(options?.useMipmap);\n        gl.bindTexture(gl.TEXTURE_2D, this.texture);\n\n        context.pixelStoreUnpackFlipY.set(false);\n        context.pixelStoreUnpack.set(1);\n\n        const wantPremultiply = this.format === gl.RGBA && (options?.premultiply !== false);\n\n        if (resize) {\n            this.size = [width, height];\n            if (hasDataProperty(image)) {\n                // #2030: raw data is premultiplied in JS\n                context.pixelStoreUnpackPremultiplyAlpha.set(false);\n                this._uploadRawData(image, wantPremultiply, width, height, gl);\n            } else {\n                context.pixelStoreUnpackPremultiplyAlpha.set(wantPremultiply);\n                this._uploadDomImage(image, gl);\n            }\n        } else {\n            const {x, y} = position || {x: 0, y: 0};\n            if (hasDataProperty(image)) {\n                context.pixelStoreUnpackPremultiplyAlpha.set(false);\n                this._updateRawData(image, wantPremultiply, x, y, width, height, gl);\n            } else {\n                context.pixelStoreUnpackPremultiplyAlpha.set(wantPremultiply);\n                this._updateDomImage(image, x, y, gl);\n            }\n        }\n\n        if (this.useMipmap && this.isSizePowerOfTwo()) {\n            gl.generateMipmap(gl.TEXTURE_2D);\n        }\n\n        context.pixelStoreUnpackFlipY.setDefault();\n        context.pixelStoreUnpack.setDefault();\n        context.pixelStoreUnpackPremultiplyAlpha.setDefault();\n    }\n\n    private _uploadDomImage(image: TexImageSource, gl: WebGLRenderingContext | WebGL2RenderingContext) {\n        gl.texImage2D(gl.TEXTURE_2D, 0, this.format, this.format, gl.UNSIGNED_BYTE, image);\n    }\n\n    private _uploadRawData(image: DataTextureImage, wantPremultiply: boolean, width: number, height: number, gl: WebGLRenderingContext | WebGL2RenderingContext) {\n        let {data} = image;\n        if (wantPremultiply && data) data = premultiplyAlpha(data);\n        gl.texImage2D(gl.TEXTURE_2D, 0, this.format, width, height, 0, this.format, gl.UNSIGNED_BYTE, data);\n    }\n\n    private _updateDomImage(image: TexImageSource, x: number, y: number, gl: WebGLRenderingContext | WebGL2RenderingContext) {\n        gl.texSubImage2D(gl.TEXTURE_2D, 0, x, y, gl.RGBA, gl.UNSIGNED_BYTE, image);\n    }\n\n    private _updateRawData(image: DataTextureImage, wantPremultiply: boolean, x: number, y: number, width: number, height: number, gl: WebGLRenderingContext | WebGL2RenderingContext) {\n        let {data} = image;\n        if (wantPremultiply && data) data = premultiplyAlpha(data);\n        gl.texSubImage2D(gl.TEXTURE_2D, 0, x, y, width, height, gl.RGBA, gl.UNSIGNED_BYTE, data);\n    }\n\n    bind(filter: TextureFilter, wrap: TextureWrap, minFilter?: TextureFilter | null) {\n        const {context} = this;\n        const {gl} = context;\n\n        if (this.texture !== this._ownedHandle) {\n            this.texture = this._ownedHandle;\n        }\n\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        this._ownedHandle = null;\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 png raw 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. x: ${x}, y: ${y}, dim: ${this.dim}`);\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    pack(v: number): {r: number; g: number; b: number} {\n        return packDEMData(v, this.getUnpackVector());\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\nexport function packDEMData(v: number, unpackVector: number[]): {r: number; g: number; b: number} {\n    const redFactor = unpackVector[0];\n    const greenFactor = unpackVector[1];\n    const blueFactor = unpackVector[2];\n    const baseShift = unpackVector[3];\n    const minScale = Math.min(redFactor, greenFactor, blueFactor);\n    const vScaled = Math.round((v + baseShift)/minScale);\n    return {\n        r: Math.floor(vScaled*minScale/redFactor) % 256,\n        g: Math.floor(vScaled*minScale/greenFactor) % 256,\n        b: Math.floor(vScaled*minScale/blueFactor) % 256\n    };\n}\n\nregister('DEMData', DEMData);\n", "import {StyleLayer} from '../style_layer';\n\nimport properties, {type ColorReliefPaintPropsPossiblyEvaluated} from './color_relief_style_layer_properties.g';\nimport {type Transitionable, type Transitioning, type PossiblyEvaluated} from '../properties';\n\nimport type {ColorReliefPaintProps} from './color_relief_style_layer_properties.g';\nimport {Color, Interpolate, ZoomConstantExpression, type LayerSpecification, type EvaluationContext, type StylePropertyExpression} from '@maplibre/maplibre-gl-style-spec';\nimport {warnOnce} from '../../util/util';\nimport {Texture} from '../../webgl/texture';\nimport {RGBAImage} from '../../util/image';\nimport {type Context} from '../../webgl/context';\nimport {packDEMData} from '../../data/dem_data';\n\nexport const isColorReliefStyleLayer = (layer: StyleLayer): layer is ColorReliefStyleLayer => layer.type === 'color-relief';\n\nexport type ColorRamp = {elevationStops: number[]; colorStops: Color[]};\nexport type ColorRampTextures = {elevationTexture: Texture; colorTexture: Texture};\n\nexport class ColorReliefStyleLayer extends StyleLayer {\n    colorRampExpression: StylePropertyExpression;\n    colorRampTextures: ColorRampTextures;\n    _transitionablePaint: Transitionable<ColorReliefPaintProps>;\n    _transitioningPaint: Transitioning<ColorReliefPaintProps>;\n    paint: PossiblyEvaluated<ColorReliefPaintProps, ColorReliefPaintPropsPossiblyEvaluated>;\n\n    constructor(layer: LayerSpecification, globalState: Record<string, any>) {\n        super(layer, properties, globalState);\n    }\n\n    /**\n     * Create the color ramp, enforcing a maximum length for the vectors. This modifies the internal color ramp,\n     * so that the remapping is only performed once.\n     *\n     * @param maxLength - the maximum number of stops in the color ramp\n     *\n     * @return a `ColorRamp` object with no more than `maxLength` stops.\n     *\n     */\n\n    _createColorRamp(maxLength: number) : ColorRamp {\n        const colorRamp: ColorRamp = {elevationStops: [], colorStops: []};\n        const expression = this._transitionablePaint._values['color-relief-color'].value.expression;\n        if (expression instanceof ZoomConstantExpression && expression._styleExpression.expression instanceof Interpolate) {\n            this.colorRampExpression = expression;\n            const interpolater = expression._styleExpression.expression;\n            colorRamp.elevationStops = interpolater.labels;\n            colorRamp.colorStops = [];\n            for (const label of colorRamp.elevationStops) {\n                colorRamp.colorStops.push(interpolater.evaluate({globals: {elevation: label}} as EvaluationContext));\n            }\n        }\n        if (colorRamp.elevationStops.length < 1)\n        {\n            colorRamp.elevationStops = [0];\n            colorRamp.colorStops = [Color.transparent];\n        }\n        if (colorRamp.elevationStops.length < 2)\n        {\n            colorRamp.elevationStops.push(colorRamp.elevationStops[0] + 1);\n            colorRamp.colorStops.push(colorRamp.colorStops[0]);\n        }\n        if (colorRamp.elevationStops.length <= maxLength) {\n            return colorRamp;\n        }\n\n        const remappedColorRamp: ColorRamp = {elevationStops: [], colorStops: []};\n        const remapStepSize = (colorRamp.elevationStops.length - 1)/(maxLength - 1);\n\n        for (let i = 0; i < colorRamp.elevationStops.length - 0.5; i += remapStepSize) {\n            remappedColorRamp.elevationStops.push(colorRamp.elevationStops[Math.round(i)]);\n            remappedColorRamp.colorStops.push(colorRamp.colorStops[Math.round(i)]);\n        }\n        warnOnce(`Too many colors in specification of ${this.id} color-relief layer, may not render properly. Max possible colors: ${maxLength}, provided: ${colorRamp.elevationStops.length}`);\n        return remappedColorRamp;\n    }\n\n    _colorRampChanged() : boolean {\n        return this.colorRampExpression != this._transitionablePaint._values['color-relief-color'].value.expression;\n    }\n\n    getColorRampTextures(context: Context, maxLength: number, unpackVector: number[]): ColorRampTextures {\n        if (this.colorRampTextures && !this._colorRampChanged()) {\n            return this.colorRampTextures;\n        }\n        const colorRamp = this._createColorRamp(maxLength);\n        const colorImage = new RGBAImage({width: colorRamp.colorStops.length, height: 1});\n        const elevationImage = new RGBAImage({width: colorRamp.colorStops.length, height: 1});\n        for (let i = 0; i < colorRamp.elevationStops.length; i++) {\n            const elevationPacked = packDEMData(colorRamp.elevationStops[i], unpackVector);\n            elevationImage.setPixel(0, i, new Color(elevationPacked.r/255, elevationPacked.g/255, elevationPacked.b/255, 1));\n            colorImage.setPixel(0, i, colorRamp.colorStops[i]);\n        }\n        this.colorRampTextures = {\n            elevationTexture: new Texture(context, elevationImage, context.gl.RGBA),\n            colorTexture: new Texture(context, colorImage, context.gl.RGBA)\n        };\n        return this.colorRampTextures;\n    }\n\n    hasOffscreenPass() {\n        return !this.isHidden() && !!this.colorRampTextures;\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", "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 {type PossiblyEvaluated} from '../../style/properties';\n\ntype PatternStyleLayers = LineStyleLayer[] | FillStyleLayer[] | 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, parameters: { zoom: number }, options: PopulateParameters) {\n    const {zoom} = parameters;\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?.name ? min.name : min;\n            mid = mid?.name ? mid.name : mid;\n            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", "\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 = data[0];\n        minY = data[1];\n        let maxX = minX;\n        let maxY = minY;\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\n    const x0 = Math.min(ax, bx, cx),\n        y0 = Math.min(ay, by, cy),\n        x1 = Math.max(ax, bx, cx),\n        y1 = Math.max(ay, 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            pointInTriangleExceptFirst(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\n    const x0 = Math.min(ax, bx, cx),\n        y0 = Math.min(ay, by, cy),\n        x1 = Math.max(ax, bx, cx),\n        y1 = Math.max(ay, 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            pointInTriangleExceptFirst(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            pointInTriangleExceptFirst(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            pointInTriangleExceptFirst(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            pointInTriangleExceptFirst(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(compareXYSlope);\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 compareXYSlope(a, b) {\n    let result = a.x - b.x;\n    // when the left-most point of 2 holes meet at a vertex, sort the holes counterclockwise so that when we find\n    // the bridge to the outer shell is always the point that they meet at.\n    if (result === 0) {\n        result = a.y - b.y;\n        if (result === 0) {\n            const aSlope = (a.next.y - a.y) / (a.next.x - a.x);\n            const bSlope = (b.next.y - b.y) / (b.next.x - b.x);\n            result = aSlope - bSlope;\n        }\n    }\n    return result;\n}\n\n// find a bridge between vertices that connects hole with an outer ring 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    // unless they intersect at a vertex, then choose the vertex\n    if (equals(hole, p)) return p;\n    do {\n        if (equals(hole, p.next)) return p.next;\n        else 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 point lies within a convex triangle but false if its equal to the first point of the triangle\nfunction pointInTriangleExceptFirst(ax, ay, bx, by, cx, cy, px, py) {\n    return !(ax === px && ay === py) && pointInTriangle(ax, ay, bx, by, cx, cy, px, 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) && // doesn'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", "// Should match actual possible granularity settings from circle_bucket.ts\n\n/**\n * Defines the granularity of subdivision for circles with `circle-pitch-alignment: 'map'` and for heatmap kernels.\n * More subdivision will cause circles to more closely follow the planet's surface.\n *\n * Possible values: 1, 3, 5, 7.\n * Subdivision of 1 results in a simple quad.\n */\nexport type CircleGranularity = 1 | 3 | 5 | 7;\n\n/**\n * Controls how much subdivision happens for a given type of geometry at different zoom levels.\n */\nexport class SubdivisionGranularityExpression {\n    /**\n     * A tile of zoom level 0 will be subdivided to this granularity level.\n     * Each subsequent zoom level will have its granularity halved.\n     */\n    private readonly _baseZoomGranularity: number;\n\n    /**\n     * No tile will have granularity level smaller than this.\n     */\n    private readonly _minGranularity: number;\n\n    constructor(baseZoomGranularity: number, minGranularity: number) {\n        if (minGranularity > baseZoomGranularity) {\n            throw new Error('Min granularity must not be greater than base granularity.');\n        }\n\n        this._baseZoomGranularity = baseZoomGranularity;\n        this._minGranularity = minGranularity;\n    }\n\n    public getGranularityForZoomLevel(zoomLevel: number): number {\n        const divisor = 1 << zoomLevel;\n        return Math.max(Math.floor(this._baseZoomGranularity / divisor), this._minGranularity, 1);\n    }\n}\n\n/**\n * An object describing how much subdivision should be applied to different types of geometry at different zoom levels.\n */\nexport class SubdivisionGranularitySetting {\n    /**\n     * Granularity settings used for fill and fill-extrusion layers (for fill, both polygons and their anti-aliasing outlines).\n     */\n    public readonly fill: SubdivisionGranularityExpression;\n\n    /**\n     * Granularity used for the line layer.\n     */\n    public readonly line: SubdivisionGranularityExpression;\n\n    /**\n     * Granularity used for geometry covering the entire tile: raster tiles, etc.\n     */\n    public readonly tile: SubdivisionGranularityExpression;\n\n    /**\n     * Granularity used for stencil masks for tiles.\n     */\n    public readonly stencil: SubdivisionGranularityExpression;\n\n    /**\n     * Controls the granularity of `pitch-alignment: map` circles and heatmap kernels.\n     * More granular circles will more closely follow the map's surface.\n     */\n    public readonly circle: CircleGranularity;\n\n    constructor(options: {\n        /**\n         * Granularity settings used for fill and fill-extrusion layers (for fill, both polygons and their anti-aliasing outlines).\n         */\n        fill: SubdivisionGranularityExpression;\n        /**\n         * Granularity used for the line layer.\n         */\n        line: SubdivisionGranularityExpression;\n        /**\n         * Granularity used for geometry covering the entire tile: stencil masks, raster tiles, etc.\n         */\n        tile: SubdivisionGranularityExpression;\n        /**\n         * Granularity used for stencil masks for tiles.\n         */\n        stencil: SubdivisionGranularityExpression;\n        /**\n         * Controls the granularity of `pitch-alignment: map` circles and heatmap kernels.\n         * More granular circles will more closely follow the map's surface.\n         */\n        circle: CircleGranularity;\n    }) {\n        this.fill = options.fill;\n        this.line = options.line;\n        this.tile = options.tile;\n        this.stencil = options.stencil;\n        this.circle = options.circle;\n    }\n\n    /**\n     * Granularity settings that disable subdivision altogether.\n     */\n    public static readonly noSubdivision = new SubdivisionGranularitySetting({\n        fill: new SubdivisionGranularityExpression(0, 0),\n        line: new SubdivisionGranularityExpression(0, 0),\n        tile: new SubdivisionGranularityExpression(0, 0),\n        stencil: new SubdivisionGranularityExpression(0, 0),\n        circle: 1\n    });\n}\n", "import Point from '@mapbox/point-geometry';\nimport {EXTENT} from '../data/extent';\nimport {type CanonicalTileID} from '../tile/tile_id';\nimport earcut from 'earcut';\nimport {SubdivisionGranularityExpression, SubdivisionGranularitySetting} from './subdivision_granularity_settings';\nimport {register} from '../util/web_worker_transfer';\n\nregister('SubdivisionGranularityExpression', SubdivisionGranularityExpression);\nregister('SubdivisionGranularitySetting', SubdivisionGranularitySetting);\n\ntype SubdivisionResult = {\n    verticesFlattened: number[];\n    indicesTriangles: number[];\n\n    /**\n     * An array of arrays of indices of subdivided lines for polygon outlines.\n     * Each array of lines corresponds to one ring of the original polygon.\n     */\n    indicesLineList: number[][];\n};\n\n// Special pole vertices have coordinates -32768,-32768 for the north pole and 32767,32767 for the south pole.\n// First, find any *non-pole* vertices at those coordinates and move them slightly elsewhere.\nexport const NORTH_POLE_Y = -32768;\nexport const SOUTH_POLE_Y = 32767;\n\nclass Subdivider {\n    /**\n     * Flattened vertex positions (xyxyxy).\n     */\n    private _vertexBuffer: number[] = [];\n\n    /**\n     * Map of \"vertex x and y coordinate\" to \"index of such vertex\".\n     */\n    private _vertexDictionary: Map<number, number> = new Map<number, number>();\n    private _used: boolean = false;\n\n    private readonly _canonical: CanonicalTileID;\n\n    private readonly _granularity;\n    private readonly _granularityCellSize;\n\n    constructor(granularity: number, canonical: CanonicalTileID) {\n        this._granularity = granularity;\n        this._granularityCellSize = EXTENT / granularity;\n        this._canonical = canonical;\n    }\n\n    private _getKey(x: number, y: number) {\n        // Assumes signed 16 bit positions.\n        x = x + 32768;\n        y = y + 32768;\n        return (x << 16) | (y << 0);\n    }\n\n    /**\n     * Returns an index into the internal vertex buffer for a vertex at the given coordinates.\n     * If the internal vertex buffer contains no such vertex, then it is added.\n     */\n    private _vertexToIndex(x: number, y: number): number {\n        if (x < -32768 || y < -32768 || x > 32767 || y > 32767) {\n            throw new Error('Vertex coordinates are out of signed 16 bit integer range.');\n        }\n        const xInt = Math.round(x) | 0;\n        const yInt = Math.round(y) | 0;\n        const key = this._getKey(xInt, yInt);\n        if (this._vertexDictionary.has(key)) {\n            return this._vertexDictionary.get(key);\n        }\n        const index = this._vertexBuffer.length / 2;\n        this._vertexDictionary.set(key, index);\n        this._vertexBuffer.push(xInt, yInt);\n        return index;\n    }\n\n    /**\n     * Subdivides a polygon by iterating over rows of granularity subdivision cells and splitting each row along vertical subdivision axes.\n     * @param inputIndices - Indices into the internal vertex buffer of the triangulated polygon (after running `earcut`).\n     * @returns Indices into the internal vertex buffer for triangles that are a subdivision of the input geometry.\n     */\n    private _subdivideTrianglesScanline(inputIndices: number[]): number[] {\n        // A granularity cell is the square space between axes that subdivide geometry.\n        // For granularity 8, cells would be 1024 by 1024 units.\n        // For each triangle, we iterate over all cell rows it intersects, and generate subdivided geometry\n        // only within one cell row at a time. This way, we implicitly subdivide along the X-parallel axes (cell row boundaries).\n        // For each cell row, we generate an ordered point ring that describes the subdivided geometry inside this row (an intersection of the triangle and a given cell row).\n        // Such ordered ring can be trivially triangulated.\n        // Each ring may consist of sections of triangle edges that lie inside the cell row, and cell boundaries that lie inside the triangle. Both must be further subdivided along Y-parallel axes.\n        // Most complexity of this function comes from generating correct vertex rings, and from placing the vertices into the ring in the correct order.\n\n        if (this._granularity < 2) {\n            // The actual subdivision code always produces triangles with the correct winding order.\n            // Also apply winding order correction when skipping subdivision altogether to maintain consistency.\n            return fixWindingOrder(this._vertexBuffer, inputIndices);\n        }\n\n        const finalIndices = [];\n\n        // Iterate over all input triangles\n        const numIndices = inputIndices.length;\n        for (let primitiveIndex = 0; primitiveIndex < numIndices; primitiveIndex += 3) {\n            const triangleIndices: [number, number, number] = [\n                inputIndices[primitiveIndex + 0], // v0\n                inputIndices[primitiveIndex + 1], // v1\n                inputIndices[primitiveIndex + 2], // v2\n            ];\n\n            const triangleVertices: [number, number, number, number, number, number] = [\n                this._vertexBuffer[inputIndices[primitiveIndex + 0] * 2 + 0], // v0.x\n                this._vertexBuffer[inputIndices[primitiveIndex + 0] * 2 + 1], // v0.y\n                this._vertexBuffer[inputIndices[primitiveIndex + 1] * 2 + 0], // v1.x\n                this._vertexBuffer[inputIndices[primitiveIndex + 1] * 2 + 1], // v1.y\n                this._vertexBuffer[inputIndices[primitiveIndex + 2] * 2 + 0], // v2.x\n                this._vertexBuffer[inputIndices[primitiveIndex + 2] * 2 + 1], // v2.y\n            ];\n\n            let minX = Infinity;\n            let minY = Infinity;\n            let maxX = -Infinity;\n            let maxY = -Infinity;\n\n            // Compute AABB\n            for (let i = 0; i < 3; i++) {\n                const vx = triangleVertices[i * 2];\n                const vy = triangleVertices[i * 2 + 1];\n                minX = Math.min(minX, vx);\n                maxX = Math.max(maxX, vx);\n                minY = Math.min(minY, vy);\n                maxY = Math.max(maxY, vy);\n            }\n\n            if (minX === maxX || minY === maxY) {\n                continue; // Skip degenerate linear axis-aligned triangles\n            }\n\n            const cellXmin = Math.floor(minX / this._granularityCellSize);\n            const cellXmax = Math.ceil(maxX / this._granularityCellSize);\n            const cellYmin = Math.floor(minY / this._granularityCellSize);\n            const cellYmax = Math.ceil(maxY / this._granularityCellSize);\n\n            // Skip subdividing triangles that do not span multiple cells - just add them \"as is\".\n            if (cellXmin === cellXmax && cellYmin === cellYmax) {\n                finalIndices.push(...triangleIndices);\n                continue;\n            }\n\n            // Iterate over cell rows that intersect this triangle\n            for (let cellRow = cellYmin; cellRow < cellYmax; cellRow++) {\n                const ring = this._scanlineGenerateVertexRingForCellRow(cellRow, triangleVertices, triangleIndices);\n                scanlineTriangulateVertexRing(this._vertexBuffer, ring, finalIndices);\n            }\n        }\n\n        return finalIndices;\n    }\n\n    /**\n     * Takes a triangle and a cell row index, returns a subdivided vertex ring of the intersection of the triangle and the cell row.\n     * @param cellRow - Index of the cell row. A cell row of index `i` convert range from `i * granularityCellSize` to `(i + 1) * granularityCellSize`.\n     * @param triangleVertices - An array of 6 elements, contains flattened positions of the triangle's vertices: `[v0x, v0y, v1x, v1y, v2x, v2y]`.\n     * @param triangleIndices - An array of 3 elements, contains the original indices of the triangle's vertices: `[index0, index1, index2]`.\n     * @returns The resulting ring of vertex indices and the index (to the returned ring array) of the leftmost vertex in the ring.\n     */\n    private _scanlineGenerateVertexRingForCellRow(\n        cellRow: number,\n        triangleVertices: [number, number, number, number, number, number],\n        triangleIndices: [number, number, number]\n    ) {\n        const cellRowYTop = cellRow * this._granularityCellSize;\n        const cellRowYBottom = cellRowYTop + this._granularityCellSize;\n        const ring = [];\n\n        // Generate the vertex ring\n        for (let edgeIndex = 0; edgeIndex < 3; edgeIndex++) {\n            // Current edge that will be subdivided: a --> b\n            // The remaining vertex of the triangle: c\n            const aX = triangleVertices[edgeIndex * 2];\n            const aY = triangleVertices[edgeIndex * 2 + 1];\n            const bX = triangleVertices[((edgeIndex + 1) * 2) % 6];\n            const bY = triangleVertices[((edgeIndex + 1) * 2 + 1) % 6];\n            const cX = triangleVertices[((edgeIndex + 2) * 2) % 6];\n            const cY = triangleVertices[((edgeIndex + 2) * 2 + 1) % 6];\n            // Edge direction\n            const dirX = bX - aX;\n            const dirY = bY - aY;\n\n            // Edges parallel with either axis will need special handling later.\n            const isParallelY = dirX === 0;\n            const isParallelX = dirY === 0;\n\n            // Distance along edge where it enters/exits current cell row,\n            // where distance 0 is the edge start point, 1 the endpoint, 0.5 the mid point, etc.\n            const tTop = (cellRowYTop - aY) / dirY;\n            const tBottom = (cellRowYBottom - aY) / dirY;\n            const tEnter = Math.min(tTop, tBottom);\n            const tExit = Math.max(tTop, tBottom);\n\n            // Determine if edge lies entirely outside this cell row.\n            // Check entry and exit points, or if edge is parallel with X, check its Y coordinate.\n            if ((!isParallelX && (tEnter >= 1 || tExit <= 0)) ||\n                (isParallelX && (aY < cellRowYTop || aY > cellRowYBottom))) {\n                // Skip this edge\n                // But make sure to add its endpoint vertex if needed.\n                if (bY >= cellRowYTop && bY <= cellRowYBottom) {\n                    // The edge endpoint is within this row, add it to the ring\n                    ring.push(triangleIndices[(edgeIndex + 1) % 3]);\n                }\n                continue;\n            }\n\n            // Do not add original triangle vertices now, those are handled separately later\n\n            // Special case: edge vertex for entry into cell row\n            // If edge is parallel with X axis, there is no entry vertex\n            if (!isParallelX && tEnter > 0) {\n                const x = aX + dirX * tEnter;\n                const y = aY + dirY * tEnter;\n                ring.push(this._vertexToIndex(x, y));\n            }\n\n            // The X coordinates of the points where the edge enters/exits the current cell row,\n            // or the edge start/endpoint, if the entry/exit happens beyond the edge bounds.\n            const enterX = aX + dirX * Math.max(tEnter, 0);\n            const exitX = aX + dirX * Math.min(tExit, 1);\n\n            // Generate edge interior vertices\n            // No need to subdivide (along X) edges that are parallel with Y\n            if (!isParallelY) {\n                this._generateIntraEdgeVertices(ring, aX, aY, bX, bY, enterX, exitX);\n            }\n\n            // Special case: edge vertex for exit from cell row\n            if (!isParallelX && tExit < 1) {\n                const x = aX + dirX * tExit;\n                const y = aY + dirY * tExit;\n                ring.push(this._vertexToIndex(x, y));\n            }\n\n            // When to split inter-edge boundary segments?\n            // When the boundary doesn't intersect a vertex, its easy. But what if it does?\n\n            //      a\n            //     /|\n            //    / |\n            // --c--|--boundary\n            //    \\ |\n            //     \\|\n            //      b\n            //\n            // Inter-edge region should be generated when processing the a-b edge.\n            // This happens fine for the top row, for the bottom row,\n            //\n\n            //      x\n            //     /|\n            //    / |\n            // --x--x--boundary\n            //\n            // Edge that lies on boundary should be subdivided in its edge phase.\n            // The inter-edge phase will correctly skip it.\n\n            // Add endpoint vertex\n            if (isParallelX || (bY >= cellRowYTop && bY <= cellRowYBottom)) {\n                ring.push(triangleIndices[(edgeIndex + 1) % 3]);\n            }\n            // Any edge that has endpoint outside this row or on its boundary gets\n            // inter-edge vertices.\n            // No row boundary to split for edges parallel with X\n            if (!isParallelX && (bY <= cellRowYTop || bY >= cellRowYBottom)) {\n                this._generateInterEdgeVertices(ring, aX, aY, bX, bY, cX, cY,\n                    exitX, cellRowYTop, cellRowYBottom);\n            }\n        }\n\n        return ring;\n    }\n\n    /**\n     * Generates ring vertices along an edge A-\\>B, but only in the part that intersects a given cell row.\n     * Does not handle adding edge endpoint vertices or edge cell row enter/exit vertices.\n     * @param ring - Ordered array of vertex indices for the constructed ring. New indices are placed here.\n     * @param enterX - The X coordinate of the point where edge A-\\>B enters the current cell row.\n     * @param exitX - The X coordinate of the point where edge A-\\>B exits the current cell row.\n     */\n    private _generateIntraEdgeVertices(\n        ring: number[],\n        aX: number,\n        aY: number,\n        bX: number,\n        bY: number,\n        enterX: number,\n        exitX: number\n    ): void {\n        const dirX = bX - aX;\n        const dirY = bY - aY;\n        const isParallelX = dirY === 0;\n\n        const leftX = isParallelX ? Math.min(aX, bX) : Math.min(enterX, exitX);\n        const rightX = isParallelX ? Math.max(aX, bX) : Math.max(enterX, exitX);\n\n        const edgeSubdivisionLeftCellX = Math.floor(leftX / this._granularityCellSize) + 1;\n        const edgeSubdivisionRightCellX = Math.ceil(rightX / this._granularityCellSize) - 1;\n\n        const isEdgeLeftToRight = isParallelX ? (aX < bX) : (enterX < exitX);\n        if (isEdgeLeftToRight) {\n            // Left to right\n            for (let cellX = edgeSubdivisionLeftCellX; cellX <= edgeSubdivisionRightCellX; cellX++) {\n                const x = cellX * this._granularityCellSize;\n                const y = aY + dirY * (x - aX) / dirX;\n                ring.push(this._vertexToIndex(x, y));\n            }\n        } else {\n            // Right to left\n            for (let cellX = edgeSubdivisionRightCellX; cellX >= edgeSubdivisionLeftCellX; cellX--) {\n                const x = cellX * this._granularityCellSize;\n                const y = aY + dirY * (x - aX) / dirX;\n                ring.push(this._vertexToIndex(x, y));\n            }\n        }\n    }\n\n    /**\n     * Generates ring vertices along cell border.\n     * Call when processing an edge A-\\>B that exits the current row (B lies outside the current row).\n     * Generates vertices along the cell edge between the exit point from cell row\n     * of edge A-\\>B and entry of edge B-\\>C, or entry of C-\\>A if both A and C lie outside the cell row.\n     * Does not handle adding edge endpoint vertices or edge cell row enter/exit vertices.\n     * @param ring - Ordered array of vertex indices for the constructed ring. New indices are placed here.\n     * @param exitX - The X coordinate of the point where edge A-\\>B exits the current cell row.\n     * @param cellRowYTop - The current cell row top Y coordinate.\n     * @param cellRowYBottom - The current cell row bottom Y coordinate.\n     */\n    private _generateInterEdgeVertices(\n        ring: number[],\n        aX: number,\n        aY: number,\n        bX: number,\n        bY: number,\n        cX: number,\n        cY: number,\n        exitX: number,\n        cellRowYTop: number,\n        cellRowYBottom: number\n    ): void {\n        const dirY = bY - aY;\n\n        const dir2X = cX - bX;\n        const dir2Y = cY - bY;\n        const t2Top = (cellRowYTop - bY) / dir2Y;\n        const t2Bottom = (cellRowYBottom - bY) / dir2Y;\n        // The distance along edge B->C where it enters/exits the current cell row,\n        // where distance 0 is B, 1 is C, 0.5 is the edge midpoint, etc.\n        const t2Enter = Math.min(t2Top, t2Bottom);\n        const t2Exit = Math.max(t2Top, t2Bottom);\n        const enter2X = bX + dir2X * t2Enter;\n        let boundarySubdivisionLeftCellX = Math.floor(Math.min(enter2X, exitX) / this._granularityCellSize) + 1;\n        let boundarySubdivisionRightCellX = Math.ceil(Math.max(enter2X, exitX) / this._granularityCellSize) - 1;\n        let isBoundaryLeftToRight = exitX < enter2X;\n\n        const isParallelX2 = dir2Y === 0;\n\n        if (isParallelX2 && (cY === cellRowYTop || cY === cellRowYBottom)) {\n            // Special case when edge b->c that lies on the cell boundary.\n            // Do not generate any inter-edge vertices in this case,\n            // this b->c edge gets subdivided when it is itself processed.\n            return;\n        }\n\n        if (isParallelX2 || t2Enter >= 1 || t2Exit <= 0) {\n            // The next edge (b->c) lies entirely outside this cell row\n            // Find entry point for the edge after that instead (c->a)\n\n            // There may be at most 1 edge that is parallel to X in a triangle.\n            // The main \"a->b\" edge must not be parallel at this point in the code.\n            // We know that \"a->b\" crosses the current cell row boundary, such that point \"b\" is beyond the boundary.\n            // If \"b->c\" is parallel to X, then \"c->a\" must not be parallel and must cross the cell row boundary back:\n            //      a\n            //      |\\\n            // -----|-\\--cell row boundary----\n            //      |  \\\n            //      c---b\n            // If \"b->c\" is not parallel to X and doesn't cross the cell row boundary,\n            // then c->a must also not be parallel to X and must cross the cell boundary back,\n            // since points \"a\" and \"c\" lie on different sides of the boundary and on different Y coordinates.\n            //\n            // Thus there is no need for \"parallel with X\" checks inside this condition branch.\n\n            // Compute the X coordinate where edge C->A enters the current cell row\n            const dir3X = aX - cX;\n            const dir3Y = aY - cY;\n            const t3Top = (cellRowYTop - cY) / dir3Y;\n            const t3Bottom = (cellRowYBottom - cY) / dir3Y;\n            const t3Enter = Math.min(t3Top, t3Bottom);\n            const enter3X = cX + dir3X * t3Enter;\n\n            boundarySubdivisionLeftCellX = Math.floor(Math.min(enter3X, exitX) / this._granularityCellSize) + 1;\n            boundarySubdivisionRightCellX = Math.ceil(Math.max(enter3X, exitX) / this._granularityCellSize) - 1;\n            isBoundaryLeftToRight = exitX < enter3X;\n        }\n\n        const boundaryY = dirY > 0 ? cellRowYBottom : cellRowYTop;\n        if (isBoundaryLeftToRight) {\n            // Left to right\n            for (let cellX = boundarySubdivisionLeftCellX; cellX <= boundarySubdivisionRightCellX; cellX++) {\n                const x = cellX * this._granularityCellSize;\n                ring.push(this._vertexToIndex(x, boundaryY));\n            }\n        } else {\n            // Right to left\n            for (let cellX = boundarySubdivisionRightCellX; cellX >= boundarySubdivisionLeftCellX; cellX--) {\n                const x = cellX * this._granularityCellSize;\n                ring.push(this._vertexToIndex(x, boundaryY));\n            }\n        }\n    }\n\n    /**\n     * Generates an outline for a given polygon, returns a list of arrays of line indices.\n     */\n    private _generateOutline(polygon: Point[][]): number[][] {\n        const subdividedLines: number[][] = [];\n        for (const ring of polygon) {\n            const line = subdivideVertexLine(ring, this._granularity, true);\n            const pathIndices = this._pointArrayToIndices(line);\n            // Points returned by subdivideVertexLine are \"path\" waypoints,\n            // for example with indices 0 1 2 3 0.\n            // We need list of individual line segments for rendering,\n            // for example 0, 1, 1, 2, 2, 3, 3, 0.\n            const lineIndices: number[] = [];\n            for (let i = 1; i < pathIndices.length; i++) {\n                lineIndices.push(pathIndices[i - 1]);\n                lineIndices.push(pathIndices[i]);\n            }\n            subdividedLines.push(lineIndices);\n        }\n        return subdividedLines;\n    }\n\n    /**\n     * Adds pole geometry if needed.\n     * @param subdividedTriangles - Array of generated triangle indices, new pole geometry is appended here.\n     */\n    private _handlePoles(subdividedTriangles: number[]) {\n        // Add pole vertices if the tile is at north/south mercator edge\n        let north = false;\n        let south = false;\n        if (this._canonical) {\n            if (this._canonical.y === 0) {\n                north = true;\n            }\n            if (this._canonical.y === (1 << this._canonical.z) - 1) {\n                south = true;\n            }\n        }\n        if (north || south) {\n            this._fillPoles(subdividedTriangles, north, south);\n        }\n    }\n\n    /**\n     * Checks the internal vertex buffer for all vertices that might lie on the special pole coordinates and shifts them by one unit.\n     * Use for removing unintended pole vertices that might have been created during subdivision. After calling this function, actual pole vertices can be safely generated.\n     */\n    private _ensureNoPoleVertices() {\n        const flattened = this._vertexBuffer;\n\n        for (let i = 0; i < flattened.length; i += 2) {\n            const vy = flattened[i + 1];\n            if (vy === NORTH_POLE_Y) {\n                // Move slightly down\n                flattened[i + 1] = NORTH_POLE_Y + 1;\n            }\n            if (vy === SOUTH_POLE_Y) {\n                // Move slightly down\n                flattened[i + 1] = SOUTH_POLE_Y - 1;\n            }\n        }\n    }\n\n    /**\n     * Generates a quad from an edge to a pole with the correct winding order.\n     * Helper function used inside {@link _fillPoles}.\n     * @param indices - Index array into which the geometry is generated.\n     * @param i0 - Index of the first edge vertex.\n     * @param i1 - Index of the second edge vertex.\n     * @param v0x - X coordinate of the first edge vertex.\n     * @param v1x - X coordinate of the second edge vertex.\n     * @param poleY - The Y coordinate of the desired pole (NORTH_POLE_Y or SOUTH_POLE_Y).\n     */\n    private _generatePoleQuad(indices, i0, i1, v0x, v1x, poleY): void {\n        const flip = (v0x > v1x) !== (poleY === NORTH_POLE_Y);\n\n        if (flip) {\n            indices.push(i0);\n            indices.push(i1);\n            indices.push(this._vertexToIndex(v0x, poleY));\n\n            indices.push(i1);\n            indices.push(this._vertexToIndex(v1x, poleY));\n            indices.push(this._vertexToIndex(v0x, poleY));\n        } else {\n            indices.push(i1);\n            indices.push(i0);\n            indices.push(this._vertexToIndex(v0x, poleY));\n\n            indices.push(this._vertexToIndex(v1x, poleY));\n            indices.push(i1);\n            indices.push(this._vertexToIndex(v0x, poleY));\n        }\n    }\n\n    /**\n     * Detects edges that border the north or south tile edge\n     * and adds triangles that extend those edges to the poles.\n     * Only run this function on tiles that border the poles.\n     * Assumes that supplied geometry is clipped to the inclusive range of 0..EXTENT.\n     * Mutates the supplies vertex and index arrays.\n     * @param indices - Triangle indices. This array is appended with new primitives.\n     * @param north - Whether to generate geometry for the north pole.\n     * @param south - Whether to generate geometry for the south pole.\n     */\n    private _fillPoles(indices: number[], north: boolean, south: boolean): void {\n        const flattened = this._vertexBuffer;\n\n        const northEdge = 0;\n        const southEdge = EXTENT;\n\n        const numIndices = indices.length;\n        for (let primitiveIndex = 2; primitiveIndex < numIndices; primitiveIndex += 3) {\n            const i0 = indices[primitiveIndex - 2];\n            const i1 = indices[primitiveIndex - 1];\n            const i2 = indices[primitiveIndex];\n            const v0x = flattened[i0 * 2];\n            const v0y = flattened[i0 * 2 + 1];\n            const v1x = flattened[i1 * 2];\n            const v1y = flattened[i1 * 2 + 1];\n            const v2x = flattened[i2 * 2];\n            const v2y = flattened[i2 * 2 + 1];\n\n            if (north) {\n                if (v0y === northEdge && v1y === northEdge) {\n                    this._generatePoleQuad(indices, i0, i1, v0x, v1x, NORTH_POLE_Y);\n                }\n                if (v1y === northEdge && v2y === northEdge) {\n                    this._generatePoleQuad(indices, i1, i2, v1x, v2x, NORTH_POLE_Y);\n                }\n                if (v2y === northEdge && v0y === northEdge) {\n                    this._generatePoleQuad(indices, i2, i0, v2x, v0x, NORTH_POLE_Y);\n                }\n            }\n            if (south) {\n                if (v0y === southEdge && v1y === southEdge) {\n                    this._generatePoleQuad(indices, i0, i1, v0x, v1x, SOUTH_POLE_Y);\n                }\n                if (v1y === southEdge && v2y === southEdge) {\n                    this._generatePoleQuad(indices, i1, i2, v1x, v2x, SOUTH_POLE_Y);\n                }\n                if (v2y === southEdge && v0y === southEdge) {\n                    this._generatePoleQuad(indices, i2, i0, v2x, v0x, SOUTH_POLE_Y);\n                }\n            }\n        }\n    }\n\n    /**\n     * Adds all vertices in the supplied flattened vertex buffer into the internal vertex buffer.\n     */\n    private _initializeVertices(flattened: number[]) {\n        for (let i = 0; i < flattened.length; i += 2) {\n            this._vertexToIndex(flattened[i], flattened[i + 1]);\n        }\n    }\n\n    /**\n     * Subdivides an input mesh. Imagine a regular square grid with the target granularity overlaid over the mesh - this is the subdivision's result.\n     * Assumes a mesh of tile features - vertex coordinates are integers, visible range where subdivision happens is 0..8192.\n     * @param polygon - The input polygon, specified as a list of vertex rings.\n     * @param generateOutlineLines - When true, also generates line indices for outline of the supplied polygon.\n     * @returns Vertex and index buffers with subdivision applied.\n     */\n    public subdividePolygonInternal(polygon: Point[][], generateOutlineLines: boolean): SubdivisionResult {\n        if (this._used) {\n            throw new Error('Subdivision: multiple use not allowed.');\n        }\n        this._used = true;\n\n        // Initialize the vertex dictionary with input vertices since we will use all of them anyway\n        const {flattened, holeIndices} = flatten(polygon);\n        this._initializeVertices(flattened);\n\n        // Subdivide triangles\n        let subdividedTriangles: number[];\n        try {\n            // At this point this._finalVertices is just flattened polygon points\n            const earcutResult = earcut(flattened, holeIndices);\n            const cut = this._convertIndices(flattened, earcutResult);\n            subdividedTriangles = this._subdivideTrianglesScanline(cut);\n        } catch (e) {\n            console.error(e);\n        }\n\n        // Subdivide lines\n        let subdividedLines: number[][] = [];\n        if (generateOutlineLines) {\n            subdividedLines = this._generateOutline(polygon);\n        }\n\n        // Ensure no vertex has the special value used for pole vertices\n        this._ensureNoPoleVertices();\n\n        // Add pole geometry if needed\n        this._handlePoles(subdividedTriangles);\n\n        return {\n            verticesFlattened: this._vertexBuffer,\n            indicesTriangles: subdividedTriangles,\n            indicesLineList: subdividedLines,\n        };\n    }\n\n    /**\n     * Sometimes the supplies vertex and index array has duplicate vertices - same coordinates that are referenced by multiple different indices.\n     * That is not allowed for purposes of subdivision, duplicates are removed in `this.initializeVertices`.\n     * This function converts the original index array that indexes into the original vertex array with duplicates\n     * into an index array that indexes into `this._finalVertices`.\n     * @param vertices - Flattened vertex array used by the old indices. This may contain duplicate vertices.\n     * @param oldIndices - Indices into the old vertex array.\n     * @returns Indices transformed so that they are valid indices into `this._finalVertices` (with duplicates removed).\n     */\n    private _convertIndices(vertices: number[], oldIndices: number[]): number[] {\n        const newIndices = [];\n        for (const oldIndex of oldIndices) {\n            const x = vertices[oldIndex * 2];\n            const y = vertices[oldIndex * 2 + 1];\n            newIndices.push(this._vertexToIndex(x, y));\n        }\n        return newIndices;\n    }\n\n    /**\n     * Converts an array of points into an array of indices into the internal vertex buffer (`_finalVertices`).\n     */\n    private _pointArrayToIndices(array: Point[]): number[] {\n        const indices = [];\n        for (const p of array) {\n            indices.push(this._vertexToIndex(p.x, p.y));\n        }\n        return indices;\n    }\n}\n\n/**\n * Subdivides a polygon to a given granularity. Intended for preprocessing geometry for the 'fill' and 'fill-extrusion' layer types.\n * All returned triangles have the counter-clockwise winding order.\n * @param polygon - An array of point rings that specify the polygon. The first ring is the polygon exterior, all subsequent rings form holes inside the first ring.\n * @param canonical - The canonical tile ID of the tile this polygon belongs to. Needed for generating special geometry for tiles that border the poles.\n * @param granularity - The subdivision granularity. If we assume tile EXTENT=8192, then a granularity of 2 will result in geometry being \"cut\" on each axis\n * divisible by 4096 (including outside the tile range, so -8192, -4096, or 12288...), granularity of 8 on axes divisible by 1024 and so on.\n * Granularity of 1 or lower results in *no* subdivision.\n * @param generateOutlineLines - When true, also generates index arrays for subdivided lines that form the outline of the supplied polygon. True by default.\n * @returns An object that contains the generated vertex array, triangle index array and, if specified, line index arrays.\n */\nexport function subdividePolygon(polygon: Point[][], canonical: CanonicalTileID, granularity: number, generateOutlineLines: boolean = true): SubdivisionResult {\n    const subdivider = new Subdivider(granularity, canonical);\n    return subdivider.subdividePolygonInternal(polygon, generateOutlineLines);\n}\n\n/**\n * Subdivides a line represented by an array of points. Mainly intended for preprocessing geometry for the 'line' layer type.\n * Assumes a line segment between each two consecutive points in the array.\n * Does not assume a line segment from last point to first point, unless `isRing` is set to `true`.\n * For example, an array of 4 points describes exactly 3 line segments.\n * @param linePoints - An array of points describing the line segments.\n * @param granularity - Subdivision granularity.\n * @param isRing - When true, an additional line segment is assumed to exist between the input array's last and first point.\n * @returns A new array of points of the subdivided line segments. The array may contain some of the original Point objects. If `isRing` is set to `true`, then this also includes the (subdivided) segment from the last point of the input array to the first point.\n *\n * @example\n * ```ts\n * const result = subdivideVertexLine([\n *   new Point(0, 0),\n *   new Point(8, 0),\n *   new Point(0, 8),\n * ], EXTENT / 4, false);\n * // Results in an array of points with these (x, y) coordinates:\n * //   0, 0\n * //   4, 0\n * //   8, 0\n * //   4, 4\n * //   0, 8\n * ```\n *\n * @example\n * ```ts\n * const result = subdivideVertexLine([\n *   new Point(0, 0),\n *   new Point(8, 0),\n *   new Point(0, 8),\n * ], EXTENT / 4, true);\n * // Results in an array of points with these (x, y) coordinates:\n * //   0, 0\n * //   4, 0\n * //   8, 0\n * //   4, 4\n * //   0, 8\n * //   0, 4\n * //   0, 0\n * ```\n */\nexport function subdivideVertexLine(linePoints: Point[], granularity: number, isRing: boolean = false): Point[] {\n    if (!linePoints || linePoints.length < 1) {\n        return [];\n    }\n\n    if (linePoints.length < 2) {\n        return [];\n    }\n\n    // Generate an extra line segment between the input array's first and last points,\n    // but only if isRing=true AND the first and last points actually differ.\n    const first = linePoints[0];\n    const last = linePoints[linePoints.length - 1];\n    const addLastToFirstSegment = isRing && (first.x !== last.x || first.y !== last.y);\n\n    if (granularity < 2) {\n        if (addLastToFirstSegment) {\n            return [...linePoints, linePoints[0]];\n        } else {\n            return [...linePoints];\n        }\n    }\n\n    const cellSize = Math.floor(EXTENT / granularity);\n    const finalLineVertices: Point[] = [];\n\n    finalLineVertices.push(new Point(linePoints[0].x, linePoints[0].y));\n\n    // Iterate over all input lines\n    const totalPoints = linePoints.length;\n    const lastIndex = addLastToFirstSegment ? totalPoints : (totalPoints - 1);\n    for (let pointIndex = 0; pointIndex < lastIndex; pointIndex++) {\n        const linePoint0 = linePoints[pointIndex];\n        const linePoint1 = pointIndex < (totalPoints - 1) ? linePoints[pointIndex + 1] : linePoints[0];\n        const lineVertex0x = linePoint0.x;\n        const lineVertex0y = linePoint0.y;\n        const lineVertex1x = linePoint1.x;\n        const lineVertex1y = linePoint1.y;\n\n        const dirXnonZero = lineVertex0x !== lineVertex1x;\n        const dirYnonZero = lineVertex0y !== lineVertex1y;\n\n        if (!dirXnonZero && !dirYnonZero) {\n            continue;\n        }\n\n        const dirX = lineVertex1x - lineVertex0x;\n        const dirY = lineVertex1y - lineVertex0y;\n        const absDirX = Math.abs(dirX);\n        const absDirY = Math.abs(dirY);\n\n        let lastPointX = lineVertex0x;\n        let lastPointY = lineVertex0y;\n\n        // Walk along the line segment from start to end. In every step,\n        // find out the distance from start until the line intersects either the X-parallel or Y-parallel subdivision axis.\n        // Pick the closer intersection, add it to the final line points and consider that point the new start of the line.\n        // But also make sure the intersection point does not lie beyond the end of the line.\n        // If none of the intersection points is closer than line end, add the endpoint to the final line and break the loop.\n\n        while (true) {\n            const nextBoundaryX = dirX > 0 ?\n                ((Math.floor(lastPointX / cellSize) + 1) * cellSize) :\n                ((Math.ceil(lastPointX / cellSize) - 1) * cellSize);\n            const nextBoundaryY = dirY > 0 ?\n                ((Math.floor(lastPointY / cellSize) + 1) * cellSize) :\n                ((Math.ceil(lastPointY / cellSize) - 1) * cellSize);\n            const axisDistanceToBoundaryX = Math.abs(lastPointX - nextBoundaryX);\n            const axisDistanceToBoundaryY = Math.abs(lastPointY - nextBoundaryY);\n\n            const axisDistanceToEndX = Math.abs(lastPointX - lineVertex1x);\n            const axisDistanceToEndY = Math.abs(lastPointY - lineVertex1y);\n\n            const realDistanceToBoundaryX = dirXnonZero ? axisDistanceToBoundaryX / absDirX : Number.POSITIVE_INFINITY;\n            const realDistanceToBoundaryY = dirYnonZero ? axisDistanceToBoundaryY / absDirY : Number.POSITIVE_INFINITY;\n\n            if ((axisDistanceToEndX <= axisDistanceToBoundaryX || !dirXnonZero) &&\n            (axisDistanceToEndY <= axisDistanceToBoundaryY || !dirYnonZero)) {\n                break;\n            }\n\n            if ((realDistanceToBoundaryX < realDistanceToBoundaryY && dirXnonZero) || !dirYnonZero) {\n                // We hit the X cell boundary first\n                // Always consider the X cell hit if Y dir is zero\n                lastPointX = nextBoundaryX;\n                lastPointY = lastPointY + dirY * realDistanceToBoundaryX;\n                const next = new Point(lastPointX, Math.round(lastPointY));\n\n                // Do not add the next vertex if it is equal to the last added vertex\n                if (finalLineVertices[finalLineVertices.length - 1].x !== next.x ||\n                    finalLineVertices[finalLineVertices.length - 1].y !== next.y) {\n                    finalLineVertices.push(next);\n                }\n            } else {\n                lastPointX = lastPointX + dirX * realDistanceToBoundaryY;\n                lastPointY = nextBoundaryY;\n                const next = new Point(Math.round(lastPointX), lastPointY);\n\n                if (finalLineVertices[finalLineVertices.length - 1].x !== next.x ||\n                    finalLineVertices[finalLineVertices.length - 1].y !== next.y) {\n                    finalLineVertices.push(next);\n                }\n            }\n        }\n\n        const last = new Point(lineVertex1x, lineVertex1y);\n        if (finalLineVertices[finalLineVertices.length - 1].x !== last.x ||\n            finalLineVertices[finalLineVertices.length - 1].y !== last.y) {\n            finalLineVertices.push(last);\n        }\n    }\n\n    return finalLineVertices;\n}\n\n/**\n * Takes a polygon as an array of point rings, returns a flattened array of the X,Y coordinates of these points.\n * Also creates an array of hole indices. Both returned arrays are required for `earcut`.\n */\nfunction flatten(polygon: Point[][]): {\n    flattened: number[];\n    holeIndices: number[];\n} {\n    const holeIndices = [];\n    const flattened = [];\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 (const vertex of ring) {\n            flattened.push(vertex.x);\n            flattened.push(vertex.y);\n        }\n    }\n\n    return {\n        flattened,\n        holeIndices\n    };\n}\n\n/**\n * Returns a new array of indices where all triangles have the counter-clockwise winding order.\n * @param flattened - Flattened vertex buffer.\n * @param indices - Triangle indices.\n */\nexport function fixWindingOrder(flattened: number[], indices: number[]): number[] {\n    const corrected = [];\n\n    for (let i = 0; i < indices.length; i += 3) {\n        const i0 = indices[i];\n        const i1 = indices[i + 1];\n        const i2 = indices[i + 2];\n\n        const v0x = flattened[i0 * 2];\n        const v0y = flattened[i0 * 2 + 1];\n        const v1x = flattened[i1 * 2];\n        const v1y = flattened[i1 * 2 + 1];\n        const v2x = flattened[i2 * 2];\n        const v2y = flattened[i2 * 2 + 1];\n\n        const e0x = v1x - v0x;\n        const e0y = v1y - v0y;\n        const e1x = v2x - v0x;\n        const e1y = v2y - v0y;\n\n        const crossProduct = e0x * e1y - e0y * e1x;\n\n        if (crossProduct > 0) {\n            // Flip\n            corrected.push(i0);\n            corrected.push(i2);\n            corrected.push(i1);\n        } else {\n            // Don't flip\n            corrected.push(i0);\n            corrected.push(i1);\n            corrected.push(i2);\n        }\n    }\n\n    return corrected;\n}\n\n/**\n * Triangulates a ring of vertex indices. Appends to the supplied array of final triangle indices.\n * @param vertexBuffer - Flattened vertex coordinate array.\n * @param ring - Ordered ring of vertex indices to triangulate.\n * @param leftmostIndex - The index of the leftmost vertex in the supplied ring.\n * @param finalIndices - Array of final triangle indices, into where the resulting triangles are appended.\n */\nexport function scanlineTriangulateVertexRing(vertexBuffer: number[], ring: number[], finalIndices: number[]): void {\n    // Triangulate the ring\n    // It is guaranteed to be convex and ordered\n    if (ring.length === 0) {\n        throw new Error('Subdivision vertex ring is empty.');\n    }\n\n    // Find the leftmost vertex in the ring\n    let leftmostIndex = 0;\n    let leftmostX = vertexBuffer[ring[0] * 2];\n    for (let i = 1; i < ring.length; i++) {\n        const x = vertexBuffer[ring[i] * 2];\n        if (x < leftmostX) {\n            leftmostX = x;\n            leftmostIndex = i;\n        }\n    }\n\n    // Traverse the ring in both directions from the leftmost vertex\n    // Assume ring is in CCW order (to produce CCW triangles)\n    const ringVertexLength = ring.length;\n    let lastEdgeA = leftmostIndex;\n    let lastEdgeB = (lastEdgeA + 1) % ringVertexLength;\n\n    while (true) {\n        const candidateIndexA = (lastEdgeA - 1) >= 0 ? (lastEdgeA - 1) : (ringVertexLength - 1);\n        const candidateIndexB = (lastEdgeB + 1) % ringVertexLength;\n\n        // Pick candidate, move edge\n        const candidateAx = vertexBuffer[ring[candidateIndexA] * 2];\n        const candidateAy = vertexBuffer[ring[candidateIndexA] * 2 + 1];\n        const candidateBx = vertexBuffer[ring[candidateIndexB] * 2];\n        const candidateBy = vertexBuffer[ring[candidateIndexB] * 2 + 1];\n        const lastEdgeAx = vertexBuffer[ring[lastEdgeA] * 2];\n        const lastEdgeAy = vertexBuffer[ring[lastEdgeA] * 2 + 1];\n        const lastEdgeBx = vertexBuffer[ring[lastEdgeB] * 2];\n        const lastEdgeBy = vertexBuffer[ring[lastEdgeB] * 2 + 1];\n\n        let pickA = false;\n\n        if (candidateAx < candidateBx) {\n            pickA = true;\n        } else if (candidateAx > candidateBx) {\n            pickA = false;\n        } else {\n            // Pick the candidate that is more \"right\" of the last edge's line\n            const nx = lastEdgeBy - lastEdgeAy;\n            const ny = -(lastEdgeBx - lastEdgeAx);\n            const sign = (lastEdgeAy < lastEdgeBy) ? 1 : -1;\n            // dot( (candidateA <-- lastEdgeA), normal )\n            const aRight = ((candidateAx - lastEdgeAx) * nx + (candidateAy - lastEdgeAy) * ny) * sign;\n            // dot( (candidateB <-- lastEdgeA), normal )\n            const bRight = ((candidateBx - lastEdgeAx) * nx + (candidateBy - lastEdgeAy) * ny) * sign;\n            if (aRight > bRight) {\n                pickA = true;\n            }\n        }\n\n        if (pickA) {\n            // Pick candidate A\n            const c = ring[candidateIndexA];\n            const a = ring[lastEdgeA];\n            const b = ring[lastEdgeB];\n            if (c !== a && c !== b && a !== b) {\n                finalIndices.push(b, a, c);\n            }\n            lastEdgeA--;\n            if (lastEdgeA < 0) {\n                lastEdgeA = ringVertexLength - 1;\n            }\n        } else {\n            // Pick candidate B\n            const c = ring[candidateIndexB];\n            const a = ring[lastEdgeA];\n            const b = ring[lastEdgeB];\n            if (c !== a && c !== b && a !== b) {\n                finalIndices.push(b, a, c);\n            }\n            lastEdgeB++;\n            if (lastEdgeB >= ringVertexLength) {\n                lastEdgeB = 0;\n            }\n        }\n\n        if (candidateIndexA === candidateIndexB) {\n            break; // We ran out of ring vertices\n        }\n    }\n}\n", "import {type LineIndexArray, type TriangleIndexArray} from '../data/array_types.g';\nimport {type Segment, SegmentVector} from '../data/segment';\nimport {type StructArray} from '../util/struct_array';\n\n/**\n * This function will take any \"mesh\" and fill in into vertex buffers, breaking it up into multiple drawcalls as needed\n * if too many (\\>65535) vertices are used.\n * This function is mainly intended for use with subdivided geometry, since sometimes subdivision might generate\n * more vertices than what fits into 16 bit indices.\n *\n * Accepts a triangle mesh, optionally with a line list (for fill outlines) as well. The triangle and line segments are expected to share a single vertex buffer.\n *\n * Mutates the provided `segmentsTriangles` and `segmentsLines` SegmentVectors,\n * `vertexArray`, `triangleIndexArray` and optionally `lineIndexArray`.\n * Does not mutate the input `flattened` vertices, `triangleIndices` and `lineList`.\n * @param addVertex - A function for adding a new vertex into `vertexArray`. We might sometimes want to add more values per vertex than just X and Y coordinates, which can be handled in this function.\n * @param segmentsTriangles - The segment array for triangle draw calls. New segments will be placed here.\n * @param vertexArray - The vertex array into which new vertices are placed by the provided `addVertex` function.\n * @param triangleIndexArray - Index array for drawing triangles. New triangle indices are placed here.\n * @param flattened - The input flattened array or vertex coordinates.\n * @param triangleIndices - Triangle indices into `flattened`.\n * @param segmentsLines - Segment array for line draw calls. New segments will be placed here. Only needed if the mesh also contains lines.\n * @param lineIndexArray - Index array for drawing lines. New triangle indices are placed here. Only needed if the mesh also contains lines.\n * @param lineList - Line indices into `flattened`. Only needed if the mesh also contains lines.\n */\nexport function fillLargeMeshArrays(\n    addVertex: (x: number, y: number) => void,\n    segmentsTriangles: SegmentVector,\n    vertexArray: StructArray,\n    triangleIndexArray: TriangleIndexArray,\n    flattened: number[],\n    triangleIndices: number[],\n    segmentsLines?: SegmentVector,\n    lineIndexArray?: LineIndexArray,\n    lineList?: number[][]) {\n\n    const numVertices = flattened.length / 2;\n    const hasLines = segmentsLines && lineIndexArray && lineList;\n\n    if (numVertices < SegmentVector.MAX_VERTEX_ARRAY_LENGTH) {\n        // The fast path - no segmentation needed\n        const triangleSegment = segmentsTriangles.prepareSegment(numVertices, vertexArray, triangleIndexArray);\n        const triangleIndex = triangleSegment.vertexLength;\n\n        for (let i = 0; i < triangleIndices.length; i += 3) {\n            triangleIndexArray.emplaceBack(\n                triangleIndex + triangleIndices[i],\n                triangleIndex + triangleIndices[i + 1],\n                triangleIndex + triangleIndices[i + 2]);\n        }\n\n        triangleSegment.vertexLength += numVertices;\n        triangleSegment.primitiveLength += triangleIndices.length / 3;\n\n        let lineIndicesStart: number;\n        let lineSegment: Segment;\n\n        if (hasLines) {\n            // Note that segment creation must happen *before* we add vertices into the vertex buffer\n            lineSegment = segmentsLines.prepareSegment(numVertices, vertexArray, lineIndexArray);\n            lineIndicesStart = lineSegment.vertexLength;\n            lineSegment.vertexLength += numVertices;\n        }\n\n        // Add vertices into vertex buffer\n        for (let i = 0; i < flattened.length; i += 2) {\n            addVertex(flattened[i], flattened[i + 1]);\n        }\n\n        if (hasLines) {\n            for (const lineIndices of lineList) {\n\n                for (let i = 1; i < lineIndices.length; i += 2) {\n                    lineIndexArray.emplaceBack(\n                        lineIndicesStart + lineIndices[i - 1],\n                        lineIndicesStart + lineIndices[i]);\n                }\n\n                lineSegment.primitiveLength += lineIndices.length / 2;\n            }\n        }\n    } else {\n        // Assumption: the incoming triangle indices use vertices in roughly linear order,\n        // for example a grid of quads where both vertices and quads are created row by row would satisfy this.\n        // Some completely random arbitrary vertex/triangle order would not.\n        // Thus, if we encounter a vertex that doesn't fit into MAX_VERTEX_ARRAY_LENGTH,\n        // we can just stop appending into the old segment and start a new segment and only append to the new segment,\n        // copying vertices that are already present in the old segment into the new segment if needed,\n        // because there will not be too many of such vertices.\n\n        // Normally, (out)lines share the same vertex buffer as triangles, but since we need to somehow split it into several drawcalls,\n        // it is easier to just consider (out)lines separately and duplicate their vertices.\n\n        fillSegmentsTriangles(segmentsTriangles, vertexArray, triangleIndexArray, flattened, triangleIndices, addVertex);\n        if (hasLines) {\n            fillSegmentsLines(segmentsLines, vertexArray, lineIndexArray, flattened, lineList, addVertex);\n        }\n\n        // Triangles and lines share the same vertex buffer, and they usually also share the same vertices.\n        // But this method might create the vertices for triangles and for lines separately, and thus increasing the vertex count\n        // of the triangle and line segments by different amounts.\n\n        // The non-splitting fillLargeMeshArrays logic (and old fill-bucket logic) assumes the vertex counts to be the same,\n        // and forcing both SegmentVectors to return a new segment upon next prepare call satisfies this.\n        segmentsTriangles.forceNewSegmentOnNextPrepare();\n        segmentsLines?.forceNewSegmentOnNextPrepare();\n    }\n}\n\n/**\n * Determines the new index of a vertex given by its old index.\n * @param actualVertexIndices - Array that maps the old index of a given vertex to a new index in the final vertex buffer.\n * @param flattened - Old vertex buffer.\n * @param addVertex - Function for creating a new vertex in the final vertex buffer.\n * @param totalVerticesCreated - Reference to an int holding how many vertices were added to the final vertex buffer.\n * @param oldIndex - The old index of the desired vertex.\n * @param needsCopy - Whether to duplicate the desired vertex in the final vertex buffer.\n * @param segment - The current segment.\n * @returns Index of the vertex in the final vertex array.\n */\nfunction copyOrReuseVertex(\n    actualVertexIndices: number[],\n    flattened: number[],\n    addVertex: (x: number, y: number) => void,\n    totalVerticesCreated: {count: number},\n    oldIndex: number,\n    needsCopy: boolean,\n    segment: Segment\n): number {\n    if (needsCopy) {\n        const newIndex = totalVerticesCreated.count;\n        addVertex(flattened[oldIndex * 2], flattened[oldIndex * 2 + 1]);\n        actualVertexIndices[oldIndex] = totalVerticesCreated.count;\n        totalVerticesCreated.count++;\n        segment.vertexLength++;\n        return newIndex;\n    } else {\n        return actualVertexIndices[oldIndex];\n    }\n}\n\nfunction fillSegmentsTriangles(\n    segmentsTriangles: SegmentVector,\n    vertexArray: StructArray,\n    triangleIndexArray: TriangleIndexArray,\n    flattened: number[],\n    triangleIndices: number[],\n    addVertex: (x: number, y: number) => void\n) {\n    // Array, or rather a map of [vertex index in the original data] -> index of the latest copy of this vertex in the final vertex buffer.\n    const actualVertexIndices: number[] = [];\n    for (let i = 0; i < flattened.length / 2; i++) {\n        actualVertexIndices.push(-1);\n    }\n\n    const totalVerticesCreated = {count: 0};\n\n    let currentSegmentCutoff = 0;\n    let segment = segmentsTriangles.getOrCreateLatestSegment(vertexArray, triangleIndexArray);\n    let baseVertex = segment.vertexLength;\n\n    for (let primitiveEndIndex = 2; primitiveEndIndex < triangleIndices.length; primitiveEndIndex += 3) {\n        const i0 = triangleIndices[primitiveEndIndex - 2];\n        const i1 = triangleIndices[primitiveEndIndex - 1];\n        const i2 = triangleIndices[primitiveEndIndex];\n\n        let i0needsVertexCopy = actualVertexIndices[i0] < currentSegmentCutoff;\n        let i1needsVertexCopy = actualVertexIndices[i1] < currentSegmentCutoff;\n        let i2needsVertexCopy = actualVertexIndices[i2] < currentSegmentCutoff;\n\n        const vertexCopyCount = (i0needsVertexCopy ? 1 : 0) + (i1needsVertexCopy ? 1 : 0) + (i2needsVertexCopy ? 1 : 0);\n\n        // Will needed vertex copies fit into this segment?\n        if (segment.vertexLength + vertexCopyCount > SegmentVector.MAX_VERTEX_ARRAY_LENGTH) {\n            // Break up into a new segment if not.\n            segment = segmentsTriangles.createNewSegment(vertexArray, triangleIndexArray);\n            currentSegmentCutoff = totalVerticesCreated.count;\n            i0needsVertexCopy = true;\n            i1needsVertexCopy = true;\n            i2needsVertexCopy = true;\n            baseVertex = 0;\n        }\n\n        const actualIndex0 = copyOrReuseVertex(\n            actualVertexIndices, flattened, addVertex, totalVerticesCreated,\n            i0, i0needsVertexCopy, segment);\n        const actualIndex1 = copyOrReuseVertex(\n            actualVertexIndices, flattened, addVertex, totalVerticesCreated,\n            i1, i1needsVertexCopy, segment);\n        const actualIndex2 = copyOrReuseVertex(\n            actualVertexIndices, flattened, addVertex, totalVerticesCreated,\n            i2, i2needsVertexCopy, segment);\n\n        triangleIndexArray.emplaceBack(\n            baseVertex + actualIndex0 - currentSegmentCutoff,\n            baseVertex + actualIndex1 - currentSegmentCutoff,\n            baseVertex + actualIndex2 - currentSegmentCutoff\n        );\n\n        segment.primitiveLength++;\n    }\n}\n\nfunction fillSegmentsLines(\n    segmentsLines: SegmentVector,\n    vertexArray: StructArray,\n    lineIndexArray: LineIndexArray,\n    flattened: number[],\n    lineList: number[][],\n    addVertex: (x: number, y: number) => void\n) {\n    // Array, or rather a map of [vertex index in the original data] -> index of the latest copy of this vertex in the final vertex buffer.\n    const actualVertexIndices: number[] = [];\n    for (let i = 0; i < flattened.length / 2; i++) {\n        actualVertexIndices.push(-1);\n    }\n\n    const totalVerticesCreated = {count: 0};\n\n    let currentSegmentCutoff = 0;\n    let segment = segmentsLines.getOrCreateLatestSegment(vertexArray, lineIndexArray);\n    let baseVertex = segment.vertexLength;\n\n    for (const currentLine of lineList) {\n        for (let lineVertex = 1; lineVertex < currentLine.length; lineVertex += 2) {\n            const i0 = currentLine[lineVertex - 1];\n            const i1 = currentLine[lineVertex];\n\n            let i0needsVertexCopy = actualVertexIndices[i0] < currentSegmentCutoff;\n            let i1needsVertexCopy = actualVertexIndices[i1] < currentSegmentCutoff;\n\n            const vertexCopyCount = (i0needsVertexCopy ? 1 : 0) + (i1needsVertexCopy ? 1 : 0);\n\n            // Will needed vertex copies fit into this segment?\n            if (segment.vertexLength + vertexCopyCount > SegmentVector.MAX_VERTEX_ARRAY_LENGTH) {\n                // Break up into a new segment if not.\n                segment = segmentsLines.createNewSegment(vertexArray, lineIndexArray);\n                currentSegmentCutoff = totalVerticesCreated.count;\n                i0needsVertexCopy = true;\n                i1needsVertexCopy = true;\n                baseVertex = 0;\n            }\n\n            const actualIndex0 = copyOrReuseVertex(\n                actualVertexIndices, flattened, addVertex, totalVerticesCreated,\n                i0, i0needsVertexCopy, segment);\n            const actualIndex1 = copyOrReuseVertex(\n                actualVertexIndices, flattened, addVertex, totalVerticesCreated,\n                i1, i1needsVertexCopy, segment);\n\n            lineIndexArray.emplaceBack(\n                baseVertex + actualIndex0 - currentSegmentCutoff,\n                baseVertex + actualIndex1 - currentSegmentCutoff\n            );\n\n            segment.primitiveLength++;\n        }\n    }\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 {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 '../../tile/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 '../../webgl/context';\nimport type {IndexBuffer} from '../../webgl/index_buffer';\nimport type {VertexBuffer} from '../../webgl/vertex_buffer';\nimport type Point from '@mapbox/point-geometry';\nimport type {FeatureStates} from '../../source/source_state';\nimport type {ImagePosition} from '../../render/image_atlas';\nimport {subdividePolygon} from '../../render/subdivision';\nimport type {SubdivisionGranularitySetting} from '../../render/subdivision_granularity_settings';\nimport {fillLargeMeshArrays} from '../../render/fill_large_mesh_arrays';\nimport type {VectorTileLayerLike} from '@maplibre/vt-pbf';\n\nexport class FillBucket implements Bucket {\n    index: number;\n    zoom: number;\n    overscaling: number;\n    layers: FillStyleLayer[];\n    layerIds: string[];\n    stateDependentLayers: FillStyleLayer[];\n    stateDependentLayerIds: string[];\n    patternFeatures: BucketFeature[];\n\n    layoutVertexArray: FillLayoutArray;\n    layoutVertexBuffer: VertexBuffer;\n\n    indexArray: TriangleIndexArray;\n    indexBuffer: IndexBuffer;\n\n    indexArray2: LineIndexArray;\n    indexBuffer2: IndexBuffer;\n\n    hasDependencies: 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.hasDependencies = 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: IndexedFeature[], options: PopulateParameters, canonical: CanonicalTileID) {\n        this.hasDependencies = 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.hasDependencies) {\n                const patternFeature = addPatternDependencies('fill', this.layers, bucketFeature, {zoom: 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, {}, options.subdivisionGranularity);\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: VectorTileLayerLike, imagePositions: {\n        [_: string]: ImagePosition;\n    }) {\n        if (!this.stateDependentLayers.length) return;\n        this.programConfigurations.updatePaintArrays(states, vtLayer, this.stateDependentLayers, {\n            imagePositions\n        });\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, options.subdivisionGranularity);\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: Point[][], index: number, canonical: CanonicalTileID, imagePositions: {\n        [_: string]: ImagePosition;\n    }, subdivisionGranularity: SubdivisionGranularitySetting) {\n        for (const polygon of classifyRings(geometry, EARCUT_MAX_RINGS)) {\n            const subdivided = subdividePolygon(polygon, canonical, subdivisionGranularity.fill.getGranularityForZoomLevel(canonical.z));\n\n            const vertexArray = this.layoutVertexArray;\n\n            fillLargeMeshArrays(\n                (x, y) => {\n                    vertexArray.emplaceBack(x, y);\n                },\n                this.segments,\n                this.layoutVertexArray,\n                this.indexArray,\n                subdivided.verticesFlattened,\n                subdivided.indicesTriangles,\n                this.segments2,\n                this.indexArray2,\n                subdivided.indicesLineList,\n            );\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, NumberArray, ColorArray, 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 {type QueryIntersectsFeatureParams, StyleLayer} from '../style_layer';\nimport {FillBucket} from '../../data/bucket/fill_bucket';\nimport {polygonIntersectsMultiPolygon} from '../../util/intersection_tests';\nimport {translateDistance, translate} from '../query_utils';\nimport properties, {type FillLayoutPropsPossiblyEvaluated, type FillPaintPropsPossiblyEvaluated} from './fill_style_layer_properties.g';\n\nimport type {Transitionable, Transitioning, Layout, PossiblyEvaluated} from '../properties';\nimport type {LayerSpecification} from '@maplibre/maplibre-gl-style-spec';\nimport type {BucketParameters} from '../../data/bucket';\nimport type {FillLayoutProps, FillPaintProps} from './fill_style_layer_properties.g';\nimport type {EvaluationParameters} from '../evaluation_parameters';\n\nexport const isFillStyleLayer = (layer: StyleLayer): layer is FillStyleLayer => layer.type === 'fill';\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, globalState: Record<string, any>) {\n        super(layer, properties, globalState);\n    }\n\n    recalculate(parameters: EvaluationParameters, availableImages: 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,\n        geometry,\n        transform,\n        pixelsToTileUnits}: QueryIntersectsFeatureParams\n    ): boolean {\n        const translatedPolygon = translate(queryGeometry,\n            this.paint.get('fill-translate'),\n            this.paint.get('fill-translate-anchor'),\n            -transform.bearingInRadians, 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", "\nimport Point from '@mapbox/point-geometry';\n\n/** @import Pbf from 'pbf' */\n/** @import {Feature} from 'geojson' */\n\nexport class VectorTileFeature {\n    /**\n     * @param {Pbf} pbf\n     * @param {number} end\n     * @param {number} extent\n     * @param {string[]} keys\n     * @param {(number | string | boolean)[]} values\n     */\n    constructor(pbf, end, extent, keys, values) {\n        // Public\n\n        /** @type {Record<string, number | string | boolean>} */\n        this.properties = {};\n\n        this.extent = extent;\n        /** @type {0 | 1 | 2 | 3} */\n        this.type = 0;\n\n        /** @type {number | undefined} */\n        this.id = undefined;\n\n        /** @private */\n        this._pbf = pbf;\n        /** @private */\n        this._geometry = -1;\n        /** @private */\n        this._keys = keys;\n        /** @private */\n        this._values = values;\n\n        pbf.readFields(readFeature, this, end);\n    }\n\n    loadGeometry() {\n        const pbf = this._pbf;\n        pbf.pos = this._geometry;\n\n        const end = pbf.readVarint() + pbf.pos;\n\n        /** @type Point[][] */\n        const lines = [];\n\n        /** @type Point[] | undefined */\n        let line;\n\n        let cmd = 1;\n        let length = 0;\n        let x = 0;\n        let y = 0;\n\n        while (pbf.pos < end) {\n            if (length <= 0) {\n                const 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                if (line) 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\n    bbox() {\n        const pbf = this._pbf;\n        pbf.pos = this._geometry;\n\n        const end = pbf.readVarint() + pbf.pos;\n        let 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                const 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\n    /**\n     * @param {number} x\n     * @param {number} y\n     * @param {number} z\n     * @return {Feature}\n     */\n    toGeoJSON(x, y, z) {\n        const size = this.extent * Math.pow(2, z),\n            x0 = this.extent * x,\n            y0 = this.extent * y,\n            vtCoords = this.loadGeometry();\n\n        /** @param {Point} p */\n        function projectPoint(p) {\n            return [\n                (p.x + x0) * 360 / size - 180,\n                360 / Math.PI * Math.atan(Math.exp((1 - (p.y + y0) * 2 / size) * Math.PI)) - 90\n            ];\n        }\n\n        /** @param {Point[]} line */\n        function projectLine(line) {\n            return line.map(projectPoint);\n        }\n\n        /** @type {Feature[\"geometry\"]} */\n        let geometry;\n\n        if (this.type === 1) {\n            const points = [];\n            for (const line of vtCoords) {\n                points.push(line[0]);\n            }\n            const coordinates = projectLine(points);\n            geometry = points.length === 1 ?\n                {type: 'Point', coordinates: coordinates[0]} :\n                {type: 'MultiPoint', coordinates};\n\n        } else if (this.type === 2) {\n\n            const coordinates = vtCoords.map(projectLine);\n            geometry = coordinates.length === 1 ?\n                {type: 'LineString', coordinates: coordinates[0]} :\n                {type: 'MultiLineString', coordinates};\n\n        } else if (this.type === 3) {\n            const polygons = classifyRings(vtCoords);\n            const coordinates = [];\n            for (const polygon of polygons) {\n                coordinates.push(polygon.map(projectLine));\n            }\n            geometry = coordinates.length === 1 ?\n                {type: 'Polygon', coordinates: coordinates[0]} :\n                {type: 'MultiPolygon', coordinates};\n        } else {\n\n            throw new Error('unknown feature type');\n        }\n\n        /** @type {Feature} */\n        const result = {\n            type: 'Feature',\n            geometry,\n            properties: this.properties\n        };\n\n        if (this.id != null) {\n            result.id = this.id;\n        }\n\n        return result;\n    }\n}\n\n/** @type {['Unknown', 'Point', 'LineString', 'Polygon']} */\nVectorTileFeature.types = ['Unknown', 'Point', 'LineString', 'Polygon'];\n\n/**\n * @param {number} tag\n * @param {VectorTileFeature} feature\n * @param {Pbf} pbf\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 = /** @type {0 | 1 | 2 | 3} */ (pbf.readVarint());\n    // @ts-expect-error TS2341 deliberately accessing a private property\n    else if (tag === 4) feature._geometry = pbf.pos;\n}\n\n/**\n * @param {Pbf} pbf\n * @param {VectorTileFeature} feature\n */\nfunction readTag(pbf, feature) {\n    const end = pbf.readVarint() + pbf.pos;\n\n    while (pbf.pos < end) {\n        // @ts-expect-error TS2341 deliberately accessing a private property\n        const key = feature._keys[pbf.readVarint()];\n        // @ts-expect-error TS2341 deliberately accessing a private property\n        const value = feature._values[pbf.readVarint()];\n        feature.properties[key] = value;\n    }\n}\n\n/** classifies an array of rings into polygons with outer rings and holes\n * @param {Point[][]} rings\n */\nexport function classifyRings(rings) {\n    const len = rings.length;\n\n    if (len <= 1) return [rings];\n\n    const polygons = [];\n    let polygon, ccw;\n\n    for (let i = 0; i < len; i++) {\n        const 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 if (polygon) {\n            polygon.push(rings[i]);\n        }\n    }\n    if (polygon) polygons.push(polygon);\n\n    return polygons;\n}\n\n/** @param {Point[]} ring */\nfunction signedArea(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\nexport class VectorTileLayer {\n    /**\n     * @param {Pbf} pbf\n     * @param {number} [end]\n     */\n    constructor(pbf, end) {\n        // Public\n        this.version = 1;\n        this.name = '';\n        this.extent = 4096;\n        this.length = 0;\n\n        /** @private */\n        this._pbf = pbf;\n\n        /** @private\n         * @type {string[]} */\n        this._keys = [];\n\n        /** @private\n         * @type {(number | string | boolean)[]} */\n        this._values = [];\n\n        /** @private\n         * @type {number[]} */\n        this._features = [];\n\n        pbf.readFields(readLayer, this, end);\n\n        this.length = this._features.length;\n    }\n\n    /** return feature `i` from this layer as a `VectorTileFeature`\n     * @param {number} i\n     */\n    feature(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        const end = this._pbf.readVarint() + this._pbf.pos;\n        return new VectorTileFeature(this._pbf, end, this.extent, this._keys, this._values);\n    }\n}\n\n/**\n * @param {number} tag\n * @param {VectorTileLayer} layer\n * @param {Pbf} pbf\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    // @ts-expect-error TS2341 deliberately accessing a private property\n    else if (tag === 2) layer._features.push(pbf.pos);\n    // @ts-expect-error TS2341 deliberately accessing a private property\n    else if (tag === 3) layer._keys.push(pbf.readString());\n    // @ts-expect-error TS2341 deliberately accessing a private property\n    else if (tag === 4) layer._values.push(readValueMessage(pbf));\n}\n\n/**\n * @param {Pbf} pbf\n */\nfunction readValueMessage(pbf) {\n    let value = null;\n    const end = pbf.readVarint() + pbf.pos;\n\n    while (pbf.pos < end) {\n        const 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    if (value == null) {\n        throw new Error('unknown feature value');\n    }\n\n    return value;\n}\n\nexport class VectorTile {\n    /**\n     * @param {Pbf} pbf\n     * @param {number} [end]\n     */\n    constructor(pbf, end) {\n        /** @type {Record<string, VectorTileLayer>} */\n        this.layers = pbf.readFields(readTile, {}, end);\n    }\n}\n\n/**\n * @param {number} tag\n * @param {Record<string, VectorTileLayer>} layers\n * @param {Pbf} pbf\n */\nfunction readTile(tag, layers, pbf) {\n    if (tag === 3) {\n        const layer = new VectorTileLayer(pbf, pbf.readVarint() + pbf.pos);\n        if (layer.length) layers[layer.name] = layer;\n    }\n}\n", "import {FillExtrusionLayoutArray, PosArray} from '../array_types.g';\n\nimport {members as layoutAttributes, centroidAttributes} from './fill_extrusion_attributes';\nimport {type Segment, SegmentVector} from '../segment';\nimport {ProgramConfigurationSet} from '../program_configuration';\nimport {TriangleIndexArray} from '../index_array_type';\nimport {EXTENT} from '../extent';\nimport {VectorTileFeature} from '@mapbox/vector-tile';\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 '../../tile/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 '../../webgl/context';\nimport type {IndexBuffer} from '../../webgl/index_buffer';\nimport type {VertexBuffer} from '../../webgl/vertex_buffer';\nimport type Point from '@mapbox/point-geometry';\nimport type {FeatureStates} from '../../source/source_state';\nimport type {ImagePosition} from '../../render/image_atlas';\nimport {subdividePolygon, subdivideVertexLine} from '../../render/subdivision';\nimport type {SubdivisionGranularitySetting} from '../../render/subdivision_granularity_settings';\nimport {fillLargeMeshArrays} from '../../render/fill_large_mesh_arrays';\nimport type {VectorTileLayerLike} from '@maplibre/vt-pbf';\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\ntype CentroidAccumulator = {\n    x: number;\n    y: number;\n    sampleCount: number;\n};\n\nexport class FillExtrusionBucket implements Bucket {\n    index: number;\n    zoom: number;\n    overscaling: number;\n    layers: FillExtrusionStyleLayer[];\n    layerIds: string[];\n    stateDependentLayers: FillExtrusionStyleLayer[];\n    stateDependentLayerIds: string[];\n\n    layoutVertexArray: FillExtrusionLayoutArray;\n    layoutVertexBuffer: VertexBuffer;\n\n    centroidVertexArray: PosArray;\n    centroidVertexBuffer: VertexBuffer;\n\n    indexArray: TriangleIndexArray;\n    indexBuffer: IndexBuffer;\n\n    hasDependencies: boolean;\n    programConfigurations: ProgramConfigurationSet<FillExtrusionStyleLayer>;\n    segments: SegmentVector;\n    uploaded: boolean;\n    features: 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.hasDependencies = 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: IndexedFeature[], options: PopulateParameters, canonical: CanonicalTileID) {\n        this.features = [];\n        this.hasDependencies = 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.hasDependencies) {\n                this.features.push(addPatternDependencies('fill-extrusion', this.layers, bucketFeature, {zoom: this.zoom}, options));\n            } else {\n                this.addFeature(bucketFeature, bucketFeature.geometry, index, canonical, {}, options.subdivisionGranularity);\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, options.subdivisionGranularity);\n        }\n    }\n\n    update(states: FeatureStates, vtLayer: VectorTileLayerLike, imagePositions: {[_: string]: ImagePosition}) {\n        if (!this.stateDependentLayers.length) return;\n        this.programConfigurations.updatePaintArrays(states, vtLayer, this.stateDependentLayers, {\n            imagePositions\n        });\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: Point[][], index: number, canonical: CanonicalTileID, imagePositions: {[_: string]: ImagePosition}, subdivisionGranularity: SubdivisionGranularitySetting) {\n        for (const polygon of classifyRings(geometry, EARCUT_MAX_RINGS)) {\n            // Compute polygon centroid to calculate elevation in GPU\n            const centroid: CentroidAccumulator = {x: 0, y: 0, sampleCount: 0};\n            const oldVertexCount = this.layoutVertexArray.length;\n            this.processPolygon(centroid, canonical, feature, polygon, subdivisionGranularity);\n\n            const addedVertices = this.layoutVertexArray.length - oldVertexCount;\n\n            const centroidX = Math.floor(centroid.x / centroid.sampleCount);\n            const centroidY = Math.floor(centroid.y / centroid.sampleCount);\n\n            for (let i = 0; i < addedVertices; i++) {\n                this.centroidVertexArray.emplaceBack(\n                    centroidX,\n                    centroidY\n                );\n            }\n        }\n\n        this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length, feature, index, {imagePositions, canonical});\n    }\n\n    private processPolygon(\n        centroid: CentroidAccumulator,\n        canonical: CanonicalTileID,\n        feature: BucketFeature,\n        polygon: Point[][],\n        subdivisionGranularity: SubdivisionGranularitySetting\n    ): void {\n        if (polygon.length < 1) {\n            return;\n        }\n\n        if (isEntirelyOutside(polygon[0])) {\n            return;\n        }\n\n        // Only consider the un-subdivided polygon outer ring for centroid calculation\n        for (const ring of polygon) {\n            if (ring.length === 0) {\n                continue;\n            }\n\n            // Here we don't mind if a hole ring is entirely outside, unlike when generating geometry later.\n            accumulatePointsToCentroid(centroid, ring);\n        }\n\n        const segmentReference = {\n            segment: this.segments.prepareSegment(4, this.layoutVertexArray, this.indexArray)\n        };\n        const granularity = subdivisionGranularity.fill.getGranularityForZoomLevel(canonical.z);\n        const isPolygon = VectorTileFeature.types[feature.type] === 'Polygon';\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            const subdividedRing = subdivideVertexLine(ring, granularity, isPolygon);\n            this._generateSideFaces(subdividedRing, segmentReference);\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 (!isPolygon)\n            return;\n\n        // Do not generate outlines, since outlines already got subdivided earlier.\n        const subdividedPolygon = subdividePolygon(polygon, canonical, granularity, false);\n        const vertexArray = this.layoutVertexArray;\n\n        fillLargeMeshArrays(\n            (x, y) => {\n                addVertex(vertexArray, x, y, 0, 0, 1, 1, 0);\n            },\n            this.segments,\n            this.layoutVertexArray,\n            this.indexArray,\n            subdividedPolygon.verticesFlattened,\n            subdividedPolygon.indicesTriangles\n        );\n    }\n\n    /**\n     * Generates side faces for the supplied geometry. Assumes `geometry` to be a line string, like the output of {@link subdivideVertexLine}.\n     * For rings, it is assumed that the first and last vertex of `geometry` are equal.\n     */\n    private _generateSideFaces(geometry: Point[], segmentReference: {segment: Segment}) {\n        let edgeDistance = 0;\n\n        for (let p = 1; p < geometry.length; p++) {\n            const p1 = geometry[p];\n            const p2 = geometry[p - 1];\n\n            if (isBoundaryEdge(p1, p2)) {\n                continue;\n            }\n\n            if (segmentReference.segment.vertexLength + 4 > SegmentVector.MAX_VERTEX_ARRAY_LENGTH) {\n                segmentReference.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\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\n            const bottomRight = segmentReference.segment.vertexLength;\n\n            // \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n            // \u2502 0  1 \u2502 Counter-clockwise winding order.\n            // \u2502      \u2502 Triangle 1: 0 => 2 => 1\n            // \u2502 2  3 \u2502 Triangle 2: 1 => 2 => 3\n            // \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n            this.indexArray.emplaceBack(bottomRight, bottomRight + 2, bottomRight + 1);\n            this.indexArray.emplaceBack(bottomRight + 1, bottomRight + 2, bottomRight + 3);\n\n            segmentReference.segment.vertexLength += 4;\n            segmentReference.segment.primitiveLength += 2;\n        }\n    }\n}\n\n/**\n * Accumulates geometry to centroid. Geometry can be either a polygon ring, a line string or a closed line string.\n * In case of a polygon ring or line ring, the last vertex is ignored if it is the same as the first vertex.\n */\nfunction accumulatePointsToCentroid(centroid: CentroidAccumulator, geometry: Point[]): void {\n    for (let i = 0; i < geometry.length; i++) {\n        const p = geometry[i];\n\n        if (i === geometry.length - 1 && geometry[0].x === p.x && geometry[0].y === p.y) {\n            continue;\n        }\n\n        centroid.x += p.x;\n        centroid.y += p.y;\n        centroid.sampleCount++;\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, NumberArray, ColorArray, 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 {type QueryIntersectsFeatureParams, 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, {type FillExtrusionPaintPropsPossiblyEvaluated} from './fill_extrusion_style_layer_properties.g';\nimport {type Transitionable, type Transitioning, type PossiblyEvaluated} from '../properties';\nimport {type mat4, vec4} from 'gl-matrix';\nimport Point from '@mapbox/point-geometry';\nimport type {LayerSpecification} from '@maplibre/maplibre-gl-style-spec';\nimport type {BucketParameters} from '../../data/bucket';\nimport type {FillExtrusionPaintProps} from './fill_extrusion_style_layer_properties.g';\n\nexport class Point3D extends Point {\n    z: number;\n}\n\nexport const isFillExtrusionStyleLayer = (layer: StyleLayer): layer is FillExtrusionStyleLayer => layer.type === 'fill-extrusion';\n\nexport class FillExtrusionStyleLayer extends StyleLayer {\n    _transitionablePaint: Transitionable<FillExtrusionPaintProps>;\n    _transitioningPaint: Transitioning<FillExtrusionPaintProps>;\n    paint: PossiblyEvaluated<FillExtrusionPaintProps, FillExtrusionPaintPropsPossiblyEvaluated>;\n\n    constructor(layer: LayerSpecification, globalState: Record<string, any>) {\n        super(layer, properties, globalState);\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,\n        feature,\n        featureState,\n        geometry,\n        transform,\n        pixelsToTileUnits,\n        pixelPosMatrix}: QueryIntersectsFeatureParams\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.bearingInRadians, 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, 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: Point3D[], projectedFace: 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: Point3D[][], projectedTop: Point3D[][], projectedQueryGeometry: 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: Point[][], zBase: number, zTop: number, m: mat4): [Point3D[][], Point3D[][]] {\n    const projectedBase = [] as Point3D[][];\n    const projectedTop = [] as 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 Point3D[];\n        const ringTop = [] as 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: Point[], pixelPosMatrix: mat4, 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", "\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 KDBush from 'kdbush';\n\n/**\n * calculate simplification data using optimized Douglas-Peucker algorithm\n * @param coords - flat array of coordinates\n * @param first - index of the first coordinate in the segment\n * @param last - index of the last coordinate in the segment\n * @param sqTolerance - square tolerance value\n */\nfunction 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    const ax = coords[first];\n    const ay = coords[first + 1];\n    const bx = coords[last];\n    const by = coords[last + 1];\n    for (let i = first + 3; i < last; i += 3) {\n        const d = getSqSegDist(coords[i], coords[i + 1], ax, ay, bx, by);\n        if (d > maxSqDist) {\n            index = i;\n            maxSqDist = d;\n            continue;\n        }\n        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    if (maxSqDist > sqTolerance) {\n        if (index - first > 3)\n            simplify(coords, first, index, sqTolerance);\n        coords[index + 2] = maxSqDist;\n        if (last - index > 3)\n            simplify(coords, index, last, sqTolerance);\n    }\n}\n/**\n * Claculates the square distance from a point to a segment\n * @param px - x coordinate of the point\n * @param py - y coordinate of the point\n * @param x - x coordinate of the first segment endpoint\n * @param y - y coordinate of the first segment endpoint\n * @param bx - x coordinate of the second segment endpoint\n * @param by - y coordinate of the second segment endpoint\n * @returns square distance from a point to a segment\n */\nfunction getSqSegDist(px, py, x, y, bx, by) {\n    let dx = bx - x;\n    let dy = by - y;\n    if (dx !== 0 || dy !== 0) {\n        const t = ((px - x) * dx + (py - y) * dy) / (dx * dx + dy * dy);\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    dx = px - x;\n    dy = py - y;\n    return dx * dx + dy * dy;\n}\n\n/**\n *\n * @param id - the feature's ID\n * @param type - the feature's type\n * @param geom - the feature's geometry\n * @param tags - the feature's properties\n * @returns the created feature\n */\nfunction createFeature(id, type, geom, tags) {\n    // This is mostly for TypeScript type narrowing\n    const data = { type, geom };\n    const feature = {\n        id: id == null ? null : id,\n        type: data.type,\n        geometry: data.geom,\n        tags,\n        minX: Infinity,\n        minY: Infinity,\n        maxX: -Infinity,\n        maxY: -Infinity\n    };\n    switch (data.type) {\n        case 'Point':\n        case 'MultiPoint':\n            calcLineBBox(feature, data.geom);\n            break;\n        case 'LineString':\n            calcLineBBox(feature, data.geom.points);\n            break;\n        case 'Polygon':\n            // the outer ring (ie [0]) contains all inner rings\n            calcLineBBox(feature, data.geom[0].points);\n            break;\n        case 'MultiLineString':\n            for (const line of data.geom) {\n                calcLineBBox(feature, line.points);\n            }\n            break;\n        case 'MultiPolygon':\n            for (const polygon of data.geom) {\n                // the outer ring (ie [0]) contains all inner rings\n                calcLineBBox(feature, polygon[0].points);\n            }\n            break;\n    }\n    return feature;\n}\nfunction optimizeLineMemory(line) {\n    const lineImmutable = line;\n    if (line.points.length > 64) {\n        lineImmutable.points = new Float64Array(line.points);\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\n/**\n * converts GeoJSON to internal source features (an intermediate projected JSON vector format with simplification data)\n * @param data\n * @param options\n * @returns\n */\nfunction convertToInternal(data, options) {\n    const features = [];\n    switch (data.type) {\n        case 'FeatureCollection':\n            for (let i = 0; i < data.features.length; i++) {\n                featureToInternal(features, data.features[i], options, i);\n            }\n            break;\n        case 'Feature':\n            featureToInternal(features, data, options);\n            break;\n        default:\n            featureToInternal(features, { geometry: data, properties: undefined }, options);\n    }\n    return features;\n}\nfunction featureToInternal(features, geojson, options, index) {\n    if (!geojson.geometry)\n        return;\n    if (geojson.geometry.type === 'GeometryCollection') {\n        convertGeometryCollection(features, geojson, geojson.geometry, options, index);\n        return;\n    }\n    const coords = geojson.geometry.coordinates;\n    if (!coords?.length)\n        return;\n    const id = getFeatureId(geojson, options, index);\n    const tolerance = Math.pow(options.tolerance / ((1 << options.maxZoom) * options.extent), 2);\n    switch (geojson.geometry.type) {\n        case 'Point':\n            convertPointFeature(features, id, geojson.geometry, geojson.properties);\n            return;\n        case 'MultiPoint':\n            convertMultiPointFeature(features, id, geojson.geometry, geojson.properties);\n            return;\n        case 'LineString':\n            convertLineStringFeature(features, id, geojson.geometry, tolerance, geojson.properties);\n            return;\n        case 'MultiLineString':\n            convertMultiLineStringFeature(features, id, geojson.geometry, tolerance, options, geojson.properties);\n            return;\n        case 'Polygon':\n            convertPolygonFeature(features, id, geojson.geometry, tolerance, geojson.properties);\n            return;\n        case 'MultiPolygon':\n            convertMultiPolygonFeature(features, id, geojson.geometry, tolerance, geojson.properties);\n            return;\n        default:\n            throw new Error('Input data is not a valid GeoJSON object.');\n    }\n}\nfunction getFeatureId(geojson, options, index) {\n    if (options.promoteId) {\n        return geojson.properties?.[options.promoteId];\n    }\n    if (options.generateId) {\n        return index || 0;\n    }\n    return geojson.id;\n}\nfunction convertGeometryCollection(features, geojson, geometry, options, index) {\n    for (const geom of geometry.geometries) {\n        featureToInternal(features, {\n            id: geojson.id,\n            geometry: geom,\n            properties: geojson.properties\n        }, options, index);\n    }\n}\nfunction convertPointFeature(features, id, geom, properties) {\n    const out = [];\n    out.push(projectX(geom.coordinates[0]), projectY(geom.coordinates[1]), 0);\n    features.push(createFeature(id, 'Point', out, properties));\n}\nfunction convertMultiPointFeature(features, id, geom, properties) {\n    const out = [];\n    for (const coords of geom.coordinates) {\n        out.push(projectX(coords[0]), projectY(coords[1]), 0);\n    }\n    features.push(createFeature(id, 'MultiPoint', out, properties));\n}\nfunction convertLineStringFeature(features, id, geom, tolerance, properties) {\n    const out = { points: [] };\n    convertLine(geom.coordinates, out, tolerance, false);\n    features.push(createFeature(id, 'LineString', out, properties));\n}\nfunction convertMultiLineStringFeature(features, id, geom, tolerance, options, properties) {\n    if (options.lineMetrics) {\n        // explode into linestrings to be able to track metrics\n        for (const line of geom.coordinates) {\n            const out = { points: [] };\n            convertLine(line, out, tolerance, false);\n            features.push(createFeature(id, 'LineString', out, properties));\n        }\n    }\n    else {\n        const out = [];\n        convertLines(geom.coordinates, out, tolerance, false);\n        features.push(createFeature(id, 'MultiLineString', out, properties));\n    }\n}\nfunction convertPolygonFeature(features, id, geom, tolerance, properties) {\n    const out = [];\n    convertLines(geom.coordinates, out, tolerance, true);\n    features.push(createFeature(id, 'Polygon', out, properties));\n}\nfunction convertMultiPolygonFeature(features, id, geom, tolerance, properties) {\n    const out = [];\n    for (const polygon of geom.coordinates) {\n        const polygonOut = [];\n        convertLines(polygon, polygonOut, tolerance, true);\n        out.push(polygonOut);\n    }\n    features.push(createFeature(id, 'MultiPolygon', out, properties));\n}\nfunction convertLine(ring, out, tolerance, isPolygon) {\n    let x0, y0;\n    let size = 0;\n    for (let j = 0; j < ring.length; j++) {\n        const x = projectX(ring[j][0]);\n        const y = projectY(ring[j][1]);\n        out.points.push(x, y, 0);\n        if (j > 0) {\n            if (isPolygon) {\n                size += (x0 * y - x * y0) / 2; // area\n            }\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    const last = out.points.length - 3;\n    out.points[2] = 1;\n    if (tolerance > 0)\n        simplify(out.points, 0, last, tolerance);\n    out.points[last + 2] = 1;\n    optimizeLineMemory(out);\n    out.size = Math.abs(size);\n    out.start = 0;\n    out.end = out.size;\n}\nfunction convertLines(rings, out, tolerance, isPolygon) {\n    for (let i = 0; i < rings.length; i++) {\n        const geom = { points: [] };\n        convertLine(rings[i], geom, tolerance, isPolygon);\n        out.push(geom);\n    }\n}\n/**\n * Convert longitude to spherical mercator in [0..1] range\n */\nfunction projectX(x) {\n    return x / 360 + 0.5;\n}\n/**\n * Convert latitude to spherical mercator in [0..1] range\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\n/**\n * Converts internal source features back to GeoJSON format.\n */\nfunction convertToGeoJSON(source) {\n    const geojson = {\n        type: 'FeatureCollection',\n        features: source.map(feature => featureToGeoJSON(feature))\n    };\n    return geojson;\n}\n/**\n * Converts a single internal feature to GeoJSON format.\n */\nfunction featureToGeoJSON(feature) {\n    const geojsonFeature = {\n        type: 'Feature',\n        geometry: geometryToGeoJSON(feature),\n        properties: feature.tags\n    };\n    if (feature.id != null) {\n        geojsonFeature.id = feature.id;\n    }\n    return geojsonFeature;\n}\n/**\n * Converts a single internal feature geometry to GeoJSON format.\n */\nfunction geometryToGeoJSON(feature) {\n    const { type, geometry } = feature;\n    switch (type) {\n        case 'Point':\n            return {\n                type: type,\n                coordinates: unprojectPoint(geometry[0], geometry[1])\n            };\n        case 'MultiPoint':\n            return {\n                type: type,\n                coordinates: unprojectPoints(geometry)\n            };\n        case 'LineString':\n            return {\n                type: type,\n                coordinates: unprojectPoints(geometry.points)\n            };\n        case 'MultiLineString':\n        case 'Polygon':\n            return {\n                type: type,\n                coordinates: geometry.map(ring => unprojectPoints(ring.points))\n            };\n        case 'MultiPolygon':\n            return {\n                type: type,\n                coordinates: geometry.map(polygon => polygon.map(ring => unprojectPoints(ring.points)))\n            };\n    }\n}\nfunction unprojectPoints(coords) {\n    const result = [];\n    for (let i = 0; i < coords.length; i += 3) {\n        result.push(unprojectPoint(coords[i], coords[i + 1]));\n    }\n    return result;\n}\nfunction unprojectPoint(x, y) {\n    return [unprojectX(x), unprojectY(y)];\n}\n/**\n * Convert spherical mercator in [0..1] range to longitude\n */\nfunction unprojectX(x) {\n    return (x - 0.5) * 360;\n}\n/**\n * Convert spherical mercator in [0..1] range to latitude\n */\nfunction unprojectY(y) {\n    const y2 = (180 - y * 360) * Math.PI / 180;\n    return 360 * Math.atan(Math.exp(y2)) / Math.PI - 90;\n}\n\nvar AxisType;\n(function (AxisType) {\n    AxisType[AxisType[\"X\"] = 0] = \"X\";\n    AxisType[AxisType[\"Y\"] = 1] = \"Y\";\n})(AxisType || (AxisType = {}));\n/**\n * clip features between two vertical or horizontal axis-parallel lines:\n *     |        |\n *  ___|___     |     /\n * /   |   \\____|____/\n *     |        |\n *\n * @param features - the features to clip\n * @param scale - the scale to divide start and end inputs\n * @param start - the start of the clip range\n * @param end - the end of the clip range\n * @param axis - which axis to clip against\n * @param minAll - the minimum for all features in the relevant axis\n * @param maxAll - the maximum for all features in the relevant axis\n */\nfunction clip(features, scale, start, end, axis, minAll, maxAll, options) {\n    start /= scale;\n    end /= scale;\n    if (minAll >= start && maxAll < end) { // trivial accept\n        return features;\n    }\n    if (maxAll < start || minAll >= end) { // trivial reject\n        return null;\n    }\n    const clipped = [];\n    for (const feature of features) {\n        const min = axis === AxisType.X ? feature.minX : feature.minY;\n        const max = axis === AxisType.X ? feature.maxX : feature.maxY;\n        if (min >= start && max < end) { // trivial accept\n            clipped.push(feature);\n            continue;\n        }\n        if (max < start || min >= end) { // trivial reject\n            continue;\n        }\n        switch (feature.type) {\n            case 'Point':\n            case 'MultiPoint': {\n                clipPointFeature(feature, clipped, start, end, axis);\n                continue;\n            }\n            case 'LineString': {\n                clipLineStringFeature(feature, clipped, start, end, axis, options);\n                continue;\n            }\n            case 'MultiLineString': {\n                clipMultiLineStringFeature(feature, clipped, start, end, axis);\n                continue;\n            }\n            case 'Polygon': {\n                clipPolygonFeature(feature, clipped, start, end, axis);\n                continue;\n            }\n            case 'MultiPolygon': {\n                clipMultiPolygonFeature(feature, clipped, start, end, axis);\n                continue;\n            }\n        }\n    }\n    if (!clipped.length)\n        return null;\n    return clipped;\n}\nfunction clipPointFeature(feature, clipped, start, end, axis) {\n    const geom = [];\n    clipPoints(feature.geometry, geom, start, end, axis);\n    if (!geom.length)\n        return;\n    const type = geom.length === 3 ? 'Point' : 'MultiPoint';\n    clipped.push(createFeature(feature.id, type, geom, feature.tags));\n}\nfunction clipLineStringFeature(feature, clipped, start, end, axis, options) {\n    const geom = [];\n    clipLine(feature.geometry, geom, start, end, axis, false, options.lineMetrics);\n    if (!geom.length)\n        return;\n    if (options.lineMetrics) {\n        for (const line of geom) {\n            clipped.push(createFeature(feature.id, 'LineString', line, feature.tags));\n        }\n        return;\n    }\n    if (geom.length > 1) {\n        clipped.push(createFeature(feature.id, 'MultiLineString', geom, feature.tags));\n        return;\n    }\n    clipped.push(createFeature(feature.id, 'LineString', geom[0], feature.tags));\n}\nfunction clipMultiLineStringFeature(feature, clipped, start, end, axis) {\n    const geom = [];\n    clipLines(feature.geometry, geom, start, end, axis, false);\n    if (!geom.length)\n        return;\n    if (geom.length === 1) {\n        clipped.push(createFeature(feature.id, 'LineString', geom[0], feature.tags));\n        return;\n    }\n    clipped.push(createFeature(feature.id, 'MultiLineString', geom, feature.tags));\n}\nfunction clipPolygonFeature(feature, clipped, start, end, axis) {\n    const geom = [];\n    clipLines(feature.geometry, geom, start, end, axis, true);\n    if (!geom.length)\n        return;\n    clipped.push(createFeature(feature.id, 'Polygon', geom, feature.tags));\n}\nfunction clipMultiPolygonFeature(feature, clipped, start, end, axis) {\n    const geom = [];\n    for (const polygon of feature.geometry) {\n        const newPolygon = [];\n        clipLines(polygon, newPolygon, start, end, axis, true);\n        if (!newPolygon.length)\n            continue;\n        geom.push(newPolygon);\n    }\n    if (!geom.length)\n        return;\n    clipped.push(createFeature(feature.id, 'MultiPolygon', geom, feature.tags));\n}\nfunction clipPoints(geom, newGeom, start, end, axis) {\n    for (let i = 0; i < geom.length; i += 3) {\n        const a = geom[i + axis];\n        if (a >= start && a <= end) {\n            addPoint(newGeom, geom[i], geom[i + 1], geom[i + 2]);\n        }\n    }\n}\nfunction clipLine(geom, newGeom, start, end, axis, isPolygon, trackMetrics) {\n    let slice = newSlice(geom);\n    const intersect = axis === AxisType.X ? intersectX : intersectY;\n    let len = geom.start;\n    let segLen, t;\n    for (let i = 0; i < geom.points.length - 3; i += 3) {\n        const ax = geom.points[i];\n        const ay = geom.points[i + 1];\n        const az = geom.points[i + 2];\n        const bx = geom.points[i + 3];\n        const by = geom.points[i + 4];\n        const a = axis === AxisType.X ? ax : ay;\n        const b = axis === AxisType.X ? bx : by;\n        let exited = false;\n        if (trackMetrics)\n            segLen = Math.sqrt(Math.pow(ax - bx, 2) + Math.pow(ay - by, 2));\n        if (a < start) {\n            // ---|-->  | (line enters the clip region from the left)\n            if (b > start) {\n                t = intersect(slice, ax, ay, bx, by, start);\n                if (trackMetrics)\n                    slice.start = len + segLen * t;\n            }\n        }\n        else if (a > end) {\n            // |  <--|--- (line enters the clip region from the right)\n            if (b < end) {\n                t = intersect(slice, ax, ay, bx, by, end);\n                if (trackMetrics)\n                    slice.start = len + segLen * t;\n            }\n        }\n        else {\n            addPoint(slice.points, ax, ay, az);\n        }\n        if (b < start && a >= start) {\n            // <--|---  | or <--|-----|--- (line exits the clip region on the left)\n            t = intersect(slice, ax, ay, bx, by, start);\n            exited = true;\n        }\n        if (b > end && a <= end) {\n            // |  ---|--> or ---|-----|--> (line exits the clip region on the right)\n            t = intersect(slice, ax, ay, bx, by, end);\n            exited = true;\n        }\n        if (!isPolygon && exited) {\n            if (trackMetrics)\n                slice.end = len + segLen * t;\n            newGeom.push(slice);\n            slice = newSlice(geom);\n        }\n        if (trackMetrics)\n            len += segLen;\n    }\n    // add the last point\n    let last = geom.points.length - 3;\n    const ax = geom.points[last];\n    const ay = geom.points[last + 1];\n    const az = geom.points[last + 2];\n    const a = axis === AxisType.X ? ax : ay;\n    if (a >= start && a <= end)\n        addPoint(slice.points, ax, ay, az);\n    // close the polygon if its endpoints are not the same after clipping\n    last = slice.points.length - 3;\n    if (isPolygon && last >= 3 && (slice.points[last] !== slice.points[0] || slice.points[last + 1] !== slice.points[1])) {\n        addPoint(slice.points, slice.points[0], slice.points[1], slice.points[2]);\n    }\n    // add the final slice\n    if (slice.points.length) {\n        optimizeLineMemory(slice);\n        newGeom.push(slice);\n    }\n}\nfunction newSlice(line) {\n    return {\n        points: [],\n        size: line.size,\n        start: line.start,\n        end: line.end\n    };\n}\nfunction clipLines(geom, newGeom, start, end, axis, isPolygon) {\n    for (const line of geom) {\n        clipLine(line, newGeom, start, end, axis, isPolygon, false);\n    }\n}\nfunction addPoint(out, x, y, z) {\n    out.push(x, y, z);\n}\nfunction intersectX(out, ax, ay, bx, by, x) {\n    const t = (x - ax) / (bx - ax);\n    addPoint(out.points, x, ay + (by - ay) * t, 1);\n    return t;\n}\nfunction intersectY(out, ax, ay, bx, by, y) {\n    const t = (y - ay) / (by - ay);\n    addPoint(out.points, ax + (bx - ax) * t, y, 1);\n    return t;\n}\n\nfunction wrap(features, options) {\n    const buffer = options.buffer / options.extent;\n    let merged = features;\n    const left = clip(features, 1, -1 - buffer, buffer, AxisType.X, -1, 2, options); // left world copy\n    const right = clip(features, 1, 1 - buffer, 2 + buffer, AxisType.X, -1, 2, options); // right world copy\n    if (!left && !right)\n        return merged;\n    merged = clip(features, 1, -buffer, 1 + buffer, AxisType.X, -1, 2, options) || []; // center world copy\n    if (left)\n        merged = shiftFeatureCoords(left, 1).concat(merged); // merge left into center\n    if (right)\n        merged = merged.concat(shiftFeatureCoords(right, -1)); // merge right into center\n    return merged;\n}\nfunction shiftFeatureCoords(features, offset) {\n    const newFeatures = [];\n    for (const feature of features) {\n        switch (feature.type) {\n            case 'Point':\n            case 'MultiPoint': {\n                const newGeometry = shiftPointCoords(feature.geometry, offset);\n                newFeatures.push(createFeature(feature.id, feature.type, newGeometry, feature.tags));\n                continue;\n            }\n            case 'LineString': {\n                const newGeometry = shiftLineCoords(feature.geometry, offset);\n                newFeatures.push(createFeature(feature.id, feature.type, newGeometry, feature.tags));\n                continue;\n            }\n            case 'MultiLineString':\n            case 'Polygon': {\n                const newGeometry = [];\n                for (const line of feature.geometry) {\n                    newGeometry.push(shiftLineCoords(line, offset));\n                }\n                newFeatures.push(createFeature(feature.id, feature.type, newGeometry, feature.tags));\n                continue;\n            }\n            case 'MultiPolygon': {\n                const newGeometry = [];\n                for (const polygon of feature.geometry) {\n                    const newPolygon = [];\n                    for (const line of polygon) {\n                        newPolygon.push(shiftLineCoords(line, offset));\n                    }\n                    newGeometry.push(newPolygon);\n                }\n                newFeatures.push(createFeature(feature.id, feature.type, newGeometry, feature.tags));\n                continue;\n            }\n        }\n    }\n    return newFeatures;\n}\nfunction shiftPointCoords(coords, offset) {\n    const newCoords = [];\n    for (let i = 0; i < coords.length; i += 3) {\n        newCoords.push(coords[i] + offset, coords[i + 1], coords[i + 2]);\n    }\n    return newCoords;\n}\nfunction shiftLineCoords(line, offset) {\n    const newLine = {\n        points: [],\n        size: line.size\n    };\n    if (line.start !== undefined) {\n        newLine.start = line.start;\n        newLine.end = line.end;\n    }\n    for (let i = 0; i < line.points.length; i += 3) {\n        newLine.points.push(line.points[i] + offset, line.points[i + 1], line.points[i + 2]);\n    }\n    optimizeLineMemory(newLine);\n    return newLine;\n}\n\n/**\n * Applies a GeoJSON Source Diff to an existing set of simplified features\n * @param source\n * @param dataDiff\n * @param options\n * @returns\n */\nfunction applySourceDiff(source, dataDiff, options) {\n    // convert diff to sets/maps for o(1) lookups\n    const diff = diffToHashed(dataDiff, options);\n    // collection for features that will be affected by this update and used to invalidate tiles\n    let affected = [];\n    if (diff.removeAll) {\n        affected = source;\n        source = [];\n    }\n    if (diff.remove.size || diff.add.size) {\n        const removeFeatures = [];\n        // Collect features to remove (explicit removals + replacements via add)\n        for (const feature of source) {\n            if (diff.remove.has(feature.id) || diff.add.has(feature.id)) {\n                removeFeatures.push(feature);\n            }\n        }\n        if (removeFeatures.length) {\n            affected.push(...removeFeatures);\n            const removeIds = new Set(removeFeatures.map(f => f.id));\n            source = source.filter(f => !removeIds.has(f.id));\n        }\n        if (diff.add.size) {\n            let addFeatures = convertToInternal({ type: 'FeatureCollection', features: Array.from(diff.add.values()) }, options);\n            addFeatures = wrap(addFeatures, options);\n            affected.push(...addFeatures);\n            source.push(...addFeatures);\n        }\n    }\n    if (diff.update.size) {\n        // Features can be duplicated across the antimeridian (wrap) in a single tile, so must update all instances with the same id\n        const oldFeaturesMap = new Map();\n        const keepFeatures = [];\n        for (const feature of source) {\n            if (diff.update.has(feature.id)) {\n                oldFeaturesMap.set(feature.id, [...(oldFeaturesMap.get(feature.id) || []), feature]);\n            }\n            else {\n                keepFeatures.push(feature);\n            }\n        }\n        for (const [id, update] of diff.update) {\n            const oldFeatures = oldFeaturesMap.get(id);\n            if (!oldFeatures || oldFeatures.length === 0)\n                continue;\n            const updatedFeatures = getUpdatedFeatures(oldFeatures, update, options);\n            affected.push(...oldFeatures, ...updatedFeatures);\n            keepFeatures.push(...updatedFeatures);\n        }\n        source = keepFeatures;\n    }\n    return { affected, source };\n}\n/**\n * Gets updated simplified feature(s) based on a diff update object.\n * @param vtFeatures - the original features\n * @param update - the update object to apply\n * @param options - the options to use for the wrap method\n * @returns Updated features. If geometry is updated, returns new feature(s) converted from geojson and wrapped. If only properties are updated, returns feature(s) with tags updated.\n */\nfunction getUpdatedFeatures(vtFeatures, update, options) {\n    const changeGeometry = !!update.newGeometry;\n    const changeProps = update.removeAllProperties ||\n        update.removeProperties?.length > 0 ||\n        update.addOrUpdateProperties?.length > 0;\n    // if geometry changed, need to create a new geojson feature and convert to internal format\n    if (changeGeometry) {\n        const vtFeature = vtFeatures[0];\n        const geojsonFeature = {\n            type: 'Feature',\n            id: vtFeature.id,\n            geometry: update.newGeometry,\n            properties: changeProps ? applyPropertyUpdates(vtFeature.tags, update) : vtFeature.tags\n        };\n        let features = convertToInternal({ type: 'FeatureCollection', features: [geojsonFeature] }, options);\n        features = wrap(features, options);\n        return features;\n    }\n    if (changeProps) {\n        const updated = [];\n        for (const vtFeature of vtFeatures) {\n            const feature = { ...vtFeature };\n            feature.tags = applyPropertyUpdates(feature.tags, update);\n            updated.push(feature);\n        }\n        return updated;\n    }\n    return vtFeatures;\n}\n/**\n * helper to apply property updates from a diff update object to a properties object\n */\nfunction applyPropertyUpdates(tags, update) {\n    if (update.removeAllProperties) {\n        return {};\n    }\n    const properties = { ...tags || {} };\n    if (update.removeProperties) {\n        for (const key of update.removeProperties) {\n            delete properties[key];\n        }\n    }\n    if (update.addOrUpdateProperties) {\n        for (const { key, value } of update.addOrUpdateProperties) {\n            properties[key] = value;\n        }\n    }\n    return properties;\n}\n/**\n * Convert a GeoJSON Source Diff to an idempotent hashed representation using Sets and Maps\n */\nfunction diffToHashed(diff, options) {\n    if (!diff)\n        return {\n            remove: new Set(),\n            add: new Map(),\n            update: new Map()\n        };\n    const hashed = {\n        removeAll: diff.removeAll,\n        remove: new Set(diff.remove || []),\n        add: new Map(diff.add?.map(feature => [options.promoteId ? feature.properties[options.promoteId] : feature.id, feature])),\n        update: new Map(diff.update?.map(update => [update.id, update]))\n    };\n    return hashed;\n}\n\nconst defaultClusterOptions = {\n    minZoom: 0,\n    maxZoom: 16,\n    minPoints: 2,\n    radius: 40,\n    extent: 512,\n    nodeSize: 64,\n    log: false,\n    generateId: false,\n    reduce: null,\n    map: (props) => props\n};\nconst OFFSET_ZOOM = 2;\nconst OFFSET_ID = 3;\nconst OFFSET_PARENT = 4;\nconst OFFSET_NUM = 5;\nconst OFFSET_PROP = 6;\n/**\n * This class allow clustering of geojson points.\n */\nclass ClusterTileIndex {\n    constructor(options) {\n        this.options = Object.assign(Object.create(defaultClusterOptions), options);\n        this.trees = new Array(this.options.maxZoom + 1);\n        this.stride = this.options.reduce ? 7 : 6;\n        this.clusterProps = [];\n        this.points = [];\n    }\n    /**\n     * Loads GeoJSON point features and builds the internal clustering index.\n     * @param points - GeoJSON point features to cluster.\n     */\n    load(points) {\n        const features = [];\n        // Convert GeoJSON point features to GeoJSONVT internal point features\n        for (const point of points) {\n            if (!point.geometry) {\n                continue;\n            }\n            const [lng, lat] = point.geometry.coordinates;\n            const [x, y] = [projectX(lng), projectY(lat)];\n            const feature = {\n                id: point.id,\n                type: 'Point',\n                geometry: [x, y],\n                tags: point.properties\n            };\n            features.push(feature);\n        }\n        this.createIndex(features);\n    }\n    /**\n     * @internal\n     * Loads internal GeoJSONVT point features from a data source and builds the clustering index.\n     * @param features - {@link GeoJSONVTInternalFeature} data source features to filter and cluster.\n     */\n    initialize(features) {\n        const points = [];\n        for (const feature of features) {\n            if (feature.type !== 'Point')\n                continue;\n            points.push(feature);\n        }\n        this.createIndex(points);\n    }\n    /**\n     * @internal\n     * Updates the cluster data by rebuilding.\n     * @param features\n     */\n    updateIndex(features, _affected, options) {\n        this.options = Object.assign(Object.create(defaultClusterOptions), options.clusterOptions);\n        this.initialize(features);\n    }\n    createIndex(points) {\n        const { log, minZoom, maxZoom } = this.options;\n        if (log)\n            console.time('total time');\n        const timerId = `prepare ${points.length} points`;\n        if (log)\n            console.time(timerId);\n        this.points = points;\n        // generate a cluster object for each point and index input points into a KD-tree\n        const data = [];\n        for (let i = 0; i < points.length; i++) {\n            const p = points[i];\n            if (!p?.geometry)\n                continue;\n            let [x, y] = p.geometry;\n            x = Math.fround(x);\n            y = Math.fround(y);\n            // store internal point/cluster data in flat numeric arrays for performance\n            data.push(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)\n                data.push(0); // noop\n        }\n        let tree = this.trees[maxZoom + 1] = this.createTree(data);\n        if (log)\n            console.timeEnd(timerId);\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            // 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            if (log)\n                console.log('z%d: %d clusters in %dms', z, tree.numItems, Date.now() - now);\n        }\n        if (log)\n            console.timeEnd('total time');\n    }\n    /**\n     * Returns clusters and/or points within a bounding box at a given zoom level.\n     * @param bbox - Bounding box in `[westLng, southLat, eastLng, northLat]` order.\n     * @param zoom - Zoom level to query.\n     */\n    getClusters(bbox, zoom) {\n        const clusterInternal = this.getClustersInternal(bbox, zoom);\n        return clusterInternal.map((f) => featureToGeoJSON(f));\n    }\n    getClustersInternal(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        if (bbox[2] - bbox[0] >= 360) {\n            minLng = -180;\n            maxLng = 180;\n        }\n        else if (minLng > maxLng) {\n            const easternHem = this.getClustersInternal([minLng, minLat, 180, maxLat], zoom);\n            const westernHem = this.getClustersInternal([-180, minLat, maxLng, maxLat], zoom);\n            return easternHem.concat(westernHem);\n        }\n        const tree = this.trees[this.limitZoom(zoom)];\n        const ids = tree.range(projectX(minLng), projectY(maxLat), projectX(maxLng), projectY(minLat));\n        const data = tree.flatData;\n        const clusters = [];\n        for (const id of ids) {\n            const k = this.stride * id;\n            clusters.push(data[k + OFFSET_NUM] > 1 ? getClusterFeature(data, k, this.clusterProps) : this.points[data[k + OFFSET_ID]]);\n        }\n        return clusters;\n    }\n    /**\n     * Returns the immediate children (clusters or points) of a cluster as GeoJSON.\n     * @param clusterId - The target cluster id.\n     */\n    getChildren(clusterId) {\n        const originId = this.getOriginId(clusterId);\n        const originZoom = this.getOriginZoom(clusterId);\n        const clusterError = new Error('No cluster with the specified id: ' + clusterId);\n        const tree = this.trees[originZoom];\n        if (!tree)\n            throw clusterError;\n        const data = tree.flatData;\n        if (originId * this.stride >= data.length)\n            throw clusterError;\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 ? getClusterGeoJSON(data, k, this.clusterProps) : featureToGeoJSON(this.points[data[k + OFFSET_ID]]));\n            }\n        }\n        if (children.length === 0)\n            throw clusterError;\n        return children;\n    }\n    /**\n     * Returns leaf point features under a cluster, paginated by `limit` and `offset`.\n     * @param clusterId - The target cluster id.\n     * @param limit - Maximum number of points to return (defaults to `10`).\n     * @param offset - Number of points to skip before collecting results (defaults to `0`).\n     */\n    getLeaves(clusterId, limit, offset) {\n        limit = limit || 10;\n        offset = offset || 0;\n        const leaves = [];\n        this.appendLeaves(leaves, clusterId, limit, offset, 0);\n        return leaves;\n    }\n    /**\n     * Generates a vector-tile-like representation of a single tile.\n     * @param z - Tile zoom.\n     * @param x - Tile x coordinate.\n     * @param y - Tile y coordinate.\n     */\n    getTile(z, x, y) {\n        const tree = this.trees[this.limitZoom(z)];\n        if (!tree) {\n            return null;\n        }\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        const tile = {\n            transformed: true,\n            features: [],\n            source: null,\n            x: x,\n            y: y,\n            z: z\n        };\n        this.addTileFeatures(tree.range((x - p) / z2, top, (x + 1 + p) / z2, bottom), tree.flatData, x, y, z2, tile);\n        if (x === 0) {\n            this.addTileFeatures(tree.range(1 - p / z2, top, 1, bottom), tree.flatData, z2, y, z2, tile);\n        }\n        if (x === z2 - 1) {\n            this.addTileFeatures(tree.range(0, top, p / z2, bottom), tree.flatData, -1, y, z2, tile);\n        }\n        return tile;\n    }\n    /**\n     * Returns the zoom level at which a cluster expands into multiple children.\n     * @param clusterId - The target cluster id.\n     */\n    getClusterExpansionZoom(clusterId) {\n        return this.getOriginZoom(clusterId);\n    }\n    appendLeaves(result, clusterId, limit, offset, skipped) {\n        const children = this.getChildren(clusterId);\n        for (const child of children) {\n            const props = child.properties;\n            if (props?.cluster) {\n                if (skipped + props.point_count <= offset) {\n                    // skip the whole cluster\n                    skipped += props.point_count;\n                }\n                else {\n                    // enter the cluster\n                    skipped = this.appendLeaves(result, props.cluster_id, limit, offset, skipped);\n                    // exit the cluster\n                }\n            }\n            else if (skipped < offset) {\n                // skip a single point\n                skipped++;\n            }\n            else {\n                // add a single point\n                result.push(child);\n            }\n            if (result.length === limit)\n                break;\n        }\n        return skipped;\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)\n            tree.add(data[i], data[i + 1]);\n        tree.finish();\n        tree.flatData = data;\n        tree.data = null; // clear original data to free memory as it isn't used later on.\n        return tree;\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            let tags;\n            let px;\n            let py;\n            if (isCluster) {\n                tags = getClusterProperties(data, k, this.clusterProps);\n                px = data[k];\n                py = data[k + 1];\n            }\n            else {\n                const p = this.points[data[k + OFFSET_ID]];\n                tags = p.tags;\n                [px, py] = p.geometry;\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            // assign id\n            let id;\n            if (isCluster || this.options.generateId) {\n                // optionally generate id for points\n                id = data[k + OFFSET_ID];\n            }\n            else {\n                // keep id if already assigned\n                id = this.points[data[k + OFFSET_ID]].id;\n            }\n            if (id !== undefined)\n                f.id = id;\n            tile.features.push(f);\n        }\n    }\n    limitZoom(z) {\n        return Math.max(this.options.minZoom, Math.min(Math.floor(+z), this.options.maxZoom + 1));\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.flatData;\n        const nextData = [];\n        const stride = this.stride;\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)\n                continue;\n            data[i + OFFSET_ZOOM] = zoom;\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            const numPointsOrigin = data[i + OFFSET_NUM];\n            let numPoints = numPointsOrigin;\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)\n                    numPoints += data[k + OFFSET_NUM];\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                let clusterProperties;\n                let clusterPropIndex = -1;\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                for (const neighborId of neighborIds) {\n                    const k = neighborId * stride;\n                    if (data[k + OFFSET_ZOOM] <= zoom)\n                        continue;\n                    data[k + OFFSET_ZOOM] = zoom; // save the zoom (so it doesn't get processed twice)\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                    data[k + OFFSET_PARENT] = id;\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                data[i + OFFSET_PARENT] = id;\n                nextData.push(wx / numPoints, wy / numPoints, Infinity, id, -1, numPoints);\n                if (reduce)\n                    nextData.push(clusterPropIndex);\n            }\n            else { // left points as unclustered\n                for (let j = 0; j < stride; j++)\n                    nextData.push(data[i + j]);\n                if (numPoints > 1) {\n                    for (const neighborId of neighborIds) {\n                        const k = neighborId * stride;\n                        if (data[k + OFFSET_ZOOM] <= zoom)\n                            continue;\n                        data[k + OFFSET_ZOOM] = zoom;\n                        for (let j = 0; j < stride; j++)\n                            nextData.push(data[k + j]);\n                    }\n                }\n            }\n        }\n        return nextData;\n    }\n    // get index of the point from which the cluster originated\n    getOriginId(clusterId) {\n        return (clusterId - this.points.length) >> 5;\n    }\n    // get zoom of the point from which the cluster originated\n    getOriginZoom(clusterId) {\n        return (clusterId - this.points.length) % 32;\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]].tags;\n        const result = this.options.map(original);\n        return clone && result === original ? Object.assign({}, result) : result;\n    }\n}\nfunction getClusterFeature(data, i, clusterProps) {\n    return {\n        id: data[i + OFFSET_ID],\n        type: 'Point',\n        tags: getClusterProperties(data, i, clusterProps),\n        geometry: [data[i], data[i + 1]]\n    };\n}\nfunction getClusterGeoJSON(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: [unprojectX(data[i]), unprojectY(data[i + 1])]\n        }\n    };\n}\nfunction getClusterProperties(data, i, clusterProps) {\n    const count = data[i + OFFSET_NUM];\n    const abbrev = 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\nconst GEOJSONVT_CLIP_START = 'geojsonvt_clip_start';\nconst GEOJSONVT_CLIP_END = 'geojsonvt_clip_end';\n/**\n * Creates a tile object from the given features\n * @param features - the features to include in the tile\n * @param z\n * @param tx\n * @param ty\n * @param options - the options object\n * @returns the created tile\n */\nfunction createTile(features, z, tx, ty, options) {\n    const tolerance = z === options.maxZoom ? 0 : options.tolerance / ((1 << z) * options.extent);\n    const tile = {\n        transformed: false,\n        features: [],\n        source: null,\n        x: tx,\n        y: ty,\n        z: z,\n        minX: 2,\n        minY: 1,\n        maxX: -1,\n        maxY: 0,\n        numPoints: 0,\n        numSimplified: 0,\n        numFeatures: features.length\n    };\n    for (const feature of features) {\n        addFeature(tile, feature, tolerance, options);\n    }\n    return tile;\n}\nfunction addFeature(tile, feature, tolerance, options) {\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    switch (feature.type) {\n        case 'Point':\n        case 'MultiPoint':\n            addPointsTileFeature(tile, feature);\n            return;\n        case 'LineString':\n            addLineTileFeautre(tile, feature, tolerance, options);\n            return;\n        case 'MultiLineString':\n        case 'Polygon':\n            addLinesTileFeature(tile, feature, tolerance);\n            return;\n        case 'MultiPolygon':\n            addMultiPolygonTileFeature(tile, feature, tolerance);\n            return;\n    }\n}\nfunction addPointsTileFeature(tile, feature) {\n    const geometry = [];\n    for (let i = 0; i < feature.geometry.length; i += 3) {\n        geometry.push(feature.geometry[i], feature.geometry[i + 1]);\n        tile.numPoints++;\n        tile.numSimplified++;\n    }\n    if (!geometry.length)\n        return;\n    const tileFeature = {\n        type: 1,\n        tags: feature.tags || null,\n        geometry: geometry\n    };\n    if (feature.id !== null) {\n        tileFeature.id = feature.id;\n    }\n    tile.features.push(tileFeature);\n}\nfunction addLineTileFeautre(tile, feature, tolerance, options) {\n    const geometry = [];\n    addLine(geometry, feature.geometry, tile, tolerance, false, false);\n    if (!geometry.length)\n        return;\n    let tags = feature.tags || null;\n    if (options.lineMetrics) {\n        tags = {};\n        for (const key in feature.tags)\n            tags[key] = feature.tags[key];\n        tags[GEOJSONVT_CLIP_START] = feature.geometry.start / feature.geometry.size;\n        tags[GEOJSONVT_CLIP_END] = feature.geometry.end / feature.geometry.size;\n    }\n    const tileFeature = {\n        type: 2,\n        tags: tags,\n        geometry: geometry\n    };\n    if (feature.id !== null) {\n        tileFeature.id = feature.id;\n    }\n    tile.features.push(tileFeature);\n}\nfunction addLinesTileFeature(tile, feature, tolerance) {\n    const geometry = [];\n    for (let i = 0; i < feature.geometry.length; i++) {\n        addLine(geometry, feature.geometry[i], tile, tolerance, feature.type === 'Polygon', i === 0);\n    }\n    if (!geometry.length)\n        return;\n    const tileFeature = {\n        type: feature.type === 'Polygon' ? 3 : 2,\n        tags: feature.tags || null,\n        geometry: geometry\n    };\n    if (feature.id !== null) {\n        tileFeature.id = feature.id;\n    }\n    tile.features.push(tileFeature);\n}\nfunction addMultiPolygonTileFeature(tile, feature, tolerance) {\n    const geometry = [];\n    for (let k = 0; k < feature.geometry.length; k++) {\n        const polygon = feature.geometry[k];\n        for (let i = 0; i < polygon.length; i++) {\n            addLine(geometry, polygon[i], tile, tolerance, true, i === 0);\n        }\n    }\n    if (!geometry.length)\n        return;\n    const tileFeature = {\n        type: 3,\n        tags: feature.tags || null,\n        geometry: geometry\n    };\n    if (feature.id !== null) {\n        tileFeature.id = feature.id;\n    }\n    tile.features.push(tileFeature);\n}\nfunction addLine(result, geom, tile, tolerance, isPolygon, isOuter) {\n    const sqTolerance = tolerance * tolerance;\n    if (tolerance > 0 && (geom.size < (isPolygon ? sqTolerance : tolerance))) {\n        tile.numPoints += geom.points.length / 3;\n        return;\n    }\n    const ring = [];\n    for (let i = 0; i < geom.points.length; i += 3) {\n        if (tolerance === 0 || geom.points[i + 2] > sqTolerance) {\n            tile.numSimplified++;\n            ring.push(geom.points[i], geom.points[i + 1]);\n        }\n        tile.numPoints++;\n    }\n    if (isPolygon)\n        rewind(ring, isOuter);\n    result.push(ring);\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        return;\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/**\n * Transforms the coordinates of each feature in the given tile from\n * mercator-projected space into (extent x extent) tile space.\n * @param tile - the tile to transform, this gets modified in place\n * @param extent - the tile extent (usually 4096)\n * @returns the transformed tile\n */\nfunction transformTile(tile, extent) {\n    if (tile.transformed) {\n        return tile;\n    }\n    const z2 = 1 << tile.z;\n    const tx = tile.x;\n    const ty = tile.y;\n    for (const feature of tile.features) {\n        if (feature.type === 1) {\n            transformPointFeature(feature, extent, z2, tx, ty);\n        }\n        else {\n            transformNonPointFeature(feature, extent, z2, tx, ty);\n        }\n    }\n    tile.transformed = true;\n    return tile;\n}\n/**\n * Transforms a single point feature from mercator-projected space into (extent x extent) tile space.\n */\nfunction transformPointFeature(feature, extent, z2, tx, ty) {\n    const transformed = feature;\n    const geometry = feature.geometry;\n    const point = [];\n    for (let i = 0; i < geometry.length; i += 2) {\n        point.push(transformPoint(geometry[i], geometry[i + 1], extent, z2, tx, ty));\n    }\n    transformed.geometry = point;\n    return transformed;\n}\n/**\n * Transforms a single non-point feature from mercator-projected space into (extent x extent) tile space.\n */\nfunction transformNonPointFeature(feature, extent, z2, tx, ty) {\n    const transformed = feature;\n    const geometry = feature.geometry;\n    const nonPoint = [];\n    for (const geom of geometry) {\n        const ring = [];\n        for (let i = 0; i < geom.length; i += 2) {\n            ring.push(transformPoint(geom[i], geom[i + 1], extent, z2, tx, ty));\n        }\n        nonPoint.push(ring);\n    }\n    transformed.geometry = nonPoint;\n    return transformed;\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}\n\nclass TileIndex {\n    constructor(options) {\n        this.options = options;\n        this.total = 0;\n        /** @internal */\n        this.stats = {};\n        this.tiles = {};\n        this.tileCoords = [];\n        this.stats = {};\n        this.total = 0;\n    }\n    initialize(features) {\n        // start slicing from the top tile down\n        this.splitTile(features, 0, 0, 0);\n        if (this.options.debug) {\n            if (features.length)\n                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    /** {@inheritdoc} */\n    updateIndex(source, affected, options) {\n        if (options.debug > 1) {\n            console.log('invalidating tiles');\n            console.time('invalidating');\n        }\n        this.invalidateTiles(affected);\n        if (options.debug > 1)\n            console.timeEnd('invalidating');\n        // re-generate root tile with updated feature set\n        const [z, x, y] = [0, 0, 0];\n        const rootTile = createTile(source, z, x, y, options);\n        rootTile.source = source;\n        // update tile index with new root tile - ready for getTile calls\n        const id = toID(z, x, y);\n        this.tiles[id] = rootTile;\n        this.tileCoords.push({ z, x, y, id });\n        if (options.debug) {\n            const key = `z${z}`;\n            this.stats[key] = (this.stats[key] || 0) + 1;\n            this.total++;\n        }\n    }\n    /** {@inheritdoc} */\n    // eslint-disable-next-line @typescript-eslint/no-unused-vars\n    getClusterExpansionZoom(_clusterId) {\n        return null;\n    }\n    /** {@inheritdoc} */\n    // eslint-disable-next-line @typescript-eslint/no-unused-vars\n    getChildren(_clusterId) {\n        return null;\n    }\n    /** {@inheritdoc} */\n    // eslint-disable-next-line @typescript-eslint/no-unused-vars\n    getLeaves(_clusterId, _limit, _offset) {\n        return null;\n    }\n    /** {@inheritdoc} */\n    getTile(z, x, y) {\n        const { extent, debug } = this.options;\n        const z2 = 1 << z;\n        x = (x + z2) & (z2 - 1); // wrap tile x coordinate\n        const id = toID(z, x, y);\n        if (this.tiles[id]) {\n            return transformTile(this.tiles[id], extent);\n        }\n        if (debug > 1)\n            console.log('drilling down to z%d-%d-%d', z, x, y);\n        let z0 = z;\n        let x0 = x;\n        let y0 = y;\n        let parent;\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        if (!parent?.source)\n            return null;\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)\n            console.timeEnd('drilling down');\n        if (!this.tiles[id])\n            return null;\n        return transformTile(this.tiles[id], extent);\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     * @internal\n     * @param features - features to split\n     * @param z - tile zoom level\n     * @param x - tile x coordinate\n     * @param y - tile y coordinate\n     * @param cz - target tile zoom level\n     * @param cx - target tile x coordinate\n     * @param cy - target tile y coordinate\n     */\n    splitTile(features, z, x, y, cz, cx, cy) {\n        const stack = [features, z, x, y];\n        const options = this.options;\n        const debug = options.debug;\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            const z2 = 1 << z;\n            const id = toID(z, x, y);\n            let tile = this.tiles[id];\n            if (!tile) {\n                if (debug > 1)\n                    console.time('creation');\n                tile = this.tiles[id] = createTile(features, z, x, y, options);\n                this.tileCoords.push({ z, x, y, id });\n                if (debug) {\n                    if (debug > 1) {\n                        console.log('tile z%d-%d-%d (features: %d, points: %d, simplified: %d)', 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            // save reference to original geometry in tile so that we can drill down later if we stop now\n            tile.source = features;\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)\n                    continue;\n                // if a drilldown to a specific tile\n            }\n            else if (z === options.maxZoom || z === cz) {\n                // stop tiling if we reached base zoom or our target tile zoom\n                continue;\n            }\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)\n                    continue;\n            }\n            // if we slice further down, no need to keep source geometry\n            tile.source = null;\n            if (!features.length)\n                continue;\n            if (debug > 1)\n                console.time('clipping');\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            let tl = null;\n            let bl = null;\n            let tr = null;\n            let br = null;\n            const left = clip(features, z2, x - k1, x + k3, AxisType.X, tile.minX, tile.maxX, options);\n            const right = clip(features, z2, x + k2, x + k4, AxisType.X, tile.minX, tile.maxX, options);\n            if (left) {\n                tl = clip(left, z2, y - k1, y + k3, AxisType.Y, tile.minY, tile.maxY, options);\n                bl = clip(left, z2, y + k2, y + k4, AxisType.Y, tile.minY, tile.maxY, options);\n            }\n            if (right) {\n                tr = clip(right, z2, y - k1, y + k3, AxisType.Y, tile.minY, tile.maxY, options);\n                br = clip(right, z2, y + k2, y + k4, AxisType.Y, tile.minY, tile.maxY, options);\n            }\n            if (debug > 1)\n                console.timeEnd('clipping');\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     * Invalidates (removes) tiles affected by the provided features\n     * @internal\n     * @param features\n     */\n    invalidateTiles(features) {\n        if (!features.length)\n            return;\n        const options = this.options;\n        const { debug } = options;\n        // calculate bounding box of all features for trivial reject\n        let minX = Infinity;\n        let maxX = -Infinity;\n        let minY = Infinity;\n        let maxY = -Infinity;\n        for (const feature of features) {\n            minX = Math.min(minX, feature.minX);\n            maxX = Math.max(maxX, feature.maxX);\n            minY = Math.min(minY, feature.minY);\n            maxY = Math.max(maxY, feature.maxY);\n        }\n        // tile buffer clipping value - not halved as in splitTile above because checking against tile's own extent\n        const k1 = options.buffer / options.extent;\n        // track removed tile ids for o(1) lookup\n        const removedLookup = new Set();\n        // iterate through existing tiles and remove ones that are affected by features\n        for (const id in this.tiles) {\n            const tile = this.tiles[id];\n            // calculate tile bounds including buffer\n            const z2 = 1 << tile.z;\n            const tileMinX = (tile.x - k1) / z2;\n            const tileMaxX = (tile.x + 1 + k1) / z2;\n            const tileMinY = (tile.y - k1) / z2;\n            const tileMaxY = (tile.y + 1 + k1) / z2;\n            // trivial reject if feature bounds don't intersect tile\n            if (maxX < tileMinX || minX >= tileMaxX ||\n                maxY < tileMinY || minY >= tileMaxY) {\n                continue;\n            }\n            // check if any feature intersects with the tile\n            let intersects = false;\n            for (const feature of features) {\n                if (feature.maxX >= tileMinX && feature.minX < tileMaxX &&\n                    feature.maxY >= tileMinY && feature.minY < tileMaxY) {\n                    intersects = true;\n                    break;\n                }\n            }\n            if (!intersects)\n                continue;\n            if (debug) {\n                if (debug > 1) {\n                    console.log('invalidate tile z%d-%d-%d (features: %d, points: %d, simplified: %d)', tile.z, tile.x, tile.y, tile.numFeatures, tile.numPoints, tile.numSimplified);\n                }\n                const key = `z${tile.z}`;\n                this.stats[key] = (this.stats[key] || 0) - 1;\n                this.total--;\n            }\n            delete this.tiles[id];\n            removedLookup.add(id);\n        }\n        // remove tile coords that are no longer in the index\n        if (removedLookup.size) {\n            this.tileCoords = this.tileCoords.filter(c => !removedLookup.has(c.id));\n        }\n    }\n}\nfunction toID(z, x, y) {\n    return (((1 << z) * y + x) * 32) + z;\n}\n\nconst defaultOptions = {\n    maxZoom: 14,\n    indexMaxZoom: 5,\n    indexMaxPoints: 100000,\n    tolerance: 3,\n    extent: 4096,\n    buffer: 64,\n    lineMetrics: false,\n    promoteId: null,\n    generateId: false,\n    updateable: false,\n    cluster: false,\n    clusterOptions: defaultClusterOptions,\n    debug: 0\n};\n/**\n * Main class for creating and managing a vector tile index from GeoJSON data.\n */\nclass GeoJSONVT {\n    constructor(data, options) {\n        options = this.options = Object.assign({}, defaultOptions, options);\n        const debug = options.debug;\n        if (debug)\n            console.time('preprocess data');\n        if (options.maxZoom < 0 || options.maxZoom > 24)\n            throw new Error('maxZoom should be in the 0-24 range');\n        if (options.promoteId && options.generateId)\n            throw new Error('promoteId and generateId cannot be used together.');\n        // projects and adds simplification info\n        let features = convertToInternal(data, options);\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        }\n        // wraps features (ie extreme west and extreme east)\n        features = wrap(features, options);\n        // for updateable indexes, store a copy of the original simplified features\n        if (options.updateable) {\n            this.source = features;\n        }\n        this.initializeIndex(features, options);\n    }\n    initializeIndex(features, options) {\n        this.tileIndex = options.cluster ? new ClusterTileIndex(options.clusterOptions) : new TileIndex(options);\n        if (!features.length)\n            return;\n        this.tileIndex.initialize(features);\n    }\n    /**\n     * Given z, x, and y tile coordinates, returns the corresponding tile with geometries in tile coordinates, much like MVT data is stored.\n     * @param z - tile zoom level\n     * @param x - tile x coordinate\n     * @param y - tile y coordinate\n     * @returns the transformed tile or null if not found\n     */\n    getTile(z, x, y) {\n        z = +z;\n        x = +x;\n        y = +y;\n        if (z < 0 || z > 24)\n            return null;\n        return this.tileIndex.getTile(z, x, y);\n    }\n    /**\n     * Updates the source data feature set using a {@link GeoJSONVTSourceDiff}\n     * @param diff - the source diff object\n     */\n    updateData(diff, filter) {\n        const options = this.options;\n        if (!options.updateable)\n            throw new Error('to update tile geojson `updateable` option must be set to true');\n        // apply diff and collect affected features and updated source that will be used to invalidate tiles\n        let { affected, source } = applySourceDiff(this.source, diff, options);\n        if (filter) {\n            ({ affected, source } = this.filterUpdate(source, affected, filter));\n        }\n        // nothing has changed\n        if (!affected.length)\n            return;\n        // update source with new simplified feature set\n        this.source = source;\n        this.tileIndex.updateIndex(source, affected, options);\n    }\n    /**\n     * Filter an update using a predicate function. Returns the affected and updated source features.\n     */\n    filterUpdate(source, affected, predicate) {\n        const removeIds = new Set();\n        for (const feature of source) {\n            if (feature.id == undefined)\n                continue;\n            if (predicate(featureToGeoJSON(feature)))\n                continue;\n            affected.push(feature);\n            removeIds.add(feature.id);\n        }\n        source = source.filter(feature => !removeIds.has(feature.id));\n        return { affected, source };\n    }\n    /**\n     * Returns source data as GeoJSON - only available when `updateable` option is set to true.\n     */\n    getData() {\n        if (!this.options.updateable)\n            throw new Error('to retrieve data the `updateable` option must be set to true');\n        return convertToGeoJSON(this.source);\n    }\n    /**\n     * Update supercluster options and regenerate the index.\n     * @param cluster - whether to enable clustering\n     * @param clusterOptions - {@link SuperclusterOptions}\n     */\n    updateClusterOptions(cluster, clusterOptions) {\n        const wasCluster = this.options.cluster;\n        this.options.cluster = cluster;\n        this.options.clusterOptions = clusterOptions;\n        if (wasCluster == cluster) {\n            this.tileIndex.updateIndex(this.source, [], this.options);\n            return;\n        }\n        this.initializeIndex(this.source, this.options);\n    }\n    /**\n     * Returns the zoom level at which a cluster expands into multiple children.\n     * @param clusterId - The target cluster id.\n     * @returns the expansion zoom or null in case of non-clustered source\n     */\n    getClusterExpansionZoom(clusterId) {\n        return this.tileIndex.getClusterExpansionZoom(clusterId);\n    }\n    /**\n     * Returns the immediate children (clusters or points) of a cluster as GeoJSON.\n     * @param clusterId - The target cluster id.\n     * @returns the immediate children or null in case of non-clustered source\n     */\n    getClusterChildren(clusterId) {\n        return this.tileIndex.getChildren(clusterId);\n    }\n    /**\n     * Returns leaf point features under a cluster, paginated by `limit` and `offset`.\n     * @param clusterId - The target cluster id.\n     * @param limit - Maximum number of points to return (defaults to `10`).\n     * @param offset - Number of points to skip before collecting results (defaults to `0`).\n     * @returns leaf point features under a cluster or null in case of non-clustered source\n     */\n    getClusterLeaves(clusterId, limit, offset) {\n        return this.tileIndex.getLeaves(clusterId, limit, offset);\n    }\n}\n\n/**\n * Converts GeoJSON data directly to a single vector tile without building a tile index.\n *\n * Unlike the {@link GeoJSONVT} class which builds a hierarchical tile index for efficient\n * repeated tile access, this function generates a single tile on-demand. This is useful when:\n * - You only need one specific tile and don't need to query multiple tiles\n * - The source data is already spatially filtered to the tile's bounding box\n * - You want to avoid the overhead of building a full tile index\n *\n * @example\n * ```ts\n * import {geoJSONToTile} from '@maplibre/geojson-vt';\n *\n * const geojson = {\n *   type: 'FeatureCollection',\n *   features: [{\n *     type: 'Feature',\n *     geometry: { type: 'Point', coordinates: [-77.03, 38.90] },\n *     properties: { name: 'Washington, D.C.' }\n *   }]\n * };\n *\n * const tile = geoJSONToTile(geojson, 10, 292, 391, { extent: 4096 });\n * ```\n *\n * @param data - GeoJSON data (Feature, FeatureCollection, or Geometry)\n * @param z - Tile zoom level\n * @param x - Tile x coordinate\n * @param y - Tile y coordinate\n * @param options - Optional configuration for tile generation\n * @returns The generated tile with geometries in tile coordinates, or null if no features\n */\nfunction geoJSONToTile(data, z, x, y, options = {}) {\n    options = { ...defaultOptions, ...options };\n    const { wrap: shouldWrap = false, clip: shouldClip = false } = options;\n    let features = convertToInternal(data, options);\n    if (shouldWrap) {\n        features = wrap(features, options);\n    }\n    if (shouldClip || options.lineMetrics) {\n        const pow2 = 1 << z;\n        const buffer = options.buffer / options.extent;\n        const left = clip(features, pow2, (x - buffer), (x + 1 + buffer), AxisType.X, -1, 2, options);\n        features = clip(left || [], pow2, (y - buffer), (y + 1 + buffer), AxisType.Y, -1, 2, options);\n    }\n    return transformTile(createTile(features ?? [], z, x, y, options), options.extent);\n}\n\nexport { GEOJSONVT_CLIP_END, GEOJSONVT_CLIP_START, GeoJSONVT, ClusterTileIndex as Supercluster, geoJSONToTile };\n//# sourceMappingURL=geojson-vt.mjs.map\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';\nimport {GEOJSONVT_CLIP_END, GEOJSONVT_CLIP_START} from '@maplibre/geojson-vt';\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 '../array_types.g';\nimport {EXTENT} from '../extent';\nimport {VectorTileFeature} from '@mapbox/vector-tile';\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';\nimport {subdivideVertexLine} from '../../render/subdivision';\n\nimport type {CanonicalTileID} from '../../tile/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 type {RGBAImage} from '../../util/image';\nimport type {Context} from '../../webgl/context';\nimport type {Texture} from '../../webgl/texture';\nimport type {IndexBuffer} from '../../webgl/index_buffer';\nimport type {VertexBuffer} from '../../webgl/vertex_buffer';\nimport type {FeatureStates} from '../../source/source_state';\nimport type {ImagePosition} from '../../render/image_atlas';\nimport type {SubdivisionGranularitySetting} from '../../render/subdivision_granularity_settings';\nimport type {DashEntry} from '../../render/line_atlas';\nimport type {VectorTileLayerLike} from '@maplibre/vt-pbf';\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: LineStyleLayer[];\n    layerIds: string[];\n    gradients: {[x: string]: GradientTexture};\n    stateDependentLayers: any[];\n    stateDependentLayerIds: string[];\n    patternFeatures: BucketFeature[];\n    lineClipsArray: LineClips[];\n\n    layoutVertexArray: LineLayoutArray;\n    layoutVertexBuffer: VertexBuffer;\n    layoutVertexArray2: LineExtLayoutArray;\n    layoutVertexBuffer2: VertexBuffer;\n\n    indexArray: TriangleIndexArray;\n    indexBuffer: IndexBuffer;\n\n    hasDependencies: 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.hasDependencies = false;\n        this.patternFeatures = [];\n        this.lineClipsArray = [];\n        this.gradients = {};\n        for (const layer of this.layers) {\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: IndexedFeature[], options: PopulateParameters, canonical: CanonicalTileID) {\n        this.hasDependencies = hasPattern('line', this.layers, options) || this.hasLineDasharray(this.layers);\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                dashes: {},\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.hasDependencies) {\n                if (hasPattern('line', this.layers, options)) {\n                    addPatternDependencies('line', this.layers, bucketFeature, {zoom: this.zoom}, options);\n                } else if (this.hasLineDasharray(this.layers)) {\n                    this.addLineDashDependencies(this.layers, bucketFeature, this.zoom, options);\n                }\n\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(bucketFeature);\n            } else {\n                this.addFeature(bucketFeature, geometry, index, canonical, {}, {}, options.subdivisionGranularity);\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: VectorTileLayerLike, imagePositions: {[_: string]: ImagePosition}, dashPositions: {[_: string]: DashEntry}) {\n        if (!this.stateDependentLayers.length) return;\n        this.programConfigurations.updatePaintArrays(states, vtLayer, this.stateDependentLayers, {\n            imagePositions,\n            dashPositions\n        });\n    }\n\n    addFeatures(options: PopulateParameters, canonical: CanonicalTileID, imagePositions: {[_: string]: ImagePosition}, dashPositions?: {[_: string]: DashEntry}) {\n        for (const feature of this.patternFeatures) {\n            this.addFeature(feature, feature.geometry, feature.index, canonical, imagePositions, dashPositions, options.subdivisionGranularity);\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.hasOwn(feature.properties, GEOJSONVT_CLIP_START) && Object.hasOwn(feature.properties, GEOJSONVT_CLIP_END)) {\n            const start = +feature.properties[GEOJSONVT_CLIP_START];\n            const end = +feature.properties[GEOJSONVT_CLIP_END];\n            return {start, end};\n        }\n    }\n\n    addFeature(feature: BucketFeature, geometry: Point[][], index: number, canonical: CanonicalTileID, imagePositions: {[_: string]: ImagePosition}, dashPositions: Record<string, DashEntry>, subdivisionGranularity: SubdivisionGranularitySetting) {\n        const layout = this.layers[0].layout;\n        const join = layout.get('line-join').evaluate(feature, {});\n        const cap = layout.get('line-cap').evaluate(feature, {});\n        const miterLimit = layout.get('line-miter-limit').evaluate(feature, {});\n        const roundLimit = layout.get('line-round-limit').evaluate(feature, {});\n        this.lineClips = this.lineFeatureClips(feature);\n\n        for (const line of geometry) {\n            this.addLine(line, feature, join, cap, miterLimit, roundLimit, canonical, subdivisionGranularity);\n        }\n\n        this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length, feature, index, {imagePositions, dashPositions, canonical});\n    }\n\n    addLine(vertices: Point[], feature: BucketFeature, join: string, cap: string, miterLimit: number, roundLimit: number, canonical: CanonicalTileID | undefined, subdivisionGranularity: SubdivisionGranularitySetting) {\n        this.distance = 0;\n        this.scaledDistance = 0;\n        this.totalDistance = 0;\n\n        // First, subdivide the line if needed (mostly for globe rendering)\n        const granularity = canonical ? subdivisionGranularity.line.getGranularityForZoomLevel(canonical.z) : 1;\n        vertices = subdivideVertexLine(vertices, granularity);\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 = VectorTileFeature.types[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 ||= 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\u00B0 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             *             \u2196      \u2191\n             *                .________. prevVertex\n             *                |\n             * nextNormal  \u2190  |  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, e, this.e2);\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    private hasLineDasharray(layers: LineStyleLayer[]): boolean {\n        for (const layer of layers) {\n            const dasharrayProperty = layer.paint.get('line-dasharray');\n            if (dasharrayProperty && !dasharrayProperty.isConstant()) {\n                return true;\n            }\n        }\n        return false;\n    }\n\n    private addLineDashDependencies(layers: LineStyleLayer[], bucketFeature: BucketFeature, zoom: number, options: PopulateParameters) {\n        for (const layer of layers) {\n            const dasharrayProperty = layer.paint.get('line-dasharray');\n\n            if (!dasharrayProperty || dasharrayProperty.value.kind === 'constant') {\n                continue;\n            }\n\n            const round = layer.layout.get('line-cap').evaluate(bucketFeature, {}) === 'round';\n\n            const min = {\n                dasharray: dasharrayProperty.value.evaluate({zoom: zoom - 1}, bucketFeature, {}),\n                round\n            };\n            const mid = {\n                dasharray: dasharrayProperty.value.evaluate({zoom}, bucketFeature, {}),\n                round\n            };\n            const max = {\n                dasharray: dasharrayProperty.value.evaluate({zoom: zoom + 1}, bucketFeature, {}),\n                round\n            };\n\n            const minKey = `${min.dasharray.join(',')},${min.round}`;\n            const midKey = `${mid.dasharray.join(',')},${mid.round}`;\n            const maxKey = `${max.dasharray.join(',')},${max.round}`;\n\n            options.dashDependencies[minKey] = min;\n            options.dashDependencies[midKey] = mid;\n            options.dashDependencies[maxKey] = max;\n\n            bucketFeature.dashes[layer.id] = {min: minKey, mid: midKey, max: maxKey};\n        }\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, NumberArray, ColorArray, ResolvedImage, VariableAnchorOffsetCollection} from '@maplibre/maplibre-gl-style-spec';\nimport {StylePropertySpecification} from '@maplibre/maplibre-gl-style-spec';\n\nexport type LineLayoutProps = {\n    \"line-cap\": DataDrivenProperty<\"butt\" | \"round\" | \"square\">,\n    \"line-join\": DataDrivenProperty<\"bevel\" | \"round\" | \"miter\">,\n    \"line-miter-limit\": DataDrivenProperty<number>,\n    \"line-round-limit\": DataDrivenProperty<number>,\n    \"line-sort-key\": DataDrivenProperty<number>,\n};\n\nexport type LineLayoutPropsPossiblyEvaluated = {\n    \"line-cap\": PossiblyEvaluatedPropertyValue<\"butt\" | \"round\" | \"square\">,\n    \"line-join\": PossiblyEvaluatedPropertyValue<\"bevel\" | \"round\" | \"miter\">,\n    \"line-miter-limit\": PossiblyEvaluatedPropertyValue<number>,\n    \"line-round-limit\": PossiblyEvaluatedPropertyValue<number>,\n    \"line-sort-key\": PossiblyEvaluatedPropertyValue<number>,\n};\n\nlet layout: Properties<LineLayoutProps>;\nconst getLayout = () => layout = layout || new Properties({\n    \"line-cap\": new DataDrivenProperty(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 DataDrivenProperty(styleSpec[\"layout_line\"][\"line-miter-limit\"] as any as StylePropertySpecification),\n    \"line-round-limit\": new DataDrivenProperty(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\": CrossFadedDataDrivenProperty<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\": PossiblyEvaluatedPropertyValue<CrossFaded<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 CrossFadedDataDrivenProperty(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 {type QueryIntersectsFeatureParams, 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, {type LineLayoutPropsPossiblyEvaluated, type LinePaintPropsPossiblyEvaluated} from './line_style_layer_properties.g';\nimport {extend} from '../../util/util';\nimport {EvaluationParameters} from '../evaluation_parameters';\nimport {type Transitionable, type Transitioning, type Layout, type PossiblyEvaluated, DataDrivenProperty} from '../properties';\n\nimport {isZoomExpression, Step} from '@maplibre/maplibre-gl-style-spec';\nimport type {LayerSpecification} from '@maplibre/maplibre-gl-style-spec';\nimport type {Bucket, BucketParameters} from '../../data/bucket';\nimport type {LineLayoutProps, LinePaintProps} from './line_style_layer_properties.g';\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 const isLineStyleLayer = (layer: StyleLayer): layer is LineStyleLayer => layer.type === 'line';\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, globalState: Record<string, any>) {\n        super(layer, properties, globalState);\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: 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,\n        feature,\n        featureState,\n        geometry,\n        transform,\n        pixelsToTileUnits}: QueryIntersectsFeatureParams\n    ): boolean {\n        const translatedPolygon = translate(queryGeometry,\n            this.paint.get('line-translate'),\n            this.paint.get('line-translate-anchor'),\n            -transform.bearingInRadians, 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 {type 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    for (const section of text.sections) {\n        section.text = transformTextInternal(section.text, layer, feature);\n    }\n    return text;\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", "import {charHasRotatedVerticalOrientation} from './script_detection';\n\nexport const verticalizedCharacterMap = {\n    '!': '\uFE15',\n    '#': '\uFF03',\n    '$': '\uFF04',\n    '%': '\uFF05',\n    '&': '\uFF06',\n    '(': '\uFE35',\n    ')': '\uFE36',\n    '*': '\uFF0A',\n    '+': '\uFF0B',\n    ',': '\uFE10',\n    '-': '\uFE32',\n    '.': '\u30FB',\n    '/': '\uFF0F',\n    ':': '\uFE13',\n    ';': '\uFE14',\n    '<': '\uFE3F',\n    '=': '\uFF1D',\n    '>': '\uFE40',\n    '?': '\uFE16',\n    '@': '\uFF20',\n    '[': '\uFE47',\n    '\\\\': '\uFF3C',\n    ']': '\uFE48',\n    '^': '\uFF3E',\n    '_': '\uFE33',\n    '`': '\uFF40',\n    '{': '\uFE37',\n    '|': '\u2015',\n    '}': '\uFE38',\n    '~': '\uFF5E',\n    '\u00A2': '\uFFE0',\n    '\u00A3': '\uFFE1',\n    '\u00A5': '\uFFE5',\n    '\u00A6': '\uFFE4',\n    '\u00AC': '\uFFE2',\n    '\u00AF': '\uFFE3',\n    '\u2013': '\uFE32',\n    '\u2014': '\uFE31',\n    '\u2018': '\uFE43',\n    '\u2019': '\uFE44',\n    '\u201C': '\uFE41',\n    '\u201D': '\uFE42',\n    '\u2026': '\uFE19',\n    '\u22EF': '\uFE19',\n    '\u2027': '\u30FB',\n    '\u20A9': '\uFFE6',\n    '\u3001': '\uFE11',\n    '\u3002': '\uFE12',\n    '\u3008': '\uFE3F',\n    '\u3009': '\uFE40',\n    '\u300A': '\uFE3D',\n    '\u300B': '\uFE3E',\n    '\u300C': '\uFE41',\n    '\u300D': '\uFE42',\n    '\u300E': '\uFE43',\n    '\u300F': '\uFE44',\n    '\u3010': '\uFE3B',\n    '\u3011': '\uFE3C',\n    '\u3014': '\uFE39',\n    '\u3015': '\uFE3A',\n    '\u3016': '\uFE17',\n    '\u3017': '\uFE18',\n    '\uFF01': '\uFE15',\n    '\uFF08': '\uFE35',\n    '\uFF09': '\uFE36',\n    '\uFF0C': '\uFE10',\n    '\uFF0D': '\uFE32',\n    '\uFF0E': '\u30FB',\n    '\uFF1A': '\uFE13',\n    '\uFF1B': '\uFE14',\n    '\uFF1C': '\uFE3F',\n    '\uFF1E': '\uFE40',\n    '\uFF1F': '\uFE16',\n    '\uFF3B': '\uFE47',\n    '\uFF3D': '\uFE48',\n    '\uFF3F': '\uFE33',\n    '\uFF5B': '\uFE37',\n    '\uFF5C': '\u2015',\n    '\uFF5D': '\uFE38',\n    '\uFF5F': '\uFE35',\n    '\uFF60': '\uFE36',\n    '\uFF61': '\uFE12',\n    '\uFF62': '\uFE41',\n    '\uFF63': '\uFE42'\n};\n\nexport function verticalizePunctuation(input: string) {\n    let output = '';\n\n    let prevChar = {premature: true, value: undefined};\n    const chars = input[Symbol.iterator]();\n    let char = chars.next();\n    const nextChars = input[Symbol.iterator]();\n    nextChars.next();\n    let nextChar = nextChars.next();\n\n    while (!char.done) {\n        const canReplacePunctuation = (\n            (nextChar.done || !charHasRotatedVerticalOrientation(nextChar.value.codePointAt(0)) || verticalizedCharacterMap[nextChar.value]) &&\n            (prevChar.premature || !charHasRotatedVerticalOrientation(prevChar.value.codePointAt(0)) || verticalizedCharacterMap[prevChar.value])\n        );\n\n        if (canReplacePunctuation && verticalizedCharacterMap[char.value]) {\n            output += verticalizedCharacterMap[char.value];\n        } else {\n            output += char.value;\n        }\n\n        prevChar = {value: char.value, premature: false};\n        char = chars.next();\n        nextChar = nextChars.next();\n    }\n\n    return output;\n}\n\n", "import type {Formatted, FormattedSection, VerticalAlign} from '@maplibre/maplibre-gl-style-spec';\n\nimport ONE_EM from './one_em';\nimport type {ImagePosition} from '../render/image_atlas';\nimport type {StyleGlyph} from '../style/style_glyph';\nimport {verticalizePunctuation} from '../util/verticalize_punctuation';\nimport {charIsWhitespace} from '../util/script_detection';\nimport {codePointAllowsIdeographicBreaking} from '../util/unicode_properties.g';\nimport {warnOnce} from '../util/util';\n\nexport type TextSectionOptions = {\n    scale: number;\n    verticalAlign: VerticalAlign;\n    fontStack: string;\n};\n\nexport type ImageSectionOptions = {\n    scale: number;\n    verticalAlign: VerticalAlign;\n    imageName: string;\n};\n\nexport type SectionOptions = TextSectionOptions | ImageSectionOptions;\n\n// Max number of images in label is 6401 U+E000\u2013U+F8FF that covers\n// Basic Multilingual Plane Unicode Private Use Area (PUA).\nconst PUAbegin = 0xE000;\nconst PUAend = 0xF8FF;\n\ntype Break = {\n    index: number;\n    x: number;\n    priorBreak: Break;\n    badness: number;\n};\n\n// using computed properties due to https://github.com/facebook/flow/issues/380\n/* eslint no-useless-computed-key: 0 */\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 in codePointHasNeutralVerticalOrientation in unicode_properties\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 ('fontStack' in section) {\n        const positions = glyphMap[section.fontStack];\n        const glyph = 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 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\nfunction evaluateBreak(\n    breakIndex: number,\n    breakX: number,\n    targetWidth: number,\n    potentialBreaks: 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): number[] {\n    if (!lastLineBreak) {\n        return [];\n    }\n    return leastBadBreaks(lastLineBreak.priorBreak).concat(lastLineBreak.index);\n}\n\nexport class TaggedString {\n    text: string;\n    sections: SectionOptions[];\n    /** Maps each character in `text` to its corresponding entry in `sections`. */\n    sectionIndex: number[];\n    imageSectionID: number | null;\n\n    constructor(text: string = '', sections: SectionOptions[] = [], sectionIndex: number[] = []) {\n        this.text = text;\n        this.sections = sections;\n        this.sectionIndex = sectionIndex;\n        this.imageSectionID = null;\n    }\n\n    static fromFeature(text: Formatted, defaultFontStack: string) {\n        const result = new TaggedString();\n        for (const section of text.sections) {\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    verticalizePunctuation() {\n        this.text = verticalizePunctuation(this.text);\n    }\n\n    /**\n     * Returns whether the text contains zero-width spaces.\n     *\n     * Some tilesets such as Mapbox Streets insert ZWSPs as hints for line\n     * breaking in CJK text.\n     */\n    hasZeroWidthSpaces(): boolean {\n        return this.text.includes('\\u200b');\n    }\n\n    trim() {\n        const leadingWhitespace = this.text.match(/^\\s*/);\n        const leadingLength = leadingWhitespace ? leadingWhitespace[0].length : 0;\n        // Require a preceding non-space character to avoid overlapping leading and trailing matches.\n        const trailingWhitespace = this.text.match(/\\S\\s*$/);\n        const trailingLength = trailingWhitespace ? trailingWhitespace[0].length - 1 : 0;\n        this.text = this.text.substring(leadingLength, this.text.length - trailingLength);\n        this.sectionIndex = this.sectionIndex.slice(leadingLength, this.sectionIndex.length - trailingLength);\n    }\n\n    substring(start: number, end: number): TaggedString {\n        const text = [...this.text].slice(start, end).join('');\n        const sectionIndex = this.sectionIndex.slice(start, end);\n        return new TaggedString(text, this.sections, sectionIndex);\n    }\n\n    /**\n     * Converts a UTF-16 character index to a UTF-16 code unit (JavaScript character index).\n     */\n    toCodeUnitIndex(unicodeIndex: number): number {\n        return [...this.text].slice(0, unicodeIndex).join('').length;\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    getMaxImageSize(imagePositions: {[_: string]: ImagePosition}): {\n        maxImageWidth: number;\n        maxImageHeight: number;\n    } {\n        let maxImageWidth = 0;\n        let maxImageHeight = 0;\n        for (let i = 0; i < this.length(); i++) {\n            const section = this.getSection(i);\n            if ('imageName' in section) {\n                const imagePosition = imagePositions[section.imageName];\n                if (!imagePosition) continue;\n                const size = imagePosition.displaySize;\n                maxImageWidth = Math.max(maxImageWidth, size[0]);\n                maxImageHeight = Math.max(maxImageHeight, size[1]);\n            }\n        }\n        return {maxImageWidth, maxImageHeight};\n    }\n\n    addTextSection(section: FormattedSection, defaultFontStack: string) {\n        this.text += section.text;\n        this.sections.push({\n            scale: section.scale || 1,\n            verticalAlign: section.verticalAlign || 'bottom',\n            fontStack: section.fontStack || defaultFontStack,\n        } as TextSectionOptions);\n        const index = this.sections.length - 1;\n        this.sectionIndex.push(...[...section.text].map(() => index));\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({\n            scale: 1,\n            verticalAlign: section.verticalAlign || 'bottom',\n            imageName,\n        } as ImageSectionOptions);\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    determineLineBreaks(\n        spacing: number,\n        maxWidth: number,\n        glyphMap: {\n            [_: string]: {\n                [_: number]: StyleGlyph;\n            };\n        },\n        imagePositions: {[_: string]: ImagePosition},\n        layoutTextSize: number\n    ): number[] {\n        const potentialLineBreaks = [];\n        const targetWidth = this.determineAverageLineWidth(spacing, maxWidth, glyphMap, imagePositions, layoutTextSize);\n\n        const hasZeroWidthSpaces = this.hasZeroWidthSpaces();\n\n        let currentX = 0;\n\n        let i = 0;\n        const chars = this.text[Symbol.iterator]();\n        let char = chars.next();\n        const nextChars = this.text[Symbol.iterator]();\n        nextChars.next();\n        let nextChar = nextChars.next();\n        const nextNextChars = this.text[Symbol.iterator]();\n        nextNextChars.next();\n        nextNextChars.next();\n        let nextNextChar = nextNextChars.next();\n\n        while (!char.done) {\n            const section = this.getSection(i);\n            const codePoint = char.value.codePointAt(0);\n            if (!charIsWhitespace(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 (!nextChar.done) {\n                const ideographicBreak = codePointAllowsIdeographicBreaking(codePoint);\n                const nextCodePoint = nextChar.value.codePointAt(0);\n                if (breakable[codePoint] || ideographicBreak || 'imageName' in section || (!nextNextChar.done && breakableBefore[nextCodePoint])) {\n\n                    potentialLineBreaks.push(\n                        evaluateBreak(\n                            i + 1,\n                            currentX,\n                            targetWidth,\n                            potentialLineBreaks,\n                            calculatePenalty(codePoint, nextCodePoint, ideographicBreak && hasZeroWidthSpaces),\n                            false));\n                }\n            }\n            i++;\n            char = chars.next();\n            nextChar = nextChars.next();\n            nextNextChar = nextNextChars.next();\n        }\n\n        return leastBadBreaks(\n            evaluateBreak(\n                this.length(),\n                currentX,\n                targetWidth,\n                potentialLineBreaks,\n                0,\n                true));\n    }\n\n    determineAverageLineWidth(\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        let index = 0;\n        for (const char of this.text) {\n            const section = this.getSection(index);\n            totalWidth += getGlyphAdvance(char.codePointAt(0), section, glyphMap, imagePositions, spacing, layoutTextSize);\n            index++;\n        }\n\n        const lineCount = Math.max(1, Math.ceil(totalWidth / maxWidth));\n        return totalWidth / lineCount;\n    }\n}\n", "\nconst SHIFT_LEFT_32 = (1 << 16) * (1 << 16);\nconst 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)\nconst TEXT_DECODER_MIN_LENGTH = 12;\nconst utf8TextDecoder = typeof TextDecoder === 'undefined' ? null : new TextDecoder('utf-8');\n\nconst PBF_VARINT  = 0; // varint: int32, int64, uint32, uint64, sint32, sint64, bool, enum\nconst PBF_FIXED64 = 1; // 64-bit: double, fixed64, sfixed64\nconst PBF_BYTES   = 2; // length-delimited: string, bytes, embedded messages, packed repeated fields\nconst PBF_FIXED32 = 5; // 32-bit: float, fixed32, sfixed32\n\nexport default class Pbf {\n    /**\n     * @param {Uint8Array | ArrayBuffer} [buf]\n     */\n    constructor(buf = new Uint8Array(16)) {\n        this.buf = ArrayBuffer.isView(buf) ? buf : new Uint8Array(buf);\n        this.dataView = new DataView(this.buf.buffer);\n        this.pos = 0;\n        this.type = 0;\n        this.length = this.buf.length;\n    }\n\n    // === READING =================================================================\n\n    /**\n     * @template T\n     * @param {(tag: number, result: T, pbf: Pbf) => void} readField\n     * @param {T} result\n     * @param {number} [end]\n     */\n    readFields(readField, result, end = this.length) {\n        while (this.pos < end) {\n            const 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    /**\n     * @template T\n     * @param {(tag: number, result: T, pbf: Pbf) => void} readField\n     * @param {T} result\n     */\n    readMessage(readField, result) {\n        return this.readFields(readField, result, this.readVarint() + this.pos);\n    }\n\n    readFixed32() {\n        const val = this.dataView.getUint32(this.pos, true);\n        this.pos += 4;\n        return val;\n    }\n\n    readSFixed32() {\n        const val = this.dataView.getInt32(this.pos, true);\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() {\n        const val = this.dataView.getUint32(this.pos, true) + this.dataView.getUint32(this.pos + 4, true) * SHIFT_LEFT_32;\n        this.pos += 8;\n        return val;\n    }\n\n    readSFixed64() {\n        const val = this.dataView.getUint32(this.pos, true) + this.dataView.getInt32(this.pos + 4, true) * SHIFT_LEFT_32;\n        this.pos += 8;\n        return val;\n    }\n\n    readFloat() {\n        const val = this.dataView.getFloat32(this.pos, true);\n        this.pos += 4;\n        return val;\n    }\n\n    readDouble() {\n        const val = this.dataView.getFloat64(this.pos, true);\n        this.pos += 8;\n        return val;\n    }\n\n    /**\n     * @param {boolean} [isSigned]\n     */\n    readVarint(isSigned) {\n        const buf = this.buf;\n        let 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() { // for compatibility with v2.0.1\n        return this.readVarint(true);\n    }\n\n    readSVarint() {\n        const num = this.readVarint();\n        return num % 2 === 1 ? (num + 1) / -2 : num / 2; // zigzag encoding\n    }\n\n    readBoolean() {\n        return Boolean(this.readVarint());\n    }\n\n    readString() {\n        const end = this.readVarint() + this.pos;\n        const 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 utf8TextDecoder.decode(this.buf.subarray(pos, end));\n        }\n        // short strings are fast with our custom implementation\n        return readUtf8(this.buf, pos, end);\n    }\n\n    readBytes() {\n        const 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    /**\n     * @param {number[]} [arr]\n     * @param {boolean} [isSigned]\n     */\n    readPackedVarint(arr = [], isSigned) {\n        const end = this.readPackedEnd();\n        while (this.pos < end) arr.push(this.readVarint(isSigned));\n        return arr;\n    }\n    /** @param {number[]} [arr] */\n    readPackedSVarint(arr = []) {\n        const end = this.readPackedEnd();\n        while (this.pos < end) arr.push(this.readSVarint());\n        return arr;\n    }\n    /** @param {boolean[]} [arr] */\n    readPackedBoolean(arr = []) {\n        const end = this.readPackedEnd();\n        while (this.pos < end) arr.push(this.readBoolean());\n        return arr;\n    }\n    /** @param {number[]} [arr] */\n    readPackedFloat(arr = []) {\n        const end = this.readPackedEnd();\n        while (this.pos < end) arr.push(this.readFloat());\n        return arr;\n    }\n    /** @param {number[]} [arr] */\n    readPackedDouble(arr = []) {\n        const end = this.readPackedEnd();\n        while (this.pos < end) arr.push(this.readDouble());\n        return arr;\n    }\n    /** @param {number[]} [arr] */\n    readPackedFixed32(arr = []) {\n        const end = this.readPackedEnd();\n        while (this.pos < end) arr.push(this.readFixed32());\n        return arr;\n    }\n    /** @param {number[]} [arr] */\n    readPackedSFixed32(arr = []) {\n        const end = this.readPackedEnd();\n        while (this.pos < end) arr.push(this.readSFixed32());\n        return arr;\n    }\n    /** @param {number[]} [arr] */\n    readPackedFixed64(arr = []) {\n        const end = this.readPackedEnd();\n        while (this.pos < end) arr.push(this.readFixed64());\n        return arr;\n    }\n    /** @param {number[]} [arr] */\n    readPackedSFixed64(arr = []) {\n        const end = this.readPackedEnd();\n        while (this.pos < end) arr.push(this.readSFixed64());\n        return arr;\n    }\n    readPackedEnd() {\n        return this.type === PBF_BYTES ? this.readVarint() + this.pos : this.pos + 1;\n    }\n\n    /** @param {number} val */\n    skip(val) {\n        const 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    /**\n     * @param {number} tag\n     * @param {number} type\n     */\n    writeTag(tag, type) {\n        this.writeVarint((tag << 3) | type);\n    }\n\n    /** @param {number} min */\n    realloc(min) {\n        let length = this.length || 16;\n\n        while (length < this.pos + min) length *= 2;\n\n        if (length !== this.length) {\n            const buf = new Uint8Array(length);\n            buf.set(this.buf);\n            this.buf = buf;\n            this.dataView = new DataView(buf.buffer);\n            this.length = length;\n        }\n    }\n\n    finish() {\n        this.length = this.pos;\n        this.pos = 0;\n        return this.buf.subarray(0, this.length);\n    }\n\n    /** @param {number} val */\n    writeFixed32(val) {\n        this.realloc(4);\n        this.dataView.setInt32(this.pos, val, true);\n        this.pos += 4;\n    }\n\n    /** @param {number} val */\n    writeSFixed32(val) {\n        this.realloc(4);\n        this.dataView.setInt32(this.pos, val, true);\n        this.pos += 4;\n    }\n\n    /** @param {number} val */\n    writeFixed64(val) {\n        this.realloc(8);\n        this.dataView.setInt32(this.pos, val & -1, true);\n        this.dataView.setInt32(this.pos + 4, Math.floor(val * SHIFT_RIGHT_32), true);\n        this.pos += 8;\n    }\n\n    /** @param {number} val */\n    writeSFixed64(val) {\n        this.realloc(8);\n        this.dataView.setInt32(this.pos, val & -1, true);\n        this.dataView.setInt32(this.pos + 4, Math.floor(val * SHIFT_RIGHT_32), true);\n        this.pos += 8;\n    }\n\n    /** @param {number} val */\n    writeVarint(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    /** @param {number} val */\n    writeSVarint(val) {\n        this.writeVarint(val < 0 ? -val * 2 - 1 : val * 2);\n    }\n\n    /** @param {boolean} val */\n    writeBoolean(val) {\n        this.writeVarint(+val);\n    }\n\n    /** @param {string} str */\n    writeString(str) {\n        str = String(str);\n        this.realloc(str.length * 4);\n\n        this.pos++; // reserve 1 byte for short string length\n\n        const 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        const 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    /** @param {number} val */\n    writeFloat(val) {\n        this.realloc(4);\n        this.dataView.setFloat32(this.pos, val, true);\n        this.pos += 4;\n    }\n\n    /** @param {number} val */\n    writeDouble(val) {\n        this.realloc(8);\n        this.dataView.setFloat64(this.pos, val, true);\n        this.pos += 8;\n    }\n\n    /** @param {Uint8Array} buffer */\n    writeBytes(buffer) {\n        const len = buffer.length;\n        this.writeVarint(len);\n        this.realloc(len);\n        for (let i = 0; i < len; i++) this.buf[this.pos++] = buffer[i];\n    }\n\n    /**\n     * @template T\n     * @param {(obj: T, pbf: Pbf) => void} fn\n     * @param {T} obj\n     */\n    writeRawMessage(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        const startPos = this.pos;\n        fn(obj, this);\n        const 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    /**\n     * @template T\n     * @param {number} tag\n     * @param {(obj: T, pbf: Pbf) => void} fn\n     * @param {T} obj\n     */\n    writeMessage(tag, fn, obj) {\n        this.writeTag(tag, PBF_BYTES);\n        this.writeRawMessage(fn, obj);\n    }\n\n    /**\n     * @param {number} tag\n     * @param {number[]} arr\n     */\n    writePackedVarint(tag, arr) {\n        if (arr.length) this.writeMessage(tag, writePackedVarint, arr);\n    }\n    /**\n     * @param {number} tag\n     * @param {number[]} arr\n     */\n    writePackedSVarint(tag, arr) {\n        if (arr.length) this.writeMessage(tag, writePackedSVarint, arr);\n    }\n    /**\n     * @param {number} tag\n     * @param {boolean[]} arr\n     */\n    writePackedBoolean(tag, arr) {\n        if (arr.length) this.writeMessage(tag, writePackedBoolean, arr);\n    }\n    /**\n     * @param {number} tag\n     * @param {number[]} arr\n     */\n    writePackedFloat(tag, arr) {\n        if (arr.length) this.writeMessage(tag, writePackedFloat, arr);\n    }\n    /**\n     * @param {number} tag\n     * @param {number[]} arr\n     */\n    writePackedDouble(tag, arr) {\n        if (arr.length) this.writeMessage(tag, writePackedDouble, arr);\n    }\n    /**\n     * @param {number} tag\n     * @param {number[]} arr\n     */\n    writePackedFixed32(tag, arr) {\n        if (arr.length) this.writeMessage(tag, writePackedFixed32, arr);\n    }\n    /**\n     * @param {number} tag\n     * @param {number[]} arr\n     */\n    writePackedSFixed32(tag, arr) {\n        if (arr.length) this.writeMessage(tag, writePackedSFixed32, arr);\n    }\n    /**\n     * @param {number} tag\n     * @param {number[]} arr\n     */\n    writePackedFixed64(tag, arr) {\n        if (arr.length) this.writeMessage(tag, writePackedFixed64, arr);\n    }\n    /**\n     * @param {number} tag\n     * @param {number[]} arr\n     */\n    writePackedSFixed64(tag, arr) {\n        if (arr.length) this.writeMessage(tag, writePackedSFixed64, arr);\n    }\n\n    /**\n     * @param {number} tag\n     * @param {Uint8Array} buffer\n     */\n    writeBytesField(tag, buffer) {\n        this.writeTag(tag, PBF_BYTES);\n        this.writeBytes(buffer);\n    }\n    /**\n     * @param {number} tag\n     * @param {number} val\n     */\n    writeFixed32Field(tag, val) {\n        this.writeTag(tag, PBF_FIXED32);\n        this.writeFixed32(val);\n    }\n    /**\n     * @param {number} tag\n     * @param {number} val\n     */\n    writeSFixed32Field(tag, val) {\n        this.writeTag(tag, PBF_FIXED32);\n        this.writeSFixed32(val);\n    }\n    /**\n     * @param {number} tag\n     * @param {number} val\n     */\n    writeFixed64Field(tag, val) {\n        this.writeTag(tag, PBF_FIXED64);\n        this.writeFixed64(val);\n    }\n    /**\n     * @param {number} tag\n     * @param {number} val\n     */\n    writeSFixed64Field(tag, val) {\n        this.writeTag(tag, PBF_FIXED64);\n        this.writeSFixed64(val);\n    }\n    /**\n     * @param {number} tag\n     * @param {number} val\n     */\n    writeVarintField(tag, val) {\n        this.writeTag(tag, PBF_VARINT);\n        this.writeVarint(val);\n    }\n    /**\n     * @param {number} tag\n     * @param {number} val\n     */\n    writeSVarintField(tag, val) {\n        this.writeTag(tag, PBF_VARINT);\n        this.writeSVarint(val);\n    }\n    /**\n     * @param {number} tag\n     * @param {string} str\n     */\n    writeStringField(tag, str) {\n        this.writeTag(tag, PBF_BYTES);\n        this.writeString(str);\n    }\n    /**\n     * @param {number} tag\n     * @param {number} val\n     */\n    writeFloatField(tag, val) {\n        this.writeTag(tag, PBF_FIXED32);\n        this.writeFloat(val);\n    }\n    /**\n     * @param {number} tag\n     * @param {number} val\n     */\n    writeDoubleField(tag, val) {\n        this.writeTag(tag, PBF_FIXED64);\n        this.writeDouble(val);\n    }\n    /**\n     * @param {number} tag\n     * @param {boolean} val\n     */\n    writeBooleanField(tag, val) {\n        this.writeVarintField(tag, +val);\n    }\n};\n\n/**\n * @param {number} l\n * @param {boolean | undefined} s\n * @param {Pbf} p\n */\nfunction readVarintRemainder(l, s, p) {\n    const buf = p.buf;\n    let 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\n/**\n * @param {number} low\n * @param {number} high\n * @param {boolean} [isSigned]\n */\nfunction toNum(low, high, isSigned) {\n    return isSigned ? high * 0x100000000 + (low >>> 0) : ((high >>> 0) * 0x100000000) + (low >>> 0);\n}\n\n/**\n * @param {number} val\n * @param {Pbf} pbf\n */\nfunction writeBigVarint(val, pbf) {\n    let 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\n/**\n * @param {number} high\n * @param {number} low\n * @param {Pbf} pbf\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\n/**\n * @param {number} high\n * @param {Pbf} pbf\n */\nfunction writeBigVarintHigh(high, pbf) {\n    const 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\n/**\n * @param {number} startPos\n * @param {number} len\n * @param {Pbf} pbf\n */\nfunction makeRoomForExtraLength(startPos, len, pbf) {\n    const 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 (let i = pbf.pos - 1; i >= startPos; i--) pbf.buf[i + extraLen] = pbf.buf[i];\n}\n\n/**\n * @param {number[]} arr\n * @param {Pbf} pbf\n */\nfunction writePackedVarint(arr, pbf) {\n    for (let i = 0; i < arr.length; i++) pbf.writeVarint(arr[i]);\n}\n/**\n * @param {number[]} arr\n * @param {Pbf} pbf\n */\nfunction writePackedSVarint(arr, pbf) {\n    for (let i = 0; i < arr.length; i++) pbf.writeSVarint(arr[i]);\n}\n/**\n * @param {number[]} arr\n * @param {Pbf} pbf\n */\nfunction writePackedFloat(arr, pbf) {\n    for (let i = 0; i < arr.length; i++) pbf.writeFloat(arr[i]);\n}\n/**\n * @param {number[]} arr\n * @param {Pbf} pbf\n */\nfunction writePackedDouble(arr, pbf) {\n    for (let i = 0; i < arr.length; i++) pbf.writeDouble(arr[i]);\n}\n/**\n * @param {boolean[]} arr\n * @param {Pbf} pbf\n */\nfunction writePackedBoolean(arr, pbf) {\n    for (let i = 0; i < arr.length; i++) pbf.writeBoolean(arr[i]);\n}\n/**\n * @param {number[]} arr\n * @param {Pbf} pbf\n */\nfunction writePackedFixed32(arr, pbf) {\n    for (let i = 0; i < arr.length; i++) pbf.writeFixed32(arr[i]);\n}\n/**\n * @param {number[]} arr\n * @param {Pbf} pbf\n */\nfunction writePackedSFixed32(arr, pbf) {\n    for (let i = 0; i < arr.length; i++) pbf.writeSFixed32(arr[i]);\n}\n/**\n * @param {number[]} arr\n * @param {Pbf} pbf\n */\nfunction writePackedFixed64(arr, pbf) {\n    for (let i = 0; i < arr.length; i++) pbf.writeFixed64(arr[i]);\n}\n/**\n * @param {number[]} arr\n * @param {Pbf} pbf\n */\nfunction writePackedSFixed64(arr, pbf) {\n    for (let i = 0; i < arr.length; i++) pbf.writeSFixed64(arr[i]);\n}\n\n// Buffer code below from https://github.com/feross/buffer, MIT-licensed\n\n/**\n * @param {Uint8Array} buf\n * @param {number} pos\n * @param {number} end\n */\nfunction readUtf8(buf, pos, end) {\n    let str = '';\n    let i = pos;\n\n    while (i < end) {\n        const b0 = buf[i];\n        let c = null; // codepoint\n        let bytesPerSequence =\n            b0 > 0xEF ? 4 :\n            b0 > 0xDF ? 3 :\n            b0 > 0xBF ? 2 : 1;\n\n        if (i + bytesPerSequence > end) break;\n\n        let 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\n/**\n * @param {Uint8Array} buf\n * @param {string} str\n * @param {number} pos\n */\nfunction writeUtf8(buf, str, pos) {\n    for (let 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", "import {AlphaImage} from '../util/image';\n\nimport Protobuf from 'pbf';\nconst border = 3;\n\nimport type {StyleGlyph} from './style_glyph';\n\ntype RawGlyph = {\n    id: number;\n    bitmap: Uint8Array;\n    width: number;\n    height: number;\n    left: number;\n    top: number;\n    advance: number;\n};\n\nfunction readFontstacks(tag: number, glyphs: StyleGlyph[], pbf: Protobuf) {\n    if (tag === 1) {\n        pbf.readMessage(readFontstack, glyphs);\n    }\n}\n\nfunction readFontstack(tag: number, glyphs: StyleGlyph[], pbf: Protobuf) {\n    if (tag === 3) {\n        const {id, bitmap, width, height, left, top, advance} = pbf.readMessage(readGlyph, {} as RawGlyph);\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: RawGlyph, 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): StyleGlyph[] {\n    return new Protobuf(data).readFields(readFontstacks, []);\n}\n\nexport const GLYPH_PBF_BORDER = border;\n", "/**\n * @typedef {Object} PotpackBox\n * @property {number} w Box width.\n * @property {number} h Box height.\n * @property {number} [x] X coordinate in the resulting container.\n * @property {number} [y] Y coordinate in the resulting container.\n */\n\n/**\n * @typedef {Object} PotpackStats\n * @property {number} w Width of the resulting container.\n * @property {number} h Height of the resulting container.\n * @property {number} fill The space utilization value (0 to 1). Higher is better.\n */\n\n/**\n * Packs 2D rectangles into a near-square container.\n *\n * Mutates the {@link boxes} array: it's sorted (by height/width),\n * and box objects are augmented with `x`, `y` coordinates.\n *\n * @param {PotpackBox[]} boxes\n * @return {PotpackStats}\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 (last && 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 {type TextFit} from '../style/style_image';\nimport type {ImageManager} from './image_manager';\nimport type {Texture} from '../webgl/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(): 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: 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: 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    codePointHasUprightVerticalOrientation\n} from '../util/unicode_properties.g';\nimport {\n    charIsWhitespace,\n    charInComplexShapingScript\n} from '../util/script_detection';\nimport {rtlWorkerPlugin} from '../source/rtl_text_plugin_worker';\nimport ONE_EM from './one_em';\n\nimport {TaggedString, type TextSectionOptions, type ImageSectionOptions} from './tagged_string';\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 type {Formatted, VerticalAlign} 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: PositionedGlyph[];\n    lineOffset: number;\n};\n\n// A collection of positioned glyphs and some metadata\nexport type Shaping = {\n    positionedLines: 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\ntype ShapingSectionAttributes = {\n    rect: Rect | null;\n    metrics: GlyphMetrics;\n    baselineOffset: number;\n    imageOffset?: number;\n};\n\ntype LineShapingSize = {\n    verticalLineContentWidth: number;\n    horizontalLineContentHeight: number;\n};\n\nfunction isEmpty(positionedLines: 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\nfunction breakLines(input: TaggedString, lineBreakPoints: number[]): TaggedString[] {\n    const lines = [];\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 < input.length()) {\n        lines.push(input.substring(start, input.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: TaggedString[];\n\n    let lineBreaks = logicalInput.determineLineBreaks(spacing, maxWidth, glyphMap, imagePositions, layoutTextSize);\n    const {processBidirectionalText, processStyledBidirectionalText} = rtlWorkerPlugin;\n    if (processBidirectionalText && logicalInput.sections.length === 1) {\n        // Bidi doesn't have to be style-aware\n        lines = [];\n        // ICU operates on code units.\n        lineBreaks = lineBreaks.map(index => logicalInput.toCodeUnitIndex(index));\n        const untaggedLines =\n            processBidirectionalText(logicalInput.toString(), lineBreaks);\n        for (const line of untaggedLines) {\n            const sectionIndex = [...line].map(() => 0);\n            lines.push(new TaggedString(line, logicalInput.sections, sectionIndex));\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        // ICU operates on code units.\n        lineBreaks = lineBreaks.map(index => logicalInput.toCodeUnitIndex(index));\n\n        // Convert character-based section index to be based on code units.\n        let i = 0;\n        const sectionIndex = [];\n        for (const char of logicalInput.text) {\n            sectionIndex.push(...Array(char.length).fill(logicalInput.sectionIndex[i]));\n            i++;\n        }\n\n        const processedLines =\n            processStyledBidirectionalText(logicalInput.text, sectionIndex, lineBreaks);\n        for (const line of processedLines) {\n            const sectionIndex = [];\n            let elapsedChars = '';\n            for (const char of line[0]) {\n                sectionIndex.push(line[1][elapsedChars.length]);\n                elapsedChars += char;\n            }\n            lines.push(new TaggedString(line[0], logicalInput.sections, sectionIndex));\n        }\n    } else {\n        lines = breakLines(logicalInput, lineBreaks);\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\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 calculateLineContentSize(\n    imagePositions: {[_: string]: ImagePosition},\n    line: TaggedString,\n    layoutTextSizeFactor: number\n): LineShapingSize {\n    const maxGlyphSize = line.getMaxScale() * ONE_EM;\n    const {maxImageWidth, maxImageHeight} = line.getMaxImageSize(imagePositions);\n\n    const horizontalLineContentHeight = Math.max(maxGlyphSize, maxImageHeight * layoutTextSizeFactor);\n    const verticalLineContentWidth = Math.max(maxGlyphSize, maxImageWidth * layoutTextSizeFactor);\n\n    return {verticalLineContentWidth, horizontalLineContentHeight};\n}\n\nfunction getVerticalAlignFactor(\n    verticalAlign: VerticalAlign\n) {\n    switch (verticalAlign) {\n        case 'top':\n            return 0;\n        case 'center':\n            return 0.5;\n        default:\n            return 1;\n    }\n}\n\nfunction getRectAndMetrics(\n    glyphPosition: GlyphPosition,\n    glyphMap: {\n        [_: string]: {\n            [_: number]: StyleGlyph;\n        };\n    },\n    section: TextSectionOptions,\n    codePoint: number\n): GlyphPosition | null {\n    if (glyphPosition?.rect) {\n        return glyphPosition;\n    }\n\n    const glyphs = glyphMap[section.fontStack];\n    const glyph = glyphs?.[codePoint];\n    if (!glyph) return null;\n\n    const metrics = glyph.metrics;\n    return {rect: null, metrics};\n}\n\nfunction isLineVertical(\n    writingMode: WritingMode.horizontal | WritingMode.vertical,\n    allowVerticalPlacement: boolean,\n    codePoint: number\n): boolean {\n    return !(writingMode === WritingMode.horizontal ||\n        // Don't verticalize glyphs that have no upright orientation if vertical placement is disabled.\n        (!allowVerticalPlacement && !codePointHasUprightVerticalOrientation(codePoint)) ||\n        // If vertical placement is enabled, don't verticalize glyphs that\n        // are from complex text layout script, or whitespaces.\n        (allowVerticalPlacement && (charIsWhitespace(codePoint) || charInComplexShapingScript(codePoint))));\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: 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 = 0;\n\n    let maxLineLength = 0;\n    let maxLineHeight = 0;\n\n    const justify =\n        textJustify === 'right' ? 1 :\n            textJustify === 'left' ? 0 : 0.5;\n    const layoutTextSizeFactor = ONE_EM / layoutTextSizeThisZoom;\n\n    let lineIndex = 0;\n    for (const line of lines) {\n        line.trim();\n\n        const lineMaxScale = line.getMaxScale();\n        const positionedLine = {positionedGlyphs: [], lineOffset: 0};\n        shaping.positionedLines[lineIndex] = positionedLine;\n        const positionedGlyphs = positionedLine.positionedGlyphs;\n        let imageOffset = 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        const lineShapingSize = calculateLineContentSize(imagePositions, line, layoutTextSizeFactor);\n\n        let i = 0;\n        for (const char of line.text) {\n            const section = line.getSection(i);\n            const codePoint = char.codePointAt(0);\n            const vertical = isLineVertical(writingMode, allowVerticalPlacement, codePoint);\n            const positionedGlyph: PositionedGlyph = {\n                glyph: codePoint,\n                imageName: null,\n                x,\n                y: y + SHAPING_DEFAULT_OFFSET,\n                vertical,\n                scale: 1,\n                fontStack: '',\n                sectionIndex: line.getSectionIndex(i),\n                metrics: null,\n                rect: null\n            };\n\n            let sectionAttributes: ShapingSectionAttributes;\n            if ('fontStack' in section) {\n                sectionAttributes = shapeTextSection(section, codePoint, vertical, lineShapingSize, glyphMap, glyphPositions);\n                if (!sectionAttributes) continue;\n                positionedGlyph.fontStack = section.fontStack;\n            } else {\n                shaping.iconsInText = true;\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 *= layoutTextSizeFactor;\n\n                sectionAttributes = shapeImageSection(section, vertical, lineMaxScale, lineShapingSize, imagePositions);\n                if (!sectionAttributes) continue;\n                imageOffset = Math.max(imageOffset, sectionAttributes.imageOffset);\n                positionedGlyph.imageName = section.imageName;\n            }\n\n            const {rect, metrics, baselineOffset} = sectionAttributes;\n            positionedGlyph.y += baselineOffset;\n            positionedGlyph.scale = section.scale;\n            positionedGlyph.metrics = metrics;\n            positionedGlyph.rect = rect;\n            positionedGlyphs.push(positionedGlyph);\n\n            if (!vertical) {\n                x += metrics.advance * section.scale + spacing;\n            } else {\n                shaping.verticalizable = true;\n                const verticalAdvance = 'imageName' in section ? metrics.advance : ONE_EM;\n                x += verticalAdvance * section.scale + spacing;\n            }\n\n            i++;\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);\n        }\n\n        x = 0;\n        const maxLineOffset = (lineMaxScale - 1) * ONE_EM;\n        positionedLine.lineOffset = Math.max(imageOffset, maxLineOffset);\n        const currentLineHeight = lineHeight * lineMaxScale + imageOffset;\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 {horizontalAlign, verticalAlign} = getAnchorAlignment(textAnchor);\n    align(shaping.positionedLines, justify, horizontalAlign, verticalAlign, maxLineLength, maxLineHeight, lineHeight, y, lines.length);\n\n    // Calculate the bounding box\n    // shaping.top & shaping.left already include text offset (text-radial-offset or text-offset)\n    shaping.top += -verticalAlign * y;\n    shaping.bottom = shaping.top + y;\n    shaping.left += -horizontalAlign * maxLineLength;\n    shaping.right = shaping.left + maxLineLength;\n}\n\nfunction shapeTextSection(\n    section: TextSectionOptions,\n    codePoint: number,\n    vertical: boolean,\n    lineShapingSize: LineShapingSize,\n    glyphMap: {\n        [_: string]: {\n            [_: number]: StyleGlyph;\n        };\n    },\n    glyphPositions: {\n        [_: string]: {\n            [_: number]: GlyphPosition;\n        };\n    },\n): ShapingSectionAttributes | null {\n    const positions = glyphPositions[section.fontStack];\n    const glyphPosition = positions?.[codePoint];\n\n    const rectAndMetrics = getRectAndMetrics(glyphPosition, glyphMap, section, codePoint);\n\n    if (rectAndMetrics === null) return null;\n\n    let baselineOffset: number;\n    if (vertical) {\n        baselineOffset = lineShapingSize.verticalLineContentWidth - section.scale * ONE_EM;\n    } else {\n        const verticalAlignFactor = getVerticalAlignFactor(section.verticalAlign);\n        baselineOffset = (lineShapingSize.horizontalLineContentHeight - section.scale * ONE_EM) * verticalAlignFactor;\n    }\n\n    return {\n        rect: rectAndMetrics.rect,\n        metrics: rectAndMetrics.metrics,\n        baselineOffset\n    };\n}\n\nfunction shapeImageSection(\n    section: ImageSectionOptions,\n    vertical: boolean,\n    lineMaxScale: number,\n    lineShapingSize: LineShapingSize,\n    imagePositions: {[_: string]: ImagePosition},\n): ShapingSectionAttributes | null {\n    const imagePosition = imagePositions[section.imageName];\n    if (!imagePosition) return null;\n    const rect = imagePosition.paddedRect;\n    const size = imagePosition.displaySize;\n\n    const 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    let baselineOffset: number;\n    if (vertical) {\n        baselineOffset = lineShapingSize.verticalLineContentWidth - size[1] * section.scale;\n    } else {\n        const verticalAlignFactor = getVerticalAlignFactor(section.verticalAlign);\n        baselineOffset = (lineShapingSize.horizontalLineContentHeight - size[1] * section.scale) * verticalAlignFactor;\n    }\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 imageOffset = (vertical ? size[0] : size[1]) * section.scale - ONE_EM * lineMaxScale;\n    \n    return {rect, metrics, baselineOffset, imageOffset};\n}\n\n// justify right = 1, left = 0, center = 0.5\nfunction justifyLine(positionedGlyphs: PositionedGlyph[],\n    start: number,\n    end: number,\n    justify: 1 | 0 | 0.5) {\n    if (justify === 0)\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    }\n}\n\n/**\n * Aligns the lines based on horizontal and vertical alignment.\n */\nfunction align(positionedLines: 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 * lineHeight + 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 type 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        // transferable 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 {type SymbolLayoutPropsPossiblyEvaluated} from './symbol_style_layer_properties.g';\nimport type {SymbolLayoutProps} from './symbol_style_layer_properties.g';\nimport {type 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 '../array_types.g';\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 {VectorTileFeature} from '@mapbox/vector-tile';\nimport {verticalizedCharacterMap} from '../../util/verticalize_punctuation';\nimport {type 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 {getOverlapMode} from '../../style/style_layer/overlap_mode';\nimport type {CanonicalTileID} from '../../tile/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 '../../webgl/context';\nimport type {IndexBuffer} from '../../webgl/index_buffer';\nimport type {VertexBuffer} from '../../webgl/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 {VectorTileLayerLike} from '@maplibre/vt-pbf';\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: 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: 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: 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: SymbolStyleLayer[];\n    layerIds: string[];\n    stateDependentLayers: SymbolStyleLayer[];\n    stateDependentLayerIds: string[];\n\n    index: number;\n    sdfIcons: boolean;\n    iconsInText: boolean;\n    iconsNeedLinear: boolean;\n    bucketInstanceId: number;\n    justReloaded: boolean;\n    hasDependencies: boolean;\n\n    textSizeData: SizeData;\n    iconSizeData: SizeData;\n\n    glyphOffsetArray: GlyphOffsetArray;\n    lineVertexArray: SymbolLineVertexArray;\n    features: SymbolFeature[];\n    symbolInstances: SymbolInstanceArray;\n    textAnchorOffsets: TextAnchorOffsetArray;\n    collisionArrays: CollisionArrays[];\n    sortKeyRanges: SortKeyRange[];\n    pixelRatio: number;\n    tilePixelRatio: number;\n    compareText: {[_: string]: Point[]};\n    fadeStartTime: number;\n    sortFeaturesByKey: boolean;\n    sortFeaturesByY: boolean;\n    canOverlap: boolean;\n    sortedAngle: number;\n    featureSortOrder: number[];\n\n    collisionCircleArray: number[];\n\n    text: SymbolBuffers;\n    icon: SymbolBuffers;\n    textCollisionBox: CollisionBuffers;\n    iconCollisionBox: CollisionBuffers;\n    uploaded: boolean;\n    sourceLayerIndex: number;\n    sourceID: string;\n    symbolInstanceIndexes: 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.hasDependencies = false;\n        this.hasRTLText = false;\n        this.sortKeyRanges = [];\n\n        this.collisionCircleArray = [];\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 => property.startsWith('text')));\n        this.icon = new SymbolBuffers(new ProgramConfigurationSet(this.layers, this.zoom, property => property.startsWith('icon')));\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 (const char of text) {\n            stack[char.codePointAt(0)] = true;\n            if ((textAlongLine || allowVerticalPlacement) && doesAllowVerticalWritingMode) {\n                const verticalChar = verticalizedCharacterMap[char];\n                if (verticalChar) {\n                    stack[verticalChar.codePointAt(0)] = true;\n                }\n            }\n        }\n    }\n\n    populate(features: 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                this.hasRTLText ||= containsRTLText(formattedText);\n                if (\n                    !this.hasRTLText || // 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                    this.hasRTLText && 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: VectorTileFeature.types[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?.includes(WritingMode.vertical);\n                for (const section of text.sections) {\n                    if (!section.image) {\n                        const doesAllowVerticalWritingMode = allowsVerticalWritingMode(text.toString());\n                        const sectionFont = section.fontStack || fontStack;\n                        stacks[sectionFont] ||= {};\n                        this.calculateGlyphDependencies(section.text, stacks[sectionFont], 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 labeling.\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: VectorTileLayerLike, imagePositions: {[_: string]: ImagePosition}) {\n        if (!this.stateDependentLayers.length) return;\n        this.text.programConfigurations.updatePaintArrays(states, vtLayer, this.layers, {\n            imagePositions\n        });\n        this.icon.programConfigurations.updatePaintArrays(states, vtLayer, this.layers, {\n            imagePositions\n        });\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: Point[]) {\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: 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 + 2, index + 1);\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, {imagePositions: {}, canonical, formattedSection: 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 + 2, vertexIndex + 1);\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?.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            const textIndices = [\n                symbolInstance.rightJustifiedTextSymbolIndex,\n                symbolInstance.centerJustifiedTextSymbolIndex,\n                symbolInstance.leftJustifiedTextSymbolIndex\n            ];\n            for (let i = 0; i < textIndices.length; i++) {\n                const index = textIndices[i];\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 && textIndices.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: SymbolFeature[]): 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, NumberArray, ColorArray, 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<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<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 {type 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?.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, type SymbolFeature} from '../../data/bucket/symbol_bucket';\nimport {resolveTokens} from '../../util/resolve_tokens';\nimport properties, {type SymbolLayoutPropsPossiblyEvaluated, type SymbolPaintPropsPossiblyEvaluated} from './symbol_style_layer_properties.g';\n\nimport {\n    type Transitionable,\n    type Transitioning,\n    type Layout,\n    type PossiblyEvaluated,\n    PossiblyEvaluatedPropertyValue,\n    type 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 '../../tile/tile_id';\nimport {FormatSectionOverride} from '../format_section_override';\n\nexport const isSymbolStyleLayer = (layer: StyleLayer): layer is SymbolStyleLayer => layer.type === 'symbol';\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, globalState: Record<string, any>) {\n        super(layer, properties, globalState);\n    }\n\n    recalculate(parameters: EvaluationParameters, availableImages: 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.includes(m)) 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: 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?.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' || textField.value.kind === 'composite') {\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?.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, NumberArray, ColorArray, 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, {type BackgroundPaintPropsPossiblyEvaluated} from './background_style_layer_properties.g';\nimport {type Transitionable, type Transitioning, type PossiblyEvaluated} from '../properties';\n\nimport type {BackgroundPaintProps} from './background_style_layer_properties.g';\nimport type {LayerSpecification} from '@maplibre/maplibre-gl-style-spec';\n\nexport const isBackgroundStyleLayer = (layer: StyleLayer): layer is BackgroundStyleLayer => layer.type === 'background';\n\nexport class BackgroundStyleLayer extends StyleLayer {\n    _transitionablePaint: Transitionable<BackgroundPaintProps>;\n    _transitioningPaint: Transitioning<BackgroundPaintProps>;\n    paint: PossiblyEvaluated<BackgroundPaintProps, BackgroundPaintPropsPossiblyEvaluated>;\n\n    constructor(layer: LayerSpecification, globalState: Record<string, any>) {\n        super(layer, properties, globalState);\n    }\n}\n", "import {StyleLayer} from '../style_layer';\nimport type {Map} from '../../ui/map';\nimport {type mat4} from 'gl-matrix';\nimport {type LayerSpecification} from '@maplibre/maplibre-gl-style-spec';\nimport type {ProjectionData} from '../../geo/projection/projection_data';\n\n/**\n* Input arguments exposed by custom render function.\n*/\nexport type 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    /**\n     * Vertical field of view in radians.\n     */\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     * Data required for picking and compiling a custom shader for the current projection.\n     */\n    shaderData: {\n        /**\n         * Name of the shader variant that should be used.\n         * Depends on current projection.\n         * Whenever the other shader properties change, this string changes as well,\n         * and can be used as a key with which to cache compiled shaders.\n         */\n        variantName: string;\n        /**\n         * The prelude code to add to the vertex shader to access MapLibre's `projectTile` projection function.\n         * Depends on current projection.\n         * @example\n         * ```\n         * const vertexSource = `#version 300 es\n         * ${shaderData.vertexShaderPrelude}\n         * ${shaderData.define}\n         * in vec2 a_pos;\n         * void main() {\n         *     gl_Position = projectTile(a_pos);\n         * }`;\n         * ```\n         */\n        vertexShaderPrelude: string;\n        /**\n         * Defines to add to the shader code.\n         * Depends on current projection.\n         * @example\n         * ```\n         * const vertexSource = `#version 300 es\n         * ${shaderData.vertexShaderPrelude}\n         * ${shaderData.define}\n         * in vec2 a_pos;\n         * void main() {\n         *     gl_Position = projectTile(a_pos);\n         *     #ifdef GLOBE\n         *     // Do globe-specific things\n         *     #endif\n         * }`;\n         * ```\n         */\n        define: string;\n    };\n    /**\n     * Uniforms that should be passed to the vertex shader, if MapLibre's projection code is used.\n     * For more details of this object's internals, see its doc comments in `src/geo/projection/projection_data.ts`.\n     *\n     * These uniforms are set so that `projectTile` in shader accepts a vec2 in range 0..1 in web mercator coordinates.\n     * Use `map.transform.getProjectionData({overscaledTileID: tileID})` to get uniforms for a given tile and pass vec2 in tile-local range 0..EXTENT instead.\n     *\n     * For projection 3D features, use `projectTileFor3D` in the shader.\n     *\n     * If you just need a projection matrix, use `defaultProjectionData.projectionMatrix`.\n     * A projection matrix is sufficient for simple custom layers that also only support mercator projection.\n     *\n     * Under mercator projection, when these uniforms are used, the shader's `projectTile` function 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     *\n     * Under globe projection, when these uniforms are used, the `elevation` parameter\n     * passed to `projectTileFor3D` in the shader is elevation in meters above \"sea level\",\n     * or more accurately for globe, elevation above the surface of the perfect sphere used to render the planet.\n     */\n    defaultProjectionData: ProjectionData;\n};\n\n/**\n * @param gl - The map's gl context.\n * @param options - Argument object with render inputs like camera properties.\n */\nexport type CustomRenderMethod = (gl: WebGLRenderingContext|WebGL2RenderingContext, 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: maplibregl.Map, gl: WebGLRenderingContext | WebGL2RenderingContext) {\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({\n *      gl,\n *      modelViewProjectionMatrix: matrix\n *      }: {\n *      gl: WebGLRenderingContext | WebGL2RenderingContext;\n *      modelViewProjectionMatrix: Float32Array;\n *      }) {\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 const isCustomStyleLayer = (layer: StyleLayer): layer is CustomStyleLayer => layer.type === 'custom';\n\nexport class CustomStyleLayer extends StyleLayer {\n\n    implementation: CustomLayerInterface;\n\n    constructor(implementation: CustomLayerInterface, globalState: Record<string, any>) {\n        super(implementation, {}, globalState);\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 | undefined;\n    _triggered: boolean;\n    _methodToThrottle: Function;\n\n    constructor(methodToThrottle: Function) {\n        this._methodToThrottle = methodToThrottle;\n        this._triggered = false;\n        this._channel = new MessageChannel();\n        this._channel.port2.onmessage = () => {\n            this._triggered = false;\n            this._methodToThrottle();\n        };\n    }\n\n    trigger() {\n        if (this._triggered) {\n            return;\n        }\n        this._triggered = true;\n        this._channel?.port1.postMessage(true);\n    }\n\n    remove() {\n        delete this._channel;\n        this._methodToThrottle = () => {};\n    }\n}\n", "import {type Subscription, ensureError, isWorker, subscribe} from './util';\nimport {serialize, deserialize, type Serialized} from './web_worker_transfer';\nimport {ThrottledInvoker} from './throttled_invoker';\n\nimport {\n    type MessageType,\n    type ActorMessage,\n    type RequestResponseMessageMap,\n} 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\nconst addEventDefaultOptions: AddEventListenerOptions = {once: true};\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: string[];\n    abortControllers: { [x: number | string]: AbortController };\n    invoker: ThrottledInvoker;\n    globalScope: ActorTarget;\n    messageHandlers: { [K in MessageType]?: MessageHandler<K>};\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 as Record<T, MessageHandler<T>>)[type] = handler;\n    }\n\n    unregisterMessageHandler<T extends MessageType>(type: T) {\n        delete this.messageHandlers[type];\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\n            const subscription =  abortController ? subscribe(abortController.signal, 'abort', () => {\n                subscription?.unsubscribe();\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            }, addEventDefaultOptions) : null;\n\n            this.resolveRejects[id] = {\n                resolve: (value) => {\n                    subscription?.unsubscribe();\n                    resolve(value);\n                },\n                reject: (reason) => {\n                    subscription?.unsubscribe();\n                    reject(reason);\n                }\n            };\n\n            const buffers: 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\n        const SPECIAL_ORIGINS = ['file://', 'resource://android', 'null'];\n        const origins = [data.origin, location.origin];\n\n        const isSameOrigin = data.origin === location.origin;\n        const hasSpecialOrigin = origins.some((origin) => SPECIAL_ORIGINS.includes(origin));\n\n        // Ignore cross-origin messages except for special origins.\n        if (!isSameOrigin && !hasSpecialOrigin) {\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(ensureError(deserialize(task.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, ensureError(err));\n        }\n    }\n\n    completeTask(id: string, err: Error, data?: RequestResponseMessageMap[MessageType][1]) {\n        const buffers: 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 {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/get-coordinates-of-the-mouse-pointer/)\n */\nexport class LngLat {\n    /**\n     * Longitude, measured in degrees.\n     */\n    lng: number;\n\n    /**\n     * Latitude, measured in degrees.\n     */\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        return earthRadius * Math.acos(Math.min(a, 1));\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 {type 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/add-a-custom-style-layer/)\n * @see [Add a 3D model using three.js](https://maplibre.org/maplibre-gl-js/docs/examples/add-a-3d-model-using-threejs/)\n * @see [Add a simple custom layer on a globe](https://maplibre.org/maplibre-gl-js/docs/examples/add-a-simple-custom-layer-on-a-globe/)\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 {type mat4} from 'gl-matrix';\nimport {type ICanonicalTileID, type 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 = calculateTileKey(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    /**\n     * given a list of urls, choose a url template and return a tile URL\n     */\n    url(urls: 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 = calculateTileKey(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    /**\n     * This matrix is used during terrain's render-to-texture stage only.\n     * If the render-to-texture stage is active, this matrix will be present\n     * and should be used, otherwise this matrix will be null.\n     * The matrix should be float32 in order to avoid slow WebGL calls in Chrome.\n     */\n    terrainRttPosMatrix32f: mat4 | null = null;\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 = calculateTileKey(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    /**\n     * Returns a new `OverscaledTileID` representing the tile at the target zoom level.\n     * When targetZ is greater than the current canonical z, the canonical coordinates are unchanged.\n     * When targetZ is less than the current canonical z, the canonical coordinates are updated.\n     * @param targetZ - the zoom level to scale to. Must be less than or equal to this.overscaledZ\n     * @returns a new OverscaledTileID representing the tile at the target zoom level\n     * @throws if targetZ is greater than this.overscaledZ\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    isOverscaled() {\n        return (this.overscaledZ > this.canonical.z);\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 calculateTileKey(this.wrap * +withWrap, targetZ, this.canonical.z, this.canonical.x, this.canonical.y);\n        } else {\n            return calculateTileKey(this.wrap * +withWrap, targetZ, targetZ, this.canonical.x >> zDifference, this.canonical.y >> zDifference);\n        }\n    }\n\n    isChildOf(parent: OverscaledTileID): boolean {\n        if (parent.wrap !== this.wrap) return false; // different world copy\n\n        const zDifference = this.overscaledZ - parent.overscaledZ;\n        if (zDifference <= 0) return false; // must be deeper zoom\n\n        //special case for root tile (bitwise math doesn't work for root)\n        if (parent.overscaledZ === 0) return this.overscaledZ > 0;\n\n        const dz = this.canonical.z - parent.canonical.z;\n        if (dz < 0) return false; // parent can't be deeper canonically\n\n        return (\n            parent.canonical.x === (this.canonical.x >> dz) &&\n            parent.canonical.y === (this.canonical.y >> dz)\n        );\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        return this.canonical.y < rhs.canonical.y;\n\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    /**\n     * Maps tile-local coordinates that may fall outside the `[0, extent)` range\n     * to the correct neighbor tile and the corresponding in-tile position.\n     *\n     * Coordinates can exceed tile bounds when geometry (e.g. symbol labels along\n     * lines) extends across tile edges. This method resolves such coordinates to\n     * the appropriate adjacent tile, wrapping horizontally across world boundaries\n     * and returning `null` when the target falls beyond the polar tile-grid limits.\n     *\n     * When the coordinates are already in bounds, the original tile ID is returned.\n     *\n     * @param x - x coordinate relative to this tile, may be outside `[0, extent)`\n     * @param y - y coordinate relative to this tile, may be outside `[0, extent)`\n     * @param extent - tile coordinate extent, default {@link EXTENT}\n     * @returns the resolved tile ID and in-tile coordinates, or `null` if the\n     *          target is beyond the tile grid (e.g. past the poles)\n     */\n    normalizeCoordinates(x: number, y: number, extent: number = EXTENT): {tileID: OverscaledTileID; x: number; y: number} | null {\n        if (x >= 0 && x < extent && y >= 0 && y < extent) {\n            return {tileID: this, x, y};\n        }\n\n        const tileOffsetX = Math.floor(x / extent);\n        const tileOffsetY = Math.floor(y / extent);\n        const newX = x - tileOffsetX * extent;\n        const newY = y - tileOffsetY * extent;\n\n        const z = this.canonical.z;\n        const dim = 1 << z;\n        const newCanonicalY = this.canonical.y + tileOffsetY;\n\n        if (newCanonicalY < 0 || newCanonicalY >= dim) return null;\n\n        let newCanonicalX = this.canonical.x + tileOffsetX;\n        let newWrap = this.wrap;\n        if (newCanonicalX < 0) {\n            newWrap -= Math.ceil(-newCanonicalX / dim);\n            newCanonicalX = ((newCanonicalX % dim) + dim) % dim;\n        } else if (newCanonicalX >= dim) {\n            newWrap += Math.floor(newCanonicalX / dim);\n            newCanonicalX = newCanonicalX % dim;\n        }\n\n        return {\n            tileID: new OverscaledTileID(this.overscaledZ, newWrap, z, newCanonicalX, newCanonicalY),\n            x: newX,\n            y: newY,\n        };\n    }\n}\n\nexport function calculateTileKey(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:number, x:number, y:number): string {\n    let quadkey = '';\n    for (let i = z; i > 0; i--) {\n        const mask = 1 << (i - 1);\n        quadkey += ((x & mask ? 1 : 0) + (y & mask ? 2 : 0));\n    }\n    return quadkey;\n}\n\nexport function 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\nregister('CanonicalTileID', CanonicalTileID);\nregister('OverscaledTileID', OverscaledTileID, {omit: ['terrainRttPosMatrix32f']});\n", "import {MAX_TILE_ZOOM, MIN_TILE_ZOOM} from './util';\nimport {type 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 Point from '@mapbox/point-geometry';\nimport {type Point2D} from '@maplibre/maplibre-gl-style-spec';\n\nexport interface ReadOnlyBounds {\n    readonly minX: number;\n    readonly maxX: number;\n    readonly minY: number;\n    readonly maxY: number;\n\n    /**\n     * Returns whether this bounding box contains a point\n     *\n     * @param point - The point to check\n     * @returns True if this bounding box contains point, false otherwise.\n     */\n    contains(point: Point2D): boolean;\n\n    /**\n     * Returns true if this bounding box contains no points\n     *\n     * @returns True if this bounding box contains no points.\n     */\n    empty(): boolean;\n\n    /**\n     * Returns the width of this bounding box.\n     *\n     * @returns `maxX - minX`.\n     */\n    width(): number;\n\n    /**\n     * Returns the height of this bounding box.\n     *\n     * @returns `maxY - minY`.\n     */\n    height(): number;\n\n    /**\n     * Returns true if this bounding box completely covers `other`.\n     *\n     * @param other - The other bounding box\n     * @returns True if this bounding box completely encloses `other`\n     */\n    covers(other: ReadOnlyBounds): boolean;\n\n    /**\n     * Returns true if this bounding box touches any part of `other`.\n     *\n     * @param other - The other bounding box\n     * @returns True if this bounding box touches any part of `other`.\n     */\n    intersects(other: ReadOnlyBounds): boolean;\n}\n\n/** A 2-d bounding box covering an X and Y range. */\nexport class Bounds implements ReadOnlyBounds {\n    minX: number = Infinity;\n    maxX: number = -Infinity;\n    minY: number = Infinity;\n    maxY: number = -Infinity;\n\n    /**\n     * Expands this bounding box to include point.\n     *\n     * @param point - The point to include in this bounding box\n     * @returns This mutated bounding box\n     */\n    extend(point: Point2D): this {\n        this.minX = Math.min(this.minX, point.x);\n        this.minY = Math.min(this.minY, point.y);\n        this.maxX = Math.max(this.maxX, point.x);\n        this.maxY = Math.max(this.maxY, point.y);\n        return this;\n    }\n\n    /**\n     * Expands this bounding box by a fixed amount in each direction.\n     *\n     * @param amount - The amount to expand the box by, or contract if negative\n     * @returns This mutated bounding box\n     */\n    expandBy(amount: number): this {\n        this.minX -= amount;\n        this.minY -= amount;\n        this.maxX += amount;\n        this.maxY += amount;\n        // check if bounds collapsed in either dimension\n        if (this.minX > this.maxX || this.minY > this.maxY) {\n            this.minX = Infinity;\n            this.maxX = -Infinity;\n            this.minY = Infinity;\n            this.maxY = -Infinity;\n        }\n        return this;\n    }\n\n    /**\n     * Shrinks this bounding box by a fixed amount in each direction.\n     *\n     * @param amount - The amount to shrink the box by\n     * @returns This mutated bounding box\n     */\n    shrinkBy(amount: number): this {\n        return this.expandBy(-amount);\n    }\n\n    /**\n     * Returns a new bounding box that contains all of the corners of this bounding\n     * box with a transform applied. Does not modify this bounding box.\n     *\n     * @param fn - The function to apply to each corner\n     * @returns A new bounding box containing all of the mapped points.\n     */\n    map(fn: (point: Point) => Point2D): Bounds {\n        const result = new Bounds();\n        result.extend(fn(new Point(this.minX, this.minY)));\n        result.extend(fn(new Point(this.maxX, this.minY)));\n        result.extend(fn(new Point(this.minX, this.maxY)));\n        result.extend(fn(new Point(this.maxX, this.maxY)));\n        return result;\n    }\n\n    /**\n     * Creates a new bounding box that includes all points provided.\n     *\n     * @param points - The points to include inside the bounding box\n     * @returns The new bounding box\n     */\n    static fromPoints(points: Point2D[]): Bounds {\n        const result = new Bounds();\n        for (const p of points) {\n            result.extend(p);\n        }\n        return result;\n    }\n\n    contains(point: Point2D): boolean {\n        return point.x >= this.minX && point.x <= this.maxX && point.y >= this.minY && point.y <= this.maxY;\n    }\n\n    empty(): boolean {\n        return this.minX > this.maxX;\n    }\n\n    width(): number {\n        return this.maxX - this.minX;\n    }\n\n    height(): number {\n        return this.maxY - this.minY;\n    }\n\n    covers(other: ReadOnlyBounds) {\n        return !this.empty() && !other.empty() &&\n            other.minX >= this.minX &&\n            other.maxX <= this.maxX &&\n            other.minY >= this.minY &&\n            other.maxY <= this.maxY;\n    }\n\n    intersects(other: ReadOnlyBounds) {\n        return !this.empty() && !other.empty() &&\n            other.minX <= this.maxX &&\n            other.maxX >= this.minX &&\n            other.minY <= this.maxY &&\n            other.maxY >= this.minY;\n    }\n}\n", "export class DictionaryCoder {\n    _stringToNumber: {[_: string]: number};\n    _numberToString: string[];\n\n    constructor(strings: 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 Point from '@mapbox/point-geometry';\nimport {classifyRings} from '@mapbox/vector-tile';\nimport type {LayerSpecification} from '@maplibre/maplibre-gl-style-spec';\nimport type {VectorTileFeatureLike} from '@maplibre/vt-pbf';\n\n/**\n * A helper for type to omit a property from a type\n */\nexport type DistributiveKeys<T> = T extends T ? keyof T : never;\n/**\n * A helper for type to omit a property from a type\n */\nexport type 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    _x: number;\n    _y: number;\n    _z: number;\n\n    _vectorTileFeature: VectorTileFeatureLike;\n\n    constructor(vectorTileFeature: VectorTileFeatureLike, z: number, x: number, y: number, id: string | number | undefined) {\n        this.type = 'Feature';\n        this._vectorTileFeature = vectorTileFeature;\n        this._x = x;\n        this._y = y;\n        this._z = z;\n\n        this.properties = vectorTileFeature.properties;\n        this.id = id;\n    }\n\n    private projectPoint(p: Point, x0: number, y0: number, size: number): [number, number] {\n        return [\n            (p.x + x0) * 360 / size - 180,\n            360 / Math.PI * Math.atan(Math.exp((1 - (p.y + y0) * 2 / size) * Math.PI)) - 90\n        ];\n    }\n\n    private projectLine(line: Point[], x0: number, y0: number, size: number) {\n        return line.map(p => this.projectPoint(p, x0, y0, size));\n    }\n\n    get geometry(): GeoJSON.Geometry {\n        if (this._geometry) return this._geometry;\n\n        const feature = this._vectorTileFeature;\n\n        // Copied from https://github.com/mapbox/vector-tile-js/blob/f1457ee47d0a261e6246d68c959fbd12bf56aeeb/index.js\n        const size = feature.extent * Math.pow(2, this._z);\n        const x0 = feature.extent * this._x;\n        const y0 = feature.extent * this._y;\n        const vtCoords = feature.loadGeometry();\n\n        switch (feature.type) {\n            case 1: {\n                const points = [];\n                for (const line of vtCoords) {\n                    points.push(line[0]);\n                }\n                const coordinates = this.projectLine(points, x0, y0, size);\n                this._geometry = points.length === 1 ?\n                    {type: 'Point', coordinates: coordinates[0]} :\n                    {type: 'MultiPoint', coordinates};\n                break;\n            }\n            case 2: {\n                const coordinates = vtCoords.map(coord => this.projectLine(coord, x0, y0, size));\n                this._geometry = coordinates.length === 1 ?\n                    {type: 'LineString', coordinates: coordinates[0]} :\n                    {type: 'MultiLineString', coordinates};\n                break;\n            }\n            case 3: {\n                const polygons = classifyRings(vtCoords);\n                const coordinates = [];\n                for (const polygon of polygons) {\n                    coordinates.push(polygon.map(coord => this.projectLine(coord, x0, y0, size)));\n                }\n                this._geometry = coordinates.length === 1 ?\n                    {type: 'Polygon', coordinates: coordinates[0]} :\n                    {type: 'MultiPolygon', coordinates};\n                break;\n            }\n            default:\n                throw new Error(`unknown feature type: ${feature.type}`);\n        }\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' || i === '_x' || i === '_y' || i === '_z') continue;\n            json[i] = (this)[i];\n        }\n        return json;\n    }\n}\n", "export default class Vector {\n    constructor(_name, dataBuffer, sizeOrNullabilityBuffer) {\n        this._name = _name;\n        this.dataBuffer = dataBuffer;\n        if (typeof sizeOrNullabilityBuffer === \"number\") {\n            this._size = sizeOrNullabilityBuffer;\n        }\n        else {\n            this.nullabilityBuffer = sizeOrNullabilityBuffer;\n            this._size = sizeOrNullabilityBuffer.size();\n        }\n    }\n    getValue(index) {\n        return this.nullabilityBuffer && !this.nullabilityBuffer.get(index) ? null : this.getValueFromBuffer(index);\n    }\n    has(index) {\n        return this.nullabilityBuffer?.get(index) || !this.nullabilityBuffer;\n    }\n    get name() {\n        return this._name;\n    }\n    get size() {\n        return this._size;\n    }\n}\n//# sourceMappingURL=vector.js.map", "import Vector from \"./vector\";\nexport class FixedSizeVector extends Vector {\n}\n//# sourceMappingURL=fixedSizeVector.js.map", "import { FixedSizeVector } from \"../fixedSizeVector\";\nexport class Int32FlatVector extends FixedSizeVector {\n    getValueFromBuffer(index) {\n        return this.dataBuffer[index];\n    }\n}\n//# sourceMappingURL=int32FlatVector.js.map", "import { FixedSizeVector } from \"../fixedSizeVector\";\nexport class DoubleFlatVector extends FixedSizeVector {\n    getValueFromBuffer(index) {\n        return this.dataBuffer[index];\n    }\n}\n//# sourceMappingURL=doubleFlatVector.js.map", "import Vector from \"../vector\";\nexport class SequenceVector extends Vector {\n    constructor(name, baseValueBuffer, delta, size) {\n        super(name, baseValueBuffer, size);\n        this.delta = delta;\n    }\n}\n//# sourceMappingURL=sequenceVector.js.map", "import { SequenceVector } from \"./sequenceVector\";\nexport class Int32SequenceVector extends SequenceVector {\n    constructor(name, baseValue, delta, size) {\n        super(name, Int32Array.of(baseValue), delta, size);\n    }\n    getValueFromBuffer(index) {\n        return this.dataBuffer[0] + index * this.delta;\n    }\n}\n//# sourceMappingURL=int32SequenceVector.js.map", "import Vector from \"../vector\";\nexport class Int32ConstVector extends Vector {\n    constructor(name, value, sizeOrNullabilityBuffer, isSigned) {\n        super(name, isSigned ? Int32Array.of(value) : Uint32Array.of(value), sizeOrNullabilityBuffer);\n    }\n    getValueFromBuffer(_index) {\n        return this.dataBuffer[0];\n    }\n}\n//# sourceMappingURL=int32ConstVector.js.map", "import { Int32FlatVector } from \"./flat/int32FlatVector\";\nimport { DoubleFlatVector } from \"./flat/doubleFlatVector\";\nimport { Int32SequenceVector } from \"./sequence/int32SequenceVector\";\nimport { Int32ConstVector } from \"./constant/int32ConstVector\";\nexport default class FeatureTable {\n    constructor(_name, _geometryVector, _idVector, _propertyVectors, _extent = 4096) {\n        this._name = _name;\n        this._geometryVector = _geometryVector;\n        this._idVector = _idVector;\n        this._propertyVectors = _propertyVectors;\n        this._extent = _extent;\n    }\n    get name() {\n        return this._name;\n    }\n    get idVector() {\n        return this._idVector;\n    }\n    get geometryVector() {\n        return this._geometryVector;\n    }\n    get propertyVectors() {\n        return this._propertyVectors;\n    }\n    getPropertyVector(name) {\n        if (!this.propertyVectorsMap) {\n            this.propertyVectorsMap = new Map(this._propertyVectors.map((vector) => [vector.name, vector]));\n        }\n        return this.propertyVectorsMap.get(name);\n    }\n    get numFeatures() {\n        return this.geometryVector.numGeometries;\n    }\n    get extent() {\n        return this._extent;\n    }\n    /**\n     * Returns all features as an array\n     */\n    getFeatures() {\n        const features = [];\n        const geometries = this.geometryVector.getGeometries();\n        for (let i = 0; i < this.numFeatures; i++) {\n            let id;\n            if (this.idVector) {\n                const idValue = this.idVector.getValue(i);\n                id = this.containsMaxSafeIntegerValues(this.idVector) && idValue !== null ? Number(idValue) : idValue;\n            }\n            const geometry = {\n                coordinates: geometries[i],\n                type: this.geometryVector.geometryType(i),\n            };\n            const properties = {};\n            for (const propertyColumn of this.propertyVectors) {\n                if (!propertyColumn)\n                    continue;\n                const columnName = propertyColumn.name;\n                const propertyValue = propertyColumn.getValue(i);\n                if (propertyValue !== null) {\n                    properties[columnName] = propertyValue;\n                }\n            }\n            features.push({ id, geometry, properties });\n        }\n        return features;\n    }\n    containsMaxSafeIntegerValues(idVector) {\n        return (idVector instanceof Int32FlatVector ||\n            idVector instanceof Int32ConstVector ||\n            idVector instanceof Int32SequenceVector ||\n            idVector instanceof DoubleFlatVector);\n    }\n}\n//# sourceMappingURL=featureTable.js.map", "// Ported from https://github.com/lemire/JavaFastPFOR/blob/master/src/main/java/me/lemire/integercompression/IntWrapper.java\nexport default class IntWrapper {\n    constructor(value) {\n        this.value = value;\n    }\n    get() {\n        return this.value;\n    }\n    set(v) {\n        this.value = v;\n    }\n    increment() {\n        return this.value++;\n    }\n    add(v) {\n        this.value += v;\n    }\n}\n//# sourceMappingURL=intWrapper.js.map", "export var LogicalLevelTechnique;\n(function (LogicalLevelTechnique) {\n    LogicalLevelTechnique[\"NONE\"] = \"NONE\";\n    LogicalLevelTechnique[\"DELTA\"] = \"DELTA\";\n    LogicalLevelTechnique[\"COMPONENTWISE_DELTA\"] = \"COMPONENTWISE_DELTA\";\n    LogicalLevelTechnique[\"RLE\"] = \"RLE\";\n    LogicalLevelTechnique[\"MORTON\"] = \"MORTON\";\n    // Pseudodecimal Encoding of floats -> only for the exponent integer part an additional logical level technique is used.\n    // Both exponent and significant parts are encoded with the same physical level technique\n    LogicalLevelTechnique[\"PDE\"] = \"PDE\";\n})(LogicalLevelTechnique || (LogicalLevelTechnique = {}));\n//# sourceMappingURL=logicalLevelTechnique.js.map", "export var PhysicalLevelTechnique;\n(function (PhysicalLevelTechnique) {\n    PhysicalLevelTechnique[\"NONE\"] = \"NONE\";\n    /**\n     * Preferred option, tends to produce the best compression ratio and decoding performance.\n     * But currently only limited to 32 bit integer.\n     */\n    PhysicalLevelTechnique[\"FAST_PFOR\"] = \"FAST_PFOR\";\n    /**\n     * Can produce better results in combination with a heavyweight compression scheme like Gzip.\n     * Simple compression scheme where the decoder are easier to implement compared to FastPfor.\n     */\n    PhysicalLevelTechnique[\"VARINT\"] = \"VARINT\";\n    /**\n     * Adaptive Lossless floating-Point Compression\n     */\n    PhysicalLevelTechnique[\"ALP\"] = \"ALP\";\n})(PhysicalLevelTechnique || (PhysicalLevelTechnique = {}));\n//# sourceMappingURL=physicalLevelTechnique.js.map", "/**\n * Bit masks for each bitwidth 0-32.\n * DO NOT MUTATE - this is a shared constant.\n */\nconst masks = new Uint32Array(33);\nmasks[0] = 0;\nfor (let bitWidth = 1; bitWidth <= 32; bitWidth++) {\n    masks[bitWidth] = bitWidth === 32 ? 0xffffffff : 0xffffffff >>> (32 - bitWidth);\n}\nexport const MASKS = masks;\nexport const DEFAULT_PAGE_SIZE = 65536;\nexport const BLOCK_SIZE = 256;\nexport function greatestMultiple(value, factor) {\n    return value - (value % factor);\n}\nexport function roundUpToMultipleOf32(value) {\n    return greatestMultiple(value + 31, 32);\n}\nexport function normalizePageSize(pageSize) {\n    if (!Number.isFinite(pageSize) || pageSize <= 0)\n        return DEFAULT_PAGE_SIZE;\n    const aligned = greatestMultiple(Math.floor(pageSize), BLOCK_SIZE);\n    return aligned === 0 ? BLOCK_SIZE : aligned;\n}\nexport function bswap32(value) {\n    const x = value >>> 0;\n    return (((x & 0xff) << 24) | ((x & 0xff00) << 8) | ((x >>> 8) & 0xff00) | ((x >>> 24) & 0xff)) >>> 0;\n}\n//# sourceMappingURL=fastPforShared.js.map", "import { MASKS, DEFAULT_PAGE_SIZE, BLOCK_SIZE, greatestMultiple, roundUpToMultipleOf32, normalizePageSize, } from \"./fastPforShared\";\nimport { fastUnpack32_2, fastUnpack32_3, fastUnpack32_4, fastUnpack32_5, fastUnpack32_6, fastUnpack32_7, fastUnpack32_8, fastUnpack32_9, fastUnpack32_10, fastUnpack32_11, fastUnpack32_12, fastUnpack32_16, fastUnpack256_1, fastUnpack256_2, fastUnpack256_3, fastUnpack256_4, fastUnpack256_5, fastUnpack256_6, fastUnpack256_7, fastUnpack256_8, fastUnpack256_16, fastUnpack256_Generic, } from \"./fastPforUnpack\";\nconst MAX_BIT_WIDTH = 32;\nconst BIT_WIDTH_SLOTS = MAX_BIT_WIDTH + 1;\nconst PAGE_SIZE = normalizePageSize(DEFAULT_PAGE_SIZE);\nconst BYTE_CONTAINER_SIZE = ((3 * PAGE_SIZE) / BLOCK_SIZE + PAGE_SIZE) | 0;\n/**\n * Creates an isolated workspace for decoding.\n * Reusing a workspace across calls avoids repeated allocations.\n */\nexport function createDecoderWorkspace() {\n    const byteContainer = new Uint8Array(BYTE_CONTAINER_SIZE);\n    return {\n        dataToBePacked: new Array(BIT_WIDTH_SLOTS),\n        dataPointers: new Int32Array(BIT_WIDTH_SLOTS),\n        byteContainer,\n        byteContainerI32: new Int32Array(byteContainer.buffer, byteContainer.byteOffset, byteContainer.byteLength >>> 2),\n        exceptionSizes: new Int32Array(BIT_WIDTH_SLOTS),\n    };\n}\nexport function createFastPforWireDecodeWorkspace(initialEncodedWordCapacity = 16) {\n    if (initialEncodedWordCapacity < 0) {\n        throw new RangeError(`initialEncodedWordCapacity must be >= 0, got ${initialEncodedWordCapacity}`);\n    }\n    const capacity = Math.max(16, initialEncodedWordCapacity | 0);\n    return {\n        encodedWords: new Uint32Array(capacity),\n        decoderWorkspace: createDecoderWorkspace(),\n    };\n}\nexport function ensureFastPforWireEncodedWordsCapacity(workspace, requiredWordCount) {\n    if (requiredWordCount <= workspace.encodedWords.length)\n        return workspace.encodedWords;\n    const next = new Uint32Array(Math.max(16, requiredWordCount * 2));\n    workspace.encodedWords = next;\n    return next;\n}\nfunction materializeByteContainer(inValues, byteContainerStart, byteSize, workspace) {\n    if (workspace.byteContainer.length < byteSize) {\n        workspace.byteContainer = new Uint8Array(byteSize * 2);\n        workspace.byteContainerI32 = undefined;\n    }\n    const byteContainer = workspace.byteContainer;\n    const numFullInts = byteSize >>> 2;\n    if ((byteContainer.byteOffset & 3) === 0) {\n        let intView = workspace.byteContainerI32;\n        if (!intView ||\n            intView.buffer !== byteContainer.buffer ||\n            intView.byteOffset !== byteContainer.byteOffset ||\n            intView.length < numFullInts) {\n            intView = workspace.byteContainerI32 = new Int32Array(byteContainer.buffer, byteContainer.byteOffset, byteContainer.byteLength >>> 2);\n        }\n        intView.set(inValues.subarray(byteContainerStart, byteContainerStart + numFullInts));\n    }\n    else {\n        for (let i = 0; i < numFullInts; i = (i + 1) | 0) {\n            const val = inValues[(byteContainerStart + i) | 0] | 0;\n            const base = i << 2;\n            byteContainer[base] = val & 0xff;\n            byteContainer[(base + 1) | 0] = (val >>> 8) & 0xff;\n            byteContainer[(base + 2) | 0] = (val >>> 16) & 0xff;\n            byteContainer[(base + 3) | 0] = (val >>> 24) & 0xff;\n        }\n    }\n    const remainder = byteSize & 3;\n    if (remainder > 0) {\n        const lastIntIdx = (byteContainerStart + numFullInts) | 0;\n        const lastVal = inValues[lastIntIdx] | 0;\n        const base = numFullInts << 2;\n        for (let r = 0; r < remainder; r = (r + 1) | 0) {\n            byteContainer[(base + r) | 0] = (lastVal >>> (r << 3)) & 0xff;\n        }\n    }\n    return byteContainer;\n}\n/**\n * Unpacks the per-bitWidth \"exception streams\" described by the page's bitmap.\n *\n * @remarks\n * For each bit-width present in the bitmap, a stream header gives the count of outlier values for that\n * bit-width, followed by packed bits representing those values.\n *\n * @param inValues - Packed input (32-bit words).\n * @param inExcept - Offset (32-bit word index) where the exception bitmap starts.\n * @param workspace - Decoder workspace used to store the unpacked exception streams.\n * @returns The new input offset (32-bit word index) after consuming all exception streams.\n */\nfunction unpackExceptionStreams(inValues, inExcept, workspace) {\n    const bitmap = inValues[inExcept++] | 0;\n    const dataToBePacked = workspace.dataToBePacked;\n    for (let bitWidth = 2; bitWidth <= MAX_BIT_WIDTH; bitWidth = (bitWidth + 1) | 0) {\n        if (((bitmap >>> (bitWidth - 1)) & 1) === 0)\n            continue;\n        if (inExcept >= inValues.length) {\n            throw new Error(`FastPFOR decode: truncated exception stream header (bitWidth=${bitWidth}, streamWordIndex=${inExcept}, needWords=1, availableWords=${inValues.length - inExcept}, encodedWords=${inValues.length})`);\n        }\n        const size = inValues[inExcept++] >>> 0;\n        const roundedUp = roundUpToMultipleOf32(size);\n        const wordsNeeded = (size * bitWidth + 31) >>> 5;\n        if (inExcept + wordsNeeded > inValues.length) {\n            throw new Error(`FastPFOR decode: truncated exception stream (bitWidth=${bitWidth}, size=${size}, streamWordIndex=${inExcept}, needWords=${wordsNeeded}, availableWords=${inValues.length - inExcept}, encodedWords=${inValues.length})`);\n        }\n        let exceptionStream = dataToBePacked[bitWidth];\n        if (!exceptionStream || exceptionStream.length < roundedUp) {\n            exceptionStream = dataToBePacked[bitWidth] = new Uint32Array(roundedUp);\n        }\n        let j = 0;\n        for (; j < size; j = (j + 32) | 0) {\n            fastUnpack32(inValues, inExcept, exceptionStream, j, bitWidth);\n            inExcept = (inExcept + bitWidth) | 0;\n        }\n        const overflow = (j - size) | 0;\n        inExcept = (inExcept - ((overflow * bitWidth) >>> 5)) | 0;\n        workspace.exceptionSizes[bitWidth] = size;\n    }\n    return inExcept;\n}\n/**\n * Unpacks one 256-value block from the packed bitstream using a specialized implementation for common widths.\n *\n * @param inValues - Packed input (32-bit words).\n * @param inPos - Input offset (32-bit word index) where the packed block starts.\n * @param out - Output buffer.\n * @param outPos - Output offset where the 256 values will be written.\n * @param bitWidth - Base bit-width used for this block.\n * @returns The new input offset (32-bit word index) right after the packed block data.\n */\nfunction unpackBlock256(inValues, inPos, out, outPos, bitWidth) {\n    switch (bitWidth) {\n        case 1:\n            fastUnpack256_1(inValues, inPos, out, outPos);\n            break;\n        case 2:\n            fastUnpack256_2(inValues, inPos, out, outPos);\n            break;\n        case 3:\n            fastUnpack256_3(inValues, inPos, out, outPos);\n            break;\n        case 4:\n            fastUnpack256_4(inValues, inPos, out, outPos);\n            break;\n        case 5:\n            fastUnpack256_5(inValues, inPos, out, outPos);\n            break;\n        case 6:\n            fastUnpack256_6(inValues, inPos, out, outPos);\n            break;\n        case 7:\n            fastUnpack256_7(inValues, inPos, out, outPos);\n            break;\n        case 8:\n            fastUnpack256_8(inValues, inPos, out, outPos);\n            break;\n        case 16:\n            fastUnpack256_16(inValues, inPos, out, outPos);\n            break;\n        default:\n            fastUnpack256_Generic(inValues, inPos, out, outPos, bitWidth);\n            break;\n    }\n    return (inPos + (bitWidth << 3)) | 0;\n}\n/**\n * Reads and validates the 2-byte block header from the byteContainer.\n *\n * @remarks\n * The header is `[bitWidth, exceptionCount]`, both stored as single bytes.\n *\n * @param byteContainer - Byte metadata buffer for the page.\n * @param byteContainerLen - The valid byte length in `byteContainer` for this page.\n * @param bytePosIn - Current offset in `byteContainer`.\n * @param block - Block index within the page (for error messages).\n * @returns The parsed header and the updated `bytePosIn`.\n */\nfunction readBlockHeader(byteContainer, byteContainerLen, bytePosIn, block) {\n    if (bytePosIn + 2 > byteContainerLen) {\n        throw new Error(`FastPFOR decode: byteContainer underflow at block=${block} (need 2 bytes for [bitWidth, exceptionCount], bytePos=${bytePosIn}, byteSize=${byteContainerLen})`);\n    }\n    const bitWidth = byteContainer[bytePosIn++];\n    const exceptionCount = byteContainer[bytePosIn++];\n    if (bitWidth > MAX_BIT_WIDTH) {\n        throw new Error(`FastPFOR decode: invalid bitWidth=${bitWidth} at block=${block} (expected 0..${MAX_BIT_WIDTH}). This likely indicates corrupted or truncated input.`);\n    }\n    return { bitWidth, exceptionCount, bytePosIn };\n}\n/**\n * Reads and validates the exception header for a block.\n *\n * @remarks\n * The header contains `maxBits` (1 byte), which defines the width of the outlier values as\n * `exceptionBitWidth = maxBits - bitWidth`.\n *\n * @param byteContainer - Byte metadata buffer for the page.\n * @param byteContainerLen - The valid byte length in `byteContainer` for this page.\n * @param bytePosIn - Current offset in `byteContainer`.\n * @param bitWidth - Base bit-width for the block.\n * @param exceptionCount - Number of exceptions/outliers in this block.\n * @param block - Block index within the page (for error messages).\n * @returns Parsed `maxBits`, `exceptionBitWidth`, and the updated `bytePosIn`.\n */\nfunction readBlockExceptionHeader(byteContainer, byteContainerLen, bytePosIn, bitWidth, exceptionCount, block) {\n    if (bytePosIn + 1 > byteContainerLen) {\n        throw new Error(`FastPFOR decode: exception header underflow at block=${block} (need 1 byte for maxBits, bytePos=${bytePosIn}, byteSize=${byteContainerLen})`);\n    }\n    const maxBits = byteContainer[bytePosIn++];\n    if (maxBits < bitWidth || maxBits > MAX_BIT_WIDTH) {\n        throw new Error(`FastPFOR decode: invalid maxBits=${maxBits} at block=${block} (bitWidth=${bitWidth}, expected ${bitWidth}..${MAX_BIT_WIDTH})`);\n    }\n    const exceptionBitWidth = (maxBits - bitWidth) | 0;\n    if (exceptionBitWidth < 1 || exceptionBitWidth > MAX_BIT_WIDTH) {\n        throw new Error(`FastPFOR decode: invalid exceptionBitWidth=${exceptionBitWidth} at block=${block} (bitWidth=${bitWidth}, maxBits=${maxBits})`);\n    }\n    if (bytePosIn + exceptionCount > byteContainerLen) {\n        throw new Error(`FastPFOR decode: exception positions underflow at block=${block} (need=${exceptionCount}, have=${byteContainerLen - bytePosIn})`);\n    }\n    return { maxBits, exceptionBitWidth, bytePosIn };\n}\n/**\n * Applies (block-local) FastPFOR \"exceptions\" (outliers) to an already-unpacked base 256-value block.\n *\n * @param out - Output buffer containing the base unpacked values for the block.\n * @param blockOutPos - Offset in `out` where the 256-value block starts.\n * @param bitWidth - Base bit-width for the block.\n * @param exceptionCount - Number of exceptions/outliers in this block.\n * @param byteContainer - Byte metadata buffer for the page.\n * @param byteContainerLen - The valid byte length in `byteContainer` for this page.\n * @param bytePosIn - Current offset in `byteContainer` (right after `[bitWidth, exceptionCount]`).\n * @param workspace - Decoder workspace holding the unpacked exception streams.\n * @param block - Block index within the page (for error messages).\n * @returns The updated `bytePosIn` after consuming the exception metadata bytes.\n *\n * The exception metadata is stored in `byteContainer`:\n * - `maxBits` (1 byte): the maximum bit-width of any value in the block\n * - `exceptionCount` exception positions (1 byte each, 0..255)\n *\n * The exception values themselves are read from the pre-unpacked exception streams stored in `workspace`.\n * Returns the new position in the byteContainer after consuming the exception metadata bytes.\n */\nfunction applyBlockExceptions(out, blockOutPos, bitWidth, exceptionCount, byteContainer, byteContainerLen, bytePosIn, workspace, block) {\n    const { maxBits, exceptionBitWidth, bytePosIn: afterHeaderPos, } = readBlockExceptionHeader(byteContainer, byteContainerLen, bytePosIn, bitWidth, exceptionCount, block);\n    bytePosIn = afterHeaderPos;\n    if (exceptionBitWidth === 1) {\n        const shift = 1 << bitWidth;\n        for (let k = 0; k < exceptionCount; k = (k + 1) | 0) {\n            const pos = byteContainer[bytePosIn++];\n            out[(pos + blockOutPos) | 0] |= shift;\n        }\n        return bytePosIn;\n    }\n    const exceptionValues = workspace.dataToBePacked[exceptionBitWidth];\n    if (!exceptionValues) {\n        throw new Error(`FastPFOR decode: missing exception stream for exceptionBitWidth=${exceptionBitWidth} (bitWidth=${bitWidth}, maxBits=${maxBits}) at block ${block}`);\n    }\n    const exceptionPointers = workspace.dataPointers;\n    let exPtr = exceptionPointers[exceptionBitWidth] | 0;\n    const exSize = workspace.exceptionSizes[exceptionBitWidth] | 0;\n    if (exPtr + exceptionCount > exSize) {\n        throw new Error(`FastPFOR decode: exception stream overflow for exceptionBitWidth=${exceptionBitWidth} (ptr=${exPtr}, need ${exceptionCount}, size=${exSize}) at block ${block}`);\n    }\n    for (let k = 0; k < exceptionCount; k = (k + 1) | 0) {\n        const pos = byteContainer[bytePosIn++];\n        const val = exceptionValues[exPtr++] | 0;\n        out[(pos + blockOutPos) | 0] |= val << bitWidth;\n    }\n    exceptionPointers[exceptionBitWidth] = exPtr;\n    return bytePosIn;\n}\nfunction decodePageBlocks(inValues, pageStart, inPos, packedEnd, out, outPos, blocks, byteContainer, byteContainerLen, workspace) {\n    let tmpInPos = inPos | 0;\n    let bytePosIn = 0;\n    for (let run = 0; run < blocks; run = (run + 1) | 0) {\n        const header = readBlockHeader(byteContainer, byteContainerLen, bytePosIn, run);\n        bytePosIn = header.bytePosIn;\n        const bitWidth = header.bitWidth;\n        const exceptionCount = header.exceptionCount;\n        const blockOutPos = (outPos + run * BLOCK_SIZE) | 0;\n        switch (bitWidth) {\n            case 0:\n                out.fill(0, blockOutPos, blockOutPos + BLOCK_SIZE);\n                break;\n            case 32:\n                for (let i = 0; i < BLOCK_SIZE; i = (i + 1) | 0) {\n                    out[(blockOutPos + i) | 0] = inValues[(tmpInPos + i) | 0] | 0;\n                }\n                tmpInPos = (tmpInPos + BLOCK_SIZE) | 0;\n                break;\n            default:\n                tmpInPos = unpackBlock256(inValues, tmpInPos, out, blockOutPos, bitWidth);\n                break;\n        }\n        if (exceptionCount > 0) {\n            bytePosIn = applyBlockExceptions(out, blockOutPos, bitWidth, exceptionCount, byteContainer, byteContainerLen, bytePosIn, workspace, run);\n        }\n    }\n    if (tmpInPos !== packedEnd) {\n        throw new Error(`FastPFOR decode: packed region mismatch (pageStart=${pageStart}, packedStart=${inPos}, consumedPackedEnd=${tmpInPos}, expectedPackedEnd=${packedEnd}, packedWords=${packedEnd - inPos}, encoded.length=${inValues.length})`);\n    }\n    return;\n}\n/**\n * Decodes one FastPFOR page (aligned to 256-value blocks).\n */\nfunction decodePage(inValues, out, inPos, outPos, thisSize, workspace) {\n    const pageStart = inPos | 0;\n    const whereMeta = inValues[pageStart] | 0;\n    if (whereMeta <= 0 || pageStart + whereMeta > inValues.length - 1) {\n        throw new Error(`FastPFOR decode: invalid whereMeta=${whereMeta} at pageStart=${pageStart} (expected > 0 and pageStart+whereMeta < encoded.length=${inValues.length})`);\n    }\n    const packedStart = (pageStart + 1) | 0;\n    const packedEnd = (pageStart + whereMeta) | 0;\n    const byteSize = inValues[packedEnd] >>> 0;\n    const metaInts = (byteSize + 3) >>> 2;\n    const byteContainerStart = packedEnd + 1;\n    const bitmapPos = byteContainerStart + metaInts;\n    if (bitmapPos >= inValues.length) {\n        throw new Error(`FastPFOR decode: invalid byteSize=${byteSize} (metaInts=${metaInts}, pageStart=${pageStart}, packedEnd=${packedEnd}, byteContainerStart=${byteContainerStart}) causes bitmapPos=${bitmapPos} out of bounds (encoded.length=${inValues.length})`);\n    }\n    const byteContainer = materializeByteContainer(inValues, byteContainerStart, byteSize, workspace);\n    const byteContainerLen = byteSize;\n    const inExcept = unpackExceptionStreams(inValues, bitmapPos, workspace);\n    const exceptionPointers = workspace.dataPointers;\n    exceptionPointers.fill(0);\n    const startOutPos = outPos | 0;\n    const blocks = (thisSize / BLOCK_SIZE) | 0;\n    decodePageBlocks(inValues, pageStart, packedStart, packedEnd, out, startOutPos, blocks, byteContainer, byteContainerLen, workspace);\n    return inExcept;\n}\nfunction decodeAlignedPages(inValues, out, inPos, outPos, outLength, workspace) {\n    const alignedOutLength = greatestMultiple(outLength, BLOCK_SIZE);\n    const finalOut = outPos + alignedOutLength;\n    let tmpOutPos = outPos;\n    let tmpInPos = inPos;\n    while (tmpOutPos !== finalOut) {\n        const thisSize = Math.min(PAGE_SIZE, finalOut - tmpOutPos);\n        tmpInPos = decodePage(inValues, out, tmpInPos, tmpOutPos, thisSize, workspace);\n        tmpOutPos = (tmpOutPos + thisSize) | 0;\n    }\n    return tmpInPos;\n}\n/**\n * Decodes the VariableByte tail (MSB=1 terminator, opposite of Protobuf Varint).\n */\nfunction decodeVByte(inValues, inPos, inLength, out, outPos, expectedCount) {\n    if (expectedCount === 0)\n        return inPos;\n    let bitOffset = 0;\n    let wordIndex = inPos;\n    const finalWordIndex = inPos + inLength;\n    const outPos0 = outPos;\n    let tmpOutPos = outPos;\n    const targetOut = outPos + expectedCount;\n    let accumulator = 0;\n    let accumulatorShift = 0;\n    while (wordIndex < finalWordIndex && tmpOutPos < targetOut) {\n        const word = inValues[wordIndex];\n        const byte = (word >>> bitOffset) & 0xff;\n        bitOffset += 8;\n        wordIndex += bitOffset >>> 5;\n        bitOffset &= 31;\n        accumulator |= (byte & 0x7f) << accumulatorShift;\n        if ((byte & 0x80) !== 0) {\n            out[tmpOutPos++] = accumulator | 0;\n            accumulator = 0;\n            accumulatorShift = 0;\n        }\n        else {\n            accumulatorShift += 7;\n            if (accumulatorShift > 28) {\n                throw new Error(`FastPFOR VByte: unterminated value (expected MSB=1 terminator within 5 bytes; shift=${accumulatorShift}, partial=${accumulator}, decoded=${tmpOutPos - outPos0}/${expectedCount}, inPos=${wordIndex}, inEnd=${finalWordIndex})`);\n            }\n        }\n    }\n    if (tmpOutPos !== targetOut) {\n        throw new Error(`FastPFOR VByte: truncated stream (decoded=${tmpOutPos - outPos0}, expected=${expectedCount}, consumedWords=${wordIndex - inPos}/${inLength}, vbyteStart=${inPos}, vbyteEnd=${finalWordIndex})`);\n    }\n    return wordIndex;\n}\n/**\n * Decodes a sequence of FastPFOR-encoded integers.\n *\n * @param encoded The input buffer containing FastPFOR encoded data.\n * @param numValues The number of integers expected to be decoded.\n * @param workspace Optional workspace for reuse across calls. If omitted, a new workspace is created per call.\n */\nexport function decodeFastPforInt32(encoded, numValues, workspace) {\n    let inPos = 0;\n    let outPos = 0;\n    const decoded = new Uint32Array(numValues);\n    const decoderWorkspace = workspace ?? createDecoderWorkspace();\n    if (encoded.length > 0) {\n        const alignedLength = encoded[inPos] | 0;\n        inPos = (inPos + 1) | 0;\n        if ((alignedLength & (BLOCK_SIZE - 1)) !== 0) {\n            throw new Error(`FastPFOR decode: invalid alignedLength=${alignedLength} (expected multiple of ${BLOCK_SIZE})`);\n        }\n        if (outPos + alignedLength > decoded.length) {\n            throw new Error(`FastPFOR decode: output buffer too small (outPos=${outPos}, alignedLength=${alignedLength}, out.length=${decoded.length})`);\n        }\n        inPos = decodeAlignedPages(encoded, decoded, inPos, outPos, alignedLength, decoderWorkspace);\n        outPos = (outPos + alignedLength) | 0;\n    }\n    const remainingLength = (encoded.length - inPos) | 0;\n    const expectedTail = (numValues - outPos) | 0;\n    decodeVByte(encoded, inPos, remainingLength, decoded, outPos, expectedTail);\n    return decoded;\n}\nfunction fastUnpack32(inValues, inPos, out, outPos, bitWidth) {\n    switch (bitWidth) {\n        case 2:\n            fastUnpack32_2(inValues, inPos, out, outPos);\n            return;\n        case 3:\n            fastUnpack32_3(inValues, inPos, out, outPos);\n            return;\n        case 4:\n            fastUnpack32_4(inValues, inPos, out, outPos);\n            return;\n        case 5:\n            fastUnpack32_5(inValues, inPos, out, outPos);\n            return;\n        case 6:\n            fastUnpack32_6(inValues, inPos, out, outPos);\n            return;\n        case 7:\n            fastUnpack32_7(inValues, inPos, out, outPos);\n            return;\n        case 8:\n            fastUnpack32_8(inValues, inPos, out, outPos);\n            return;\n        case 9:\n            fastUnpack32_9(inValues, inPos, out, outPos);\n            return;\n        case 10:\n            fastUnpack32_10(inValues, inPos, out, outPos);\n            return;\n        case 11:\n            fastUnpack32_11(inValues, inPos, out, outPos);\n            return;\n        case 12:\n            fastUnpack32_12(inValues, inPos, out, outPos);\n            return;\n        case 16:\n            fastUnpack32_16(inValues, inPos, out, outPos);\n            return;\n        case 32:\n            for (let i = 0; i < 32; i = (i + 1) | 0) {\n                out[(outPos + i) | 0] = inValues[(inPos + i) | 0] | 0;\n            }\n            return;\n        default:\n            break;\n    }\n    const valueMask = MASKS[bitWidth] >>> 0;\n    let inputWordIndex = inPos;\n    let bitOffset = 0;\n    let currentWord = inValues[inputWordIndex] >>> 0;\n    for (let i = 0; i < 32; i++) {\n        if (bitOffset + bitWidth <= 32) {\n            const value = (currentWord >>> bitOffset) & valueMask;\n            out[outPos + i] = value | 0;\n            bitOffset += bitWidth;\n            if (bitOffset === 32) {\n                bitOffset = 0;\n                inputWordIndex++;\n                if (i !== 31)\n                    currentWord = inValues[inputWordIndex] >>> 0;\n            }\n        }\n        else {\n            const lowBits = 32 - bitOffset;\n            const low = currentWord >>> bitOffset;\n            inputWordIndex++;\n            currentWord = inValues[inputWordIndex] >>> 0;\n            const highMask = MASKS[bitWidth - lowBits] >>> 0;\n            const high = currentWord & highMask;\n            const value = (low | (high << lowBits)) & valueMask;\n            out[outPos + i] = value | 0;\n            bitOffset = bitWidth - lowBits;\n        }\n    }\n}\n//# sourceMappingURL=fastPforDecoder.js.map", "import { MASKS } from \"./fastPforShared\";\nexport function fastUnpack32_1(inValues, inPos, out, outPos) {\n    const in0 = inValues[inPos] >>> 0;\n    for (let i = 0; i < 32; i++) {\n        out[outPos + i] = (in0 >>> i) & 1;\n    }\n}\nexport function fastUnpack32_2(inValues, inPos, out, outPos) {\n    let op = outPos;\n    const in0 = inValues[inPos] >>> 0;\n    const in1 = inValues[inPos + 1] >>> 0;\n    out[op++] = (in0 >>> 0) & 0x3;\n    out[op++] = (in0 >>> 2) & 0x3;\n    out[op++] = (in0 >>> 4) & 0x3;\n    out[op++] = (in0 >>> 6) & 0x3;\n    out[op++] = (in0 >>> 8) & 0x3;\n    out[op++] = (in0 >>> 10) & 0x3;\n    out[op++] = (in0 >>> 12) & 0x3;\n    out[op++] = (in0 >>> 14) & 0x3;\n    out[op++] = (in0 >>> 16) & 0x3;\n    out[op++] = (in0 >>> 18) & 0x3;\n    out[op++] = (in0 >>> 20) & 0x3;\n    out[op++] = (in0 >>> 22) & 0x3;\n    out[op++] = (in0 >>> 24) & 0x3;\n    out[op++] = (in0 >>> 26) & 0x3;\n    out[op++] = (in0 >>> 28) & 0x3;\n    out[op++] = (in0 >>> 30) & 0x3;\n    out[op++] = (in1 >>> 0) & 0x3;\n    out[op++] = (in1 >>> 2) & 0x3;\n    out[op++] = (in1 >>> 4) & 0x3;\n    out[op++] = (in1 >>> 6) & 0x3;\n    out[op++] = (in1 >>> 8) & 0x3;\n    out[op++] = (in1 >>> 10) & 0x3;\n    out[op++] = (in1 >>> 12) & 0x3;\n    out[op++] = (in1 >>> 14) & 0x3;\n    out[op++] = (in1 >>> 16) & 0x3;\n    out[op++] = (in1 >>> 18) & 0x3;\n    out[op++] = (in1 >>> 20) & 0x3;\n    out[op++] = (in1 >>> 22) & 0x3;\n    out[op++] = (in1 >>> 24) & 0x3;\n    out[op++] = (in1 >>> 26) & 0x3;\n    out[op++] = (in1 >>> 28) & 0x3;\n    out[op] = (in1 >>> 30) & 0x3;\n}\nexport function fastUnpack32_3(inValues, inPos, out, outPos) {\n    let op = outPos;\n    const in0 = inValues[inPos] >>> 0;\n    const in1 = inValues[inPos + 1] >>> 0;\n    const in2 = inValues[inPos + 2] >>> 0;\n    out[op++] = (in0 >>> 0) & 0x7;\n    out[op++] = (in0 >>> 3) & 0x7;\n    out[op++] = (in0 >>> 6) & 0x7;\n    out[op++] = (in0 >>> 9) & 0x7;\n    out[op++] = (in0 >>> 12) & 0x7;\n    out[op++] = (in0 >>> 15) & 0x7;\n    out[op++] = (in0 >>> 18) & 0x7;\n    out[op++] = (in0 >>> 21) & 0x7;\n    out[op++] = (in0 >>> 24) & 0x7;\n    out[op++] = (in0 >>> 27) & 0x7;\n    out[op++] = ((in0 >>> 30) | ((in1 & 0x1) << 2)) & 0x7;\n    out[op++] = (in1 >>> 1) & 0x7;\n    out[op++] = (in1 >>> 4) & 0x7;\n    out[op++] = (in1 >>> 7) & 0x7;\n    out[op++] = (in1 >>> 10) & 0x7;\n    out[op++] = (in1 >>> 13) & 0x7;\n    out[op++] = (in1 >>> 16) & 0x7;\n    out[op++] = (in1 >>> 19) & 0x7;\n    out[op++] = (in1 >>> 22) & 0x7;\n    out[op++] = (in1 >>> 25) & 0x7;\n    out[op++] = (in1 >>> 28) & 0x7;\n    out[op++] = ((in1 >>> 31) | ((in2 & 0x3) << 1)) & 0x7;\n    out[op++] = (in2 >>> 2) & 0x7;\n    out[op++] = (in2 >>> 5) & 0x7;\n    out[op++] = (in2 >>> 8) & 0x7;\n    out[op++] = (in2 >>> 11) & 0x7;\n    out[op++] = (in2 >>> 14) & 0x7;\n    out[op++] = (in2 >>> 17) & 0x7;\n    out[op++] = (in2 >>> 20) & 0x7;\n    out[op++] = (in2 >>> 23) & 0x7;\n    out[op++] = (in2 >>> 26) & 0x7;\n    out[op] = (in2 >>> 29) & 0x7;\n}\nexport function fastUnpack32_4(inValues, inPos, out, outPos) {\n    let op = outPos;\n    const in0 = inValues[inPos] >>> 0;\n    const in1 = inValues[inPos + 1] >>> 0;\n    const in2 = inValues[inPos + 2] >>> 0;\n    const in3 = inValues[inPos + 3] >>> 0;\n    out[op++] = (in0 >>> 0) & 0xf;\n    out[op++] = (in0 >>> 4) & 0xf;\n    out[op++] = (in0 >>> 8) & 0xf;\n    out[op++] = (in0 >>> 12) & 0xf;\n    out[op++] = (in0 >>> 16) & 0xf;\n    out[op++] = (in0 >>> 20) & 0xf;\n    out[op++] = (in0 >>> 24) & 0xf;\n    out[op++] = (in0 >>> 28) & 0xf;\n    out[op++] = (in1 >>> 0) & 0xf;\n    out[op++] = (in1 >>> 4) & 0xf;\n    out[op++] = (in1 >>> 8) & 0xf;\n    out[op++] = (in1 >>> 12) & 0xf;\n    out[op++] = (in1 >>> 16) & 0xf;\n    out[op++] = (in1 >>> 20) & 0xf;\n    out[op++] = (in1 >>> 24) & 0xf;\n    out[op++] = (in1 >>> 28) & 0xf;\n    out[op++] = (in2 >>> 0) & 0xf;\n    out[op++] = (in2 >>> 4) & 0xf;\n    out[op++] = (in2 >>> 8) & 0xf;\n    out[op++] = (in2 >>> 12) & 0xf;\n    out[op++] = (in2 >>> 16) & 0xf;\n    out[op++] = (in2 >>> 20) & 0xf;\n    out[op++] = (in2 >>> 24) & 0xf;\n    out[op++] = (in2 >>> 28) & 0xf;\n    out[op++] = (in3 >>> 0) & 0xf;\n    out[op++] = (in3 >>> 4) & 0xf;\n    out[op++] = (in3 >>> 8) & 0xf;\n    out[op++] = (in3 >>> 12) & 0xf;\n    out[op++] = (in3 >>> 16) & 0xf;\n    out[op++] = (in3 >>> 20) & 0xf;\n    out[op++] = (in3 >>> 24) & 0xf;\n    out[op] = (in3 >>> 28) & 0xf;\n}\nexport function fastUnpack32_5(inValues, inPos, out, outPos) {\n    let op = outPos;\n    const in0 = inValues[inPos] >>> 0;\n    const in1 = inValues[inPos + 1] >>> 0;\n    const in2 = inValues[inPos + 2] >>> 0;\n    const in3 = inValues[inPos + 3] >>> 0;\n    const in4 = inValues[inPos + 4] >>> 0;\n    out[op++] = (in0 >>> 0) & 0x1f;\n    out[op++] = (in0 >>> 5) & 0x1f;\n    out[op++] = (in0 >>> 10) & 0x1f;\n    out[op++] = (in0 >>> 15) & 0x1f;\n    out[op++] = (in0 >>> 20) & 0x1f;\n    out[op++] = (in0 >>> 25) & 0x1f;\n    out[op++] = ((in0 >>> 30) | ((in1 & 0x7) << 2)) & 0x1f;\n    out[op++] = (in1 >>> 3) & 0x1f;\n    out[op++] = (in1 >>> 8) & 0x1f;\n    out[op++] = (in1 >>> 13) & 0x1f;\n    out[op++] = (in1 >>> 18) & 0x1f;\n    out[op++] = (in1 >>> 23) & 0x1f;\n    out[op++] = ((in1 >>> 28) | ((in2 & 0x1) << 4)) & 0x1f;\n    out[op++] = (in2 >>> 1) & 0x1f;\n    out[op++] = (in2 >>> 6) & 0x1f;\n    out[op++] = (in2 >>> 11) & 0x1f;\n    out[op++] = (in2 >>> 16) & 0x1f;\n    out[op++] = (in2 >>> 21) & 0x1f;\n    out[op++] = (in2 >>> 26) & 0x1f;\n    out[op++] = ((in2 >>> 31) | ((in3 & 0xf) << 1)) & 0x1f;\n    out[op++] = (in3 >>> 4) & 0x1f;\n    out[op++] = (in3 >>> 9) & 0x1f;\n    out[op++] = (in3 >>> 14) & 0x1f;\n    out[op++] = (in3 >>> 19) & 0x1f;\n    out[op++] = (in3 >>> 24) & 0x1f;\n    out[op++] = ((in3 >>> 29) | ((in4 & 0x3) << 3)) & 0x1f;\n    out[op++] = (in4 >>> 2) & 0x1f;\n    out[op++] = (in4 >>> 7) & 0x1f;\n    out[op++] = (in4 >>> 12) & 0x1f;\n    out[op++] = (in4 >>> 17) & 0x1f;\n    out[op++] = (in4 >>> 22) & 0x1f;\n    out[op] = (in4 >>> 27) & 0x1f;\n}\nexport function fastUnpack32_6(inValues, inPos, out, outPos) {\n    let op = outPos;\n    const in0 = inValues[inPos] >>> 0;\n    const in1 = inValues[inPos + 1] >>> 0;\n    const in2 = inValues[inPos + 2] >>> 0;\n    const in3 = inValues[inPos + 3] >>> 0;\n    const in4 = inValues[inPos + 4] >>> 0;\n    const in5 = inValues[inPos + 5] >>> 0;\n    out[op++] = (in0 >>> 0) & 0x3f;\n    out[op++] = (in0 >>> 6) & 0x3f;\n    out[op++] = (in0 >>> 12) & 0x3f;\n    out[op++] = (in0 >>> 18) & 0x3f;\n    out[op++] = (in0 >>> 24) & 0x3f;\n    out[op++] = ((in0 >>> 30) | ((in1 & 0xf) << 2)) & 0x3f;\n    out[op++] = (in1 >>> 4) & 0x3f;\n    out[op++] = (in1 >>> 10) & 0x3f;\n    out[op++] = (in1 >>> 16) & 0x3f;\n    out[op++] = (in1 >>> 22) & 0x3f;\n    out[op++] = ((in1 >>> 28) | ((in2 & 0x3) << 4)) & 0x3f;\n    out[op++] = (in2 >>> 2) & 0x3f;\n    out[op++] = (in2 >>> 8) & 0x3f;\n    out[op++] = (in2 >>> 14) & 0x3f;\n    out[op++] = (in2 >>> 20) & 0x3f;\n    out[op++] = (in2 >>> 26) & 0x3f;\n    out[op++] = (in3 >>> 0) & 0x3f;\n    out[op++] = (in3 >>> 6) & 0x3f;\n    out[op++] = (in3 >>> 12) & 0x3f;\n    out[op++] = (in3 >>> 18) & 0x3f;\n    out[op++] = (in3 >>> 24) & 0x3f;\n    out[op++] = ((in3 >>> 30) | ((in4 & 0xf) << 2)) & 0x3f;\n    out[op++] = (in4 >>> 4) & 0x3f;\n    out[op++] = (in4 >>> 10) & 0x3f;\n    out[op++] = (in4 >>> 16) & 0x3f;\n    out[op++] = (in4 >>> 22) & 0x3f;\n    out[op++] = ((in4 >>> 28) | ((in5 & 0x3) << 4)) & 0x3f;\n    out[op++] = (in5 >>> 2) & 0x3f;\n    out[op++] = (in5 >>> 8) & 0x3f;\n    out[op++] = (in5 >>> 14) & 0x3f;\n    out[op++] = (in5 >>> 20) & 0x3f;\n    out[op] = (in5 >>> 26) & 0x3f;\n}\nexport function fastUnpack32_7(inValues, inPos, out, outPos) {\n    let op = outPos;\n    const in0 = inValues[inPos] >>> 0;\n    const in1 = inValues[inPos + 1] >>> 0;\n    const in2 = inValues[inPos + 2] >>> 0;\n    const in3 = inValues[inPos + 3] >>> 0;\n    const in4 = inValues[inPos + 4] >>> 0;\n    const in5 = inValues[inPos + 5] >>> 0;\n    const in6 = inValues[inPos + 6] >>> 0;\n    out[op++] = (in0 >>> 0) & 0x7f;\n    out[op++] = (in0 >>> 7) & 0x7f;\n    out[op++] = (in0 >>> 14) & 0x7f;\n    out[op++] = (in0 >>> 21) & 0x7f;\n    out[op++] = ((in0 >>> 28) | ((in1 & 0x7) << 4)) & 0x7f;\n    out[op++] = (in1 >>> 3) & 0x7f;\n    out[op++] = (in1 >>> 10) & 0x7f;\n    out[op++] = (in1 >>> 17) & 0x7f;\n    out[op++] = (in1 >>> 24) & 0x7f;\n    out[op++] = ((in1 >>> 31) | ((in2 & 0x3f) << 1)) & 0x7f;\n    out[op++] = (in2 >>> 6) & 0x7f;\n    out[op++] = (in2 >>> 13) & 0x7f;\n    out[op++] = (in2 >>> 20) & 0x7f;\n    out[op++] = ((in2 >>> 27) | ((in3 & 0x3) << 5)) & 0x7f;\n    out[op++] = (in3 >>> 2) & 0x7f;\n    out[op++] = (in3 >>> 9) & 0x7f;\n    out[op++] = (in3 >>> 16) & 0x7f;\n    out[op++] = (in3 >>> 23) & 0x7f;\n    out[op++] = ((in3 >>> 30) | ((in4 & 0x1f) << 2)) & 0x7f;\n    out[op++] = (in4 >>> 5) & 0x7f;\n    out[op++] = (in4 >>> 12) & 0x7f;\n    out[op++] = (in4 >>> 19) & 0x7f;\n    out[op++] = ((in4 >>> 26) | ((in5 & 0x1) << 6)) & 0x7f;\n    out[op++] = (in5 >>> 1) & 0x7f;\n    out[op++] = (in5 >>> 8) & 0x7f;\n    out[op++] = (in5 >>> 15) & 0x7f;\n    out[op++] = (in5 >>> 22) & 0x7f;\n    out[op++] = ((in5 >>> 29) | ((in6 & 0xf) << 3)) & 0x7f;\n    out[op++] = (in6 >>> 4) & 0x7f;\n    out[op++] = (in6 >>> 11) & 0x7f;\n    out[op++] = (in6 >>> 18) & 0x7f;\n    out[op] = (in6 >>> 25) & 0x7f;\n}\nexport function fastUnpack32_8(inValues, inPos, out, outPos) {\n    let op = outPos;\n    const in0 = inValues[inPos] >>> 0;\n    const in1 = inValues[inPos + 1] >>> 0;\n    const in2 = inValues[inPos + 2] >>> 0;\n    const in3 = inValues[inPos + 3] >>> 0;\n    const in4 = inValues[inPos + 4] >>> 0;\n    const in5 = inValues[inPos + 5] >>> 0;\n    const in6 = inValues[inPos + 6] >>> 0;\n    const in7 = inValues[inPos + 7] >>> 0;\n    out[op++] = (in0 >>> 0) & 0xff;\n    out[op++] = (in0 >>> 8) & 0xff;\n    out[op++] = (in0 >>> 16) & 0xff;\n    out[op++] = (in0 >>> 24) & 0xff;\n    out[op++] = (in1 >>> 0) & 0xff;\n    out[op++] = (in1 >>> 8) & 0xff;\n    out[op++] = (in1 >>> 16) & 0xff;\n    out[op++] = (in1 >>> 24) & 0xff;\n    out[op++] = (in2 >>> 0) & 0xff;\n    out[op++] = (in2 >>> 8) & 0xff;\n    out[op++] = (in2 >>> 16) & 0xff;\n    out[op++] = (in2 >>> 24) & 0xff;\n    out[op++] = (in3 >>> 0) & 0xff;\n    out[op++] = (in3 >>> 8) & 0xff;\n    out[op++] = (in3 >>> 16) & 0xff;\n    out[op++] = (in3 >>> 24) & 0xff;\n    out[op++] = (in4 >>> 0) & 0xff;\n    out[op++] = (in4 >>> 8) & 0xff;\n    out[op++] = (in4 >>> 16) & 0xff;\n    out[op++] = (in4 >>> 24) & 0xff;\n    out[op++] = (in5 >>> 0) & 0xff;\n    out[op++] = (in5 >>> 8) & 0xff;\n    out[op++] = (in5 >>> 16) & 0xff;\n    out[op++] = (in5 >>> 24) & 0xff;\n    out[op++] = (in6 >>> 0) & 0xff;\n    out[op++] = (in6 >>> 8) & 0xff;\n    out[op++] = (in6 >>> 16) & 0xff;\n    out[op++] = (in6 >>> 24) & 0xff;\n    out[op++] = (in7 >>> 0) & 0xff;\n    out[op++] = (in7 >>> 8) & 0xff;\n    out[op++] = (in7 >>> 16) & 0xff;\n    out[op] = (in7 >>> 24) & 0xff;\n}\nexport function fastUnpack32_9(inValues, inPos, out, outPos) {\n    let op = outPos;\n    const in0 = inValues[inPos] >>> 0;\n    const in1 = inValues[inPos + 1] >>> 0;\n    const in2 = inValues[inPos + 2] >>> 0;\n    const in3 = inValues[inPos + 3] >>> 0;\n    const in4 = inValues[inPos + 4] >>> 0;\n    const in5 = inValues[inPos + 5] >>> 0;\n    const in6 = inValues[inPos + 6] >>> 0;\n    const in7 = inValues[inPos + 7] >>> 0;\n    const in8 = inValues[inPos + 8] >>> 0;\n    out[op++] = (in0 >>> 0) & 0x1ff;\n    out[op++] = (in0 >>> 9) & 0x1ff;\n    out[op++] = (in0 >>> 18) & 0x1ff;\n    out[op++] = ((in0 >>> 27) | ((in1 & 0xf) << 5)) & 0x1ff;\n    out[op++] = (in1 >>> 4) & 0x1ff;\n    out[op++] = (in1 >>> 13) & 0x1ff;\n    out[op++] = (in1 >>> 22) & 0x1ff;\n    out[op++] = ((in1 >>> 31) | ((in2 & 0xff) << 1)) & 0x1ff;\n    out[op++] = (in2 >>> 8) & 0x1ff;\n    out[op++] = (in2 >>> 17) & 0x1ff;\n    out[op++] = ((in2 >>> 26) | ((in3 & 0x7) << 6)) & 0x1ff;\n    out[op++] = (in3 >>> 3) & 0x1ff;\n    out[op++] = (in3 >>> 12) & 0x1ff;\n    out[op++] = (in3 >>> 21) & 0x1ff;\n    out[op++] = ((in3 >>> 30) | ((in4 & 0x7f) << 2)) & 0x1ff;\n    out[op++] = (in4 >>> 7) & 0x1ff;\n    out[op++] = (in4 >>> 16) & 0x1ff;\n    out[op++] = ((in4 >>> 25) | ((in5 & 0x3) << 7)) & 0x1ff;\n    out[op++] = (in5 >>> 2) & 0x1ff;\n    out[op++] = (in5 >>> 11) & 0x1ff;\n    out[op++] = (in5 >>> 20) & 0x1ff;\n    out[op++] = ((in5 >>> 29) | ((in6 & 0x3f) << 3)) & 0x1ff;\n    out[op++] = (in6 >>> 6) & 0x1ff;\n    out[op++] = (in6 >>> 15) & 0x1ff;\n    out[op++] = ((in6 >>> 24) | ((in7 & 0x1) << 8)) & 0x1ff;\n    out[op++] = (in7 >>> 1) & 0x1ff;\n    out[op++] = (in7 >>> 10) & 0x1ff;\n    out[op++] = (in7 >>> 19) & 0x1ff;\n    out[op++] = ((in7 >>> 28) | ((in8 & 0x1f) << 4)) & 0x1ff;\n    out[op++] = (in8 >>> 5) & 0x1ff;\n    out[op++] = (in8 >>> 14) & 0x1ff;\n    out[op] = (in8 >>> 23) & 0x1ff;\n}\nexport function fastUnpack32_10(inValues, inPos, out, outPos) {\n    let op = outPos;\n    const in0 = inValues[inPos] >>> 0;\n    const in1 = inValues[inPos + 1] >>> 0;\n    const in2 = inValues[inPos + 2] >>> 0;\n    const in3 = inValues[inPos + 3] >>> 0;\n    const in4 = inValues[inPos + 4] >>> 0;\n    const in5 = inValues[inPos + 5] >>> 0;\n    const in6 = inValues[inPos + 6] >>> 0;\n    const in7 = inValues[inPos + 7] >>> 0;\n    const in8 = inValues[inPos + 8] >>> 0;\n    const in9 = inValues[inPos + 9] >>> 0;\n    out[op++] = (in0 >>> 0) & 0x3ff;\n    out[op++] = (in0 >>> 10) & 0x3ff;\n    out[op++] = (in0 >>> 20) & 0x3ff;\n    out[op++] = ((in0 >>> 30) | ((in1 & 0xff) << 2)) & 0x3ff;\n    out[op++] = (in1 >>> 8) & 0x3ff;\n    out[op++] = (in1 >>> 18) & 0x3ff;\n    out[op++] = ((in1 >>> 28) | ((in2 & 0x3f) << 4)) & 0x3ff;\n    out[op++] = (in2 >>> 6) & 0x3ff;\n    out[op++] = (in2 >>> 16) & 0x3ff;\n    out[op++] = ((in2 >>> 26) | ((in3 & 0xf) << 6)) & 0x3ff;\n    out[op++] = (in3 >>> 4) & 0x3ff;\n    out[op++] = (in3 >>> 14) & 0x3ff;\n    out[op++] = ((in3 >>> 24) | ((in4 & 0x3) << 8)) & 0x3ff;\n    out[op++] = (in4 >>> 2) & 0x3ff;\n    out[op++] = (in4 >>> 12) & 0x3ff;\n    out[op++] = (in4 >>> 22) & 0x3ff;\n    out[op++] = (in5 >>> 0) & 0x3ff;\n    out[op++] = (in5 >>> 10) & 0x3ff;\n    out[op++] = (in5 >>> 20) & 0x3ff;\n    out[op++] = ((in5 >>> 30) | ((in6 & 0xff) << 2)) & 0x3ff;\n    out[op++] = (in6 >>> 8) & 0x3ff;\n    out[op++] = (in6 >>> 18) & 0x3ff;\n    out[op++] = ((in6 >>> 28) | ((in7 & 0x3f) << 4)) & 0x3ff;\n    out[op++] = (in7 >>> 6) & 0x3ff;\n    out[op++] = (in7 >>> 16) & 0x3ff;\n    out[op++] = ((in7 >>> 26) | ((in8 & 0xf) << 6)) & 0x3ff;\n    out[op++] = (in8 >>> 4) & 0x3ff;\n    out[op++] = (in8 >>> 14) & 0x3ff;\n    out[op++] = ((in8 >>> 24) | ((in9 & 0x3) << 8)) & 0x3ff;\n    out[op++] = (in9 >>> 2) & 0x3ff;\n    out[op++] = (in9 >>> 12) & 0x3ff;\n    out[op] = (in9 >>> 22) & 0x3ff;\n}\nexport function fastUnpack32_11(inValues, inPos, out, outPos) {\n    let op = outPos;\n    const in0 = inValues[inPos] >>> 0;\n    const in1 = inValues[inPos + 1] >>> 0;\n    const in2 = inValues[inPos + 2] >>> 0;\n    const in3 = inValues[inPos + 3] >>> 0;\n    const in4 = inValues[inPos + 4] >>> 0;\n    const in5 = inValues[inPos + 5] >>> 0;\n    const in6 = inValues[inPos + 6] >>> 0;\n    const in7 = inValues[inPos + 7] >>> 0;\n    const in8 = inValues[inPos + 8] >>> 0;\n    const in9 = inValues[inPos + 9] >>> 0;\n    const in10 = inValues[inPos + 10] >>> 0;\n    out[op++] = (in0 >>> 0) & 0x7ff;\n    out[op++] = (in0 >>> 11) & 0x7ff;\n    out[op++] = ((in0 >>> 22) | ((in1 & 0x1) << 10)) & 0x7ff;\n    out[op++] = (in1 >>> 1) & 0x7ff;\n    out[op++] = (in1 >>> 12) & 0x7ff;\n    out[op++] = ((in1 >>> 23) | ((in2 & 0x3) << 9)) & 0x7ff;\n    out[op++] = (in2 >>> 2) & 0x7ff;\n    out[op++] = (in2 >>> 13) & 0x7ff;\n    out[op++] = ((in2 >>> 24) | ((in3 & 0x7) << 8)) & 0x7ff;\n    out[op++] = (in3 >>> 3) & 0x7ff;\n    out[op++] = (in3 >>> 14) & 0x7ff;\n    out[op++] = ((in3 >>> 25) | ((in4 & 0xf) << 7)) & 0x7ff;\n    out[op++] = (in4 >>> 4) & 0x7ff;\n    out[op++] = (in4 >>> 15) & 0x7ff;\n    out[op++] = ((in4 >>> 26) | ((in5 & 0x1f) << 6)) & 0x7ff;\n    out[op++] = (in5 >>> 5) & 0x7ff;\n    out[op++] = (in5 >>> 16) & 0x7ff;\n    out[op++] = ((in5 >>> 27) | ((in6 & 0x3f) << 5)) & 0x7ff;\n    out[op++] = (in6 >>> 6) & 0x7ff;\n    out[op++] = (in6 >>> 17) & 0x7ff;\n    out[op++] = ((in6 >>> 28) | ((in7 & 0x7f) << 4)) & 0x7ff;\n    out[op++] = (in7 >>> 7) & 0x7ff;\n    out[op++] = (in7 >>> 18) & 0x7ff;\n    out[op++] = ((in7 >>> 29) | ((in8 & 0xff) << 3)) & 0x7ff;\n    out[op++] = (in8 >>> 8) & 0x7ff;\n    out[op++] = (in8 >>> 19) & 0x7ff;\n    out[op++] = ((in8 >>> 30) | ((in9 & 0x1ff) << 2)) & 0x7ff;\n    out[op++] = (in9 >>> 9) & 0x7ff;\n    out[op++] = (in9 >>> 20) & 0x7ff;\n    out[op++] = ((in9 >>> 31) | ((in10 & 0x3ff) << 1)) & 0x7ff;\n    out[op++] = (in10 >>> 10) & 0x7ff;\n    out[op] = (in10 >>> 21) & 0x7ff;\n}\nexport function fastUnpack32_12(inValues, inPos, out, outPos) {\n    let op = outPos;\n    const in0 = inValues[inPos] >>> 0;\n    const in1 = inValues[inPos + 1] >>> 0;\n    const in2 = inValues[inPos + 2] >>> 0;\n    const in3 = inValues[inPos + 3] >>> 0;\n    const in4 = inValues[inPos + 4] >>> 0;\n    const in5 = inValues[inPos + 5] >>> 0;\n    const in6 = inValues[inPos + 6] >>> 0;\n    const in7 = inValues[inPos + 7] >>> 0;\n    const in8 = inValues[inPos + 8] >>> 0;\n    const in9 = inValues[inPos + 9] >>> 0;\n    const in10 = inValues[inPos + 10] >>> 0;\n    const in11 = inValues[inPos + 11] >>> 0;\n    out[op++] = (in0 >>> 0) & 0xfff;\n    out[op++] = (in0 >>> 12) & 0xfff;\n    out[op++] = ((in0 >>> 24) | ((in1 & 0xf) << 8)) & 0xfff;\n    out[op++] = (in1 >>> 4) & 0xfff;\n    out[op++] = (in1 >>> 16) & 0xfff;\n    out[op++] = ((in1 >>> 28) | ((in2 & 0xff) << 4)) & 0xfff;\n    out[op++] = (in2 >>> 8) & 0xfff;\n    out[op++] = (in2 >>> 20) & 0xfff;\n    out[op++] = (in3 >>> 0) & 0xfff;\n    out[op++] = (in3 >>> 12) & 0xfff;\n    out[op++] = ((in3 >>> 24) | ((in4 & 0xf) << 8)) & 0xfff;\n    out[op++] = (in4 >>> 4) & 0xfff;\n    out[op++] = (in4 >>> 16) & 0xfff;\n    out[op++] = ((in4 >>> 28) | ((in5 & 0xff) << 4)) & 0xfff;\n    out[op++] = (in5 >>> 8) & 0xfff;\n    out[op++] = (in5 >>> 20) & 0xfff;\n    out[op++] = (in6 >>> 0) & 0xfff;\n    out[op++] = (in6 >>> 12) & 0xfff;\n    out[op++] = ((in6 >>> 24) | ((in7 & 0xf) << 8)) & 0xfff;\n    out[op++] = (in7 >>> 4) & 0xfff;\n    out[op++] = (in7 >>> 16) & 0xfff;\n    out[op++] = ((in7 >>> 28) | ((in8 & 0xff) << 4)) & 0xfff;\n    out[op++] = (in8 >>> 8) & 0xfff;\n    out[op++] = (in8 >>> 20) & 0xfff;\n    out[op++] = (in9 >>> 0) & 0xfff;\n    out[op++] = (in9 >>> 12) & 0xfff;\n    out[op++] = ((in9 >>> 24) | ((in10 & 0xf) << 8)) & 0xfff;\n    out[op++] = (in10 >>> 4) & 0xfff;\n    out[op++] = (in10 >>> 16) & 0xfff;\n    out[op++] = ((in10 >>> 28) | ((in11 & 0xff) << 4)) & 0xfff;\n    out[op++] = (in11 >>> 8) & 0xfff;\n    out[op] = (in11 >>> 20) & 0xfff;\n}\nexport function fastUnpack32_16(inValues, inPos, out, outPos) {\n    let op = outPos;\n    const in0 = inValues[inPos] >>> 0;\n    const in1 = inValues[inPos + 1] >>> 0;\n    const in2 = inValues[inPos + 2] >>> 0;\n    const in3 = inValues[inPos + 3] >>> 0;\n    const in4 = inValues[inPos + 4] >>> 0;\n    const in5 = inValues[inPos + 5] >>> 0;\n    const in6 = inValues[inPos + 6] >>> 0;\n    const in7 = inValues[inPos + 7] >>> 0;\n    const in8 = inValues[inPos + 8] >>> 0;\n    const in9 = inValues[inPos + 9] >>> 0;\n    const in10 = inValues[inPos + 10] >>> 0;\n    const in11 = inValues[inPos + 11] >>> 0;\n    const in12 = inValues[inPos + 12] >>> 0;\n    const in13 = inValues[inPos + 13] >>> 0;\n    const in14 = inValues[inPos + 14] >>> 0;\n    const in15 = inValues[inPos + 15] >>> 0;\n    out[op++] = (in0 >>> 0) & 0xffff;\n    out[op++] = (in0 >>> 16) & 0xffff;\n    out[op++] = (in1 >>> 0) & 0xffff;\n    out[op++] = (in1 >>> 16) & 0xffff;\n    out[op++] = (in2 >>> 0) & 0xffff;\n    out[op++] = (in2 >>> 16) & 0xffff;\n    out[op++] = (in3 >>> 0) & 0xffff;\n    out[op++] = (in3 >>> 16) & 0xffff;\n    out[op++] = (in4 >>> 0) & 0xffff;\n    out[op++] = (in4 >>> 16) & 0xffff;\n    out[op++] = (in5 >>> 0) & 0xffff;\n    out[op++] = (in5 >>> 16) & 0xffff;\n    out[op++] = (in6 >>> 0) & 0xffff;\n    out[op++] = (in6 >>> 16) & 0xffff;\n    out[op++] = (in7 >>> 0) & 0xffff;\n    out[op++] = (in7 >>> 16) & 0xffff;\n    out[op++] = (in8 >>> 0) & 0xffff;\n    out[op++] = (in8 >>> 16) & 0xffff;\n    out[op++] = (in9 >>> 0) & 0xffff;\n    out[op++] = (in9 >>> 16) & 0xffff;\n    out[op++] = (in10 >>> 0) & 0xffff;\n    out[op++] = (in10 >>> 16) & 0xffff;\n    out[op++] = (in11 >>> 0) & 0xffff;\n    out[op++] = (in11 >>> 16) & 0xffff;\n    out[op++] = (in12 >>> 0) & 0xffff;\n    out[op++] = (in12 >>> 16) & 0xffff;\n    out[op++] = (in13 >>> 0) & 0xffff;\n    out[op++] = (in13 >>> 16) & 0xffff;\n    out[op++] = (in14 >>> 0) & 0xffff;\n    out[op++] = (in14 >>> 16) & 0xffff;\n    out[op++] = (in15 >>> 0) & 0xffff;\n    out[op] = (in15 >>> 16) & 0xffff;\n}\nexport function fastUnpack256_1(inValues, inPos, out, outPos) {\n    let op = outPos;\n    let ip = inPos;\n    for (let c = 0; c < 8; c++) {\n        const in0 = inValues[ip++] >>> 0;\n        out[op++] = (in0 >>> 0) & 0x1;\n        out[op++] = (in0 >>> 1) & 0x1;\n        out[op++] = (in0 >>> 2) & 0x1;\n        out[op++] = (in0 >>> 3) & 0x1;\n        out[op++] = (in0 >>> 4) & 0x1;\n        out[op++] = (in0 >>> 5) & 0x1;\n        out[op++] = (in0 >>> 6) & 0x1;\n        out[op++] = (in0 >>> 7) & 0x1;\n        out[op++] = (in0 >>> 8) & 0x1;\n        out[op++] = (in0 >>> 9) & 0x1;\n        out[op++] = (in0 >>> 10) & 0x1;\n        out[op++] = (in0 >>> 11) & 0x1;\n        out[op++] = (in0 >>> 12) & 0x1;\n        out[op++] = (in0 >>> 13) & 0x1;\n        out[op++] = (in0 >>> 14) & 0x1;\n        out[op++] = (in0 >>> 15) & 0x1;\n        out[op++] = (in0 >>> 16) & 0x1;\n        out[op++] = (in0 >>> 17) & 0x1;\n        out[op++] = (in0 >>> 18) & 0x1;\n        out[op++] = (in0 >>> 19) & 0x1;\n        out[op++] = (in0 >>> 20) & 0x1;\n        out[op++] = (in0 >>> 21) & 0x1;\n        out[op++] = (in0 >>> 22) & 0x1;\n        out[op++] = (in0 >>> 23) & 0x1;\n        out[op++] = (in0 >>> 24) & 0x1;\n        out[op++] = (in0 >>> 25) & 0x1;\n        out[op++] = (in0 >>> 26) & 0x1;\n        out[op++] = (in0 >>> 27) & 0x1;\n        out[op++] = (in0 >>> 28) & 0x1;\n        out[op++] = (in0 >>> 29) & 0x1;\n        out[op++] = (in0 >>> 30) & 0x1;\n        out[op++] = (in0 >>> 31) & 0x1;\n    }\n}\nexport function fastUnpack256_2(inValues, inPos, out, outPos) {\n    let op = outPos;\n    let ip = inPos;\n    for (let c = 0; c < 8; c++) {\n        const in0 = inValues[ip++] >>> 0;\n        const in1 = inValues[ip++] >>> 0;\n        out[op++] = (in0 >>> 0) & 0x3;\n        out[op++] = (in0 >>> 2) & 0x3;\n        out[op++] = (in0 >>> 4) & 0x3;\n        out[op++] = (in0 >>> 6) & 0x3;\n        out[op++] = (in0 >>> 8) & 0x3;\n        out[op++] = (in0 >>> 10) & 0x3;\n        out[op++] = (in0 >>> 12) & 0x3;\n        out[op++] = (in0 >>> 14) & 0x3;\n        out[op++] = (in0 >>> 16) & 0x3;\n        out[op++] = (in0 >>> 18) & 0x3;\n        out[op++] = (in0 >>> 20) & 0x3;\n        out[op++] = (in0 >>> 22) & 0x3;\n        out[op++] = (in0 >>> 24) & 0x3;\n        out[op++] = (in0 >>> 26) & 0x3;\n        out[op++] = (in0 >>> 28) & 0x3;\n        out[op++] = (in0 >>> 30) & 0x3;\n        out[op++] = (in1 >>> 0) & 0x3;\n        out[op++] = (in1 >>> 2) & 0x3;\n        out[op++] = (in1 >>> 4) & 0x3;\n        out[op++] = (in1 >>> 6) & 0x3;\n        out[op++] = (in1 >>> 8) & 0x3;\n        out[op++] = (in1 >>> 10) & 0x3;\n        out[op++] = (in1 >>> 12) & 0x3;\n        out[op++] = (in1 >>> 14) & 0x3;\n        out[op++] = (in1 >>> 16) & 0x3;\n        out[op++] = (in1 >>> 18) & 0x3;\n        out[op++] = (in1 >>> 20) & 0x3;\n        out[op++] = (in1 >>> 22) & 0x3;\n        out[op++] = (in1 >>> 24) & 0x3;\n        out[op++] = (in1 >>> 26) & 0x3;\n        out[op++] = (in1 >>> 28) & 0x3;\n        out[op++] = (in1 >>> 30) & 0x3;\n    }\n}\nexport function fastUnpack256_3(inValues, inPos, out, outPos) {\n    let op = outPos;\n    let ip = inPos;\n    for (let c = 0; c < 8; c++) {\n        const in0 = inValues[ip++] >>> 0;\n        const in1 = inValues[ip++] >>> 0;\n        const in2 = inValues[ip++] >>> 0;\n        out[op++] = (in0 >>> 0) & 0x7;\n        out[op++] = (in0 >>> 3) & 0x7;\n        out[op++] = (in0 >>> 6) & 0x7;\n        out[op++] = (in0 >>> 9) & 0x7;\n        out[op++] = (in0 >>> 12) & 0x7;\n        out[op++] = (in0 >>> 15) & 0x7;\n        out[op++] = (in0 >>> 18) & 0x7;\n        out[op++] = (in0 >>> 21) & 0x7;\n        out[op++] = (in0 >>> 24) & 0x7;\n        out[op++] = (in0 >>> 27) & 0x7;\n        out[op++] = ((in0 >>> 30) | ((in1 & 0x1) << 2)) & 0x7;\n        out[op++] = (in1 >>> 1) & 0x7;\n        out[op++] = (in1 >>> 4) & 0x7;\n        out[op++] = (in1 >>> 7) & 0x7;\n        out[op++] = (in1 >>> 10) & 0x7;\n        out[op++] = (in1 >>> 13) & 0x7;\n        out[op++] = (in1 >>> 16) & 0x7;\n        out[op++] = (in1 >>> 19) & 0x7;\n        out[op++] = (in1 >>> 22) & 0x7;\n        out[op++] = (in1 >>> 25) & 0x7;\n        out[op++] = (in1 >>> 28) & 0x7;\n        out[op++] = ((in1 >>> 31) | ((in2 & 0x3) << 1)) & 0x7;\n        out[op++] = (in2 >>> 2) & 0x7;\n        out[op++] = (in2 >>> 5) & 0x7;\n        out[op++] = (in2 >>> 8) & 0x7;\n        out[op++] = (in2 >>> 11) & 0x7;\n        out[op++] = (in2 >>> 14) & 0x7;\n        out[op++] = (in2 >>> 17) & 0x7;\n        out[op++] = (in2 >>> 20) & 0x7;\n        out[op++] = (in2 >>> 23) & 0x7;\n        out[op++] = (in2 >>> 26) & 0x7;\n        out[op++] = (in2 >>> 29) & 0x7;\n    }\n}\nexport function fastUnpack256_4(inValues, inPos, out, outPos) {\n    let op = outPos;\n    let ip = inPos;\n    for (let c = 0; c < 8; c++) {\n        const in0 = inValues[ip++] >>> 0;\n        const in1 = inValues[ip++] >>> 0;\n        const in2 = inValues[ip++] >>> 0;\n        const in3 = inValues[ip++] >>> 0;\n        out[op++] = (in0 >>> 0) & 0xf;\n        out[op++] = (in0 >>> 4) & 0xf;\n        out[op++] = (in0 >>> 8) & 0xf;\n        out[op++] = (in0 >>> 12) & 0xf;\n        out[op++] = (in0 >>> 16) & 0xf;\n        out[op++] = (in0 >>> 20) & 0xf;\n        out[op++] = (in0 >>> 24) & 0xf;\n        out[op++] = (in0 >>> 28) & 0xf;\n        out[op++] = (in1 >>> 0) & 0xf;\n        out[op++] = (in1 >>> 4) & 0xf;\n        out[op++] = (in1 >>> 8) & 0xf;\n        out[op++] = (in1 >>> 12) & 0xf;\n        out[op++] = (in1 >>> 16) & 0xf;\n        out[op++] = (in1 >>> 20) & 0xf;\n        out[op++] = (in1 >>> 24) & 0xf;\n        out[op++] = (in1 >>> 28) & 0xf;\n        out[op++] = (in2 >>> 0) & 0xf;\n        out[op++] = (in2 >>> 4) & 0xf;\n        out[op++] = (in2 >>> 8) & 0xf;\n        out[op++] = (in2 >>> 12) & 0xf;\n        out[op++] = (in2 >>> 16) & 0xf;\n        out[op++] = (in2 >>> 20) & 0xf;\n        out[op++] = (in2 >>> 24) & 0xf;\n        out[op++] = (in2 >>> 28) & 0xf;\n        out[op++] = (in3 >>> 0) & 0xf;\n        out[op++] = (in3 >>> 4) & 0xf;\n        out[op++] = (in3 >>> 8) & 0xf;\n        out[op++] = (in3 >>> 12) & 0xf;\n        out[op++] = (in3 >>> 16) & 0xf;\n        out[op++] = (in3 >>> 20) & 0xf;\n        out[op++] = (in3 >>> 24) & 0xf;\n        out[op++] = (in3 >>> 28) & 0xf;\n    }\n}\nexport function fastUnpack256_5(inValues, inPos, out, outPos) {\n    let op = outPos;\n    let ip = inPos;\n    for (let c = 0; c < 8; c++) {\n        const in0 = inValues[ip++] >>> 0;\n        const in1 = inValues[ip++] >>> 0;\n        const in2 = inValues[ip++] >>> 0;\n        const in3 = inValues[ip++] >>> 0;\n        const in4 = inValues[ip++] >>> 0;\n        out[op++] = (in0 >>> 0) & 0x1f;\n        out[op++] = (in0 >>> 5) & 0x1f;\n        out[op++] = (in0 >>> 10) & 0x1f;\n        out[op++] = (in0 >>> 15) & 0x1f;\n        out[op++] = (in0 >>> 20) & 0x1f;\n        out[op++] = (in0 >>> 25) & 0x1f;\n        out[op++] = ((in0 >>> 30) | ((in1 & 0x7) << 2)) & 0x1f;\n        out[op++] = (in1 >>> 3) & 0x1f;\n        out[op++] = (in1 >>> 8) & 0x1f;\n        out[op++] = (in1 >>> 13) & 0x1f;\n        out[op++] = (in1 >>> 18) & 0x1f;\n        out[op++] = (in1 >>> 23) & 0x1f;\n        out[op++] = ((in1 >>> 28) | ((in2 & 0x1) << 4)) & 0x1f;\n        out[op++] = (in2 >>> 1) & 0x1f;\n        out[op++] = (in2 >>> 6) & 0x1f;\n        out[op++] = (in2 >>> 11) & 0x1f;\n        out[op++] = (in2 >>> 16) & 0x1f;\n        out[op++] = (in2 >>> 21) & 0x1f;\n        out[op++] = (in2 >>> 26) & 0x1f;\n        out[op++] = ((in2 >>> 31) | ((in3 & 0xf) << 1)) & 0x1f;\n        out[op++] = (in3 >>> 4) & 0x1f;\n        out[op++] = (in3 >>> 9) & 0x1f;\n        out[op++] = (in3 >>> 14) & 0x1f;\n        out[op++] = (in3 >>> 19) & 0x1f;\n        out[op++] = (in3 >>> 24) & 0x1f;\n        out[op++] = ((in3 >>> 29) | ((in4 & 0x3) << 3)) & 0x1f;\n        out[op++] = (in4 >>> 2) & 0x1f;\n        out[op++] = (in4 >>> 7) & 0x1f;\n        out[op++] = (in4 >>> 12) & 0x1f;\n        out[op++] = (in4 >>> 17) & 0x1f;\n        out[op++] = (in4 >>> 22) & 0x1f;\n        out[op++] = (in4 >>> 27) & 0x1f;\n    }\n}\nexport function fastUnpack256_6(inValues, inPos, out, outPos) {\n    let op = outPos;\n    let ip = inPos;\n    for (let c = 0; c < 8; c++) {\n        const in0 = inValues[ip++] >>> 0;\n        const in1 = inValues[ip++] >>> 0;\n        const in2 = inValues[ip++] >>> 0;\n        const in3 = inValues[ip++] >>> 0;\n        const in4 = inValues[ip++] >>> 0;\n        const in5 = inValues[ip++] >>> 0;\n        out[op++] = (in0 >>> 0) & 0x3f;\n        out[op++] = (in0 >>> 6) & 0x3f;\n        out[op++] = (in0 >>> 12) & 0x3f;\n        out[op++] = (in0 >>> 18) & 0x3f;\n        out[op++] = (in0 >>> 24) & 0x3f;\n        out[op++] = ((in0 >>> 30) | ((in1 & 0xf) << 2)) & 0x3f;\n        out[op++] = (in1 >>> 4) & 0x3f;\n        out[op++] = (in1 >>> 10) & 0x3f;\n        out[op++] = (in1 >>> 16) & 0x3f;\n        out[op++] = (in1 >>> 22) & 0x3f;\n        out[op++] = ((in1 >>> 28) | ((in2 & 0x3) << 4)) & 0x3f;\n        out[op++] = (in2 >>> 2) & 0x3f;\n        out[op++] = (in2 >>> 8) & 0x3f;\n        out[op++] = (in2 >>> 14) & 0x3f;\n        out[op++] = (in2 >>> 20) & 0x3f;\n        out[op++] = (in2 >>> 26) & 0x3f;\n        out[op++] = (in3 >>> 0) & 0x3f;\n        out[op++] = (in3 >>> 6) & 0x3f;\n        out[op++] = (in3 >>> 12) & 0x3f;\n        out[op++] = (in3 >>> 18) & 0x3f;\n        out[op++] = (in3 >>> 24) & 0x3f;\n        out[op++] = ((in3 >>> 30) | ((in4 & 0xf) << 2)) & 0x3f;\n        out[op++] = (in4 >>> 4) & 0x3f;\n        out[op++] = (in4 >>> 10) & 0x3f;\n        out[op++] = (in4 >>> 16) & 0x3f;\n        out[op++] = (in4 >>> 22) & 0x3f;\n        out[op++] = ((in4 >>> 28) | ((in5 & 0x3) << 4)) & 0x3f;\n        out[op++] = (in5 >>> 2) & 0x3f;\n        out[op++] = (in5 >>> 8) & 0x3f;\n        out[op++] = (in5 >>> 14) & 0x3f;\n        out[op++] = (in5 >>> 20) & 0x3f;\n        out[op++] = (in5 >>> 26) & 0x3f;\n    }\n}\nexport function fastUnpack256_7(inValues, inPos, out, outPos) {\n    let op = outPos;\n    let ip = inPos;\n    for (let c = 0; c < 8; c++) {\n        const in0 = inValues[ip++] >>> 0;\n        const in1 = inValues[ip++] >>> 0;\n        const in2 = inValues[ip++] >>> 0;\n        const in3 = inValues[ip++] >>> 0;\n        const in4 = inValues[ip++] >>> 0;\n        const in5 = inValues[ip++] >>> 0;\n        const in6 = inValues[ip++] >>> 0;\n        out[op++] = (in0 >>> 0) & 0x7f;\n        out[op++] = (in0 >>> 7) & 0x7f;\n        out[op++] = (in0 >>> 14) & 0x7f;\n        out[op++] = (in0 >>> 21) & 0x7f;\n        out[op++] = ((in0 >>> 28) | ((in1 & 0x7) << 4)) & 0x7f;\n        out[op++] = (in1 >>> 3) & 0x7f;\n        out[op++] = (in1 >>> 10) & 0x7f;\n        out[op++] = (in1 >>> 17) & 0x7f;\n        out[op++] = (in1 >>> 24) & 0x7f;\n        out[op++] = ((in1 >>> 31) | ((in2 & 0x3f) << 1)) & 0x7f;\n        out[op++] = (in2 >>> 6) & 0x7f;\n        out[op++] = (in2 >>> 13) & 0x7f;\n        out[op++] = (in2 >>> 20) & 0x7f;\n        out[op++] = ((in2 >>> 27) | ((in3 & 0x3) << 5)) & 0x7f;\n        out[op++] = (in3 >>> 2) & 0x7f;\n        out[op++] = (in3 >>> 9) & 0x7f;\n        out[op++] = (in3 >>> 16) & 0x7f;\n        out[op++] = (in3 >>> 23) & 0x7f;\n        out[op++] = ((in3 >>> 30) | ((in4 & 0x1f) << 2)) & 0x7f;\n        out[op++] = (in4 >>> 5) & 0x7f;\n        out[op++] = (in4 >>> 12) & 0x7f;\n        out[op++] = (in4 >>> 19) & 0x7f;\n        out[op++] = ((in4 >>> 26) | ((in5 & 0x1) << 6)) & 0x7f;\n        out[op++] = (in5 >>> 1) & 0x7f;\n        out[op++] = (in5 >>> 8) & 0x7f;\n        out[op++] = (in5 >>> 15) & 0x7f;\n        out[op++] = (in5 >>> 22) & 0x7f;\n        out[op++] = ((in5 >>> 29) | ((in6 & 0xf) << 3)) & 0x7f;\n        out[op++] = (in6 >>> 4) & 0x7f;\n        out[op++] = (in6 >>> 11) & 0x7f;\n        out[op++] = (in6 >>> 18) & 0x7f;\n        out[op++] = (in6 >>> 25) & 0x7f;\n    }\n}\nexport function fastUnpack256_8(inValues, inPos, out, outPos) {\n    let op = outPos;\n    let ip = inPos;\n    for (let c = 0; c < 8; c++) {\n        const in0 = inValues[ip++] >>> 0;\n        const in1 = inValues[ip++] >>> 0;\n        const in2 = inValues[ip++] >>> 0;\n        const in3 = inValues[ip++] >>> 0;\n        const in4 = inValues[ip++] >>> 0;\n        const in5 = inValues[ip++] >>> 0;\n        const in6 = inValues[ip++] >>> 0;\n        const in7 = inValues[ip++] >>> 0;\n        out[op++] = (in0 >>> 0) & 0xff;\n        out[op++] = (in0 >>> 8) & 0xff;\n        out[op++] = (in0 >>> 16) & 0xff;\n        out[op++] = (in0 >>> 24) & 0xff;\n        out[op++] = (in1 >>> 0) & 0xff;\n        out[op++] = (in1 >>> 8) & 0xff;\n        out[op++] = (in1 >>> 16) & 0xff;\n        out[op++] = (in1 >>> 24) & 0xff;\n        out[op++] = (in2 >>> 0) & 0xff;\n        out[op++] = (in2 >>> 8) & 0xff;\n        out[op++] = (in2 >>> 16) & 0xff;\n        out[op++] = (in2 >>> 24) & 0xff;\n        out[op++] = (in3 >>> 0) & 0xff;\n        out[op++] = (in3 >>> 8) & 0xff;\n        out[op++] = (in3 >>> 16) & 0xff;\n        out[op++] = (in3 >>> 24) & 0xff;\n        out[op++] = (in4 >>> 0) & 0xff;\n        out[op++] = (in4 >>> 8) & 0xff;\n        out[op++] = (in4 >>> 16) & 0xff;\n        out[op++] = (in4 >>> 24) & 0xff;\n        out[op++] = (in5 >>> 0) & 0xff;\n        out[op++] = (in5 >>> 8) & 0xff;\n        out[op++] = (in5 >>> 16) & 0xff;\n        out[op++] = (in5 >>> 24) & 0xff;\n        out[op++] = (in6 >>> 0) & 0xff;\n        out[op++] = (in6 >>> 8) & 0xff;\n        out[op++] = (in6 >>> 16) & 0xff;\n        out[op++] = (in6 >>> 24) & 0xff;\n        out[op++] = (in7 >>> 0) & 0xff;\n        out[op++] = (in7 >>> 8) & 0xff;\n        out[op++] = (in7 >>> 16) & 0xff;\n        out[op++] = (in7 >>> 24) & 0xff;\n    }\n}\nexport function fastUnpack256_16(inValues, inPos, out, outPos) {\n    let op = outPos;\n    let ip = inPos;\n    for (let i = 0; i < 128; i++) {\n        const in0 = inValues[ip++] >>> 0;\n        out[op++] = in0 & 0xffff;\n        out[op++] = (in0 >>> 16) & 0xffff;\n    }\n}\nexport function fastUnpack256_Generic(inValues, inPos, out, outPos, bitWidth) {\n    const mask = MASKS[bitWidth] >>> 0;\n    let inputWordIndex = inPos;\n    let bitOffset = 0;\n    let currentWord = inValues[inputWordIndex] >>> 0;\n    let op = outPos;\n    for (let c = 0; c < 8; c++) {\n        for (let i = 0; i < 32; i++) {\n            if (bitOffset + bitWidth <= 32) {\n                const value = (currentWord >>> bitOffset) & mask;\n                out[op + i] = value | 0;\n                bitOffset += bitWidth;\n                if (bitOffset === 32) {\n                    bitOffset = 0;\n                    inputWordIndex++;\n                    if (i !== 31) {\n                        currentWord = inValues[inputWordIndex] >>> 0;\n                    }\n                }\n            }\n            else {\n                const lowBits = 32 - bitOffset;\n                const low = currentWord >>> bitOffset;\n                inputWordIndex++;\n                currentWord = inValues[inputWordIndex] >>> 0;\n                const highBits = bitWidth - lowBits;\n                const highMask = (-1 >>> (32 - highBits)) >>> 0;\n                const high = currentWord & highMask;\n                const value = (low | (high << lowBits)) & mask;\n                out[op + i] = value | 0;\n                bitOffset = highBits;\n            }\n        }\n        op += 32;\n        bitOffset = 0;\n        if (c < 7) {\n            currentWord = inValues[inputWordIndex] >>> 0;\n        }\n    }\n}\n//# sourceMappingURL=fastPforUnpack.js.map", "import { createFastPforWireDecodeWorkspace, decodeFastPforInt32, ensureFastPforWireEncodedWordsCapacity, } from \"./fastPforDecoder\";\nimport { decodeBigEndianInt32sInto } from \"./bigEndianDecode\";\nexport { createFastPforWireDecodeWorkspace } from \"./fastPforDecoder\";\n//based on https://github.com/mapbox/pbf/blob/main/index.js\nexport function decodeVarintInt32(buf, bufferOffset, numValues) {\n    const dst = new Uint32Array(numValues);\n    let dstOffset = 0;\n    let offset = bufferOffset.get();\n    for (let i = 0; i < dst.length; i++) {\n        let b = buf[offset++];\n        let val = b & 0x7f;\n        if (b < 0x80) {\n            dst[dstOffset++] = val;\n            continue;\n        }\n        b = buf[offset++];\n        val |= (b & 0x7f) << 7;\n        if (b < 0x80) {\n            dst[dstOffset++] = val;\n            continue;\n        }\n        b = buf[offset++];\n        val |= (b & 0x7f) << 14;\n        if (b < 0x80) {\n            dst[dstOffset++] = val;\n            continue;\n        }\n        b = buf[offset++];\n        val |= (b & 0x7f) << 21;\n        if (b < 0x80) {\n            dst[dstOffset++] = val;\n            continue;\n        }\n        b = buf[offset++];\n        val |= (b & 0x0f) << 28;\n        dst[dstOffset++] = val;\n    }\n    bufferOffset.set(offset);\n    return dst;\n}\nexport function decodeVarintInt64(src, offset, numValues) {\n    const dst = new BigUint64Array(numValues);\n    for (let i = 0; i < dst.length; i++) {\n        dst[i] = decodeVarintInt64Value(src, offset);\n    }\n    return dst;\n}\n// Source: https://github.com/bazelbuild/bazel/blob/master/src/main/java/com/google/devtools/build/lib/util/VarInt.java\nfunction decodeVarintInt64Value(bytes, pos) {\n    let value = 0n;\n    let shift = 0;\n    let index = pos.get();\n    while (index < bytes.length) {\n        const b = bytes[index++];\n        value |= BigInt(b & 0x7f) << BigInt(shift);\n        if ((b & 0x80) === 0) {\n            break;\n        }\n        shift += 7;\n        if (shift >= 64) {\n            throw new Error(\"Varint too long\");\n        }\n    }\n    pos.set(index);\n    return value;\n}\n/*\n * Since decoding Int64 values to BigInt is more than an order of magnitude slower in the tests then using a Float64,\n * this decoding method limits the max size of a Long value to 53 bits\n */\nexport function decodeVarintFloat64(src, offset, numValues) {\n    const dst = new Float64Array(numValues);\n    for (let i = 0; i < numValues; i++) {\n        dst[i] = decodeVarintFloat64Value(src, offset);\n    }\n    return dst;\n}\n//based on https://github.com/mapbox/pbf/blob/main/index.js\nfunction decodeVarintFloat64Value(buf, offset) {\n    let val;\n    let b;\n    b = buf[offset.get()];\n    offset.increment();\n    val = b & 0x7f;\n    if (b < 0x80)\n        return val;\n    b = buf[offset.get()];\n    offset.increment();\n    val |= (b & 0x7f) << 7;\n    if (b < 0x80)\n        return val;\n    b = buf[offset.get()];\n    offset.increment();\n    val |= (b & 0x7f) << 14;\n    if (b < 0x80)\n        return val;\n    b = buf[offset.get()];\n    offset.increment();\n    val |= (b & 0x7f) << 21;\n    if (b < 0x80)\n        return val;\n    b = buf[offset.get()];\n    val |= (b & 0x0f) << 28;\n    return decodeVarintRemainder(val, buf, offset);\n}\nfunction decodeVarintRemainder(l, buf, offset) {\n    let h;\n    let b;\n    b = buf[offset.get()];\n    offset.increment();\n    h = (b & 0x70) >> 4;\n    if (b < 0x80)\n        return h * 0x100000000 + (l >>> 0);\n    b = buf[offset.get()];\n    offset.increment();\n    h |= (b & 0x7f) << 3;\n    if (b < 0x80)\n        return h * 0x100000000 + (l >>> 0);\n    b = buf[offset.get()];\n    offset.increment();\n    h |= (b & 0x7f) << 10;\n    if (b < 0x80)\n        return h * 0x100000000 + (l >>> 0);\n    b = buf[offset.get()];\n    offset.increment();\n    h |= (b & 0x7f) << 17;\n    if (b < 0x80)\n        return h * 0x100000000 + (l >>> 0);\n    b = buf[offset.get()];\n    offset.increment();\n    h |= (b & 0x7f) << 24;\n    if (b < 0x80)\n        return h * 0x100000000 + (l >>> 0);\n    b = buf[offset.get()];\n    offset.increment();\n    h |= (b & 0x01) << 31;\n    if (b < 0x80)\n        return h * 0x100000000 + (l >>> 0);\n    throw new Error(\"Expected varint not more than 10 bytes\");\n}\nexport function decodeFastPfor(encodedBytes, expectedValueCount, encodedByteLength, offset) {\n    const workspace = createFastPforWireDecodeWorkspace(encodedByteLength >>> 2);\n    return decodeFastPforWithWorkspace(encodedBytes, expectedValueCount, encodedByteLength, offset, workspace);\n}\nexport function decodeFastPforWithWorkspace(encodedBytes, expectedValueCount, encodedByteLength, offset, workspace) {\n    const inputByteOffset = offset.get();\n    if ((encodedByteLength & 3) !== 0) {\n        throw new Error(`FastPFOR: invalid encodedByteLength=${encodedByteLength} at offset=${inputByteOffset} (encodedBytes.length=${encodedBytes.length}; expected a multiple of 4 bytes for an int32 big-endian word stream)`);\n    }\n    const encodedWordCount = encodedByteLength >>> 2;\n    const encodedWordBuffer = ensureFastPforWireEncodedWordsCapacity(workspace, encodedWordCount);\n    decodeBigEndianInt32sInto(encodedBytes, inputByteOffset, encodedByteLength, encodedWordBuffer);\n    const decodedValues = decodeFastPforInt32(encodedWordBuffer.subarray(0, encodedWordCount), expectedValueCount, workspace.decoderWorkspace);\n    offset.add(encodedByteLength);\n    return decodedValues;\n}\nexport function decodeZigZagInt32Value(encoded) {\n    return (encoded >>> 1) ^ -(encoded & 1);\n}\nexport function decodeZigZagInt64Value(encoded) {\n    return (encoded >> 1n) ^ -(encoded & 1n);\n}\nexport function decodeZigZagFloat64Value(encoded) {\n    return encoded % 2 === 1 ? (encoded + 1) / -2 : encoded / 2;\n}\nexport function decodeZigZagInt32(encodedData) {\n    const decodedValues = new Int32Array(encodedData.length);\n    for (let i = 0; i < encodedData.length; i++) {\n        decodedValues[i] = decodeZigZagInt32Value(encodedData[i]);\n    }\n    return decodedValues;\n}\nexport function decodeZigZagInt64(encodedData) {\n    const decodedValues = new BigInt64Array(encodedData.length);\n    for (let i = 0; i < encodedData.length; i++) {\n        decodedValues[i] = decodeZigZagInt64Value(encodedData[i]);\n    }\n    return decodedValues;\n}\nexport function decodeZigZagFloat64(encodedData) {\n    for (let i = 0; i < encodedData.length; i++) {\n        encodedData[i] = decodeZigZagFloat64Value(encodedData[i]);\n    }\n}\nexport function decodeUnsignedRleInt32(encodedData, numRuns, numTotalValues) {\n    // If numTotalValues not provided, calculate from runs (nullable case)\n    if (numTotalValues === undefined) {\n        numTotalValues = 0;\n        for (let i = 0; i < numRuns; i++) {\n            numTotalValues += encodedData[i];\n        }\n    }\n    const decodedValues = new Uint32Array(numTotalValues);\n    let offset = 0;\n    for (let i = 0; i < numRuns; i++) {\n        const runLength = encodedData[i];\n        const value = encodedData[i + numRuns];\n        decodedValues.fill(value, offset, offset + runLength);\n        offset += runLength;\n    }\n    return decodedValues;\n}\nexport function decodeUnsignedRleInt64(encodedData, numRuns, numTotalValues) {\n    // If numTotalValues not provided, calculate from runs (nullable case)\n    if (numTotalValues === undefined) {\n        numTotalValues = 0;\n        for (let i = 0; i < numRuns; i++) {\n            numTotalValues += Number(encodedData[i]);\n        }\n    }\n    const decodedValues = new BigUint64Array(numTotalValues);\n    let offset = 0;\n    for (let i = 0; i < numRuns; i++) {\n        const runLength = Number(encodedData[i]);\n        const value = encodedData[i + numRuns];\n        decodedValues.fill(value, offset, offset + runLength);\n        offset += runLength;\n    }\n    return decodedValues;\n}\nexport function decodeUnsignedRleFloat64(encodedData, numRuns, numTotalValues) {\n    const decodedValues = new Float64Array(numTotalValues);\n    let offset = 0;\n    for (let i = 0; i < numRuns; i++) {\n        const runLength = encodedData[i];\n        const value = encodedData[i + numRuns];\n        decodedValues.fill(value, offset, offset + runLength);\n        offset += runLength;\n    }\n    return decodedValues;\n}\n/*\n * In place decoding of the zigzag encoded delta values.\n * Inspired by https://github.com/lemire/JavaFastPFOR/blob/master/src/main/java/me/lemire/integercompression/differential/Delta.java\n */\nexport function decodeZigZagDeltaInt32(data) {\n    const decodedValues = new Int32Array(data.length);\n    decodedValues[0] = decodeZigZagInt32Value(data[0]);\n    const sz0 = (data.length / 4) * 4;\n    let i = 1;\n    if (sz0 >= 4) {\n        for (; i < sz0 - 4; i += 4) {\n            const data1 = data[i];\n            const data2 = data[i + 1];\n            const data3 = data[i + 2];\n            const data4 = data[i + 3];\n            decodedValues[i] = decodeZigZagInt32Value(data1) + decodedValues[i - 1];\n            decodedValues[i + 1] = decodeZigZagInt32Value(data2) + decodedValues[i];\n            decodedValues[i + 2] = decodeZigZagInt32Value(data3) + decodedValues[i + 1];\n            decodedValues[i + 3] = decodeZigZagInt32Value(data4) + decodedValues[i + 2];\n        }\n    }\n    for (; i !== data.length; ++i) {\n        decodedValues[i] = decodeZigZagInt32Value(data[i]) + decodedValues[i - 1];\n    }\n    return decodedValues;\n}\nexport function decodeZigZagDeltaInt64(data) {\n    const decodedValues = new BigInt64Array(data.length);\n    decodedValues[0] = decodeZigZagInt64Value(data[0]);\n    const sz0 = (data.length / 4) * 4;\n    let i = 1;\n    if (sz0 >= 4) {\n        for (; i < sz0 - 4; i += 4) {\n            const data1 = data[i];\n            const data2 = data[i + 1];\n            const data3 = data[i + 2];\n            const data4 = data[i + 3];\n            decodedValues[i] = decodeZigZagInt64Value(data1) + decodedValues[i - 1];\n            decodedValues[i + 1] = decodeZigZagInt64Value(data2) + decodedValues[i];\n            decodedValues[i + 2] = decodeZigZagInt64Value(data3) + decodedValues[i + 1];\n            decodedValues[i + 3] = decodeZigZagInt64Value(data4) + decodedValues[i + 2];\n        }\n    }\n    for (; i !== decodedValues.length; ++i) {\n        decodedValues[i] = decodeZigZagInt64Value(data[i]) + decodedValues[i - 1];\n    }\n    return decodedValues;\n}\nexport function decodeZigZagDeltaFloat64(data) {\n    data[0] = decodeZigZagFloat64Value(data[0]);\n    const sz0 = (data.length / 4) * 4;\n    let i = 1;\n    if (sz0 >= 4) {\n        for (; i < sz0 - 4; i += 4) {\n            const data1 = data[i];\n            const data2 = data[i + 1];\n            const data3 = data[i + 2];\n            const data4 = data[i + 3];\n            data[i] = decodeZigZagFloat64Value(data1) + data[i - 1];\n            data[i + 1] = decodeZigZagFloat64Value(data2) + data[i];\n            data[i + 2] = decodeZigZagFloat64Value(data3) + data[i + 1];\n            data[i + 3] = decodeZigZagFloat64Value(data4) + data[i + 2];\n        }\n    }\n    for (; i !== data.length; ++i) {\n        data[i] = decodeZigZagFloat64Value(data[i]) + data[i - 1];\n    }\n}\nexport function decodeZigZagRleInt32(data, numRuns, numTotalValues) {\n    // If numTotalValues not provided, calculate from runs (nullable case)\n    if (numTotalValues === undefined) {\n        numTotalValues = 0;\n        for (let i = 0; i < numRuns; i++) {\n            numTotalValues += data[i];\n        }\n    }\n    const decodedValues = new Int32Array(numTotalValues);\n    let offset = 0;\n    for (let i = 0; i < numRuns; i++) {\n        const runLength = data[i];\n        let value = data[i + numRuns];\n        value = decodeZigZagInt32Value(value);\n        decodedValues.fill(value, offset, offset + runLength);\n        offset += runLength;\n    }\n    return decodedValues;\n}\nexport function decodeZigZagRleInt64(data, numRuns, numTotalValues) {\n    // If numTotalValues not provided, calculate from runs (nullable case)\n    if (numTotalValues === undefined) {\n        numTotalValues = 0;\n        for (let i = 0; i < numRuns; i++) {\n            numTotalValues += Number(data[i]);\n        }\n    }\n    const decodedValues = new BigInt64Array(numTotalValues);\n    let offset = 0;\n    for (let i = 0; i < numRuns; i++) {\n        const runLength = Number(data[i]);\n        let value = data[i + numRuns];\n        value = decodeZigZagInt64Value(value);\n        decodedValues.fill(value, offset, offset + runLength);\n        offset += runLength;\n    }\n    return decodedValues;\n}\nexport function decodeZigZagRleFloat64(data, numRuns, numTotalValues) {\n    const decodedValues = new Float64Array(numTotalValues);\n    let offset = 0;\n    for (let i = 0; i < numRuns; i++) {\n        const runLength = data[i];\n        let value = data[i + numRuns];\n        value = decodeZigZagFloat64Value(value);\n        decodedValues.fill(value, offset, offset + runLength);\n        offset += runLength;\n    }\n    return decodedValues;\n}\n/*\n * Inspired by https://github.com/lemire/JavaFastPFOR/blob/master/src/main/java/me/lemire/integercompression/differential/Delta.java\n */\nexport function fastInverseDelta(data) {\n    const sz0 = (data.length / 4) * 4;\n    let i = 1;\n    if (sz0 >= 4) {\n        for (let a = data[0]; i < sz0 - 4; i += 4) {\n            a = data[i] += a;\n            a = data[i + 1] += a;\n            a = data[i + 2] += a;\n            a = data[i + 3] += a;\n        }\n    }\n    while (i !== data.length) {\n        data[i] += data[i - 1];\n        ++i;\n    }\n}\nexport function inverseDelta(data) {\n    let prevValue = 0;\n    for (let i = 0; i < data.length; i++) {\n        data[i] += prevValue;\n        prevValue = data[i];\n    }\n}\n/*\n * In place decoding of the zigzag delta encoded Vec2.\n * Inspired by https://github.com/lemire/JavaFastPFOR/blob/master/src/main/java/me/lemire/integercompression/differential/Delta.java\n */\nexport function decodeComponentwiseDeltaVec2(data) {\n    if (data.length < 2)\n        return new Int32Array(data);\n    const decodedData = new Int32Array(data.length);\n    decodedData[0] = decodeZigZagInt32Value(data[0]);\n    decodedData[1] = decodeZigZagInt32Value(data[1]);\n    const sz0 = (data.length / 4) * 4;\n    let i = 2;\n    if (sz0 >= 4) {\n        for (; i < sz0 - 4; i += 4) {\n            const x1 = data[i];\n            const y1 = data[i + 1];\n            const x2 = data[i + 2];\n            const y2 = data[i + 3];\n            decodedData[i] = decodeZigZagInt32Value(x1) + decodedData[i - 2];\n            decodedData[i + 1] = decodeZigZagInt32Value(y1) + decodedData[i - 1];\n            decodedData[i + 2] = decodeZigZagInt32Value(x2) + decodedData[i];\n            decodedData[i + 3] = decodeZigZagInt32Value(y2) + decodedData[i + 1];\n        }\n    }\n    for (; i !== data.length; i += 2) {\n        decodedData[i] = decodeZigZagInt32Value(data[i]) + decodedData[i - 2];\n        decodedData[i + 1] = decodeZigZagInt32Value(data[i + 1]) + decodedData[i - 1];\n    }\n    return decodedData;\n}\nexport function decodeComponentwiseDeltaVec2Scaled(data, scale, min, max) {\n    if (data.length < 2)\n        return new Int32Array(data);\n    const decodedData = new Int32Array(data.length);\n    let previousVertexX = decodeZigZagInt32Value(data[0]);\n    let previousVertexY = decodeZigZagInt32Value(data[1]);\n    decodedData[0] = clamp(Math.round(previousVertexX * scale), min, max);\n    decodedData[1] = clamp(Math.round(previousVertexY * scale), min, max);\n    const sz0 = data.length / 16;\n    let i = 2;\n    if (sz0 >= 4) {\n        for (; i < sz0 - 4; i += 4) {\n            const x1 = data[i];\n            const y1 = data[i + 1];\n            const currentVertexX = decodeZigZagInt32Value(x1) + previousVertexX;\n            const currentVertexY = decodeZigZagInt32Value(y1) + previousVertexY;\n            decodedData[i] = clamp(Math.round(currentVertexX * scale), min, max);\n            decodedData[i + 1] = clamp(Math.round(currentVertexY * scale), min, max);\n            const x2 = data[i + 2];\n            const y2 = data[i + 3];\n            previousVertexX = decodeZigZagInt32Value(x2) + currentVertexX;\n            previousVertexY = decodeZigZagInt32Value(y2) + currentVertexY;\n            decodedData[i + 2] = clamp(Math.round(previousVertexX * scale), min, max);\n            decodedData[i + 3] = clamp(Math.round(previousVertexY * scale), min, max);\n        }\n    }\n    for (; i !== data.length; i += 2) {\n        previousVertexX += decodeZigZagInt32Value(data[i]);\n        previousVertexY += decodeZigZagInt32Value(data[i + 1]);\n        decodedData[i] = clamp(Math.round(previousVertexX * scale), min, max);\n        decodedData[i + 1] = clamp(Math.round(previousVertexY * scale), min, max);\n    }\n    return decodedData;\n}\nfunction clamp(n, min, max) {\n    return Math.min(max, Math.max(min, n));\n}\n/* Transform data to allow util access ------------------------------------------------------------------------ */\nexport function decodeZigZagDeltaOfDeltaInt32(data) {\n    const decodedData = new Int32Array(data.length + 1);\n    decodedData[0] = 0;\n    decodedData[1] = decodeZigZagInt32Value(data[0]);\n    let deltaSum = decodedData[1];\n    for (let i = 2; i !== decodedData.length; ++i) {\n        const zigZagValue = data[i - 1];\n        const delta = decodeZigZagInt32Value(zigZagValue);\n        deltaSum += delta;\n        decodedData[i] = decodedData[i - 1] + deltaSum;\n    }\n    return new Uint32Array(decodedData);\n}\nexport function decodeZigZagRleDeltaInt32(data, numRuns, numTotalValues) {\n    const decodedValues = new Int32Array(numTotalValues + 1);\n    decodedValues[0] = 0;\n    let offset = 1;\n    let previousValue = decodedValues[0];\n    for (let i = 0; i < numRuns; i++) {\n        const runLength = data[i];\n        let value = data[i + numRuns];\n        value = decodeZigZagInt32Value(value);\n        for (let j = offset; j < offset + runLength; j++) {\n            decodedValues[j] = value + previousValue;\n            previousValue = decodedValues[j];\n        }\n        offset += runLength;\n    }\n    return decodedValues;\n}\nexport function decodeRleDeltaInt32(data, numRuns, numTotalValues) {\n    const decodedValues = new Uint32Array(numTotalValues + 1);\n    decodedValues[0] = 0;\n    let offset = 1;\n    let previousValue = decodedValues[0];\n    for (let i = 0; i < numRuns; i++) {\n        const runLength = data[i];\n        const value = data[i + numRuns];\n        for (let j = offset; j < offset + runLength; j++) {\n            decodedValues[j] = value + previousValue;\n            previousValue = decodedValues[j];\n        }\n        offset += runLength;\n    }\n    return decodedValues;\n}\n/**\n * Decode Delta-RLE with multiple runs by fully reconstructing values.\n *\n * @param data RLE encoded data: [run1, run2, ..., value1, value2, ...]\n * @param numRuns Number of runs in the RLE encoding\n * @param numValues Total number of values to reconstruct\n * @returns Reconstructed values with deltas applied\n */\nexport function decodeDeltaRleInt32(data, numRuns, numValues) {\n    const result = new Int32Array(numValues);\n    let outPos = 0;\n    let previousValue = 0;\n    for (let i = 0; i < numRuns; i++) {\n        const runLength = data[i];\n        const zigZagDelta = data[i + numRuns];\n        const delta = decodeZigZagInt32Value(zigZagDelta);\n        for (let j = 0; j < runLength; j++) {\n            previousValue += delta;\n            result[outPos++] = previousValue;\n        }\n    }\n    return result;\n}\n/**\n * Decode Delta-RLE with multiple runs for 64-bit integers.\n */\nexport function decodeDeltaRleInt64(data, numRuns, numValues) {\n    const result = new BigInt64Array(numValues);\n    let outPos = 0;\n    let previousValue = 0n;\n    for (let i = 0; i < numRuns; i++) {\n        const runLength = Number(data[i]);\n        const zigZagDelta = data[i + numRuns];\n        const delta = decodeZigZagInt64Value(zigZagDelta);\n        for (let j = 0; j < runLength; j++) {\n            previousValue += delta;\n            result[outPos++] = previousValue;\n        }\n    }\n    return result;\n}\nexport function decodeUnsignedZigZagDeltaInt32(data) {\n    const decodedValues = new Uint32Array(data.length);\n    decodedValues[0] = decodeZigZagInt32Value(data[0]) >>> 0;\n    for (let i = 1; i < data.length; i++) {\n        decodedValues[i] = (decodedValues[i - 1] + decodeZigZagInt32Value(data[i])) >>> 0;\n    }\n    return decodedValues;\n}\nexport function decodeUnsignedZigZagDeltaInt64(data) {\n    const decodedValues = new BigUint64Array(data.length);\n    decodedValues[0] = BigInt.asUintN(64, decodeZigZagInt64Value(data[0]));\n    for (let i = 1; i < data.length; i++) {\n        decodedValues[i] = BigInt.asUintN(64, decodedValues[i - 1] + decodeZigZagInt64Value(data[i]));\n    }\n    return decodedValues;\n}\nexport function decodeUnsignedComponentwiseDeltaVec2(data) {\n    if (data.length < 2) {\n        return new Uint32Array(data);\n    }\n    const decodedData = new Uint32Array(data.length);\n    decodedData[0] = decodeZigZagInt32Value(data[0]) >>> 0;\n    decodedData[1] = decodeZigZagInt32Value(data[1]) >>> 0;\n    for (let i = 2; i < data.length; i += 2) {\n        decodedData[i] = (decodedData[i - 2] + decodeZigZagInt32Value(data[i])) >>> 0;\n        decodedData[i + 1] = (decodedData[i - 1] + decodeZigZagInt32Value(data[i + 1])) >>> 0;\n    }\n    return decodedData;\n}\nexport function decodeUnsignedComponentwiseDeltaVec2Scaled(data, scale, min, max) {\n    const scaledValues = decodeComponentwiseDeltaVec2Scaled(data, scale, min, max);\n    return new Uint32Array(scaledValues);\n}\nexport function decodeUnsignedConstRleInt32(data) {\n    return data[1];\n}\nexport function decodeZigZagConstRleInt32(data) {\n    return decodeZigZagInt32Value(data[1]);\n}\nexport function decodeZigZagSequenceRleInt32(data) {\n    /* base value and delta value are equal */\n    if (data.length === 2) {\n        const value = decodeZigZagInt32Value(data[1]);\n        return [value, value];\n    }\n    /* base value and delta value are not equal -> 2 runs and 2 values*/\n    const base = decodeZigZagInt32Value(data[2]);\n    const delta = decodeZigZagInt32Value(data[3]);\n    return [base, delta];\n}\nexport function decodeUnsignedConstRleInt64(data) {\n    return data[1];\n}\nexport function decodeZigZagConstRleInt64(data) {\n    return decodeZigZagInt64Value(data[1]);\n}\nexport function decodeZigZagSequenceRleInt64(data) {\n    /* base value and delta value are equal */\n    if (data.length === 2) {\n        const value = decodeZigZagInt64Value(data[1]);\n        return [value, value];\n    }\n    /* base value and delta value are not equal -> 2 runs and 2 values*/\n    const base = decodeZigZagInt64Value(data[2]);\n    const delta = decodeZigZagInt64Value(data[3]);\n    return [base, delta];\n}\n//# sourceMappingURL=integerDecodingUtils.js.map", "export var PhysicalStreamType;\n(function (PhysicalStreamType) {\n    PhysicalStreamType[\"PRESENT\"] = \"PRESENT\";\n    PhysicalStreamType[\"DATA\"] = \"DATA\";\n    PhysicalStreamType[\"OFFSET\"] = \"OFFSET\";\n    PhysicalStreamType[\"LENGTH\"] = \"LENGTH\";\n})(PhysicalStreamType || (PhysicalStreamType = {}));\n//# sourceMappingURL=physicalStreamType.js.map", "export var DictionaryType;\n(function (DictionaryType) {\n    DictionaryType[\"NONE\"] = \"NONE\";\n    DictionaryType[\"SINGLE\"] = \"SINGLE\";\n    DictionaryType[\"SHARED\"] = \"SHARED\";\n    DictionaryType[\"VERTEX\"] = \"VERTEX\";\n    DictionaryType[\"MORTON\"] = \"MORTON\";\n    DictionaryType[\"FSST\"] = \"FSST\";\n})(DictionaryType || (DictionaryType = {}));\n//# sourceMappingURL=dictionaryType.js.map", "export var OffsetType;\n(function (OffsetType) {\n    OffsetType[\"VERTEX\"] = \"VERTEX\";\n    OffsetType[\"INDEX\"] = \"INDEX\";\n    OffsetType[\"STRING\"] = \"STRING\";\n    OffsetType[\"KEY\"] = \"KEY\";\n})(OffsetType || (OffsetType = {}));\n//# sourceMappingURL=offsetType.js.map", "export var LengthType;\n(function (LengthType) {\n    LengthType[\"VAR_BINARY\"] = \"VAR_BINARY\";\n    LengthType[\"GEOMETRIES\"] = \"GEOMETRIES\";\n    LengthType[\"PARTS\"] = \"PARTS\";\n    LengthType[\"RINGS\"] = \"RINGS\";\n    LengthType[\"TRIANGLES\"] = \"TRIANGLES\";\n    LengthType[\"SYMBOL\"] = \"SYMBOL\";\n    LengthType[\"DICTIONARY\"] = \"DICTIONARY\";\n})(LengthType || (LengthType = {}));\n//# sourceMappingURL=lengthType.js.map", "export var VectorType;\n(function (VectorType) {\n    VectorType[VectorType[\"FLAT\"] = 0] = \"FLAT\";\n    VectorType[VectorType[\"CONST\"] = 1] = \"CONST\";\n    VectorType[VectorType[\"SEQUENCE\"] = 2] = \"SEQUENCE\";\n    VectorType[VectorType[\"DICTIONARY\"] = 3] = \"DICTIONARY\";\n    VectorType[VectorType[\"FSST_DICTIONARY\"] = 4] = \"FSST_DICTIONARY\";\n})(VectorType || (VectorType = {}));\n//# sourceMappingURL=vectorType.js.map", "export var GEOMETRY_TYPE;\n(function (GEOMETRY_TYPE) {\n    GEOMETRY_TYPE[GEOMETRY_TYPE[\"POINT\"] = 0] = \"POINT\";\n    GEOMETRY_TYPE[GEOMETRY_TYPE[\"LINESTRING\"] = 1] = \"LINESTRING\";\n    GEOMETRY_TYPE[GEOMETRY_TYPE[\"POLYGON\"] = 2] = \"POLYGON\";\n    GEOMETRY_TYPE[GEOMETRY_TYPE[\"MULTIPOINT\"] = 3] = \"MULTIPOINT\";\n    GEOMETRY_TYPE[GEOMETRY_TYPE[\"MULTILINESTRING\"] = 4] = \"MULTILINESTRING\";\n    GEOMETRY_TYPE[GEOMETRY_TYPE[\"MULTIPOLYGON\"] = 5] = \"MULTIPOLYGON\";\n})(GEOMETRY_TYPE || (GEOMETRY_TYPE = {}));\nexport var SINGLE_PART_GEOMETRY_TYPE;\n(function (SINGLE_PART_GEOMETRY_TYPE) {\n    SINGLE_PART_GEOMETRY_TYPE[SINGLE_PART_GEOMETRY_TYPE[\"POINT\"] = 0] = \"POINT\";\n    SINGLE_PART_GEOMETRY_TYPE[SINGLE_PART_GEOMETRY_TYPE[\"LINESTRING\"] = 1] = \"LINESTRING\";\n    SINGLE_PART_GEOMETRY_TYPE[SINGLE_PART_GEOMETRY_TYPE[\"POLYGON\"] = 2] = \"POLYGON\";\n})(SINGLE_PART_GEOMETRY_TYPE || (SINGLE_PART_GEOMETRY_TYPE = {}));\n//# sourceMappingURL=geometryType.js.map", "export var VertexBufferType;\n(function (VertexBufferType) {\n    VertexBufferType[VertexBufferType[\"MORTON\"] = 0] = \"MORTON\";\n    VertexBufferType[VertexBufferType[\"VEC_2\"] = 1] = \"VEC_2\";\n    VertexBufferType[VertexBufferType[\"VEC_3\"] = 2] = \"VEC_3\";\n})(VertexBufferType || (VertexBufferType = {}));\n//# sourceMappingURL=vertexBufferType.js.map", "import { LogicalLevelTechnique } from \"./logicalLevelTechnique\";\nimport { PhysicalLevelTechnique } from \"./physicalLevelTechnique\";\nimport { decodeVarintInt32 } from \"../../decoding/integerDecodingUtils\";\nimport { PhysicalStreamType } from \"./physicalStreamType\";\nimport { DictionaryType } from \"./dictionaryType\";\nimport { OffsetType } from \"./offsetType\";\nimport { LengthType } from \"./lengthType\";\nexport function decodeStreamMetadata(tile, offset) {\n    const streamMetadata = decodeStreamMetadataInternal(tile, offset);\n    if (streamMetadata.logicalLevelTechnique1 === LogicalLevelTechnique.MORTON) {\n        return decodePartialMortonEncodedStreamMetadata(streamMetadata, tile, offset);\n    }\n    if ((LogicalLevelTechnique.RLE === streamMetadata.logicalLevelTechnique1 ||\n        LogicalLevelTechnique.RLE === streamMetadata.logicalLevelTechnique2) &&\n        PhysicalLevelTechnique.NONE !== streamMetadata.physicalLevelTechnique) {\n        return decodePartialRleEncodedStreamMetadata(streamMetadata, tile, offset);\n    }\n    return streamMetadata;\n}\nfunction decodePartialMortonEncodedStreamMetadata(streamMetadata, tile, offset) {\n    const mortonInfo = decodeVarintInt32(tile, offset, 2);\n    return {\n        physicalStreamType: streamMetadata.physicalStreamType,\n        logicalStreamType: streamMetadata.logicalStreamType,\n        logicalLevelTechnique1: streamMetadata.logicalLevelTechnique1,\n        logicalLevelTechnique2: streamMetadata.logicalLevelTechnique2,\n        physicalLevelTechnique: streamMetadata.physicalLevelTechnique,\n        numValues: streamMetadata.numValues,\n        byteLength: streamMetadata.byteLength,\n        decompressedCount: streamMetadata.decompressedCount,\n        numBits: mortonInfo[0],\n        coordinateShift: mortonInfo[1],\n    };\n}\nfunction decodePartialRleEncodedStreamMetadata(streamMetadata, tile, offset) {\n    const rleInfo = decodeVarintInt32(tile, offset, 2);\n    return {\n        physicalStreamType: streamMetadata.physicalStreamType,\n        logicalStreamType: streamMetadata.logicalStreamType,\n        logicalLevelTechnique1: streamMetadata.logicalLevelTechnique1,\n        logicalLevelTechnique2: streamMetadata.logicalLevelTechnique2,\n        physicalLevelTechnique: streamMetadata.physicalLevelTechnique,\n        numValues: streamMetadata.numValues,\n        byteLength: streamMetadata.byteLength,\n        decompressedCount: rleInfo[1],\n        runs: rleInfo[0],\n        numRleValues: rleInfo[1],\n    };\n}\nfunction decodeStreamMetadataInternal(tile, offset) {\n    const stream_type = tile[offset.get()];\n    const physicalStreamType = Object.values(PhysicalStreamType)[stream_type >> 4];\n    let logicalStreamType = null;\n    switch (physicalStreamType) {\n        case PhysicalStreamType.DATA:\n            logicalStreamType = {\n                dictionaryType: Object.values(DictionaryType)[stream_type & 0xf],\n            };\n            break;\n        case PhysicalStreamType.OFFSET:\n            logicalStreamType = {\n                offsetType: Object.values(OffsetType)[stream_type & 0xf],\n            };\n            break;\n        case PhysicalStreamType.LENGTH:\n            logicalStreamType = {\n                lengthType: Object.values(LengthType)[stream_type & 0xf],\n            };\n            break;\n    }\n    offset.increment();\n    const encodings_header = tile[offset.get()];\n    const llt1 = Object.values(LogicalLevelTechnique)[encodings_header >> 5];\n    const llt2 = Object.values(LogicalLevelTechnique)[(encodings_header >> 2) & 0x7];\n    const plt = Object.values(PhysicalLevelTechnique)[encodings_header & 0x3];\n    offset.increment();\n    const sizeInfo = decodeVarintInt32(tile, offset, 2);\n    const numValues = sizeInfo[0];\n    const byteLength = sizeInfo[1];\n    return {\n        physicalStreamType,\n        logicalStreamType,\n        logicalLevelTechnique1: llt1,\n        logicalLevelTechnique2: llt2,\n        physicalLevelTechnique: plt,\n        numValues,\n        byteLength,\n        decompressedCount: numValues,\n    };\n}\n//# sourceMappingURL=streamMetadataDecoder.js.map", "export default class BitVector {\n    /**\n     * @param values The byte buffer containing the bit values in least-significant bit (LSB)\n     *     numbering\n     */\n    constructor(values, size) {\n        this.values = values;\n        this._size = size;\n    }\n    get(index) {\n        const byteIndex = Math.floor(index / 8);\n        const bitIndex = index % 8;\n        const b = this.values[byteIndex];\n        return ((b >> bitIndex) & 1) === 1;\n    }\n    set(index, value) {\n        //TODO: refactor -> improve quick and dirty solution\n        const byteIndex = Math.floor(index / 8);\n        const bitIndex = index % 8;\n        this.values[byteIndex] = this.values[byteIndex] | ((value ? 1 : 0) << bitIndex);\n    }\n    getInt(index) {\n        const byteIndex = Math.floor(index / 8);\n        const bitIndex = index % 8;\n        const b = this.values[byteIndex];\n        return (b >> bitIndex) & 1;\n    }\n    size() {\n        return this._size;\n    }\n    getBuffer() {\n        return this.values;\n    }\n}\n//# sourceMappingURL=bitVector.js.map", "import BitVector from \"../vector/flat/bitVector.js\";\n/**\n * Generic unpacking function.\n * Reconstructs the full array by inserting default values at null positions.\n *\n * @param dataStream The compact data stream containing only non-null values\n * @param presentBits BitVector indicating which positions have values (null if non-nullable)\n * @param defaultValue The default value to insert at null positions (0, 0n, etc.)\n * @returns Full array with default values at null positions\n */\nexport function unpackNullable(dataStream, presentBits, defaultValue) {\n    // Non-nullable case: return data stream as-is\n    if (!presentBits) {\n        return dataStream;\n    }\n    const size = presentBits.size();\n    // Create new array of same type with full size\n    const constructor = dataStream.constructor;\n    const result = new constructor(size);\n    let counter = 0;\n    for (let i = 0; i < size; i++) {\n        // If position has a value, take from data stream; otherwise use default\n        result[i] = presentBits.get(i) ? dataStream[counter++] : defaultValue;\n    }\n    return result;\n}\n/**\n * Special case for boolean columns because BitVector is not directly compatible with TypedArray.\n *\n * @param dataStream The compact BitVector data containing only non-null boolean values\n * @param dataStreamSize The number of actual values in dataStream\n * @param presentBits BitVector indicating which positions have values (null if non-nullable)\n * @returns Uint8Array buffer for BitVector with false at null positions\n */\nexport function unpackNullableBoolean(dataStream, dataStreamSize, presentBits) {\n    // Non-nullable case\n    if (!presentBits) {\n        return dataStream;\n    }\n    const numFeatures = presentBits.size();\n    const bitVector = new BitVector(dataStream, dataStreamSize);\n    const result = new BitVector(new Uint8Array(Math.ceil(numFeatures / 8)), numFeatures);\n    let counter = 0;\n    for (let i = 0; i < numFeatures; i++) {\n        // If position has a value, take from data stream; otherwise use false\n        const value = presentBits.get(i) ? bitVector.get(counter++) : false;\n        result.set(i, value);\n    }\n    return result.getBuffer();\n}\n//# sourceMappingURL=unpackNullableUtils.js.map", "import { PhysicalLevelTechnique } from \"../metadata/tile/physicalLevelTechnique\";\nimport IntWrapper from \"./intWrapper\";\nimport { decodeComponentwiseDeltaVec2, decodeComponentwiseDeltaVec2Scaled, decodeDeltaRleInt32, decodeDeltaRleInt64, decodeFastPfor, decodeUnsignedComponentwiseDeltaVec2, decodeUnsignedComponentwiseDeltaVec2Scaled, decodeUnsignedConstRleInt32, decodeUnsignedConstRleInt64, decodeUnsignedRleInt32, decodeUnsignedRleInt64, decodeUnsignedRleFloat64, decodeUnsignedZigZagDeltaInt32, decodeUnsignedZigZagDeltaInt64, decodeVarintInt32, decodeVarintInt64, decodeVarintFloat64, decodeZigZagInt32, decodeZigZagInt64, decodeZigZagFloat64, decodeZigZagConstRleInt32, decodeZigZagConstRleInt64, decodeZigZagDeltaInt32, decodeZigZagDeltaInt64, decodeZigZagDeltaFloat64, decodeZigZagSequenceRleInt32, decodeZigZagSequenceRleInt64, decodeZigZagInt32Value, decodeZigZagInt64Value, fastInverseDelta, inverseDelta, decodeRleDeltaInt32, decodeZigZagDeltaOfDeltaInt32, decodeZigZagRleDeltaInt32, decodeZigZagRleInt32, decodeZigZagRleInt64, decodeZigZagRleFloat64, } from \"./integerDecodingUtils\";\nimport { LogicalLevelTechnique } from \"../metadata/tile/logicalLevelTechnique\";\nimport BitVector from \"../vector/flat/bitVector\";\nimport { VectorType } from \"../vector/vectorType\";\nimport { unpackNullable } from \"./unpackNullableUtils\";\nexport function decodeSignedInt32Stream(data, offset, streamMetadata, scalingData, nullabilityBuffer) {\n    const values = decodePhysicalLevelTechnique(data, offset, streamMetadata);\n    return decodeSignedInt32(values, streamMetadata, scalingData, nullabilityBuffer);\n}\nexport function decodeUnsignedInt32Stream(data, offset, streamMetadata, scalingData, nullabilityBuffer) {\n    const values = decodePhysicalLevelTechnique(data, offset, streamMetadata);\n    return decodeUnsignedInt32(values, streamMetadata, scalingData, nullabilityBuffer);\n}\nexport function decodeLengthStreamToOffsetBuffer(data, offset, streamMetadata) {\n    const values = decodePhysicalLevelTechnique(data, offset, streamMetadata);\n    return decodeLengthToOffsetBuffer(values, streamMetadata);\n}\nfunction decodePhysicalLevelTechnique(data, offset, streamMetadata) {\n    const physicalLevelTechnique = streamMetadata.physicalLevelTechnique;\n    switch (physicalLevelTechnique) {\n        case PhysicalLevelTechnique.FAST_PFOR:\n            return decodeFastPfor(data, streamMetadata.numValues, streamMetadata.byteLength, offset);\n        case PhysicalLevelTechnique.VARINT:\n            return decodeVarintInt32(data, offset, streamMetadata.numValues);\n        case PhysicalLevelTechnique.NONE: {\n            const dataOffset = offset.get();\n            const byteLength = streamMetadata.byteLength;\n            offset.add(byteLength);\n            const slice = data.subarray(dataOffset, offset.get());\n            return new Uint32Array(slice);\n        }\n        default:\n            throw new Error(`Specified physicalLevelTechnique ${physicalLevelTechnique} is not supported (yet).`);\n    }\n}\nexport function decodeSignedConstInt32Stream(data, offset, streamMetadata) {\n    const values = decodePhysicalLevelTechnique(data, offset, streamMetadata);\n    if (values.length === 1) {\n        return decodeZigZagInt32Value(values[0]);\n    }\n    return decodeZigZagConstRleInt32(values);\n}\nexport function decodeUnsignedConstInt32Stream(data, offset, streamMetadata) {\n    const values = decodePhysicalLevelTechnique(data, offset, streamMetadata);\n    if (values.length === 1) {\n        return values[0];\n    }\n    return decodeUnsignedConstRleInt32(values);\n}\nexport function decodeSequenceInt32Stream(data, offset, streamMetadata) {\n    const values = decodePhysicalLevelTechnique(data, offset, streamMetadata);\n    return decodeZigZagSequenceRleInt32(values);\n}\nexport function decodeSequenceInt64Stream(data, offset, streamMetadata) {\n    const values = decodeVarintInt64(data, offset, streamMetadata.numValues);\n    return decodeZigZagSequenceRleInt64(values);\n}\nexport function decodeSignedInt64Stream(data, offset, streamMetadata, nullabilityBuffer) {\n    const values = decodeVarintInt64(data, offset, streamMetadata.numValues);\n    return decodeSignedInt64(values, streamMetadata, nullabilityBuffer);\n}\nexport function decodeUnsignedInt64Stream(data, offset, streamMetadata, nullabilityBuffer) {\n    const values = decodeVarintInt64(data, offset, streamMetadata.numValues);\n    return decodeUnsignedInt64(values, streamMetadata, nullabilityBuffer);\n}\nexport function decodeSignedInt64AsFloat64Stream(data, offset, streamMetadata) {\n    const values = decodeVarintFloat64(data, offset, streamMetadata.numValues);\n    return decodeFloat64Values(values, streamMetadata, true);\n}\nexport function decodeUnsignedInt64AsFloat64Stream(data, offset, streamMetadata) {\n    const values = decodeVarintFloat64(data, offset, streamMetadata.numValues);\n    return decodeFloat64Values(values, streamMetadata, false);\n}\nexport function decodeSignedConstInt64Stream(data, offset, streamMetadata) {\n    const values = decodeVarintInt64(data, offset, streamMetadata.numValues);\n    if (values.length === 1) {\n        return decodeZigZagInt64Value(values[0]);\n    }\n    return decodeZigZagConstRleInt64(values);\n}\nexport function decodeUnsignedConstInt64Stream(data, offset, streamMetadata) {\n    const values = decodeVarintInt64(data, offset, streamMetadata.numValues);\n    if (values.length === 1) {\n        return values[0];\n    }\n    return decodeUnsignedConstRleInt64(values);\n}\n/**\n * This method decodes integer streams.\n * Currently the encoder uses only fixed combinations of encodings.\n * For performance reasons it is also uses a fixed combination of the encodings on the decoding side.\n * The following encodings and combinations are used:\n *   - Morton Delta -> always sorted so not ZigZag encoding needed\n *   - Delta -> currently always in combination with ZigZag encoding\n *   - Rle -> in combination with ZigZag encoding if data type is signed\n *   - Delta Rle\n *   - Componentwise Delta -> always ZigZag encoding is used\n */\nfunction decodeSignedInt32(values, streamMetadata, scalingData, nullabilityBuffer) {\n    let decodedValues;\n    switch (streamMetadata.logicalLevelTechnique1) {\n        case LogicalLevelTechnique.DELTA:\n            if (streamMetadata.logicalLevelTechnique2 === LogicalLevelTechnique.RLE) {\n                const rleMetadata = streamMetadata;\n                if (!nullabilityBuffer) {\n                    return decodeDeltaRleInt32(values, rleMetadata.runs, rleMetadata.numRleValues);\n                }\n                values = decodeUnsignedRleInt32(values, rleMetadata.runs, rleMetadata.numRleValues);\n                decodedValues = decodeZigZagDeltaInt32(values);\n            }\n            else {\n                decodedValues = decodeZigZagDeltaInt32(values);\n            }\n            break;\n        case LogicalLevelTechnique.RLE:\n            decodedValues = decodeZigZagRleInt32(values, streamMetadata.runs, streamMetadata.numRleValues);\n            break;\n        case LogicalLevelTechnique.MORTON:\n            fastInverseDelta(values);\n            decodedValues = new Int32Array(values);\n            break;\n        case LogicalLevelTechnique.COMPONENTWISE_DELTA:\n            if (scalingData && !nullabilityBuffer) {\n                return decodeComponentwiseDeltaVec2Scaled(values, scalingData.scale, scalingData.min, scalingData.max);\n            }\n            decodedValues = decodeComponentwiseDeltaVec2(values);\n            break;\n        case LogicalLevelTechnique.NONE:\n            decodedValues = decodeZigZagInt32(values);\n            break;\n        default:\n            throw new Error(`The specified Logical level technique is not supported: ${streamMetadata.logicalLevelTechnique1}`);\n    }\n    if (nullabilityBuffer) {\n        return unpackNullable(decodedValues, nullabilityBuffer, 0);\n    }\n    return decodedValues;\n}\nfunction decodeUnsignedInt32(values, streamMetadata, scalingData, nullabilityBuffer) {\n    let decodedValues;\n    switch (streamMetadata.logicalLevelTechnique1) {\n        case LogicalLevelTechnique.DELTA:\n            if (streamMetadata.logicalLevelTechnique2 === LogicalLevelTechnique.RLE) {\n                const rleMetadata = streamMetadata;\n                const deltaValues = decodeUnsignedRleInt32(values, rleMetadata.runs, rleMetadata.numRleValues);\n                decodedValues = decodeUnsignedZigZagDeltaInt32(deltaValues);\n            }\n            else {\n                decodedValues = decodeUnsignedZigZagDeltaInt32(values);\n            }\n            break;\n        case LogicalLevelTechnique.RLE:\n            decodedValues = decodeUnsignedRleInt32(values, streamMetadata.runs, streamMetadata.numRleValues);\n            break;\n        case LogicalLevelTechnique.MORTON:\n            fastInverseDelta(values);\n            decodedValues = values;\n            break;\n        case LogicalLevelTechnique.COMPONENTWISE_DELTA:\n            if (scalingData && !nullabilityBuffer) {\n                decodedValues = decodeUnsignedComponentwiseDeltaVec2Scaled(values, scalingData.scale, scalingData.min, scalingData.max);\n            }\n            else {\n                decodedValues = decodeUnsignedComponentwiseDeltaVec2(values);\n            }\n            break;\n        case LogicalLevelTechnique.NONE:\n            decodedValues = values;\n            break;\n        default:\n            throw new Error(`The specified Logical level technique is not supported: ${streamMetadata.logicalLevelTechnique1}`);\n    }\n    if (nullabilityBuffer) {\n        return unpackNullable(decodedValues, nullabilityBuffer, 0);\n    }\n    return decodedValues;\n}\nfunction decodeSignedInt64(values, streamMetadata, nullabilityBuffer) {\n    let decodedValues;\n    switch (streamMetadata.logicalLevelTechnique1) {\n        case LogicalLevelTechnique.DELTA:\n            if (streamMetadata.logicalLevelTechnique2 === LogicalLevelTechnique.RLE) {\n                const rleMetadata = streamMetadata;\n                if (!nullabilityBuffer) {\n                    return decodeDeltaRleInt64(values, rleMetadata.runs, rleMetadata.numRleValues);\n                }\n                values = decodeUnsignedRleInt64(values, rleMetadata.runs, rleMetadata.numRleValues);\n                decodedValues = decodeZigZagDeltaInt64(values);\n            }\n            else {\n                decodedValues = decodeZigZagDeltaInt64(values);\n            }\n            break;\n        case LogicalLevelTechnique.RLE:\n            decodedValues = decodeZigZagRleInt64(values, streamMetadata.runs, streamMetadata.numRleValues);\n            break;\n        case LogicalLevelTechnique.NONE:\n            decodedValues = decodeZigZagInt64(values);\n            break;\n        default:\n            throw new Error(`The specified Logical level technique is not supported: ${streamMetadata.logicalLevelTechnique1}`);\n    }\n    if (nullabilityBuffer) {\n        return unpackNullable(decodedValues, nullabilityBuffer, 0n);\n    }\n    return decodedValues;\n}\nfunction decodeUnsignedInt64(values, streamMetadata, nullabilityBuffer) {\n    let decodedValues;\n    switch (streamMetadata.logicalLevelTechnique1) {\n        case LogicalLevelTechnique.DELTA:\n            if (streamMetadata.logicalLevelTechnique2 === LogicalLevelTechnique.RLE) {\n                const rleMetadata = streamMetadata;\n                const deltaValues = decodeUnsignedRleInt64(values, rleMetadata.runs, rleMetadata.numRleValues);\n                decodedValues = decodeUnsignedZigZagDeltaInt64(deltaValues);\n            }\n            else {\n                decodedValues = decodeUnsignedZigZagDeltaInt64(values);\n            }\n            break;\n        case LogicalLevelTechnique.RLE:\n            decodedValues = decodeUnsignedRleInt64(values, streamMetadata.runs, streamMetadata.numRleValues);\n            break;\n        case LogicalLevelTechnique.NONE:\n            decodedValues = values;\n            break;\n        default:\n            throw new Error(`The specified Logical level technique is not supported: ${streamMetadata.logicalLevelTechnique1}`);\n    }\n    if (nullabilityBuffer) {\n        return unpackNullable(decodedValues, nullabilityBuffer, 0n);\n    }\n    return decodedValues;\n}\nfunction decodeFloat64Values(values, streamMetadata, isSigned) {\n    switch (streamMetadata.logicalLevelTechnique1) {\n        case LogicalLevelTechnique.DELTA:\n            if (streamMetadata.logicalLevelTechnique2 === LogicalLevelTechnique.RLE) {\n                const rleMetadata = streamMetadata;\n                values = decodeUnsignedRleFloat64(values, rleMetadata.runs, rleMetadata.numRleValues);\n            }\n            decodeZigZagDeltaFloat64(values);\n            return values;\n        case LogicalLevelTechnique.RLE:\n            return decodeRleFloat64(values, streamMetadata, isSigned);\n        case LogicalLevelTechnique.NONE:\n            if (isSigned) {\n                decodeZigZagFloat64(values);\n            }\n            return values;\n        default:\n            throw new Error(`The specified Logical level technique is not supported: ${streamMetadata.logicalLevelTechnique1}`);\n    }\n}\nfunction decodeLengthToOffsetBuffer(values, streamMetadata) {\n    if (streamMetadata.logicalLevelTechnique1 === LogicalLevelTechnique.DELTA &&\n        streamMetadata.logicalLevelTechnique2 === LogicalLevelTechnique.NONE) {\n        return decodeZigZagDeltaOfDeltaInt32(values);\n    }\n    if (streamMetadata.logicalLevelTechnique1 === LogicalLevelTechnique.RLE &&\n        streamMetadata.logicalLevelTechnique2 === LogicalLevelTechnique.NONE) {\n        const rleMetadata = streamMetadata;\n        return decodeRleDeltaInt32(values, rleMetadata.runs, rleMetadata.numRleValues);\n    }\n    if (streamMetadata.logicalLevelTechnique1 === LogicalLevelTechnique.NONE &&\n        streamMetadata.logicalLevelTechnique2 === LogicalLevelTechnique.NONE) {\n        //TODO: use fastInverseDelta again and check what are the performance problems in zoom 14\n        //fastInverseDelta(values);\n        inverseDelta(values);\n        const offsets = new Uint32Array(streamMetadata.numValues + 1);\n        offsets[0] = 0;\n        offsets.set(values, 1);\n        return offsets;\n    }\n    if (streamMetadata.logicalLevelTechnique1 === LogicalLevelTechnique.DELTA &&\n        streamMetadata.logicalLevelTechnique2 === LogicalLevelTechnique.RLE) {\n        const rleMetadata = streamMetadata;\n        const decodedValues = decodeZigZagRleDeltaInt32(values, rleMetadata.runs, rleMetadata.numRleValues);\n        fastInverseDelta(decodedValues);\n        return new Uint32Array(decodedValues);\n    }\n    throw new Error(\"Only delta encoding is supported for transforming length to offset streams yet.\");\n}\nexport function getVectorType(streamMetadata, sizeOrNullabilityBuffer, data, offset, varintWidth = \"int32\") {\n    const logicalLevelTechnique1 = streamMetadata.logicalLevelTechnique1;\n    if (logicalLevelTechnique1 === LogicalLevelTechnique.RLE) {\n        return streamMetadata.runs === 1 ? VectorType.CONST : VectorType.FLAT;\n    }\n    if (logicalLevelTechnique1 !== LogicalLevelTechnique.DELTA ||\n        streamMetadata.logicalLevelTechnique2 !== LogicalLevelTechnique.RLE) {\n        return streamMetadata.numValues === 1 ? VectorType.CONST : VectorType.FLAT;\n    }\n    const numFeatures = sizeOrNullabilityBuffer instanceof BitVector ? sizeOrNullabilityBuffer.size() : sizeOrNullabilityBuffer;\n    const rleMetadata = streamMetadata;\n    if (rleMetadata.numRleValues !== numFeatures) {\n        return VectorType.FLAT;\n    }\n    // Single run is always a sequence\n    if (rleMetadata.runs === 1) {\n        return VectorType.SEQUENCE;\n    }\n    if (rleMetadata.runs !== 2) {\n        return streamMetadata.numValues === 1 ? VectorType.CONST : VectorType.FLAT;\n    }\n    // Two runs can be a sequence if both deltas are equal to 1\n    const savedOffset = offset.get();\n    if (streamMetadata.physicalLevelTechnique === PhysicalLevelTechnique.VARINT) {\n        if (isDeltaRleSequenceVarintWidth(data, offset, varintWidth)) {\n            return VectorType.SEQUENCE;\n        }\n        return streamMetadata.numValues === 1 ? VectorType.CONST : VectorType.FLAT;\n    }\n    const byteOffset = offset.get();\n    const values = new Int32Array(data.buffer, data.byteOffset + byteOffset, 4);\n    offset.set(savedOffset);\n    // Check if both deltas are encoded 1\n    const zigZagOne = 2;\n    if (values[2] === zigZagOne && values[3] === zigZagOne) {\n        return VectorType.SEQUENCE;\n    }\n    return streamMetadata.numValues === 1 ? VectorType.CONST : VectorType.FLAT;\n}\nfunction isDeltaRleSequenceVarintWidth(data, offset, varintWidth) {\n    const peekOffset = new IntWrapper(offset.get());\n    if (varintWidth === \"int64\") {\n        const values = decodeVarintInt64(data, peekOffset, 4);\n        return values[2] === 2n && values[3] === 2n;\n    }\n    const values = decodeVarintInt32(data, peekOffset, 4);\n    return values[2] === 2 && values[3] === 2;\n}\nfunction decodeRleFloat64(data, streamMetadata, isSigned) {\n    return isSigned\n        ? decodeZigZagRleFloat64(data, streamMetadata.runs, streamMetadata.numRleValues)\n        : decodeUnsignedRleFloat64(data, streamMetadata.runs, streamMetadata.numRleValues);\n}\n//# sourceMappingURL=integerStreamDecoder.js.map", "import { bswap32 } from \"./fastPforShared\";\n/**\n * Decodes big-endian bytes into `out` without allocating the output buffer.\n *\n * This function does not copy `bytes`; it writes decoded words into the provided `out` array.\n * For aligned inputs it may create a temporary typed-array view (`Uint32Array`) over `bytes.buffer`\n * to speed up decoding.\n *\n * If `byteLength` is not a multiple of 4, the final word is padded with zeros.\n *\n * @returns Number of int32 words written.\n * @throws RangeError If `(offset, byteLength)` is out of bounds, or if `out` is too small.\n */\nexport function decodeBigEndianInt32sInto(bytes, offset, byteLength, out) {\n    if (offset < 0 || byteLength < 0 || offset + byteLength > bytes.length) {\n        throw new RangeError(`decodeBigEndianInt32sInto: out of bounds (offset=${offset}, byteLength=${byteLength}, bytes.length=${bytes.length})`);\n    }\n    const numCompleteInts = Math.floor(byteLength / 4);\n    const hasTrailingBytes = byteLength % 4 !== 0;\n    const numInts = hasTrailingBytes ? numCompleteInts + 1 : numCompleteInts;\n    if (out.length < numInts) {\n        throw new RangeError(`decodeBigEndianInt32sInto: out.length=${out.length} < ${numInts}`);\n    }\n    if (numCompleteInts > 0) {\n        const absoluteOffset = bytes.byteOffset + offset;\n        if ((absoluteOffset & 3) === 0) {\n            const u32 = new Uint32Array(bytes.buffer, absoluteOffset, numCompleteInts);\n            for (let i = 0; i < numCompleteInts; i++) {\n                out[i] = bswap32(u32[i]) | 0;\n            }\n        }\n        else {\n            for (let i = 0; i < numCompleteInts; i++) {\n                const base = offset + i * 4;\n                out[i] = (bytes[base] << 24) | (bytes[base + 1] << 16) | (bytes[base + 2] << 8) | bytes[base + 3] | 0;\n            }\n        }\n    }\n    if (hasTrailingBytes) {\n        const base = offset + numCompleteInts * 4;\n        const remaining = byteLength - numCompleteInts * 4;\n        let v = 0;\n        for (let i = 0; i < remaining; i++) {\n            v |= bytes[base + i] << (24 - i * 8);\n        }\n        out[numCompleteInts] = v | 0;\n    }\n    return numInts;\n}\n//# sourceMappingURL=bigEndianDecode.js.map", "import { FixedSizeVector } from \"../fixedSizeVector\";\nexport class Int64FlatVector extends FixedSizeVector {\n    getValueFromBuffer(index) {\n        return this.dataBuffer[index];\n    }\n}\n//# sourceMappingURL=int64FlatVector.js.map", "import { SequenceVector } from \"./sequenceVector\";\nexport class Int64SequenceVector extends SequenceVector {\n    constructor(name, baseValue, delta, size) {\n        super(name, BigInt64Array.of(baseValue), delta, size);\n    }\n    getValueFromBuffer(index) {\n        return this.dataBuffer[0] + BigInt(index) * this.delta;\n    }\n}\n//# sourceMappingURL=int64SequenceVector.js.map", "export function decodeZOrderCurve(mortonCode, numBits, coordinateShift) {\n    const x = decodeMorton(mortonCode, numBits) - coordinateShift;\n    const y = decodeMorton(mortonCode >> 1, numBits) - coordinateShift;\n    return { x, y };\n}\nfunction decodeMorton(code, numBits) {\n    let coordinate = 0;\n    for (let i = 0; i < numBits; i++) {\n        coordinate |= (code & (1 << (2 * i))) >> i;\n    }\n    return coordinate;\n}\n//# sourceMappingURL=zOrderCurve.js.map", "import { decodeZOrderCurve } from \"./zOrderCurve\";\nimport { GEOMETRY_TYPE } from \"./geometryType\";\nimport { VertexBufferType } from \"./vertexBufferType\";\nimport Point from \"@mapbox/point-geometry\";\nexport function convertGeometryVector(geometryVector) {\n    const geometries = new Array(geometryVector.numGeometries);\n    let partOffsetCounter = 1;\n    let ringOffsetsCounter = 1;\n    let geometryOffsetsCounter = 1;\n    let geometryCounter = 0;\n    let vertexBufferOffset = 0;\n    let vertexOffsetsOffset = 0;\n    const mortonSettings = geometryVector.mortonSettings;\n    const topologyVector = geometryVector.topologyVector;\n    const geometryOffsets = topologyVector.geometryOffsets;\n    const partOffsets = topologyVector.partOffsets;\n    const ringOffsets = topologyVector.ringOffsets;\n    const vertexOffsets = geometryVector.vertexOffsets;\n    const nonOffset = !vertexOffsets || vertexOffsets.length === 0;\n    const containsPolygon = geometryVector.containsPolygonGeometry();\n    const vertexBuffer = geometryVector.vertexBuffer;\n    for (let i = 0; i < geometryVector.numGeometries; i++) {\n        const geometryType = geometryVector.geometryType(i);\n        switch (geometryType) {\n            case GEOMETRY_TYPE.POINT:\n                {\n                    let x;\n                    let y;\n                    if (nonOffset) {\n                        x = vertexBuffer[vertexBufferOffset++];\n                        y = vertexBuffer[vertexBufferOffset++];\n                    }\n                    else if (geometryVector.vertexBufferType === VertexBufferType.MORTON) {\n                        const offset = vertexOffsets[vertexOffsetsOffset++];\n                        const mortonCode = vertexBuffer[offset];\n                        const vertex = decodeZOrderCurve(mortonCode, mortonSettings.numBits, mortonSettings.coordinateShift);\n                        x = vertex.x;\n                        y = vertex.y;\n                    }\n                    else {\n                        const offset = vertexOffsets[vertexOffsetsOffset++] * 2;\n                        x = vertexBuffer[offset];\n                        y = vertexBuffer[offset + 1];\n                    }\n                    geometries[geometryCounter++] = [[new Point(x, y)]];\n                    if (geometryOffsets)\n                        geometryOffsetsCounter++;\n                    if (partOffsets)\n                        partOffsetCounter++;\n                    if (ringOffsets)\n                        ringOffsetsCounter++;\n                }\n                break;\n            case GEOMETRY_TYPE.MULTIPOINT:\n                {\n                    const numPoints = geometryOffsets[geometryOffsetsCounter] - geometryOffsets[geometryOffsetsCounter - 1];\n                    geometryOffsetsCounter++;\n                    const points = new Array(numPoints);\n                    if (nonOffset) {\n                        for (let j = 0; j < numPoints; j++) {\n                            const x = vertexBuffer[vertexBufferOffset++];\n                            const y = vertexBuffer[vertexBufferOffset++];\n                            points[j] = new Point(x, y);\n                        }\n                    }\n                    else {\n                        for (let j = 0; j < numPoints; j++) {\n                            const offset = vertexOffsets[vertexOffsetsOffset++] * 2;\n                            const x = vertexBuffer[offset];\n                            const y = vertexBuffer[offset + 1];\n                            points[j] = new Point(x, y);\n                        }\n                    }\n                    geometries[geometryCounter++] = points.map((point) => [point]);\n                    // MULTIPOINT must increment offset counters like POINT does\n                    partOffsetCounter += numPoints;\n                    ringOffsetsCounter += numPoints;\n                }\n                break;\n            case GEOMETRY_TYPE.LINESTRING:\n                {\n                    let numVertices;\n                    if (containsPolygon) {\n                        numVertices = ringOffsets[ringOffsetsCounter] - ringOffsets[ringOffsetsCounter - 1];\n                        ringOffsetsCounter++;\n                    }\n                    else {\n                        numVertices = partOffsets[partOffsetCounter] - partOffsets[partOffsetCounter - 1];\n                    }\n                    partOffsetCounter++;\n                    let vertices;\n                    if (nonOffset) {\n                        vertices = getLineStringOrRing(vertexBuffer, vertexBufferOffset, numVertices, false);\n                        vertexBufferOffset += numVertices * 2;\n                    }\n                    else {\n                        vertices = decodeDictionaryEncodedLineStringOrRing(geometryVector.vertexBufferType, vertexBuffer, vertexOffsets, vertexOffsetsOffset, numVertices, false, mortonSettings);\n                        vertexOffsetsOffset += numVertices;\n                    }\n                    geometries[geometryCounter++] = [vertices];\n                    if (geometryOffsets)\n                        geometryOffsetsCounter++;\n                }\n                break;\n            case GEOMETRY_TYPE.POLYGON:\n                {\n                    const numRings = partOffsets[partOffsetCounter] - partOffsets[partOffsetCounter - 1];\n                    partOffsetCounter++;\n                    const rings = new Array(numRings - 1);\n                    let shell;\n                    let numVertices = ringOffsets[ringOffsetsCounter] - ringOffsets[ringOffsetsCounter - 1];\n                    ringOffsetsCounter++;\n                    if (nonOffset) {\n                        shell = getLineStringOrRing(vertexBuffer, vertexBufferOffset, numVertices, true);\n                        vertexBufferOffset += numVertices * 2;\n                        for (let j = 0; j < rings.length; j++) {\n                            numVertices = ringOffsets[ringOffsetsCounter] - ringOffsets[ringOffsetsCounter - 1];\n                            ringOffsetsCounter++;\n                            rings[j] = getLineStringOrRing(vertexBuffer, vertexBufferOffset, numVertices, true);\n                            vertexBufferOffset += numVertices * 2;\n                        }\n                    }\n                    else {\n                        shell = decodeDictionaryEncodedLineStringOrRing(geometryVector.vertexBufferType, vertexBuffer, vertexOffsets, vertexOffsetsOffset, numVertices, true, mortonSettings);\n                        vertexOffsetsOffset += numVertices;\n                        for (let j = 0; j < rings.length; j++) {\n                            numVertices = ringOffsets[ringOffsetsCounter] - ringOffsets[ringOffsetsCounter - 1];\n                            ringOffsetsCounter++;\n                            rings[j] = decodeDictionaryEncodedLineStringOrRing(geometryVector.vertexBufferType, vertexBuffer, vertexOffsets, vertexOffsetsOffset, numVertices, true, mortonSettings);\n                            vertexOffsetsOffset += numVertices;\n                        }\n                    }\n                    geometries[geometryCounter++] = [shell].concat(rings);\n                    if (geometryOffsets)\n                        geometryOffsetsCounter++;\n                }\n                break;\n            case GEOMETRY_TYPE.MULTILINESTRING:\n                {\n                    const numLineStrings = geometryOffsets[geometryOffsetsCounter] - geometryOffsets[geometryOffsetsCounter - 1];\n                    geometryOffsetsCounter++;\n                    const lineStrings = new Array(numLineStrings);\n                    for (let j = 0; j < numLineStrings; j++) {\n                        let numVertices;\n                        if (containsPolygon) {\n                            numVertices = ringOffsets[ringOffsetsCounter] - ringOffsets[ringOffsetsCounter - 1];\n                            ringOffsetsCounter++;\n                        }\n                        else {\n                            numVertices = partOffsets[partOffsetCounter] - partOffsets[partOffsetCounter - 1];\n                        }\n                        partOffsetCounter++;\n                        if (nonOffset) {\n                            lineStrings[j] = getLineStringOrRing(vertexBuffer, vertexBufferOffset, numVertices, false);\n                            vertexBufferOffset += numVertices * 2;\n                        }\n                        else {\n                            const vertices = decodeDictionaryEncodedLineStringOrRing(geometryVector.vertexBufferType, vertexBuffer, vertexOffsets, vertexOffsetsOffset, numVertices, false, mortonSettings);\n                            lineStrings[j] = vertices;\n                            vertexOffsetsOffset += numVertices;\n                        }\n                    }\n                    geometries[geometryCounter++] = lineStrings;\n                }\n                break;\n            case GEOMETRY_TYPE.MULTIPOLYGON:\n                {\n                    const numPolygons = geometryOffsets[geometryOffsetsCounter] - geometryOffsets[geometryOffsetsCounter - 1];\n                    geometryOffsetsCounter++;\n                    const polygons = new Array(numPolygons);\n                    for (let j = 0; j < numPolygons; j++) {\n                        const numRings = partOffsets[partOffsetCounter] - partOffsets[partOffsetCounter - 1];\n                        partOffsetCounter++;\n                        let shell;\n                        const rings = new Array(numRings - 1);\n                        const numVertices = ringOffsets[ringOffsetsCounter] - ringOffsets[ringOffsetsCounter - 1];\n                        ringOffsetsCounter++;\n                        if (nonOffset) {\n                            shell = getLineStringOrRing(vertexBuffer, vertexBufferOffset, numVertices, true);\n                            vertexBufferOffset += numVertices * 2;\n                        }\n                        else {\n                            shell = decodeDictionaryEncodedLineStringOrRing(geometryVector.vertexBufferType, vertexBuffer, vertexOffsets, vertexOffsetsOffset, numVertices, true, mortonSettings);\n                            vertexOffsetsOffset += numVertices;\n                        }\n                        for (let k = 0; k < rings.length; k++) {\n                            const numRingVertices = ringOffsets[ringOffsetsCounter] - ringOffsets[ringOffsetsCounter - 1];\n                            ringOffsetsCounter++;\n                            if (nonOffset) {\n                                rings[k] = getLineStringOrRing(vertexBuffer, vertexBufferOffset, numRingVertices, true);\n                                vertexBufferOffset += numRingVertices * 2;\n                            }\n                            else {\n                                rings[k] = decodeDictionaryEncodedLineStringOrRing(geometryVector.vertexBufferType, vertexBuffer, vertexOffsets, vertexOffsetsOffset, numRingVertices, true, mortonSettings);\n                                vertexOffsetsOffset += numRingVertices;\n                            }\n                        }\n                        polygons[j] = [shell].concat(rings);\n                    }\n                    geometries[geometryCounter++] = polygons.flat();\n                }\n                break;\n            default:\n                throw new Error(\"The specified geometry type is currently not supported.\");\n        }\n    }\n    return geometries;\n}\nfunction decodeDictionaryEncodedLineStringOrRing(vertexBufferType, vertexBuffer, vertexOffsets, vertexOffset, numVertices, closeLineString, mortonSettings) {\n    if (vertexBufferType === VertexBufferType.MORTON) {\n        return decodeMortonDictionaryEncodedLineString(vertexBuffer, vertexOffsets, vertexOffset, numVertices, closeLineString, mortonSettings);\n    }\n    else {\n        return decodeDictionaryEncodedLineString(vertexBuffer, vertexOffsets, vertexOffset, numVertices, closeLineString);\n    }\n}\nfunction getLineStringOrRing(vertexBuffer, startIndex, numVertices, closeLineString) {\n    const vertices = new Array(closeLineString ? numVertices + 1 : numVertices);\n    for (let i = 0; i < numVertices * 2; i += 2) {\n        const x = vertexBuffer[startIndex + i];\n        const y = vertexBuffer[startIndex + i + 1];\n        vertices[i / 2] = new Point(x, y);\n    }\n    if (closeLineString) {\n        vertices[vertices.length - 1] = vertices[0];\n    }\n    return vertices;\n}\nfunction decodeDictionaryEncodedLineString(vertexBuffer, vertexOffsets, vertexOffset, numVertices, closeLineString) {\n    const vertices = new Array(closeLineString ? numVertices + 1 : numVertices);\n    for (let i = 0; i < numVertices * 2; i += 2) {\n        const offset = vertexOffsets[vertexOffset + i / 2] * 2;\n        const x = vertexBuffer[offset];\n        const y = vertexBuffer[offset + 1];\n        vertices[i / 2] = new Point(x, y);\n    }\n    if (closeLineString) {\n        vertices[vertices.length - 1] = vertices[0];\n    }\n    return vertices;\n}\nfunction decodeMortonDictionaryEncodedLineString(vertexBuffer, vertexOffsets, vertexOffset, numVertices, closeLineString, mortonSettings) {\n    const vertices = new Array(closeLineString ? numVertices + 1 : numVertices);\n    for (let i = 0; i < numVertices; i++) {\n        const offset = vertexOffsets[vertexOffset + i];\n        const mortonEncodedVertex = vertexBuffer[offset];\n        const vertex = decodeZOrderCurve(mortonEncodedVertex, mortonSettings.numBits, mortonSettings.coordinateShift);\n        vertices[i] = new Point(vertex.x, vertex.y);\n    }\n    if (closeLineString) {\n        vertices[vertices.length - 1] = vertices[0];\n    }\n    return vertices;\n}\n//# sourceMappingURL=geometryVectorConverter.js.map", "import { convertGeometryVector } from \"./geometryVectorConverter\";\nimport { decodeZOrderCurve } from \"./zOrderCurve\";\nexport class GeometryVector {\n    constructor(_vertexBufferType, _topologyVector, _vertexOffsets, _vertexBuffer, _mortonSettings) {\n        this._vertexBufferType = _vertexBufferType;\n        this._topologyVector = _topologyVector;\n        this._vertexOffsets = _vertexOffsets;\n        this._vertexBuffer = _vertexBuffer;\n        this._mortonSettings = _mortonSettings;\n    }\n    get vertexBufferType() {\n        return this._vertexBufferType;\n    }\n    get topologyVector() {\n        return this._topologyVector;\n    }\n    get vertexOffsets() {\n        return this._vertexOffsets;\n    }\n    get vertexBuffer() {\n        return this._vertexBuffer;\n    }\n    /* Allows faster access to the vertices since morton encoding is currently not used in the POC. Morton encoding\n       will be used after adapting the shader to decode the morton codes on the GPU. */\n    getSimpleEncodedVertex(index) {\n        const offset = this.vertexOffsets ? this.vertexOffsets[index] * 2 : index * 2;\n        const x = this.vertexBuffer[offset];\n        const y = this.vertexBuffer[offset + 1];\n        return [x, y];\n    }\n    //TODO: add scaling information to the constructor\n    getVertex(index) {\n        if (this.vertexOffsets && this.mortonSettings) {\n            //TODO: move decoding of the morton codes on the GPU in the vertex shader\n            const vertexOffset = this.vertexOffsets[index];\n            const mortonEncodedVertex = this.vertexBuffer[vertexOffset];\n            //TODO: improve performance -> inline calculation and move to decoding of VertexBuffer\n            const vertex = decodeZOrderCurve(mortonEncodedVertex, this.mortonSettings.numBits, this.mortonSettings.coordinateShift);\n            return [vertex.x, vertex.y];\n        }\n        const offset = this.vertexOffsets ? this.vertexOffsets[index] * 2 : index * 2;\n        const x = this.vertexBuffer[offset];\n        const y = this.vertexBuffer[offset + 1];\n        return [x, y];\n    }\n    getGeometries() {\n        return convertGeometryVector(this);\n    }\n    get mortonSettings() {\n        return this._mortonSettings;\n    }\n}\n//# sourceMappingURL=geometryVector.js.map", "import { GeometryVector } from \"./geometryVector\";\nimport { GEOMETRY_TYPE } from \"./geometryType\";\nimport { VertexBufferType } from \"./vertexBufferType\";\nexport function createConstGeometryVector(numGeometries, geometryType, topologyVector, vertexOffsets, vertexBuffer) {\n    return new ConstGeometryVector(numGeometries, geometryType, VertexBufferType.VEC_2, topologyVector, vertexOffsets, vertexBuffer);\n}\nexport function createMortonEncodedConstGeometryVector(numGeometries, geometryType, topologyVector, vertexOffsets, vertexBuffer, mortonInfo) {\n    return new ConstGeometryVector(numGeometries, geometryType, VertexBufferType.MORTON, topologyVector, vertexOffsets, vertexBuffer, mortonInfo);\n}\nexport class ConstGeometryVector extends GeometryVector {\n    constructor(_numGeometries, _geometryType, vertexBufferType, topologyVector, vertexOffsets, vertexBuffer, mortonSettings) {\n        super(vertexBufferType, topologyVector, vertexOffsets, vertexBuffer, mortonSettings);\n        this._numGeometries = _numGeometries;\n        this._geometryType = _geometryType;\n    }\n    geometryType(_index) {\n        return this._geometryType;\n    }\n    get numGeometries() {\n        return this._numGeometries;\n    }\n    containsPolygonGeometry() {\n        return this._geometryType === GEOMETRY_TYPE.POLYGON || this._geometryType === GEOMETRY_TYPE.MULTIPOLYGON;\n    }\n    containsSingleGeometryType() {\n        return true;\n    }\n}\n//# sourceMappingURL=constGeometryVector.js.map", "import { GeometryVector } from \"./geometryVector\";\nimport { GEOMETRY_TYPE } from \"./geometryType\";\nimport { VertexBufferType } from \"./vertexBufferType\";\nexport function createFlatGeometryVector(geometryTypes, topologyVector, vertexOffsets, vertexBuffer) {\n    return new FlatGeometryVector(VertexBufferType.VEC_2, geometryTypes, topologyVector, vertexOffsets, vertexBuffer);\n}\nexport function createFlatGeometryVectorMortonEncoded(geometryTypes, topologyVector, vertexOffsets, vertexBuffer, mortonInfo) {\n    return new FlatGeometryVector(VertexBufferType.MORTON, geometryTypes, topologyVector, vertexOffsets, vertexBuffer, mortonInfo);\n}\nexport class FlatGeometryVector extends GeometryVector {\n    constructor(vertexBufferType, _geometryTypes, topologyVector, vertexOffsets, vertexBuffer, mortonSettings) {\n        super(vertexBufferType, topologyVector, vertexOffsets, vertexBuffer, mortonSettings);\n        this._geometryTypes = _geometryTypes;\n    }\n    geometryType(index) {\n        return this._geometryTypes[index];\n    }\n    get numGeometries() {\n        return this._geometryTypes.length;\n    }\n    containsPolygonGeometry() {\n        for (let i = 0; i < this.numGeometries; i++) {\n            if (this.geometryType(i) === GEOMETRY_TYPE.POLYGON || this.geometryType(i) === GEOMETRY_TYPE.MULTIPOLYGON) {\n                return true;\n            }\n        }\n        return false;\n    }\n    containsSingleGeometryType() {\n        return false;\n    }\n}\n//# sourceMappingURL=flatGeometryVector.js.map", "import Point from \"@mapbox/point-geometry\";\nimport { GEOMETRY_TYPE } from \"./geometryType\";\nexport class GpuVector {\n    constructor(_triangleOffsets, _indexBuffer, _vertexBuffer, _topologyVector) {\n        this._triangleOffsets = _triangleOffsets;\n        this._indexBuffer = _indexBuffer;\n        this._vertexBuffer = _vertexBuffer;\n        this._topologyVector = _topologyVector;\n    }\n    get triangleOffsets() {\n        return this._triangleOffsets;\n    }\n    get indexBuffer() {\n        return this._indexBuffer;\n    }\n    get vertexBuffer() {\n        return this._vertexBuffer;\n    }\n    get topologyVector() {\n        return this._topologyVector;\n    }\n    /**\n     * Returns geometries as coordinate arrays by extracting polygon outlines from topology.\n     * The vertexBuffer contains the outline vertices, separate from the tessellated triangles.\n     */\n    getGeometries() {\n        if (!this._topologyVector) {\n            throw new Error(\"Cannot convert GpuVector to coordinates without topology information\");\n        }\n        const geometries = new Array(this.numGeometries);\n        const topology = this._topologyVector;\n        const partOffsets = topology.partOffsets;\n        const ringOffsets = topology.ringOffsets;\n        const geometryOffsets = topology.geometryOffsets;\n        // Use counters to track position in offset arrays (like Java implementation)\n        let vertexBufferOffset = 0;\n        let partOffsetCounter = 1;\n        let ringOffsetsCounter = 1;\n        let geometryOffsetsCounter = 1;\n        for (let i = 0; i < this.numGeometries; i++) {\n            const geometryType = this.geometryType(i);\n            switch (geometryType) {\n                case GEOMETRY_TYPE.POLYGON:\n                    {\n                        // Get number of rings for this polygon\n                        const numRings = partOffsets[partOffsetCounter] - partOffsets[partOffsetCounter - 1];\n                        partOffsetCounter++;\n                        const rings = [];\n                        for (let j = 0; j < numRings; j++) {\n                            // Get number of vertices in this ring\n                            const numVertices = ringOffsets[ringOffsetsCounter] - ringOffsets[ringOffsetsCounter - 1];\n                            ringOffsetsCounter++;\n                            const ring = [];\n                            for (let k = 0; k < numVertices; k++) {\n                                const x = this._vertexBuffer[vertexBufferOffset++];\n                                const y = this._vertexBuffer[vertexBufferOffset++];\n                                ring.push(new Point(x, y));\n                            }\n                            // Close the ring by duplicating the first vertex (MVT format requirement)\n                            if (ring.length > 0) {\n                                ring.push(ring[0]);\n                            }\n                            rings.push(ring);\n                        }\n                        geometries[i] = rings;\n                        if (geometryOffsets)\n                            geometryOffsetsCounter++;\n                    }\n                    break;\n                case GEOMETRY_TYPE.MULTIPOLYGON:\n                    {\n                        // Get number of polygons in this multipolygon\n                        const numPolygons = geometryOffsets[geometryOffsetsCounter] - geometryOffsets[geometryOffsetsCounter - 1];\n                        geometryOffsetsCounter++;\n                        const allRings = [];\n                        for (let p = 0; p < numPolygons; p++) {\n                            // Get number of rings in this polygon\n                            const numRings = partOffsets[partOffsetCounter] - partOffsets[partOffsetCounter - 1];\n                            partOffsetCounter++;\n                            for (let j = 0; j < numRings; j++) {\n                                // Get number of vertices in this ring\n                                const numVertices = ringOffsets[ringOffsetsCounter] - ringOffsets[ringOffsetsCounter - 1];\n                                ringOffsetsCounter++;\n                                const ring = [];\n                                for (let k = 0; k < numVertices; k++) {\n                                    const x = this._vertexBuffer[vertexBufferOffset++];\n                                    const y = this._vertexBuffer[vertexBufferOffset++];\n                                    ring.push(new Point(x, y));\n                                }\n                                // Close the ring by duplicating the first vertex (MVT format requirement)\n                                if (ring.length > 0) {\n                                    ring.push(ring[0]);\n                                }\n                                allRings.push(ring);\n                            }\n                        }\n                        geometries[i] = allRings;\n                    }\n                    break;\n            }\n        }\n        return geometries;\n    }\n    [Symbol.iterator]() {\n        /*for(let i = 1; i < this.triangleOffsets.length; i++) {\n           const numTriangles = this.triangleOffsets[i] - this.triangleOffsets[i-1];\n           const startIndex = this.triangleOffsets[i-1] * 3;\n           const endIndex = this.triangleOffsets[i] * 3;\n       }\n\n        while (index < this.numGeometries) {\n            yield geometries[index++];\n        }*/\n        //throw new Error(\"Iterator on a GpuVector is not implemented yet.\");\n        return null;\n    }\n}\n//# sourceMappingURL=gpuVector.js.map", "import { GpuVector } from \"./gpuVector\";\nexport function createConstGpuVector(numGeometries, geometryType, triangleOffsets, indexBuffer, vertexBuffer, topologyVector) {\n    return new ConstGpuVector(numGeometries, geometryType, triangleOffsets, indexBuffer, vertexBuffer, topologyVector);\n}\n//TODO: extend from GeometryVector -> make topology vector optional\nexport class ConstGpuVector extends GpuVector {\n    constructor(_numGeometries, _geometryType, triangleOffsets, indexBuffer, vertexBuffer, topologyVector) {\n        super(triangleOffsets, indexBuffer, vertexBuffer, topologyVector);\n        this._numGeometries = _numGeometries;\n        this._geometryType = _geometryType;\n    }\n    geometryType(_index) {\n        return this._geometryType;\n    }\n    get numGeometries() {\n        return this._numGeometries;\n    }\n    containsSingleGeometryType() {\n        return true;\n    }\n}\n//# sourceMappingURL=constGpuVector.js.map", "import { GpuVector } from \"./gpuVector\";\nexport function createFlatGpuVector(geometryTypes, triangleOffsets, indexBuffer, vertexBuffer, topologyVector) {\n    return new FlatGpuVector(geometryTypes, triangleOffsets, indexBuffer, vertexBuffer, topologyVector);\n}\n//TODO: extend from GeometryVector -> make topology vector optional\nexport class FlatGpuVector extends GpuVector {\n    constructor(_geometryTypes, triangleOffsets, indexBuffer, vertexBuffer, topologyVector) {\n        super(triangleOffsets, indexBuffer, vertexBuffer, topologyVector);\n        this._geometryTypes = _geometryTypes;\n    }\n    geometryType(index) {\n        return this._geometryTypes[index];\n    }\n    get numGeometries() {\n        return this._geometryTypes.length;\n    }\n    containsSingleGeometryType() {\n        return false;\n    }\n}\n//# sourceMappingURL=flatGpuVector.js.map", "import { decodeStreamMetadata } from \"../metadata/tile/streamMetadataDecoder\";\nimport { decodeSignedInt32Stream, decodeLengthStreamToOffsetBuffer, decodeUnsignedConstInt32Stream, decodeUnsignedInt32Stream, getVectorType, } from \"./integerStreamDecoder\";\nimport { VectorType } from \"../vector/vectorType\";\nimport { PhysicalStreamType } from \"../metadata/tile/physicalStreamType\";\nimport { LengthType } from \"../metadata/tile/lengthType\";\nimport { DictionaryType } from \"../metadata/tile/dictionaryType\";\nimport { createConstGeometryVector, createMortonEncodedConstGeometryVector, } from \"../vector/geometry/constGeometryVector\";\nimport { createFlatGeometryVector, createFlatGeometryVectorMortonEncoded } from \"../vector/geometry/flatGeometryVector\";\nimport { OffsetType } from \"../metadata/tile/offsetType\";\nimport { createConstGpuVector } from \"../vector/geometry/constGpuVector\";\nimport { createFlatGpuVector } from \"../vector/geometry/flatGpuVector\";\n// TODO: get rid of numFeatures parameter\nexport function decodeGeometryColumn(tile, numStreams, offset, numFeatures, scalingData) {\n    const geometryTypeMetadata = decodeStreamMetadata(tile, offset);\n    const geometryTypesVectorType = getVectorType(geometryTypeMetadata, numFeatures, tile, offset);\n    let vertexOffsets;\n    let vertexBuffer;\n    let mortonSettings;\n    let indexBuffer;\n    if (geometryTypesVectorType === VectorType.CONST) {\n        /* All geometries in the column have the same geometry type */\n        const geometryType = decodeUnsignedConstInt32Stream(tile, offset, geometryTypeMetadata);\n        // Variables for const geometry path (directly decoded as offsets)\n        let geometryOffsets;\n        let partOffsets;\n        let ringOffsets;\n        //TODO: use geometryOffsets for that? -> but then tessellated polygons can't be used with normal polygons\n        // in one FeatureTable?\n        let triangleOffsets;\n        for (let i = 0; i < numStreams - 1; i++) {\n            const geometryStreamMetadata = decodeStreamMetadata(tile, offset);\n            switch (geometryStreamMetadata.physicalStreamType) {\n                case PhysicalStreamType.LENGTH:\n                    switch (geometryStreamMetadata.logicalStreamType.lengthType) {\n                        case LengthType.GEOMETRIES:\n                            geometryOffsets = decodeLengthStreamToOffsetBuffer(tile, offset, geometryStreamMetadata);\n                            break;\n                        case LengthType.PARTS:\n                            partOffsets = decodeLengthStreamToOffsetBuffer(tile, offset, geometryStreamMetadata);\n                            break;\n                        case LengthType.RINGS:\n                            ringOffsets = decodeLengthStreamToOffsetBuffer(tile, offset, geometryStreamMetadata);\n                            break;\n                        case LengthType.TRIANGLES:\n                            triangleOffsets = decodeLengthStreamToOffsetBuffer(tile, offset, geometryStreamMetadata);\n                    }\n                    break;\n                case PhysicalStreamType.OFFSET: {\n                    switch (geometryStreamMetadata.logicalStreamType.offsetType) {\n                        case OffsetType.VERTEX:\n                            vertexOffsets = decodeUnsignedInt32Stream(tile, offset, geometryStreamMetadata);\n                            break;\n                        case OffsetType.INDEX:\n                            indexBuffer = decodeUnsignedInt32Stream(tile, offset, geometryStreamMetadata);\n                            break;\n                    }\n                    break;\n                }\n                case PhysicalStreamType.DATA: {\n                    if (DictionaryType.VERTEX === geometryStreamMetadata.logicalStreamType.dictionaryType) {\n                        vertexBuffer = decodeSignedInt32Stream(tile, offset, geometryStreamMetadata, scalingData);\n                    }\n                    else {\n                        const mortonMetadata = geometryStreamMetadata;\n                        mortonSettings = {\n                            numBits: mortonMetadata.numBits,\n                            coordinateShift: mortonMetadata.coordinateShift,\n                        };\n                        vertexBuffer = decodeUnsignedInt32Stream(tile, offset, geometryStreamMetadata, scalingData);\n                    }\n                    break;\n                }\n            }\n        }\n        if (indexBuffer) {\n            if (geometryOffsets !== undefined || partOffsets !== undefined) {\n                /* Case when the indices of a Polygon outline are encoded in the tile */\n                const topologyVector = { geometryOffsets, partOffsets, ringOffsets };\n                return createConstGpuVector(numFeatures, geometryType, triangleOffsets, indexBuffer, vertexBuffer, topologyVector);\n            }\n            /* Case when the no Polygon outlines are encoded in the tile */\n            return createConstGpuVector(numFeatures, geometryType, triangleOffsets, indexBuffer, vertexBuffer);\n        }\n        return mortonSettings === undefined\n            ? /* Currently only 2D coordinates (Vec2) are implemented in the encoder  */\n                createConstGeometryVector(numFeatures, geometryType, { geometryOffsets, partOffsets, ringOffsets }, vertexOffsets, vertexBuffer)\n            : createMortonEncodedConstGeometryVector(numFeatures, geometryType, { geometryOffsets, partOffsets, ringOffsets }, vertexOffsets, vertexBuffer, mortonSettings);\n    }\n    /* Different geometry types are mixed in the geometry column */\n    const geometryTypeVector = decodeUnsignedInt32Stream(tile, offset, geometryTypeMetadata);\n    // Variables for flat geometry path (decoded as lengths, then converted to offsets)\n    let geometryLengths;\n    let partLengths;\n    let ringLengths;\n    //TODO: use geometryOffsets for that? -> but then tessellated polygons can't be used with normal polygons\n    // in one FeatureTable?\n    let triangleOffsets;\n    for (let i = 0; i < numStreams - 1; i++) {\n        const geometryStreamMetadata = decodeStreamMetadata(tile, offset);\n        switch (geometryStreamMetadata.physicalStreamType) {\n            case PhysicalStreamType.LENGTH:\n                switch (geometryStreamMetadata.logicalStreamType.lengthType) {\n                    case LengthType.GEOMETRIES:\n                        geometryLengths = decodeUnsignedInt32Stream(tile, offset, geometryStreamMetadata);\n                        break;\n                    case LengthType.PARTS:\n                        partLengths = decodeUnsignedInt32Stream(tile, offset, geometryStreamMetadata);\n                        break;\n                    case LengthType.RINGS:\n                        ringLengths = decodeUnsignedInt32Stream(tile, offset, geometryStreamMetadata);\n                        break;\n                    case LengthType.TRIANGLES:\n                        triangleOffsets = decodeLengthStreamToOffsetBuffer(tile, offset, geometryStreamMetadata);\n                }\n                break;\n            case PhysicalStreamType.OFFSET:\n                switch (geometryStreamMetadata.logicalStreamType.offsetType) {\n                    case OffsetType.VERTEX:\n                        vertexOffsets = decodeUnsignedInt32Stream(tile, offset, geometryStreamMetadata);\n                        break;\n                    case OffsetType.INDEX:\n                        indexBuffer = decodeUnsignedInt32Stream(tile, offset, geometryStreamMetadata);\n                        break;\n                }\n                break;\n            case PhysicalStreamType.DATA:\n                if (DictionaryType.VERTEX === geometryStreamMetadata.logicalStreamType.dictionaryType) {\n                    vertexBuffer = decodeSignedInt32Stream(tile, offset, geometryStreamMetadata, scalingData);\n                }\n                else {\n                    const mortonMetadata = geometryStreamMetadata;\n                    mortonSettings = {\n                        numBits: mortonMetadata.numBits,\n                        coordinateShift: mortonMetadata.coordinateShift,\n                    };\n                    vertexBuffer = decodeUnsignedInt32Stream(tile, offset, geometryStreamMetadata, scalingData);\n                }\n                break;\n        }\n    }\n    // TODO: refactor the following instructions -> decode in one pass for performance reasons\n    /* Calculate the offsets from the length buffer for util access */\n    let geometryOffsets;\n    let partOffsets;\n    let ringOffsets;\n    if (geometryLengths) {\n        geometryOffsets = decodeRootLengthStream(geometryTypeVector, geometryLengths, 2);\n        if (partLengths && ringLengths) {\n            partOffsets = decodeLevel1LengthStream(geometryTypeVector, geometryOffsets, partLengths, false);\n            ringOffsets = decodeLevel2LengthStream(geometryTypeVector, geometryOffsets, partOffsets, ringLengths);\n        }\n        else if (partLengths) {\n            partOffsets = decodeLevel1WithoutRingBufferLengthStream(geometryTypeVector, geometryOffsets, partLengths);\n        }\n    }\n    else if (partLengths && ringLengths) {\n        partOffsets = decodeRootLengthStream(geometryTypeVector, partLengths, 1);\n        ringOffsets = decodeLevel1LengthStream(geometryTypeVector, partOffsets, ringLengths, true);\n    }\n    else if (partLengths) {\n        partOffsets = decodeRootLengthStream(geometryTypeVector, partLengths, 0);\n    }\n    if (indexBuffer && !partOffsets) {\n        /* Case when the indices of a Polygon outline are not encoded in the data so no\n         *  topology data are present in the tile */\n        return createFlatGpuVector(geometryTypeVector, triangleOffsets, indexBuffer, vertexBuffer);\n    }\n    if (indexBuffer) {\n        /* Case when the indices of a Polygon outline are encoded in the tile */\n        return createFlatGpuVector(geometryTypeVector, triangleOffsets, indexBuffer, vertexBuffer, {\n            geometryOffsets,\n            partOffsets,\n            ringOffsets,\n        });\n    }\n    return mortonSettings === undefined /* Currently only 2D coordinates (Vec2) are implemented in the encoder  */\n        ? createFlatGeometryVector(geometryTypeVector, { geometryOffsets, partOffsets, ringOffsets }, vertexOffsets, vertexBuffer)\n        : createFlatGeometryVectorMortonEncoded(geometryTypeVector, { geometryOffsets, partOffsets, ringOffsets }, vertexOffsets, vertexBuffer, mortonSettings);\n}\n/*\n * Handle the parsing of the different topology length buffers separate not generic to reduce the\n * branching and improve the performance\n */\nfunction decodeRootLengthStream(geometryTypes, rootLengthStream, bufferId) {\n    const rootBufferOffsets = new Uint32Array(geometryTypes.length + 1);\n    let previousOffset = 0;\n    rootBufferOffsets[0] = previousOffset;\n    let rootLengthCounter = 0;\n    for (let i = 0; i < geometryTypes.length; i++) {\n        /* Test if the geometry has and entry in the root buffer\n         * BufferId: 2 GeometryOffsets -> MultiPolygon, MultiLineString, MultiPoint\n         * BufferId: 1 PartOffsets -> Polygon\n         * BufferId: 0 PartOffsets, RingOffsets -> LineString\n         * */\n        previousOffset = rootBufferOffsets[i + 1] =\n            previousOffset + (geometryTypes[i] > bufferId ? rootLengthStream[rootLengthCounter++] : 1);\n    }\n    return rootBufferOffsets;\n}\nfunction decodeLevel1LengthStream(geometryTypes, rootOffsetBuffer, level1LengthBuffer, isLineStringPresent) {\n    const level1BufferOffsets = new Uint32Array(rootOffsetBuffer[rootOffsetBuffer.length - 1] + 1);\n    let previousOffset = 0;\n    level1BufferOffsets[0] = previousOffset;\n    let level1BufferCounter = 1;\n    let level1LengthBufferCounter = 0;\n    for (let i = 0; i < geometryTypes.length; i++) {\n        const geometryType = geometryTypes[i];\n        const numGeometries = rootOffsetBuffer[i + 1] - rootOffsetBuffer[i];\n        if (geometryType === 5 ||\n            geometryType === 2 ||\n            (isLineStringPresent && (geometryType === 4 || geometryType === 1))) {\n            /* For MultiPolygon, Polygon and in some cases for MultiLineString and LineString\n             * a value in the level1LengthBuffer exists */\n            for (let j = 0; j < numGeometries; j++) {\n                previousOffset = level1BufferOffsets[level1BufferCounter++] =\n                    previousOffset + level1LengthBuffer[level1LengthBufferCounter++];\n            }\n        }\n        else {\n            /* For MultiPoint and Point and in some cases for MultiLineString and LineString no value in the\n             * level1LengthBuffer exists */\n            for (let j = 0; j < numGeometries; j++) {\n                level1BufferOffsets[level1BufferCounter++] = ++previousOffset;\n            }\n        }\n    }\n    return level1BufferOffsets;\n}\n/*\n * Case where no ring buffer exists so no MultiPolygon or Polygon geometry is part of the buffer\n */\nfunction decodeLevel1WithoutRingBufferLengthStream(geometryTypes, rootOffsetBuffer, level1LengthBuffer) {\n    const level1BufferOffsets = new Uint32Array(rootOffsetBuffer[rootOffsetBuffer.length - 1] + 1);\n    let previousOffset = 0;\n    level1BufferOffsets[0] = previousOffset;\n    let level1OffsetBufferCounter = 1;\n    let level1LengthCounter = 0;\n    for (let i = 0; i < geometryTypes.length; i++) {\n        const geometryType = geometryTypes[i];\n        const numGeometries = rootOffsetBuffer[i + 1] - rootOffsetBuffer[i];\n        if (geometryType === 4 || geometryType === 1) {\n            /* For MultiLineString and LineString a value in the level1LengthBuffer exists */\n            for (let j = 0; j < numGeometries; j++) {\n                previousOffset = level1BufferOffsets[level1OffsetBufferCounter++] =\n                    previousOffset + level1LengthBuffer[level1LengthCounter++];\n            }\n        }\n        else {\n            /* For MultiPoint and Point no value in level1LengthBuffer exists */\n            for (let j = 0; j < numGeometries; j++) {\n                level1BufferOffsets[level1OffsetBufferCounter++] = ++previousOffset;\n            }\n        }\n    }\n    return level1BufferOffsets;\n}\nfunction decodeLevel2LengthStream(geometryTypes, rootOffsetBuffer, level1OffsetBuffer, level2LengthBuffer) {\n    const level2BufferOffsets = new Uint32Array(level1OffsetBuffer[level1OffsetBuffer.length - 1] + 1);\n    let previousOffset = 0;\n    level2BufferOffsets[0] = previousOffset;\n    let level1OffsetBufferCounter = 1;\n    let level2OffsetBufferCounter = 1;\n    let level2LengthBufferCounter = 0;\n    for (let i = 0; i < geometryTypes.length; i++) {\n        const geometryType = geometryTypes[i];\n        const numGeometries = rootOffsetBuffer[i + 1] - rootOffsetBuffer[i];\n        if (geometryType !== 0 && geometryType !== 3) {\n            /* For MultiPolygon, MultiLineString, Polygon and LineString a value in level2LengthBuffer\n             * exists */\n            for (let j = 0; j < numGeometries; j++) {\n                const numParts = level1OffsetBuffer[level1OffsetBufferCounter] - level1OffsetBuffer[level1OffsetBufferCounter - 1];\n                level1OffsetBufferCounter++;\n                for (let k = 0; k < numParts; k++) {\n                    previousOffset = level2BufferOffsets[level2OffsetBufferCounter++] =\n                        previousOffset + level2LengthBuffer[level2LengthBufferCounter++];\n                }\n            }\n        }\n        else {\n            /* For MultiPoint and Point no value in level2LengthBuffer exists */\n            for (let j = 0; j < numGeometries; j++) {\n                level2BufferOffsets[level2OffsetBufferCounter++] = ++previousOffset;\n                level1OffsetBufferCounter++;\n            }\n        }\n    }\n    return level2BufferOffsets;\n}\n//# sourceMappingURL=geometryDecoder.js.map", "import Vector from \"../vector\";\nexport class BooleanFlatVector extends Vector {\n    constructor(name, dataVector, sizeOrNullabilityBuffer) {\n        super(name, dataVector.getBuffer(), sizeOrNullabilityBuffer);\n        this.dataVector = dataVector;\n    }\n    getValueFromBuffer(index) {\n        return this.dataVector.get(index);\n    }\n}\n//# sourceMappingURL=booleanFlatVector.js.map", "import { FixedSizeVector } from \"../fixedSizeVector\";\nexport class FloatFlatVector extends FixedSizeVector {\n    getValueFromBuffer(index) {\n        return this.dataBuffer[index];\n    }\n}\n//# sourceMappingURL=floatFlatVector.js.map", "import Vector from \"../vector\";\nexport class Int64ConstVector extends Vector {\n    constructor(name, value, sizeOrNullabilityBuffer, isSigned) {\n        super(name, isSigned ? BigInt64Array.of(value) : BigUint64Array.of(value), sizeOrNullabilityBuffer);\n    }\n    getValueFromBuffer(_index) {\n        return this.dataBuffer[0];\n    }\n}\n//# sourceMappingURL=int64ConstVector.js.map", "import { VectorType } from \"../vector/vectorType\";\nimport { decodeStreamMetadata } from \"../metadata/tile/streamMetadataDecoder\";\nimport { unpackNullableBoolean, unpackNullable } from \"./unpackNullableUtils\";\nexport function skipColumn(numStreams, tile, offset) {\n    //TODO: add size of column in Mlt for fast skipping\n    for (let i = 0; i < numStreams; i++) {\n        const streamMetadata = decodeStreamMetadata(tile, offset);\n        offset.add(streamMetadata.byteLength);\n    }\n}\nexport function decodeBooleanRle(buffer, numBooleans, byteLength, pos, nullabilityBuffer) {\n    const numBytes = Math.ceil(numBooleans / 8.0);\n    const values = decodeByteRle(buffer, numBytes, byteLength, pos);\n    if (nullabilityBuffer) {\n        return unpackNullableBoolean(values, numBooleans, nullabilityBuffer);\n    }\n    return values;\n}\nexport function decodeByteRle(buffer, numBytes, byteLength, pos) {\n    const values = new Uint8Array(numBytes);\n    let valueOffset = 0;\n    const streamEndPos = pos.get() + byteLength;\n    while (valueOffset < numBytes) {\n        if (pos.get() >= streamEndPos) {\n            break;\n        }\n        const header = buffer[pos.increment()];\n        /* Runs */\n        if (header <= 0x7f) {\n            const numRuns = header + 3;\n            const value = buffer[pos.increment()];\n            const endValueOffset = Math.min(valueOffset + numRuns, numBytes);\n            values.fill(value, valueOffset, endValueOffset);\n            valueOffset = endValueOffset;\n        }\n        else {\n            /* Literals */\n            const numLiterals = 256 - header;\n            for (let i = 0; i < numLiterals && valueOffset < numBytes; i++) {\n                values[valueOffset++] = buffer[pos.increment()];\n            }\n        }\n    }\n    pos.set(streamEndPos);\n    return values;\n}\nexport function decodeFloatsLE(encodedValues, pos, numValues, nullabilityBuffer) {\n    const currentPos = pos.get();\n    const newOffset = currentPos + numValues * Float32Array.BYTES_PER_ELEMENT;\n    const newBuf = new Uint8Array(encodedValues.subarray(currentPos, newOffset)).buffer;\n    const fb = new Float32Array(newBuf);\n    pos.set(newOffset);\n    if (nullabilityBuffer) {\n        return unpackNullable(fb, nullabilityBuffer, 0);\n    }\n    return fb;\n}\nexport function decodeDoublesLE(encodedValues, pos, numValues, nullabilityBuffer) {\n    const currentPos = pos.get();\n    const newOffset = currentPos + numValues * Float64Array.BYTES_PER_ELEMENT;\n    const newBuf = new Uint8Array(encodedValues.subarray(currentPos, newOffset)).buffer;\n    const fb = new Float64Array(newBuf);\n    pos.set(newOffset);\n    if (nullabilityBuffer) {\n        return unpackNullable(fb, nullabilityBuffer, 0);\n    }\n    return fb;\n}\nconst TEXT_DECODER_MIN_LENGTH = 12;\nconst utf8TextDecoder = new TextDecoder();\n// Source: https://github.com/mapbox/pbf/issues/106\nexport function decodeString(buf, pos, end) {\n    if (end - pos >= TEXT_DECODER_MIN_LENGTH) {\n        // longer strings are fast with the built-in browser TextDecoder API\n        return utf8TextDecoder.decode(buf.subarray(pos, end));\n    }\n    // short strings are fast with custom implementation\n    return readUtf8(buf, pos, end);\n}\nfunction readUtf8(buf, pos, end) {\n    let str = \"\";\n    let i = pos;\n    while (i < end) {\n        const b0 = buf[i];\n        let c = null; // codepoint\n        let bytesPerSequence = b0 > 0xef ? 4 : b0 > 0xdf ? 3 : b0 > 0xbf ? 2 : 1;\n        if (i + bytesPerSequence > end)\n            break;\n        let b1;\n        let b2;\n        let b3;\n        if (bytesPerSequence === 1) {\n            if (b0 < 0x80) {\n                c = b0;\n            }\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        }\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        }\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        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        str += String.fromCharCode(c);\n        i += bytesPerSequence;\n    }\n    return str;\n}\nexport function getVectorTypeBooleanStream(numFeatures, byteLength, data, offset) {\n    const valuesPerRun = 0x83;\n    // TODO: use VectorType metadata field for to test which VectorType is used\n    return Math.ceil(numFeatures / valuesPerRun) * 2 === byteLength &&\n        /* Test the first value byte if all bits are set to true */\n        (data[offset.get() + 1] & 0xff) === (bitCount(numFeatures) << 2) - 1\n        ? VectorType.CONST\n        : VectorType.FLAT;\n}\nfunction bitCount(number) {\n    //TODO: refactor to get rid of special case handling\n    return number === 0 ? 1 : Math.floor(Math.log2(number) + 1);\n}\n//# sourceMappingURL=decodingUtils.js.map", "import Vector from \"./vector\";\nexport class VariableSizeVector extends Vector {\n    constructor(name, offsetBuffer, dataBuffer, sizeOrNullabilityBuffer) {\n        super(name, dataBuffer, sizeOrNullabilityBuffer);\n        this.offsetBuffer = offsetBuffer;\n    }\n}\n//# sourceMappingURL=variableSizeVector.js.map", "import { VariableSizeVector } from \"../variableSizeVector\";\nimport { decodeString } from \"../../decoding/decodingUtils\";\nexport class StringFlatVector extends VariableSizeVector {\n    constructor(name, offsetBuffer, dataBuffer, nullabilityBuffer) {\n        super(name, offsetBuffer, dataBuffer, nullabilityBuffer ?? offsetBuffer.length - 1);\n    }\n    getValueFromBuffer(index) {\n        const start = this.offsetBuffer[index];\n        const end = this.offsetBuffer[index + 1];\n        return decodeString(this.dataBuffer, start, end);\n    }\n}\n//# sourceMappingURL=stringFlatVector.js.map", "import { VariableSizeVector } from \"../variableSizeVector\";\nimport { decodeString } from \"../../decoding/decodingUtils\";\nexport class StringDictionaryVector extends VariableSizeVector {\n    constructor(name, indexBuffer, offsetBuffer, dictionaryBuffer, nullabilityBuffer) {\n        super(name, offsetBuffer, dictionaryBuffer, nullabilityBuffer ?? indexBuffer.length);\n        this.indexBuffer = indexBuffer;\n        this.indexBuffer = indexBuffer;\n    }\n    getValueFromBuffer(index) {\n        const offset = this.indexBuffer[index];\n        const start = this.offsetBuffer[offset];\n        const end = this.offsetBuffer[offset + 1];\n        return decodeString(this.dataBuffer, start, end);\n    }\n}\n//# sourceMappingURL=stringDictionaryVector.js.map", "import { VariableSizeVector } from \"../variableSizeVector\";\nimport { decodeFsst } from \"../../decoding/fsstDecoder\";\nimport { decodeString } from \"../../decoding/decodingUtils\";\nexport class StringFsstDictionaryVector extends VariableSizeVector {\n    constructor(name, indexBuffer, offsetBuffer, dictionaryBuffer, symbolOffsetBuffer, symbolTableBuffer, nullabilityBuffer) {\n        super(name, offsetBuffer, dictionaryBuffer, nullabilityBuffer);\n        this.indexBuffer = indexBuffer;\n        this.symbolOffsetBuffer = symbolOffsetBuffer;\n        this.symbolTableBuffer = symbolTableBuffer;\n    }\n    getValueFromBuffer(index) {\n        if (this.decodedDictionary == null) {\n            if (this.symbolLengthBuffer == null) {\n                // TODO: change FsstEncoder to take offsets instead of length to get rid of this conversion\n                this.symbolLengthBuffer = this.offsetToLengthBuffer(this.symbolOffsetBuffer);\n            }\n            this.decodedDictionary = decodeFsst(this.symbolTableBuffer, this.symbolLengthBuffer, this.dataBuffer);\n        }\n        const offset = this.indexBuffer[index];\n        const start = this.offsetBuffer[offset];\n        const end = this.offsetBuffer[offset + 1];\n        return decodeString(this.decodedDictionary, start, end);\n    }\n    // TODO: get rid of that conversion\n    offsetToLengthBuffer(offsetBuffer) {\n        const lengthBuffer = new Uint32Array(offsetBuffer.length - 1);\n        let previousOffset = offsetBuffer[0];\n        for (let i = 1; i < offsetBuffer.length; i++) {\n            const offset = offsetBuffer[i];\n            lengthBuffer[i - 1] = offset - previousOffset;\n            previousOffset = offset;\n        }\n        return lengthBuffer;\n    }\n}\n//# sourceMappingURL=stringFsstDictionaryVector.js.map", "/**\n * Decode FSST compressed data\n *\n * @param symbols           Array of symbols, where each symbol can be between 1 and 8 bytes\n * @param symbolLengths     Array of symbol lengths, length of each symbol in symbols array\n * @param compressedData    FSST Compressed data, where each entry is an index to the symbols array\n * @returns                 Decoded data as Uint8Array\n */\n//TODO: improve -> quick and dirty implementation\nexport function decodeFsst(symbols, symbolLengths, compressedData) {\n    //TODO: use typed array directly\n    const decodedData = [];\n    const symbolOffsets = new Array(symbolLengths.length).fill(0);\n    for (let i = 1; i < symbolLengths.length; i++) {\n        symbolOffsets[i] = symbolOffsets[i - 1] + symbolLengths[i - 1];\n    }\n    for (let i = 0; i < compressedData.length; i++) {\n        if (compressedData[i] === 255) {\n            decodedData.push(compressedData[++i]);\n        }\n        else {\n            const symbolLength = symbolLengths[compressedData[i]];\n            const symbolOffset = symbolOffsets[compressedData[i]];\n            for (let j = 0; j < symbolLength; j++) {\n                decodedData.push(symbols[symbolOffset + j]);\n            }\n        }\n    }\n    return new Uint8Array(decodedData);\n}\n//# sourceMappingURL=fsstDecoder.js.map", "import { ScalarType } from \"../metadata/tileset/tilesetMetadata\";\nimport BitVector from \"../vector/flat/bitVector\";\nimport { decodeStreamMetadata } from \"../metadata/tile/streamMetadataDecoder\";\nimport { VectorType } from \"../vector/vectorType\";\nimport { BooleanFlatVector } from \"../vector/flat/booleanFlatVector\";\nimport { DoubleFlatVector } from \"../vector/flat/doubleFlatVector\";\nimport { FloatFlatVector } from \"../vector/flat/floatFlatVector\";\nimport { Int64ConstVector } from \"../vector/constant/int64ConstVector\";\nimport { Int64FlatVector } from \"../vector/flat/int64FlatVector\";\nimport { Int32FlatVector } from \"../vector/flat/int32FlatVector\";\nimport { Int32ConstVector } from \"../vector/constant/int32ConstVector\";\nimport { decodeBooleanRle, decodeDoublesLE, decodeFloatsLE, skipColumn } from \"./decodingUtils\";\nimport { decodeSignedConstInt32Stream, decodeSignedConstInt64Stream, decodeSignedInt32Stream, decodeSignedInt64Stream, decodeUnsignedInt32Stream, decodeUnsignedConstInt32Stream, decodeUnsignedConstInt64Stream, decodeUnsignedInt64Stream, decodeSequenceInt32Stream, decodeSequenceInt64Stream, getVectorType, } from \"./integerStreamDecoder\";\nimport { Int32SequenceVector } from \"../vector/sequence/int32SequenceVector\";\nimport { Int64SequenceVector } from \"../vector/sequence/int64SequenceVector\";\nimport { decodeSharedDictionary, decodeString } from \"./stringDecoder\";\nexport function decodePropertyColumn(data, offset, columnMetadata, numStreams, numFeatures, propertyColumnNames) {\n    if (columnMetadata.type === \"scalarType\") {\n        if (propertyColumnNames && !propertyColumnNames.has(columnMetadata.name)) {\n            skipColumn(numStreams, data, offset);\n            return null;\n        }\n        return decodeScalarPropertyColumn(numStreams, data, offset, numFeatures, columnMetadata.scalarType, columnMetadata);\n    }\n    if (numStreams === 0) {\n        return null;\n    }\n    return decodeSharedDictionary(data, offset, columnMetadata, numFeatures, propertyColumnNames);\n}\nfunction decodeScalarPropertyColumn(numStreams, data, offset, numFeatures, column, columnMetadata) {\n    let nullabilityBuffer = null;\n    if (numStreams === 0) {\n        return null;\n    }\n    if (columnMetadata.nullable) {\n        const presentStreamMetadata = decodeStreamMetadata(data, offset);\n        const numValues = presentStreamMetadata.numValues;\n        const streamDataStart = offset.get();\n        const presentVector = decodeBooleanRle(data, numValues, presentStreamMetadata.byteLength, offset);\n        offset.set(streamDataStart + presentStreamMetadata.byteLength);\n        nullabilityBuffer = new BitVector(presentVector, presentStreamMetadata.numValues);\n    }\n    const sizeOrNullabilityBuffer = nullabilityBuffer ?? numFeatures;\n    const scalarType = column.physicalType;\n    switch (scalarType) {\n        case ScalarType.UINT_32:\n        case ScalarType.INT_32:\n            return decodeInt32Column(data, offset, columnMetadata, column, sizeOrNullabilityBuffer);\n        case ScalarType.STRING: {\n            // In embedded format: numStreams includes nullability stream if column is nullable\n            const stringDataStreams = columnMetadata.nullable ? numStreams - 1 : numStreams;\n            return decodeString(columnMetadata.name, data, offset, stringDataStreams, nullabilityBuffer);\n        }\n        case ScalarType.BOOLEAN:\n            return decodeBooleanColumn(data, offset, columnMetadata, numFeatures, sizeOrNullabilityBuffer);\n        case ScalarType.UINT_64:\n        case ScalarType.INT_64:\n            return decodeInt64Column(data, offset, columnMetadata, sizeOrNullabilityBuffer, column);\n        case ScalarType.FLOAT:\n            return decodeFloatColumn(data, offset, columnMetadata, sizeOrNullabilityBuffer);\n        case ScalarType.DOUBLE:\n            return decodeDoubleColumn(data, offset, columnMetadata, sizeOrNullabilityBuffer);\n        default:\n            throw new Error(`The specified data type for the field is currently not supported: ${column}`);\n    }\n}\nfunction decodeBooleanColumn(data, offset, column, _numFeatures, sizeOrNullabilityBuffer) {\n    const dataStreamMetadata = decodeStreamMetadata(data, offset);\n    const numValues = dataStreamMetadata.numValues;\n    const streamDataStart = offset.get();\n    const nullabilityBuffer = isNullabilityBuffer(sizeOrNullabilityBuffer) ? sizeOrNullabilityBuffer : undefined;\n    const dataStream = decodeBooleanRle(data, numValues, dataStreamMetadata.byteLength, offset, nullabilityBuffer);\n    offset.set(streamDataStart + dataStreamMetadata.byteLength);\n    const dataVector = new BitVector(dataStream, numValues);\n    return new BooleanFlatVector(column.name, dataVector, sizeOrNullabilityBuffer);\n}\nfunction decodeFloatColumn(data, offset, column, sizeOrNullabilityBuffer) {\n    const dataStreamMetadata = decodeStreamMetadata(data, offset);\n    const nullabilityBuffer = isNullabilityBuffer(sizeOrNullabilityBuffer) ? sizeOrNullabilityBuffer : undefined;\n    const dataStream = decodeFloatsLE(data, offset, dataStreamMetadata.numValues, nullabilityBuffer);\n    return new FloatFlatVector(column.name, dataStream, sizeOrNullabilityBuffer);\n}\nfunction decodeDoubleColumn(data, offset, column, sizeOrNullabilityBuffer) {\n    const dataStreamMetadata = decodeStreamMetadata(data, offset);\n    const nullabilityBuffer = isNullabilityBuffer(sizeOrNullabilityBuffer) ? sizeOrNullabilityBuffer : undefined;\n    const dataStream = decodeDoublesLE(data, offset, dataStreamMetadata.numValues, nullabilityBuffer);\n    return new DoubleFlatVector(column.name, dataStream, sizeOrNullabilityBuffer);\n}\nfunction decodeInt64Column(data, offset, column, sizeOrNullabilityBuffer, scalarColumn) {\n    const dataStreamMetadata = decodeStreamMetadata(data, offset);\n    const vectorType = getVectorType(dataStreamMetadata, sizeOrNullabilityBuffer, data, offset, \"int64\");\n    const isSigned = scalarColumn.physicalType === ScalarType.INT_64;\n    if (vectorType === VectorType.FLAT) {\n        const nullabilityBuffer = isNullabilityBuffer(sizeOrNullabilityBuffer) ? sizeOrNullabilityBuffer : undefined;\n        const dataStream = isSigned\n            ? decodeSignedInt64Stream(data, offset, dataStreamMetadata, nullabilityBuffer)\n            : decodeUnsignedInt64Stream(data, offset, dataStreamMetadata, nullabilityBuffer);\n        return new Int64FlatVector(column.name, dataStream, sizeOrNullabilityBuffer);\n    }\n    if (vectorType === VectorType.SEQUENCE) {\n        const id = decodeSequenceInt64Stream(data, offset, dataStreamMetadata);\n        return new Int64SequenceVector(column.name, id[0], id[1], dataStreamMetadata.numRleValues);\n    }\n    const constValue = isSigned\n        ? decodeSignedConstInt64Stream(data, offset, dataStreamMetadata)\n        : decodeUnsignedConstInt64Stream(data, offset, dataStreamMetadata);\n    return new Int64ConstVector(column.name, constValue, sizeOrNullabilityBuffer, isSigned);\n}\nfunction decodeInt32Column(data, offset, column, scalarColumn, sizeOrNullabilityBuffer) {\n    const dataStreamMetadata = decodeStreamMetadata(data, offset);\n    const vectorType = getVectorType(dataStreamMetadata, sizeOrNullabilityBuffer, data, offset);\n    const isSigned = scalarColumn.physicalType === ScalarType.INT_32;\n    if (vectorType === VectorType.FLAT) {\n        const nullabilityBuffer = isNullabilityBuffer(sizeOrNullabilityBuffer) ? sizeOrNullabilityBuffer : undefined;\n        const dataStream = isSigned\n            ? decodeSignedInt32Stream(data, offset, dataStreamMetadata, undefined, nullabilityBuffer)\n            : decodeUnsignedInt32Stream(data, offset, dataStreamMetadata, undefined, nullabilityBuffer);\n        return new Int32FlatVector(column.name, dataStream, sizeOrNullabilityBuffer);\n    }\n    if (vectorType === VectorType.SEQUENCE) {\n        const id = decodeSequenceInt32Stream(data, offset, dataStreamMetadata);\n        return new Int32SequenceVector(column.name, id[0], id[1], dataStreamMetadata.numRleValues);\n    }\n    const constValue = isSigned\n        ? decodeSignedConstInt32Stream(data, offset, dataStreamMetadata)\n        : decodeUnsignedConstInt32Stream(data, offset, dataStreamMetadata);\n    return new Int32ConstVector(column.name, constValue, sizeOrNullabilityBuffer, isSigned);\n}\nfunction isNullabilityBuffer(sizeOrNullabilityBuffer) {\n    return sizeOrNullabilityBuffer instanceof BitVector;\n}\n//# sourceMappingURL=propertyDecoder.js.map", "// based on ../spec/schema/mlt_tileset_metadata.proto\nexport const ColumnScope = {\n    FEATURE: 0,\n    VERTEX: 1,\n};\nexport const ScalarType = {\n    BOOLEAN: 0,\n    INT_8: 1,\n    UINT_8: 2,\n    INT_32: 3,\n    UINT_32: 4,\n    INT_64: 5,\n    UINT_64: 6,\n    FLOAT: 7,\n    DOUBLE: 8,\n    STRING: 9,\n};\nexport const ComplexType = {\n    GEOMETRY: 0,\n    STRUCT: 1,\n};\nexport const LogicalScalarType = {\n    ID: 0,\n};\nexport const LogicalComplexType = {\n    BINARY: 0,\n    RANGE_MAP: 1,\n};\n//# sourceMappingURL=tilesetMetadata.js.map", "import { decodeStreamMetadata } from \"../metadata/tile/streamMetadataDecoder\";\nimport { StringFlatVector } from \"../vector/flat/stringFlatVector\";\nimport { StringDictionaryVector } from \"../vector/dictionary/stringDictionaryVector\";\nimport BitVector from \"../vector/flat/bitVector\";\nimport { PhysicalStreamType } from \"../metadata/tile/physicalStreamType\";\nimport { DictionaryType } from \"../metadata/tile/dictionaryType\";\nimport { LengthType } from \"../metadata/tile/lengthType\";\nimport { decodeUnsignedInt32Stream, decodeLengthStreamToOffsetBuffer } from \"./integerStreamDecoder\";\nimport { ScalarType } from \"../metadata/tileset/tilesetMetadata\";\nimport { decodeVarintInt32 } from \"./integerDecodingUtils\";\nimport { decodeBooleanRle, skipColumn } from \"./decodingUtils\";\nimport { StringFsstDictionaryVector } from \"../vector/fsst-dictionary/stringFsstDictionaryVector\";\nexport function decodeString(name, data, offset, numStreams, bitVector) {\n    let dictionaryLengthStream = null;\n    let offsetStream = null;\n    let dictionaryStream = null;\n    let symbolLengthStream = null;\n    let symbolTableStream = null;\n    let nullabilityBuffer = bitVector ?? null;\n    let plainLengthStream = null;\n    let plainDataStream = null;\n    for (let i = 0; i < numStreams; i++) {\n        const streamMetadata = decodeStreamMetadata(data, offset);\n        switch (streamMetadata.physicalStreamType) {\n            case PhysicalStreamType.PRESENT: {\n                const presentData = decodeBooleanRle(data, streamMetadata.numValues, streamMetadata.byteLength, offset);\n                const presentStream = new BitVector(presentData, streamMetadata.numValues);\n                nullabilityBuffer = bitVector ?? presentStream;\n                break;\n            }\n            case PhysicalStreamType.OFFSET: {\n                offsetStream = decodeUnsignedInt32Stream(data, offset, streamMetadata, undefined, nullabilityBuffer);\n                break;\n            }\n            case PhysicalStreamType.LENGTH: {\n                const lengthStream = decodeLengthStreamToOffsetBuffer(data, offset, streamMetadata);\n                if (LengthType.DICTIONARY === streamMetadata.logicalStreamType.lengthType) {\n                    dictionaryLengthStream = lengthStream;\n                }\n                else if (LengthType.SYMBOL === streamMetadata.logicalStreamType.lengthType) {\n                    symbolLengthStream = lengthStream;\n                }\n                else {\n                    // Plain string encoding uses VAR_BINARY length type\n                    plainLengthStream = lengthStream;\n                }\n                break;\n            }\n            case PhysicalStreamType.DATA: {\n                const dataStream = data.subarray(offset.get(), offset.get() + streamMetadata.byteLength);\n                offset.add(streamMetadata.byteLength);\n                const dictType = streamMetadata.logicalStreamType.dictionaryType;\n                if (DictionaryType.FSST === dictType) {\n                    symbolTableStream = dataStream;\n                }\n                else if (DictionaryType.SINGLE === dictType || DictionaryType.SHARED === dictType) {\n                    dictionaryStream = dataStream;\n                }\n                else if (DictionaryType.NONE === dictType) {\n                    plainDataStream = dataStream;\n                }\n                break;\n            }\n        }\n    }\n    return (decodeFsstDictionaryVector(name, symbolTableStream, offsetStream, dictionaryLengthStream, dictionaryStream, symbolLengthStream, nullabilityBuffer) ??\n        decodeDictionaryVector(name, dictionaryStream, offsetStream, dictionaryLengthStream, nullabilityBuffer) ??\n        decodePlainStringVector(name, plainLengthStream, plainDataStream, offsetStream, nullabilityBuffer));\n}\nfunction decodeFsstDictionaryVector(name, symbolTableStream, offsetStream, dictionaryLengthStream, dictionaryStream, symbolLengthStream, nullabilityBuffer) {\n    if (!symbolTableStream) {\n        return null;\n    }\n    return new StringFsstDictionaryVector(name, offsetStream, dictionaryLengthStream, dictionaryStream, symbolLengthStream, symbolTableStream, nullabilityBuffer);\n}\nfunction decodeDictionaryVector(name, dictionaryStream, offsetStream, dictionaryLengthStream, nullabilityBuffer) {\n    if (!dictionaryStream) {\n        return null;\n    }\n    return nullabilityBuffer\n        ? new StringDictionaryVector(name, offsetStream, dictionaryLengthStream, dictionaryStream, nullabilityBuffer)\n        : new StringDictionaryVector(name, offsetStream, dictionaryLengthStream, dictionaryStream);\n}\nfunction decodePlainStringVector(name, plainLengthStream, plainDataStream, offsetStream, nullabilityBuffer) {\n    if (!plainLengthStream || !plainDataStream) {\n        return null;\n    }\n    if (offsetStream) {\n        return nullabilityBuffer\n            ? new StringDictionaryVector(name, offsetStream, plainLengthStream, plainDataStream, nullabilityBuffer)\n            : new StringDictionaryVector(name, offsetStream, plainLengthStream, plainDataStream);\n    }\n    if (nullabilityBuffer && nullabilityBuffer.size() !== plainLengthStream.length - 1) {\n        const sparseOffsetStream = new Uint32Array(nullabilityBuffer.size());\n        let valueIndex = 0;\n        for (let i = 0; i < nullabilityBuffer.size(); i++) {\n            if (nullabilityBuffer.get(i)) {\n                sparseOffsetStream[i] = valueIndex++;\n            }\n            else {\n                sparseOffsetStream[i] = 0;\n            }\n        }\n        return new StringDictionaryVector(name, sparseOffsetStream, plainLengthStream, plainDataStream, nullabilityBuffer);\n    }\n    return nullabilityBuffer\n        ? new StringFlatVector(name, plainLengthStream, plainDataStream, nullabilityBuffer)\n        : new StringFlatVector(name, plainLengthStream, plainDataStream);\n}\nexport function decodeSharedDictionary(data, offset, column, numFeatures, propertyColumnNames) {\n    let dictionaryOffsetBuffer = null;\n    let dictionaryBuffer = null;\n    let symbolOffsetBuffer = null;\n    let symbolTableBuffer = null;\n    let dictionaryStreamDecoded = false;\n    while (!dictionaryStreamDecoded) {\n        const streamMetadata = decodeStreamMetadata(data, offset);\n        switch (streamMetadata.physicalStreamType) {\n            case PhysicalStreamType.LENGTH:\n                if (LengthType.DICTIONARY === streamMetadata.logicalStreamType.lengthType) {\n                    dictionaryOffsetBuffer = decodeLengthStreamToOffsetBuffer(data, offset, streamMetadata);\n                }\n                else {\n                    symbolOffsetBuffer = decodeLengthStreamToOffsetBuffer(data, offset, streamMetadata);\n                }\n                break;\n            case PhysicalStreamType.DATA:\n                if (DictionaryType.SINGLE === streamMetadata.logicalStreamType.dictionaryType ||\n                    DictionaryType.SHARED === streamMetadata.logicalStreamType.dictionaryType) {\n                    dictionaryBuffer = data.subarray(offset.get(), offset.get() + streamMetadata.byteLength);\n                    dictionaryStreamDecoded = true;\n                }\n                else {\n                    symbolTableBuffer = data.subarray(offset.get(), offset.get() + streamMetadata.byteLength);\n                }\n                offset.add(streamMetadata.byteLength);\n                break;\n        }\n    }\n    const childFields = column.complexType.children;\n    const stringDictionaryVectors = [];\n    let i = 0;\n    for (const childField of childFields) {\n        const numStreams = decodeVarintInt32(data, offset, 1)[0];\n        if (numStreams === 0) {\n            /* Column is not present in the tile */\n            continue;\n        }\n        const columnName = childField.name ? `${column.name}${childField.name}` : column.name;\n        if (propertyColumnNames) {\n            if (!propertyColumnNames.has(columnName)) {\n                //TODO: add size of sub column to Mlt for faster skipping\n                skipColumn(numStreams, data, offset);\n                continue;\n            }\n        }\n        if (numStreams !== 2 ||\n            childField.type !== \"scalarField\" ||\n            childField.scalarField.physicalType !== ScalarType.STRING) {\n            throw new Error(\"Currently only optional string fields are implemented for a struct.\");\n        }\n        const presentStreamMetadata = decodeStreamMetadata(data, offset);\n        const presentStream = decodeBooleanRle(data, presentStreamMetadata.numValues, presentStreamMetadata.byteLength, offset);\n        const offsetStreamMetadata = decodeStreamMetadata(data, offset);\n        const offsetCount = offsetStreamMetadata.decompressedCount;\n        const isNullable = offsetCount !== numFeatures;\n        const offsetStream = decodeUnsignedInt32Stream(data, offset, offsetStreamMetadata, undefined, isNullable ? new BitVector(presentStream, presentStreamMetadata.numValues) : undefined);\n        stringDictionaryVectors[i++] = symbolTableBuffer\n            ? new StringFsstDictionaryVector(columnName, offsetStream, dictionaryOffsetBuffer, dictionaryBuffer, symbolOffsetBuffer, symbolTableBuffer, new BitVector(presentStream, presentStreamMetadata.numValues))\n            : new StringDictionaryVector(columnName, offsetStream, dictionaryOffsetBuffer, dictionaryBuffer, new BitVector(presentStream, presentStreamMetadata.numValues));\n    }\n    return stringDictionaryVectors;\n}\n//# sourceMappingURL=stringDecoder.js.map", "import { ColumnScope, ComplexType, LogicalScalarType, ScalarType, } from \"./tilesetMetadata\";\n/**\n * The type code is a single varint32 that encodes:\n * - Physical or logical type\n * - Nullable flag\n * - Whether the column has a name (typeCode >= 10)\n * - Whether the column has children (typeCode == 30 for STRUCT)\n * - For ID types: whether it uses long (64-bit) IDs\n */\n/**\n * Decodes a type code into a Column structure.\n *\n * ID type codes (0..3):\n * - Bit 0: nullable\n * - Bit 1: longID (0/1 -> uint32 IDs, 2/3 -> uint64 IDs)\n *\n * ID columns are kept as logical types so they remain distinguishable\n * from feature properties that may also be named \"id\".\n */\nexport function decodeColumnType(typeCode) {\n    switch (typeCode) {\n        case 0:\n        case 1:\n        case 2:\n        case 3: {\n            const column = {};\n            column.nullable = (typeCode & 1) !== 0;\n            column.columnScope = ColumnScope.FEATURE;\n            const scalarCol = {};\n            scalarCol.type = \"logicalType\";\n            scalarCol.logicalType = LogicalScalarType.ID;\n            scalarCol.longID = (typeCode & 2) !== 0;\n            column.scalarType = scalarCol;\n            column.type = \"scalarType\";\n            return column;\n        }\n        case 4: {\n            // GEOMETRY (non-nullable, no children)\n            const column = {};\n            column.nullable = false;\n            column.columnScope = ColumnScope.FEATURE;\n            const complexCol = {};\n            complexCol.type = \"physicalType\";\n            complexCol.physicalType = ComplexType.GEOMETRY;\n            column.type = \"complexType\";\n            column.complexType = complexCol;\n            return column;\n        }\n        case 30: {\n            // STRUCT (non-nullable with children)\n            const column = {};\n            column.nullable = false;\n            column.columnScope = ColumnScope.FEATURE;\n            const complexCol = {};\n            complexCol.type = \"physicalType\";\n            complexCol.physicalType = ComplexType.STRUCT;\n            column.type = \"complexType\";\n            column.complexType = complexCol;\n            return column;\n        }\n        default:\n            return mapScalarType(typeCode);\n    }\n}\n/**\n * Returns true if this type code requires a name to be stored.\n * ID (0-3) and GEOMETRY (4) columns have implicit names.\n * All other types (>= 10) require explicit names.\n */\nexport function columnTypeHasName(typeCode) {\n    return typeCode >= 10;\n}\n/**\n * Returns true if this type code has child fields.\n * Only STRUCT (typeCode 30) has children.\n */\nexport function columnTypeHasChildren(typeCode) {\n    return typeCode === 30;\n}\n/**\n * Determines if a stream count needs to be read for this column.\n * Mirrors the logic in cpp/include/mlt/metadata/type_map.hpp lines 85-122\n */\nexport function hasStreamCount(column) {\n    if (column.type === \"scalarType\") {\n        const scalarCol = column.scalarType;\n        if (scalarCol.type === \"physicalType\") {\n            const physicalType = scalarCol.physicalType;\n            switch (physicalType) {\n                case ScalarType.BOOLEAN:\n                case ScalarType.INT_8:\n                case ScalarType.UINT_8:\n                case ScalarType.INT_32:\n                case ScalarType.UINT_32:\n                case ScalarType.INT_64:\n                case ScalarType.UINT_64:\n                case ScalarType.FLOAT:\n                case ScalarType.DOUBLE:\n                    return false;\n                case ScalarType.STRING:\n                    return true;\n                default:\n                    return false;\n            }\n        }\n        if (scalarCol.type === \"logicalType\") {\n            return false;\n        }\n    }\n    else if (column.type === \"complexType\") {\n        const complexCol = column.complexType;\n        if (complexCol.type === \"physicalType\") {\n            const physicalType = complexCol.physicalType;\n            switch (physicalType) {\n                case ComplexType.GEOMETRY:\n                case ComplexType.STRUCT:\n                    return true;\n                default:\n                    return false;\n            }\n        }\n    }\n    console.warn(\"Unexpected column type in hasStreamCount\", column);\n    return false;\n}\nexport function isLogicalIdColumn(column) {\n    return (column.type === \"scalarType\" &&\n        column.scalarType?.type === \"logicalType\" &&\n        column.scalarType.logicalType === LogicalScalarType.ID);\n}\nexport function isGeometryColumn(column) {\n    return (column.type === \"complexType\" &&\n        column.complexType?.type === \"physicalType\" &&\n        column.complexType.physicalType === ComplexType.GEOMETRY);\n}\n/**\n * Maps a scalar type code to a Column with ScalarType.\n * Type codes 10-29 encode scalar types with nullable flag.\n * Even codes are non-nullable, odd codes are nullable.\n */\nfunction mapScalarType(typeCode) {\n    let scalarType;\n    switch (typeCode) {\n        case 10:\n        case 11:\n            scalarType = ScalarType.BOOLEAN;\n            break;\n        case 12:\n        case 13:\n            scalarType = ScalarType.INT_8;\n            break;\n        case 14:\n        case 15:\n            scalarType = ScalarType.UINT_8;\n            break;\n        case 16:\n        case 17:\n            scalarType = ScalarType.INT_32;\n            break;\n        case 18:\n        case 19:\n            scalarType = ScalarType.UINT_32;\n            break;\n        case 20:\n        case 21:\n            scalarType = ScalarType.INT_64;\n            break;\n        case 22:\n        case 23:\n            scalarType = ScalarType.UINT_64;\n            break;\n        case 24:\n        case 25:\n            scalarType = ScalarType.FLOAT;\n            break;\n        case 26:\n        case 27:\n            scalarType = ScalarType.DOUBLE;\n            break;\n        case 28:\n        case 29:\n            scalarType = ScalarType.STRING;\n            break;\n        default:\n            return null;\n    }\n    const column = {};\n    column.nullable = (typeCode & 1) !== 0;\n    column.columnScope = ColumnScope.FEATURE;\n    const scalarCol = {};\n    scalarCol.type = \"physicalType\";\n    scalarCol.physicalType = scalarType;\n    column.type = \"scalarType\";\n    column.scalarType = scalarCol;\n    return column;\n}\n//# sourceMappingURL=typeMap.js.map", "import { decodeVarintInt32 } from \"../../decoding/integerDecodingUtils\";\nimport { columnTypeHasChildren, columnTypeHasName, decodeColumnType } from \"./typeMap\";\nconst textDecoder = new TextDecoder();\nconst SUPPORTED_COLUMN_TYPES = \"0-3(ID), 4(GEOMETRY), 10-29(scalars), 30(STRUCT)\";\nconst SUPPORTED_FIELD_TYPES = \"10-29(scalars), 30(STRUCT)\";\n/**\n * Decodes a length-prefixed UTF-8 string.\n * Layout: [len: varint32][bytes: len]\n */\nfunction decodeString(src, offset) {\n    const length = decodeVarintInt32(src, offset, 1)[0];\n    if (length === 0) {\n        return \"\";\n    }\n    const start = offset.get();\n    const end = start + length;\n    const view = src.subarray(start, end);\n    offset.add(length);\n    return textDecoder.decode(view);\n}\n/**\n * Converts a Column to a Field.\n * Used when decoding Field metadata which has the same format as Column.\n */\nfunction columnToField(column) {\n    return {\n        name: column.name,\n        nullable: column.nullable,\n        scalarField: column.scalarType,\n        complexField: column.complexType,\n        type: column.type === \"scalarType\" ? \"scalarField\" : \"complexField\",\n    };\n}\n/**\n * Decodes a Field used as part of complex types (STRUCT children).\n */\nexport function decodeField(src, offset) {\n    const typeCode = decodeVarintInt32(src, offset, 1)[0] >>> 0;\n    if (typeCode < 10 || typeCode > 30) {\n        throw new Error(`Unsupported field type code ${typeCode}. Supported: ${SUPPORTED_FIELD_TYPES}`);\n    }\n    const column = decodeColumnType(typeCode);\n    if (columnTypeHasName(typeCode)) {\n        column.name = decodeString(src, offset);\n    }\n    if (columnTypeHasChildren(typeCode)) {\n        const childCount = decodeVarintInt32(src, offset, 1)[0] >>> 0;\n        column.complexType.children = new Array(childCount);\n        for (let i = 0; i < childCount; i++) {\n            column.complexType.children[i] = decodeField(src, offset);\n        }\n    }\n    return columnToField(column);\n}\n/**\n * The typeCode encodes the column type, nullable flag, and whether it has name/children.\n */\nfunction decodeColumn(src, offset) {\n    const typeCode = decodeVarintInt32(src, offset, 1)[0] >>> 0;\n    const column = decodeColumnType(typeCode);\n    if (!column) {\n        throw new Error(`Unsupported column type code ${typeCode}. Supported: ${SUPPORTED_COLUMN_TYPES}`);\n    }\n    if (columnTypeHasName(typeCode)) {\n        column.name = decodeString(src, offset);\n    }\n    else {\n        // ID and GEOMETRY columns have implicit names\n        if (typeCode >= 0 && typeCode <= 3) {\n            column.name = \"id\";\n        }\n        else if (typeCode === 4) {\n            column.name = \"geometry\";\n        }\n    }\n    if (columnTypeHasChildren(typeCode)) {\n        // Only STRUCT (typeCode 30) has children\n        const childCount = decodeVarintInt32(src, offset, 1)[0] >>> 0;\n        const complexCol = column.complexType;\n        complexCol.children = new Array(childCount);\n        for (let i = 0; i < childCount; i++) {\n            complexCol.children[i] = decodeField(src, offset);\n        }\n    }\n    return column;\n}\n/**\n * Top-level decoder for embedded tileset metadata.\n * Reads exactly ONE FeatureTableSchema from the stream.\n *\n * @param bytes The byte array containing the metadata\n * @param offset The current offset in the byte array (will be advanced)\n */\nexport function decodeEmbeddedTileSetMetadata(bytes, offset) {\n    const meta = {};\n    meta.featureTables = [];\n    const table = {};\n    table.name = decodeString(bytes, offset);\n    const extent = decodeVarintInt32(bytes, offset, 1)[0] >>> 0;\n    const columnCount = decodeVarintInt32(bytes, offset, 1)[0] >>> 0;\n    table.columns = new Array(columnCount);\n    for (let j = 0; j < columnCount; j++) {\n        table.columns[j] = decodeColumn(bytes, offset);\n    }\n    meta.featureTables.push(table);\n    return [meta, extent];\n}\n//# sourceMappingURL=embeddedTilesetMetadataDecoder.js.map", "import FeatureTable from \"./vector/featureTable\";\nimport { LogicalScalarType, ScalarType } from \"./metadata/tileset/tilesetMetadata\";\nimport IntWrapper from \"./decoding/intWrapper\";\nimport { decodeStreamMetadata } from \"./metadata/tile/streamMetadataDecoder\";\nimport { VectorType } from \"./vector/vectorType\";\nimport { Int32FlatVector } from \"./vector/flat/int32FlatVector\";\nimport BitVector from \"./vector/flat/bitVector\";\nimport { decodeUnsignedConstInt32Stream, decodeUnsignedConstInt64Stream, decodeUnsignedInt64AsFloat64Stream, decodeUnsignedInt32Stream, decodeUnsignedInt64Stream, decodeSequenceInt32Stream, decodeSequenceInt64Stream, getVectorType, } from \"./decoding/integerStreamDecoder\";\nimport { Int32SequenceVector } from \"./vector/sequence/int32SequenceVector\";\nimport { Int64FlatVector } from \"./vector/flat/int64FlatVector\";\nimport { Int64SequenceVector } from \"./vector/sequence/int64SequenceVector\";\nimport { decodeVarintInt32 } from \"./decoding/integerDecodingUtils\";\nimport { decodeGeometryColumn } from \"./decoding/geometryDecoder\";\nimport { decodePropertyColumn } from \"./decoding/propertyDecoder\";\nimport { Int32ConstVector } from \"./vector/constant/int32ConstVector\";\nimport { Int64ConstVector } from \"./vector/constant/int64ConstVector\";\nimport { decodeBooleanRle } from \"./decoding/decodingUtils\";\nimport { DoubleFlatVector } from \"./vector/flat/doubleFlatVector\";\nimport { decodeEmbeddedTileSetMetadata } from \"./metadata/tileset/embeddedTilesetMetadataDecoder\";\nimport { hasStreamCount, isGeometryColumn, isLogicalIdColumn } from \"./metadata/tileset/typeMap\";\n/**\n * Decodes a tile with embedded metadata (Tag 0x01 format).\n * This is the primary decoder function for MLT tiles.\n *\n * @param tile The tile data to decode (will be decompressed if gzip-compressed)\n * @param geometryScaling Optional geometry scaling parameters\n * @param idWithinMaxSafeInteger If true, limits ID values to JavaScript safe integer range (53 bits)\n */\nexport default function decodeTile(tile, geometryScaling, idWithinMaxSafeInteger = true) {\n    const offset = new IntWrapper(0);\n    const featureTables = [];\n    while (offset.get() < tile.length) {\n        const blockLength = decodeVarintInt32(tile, offset, 1)[0] >>> 0;\n        const blockStart = offset.get();\n        const blockEnd = blockStart + blockLength;\n        if (blockEnd > tile.length) {\n            throw new Error(`Block overruns tile: ${blockEnd} > ${tile.length}`);\n        }\n        const tag = decodeVarintInt32(tile, offset, 1)[0] >>> 0;\n        if (tag !== 1) {\n            // Skip unknown block types\n            offset.set(blockEnd);\n            continue;\n        }\n        const [metadata, extent] = decodeEmbeddedTileSetMetadata(tile, offset);\n        const featureTableMetadata = metadata.featureTables[0];\n        let idVector = null;\n        let geometryVector = null;\n        const propertyVectors = [];\n        let numFeatures = 0;\n        for (const columnMetadata of featureTableMetadata.columns) {\n            const columnName = columnMetadata.name;\n            if (isLogicalIdColumn(columnMetadata)) {\n                let nullabilityBuffer = null;\n                // Check column metadata nullable flag, not numStreams (ID columns don't have stream count)\n                if (columnMetadata.nullable) {\n                    const presentStreamMetadata = decodeStreamMetadata(tile, offset);\n                    const streamDataStart = offset.get();\n                    const values = decodeBooleanRle(tile, presentStreamMetadata.numValues, presentStreamMetadata.byteLength, offset);\n                    offset.set(streamDataStart + presentStreamMetadata.byteLength);\n                    nullabilityBuffer = new BitVector(values, presentStreamMetadata.numValues);\n                }\n                const idDataStreamMetadata = decodeStreamMetadata(tile, offset);\n                // decompressedCount is the count WITHOUT nulls, but we may have nulls\n                numFeatures = nullabilityBuffer ? nullabilityBuffer.size() : idDataStreamMetadata.decompressedCount;\n                idVector = decodeIdColumn(tile, columnMetadata, offset, columnName, idDataStreamMetadata, nullabilityBuffer ?? numFeatures, idWithinMaxSafeInteger);\n            }\n            else if (isGeometryColumn(columnMetadata)) {\n                const numStreams = decodeVarintInt32(tile, offset, 1)[0];\n                // If no ID column, get numFeatures from geometry type stream metadata\n                if (numFeatures === 0) {\n                    const savedOffset = offset.get();\n                    const geometryTypeMetadata = decodeStreamMetadata(tile, offset);\n                    numFeatures = geometryTypeMetadata.decompressedCount;\n                    offset.set(savedOffset); // Reset to re-read in decodeGeometryColumn\n                }\n                if (geometryScaling) {\n                    geometryScaling.scale = geometryScaling.extent / extent;\n                }\n                geometryVector = decodeGeometryColumn(tile, numStreams, offset, numFeatures, geometryScaling);\n            }\n            else {\n                const columnHasStreamCount = hasStreamCount(columnMetadata);\n                const numStreams = columnHasStreamCount ? decodeVarintInt32(tile, offset, 1)[0] : 1;\n                if (numStreams === 0) {\n                    continue;\n                }\n                const propertyVector = decodePropertyColumn(tile, offset, columnMetadata, numStreams, numFeatures, undefined);\n                if (propertyVector) {\n                    if (Array.isArray(propertyVector)) {\n                        for (const property of propertyVector) {\n                            propertyVectors.push(property);\n                        }\n                    }\n                    else {\n                        propertyVectors.push(propertyVector);\n                    }\n                }\n            }\n        }\n        const featureTable = new FeatureTable(featureTableMetadata.name, geometryVector, idVector, propertyVectors, extent);\n        featureTables.push(featureTable);\n        offset.set(blockEnd);\n    }\n    return featureTables;\n}\nfunction decodeIdColumn(tile, columnMetadata, offset, columnName, idDataStreamMetadata, sizeOrNullabilityBuffer, idWithinMaxSafeInteger = false) {\n    const scalarTypeMetadata = columnMetadata.scalarType;\n    if (!scalarTypeMetadata ||\n        scalarTypeMetadata.type !== \"logicalType\" ||\n        scalarTypeMetadata.logicalType !== LogicalScalarType.ID) {\n        throw new Error(`ID column must be a logical ID scalar type: ${columnName}`);\n    }\n    const idDataType = scalarTypeMetadata.longID ? ScalarType.UINT_64 : ScalarType.UINT_32;\n    const nullabilityBuffer = typeof sizeOrNullabilityBuffer === \"number\" ? undefined : sizeOrNullabilityBuffer;\n    const vectorType = getVectorType(idDataStreamMetadata, sizeOrNullabilityBuffer, tile, offset, idDataType === ScalarType.UINT_64 ? \"int64\" : \"int32\");\n    if (idDataType === ScalarType.UINT_32) {\n        switch (vectorType) {\n            case VectorType.FLAT: {\n                const id = decodeUnsignedInt32Stream(tile, offset, idDataStreamMetadata, undefined, nullabilityBuffer);\n                return new Int32FlatVector(columnName, id, sizeOrNullabilityBuffer);\n            }\n            case VectorType.SEQUENCE: {\n                const id = decodeSequenceInt32Stream(tile, offset, idDataStreamMetadata);\n                return new Int32SequenceVector(columnName, id[0], id[1], idDataStreamMetadata.numRleValues);\n            }\n            case VectorType.CONST: {\n                const id = decodeUnsignedConstInt32Stream(tile, offset, idDataStreamMetadata);\n                return new Int32ConstVector(columnName, id, sizeOrNullabilityBuffer, false);\n            }\n        }\n    }\n    switch (vectorType) {\n        case VectorType.FLAT: {\n            if (idWithinMaxSafeInteger) {\n                const id = decodeUnsignedInt64AsFloat64Stream(tile, offset, idDataStreamMetadata);\n                return new DoubleFlatVector(columnName, id, sizeOrNullabilityBuffer);\n            }\n            const id = decodeUnsignedInt64Stream(tile, offset, idDataStreamMetadata, nullabilityBuffer);\n            return new Int64FlatVector(columnName, id, sizeOrNullabilityBuffer);\n        }\n        case VectorType.SEQUENCE: {\n            const id = decodeSequenceInt64Stream(tile, offset, idDataStreamMetadata);\n            return new Int64SequenceVector(columnName, id[0], id[1], idDataStreamMetadata.numRleValues);\n        }\n        case VectorType.CONST: {\n            const id = decodeUnsignedConstInt64Stream(tile, offset, idDataStreamMetadata);\n            return new Int64ConstVector(columnName, id, sizeOrNullabilityBuffer, false);\n        }\n    }\n    throw new Error(\"Vector type not supported for id column.\");\n}\n//# sourceMappingURL=mltDecoder.js.map", "import Point from '@mapbox/point-geometry';\nimport {type FeatureTable, decodeTile, type Feature as MLTFeature, GEOMETRY_TYPE} from '@maplibre/mlt';\nimport type {VectorTileFeatureLike, VectorTileLayerLike, VectorTileLike} from '@maplibre/vt-pbf';\n\nclass MLTVectorTileFeature implements VectorTileFeatureLike {\n    _featureData: MLTFeature;\n    properties: {[_: string]: any};\n    type: VectorTileFeatureLike['type'];\n    extent: VectorTileFeatureLike['extent'];\n    id: VectorTileFeatureLike['id'];\n\n    constructor(feature: MLTFeature, extent: number) {\n        this._featureData = feature;\n        this.properties = this._featureData.properties || {};\n        switch (this._featureData.geometry?.type) {\n            case GEOMETRY_TYPE.POINT:\n            case GEOMETRY_TYPE.MULTIPOINT:\n                this.type = 1;\n                break;\n            case GEOMETRY_TYPE.LINESTRING:\n            case GEOMETRY_TYPE.MULTILINESTRING:\n                this.type = 2;\n                break;\n            case GEOMETRY_TYPE.POLYGON:\n            case GEOMETRY_TYPE.MULTIPOLYGON:\n                this.type = 3;\n                break;\n            default:\n                this.type = 0;\n        };\n        this.extent = extent;\n        this.id = Number(this._featureData.id);\n    }\n\n    loadGeometry(): Point[][] {\n        const points: Point[][] = [];\n        for (const ring of this._featureData.geometry.coordinates) {\n            const pointRing: Point[] = [];\n            for (const coord of ring) {\n                pointRing.push(new Point(coord.x, coord.y));\n            }\n            points.push(pointRing);\n        }\n        return points;\n    }\n}\n\nclass MLTVectorTileLayer implements VectorTileLayerLike {\n    featureTable: FeatureTable;\n    name: string;\n    length: number;\n    version: number;\n    extent: number;\n    features: MLTFeature[] = [];\n    \n    constructor(featureTable: FeatureTable) {\n        this.featureTable = featureTable;\n        this.name = featureTable.name;\n        this.extent = featureTable.extent;\n        this.version = 2;\n        this.features = featureTable.getFeatures();\n        this.length = this.features.length;\n    }\n\n    feature(i: number): VectorTileFeatureLike {\n        return new MLTVectorTileFeature(this.features[i], this.extent);\n    }\n}\n\nexport class MLTVectorTile implements VectorTileLike {\n    layers: Record<string, VectorTileLayerLike> = {};\n\n    constructor(buffer: ArrayBuffer) {\n        const features = decodeTile(new Uint8Array(buffer));\n        this.layers = features.reduce((acc, f) => ({...acc, [f.name]: new MLTVectorTileLayer(f)}), {});\n    }\n}\n", "import Pbf from 'pbf';\nimport Point from '@mapbox/point-geometry';\n\nclass FeatureWrapper {\n    constructor(feature, extent) {\n        this.feature = feature;\n        this.type = feature.type;\n        this.properties = feature.tags ? feature.tags : {};\n        this.extent = extent;\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) {\n            if (typeof feature.id === 'string') {\n                this.id = parseInt(feature.id, 10);\n            }\n            else if (typeof feature.id === 'number' && !isNaN(feature.id)) {\n                this.id = feature.id;\n            }\n        }\n    }\n    loadGeometry() {\n        const geometry = [];\n        const rawGeo = this.feature.type === 1 ? [this.feature.geometry] : this.feature.geometry;\n        for (const ring of rawGeo) {\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}\nconst GEOJSON_TILE_LAYER_NAME = \"_geojsonTileLayer\";\nclass GeoJSONWrapper {\n    constructor(features, options) {\n        this.layers = { [GEOJSON_TILE_LAYER_NAME]: this };\n        this.name = GEOJSON_TILE_LAYER_NAME;\n        this.version = options ? options.version : 1;\n        this.extent = options ? options.extent : 4096;\n        this.length = features.length;\n        this.features = features;\n    }\n    feature(i) {\n        return new FeatureWrapper(this.features[i], this.extent);\n    }\n}\n\n/**\n * Serialize a vector-tile-js-created tile to pbf\n *\n * @param tile - the tile to serialize\n * @param jsonPrefix - a string prefix to prepend to JSON-stringified non-primitive property values, used to distinguish them from regular string values when parsing the tile later. Default is \"\".\n * @return uncompressed, pbf-serialized tile data\n */\nfunction fromVectorTileJs(tile, jsonPrefix = \"\") {\n    const out = new Pbf();\n    writeTile(tile, out, jsonPrefix);\n    return out.finish();\n}\n/**\n * Serialized a geojson-vt-created tile to pbf.\n *\n * @param layers - An object mapping layer names to geojson-vt-created vector tile objects\n * @param options - An object specifying the vector-tile specification version and extent that were used to create `layers`.\n * @return uncompressed, pbf-serialized tile data\n */\nfunction fromGeojsonVt(layers, options) {\n    const l = {};\n    // eslint-disable-next-line @typescript-eslint/no-for-in-array\n    for (const k in layers) {\n        l[k] = new GeoJSONWrapper(layers[k].features, options);\n        l[k].name = k;\n        l[k].version = options ? options.version : 1;\n        l[k].extent = options ? options.extent : 4096;\n    }\n    return fromVectorTileJs({ layers: l });\n}\nfunction writeTile(tile, pbf, jsonPrefix = \"\") {\n    for (const key in tile.layers) {\n        pbf.writeMessage(3, (layer, pbf) => writeLayer(layer, pbf, jsonPrefix), tile.layers[key]);\n    }\n}\nfunction writeLayer(layer, pbf, jsonPrefix = \"\") {\n    pbf.writeVarintField(15, layer.version || 1);\n    pbf.writeStringField(1, layer.name || '');\n    pbf.writeVarintField(5, layer.extent || 4096);\n    const context = {\n        jsonPrefix,\n        keys: [],\n        values: [],\n        keycache: {},\n        valuecache: {}\n    };\n    for (let i = 0; i < layer.length; i++) {\n        context.feature = layer.feature(i);\n        pbf.writeMessage(2, writeFeature, context);\n    }\n    const keys = context.keys;\n    for (const key of keys) {\n        pbf.writeStringField(3, key);\n    }\n    const values = context.values;\n    for (const value of values) {\n        pbf.writeMessage(4, writeValue, value);\n    }\n}\nfunction writeFeature(context, pbf) {\n    if (!context.feature) {\n        return;\n    }\n    const feature = context.feature;\n    if (feature.id !== undefined) {\n        pbf.writeVarintField(1, feature.id);\n    }\n    pbf.writeMessage(2, writeProperties, context);\n    pbf.writeVarintField(3, feature.type);\n    pbf.writeMessage(4, writeGeometry, feature);\n}\nfunction writeProperties(context, pbf) {\n    for (const key in context.feature?.properties) {\n        let value = context.feature.properties[key];\n        let keyIndex = context.keycache[key];\n        if (value == null)\n            continue; // don't encode null/undefined value properties\n        if (typeof keyIndex === 'undefined') {\n            context.keys.push(key);\n            keyIndex = context.keys.length - 1;\n            context.keycache[key] = keyIndex;\n        }\n        pbf.writeVarint(keyIndex);\n        if (typeof value !== 'string' && typeof value !== 'boolean' && typeof value !== 'number') {\n            value = context.jsonPrefix + JSON.stringify(value);\n        }\n        const valueKey = typeof value + ':' + value;\n        let valueIndex = context.valuecache[valueKey];\n        if (typeof valueIndex === 'undefined') {\n            context.values.push(value);\n            valueIndex = context.values.length - 1;\n            context.valuecache[valueKey] = valueIndex;\n        }\n        pbf.writeVarint(valueIndex);\n    }\n}\nfunction command(cmd, length) {\n    return (length << 3) + (cmd & 0x7);\n}\nfunction zigzag(num) {\n    return (num << 1) ^ (num >> 31);\n}\nfunction writeGeometry(feature, pbf) {\n    const geometry = feature.loadGeometry();\n    const type = feature.type;\n    let x = 0;\n    let y = 0;\n    for (const ring of geometry) {\n        let 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        const lineCount = type === 3 ? ring.length - 1 : ring.length;\n        for (let i = 0; i < lineCount; i++) {\n            if (i === 1 && type !== 1) {\n                pbf.writeVarint(command(2, lineCount - 1)); // lineto\n            }\n            const dx = ring[i].x - x;\n            const dy = ring[i].y - y;\n            pbf.writeVarint(zigzag(dx));\n            pbf.writeVarint(zigzag(dy));\n            x += dx;\n            y += dy;\n        }\n        if (feature.type === 3) {\n            pbf.writeVarint(command(7, 1)); // closepath\n        }\n    }\n}\nfunction writeValue(value, pbf) {\n    const type = typeof value;\n    if (type === 'string') {\n        pbf.writeStringField(1, value);\n    }\n    else if (type === 'boolean') {\n        pbf.writeBooleanField(7, value);\n    }\n    else if (type === 'number') {\n        if (value % 1 !== 0) {\n            pbf.writeDoubleField(3, value);\n        }\n        else if (value < 0) {\n            pbf.writeSVarintField(6, value);\n        }\n        else {\n            pbf.writeVarintField(5, value);\n        }\n    }\n}\n\nexport { GEOJSON_TILE_LAYER_NAME, GeoJSONWrapper, fromGeojsonVt, fromVectorTileJs };\n//# sourceMappingURL=index.es.js.map\n", "import type 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 Protobuf from 'pbf';\nimport {GeoJSONFeature} from '../util/vectortile_to_geojson';\nimport {mapObject, extend} from '../util/util';\nimport {register} from '../util/web_worker_transfer';\nimport {EvaluationParameters} from '../style/evaluation_parameters';\nimport {polygonIntersectsBox} from '../util/intersection_tests';\nimport {PossiblyEvaluated} from '../style/properties';\nimport {FeatureIndexArray} from './array_types.g';\n\nimport {MLTVectorTile} from '../source/vector_tile_mlt';\nimport {Bounds} from '../geo/bounds';\nimport type {OverscaledTileID} from '../tile/tile_id';\nimport type {SourceFeatureState} from '../source/source_state';\nimport type {mat4} from 'gl-matrix';\nimport type {MapGeoJSONFeature} from '../util/vectortile_to_geojson';\nimport type {StyleLayer} from '../style/style_layer';\nimport type {FeatureFilter, FeatureState, FilterSpecification, PromoteIdSpecification} from '@maplibre/maplibre-gl-style-spec';\nimport type {IReadonlyTransform} from '../geo/transform_interface';\nimport {type VectorTileFeatureLike, type VectorTileLayerLike, GEOJSON_TILE_LAYER_NAME} from '@maplibre/vt-pbf';\nimport {VectorTile} from '@mapbox/vector-tile';\n\nexport {GEOJSON_TILE_LAYER_NAME};\n\ntype QueryParameters = {\n    scale: number;\n    pixelPosMatrix: mat4;\n    transform: IReadonlyTransform;\n    tileSize: number;\n    queryGeometry: Point[];\n    cameraQueryGeometry: Point[];\n    queryPadding: number;\n    getElevation: undefined | ((x: number, y: number) => number);\n    params: {\n        filter?: FilterSpecification;\n        layers?: Set<string> | null;\n        availableImages?: string[];\n        globalState?: Record<string, any>;\n    };\n};\n\nexport type QueryResults = {\n    [_: string]: QueryResultsItem[];\n};\n\nexport type QueryResultsItem = {\n    featureIndex: number;\n    feature: GeoJSONFeature;\n    intersectionZ?: boolean | number;\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    encoding: string;\n    rawTileData: ArrayBuffer;\n    bucketLayerIDs: string[][];\n\n    vtLayers: {[_: string]: VectorTileLayerLike};\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: VectorTileFeatureLike, geometry: 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 (const ring of geometry) {\n\n            const bbox = [Infinity, Infinity, -Infinity, -Infinity];\n            for (const p of ring) {\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]: VectorTileLayerLike} {\n        if (!this.vtLayers) {\n            this.vtLayers = this.encoding !== 'mlt' \n                ? new VectorTile(new Protobuf(this.rawTileData)).layers\n                : new MLTVectorTile(this.rawTileData).layers;\n            this.sourceLayerCoder = new DictionaryCoder(this.vtLayers ? Object.keys(this.vtLayers).sort() : [GEOJSON_TILE_LAYER_NAME]);\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    ): QueryResults {\n        this.loadVTLayers();\n\n        const params = args.params;\n        const pixelsToTileUnits = EXTENT / args.tileSize / args.scale;\n        const filter = featureFilter(params.filter, params.globalState);\n\n        const queryGeometry = args.queryGeometry;\n        const queryPadding = args.queryPadding * pixelsToTileUnits;\n\n        const bounds = Bounds.fromPoints(queryGeometry);\n        const matching = this.grid.query(bounds.minX - queryPadding, bounds.minY - queryPadding, bounds.maxX + queryPadding, bounds.maxY + queryPadding);\n\n        const cameraBounds = Bounds.fromPoints(args.cameraQueryGeometry).expandBy(queryPadding);\n        const matching3D = this.grid3D.query(\n            cameraBounds.minX, cameraBounds.minY, cameraBounds.maxX, cameraBounds.maxY,\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: QueryResults = {};\n        let previousIndex;\n        for (const index of matching) {\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: VectorTileFeatureLike, styleLayer: StyleLayer, featureState: FeatureState) => {\n                    featureGeometry ||= loadGeometry(feature);\n\n                    return styleLayer.queryIntersectsFeature({\n                        queryGeometry,\n                        feature,\n                        featureState,\n                        geometry: featureGeometry,\n                        zoom: this.z,\n                        transform: args.transform,\n                        pixelsToTileUnits,\n                        pixelPosMatrix: args.pixelPosMatrix,\n                        unwrappedTileID: this.tileID.toUnwrapped(),\n                        getElevation: args.getElevation\n                    });\n                }\n            );\n        }\n\n        return result;\n    }\n\n    loadMatchingFeature(\n        result: QueryResults,\n        bucketIndex: number,\n        sourceLayerIndex: number,\n        featureIndex: number,\n        filter: FeatureFilter,\n        filterLayerIDs: Set<string> | undefined,\n        availableImages: string[],\n        styleLayers: {[_: string]: StyleLayer},\n        serializedLayers: {[_: string]: any},\n        sourceFeatureState?: SourceFeatureState,\n        intersectionTest?: (\n            feature: VectorTileFeatureLike,\n            styleLayer: StyleLayer,\n            featureState: any,\n            id: string | number | void\n        ) => boolean | number) {\n\n        const layerIDs = this.bucketLayerIDs[bucketIndex];\n        if (filterLayerIDs && !layerIDs.some(id => filterLayerIDs.has(id)))\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 (const layerID of layerIDs) {\n\n            if (filterLayerIDs && !filterLayerIDs.has(layerID)) {\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 || GEOJSON_TILE_LAYER_NAME, 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: number[],\n        serializedLayers: {[_: string]: StyleLayer},\n        bucketIndex: number,\n        sourceLayerIndex: number,\n        filterParams: {\n            filterSpec: FilterSpecification;\n            globalState: Record<string, any>;\n        },\n        filterLayerIDs: Set<string> | null,\n        availableImages: string[],\n        styleLayers: {[_: string]: StyleLayer}): QueryResults {\n        const result: QueryResults = {};\n        this.loadVTLayers();\n\n        const filter = featureFilter(filterParams.filterSpec, filterParams.globalState);\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: VectorTileFeatureLike, 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            // When cluster is true, the id is the cluster_id even though promoteId is set\n            if (id === undefined && feature.properties?.cluster && this.promoteId) {\n                id = Number(feature.properties.cluster_id);\n            }\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?.evaluate ? prop.evaluate(feature, featureState, availableImages) : prop;\n    });\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: Point[][], x1: number, y1: number, x2: number, y2: number): Point[][] {\n    const clippedLines: Point[][] = [];\n\n    for (const line of lines) {\n        let clippedLine: Point[] | undefined;\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\n/**\n * Clips the geometry to the given bounds.\n * @param geometry - the geometry to clip\n * @param type - the geometry type (1=POINT, 2=LINESTRING, 3=POLYGON)\n * @param x1 - the left edge of the clipping box\n * @param y1 - the top edge of the clipping box\n * @param x2 - the right edge of the clipping box\n * @param y2 - the bottom edge of the clipping box\n * @returns the clipped geometry\n */\nexport function clipGeometry(geometry: Point[][], type: 0 | 1 | 2 | 3, x1: number, y1: number, x2: number, y2: number): Point[][] {\n    let clippedGeometry = clipGeometryOnAxis(geometry, type, x1, x2, AxisType.X);\n    clippedGeometry = clipGeometryOnAxis(clippedGeometry, type, y1, y2, AxisType.Y);\n    return clippedGeometry;\n}\n\n/**\n * On which axis to clip\n */\nconst enum AxisType {\n    X = 0,\n    Y = 1\n}\n\n/**\n * Clip features between two vertical or horizontal axis-parallel lines:\n * ```\n *     |        |\n *  ___|___     |     /\n * /   |   \\____|____/\n *     |        |\n *```\n * @param geometry - the geometry to clip\n * @param type - the geometry type (1=POINT, 2=LINESTRING, 3=POLYGON)\n * @param start - the start line coordinate (x or y) to clip against\n * @param end - the end line coordinate (x or y) to clip against\n * @param axis - the axis to clip on (X or Y)\n * @returns the clipped geometry\n */\nfunction clipGeometryOnAxis(geometry: Point[][], type: 0 | 1 | 2 | 3, start: number, end: number, axis: AxisType): Point[][] {\n    switch (type) {\n        case 1: // POINT\n            return clipPoints(geometry, start, end, axis);\n        case 2: // LINESTRING\n            return clipLines(geometry, start, end, axis, false);\n        case 3: // POLYGON\n            return clipLines(geometry, start, end, axis, true);\n    }\n\n    return [];\n}\n\nfunction clipPoints(geometry: Point[][], start: number, end: number, axis: AxisType): Point[][] {\n    const newGeometry: Point[][] = [];\n    for (const ring of geometry) {\n        for (const point of ring) {\n            const a = axis === AxisType.X ? point.x : point.y;\n            if (a >= start && a <= end) {\n                newGeometry.push([point]);\n            }\n        }\n    }\n    return newGeometry;\n}\n\n/**\n * Clips a line to the given start and end coordinates.\n * @param line - the line to clip\n * @param start - the start line coordinate (x or y) to clip against\n * @param end - the end line coordinate (x or y) to clip against\n * @param axis - the axis to clip on (X or Y)\n * @param isPolygon - whether the line is part of a polygon\n * @returns the clipped line(s)\n */\nfunction clipLineInternal(line: Point[], start: number, end: number, axis: AxisType, isPolygon: boolean): Point[][] {\n    const intersectionPoint = axis === AxisType.X ? intersectionPointX : intersectionPointY;\n\n    let slice: Point[] = [];\n    const newLine: Point[][] = [];\n    for (let i = 0; i < line.length - 1; i++) {\n        const p1 = line[i];\n        const p2 = line[i + 1];\n        const pos1 = axis === AxisType.X ? p1.x : p1.y;\n        const pos2 = axis === AxisType.X ? p2.x : p2.y;\n        let exited = false;\n\n        if (pos1 < start) {\n            // ---|-->  | (line enters the clip region from the left)\n            if (pos2 > start) {\n                slice.push(intersectionPoint(p1, p2, start));\n            }\n        } else if (pos1 > end) {\n            // |  <--|--- (line enters the clip region from the right)\n            if (pos2 < end) {\n                slice.push(intersectionPoint(p1, p2, end));\n            }\n        } else {\n            slice.push(p1);\n        }\n        if (pos2 < start && pos1 >= start) {\n            // <--|---  | or <--|-----|--- (line exits the clip region on the left)\n            slice.push(intersectionPoint(p1, p2, start));\n            exited = true;\n        }\n        if (pos2 > end && pos1 <= end) {\n            // |  ---|--> or ---|-----|--> (line exits the clip region on the right)\n            slice.push(intersectionPoint(p1, p2, end));\n            exited = true;\n        }\n\n        if (!isPolygon && exited) {\n            newLine.push(slice);\n            slice = [];\n        }\n    }\n\n    // add the last point\n    const last = line.length - 1;\n    const lastPos = axis === AxisType.X ? line[last].x : line[last].y;\n    if (lastPos >= start && lastPos <= end) {\n        slice.push(line[last]);\n    }\n\n    // close the polygon if its endpoints are not the same after clipping\n    if (isPolygon && slice.length > 0 && !slice[0].equals(slice[slice.length - 1])) {\n        slice.push(new Point(slice[0].x, slice[0].y));\n    }\n    if (slice.length > 0) {\n        newLine.push(slice);\n    }\n    return newLine;\n}\n\nfunction clipLines(geometry: Point[][], start: number, end: number, axis: AxisType, isPolygon: boolean): Point[][] {\n    const newGeometry: Point[][] = [];\n    for (const line of geometry) {\n        const clippedLines = clipLineInternal(line, start, end, axis, isPolygon);\n        if (clippedLines.length > 0) {\n            newGeometry.push(...clippedLines);\n        }\n    }\n    return newGeometry;\n}\n\nfunction intersectionPointX(p1: Point, p2: Point, x: number): Point {\n    const t = (x - p1.x) / (p2.x - p1.x);\n    return new Point(x, p1.y + (p2.y - p1.y) * t);\n}\n\nfunction intersectionPointY(p1: Point, p2: Point, y: number): Point {\n    const t = (y - p1.y) / (p2.y - p1.y);\n    return new Point(p1.x + (p2.x - p1.x) * t, y);\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: 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: 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: 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: 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): Anchor[] {\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: Point[], offset: number, spacing: number, angleWindowSize: number, maxAngle: number, labelLength: number, isLineContinued: boolean, placeAtMiddle: boolean, tileExtent: number): Anchor[] {\n\n    const halfLabelLength = labelLength / 2;\n    const lineLength = getLineLength(line);\n\n    let distance = 0;\n    let markedDistance = offset - spacing;\n\n    let anchors: Anchor[] = [];\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 {type 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): 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] as [number, number, number, number];\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): 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] as [number, number, number, number];\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 {type 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';\nimport {Bounds} from '../geo/bounds';\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 * @returns Pole of Inaccessibility.\n */\nexport function findPoleOfInaccessibility(\n    polygonRings: Point[][],\n    precision: number = 1,\n): Point {\n    const bounds = Bounds.fromPoints(polygonRings[0]);\n\n    const cellSize = Math.min(bounds.width(), bounds.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    const {minX, minY, maxX, maxY} = bounds;\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    const centroidCell = getCentroidCell(polygonRings);\n    let bestCell = centroidCell;\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        }\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    }\n\n    // For convex or nearly-convex polygons, the centroid provides visually\n    // better label placement than the mathematical POI.\n    // Coordinate rounding (e.g. in geojson-vt) can break polygon symmetry and cause the POI to\n    // drift far from center even though its distance-to-edge is only marginally better.\n    // Prefer the centroid when it is inside the polygon\n    // and its distance is within `precision` of the best found.\n    if (centroidCell.d > 0 && bestCell.d - centroidCell.d <= precision) {\n        return centroidCell.p;\n    }\n    return bestCell.p;\n}\n\nfunction compareMax(a: Cell, b: Cell) {\n    return b.max - a.max;\n}\n\nclass Cell {\n    p: Point;\n    h: number;\n    d: number;\n    max: number;\n\n    constructor(x: number, y: number, h: number, polygon: Point[][]) {\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\n// signed distance from point to polygon outline (negative if point is outside)\nfunction pointToPolygonDist(p: Point, polygon: Point[][]) {\n    let inside = false;\n    let minDistSq = Infinity;\n\n    for (const ring of polygon) {\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\nexport function getCentroidCell(polygon: Point[][]) {\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, type VariableAnchorOffsetCollectionSpecification} from '@maplibre/maplibre-gl-style-spec';\nimport {type SymbolFeature} from '../../data/bucket/symbol_bucket';\nimport {type CanonicalTileID} from '../../tile/tile_id';\nimport ONE_EM from '../../symbol/one_em';\nimport {type 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 '../tile/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 type Point from '@mapbox/point-geometry';\nimport murmur3 from 'murmurhash-js';\nimport {getIconPadding, type SymbolPadding} from '../style/style_layer/symbol_style_layer';\nimport {type VariableAnchorOffsetCollection, classifyRings} from '@maplibre/maplibre-gl-style-spec';\nimport {getTextVariableAnchorOffset, evaluateVariableOffset, INVALID_TEXT_OFFSET, type TextAnchor, TextAnchorEnum} from '../style/style_layer/variable_text_anchor';\nimport {subdivideVertexLine} from '../render/subdivision';\nimport type {SubdivisionGranularitySetting} from '../render/subdivision_granularity_settings';\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    subdivisionGranularity: SubdivisionGranularitySetting;\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?.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, args.subdivisionGranularity);\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 it 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    subdivisionGranularity: SubdivisionGranularitySetting) {\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: PositionedIcon | undefined;\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 granularity = (canonical) ? subdivisionGranularity.line.getGranularityForZoomLevel(canonical.z) : 1;\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 subdividedLine = subdivideVertexLine(line, granularity);\n            const anchors = getAnchors(\n                subdividedLine,\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(subdividedLine, 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 subdividedLine = subdivideVertexLine(line, granularity);\n                const anchor = getCenterAnchor(\n                    subdividedLine,\n                    textMaxAngle,\n                    shapedTextOrientations.vertical || defaultHorizontalShaping,\n                    shapedIcon,\n                    glyphSize,\n                    textMaxBoxScale);\n                if (anchor) {\n                    addSymbolAtAnchor(subdividedLine, 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            const subdividedLine = subdivideVertexLine(polygon[0], granularity, true);\n            addSymbolAtAnchor(subdividedLine, 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            const subdividedLine = subdivideVertexLine(line, granularity);\n            addSymbolAtAnchor(subdividedLine, new Anchor(subdividedLine[0].x, subdividedLine[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: Point[],\n    shapedTextOrientations: ShapedTextOrientations,\n    shapedIcon: PositionedIcon | undefined,\n    imageMap: {[_: string]: StyleImage},\n    verticallyShapedIcon: PositionedIcon | undefined,\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?.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", "import {type 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 *\n * TileManager offloads currently unused tiles to this cache, and when a tile gets used again,\n * it is also removed from this cache. Thus addition is the only operation that counts as \"usage\"\n * for the purposes of LRU behaviour.\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: 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): this {\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\nexport class BoundedLRUCache<K, V> {\n    private maxEntries: number;\n    private map: Map<K, V>;\n\n    constructor(maxEntries: number) {\n        this.maxEntries = maxEntries;\n        this.map = new Map();\n    }\n\n    get(key: K): V | undefined {\n        const value = this.map.get(key);\n        if (value !== undefined) {\n            // Move key to end (most recently used)\n            this.map.delete(key);\n            this.map.set(key, value);\n        }\n        return value;\n    }\n\n    set(key: K, value: V): void {\n        if (this.map.has(key)) {\n            this.map.delete(key);\n        } else if (this.map.size >= this.maxEntries) {\n            // Delete oldest\n            const oldestKey = this.map.keys().next().value;\n            this.map.delete(oldestKey);\n        }\n        this.map.set(key, value);\n    }\n\n    clear(): void {\n        this.map.clear();\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 {ColorReliefStyleLayer} from './style_layer/color_relief_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, globalState: Record<string, any>) {\n    if (layer.type === 'custom') {\n        return new CustomStyleLayer(layer, globalState);\n    }\n    switch (layer.type) {\n        case 'background':\n            return new BackgroundStyleLayer(layer, globalState);\n        case 'circle':\n            return new CircleStyleLayer(layer, globalState);\n        case 'color-relief':\n            return new ColorReliefStyleLayer(layer, globalState);\n        case 'fill':\n            return new FillStyleLayer(layer, globalState);\n        case 'fill-extrusion':\n            return new FillExtrusionStyleLayer(layer, globalState);\n        case 'heatmap':\n            return new HeatmapStyleLayer(layer, globalState);\n        case 'hillshade':\n            return new HillshadeStyleLayer(layer, globalState);\n        case 'line':\n            return new LineStyleLayer(layer, globalState);\n        case 'raster':\n            return new RasterStyleLayer(layer, globalState);\n        case 'symbol':\n            return new SymbolStyleLayer(layer, globalState);\n    }\n}\n\n", "import {createStyleLayer} from './create_style_layer';\nimport {featureFilter, groupByLayout} from '@maplibre/maplibre-gl-style-spec';\nimport {GEOJSON_TILE_LAYER_NAME} from '../data/feature_index';\nimport type {StyleLayer} from './style_layer';\nimport type {LayerSpecification} from '@maplibre/maplibre-gl-style-spec';\n\nexport type LayerConfigs = {[_: string]: LayerSpecification};\n\nexport class StyleLayerIndex {\n    familiesBySource: {\n        [source: string]: {\n            [sourceLayer: string]: StyleLayer[][];\n        };\n    };\n    keyCache: {[source: string]: string};\n\n    _layerConfigs: LayerConfigs;\n    _layers: {[_: string]: StyleLayer};\n\n    constructor(layerConfigs?: LayerSpecification[] | null, globalState?: Record<string, any>) {\n        this.keyCache = {};\n        if (layerConfigs) {\n            this.replace(layerConfigs, globalState);\n        }\n    }\n\n    replace(layerConfigs: LayerSpecification[], globalState?: Record<string, any>) {\n        this._layerConfigs = {};\n        this._layers = {};\n        this.update(layerConfigs, [], globalState);\n    }\n\n    update(layerConfigs: LayerSpecification[], removedIds: string[], globalState?: Record<string, any>) {\n        for (const layerConfig of layerConfigs) {\n            this._layerConfigs[layerConfig.id] = layerConfig;\n\n            const layer = this._layers[layerConfig.id] = createStyleLayer(layerConfig, globalState);\n            layer._featureFilter = featureFilter(layer.filter, globalState);\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.isHidden()) {\n                continue;\n            }\n\n            const sourceId = layer.source || '';\n            let sourceGroup = this.familiesBySource[sourceId];\n            sourceGroup ||= this.familiesBySource[sourceId] = {};\n\n            const sourceLayerId = layer.sourceLayer || GEOJSON_TILE_LAYER_NAME;\n            let sourceLayerFamilies = sourceGroup[sourceLayerId];\n            sourceLayerFamilies ||= sourceGroup[sourceLayerId] = [];\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 position, 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/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 './worker_source';\nimport type {PromoteIdSpecification} from '@maplibre/maplibre-gl-style-spec';\nimport type {VectorTileLike} from '@maplibre/vt-pbf';\nimport {type GetDashesResponse, MessageType, type GetGlyphsResponse, type GetImagesResponse} from '../util/actor_messages';\nimport type {SubdivisionGranularitySetting} from '../render/subdivision_granularity_settings';\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: VectorTileLike;\n    collisionBoxArray: CollisionBoxArray;\n\n    abort: AbortController;\n    vectorTile: VectorTileLike;\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: VectorTileLike, layerIndex: StyleLayerIndex, availableImages: string[], actor: IActor, subdivisionGranularity: SubdivisionGranularitySetting): 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            dashDependencies: {},\n            availableImages,\n            subdivisionGranularity\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.isHidden(this.zoom, true)) continue;\n                recalculateLayers(family, this.zoom, availableImages);\n\n                const 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]: number[]} = mapObject(options.glyphDependencies, (glyphs) => Object.keys(glyphs).map(Number));\n\n        for (const request of this.inFlightDependencies) {\n            request?.abort();\n        }\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 dashes = options.dashDependencies;\n        let getDashesPromise = Promise.resolve<GetDashesResponse>({} as GetDashesResponse);\n        if (Object.keys(dashes).length) {\n            const abortController = new AbortController();\n            this.inFlightDependencies.push(abortController);\n            getDashesPromise = actor.sendAsync({type: MessageType.getDashes, data: {dashes}}, abortController);\n        }\n\n        const [glyphMap, iconMap, patternMap, dashPositions] = await Promise.all([getGlyphsPromise, getIconsPromise, getPatternsPromise, getDashesPromise]);\n\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                    subdivisionGranularity: options.subdivisionGranularity\n                });\n            } else if (bucket.hasDependencies && (bucket instanceof FillBucket || bucket instanceof FillExtrusionBucket || bucket instanceof LineBucket)) {\n                recalculateLayers(bucket.layers, this.zoom, availableImages);\n                bucket.addFeatures(options, this.tileID.canonical, imageAtlas.patternPositions, dashPositions);\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            dashPositions,\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: readonly StyleLayer[], zoom: number, availableImages: 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 type {WorkerTile} from './worker_tile';\nimport {type ExpiryData} from '../util/ajax';\n\nexport type ParsingState = {\n    rawData: ArrayBufferLike;\n    cacheControl?: ExpiryData;\n    resourceTiming?: any;\n};\n\nexport class WorkerTileState {\n    loading: Record<string, WorkerTile> = {};\n    loaded: Record<string, WorkerTile> = {};\n    parsing: Record<string, ParsingState> = {};\n\n    startLoading(uid: string | number, tile: WorkerTile): void {\n        this.loading[uid] = tile;\n    }\n\n    finishLoading(uid: string | number): void {\n        delete this.loading[uid];\n    }\n\n    abort(uid: string | number): void {\n        const tile = this.loading[uid];\n        if (!tile?.abort) return;\n        tile.abort.abort();\n        delete this.loading[uid];\n    }\n\n    setParsing(uid: string | number, state: ParsingState): void {\n        this.parsing[uid] = state;\n    }\n\n    consumeParsing(uid: string | number): ParsingState | undefined {\n        const state = this.parsing[uid];\n        if (!state) return undefined;\n        delete this.parsing[uid];\n        return state;\n    }\n\n    clearParsing(uid: string | number): void {\n        delete this.parsing[uid];\n    }\n\n    markLoaded(uid: string | number, tile: WorkerTile): void {\n        this.loaded[uid] = tile;\n    }\n\n    getLoaded(uid: string | number): WorkerTile | undefined {\n        const tile = this.loaded[uid];\n        if (!tile) return undefined;\n        return tile;\n    }\n\n    removeLoaded(uid: string | number): void {\n        delete this.loaded[uid];\n    }\n\n    clearLoaded(): void {\n        this.loaded = {};\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    private start: string;\n    private end: string;\n    private measure: string;\n\n    constructor (url: string) {\n        this.start = `${url}#start`;\n        this.end = `${url}#end`;\n        this.measure = url;\n\n        performance.mark(this.start);\n    }\n\n    finish() {\n        performance.mark(this.end);\n        let resourceTimingData = performance.getEntriesByName(this.measure);\n\n        // fallback if web worker implementation of perf.getEntriesByName returns empty\n        if (resourceTimingData.length === 0) {\n            performance.measure(this.measure, this.start, this.end);\n            resourceTimingData = performance.getEntriesByName(this.measure);\n\n            // cleanup\n            performance.clearMarks(this.start);\n            performance.clearMarks(this.end);\n            performance.clearMeasures(this.measure);\n        }\n\n        return resourceTimingData;\n    }\n}\n", "import Point from '@mapbox/point-geometry';\nimport {type VectorTileFeatureLike, type VectorTileLayerLike, type VectorTileLike, fromVectorTileJs} from '@maplibre/vt-pbf';\nimport {clipGeometry} from '../symbol/clip_line';\nimport type {LoadVectorTileResult} from './vector_tile_worker_source';\nimport type {CanonicalTileID} from '../tile/tile_id';\n\nclass VectorTileFeatureOverzoomed implements VectorTileFeatureLike {\n    pointsArray: Point[][];\n    type: VectorTileFeatureLike['type'];\n    properties: VectorTileFeatureLike['properties'];\n    id: VectorTileFeatureLike['id'];\n    extent: VectorTileFeatureLike['extent'];\n\n    constructor(\n        type: VectorTileFeatureLike['type'],\n        geometry: Point[][],\n        properties: VectorTileFeatureLike['properties'],\n        id: VectorTileFeatureLike['id'],\n        extent: VectorTileFeatureLike['extent']\n    ) {\n        this.type = type;\n        this.properties = properties ? properties : {};\n        this.extent = extent;\n        this.pointsArray = geometry;\n        this.id = id;\n    }\n\n    loadGeometry() {\n        // Clone the geometry and ensure all points are Point instances\n        return this.pointsArray.map(ring => \n            ring.map(point => new Point(point.x, point.y))\n        );\n    }\n}\n\nclass VectorTileLayerOverzoomed implements VectorTileLayerLike {\n    private _myFeatures: VectorTileFeatureOverzoomed[];\n    name: string;\n    extent: number;\n    version: number = 2;\n    length: number;\n\n    constructor(features: VectorTileFeatureOverzoomed[], layerName: string, extent: number) {\n        this._myFeatures = features;\n        this.name = layerName;\n        this.length = features.length;\n        this.extent = extent;\n    }\n\n    feature(i: number): VectorTileFeatureLike {\n        return this._myFeatures[i];\n    }\n}\n\nexport class VectorTileOverzoomed implements VectorTileLike {\n    layers: Record<string, VectorTileLayerLike> = {};\n\n    addLayer(layer: VectorTileLayerOverzoomed) {\n        this.layers[layer.name] = layer;\n    }\n}\n\n/**\n * Encodes the virtual tile into binary vector tile form.\n * This is a convenience that allows `FeatureIndex` to operate the same way across `VectorTileSource` and `GeoJSONSource` data.\n * @param virtualVectorTile - a syntetically created vector tile, this tile should have the relevant layer and features already added to it.\n * @returns - the encoded vector tile along with the original virtual tile binary data.\n */\nexport function toVirtualVectorTile(virtualVectorTile: VectorTileLike): LoadVectorTileResult {\n    let pbf: Uint8Array = fromVectorTileJs(virtualVectorTile);\n    if (pbf.byteOffset !== 0 || pbf.byteLength !== pbf.buffer.byteLength) {\n        pbf = new Uint8Array(pbf);  // Compatibility with node Buffer (https://github.com/mapbox/pbf/issues/35)\n    }\n    return {\n        vectorTile: virtualVectorTile,\n        rawData: pbf.buffer\n    };\n}\n\n/**\n * This function slices a source tile layer into an overzoomed tile layer for a target tile ID.\n * @param sourceLayer - the source tile layer to slice\n * @param maxZoomTileID - the maximum zoom tile ID\n * @param targetTileID - the target tile ID\n * @returns - the overzoomed tile layer\n */\nexport function sliceVectorTileLayer(sourceLayer: VectorTileLayerLike, maxZoomTileID: CanonicalTileID, targetTileID: CanonicalTileID): VectorTileLayerOverzoomed {\n    const {extent} = sourceLayer;\n    const dz = targetTileID.z - maxZoomTileID.z;\n    const scale = Math.pow(2, dz);\n    \n    // Calculate the target tile's position within the source tile in target coordinate space\n    // This ensures all tiles share the same coordinate system\n    const offsetX = (targetTileID.x - maxZoomTileID.x * scale) * extent;\n    const offsetY = (targetTileID.y - maxZoomTileID.y * scale) * extent;\n\n    const featureWrappers: VectorTileFeatureOverzoomed[] = [];\n    for (let index = 0; index < sourceLayer.length; index++) {\n        const feature: VectorTileFeatureLike = sourceLayer.feature(index);\n        let geometry = feature.loadGeometry();\n        \n        // Transform all coordinates to target tile space\n        for (const ring of geometry) {\n            for (const point of ring) {\n                point.x = point.x * scale - offsetX;\n                point.y = point.y * scale - offsetY;\n            }\n        }\n        \n        const buffer = 128;\n        geometry = clipGeometry(geometry, feature.type, -buffer, -buffer, extent + buffer, extent + buffer);\n        if (geometry.length === 0) {\n            continue;\n        }\n        \n        featureWrappers.push(new VectorTileFeatureOverzoomed(\n            feature.type,\n            geometry,\n            feature.properties,\n            feature.id,\n            extent\n        ));\n    }\n    return new VectorTileLayerOverzoomed(featureWrappers, sourceLayer.name, extent);\n}", "import Protobuf from 'pbf';\nimport {VectorTile} from '@mapbox/vector-tile';\nimport {type ExpiryData, getArrayBuffer} from '../util/ajax';\nimport {WorkerTile} from './worker_tile';\nimport {WorkerTileState, type ParsingState} from './worker_tile_state';\nimport {BoundedLRUCache} from '../tile/tile_cache';\nimport {ensureError, extend} from '../util/util';\nimport {RequestPerformance} from '../util/request_performance';\nimport {VectorTileOverzoomed, sliceVectorTileLayer, toVirtualVectorTile} from './vector_tile_overzoomed';\nimport {MLTVectorTile} from './vector_tile_mlt';\nimport type {\n    WorkerSource,\n    WorkerTileParameters,\n    TileParameters,\n    WorkerTileResult\n} from '../source/worker_source';\nimport type {IActor} from '../util/actor';\nimport type {StyleLayer} from '../style/style_layer';\nimport type {StyleLayerIndex} from '../style/style_layer_index';\nimport type {VectorTileLayerLike, VectorTileLike} from '@maplibre/vt-pbf';\n\nexport type LoadVectorTileResult = {\n    vectorTile: VectorTileLike;\n    rawData: ArrayBufferLike;\n};\n\n/**\n * The {@link WorkerSource} implementation that supports {@link VectorTileSource}. This class is\n * used by vector tile sources to perform tile processing operations in a separate worker thread.\n */\nexport class VectorTileWorkerSource implements WorkerSource {\n    actor: IActor;\n    layerIndex: StyleLayerIndex;\n    availableImages: string[];\n    tileState: WorkerTileState;\n    overzoomedTileResultCache: BoundedLRUCache<string, LoadVectorTileResult>;\n\n    constructor(actor: IActor, layerIndex: StyleLayerIndex, availableImages: string[]) {\n        this.actor = actor;\n        this.layerIndex = layerIndex;\n        this.availableImages = availableImages;\n        this.tileState = new WorkerTileState();\n        this.overzoomedTileResultCache = new BoundedLRUCache<string, LoadVectorTileResult>(1000);\n    }\n\n    /**\n     * Loads a vector tile\n     */\n    loadVectorTile(params: WorkerTileParameters, rawData: ArrayBuffer): LoadVectorTileResult {\n        try {\n            const vectorTile = params.encoding !== 'mlt'\n                ? new VectorTile(new Protobuf(rawData))\n                : new MLTVectorTile(rawData);\n\n            return {vectorTile, rawData};\n        } catch (ex) {\n            const bytes = new Uint8Array(rawData);\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: ${ensureError(ex).message}`;\n            }\n            throw new Error(errorMessage);\n        }\n    }\n\n    /**\n     * Implements {@link WorkerSource.loadTile}.\n     */\n    async loadTile(params: WorkerTileParameters): Promise<WorkerTileResult | null> {\n        const {uid, overzoomParameters} = params;\n\n        if (overzoomParameters) {\n            params.request = overzoomParameters.overzoomRequest;\n        }\n\n        const timing = this._startRequestTiming(params);\n        const workerTile = new WorkerTile(params);\n\n        this.tileState.startLoading(uid, workerTile);\n        const abortController = new AbortController();\n        workerTile.abort = abortController;\n        try {\n            // Download the tile data from the network.\n            const tileResponse = await getArrayBuffer(params.request, abortController);\n\n            // Tile data hasn't changed (etag support) - return an unmodified result\n            if (params.etag && params.etag === tileResponse.etag) {\n                this.tileState.finishLoading(uid);\n                return this._getEtagUnmodifiedResult(tileResponse, timing);\n            }\n\n            const tileResult = this.loadVectorTile(params, tileResponse.data);\n            this.tileState.finishLoading(uid);\n            if (!tileResult) return null;\n\n            let {vectorTile, rawData} = tileResult;\n            if (overzoomParameters) {\n                ({vectorTile, rawData} = this._getOverzoomTile(params, vectorTile));\n            }\n\n            const cacheControl = this._getExpiryData(tileResponse);\n            const resourceTiming = this._finishRequestTiming(timing);\n\n            workerTile.vectorTile = vectorTile;\n            this.tileState.markLoaded(uid, workerTile);\n\n            const parseState = {rawData, cacheControl, resourceTiming};  // Keep data so reloadTile can access if parse is canceled.\n            this.tileState.setParsing(uid, parseState);\n            try {\n                return await this._parseWorkerTile(workerTile, params, parseState);\n            } finally {\n                this.tileState.clearParsing(uid);\n            }\n        } catch (err) {\n            this.tileState.finishLoading(uid);\n            workerTile.status = 'done';\n            this.tileState.markLoaded(uid, workerTile);\n            throw err;\n        }\n    }\n\n    _getEtagUnmodifiedResult(response: ExpiryData, timing: RequestPerformance): WorkerTileResult {\n        const cacheControl = this._getExpiryData(response);\n        const resourceTiming = this._finishRequestTiming(timing);\n        return extend({etagUnmodified: true as const}, cacheControl, resourceTiming);\n    }\n\n    async _parseWorkerTile(workerTile: WorkerTile, params: WorkerTileParameters, parseState?: ParsingState): Promise<WorkerTileResult> {\n        let result = await workerTile.parse(workerTile.vectorTile, this.layerIndex, this.availableImages, this.actor, params.subdivisionGranularity);\n\n        if (parseState) {\n            const {rawData, cacheControl, resourceTiming} = parseState;\n            // Transferring a copy of rawTileData because the worker needs to retain its copy.\n            result = extend({rawTileData: rawData.slice(0), encoding: params.encoding}, result, cacheControl, resourceTiming);\n        }\n\n        return result;\n    }\n\n    _getExpiryData({expires, cacheControl, etag}: ExpiryData): ExpiryData {\n        const data: ExpiryData = {};\n        if (expires) data.expires = expires;\n        if (cacheControl) data.cacheControl = cacheControl;\n        if (etag) data.etag = etag;\n        return data;\n    }\n\n    _startRequestTiming(params: WorkerTileParameters): RequestPerformance | undefined {\n        if (!params.request?.collectResourceTiming) return;\n        return new RequestPerformance(params.request.url);\n    }\n\n    _finishRequestTiming(timing: RequestPerformance): {resourceTiming?: any} {\n        const timingData = timing?.finish();\n        if (!timingData) return {};\n\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        return {resourceTiming: JSON.parse(JSON.stringify(timingData))};\n    }\n\n    /**\n     * If we are seeking a tile deeper than the source's max available canonical tile, get the overzoomed tile\n     * @param params - the worker tile parameters\n     * @param maxZoomVectorTile - the original vector tile at the source's max available canonical zoom\n     * @returns the overzoomed tile and its raw data\n     */\n    private _getOverzoomTile(params: WorkerTileParameters, maxZoomVectorTile: VectorTileLike): LoadVectorTileResult {\n        const {tileID, source, overzoomParameters} = params;\n        const {maxZoomTileID} = overzoomParameters;\n\n        const cacheKey = `${maxZoomTileID.key}_${tileID.key}_${params.request?.url}`;\n        const cachedOverzoomTile = this.overzoomedTileResultCache.get(cacheKey);\n\n        if (cachedOverzoomTile) {\n            return cachedOverzoomTile;\n        }\n\n        const overzoomedVectorTile = new VectorTileOverzoomed();\n        const layerFamilies: Record<string, StyleLayer[][]> = this.layerIndex.familiesBySource[source];\n\n        for (const sourceLayerId in layerFamilies) {\n            const sourceLayer: VectorTileLayerLike = maxZoomVectorTile.layers[sourceLayerId];\n            if (!sourceLayer) {\n                continue;\n            }\n\n            const slicedTileLayer = sliceVectorTileLayer(sourceLayer, maxZoomTileID, tileID.canonical);\n            if (slicedTileLayer.length > 0) {\n                overzoomedVectorTile.addLayer(slicedTileLayer);\n            }\n        }\n        const overzoomedVectorTileResult = toVirtualVectorTile(overzoomedVectorTile);\n        this.overzoomedTileResultCache.set(cacheKey, overzoomedVectorTileResult);\n\n        return overzoomedVectorTileResult;\n    }\n\n    /**\n     * Implements {@link WorkerSource.reloadTile}.\n     */\n    async reloadTile(params: WorkerTileParameters): Promise<WorkerTileResult> {\n        const uid = params.uid;\n\n        const workerTile = this.tileState.getLoaded(uid);\n        if (!workerTile) throw new Error('Should not be trying to reload a tile that was never loaded or has been removed');\n\n        workerTile.showCollisionBoxes = params.showCollisionBoxes;\n\n        if (workerTile.status === 'parsing') {\n            // if we are cancelling the original parse, make sure to pass the rawTileData from the original parse\n            const parseState = this.tileState.consumeParsing(uid);\n            return await this._parseWorkerTile(workerTile, params, parseState);\n        }\n\n        // If there was no vector tile data on the initial load, don't try and reparse the tile.\n        // this seems like a missing case where cache control is lost? see #3309\n        if (workerTile.status === 'done' && workerTile.vectorTile) {\n            return await this._parseWorkerTile(workerTile, params);\n        }\n    }\n\n    /**\n     * Implements {@link WorkerSource.abortTile}.\n     */\n    async abortTile(params: TileParameters): Promise<void> {\n        this.tileState.abort(params.uid);\n    }\n\n    /**\n     * Implements {@link WorkerSource.removeTile}.\n     */\n    async removeTile(params: TileParameters): Promise<void> {\n        this.tileState.removeLoaded(params.uid);\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 ||= {};\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?.[uid]) {\n            delete loaded[uid];\n        }\n    }\n}\n", "import {getJSON} from '../util/ajax';\nimport {RequestPerformance} from '../util/request_performance';\nimport {GeoJSONWrapper} from '@maplibre/vt-pbf';\nimport {EXTENT} from '../data/extent';\nimport {GeoJSONVT, type GeoJSONVTOptions} from '@maplibre/geojson-vt';\nimport {createExpression, type FilterSpecification} from '@maplibre/maplibre-gl-style-spec';\nimport {isAbortError} from '../util/abort_error';\nimport {toVirtualVectorTile} from './vector_tile_overzoomed';\nimport {WorkerTile} from './worker_tile';\nimport {WorkerTileState, type ParsingState} from './worker_tile_state';\nimport {extend} from '../util/util';\n\nimport type {GeoJSONSourceDiff} from './geojson_source_diff';\nimport type {WorkerSource, WorkerTileParameters, TileParameters, WorkerTileResult} from './worker_source';\nimport type {LoadVectorTileResult} from './vector_tile_worker_source';\nimport type {RequestParameters} from '../util/ajax';\nimport type {ClusterIDAndSource, GeoJSONWorkerSourceLoadDataResult, RemoveSourceParams} from '../util/actor_messages';\nimport type {IActor} from '../util/actor';\nimport type {StyleLayerIndex} from '../style/style_layer_index';\n\n/**\n * The geojson worker options that can be passed to the worker\n */\nexport type GeoJSONWorkerOptions = {\n    source?: string;\n    geojsonVtOptions?: GeoJSONVTOptions;\n    clusterProperties?: Record<string, [unknown, unknown]>;\n    filter?: FilterSpecification;\n    collectResourceTiming?: boolean;\n};\n\n/**\n * Parameters needed to load GeoJSON to the worker - must specify either a `request`, `data` or `dataDiff`.\n */\nexport type LoadGeoJSONParameters = GeoJSONWorkerOptions & {\n    type: 'geojson';\n    /**\n     * Request parameters including a URL to fetch GeoJSON data.\n     */\n    request?: RequestParameters;\n    /**\n     * GeoJSON data to set as the source's data.\n     */\n    data?: GeoJSON.GeoJSON;\n    /**\n     * GeoJSONSourceDiff to apply to the existing GeoJSON source data.\n     */\n    dataDiff?: GeoJSONSourceDiff;\n    /**\n     * Update the supercluster using the latest worker cluster options.\n     */\n    updateCluster?: boolean;\n};\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 implements WorkerSource {\n    actor: IActor;\n    layerIndex: StyleLayerIndex;\n    availableImages: string[];\n    tileState: WorkerTileState;\n\n    _pendingRequest: AbortController;\n    _geoJSONIndex: GeoJSONVT;\n    _createGeoJSONIndex: typeof createGeoJSONIndex;\n\n    constructor(actor: IActor, layerIndex: StyleLayerIndex, availableImages: string[], createGeoJSONIndexFunc: typeof createGeoJSONIndex = createGeoJSONIndex) {\n        this.actor = actor;\n        this.layerIndex = layerIndex;\n        this.availableImages = availableImages;\n        this.tileState = new WorkerTileState();\n        this._createGeoJSONIndex = createGeoJSONIndexFunc;\n    }\n\n    /**\n     * Retrieves and sends loaded vector tiles to the main thread.\n     */\n    loadVectorTile(params: WorkerTileParameters): LoadVectorTileResult | null {\n        if (!this._geoJSONIndex) throw new Error('Unable to parse the data into a cluster or geojson');\n\n        const {z, x, y} = params.tileID.canonical;\n        const geoJSONTile = this._geoJSONIndex.getTile(z, x, y);\n        if (!geoJSONTile) return null;\n\n        const geojsonWrapper = new GeoJSONWrapper(geoJSONTile.features, {version: 2, extent: EXTENT});\n        return toVirtualVectorTile(geojsonWrapper);\n    }\n\n    /**\n     * Implements {@link WorkerSource.loadTile}.\n     */\n    async loadTile(params: WorkerTileParameters): Promise<WorkerTileResult | null> {\n        const {uid} = params;\n\n        const workerTile = new WorkerTile(params);\n        workerTile.abort = new AbortController();\n        try {\n            const loadResult = this.loadVectorTile(params);\n            if (!loadResult) return null;\n\n            const {vectorTile, rawData} = loadResult;\n\n            workerTile.vectorTile = vectorTile;\n            this.tileState.markLoaded(uid, workerTile);\n\n            const parseState = {rawData};\n            this.tileState.setParsing(uid, parseState);  // Keep data so reloadTile can access if parse is canceled.\n            try {\n                return await this._parseWorkerTile(workerTile, params, parseState);\n            } finally {\n                this.tileState.clearParsing(uid);\n            }\n        } catch (err) {\n            workerTile.status = 'done';\n            this.tileState.markLoaded(uid, workerTile);\n            throw err;\n        }\n    }\n\n    private async _reloadLoadedTile(params: WorkerTileParameters): Promise<WorkerTileResult> {\n        const uid = params.uid;\n\n        const workerTile = this.tileState.getLoaded(uid);\n        if (!workerTile) throw new Error('Should not be trying to reload a tile that was never loaded or has been removed');\n\n        workerTile.showCollisionBoxes = params.showCollisionBoxes;\n\n        if (workerTile.status === 'parsing') {\n            // If we are cancelling the original parse, make sure to pass the rawData from the original parse.\n            const parseState = this.tileState.consumeParsing(uid);\n            return await this._parseWorkerTile(workerTile, params, parseState);\n        }\n\n        // If there was no vector tile data on the initial load, don't try and reparse the tile.\n        if (workerTile.status === 'done' && workerTile.vectorTile) {\n            return await this._parseWorkerTile(workerTile, params);\n        }\n    }\n\n    async _parseWorkerTile(workerTile: WorkerTile, params: WorkerTileParameters, parseState?: ParsingState): Promise<WorkerTileResult> {\n        let result = await workerTile.parse(workerTile.vectorTile, this.layerIndex, this.availableImages, this.actor, params.subdivisionGranularity);\n\n        if (parseState) {\n            const {rawData} = parseState;\n            // Transferring a copy of rawTileData because the worker needs to retain its copy.\n            result = extend({rawTileData: rawData.slice(0), encoding: 'mvt'}, result);\n        }\n\n        return result;\n    }\n\n    /**\n     * Implements {@link WorkerSource.abortTile}.\n     */\n    async abortTile(params: TileParameters): Promise<void> {\n        this.tileState.abort(params.uid);\n    }\n\n    /**\n     * Implements {@link WorkerSource.removeTile}.\n     */\n    async removeTile(params: TileParameters): Promise<void> {\n        this.tileState.removeLoaded(params.uid);\n    }\n\n    /**\n     * Fetches (if appropriate), parses and indexes geojson data into tiles. This\n     * preparatory method must be called before {@link GeoJSONWorkerSource.loadTile}\n     * can correctly serve up tiles. The first call to this method must contain a valid\n     * {@link params.data}, {@link params.request} or {@link params.dataDiff}. Subsequent\n     * calls may omit these parameters to reprocess the existing data (such as to update\n     * clustering options).\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\n        const timing = this._startRequestTiming(params);\n        this._pendingRequest = new AbortController();\n        try {\n            await this.loadAndProcessGeoJSON(params, this._pendingRequest);\n            delete this._pendingRequest;\n            this.tileState.clearLoaded();\n\n            // Sending a large GeoJSON payload from the worker to the main thread is slow so only do if necessary.\n            // Send data only if it was loaded from a URL, otherwise the main thread already has a copy of this data.\n            const result: GeoJSONWorkerSourceLoadDataResult = {};\n            if (params.request) result.data = params.data;\n\n            this._finishRequestTiming(timing, params, result);\n            return result;\n        } catch (err) {\n            delete this._pendingRequest;\n            if (!isAbortError(err)) throw err;\n            return {abandoned: true};\n        }\n    }\n\n    _startRequestTiming(params: LoadGeoJSONParameters): RequestPerformance | undefined {\n        if (!params.request?.collectResourceTiming) return;\n        return new RequestPerformance(params.request.url);\n    }\n\n    _finishRequestTiming(timing: RequestPerformance, params: LoadGeoJSONParameters, result: GeoJSONWorkerSourceLoadDataResult): void {\n        const timingData = timing?.finish();\n        if (!timingData) return;\n\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        result.resourceTiming = {[params.source]: JSON.parse(JSON.stringify(timingData))};\n    }\n\n    /**\n     * Implements {@link WorkerSource.reloadTile}.\n     *\n     * If the tile is loaded, reload by re-parsing the already available tile data.\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 tile = this.tileState.getLoaded(params.uid);\n\n        if (tile) {\n            return this._reloadLoadedTile(params);\n        }\n\n        return this.loadTile(params);\n    }\n\n    /**\n     * Fetch, parse and process GeoJSON according to the given parameters.\n     * Defers to {@link GeoJSONWorkerSource._loadGeoJSONFromString} 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        if (params.request) {\n            params.data = (await getJSON<GeoJSON.GeoJSON>(params.request, abortController)).data;\n        }\n\n        if (params.data) {\n            params.data = this._filterGeoJSON(params.data, params.filter);\n            this._geoJSONIndex = this._createGeoJSONIndex(params.data, params);\n            return;\n        }\n\n        if (params.dataDiff) {\n            this._geoJSONIndex ??= this._createGeoJSONIndex({type: 'FeatureCollection', features: []}, params);\n            this._geoJSONIndex.updateData(params.dataDiff, this._getFilterPredicate(params.filter));\n            return;\n        }\n\n        if (params.updateCluster) {\n            this._geoJSONIndex.updateClusterOptions(params.geojsonVtOptions.cluster, getSuperclusterOptions(params));\n        }\n\n        if (this._geoJSONIndex == null) {\n            throw new Error(`Input data given to '${params.source}' is not a valid GeoJSON object.`);\n        }\n    }\n\n    /**\n     * Applies a filter to a GeoJSON object.\n     */\n    _filterGeoJSON(data: GeoJSON.GeoJSON, filter: FilterSpecification): GeoJSON.GeoJSON {\n        if (data.type !== 'FeatureCollection') return data;\n\n        const predicate = this._getFilterPredicate(filter);\n        if (!predicate) return data;\n\n        return {type: 'FeatureCollection', features: data.features.filter(feature => predicate(feature))};\n    }\n\n    /**\n     * Gets a predicate function that can be used to filter GeoJSON features.\n     */\n    _getFilterPredicate(filter: FilterSpecification): (feature: GeoJSON.Feature) => boolean {\n        if (typeof filter !== 'boolean' && !filter?.length) return undefined;\n\n        const compiled = createExpression(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\n        return (feature: GeoJSON.Feature) => compiled.value.evaluate({zoom: 0}, feature as any);\n    }\n\n    async removeSource(_params: RemoveSourceParams): Promise<void> {\n        this._pendingRequest?.abort();\n    }\n\n    getClusterExpansionZoom(params: ClusterIDAndSource): number {\n        return this._geoJSONIndex.getClusterExpansionZoom(params.clusterId);\n    }\n\n    getClusterChildren(params: ClusterIDAndSource): GeoJSON.Feature[] {\n        return this._geoJSONIndex.getClusterChildren(params.clusterId);\n    }\n\n    getClusterLeaves(params: {\n        clusterId: number;\n        limit: number;\n        offset: number;\n    }): GeoJSON.Feature[] {\n        return this._geoJSONIndex.getClusterLeaves(params.clusterId, params.limit, params.offset);\n    }\n}\n\nexport function createGeoJSONIndex(data: GeoJSON.GeoJSON, params: LoadGeoJSONParameters): GeoJSONVT {\n    const options = extend(params.geojsonVtOptions || {}, {\n        updateable: true,\n        clusterOptions: getSuperclusterOptions(params),\n    });\n\n    return new GeoJSONVT(data, options);\n}\n\nfunction getSuperclusterOptions({geojsonVtOptions, clusterProperties}: LoadGeoJSONParameters) {\n    if (!clusterProperties || !geojsonVtOptions.clusterOptions) return geojsonVtOptions.clusterOptions;\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    geojsonVtOptions.clusterOptions.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    geojsonVtOptions.clusterOptions.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    return geojsonVtOptions.clusterOptions;\n}\n", "import {Actor, type ActorTarget, type 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, type RTLTextPlugin} from './rtl_text_plugin_worker';\nimport {GeoJSONWorkerSource, type LoadGeoJSONParameters} from './geojson_worker_source';\nimport {isWorker} from '../util/util';\nimport {addProtocol, removeProtocol} from './protocol_crud';\nimport {makeRequest} from '../util/ajax';\n\nimport {type PluginState} from './rtl_text_plugin_status';\nimport type {\n    WorkerSource,\n    WorkerSourceConstructor,\n    WorkerTileParameters,\n    WorkerDEMTileParameters,\n    TileParameters\n} from '../source/worker_source';\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 UpdateLayersParameters\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]: 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    globalStates: Map<string, Record<string, any>>;\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.globalStates = new Map<string, Record<string, any>>();\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            rtlWorkerPlugin.setMethods(rtlTextPlugin);\n        };\n\n        this.self.makeRequest = makeRequest;\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.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]?.[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            this.globalStates.delete(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: UpdateLayersParameters) => {\n            this._getLayerIndex(mapId).update(params.layers, params.removedIds, this._getGlobalState(mapId));\n        });\n\n        this.actor.registerMessageHandler(MessageType.updateGlobalState, async (mapId: string, params: Record<string, any>) => {\n            const globalState = this._getGlobalState(mapId);\n            for (const key in params) {\n                globalState[key] = params[key];\n            }\n        });\n\n        this.actor.registerMessageHandler(MessageType.setLayers, async (mapId: string, params: LayerSpecification[]) => {\n            this._getLayerIndex(mapId).replace(params, this._getGlobalState(mapId));\n        });\n    }\n\n    private _getGlobalState(mapId: string): Record<string, any> {\n        let state = this.globalStates.get(mapId);\n        if (!state) {\n            state = {};\n            this.globalStates.set(mapId, state);\n        }\n        return state;\n    }\n\n    private async _setImages(mapId: string, images: 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        return await rtlWorkerPlugin.syncState(incomingState, this.self.importScripts);\n    }\n\n    private _getAvailableImages(mapId: string) {\n        let availableImages = this.availableImages[mapId];\n\n        availableImages ||= [];\n\n        return availableImages;\n    }\n\n    private _getLayerIndex(mapId: string) {\n        let layerIndexes = this.layerIndexes[mapId];\n        layerIndexes ||= this.layerIndexes[mapId] = new StyleLayerIndex();\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        this.workerSources[mapId] ||= {};\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        this.demWorkerSources[mapId] ||= {};\n        this.demWorkerSources[mapId][sourceType] ||= new RasterDEMTileWorkerSource();\n\n        return this.demWorkerSources[mapId][sourceType];\n    }\n}\n\nif (isWorker(self)) {\n    self.worker = new Worker(self);\n}\n", "import * as glMatrix from \"./common.js\";\n\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 */\nexport function create() {\n  var out = new glMatrix.ARRAY_TYPE(4);\n  if (glMatrix.ARRAY_TYPE != Float32Array) {\n    out[1] = 0;\n    out[2] = 0;\n  }\n  out[0] = 1;\n  out[3] = 1;\n  return out;\n}\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 */\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/**\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 */\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/**\n * Set a mat2 to the identity matrix\n *\n * @param {mat2} out the receiving matrix\n * @returns {mat2} out\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/**\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 */\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/**\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 */\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/**\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 */\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  return out;\n}\n\n/**\n * Inverts a mat2\n *\n * @param {mat2} out the receiving matrix\n * @param {ReadonlyMat2} a the source matrix\n * @returns {mat2 | null} out, or null if source matrix is not invertible\n */\nexport function invert(out, a) {\n  var a0 = a[0],\n    a1 = a[1],\n    a2 = a[2],\n    a3 = a[3];\n\n  // Calculate the determinant\n  var det = a0 * a3 - a2 * a1;\n  if (!det) {\n    return null;\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/**\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 */\nexport function adjoint(out, a) {\n  // Caching this value is necessary 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/**\n * Calculates the determinant of a mat2\n *\n * @param {ReadonlyMat2} a the source matrix\n * @returns {Number} determinant of a\n */\nexport function determinant(a) {\n  return a[0] * a[3] - a[2] * a[1];\n}\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 */\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/**\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 */\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/**\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 **/\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/**\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 */\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/**\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 */\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/**\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 */\nexport function str(a) {\n  return \"mat2(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \")\";\n}\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 */\nexport function frob(a) {\n  return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3]);\n}\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/**\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 */\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/**\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 */\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/**\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 */\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/**\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 */\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/**\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 */\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/**\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 */\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/**\n * Alias for {@link mat2.multiply}\n * @function\n */\nexport var mul = multiply;\n\n/**\n * Alias for {@link mat2.subtract}\n * @function\n */\nexport var sub = subtract;", "import {AbortError} from './abort_error';\nimport {subscribe} from './util';\n\nlet linkEl;\n\nlet reducedMotionQuery: MediaQueryList;\nlet reducedMotionOverride: boolean | undefined;\n\n/** */\nexport const browser = {\n    /**\n     * Schedules a callback to be invoked on the next animation frame.\n     * @param abortController - Controller to abort the scheduled frame.\n     * @param fn - Callback to invoke with the paint start timestamp.\n     * @param reject - Callback to invoke if the frame is aborted.\n     * @param targetWindow - Optional window to use for requestAnimationFrame.\n     *   When the map is rendered in a popup window or iframe, pass the owning\n     *   window to ensure animation frames continue even when the main window\n     *   is not focused.\n     */\n    frame(abortController: AbortController, fn: (paintStartTimestamp: number) => void, reject: (error: Error) => void, targetWindow?: Window): void {\n        const win = targetWindow || window;\n        const frameId = win.requestAnimationFrame((paintStartTimestamp)=>{\n            unsubscribe();\n            fn(paintStartTimestamp);\n        });\n\n        const {unsubscribe} = subscribe(abortController.signal, 'abort', () => {\n            unsubscribe();\n            win.cancelAnimationFrame(frameId);\n            reject(new AbortError(abortController.signal.reason));\n        }, false);\n    },\n\n    /**\n     * Returns a promise that resolves on the next animation frame.\n     * @param abortController - Controller to abort the scheduled frame.\n     * @param targetWindow - Optional window to use for requestAnimationFrame.\n     * @see {@link browser.frame}\n     */\n    frameAsync(abortController: AbortController, targetWindow?: Window): Promise<number> {\n        return new Promise((resolve, reject) => {\n            this.frame(abortController, resolve, reject, targetWindow);\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 + 2 * padding, img.height + 2 * padding);\n    },\n\n    getImageCanvasContext(img: HTMLImageElement | ImageBitmap): CanvasRenderingContext2D {\n        const canvas = window.document.createElement('canvas');\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;\n        canvas.height = img.height;\n        context.drawImage(img, 0, 0, img.width, img.height);\n        return context;\n    },\n\n    resolveURL(path: string) {\n        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        if (reducedMotionOverride !== undefined) return reducedMotionOverride;\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        reducedMotionQuery ??= matchMedia('(prefers-reduced-motion: reduce)');\n        return reducedMotionQuery.matches;\n    },\n\n    set prefersReducedMotion(value: boolean) {\n        reducedMotionOverride = value;\n    }\n};\n", "/**\n * Manages time flow with optional freezing capability for deterministic rendering.\n */\nclass TimeManager {\n    private _frozenAt: number | null = null;\n\n    /**\n     * Gets the current time, either real or frozen.\n     * @returns Current time in milliseconds\n     */\n    getCurrentTime(): number {\n        return this._frozenAt !== null ? this._frozenAt : performance.now();\n    }\n\n    /**\n     * Sets time at a specific timestamp.\n     * @param timestamp - Time in milliseconds to set\n     */\n    setNow(timestamp: number): void {\n        this._frozenAt = timestamp;\n    }\n\n    /**\n     * Restores normal time flow.\n     */\n    restoreNow(): void {\n        this._frozenAt = null;\n    }\n\n    /**\n     * Returns whether time is currently frozen.\n     * @returns True if time is frozen, false otherwise\n     */\n    isFrozen(): boolean {\n        return this._frozenAt !== null;\n    }\n}\n\nconst timeManager = new TimeManager();\n\n/**\n * Returns the current time in milliseconds.\n * When time is frozen via setNow(), returns the frozen timestamp.\n * Otherwise returns real browser time via performance.now().\n *\n * @returns Current time in milliseconds\n * @example\n * ```ts\n * // Measure elapsed time\n * const start = maplibregl.now();\n * // ... later ...\n * const elapsed = maplibregl.now() - start;\n *\n * // During frozen time\n * maplibregl.setNow(16.67);\n * console.log(maplibregl.now()); // 16.67\n * maplibregl.restoreNow();\n * console.log(maplibregl.now()); // real time\n * ```\n */\nexport function now(): number {\n    return timeManager.getCurrentTime();\n}\n\n/**\n * Freezes time at a specific timestamp for deterministic rendering.\n * Useful for frame-by-frame video capture where each frame needs\n * a consistent time value.\n *\n * @param timestamp - Time in milliseconds to freeze at\n * @example\n * ```ts\n * // Freeze time for video export at 60fps\n * setNow(0);           // First frame\n * // ... render frame ...\n * setNow(16.67);       // Second frame\n * // ... render frame ...\n * setNow(33.34);       // Third frame\n * // ... done ...\n * restoreNow();        // Resume normal time\n * ```\n */\nexport function setNow(timestamp: number): void {\n    timeManager.setNow(timestamp);\n}\n\n/**\n * Restores normal time flow after freezing with setNow().\n * Call this after finishing deterministic rendering operations.\n *\n * @example\n * ```ts\n * // After video export, resume normal time\n * setNow(0);\n * // ... export frames ...\n * restoreNow(); // Map animations resume normally\n * ```\n */\nexport function restoreNow(): void {\n    timeManager.restoreNow();\n}\n\n/**\n * Returns whether time is currently frozen.\n * @returns True if time is frozen via setNow(), false otherwise\n * @example\n * ```ts\n * setNow(1000);\n * console.log(isTimeFrozen()); // true\n * restoreNow();\n * console.log(isTimeFrozen()); // false\n * ```\n */\nexport function isTimeFrozen(): boolean {\n    return timeManager.isFrozen();\n}", "import {type RequestParameters, makeRequest, sameOrigin, type GetResourceResponse} from './ajax';\nimport {arrayBufferToImageBitmap, arrayBufferToImage, ensureError, extend, isWorker, isImageBitmap} from './util';\nimport {config} from './config';\nimport {AbortError} 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            requestParameters.headers ||= {};\n            requestParameters.headers.accept = 'image/webp,*/*';\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(ensureError(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(new AbortError(abortController.signal.reason));\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 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?.documentElement.style;\n\n    private static userSelect: string;\n\n    private static selectProp = !DOM.docStyle || 'userSelect' in DOM.docStyle ? 'userSelect' : 'webkitUserSelect';\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        return window.document.createElementNS(namespaceURI, tagName);\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    // 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 (const touch of touches) {\n            points.push(DOM.getPoint(el, scale, touch));\n        }\n        return points;\n    }\n\n    /**\n     * Sanitize an HTML string - this might not be enough to prevent all XSS attacks\n     * Base on https://javascriptsource.com/sanitize-an-html-string-to-reduce-the-risk-of-xss-attacks/\n     * (c) 2021 Chris Ferdinandi, MIT License, https://gomakethings.com\n     */\n    public static sanitize(str: string): string {\n        const parser = new DOMParser();\n        const doc = parser.parseFromString(str, 'text/html');\n        const html = doc.body || document.createElement('body');\n        const scripts = html.querySelectorAll('script');\n        for (const script of scripts) {\n            script.remove();\n        }\n\n        DOM.clean(html);\n\n        return html.innerHTML;\n    }\n\n    /**\n     * Check if the attribute is potentially dangerous\n     */\n    private static isPossiblyDangerous(name: string, value: string): boolean {\n        const val = value.replace(/\\s+/g, '').toLowerCase();\n        if (['src', 'href', 'xlink:href'].includes(name)) {\n            if (val.includes('javascript:') || val.includes('data:')) return true;\n        }\n        if (name.startsWith('on')) return true;\n    }\n\n    /**\n\t * Remove dangerous stuff from the HTML document's nodes\n\t * @param html - The HTML document\n\t */\n    private static clean(html: Element) {\n        const nodes = html.children;\n        for (const node of nodes) {\n            DOM.removeAttributes(node);\n            DOM.clean(node);\n        }\n    }\n\n    /**\n\t * Remove potentially dangerous attributes from an element\n\t * @param elem - The element\n\t */\n    private static removeAttributes(elem: Element) {\n        for (const {name, value} of elem.attributes) {\n            if (!DOM.isPossiblyDangerous(name, value)) continue;\n            elem.removeAttribute(name);\n        }\n    }\n}\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 transform a request.\n * It is used just before executing the relevant request.\n */\nexport type RequestTransformFunction = (url: string, resourceType?: ResourceType) => RequestParameters | Promise<RequestParameters> | undefined;\n\nexport class RequestManager {\n    _transformRequestFn: RequestTransformFunction | null;\n\n    constructor(transformRequestFn?: RequestTransformFunction | null) {\n        this._transformRequestFn = transformRequestFn ?? null;\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 | null) {\n        this._transformRequestFn = transformRequest;\n    }\n}\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): Array<{id: string; url: string}> {\n    const resultArray: Array<{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.includes(key)) {\n                dedupArray.push(key);\n                resultArray.push({id, url});\n            }\n        }\n    }\n\n    return resultArray;\n\n}\n", "import {type 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    try {\n        const parsed = new URL(url);\n        parsed.pathname += `${format}${extension}`;\n        return parsed.toString();\n    }\n    catch {\n        throw new Error(`Invalid sprite URL \"${url}\", must be absolute. Modify style specification directly or use TransformStyleFunction to correct the issue dynamically`);\n    }\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 = await requestManager.transformRequest(normalizeSpriteURL(url, format, '.json'), ResourceType.SpriteJSON);\n        jsonsMap[id] = getJSON<SpriteJSON>(jsonRequestParameters, abortController);\n\n        const imageRequestParameters = await 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 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?.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 '../webgl/texture';\nimport {renderStyleImage} from '../style/style_image';\nimport {warnOnce} from '../util/util';\n\nimport type {StyleImage} from '../style/style_image';\nimport type {Context} from '../webgl/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: 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    destroy() {\n        // Destroy atlas texture if it exists\n        if (this.atlasTexture) {\n            this.atlasTexture.destroy();\n            this.atlasTexture = null;\n        }\n        // Remove all images and patterns\n        for (const id of Object.keys(this.images)) {\n            this.removeImage(id);\n        }\n\n        this.patterns = {};\n        this.atlasImage = new RGBAImage({width: 1, height: 1});\n        this.dirty = true;\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        // 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?.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?.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?.width) || image.data.width;\n        const height = (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        return content[3] >= content[1];\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?.onRemove) {\n            image.userImage.onRemove();\n        }\n    }\n\n    listImages(): string[] {\n        return Object.keys(this.images);\n    }\n\n    getImages(ids: 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: 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?.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        // eslint-disable-next-line @typescript-eslint/prefer-optional-chain -- pattern?.position.version would be undefined when pattern is nullish, making undefined === undefined true\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: 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    cloneImages() {\n        const clonedImages: Record<string, StyleImage> = {};\n        for (const id in this.images) {\n            const image = this.images[id];\n            clonedImages[id] = {\n                ...image,\n                data: image.data ? image.data.clone() : null\n            };\n        }\n        return clonedImages;\n    }\n}\n", "const INF = 1e20;\n\n// lookup table for gamma-corrected, signed squared alpha distance values\nconst alphaTable = new Float64Array(256);\nfor (let i = 0; i < 256; i++) {\n    const d = 0.5 - Math.pow(i / 255, 1 / 2.2);\n    alphaTable[i] = d * Math.abs(d);\n}\nalphaTable[255] = -INF;\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        lang = null\n    } = {}) {\n        this.buffer = buffer; // padding around a glyph's bounding box\n        this.radius = radius; // how many pixels around the glyph edge are encoded as signed distances\n        this.cutoff = cutoff; // how much of the SDF byte range represents inside vs outside the edge\n        this.lang = lang; // language of the Canvas drawing context\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        // two grids of squared distances: one for the outside of the glyph shape, one for the inside;\n        // the signed distance is derived as sqrt(outer) - sqrt(inner)\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        if (typeof OffscreenCanvas !== 'undefined') {\n            return new OffscreenCanvas(size, size);\n        }\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 alignment is encoded in metrics.glyphTop/glyphLeft\n        // The remainder is implicitly encoded in the rasterization\n        const glyphTop = Math.ceil(actualBoundingBoxAscent);\n        const glyphLeft = Math.floor(actualBoundingBoxLeft);\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) - glyphLeft));\n        const glyphHeight = Math.max(0, 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        if (this.lang) ctx.lang = this.lang;\n        ctx.clearRect(buffer, buffer, glyphWidth, glyphHeight);\n        ctx.fillText(char, buffer - glyphLeft, buffer + glyphTop);\n        const imgData = ctx.getImageData(buffer, buffer, glyphWidth, glyphHeight);\n\n        // default: outside the glyph (INF distance) for outer, inside (0 distance) for inner\n        gridOuter.fill(INF, 0, len);\n        gridInner.fill(0, 0, len);\n\n        // for anti-aliased pixels, treat partial coverage as a distance approximation:\n        // a fully covered pixel gets 0 outer / INF inner; a partial pixel gets a small\n        // non-zero outer or inner distance based on how far its coverage deviates from 0.5\n        let imgIdx = 3; // start at the alpha channel of the first pixel\n        for (let y = 0; y < glyphHeight; y++) {\n            let j = (y + buffer) * width + buffer;\n            for (let x = 0; x < glyphWidth; x++, imgIdx += 4, j++) {\n                const a = imgData.data[imgIdx]; // alpha value\n                if (a === 0) continue; // empty pixels\n                const t = alphaTable[a];\n                gridOuter[j] = Math.max(0, t);\n                gridInner[j] = Math.max(0, -t);\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        // encode signed distance as a byte: inside the glyph maps to high values, outside to low,\n        // with the edge gradient spanning [-radius * cutoff, radius * (1 - cutoff)] pixels around the edge;\n        // Uint8ClampedArray clamps beyond that\n        const scale = 255 / this.radius;\n        const base = 255 * (1 - this.cutoff);\n        for (let i = 0; i < len; i++) {\n            const d = Math.sqrt(gridOuter[i]) - Math.sqrt(gridInner[i]);\n            data[i] = Math.round(base - scale * d);\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 {codePointUsesLocalIdeographFontFamily} from '../util/unicode_properties.g';\nimport {AlphaImage} from '../util/image';\nimport {ensureError, warnOnce} from '../util/util';\n\nimport type {StyleGlyph} from '../style/style_glyph';\nimport type {RequestManager} from '../util/request_manager';\nimport type {GetGlyphsResponse} from '../util/actor_messages';\n\nimport {v8} from '@maplibre/maplibre-gl-style-spec';\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    ideographTinySDF?: TinySDF;\n};\n\n/**\n * The style specification hard-codes some last resort fonts as a default fontstack.\n */\nconst defaultStack = v8.layout_symbol['text-font'].default.join(',');\n/**\n * The CSS generic font family closest to `defaultStack`.\n */\nconst defaultGenericFontFamily = 'sans-serif';\n\n/**\n * Scale factor for client-generated glyphs.\n *\n * Client-generated glyphs are rendered at 2\u00D7 because CJK glyphs are more detailed than others.\n */\nconst textureScale = 2;\n\nexport class GlyphManager {\n    requestManager: RequestManager;\n    localIdeographFontFamily: string | false;\n    entries: {[stack: string]: Entry};\n    url: string;\n    lang?: string;\n\n    // exposed as statistics to enable stubbing in unit tests\n    static loadGlyphRange = loadGlyphRange;\n    static TinySDF = TinySDF;\n\n    constructor(requestManager: RequestManager, localIdeographFontFamily?: string | false, lang?: string) {\n        this.requestManager = requestManager;\n        this.localIdeographFontFamily = localIdeographFontFamily;\n        this.entries = {};\n        this.lang = lang;\n    }\n\n    setURL(url?: string | null) {\n        this.url = url;\n    }\n\n    async getGlyphs(glyphs: {[stack: string]: number[]}): Promise<GetGlyphsResponse> {\n        const glyphsPromises: Array<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            result[stack] ||= {};\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        // Create an entry for this fontstack if it doesn\u2019t already exist.\n        this.entries[stack] ??= {glyphs: {}, requests: {}, ranges: {}};\n        const entry = this.entries[stack];\n\n        // Try to get the glyph from the cache of client-side glyphs by codepoint.\n        let glyph = entry.glyphs[id];\n        if (glyph !== undefined) {\n            return {stack, id, glyph};\n        }\n\n        // If the style hasn\u2019t opted into server-side fonts or this codepoint is CJK, draw the glyph locally and cache it.\n        if (!this.url || this._charUsesLocalIdeographFontFamily(id)) {\n            glyph = entry.glyphs[id] = this._drawGlyph(entry, stack, id);\n            return {stack, id, glyph};\n        }\n\n        return await this._downloadAndCacheRangePromise(stack, id);\n    }\n\n    async _downloadAndCacheRangePromise(stack: string, id: number): Promise<{stack: string; id: number; glyph: StyleGlyph}> {\n        // Try to get the glyph from the cache of server-side glyphs by PBF range.\n        const entry = this.entries[stack];\n        const range = Math.floor(id / 256);\n        if (entry.ranges[range]) {\n            return {stack, id, glyph: null};\n        }\n\n        // Start downloading this range unless we\u2019re currently downloading it.\n        entry.requests[range] ||= GlyphManager.loadGlyphRange(stack, range, this.url, this.requestManager);\n\n        try {\n            // Get the response and cache the glyphs from it.\n            const response = await entry.requests[range];\n            for (const id in response) {\n                entry.glyphs[+id] = response[+id];\n            }\n            entry.ranges[range] = true;\n            return {stack, id, glyph: response[id] || null};\n        } catch (e) {\n            // Fall back to drawing the glyph locally and caching it.\n            const glyph = entry.glyphs[id] = this._drawGlyph(entry, stack, id);\n            this._warnOnMissingGlyphRange(glyph, range, id, ensureError(e));\n            return {stack, id, glyph};\n        }\n    }\n\n    _warnOnMissingGlyphRange(glyph: StyleGlyph, range: number, id: number, err: Error) {\n        const begin = range * 256;\n        const end = begin + 255;\n        const codePoint = id.toString(16).padStart(4, '0').toUpperCase();\n        warnOnce(`Unable to load glyph range ${range}, ${begin}-${end}. Rendering codepoint U+${codePoint} locally instead. ${err}`);\n    }\n\n    /**\n     * Returns whether the given codepoint should be rendered locally.\n     */\n    _charUsesLocalIdeographFontFamily(id: number): boolean {\n        return !!this.localIdeographFontFamily && codePointUsesLocalIdeographFontFamily(id);\n    }\n\n    /**\n     * Draws a glyph offscreen using TinySDF, creating a TinySDF instance lazily.\n     */\n    _drawGlyph(entry: Entry, stack: string, id: number): StyleGlyph {\n        // The CJK fallback font specified by the developer takes precedence over the last resort fontstack in the style specification.\n        const usesLocalIdeographFontFamily = stack === defaultStack && this.localIdeographFontFamily !== '' && this._charUsesLocalIdeographFontFamily(id);\n\n        // Keep a separate TinySDF instance for when we need to apply the localIdeographFontFamily fallback to keep the font selection from bleeding into non-CJK text.\n        const tinySDFKey = usesLocalIdeographFontFamily ? 'ideographTinySDF' : 'tinySDF';\n        entry[tinySDFKey] ||= this._createTinySDF(usesLocalIdeographFontFamily ? this.localIdeographFontFamily : stack);\n        const char = entry[tinySDFKey].draw(String.fromCodePoint(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        // By definition, control characters are invisible and nonspacing.\n        const isControl = /^\\p{gc=Cf}+$/u.test(String.fromCodePoint(id));\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: isControl ? 0 : (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: isControl ? 0 : (char.glyphAdvance / textureScale || 24),\n                isDoubleResolution: true\n            }\n        };\n    }\n\n    _createTinySDF(stack: String | false): TinySDF {\n        // Escape and quote the font family list for use in CSS.\n        const fontFamilies = stack ? stack.split(',') : [];\n        fontFamilies.push(defaultGenericFontFamily);\n        const fontFamily = fontFamilies.map(fontName =>\n            /[-\\w]+/.test(fontName) ? fontName : `'${CSS.escape(fontName)}'`\n        ).join(',');\n\n        return new GlyphManager.TinySDF({\n            fontSize: 24 * textureScale,\n            buffer: 3 * textureScale,\n            radius: 8 * textureScale,\n            cutoff: 0.25,\n            fontFamily,\n            fontWeight: this._fontWeight(fontFamilies[0]),\n            fontStyle: this._fontStyle(fontFamilies[0]),\n            lang: this.lang\n        });\n    }\n\n    /**\n     * Sniffs the font style out of a font family name.\n     */\n    _fontStyle(fontFamily: string): string {\n        if (/italic/i.test(fontFamily)) {\n            return 'italic';\n        } else if (/oblique/i.test(fontFamily)) {\n            return 'oblique';\n        }\n        return 'normal';\n    }\n\n    /**\n     * Sniffs the font weight out of a font family name.\n     */\n    _fontWeight(fontFamily: string): string {\n        // Based on the OpenType specification\n        // https://learn.microsoft.com/en-us/typography/opentype/spec/os2#usweightclass\n        const weightsByName = {\n            thin: 100, hairline: 100,\n            'extra light': 200, 'ultra light': 200,\n            light: 300,\n            normal: 400, regular: 400,\n            medium: 500,\n            semibold: 600, demibold: 600,\n            bold: 700,\n            'extra bold': 800, 'ultra bold': 800,\n            black: 900, heavy: 900,\n            'extra black': 950, 'ultra black': 950\n        };\n        let match;\n        for (const [name, weight] of Object.entries(weightsByName)) {\n            if (new RegExp(`\\\\b${name}\\\\b`, 'i').test(fontFamily)) {\n                match = `${weight}`;\n            }\n        }\n        return match;\n    }\n\n    destroy() {\n        for (const stack in this.entries) {\n            const entry = this.entries[stack];\n            entry.tinySDF = null;\n            entry.ideographTinySDF = null;\n            entry.glyphs = {};\n            entry.requests = {};\n            entry.ranges = {};\n        }\n        this.entries = {};\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 = await 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?.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, type 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, type Transitioning, type PossiblyEvaluated, DataConstantProperty, TRANSITION_SUFFIX} 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\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 ||= 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, undefined);\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?.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, type PossiblyEvaluated, Properties, TRANSITION_SUFFIX, Transitionable, type Transitioning, type 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 {type Color, latest as styleSpec} from '@maplibre/maplibre-gl-style-spec';\nimport {type 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\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    atmosphereMesh: Mesh | undefined;\n    _transitionable: Transitionable<SkyProps>;\n    _transitioning: Transitioning<SkyProps>;\n\n    constructor(sky?: SkySpecification) {\n        super();\n        this._transitionable = new Transitionable(properties, undefined);\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        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        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 '../webgl/context';\n\n/**\n * A dash entry\n */\nexport type 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: number[], round: boolean) {\n        const key = dasharray.join(',') + String(round);\n\n        this.dashEntry[key] ||= this.addDash(dasharray, round);\n        return this.dashEntry[key];\n    }\n\n    getDashRanges(dasharray: 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: 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 (const dash of dasharray) { length += dash; }\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,\n            height: 2 * n,\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 {type 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: ActorTarget[];\n\n    constructor() {\n        this.active = {};\n    }\n\n    acquire(mapId: number | string): 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            for (const w of this.workers) {\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 {type AddProtocolAction, config} from './config';\nimport type {default as MaplibreWorker} from '../source/worker';\nimport type {WorkerSourceConstructor} from '../source/worker_source';\nimport type {GetResourceResponse, RequestParameters} from './ajax';\n\nexport interface WorkerGlobalScopeInterface {\n    importScripts(...urls: 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    makeRequest: (request: RequestParameters, abortController: AbortController) => Promise<GetResourceResponse<any>>;\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    globalWorkerPool ||= new WorkerPool();\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, type 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 {RequestResponseMessageMap} from './actor_messages';\nimport {MessageType} from './actor_messages';\n\n/**\n * Responsible for sending messages from a {@link Source} to an associated worker source (usually with the same name).\n */\nexport class Dispatcher {\n    workerPool: WorkerPool;\n    actors: 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<Array<RequestResponseMessageMap[T][1]>> {\n        const promises: Array<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        for (const actor of this.actors) {\n            actor.remove();\n        }\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    public unregisterMessageHandler<T extends MessageType>(type: T) {\n        for (const actor of this.actors) {\n            actor.unregisterMessageHandler(type);\n        }\n    }\n}\n\nlet globalDispatcher: Dispatcher;\n\n/**\n * This function is used to get the global dispatcher that is shared across all maps instances.\n * It is used by the main thread to send messages to the workers, and by the workers to send messages back to the main thread.\n * If you import a script into the worker and need to send a message to the workers to pass some parameters for example, \n * you can use this function to get the global dispatcher and send a message to the workers.\n * @returns The global dispatcher instance.\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 {mat4} from 'gl-matrix';\nimport type Point from '@mapbox/point-geometry';\nimport type {TileManager} from '../tile/tile_manager';\nimport type {StyleLayer} from '../style/style_layer';\nimport type {CollisionIndex} from '../symbol/collision_index';\nimport type {IReadonlyTransform} from '../geo/transform_interface';\nimport type {RetainedQueryData} from '../symbol/placement';\nimport type {FilterSpecification} from '@maplibre/maplibre-gl-style-spec';\nimport type {GeoJSONFeature, MapGeoJSONFeature} from '../util/vectortile_to_geojson';\nimport type {QueryResults, QueryResultsItem} from '../data/feature_index';\nimport type {OverscaledTileID} from '../tile/tile_id';\n\ntype RenderedFeatureLayer = {\n    wrappedTileID: string;\n    queryResults: QueryResults;\n};\n\n/**\n * Options to pass to query the map for the rendered features\n */\nexport type QueryRenderedFeaturesOptions = {\n    /**\n     * An array or set 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?: string[] | Set<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?: 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 * @internal\n * A version of QueryRenderedFeaturesOptions used internally\n */\nexport type QueryRenderedFeaturesOptionsStrict = Omit<QueryRenderedFeaturesOptions, 'layers'> & {\n    layers: Set<string> | null;\n    globalState?: Record<string, any>;\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 * @internal\n * A version of QuerySourceFeatureOptions used internally\n */\nexport type QuerySourceFeatureOptionsStrict = QuerySourceFeatureOptions & {\n    globalState?: Record<string, any>;\n};\n\nexport type QueryRenderedFeaturesResults = {\n    [key: string]: QueryRenderedFeaturesResultsItem[];\n};\n\nexport type QueryRenderedFeaturesResultsItem = QueryResultsItem & { feature: MapGeoJSONFeature };\n\n/*\n * Returns a matrix that can be used to convert from tile coordinates to viewport pixel coordinates.\n */\nfunction getPixelPosMatrix(transform, tileID: OverscaledTileID) {\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    if (transform.calculatePosMatrix) { // Globe: TODO: remove this hack once queryRendererFeatures supports globe properly\n        return mat4.multiply(t, t, transform.calculatePosMatrix(tileID.toUnwrapped()));\n    } else {\n        return t;\n    }\n}\n\nfunction queryIncludes3DLayer(layers: Set<string> | undefined, styleLayers: {[_: string]: StyleLayer}, sourceID: string) {\n    if (layers) {\n        for (const layerID of layers) {\n            const layer = styleLayers[layerID];\n            if (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    tileManager: TileManager,\n    styleLayers: {[_: string]: StyleLayer},\n    serializedLayers: {[_: string]: any},\n    queryGeometry: Point[],\n    params: QueryRenderedFeaturesOptionsStrict | undefined,\n    transform: IReadonlyTransform,\n    getElevation: undefined | ((id: OverscaledTileID, x: number, y: number) => number)\n): QueryRenderedFeaturesResults {\n\n    const has3DLayer = queryIncludes3DLayer(params?.layers ?? null, styleLayers, tileManager.id);\n    const maxPitchScaleFactor = transform.maxPitchScaleFactor();\n    const tilesIn = tileManager.tilesIn(queryGeometry, maxPitchScaleFactor, has3DLayer);\n\n    tilesIn.sort(sortTilesIn);\n    const renderedFeatureLayers: RenderedFeatureLayer[] = [];\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                tileManager.getState(),\n                tileIn.queryGeometry,\n                tileIn.cameraQueryGeometry,\n                tileIn.scale,\n                params,\n                transform,\n                maxPitchScaleFactor,\n                getPixelPosMatrix(transform, tileIn.tileID),\n                getElevation ? (x: number, y: number) => getElevation(tileIn.tileID, x, y) : undefined,\n            )\n        });\n    }\n\n    const result = mergeRenderedFeatureLayers(renderedFeatureLayers);\n\n    return convertFeaturesToMapFeatures(result, tileManager);\n}\n\nexport function queryRenderedSymbols(styleLayers: {[_: string]: StyleLayer},\n    serializedLayers: {[_: string]: StyleLayer},\n    tileManagers: {[_: string]: TileManager},\n    queryGeometry: Point[],\n    params: QueryRenderedFeaturesOptionsStrict,\n    collisionIndex: CollisionIndex,\n    retainedQueryData: {\n        [_: number]: RetainedQueryData;\n    }): QueryRenderedFeaturesResults {\n    const result: QueryResults = {};\n    const renderedSymbols = collisionIndex.queryRenderedSymbols(queryGeometry);\n    const bucketQueryData: RetainedQueryData[] = [];\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            {\n                filterSpec: params.filter,\n                globalState: params.globalState\n            },\n            params.layers,\n            params.availableImages,\n            styleLayers);\n\n        for (const layerID in bucketSymbols) {\n            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                result[layerID].push(symbolFeature);\n            }\n        }\n    }\n\n    return convertFeaturesToMapFeaturesMultiple(result, styleLayers, tileManagers);\n}\n\nexport function querySourceFeatures(tileManager: TileManager, params: QuerySourceFeatureOptionsStrict | undefined): GeoJSONFeature[] {\n    const tiles = tileManager.getRenderableIds().map((id) => {\n        return tileManager.getTileByID(id);\n    });\n\n    const result: GeoJSONFeature[] = [];\n\n    const dataTiles = {};\n    for (const tile of tiles) {\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: {tileID: OverscaledTileID}, b: {tileID: OverscaledTileID}) {\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: RenderedFeatureLayer[]): QueryResults {\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: QueryResults = {};\n    const wrappedIDLayerMap = {};\n    for (const {queryResults, wrappedTileID} of tiles) {\n        wrappedIDLayerMap[wrappedTileID] ||= {};\n        const wrappedIDLayers = wrappedIDLayerMap[wrappedTileID];\n        for (const layerID in queryResults) {\n            const tileFeatures = queryResults[layerID];\n            wrappedIDLayers[layerID] ||= {};\n            const wrappedIDFeatures = wrappedIDLayers[layerID];\n            result[layerID] ||= [];\n            for (const tileFeature of tileFeatures) {\n                if (!wrappedIDFeatures[tileFeature.featureIndex]) {\n                    wrappedIDFeatures[tileFeature.featureIndex] = true;\n                    result[layerID].push(tileFeature);\n                }\n            }\n        }\n    }\n    return result;\n}\n\nfunction convertFeaturesToMapFeatures(result: QueryResults, tileManager: TileManager): QueryRenderedFeaturesResults {\n    // Merge state from TileManager into the results\n    for (const layerID in result) {\n        for (const featureWrapper of result[layerID]) {\n            convertFeatureToMapFeature(featureWrapper, tileManager);\n        }\n    }\n    return result as QueryRenderedFeaturesResults;\n}\n\nfunction convertFeaturesToMapFeaturesMultiple(result: QueryResults, styleLayers: {[_: string]: StyleLayer}, tileManagers: {[_: string]: TileManager}): QueryRenderedFeaturesResults {\n    // Merge state from TileManager into the results\n    for (const layerName in result) {\n        for (const featureWrapper of result[layerName]) {\n            const layer = styleLayers[layerName];\n            const tileManager = tileManagers[layer.source];\n            convertFeatureToMapFeature(featureWrapper, tileManager);\n        };\n    }\n    return result as QueryRenderedFeaturesResults;\n}\n\nfunction convertFeatureToMapFeature(featureWrapper: QueryResultsItem, tileManager: TileManager) {\n    const feature = featureWrapper.feature as MapGeoJSONFeature;\n    const state = tileManager.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", "import {pick, extend, type 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: 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?: string[];\n};\n\nexport async function loadTileJson(\n    options: RasterSourceSpecification | RasterDEMSourceSpecification | VectorSourceSpecification,\n    requestManager: RequestManager,\n    abortController: AbortController,\n    targetWindow?: Window,\n): Promise<LoadTileJsonResponse | null> {\n    let tileJSON: TileJSON | typeof options = options;\n    if (options.url) {\n        const response = await getJSON<TileJSON>(await requestManager.transformRequest(options.url, ResourceType.Source), abortController);\n        tileJSON = response.data;\n    } else {\n        await browser.frameAsync(abortController, targetWindow);\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) => layer.id);\n    }\n\n    return result;\n}\n", "import {LngLat} from './lng_lat';\nimport type {LngLatLike} from './lng_lat';\nimport {wrap} from '../util/util';\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 MapLibre 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 * @see [Fit to the bounds of a LineString](https://maplibre.org/maplibre-gl-js/docs/examples/fit-to-the-bounds-of-a-linestring/)\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(): [[number, number], [number, number]] {\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     * Checks if this bounding box intersects with another bounding box.\n     *\n     * Returns true if the bounding boxes share any area, including cases where\n     * they only touch along an edge or at a corner.\n     *\n     * This method properly handles cases where either or both bounding boxes cross\n     * the antimeridian (date line).\n     */\n    intersects(other: LngLatBoundsLike): boolean {\n        other = LngLatBounds.convert(other);\n\n        const latIntersects =\n            other.getNorth() >= this.getSouth() &&\n            other.getSouth() <= this.getNorth();\n\n        if (!latIntersects) return false;\n\n        // Check if either bound covers the full world (|span| >= 360\u00B0)\n        // This must be done before wrapping to preserve the span information\n        const thisSpan = Math.abs(this.getEast() - this.getWest());\n        const otherSpan = Math.abs(other.getEast() - other.getWest());\n\n        if (thisSpan >= 360 || otherSpan >= 360) {\n            return true;\n        }\n\n        // Normalize longitudes to [-180, 180] range\n        const thisWest = wrap(this.getWest(), -180, 180);\n        const thisEast = wrap(this.getEast(), -180, 180);\n        const otherWest = wrap(other.getWest(), -180, 180);\n        const otherEast = wrap(other.getEast(), -180, 180);\n\n        // Check if either bounds wraps around the antimeridian\n        // Use strict inequality: equal values indicate zero-width bounds (e.g., a point), not wrapping\n        const thisWraps = thisWest > thisEast;\n        const otherWraps = otherWest > otherEast;\n\n        // Both wrap: they always intersect\n        if (thisWraps && otherWraps) {\n            return true;\n        }\n\n        // Only this wraps: intersects if other is outside the gap\n        if (thisWraps) {\n            return otherEast >= thisWest || otherWest <= thisEast;\n        }\n\n        if (otherWraps) {\n            // Only other wraps: intersects if this is outside the gap\n            return thisEast >= otherWest || thisWest <= otherEast;\n        }\n\n        // Neither wraps: standard intersection check\n        return otherWest <= thisEast && otherEast >= thisWest;\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 {@link 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, type 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        return tileID.x >= level.minX && tileID.x < level.maxX && tileID.y >= level.minY && tileID.y < level.maxY;\n    }\n}\n", "import {Event, ErrorEvent, Evented} from '../util/evented';\n\nimport {ensureError, extend, pick} from '../util/util';\nimport {loadTileJson} from './load_tilejson';\nimport {TileBounds} from '../tile/tile_bounds';\nimport {ResourceType} from '../util/request_manager';\nimport {MessageType} from '../util/actor_messages';\nimport {isAbortError} from '../util/abort_error';\n\nimport type {Source} from './source';\nimport type {OverscaledTileID} from '../tile/tile_id';\nimport type {Map} from '../ui/map';\nimport type {Dispatcher} from '../util/dispatcher';\nimport type {Tile} from '../tile/tile';\nimport type {VectorSourceSpecification, PromoteIdSpecification} from '@maplibre/maplibre-gl-style-spec';\nimport type {WorkerTileParameters, OverzoomParameters, WorkerTileResult} from './worker_source';\n\nexport type VectorTileSourceOptions = VectorSourceSpecification & {\n    collectResourceTiming?: boolean;\n    tileSize?: number;\n};\n\nexport type LoadTileResult = {\n    /**\n     * Indicates that the tile requested was not modified.\n     */\n    unmodified?: boolean;\n};\n\n/**\n * A source containing vector tiles in [Maplibre Vector Tile format](https://maplibre.org/maplibre-tile-spec/) or [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/add-a-vector-tile-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    encoding: 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: 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', 'encoding']));\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(sourceDataChanged: boolean = false) {\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, this.map._ownerWindow);\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', sourceDataChanged}));\n            }\n        } catch (err) {\n            this._tileJSONRequest = null;\n            this._loaded = true; // let's pretend it's loaded so the source will be ignored\n\n            // only fire error event if it is not due to aborting the request\n            if (!isAbortError(err)) {\n                this.fire(new ErrorEvent(ensureError(err)));\n            }\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(true);\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: 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<LoadTileResult | void> {\n        const url = tile.tileID.canonical.url(this.tiles, this.map.getPixelRatio(), this.scheme);\n        const params: WorkerTileParameters = {\n            request: await 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            subdivisionGranularity: this.map.style.projection.subdivisionGranularity,\n            encoding: this.encoding,\n            overzoomParameters: await this._getOverzoomParameters(tile),\n            etag: tile.etag\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\n            const result: LoadTileResult = {};\n            if (data?.etagUnmodified) result.unmodified = true;\n            return result;\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    /**\n     * When the requested tile has a higher canonical Z than source maxzoom, pass overzoom parameters so worker can load the\n     * deepest tile at source max zoom to generate sub tiles using geojsonvt for highest performance on vector overscaling\n     */\n    private async _getOverzoomParameters(tile: Tile): Promise<OverzoomParameters | undefined> {\n        if (tile.tileID.canonical.z <= this.maxzoom) {\n            return undefined;\n        }\n        if (this.map._zoomLevelsToOverscale === undefined) {\n            return undefined;\n        }\n        const maxZoomTileID = tile.tileID.scaledTo(this.maxzoom).canonical;\n        const maxZoomTileUrl = maxZoomTileID.url(this.tiles, this.map.getPixelRatio(), this.scheme);\n\n        return {\n            maxZoomTileID,\n            overzoomRequest: await this.map._requestManager.transformRequest(maxZoomTileUrl, ResourceType.Tile)\n        };\n    }\n\n    private _afterTileLoadWorkerResponse(tile: Tile, data: WorkerTileResult) {\n        if (data?.resourceTiming) {\n            tile.resourceTiming = data.resourceTiming;\n        }\n\n        if (data && this.map._refreshExpiredTiles) {\n            tile.setExpiryData(data);\n        }\n        tile.etag = data?.etag;\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 {ensureError, 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/tile_bounds';\nimport {Texture} from '../webgl/texture';\nimport {isAbortError} from '../util/abort_error';\n\nimport type {Source} from './source';\nimport type {OverscaledTileID} from '../tile/tile_id';\nimport type {Map} from '../ui/map';\nimport type {Dispatcher} from '../util/dispatcher';\nimport type {Tile} from '../tile/tile';\nimport type {\n    RasterSourceSpecification,\n    RasterDEMSourceSpecification\n} from '@maplibre/maplibre-gl-style-spec';\n\n/**\n * A source containing raster tiles (See the [raster source documentation](https://maplibre.org/maplibre-style-spec/sources/#raster) for detailed documentation of options.)\n *\n * @group Sources\n *\n * \\> \u2139\uFE0F **Note:** The default `tileSize` is `512`. If your tile provider (such as OpenStreetMap or Stadia Maps) serves 256px tiles, set `tileSize: 256` manually to avoid blurry rendering due to upscaling.\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, // Set this to match tile server output to avoid blurry rendering\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 // Important for WMS if tiles are 256px\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/add-a-wms-source/)\n * @see [Display a satellite map](https://maplibre.org/maplibre-gl-js/docs/examples/display-a-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: 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(sourceDataChanged: boolean = false) {\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, this.map._ownerWindow);\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', sourceDataChanged}));\n            }\n        } catch (err) {\n            this._tileJSONRequest = null;\n            this._loaded = true; // let's pretend it's loaded so the source will be ignored\n\n            // only fire error event if it is not due to aborting the request\n            if (!isAbortError(err)) {\n                this.fire(new ErrorEvent(ensureError(err)));\n            }\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(true);\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: 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(await 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?.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 {type Evented} from '../util/evented';\nimport {browser} from '../util/browser';\nimport {offscreenCanvasSupported} from '../util/offscreen_canvas_supported';\nimport {OverscaledTileID} from '../tile/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/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 = await 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?.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' && tile.state !== 'reloading') {\n                    return;\n                }\n                if (!tile.actor || tile.state === 'expired') {\n                    tile.actor = this.dispatcher.getActor();\n                }\n                tile.dem = await tile.actor.sendAsync({type: MessageType.loadDEMTile, data: params});\n                tile.needsHillshadePrepare = true;\n                tile.needsTerrainPrepare = true;\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 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 {\n                // fall-back to browser canvas decoding\n            }\n        }\n        return browser.getImageData(img, 1);\n    }\n\n    _getNeighboringTiles(tileID: OverscaledTileID): Record<string, {backfilled: boolean}> {\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: Record<string, {backfilled: boolean}> = {};\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", "/**\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 - processed in the following order: remove, add, update. Provides an efficient\n * way to update GeoJSON data in a map source without having to replace the entire dataset.\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?: GeoJSONFeatureId[];\n    /**\n     * An array of features to add\n     */\n    add?: GeoJSON.Feature[];\n    /**\n     * An array of update objects\n     */\n    update?: GeoJSONFeatureDiff[];\n};\n\n/**\n * A geojson feature diff object - processed in the following order: new geometry, remove properties, add/update properties.\n * Provides an efficient way to update GeoJSON features in a map source without replacing the entire feature.\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?: 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\n/**\n * Converts a GeoJSON object into a map of feature IDs to GeoJSON features.\n * @param data - The GeoJSON object to convert.\n * @param promoteId - If set, the feature id will be set to the promoteId property value.\n * @returns A map of feature IDs to GeoJSON features, or `undefined` if the GeoJSON object is not a valid updateable object.\n *\n * Features must have unique identifiers to be updateable. IDs can come from:\n * - The feature's `id` property (standard GeoJSON)\n * - A promoted property specified by `promoteId` (e.g., a \"name\" property)\n */\nexport function toUpdateable(data: GeoJSON.GeoJSON | undefined, promoteId?: string): Map<GeoJSONFeatureId, GeoJSON.Feature> | undefined {\n    const updateable = new Map<GeoJSONFeatureId, GeoJSON.Feature>();\n\n    // null can be updated - empty updateable\n    if (data == null) {\n        return updateable;\n    }\n\n    // {} can be updated - empty updateable\n    if (data.type == null) {\n        return updateable;\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        const id = getFeatureId(data, promoteId);\n        if (id == null) return undefined;\n\n        updateable.set(id, data);\n        return updateable;\n    }\n\n    // a feature collection can be updated if every feature has a unique id, which prevents the silent dropping of features\n    if (data.type === 'FeatureCollection') {\n        const seenIds = new Set<GeoJSONFeatureId>();\n\n        for (const feature of data.features) {\n            const id = getFeatureId(feature, promoteId);\n            if (id == null) return undefined;\n\n            if (seenIds.has(id)) return undefined;\n            seenIds.add(id);\n\n            updateable.set(id, feature);\n        }\n\n        return updateable;\n    }\n\n    return undefined;\n}\n\n/**\n * Mutates updateable and applies a {@link GeoJSONSourceDiff}. Operations are processed in a specific order to ensure predictable behavior:\n * 1. Remove operations (removeAll, remove)\n * 2. Add operations (add)\n * 3. Update operations (update)\n * @returns an array of geometries that were affected by the diff - with the exception of removeAll which does not track any affected geometries.\n */\nexport function applySourceDiff(updateable: Map<GeoJSONFeatureId, GeoJSON.Feature>, diff: GeoJSONSourceDiff, promoteId?: string): GeoJSON.Geometry[] {\n    const affectedGeometries: GeoJSON.Geometry[] = [];\n\n    if (diff.removeAll) {\n        updateable.clear();\n    }\n    else if (diff.remove) {\n        for (const id of diff.remove) {\n            const existing = updateable.get(id);\n            if (!existing) continue;\n\n            affectedGeometries.push(existing.geometry);\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            if (id == null) continue;\n\n            const existing = updateable.get(id);\n            if (existing) affectedGeometries.push(existing.geometry);\n\n            affectedGeometries.push(feature.geometry);\n            updateable.set(id, feature);\n        }\n    }\n\n    if (diff.update) {\n        for (const update of diff.update) {\n            const existing = updateable.get(update.id);\n            if (!existing) continue;\n\n            const changeGeometry = !!update.newGeometry;\n\n            const changeProps =\n                update.removeAllProperties ||\n                update.removeProperties?.length > 0 ||\n                update.addOrUpdateProperties?.length > 0;\n\n            // nothing to do\n            if (!changeGeometry && !changeProps) continue;\n\n            // clone once since we'll mutate\n            affectedGeometries.push(existing.geometry);\n            const feature = {...existing};\n            updateable.set(update.id, feature);\n\n            if (changeGeometry) {\n                affectedGeometries.push(update.newGeometry);\n                feature.geometry = update.newGeometry;\n            }\n\n            if (changeProps) {\n                if (update.removeAllProperties) {\n                    feature.properties = {};\n                } else {\n                    feature.properties = {...feature.properties || {}};\n                }\n\n                if (update.removeProperties) {\n                    for (const key of update.removeProperties) {\n                        delete feature.properties[key];\n                    }\n                }\n\n                if (update.addOrUpdateProperties) {\n                    for (const {key, value} of update.addOrUpdateProperties) {\n                        feature.properties[key] = value;\n                    }\n                }\n            }\n        }\n    }\n\n    return affectedGeometries;\n}\n\n/**\n * Merge two GeoJSONSourceDiffs, considering the order of operations as specified above (remove, add, update).\n *\n * For `add` features that use promoteId, the feature id will be set to the promoteId value temporarily so that\n * the merge can be completed, then reverted to the original promoteId state after the merge.\n */\nexport function mergeSourceDiffs(\n    prevDiff: GeoJSONSourceDiff | undefined,\n    nextDiff: GeoJSONSourceDiff | undefined,\n    promoteId?: string\n): GeoJSONSourceDiff {\n    if (!prevDiff) return nextDiff || {};\n    if (!nextDiff) return prevDiff || {};\n\n    if (promoteId) {\n        // Temporarily normalize diff.add for features using promoteId\n        promoteFeatureIds(prevDiff.add, promoteId);\n        promoteFeatureIds(nextDiff.add, promoteId);\n    }\n\n    // Hash for o(1) lookups while creating a mutatable copy of the collections\n    const prev = diffToHashed(prevDiff);\n    const next = diffToHashed(nextDiff);\n\n    // Resolve merge conflicts\n    resolveMergeConflicts(prev, next);\n\n    // Simply merge the two diffs now that conflicts have been resolved\n    const merged: GeoJSONSourceDiffHashed = {};\n    if (prev.removeAll || next.removeAll) merged.removeAll = true;\n    merged.remove = new Set([...prev.remove , ...next.remove]);\n    merged.add    = new Map([...prev.add    , ...next.add]);\n    merged.update = new Map([...prev.update , ...next.update]);\n\n    // Squash the merge - removing then adding the same feature\n    if (merged.remove.size && merged.add.size) {\n        for (const id of merged.add.keys()) {\n            merged.remove.delete(id);\n        }\n    }\n\n    // Convert back to array-based representation\n    const mergedDiff = hashedToDiff(merged);\n\n    if (promoteId) {\n        // Revert diff.add for features using promoteId\n        demoteFeatureIds(mergedDiff.add, promoteId);\n    }\n\n    return mergedDiff;\n}\n\n/**\n * Resolve merge conflicts between two GeoJSONSourceDiffs considering the ordering above (remove/add/update).\n *\n * - If you `removeAll` and then `add` features in the same diff, the added features will be kept.\n * - Updates only apply to features that exist after removes and adds have been processed.\n */\nfunction resolveMergeConflicts(prev: GeoJSONSourceDiffHashed, next: GeoJSONSourceDiffHashed) {\n    // Removing all features with added or updated features in previous - and clear no-op removes\n    if (next.removeAll) {\n        prev.add.clear();\n        prev.update.clear();\n        prev.remove.clear();\n        next.remove.clear();\n    }\n\n    // Removing features that were added or updated in previous\n    for (const id of next.remove) {\n        prev.add.delete(id);\n        prev.update.delete(id);\n    }\n\n    // Updating features that were updated in previous\n    for (const [id, nextUpdate] of next.update) {\n        const prevUpdate = prev.update.get(id);\n        if (!prevUpdate) continue;\n\n        next.update.set(id, mergeFeatureDiffs(prevUpdate, nextUpdate));\n        prev.update.delete(id);\n    }\n}\n\n/**\n * Merge two feature diffs for the same feature id, considering the order of operations as specified above (remove, add/update).\n */\nfunction mergeFeatureDiffs(prev: GeoJSONFeatureDiff, next: GeoJSONFeatureDiff): GeoJSONFeatureDiff {\n    const merged: GeoJSONFeatureDiff = {id: prev.id};\n\n    // Removing all properties with added or updated properties in previous - and clear no-op removes\n    if (next.removeAllProperties) {\n        delete prev.removeProperties;\n        delete prev.addOrUpdateProperties;\n        delete next.removeProperties;\n    }\n    // Removing properties that were added or updated in previous\n    if (next.removeProperties) {\n        for (const key of next.removeProperties) {\n            const index = prev.addOrUpdateProperties.findIndex(prop => prop.key === key);\n            if (index > -1) prev.addOrUpdateProperties.splice(index, 1);\n        }\n    }\n\n    // Merge the two diffs\n    if (prev.removeAllProperties || next.removeAllProperties) {\n        merged.removeAllProperties = true;\n    }\n    if (prev.removeProperties || next.removeProperties) {\n        merged.removeProperties = [...prev.removeProperties || [], ...next.removeProperties || []];\n    }\n    if (prev.addOrUpdateProperties || next.addOrUpdateProperties) {\n        merged.addOrUpdateProperties = [...prev.addOrUpdateProperties || [], ...next.addOrUpdateProperties || []];\n    }\n    if (prev.newGeometry || next.newGeometry) {\n        merged.newGeometry = next.newGeometry || prev.newGeometry;\n    }\n\n    return merged;\n}\n\n/**\n * Mutates diff.add and applies a feature id using the promoteId property\n */\nfunction promoteFeatureIds(add: GeoJSON.Feature[], promoteId: string) {\n    if (!add) return;\n\n    for (const feature of add) {\n        const id = getFeatureId(feature, promoteId);\n        if (id != null) feature.id = id;\n    }\n}\n\n/**\n * Mutates diff.add and removes the feature id if using the promoteId property\n */\nfunction demoteFeatureIds(add: GeoJSON.Feature[], promoteId: string) {\n    if (!add) return;\n\n    for (const feature of add) {\n        const id = getFeatureId(feature, promoteId);\n        if (id != null) delete feature.id;\n    }\n}\n\n/**\n * @internal\n * Internal representation of GeoJSONSourceDiff using Sets and Maps for efficient operations\n */\ntype GeoJSONSourceDiffHashed = {\n    removeAll?: boolean;\n    remove?: Set<GeoJSONFeatureId>;\n    add?: Map<GeoJSONFeatureId, GeoJSON.Feature>;\n    update?: Map<GeoJSONFeatureId, GeoJSONFeatureDiff>;\n};\n\n/**\n * @internal\n * Convert a GeoJSONSourceDiff to an idempotent hashed representation using Sets and Maps\n */\nfunction diffToHashed(diff: GeoJSONSourceDiff | undefined): GeoJSONSourceDiffHashed {\n    if (!diff) return {};\n\n    const hashed: GeoJSONSourceDiffHashed = {};\n\n    hashed.removeAll = diff.removeAll;\n    hashed.remove = new Set(diff.remove || []);\n    hashed.add    = new Map(diff.add?.map(feature => [feature.id, feature]));\n    hashed.update = new Map(diff.update?.map(update => [update.id, update]));\n\n    return hashed;\n}\n\n/**\n * @internal\n * Convert a hashed GeoJSONSourceDiff back to the array-based representation\n */\nfunction hashedToDiff(hashed: GeoJSONSourceDiffHashed): GeoJSONSourceDiff {\n    const diff: GeoJSONSourceDiff = {};\n\n    if (hashed.removeAll) {\n        diff.removeAll = hashed.removeAll;\n    }\n    if (hashed.remove) {\n        diff.remove = Array.from(hashed.remove);\n    }\n    if (hashed.add) {\n        diff.add = Array.from(hashed.add.values());\n    }\n    if (hashed.update) {\n        diff.update = Array.from(hashed.update.values());\n    }\n\n    return diff;\n}\n", "import {LngLatBounds} from '../geo/lng_lat_bounds';\n\ntype DeepCoordinates = GeoJSON.Position | DeepCoordinates[];\n\nfunction extractCoordinates(coords: DeepCoordinates): number[][] {\n    if (!coords || coords.length === 0) return [];\n\n    if (typeof coords[0] === 'number') {\n        return [coords as number[]];\n    }\n\n    return coords.flatMap(c => extractCoordinates(c));\n}\n\nfunction getCoordinatesFromGeometry(geometry: GeoJSON.Geometry): number[][] {\n    if (geometry.type === 'GeometryCollection') {\n        return geometry.geometries.flatMap(g => getCoordinatesFromGeometry(g));\n    }\n\n    return extractCoordinates(geometry.coordinates);\n}\n\n/**\n * Calculates the bounding box of GeoJSON data.\n * @param data - The GeoJSON data to calculate bounds for\n * @returns The bounding box of the GeoJSON data\n */\nexport function getGeoJSONBounds(data: GeoJSON.GeoJSON): LngLatBounds {\n    const bounds = new LngLatBounds();\n    let coordinates: number[][];\n\n    switch (data.type) {\n        case 'FeatureCollection':\n            coordinates = data.features.flatMap(f => getCoordinatesFromGeometry(f.geometry));\n            break;\n        case 'Feature':\n            coordinates = getCoordinatesFromGeometry(data.geometry);\n            break;\n        default:\n            coordinates = getCoordinatesFromGeometry(data);\n            break;\n    }\n\n    if (coordinates.length === 0) {\n        return bounds;\n    }\n\n    for (const coordinate of coordinates) {\n        const [lng, lat] = coordinate;\n\n        bounds.extend([lng, lat]);\n    }\n    return bounds;\n}\n", "import {Event, ErrorEvent, Evented} from '../util/evented';\nimport {ensureError, extend, warnOnce, type ExactlyOne} from '../util/util';\nimport {EXTENT} from '../data/extent';\nimport {ResourceType} from '../util/request_manager';\nimport {browser} from '../util/browser';\nimport {applySourceDiff, mergeSourceDiffs, toUpdateable} from './geojson_source_diff';\nimport {getGeoJSONBounds} from '../util/geojson_bounds';\nimport {MessageType} from '../util/actor_messages';\nimport {tileIdToLngLatBounds} from '../tile/tile_id_to_lng_lat_bounds';\n\nimport type {LngLatBounds} from '../geo/lng_lat_bounds';\nimport type {Source} from './source';\nimport type {Map} from '../ui/map';\nimport type {Dispatcher} from '../util/dispatcher';\nimport type {Tile} from '../tile/tile';\nimport type {Actor} from '../util/actor';\nimport type {GeoJSONWorkerSourceLoadDataResult} from '../util/actor_messages';\nimport type {GeoJSONSourceSpecification, PromoteIdSpecification} from '@maplibre/maplibre-gl-style-spec';\nimport type {GeoJSONFeatureId, GeoJSONSourceDiff} from './geojson_source_diff';\nimport type {GeoJSONWorkerOptions, LoadGeoJSONParameters} from './geojson_worker_source';\nimport type {WorkerTileParameters} from './worker_source';\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 * @internal\n */\nexport type GeoJSONSourceShouldReloadTileOptions = {\n    /**\n     * Refresh all tiles that WILL contain these bounds.\n     */\n    affectedBounds: LngLatBounds[];\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     * Non-integer values are rounded to the closest integer due to supercluster integer value requirements.\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/draw-geojson-points/)\n * @see [Add a GeoJSON line](https://maplibre.org/maplibre-gl-js/docs/examples/add-a-geojson-line/)\n * @see [Create a heatmap from points](https://maplibre.org/maplibre-gl-js/docs/examples/create-a-heatmap-layer/)\n * @see [Create and style clusters](https://maplibre.org/maplibre-gl-js/docs/examples/create-and-style-clusters/)\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: ExactlyOne<{\n        url: string;\n        geojson: GeoJSON.GeoJSON;\n        updateable: globalThis.Map<GeoJSONFeatureId, GeoJSON.Feature>;\n    }>;\n    _options: GeoJSONSourceInternalOptions;\n    workerOptions: GeoJSONWorkerOptions;\n    map: Map;\n    actor: Actor;\n    _isUpdatingWorker: boolean;\n    _pendingWorkerUpdate: {\n        data?: GeoJSON.GeoJSON | string;\n        diff?: GeoJSONSourceDiff;\n        updateCluster?: boolean;\n    };\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._isUpdatingWorker = false;\n        this._pendingWorkerUpdate = {data: options.data};\n\n        this.actor = dispatcher.getActor();\n        this.setEventedParent(eventedParent);\n\n        this._data = typeof options.data === 'string' ? {url: options.data} : {geojson: options.data};\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        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            geojsonVtOptions: {\n                buffer: this._pixelsToTileUnits(options.buffer !== undefined ? options.buffer : 128),\n                tolerance: this._pixelsToTileUnits(options.tolerance !== undefined ? options.tolerance : 0.375),\n                extent: EXTENT,\n                maxZoom: this.maxzoom,\n                lineMetrics: options.lineMetrics || false,\n                generateId: options.generateId || false,\n                promoteId: typeof options.promoteId === 'string' ? options.promoteId : undefined,\n                cluster: options.cluster || false,\n                clusterOptions: {\n                    maxZoom: this._getClusterMaxZoom(options.clusterMaxZoom),\n                    minPoints: Math.max(2, options.clusterMinPoints || 2),\n                    extent: EXTENT,\n                    radius: this._pixelsToTileUnits(options.clusterRadius || 50),\n                    log: false,\n                    generateId: options.generateId || false\n                },\n            },\n            clusterProperties: options.clusterProperties,\n            filter: options.filter\n        }, options.workerOptions);\n    }\n\n    private _hasPendingWorkerUpdate(): boolean {\n        return this._pendingWorkerUpdate.data !== undefined || this._pendingWorkerUpdate.diff !== undefined || this._pendingWorkerUpdate.updateCluster;\n    }\n\n    private _pixelsToTileUnits(pixelValue: number): number {\n        return pixelValue * (EXTENT / this.tileSize);\n    }\n\n    private _getClusterMaxZoom(clusterMaxZoom: number): number {\n        const effectiveClusterMaxZoom = clusterMaxZoom ? Math.round(clusterMaxZoom) : this.maxzoom - 1;\n        if (!(Number.isInteger(clusterMaxZoom) || clusterMaxZoom === undefined)) {\n            warnOnce(`Integer expected for option 'clusterMaxZoom': provided value \"${clusterMaxZoom}\" rounded to \"${effectiveClusterMaxZoom}\"`);\n        }\n        return effectiveClusterMaxZoom;\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     * @param waitForCompletion - If true, the method will return a promise that resolves when set data is complete.\n     */\n    setData(data: GeoJSON.GeoJSON | string, waitForCompletion: true): Promise<void>;\n    setData(data: GeoJSON.GeoJSON | string, waitForCompletion?: false): this;\n    setData(data: GeoJSON.GeoJSON | string, waitForCompletion?: boolean): this | Promise<void> {\n        this._data = typeof data === 'string' ? {url: data} : {geojson: data};\n        this._pendingWorkerUpdate = {data};\n        const updatePromise = this._updateWorkerData();\n        if (waitForCompletion) return updatePromise;\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     * @param waitForCompletion - If true, the method will return a promise that resolves when the update is complete.\n     */\n    updateData(diff: GeoJSONSourceDiff, waitForCompletion: true): Promise<void>;\n    updateData(diff: GeoJSONSourceDiff, waitForCompletion?: false): this;\n    updateData(diff: GeoJSONSourceDiff, waitForCompletion?: boolean): this | Promise<void> {\n        this._pendingWorkerUpdate.diff = mergeSourceDiffs(this._pendingWorkerUpdate.diff, diff);\n        const updatePromise = this._updateWorkerData();\n        if (waitForCompletion) return updatePromise;\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        if (this._data.url) {\n            await this.once('data'); // wait for loading to complete\n        }\n        if (this._data.geojson) {\n            return this._data.geojson;\n        }\n        return {\n            type: 'FeatureCollection',\n            features: Array.from(this._data.updateable.values())\n        };\n    }\n\n    /**\n     * Allows getting the source's boundaries.\n     * If there's a problem with the source's data, it will return an empty {@link LngLatBounds}.\n     * @returns a promise which resolves to the source's boundaries\n     */\n    async getBounds(): Promise<LngLatBounds> {\n        return getGeoJSONBounds(await this.getData());\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.geojsonVtOptions.cluster = options.cluster;\n        if (options.clusterRadius !== undefined) {\n            this.workerOptions.geojsonVtOptions.clusterOptions.radius = this._pixelsToTileUnits(options.clusterRadius);\n        }\n        if (options.clusterMaxZoom !== undefined) {\n            this.workerOptions.geojsonVtOptions.clusterOptions.maxZoom = this._getClusterMaxZoom(options.clusterMaxZoom);\n        }\n        this._pendingWorkerUpdate.updateCluster = true;\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<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<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     */\n    async _updateWorkerData(): Promise<void> {\n        if (this._isUpdatingWorker) return;\n\n        if (!this._hasPendingWorkerUpdate()) {\n            warnOnce(`No pending worker updates for GeoJSONSource ${this.id}.`);\n            return;\n        }\n\n        const {data, diff, updateCluster} = this._pendingWorkerUpdate;\n        // delay awaiting params until _isUpdatingWorker is set, otherwise, a race condition could happen\n        const params = this._getLoadGeoJSONParameters(data, diff, updateCluster);\n\n        if (data !== undefined) {\n            this._pendingWorkerUpdate.data = undefined;\n        } else if (diff) {\n            this._pendingWorkerUpdate.diff = undefined;\n        } else if (updateCluster) {\n            this._pendingWorkerUpdate.updateCluster = undefined;\n        }\n\n        await this._dispatchWorkerUpdate(params);\n    }\n\n    /**\n     * Create the parameters object that will be sent to the worker and used to load GeoJSON.\n     */\n    private async _getLoadGeoJSONParameters(data: string | GeoJSON.GeoJSON<GeoJSON.Geometry>, diff: GeoJSONSourceDiff, updateCluster: boolean): Promise<LoadGeoJSONParameters | undefined> {\n        const params: LoadGeoJSONParameters = extend({type: this.type}, this.workerOptions);\n\n        // Data comes from a remote url\n        if (typeof data === 'string') {\n            params.request = await this.map._requestManager.transformRequest(browser.resolveURL(data), ResourceType.Source);\n            params.request.collectResourceTiming = this._collectResourceTiming;\n            return params;\n        }\n\n        // Data is a geojson object\n        if (data !== undefined) {\n            params.data = data;\n            return params;\n        }\n\n        // Data is a differential update\n        if (diff) {\n            params.dataDiff = diff;\n            return params;\n        }\n\n        // Update supercluster with the latest worker cluster options\n        if (updateCluster) {\n            params.updateCluster = true;\n            return params;\n        }\n    }\n\n    /**\n     * Send the worker update data from the main thread to the worker\n     */\n    private async _dispatchWorkerUpdate(optionsPromise: Promise<LoadGeoJSONParameters>) {\n        this._isUpdatingWorker = true;\n        this.fire(new Event('dataloading', {dataType: 'source'}));\n\n        try {\n            const options = await optionsPromise;\n            const result = await this.actor.sendAsync({type: MessageType.loadData, data: options});\n            this._isUpdatingWorker = false;\n\n            if (this._removed || result.abandoned) {\n                this.fire(new Event('dataabort', {dataType: 'source'}));\n                return;\n            }\n\n            // Update the copy of the data in this source with the worker result. (only sent for url based geojson data)\n            if (result.data) {\n                this._data = {geojson: result.data};\n            }\n\n            const affectedGeometries = this._applyDiffToSource(options.dataDiff);\n            const shouldReloadTileOptions = this._getShouldReloadTileOptions(affectedGeometries);\n\n            const eventData = {dataType: 'source'};\n            this._applyResourceTiming(eventData, result);\n\n            // Fire the metadata event to let the TileManager know it's ok to start requesting tiles.\n            this.fire(new Event('data', {...eventData, sourceDataType: 'metadata'}));\n            this.fire(new Event('data', {...eventData, sourceDataType: 'content', shouldReloadTileOptions}));\n        } catch (err) {\n            this._isUpdatingWorker = false;\n\n            if (this._removed) {\n                this.fire(new Event('dataabort', {dataType: 'source'}));\n                return;\n            }\n\n            this.fire(new ErrorEvent(ensureError(err)));\n        } finally {\n            // If there is more pending data, update the worker again.\n            if (this._hasPendingWorkerUpdate()) {\n                this._updateWorkerData();\n            }\n        }\n    }\n\n    /**\n     * Apply resource timing data to the event object.\n     */\n    private _applyResourceTiming(eventData: {dataType: string}, result: GeoJSONWorkerSourceLoadDataResult) {\n        if (!this._collectResourceTiming) return;\n\n        const timingData = result.resourceTiming?.[this.id];\n        if (!timingData) return;\n\n        const resourceTiming = timingData.slice(0);\n        if (!resourceTiming?.length) return;\n\n        extend(eventData, {resourceTiming});\n    }\n\n    /**\n     * Apply a diff to this source's data and return the affected feature geometries.\n     * @param diff - The {@link GeoJSONSourceDiff} to apply.\n     * @returns The affected geometries, or undefined if the diff is not applicable or all geometries are affected.\n     */\n    private _applyDiffToSource(diff: GeoJSONSourceDiff): GeoJSON.Geometry[] | undefined {\n        if (!diff) {\n            return undefined;\n        }\n\n        const promoteId = typeof this.promoteId === 'string' ? this.promoteId : undefined;\n\n        // Lazily convert `this._data` to updateable if it's not already\n        if (!this._data.url && !this._data.updateable) {\n            const updateable = toUpdateable(this._data.geojson, promoteId);\n            if (!updateable) throw new Error(`GeoJSONSource \"${this.id}\": GeoJSON data is not compatible with updateData`);\n            this._data = {updateable};\n        }\n\n        if (!this._data.updateable) {\n            return undefined;\n        }\n        const affectedGeometries = applySourceDiff(this._data.updateable, diff, promoteId);\n\n        if (diff.removeAll || this._options.cluster) {\n            return undefined;\n        }\n\n        return affectedGeometries;\n    }\n\n    /**\n     * Get options for use in determining whether to reload a tile based on the modified features.\n     * @param affectedGeometries - The feature geometries affected by the update.\n     * @returns A {@link GeoJSONSourceShouldReloadTileOptions} object which contains an array of affected bounds caused by the update.\n     */\n    private _getShouldReloadTileOptions(affectedGeometries: GeoJSON.Geometry[]): GeoJSONSourceShouldReloadTileOptions | undefined {\n        if (!affectedGeometries) return undefined;\n\n        const affectedBounds = affectedGeometries\n            .filter(Boolean)\n            .map(g => getGeoJSONBounds(g));\n\n        return {affectedBounds};\n    }\n\n    /**\n     * Determine whether a tile should be reloaded based on a set of options associated with a {@link MapSourceDataChangedEvent}.\n     * @internal\n     */\n    shouldReloadTile(tile: Tile, {affectedBounds}: GeoJSONSourceShouldReloadTileOptions) : boolean {\n        if (tile.state === 'loading') {\n            return true;\n        }\n        if (tile.state === 'unloaded') {\n            return false;\n        }\n\n        // Update the tile if contained or will contain an updated feature.\n        const {buffer, extent} = this.workerOptions.geojsonVtOptions;\n        const tileBounds = tileIdToLngLatBounds(\n            tile.tileID.canonical,\n            buffer / extent\n        );\n        for (const bounds of affectedBounds) {\n            if (tileBounds.intersects(bounds)) {\n                return true;\n            }\n        }\n\n        return false;\n    }\n\n    loaded(): boolean {\n        return !this._isUpdatingWorker && !this._hasPendingWorkerUpdate();\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: WorkerTileParameters = {\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            subdivisionGranularity: this.map.style.projection.subdivisionGranularity\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.updateable ?\n                {\n                    type: 'FeatureCollection',\n                    features: Array.from(this._data.updateable.values())\n                } :\n                this._data.url || this._data.geojson\n        });\n    }\n\n    hasTransition() {\n        return false;\n    }\n}\n", "import {latFromMercatorY, lngFromMercatorX} from '../geo/mercator_coordinate';\nimport {LngLatBounds} from '../geo/lng_lat_bounds';\nimport type {CanonicalTileID} from './tile_id';\n\nexport function tileIdToLngLatBounds(\n    {x,y,z}: CanonicalTileID,\n    buffer: number = 0,\n): LngLatBounds {\n    const lngMin = lngFromMercatorX((x - buffer) / Math.pow(2, z));\n    const latMin = latFromMercatorY((y + 1 + buffer) / Math.pow(2, z));\n\n    const lngMax = lngFromMercatorX((x + 1 + buffer) / Math.pow(2, z));\n    const latMax = latFromMercatorY((y - buffer) / Math.pow(2, z));\n\n    return new LngLatBounds([lngMin, latMin], [lngMax, latMax]);\n}\n", "import {CanonicalTileID} from '../tile/tile_id';\nimport {Event, ErrorEvent, Evented} from '../util/evented';\nimport {ImageRequest} from '../util/image_request';\nimport {ResourceType} from '../util/request_manager';\nimport {Texture} from '../webgl/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/tile';\nimport type {\n    ImageSourceSpecification,\n    VideoSourceSpecification\n} from '@maplibre/maplibre-gl-style-spec';\nimport type Point from '@mapbox/point-geometry';\nimport {ensureError, MAX_TILE_ZOOM} from '../util/util';\nimport {Bounds} from '../geo/bounds';\nimport {isAbortError} from '../util/abort_error';\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\nexport type CanonicalTileRange = {\n    minTileY: number;\n    maxTileY: number;\n\n    /**\n     * Image can exceed the boundary of a single \"world\" (tile 0/0/0),\n     * so we need to know the tile range for wrapping.\n     */\n    minTileXWrapped: number;\n    maxTileXWrapped: number;\n    minWrap: number;\n    maxWrap: number;\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     * This object is used to store the range of terrain tiles that overlap with this tile.\n     * It is relevant for image tiles, as the image exceeds single tile boundaries.\n     */\n    terrainTileRanges: {[zoom: string]: CanonicalTileRange};\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    tileCoords: Point[];\n    flippedWindingOrder: boolean = false;\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(await this.map._requestManager.transformRequest(this.url, ResourceType.Image), this._request);\n            this._request = null;\n            this._loaded = true;\n\n            if (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            if (!isAbortError(err)) {\n                this.fire(new ErrorEvent(ensureError(err)));\n            }\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        // Compute tiles overlapping with the image. We need to know for which\n        // terrain tiles we have to render the image.\n        this.terrainTileRanges = this._getOverlappingTileRanges(cornerCoords);\n\n        // Constrain min/max zoom to our tile's zoom level in order to force\n        // TileManager 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        this.tileCoords = cornerCoords.map((coord) => this.tileID.getTilePoint(coord)._round());\n        this.flippedWindingOrder = hasWrongWindingOrder(this.tileCoords);\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.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?.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     * Given a list of coordinates, determine overlapping tile ranges for all zoom levels.\n     *\n     * @returns Overlapping tile ranges for all zoom levels.\n     * @internal\n     */\n    private _getOverlappingTileRanges(\n        coords: MercatorCoordinate[]\n    ): {[zoom: string]: CanonicalTileRange} {\n        const {minX, minY, maxX, maxY} = Bounds.fromPoints(coords);\n\n        const ranges: {[zoom: string]: CanonicalTileRange} = {};\n\n        for (let z = 0; z <= MAX_TILE_ZOOM; z++) {\n            const tilesAtZoom = Math.pow(2, z);\n            const minTileX = Math.floor(minX * tilesAtZoom);\n            const minTileY = Math.floor(minY * tilesAtZoom);\n            const maxTileX = Math.floor(maxX * tilesAtZoom);\n            const maxTileY = Math.floor(maxY * tilesAtZoom);\n\n            const minTileXWrapped = ((minTileX % tilesAtZoom) + tilesAtZoom) % tilesAtZoom;\n            const maxTileXWrapped = maxTileX % tilesAtZoom;\n            const minWrap = Math.floor(minTileX / tilesAtZoom);\n            const maxWrap = Math.floor(maxTileX / tilesAtZoom);\n\n            ranges[z] = {\n                minWrap,\n                maxWrap,\n                minTileXWrapped,\n                maxTileXWrapped,\n                minTileY,\n                maxTileY\n            };\n        }\n\n        return ranges;\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: MercatorCoordinate[]) {\n    const bounds = Bounds.fromPoints(coords);\n\n    const dx = bounds.width();\n    const dy = bounds.height();\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((bounds.minX + bounds.maxX) / 2 * tilesAtZoom),\n        Math.floor((bounds.minY + bounds.maxY) / 2 * tilesAtZoom));\n}\n\nfunction hasWrongWindingOrder(coords: Point[]) {\n    const e0x = coords[1].x - coords[0].x;\n    const e0y = coords[1].y - coords[0].y;\n    const e1x = coords[2].x - coords[0].x;\n    const e1y = coords[2].y - coords[0].y;\n\n    const crossProduct = e0x * e1y - e0y * e1x;\n\n    return crossProduct < 0;\n}\n", "import {getVideo} from '../util/ajax';\nimport {ResourceType} from '../util/request_manager';\n\nimport {ImageSource} from './image_source';\nimport {Texture} from '../webgl/texture';\nimport {Event, ErrorEvent} from '../util/evented';\nimport {ensureError} from '../util/util';\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: string[];\n    video: HTMLVideoElement;\n    roundZoom: boolean;\n\n    private _onPlayingHandler = () => {\n        this.map?.triggerRepaint();\n    };\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((await 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', this._onPlayingHandler);\n\n            if (this.map) {\n                this.video.play();\n            }\n\n            this._finishLoading();\n        } catch (err) {\n            this.fire(new ErrorEvent(ensureError(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    onRemove() {\n        super.onRemove();\n        if (this.video) {\n            this.video.removeEventListener('playing', this._onPlayingHandler);\n            this.video.pause();\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.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 {Texture} from '../webgl/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        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        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.texture) {\n            this.texture = new Texture(context, this.canvas, gl.RGBA, {premultiply: true});\n            this.texture.bind(gl.LINEAR, gl.CLAMP_TO_EDGE);\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            animate: this.animate,\n            canvas: this.options.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, type GeoJSONSourceShouldReloadTileOptions} from '../source/geojson_source';\nimport {VideoSource} from '../source/video_source';\nimport {ImageSource} from '../source/image_source';\nimport {CanvasSource} from '../source/canvas_source';\nimport {type 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/tile';\nimport type {OverscaledTileID, CanonicalTileID} from '../tile/tile_id';\nimport type {LoadTileResult} from '../source/vector_tile_source';\nimport type {CanvasSourceSpecification} from '../source/canvas_source';\nimport {type CalculateTileZoomFunction} from '../geo/projection/covering_tiles';\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?: 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<LoadTileResult | 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     * Optional function to redefine how tiles are loaded at high pitch angles.\n     */\n    calculateTileZoom?: CalculateTileZoomFunction;\n    /**\n     * Optional function to determine whether a tile should be reloaded, given a\n     * set of options associated with a `MapSourceDataChangedEvent`.\n     * @internal\n     */\n    shouldReloadTile?(tile: Tile, options: GeoJSONSourceShouldReloadTileOptions): boolean;\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 {type RTLPluginStatus, RTLPluginLoadedEventName, type PluginState} from './rtl_text_plugin_status';\nimport {type 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    rtlMainThreadPlugin ||= new RTLMainThreadPlugin();\n    return rtlMainThreadPlugin;\n}\n", "import {uniqueId, parseCacheControl} from '../util/util';\nimport {deserialize as deserializeBucket} from '../data/bucket';\nimport {GEOJSON_TILE_LAYER_NAME, type FeatureIndex, type QueryResults} 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 '../webgl/texture';\nimport {now} from '../util/time_control';\nimport {toEvaluationFeature} from '../data/evaluation_feature';\nimport {EvaluationParameters} from '../style/evaluation_parameters';\nimport {rtlMainThreadPluginFactory} from '../source/rtl_text_plugin_main_thread';\n\nconst CLOCK_SKEW_RETRY_TIMEOUT = 30000;\n\nimport type {SourceFeatureState} from '../source/source_state';\nimport type {Bucket} from '../data/bucket';\nimport type {StyleLayer} from '../style/style_layer';\nimport type {WorkerTileResult} from '../source/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 '../webgl/context';\nimport type {OverscaledTileID} from './tile_id';\nimport type {Framebuffer} from '../webgl/framebuffer';\nimport type {IReadonlyTransform} from '../geo/transform_interface';\nimport type {LayerFeatureStates} from '../source/source_state';\nimport type Point from '@mapbox/point-geometry';\nimport type {mat4} from 'gl-matrix';\nimport type {ExpiryData} from '../util/ajax';\nimport type {QueryRenderedFeaturesOptionsStrict, QuerySourceFeatureOptionsStrict} from '../source/query_features';\nimport type {DashEntry} from '../render/line_atlas';\nimport type {VectorTileLayerLike} from '@maplibre/vt-pbf';\nimport type {Painter} from '../render/painter';\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/** @internal */\ntype CrossFadeArgs = {\n    fadingRole: FadingRoles;\n    fadingDirection: FadingDirections;\n    fadingParentID?: OverscaledTileID;\n    fadeEndTime: number;\n};\n\nexport enum FadingRoles {\n    Base, Parent\n}\nexport enum FadingDirections {\n    Departing, Incoming\n}\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 | null;\n    latestRawTileData: ArrayBuffer;\n    latestEncoding: string;\n    imageAtlas: ImageAtlas;\n    imageAtlasTexture: Texture;\n    dashPositions: {[_: string]: DashEntry};\n    glyphAtlasImage: AlphaImage;\n    glyphAtlasTexture: Texture;\n    etag?: string;\n    expirationTime: any;\n    expiredRequestCount: number;\n    state: TileState;\n    fadingRole: FadingRoles;\n    fadingDirection: FadingDirections;\n    fadingParentID: OverscaledTileID;\n    selfFading: boolean;\n    timeAdded: number = 0;\n    fadeEndTime: number = 0;\n    fadeOpacity: number = 1;\n    collisionBoxArray: CollisionBoxArray;\n    redoWhenDone: boolean;\n    showCollisionBoxes: boolean;\n    placementSource: any;\n    actor: Actor;\n    vtLayers: {[_: string]: VectorTileLayerLike};\n\n    neighboringTiles: Record<string, {backfilled: boolean}>;\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: 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    rttFingerprint: {[sourceId: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.rttFingerprint = {};\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    isRenderable(symbolLayer: boolean): boolean {\n        return (\n            this.hasData() &&\n            (!this.fadeEndTime || this.fadeOpacity > 0) &&  // raster fading\n            (symbolLayer || !this.holdingForSymbolFade())   // symbol fading\n        );\n    }\n\n    /**\n     * @internal\n     * Many-to-one crossfade between a base tile and parent/ancestor tile (when zooming)\n     */\n    setCrossFadeLogic({fadingRole, fadingDirection, fadingParentID, fadeEndTime}: CrossFadeArgs) {\n        this.resetFadeLogic();\n\n        this.fadingRole = fadingRole;\n        this.fadingDirection = fadingDirection;\n        this.fadingParentID = fadingParentID;\n        this.fadeEndTime = fadeEndTime;\n    }\n\n    /**\n     * Self fading for edge tiles (when panning map)\n     */\n    setSelfFadeLogic(fadeEndTime: number) {\n        this.resetFadeLogic();\n        this.selfFading = true;\n        this.fadeEndTime = fadeEndTime;\n    }\n\n    resetFadeLogic() {\n        this.fadingRole = null;\n        this.fadingDirection = null;\n        this.fadingParentID = null;\n        this.selfFading = false;\n\n        this.timeAdded = now();\n        this.fadeEndTime = 0;\n        this.fadeOpacity = 1;\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: Painter, justReloaded?: boolean | null) {\n        if (data?.etagUnmodified === true) {\n            this.state = 'loaded';\n            return;\n        }\n\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.latestEncoding = data.encoding;\n                this.latestFeatureIndex.rawTileData = data.rawTileData;\n                this.latestFeatureIndex.encoding = data.encoding;\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                this.latestFeatureIndex.encoding = this.latestEncoding;\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        this.dashPositions = data.dashPositions;\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.glyphAtlasTexture) {\n            this.glyphAtlasTexture.destroy();\n        }\n        \n        this.imageAtlas = null;\n        this.dashPositions = null;\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: Point[],\n        cameraQueryGeometry: Point[],\n        scale: number,\n        params: Pick<QueryRenderedFeaturesOptionsStrict, 'filter' | 'layers' | 'availableImages'> | undefined,\n        transform: IReadonlyTransform,\n        maxPitchScaleFactor: number,\n        pixelPosMatrix: mat4,\n        getElevation: undefined | ((x: number, y: number) => number)\n    ): QueryResults {\n        if (!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            getElevation\n        }, layers, serializedLayers, sourceFeatureState);\n    }\n\n    querySourceFeatures(result: GeoJSONFeature[], params?: QuerySourceFeatureOptionsStrict) {\n        const featureIndex = this.latestFeatureIndex;\n        if (!featureIndex?.rawTileData) return;\n\n        const vtLayers = featureIndex.loadVTLayers();\n\n        const sourceLayer = params?.sourceLayer ? params.sourceLayer : '';\n        const layer = vtLayers[GEOJSON_TILE_LAYER_NAME] || vtLayers[sourceLayer];\n\n        if (!layer) return;\n\n        const filter = featureFilter(params?.filter, params?.globalState);\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?.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'] || GEOJSON_TILE_LAYER_NAME;\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?.patternPositions || {}, this.dashPositions || {});\n            const layer = painter?.style?.getLayer(id);\n            if (layer) {\n                this.queryPadding = Math.max(this.queryPadding, layer.queryRadius(bucket));\n            }\n        }\n    }\n\n    holdingForSymbolFade(): boolean {\n        return this.symbolFadeHoldUntil !== undefined;\n    }\n\n    symbolFadeFinished(): boolean {\n        return !this.symbolFadeHoldUntil || this.symbolFadeHoldUntil < now();\n    }\n\n    clearSymbolFadeHold() {\n        this.symbolFadeHoldUntil = undefined;\n    }\n\n    setSymbolHoldDuration(duration: number) {\n        this.symbolFadeHoldUntil = now() + duration;\n    }\n\n    setDependencies(namespace: string, dependencies: 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: string[], keys: 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 '../webgl/context';\nimport type {FeatureStates} from '../source/source_state';\nimport type {ImagePosition} from '../render/image_atlas';\nimport type {CanonicalTileID} from '../tile/tile_id';\nimport type Point from '@mapbox/point-geometry';\nimport type {SubdivisionGranularitySetting} from '../render/subdivision_granularity_settings';\nimport type {DashEntry} from '../render/line_atlas';\nimport type {Feature as StyleFeature} from '@maplibre/maplibre-gl-style-spec';\nimport type {VectorTileFeatureLike, VectorTileLayerLike} from '@maplibre/vt-pbf';\n\nexport type BucketParameters<Layer extends TypedStyleLayer> = {\n    index: number;\n    layers: 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    dashDependencies: Record<string, {round: boolean; dasharray: number[]}>;\n    availableImages: string[];\n    subdivisionGranularity: SubdivisionGranularitySetting;\n};\n\nexport type IndexedFeature = {\n    feature: VectorTileFeatureLike;\n    id: number | string;\n    index: number;\n    sourceLayerIndex: number;\n};\n\nexport type BucketFeature = {\n    index: number;\n    sourceLayerIndex: number;\n    geometry: 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    readonly dashes?: NonNullable<StyleFeature['dashes']>;\n    sortKey?: number;\n};\n\n/**\n * @hidden\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: string[];\n    hasDependencies: boolean;\n    readonly layers: any[];\n    readonly stateDependentLayers: any[];\n    readonly stateDependentLayerIds: string[];\n    populate(features: IndexedFeature[], options: PopulateParameters, canonical: CanonicalTileID): void;\n    update(states: FeatureStates, vtLayer: VectorTileLayerLike, imagePositions: {[_: string]: ImagePosition}, dashPositions: Record<string, DashEntry>): 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: 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 {extend} from '../util/util';\nimport type {Tile} from '../tile/tile';\nimport type {FeatureState} from '@maplibre/maplibre-gl-style-spec';\nimport type {InViewTiles} from '../tile/tile_manager_in_view_tiles';\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    revision: number;\n\n    constructor() {\n        this.state = {};\n        this.stateChanges = {};\n        this.deletedStates = {};\n        this.revision = 0;\n    }\n\n    updateState(sourceLayer: string, featureId: number | string, newState: any) {\n        const feature = String(featureId);\n        this.stateChanges[sourceLayer] ||= {};\n        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]?.[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]?.[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] ||= {};\n\n        if (key && featureId !== undefined) {\n            if (this.deletedStates[sourceLayer][feature] !== null) {\n                this.deletedStates[sourceLayer][feature] ||= {};\n                this.deletedStates[sourceLayer][feature][key] = null;\n            }\n        } else if (featureId !== undefined) {\n            const updateInQueue = 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(inViewTiles: InViewTiles, 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] ||= {};\n            const layerStates = {};\n            for (const feature in this.stateChanges[sourceLayer]) {\n                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] ||= {};\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] ||= {};\n            extend(featuresChanged[sourceLayer], layerStates);\n        }\n\n        this.stateChanges = {};\n        this.deletedStates = {};\n\n        if (Object.keys(featuresChanged).length === 0) return;\n\n        this.revision++;\n\n        inViewTiles.setFeatureState(featuresChanged, painter);\n    }\n}\n", "import {mat4} from 'gl-matrix';\nimport {EXTENT} from '../../data/extent';\nimport {clamp, degreesToRadians, MAX_VALID_LATITUDE, zoomScale} from '../../util/util';\nimport {MercatorCoordinate, mercatorXfromLng, mercatorYfromLat, mercatorZfromAltitude} from '../mercator_coordinate';\nimport Point from '@mapbox/point-geometry';\nimport type {UnwrappedTileIDType} from '../transform_helper';\nimport type {LngLat} from '../lng_lat';\n\n/*\n* The maximum angle to use for the Mercator horizon. This must be less than 90\n* to prevent errors in `MercatorTransform::_calcMatrices()`. It shouldn't be too close\n* to 90, or the distance to the horizon will become very large, unnecessarily increasing\n* the number of tiles needed to render the map.\n*/\nexport const maxMercatorHorizonAngle = 89.25;\n\n/**\n * Returns mercator coordinates in range 0..1 for given coordinates inside a specified tile.\n * @param inTileX - X coordinate in tile units - range [0..EXTENT].\n * @param inTileY - Y coordinate in tile units - range [0..EXTENT].\n * @param canonicalTileID - Tile canonical ID - mercator X, Y and zoom.\n * @returns Mercator coordinates of the specified point in range [0..1].\n */\nexport function tileCoordinatesToMercatorCoordinates(inTileX: number, inTileY: number, canonicalTileID: {x: number; y: number; z: number}): MercatorCoordinate {\n    const scale = 1.0 / (1 << canonicalTileID.z);\n    return new MercatorCoordinate(\n        inTileX / EXTENT * scale + canonicalTileID.x * scale,\n        inTileY / EXTENT * scale + canonicalTileID.y * scale\n    );\n}\n\n/**\n * Returns LngLat for given in-tile coordinates and tile ID.\n * @param inTileX - X coordinate in tile units - range [0..EXTENT].\n * @param inTileY - Y coordinate in tile units - range [0..EXTENT].\n * @param canonicalTileID - Tile canonical ID - mercator X, Y and zoom.\n */\nexport function tileCoordinatesToLocation(inTileX: number, inTileY: number, canonicalTileID: {x: number; y: number; z: number}): LngLat {\n    return tileCoordinatesToMercatorCoordinates(inTileX, inTileY, canonicalTileID).toLngLat();\n}\n\n/**\n * Convert from LngLat to world coordinates (Mercator coordinates scaled by world size).\n * @param worldSize - Mercator world size computed from zoom level and tile size.\n * @param lnglat - The location to convert.\n * @returns Point\n */\nexport function projectToWorldCoordinates(worldSize: number, lnglat: LngLat): Point {\n    const lat = clamp(lnglat.lat, -MAX_VALID_LATITUDE, MAX_VALID_LATITUDE);\n    return new Point(\n        mercatorXfromLng(lnglat.lng) * worldSize,\n        mercatorYfromLat(lat) * worldSize);\n}\n\n/**\n * Convert from world coordinates (mercator coordinates scaled by world size) to LngLat.\n * @param worldSize - Mercator world size computed from zoom level and tile size.\n * @param point - World coordinate.\n * @returns LngLat\n */\nexport function unprojectFromWorldCoordinates(worldSize: number, point: Point): LngLat {\n    return new MercatorCoordinate(point.x / worldSize, point.y / worldSize).toLngLat();\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 */\nexport function getMercatorHorizon(transform: {pitch: number; cameraToCenterDistance: number}): number {\n    return transform.cameraToCenterDistance * Math.min(Math.tan(degreesToRadians(90 - transform.pitch)) * 0.85,\n        Math.tan(degreesToRadians(maxMercatorHorizonAngle - transform.pitch)));\n}\n\nexport function calculateTileMatrix(unwrappedTileID: UnwrappedTileIDType, worldSize: number): mat4 {\n    const canonical = unwrappedTileID.canonical;\n    const scale = worldSize / 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\nexport function cameraMercatorCoordinateFromCenterAndRotation(center: LngLat, elevation: number, pitch: number, bearing: number, distance: number): MercatorCoordinate {\n    const centerMercator = MercatorCoordinate.fromLngLat(center, elevation);\n    const mercUnitsPerMeter = mercatorZfromAltitude(1, center.lat);\n    const dMercator = distance * mercUnitsPerMeter;\n    const {x, y, z} = cameraDirectionFromPitchBearing(pitch, bearing);\n    const dxMercator = dMercator * -x;\n    const dyMercator = dMercator * -y;\n    const dzMercator = dMercator * -z;\n    return new MercatorCoordinate(centerMercator.x + dxMercator, centerMercator.y + dyMercator, centerMercator.z + dzMercator);\n}\n\nexport function cameraDirectionFromPitchBearing(pitch: number, bearing: number): {x: number; y: number; z: number} {\n    const pitchRadians = degreesToRadians(pitch);\n    const bearingRadians = degreesToRadians(bearing);\n    const z = Math.cos(-pitchRadians);\n    const h = Math.sin(pitchRadians);\n    const x = h * Math.sin(bearingRadians);\n    const y = -h * Math.cos(bearingRadians);\n    return {x, y, z};\n}\n", "import {OverscaledTileID} from '../../tile/tile_id';\nimport {vec2, type vec4} from 'gl-matrix';\nimport {MercatorCoordinate} from '../mercator_coordinate';\nimport {degreesToRadians, scaleZoom} from '../../util/util';\n\nimport type {IReadonlyTransform} from '../transform_interface';\nimport type {Terrain} from '../../render/terrain';\nimport type {Frustum} from '../../util/primitives/frustum';\nimport {maxMercatorHorizonAngle} from './mercator_utils';\nimport {type IBoundingVolume, IntersectionResult} from '../../util/primitives/bounding_volume';\n\ntype CoveringTilesResult = {\n    tileID: OverscaledTileID;\n    distanceSq: number;\n    tileDistanceToCamera: number;\n};\n\ntype CoveringTilesStackEntry = {\n    zoom: number;\n    x: number;\n    y: number;\n    wrap: number;\n    fullyVisible: boolean;\n};\n\nexport type CoveringTilesOptions = {\n    /**\n     * Smallest allowed tile zoom.\n     */\n    minzoom?: number;\n    /**\n     * Largest allowed tile zoom.\n     */\n    maxzoom?: number;\n    /**\n     * Whether to round or floor the 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};\n\nexport type CoveringTilesOptionsInternal = CoveringTilesOptions & {\n    /**\n     * `true` if tiles should be sent back to the worker for each overzoomed zoom level, `false` if not.\n     * Fill this option when computing covering tiles for a source.\n     * When true, any tile at `maxzoom` level that should be overscaled to a greater zoom will have\n     * its zoom set to the overscaled greater zoom. When false, such tiles will have zoom set to `maxzoom`.\n     */\n    reparseOverscaled?: boolean;\n    /**\n     * When terrain is present, tile visibility will be computed in regards to the min and max elevations for each tile.\n     */\n    terrain?: Terrain;\n    /**\n     * Optional function to redefine how tiles are loaded at high pitch angles.\n     */\n    calculateTileZoom?: CalculateTileZoomFunction;\n};\n\n/**\n * Function to define how tiles are loaded at high pitch angles\n * @param requestedCenterZoom - the requested zoom level, valid at the center point.\n * @param distanceToTile2D - 2D distance from the camera to the candidate tile, in mercator units.\n * @param distanceToTileZ - vertical distance from the camera to the candidate tile, in mercator units.\n * @param distanceToCenter3D - distance from camera to center point, in mercator units\n * @param cameraVerticalFOV - camera vertical field of view, in degrees\n * @return the desired zoom level for this tile. May not be an integer.\n */\nexport type CalculateTileZoomFunction = (requestedCenterZoom: number,\n    distanceToTile2D: number,\n    distanceToTileZ: number,\n    distanceToCenter3D: number,\n    cameraVerticalFOV: number) => number;\n\n/**\n * A simple/heuristic function that returns whether the tile is visible under the current transform.\n * @returns an {@link IntersectionResult}.\n */\nexport function isTileVisible(frustum: Frustum, tileBoundingVolume: IBoundingVolume, plane?: vec4): IntersectionResult {\n    const frustumTest = tileBoundingVolume.intersectsFrustum(frustum);\n    if (!plane || frustumTest === IntersectionResult.None) {\n        return frustumTest;\n    }\n    const planeTest = tileBoundingVolume.intersectsPlane(plane);\n\n    if (planeTest === IntersectionResult.None) {\n        return IntersectionResult.None;\n    }\n\n    if (frustumTest === IntersectionResult.Full && planeTest === IntersectionResult.Full) {\n        return IntersectionResult.Full;\n    }\n\n    return IntersectionResult.Partial;\n}\n\n/**\n * Definite integral of cos(x)^p. The analytical solution is described in `developer-guides/covering-tiles.md`,\n * but here the integral is evaluated numerically.\n * @param p - the power to raise cos(x) to inside the integral\n * @param x1 - the starting point of the integral.\n * @param x2 - the ending point of the integral.\n * @return the integral of cos(x)^p from x=x1 to x=x2\n */\nfunction integralOfCosXByP(p: number, x1: number, x2: number): number {\n    const numPoints = 10;\n    let sum = 0;\n    const dx = (x2 - x1 ) / numPoints;\n    // Midpoint integration\n    for( let i = 0; i < numPoints; i++)\n    {\n        const x = x1 + (i + 0.5)/numPoints * (x2 - x1);\n        sum += dx * Math.pow(Math.cos(x), p);\n    }\n    return sum;\n}\n\nexport function createCalculateTileZoomFunction(maxZoomLevelsOnScreen: number, tileCountMaxMinRatio: number): CalculateTileZoomFunction {\n    return function (requestedCenterZoom: number,\n        distanceToTile2D: number,\n        distanceToTileZ: number,\n        distanceToCenter3D: number,\n        cameraVerticalFOV: number): number {\n        /**\n        * Controls how tiles are loaded at high pitch angles. Higher numbers cause fewer, lower resolution\n        * tiles to be loaded. Calculate the value that will result in the selected number of zoom levels in\n        * the worst-case condition (when the horizon is at the top of the screen). For more information, see\n        * `developer-guides/covering-tiles.md`\n        */\n        const pitchTileLoadingBehavior = 2 * ((maxZoomLevelsOnScreen - 1) /\n            scaleZoom(Math.cos(degreesToRadians(maxMercatorHorizonAngle - cameraVerticalFOV)) /\n                Math.cos(degreesToRadians(maxMercatorHorizonAngle))) - 1);\n\n        const centerPitch = Math.acos(distanceToTileZ / distanceToCenter3D);\n        const tileCountPitch0 = 2 * integralOfCosXByP(pitchTileLoadingBehavior - 1, 0, degreesToRadians(cameraVerticalFOV / 2));\n        const highestPitch = Math.min(degreesToRadians(maxMercatorHorizonAngle), centerPitch + degreesToRadians(cameraVerticalFOV / 2));\n        const lowestPitch = Math.min(highestPitch, centerPitch - degreesToRadians(cameraVerticalFOV / 2));\n        const tileCount = integralOfCosXByP(pitchTileLoadingBehavior - 1, lowestPitch, highestPitch);\n        const thisTilePitch = Math.atan(distanceToTile2D / distanceToTileZ);\n        const distanceToTile3D = Math.hypot(distanceToTile2D, distanceToTileZ);\n\n        let thisTileDesiredZ = requestedCenterZoom;\n        // if distance to candidate tile is a tiny bit farther than distance to center,\n        // use the same zoom as the center. This is achieved by the scaling distance ratio by cos(fov/2)\n        thisTileDesiredZ = thisTileDesiredZ + scaleZoom(distanceToCenter3D / distanceToTile3D / Math.max(0.5, Math.cos(degreesToRadians(cameraVerticalFOV / 2))));\n        thisTileDesiredZ += pitchTileLoadingBehavior * scaleZoom(Math.cos(thisTilePitch)) / 2;\n        thisTileDesiredZ -= scaleZoom(Math.max(1, tileCount / tileCountPitch0 / tileCountMaxMinRatio)) / 2;\n        return thisTileDesiredZ;\n    };\n}\nconst defaultMaxZoomLevelsOnScreen = 9.314;\nconst defaultTileCountMaxMinRatio = 3.0;\nconst defaultCalculateTileZoom = createCalculateTileZoomFunction(defaultMaxZoomLevelsOnScreen, defaultTileCountMaxMinRatio);\n\n/**\n * Return what zoom level of a tile source would most closely cover the tiles displayed by this transform.\n * @param options - The options, most importantly the source's tile size.\n * @returns An integer zoom level at which all tiles will be visible.\n */\nexport function coveringZoomLevel(transform: IReadonlyTransform, options: CoveringTilesOptions): number {\n    const z = (options.roundZoom ? Math.round : Math.floor)(\n        transform.zoom + scaleZoom(transform.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 * Returns a list of tiles that optimally covers the screen. Adapted for globe projection.\n * Correctly handles LOD when moving over the antimeridian.\n * @param transform - The transform instance.\n * @param frustum - The covering frustum.\n * @param plane - The clipping plane used by globe transform, or null.\n * @param cameraCoord - The x, y, z position of the camera in MercatorCoordinates.\n * @param centerCoord - The x, y, z position of the center point in MercatorCoordinates.\n * @param options - Additional coveringTiles options.\n * @param details - Interface to define required helper functions.\n * @returns A list of tile coordinates, ordered by ascending distance from camera.\n */\nexport function coveringTiles(transform: IReadonlyTransform, options: CoveringTilesOptionsInternal): OverscaledTileID[] {\n    const frustum = transform.getCameraFrustum();\n    const plane = transform.getClippingPlane();\n    const cameraCoord = transform.screenPointToMercatorCoordinate(transform.getCameraPoint());\n    const centerCoord = MercatorCoordinate.fromLngLat(transform.center, transform.elevation);\n    cameraCoord.z = centerCoord.z + Math.cos(transform.pitchInRadians) * transform.cameraToCenterDistance / transform.worldSize;\n    const detailsProvider = transform.getCoveringTilesDetailsProvider();\n    const allowVariableZoom = detailsProvider.allowVariableZoom(transform, options);\n    \n    const desiredZ = coveringZoomLevel(transform, options);\n    const minZoom = options.minzoom || 0;\n    const maxZoom = options.maxzoom !== undefined ? options.maxzoom : transform.maxZoom;\n    const nominalZ = Math.min(Math.max(0, desiredZ), maxZoom);\n\n    const numTiles = Math.pow(2, nominalZ);\n    const cameraPoint = [numTiles * cameraCoord.x, numTiles * cameraCoord.y, 0];\n    const centerPoint = [numTiles * centerCoord.x, numTiles * centerCoord.y, 0];\n    const distanceToCenter2d = Math.hypot(centerCoord.x - cameraCoord.x, centerCoord.y - cameraCoord.y);\n    const distanceZ = Math.abs(centerCoord.z - cameraCoord.z);\n    const distanceToCenter3d = Math.hypot(distanceToCenter2d, distanceZ);\n\n    const newRootTile = (wrap: number): CoveringTilesStackEntry => {\n        return {\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: CoveringTilesStackEntry[] = [];\n    const result: CoveringTilesResult[] = [];\n\n    if (transform.renderWorldCopies && detailsProvider.allowWorldCopies()) {\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        const tileID = {x, y, z: it.zoom};\n        const boundingVolume = detailsProvider.getTileBoundingVolume(tileID, it.wrap, transform.elevation, options);\n\n        // Visibility of a tile is not required if any of its ancestor is fully visible\n        if (!fullyVisible) {\n            const intersectResult = isTileVisible(frustum, boundingVolume, plane);\n\n            if (intersectResult === IntersectionResult.None)\n                continue;\n\n            fullyVisible = intersectResult === IntersectionResult.Full;\n        }\n\n        const distToTile2d = detailsProvider.distanceToTile2d(cameraCoord.x, cameraCoord.y, tileID, boundingVolume);\n\n        let thisTileDesiredZ = desiredZ;\n        if (allowVariableZoom) {\n            const tileZoomFunc = options.calculateTileZoom || defaultCalculateTileZoom;\n            thisTileDesiredZ = tileZoomFunc(transform.zoom + scaleZoom(transform.tileSize / options.tileSize),\n                distToTile2d,\n                distanceZ,\n                distanceToCenter3d,\n                transform.fov);\n        }\n        thisTileDesiredZ = (options.roundZoom ? Math.round : Math.floor)(thisTileDesiredZ);\n        thisTileDesiredZ = Math.max(0, thisTileDesiredZ);\n        const z = Math.min(thisTileDesiredZ, maxZoom);\n\n        // We need to compute a valid wrap value for the tile to keep globe compatibility with mercator\n        it.wrap = detailsProvider.getWrap(centerCoord, tileID, it.wrap);\n\n        // Have we reached the target depth?\n        if (it.zoom >= z) {\n            if (it.zoom < minZoom) {\n                continue;\n            }\n            const dz = nominalZ - it.zoom;\n            const dx = cameraPoint[0] - 0.5 - (x << dz);\n            const dy = cameraPoint[1] - 0.5 - (y << dz);\n            const overscaledZ = options.reparseOverscaled ? Math.max(it.zoom, thisTileDesiredZ) : it.zoom;\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            stack.push({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", "import Point from '@mapbox/point-geometry';\nimport {Bounds, type ReadOnlyBounds} from '../geo/bounds';\nimport {EXTENT} from './extent';\n\n/**\n * The bounding box covering the entire extent of a tile.\n */\nexport const EXTENT_BOUNDS = Bounds.fromPoints([new Point(0, 0), new Point(EXTENT, EXTENT)]) as ReadOnlyBounds;", "import {now} from '../util/time_control';\nimport {getEdgeTiles} from '../util/util';\nimport {FadingDirections, FadingRoles, type Tile} from './tile';\nimport {type OverscaledTileID} from './tile_id';\nimport {type InViewTiles} from './tile_manager_in_view_tiles';\n\nexport function isRasterType(type: string): boolean {\n    return type === 'raster' || type === 'image' || type === 'video';\n}\n\n/**\n * Designate fading bases and parents using a many-to-one relationship where the lower children fade in/out\n * with their parents. Raster shaders are not currently designed for a one-to-many fade relationship.\n *\n * Tiles that are candidates for fading out must be loaded and rendered tiles, as loading a tile to then\n * fade it out would not appear smoothly. The first source of truth for tile fading always starts at the\n * ideal tile, which continually changes on map adjustment. The state of the previously rendered ideal\n * tile plane indicates which direction to fade each part of the newer ideal plane (with varying z).\n *\n * For a pitched map, the back of the map can have decreasing zooms while the front can have increasing zooms.\n * Fade logic must therefore adapt dynamically based on the previously rendered ideal tile set.\n */\nexport function updateFadingTiles(\n    inViewTiles: InViewTiles,\n    idealTileIDs: OverscaledTileID[], \n    retain: Record<string, OverscaledTileID>,\n    maxFadingAncestorLevels: number,\n    sourceMinZoom: number,\n    sourceMaxZoom: number,\n    rasterFadeDuration: number) {\n    const currentTime: number = now();\n    const edgeTileIDs: Set<OverscaledTileID> = getEdgeTiles(idealTileIDs);\n\n    for (const idealID of idealTileIDs) {\n        const idealTile = inViewTiles.getTileById(idealID.key);\n\n        // reset any previously departing(ed) tiles that are now ideal tiles\n        if (idealTile.fadingDirection === FadingDirections.Departing || idealTile.fadeOpacity === 0) {\n            idealTile.resetFadeLogic();\n        }\n\n        const parentIsFader = updateFadingAncestor(inViewTiles, idealTile, retain, currentTime, maxFadingAncestorLevels, sourceMinZoom, rasterFadeDuration);\n        if (parentIsFader) continue;\n\n        const childIsFader = updateFadingDescendents(inViewTiles, idealTile, retain, currentTime, sourceMaxZoom, rasterFadeDuration);\n        if (childIsFader) continue;\n\n        const edgeIsFader = updateFadingEdge(idealTile, edgeTileIDs, currentTime, rasterFadeDuration);\n        if (edgeIsFader) continue;\n\n        // for all remaining non-fading ideal tiles reset the fade logic\n        idealTile.resetFadeLogic();\n    }\n}\n\n/**\n * Many-to-one cross-fade. Set 4 ideal tiles as the fading base for a rendered parent tile\n * as the fading parent. Here the parent is fading out and the ideal tile is fading in.\n *\n * Parent tile - fading out                                \u25A0                                -- Fading Parent\n *                                   \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252C\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n * Ideal tiles - fading in           \u25A0              \u25A0              \u25A0              \u25A0         -- Base Role = Incoming\n *                             \u250C\u2500\u2500\u2500\u252C\u2500\u2534\u2500\u252C\u2500\u2500\u2500\u2510  \u250C\u2500\u2500\u2500\u252C\u2500\u2534\u2500\u252C\u2500\u2500\u2500\u2510  \u250C\u2500\u2500\u2500\u252C\u2500\u2534\u2500\u252C\u2500\u2500\u2500\u2510  \u250C\u2500\u2500\u2500\u252C\u2500\u2534\u2500\u252C\u2500\u2500\u2500\u2510\n *                             \u25A0   \u25A0   \u25A0   \u25A0  \u25A0   \u25A0   \u25A0   \u25A0  \u25A0   \u25A0   \u25A0   \u25A0  \u25A0   \u25A0   \u25A0   \u25A0\n */\nfunction updateFadingAncestor(\n    inViewTiles: InViewTiles,\n    idealTile: Tile, \n    retain: Record<string, OverscaledTileID>, \n    now: number,\n    maxFadingAncestorLevels: number,\n    sourceMinZoom: number,\n    rasterFadeDuration: number): boolean {\n    if (!idealTile.hasData()) return false;\n\n    const {tileID: idealID, fadingRole, fadingDirection, fadingParentID} = idealTile;\n    // ideal tile already has fading parent - retain and return\n    if (fadingRole === FadingRoles.Base && fadingDirection === FadingDirections.Incoming && fadingParentID) {\n        retain[fadingParentID.key] = fadingParentID;\n        return true;\n    }\n\n    // find a loaded parent tile to fade with the ideal tile\n    const minAncestorZ = Math.max(idealID.overscaledZ - maxFadingAncestorLevels, sourceMinZoom);\n    for (let ancestorZ = idealID.overscaledZ - 1; ancestorZ >= minAncestorZ; ancestorZ--) {\n        const ancestorID = idealID.scaledTo(ancestorZ);\n        const ancestorTile = inViewTiles.getLoadedTile(ancestorID);\n        if (!ancestorTile) continue;\n\n        // ideal tile (base) is fading in\n        idealTile.setCrossFadeLogic({\n            fadingRole: FadingRoles.Base,\n            fadingDirection: FadingDirections.Incoming,\n            fadingParentID: ancestorTile.tileID,  // fading out\n            fadeEndTime: now + rasterFadeDuration\n        });\n        // ancestor tile (parent) is fading out\n        ancestorTile.setCrossFadeLogic({\n            fadingRole: FadingRoles.Parent,\n            fadingDirection: FadingDirections.Departing,\n            fadeEndTime: now + rasterFadeDuration\n        });\n\n        retain[ancestorID.key] = ancestorID;\n        return true;\n    }\n    return false;\n}\n\n/**\n * Many-to-one cross-fade. Search descendents of ideal tiles as the fading base with the ideal tile\n * as the fading parent. Here the children are fading out and the ideal tile is fading in.\n *\n *                                                         \u25A0\n *                                   \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252C\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n * Ideal tiles - fading in           \u25A0              \u25A0              \u25A0              \u25A0          -- Fading Parent\n *                             \u250C\u2500\u2500\u2500\u252C\u2500\u2534\u2500\u252C\u2500\u2500\u2500\u2510  \u250C\u2500\u2500\u2500\u252C\u2500\u2534\u2500\u252C\u2500\u2500\u2500\u2510  \u250C\u2500\u2500\u2500\u252C\u2500\u2534\u2500\u252C\u2500\u2500\u2500\u2510  \u250C\u2500\u2500\u2500\u252C\u2500\u2534\u2500\u252C\u2500\u2500\u2500\u2510\n * Child tiles - fading out    \u25A0   \u25A0   \u25A0   \u25A0  \u25A0   \u25A0   \u25A0   \u25A0  \u25A0   \u25A0   \u25A0   \u25A0  \u25A0   \u25A0   \u25A0   \u25A0    -- Base Role = Departing\n *\n * Try direct children first. If none found, try grandchildren. Stops at the first generation that provides a fader.\n */\nfunction updateFadingDescendents(inViewTiles: InViewTiles, idealTile: Tile, retain: Record<string, OverscaledTileID>, now: number, sourceMaxZoom: number, rasterFadeDuration: number): boolean {\n    if (!idealTile.hasData()) return false;\n\n    // search first level of descendents (4 tiles)\n    const idealChildren = idealTile.tileID.children(sourceMaxZoom);\n    let hasFader = updateFadingChildren(inViewTiles, idealTile, idealChildren, retain, now, sourceMaxZoom, rasterFadeDuration);\n    if (hasFader) return true;\n\n    // search second level of descendents (16 tiles)\n    for (const childID of idealChildren) {\n        const grandChildIDs = childID.children(sourceMaxZoom);\n        if (updateFadingChildren(inViewTiles, idealTile, grandChildIDs, retain, now, sourceMaxZoom, rasterFadeDuration)) {\n            hasFader = true;\n        }\n    }\n\n    return hasFader;\n}\n\nfunction updateFadingChildren(\n    inViewTiles: InViewTiles,\n    idealTile: Tile, \n    childIDs: OverscaledTileID[], \n    retain: Record<string, OverscaledTileID>, \n    now: number, \n    sourceMaxZoom: number,\n    rasterFadeDuration: number): boolean {\n    if (childIDs[0].overscaledZ >= sourceMaxZoom) return false;\n    let foundFader = false;\n\n    // find loaded child tiles to fade with the ideal tile\n    for (const childID of childIDs) {\n        const childTile = inViewTiles.getLoadedTile(childID);\n        if (!childTile) continue;\n\n        const {fadingRole, fadingDirection, fadingParentID} = childTile;\n        if (fadingRole !== FadingRoles.Base || fadingDirection !== FadingDirections.Departing || !fadingParentID) {\n            // child tile (base) is fading out\n            childTile.setCrossFadeLogic({\n                fadingRole: FadingRoles.Base,\n                fadingDirection: FadingDirections.Departing,\n                fadingParentID: idealTile.tileID,\n                fadeEndTime: now + rasterFadeDuration\n            });\n            // ideal tile (parent) is fading in\n            idealTile.setCrossFadeLogic({\n                fadingRole: FadingRoles.Parent,\n                fadingDirection: FadingDirections.Incoming,\n                fadeEndTime: now + rasterFadeDuration\n            });\n        }\n\n        retain[childID.key] = childID;\n        foundFader = true;\n    }\n\n    return foundFader;\n}\n\n/**\n * One-to-one self fading for unloaded edge tiles (for panning sideways on map). for loading tiles over gaps it feels\n * more natural for them to fade in, however if they are already loaded/cached then there is no need to fade as map will\n * look cohesive with no gaps. Note that draw_raster determines fade priority, as many-to-one fade supersedes edge fading.\n */\nfunction updateFadingEdge(idealTile: Tile, edgeTileIDs: Set<OverscaledTileID>, now: number, rasterFadeDuration: number): boolean {\n    const idealID: OverscaledTileID = idealTile.tileID;\n\n    // tile is already self fading\n    if (idealTile.selfFading) {\n        return true;\n    }\n\n    // fading not needed for tiles that are already loaded\n    if (idealTile.hasData()) {\n        return false;\n    }\n\n    // enable fading for loading edges with no data\n    if (edgeTileIDs.has(idealID)) {\n        const fadeEndTime = now + rasterFadeDuration;\n        idealTile.setSelfFadeLogic(fadeEndTime);\n        return true;\n    }\n\n    return false;\n}\n\nexport function hasRasterTransition(inViewTiles: InViewTiles, rasterFadeDuration: number) {\n    if (rasterFadeDuration <= 0) {\n        return false;\n    }\n    const currentTime = now();\n    for (const tile of inViewTiles.getAllTiles()) {\n        if (tile.fadeEndTime >= currentTime) {\n            return true;\n        }\n    }\n    return false;\n}", "import {type Tile} from './tile';\nimport {type InViewTiles} from './tile_manager_in_view_tiles';\n\n/**\n * For raster terrain source, backfill DEM to eliminate visible tile boundaries\n */\nexport function backfillDEM(tile: Tile, inViewTiles: InViewTiles) {\n    const renderables = inViewTiles.getRenderableIds();\n    for (const borderId of renderables) {\n        if (!tile.neighboringTiles?.[borderId]) {\n            continue;\n        }\n        const borderTile = inViewTiles.getTileById(borderId);\n        if (!tile.neighboringTiles[borderId].backfilled) {\n            fillBorder(tile, borderTile);\n        }\n        if (borderTile.neighboringTiles?.[tile.tileID.key]?.backfilled) {\n            continue;\n        }\n        fillBorder(borderTile, tile);\n    }\n}\n\nfunction fillBorder(tile: Tile, borderTile: Tile) {\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?.[borderId]) {\n        tile.neighboringTiles[borderId].backfilled = true;\n    }\n}\n\n", "import Point from '@mapbox/point-geometry';\nimport {type LayerFeatureStates} from '../source/source_state';\nimport {type Tile} from './tile';\nimport {compareTileId, type OverscaledTileID} from './tile_id';\n\nexport class InViewTiles {\n    private _tiles: Record<string, Tile> = {};\n\n    public handleWrapJump(wrapDelta: number) {\n        const tiles: Record<string, Tile> = {};\n        for (const id in this._tiles) {\n            const tile = this._tiles[id];\n            tile.tileID = tile.tileID.unwrapTo(tile.tileID.wrap + wrapDelta);\n            tiles[tile.tileID.key] = tile;\n        }\n        this._tiles = tiles;\n    }\n\n    public setFeatureState(featuresChanged: LayerFeatureStates, painter: any) {\n        for (const id in this._tiles) {\n            const tile = this._tiles[id];\n            tile.setFeatureState(featuresChanged, painter);\n        }\n    }\n\n    public getAllTiles(): Tile[] {\n        return Object.values(this._tiles);\n    }\n\n    public getAllIds(sorted = false): string[] {\n        if (sorted) {\n            return Object.values(this._tiles).map(tile => tile.tileID).sort(compareTileId).map(id => id.key);\n        }\n        return Object.keys(this._tiles);\n    }\n\n    public getTileById(key: string): Tile | undefined {\n        return this._tiles[key];\n    }\n\n    public setTile(key: string, tile: Tile) {\n        this._tiles[key] = tile;\n    }\n\n    public deleteTileById(key: string) {\n        delete this._tiles[key];\n    }\n\n    /**\n     * Get a currently loaded tile.\n     * - a cached tile is not a loaded tile\n     * @returns the tile if it's in view and had data, null otherwise.\n     */\n    public getLoadedTile(tileID: OverscaledTileID): Tile | null {\n        const tile = this.getTileById(tileID.key);\n        if (tile?.hasData()) {\n            return tile;\n        }\n        return null;\n    }\n\n    public isIdRenderable(id: string, symbolLayer: boolean = false) {\n        return this.getTileById(id)?.isRenderable(symbolLayer);\n    }\n\n    public getRenderableIds(bearingInRadians: number = 0, symbolLayer?: boolean): string[] {\n        const renderables: Tile[] = [];\n        for (const id of this.getAllIds()) {\n            if (this.isIdRenderable(id, symbolLayer)) {\n                renderables.push(this.getTileById(id));\n            }\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(-bearingInRadians);\n                const rotatedB = (new Point(b.canonical.x, b.canonical.y))._rotate(-bearingInRadians);\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}", "import {create as createSource} from '../source/source';\n\nimport {Tile} from './tile';\nimport {ErrorEvent, Event, Evented} from '../util/evented';\nimport {ensureError} from '../util/util';\nimport {TileCache} from './tile_cache';\nimport {MercatorCoordinate} from '../geo/mercator_coordinate';\nimport {EXTENT} from '../data/extent';\nimport type Point from '@mapbox/point-geometry';\nimport {now} from '../util/time_control';\nimport {OverscaledTileID} from './tile_id';\nimport {SourceFeatureState} from '../source/source_state';\nimport {config} from '../util/config';\nimport {coveringTiles, coveringZoomLevel} from '../geo/projection/covering_tiles';\nimport {Bounds} from '../geo/bounds';\nimport {EXTENT_BOUNDS} from '../data/extent_bounds';\nimport {GEOJSON_TILE_LAYER_NAME} from '../data/feature_index';\nimport {hasRasterTransition, isRasterType, updateFadingTiles} from './tile_manager_raster';\nimport {backfillDEM} from './tile_manager_raster_dem';\nimport {InViewTiles} from './tile_manager_in_view_tiles';\n\nimport type {Context} from '../webgl/context';\nimport type {Source} from '../source/source';\nimport type {Map} from '../ui/map';\nimport type {Style} from '../style/style';\nimport type {Dispatcher} from '../util/dispatcher';\nimport type {IReadonlyTransform, ITransform} from '../geo/transform_interface';\nimport type {TileState} from './tile';\nimport type {ICanonicalTileID, SourceSpecification} from '@maplibre/maplibre-gl-style-spec';\nimport type {MapSourceDataEvent} from '../ui/events';\nimport type {Terrain} from '../render/terrain';\nimport type {CanvasSourceSpecification} from '../source/canvas_source';\nimport type {LoadTileResult} from '../source/vector_tile_source';\n\ntype TileResult = {\n    tile: Tile;\n    tileID: OverscaledTileID;\n    queryGeometry: Point[];\n    cameraQueryGeometry: Point[];\n    scale: number;\n};\n\n/**\n * @internal\n * `TileManager` is responsible for\n *\n *  - creating an instance of `Source`\n *  - caching tiles loaded from an instance of `Source`\n *  - handling incoming source data events events from `Map` and coordinating updates\n *  - providing the current renderable tile coordinates to the `Painter`\n *  - loading the tiles needed to render a given viewport\n *  - retaining the tiles needed as substitutes for pending loading tiles\n *  - retaining the tiles needed for fading between parents and children (for raster sources)\n *  - reloading tiles when source data or dependencies change\n *  - handling tile expiration and refresh timers\n *  - unloading cached tiles not needed to render a given viewport\n *  - managing tile state and feature state\n */\nexport class TileManager 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    _inViewTiles: InViewTiles;\n    _prevLng: number;\n    _outOfViewCache: TileCache;\n    _timers: Record<string, ReturnType<typeof setTimeout>>;\n    _maxTileCacheSize: number;\n    _maxTileCacheZoomLevels: number;\n    _paused: boolean;\n    _shouldReloadOnResume: boolean;\n    transform: ITransform;\n    terrain: Terrain;\n    used: boolean;\n    usedForTerrain: boolean;\n    tileSize: number;\n    _state: SourceFeatureState;\n    _didEmitContent: boolean;\n    _updated: boolean;\n    _rasterFadeDuration: number;\n    _maxFadingAncestorLevels: number;\n\n    static maxUnderzooming: number = 10;\n    static maxOverzooming: number = 3;\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._inViewTiles = new InViewTiles();\n        this._outOfViewCache = new TileCache(0, (tile) => this._unloadTile(tile));\n        this._timers = {};\n        this._maxTileCacheSize = null;\n        this._maxTileCacheZoomLevels = null;\n        this._rasterFadeDuration = 0;\n        this._maxFadingAncestorLevels = 5;\n\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?.onAdd) {\n            this._source.onAdd(map);\n        }\n    }\n\n    onRemove(map: Map) {\n        for (const tile of this._inViewTiles.getAllTiles()) {\n            tile.unloadVectorData();\n        }\n        this.clearTiles();\n        if (this._source?.onRemove) {\n            this._source.onRemove(map);\n        }\n        this._inViewTiles = new InViewTiles();\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 tile of this._inViewTiles.getAllTiles()) {\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    getState(): SourceFeatureState {\n        return this._state;\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            const result = await this._source.loadTile(tile) as LoadTileResult;\n            this._tileLoaded(tile, id, state, result);\n        } catch (err) {\n            tile.state = 'errored';\n\n            if (err.status !== 404) {\n                this._source.fire(new ErrorEvent(ensureError(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._inViewTiles, this.map ? this.map.painter : null);\n        for (const tile of this._inViewTiles.getAllTiles()) {\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(): string[] {\n        return this._inViewTiles.getAllIds(true);\n    }\n\n    getRenderableIds(symbolLayer?: boolean): string[] {\n        return this._inViewTiles.getRenderableIds(this.transform?.bearingInRadians, symbolLayer);\n    }\n\n    hasRenderableParent(tileID: OverscaledTileID) {\n        const parentZ = tileID.overscaledZ - 1;\n        if (parentZ >= this._source.minzoom) {\n            const parentTile = this.getLoadedTile(tileID.scaledTo(parentZ));\n            if (parentTile) {\n                return this._inViewTiles.isIdRenderable(parentTile.tileID.key);\n            }\n        }\n        return false;\n    }\n\n    /**\n     * Reload tiles based on the current state of the source.\n     * @param sourceDataChanged - If `true`, reload all tiles using a state of 'expired', otherwise reload only non-errored tiles using state of 'reloading'.\n     * @param shouldReloadTileOptions - Set of options associated with a `MapSourceDataChangedEvent` that can be passed back to the associated `Source` determine whether a tile should be reloaded.\n     */\n    reload(\n        sourceDataChanged?: boolean,\n        shouldReloadTileOptions: any = undefined\n    ) {\n        if (this._paused) {\n            this._shouldReloadOnResume = true;\n            return;\n        }\n\n        this._outOfViewCache.reset();\n\n        for (const id of this._inViewTiles.getAllIds()) {\n            const tile = this._inViewTiles.getTileById(id);\n            if (shouldReloadTileOptions && !this._source.shouldReloadTile(tile, shouldReloadTileOptions)) {\n                continue;\n            } else if (sourceDataChanged) {\n                this._reloadTile(id, 'expired');\n            } else if (tile.state !== 'errored') {\n                this._reloadTile(id, 'reloading');\n            }\n        }\n    }\n\n    async _reloadTile(id: string, state: TileState) {\n        const tile = this._inViewTiles.getTileById(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, result: LoadTileResult) {\n        tile.timeAdded = now();\n        // Since self-fading applies to unloaded tiles, fadeEndTime must be updated upon load\n        if (tile.selfFading) {\n            tile.fadeEndTime = tile.timeAdded + this._rasterFadeDuration;\n        }\n\n        if (previousState === 'expired') tile.refreshedUponExpiration = true;\n        this._setTileReloadTimer(id, tile);\n\n        if (result?.unmodified) return;\n\n        if (this.getSource().type === 'raster-dem' && tile.dem) {\n            backfillDEM(tile, this._inViewTiles);\n        }\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     * 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 | undefined {\n        return this._inViewTiles.getTileById(id);\n    }\n\n    /**\n     * Retain the uppermost loaded children of each provided target tile, within a variable covering zoom range.\n     *\n     * On pitched maps, different parts of the screen show different zoom levels simultaneously.\n     * Ideal tiles are generated using coveringTiles() above, which returns the ideal tile set for\n     * the current pitched plane, which can carry tiles of varying zooms (overscaledZ).\n     * See: https://maplibre.org/maplibre-gl-js/docs/examples/level-of-detail-control/\n     *\n     * A fixed `maxCoveringZoom` on a pitched map would incorrectly intersect with some\n     * ideal tiles and cause distant high-pitch tiles to skip their uppermost children.\n     *\n     * To solve this, we calculate the max covering zoom for each ideal tile separately using its\n     * `overscaledZ`. This effectively makes the \"max covering zoom plane\" parallel to the\n     * \"ideal tile plane,\" ensuring that we correctly capture the uppermost children\n     * of each ideal tile across the pitched view.\n     *\n     * Analogy: imagine two sheets of paper in 3D space:\n     *   - one sheet = ideal tiles at varying overscaledZ\n     *   - the second sheet = maxCoveringZoom\n     *\n     * @param retainTileMap - this parameters will be updated with the child tiles to keep\n     * @param idealTilesWithoutData - which of the ideal tiles currently does not have loaded data\n     * @return a set of tiles that need to be loaded\n     */\n    _retainLoadedChildren(retainTileMap: Record<string, OverscaledTileID>, idealTilesWithoutData: Set<OverscaledTileID>): Set<OverscaledTileID> {\n        const loadedDescendents: Record<string, Tile[]> = this._getLoadedDescendents(idealTilesWithoutData);\n        const incomplete = new Set<OverscaledTileID>();\n\n        // retain the uppermost descendents of target tiles\n        for (const targetID of idealTilesWithoutData) {\n            const descendents = loadedDescendents[targetID.key];\n            if (!descendents?.length) {\n                incomplete.add(targetID);\n                continue;\n            }\n\n            // find descendents within the max covering zoom range\n            const maxCoveringZoom = targetID.overscaledZ + TileManager.maxOverzooming;\n            const candidates = descendents.filter(t => t.tileID.overscaledZ <= maxCoveringZoom);\n            if (!candidates.length) {\n                incomplete.add(targetID);\n                continue;\n            }\n\n            // retain the uppermost descendents in the topmost zoom below the target tile\n            const topZoom = Math.min(...candidates.map(t => t.tileID.overscaledZ));\n            const topIDs = candidates.filter(t => t.tileID.overscaledZ === topZoom).map(t => t.tileID);\n            for (const tileID of topIDs) {\n                retainTileMap[tileID.key] = tileID;\n            }\n\n            //determine if the retained generation is fully covered\n            if (!this._areDescendentsComplete(topIDs, topZoom, targetID.overscaledZ)) {\n                incomplete.add(targetID);\n            }\n        }\n\n        return incomplete;\n    }\n\n    /**\n     * Return dictionary of qualified loaded descendents for each provided target tile id\n     */\n    _getLoadedDescendents(targetTileIDs: Set<OverscaledTileID>) {\n        const loadedDescendents: Record<string, Tile[]> = {};\n\n        // enumerate current tiles and find the loaded descendents of each target tile\n        for (const tile of this._inViewTiles.getAllTiles().filter(tile => tile.hasData())) {\n            // determine if the loaded tile (hasData) is a qualified descendent of any target tile\n            for (const targetID of targetTileIDs) {\n                if (tile.tileID.isChildOf(targetID)) {\n                    loadedDescendents[targetID.key] ||= [];\n                    loadedDescendents[targetID.key].push(tile);\n                }\n            }\n        }\n\n        return loadedDescendents;\n    }\n\n    /**\n     * Determine if tile ids fully cover the current generation.\n     * - 1st generation: need 4 children or 1 overscaled child\n     * - 2nd generation: need 16 children or 1 overscaled child\n     */\n    _areDescendentsComplete(generationIDs: OverscaledTileID[], generationZ: number, ancestorZ: number) {\n        //if overscaled, seeking 1 tile at generationZ, otherwise seeking a power of 4 for each descending Z\n        if (generationIDs.length === 1 && generationIDs[0].isOverscaled()) {\n            return generationIDs[0].overscaledZ === generationZ;\n        } else {\n            const expectedTiles = Math.pow(4, generationZ - ancestorZ);  //4, 16, 64 (for first 3 gens)\n            return expectedTiles === generationIDs.length;\n        }\n    }\n\n    /**\n     * Get a currently loaded tile.\n     * - a cached tile is not a loaded tile\n     * @returns the tile if it's in view and had data, null otherwise.\n     */\n    getLoadedTile(tileID: OverscaledTileID): Tile | null {\n        return this._inViewTiles.getLoadedTile(tileID);\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: IReadonlyTransform) {\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._outOfViewCache.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            this._inViewTiles.handleWrapJump(wrapDelta);\n            this._resetTileReloadTimers();\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: ITransform, 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        let idealTileIDs: OverscaledTileID[];\n\n        if (!this.used && !this.usedForTerrain) {\n            idealTileIDs = [];\n        } else if (this._source.tileID) { // image source\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 = coveringTiles(transform, {\n                tileSize: this.usedForTerrain ? this.tileSize : this._source.tileSize,\n                minzoom: this._source.minzoom,\n                maxzoom: this._source.type === 'vector' && this.map._zoomLevelsToOverscale !== undefined\n                    ? transform.maxZoom - this.map._zoomLevelsToOverscale\n                    : this._source.maxzoom,\n                roundZoom: this.usedForTerrain ? false : this._source.roundZoom,\n                reparseOverscaled: this._source.reparseOverscaled,\n                terrain,\n                calculateTileZoom: this._source.calculateTileZoom,\n            });\n\n            if (this._source.hasTile) { // tile should be in bounds\n                idealTileIDs = idealTileIDs.filter((coord) => this._source.hasTile(coord));\n            }\n        }\n\n        // When tilemanager is used for terrain also load parent tiles for complete rendering of 3d terrain levels\n        if (this.usedForTerrain) {\n            idealTileIDs = this._addTerrainIdealTiles(idealTileIDs);\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 zoom: number = coveringZoomLevel(transform, this._source);\n        const retain: Record<string, OverscaledTileID> = this._updateRetainedTiles(idealTileIDs, zoom);\n\n        // enable fading for raster source except when using terrain which doesn't currently support fading\n        const isRaster = isRasterType(this._source.type);\n        if (isRaster && this._rasterFadeDuration > 0 && !terrain) {\n            updateFadingTiles(this._inViewTiles, idealTileIDs, retain, this._maxFadingAncestorLevels, this._source.minzoom, this._source.maxzoom, this._rasterFadeDuration);\n        }\n\n        // clean up non-retained tiles that are no longer needed\n        if (isRaster) {\n            this._cleanUpRasterTiles(retain);\n        } else {\n            this._cleanUpVectorTiles(retain);\n        }\n    }\n\n    /**\n     * Remove raster tiles that are no longer retained\n     */\n    _cleanUpRasterTiles(retain: Record<string, OverscaledTileID>) {\n        for (const id of this._inViewTiles.getAllIds()) {\n            if (!retain[id]) {\n                this._removeTile(id);\n            }\n        }\n    }\n\n    /**\n     * Remove vector tiles that are no longer retained and also not needed for symbol fading\n     */\n    _cleanUpVectorTiles(retain: Record<string, OverscaledTileID>) {\n        for (const id of this._inViewTiles.getAllIds()) {\n            const tile = this._inViewTiles.getTileById(id);\n\n            // retained - clear fade hold so if it's removed again fade timer starts fresh.\n            if (retain[id]) {\n                tile.clearSymbolFadeHold();\n                continue;\n            }\n\n            // remove non-retained tiles without symbols\n            if (!tile.hasSymbolBuckets) {\n                this._removeTile(id);\n                continue;\n            }\n\n            // for tile with symbols - hold for fade - then remove\n            if (!tile.holdingForSymbolFade()) {\n                tile.setSymbolHoldDuration(this.map._fadeDuration);\n            } else if (tile.symbolFadeFinished()) {\n                this._removeTile(id);\n            }\n        }\n    }\n\n    /**\n     * Add ideal tiles needed for 3D terrain rendering\n     */\n    _addTerrainIdealTiles(idealTileIDs: OverscaledTileID[]): OverscaledTileID[] {\n        const ancestors = [];\n\n        for (const tileID of idealTileIDs) {\n            if (tileID.canonical.z > this._source.minzoom) {\n                const parent = tileID.scaledTo(tileID.canonical.z - 1);\n                ancestors.push(parent);\n                // load very low zoom to calculate tile visibility in transform.coveringTiles and high zoom levels correct\n                const parent2 = tileID.scaledTo(Math.max(this._source.minzoom, Math.min(tileID.canonical.z, 5)));\n                ancestors.push(parent2);\n            }\n        }\n\n        return idealTileIDs.concat(ancestors);\n    }\n\n    releaseSymbolFadeTiles() {\n        for (const id of this._inViewTiles.getAllIds()) {\n            if (this._inViewTiles.getTileById(id).holdingForSymbolFade()) {\n                this._removeTile(id);\n            }\n        }\n    }\n\n    /**\n     * Set tiles to be retained on update of the source. For ideal tiles that do not have data, retain their loaded\n     * children so they can be displayed as substitutes pending load of each ideal tile (to reduce flickering).\n     * If no loaded children are available, fallback to seeking loaded parents as an alternative substitute.\n     */\n    _updateRetainedTiles(idealTileIDs: OverscaledTileID[], zoom: number): Record<string, OverscaledTileID> {\n        const idealTilesWithoutData = new Set<OverscaledTileID>();\n        for (const idealID of idealTileIDs) {\n            const idealTile = this._addTile(idealID);\n\n            if (!idealTile.hasData()) {\n                idealTilesWithoutData.add(idealID);\n            }\n        }\n\n        // retain the tile even if it's not loaded because it's an ideal tile.\n        const retainTileMap: Record<string, OverscaledTileID> = idealTileIDs.reduce((acc, t) => { acc[t.key] = t; return acc;}, {});\n        const tileIdsWithoutData = this._retainLoadedChildren(retainTileMap, idealTilesWithoutData);\n\n        // for remaining missing tiles with incomplete child coverage, seek a loaded parent tile\n        const checked: Record<string, boolean> = {};\n        const minCoveringZoom = Math.max(zoom - TileManager.maxUnderzooming, this._source.minzoom);\n        for (const tileID of tileIdsWithoutData) {\n            let tile = this._inViewTiles.getTileById(tileID.key);\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                        retainTileMap[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 retainTileMap;\n    }\n\n    /**\n     * Add a tile, given its coordinate, to the pyramid.\n     */\n    _addTile(tileID: OverscaledTileID): Tile {\n        let tile = this._inViewTiles.getTileById(tileID.key);\n        if (tile)\n            return tile;\n\n        tile = this._outOfViewCache.getAndRemove(tileID);\n        if (tile) {\n            //reset fading logic to remove stale fading data from cache\n            tile.resetFadeLogic();\n\n            // set timer for the reloading of the tile upon expiration\n            this._setTileReloadTimer(tileID.key, tile);\n\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        }\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._inViewTiles.setTile(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    /**\n     * Set a timeout to reload the tile after it expires\n     */\n    _setTileReloadTimer(id: string, tile: Tile) {\n        this._clearTileReloadTimer(id);\n\n        const expiryTimeout = tile.getExpiryTimeout();\n        if (expiryTimeout) {\n            const reload = () => {\n                this._reloadTile(id, 'expired');\n                delete this._timers[id];\n            };\n            this._timers[id] = setTimeout(reload, expiryTimeout);\n        }\n    }\n\n    _clearTileReloadTimer(id: string) {\n        const timeout = this._timers[id];\n        if (timeout) {\n            clearTimeout(timeout);\n            delete this._timers[id];\n        }\n    }\n\n    _resetTileReloadTimers() {\n        for (const id in this._timers) {\n            clearTimeout(this._timers[id]);\n            delete this._timers[id];\n        }\n        for (const id of this._inViewTiles.getAllIds()) {\n            const tile = this._inViewTiles.getTileById(id);\n            this._setTileReloadTimer(id, tile);\n        }\n    }\n\n    /**\n     * Reload any currently renderable tiles that are match one of the incoming `tileId` x/y/z\n     */\n    refreshTiles(tileIds: ICanonicalTileID[]) {\n        for (const id of this._inViewTiles.getAllIds()) {\n            const tile = this._inViewTiles.getTileById(id);\n            if (!this._inViewTiles.isIdRenderable(id) && tile.state != 'errored') {\n                continue;\n            }\n            if (tileIds.some(tid => tid.equals(tile.tileID.canonical))) {\n                this._reloadTile(id, 'expired');\n            }\n        }\n    }\n\n    /**\n     * Remove a tile, given its id, from the pyramid\n     */\n    _removeTile(id: string) {\n        const tile = this._inViewTiles.getTileById(id);\n        if (!tile)\n            return;\n\n        tile.uses--;\n        this._inViewTiles.deleteTileById(id);\n        this._clearTileReloadTimer(id);\n\n        if (tile.uses > 0)\n            return;\n\n        if (tile.hasData() && tile.state !== 'reloading') {\n            this._outOfViewCache.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     * Handles incoming source data messages (i.e. after the source has been updated via a worker that has fired\n     * to map.ts data event). For sources with mutable data, the 'content' event fires when the underlying data\n     * to a source has changed. (i.e. GeoJSONSource.setData and ImageSource.setCoordinates)\n     */\n    private _dataHandler(e: MapSourceDataEvent) {\n        if (e.dataType !== 'source') return;\n\n        if (e.sourceDataType === 'metadata') {\n            this._sourceLoaded = true;\n            return;\n        }\n\n        if (e.sourceDataType !== 'content' || !this._sourceLoaded || this._paused) {\n            return;\n        }\n\n        this.reload(e.sourceDataChanged, e.shouldReloadTileOptions);\n        if (this.transform) {\n            this.update(this.transform, this.terrain);\n        }\n        this._didEmitContent = true;\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 of this._inViewTiles.getAllIds()) {\n            this._removeTile(id);\n        }\n\n        this._outOfViewCache.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: Point[], maxPitchScaleFactor: number, has3DLayer: boolean): TileResult[] {\n        const tileResults: TileResult[] = [];\n\n        const transform = this.transform;\n        if (!transform) return tileResults;\n        const allowWorldCopies = transform.getCoveringTilesDetailsProvider().allowWorldCopies();\n\n        const cameraPointQueryGeometry = has3DLayer ?\n            transform.getCameraQueryGeometry(pointQueryGeometry) :\n            pointQueryGeometry;\n\n        const project = (point: Point) => transform.screenPointToMercatorCoordinate(point, this.terrain);\n        const queryGeometry = this.transformBbox(pointQueryGeometry, project, !allowWorldCopies);\n        const cameraQueryGeometry = this.transformBbox(cameraPointQueryGeometry, project, !allowWorldCopies);\n\n        const ids = this.getIds();\n\n        const cameraBounds = Bounds.fromPoints(cameraQueryGeometry);\n\n        for (const id of ids) {\n            const tile = this._inViewTiles.getTileById(id);\n            if (tile.holdingForSymbolFade()) {\n                // Tiles held for fading are covered by tiles that are closer to ideal\n                continue;\n            }\n            // if the projection does not render world copies then we need to explicitly check for the bounding box crossing the antimeridian\n            const tileIDs = allowWorldCopies ? [tile.tileID] : [tile.tileID.unwrapTo(-1), tile.tileID.unwrapTo(0)];\n            const scale = Math.pow(2, transform.zoom - tile.tileID.overscaledZ);\n            const queryPadding = maxPitchScaleFactor * tile.queryPadding * EXTENT / tile.tileSize / scale;\n\n            for (const tileID of tileIDs) {\n\n                const tileSpaceBounds = cameraBounds.map(point => tileID.getTilePoint(new MercatorCoordinate(point.x, point.y)));\n                tileSpaceBounds.expandBy(queryPadding);\n\n                if (tileSpaceBounds.intersects(EXTENT_BOUNDS)) {\n\n                    const tileSpaceQueryGeometry: Point[] = queryGeometry.map((c) => tileID.getTilePoint(c));\n                    const tileSpaceCameraQueryGeometry = cameraQueryGeometry.map((c) => tileID.getTilePoint(c));\n\n                    tileResults.push({\n                        tile,\n                        tileID: allowWorldCopies ? tileID : tileID.unwrapTo(0),\n                        queryGeometry: tileSpaceQueryGeometry,\n                        cameraQueryGeometry: tileSpaceCameraQueryGeometry,\n                        scale\n                    });\n                }\n            }\n        }\n\n        return tileResults;\n    }\n\n    private transformBbox(geom: Point[], project: (point: Point) => MercatorCoordinate, checkWrap: boolean): MercatorCoordinate[] {\n        let transformed = geom.map(project);\n        if (checkWrap) {\n            // If the projection does not allow world copies, then a bounding box may span the antimeridian and\n            // instead of a bounding box going from 179\u00B0E to 179\u00B0W, it goes from 179\u00B0W to 179\u00B0E and covers the entire\n            // planet except for what should be inside it.\n            const bounds = Bounds.fromPoints(geom);\n            bounds.shrinkBy(Math.min(bounds.width(), bounds.height()) * 0.001);\n            const projected = bounds.map(project);\n\n            const newBounds = Bounds.fromPoints(transformed);\n\n            if (!newBounds.covers(projected)) {\n                transformed = transformed.map((coord) => coord.x > 0.5 ?\n                    new MercatorCoordinate(coord.x - 1, coord.y, coord.z) :\n                    coord\n                );\n            }\n        }\n        return transformed;\n    }\n\n    getVisibleCoordinates(symbolLayer?: boolean): OverscaledTileID[] {\n        const coords = this.getRenderableIds(symbolLayer).map((id) => this._inViewTiles.getTileById(id).tileID);\n        if (this.transform) {\n            this.transform.populateCache(coords);\n        }\n        return coords;\n    }\n\n    hasTransition() {\n        if (this._source.hasTransition()) {\n            return true;\n        }\n\n        return isRasterType(this._source.type) && hasRasterTransition(this._inViewTiles, this._rasterFadeDuration);\n    }\n\n    setRasterFadeDuration(fadeDuration: number) {\n        this._rasterFadeDuration = fadeDuration;\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 ||= GEOJSON_TILE_LAYER_NAME;\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 ||= GEOJSON_TILE_LAYER_NAME;\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 ||= GEOJSON_TILE_LAYER_NAME;\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: string[]) {\n        const tile = this._inViewTiles.getTileById(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: string[], keys: string[]) {\n        for (const id of this._inViewTiles.getAllIds()) {\n            const tile = this._inViewTiles.getTileById(id);\n            if (tile.hasDependency(namespaces, keys)) {\n                this._reloadTile(id, 'reloading');\n            }\n        }\n        this._outOfViewCache.filter(tile => !tile.hasDependency(namespaces, keys));\n    }\n\n    areTilesLoaded(): boolean {\n        for (const tile of this._inViewTiles.getAllTiles()) {\n            if (!(tile.state === 'loaded' || tile.state === 'errored')) {\n                return false;\n            }\n        }\n        return true;\n    }\n}\n", "import {clamp} from '../util/util';\nimport type Point from '@mapbox/point-geometry';\n\nexport class PathInterpolator {\n    points: Point[];\n    length: number;\n    paddedLength: number;\n    padding: number;\n    _distances: number[];\n\n    constructor(points_?: Point[] | null, padding_?: number | null) {\n        this.reset(points_, padding_);\n    }\n\n    reset(points_?: 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: T[];\n    boxKeys: T[];\n    boxCells: number[][];\n    circleCells: number[][];\n    bboxes: number[];\n    circles: 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        // Use a small epsilon to account for floating-point imprecision\n        // when collision box boundaries are computed via different\n        // projection paths (different tiles/sources) but should\n        // mathematically produce the same boundary value.\n        const epsilon = 1e-6;\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] + epsilon) &&\n                        (y1 <= bboxes[offset + 3] + epsilon) &&\n                        (x2 >= bboxes[offset + 0] - epsilon) &&\n                        (y2 >= bboxes[offset + 1] - epsilon) &&\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: 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", "/*\nThis class implements fast mathematical operations to optimize or complement gl-matrix\n*/\nimport type {mat4} from 'gl-matrix';\n\n/*\nInvert a transform matrix\ndst and src are in column-major flat format\n*/\nexport function fastInvertTransformMat4(dst: mat4, src: mat4): mat4{\n    // extract scale. hyp: scale X = scale Y:\n    const sXYSqInv = 1.0 / (src[0] * src[0] + src[1] * src[1] + src[2] * src[2]);\n    const sZSqInv = 1.0 / (src[8] * src[8] + src[9] * src[9] + src[10] * src[10]);\n\n    // inv rotation and scaling part:\n    const s0 = src[0] * sXYSqInv;\n    const s4 = src[4] * sXYSqInv;\n    const s8 = src[8] * sZSqInv;\n    const s1 = src[1] * sXYSqInv;\n    const s5 = src[5] * sXYSqInv;\n    const s9 = src[9] * sZSqInv;\n    const s2 = src[2] * sXYSqInv;\n    const s6 = src[6] * sXYSqInv;\n    const s10 = src[10] * sZSqInv;\n\n    // rotation part:\n    dst[0] = s0;\n    dst[1] = s4;\n    dst[2] = s8;\n    dst[4] = s1;\n    dst[5] = s5;\n    dst[6] = s9;\n    dst[8] = s2;\n    dst[9] = s6;\n    dst[10] = s10;\n\n    // translation part:\n    const t0 = src[12];\n    const t1 = src[13];\n    const t2 = src[14];\n    dst[12] = -s0 * t0 - s1 * t1 - s2 * t2;\n    dst[13] = -s4 * t0 - s5 * t1 - s6 * t2;\n    dst[14] = -s8 * t0 - s9 * t1 - s10 * t2;\n\n    // constant part:\n    dst[3] = 0;\n    dst[7] = 0;\n    dst[11] = 0;\n    dst[15] = 1;\n\n    return dst;\n}\n\n/*\nInvert a perspective projection matrix\ndst and src are in column-major flat format\n*/\nexport function fastInvertProjMat4(dst: mat4, src: mat4): mat4{\n    dst[0] = 1 / src[0];\n    dst[1] = 0;\n    dst[2] = 0;\n    dst[3] = 0;\n\n    dst[4] = 0;\n    dst[5] = 1 / src[5];\n    dst[6] = 0;\n    dst[7] = 0;\n\n    dst[8] = 0;\n    dst[9] = 0;\n    dst[10] = 0;\n    dst[11] = 1 / src[14];\n\n    dst[12] = 0;\n    dst[13] = 0;\n    dst[14] = -1;\n    dst[15] = src[10] / src[14];\n\n    return dst;\n}\n\n/*\nInvert a skew matrix\nwith diag coefficients > 0 and XY counterdiag\ndst and src are in column-major flat format\n*/\n\nexport function fastInvertSkewMat4(dst: mat4, src: mat4): mat4{\n    const invDetXY = 1.0 / (src[0]*src[5] - src[1]*src[4]);\n    dst[0] = src[5] * invDetXY;\n    dst[1] = -src[1] * invDetXY;\n    dst[2] = 0;\n    dst[3] = 0;\n\n    dst[4] = -src[4] * invDetXY;\n    dst[5] = src[0] * invDetXY;\n    dst[6] = 0;\n    dst[7] = 0;\n\n    dst[8] = 0;\n    dst[9] = 0;\n    dst[10] = 1 / src[10];\n    dst[11] = 0;\n\n    dst[12] = 0;\n    dst[13] = 0;\n    dst[14] = 0;\n    dst[15] = 1 / src[15];\n\n    return dst;\n}\n", "import Point from '@mapbox/point-geometry';\n\nimport {mat2, mat4, vec2, 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 {IReadonlyTransform} from '../geo/transform_interface';\nimport type {SymbolBucket} from '../data/bucket/symbol_bucket';\nimport type {\n    GlyphOffsetArray,\n    SymbolLineVertexArray,\n    SymbolDynamicLayoutArray,\n    PlacedSymbol,\n} from '../data/array_types.g';\nimport {WritingMode} from '../symbol/shaping';\nimport {findLineIntersection} from '../util/util';\nimport {type UnwrappedTileID} from '../tile/tile_id';\nimport {type StructArray} from '../util/struct_array';\nimport {fastInvertSkewMat4} from '../util/fast_maths';\n\n/**\n * Pre-allocate objects to avoid online allocation\n */\nconst tmpMat4 = mat4.create();\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     * If the point is simply beyond the edge of the screen, this should NOT be set to false.\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 * # Custom projection handling\n * Note that since MapLibre now supports more than one projection, the transformation\n * to viewport pixel space and GL clip space now *must* go through the projection's (`transform`'s)\n * `projectTileCoordinates` function, since it might do nontrivial transformations.\n *\n * Hence projecting anything to a symbol's label plane can no longer be handled by a simple matrix,\n * since, if the symbol's label plane is viewport pixel space, `projectTileCoordinates` must be used.\n * This is applies both here and in the symbol vertex shaders.\n */\n\nexport function getPitchedLabelPlaneMatrix(\n    rotateWithMap: boolean,\n    transform: IReadonlyTransform,\n    pixelsToTileUnits: number) {\n    const m = mat4.create();\n    if (!rotateWithMap) {\n        const {vecSouth, vecEast} = getTileSkewVectors(transform);\n        const skew = mat2.create();\n        skew[0] = vecEast[0];\n        skew[1] = vecEast[1];\n        skew[2] = vecSouth[0];\n        skew[3] = vecSouth[1];\n        mat2.invert(skew, skew);\n        m[0] = skew[0];\n        m[1] = skew[1];\n        m[4] = skew[2];\n        m[5] = skew[3];\n    }\n    mat4.scale(m, m, [1 / pixelsToTileUnits, 1 / pixelsToTileUnits, 1]);\n    return m;\n}\n\n/*\n * Returns a matrix for either converting from pitched label space to tile space,\n * or for converting from screenspace pixels to clip space.\n */\nexport function getGlCoordMatrix(\n    pitchWithMap: boolean,\n    rotateWithMap: boolean,\n    transform: IReadonlyTransform,\n    pixelsToTileUnits: number) {\n    if (pitchWithMap) {\n        const m = mat4.create();\n        if (!rotateWithMap) {\n            const {vecSouth, vecEast} = getTileSkewVectors(transform);\n            m[0] = vecEast[0];\n            m[1] = vecEast[1];\n            m[4] = vecSouth[0];\n            m[5] = vecSouth[1];\n        }\n        mat4.scale(m, m, [pixelsToTileUnits, pixelsToTileUnits, 1]);\n        return m;\n    } else {\n        return transform.pixelsToClipSpaceMatrix;\n    }\n}\n\nexport function getTileSkewVectors(transform: IReadonlyTransform): {vecEast: vec2; vecSouth: vec2} {\n    const cosRoll = Math.cos(transform.rollInRadians);\n    const sinRoll = Math.sin(transform.rollInRadians);\n    const cosPitch = Math.cos(transform.pitchInRadians);\n    const cosBearing = Math.cos(transform.bearingInRadians);\n    const sinBearing = Math.sin(transform.bearingInRadians);\n    const vecSouth = vec2.create();\n    vecSouth[0] = -cosBearing * cosPitch * sinRoll - sinBearing * cosRoll;\n    vecSouth[1] = -sinBearing * cosPitch * sinRoll + cosBearing * cosRoll;\n    const vecSouthLen = vec2.length(vecSouth);\n    if (vecSouthLen < 1.0e-9) {\n        vec2.zero(vecSouth);\n    } else {\n        vec2.scale(vecSouth, vecSouth, 1 / vecSouthLen);\n    }\n    const vecEast = vec2.create();\n    vecEast[0] = cosBearing * cosPitch * cosRoll - sinBearing * sinRoll;\n    vecEast[1] = sinBearing * cosPitch * cosRoll + cosBearing * sinRoll;\n    const vecEastLen = vec2.length(vecEast);\n    if (vecEastLen < 1.0e-9) {\n        vec2.zero(vecEast);\n    } else {\n        vec2.scale(vecEast, vecEast, 1 / vecEastLen);\n    }\n\n    return {vecEast, vecSouth};\n}\n\n/**\n * Projects a point using a specified matrix, including the perspective divide.\n * Uses a fast path if `getElevation` is undefined.\n */\nexport function projectWithMatrix(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\nexport function 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 */\nexport function updateLineLabels(bucket: SymbolBucket,\n    painter: Painter,\n    isText: boolean,\n    pitchedLabelPlaneMatrix: mat4,\n    pitchedLabelPlaneMatrixInverse: mat4,\n    pitchWithMap: boolean,\n    keepUpright: boolean,\n    rotateToLine: boolean,\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 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            pitchedLabelPlaneMatrix,\n            lineVertexArray,\n            pitchWithMap,\n            projectionCache,\n            transform: painter.transform,\n            tileAnchorPoint,\n            unwrappedTileID,\n            width: viewportWidth,\n            height: viewportHeight,\n            translation\n        };\n\n        const anchorPos = projectTileCoordinatesToClipSpace(symbol.anchorX, symbol.anchorY, projectionContext);\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 * painter.transform.getPitchedTextCorrection(symbol.anchorX, symbol.anchorY, unwrappedTileID) / perspectiveRatio) : fontSize * perspectiveRatio;\n\n        const placeUnflipped = placeGlyphsAlongLine({\n            projectionContext,\n            pitchedLabelPlaneMatrixInverse,\n            symbol,\n            fontSize: pitchScaledFontSize,\n            flip: false,\n            keepUpright,\n            glyphOffsetArray: bucket.glyphOffsetArray,\n            dynamicLayoutVertexArray,\n            aspectRatio,\n            rotateToLine,\n        });\n\n        useVertical = placeUnflipped.useVertical;\n\n        if (placeUnflipped.notEnoughRoom || useVertical ||\n            (placeUnflipped.needsFlipping &&\n                placeGlyphsAlongLine({\n                    projectionContext,\n                    pitchedLabelPlaneMatrixInverse,\n                    symbol,\n                    fontSize: pitchScaledFontSize,\n                    flip: true, // flipped\n                    keepUpright,\n                    glyphOffsetArray: bucket.glyphOffsetArray,\n                    dynamicLayoutVertexArray,\n                    aspectRatio,\n                    rotateToLine,\n                }).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 */\nexport function placeFirstAndLastGlyph(\n    fontScale: number,\n    glyphOffsetArray: GlyphOffsetArray,\n    lineOffsetX: number,\n    lineOffsetY: number,\n    flip: boolean,\n    symbol: PlacedSymbol,\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\ntype OrientationChangeType = {\n    useVertical?: boolean;\n    needsFlipping?: boolean;\n};\n\nfunction requiresOrientationChange(writingMode, firstPoint, lastPoint, aspectRatio): OrientationChangeType {\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\ntype GlyphLinePlacementResult = OrientationChangeType & {\n    notEnoughRoom?: boolean;\n};\n\ntype GlyphLinePlacementArgs = {\n    projectionContext: SymbolProjectionContext;\n    pitchedLabelPlaneMatrixInverse: mat4;\n    symbol: PlacedSymbol;\n    fontSize: number;\n    flip: boolean;\n    keepUpright: boolean;\n    glyphOffsetArray: GlyphOffsetArray;\n    dynamicLayoutVertexArray: StructArray;\n    aspectRatio: number;\n    rotateToLine: boolean;\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(args: GlyphLinePlacementArgs): GlyphLinePlacementResult {\n    const {\n        projectionContext,\n        pitchedLabelPlaneMatrixInverse,\n        symbol,\n        fontSize,\n        flip,\n        keepUpright,\n        glyphOffsetArray,\n        dynamicLayoutVertexArray,\n        aspectRatio,\n        rotateToLine\n    } = args;\n\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        // Note: these glyphs are placed onto the label plane\n        const firstAndLastGlyph = placeFirstAndLastGlyph(fontScale, glyphOffsetArray, lineOffsetX, lineOffsetY, flip, symbol, rotateToLine, projectionContext);\n        if (!firstAndLastGlyph) {\n            return {notEnoughRoom: true};\n        }\n        const firstPoint = projectFromLabelPlaneToClipSpace(firstAndLastGlyph.first.point.x, firstAndLastGlyph.first.point.y, projectionContext, pitchedLabelPlaneMatrixInverse);\n        const lastPoint = projectFromLabelPlaneToClipSpace(firstAndLastGlyph.last.point.x, firstAndLastGlyph.last.point.y, projectionContext, pitchedLabelPlaneMatrixInverse);\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, try placing the rest of the glyphs.\n            const placedGlyph = placeGlyphAlongLine(fontScale * glyphOffsetArray.getoffsetX(glyphIndex), lineOffsetX, lineOffsetY, flip, symbol.segment,\n                lineStartIndex, lineEndIndex, projectionContext, rotateToLine);\n            if (!placedGlyph) {\n                return {notEnoughRoom: true};\n            }\n            placedGlyphs.push(placedGlyph);\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 = projectTileCoordinatesToLabelPlane(projectionContext.tileAnchorPoint.x, projectionContext.tileAnchorPoint.y, projectionContext).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 = projectTileCoordinatesToLabelPlane(tileSegmentEnd.x, tileSegmentEnd.y, projectionContext);\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, projectionContext);\n\n            const clipSpaceA = projectFromLabelPlaneToClipSpace(a.x, a.y, projectionContext, pitchedLabelPlaneMatrixInverse);\n            const clipSpaceB = projectFromLabelPlaneToClipSpace(b.x, b.y, projectionContext, pitchedLabelPlaneMatrixInverse);\n\n            const orientationChange = requiresOrientationChange(symbol.writingMode, clipSpaceA, clipSpaceB, 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`, projects it to the correct label plane,\n * and returns a projected point along this projected line that is `minimumLength` distance away from `previousProjectedPoint`.\n * Projects a \"virtual\" vertex along a line segment.\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 projectionContext - Projection context, used to get terrain's `getElevation`, and to project the points to screen pixels.\n */\nfunction projectTruncatedLineSegmentToLabelPlane(previousTilePoint: Point, currentTilePoint: Point, previousProjectedPoint: Point, minimumLength: number, 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 = projectTileCoordinatesToLabelPlane(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     * Matrix for transforming from pixels (symbol shaping) to potentially rotated tile units (pitched map label plane).\n     */\n    pitchedLabelPlaneMatrix: 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    transform: IReadonlyTransform;\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 */\nexport function projectLineVertexToLabelPlane(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 = projectTileCoordinatesToLabelPlane(currentVertex.x, currentVertex.y, projectionContext);\n\n    if (projection.signedDistanceFromCamera > 0) {\n        cache.projections[index] = projection.point;\n        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 projectTruncatedLineSegmentToLabelPlane(previousTilePoint, currentVertex, syntheticVertexArgs.previousVertex, minimumLength, projectionContext);\n}\n\n/**\n * Projects the given point in tile coordinates to the correct label plane.\n * If pitchWithMap is true, the (rotated) map plane in pixels is used,\n * otherwise screen pixels are used.\n */\nexport function projectTileCoordinatesToLabelPlane(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) {\n        projection = projectWithMatrix(translatedX, translatedY, projectionContext.pitchedLabelPlaneMatrix, projectionContext.getElevation);\n        projection.isOccluded = false;\n    } else {\n        projection = projectionContext.transform.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    }\n    return projection;\n}\n\nfunction projectFromLabelPlaneToClipSpace(x: number, y: number, projectionContext: SymbolProjectionContext, pitchedLabelPlaneMatrixInverse: mat4): {x: number; y: number} {\n    if (projectionContext.pitchWithMap) {\n        const pos = [x, y, 0, 1] as vec4;\n        vec4.transformMat4(pos, pos, pitchedLabelPlaneMatrixInverse);\n        return projectionContext.transform.projectTileCoordinates(pos[0] / pos[3], pos[1] / pos[3], projectionContext.unwrappedTileID, projectionContext.getElevation).point;\n    } else {\n        return {\n            x: (x / projectionContext.width) * 2.0 - 1.0,\n            y: 1.0 - (y / projectionContext.height) * 2.0\n        };\n    }\n}\n\n/**\n * Projects the given point in tile coordinates to the GL clip space (-1..1).\n */\nexport function projectTileCoordinatesToClipSpace(x: number, y: number, projectionContext: SymbolProjectionContext): PointProjection {\n    const projection = projectionContext.transform.projectTileCoordinates(x, y, projectionContext.unwrappedTileID, projectionContext.getElevation);\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 */\nexport function 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 */\nexport function 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 = projectLineVertexToLabelPlane(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: 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 */\nexport function 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 viewport and cache it\n    let anchorPoint: Point;\n\n    if (projectionContext.projectionCache.cachedAnchorPoint) {\n        anchorPoint = projectionContext.projectionCache.cachedAnchorPoint;\n    } else {\n        anchorPoint = projectTileCoordinatesToLabelPlane(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: 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 = projectLineVertexToLabelPlane(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 = projectLineVertexToLabelPlane(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            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.\nexport function 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\nexport function 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\n/**\n * Takes a path of points that was previously projected using the `pitchedLabelPlaneMatrix`\n * and projects it using the map projection's (mercator/globe...) `projectTileCoordinates` function.\n * Returns a new array of the projected points.\n * Does not modify the input array.\n */\nexport function projectPathSpecialProjection(projectedPath: Point[], projectionContext: SymbolProjectionContext): PointProjection[] {\n    const inverseLabelPlaneMatrix = tmpMat4;\n    fastInvertSkewMat4(inverseLabelPlaneMatrix, projectionContext.pitchedLabelPlaneMatrix);\n    return projectedPath.map(p => {\n        const backProjected = projectWithMatrix(p.x, p.y, inverseLabelPlaneMatrix, projectionContext.getElevation);\n        const projected = projectionContext.transform.projectTileCoordinates(\n            backProjected.point.x,\n            backProjected.point.y,\n            projectionContext.unwrappedTileID,\n            projectionContext.getElevation\n        );\n        projected.point.x = (projected.point.x * 0.5 + 0.5) * projectionContext.width;\n        projected.point.y = (-projected.point.y * 0.5 + 0.5) * projectionContext.height;\n        return projected;\n    });\n}\n\n/**\n * Takes a path of points projected to screenspace, finds the longest continuous unoccluded segment of that path\n * and returns it.\n * Does not modify the input array.\n */\nexport function pathSlicedToLongestUnoccluded(path: PointProjection[]): PointProjection[] {\n    let longestUnoccludedStart = 0;\n    let longestUnoccludedLength = 0;\n    let currentUnoccludedStart = 0;\n    let currentUnoccludedLength = 0;\n    for (let i = 0; i < path.length; i++) {\n        if (path[i].isOccluded) {\n            currentUnoccludedStart = i + 1;\n            currentUnoccludedLength = 0;\n        } else {\n            currentUnoccludedLength++;\n            if (currentUnoccludedLength > longestUnoccludedLength) {\n                longestUnoccludedLength = currentUnoccludedLength;\n                longestUnoccludedStart = currentUnoccludedStart;\n            }\n        }\n    }\n    return path.slice(longestUnoccludedStart, longestUnoccludedStart + longestUnoccludedLength);\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 type {IReadonlyTransform} from '../geo/transform_interface';\nimport type {SingleCollisionBox} from '../data/bucket/symbol_bucket';\nimport type {\n    GlyphOffsetArray,\n    PlacedSymbol,\n    SymbolLineVertexArray\n} from '../data/array_types.g';\nimport type {OverlapMode} from '../style/style_layer/overlap_mode';\nimport {type OverscaledTileID, type UnwrappedTileID} from '../tile/tile_id';\nimport {type PointProjection, type SymbolProjectionContext, getTileSkewVectors, pathSlicedToLongestUnoccluded, placeFirstAndLastGlyph, projectPathSpecialProjection, xyTransformMat4} from '../symbol/projection';\nimport {clamp, getAABB} from '../util/util';\nimport {Bounds} from '../geo/bounds';\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: number[];\n    offscreen: boolean;\n    collisionDetected: boolean;\n};\n\nexport type PlacedBox = {\n    box: number[];\n    placeable: boolean;\n    offscreen: boolean;\n    occluded: 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: IReadonlyTransform;\n    pitchFactor: number;\n    screenRightBoundary: number;\n    screenBottomBoundary: number;\n    gridRightBoundary: number;\n    gridBottomBoundary: number;\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: IReadonlyTransform,\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\n        this.grid = grid;\n        this.ignoredGrid = ignoredGrid;\n        this.pitchFactor = Math.cos(transform.pitch * Math.PI / 180.0) * 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        tileID: OverscaledTileID,\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        simpleProjectionMatrix?: mat4,\n    ): PlacedBox {\n        const x = collisionBox.anchorPointX + translation[0];\n        const y = collisionBox.anchorPointY + translation[1];\n        const projectedPoint = this.projectAndGetPerspectiveRatio(\n            x,\n            y,\n            unwrappedTileID,\n            getElevation,\n            simpleProjectionMatrix\n        );\n\n        const tileToViewport = textPixelRatio * projectedPoint.perspectiveRatio;\n        let projectedBox: ProjectedBox;\n\n        if (!pitchWithMap && !rotateWithMap) {\n            // Fast path for common symbols\n            const pointX = projectedPoint.x + (shift ? shift.x * tileToViewport : 0);\n            const pointY = projectedPoint.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                tileID,\n                unwrappedTileID,\n                pitchWithMap,\n                rotateWithMap,\n                translation,\n                projectedPoint,\n                getElevation,\n                shift,\n                simpleProjectionMatrix,\n            );\n        }\n\n        const [tlX, tlY, brX, brY] = projectedBox.box;\n\n        // Conditions are ordered from the fastest to evaluate to the slowest.\n        const occluded = pitchWithMap ? projectedBox.allPointsOccluded : projectedPoint.isOccluded;\n\n        let unplaceable = occluded;\n        unplaceable ||= projectedPoint.perspectiveRatio < this.perspectiveRatioCutoff;\n        unplaceable ||= !this.isInsideGrid(tlX, tlY, brX, brY);\n\n        if (unplaceable ||\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                occluded\n            };\n        }\n\n        return {\n            box: [tlX, tlY, brX, brY],\n            placeable: true,\n            offscreen: this.isOffscreen(tlX, tlY, brX, brY),\n            occluded\n        };\n    }\n\n    placeCollisionCircles(\n        overlapMode: OverlapMode,\n        symbol: PlacedSymbol,\n        lineVertexArray: SymbolLineVertexArray,\n        glyphOffsetArray: GlyphOffsetArray,\n        fontSize: number,\n        unwrappedTileID: UnwrappedTileID,\n        pitchedLabelPlaneMatrix: 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(tileUnitAnchorPoint.x, tileUnitAnchorPoint.y, unwrappedTileID, getElevation);\n\n        const labelPlaneFontSize = pitchWithMap ? (fontSize * this.transform.getPitchedTextCorrection(symbol.anchorX, symbol.anchorY, unwrappedTileID) / 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            pitchedLabelPlaneMatrix,\n            lineVertexArray,\n            pitchWithMap,\n            projectionCache,\n            transform: this.transform,\n            tileAnchorPoint: tileUnitAnchorPoint,\n            unwrappedTileID,\n            width: this.transform.width,\n            height: this.transform.height,\n            translation\n        };\n\n        const firstAndLastGlyph = 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: 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 (pitchWithMap) {\n                const screenSpacePath = this.projectPathToScreenSpace(projectedPath, projectionContext);\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 &&= this.isOffscreen(x1, y1, x2, y2);\n                    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: Point[], projectionContext: SymbolProjectionContext): PointProjection[] {\n        const screenSpacePath = projectPathSpecialProjection(projectedPath, projectionContext);\n        // We don't want to generate screenspace collision circles for parts of the line that\n        // are occluded by the planet itself. Find the longest segment of the path that is\n        // not occluded, and remove everything else.\n        return pathSlicedToLongestUnoccluded(screenSpacePath);\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: Point[]) {\n        if (viewportQueryGeometry.length === 0 || (this.grid.keysLength() === 0 && this.ignoredGrid.keysLength() === 0)) {\n            return {};\n        }\n\n        const query = [];\n        const bounds = new Bounds();\n        for (const point of viewportQueryGeometry) {\n            const gridPoint = new Point(point.x + viewportPadding, point.y + viewportPadding);\n            bounds.extend(gridPoint);\n            query.push(gridPoint);\n        }\n\n        const {minX, minY, maxX, maxY} = bounds;\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: 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: 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(x: number, y: number, unwrappedTileID: UnwrappedTileID, getElevation?: (x: number, y: number) => number, simpleProjectionMatrix?: mat4) {\n        if (simpleProjectionMatrix) {\n            // This branch is a fast-path for mercator transform.\n            // The code here is a copy of MercatorTransform.projectTileCoordinates, slightly modified for extra performance.\n            // This has a huge impact for some reason.\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, simpleProjectionMatrix);\n            } else { // fast because of ignore z-index\n                pos = [x, y, 0, 1] as vec4;\n                xyTransformMat4(pos, pos, simpleProjectionMatrix);\n            }\n            const w = pos[3];\n            return {\n                x: (((pos[0] / w + 1) / 2) * this.transform.width) + viewportPadding,\n                y: (((-pos[1] / w + 1) / 2) * this.transform.height) + viewportPadding,\n                perspectiveRatio: 0.5 + 0.5 * (this.transform.cameraToCenterDistance / w),\n                isOccluded: false,\n                signedDistanceFromCamera: w\n            };\n        } else {\n            const projected = this.transform.projectTileCoordinates(x, y, unwrappedTileID, getElevation);\n            return {\n                x: (((projected.point.x + 1) / 2) * this.transform.width) + viewportPadding,\n                y: (((-projected.point.y + 1) / 2) * this.transform.height) + viewportPadding,\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 / projected.signedDistanceFromCamera),\n                isOccluded: projected.isOccluded,\n                signedDistanceFromCamera: projected.signedDistanceFromCamera\n            };\n        }\n    }\n\n    getPerspectiveRatio(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.transform.projectTileCoordinates(x, y, unwrappedTileID, 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        tileID: OverscaledTileID,\n        unwrappedTileID: UnwrappedTileID,\n        pitchWithMap: boolean,\n        rotateWithMap: boolean,\n        translation: [number, number],\n        projectedPoint: {x: number; y: number; perspectiveRatio: number; signedDistanceFromCamera: number},\n        getElevation?: (x: number, y: number) => number,\n        shift?: Point,\n        simpleProjectionMatrix?: mat4,\n    ): ProjectedBox {\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 vecEastX = 1;\n        let vecEastY = 0;\n        let vecSouthX = 0;\n        let vecSouthY = 1;\n\n        const translatedAnchorX = collisionBox.anchorPointX + translation[0];\n        const translatedAnchorY = 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                translatedAnchorX + 1,\n                translatedAnchorY,\n                unwrappedTileID,\n                getElevation,\n                simpleProjectionMatrix,\n            );\n            const toEastX = projectedEast.x - projectedPoint.x;\n            const toEastY = projectedEast.y - projectedPoint.y;\n            const angle = Math.atan(toEastY / toEastX) + (toEastX < 0 ? Math.PI : 0);\n            const sin = Math.sin(angle);\n            const cos = Math.cos(angle);\n            vecEastX = cos;\n            vecEastY = sin;\n            vecSouthX = -sin;\n            vecSouthY = cos;\n        } else if (!rotateWithMap && pitchWithMap) {\n            // Handles pitch-align: map texts that are always aligned with the viewport's X axis.\n            const skew = getTileSkewVectors(this.transform);\n            vecEastX = skew.vecEast[0];\n            vecEastY = skew.vecEast[1];\n            vecSouthX = skew.vecSouth[0];\n            vecSouthY = skew.vecSouth[1];\n        }\n\n        // Configuration for screen space offsets\n        let basePointX = projectedPoint.x;\n        let basePointY = projectedPoint.y;\n        let distanceMultiplier = tileToViewport;\n\n        if (pitchWithMap) {\n            // Configuration for tile space (map-pitch-aligned) offsets\n            basePointX = translatedAnchorX;\n            basePointY = translatedAnchorY;\n\n            const zoomFraction = this.transform.zoom - tileID.overscaledZ;\n            distanceMultiplier = Math.pow(2, -zoomFraction);\n            distanceMultiplier *= this.transform.getPitchedTextCorrection(translatedAnchorX, translatedAnchorY, 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            basePointX += vecEastX * shift.x * distanceMultiplier + vecSouthX * shift.y * distanceMultiplier;\n            basePointY += vecEastY * shift.x * distanceMultiplier + vecSouthY * 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: Point[] = [];\n\n        for (const {offsetX, offsetY} of offsetsArray) {\n            points.push(new Point(\n                basePointX + vecEastX * offsetX + vecSouthX * offsetY,\n                basePointY + vecEastY * offsetX + vecSouthY * 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(p.x, p.y, unwrappedTileID, getElevation, simpleProjectionMatrix));\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 => new Point(p.x, p.y));\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 {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 {type mat4} from 'gl-matrix';\nimport {pixelsToTileUnits} from '../source/pixels_to_tile_units';\nimport Point from '@mapbox/point-geometry';\nimport type {IReadonlyTransform, ITransform} from '../geo/transform_interface';\nimport type {StyleLayer} from '../style/style_layer';\nimport {type PossiblyEvaluated} from '../style/properties';\nimport type {SymbolLayoutProps, SymbolLayoutPropsPossiblyEvaluated} from '../style/style_layer/symbol_style_layer_properties.g';\nimport {getOverlapMode, type OverlapMode} from '../style/style_layer/overlap_mode';\n\nimport type {Tile} from '../tile/tile';\nimport type {SymbolBucket, CollisionArrays, SingleCollisionBox, SymbolBuffers} from '../data/bucket/symbol_bucket';\nimport type {CollisionBoxArray, CollisionVertexArray, SymbolInstance, TextAnchorOffset} from '../data/array_types.g';\nimport type {FeatureIndex} from '../data/feature_index';\nimport type {OverscaledTileID, UnwrappedTileID} from '../tile/tile_id';\nimport {type Terrain} from '../render/terrain';\nimport {translatePosition, warnOnce} from '../util/util';\nimport {type TextAnchor, TextAnchorEnum} from '../style/style_layer/variable_text_anchor';\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\nexport class RetainedQueryData {\n    bucketInstanceId: number;\n    featureIndex: FeatureIndex;\n    sourceLayerIndex: number;\n    bucketIndex: number;\n    tileID: OverscaledTileID;\n    featureSortOrder: 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    pitchedLabelPlaneMatrix: 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: IReadonlyTransform;\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]: number[];\n    };\n    collisionBoxArrays: Map<number, Map<number, {\n        text: number[];\n        icon: number[];\n    }>>;\n\n    constructor(transform: ITransform, terrain: Terrain, fadeDuration: number, crossSourceCollisions: boolean, prevPlacement?: Placement) {\n        this.transform = transform.clone();\n        this.terrain = terrain;\n        this.collisionIndex = new CollisionIndex(this.transform);\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        if (!terrain) return null;\n        return (x: number, y: number) => terrain.getElevation(tileID, x, y);\n    }\n\n    getBucketParts(results: 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 rotateWithMap = layout.get('text-rotation-alignment') === 'map';\n        const pixelsToTiles = pixelsToTileUnits(tile, 1, this.transform.zoom);\n\n        const translationText = translatePosition(\n            this.collisionIndex.transform,\n            tile,\n            paint.get('text-translate'),\n            paint.get('text-translate-anchor'),);\n\n        const translationIcon = translatePosition(\n            this.collisionIndex.transform,\n            tile,\n            paint.get('icon-translate'),\n            paint.get('icon-translate-anchor'),);\n\n        const pitchedLabelPlaneMatrix = projection.getPitchedLabelPlaneMatrix(rotateWithMap, this.transform, pixelsToTiles);\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            unwrappedTileID,\n            pitchedLabelPlaneMatrix,\n            scale,\n            textPixelRatio,\n            holdingForFade: tile.holdingForSymbolFade(),\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        tileID: OverscaledTileID,\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        simpleProjectionMatrix?: mat4,\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            tileID,\n            unwrappedTileID,\n            pitchWithMap,\n            rotateWithMap,\n            translationText,\n            collisionGroup.predicate,\n            getElevation,\n            shift,\n            simpleProjectionMatrix,\n        );\n\n        if (iconBox) {\n            const placedIconBoxes = this.collisionIndex.placeCollisionBox(\n                iconBox,\n                textOverlapMode,\n                textPixelRatio,\n                tileID,\n                unwrappedTileID,\n                pitchWithMap,\n                rotateWithMap,\n                translationIcon,\n                collisionGroup.predicate,\n                getElevation,\n                shift,\n                simpleProjectionMatrix,\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?.variableOffsets[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            unwrappedTileID,\n            pitchedLabelPlaneMatrix,\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        const simpleProjectionMatrix = this.transform.getFastPathSimpleProjectionMatrix(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, occluded: false};\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?.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                            tileID,\n                            unwrappedTileID,\n                            pitchWithMap,\n                            rotateWithMap,\n                            translationText,\n                            collisionGroup.predicate,\n                            getElevation,\n                            undefined,\n                            simpleProjectionMatrix,\n                        );\n                        if (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?.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, tileID, unwrappedTileID,\n                                    collisionGroup, overlapMode, symbolInstance, bucket, orientation, translationText, translationIcon, variableIconBox, getElevation);\n\n                                if (result) {\n                                    placedBox = result.placedGlyphBoxes;\n                                    if (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                                tileID,\n                                unwrappedTileID,\n                                pitchWithMap,\n                                rotateWithMap,\n                                translationText,\n                                collisionGroup.predicate,\n                                getElevation,\n                                undefined,\n                                simpleProjectionMatrix,\n                            );\n                            placedBox = {\n                                box: placedFakeGlyphBox.box,\n                                offscreen: false,\n                                placeable: false,\n                                occluded: 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?.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?.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?.placeable;\n            offscreen = placedGlyphBoxes?.offscreen;\n\n            if (symbolInstance.useRuntimeCollisionCircles && symbolInstance.centerJustifiedTextSymbolIndex >= 0) {\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                    unwrappedTileID,\n                    pitchedLabelPlaneMatrix,\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 &&= 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                        tileID,\n                        unwrappedTileID,\n                        pitchWithMap,\n                        rotateWithMap,\n                        translationIcon,\n                        collisionGroup.predicate,\n                        getElevation,\n                        (hasIconTextFit && shift) ? shift : undefined,\n                        simpleProjectionMatrix,\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 &&= 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 &&= 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            // Do not show text or icons that are occluded by the globe, even if overlap mode is 'always'!\n            const textVisible: boolean = (placeText || alwaysShowText) && !(placedGlyphBoxes?.occluded);\n            const iconVisible = (placeIcon || alwaysShowIcon) && !(placedIconBoxes?.occluded);\n            this.placements[symbolInstance.crossTileID] = new JointPlacement(textVisible, iconVisible, 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.bearingInRadians);\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        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] = [];\n\n            for (let i = 0; i < placedGlyphCircles.circles.length; i += 4) {\n                circleArray.push(placedGlyphCircles.circles[i + 0] - viewportPadding); // x\n                circleArray.push(placedGlyphCircles.circles[i + 1] - viewportPadding); // y\n                circleArray.push(placedGlyphCircles.circles[i + 2]);                   // radius\n                circleArray.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 ||= jointPlacement.text !== prevOpacity.text.placed;\n                placementChanged ||= jointPlacement.icon !== prevOpacity.icon.placed;\n            } else {\n                this.opacities[crossTileID] = new JointOpacityState(null, increment, jointPlacement.text, jointPlacement.icon, jointPlacement.skipFade);\n                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 ||= prevOpacity.text.placed;\n                    placementChanged ||= 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: 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: SymbolBuffers, numVertices: number, opacity: number) => {\n            for (let i = 0; i < numVertices / 4; i++) {\n                iconOrText.opacityVertexArray.emplaceBack(opacity);\n            }\n            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                const textSymbolIndexes = [\n                    symbolInstance.rightJustifiedTextSymbolIndex,\n                    symbolInstance.centerJustifiedTextSymbolIndex,\n                    symbolInstance.leftJustifiedTextSymbolIndex\n                ];\n                for (const index of textSymbolIndexes) {\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?.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.bearingInRadians : this.transform.bearingInRadians);\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.bearingInRadians);\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            bucket.collisionCircleArray = this.collisionCircleArrays[bucket.bucketInstanceId];\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: 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 {now} from '../util/time_control';\nimport {Placement} from '../symbol/placement';\nimport {isSymbolStyleLayer, type SymbolStyleLayer} from './style_layer/symbol_style_layer';\nimport type {ITransform} from '../geo/transform_interface';\nimport type {StyleLayer} from './style_layer';\nimport type {Tile} from '../tile/tile';\nimport type {BucketPart} from '../symbol/placement';\nimport type {Terrain} from '../render/terrain';\n\nclass LayerPlacement {\n    _sortAcrossTiles: boolean;\n    _currentTileIndex: number;\n    _currentPartIndex: number;\n    _seenCrossTileIDs: {\n        [k in string | number]: boolean;\n    };\n    _bucketParts: 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: 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: ITransform,\n        terrain: Terrain,\n        order: string[],\n        forceFullPlacement: boolean,\n        showCollisionBoxes: boolean,\n        fadeDuration: number,\n        crossSourceCollisions: boolean,\n        prevPlacement?: Placement\n    ) {\n        this.placement = new Placement(transform, 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: string[],\n        layers: {[_: string]: StyleLayer},\n        layerTiles: {[_: string]: Tile[]}\n    ) {\n        const startTime = now();\n\n        const shouldPausePlacement = () => {\n            return this._forceFullPlacement ? false : (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 (isSymbolStyleLayer(layer) &&\n                layer.layout &&\n                (!layer.minzoom || layer.minzoom <= placementZoom) &&\n                (!layer.maxzoom || layer.maxzoom > placementZoom)) {\n\n                this._inProgressLayer ||= new LayerPlacement(layer);\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 type {SymbolInstance} from '../data/array_types.g';\nimport {type SymbolInstanceArray} from '../data/array_types.g';\nimport type {OverscaledTileID} from '../tile/tile_id';\nimport type {SymbolBucket} from '../data/bucket/symbol_bucket';\nimport type {StyleLayer} from '../style/style_layer';\nimport type {Tile} from '../tile/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\ntype SymbolsByKeyEntry = {\n    index?: KDBush;\n    positions?: Array<{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        return {\n            x: Math.floor(xWorld - xOffset),\n            y: Math.floor(yWorld - yOffset)\n        };\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]?.[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        this.usedCrossTileIDs[tileID.overscaledZ] ||= {};\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: 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 (styleLayer.id !== symbolBucket?.layerIds[0])\n                continue;\n\n            if (!symbolBucket.bucketInstanceId) {\n                this.maxBucketInstanceId += 1;\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: string[]) {\n        const usedLayerMap = {};\n        for (const usedLayer of usedLayers) {\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", "// 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\\nout highp vec4 fragColor;';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'void main() {fragColor=vec4(1.0);}';\n", "// Disable Flow annotations here because Flow doesn't support importing GLSL files\n\nimport preludeFrag from './glsl/_prelude.fragment.glsl.g';\nimport preludeVert from './glsl/_prelude.vertex.glsl.g';\nimport backgroundFrag from './glsl/background.fragment.glsl.g';\nimport backgroundVert from './glsl/background.vertex.glsl.g';\nimport backgroundPatternFrag from './glsl/background_pattern.fragment.glsl.g';\nimport backgroundPatternVert from './glsl/background_pattern.vertex.glsl.g';\nimport circleFrag from './glsl/circle.fragment.glsl.g';\nimport circleVert from './glsl/circle.vertex.glsl.g';\nimport clippingMaskFrag from './glsl/clipping_mask.fragment.glsl.g';\nimport clippingMaskVert from './glsl/clipping_mask.vertex.glsl.g';\nimport heatmapFrag from './glsl/heatmap.fragment.glsl.g';\nimport heatmapVert from './glsl/heatmap.vertex.glsl.g';\nimport heatmapTextureFrag from './glsl/heatmap_texture.fragment.glsl.g';\nimport heatmapTextureVert from './glsl/heatmap_texture.vertex.glsl.g';\nimport collisionBoxFrag from './glsl/collision_box.fragment.glsl.g';\nimport collisionBoxVert from './glsl/collision_box.vertex.glsl.g';\nimport collisionCircleFrag from './glsl/collision_circle.fragment.glsl.g';\nimport collisionCircleVert from './glsl/collision_circle.vertex.glsl.g';\nimport colorReliefFrag from './glsl/color_relief.fragment.glsl.g';\nimport colorReliefVert from './glsl/color_relief.vertex.glsl.g';\nimport debugFrag from './glsl/debug.fragment.glsl.g';\nimport debugVert from './glsl/debug.vertex.glsl.g';\nimport depthVert from './glsl/depth.vertex.glsl.g';\nimport fillFrag from './glsl/fill.fragment.glsl.g';\nimport fillVert from './glsl/fill.vertex.glsl.g';\nimport fillOutlineFrag from './glsl/fill_outline.fragment.glsl.g';\nimport fillOutlineVert from './glsl/fill_outline.vertex.glsl.g';\nimport fillOutlinePatternFrag from './glsl/fill_outline_pattern.fragment.glsl.g';\nimport fillOutlinePatternVert from './glsl/fill_outline_pattern.vertex.glsl.g';\nimport fillPatternFrag from './glsl/fill_pattern.fragment.glsl.g';\nimport fillPatternVert from './glsl/fill_pattern.vertex.glsl.g';\nimport fillExtrusionFrag from './glsl/fill_extrusion.fragment.glsl.g';\nimport fillExtrusionVert from './glsl/fill_extrusion.vertex.glsl.g';\nimport fillExtrusionPatternFrag from './glsl/fill_extrusion_pattern.fragment.glsl.g';\nimport fillExtrusionPatternVert from './glsl/fill_extrusion_pattern.vertex.glsl.g';\nimport hillshadePrepareFrag from './glsl/hillshade_prepare.fragment.glsl.g';\nimport hillshadePrepareVert from './glsl/hillshade_prepare.vertex.glsl.g';\nimport hillshadeFrag from './glsl/hillshade.fragment.glsl.g';\nimport hillshadeVert from './glsl/hillshade.vertex.glsl.g';\nimport lineFrag from './glsl/line.fragment.glsl.g';\nimport lineVert from './glsl/line.vertex.glsl.g';\nimport lineGradientFrag from './glsl/line_gradient.fragment.glsl.g';\nimport lineGradientVert from './glsl/line_gradient.vertex.glsl.g';\nimport linePatternFrag from './glsl/line_pattern.fragment.glsl.g';\nimport linePatternVert from './glsl/line_pattern.vertex.glsl.g';\nimport lineSDFFrag from './glsl/line_sdf.fragment.glsl.g';\nimport lineSDFVert from './glsl/line_sdf.vertex.glsl.g';\nimport lineGradientSDFFrag from './glsl/line_gradient_sdf.fragment.glsl.g';\nimport lineGradientSDFVert from './glsl/line_gradient_sdf.vertex.glsl.g';\nimport rasterFrag from './glsl/raster.fragment.glsl.g';\nimport rasterVert from './glsl/raster.vertex.glsl.g';\nimport symbolIconFrag from './glsl/symbol_icon.fragment.glsl.g';\nimport symbolIconVert from './glsl/symbol_icon.vertex.glsl.g';\nimport symbolSDFFrag from './glsl/symbol_sdf.fragment.glsl.g';\nimport symbolSDFVert from './glsl/symbol_sdf.vertex.glsl.g';\nimport symbolTextAndIconFrag from './glsl/symbol_text_and_icon.fragment.glsl.g';\nimport symbolTextAndIconVert from './glsl/symbol_text_and_icon.vertex.glsl.g';\nimport terrainDepthFrag from './glsl/terrain_depth.fragment.glsl.g';\nimport terrainCoordsFrag from './glsl/terrain_coords.fragment.glsl.g';\nimport terrainFrag from './glsl/terrain.fragment.glsl.g';\nimport terrainVert from './glsl/terrain.vertex.glsl.g';\nimport terrainVertDepth from './glsl/terrain_depth.vertex.glsl.g';\nimport terrainVertCoords from './glsl/terrain_coords.vertex.glsl.g';\nimport projectionErrorMeasurementVert from './glsl/projection_error_measurement.vertex.glsl.g';\nimport projectionErrorMeasurementFrag from './glsl/projection_error_measurement.fragment.glsl.g';\nimport projectionMercatorVert from './glsl/_projection_mercator.vertex.glsl.g';\nimport projectionGlobeVert from './glsl/_projection_globe.vertex.glsl.g';\nimport atmosphereFrag from './glsl/atmosphere.fragment.glsl.g';\nimport atmosphereVert from './glsl/atmosphere.vertex.glsl.g';\nimport skyFrag from './glsl/sky.fragment.glsl.g';\nimport skyVert from './glsl/sky.vertex.glsl.g';\n\nexport type PreparedShader = {\n    fragmentSource: string;\n    vertexSource: string;\n    staticAttributes: string[];\n    staticUniforms: string[];\n};\n\nexport const shaders = {\n    prelude: prepare(preludeFrag, preludeVert),\n    projectionMercator: prepare('', projectionMercatorVert),\n    projectionGlobe: prepare('', projectionGlobeVert),\n    background: prepare(backgroundFrag, backgroundVert),\n    backgroundPattern: prepare(backgroundPatternFrag, backgroundPatternVert),\n    circle: prepare(circleFrag, circleVert),\n    clippingMask: prepare(clippingMaskFrag, clippingMaskVert),\n    heatmap: prepare(heatmapFrag, heatmapVert),\n    heatmapTexture: prepare(heatmapTextureFrag, heatmapTextureVert),\n    collisionBox: prepare(collisionBoxFrag, collisionBoxVert),\n    collisionCircle: prepare(collisionCircleFrag, collisionCircleVert),\n    colorRelief: prepare(colorReliefFrag, colorReliefVert),\n    debug: prepare(debugFrag, debugVert),\n    depth: prepare(clippingMaskFrag, depthVert),\n    fill: prepare(fillFrag, fillVert),\n    fillOutline: prepare(fillOutlineFrag, fillOutlineVert),\n    fillOutlinePattern: prepare(fillOutlinePatternFrag, fillOutlinePatternVert),\n    fillPattern: prepare(fillPatternFrag, fillPatternVert),\n    fillExtrusion: prepare(fillExtrusionFrag, fillExtrusionVert),\n    fillExtrusionPattern: prepare(fillExtrusionPatternFrag, fillExtrusionPatternVert),\n    hillshadePrepare: prepare(hillshadePrepareFrag, hillshadePrepareVert),\n    hillshade: prepare(hillshadeFrag, hillshadeVert),\n    line: prepare(lineFrag, lineVert),\n    lineGradient: prepare(lineGradientFrag, lineGradientVert),\n    linePattern: prepare(linePatternFrag, linePatternVert),\n    lineSDF: prepare(lineSDFFrag, lineSDFVert),\n    lineGradientSDF: prepare(lineGradientSDFFrag, lineGradientSDFVert),\n    raster: prepare(rasterFrag, rasterVert),\n    symbolIcon: prepare(symbolIconFrag, symbolIconVert),\n    symbolSDF: prepare(symbolSDFFrag, symbolSDFVert),\n    symbolTextAndIcon: prepare(symbolTextAndIconFrag, symbolTextAndIconVert),\n    terrain: prepare(terrainFrag, terrainVert),\n    terrainDepth: prepare(terrainDepthFrag, terrainVertDepth),\n    terrainCoords: prepare(terrainCoordsFrag, terrainVertCoords),\n    projectionErrorMeasurement: prepare(projectionErrorMeasurementFrag, projectionErrorMeasurementVert),\n    atmosphere: prepare(atmosphereFrag, atmosphereVert),\n    sky: prepare(skyFrag, skyVert),\n};\n\n/** Expand #pragmas to #ifdefs, extract attributes and uniforms */\nfunction prepare(fragmentSource: string, vertexSource: string): PreparedShader {\n    const re = /#pragma mapbox: ([\\w]+) ([\\w]+) ([\\w]+) ([\\w]+)/g;\n\n    const vertexAttributes = vertexSource.match(/in ([\\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 shaderUniforms = 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}\nin ${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;\nin ${precision} ${attrType} a_${name};\nout ${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;\nin ${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: vertexAttributes, staticUniforms: shaderUniforms};\n}\n\n/** Transpile WebGL2 vertex shader source to WebGL1 */\nexport function transpileVertexShaderToWebGL1(source: string): string {\n    return source\n        .replace(/\\bin\\s/g, 'attribute ')\n        .replace(/\\bout\\s/g, 'varying ')\n        .replace(/texture\\(/g, 'texture2D(');\n}\n\n/** Transpile WebGL2 fragment shader source to WebGL1 */\nexport function transpileFragmentShaderToWebGL1(source: string): string {\n    return source\n        .replace(/\\bin\\s/g, 'varying ')\n        .replace('out highp vec4 fragColor;', '')\n        .replace(/fragColor/g, 'gl_FragColor')\n        .replace(/texture\\(/g, 'texture2D(');\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;}mat3 rotationMatrixFromAxisAngle(vec3 u,float angle) {float c=cos(angle);float s=sin(angle);float c2=1.0-c;return mat3(u.x*u.x*c2+      c,u.x*u.y*c2-u.z*s,u.x*u.z*c2+u.y*s,u.y*u.x*c2+u.z*s,u.y*u.y*c2+    c,u.y*u.z*c2-u.x*s,u.z*u.x*c2-u.y*s,u.z*u.y*c2+u.x*s,u.z*u.z*c2+    c\\n);}\\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(texture(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=(texture(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\\n#ifdef GLOBE\\nif ((pos.y <-32767.5) || (pos.y > 32766.5)) {return 0.0;}\\n#endif\\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}const float PI=3.141592653589793;uniform mat4 u_projection_matrix;';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'float projectLineThickness(float tileY) {return 1.0;}float projectCircleRadius(float tileY) {return 1.0;}vec4 projectTile(vec2 p) {vec4 result=u_projection_matrix*vec4(p,0.0,1.0);return result;}vec4 projectTile(vec2 p,vec2 rawPos) {vec4 result=u_projection_matrix*vec4(p,0.0,1.0);if (rawPos.y <-32767.5 || rawPos.y > 32766.5) {result.z=-10000000.0;}return result;}vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_projection_matrix*vec4(posInTile,elevation,1.0);}vec4 projectTileFor3D(vec2 posInTile,float elevation) {return projectTileWithElevation(posInTile,elevation);}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default '#define GLOBE_RADIUS 6371008.8\\nuniform highp vec4 u_projection_tile_mercator_coords;uniform highp vec4 u_projection_clipping_plane;uniform highp float u_projection_transition;uniform mat4 u_projection_fallback_matrix;vec3 globeRotateVector(vec3 vec,vec2 angles) {vec3 axisRight=vec3(vec.z,0.0,-vec.x);vec3 axisUp=cross(axisRight,vec);axisRight=normalize(axisRight);axisUp=normalize(axisUp);vec2 t=tan(angles);return normalize(vec+axisRight*t.x+axisUp*t.y);}mat3 globeGetRotationMatrix(vec3 spherePos) {vec3 axisRight=vec3(spherePos.z,0.0,-spherePos.x);vec3 axisDown=cross(axisRight,spherePos);axisRight=normalize(axisRight);axisDown=normalize(axisDown);return mat3(axisRight,axisDown,spherePos\\n);}float circumferenceRatioAtTileY(float tileY) {float mercator_pos_y=u_projection_tile_mercator_coords.y+u_projection_tile_mercator_coords.w*tileY;float spherical_y=2.0*atan(exp(PI-(mercator_pos_y*PI*2.0)))-PI*0.5;return cos(spherical_y);}float projectLineThickness(float tileY) {float thickness=1.0/circumferenceRatioAtTileY(tileY); \\nif (u_projection_transition < 0.999) {return mix(1.0,thickness,u_projection_transition);} else {return thickness;}}vec3 projectToSphere(vec2 translatedPos,vec2 rawPos) {vec2 mercator_pos=u_projection_tile_mercator_coords.xy+u_projection_tile_mercator_coords.zw*translatedPos;vec2 spherical;spherical.x=mercator_pos.x*PI*2.0+PI;spherical.y=2.0*atan(exp(PI-(mercator_pos.y*PI*2.0)))-PI*0.5;float len=cos(spherical.y);vec3 pos=vec3(sin(spherical.x)*len,sin(spherical.y),cos(spherical.x)*len\\n);if (rawPos.y <-32767.5) {pos=vec3(0.0,1.0,0.0);}if (rawPos.y > 32766.5) {pos=vec3(0.0,-1.0,0.0);}return pos;}vec3 projectToSphere(vec2 posInTile) {return projectToSphere(posInTile,vec2(0.0,0.0));}float globeComputeClippingZ(vec3 spherePos) {return (1.0-(dot(spherePos,u_projection_clipping_plane.xyz)+u_projection_clipping_plane.w));}vec4 interpolateProjection(vec2 posInTile,vec3 spherePos,float elevation) {vec3 elevatedPos=spherePos*(1.0+elevation/GLOBE_RADIUS);vec4 globePosition=u_projection_matrix*vec4(elevatedPos,1.0);globePosition.z=globeComputeClippingZ(elevatedPos)*globePosition.w;if (u_projection_transition > 0.999) {return globePosition;}vec4 flatPosition=u_projection_fallback_matrix*vec4(posInTile,elevation,1.0);const float z_globeness_threshold=0.2;vec4 result=globePosition;result.z=mix(0.0,globePosition.z,clamp((u_projection_transition-z_globeness_threshold)/(1.0-z_globeness_threshold),0.0,1.0));result.xyw=mix(flatPosition.xyw,globePosition.xyw,u_projection_transition);if ((posInTile.y <-32767.5) || (posInTile.y > 32766.5)) {result=globePosition;const float poles_hidden_anim_percentage=0.02;result.z=mix(globePosition.z,100.0,pow(max((1.0-u_projection_transition)/poles_hidden_anim_percentage,0.0),8.0));}return result;}vec4 interpolateProjectionFor3D(vec2 posInTile,vec3 spherePos,float elevation) {vec3 elevatedPos=spherePos*(1.0+elevation/GLOBE_RADIUS);vec4 globePosition=u_projection_matrix*vec4(elevatedPos,1.0);if (u_projection_transition > 0.999) {return globePosition;}vec4 fallbackPosition=u_projection_fallback_matrix*vec4(posInTile,elevation,1.0);return mix(fallbackPosition,globePosition,u_projection_transition);}vec4 projectTile(vec2 posInTile) {return interpolateProjection(posInTile,projectToSphere(posInTile),0.0);}vec4 projectTile(vec2 posInTile,vec2 rawPos) {return interpolateProjection(posInTile,projectToSphere(posInTile,rawPos),0.0);}vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return interpolateProjection(posInTile,projectToSphere(posInTile),elevation);}vec4 projectTileFor3D(vec2 posInTile,float elevation) {vec3 spherePos=projectToSphere(posInTile,posInTile);return interpolateProjectionFor3D(posInTile,spherePos,elevation);}';\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() {fragColor=u_color*u_opacity;\\n#ifdef OVERDRAW_INSPECTOR\\nfragColor=vec4(1.0);\\n#endif\\n}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'in vec2 a_pos;void main() {gl_Position=projectTile(a_pos);}';\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;in vec2 v_pos_a;in 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=texture(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=texture(u_image,pos2);fragColor=mix(color1,color2,u_mix)*u_opacity;\\n#ifdef OVERDRAW_INSPECTOR\\nfragColor=vec4(1.0);\\n#endif\\n}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default '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;in vec2 a_pos;out vec2 v_pos_a;out vec2 v_pos_b;void main() {gl_Position=projectTile(a_pos);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 'in vec3 v_data;in 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));fragColor=v_visibility*opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t);const float epsilon=0.5/255.0;if (fragColor.r < epsilon && fragColor.g < epsilon && fragColor.b < epsilon && fragColor.a < epsilon) {discard;}\\n#ifdef OVERDRAW_INSPECTOR\\nfragColor=vec4(1.0);\\n#endif\\n}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform highp float u_globe_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;uniform vec2 u_translate;in vec2 a_pos;out vec3 v_data;out 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 pos_raw=a_pos+32768.0;vec2 extrude=vec2(mod(pos_raw,8.0)/7.0*2.0-1.0);vec2 circle_center=floor(pos_raw/8.0)+u_translate;float ele=get_elevation(circle_center);v_visibility=calculate_visibility(projectTileWithElevation(circle_center,ele));if (u_pitch_with_map) {\\n#ifdef GLOBE\\nvec3 center_vector=projectToSphere(circle_center);\\n#endif\\nfloat angle_scale=u_globe_extrude_scale;vec2 corner_position=circle_center;if (u_scale_with_map) {angle_scale*=(radius+stroke_width);corner_position+=extrude*u_extrude_scale*(radius+stroke_width);} else {\\n#ifdef GLOBE\\nvec4 projected_center=interpolateProjection(circle_center,center_vector,ele);\\n#else\\nvec4 projected_center=projectTileWithElevation(circle_center,ele);\\n#endif\\ncorner_position+=extrude*u_extrude_scale*(radius+stroke_width)*(projected_center.w/u_camera_to_center_distance);angle_scale*=(radius+stroke_width)*(projected_center.w/u_camera_to_center_distance);}\\n#ifdef GLOBE\\nvec2 angles=extrude*angle_scale;vec3 corner_vector=globeRotateVector(center_vector,angles);gl_Position=interpolateProjection(corner_position,corner_vector,ele);\\n#else\\ngl_Position=projectTileWithElevation(corner_position,ele);\\n#endif\\n} else {gl_Position=projectTileWithElevation(circle_center,ele);if (gl_Position.z/gl_Position.w > 1.0) {gl_Position.xy=vec2(10000.0);}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 'in vec2 a_pos;void main() {gl_Position=projectTile(a_pos);}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'uniform highp float u_intensity;in 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);fragColor=vec4(val,1.0,1.0,1.0);\\n#ifdef OVERDRAW_INSPECTOR\\nfragColor=vec4(1.0);\\n#endif\\n}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;uniform highp float u_globe_extrude_scale;in vec2 a_pos;out 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 pos_raw=a_pos+32768.0;vec2 unscaled_extrude=vec2(mod(pos_raw,8.0)/7.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;vec2 circle_center=floor(pos_raw/8.0);\\n#ifdef GLOBE\\nvec2 angles=v_extrude*radius*u_globe_extrude_scale;vec3 center_vector=projectToSphere(circle_center);vec3 corner_vector=globeRotateVector(center_vector,angles);gl_Position=interpolateProjection(circle_center+extrude,corner_vector,0.0);\\n#else\\ngl_Position=projectTileFor3D(circle_center+extrude,get_elevation(circle_center));\\n#endif\\n}';\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;in vec2 v_pos;void main() {float t=texture(u_image,v_pos).r;vec4 color=texture(u_color_ramp,vec2(t,0.5));fragColor=color*u_opacity;\\n#ifdef OVERDRAW_INSPECTOR\\nfragColor=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;in vec2 a_pos;out 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 'in float v_placed;in float v_notUsed;void main() {float alpha=0.5;fragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {fragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {fragColor*=.1;}}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'in vec2 a_anchor_pos;in vec2 a_placed;in vec2 a_box_real;uniform vec2 u_pixel_extrude_scale;out float v_placed;out float v_notUsed;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 'in float v_radius;in vec2 v_extrude;in float v_collision;void main() {float alpha=0.5;float stroke_radius=0.9;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);fragColor=color*alpha*opacity_t;}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'in vec2 a_pos;in float a_radius;in vec2 a_flags;uniform vec2 u_viewport_size;out float v_radius;out vec2 v_extrude;out float v_collision;void main() {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;float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_collision=collision;gl_Position=vec4((a_pos/u_viewport_size*2.0-1.0)*vec2(1.0,-1.0),0.0,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 '#ifdef GL_ES\\nprecision highp float;\\n#endif\\nuniform sampler2D u_image;uniform vec4 u_unpack;uniform sampler2D u_elevation_stops;uniform sampler2D u_color_stops;uniform int u_color_ramp_size;uniform float u_opacity;in vec2 v_pos;float getElevation(vec2 coord) {vec4 data=texture(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack);}float getElevationStop(int stop) {float x=(float(stop)+0.5)/float(u_color_ramp_size);vec4 data=texture(u_elevation_stops,vec2(x,0))*255.0;data.a=-1.0;return dot(data,u_unpack);}void main() {float el=getElevation(v_pos);int r=(u_color_ramp_size-1);int l=0;float el_l=getElevationStop(l);float el_r=getElevationStop(r);while(r-l > 1){int m=(r+l)/2;float el_m=getElevationStop(m);if(el < el_m){r=m;el_r=el_m;}else\\n{l=m;el_l=el_m;}}float x=(float(l)+(el-el_l)/(el_r-el_l)+0.5)/float(u_color_ramp_size);fragColor=u_opacity*texture(u_color_stops,vec2(x,0));\\n#ifdef OVERDRAW_INSPECTOR\\nfragColor=vec4(1.0);\\n#endif\\n}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'uniform vec2 u_dimension;in vec2 a_pos;out vec2 v_pos;void main() {gl_Position=projectTile(a_pos,a_pos);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_pos/8192.0)*scale+epsilon;if (a_pos.y <-32767.5) {v_pos.y=0.0;}if (a_pos.y > 32766.5) {v_pos.y=1.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;in vec2 v_uv;void main() {vec4 overlay_color=texture(u_overlay,v_uv);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 'in vec2 a_pos;out vec2 v_uv;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=projectTileWithElevation(a_pos*u_overlay_scale,get_elevation(a_pos));}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'in vec2 a_pos;void main() {\\n#ifdef GLOBE\\ngl_Position=projectTileFor3D(a_pos,0.0);\\n#else\\ngl_Position=u_projection_matrix*vec4(a_pos,0.0,1.0);\\n#endif\\n}';\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\\nfragColor=color*opacity;\\n#ifdef OVERDRAW_INSPECTOR\\nfragColor=vec4(1.0);\\n#endif\\n}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'uniform vec2 u_fill_translate;in vec2 a_pos;\\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=projectTile(a_pos+u_fill_translate,a_pos);}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'in vec2 v_pos;\\n#ifdef GLOBE\\nin float v_depth;\\n#endif\\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);fragColor=outline_color*(alpha*opacity);\\n#ifdef GLOBE\\nif (v_depth > 1.0) {discard;}\\n#endif\\n#ifdef OVERDRAW_INSPECTOR\\nfragColor=vec4(1.0);\\n#endif\\n}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'uniform vec2 u_world;uniform vec2 u_fill_translate;in vec2 a_pos;out vec2 v_pos;\\n#ifdef GLOBE\\nout float v_depth;\\n#endif\\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=projectTile(a_pos+u_fill_translate,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;\\n#ifdef GLOBE\\nv_depth=gl_Position.z/gl_Position.w;\\n#endif\\n}';\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;in vec2 v_pos_a;in vec2 v_pos_b;in vec2 v_pos;\\n#ifdef GLOBE\\nin float v_depth;\\n#endif\\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=texture(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=texture(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);fragColor=mix(color1,color2,u_fade)*alpha*opacity;\\n#ifdef GLOBE\\nif (v_depth > 1.0) {discard;}\\n#endif\\n#ifdef OVERDRAW_INSPECTOR\\nfragColor=vec4(1.0);\\n#endif\\n}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;uniform vec2 u_fill_translate;in vec2 a_pos;out vec2 v_pos_a;out vec2 v_pos_b;out vec2 v_pos;\\n#ifdef GLOBE\\nout float v_depth;\\n#endif\\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=projectTile(a_pos+u_fill_translate,a_pos);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#ifdef GLOBE\\nv_depth=gl_Position.z/gl_Position.w;\\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#endif\\nuniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;in vec2 v_pos_a;in 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=texture(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=texture(u_image,pos2);fragColor=mix(color1,color2,u_fade)*opacity;\\n#ifdef OVERDRAW_INSPECTOR\\nfragColor=vec4(1.0);\\n#endif\\n}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;uniform vec2 u_fill_translate;in vec2 a_pos;out vec2 v_pos_a;out 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=projectTile(a_pos+u_fill_translate,a_pos);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 'in vec4 v_color;void main() {fragColor=v_color;\\n#ifdef OVERDRAW_INSPECTOR\\nfragColor=vec4(1.0);\\n#endif\\n}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp vec3 u_lightpos_globe;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec2 u_fill_translate;in vec2 a_pos;in vec4 a_normal_ed;\\n#ifdef TERRAIN3D\\nin vec2 a_centroid;\\n#endif\\nout 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);float elevation=t > 0.0 ? height : base;vec2 posInTile=a_pos+u_fill_translate;\\n#ifdef GLOBE\\nvec3 spherePos=projectToSphere(posInTile,a_pos);gl_Position=interpolateProjectionFor3D(posInTile,spherePos,elevation);\\n#else\\ngl_Position=u_projection_matrix*vec4(posInTile,elevation,1.0);\\n#endif\\nfloat 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;vec3 normalForLighting=normal/16384.0;float directional=clamp(dot(normalForLighting,u_lightpos),0.0,1.0);\\n#ifdef GLOBE\\nmat3 rotMatrix=globeGetRotationMatrix(spherePos);normalForLighting=rotMatrix*normalForLighting;directional=mix(directional,clamp(dot(normalForLighting,u_lightpos_globe),0.0,1.0),u_projection_transition);\\n#endif\\ndirectional=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;in vec2 v_pos_a;in vec2 v_pos_b;in 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=texture(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=texture(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);fragColor=mixedColor*v_lighting;\\n#ifdef OVERDRAW_INSPECTOR\\nfragColor=vec4(1.0);\\n#endif\\n}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default '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 vec2 u_fill_translate;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp vec3 u_lightpos_globe;uniform lowp float u_lightintensity;in vec2 a_pos;in vec4 a_normal_ed;\\n#ifdef TERRAIN3D\\nin vec2 a_centroid;\\n#endif\\n#ifdef GLOBE\\nout vec3 v_sphere_pos;\\n#endif\\nout vec2 v_pos_a;out vec2 v_pos_b;out 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 elevation=t > 0.0 ? height : base;vec2 posInTile=a_pos+u_fill_translate;\\n#ifdef GLOBE\\nvec3 spherePos=projectToSphere(posInTile,a_pos);vec3 elevatedPos=spherePos*(1.0+elevation/GLOBE_RADIUS);v_sphere_pos=elevatedPos;gl_Position=interpolateProjectionFor3D(posInTile,spherePos,elevation);\\n#else\\ngl_Position=u_projection_matrix*vec4(posInTile,elevation,1.0);\\n#endif\\nvec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0\\n? a_pos\\n: vec2(edgedistance,elevation*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;in vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack);}void main() {vec2 epsilon=1.0/u_dimension;float tileSize=u_dimension.x-2.0;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))*tileSize/pow(2.0,exaggeration+(28.2562-u_zoom));fragColor=clamp(vec4(deriv.x/8.0+0.5,deriv.y/8.0+0.5,1.0,1.0),0.0,1.0);\\n#ifdef OVERDRAW_INSPECTOR\\nfragColor=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;in vec2 a_pos;in vec2 a_texture_pos;out 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;in vec2 v_pos;uniform vec2 u_latrange;uniform float u_exaggeration;uniform vec4 u_accent;uniform int u_method;uniform float u_altitudes[NUM_ILLUMINATION_SOURCES];uniform float u_azimuths[NUM_ILLUMINATION_SOURCES];uniform vec4 u_shadows[NUM_ILLUMINATION_SOURCES];uniform vec4 u_highlights[NUM_ILLUMINATION_SOURCES];\\n#define PI 3.141592653589793\\n#define STANDARD 0\\n#define COMBINED 1\\n#define IGOR 2\\n#define MULTIDIRECTIONAL 3\\n#define BASIC 4\\nfloat get_aspect(vec2 deriv){return deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);}void igor_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;float aspect=get_aspect(deriv);float azimuth=u_azimuths[0]+PI;float slope_stength=atan(length(deriv))*2.0/PI;float aspect_strength=1.0-abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);float shadow_strength=slope_stength*aspect_strength;float highlight_strength=slope_stength*(1.0-aspect_strength);fragColor=u_shadows[0]*shadow_strength+u_highlights[0]*highlight_strength;}void standard_hillshade(vec2 deriv){float azimuth=u_azimuths[0]+PI;float slope=atan(0.625*length(deriv));float aspect=get_aspect(deriv);float intensity=u_exaggeration;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_shadows[0],u_highlights[0],shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);fragColor=accent_color*(1.0-shade_color.a)+shade_color;}void basic_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;float azimuth=u_azimuths[0]+PI;float cos_az=cos(azimuth);float sin_az=sin(azimuth);float cos_alt=cos(u_altitudes[0]);float sin_alt=sin(u_altitudes[0]);float cang=(sin_alt-(deriv.y*cos_az*cos_alt-deriv.x*sin_az*cos_alt))/sqrt(1.0+dot(deriv,deriv));float shade=clamp(cang,0.0,1.0);if(shade > 0.5){fragColor=u_highlights[0]*(2.0*shade-1.0);}else\\n{fragColor=u_shadows[0]*(1.0-2.0*shade);}}void multidirectional_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;fragColor=vec4(0,0,0,0);for(int i=0; i < NUM_ILLUMINATION_SOURCES; i++){float cos_alt=cos(u_altitudes[i]);float sin_alt=sin(u_altitudes[i]);float cos_az=-cos(u_azimuths[i]);float sin_az=-sin(u_azimuths[i]);float cang=(sin_alt-(deriv.y*cos_az*cos_alt-deriv.x*sin_az*cos_alt))/sqrt(1.0+dot(deriv,deriv));float shade=clamp(cang,0.0,1.0);if(shade > 0.5){fragColor+=u_highlights[i]*(2.0*shade-1.0)/float(NUM_ILLUMINATION_SOURCES);}else\\n{fragColor+=u_shadows[i]*(1.0-2.0*shade)/float(NUM_ILLUMINATION_SOURCES);}}}void combined_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;float azimuth=u_azimuths[0]+PI;float cos_az=cos(azimuth);float sin_az=sin(azimuth);float cos_alt=cos(u_altitudes[0]);float sin_alt=sin(u_altitudes[0]);float cang=acos((sin_alt-(deriv.y*cos_az*cos_alt-deriv.x*sin_az*cos_alt))/sqrt(1.0+dot(deriv,deriv)));cang=clamp(cang,0.0,PI/2.0);float shade=cang*atan(length(deriv))*4.0/PI/PI;float highlight=(PI/2.0-cang)*atan(length(deriv))*4.0/PI/PI;fragColor=u_shadows[0]*shade+u_highlights[0]*highlight;}void main() {vec4 pixel=texture(u_image,v_pos);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));vec2 deriv=((pixel.rg*8.0)-4.0)/scaleFactor;if (u_method==BASIC) {basic_hillshade(deriv);} else if (u_method==COMBINED) {combined_hillshade(deriv);} else if (u_method==IGOR) {igor_hillshade(deriv);} else if (u_method==MULTIDIRECTIONAL) {multidirectional_hillshade(deriv);} else if (u_method==STANDARD) {standard_hillshade(deriv);} else {standard_hillshade(deriv);}\\n#ifdef OVERDRAW_INSPECTOR\\nfragColor=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;in vec2 a_pos;out vec2 v_pos;void main() {gl_Position=projectTile(a_pos,a_pos);v_pos=a_pos/8192.0;if (a_pos.y <-32767.5) {v_pos.y=0.0;}if (a_pos.y > 32766.5) {v_pos.y=1.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;in vec2 v_width2;in vec2 v_normal;in float v_gamma_scale;\\n#ifdef GLOBE\\nin float v_depth;\\n#endif\\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);fragColor=color*(alpha*opacity);\\n#ifdef GLOBE\\nif (v_depth > 1.0) {discard;}\\n#endif\\n#ifdef OVERDRAW_INSPECTOR\\nfragColor=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\\nin vec2 a_pos_normal;in vec4 a_data;uniform vec2 u_translation;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;out vec2 v_normal;out vec2 v_width2;out float v_gamma_scale;out highp float v_linesofar;\\n#ifdef GLOBE\\nout float v_depth;\\n#endif\\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);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude;\\n#ifdef GLOBE\\nv_depth=gl_Position.z/gl_Position.w;\\n#endif\\n#ifdef TERRAIN3D\\nv_gamma_scale=1.0;\\n#else\\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.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;in vec2 v_width2;in vec2 v_normal;in float v_gamma_scale;in highp vec2 v_uv;\\n#ifdef GLOBE\\nin float v_depth;\\n#endif\\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=texture(u_image,v_uv);fragColor=color*(alpha*opacity);\\n#ifdef GLOBE\\nif (v_depth > 1.0) {discard;}\\n#endif\\n#ifdef OVERDRAW_INSPECTOR\\nfragColor=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\\nin vec2 a_pos_normal;in vec4 a_data;in float a_uv_x;in float a_split_index;uniform vec2 u_translation;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;out vec2 v_normal;out vec2 v_width2;out float v_gamma_scale;out highp vec2 v_uv;\\n#ifdef GLOBE\\nout float v_depth;\\n#endif\\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);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude;\\n#ifdef GLOBE\\nv_depth=gl_Position.z/gl_Position.w;\\n#endif\\n#ifdef TERRAIN3D\\nv_gamma_scale=1.0;\\n#else\\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.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;in vec2 v_normal;in vec2 v_width2;in float v_linesofar;in float v_gamma_scale;in float v_width;\\n#ifdef GLOBE\\nin float v_depth;\\n#endif\\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(texture(u_image,pos_a),texture(u_image,pos_b),u_fade);fragColor=color*alpha*opacity;\\n#ifdef GLOBE\\nif (v_depth > 1.0) {discard;}\\n#endif\\n#ifdef OVERDRAW_INSPECTOR\\nfragColor=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\\nin vec2 a_pos_normal;in vec4 a_data;uniform vec2 u_translation;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;out vec2 v_normal;out vec2 v_width2;out float v_linesofar;out float v_gamma_scale;out float v_width;\\n#ifdef GLOBE\\nout float v_depth;\\n#endif\\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);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude;\\n#ifdef GLOBE\\nv_depth=gl_Position.z/gl_Position.w;\\n#endif\\n#ifdef TERRAIN3D\\nv_gamma_scale=1.0;\\n#else\\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.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 lowp float u_lineatlas_width;uniform sampler2D u_image;uniform float u_mix;in vec2 v_normal;in vec2 v_width2;in vec2 v_tex_a;in vec2 v_tex_b;in float v_gamma_scale;\\n#ifdef GLOBE\\nin float v_depth;\\n#endif\\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\\n#pragma mapbox: define mediump vec4 dasharray_from\\n#pragma mapbox: define mediump vec4 dasharray_to\\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\\n#pragma mapbox: initialize mediump vec4 dasharray_from\\n#pragma mapbox: initialize mediump vec4 dasharray_to\\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=texture(u_image,v_tex_a).a;float sdfdist_b=texture(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);float sdfgamma=(u_lineatlas_width/256.0/u_device_pixel_ratio)/min(dasharray_from.w,dasharray_to.w);alpha*=smoothstep(0.5-sdfgamma/floorwidth,0.5+sdfgamma/floorwidth,sdfdist);fragColor=color*(alpha*opacity);\\n#ifdef GLOBE\\nif (v_depth > 1.0) {discard;}\\n#endif\\n#ifdef OVERDRAW_INSPECTOR\\nfragColor=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\\nin vec2 a_pos_normal;in vec4 a_data;uniform vec2 u_translation;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_tileratio;uniform float u_crossfade_from;uniform float u_crossfade_to;uniform float u_lineatlas_height;out vec2 v_normal;out vec2 v_width2;out vec2 v_tex_a;out vec2 v_tex_b;out float v_gamma_scale;\\n#ifdef GLOBE\\nout float v_depth;\\n#endif\\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\\n#pragma mapbox: define mediump vec4 dasharray_from\\n#pragma mapbox: define mediump vec4 dasharray_to\\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\\n#pragma mapbox: initialize mediump vec4 dasharray_from\\n#pragma mapbox: initialize mediump vec4 dasharray_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);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude;\\n#ifdef GLOBE\\nv_depth=gl_Position.z/gl_Position.w;\\n#endif\\n#ifdef TERRAIN3D\\nv_gamma_scale=1.0;\\n#else\\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\\n#endif\\nfloat u_patternscale_a_x=u_tileratio/dasharray_from.w/u_crossfade_from;float u_patternscale_a_y=-dasharray_from.z/2.0/u_lineatlas_height;float u_patternscale_b_x=u_tileratio/dasharray_to.w/u_crossfade_to;float u_patternscale_b_y=-dasharray_to.z/2.0/u_lineatlas_height;v_tex_a=vec2(a_linesofar*u_patternscale_a_x/floorwidth,normal.y*u_patternscale_a_y+(float(dasharray_from.y)+0.5)/u_lineatlas_height);v_tex_b=vec2(a_linesofar*u_patternscale_b_x/floorwidth,normal.y*u_patternscale_b_y+(float(dasharray_to.y)+0.5)/u_lineatlas_height);v_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;uniform sampler2D u_image_dash;uniform float u_mix;uniform lowp float u_lineatlas_width;in vec2 v_normal;in vec2 v_width2;in vec2 v_tex_a;in vec2 v_tex_b;in float v_gamma_scale;in highp vec2 v_uv;\\n#ifdef GLOBE\\nin float v_depth;\\n#endif\\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\\n#pragma mapbox: define mediump vec4 dasharray_from\\n#pragma mapbox: define mediump vec4 dasharray_to\\nvoid main() {\\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\\n#pragma mapbox: initialize mediump vec4 dasharray_from\\n#pragma mapbox: initialize mediump vec4 dasharray_to\\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=texture(u_image,v_uv);float sdfdist_a=texture(u_image_dash,v_tex_a).a;float sdfdist_b=texture(u_image_dash,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);float sdfgamma=(u_lineatlas_width/256.0)/min(dasharray_from.w,dasharray_to.w);float dash_alpha=smoothstep(0.5-sdfgamma/floorwidth,0.5+sdfgamma/floorwidth,sdfdist);fragColor=color*(alpha*dash_alpha*opacity);\\n#ifdef GLOBE\\nif (v_depth > 1.0) {discard;}\\n#endif\\n#ifdef OVERDRAW_INSPECTOR\\nfragColor=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\\nin vec2 a_pos_normal;in vec4 a_data;in float a_uv_x;in float a_split_index;uniform vec2 u_translation;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;uniform float u_tileratio;uniform float u_crossfade_from;uniform float u_crossfade_to;uniform float u_lineatlas_height;out vec2 v_normal;out vec2 v_width2;out float v_gamma_scale;out highp vec2 v_uv;out vec2 v_tex_a;out vec2 v_tex_b;\\n#ifdef GLOBE\\nout float v_depth;\\n#endif\\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\\n#pragma mapbox: define mediump vec4 dasharray_from\\n#pragma mapbox: define mediump vec4 dasharray_to\\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\\n#pragma mapbox: initialize lowp float floorwidth\\n#pragma mapbox: initialize mediump vec4 dasharray_from\\n#pragma mapbox: initialize mediump vec4 dasharray_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;float texel_height=1.0/u_image_height;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);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude;\\n#ifdef GLOBE\\nv_depth=gl_Position.z/gl_Position.w;\\n#endif\\n#ifdef TERRAIN3D\\nv_gamma_scale=1.0;\\n#else\\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\\n#endif\\nfloat u_patternscale_a_x=u_tileratio/dasharray_from.w/u_crossfade_from;float u_patternscale_a_y=-dasharray_from.z/2.0/u_lineatlas_height;float u_patternscale_b_x=u_tileratio/dasharray_to.w/u_crossfade_to;float u_patternscale_b_y=-dasharray_to.z/2.0/u_lineatlas_height;v_tex_a=vec2(a_linesofar*u_patternscale_a_x/floorwidth,normal.y*u_patternscale_a_y+(float(dasharray_from.y)+0.5)/u_lineatlas_height);v_tex_b=vec2(a_linesofar*u_patternscale_b_x/floorwidth,normal.y*u_patternscale_b_y+(float(dasharray_to.y)+0.5)/u_lineatlas_height);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;in vec2 v_pos0;in 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=texture(u_image0,v_pos0);vec4 color1=texture(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);fragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);\\n#ifdef OVERDRAW_INSPECTOR\\nfragColor=vec4(1.0);\\n#endif\\n}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;uniform vec4 u_coords_top;uniform vec4 u_coords_bottom;in vec2 a_pos;out vec2 v_pos0;out vec2 v_pos1;void main() {vec2 fractionalPos=a_pos/8192.0;vec2 position=mix(mix(u_coords_top.xy,u_coords_top.zw,fractionalPos.x),mix(u_coords_bottom.xy,u_coords_bottom.zw,fractionalPos.x),fractionalPos.y);gl_Position=projectTile(position,position);v_pos0=((fractionalPos-0.5)/u_buffer_scale)+0.5;\\n#ifdef GLOBE\\nif (a_pos.y <-32767.5) {v_pos0.y=0.0;}if (a_pos.y > 32766.5) {v_pos0.y=1.0;}\\n#endif\\nv_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;in vec2 v_tex;in float v_total_opacity;void main() {fragColor=texture(u_texture,v_tex)*v_total_opacity;\\n#ifdef OVERDRAW_INSPECTOR\\nfragColor=vec4(1.0);\\n#endif\\n}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'in vec4 a_pos_offset;in vec4 a_data;in vec4 a_pixeloffset;in vec3 a_projected_pos;in 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_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;out vec2 v_tex;out float v_total_opacity;\\n#pragma mapbox: define lowp float opacity\\nvoid main() {\\n#pragma mapbox: initialize lowp float opacity\\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);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_total_opacity=opacity*max(0.0,min(visibility,fade_opacity[0]+fade_change));if (v_total_opacity < 0.1){gl_Position=vec4(-2.,-2.,-2.,1.);return;}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;\\n#ifdef GLOBE\\nif(u_pitch_with_map) {float anchor_pos_tile_y=(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w,z,1.0)).y;projectionScaling=mix(projectionScaling,1.0/circumferenceRatioAtTileY(anchor_pos_tile_y)*u_pitched_scale,u_projection_transition);}\\n#endif\\nvec4 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;}';\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 bool u_is_plain;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;in vec2 v_data0;in 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 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 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 total_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float inner_edge=(256.0-64.0)/256.0;lowp float dist=texture(u_texture,tex).a;lowp vec4 color_alpha_out_text,color_alpha_out_halo;if (u_is_plain){highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(inner_edge-gamma_scaled,inner_edge+gamma_scaled,dist);color_alpha_out_text=total_opacity*alpha*fill_color;}if (u_is_halo) {float gamma_halo=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);float inner_edge_halo=inner_edge+gamma_halo*gamma_scale;highp float gamma_scaled_halo=gamma_halo*gamma_scale;highp float alpha_halo=smoothstep(inner_edge_halo-gamma_scaled_halo,inner_edge_halo+gamma_scaled_halo,dist);highp float halo_edge=(6.0-halo_width/fontScale)/SDF_PX;alpha_halo= min(smoothstep(halo_edge-gamma_scaled_halo,halo_edge+gamma_scaled_halo,dist),1.0-alpha_halo);color_alpha_out_halo=total_opacity*alpha_halo*halo_color;}if (u_is_plain && u_is_halo) {fragColor=color_alpha_out_text+(1.-color_alpha_out_text.a)*color_alpha_out_halo;} else if (u_is_halo){fragColor=color_alpha_out_halo;} else {fragColor=color_alpha_out_text;}\\n#ifdef OVERDRAW_INSPECTOR\\nfragColor=vec4(1.0);\\n#endif\\n}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'in vec4 a_pos_offset;in vec4 a_data;in vec4 a_pixeloffset;in vec3 a_projected_pos;in 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_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;out vec2 v_data0;out vec3 v_data1;\\n#pragma mapbox: define highp vec4 fill_color\\n#pragma mapbox: define highp vec4 halo_color\\n#pragma mapbox: define lowp float opacity\\n#pragma mapbox: define lowp float halo_width\\n#pragma mapbox: define lowp float halo_blur\\nvoid main() {\\n#pragma mapbox: initialize highp vec4 fill_color\\n#pragma mapbox: initialize highp vec4 halo_color\\n#pragma mapbox: initialize lowp float opacity\\n#pragma mapbox: initialize lowp float halo_width\\n#pragma mapbox: initialize lowp float halo_blur\\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy/16.0;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);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));float total_opacity=opacity*interpolated_fade_opacity;if (total_opacity < 0.1){gl_Position=vec4(-2.,-2.,-2.,1.);return;}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;\\n#ifdef GLOBE\\nif(u_pitch_with_map) {float anchor_pos_tile_y=(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w,z,1.0)).y;projectionScaling=mix(projectionScaling,1.0/circumferenceRatioAtTileY(anchor_pos_tile_y)*u_pitched_scale,u_projection_transition);}\\n#endif\\nvec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,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;v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,total_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 bool u_is_text;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;in vec4 v_data0;in 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 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 halo_width\\n#pragma mapbox: initialize lowp float halo_blur\\nfloat total_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;fragColor=texture(u_texture_icon,tex_icon)*total_opacity;\\n#ifdef OVERDRAW_INSPECTOR\\nfragColor=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;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;lowp float dist=texture(u_texture,tex).a;lowp vec4 color_alpha_out,color_alpha_out_halo;if (u_is_text) {highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);color_alpha_out=fill_color*(alpha*total_opacity);}if (u_is_halo) {highp float gamma_halo=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);lowp float buff_halo=(6.0-halo_width/fontScale)/SDF_PX;highp float gamma_scaled_halo=gamma_halo*gamma_scale;highp float alpha_halo=smoothstep(buff_halo-gamma_scaled_halo,buff_halo+gamma_scaled_halo,dist);color_alpha_out_halo=halo_color*(alpha_halo*total_opacity);}if (u_is_text && u_is_halo) {fragColor=color_alpha_out+(1.-color_alpha_out.a)*color_alpha_out_halo;} else if (u_is_halo) {fragColor=color_alpha_out_halo;} else {fragColor=color_alpha_out;}\\n#ifdef OVERDRAW_INSPECTOR\\nfragColor=vec4(1.0);\\n#endif\\n}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'in vec4 a_pos_offset;in vec4 a_data;in vec3 a_projected_pos;in 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_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;out vec4 v_data0;out vec4 v_data1;\\n#pragma mapbox: define highp vec4 fill_color\\n#pragma mapbox: define highp vec4 halo_color\\n#pragma mapbox: define lowp float opacity\\n#pragma mapbox: define lowp float halo_width\\n#pragma mapbox: define lowp float halo_blur\\nvoid main() {\\n#pragma mapbox: initialize highp vec4 fill_color\\n#pragma mapbox: initialize highp vec4 halo_color\\n#pragma mapbox: initialize lowp float opacity\\n#pragma mapbox: initialize lowp float halo_width\\n#pragma mapbox: initialize lowp float halo_blur\\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);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));float total_opacity=opacity*interpolated_fade_opacity;if (total_opacity < 0.1){gl_Position=vec4(-2.,-2.,-2.,1.);return;}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;\\n#ifdef GLOBE\\nif(u_pitch_with_map && !u_is_along_line) {float anchor_pos_tile_y=(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w,z,1.0)).y;projectionScaling=mix(projectionScaling,1.0/circumferenceRatioAtTileY(anchor_pos_tile_y)*u_pitched_scale,u_projection_transition);}\\n#endif\\nvec4 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;v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,total_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;uniform bool u_is_globe_mode;in vec2 v_texture_pos;in 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=texture(u_texture,vec2(v_texture_pos.x,1.0-v_texture_pos.y));if (!u_is_globe_mode && u_fog_ground_blend_opacity > 0.0 && 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);fragColor=linearToGamma(mix(surface_color_linear,fog_horizon_color_linear,pow(factor_fog,2.0)*u_fog_ground_blend_opacity));} else {fragColor=surface_color;}}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'in vec3 a_pos3d;uniform mat4 u_fog_matrix;uniform float u_ele_delta;out vec2 v_texture_pos;out 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=projectTileFor3D(a_pos3d.xy,ele-ele_delta);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 'in 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() {fragColor=pack(v_depth);}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'in vec3 a_pos3d;uniform float u_ele_delta;out 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=projectTileFor3D(a_pos3d.xy,ele-ele_delta);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;in vec2 v_texture_pos;void main() {vec4 rgba=texture(u_texture,v_texture_pos);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 'in vec3 a_pos3d;uniform float u_ele_delta;out 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=projectTileFor3D(a_pos3d.xy,ele-ele_delta);}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'in vec4 v_output_error_encoded;void main() {fragColor=v_output_error_encoded;}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'in vec2 a_pos;uniform highp float u_input;uniform highp float u_output_expected;out vec4 v_output_error_encoded;void main() {float real_output=2.0*atan(exp(PI-(u_input*PI*2.0)))-PI*0.5;float error=real_output-u_output_expected;float abs_error=abs(error)*128.0;v_output_error_encoded.x=min(floor(abs_error*256.0),255.0)/255.0;abs_error-=v_output_error_encoded.x;v_output_error_encoded.y=min(floor(abs_error*65536.0),255.0)/255.0;abs_error-=v_output_error_encoded.x/255.0;v_output_error_encoded.z=min(floor(abs_error*16777216.0),255.0)/255.0;v_output_error_encoded.w=error >=0.0 ? 1.0 : 0.0;gl_Position=vec4(a_pos,0.0,1.0);}';\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\\nin vec3 view_direction;uniform vec3 u_sun_pos;uniform vec3 u_globe_position;uniform float u_globe_radius;uniform float u_atmosphere_blend;/**Shader use from https:*Made some change to adapt to MapLibre Globe geometry*/const float PI=3.141592653589793;const int iSteps=5;const int jSteps=3;/*radius of the planet*/const float EARTH_RADIUS=6371e3;/*radius of the atmosphere*/const float ATMOS_RADIUS=6471e3;vec2 rsi(vec3 r0,vec3 rd,float sr) {float a=dot(rd,rd);float b=2.0*dot(rd,r0);float c=dot(r0,r0)-(sr*sr);float d=(b*b)-4.0*a*c;if (d < 0.0) return vec2(1e5,-1e5);return vec2((-b-sqrt(d))/(2.0*a),(-b+sqrt(d))/(2.0*a));}vec4 atmosphere(vec3 r,vec3 r0,vec3 pSun,float iSun,float rPlanet,float rAtmos,vec3 kRlh,float kMie,float shRlh,float shMie,float g) {pSun=normalize(pSun);r=normalize(r);vec2 p=rsi(r0,r,rAtmos);if (p.x > p.y) {return vec4(0.0,0.0,0.0,1.0);}if (p.x < 0.0) {p.x=0.0;}vec3 pos=r0+r*p.x;vec2 p2=rsi(r0,r,rPlanet);if (p2.x <=p2.y && p2.x > 0.0) {p.y=min(p.y,p2.x);}float iStepSize=(p.y-p.x)/float(iSteps);float iTime=p.x+iStepSize*0.5;vec3 totalRlh=vec3(0,0,0);vec3 totalMie=vec3(0,0,0);float iOdRlh=0.0;float iOdMie=0.0;float mu=dot(r,pSun);float mumu=mu*mu;float gg=g*g;float pRlh=3.0/(16.0*PI)*(1.0+mumu);float pMie=3.0/(8.0*PI)*((1.0-gg)*(mumu+1.0))/(pow(1.0+gg-2.0*mu*g,1.5)*(2.0+gg));for (int i=0; i < iSteps; i++) {vec3 iPos=r0+r*iTime;float iHeight=length(iPos)-rPlanet;float odStepRlh=exp(-iHeight/shRlh)*iStepSize;float odStepMie=exp(-iHeight/shMie)*iStepSize;iOdRlh+=odStepRlh;iOdMie+=odStepMie;float jStepSize=rsi(iPos,pSun,rAtmos).y/float(jSteps);float jTime=jStepSize*0.5;float jOdRlh=0.0;float jOdMie=0.0;for (int j=0; j < jSteps; j++) {vec3 jPos=iPos+pSun*jTime;float jHeight=length(jPos)-rPlanet;jOdRlh+=exp(-jHeight/shRlh)*jStepSize;jOdMie+=exp(-jHeight/shMie)*jStepSize;jTime+=jStepSize;}vec3 attn=exp(-(kMie*(iOdMie+jOdMie)+kRlh*(iOdRlh+jOdRlh)));totalRlh+=odStepRlh*attn;totalMie+=odStepMie*attn;iTime+=iStepSize;}float opacity=exp(-(length(kRlh)*length(totalRlh)+kMie*length(totalMie)));vec3 color=iSun*(pRlh*kRlh*totalRlh+pMie*kMie*totalMie);return vec4(color,opacity);}void main() {vec3 scale_camera_pos=-u_globe_position*EARTH_RADIUS/u_globe_radius;vec4 color=atmosphere(normalize(view_direction),scale_camera_pos,u_sun_pos,22.0,EARTH_RADIUS,ATMOS_RADIUS,vec3(5.5e-6,13.0e-6,22.4e-6),21e-6,8e3,1.2e3,0.758\\n);color.rgb=1.0-exp(-1.0*color.rgb);color=pow(color,vec4(1.0/2.2));fragColor=vec4(color.rgb,1.0-color.a)*u_atmosphere_blend;}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'in vec2 a_pos;uniform mat4 u_inv_proj_matrix;out vec3 view_direction;void main() {view_direction=(u_inv_proj_matrix*vec4(a_pos,0.0,1.0)).xyz;gl_Position=vec4(a_pos,0.0,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 vec2 u_horizon;uniform vec2 u_horizon_normal;uniform float u_sky_horizon_blend;uniform float u_sky_blend;void main() {float x=gl_FragCoord.x;float y=gl_FragCoord.y;float blend=(y-u_horizon.y)*u_horizon_normal.y+(x-u_horizon.x)*u_horizon_normal.x;if (blend > 0.0) {if (blend < u_sky_horizon_blend) {fragColor=mix(u_sky_color,u_horizon_color,pow(1.0-blend/u_sky_horizon_blend,2.0));} else {fragColor=u_sky_color;}}fragColor=mix(fragColor,vec4(vec3(0.0),0.0),u_sky_blend);}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'in vec2 a_pos;void main() {gl_Position=vec4(a_pos,1.0,1.0);}';\n", "import {type SegmentVector} from '../data/segment';\nimport {type VertexBuffer} from '../webgl/vertex_buffer';\nimport {type IndexBuffer} from '../webgl/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 {createLayout} from '../util/struct_array';\n\nexport default createLayout([\n    {name: 'a_pos', type: 'Int16', components: 2}\n]);\n", "import type {Projection, ProjectionGPUContext, TileMeshUsage} from './projection';\nimport type {CanonicalTileID} from '../../tile/tile_id';\nimport {EXTENT} from '../../data/extent';\nimport {type PreparedShader, shaders} from '../../shaders/shaders';\nimport type {Context} from '../../webgl/context';\nimport {Mesh} from '../../render/mesh';\nimport {PosArray, TriangleIndexArray} from '../../data/array_types.g';\nimport {SegmentVector} from '../../data/segment';\nimport posAttributes from '../../data/pos_attributes';\nimport {SubdivisionGranularitySetting} from '../../render/subdivision_granularity_settings';\n\nexport const MercatorShaderDefine = '#define PROJECTION_MERCATOR';\nexport const MercatorShaderVariantKey = 'mercator';\n\nexport class MercatorProjection implements Projection {\n    private _cachedMesh: Mesh = null;\n\n    get name(): 'mercator' {\n        return 'mercator';\n    }\n\n    get useSubdivision(): boolean {\n        // Mercator never uses subdivision.\n        return false;\n    }\n\n    get shaderVariantName(): string {\n        return MercatorShaderVariantKey;\n    }\n\n    get shaderDefine(): string {\n        return MercatorShaderDefine;\n    }\n\n    get shaderPreludeCode(): PreparedShader {\n        return shaders.projectionMercator;\n    }\n\n    get vertexShaderPreludeCode(): string {\n        return shaders.projectionMercator.vertexSource;\n    }\n\n    get subdivisionGranularity(): SubdivisionGranularitySetting {\n        return SubdivisionGranularitySetting.noSubdivision;\n    }\n\n    get useGlobeControls(): boolean {\n        return false;\n    }\n\n    get transitionState(): number {\n        return 0;\n    }\n\n    get latitudeErrorCorrectionRadians(): number {\n        return 0;\n    }\n\n    public destroy(): void {\n        // Do nothing.\n    }\n\n    public updateGPUdependent(_: ProjectionGPUContext): void {\n        // Do nothing.\n    }\n\n    public getMeshFromTileID(context: Context, _tileID: CanonicalTileID, _hasBorder: boolean, _allowPoles: boolean, _usage: TileMeshUsage): Mesh {\n        if (this._cachedMesh) {\n            return this._cachedMesh;\n        }\n\n        // The parameters tileID, hasBorder and allowPoles are all ignored on purpose for mercator meshes.\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        const tileExtentBuffer = context.createVertexBuffer(tileExtentArray, posAttributes.members);\n        const tileExtentSegments = SegmentVector.simpleSegment(0, 0, 4, 2);\n\n        const quadTriangleIndices = new TriangleIndexArray();\n        quadTriangleIndices.emplaceBack(1, 0, 2);\n        quadTriangleIndices.emplaceBack(1, 2, 3);\n        const quadTriangleIndexBuffer = context.createIndexBuffer(quadTriangleIndices);\n\n        this._cachedMesh = new Mesh(tileExtentBuffer, quadTriangleIndexBuffer, tileExtentSegments);\n        return this._cachedMesh;\n    }\n\n    public recalculate(): void {\n        // Do nothing.\n    }\n\n    public hasTransition(): boolean {\n        return false;\n    }\n\n    setErrorQueryLatitudeDegrees(_value: number) {\n        // Do nothing.\n    }\n}\n", "import {interpolates} from '@maplibre/maplibre-gl-style-spec';\nimport Point from '@mapbox/point-geometry';\nimport {clamp, type Complete, type RequireAtLeastOne} from '../util/util';\n\n/**\n * An `EdgeInset` object represents screen space padding applied to the edges of the viewport.\n * This shifts the apparent 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): this {\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 apparent 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(): Complete<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 = RequireAtLeastOne<{\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, type LngLatLike} from './lng_lat';\nimport {LngLatBounds} from './lng_lat_bounds';\nimport Point from '@mapbox/point-geometry';\nimport {wrap, clamp, degreesToRadians, radiansToDegrees, zoomScale, MAX_VALID_LATITUDE, scaleZoom} from '../util/util';\nimport {mat4, mat2} from 'gl-matrix';\nimport {EdgeInsets} from './edge_insets';\nimport {altitudeFromMercatorZ, MercatorCoordinate, mercatorZfromAltitude} from './mercator_coordinate';\nimport {cameraMercatorCoordinateFromCenterAndRotation, cameraDirectionFromPitchBearing} from './projection/mercator_utils';\nimport {EXTENT} from '../data/extent';\n\nimport type {PaddingOptions} from './edge_insets';\nimport type {IReadonlyTransform, ITransformGetters, TransformConstrainFunction} from './transform_interface';\nimport type {OverscaledTileID} from '../tile/tile_id';\nimport {Bounds} from './bounds';\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 * @param center - The LngLat object of the desired center. This object will be mutated.\n */\nexport function normalizeCenter(tr: IReadonlyTransform, center: LngLat): void {\n    if (!tr.renderWorldCopies || tr.lngRange) return;\n    const delta = center.lng - tr.center.lng;\n    center.lng +=\n        delta > 180 ? -360 :\n            delta < -180 ? 360 : 0;\n}\n\nexport type UnwrappedTileIDType = {\n    /**\n     * Tile wrap: 0 for the \"main\" world,\n     * negative values for worlds left of the main,\n     * positive values for worlds right of the main.\n     */\n    wrap?: number;\n    canonical: {\n        /**\n         * Tile X coordinate, in range 0..(z^2)-1\n         */\n        x: number;\n        /**\n         * Tile Y coordinate, in range 0..(z^2)-1\n         */\n        y: number;\n        /**\n         * Tile zoom level.\n         */\n        z: number;\n    };\n};\n\nexport type TransformHelperCallbacks = {\n    /**\n     * The transform's default getter of 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    defaultConstrain: TransformConstrainFunction;\n\n    /**\n     * Updates the underlying transform's internal matrices.\n     */\n    calcMatrices: () => void;\n};\n\nexport type TransformOptions = {\n    /**\n     * The minimum zoom level of the map. Users cannot zoom out beyond this level. (0\u201324)\n     * @defaultValue 0\n     */\n    minZoom?: number;\n    /**\n     * The maximum zoom level of the map. Users cannot zoom in beyond this level. (0\u201324)\n     * @defaultValue 22\n     */\n    maxZoom?: number;\n    /**\n     * The minimum pitch of the map.\n     */\n    minPitch?: number;\n    /**\n     * The maximum pitch of the map.\n     */\n    maxPitch?: number;\n    /**\n     * Whether to render multiple copies of the world side by side in the map.\n     */\n    renderWorldCopies?: boolean;\n    /**\n     * An override of the transform's default constraining function for respecting its longitude and latitude bounds.\n     */\n    constrainOverride?: TransformConstrainFunction | null;\n};\n\nfunction getTileZoom(zoom: number): number {\n    return Math.max(0, Math.floor(zoom));\n}\n\n/**\n * @internal\n * This class stores all values that define a transform's state,\n * such as center, zoom, minZoom, etc.\n * This can be used as a helper for implementing the ITransform interface.\n */\nexport class TransformHelper implements ITransformGetters {\n    private _callbacks: TransformHelperCallbacks;\n\n    _tileSize: number; // constant\n    _tileZoom: number; // integer zoom level for tiles\n    _lngRange: [number, number];\n    _latRange: [number, number];\n    _scale: number; // computed based on zoom\n    _width: number;\n    _height: number;\n    /**\n     * Vertical field of view in radians.\n     */\n    _fovInRadians: number;\n    /**\n     * This transform's bearing in radians.\n     */\n    _bearingInRadians: number;\n    /**\n     * Pitch in radians.\n     */\n    _pitchInRadians: number;\n    /**\n     * Roll in radians.\n     */\n    _rollInRadians: number;\n    _zoom: number;\n    _renderWorldCopies: boolean;\n    _minZoom: number;\n    _maxZoom: number;\n    _minPitch: number;\n    _maxPitch: number;\n    _center: LngLat;\n    _elevation: number;\n    _minElevationForCurrentTile: number;\n    _pixelPerMeter: number;\n    _edgeInsets: EdgeInsets;\n    _unmodified: boolean;\n\n    _constraining: boolean;\n    _rotationMatrix: mat2;\n    _pixelsToGLUnits: [number, number];\n    _pixelsToClipSpaceMatrix: mat4;\n    _clipSpaceToPixelsMatrix: mat4;\n    _cameraToCenterDistance: number;\n\n    _nearZ: number;\n    _farZ: number;\n    _autoCalculateNearFarZ: boolean;\n\n    _constrainOverride: TransformConstrainFunction;\n\n    constructor(callbacks: TransformHelperCallbacks, options?: TransformOptions) {\n        this._callbacks = callbacks;\n        this._tileSize = 512; // constant\n\n        this._renderWorldCopies = options?.renderWorldCopies === undefined ? true : !!options?.renderWorldCopies;\n        this._minZoom = options?.minZoom || 0;\n        this._maxZoom = options?.maxZoom || 22;\n\n        this._minPitch = (options?.minPitch === undefined || options?.minPitch === null) ? 0 : options?.minPitch;\n        this._maxPitch = (options?.maxPitch === undefined || options?.maxPitch === null) ? 60 : options?.maxPitch;\n\n        this._constrainOverride = options?.constrainOverride ?? null;\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._tileZoom = getTileZoom(this._zoom);\n        this._scale = zoomScale(this._zoom);\n        this._bearingInRadians = 0;\n        this._fovInRadians = 0.6435011087932844;\n        this._pitchInRadians = 0;\n        this._rollInRadians = 0;\n        this._unmodified = true;\n        this._edgeInsets = new EdgeInsets();\n        this._minElevationForCurrentTile = 0;\n        this._autoCalculateNearFarZ = true;\n    }\n\n    public apply(thatI: ITransformGetters, constrain: boolean, forceOverrideZ?: boolean): void {\n        this._constrainOverride = thatI.constrainOverride;\n        this._latRange = thatI.latRange;\n        this._lngRange = thatI.lngRange;\n        this._width = thatI.width;\n        this._height = thatI.height;\n        this._center = thatI.center;\n        this._elevation = thatI.elevation;\n        this._minElevationForCurrentTile = thatI.minElevationForCurrentTile;\n        this._zoom = thatI.zoom;\n        this._tileZoom = getTileZoom(this._zoom);\n        this._scale = zoomScale(this._zoom);\n        this._bearingInRadians = thatI.bearingInRadians;\n        this._fovInRadians = thatI.fovInRadians;\n        this._pitchInRadians = thatI.pitchInRadians;\n        this._rollInRadians = thatI.rollInRadians;\n        this._unmodified = thatI.unmodified;\n        this._edgeInsets = new EdgeInsets(thatI.padding.top, thatI.padding.bottom, thatI.padding.left, thatI.padding.right);\n        this._minZoom = thatI.minZoom;\n        this._maxZoom = thatI.maxZoom;\n        this._minPitch = thatI.minPitch;\n        this._maxPitch = thatI.maxPitch;\n        this._renderWorldCopies = thatI.renderWorldCopies;\n        this._cameraToCenterDistance = thatI.cameraToCenterDistance;\n        this._nearZ = thatI.nearZ;\n        this._farZ = thatI.farZ;\n        this._autoCalculateNearFarZ = !forceOverrideZ && thatI.autoCalculateNearFarZ;\n        if (constrain) {\n            this.constrainInternal();\n        }\n        this._calcMatrices();\n    }\n\n    get pixelsToClipSpaceMatrix(): mat4 { return this._pixelsToClipSpaceMatrix; }\n    get clipSpaceToPixelsMatrix(): mat4 { return this._clipSpaceToPixelsMatrix; }\n\n    get minElevationForCurrentTile(): number { return this._minElevationForCurrentTile; }\n    setMinElevationForCurrentTile(ele: number) {\n        this._minElevationForCurrentTile = ele;\n    }\n\n    get tileSize(): number { return this._tileSize; }\n    get tileZoom(): number { return this._tileZoom; }\n    get scale(): number { return this._scale; }\n\n    /**\n     * Gets the transform's width in pixels. Use {@link resize} to set the transform's size.\n     */\n    get width(): number { return this._width; }\n\n    /**\n     * Gets the transform's height in pixels. Use {@link resize} to set the transform's size.\n     */\n    get height(): number { return this._height; }\n\n    /**\n     * Gets the transform's bearing in radians.\n     */\n    get bearingInRadians(): number { return this._bearingInRadians; }\n\n    get lngRange(): [number, number] { return this._lngRange; }\n    get latRange(): [number, number] { return this._latRange; }\n\n    get pixelsToGLUnits(): [number, number] { return this._pixelsToGLUnits; }\n\n    get minZoom(): number { return this._minZoom; }\n    setMinZoom(zoom: number) {\n        if (this._minZoom === zoom) return;\n        this._minZoom = zoom;\n        this.setZoom(this.applyConstrain(this._center, this.zoom).zoom);\n    }\n\n    get maxZoom(): number { return this._maxZoom; }\n    setMaxZoom(zoom: number) {\n        if (this._maxZoom === zoom) return;\n        this._maxZoom = zoom;\n        this.setZoom(this.applyConstrain(this._center, this.zoom).zoom);\n    }\n\n    get minPitch(): number { return this._minPitch; }\n    setMinPitch(pitch: number) {\n        if (this._minPitch === pitch) return;\n        this._minPitch = pitch;\n        this.setPitch(Math.max(this.pitch, pitch));\n    }\n\n    get maxPitch(): number { return this._maxPitch; }\n    setMaxPitch(pitch: number) {\n        if (this._maxPitch === pitch) return;\n        this._maxPitch = pitch;\n        this.setPitch(Math.min(this.pitch, pitch));\n    }\n\n    get renderWorldCopies(): boolean { return this._renderWorldCopies; }\n    setRenderWorldCopies(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 constrainOverride(): TransformConstrainFunction { return this._constrainOverride; }\n    setConstrainOverride(constrain?: TransformConstrainFunction | null) {\n        if (constrain === undefined) constrain = null;\n        if (this._constrainOverride === constrain) return;\n        this._constrainOverride = constrain;\n        this.constrainInternal();\n        this._calcMatrices();\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    /**\n     * Gets the transform's dimensions packed into a Point object.\n     */\n    get size(): Point {\n        return new Point(this._width, this._height);\n    }\n\n    get bearing(): number {\n        return this._bearingInRadians / Math.PI * 180;\n    }\n    setBearing(bearing: number) {\n        const b = wrap(bearing, -180, 180) * Math.PI / 180;\n        if (this._bearingInRadians === b) return;\n        this._unmodified = false;\n        this._bearingInRadians = b;\n        this._calcMatrices();\n\n        // 2x2 matrix for rotating points\n        this._rotationMatrix = mat2.create();\n        mat2.rotate(this._rotationMatrix, this._rotationMatrix, -this._bearingInRadians);\n    }\n\n    get rotationMatrix(): mat2 { return this._rotationMatrix; }\n\n    get pitchInRadians(): number {\n        return this._pitchInRadians;\n    }\n    get pitch(): number {\n        return this._pitchInRadians / Math.PI * 180;\n    }\n    setPitch(pitch: number) {\n        const p = clamp(pitch, this.minPitch, this.maxPitch) / 180 * Math.PI;\n        if (this._pitchInRadians === p) return;\n        this._unmodified = false;\n        this._pitchInRadians = p;\n        this._calcMatrices();\n    }\n\n    get rollInRadians(): number {\n        return this._rollInRadians;\n    }\n    get roll(): number {\n        return this._rollInRadians / Math.PI * 180;\n    }\n    setRoll(roll: number) {\n        const r = roll / 180 * Math.PI;\n        if (this._rollInRadians === r) return;\n        this._unmodified = false;\n        this._rollInRadians = r;\n        this._calcMatrices();\n    }\n\n    get fovInRadians(): number {\n        return this._fovInRadians;\n    }\n    get fov(): number {\n        return radiansToDegrees(this._fovInRadians);\n    }\n    setFov(fov: number) {\n        fov = clamp(fov, 0.1, 150);\n        if (this.fov === fov) return;\n        this._unmodified = false;\n        this._fovInRadians = degreesToRadians(fov);\n        this._calcMatrices();\n    }\n\n    get zoom(): number { return this._zoom; }\n    setZoom(zoom: number) {\n        const constrainedZoom = this.applyConstrain(this._center, zoom).zoom;\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 = zoomScale(constrainedZoom);\n        this.constrainInternal();\n        this._calcMatrices();\n    }\n\n    get center(): LngLat { return this._center; }\n    setCenter(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.constrainInternal();\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    setElevation(elevation: number) {\n        if (elevation === this._elevation) return;\n        this._elevation = elevation;\n        this.constrainInternal();\n        this._calcMatrices();\n    }\n\n    get padding(): PaddingOptions { return this._edgeInsets.toJSON(); }\n    setPadding(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     * @internal\n     */\n    get pixelsPerMeter(): number { return this._pixelPerMeter; }\n\n    get unmodified(): boolean { return this._unmodified; }\n\n    get cameraToCenterDistance(): number { return this._cameraToCenterDistance; }\n\n    get nearZ(): number { return this._nearZ; }\n    get farZ(): number { return this._farZ; }\n    get autoCalculateNearFarZ(): boolean { return this._autoCalculateNearFarZ; }\n    overrideNearFarZ(nearZ: number, farZ: number): void {\n        this._autoCalculateNearFarZ = false;\n        this._nearZ = nearZ;\n        this._farZ = farZ;\n        this._calcMatrices();\n    }\n    clearNearFarZOverride(): void {\n        this._autoCalculateNearFarZ = true;\n        this._calcMatrices();\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): void {\n        this._unmodified = false;\n        this._edgeInsets.interpolate(start, target, t);\n        this.constrainInternal();\n        this._calcMatrices();\n    }\n\n    resize(width: number, height: number, constrain: boolean = true): void {\n        this._width = width;\n        this._height = height;\n        if (constrain) this.constrainInternal();\n        this._calcMatrices();\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?.length !== 2 ||\n            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     * 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): void {\n        if (bounds) {\n            this._lngRange = [bounds.getWest(), bounds.getEast()];\n            this._latRange = [bounds.getSouth(), bounds.getNorth()];\n            this.constrainInternal();\n        } else {\n            this._lngRange = null;\n            this._latRange = [-MAX_VALID_LATITUDE, MAX_VALID_LATITUDE];\n        }\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(cameraPoint: Point, queryGeometry: Point[]): Point[] {\n        if (queryGeometry.length === 1) {\n            return [queryGeometry[0], cameraPoint];\n        } else {\n            const {minX, minY, maxX, maxY} = Bounds.fromPoints(queryGeometry).extend(cameraPoint);\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    applyConstrain: TransformConstrainFunction = (lngLat, zoom) => {\n        if (this._constrainOverride !== null) {\n            return this._constrainOverride(lngLat, zoom);\n        } else {\n            return this._callbacks.defaultConstrain(lngLat, zoom);\n        }\n    };\n\n    /**\n     * @internal\n     * Snaps the transform's center, zoom, etc. into the valid range.\n     */\n    private constrainInternal(): void {\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.applyConstrain(this.center, this.zoom);\n        this.setCenter(center);\n        this.setZoom(zoom);\n        this._unmodified = unmodified;\n        this._constraining = false;\n    }\n\n    /**\n     * This function is called every time one of the transform's defining properties (center, pitch, etc.) changes.\n     * This function should update the transform's internal data, such as matrices.\n     * Any derived `_calcMatrices` function should also call the base function first. The base function only depends on the `_width` and `_height` fields.\n     */\n    private _calcMatrices(): void {\n        if (this._width && this._height) {\n            this._pixelsToGLUnits = [2 / this._width, -2 / this._height];\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._clipSpaceToPixelsMatrix = 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._pixelsToClipSpaceMatrix = m;\n            const halfFov = this.fovInRadians / 2;\n            this._cameraToCenterDistance = 0.5 / Math.tan(halfFov) * this._height;\n        }\n        this._callbacks.calcMatrices();\n    }\n\n    calculateCenterFromCameraLngLatAlt(lnglat: LngLatLike, alt: number, bearing?: number, pitch?: number): {center: LngLat; elevation: number; zoom: number} {\n        const cameraBearing = bearing !== undefined ? bearing : this.bearing;\n        const cameraPitch = pitch = pitch !== undefined ? pitch : this.pitch;\n\n        const {distanceToCenter, clampedElevation} = this._distanceToCenterFromAltElevationPitch(alt, this.elevation, cameraPitch);\n        const {x, y} = cameraDirectionFromPitchBearing(cameraPitch, cameraBearing);\n        \n        // The mercator transform scale changes with latitude. At high latitudes, there are more \"Merc units\" per meter\n        // than at the equator. We treat the center point as our fundamental quantity. This means we want to convert\n        // elevation to Mercator Z using the scale factor at the center point (not the camera point). Since the center point is\n        // initially unknown, we compute it using the scale factor at the camera point. This gives us a better estimate of the\n        // center point scale factor, which we use to recompute the center point. We repeat until the error is very small.\n        // This typically takes about 5 iterations.\n        const camMercator = MercatorCoordinate.fromLngLat(lnglat, alt);\n        let metersPerMercUnit = altitudeFromMercatorZ(1, camMercator.y);\n        let centerMercator: MercatorCoordinate;\n        let dMercator: number;\n        let iter = 0;\n        const maxIter = 10;\n        do {\n            iter += 1;\n            if (iter > maxIter) {\n                break;\n            }\n            dMercator = distanceToCenter / metersPerMercUnit;\n            const dx = x * dMercator;\n            const dy = y * dMercator;\n            centerMercator = new MercatorCoordinate(camMercator.x + dx, camMercator.y + dy);\n            metersPerMercUnit = 1 / centerMercator.meterInMercatorCoordinateUnits();\n        } while (Math.abs(distanceToCenter - dMercator * metersPerMercUnit) > 1.0e-12);\n\n        const center = centerMercator.toLngLat();\n        const zoom = scaleZoom(this.height / 2 / Math.tan(this.fovInRadians / 2) / dMercator / this.tileSize);\n        return {center, elevation: clampedElevation, zoom};\n    }\n\n    recalculateZoomAndCenter(elevation: number): void {\n        if (this.elevation - elevation === 0) return;\n\n        // Critical: Stay in pixels and use original center to avoid instability at extreme latitudes when using Mercator-LngLat\n        const mercUnitsPerPixel = 1 / this.worldSize;\n        const originalMercUnitsPerMeter = mercatorZfromAltitude(1, this.center.lat);\n        const originalPixelsPerMeter = originalMercUnitsPerMeter * this.worldSize;\n\n        // Determine camera\n        const originalCenterMercator = MercatorCoordinate.fromLngLat(this.center, this.elevation);\n        const originalCenterPixelX = originalCenterMercator.x / mercUnitsPerPixel;\n        const originalCenterPixelY = originalCenterMercator.y / mercUnitsPerPixel;\n        const originalCenterPixelZ = originalCenterMercator.z / mercUnitsPerPixel;\n        \n        const cameraPitch = this.pitch;\n        const cameraBearing = this.bearing;\n        const {x, y, z} = cameraDirectionFromPitchBearing(cameraPitch, cameraBearing);\n        const dCamPixel = this.cameraToCenterDistance;\n        const camPixelX = originalCenterPixelX + dCamPixel * -x;\n        const camPixelY = originalCenterPixelY + dCamPixel * -y;\n        const camPixelZ = originalCenterPixelZ + dCamPixel * z;\n\n        // Determine corresponding center\n        const {distanceToCenter, clampedElevation} = this._distanceToCenterFromAltElevationPitch(camPixelZ / originalPixelsPerMeter, elevation, cameraPitch);\n        const distanceToCenterPixels = distanceToCenter * originalPixelsPerMeter;\n        const centerPixelX = camPixelX + x * distanceToCenterPixels;\n        const centerPixelY = camPixelY + y * distanceToCenterPixels;\n        const center = new MercatorCoordinate(centerPixelX * mercUnitsPerPixel, centerPixelY * mercUnitsPerPixel, 0).toLngLat();\n\n        const mercUnitsPerMeter = mercatorZfromAltitude(1, center.lat);\n        const zoom = scaleZoom(this.height / 2 / Math.tan(this.fovInRadians / 2) / distanceToCenter / mercUnitsPerMeter / this.tileSize);\n\n        // Update matrices\n        this._elevation = clampedElevation;\n        this._center = center;\n        this.setZoom(zoom);\n    }\n\n    _distanceToCenterFromAltElevationPitch(alt: number, elevation: number, pitch: number): {distanceToCenter: number; clampedElevation: number} {\n        const dzNormalized = -Math.cos(degreesToRadians(pitch));\n        const altitudeAGL = alt - elevation;\n        let distanceToCenter: number;\n        let clampedElevation = elevation;\n        if (dzNormalized * altitudeAGL >= 0.0 || Math.abs(dzNormalized) < 0.1) {\n            distanceToCenter = 10000;\n            clampedElevation = alt + distanceToCenter * dzNormalized;\n        } else {\n            distanceToCenter = -altitudeAGL / dzNormalized;\n        }\n        return {distanceToCenter, clampedElevation};\n    }\n\n    getCameraPoint(): Point {\n        const pitch = this.pitchInRadians;\n        const offset = Math.tan(pitch) * (this.cameraToCenterDistance || 1);\n        return this.centerPoint.add(new Point(offset * Math.sin(this.rollInRadians), offset * Math.cos(this.rollInRadians)));\n    }\n\n    getCameraAltitude(): number {\n        const altitude = Math.cos(this.pitchInRadians) * this._cameraToCenterDistance / this._pixelPerMeter;\n        return altitude + this.elevation;\n    }\n\n    getCameraLngLat(): LngLat {\n        const pixelPerMeter = mercatorZfromAltitude(1, this.center.lat) * this.worldSize;\n        const cameraToCenterDistanceMeters = this.cameraToCenterDistance / pixelPerMeter;\n        const camMercator = cameraMercatorCoordinateFromCenterAndRotation(this.center, this.elevation, this.pitch, this.bearing, cameraToCenterDistanceMeters);\n        return camMercator.toLngLat();\n    }\n\n    getMercatorTileCoordinates(overscaledTileID: OverscaledTileID): [number, number, number, number] {\n        if (!overscaledTileID) {\n            return [0, 0, 1, 1];\n        }\n        const scale = (overscaledTileID.canonical.z >= 0) ? (1 << overscaledTileID.canonical.z) : Math.pow(2.0, overscaledTileID.canonical.z);\n        return [\n            overscaledTileID.canonical.x / scale,\n            overscaledTileID.canonical.y / scale,\n            1.0 / scale / EXTENT,\n            1.0 / scale / EXTENT\n        ];\n    }\n}\n", "import {vec3, type vec4} from 'gl-matrix';\nimport {type Frustum} from './frustum';\nimport {IntersectionResult, type IBoundingVolume} from './bounding_volume';\n\nexport class Aabb implements IBoundingVolume {\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: 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: 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    /**\n     * Performs a frustum-aabb intersection test.\n     */\n    intersectsFrustum(frustum: Frustum): IntersectionResult {\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        let fullyInside = true;\n\n        for (const plane of frustum.planes) {\n            const planeIntersection = this.intersectsPlane(plane);\n\n            if (planeIntersection === IntersectionResult.None) {\n                return IntersectionResult.None;\n            }\n            if (planeIntersection === IntersectionResult.Partial) {\n                fullyInside = false;\n            }\n        }\n\n        if (fullyInside) {\n            return IntersectionResult.Full;\n        }\n\n        if (frustum.aabb.min[0] > this.max[0] || frustum.aabb.min[1] > this.max[1] || frustum.aabb.min[2] > this.max[2] ||\n            frustum.aabb.max[0] < this.min[0] || frustum.aabb.max[1] < this.min[1] || frustum.aabb.max[2] < this.min[2]) {\n            return IntersectionResult.None;\n        }\n\n        return IntersectionResult.Partial;\n    }\n\n    /**\n     * Performs a halfspace-aabb intersection test.\n     */\n    intersectsPlane(plane: vec4): IntersectionResult {\n        let distMin = plane[3];\n        let distMax = plane[3];\n        for (let i = 0; i < 3; i++) {\n            if (plane[i] > 0) {\n                distMin += plane[i] * this.min[i];\n                distMax += plane[i] * this.max[i];\n            } else {\n                distMax += plane[i] * this.min[i];\n                distMin += plane[i] * this.max[i];\n            }\n        }\n\n        if (distMin >= 0) {\n            return IntersectionResult.Full;\n        }\n        if (distMax < 0) {\n            return IntersectionResult.None;\n        }\n        return IntersectionResult.Partial;\n    }\n}\n", "import {OverscaledTileID} from '../../tile/tile_id';\nimport {Aabb} from '../../util/primitives/aabb';\nimport type {IBoundingVolume} from '../../util/primitives/bounding_volume';\nimport {clamp} from '../../util/util';\nimport {type MercatorCoordinate} from '../mercator_coordinate';\nimport {type IReadonlyTransform} from '../transform_interface';\nimport {type CoveringTilesOptionsInternal} from './covering_tiles';\nimport {type CoveringTilesDetailsProvider} from './covering_tiles_details_provider';\n\nexport class MercatorCoveringTilesDetailsProvider implements CoveringTilesDetailsProvider {\n\n    distanceToTile2d(pointX: number, pointY: number, _tileID: {x: number; y: number; z: number}, boundingVolume: IBoundingVolume): number {\n        const aabb = boundingVolume as Aabb;\n        const distanceX = aabb.distanceX([pointX, pointY]);\n        const distanceY = aabb.distanceY([pointX, pointY]);\n        return Math.hypot(distanceX, distanceY);\n    }\n\n    /**\n     * Returns the wrap value for a given tile, computed so that tiles will remain loaded when crossing the antimeridian.\n     */\n    getWrap(centerCoord: MercatorCoordinate, tileID: {x:number; y: number; z: number}, parentWrap: number): number {\n        return parentWrap;\n    }\n\n    /**\n     * Returns the AABB of the specified tile.\n     * @param tileID - Tile x, y and z for zoom.\n     */\n    getTileBoundingVolume(tileID: {x: number; y: number; z: number}, wrap: number, elevation: number, options: CoveringTilesOptionsInternal): Aabb {\n        let minElevation = 0;\n        let maxElevation = 0;\n        if (options?.terrain) {\n            const overscaledTileID = new OverscaledTileID(tileID.z, wrap, tileID.z, tileID.x, tileID.y);\n            const minMax = options.terrain.getMinMaxElevation(overscaledTileID);\n            minElevation = minMax.minElevation ?? Math.min(0, elevation);\n            maxElevation = minMax.maxElevation ?? Math.max(0, elevation);\n        }\n        const numTiles = 1 << tileID.z;\n        return new Aabb([wrap + tileID.x / numTiles, tileID.y / numTiles, minElevation],\n            [wrap + (tileID.x + 1) / numTiles, (tileID.y + 1) / numTiles, maxElevation]);\n    }\n    \n    allowVariableZoom(transform: IReadonlyTransform, options: CoveringTilesOptionsInternal): boolean {\n        const zfov = transform.fov * (Math.abs(Math.cos(transform.rollInRadians)) * transform.height + Math.abs(Math.sin(transform.rollInRadians)) * transform.width) / transform.height;\n        const maxConstantZoomPitch = clamp(78.5 - zfov / 2, 0.0, 60.0);\n        return (!!options.terrain || transform.pitch > maxConstantZoomPitch);\n    }\n\n    allowWorldCopies(): boolean {\n        return true;\n    }\n\n    prepareNextFrame(): void { \n        // Do nothing\n    }\n}", "import {type mat4, vec3, vec4} from 'gl-matrix';\nimport {Aabb} from './aabb';\nimport {pointPlaneSignedDistance, rayPlaneIntersection} from '../util';\n\nexport class Frustum {\n\n    constructor(public points: vec4[], public planes: vec4[], public aabb: Aabb) { }\n\n    public static fromInvProjectionMatrix(invProj: mat4, worldSize: number = 1, zoom: number = 0, horizonPlane?: vec4, flippedNearFar?: boolean): 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        // Globe and mercator projection matrices have different Y directions, hence we need different sets of indices.\n        // This should be fixed in the future.\n        const frustumPlanePointIndices = flippedNearFar ? [\n            [6, 5, 4],  // near\n            [0, 1, 2],  // far\n            [0, 3, 7],  // left\n            [2, 1, 5],  // right\n            [3, 2, 6],  // bottom\n            [0, 4, 5]   // top\n        ] : [\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 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 => unprojectClipSpacePoint(v, invProj, worldSize, scale));\n\n        if (horizonPlane) {\n            // A horizon clipping plane was supplied.\n            adjustFarPlaneByHorizonPlane(frustumCoords, frustumPlanePointIndices[0], horizonPlane, flippedNearFar);\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        const min: vec3 = [Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY];\n        const max: vec3 = [Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY];\n\n        for (const p of frustumCoords) {\n            for (let i = 0; i < 3; i++) {\n                min[i] = Math.min(min[i], p[i]);\n                max[i] = Math.max(max[i], p[i]);\n            }\n        }\n\n        return new Frustum(frustumCoords, frustumPlanes, new Aabb(min, max));\n    }\n}\n\nfunction unprojectClipSpacePoint(point: vec4 | number[], invProj: mat4, worldSize: number, scale: number): vec4 {\n    const v = vec4.transformMat4([] as any, point as any, invProj) as any;\n    const s = 1.0 / v[3] / worldSize * scale;\n    return vec4.mul(v, v, [s, s, 1.0 / v[3], s] as vec4);\n}\n\n/**\n * Modifies points in the supplied `frustumCoords` array so that the frustum's far plane only lies as far as the horizon,\n * which improves frustum culling effectiveness.\n * @param frustumCoords - Points of the frustum.\n * @param nearPlanePointsIndices - Which indices in the `frustumCoords` form the near plane.\n * @param horizonPlane - The horizon plane.\n */\nfunction adjustFarPlaneByHorizonPlane(frustumCoords: vec4[], nearPlanePointsIndices: number[], horizonPlane: vec4, flippedNearFar: boolean): void {\n    // For each of the 4 edges from near to far plane,\n    // we find at which distance these edges intersect the given clipping plane,\n    // select the maximal value from these distances and then we move\n    // the frustum's far plane so that it is at most as far away from the near plane\n    // as this maximal distance.\n\n    const nearPlanePointsOffset = flippedNearFar ? 4 : 0;\n    const farPlanePointsOffset = flippedNearFar ? 0 : 4;\n\n    let maxDist = 0;\n    const cornerRayLengths: number[] = [];\n    const cornerRayNormalizedDirections: vec3[] = [];\n    for (let i = 0; i < 4; i++) {\n        const dir = vec3.sub([] as any, frustumCoords[i + farPlanePointsOffset] as vec3, frustumCoords[i + nearPlanePointsOffset] as vec3);\n        const len = vec3.length(dir);\n        vec3.scale(dir, dir, 1.0 / len); // normalize\n        cornerRayLengths.push(len);\n        cornerRayNormalizedDirections.push(dir);\n    }\n\n    for (let i = 0; i < 4; i++) {\n        const dist = rayPlaneIntersection(frustumCoords[i + nearPlanePointsOffset] as vec3, cornerRayNormalizedDirections[i], horizonPlane);\n        if (dist !== null && dist >= 0) {\n            maxDist = Math.max(maxDist, dist);\n        } else {\n            // Use the original ray length for rays parallel to the horizon plane, or for rays pointing away from it.\n            maxDist = Math.max(maxDist, cornerRayLengths[i]);\n        }\n    }\n\n    // Compute the near plane.\n    // We use its normal as the \"view vector\" - direction in which the camera is looking.\n    const nearPlaneNormalized = getNormalizedNearPlane(frustumCoords, nearPlanePointsIndices);\n\n    // We also try to adjust the far plane position so that it exactly intersects the point on the horizon\n    // that is most distant from the near plane.\n    const idealFarPlaneDistanceFromNearPlane = getIdealNearFarPlaneDistance(horizonPlane, nearPlaneNormalized);\n    if (idealFarPlaneDistanceFromNearPlane !== null) {\n        const idealCornerRayLength = idealFarPlaneDistanceFromNearPlane / vec3.dot(cornerRayNormalizedDirections[0], nearPlaneNormalized as vec3); // dot(near plane, ray dir) is the same for all 4 corners\n        maxDist = Math.min(maxDist, idealCornerRayLength);\n    }\n\n    for (let i = 0; i < 4; i++) {\n        const targetLength = Math.min(maxDist, cornerRayLengths[i]);\n        frustumCoords[i + farPlanePointsOffset] = [\n            frustumCoords[i + nearPlanePointsOffset][0] + cornerRayNormalizedDirections[i][0] * targetLength,\n            frustumCoords[i + nearPlanePointsOffset][1] + cornerRayNormalizedDirections[i][1] * targetLength,\n            frustumCoords[i + nearPlanePointsOffset][2] + cornerRayNormalizedDirections[i][2] * targetLength,\n            1,\n        ] as vec4;\n    }\n}\n\n/**\n * Returns the near plane equation with unit length direction.\n * @param frustumCoords - Points of the frustum.\n * @param nearPlanePointsIndices - Which indices in the `frustumCoords` form the near plane.\n */\nfunction getNormalizedNearPlane(frustumCoords: vec4[], nearPlanePointsIndices: number[]): vec4 {\n    const nearPlaneA = vec3.sub([] as any, frustumCoords[nearPlanePointsIndices[0]] as vec3, frustumCoords[nearPlanePointsIndices[1]] as vec3);\n    const nearPlaneB = vec3.sub([] as any, frustumCoords[nearPlanePointsIndices[2]] as vec3, frustumCoords[nearPlanePointsIndices[1]] as vec3);\n    const nearPlaneNormalized = [0, 0, 0, 0] as vec4;\n    vec3.normalize(nearPlaneNormalized as vec3, vec3.cross([] as any, nearPlaneA, nearPlaneB)) as any;\n    nearPlaneNormalized[3] = -vec3.dot(nearPlaneNormalized as vec3, frustumCoords[nearPlanePointsIndices[0]] as vec3);\n    return nearPlaneNormalized;\n}\n\n/**\n * Returns the ideal distance between the frustum's near and far plane so that the far plane only lies as far as the horizon.\n */\nfunction getIdealNearFarPlaneDistance(horizonPlane: vec4, nearPlaneNormalized: vec4): number | null {\n    // Normalize the horizon plane to unit direction\n    const horizonPlaneLen = vec3.len(horizonPlane as vec3);\n    const normalizedHorizonPlane = vec4.scale([] as any, horizonPlane, 1 / horizonPlaneLen);\n\n    // Project the view vector onto the horizon plane\n    const projectedViewDirection = vec3.sub([] as any, nearPlaneNormalized as vec3, vec3.scale([] as any, normalizedHorizonPlane as vec3, vec3.dot(nearPlaneNormalized as vec3, normalizedHorizonPlane as vec3)));\n    const projectedViewLength = vec3.len(projectedViewDirection);\n\n    // projectedViewLength will be 0 if the camera is looking straight down\n    if (projectedViewLength > 0) {\n        // Find the radius and center of the horizon circle (the horizon circle is the intersection of the planet's sphere and the horizon plane).\n        const horizonCircleRadius = Math.sqrt(1 - normalizedHorizonPlane[3] * normalizedHorizonPlane[3]);\n        const horizonCircleCenter = vec3.scale([] as any, normalizedHorizonPlane as vec3, -normalizedHorizonPlane[3]); // The horizon plane normal always points towards the camera.\n        // Find the furthest point on the horizon circle from the near plane.\n        const pointFurthestOnHorizonCircle = vec3.add([] as any, horizonCircleCenter, vec3.scale([] as any, projectedViewDirection, horizonCircleRadius / projectedViewLength));\n        // Compute this point's distance from the near plane.\n        return pointPlaneSignedDistance(nearPlaneNormalized, pointFurthestOnHorizonCircle);\n    } else {\n        return null;\n    }\n}\n", "import {LngLat, type LngLatLike} from '../lng_lat';\nimport {MercatorCoordinate, mercatorXfromLng, mercatorYfromLat, mercatorZfromAltitude} from '../mercator_coordinate';\nimport Point from '@mapbox/point-geometry';\nimport {wrap, clamp, createIdentityMat4f64, createMat4f64, degreesToRadians, createIdentityMat4f32, zoomScale, scaleZoom} from '../../util/util';\nimport {type mat2, mat4, vec3, vec4} from 'gl-matrix';\nimport {UnwrappedTileID, OverscaledTileID, type CanonicalTileID, calculateTileKey} from '../../tile/tile_id';\nimport {interpolates} from '@maplibre/maplibre-gl-style-spec';\nimport {type PointProjection, xyTransformMat4} from '../../symbol/projection';\nimport {LngLatBounds} from '../lng_lat_bounds';\nimport {getMercatorHorizon, projectToWorldCoordinates, unprojectFromWorldCoordinates, calculateTileMatrix, maxMercatorHorizonAngle, cameraMercatorCoordinateFromCenterAndRotation} from './mercator_utils';\nimport {EXTENT} from '../../data/extent';\nimport {TransformHelper} from '../transform_helper';\nimport {MercatorCoveringTilesDetailsProvider} from './mercator_covering_tiles_details_provider';\nimport {Frustum} from '../../util/primitives/frustum';\nimport {fastInvertProjMat4} from '../../util/fast_maths';\n\nimport type {Terrain} from '../../render/terrain';\nimport type {IReadonlyTransform, ITransform, TransformConstrainFunction} from '../transform_interface';\nimport type {TransformOptions} from '../transform_helper';\nimport type {PaddingOptions} from '../edge_insets';\nimport type {ProjectionData, ProjectionDataParams} from './projection_data';\nimport type {CoveringTilesDetailsProvider} from './covering_tiles_details_provider';\n\nexport class MercatorTransform implements ITransform {\n    private _helper: TransformHelper;\n\n    //\n    // Implementation of transform getters and setters\n    //\n\n    get pixelsToClipSpaceMatrix(): mat4 {\n        return this._helper.pixelsToClipSpaceMatrix;\n    }\n    get clipSpaceToPixelsMatrix(): mat4 {\n        return this._helper.clipSpaceToPixelsMatrix;\n    }\n    get pixelsToGLUnits(): [number, number] {\n        return this._helper.pixelsToGLUnits;\n    }\n    get centerOffset(): Point {\n        return this._helper.centerOffset;\n    }\n    get size(): Point {\n        return this._helper.size;\n    }\n    get rotationMatrix(): mat2 {\n        return this._helper.rotationMatrix;\n    }\n    get centerPoint(): Point {\n        return this._helper.centerPoint;\n    }\n    get pixelsPerMeter(): number {\n        return this._helper.pixelsPerMeter;\n    }\n    setMinZoom(zoom: number): void {\n        this._helper.setMinZoom(zoom);\n    }\n    setMaxZoom(zoom: number): void {\n        this._helper.setMaxZoom(zoom);\n    }\n    setMinPitch(pitch: number): void {\n        this._helper.setMinPitch(pitch);\n    }\n    setMaxPitch(pitch: number): void {\n        this._helper.setMaxPitch(pitch);\n    }\n    setRenderWorldCopies(renderWorldCopies: boolean): void {\n        this._helper.setRenderWorldCopies(renderWorldCopies);\n    }\n    setBearing(bearing: number): void {\n        this._helper.setBearing(bearing);\n    }\n    setPitch(pitch: number): void {\n        this._helper.setPitch(pitch);\n    }\n    setRoll(roll: number): void {\n        this._helper.setRoll(roll);\n    }\n    setFov(fov: number): void {\n        this._helper.setFov(fov);\n    }\n    setZoom(zoom: number): void {\n        this._helper.setZoom(zoom);\n    }\n    setCenter(center: LngLat): void {\n        this._helper.setCenter(center);\n    }\n    setElevation(elevation: number): void {\n        this._helper.setElevation(elevation);\n    }\n    setMinElevationForCurrentTile(elevation: number): void {\n        this._helper.setMinElevationForCurrentTile(elevation);\n    }\n    setPadding(padding: PaddingOptions): void {\n        this._helper.setPadding(padding);\n    }\n    interpolatePadding(start: PaddingOptions, target: PaddingOptions, t: number): void {\n        this._helper.interpolatePadding(start, target, t);\n    }\n    isPaddingEqual(padding: PaddingOptions): boolean {\n        return this._helper.isPaddingEqual(padding);\n    }\n    resize(width: number, height: number, constrain: boolean = true): void {\n        this._helper.resize(width, height, constrain);\n    }\n    getMaxBounds(): LngLatBounds {\n        return this._helper.getMaxBounds();\n    }\n    setMaxBounds(bounds?: LngLatBounds): void {\n        this._helper.setMaxBounds(bounds);\n    }\n    setConstrainOverride(constrain?: TransformConstrainFunction | null): void {\n        this._helper.setConstrainOverride(constrain);\n    }\n    overrideNearFarZ(nearZ: number, farZ: number): void {\n        this._helper.overrideNearFarZ(nearZ, farZ);\n    }\n    clearNearFarZOverride(): void {\n        this._helper.clearNearFarZOverride();\n    }\n    getCameraQueryGeometry(queryGeometry: Point[]): Point[] {\n        return this._helper.getCameraQueryGeometry(this.getCameraPoint(), queryGeometry);\n    }\n\n    get tileSize(): number {\n        return this._helper.tileSize;\n    }\n    get tileZoom(): number {\n        return this._helper.tileZoom;\n    }\n    get scale(): number {\n        return this._helper.scale;\n    }\n    get worldSize(): number {\n        return this._helper.worldSize;\n    }\n    get width(): number {\n        return this._helper.width;\n    }\n    get height(): number {\n        return this._helper.height;\n    }\n    get lngRange(): [number, number] {\n        return this._helper.lngRange;\n    }\n    get latRange(): [number, number] {\n        return this._helper.latRange;\n    }\n    get minZoom(): number {\n        return this._helper.minZoom;\n    }\n    get maxZoom(): number {\n        return this._helper.maxZoom;\n    }\n    get zoom(): number {\n        return this._helper.zoom;\n    }\n    get center(): LngLat {\n        return this._helper.center;\n    }\n    get minPitch(): number {\n        return this._helper.minPitch;\n    }\n    get maxPitch(): number {\n        return this._helper.maxPitch;\n    }\n    get pitch(): number {\n        return this._helper.pitch;\n    }\n    get pitchInRadians(): number {\n        return this._helper.pitchInRadians;\n    }\n    get roll(): number {\n        return this._helper.roll;\n    }\n    get rollInRadians(): number {\n        return this._helper.rollInRadians;\n    }\n    get bearing(): number {\n        return this._helper.bearing;\n    }\n    get bearingInRadians(): number {\n        return this._helper.bearingInRadians;\n    }\n    get fov(): number {\n        return this._helper.fov;\n    }\n    get fovInRadians(): number {\n        return this._helper.fovInRadians;\n    }\n    get elevation(): number {\n        return this._helper.elevation;\n    }\n    get minElevationForCurrentTile(): number {\n        return this._helper.minElevationForCurrentTile;\n    }\n    get padding(): PaddingOptions {\n        return this._helper.padding;\n    }\n    get unmodified(): boolean {\n        return this._helper.unmodified;\n    }\n    get renderWorldCopies(): boolean {\n        return this._helper.renderWorldCopies;\n    }\n    get cameraToCenterDistance(): number {\n        return this._helper.cameraToCenterDistance;\n    }\n    get constrainOverride(): TransformConstrainFunction {\n        return this._helper.constrainOverride;\n    }\n    public get nearZ(): number {\n        return this._helper.nearZ;\n    }\n    public get farZ(): number {\n        return this._helper.farZ;\n    }\n    public get autoCalculateNearFarZ(): boolean {\n        return this._helper.autoCalculateNearFarZ;\n    }\n    setTransitionState(_value: number, _error: number): void {\n        // Do nothing\n    }\n    //\n    // Implementation of mercator transform\n    //\n\n    private _cameraPosition: vec3;\n\n    private _mercatorMatrix: mat4;\n    private _projectionMatrix: mat4;\n    private _viewProjMatrix: mat4;\n    private _invViewProjMatrix: mat4;\n    private _invProjMatrix: mat4;\n    private _alignedProjMatrix: mat4;\n    private _pixelMatrix: mat4;\n    private _pixelMatrix3D: mat4;\n    private _pixelMatrixInverse: mat4;\n    private _fogMatrix: mat4;\n\n    private _posMatrixCache: Map<string, {f64: mat4; f32: mat4}> = new Map();\n    private _alignedPosMatrixCache: Map<string, {f64: mat4; f32: mat4}> = new Map();\n    private _fogMatrixCacheF32: Map<string, mat4> = new Map();\n\n    private _coveringTilesDetailsProvider;\n\n    constructor(options?: TransformOptions) {\n        this._helper = new TransformHelper({\n            calcMatrices: () => this._calcMatrices(),\n            defaultConstrain: (center, zoom) => { return this.defaultConstrain(center, zoom); }\n        }, options);\n        this._coveringTilesDetailsProvider = new MercatorCoveringTilesDetailsProvider();\n    }\n\n    public clone(): ITransform {\n        const clone = new MercatorTransform();\n        clone.apply(this, false);\n        return clone;\n    }\n\n    public apply(that: IReadonlyTransform, constrain: boolean, forceOverrideZ?: boolean): void {\n        this._helper.apply(that, constrain, forceOverrideZ);\n    }\n\n    public get cameraPosition(): vec3 { return this._cameraPosition; }\n    public get projectionMatrix(): mat4 { return this._projectionMatrix; }\n    public get modelViewProjectionMatrix(): mat4 { return this._viewProjMatrix; }\n    public get inverseProjectionMatrix(): mat4 { return this._invProjMatrix; }\n    public get mercatorMatrix(): mat4 { return this._mercatorMatrix; } // Not part of ITransform interface\n\n    getVisibleUnwrappedCoordinates(tileID: CanonicalTileID): UnwrappedTileID[] {\n        const result = [new UnwrappedTileID(0, tileID)];\n        if (this._helper._renderWorldCopies) {\n            const utl = this.screenPointToMercatorCoordinate(new Point(0, 0));\n            const utr = this.screenPointToMercatorCoordinate(new Point(this._helper._width, 0));\n            const ubl = this.screenPointToMercatorCoordinate(new Point(this._helper._width, this._helper._height));\n            const ubr = this.screenPointToMercatorCoordinate(new Point(0, this._helper._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    getCameraFrustum(): Frustum {\n        return Frustum.fromInvProjectionMatrix(this._invViewProjMatrix, this.worldSize);\n    }\n    getClippingPlane(): vec4 | null {\n        return null;\n    }\n    getCoveringTilesDetailsProvider(): CoveringTilesDetailsProvider {\n        return this._coveringTilesDetailsProvider;\n    }\n\n    recalculateZoomAndCenter(terrain?: Terrain): void {\n        // find position the camera is looking on\n        const center = this.screenPointToLocation(this.centerPoint, terrain);\n        const elevation = terrain ? terrain.getElevationForLngLatZoom(center, this._helper._tileZoom) : 0;\n        this._helper.recalculateZoomAndCenter(elevation);\n    }\n\n    setLocationAtPoint(lnglat: LngLat, point: Point) {\n        const z = mercatorZfromAltitude(this.elevation, this.center.lat);\n        const a = this.screenPointToMercatorCoordinateAtZ(point, z);\n        const b = this.screenPointToMercatorCoordinateAtZ(this.centerPoint, z);\n        const loc = MercatorCoordinate.fromLngLat(lnglat);\n        const newCenter = new MercatorCoordinate(\n            loc.x - (a.x - b.x),\n            loc.y - (a.y - b.y));\n        this.setCenter(newCenter?.toLngLat());\n        if (this._helper._renderWorldCopies) {\n            this.setCenter(this.center.wrap());\n        }\n    }\n\n    locationToScreenPoint(lnglat: LngLat, terrain?: Terrain): Point {\n        return terrain ?\n            this.coordinatePoint(MercatorCoordinate.fromLngLat(lnglat), terrain.getElevationForLngLat(lnglat, this), this._pixelMatrix3D) :\n            this.coordinatePoint(MercatorCoordinate.fromLngLat(lnglat));\n    }\n\n    screenPointToLocation(p: Point, terrain?: Terrain): LngLat {\n        return this.screenPointToMercatorCoordinate(p, terrain)?.toLngLat();\n    }\n\n    screenPointToMercatorCoordinate(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        return this.screenPointToMercatorCoordinateAtZ(p);\n    }\n\n    screenPointToMercatorCoordinateAtZ(p: Point, mercatorZ?: number): MercatorCoordinate {\n\n        // calculate point-coordinate on flat earth\n        const targetZ = mercatorZ ? mercatorZ : 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            targetZ);\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: mat4 = 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    getBounds(): LngLatBounds {\n        const top = Math.max(0, this._helper._height / 2 - getMercatorHorizon(this));\n        return new LngLatBounds()\n            .extend(this.screenPointToLocation(new Point(0, top)))\n            .extend(this.screenPointToLocation(new Point(this._helper._width, top)))\n            .extend(this.screenPointToLocation(new Point(this._helper._width, this._helper._height)))\n            .extend(this.screenPointToLocation(new Point(0, this._helper._height)));\n    }\n\n    isPointOnMapSurface(p: Point, terrain?: Terrain): boolean {\n        if (terrain) {\n            const coordinate = terrain.pointCoordinate(p);\n            return coordinate != null;\n        }\n        return (p.y > this.height / 2 - getMercatorHorizon(this));\n    }\n\n    /**\n     * Calculate the posMatrix that, given a tile coordinate, would be used to display the tile on a map.\n     * This function is specific to the mercator projection.\n     * @param tileID - the tile ID\n     * @param aligned - whether to use a pixel-aligned matrix variant, intended for rendering raster tiles\n     * @param useFloat32 - when true, returns a float32 matrix instead of float64. Use float32 for matrices that are passed to shaders, use float64 for everything else.\n     */\n    calculatePosMatrix(tileID: UnwrappedTileID | OverscaledTileID, aligned: boolean = false, useFloat32?: boolean): mat4 {\n        const posMatrixKey = tileID.key ?? calculateTileKey(tileID.wrap, tileID.canonical.z, tileID.canonical.z, tileID.canonical.x, tileID.canonical.y);\n        const cache = aligned ? this._alignedPosMatrixCache : this._posMatrixCache;\n        if (cache.has(posMatrixKey)) {\n            const matrices = cache.get(posMatrixKey);\n            return useFloat32 ? matrices.f32 : matrices.f64;\n        }\n\n        const tileMatrix = calculateTileMatrix(tileID, this.worldSize);\n        mat4.multiply(tileMatrix, aligned ? this._alignedProjMatrix : this._viewProjMatrix, tileMatrix);\n        const matrices = {\n            f64: tileMatrix,\n            f32: new Float32Array(tileMatrix), // Must have a 32 bit float version for WebGL, otherwise WebGL calls in Chrome get very slow.\n        };\n        cache.set(posMatrixKey, matrices);\n        // Make sure to return the correct precision\n        return useFloat32 ? matrices.f32 : matrices.f64;\n    }\n\n    calculateFogMatrix(unwrappedTileID: UnwrappedTileID): mat4 {\n        const posMatrixKey = unwrappedTileID.key;\n        const cache = this._fogMatrixCacheF32;\n        if (cache.has(posMatrixKey)) {\n            return cache.get(posMatrixKey);\n        }\n\n        const fogMatrix = calculateTileMatrix(unwrappedTileID, this.worldSize);\n        mat4.multiply(fogMatrix, this._fogMatrix, fogMatrix);\n\n        cache.set(posMatrixKey, new Float32Array(fogMatrix)); // Must be 32 bit floats, otherwise WebGL calls in Chrome get very slow.\n        return cache.get(posMatrixKey);\n    }\n\n    /**\n     * This mercator implementation returns center lngLat and zoom to ensure that:\n     *\n     * 1) everything beyond the bounds is excluded\n     * 2) a given lngLat is as near the center as possible\n     *\n     * Bounds are those set by maxBounds or North & South \"Poles\" and, if only 1 globe is displayed, antimeridian.\n     */\n    defaultConstrain: TransformConstrainFunction = (lngLat, zoom) => {\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._helper._lngRange;\n\n        if (!this._helper._renderWorldCopies && lngRange === null) {\n            const almost180 = 180 - 1e-10;\n            lngRange = [-almost180, almost180];\n        }\n\n        const worldSize = this.tileSize * 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._helper._latRange) {\n            const latRange = this._helper._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} = projectToWorldCoordinates(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 = unprojectFromWorldCoordinates(worldSize, newPoint).wrap();\n            result.zoom += scaleZoom(scale);\n            return result;\n        }\n\n        if (this._helper._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._helper._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 = unprojectFromWorldCoordinates(worldSize, newPoint).wrap();\n        }\n\n        return result;\n    };\n\n    applyConstrain: TransformConstrainFunction = (lngLat, zoom) => {\n        return this._helper.applyConstrain(lngLat, zoom);\n    };\n\n    calculateCenterFromCameraLngLatAlt(lnglat: LngLatLike, alt: number, bearing?: number, pitch?: number): {center: LngLat; elevation: number; zoom: number} {\n        return this._helper.calculateCenterFromCameraLngLatAlt(lnglat, alt, bearing, pitch);\n    }\n\n    _calculateNearFarZIfNeeded(cameraToSeaLevelDistance: number, limitedPitchRadians: number, offset: Point): void {\n        if (!this._helper.autoCalculateNearFarZ) {\n            return;\n        }\n        // In case of negative minimum elevation (e.g. the dead see, under the sea maps) use a lower plane for calculation\n        const minRenderDistanceBelowCameraInMeters = 100;\n        const minElevation = Math.min(this.elevation, this.minElevationForCurrentTile, this.getCameraAltitude() - minRenderDistanceBelowCameraInMeters);\n        const cameraToLowestPointDistance = cameraToSeaLevelDistance - minElevation * this._helper._pixelPerMeter / Math.cos(limitedPitchRadians);\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.pitchInRadians;\n        const zfov = degreesToRadians(this.fov) * (Math.abs(Math.cos(degreesToRadians(this.roll))) * this.height + Math.abs(Math.sin(degreesToRadians(this.roll))) * this.width) / this.height;\n        const fovAboveCenter = zfov * (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 = getMercatorHorizon(this);\n        const horizonAngle = Math.atan(horizon / this._helper.cameraToCenterDistance);\n        const minFovCenterToHorizonRadians = degreesToRadians(90 - maxMercatorHorizonAngle);\n        const fovCenterToHorizon = horizonAngle > minFovCenterToHorizonRadians ? 2 * horizonAngle * (0.5 + offset.y / (horizon * 2)) : minFovCenterToHorizonRadians;\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\n        this._helper._farZ = (Math.cos(Math.PI / 2 - limitedPitchRadians) * 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._helper._nearZ = this._helper._height / 50;\n    }\n\n    _calcMatrices(): void {\n        if (!this._helper._height) return;\n\n        const offset = this.centerOffset;\n        const point = projectToWorldCoordinates(this.worldSize, this.center);\n        const x = point.x, y = point.y;\n        this._helper._pixelPerMeter = mercatorZfromAltitude(1, this.center.lat) * this.worldSize;\n\n        // Calculate the camera to sea-level distance in pixel in respect of terrain\n        const limitedPitchRadians = degreesToRadians(Math.min(this.pitch, maxMercatorHorizonAngle));\n        const cameraToSeaLevelDistance = Math.max(this._helper.cameraToCenterDistance / 2, this._helper.cameraToCenterDistance + this._helper._elevation * this._helper._pixelPerMeter / Math.cos(limitedPitchRadians));\n\n        this._calculateNearFarZIfNeeded(cameraToSeaLevelDistance, limitedPitchRadians, offset);\n\n        // matrix for conversion from location to clip space(-1 .. 1)\n        let m: mat4;\n        m = new Float64Array(16) as any;\n        mat4.perspective(m, this.fovInRadians, this._helper._width / this._helper._height, this._helper._nearZ, this._helper._farZ);\n        this._invProjMatrix = new Float64Array(16) as any as mat4;\n        fastInvertProjMat4(this._invProjMatrix, m);\n\n        // Apply center of perspective offset\n        m[8] = -offset.x * 2 / this._helper._width;\n        m[9] = offset.y * 2 / this._helper._height;\n        this._projectionMatrix = mat4.clone(m);\n\n        mat4.scale(m, m, [1, -1, 1]);\n        mat4.translate(m, m, [0, 0, -this._helper.cameraToCenterDistance]);\n        mat4.rotateZ(m, m, -this.rollInRadians);\n        mat4.rotateX(m, m, this.pitchInRadians);\n        mat4.rotateZ(m, m, -this.bearingInRadians);\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._helper._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.clipSpaceToPixelsMatrix, 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._viewProjMatrix = m;\n        this._invViewProjMatrix = mat4.invert([] as any, m);\n\n        const cameraPos: vec4 = [0, 0, -1, 1];\n        vec4.transformMat4(cameraPos, cameraPos, this._invViewProjMatrix);\n        this._cameraPosition = [\n            cameraPos[0] / cameraPos[3],\n            cameraPos[1] / cameraPos[3],\n            cameraPos[2] / cameraPos[3]\n        ];\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.fovInRadians, this.width / this.height, cameraToSeaLevelDistance, this._helper._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.rotateZ(this._fogMatrix, this._fogMatrix, -this.rollInRadians);\n        mat4.rotateX(this._fogMatrix, this._fogMatrix, this.pitchInRadians);\n        mat4.rotateZ(this._fogMatrix, this._fogMatrix, -this.bearingInRadians);\n        mat4.translate(this._fogMatrix, this._fogMatrix, [-x, -y, 0]);\n        mat4.scale(this._fogMatrix, this._fogMatrix, [1, 1, this._helper._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.clipSpaceToPixelsMatrix, 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\u00B0, 90\u00B0, 180\u00B0, and 270\u00B0 rasters are crisp, and adjust the shift so that\n        // it is always <= 0.5 pixels.\n        const xShift = (this._helper._width % 2) / 2, yShift = (this._helper._height % 2) / 2,\n            angleCos = Math.cos(this.bearingInRadians), angleSin = Math.sin(-this.bearingInRadians),\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._alignedProjMatrix = 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._clearMatrixCaches();\n    }\n\n    private _clearMatrixCaches(): void {\n        this._posMatrixCache.clear();\n        this._alignedPosMatrixCache.clear();\n        this._fogMatrixCacheF32.clear();\n    }\n\n    maxPitchScaleFactor(): number {\n        // calcMatrices hasn't run yet\n        if (!this._pixelMatrixInverse) return 1;\n\n        const coord = this.screenPointToMercatorCoordinate(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._helper.cameraToCenterDistance;\n    }\n\n    getCameraPoint(): Point {\n        return this._helper.getCameraPoint();\n    }\n\n    getCameraAltitude(): number {\n        return this._helper.getCameraAltitude();\n    }\n\n    getCameraLngLat(): LngLat {\n        const pixelPerMeter = mercatorZfromAltitude(1, this.center.lat) * this.worldSize;\n        const cameraToCenterDistanceMeters = this._helper.cameraToCenterDistance / pixelPerMeter;\n        const camMercator = cameraMercatorCoordinateFromCenterAndRotation(this.center, this.elevation, this.pitch, this.bearing, cameraToCenterDistanceMeters);\n        return camMercator.toLngLat();\n    }\n\n    lngLatToCameraDepth(lngLat: LngLat, elevation: number) {\n        const coord = MercatorCoordinate.fromLngLat(lngLat);\n        const p = [coord.x * this.worldSize, coord.y * this.worldSize, elevation, 1] as vec4;\n        vec4.transformMat4(p, p, this._viewProjMatrix);\n        return (p[2] / p[3]);\n    }\n\n    getProjectionData(params: ProjectionDataParams): ProjectionData {\n        const {overscaledTileID, aligned, applyTerrainMatrix} = params;\n        const mercatorTileCoordinates = this._helper.getMercatorTileCoordinates(overscaledTileID);\n        const tilePosMatrix = overscaledTileID ? this.calculatePosMatrix(overscaledTileID, aligned, true) : null;\n\n        let mainMatrix: mat4;\n        if (overscaledTileID?.terrainRttPosMatrix32f && applyTerrainMatrix) {\n            mainMatrix = overscaledTileID.terrainRttPosMatrix32f;\n        } else if (tilePosMatrix) {\n            mainMatrix = tilePosMatrix; // This matrix should be float32\n        } else {\n            mainMatrix = createIdentityMat4f32();\n        }\n        return {\n            mainMatrix, // Might be set to a custom matrix by different projections.\n            tileMercatorCoords: mercatorTileCoordinates,\n            clippingPlane: [0, 0, 0, 0],\n            projectionTransition: 0.0, // Range 0..1, where 0 is mercator, 1 is another projection, mostly globe.\n            fallbackMatrix: mainMatrix,\n        };\n    }\n\n    isLocationOccluded(_: LngLat): boolean {\n        return false;\n    }\n\n    getPixelScale(): number {\n        return 1.0;\n    }\n\n    getCircleRadiusCorrection(): number {\n        return 1.0;\n    }\n\n    getPitchedTextCorrection(_textAnchorX: number, _textAnchorY: number, _tileID: UnwrappedTileID): number {\n        return 1.0;\n    }\n\n    transformLightDirection(dir: vec3): vec3 {\n        return vec3.clone(dir);\n    }\n\n    getRayDirectionFromPixel(_p: Point): vec3 {\n        throw new Error('Not implemented.'); // No need for this in mercator transform\n    }\n\n    projectTileCoordinates(x: number, y: number, unwrappedTileID: UnwrappedTileID, getElevation: (x: number, y: number) => number): PointProjection {\n        const matrix = this.calculatePosMatrix(unwrappedTileID);\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\n    populateCache(coords: OverscaledTileID[]): void {\n        for (const coord of coords) {\n            // Return value is thrown away, but this function will still\n            // place the pos matrix into the transform's internal cache.\n            this.calculatePosMatrix(coord);\n        }\n    }\n\n    getMatrixForModel(location: LngLatLike, altitude?: number): mat4 {\n        const modelAsMercatorCoordinate = MercatorCoordinate.fromLngLat(\n            location,\n            altitude\n        );\n        const scale = modelAsMercatorCoordinate.meterInMercatorCoordinateUnits();\n\n        const m = createIdentityMat4f64();\n        mat4.translate(m, m, [modelAsMercatorCoordinate.x, modelAsMercatorCoordinate.y, modelAsMercatorCoordinate.z]);\n        mat4.rotateZ(m, m, Math.PI);\n        mat4.rotateX(m, m, Math.PI / 2);\n        mat4.scale(m, m, [-scale, scale, scale]);\n        return m;\n    }\n\n    getProjectionDataForCustomLayer(applyGlobeMatrix: boolean = true): ProjectionData {\n        const tileID = new OverscaledTileID(0, 0, 0, 0, 0);\n        const projectionData = this.getProjectionData({overscaledTileID: tileID, applyGlobeMatrix});\n\n        const tileMatrix = calculateTileMatrix(tileID, this.worldSize);\n        mat4.multiply(tileMatrix, this._viewProjMatrix, tileMatrix);\n\n        projectionData.tileMercatorCoords = [0, 0, 1, 1];\n\n        // Even though we requested projection data for the mercator base tile which covers the entire mercator range,\n        // the shader projection machinery still expects inputs to be in tile units range [0..EXTENT].\n        // Since custom layers are expected to supply mercator coordinates [0..1], we need to rescale\n        // both matrices by EXTENT. We also need to rescale Z.\n\n        const scale: vec3 = [EXTENT, EXTENT, this.worldSize / this._helper.pixelsPerMeter];\n\n        // We pass full-precision 64bit float matrices to custom layers to prevent precision loss in case the user wants to do further transformations.\n        // Otherwise we get very visible precision-artifacts and twitching for objects that are bulding-scale.\n        const projectionMatrixScaled = createMat4f64();\n        mat4.scale(projectionMatrixScaled, tileMatrix, scale);\n\n        projectionData.fallbackMatrix = projectionMatrixScaled;\n        projectionData.mainMatrix = projectionMatrixScaled;\n        return projectionData;\n    }\n\n    getFastPathSimpleProjectionMatrix(tileID: OverscaledTileID): mat4 {\n        return this.calculatePosMatrix(tileID);\n    }\n}\n", "import Point from '@mapbox/point-geometry';\nimport {type IReadonlyTransform, type ITransform} from '../transform_interface';\nimport {type LngLat, type LngLatLike} from '../lng_lat';\nimport {type CameraForBoundsOptions, type PointLike} from '../../ui/camera';\nimport {type PaddingOptions} from '../edge_insets';\nimport {type LngLatBounds} from '../lng_lat_bounds';\nimport {degreesToRadians, getRollPitchBearing, type RollPitchBearing, rollPitchBearingToQuat, scaleZoom, warnOnce, zoomScale} from '../../util/util';\nimport {quat} from 'gl-matrix';\nimport {interpolates} from '@maplibre/maplibre-gl-style-spec';\nimport {projectToWorldCoordinates, unprojectFromWorldCoordinates} from './mercator_utils';\n\nexport type MapControlsDeltas = {\n    panDelta: Point;\n    zoomDelta: number;\n    bearingDelta: number;\n    pitchDelta: number;\n    rollDelta: number;\n    around: Point;\n};\n\nexport type CameraForBoxAndBearingHandlerResult = {\n    center: LngLat;\n    zoom: number;\n    bearing: number;\n};\n\nexport type EaseToHandlerOptions = {\n    bearing: number;\n    pitch: number;\n    roll: number;\n    padding: PaddingOptions;\n    offsetAsPoint: Point;\n    around?: LngLat;\n    aroundPoint?: Point;\n    center?: LngLatLike;\n    zoom?: number;\n    offset?: PointLike;\n};\n\nexport type EaseToHandlerResult = {\n    easeFunc: (k: number) => void;\n    elevationCenter: LngLat;\n    isZooming: boolean;\n};\n\nexport type FlyToHandlerOptions = {\n    bearing: number;\n    pitch: number;\n    roll: number;\n    padding: PaddingOptions;\n    offsetAsPoint: Point;\n    center?: LngLatLike;\n    locationAtOffset: LngLat;\n    zoom?: number;\n    minZoom?: number;\n};\n\nexport type FlyToHandlerResult = {\n    easeFunc: (k: number, scale: number, centerFactor: number, pointAtOffset: Point) => void;\n    scaleOfZoom: number;\n    scaleOfMinZoom?: number;\n    targetCenter: LngLat;\n    pixelPathLength: number;\n};\n\nexport type UpdateRotationArgs = {\n    /**\n     * The starting Euler angles.\n     */\n    startEulerAngles: RollPitchBearing;\n\n    /**\n     * The end Euler angles.\n     */\n    endEulerAngles: RollPitchBearing;\n\n    /**\n     * The transform to be updated\n     */\n    tr: ITransform;\n\n    /**\n     * The interpolation fraction, between 0 and 1.\n     */\n    k: number;\n\n    /**\n     * If true, use spherical linear interpolation. If false, use linear interpolation of Euler angles.\n     */\n    useSlerp: boolean;\n};\n\n/**\n * @internal\n */\nexport function cameraBoundsWarning() {\n    warnOnce(\n        'Map cannot fit within canvas with the given bounds, padding, and/or offset.'\n    );\n}\n\n/**\n * @internal\n * Contains projection-specific functions related to camera controls, easeTo, flyTo, inertia, etc.\n */\nexport interface ICameraHelper {\n    get useGlobeControls(): boolean;\n\n    handlePanInertia(pan: Point, transform: IReadonlyTransform): {\n        easingCenter: LngLat;\n        easingOffset: Point;\n    };\n\n    handleMapControlsRollPitchBearingZoom(deltas: MapControlsDeltas, tr: ITransform): void;\n\n    handleMapControlsPan(deltas: MapControlsDeltas, tr: ITransform, preZoomAroundLoc: LngLat): void;\n\n    cameraForBoxAndBearing(options: CameraForBoundsOptions, padding: PaddingOptions, bounds: LngLatBounds, bearing: number, tr: IReadonlyTransform): CameraForBoxAndBearingHandlerResult;\n\n    handleJumpToCenterZoom(tr: ITransform, options: { zoom?: number; center?: LngLatLike }): void;\n\n    handleEaseTo(tr: ITransform, options: EaseToHandlerOptions): EaseToHandlerResult;\n\n    handleFlyTo(tr: ITransform, options: FlyToHandlerOptions): FlyToHandlerResult;\n}\n\n/**\n * @internal\n * Set a transform's rotation to a value interpolated between startEulerAngles and endEulerAngles\n */\nexport function updateRotation(args: UpdateRotationArgs) {\n    if (args.useSlerp) {\n        // At pitch ==0, the Euler angle representation is ambiguous. In this case, set the Euler angles\n        // to the representation requested by the caller\n        if (args.k < 1) {\n            const startRotation = rollPitchBearingToQuat(args.startEulerAngles.roll, args.startEulerAngles.pitch, args.startEulerAngles.bearing);\n            const endRotation = rollPitchBearingToQuat(args.endEulerAngles.roll, args.endEulerAngles.pitch, args.endEulerAngles.bearing);\n            const rotation: quat = new Float64Array(4) as any;\n            quat.slerp(rotation, startRotation, endRotation, args.k);\n            const eulerAngles = getRollPitchBearing(rotation);\n            args.tr.setRoll(eulerAngles.roll);\n            args.tr.setPitch(eulerAngles.pitch);\n            args.tr.setBearing(eulerAngles.bearing);\n        } else {\n            args.tr.setRoll(args.endEulerAngles.roll);\n            args.tr.setPitch(args.endEulerAngles.pitch);\n            args.tr.setBearing(args.endEulerAngles.bearing);\n        }\n    } else {\n        args.tr.setRoll(interpolates.number(args.startEulerAngles.roll, args.endEulerAngles.roll, args.k));\n        args.tr.setPitch(interpolates.number(args.startEulerAngles.pitch, args.endEulerAngles.pitch, args.k));\n        args.tr.setBearing(interpolates.number(args.startEulerAngles.bearing, args.endEulerAngles.bearing, args.k));\n    }\n}\n\nexport function cameraForBoxAndBearing(options: CameraForBoundsOptions, padding: PaddingOptions, bounds: LngLatBounds, bearing: number, tr: IReadonlyTransform): CameraForBoxAndBearingHandlerResult {\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\n    const nwWorld = projectToWorldCoordinates(tr.worldSize, bounds.getNorthWest());\n    const neWorld = projectToWorldCoordinates(tr.worldSize, bounds.getNorthEast());\n    const seWorld = projectToWorldCoordinates(tr.worldSize, bounds.getSouthEast());\n    const swWorld = projectToWorldCoordinates(tr.worldSize, 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\n    const availableWidth = (tr.width - (edgePadding.left + edgePadding.right + padding.left + padding.right));\n    const availableHeight = (tr.height - (edgePadding.top + edgePadding.bottom + padding.top + padding.bottom));\n    const scaleX = availableWidth / size.x;\n    const scaleY = availableHeight / size.y;\n\n    if (scaleY < 0 || scaleX < 0) {\n        cameraBoundsWarning();\n        return undefined;\n    }\n\n    const zoom = Math.min(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 = (padding.left - padding.right) / 2;\n    const paddingOffsetY = (padding.top - 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 / zoomScale(zoom));\n\n    const center = unprojectFromWorldCoordinates(\n        tr.worldSize,\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", "import type Point from '@mapbox/point-geometry';\nimport {LngLat, type LngLatLike} from '../lng_lat';\nimport {cameraForBoxAndBearing, type CameraForBoxAndBearingHandlerResult, type EaseToHandlerResult, type EaseToHandlerOptions, type FlyToHandlerResult, type FlyToHandlerOptions, type ICameraHelper, type MapControlsDeltas, updateRotation, type UpdateRotationArgs} from './camera_helper';\nimport {normalizeCenter} from '../transform_helper';\nimport {rollPitchBearingEqual, scaleZoom, zoomScale} from '../../util/util';\nimport {getMercatorHorizon, projectToWorldCoordinates, unprojectFromWorldCoordinates} from './mercator_utils';\nimport {interpolates} from '@maplibre/maplibre-gl-style-spec';\n\nimport type {IReadonlyTransform, ITransform} from '../transform_interface';\nimport type {CameraForBoundsOptions} from '../../ui/camera';\nimport type {PaddingOptions} from '../edge_insets';\nimport type {LngLatBounds} from '../lng_lat_bounds';\n\n/**\n * @internal\n */\nexport class MercatorCameraHelper implements ICameraHelper {\n    get useGlobeControls(): boolean { return false; }\n\n    handlePanInertia(pan: Point, transform: IReadonlyTransform): {\n        easingCenter: LngLat;\n        easingOffset: Point;\n    } {\n        // Reduce the offset so that it never goes past the horizon. If it goes past\n        // the horizon, the pan direction is opposite of the intended direction.\n        const offsetLength = pan.mag();\n        const pixelsToHorizon = Math.abs(getMercatorHorizon(transform));\n        const horizonFactor = 0.75; // Must be < 1 to prevent the offset from crossing the horizon\n        const offsetAsPoint = pan.mult(Math.min(pixelsToHorizon * horizonFactor / offsetLength, 1.0));\n        return {\n            easingOffset: offsetAsPoint,\n            easingCenter: transform.center,\n        };\n    }\n\n    handleMapControlsRollPitchBearingZoom(deltas: MapControlsDeltas, tr: ITransform): void {\n        if (deltas.bearingDelta) tr.setBearing(tr.bearing + deltas.bearingDelta);\n        if (deltas.pitchDelta) tr.setPitch(tr.pitch + deltas.pitchDelta);\n        if (deltas.rollDelta) tr.setRoll(tr.roll + deltas.rollDelta);\n        if (deltas.zoomDelta) tr.setZoom(tr.zoom + deltas.zoomDelta);\n    }\n\n    handleMapControlsPan(deltas: MapControlsDeltas, tr: ITransform, preZoomAroundLoc: LngLat): void {\n        // If we are rotating about the center point, there is no need to update the transform center. Doing so causes\n        // a small amount of drift of the center point, especially when pitch is close to 90 degrees.\n        // In this case, return early.\n        if (deltas.around.distSqr(tr.centerPoint) < 1.0e-2) {\n            return;\n        }\n        tr.setLocationAtPoint(preZoomAroundLoc, deltas.around);\n    }\n\n    cameraForBoxAndBearing(options: CameraForBoundsOptions, padding: PaddingOptions, bounds: LngLatBounds, bearing: number, tr: IReadonlyTransform): CameraForBoxAndBearingHandlerResult {\n        return cameraForBoxAndBearing(options, padding, bounds, bearing, tr);\n    }\n\n    handleJumpToCenterZoom(tr: ITransform, options: { zoom?: number; center?: LngLatLike }): void {\n        // Mercator zoom & center handling.\n        const optionsZoom = typeof options.zoom !== 'undefined';\n\n        const zoom = optionsZoom ? +options.zoom : tr.zoom;\n        if (tr.zoom !== zoom) {\n            tr.setZoom(+options.zoom);\n        }\n\n        if (options.center !== undefined) {\n            tr.setCenter(LngLat.convert(options.center));\n        }\n    }\n\n    handleEaseTo(tr: ITransform, options: EaseToHandlerOptions): EaseToHandlerResult {\n        const startZoom = tr.zoom;\n        const startPadding = tr.padding;\n        const startEulerAngles = {roll: tr.roll, pitch: tr.pitch, bearing: tr.bearing};\n        const endRoll = options.roll === undefined ? tr.roll : options.roll;\n        const endPitch = options.pitch === undefined ? tr.pitch : options.pitch;\n        const endBearing = options.bearing === undefined ? tr.bearing : options.bearing;\n        const endEulerAngles = {roll: endRoll, pitch: endPitch, bearing: endBearing};\n\n        const optionsZoom = typeof options.zoom !== 'undefined';\n\n        const doPadding = !tr.isPaddingEqual(options.padding);\n\n        let isZooming = false;\n\n        const zoom = optionsZoom ? +options.zoom : tr.zoom;\n\n        let pointAtOffset = tr.centerPoint.add(options.offsetAsPoint);\n        const locationAtOffset = tr.screenPointToLocation(pointAtOffset);\n        const {center, zoom: endZoom} = tr.applyConstrain(\n            LngLat.convert(options.center || locationAtOffset),\n            zoom ?? startZoom\n        );\n        normalizeCenter(tr, center);\n\n        const from = projectToWorldCoordinates(tr.worldSize, locationAtOffset);\n        const delta = projectToWorldCoordinates(tr.worldSize, center).sub(from);\n\n        const finalScale = zoomScale(endZoom - startZoom);\n        isZooming = (endZoom !== startZoom);\n\n        const easeFunc = (k: number) => {\n            if (isZooming) {\n                tr.setZoom(interpolates.number(startZoom, endZoom, k));\n            }\n            if (!rollPitchBearingEqual(startEulerAngles, endEulerAngles)) {\n                updateRotation({\n                    startEulerAngles,\n                    endEulerAngles,\n                    tr,\n                    k,\n                    useSlerp: startEulerAngles.roll != endEulerAngles.roll} as UpdateRotationArgs);\n            }\n            if (doPadding) {\n                tr.interpolatePadding(startPadding, options.padding, 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(options.offsetAsPoint);\n            }\n\n            if (options.around) {\n                tr.setLocationAtPoint(options.around, options.aroundPoint);\n            } else {\n                const scale = zoomScale(tr.zoom - startZoom);\n                const base = endZoom > startZoom ?\n                    Math.min(2, finalScale) :\n                    Math.max(0.5, finalScale);\n                const speedup = Math.pow(base, 1 - k);\n                const newCenter = unprojectFromWorldCoordinates(tr.worldSize, from.add(delta.mult(k * speedup)).mult(scale));\n                tr.setLocationAtPoint(tr.renderWorldCopies ? newCenter.wrap() : newCenter, pointAtOffset);\n            }\n        };\n\n        return {\n            easeFunc,\n            isZooming,\n            elevationCenter: center,\n        };\n    }\n\n    handleFlyTo(tr: ITransform, options: FlyToHandlerOptions): FlyToHandlerResult {\n        const optionsZoom = typeof options.zoom !== 'undefined';\n\n        const startZoom = tr.zoom;\n\n        // Obtain target center and zoom\n        const constrained = tr.applyConstrain(\n            LngLat.convert(options.center || options.locationAtOffset),\n            optionsZoom ? +options.zoom : startZoom\n        );\n        const targetCenter = constrained.center;\n        const targetZoom = constrained.zoom;\n\n        normalizeCenter(tr, targetCenter);\n\n        const from = projectToWorldCoordinates(tr.worldSize, options.locationAtOffset);\n        const delta = projectToWorldCoordinates(tr.worldSize, targetCenter).sub(from);\n\n        const pixelPathLength = delta.mag();\n\n        const scaleOfZoom = zoomScale(targetZoom - startZoom);\n\n        const optionsMinZoom = typeof options.minZoom !== 'undefined';\n\n        let scaleOfMinZoom: number;\n\n        if (optionsMinZoom) {\n            const minZoomPreConstrain = Math.min(+options.minZoom, startZoom, targetZoom);\n            const minZoom = tr.applyConstrain(targetCenter, minZoomPreConstrain).zoom;\n            scaleOfMinZoom = zoomScale(minZoom - startZoom);\n        }\n\n        const easeFunc = (k: number, scale: number, centerFactor: number, pointAtOffset: Point) => {\n            tr.setZoom(k === 1 ? targetZoom : startZoom + scaleZoom(scale));\n            const newCenter = k === 1 ? targetCenter : unprojectFromWorldCoordinates(tr.worldSize, from.add(delta.mult(centerFactor)).mult(scale));\n            tr.setLocationAtPoint(tr.renderWorldCopies ? newCenter.wrap() : newCenter, pointAtOffset);\n        };\n\n        return {\n            easeFunc,\n            scaleOfZoom,\n            targetCenter,\n            scaleOfMinZoom,\n            pixelPathLength,\n        };\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 type {CullFaceModeType, FrontFaceType} from './types';\n\nconst FRONT = 0x0404;\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\n    /**\n     * The standard GL cull mode. Culls backfacing triangles when counterclockwise vertex order is used.\n     * Use for 3D geometry such as terrain.\n     */\n    static backCCW: Readonly<CullFaceMode>;\n\n    /**\n     * Opposite of {@link backCCW}. Culls front-facing triangles when counterclockwise vertex order is used.\n     */\n    static frontCCW: Readonly<CullFaceMode>;\n}\n\nCullFaceMode.disabled = new CullFaceMode(false, BACK, CCW);\nCullFaceMode.backCCW = new CullFaceMode(true, BACK, CCW);\nCullFaceMode.frontCCW = new CullFaceMode(true, FRONT, CCW);\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", "export function isWebGL2(\n    gl: WebGLRenderingContext | WebGL2RenderingContext\n): gl is WebGL2RenderingContext {\n    // this method is really faster than fetching a cache:\n    return typeof WebGL2RenderingContext !== 'undefined' && gl instanceof WebGL2RenderingContext;\n}\n", "import {Color} from '@maplibre/maplibre-gl-style-spec';\nimport {ColorMode} from '../../webgl/color_mode';\nimport {CullFaceMode} from '../../webgl/cull_face_mode';\nimport {DepthMode} from '../../webgl/depth_mode';\nimport {StencilMode} from '../../webgl/stencil_mode';\nimport {warnOnce} from '../../util/util';\nimport {projectionErrorMeasurementUniformValues} from '../../webgl/program/projection_error_measurement_program';\nimport {Mesh} from '../../render/mesh';\nimport {SegmentVector} from '../../data/segment';\nimport {PosArray, TriangleIndexArray} from '../../data/array_types.g';\nimport posAttributes from '../../data/pos_attributes';\nimport {type Framebuffer} from '../../webgl/framebuffer';\nimport {isWebGL2} from '../../webgl/webgl2';\nimport {type ProjectionGPUContext} from './projection';\n\n/**\n * For vector globe the vertex shader projects mercator coordinates to angular coordinates on a sphere.\n * This projection requires some inverse trigonometry `atan(exp(...))`, which is inaccurate on some GPUs (mainly on AMD and Nvidia).\n * The inaccuracy is severe enough to require a workaround. The uncorrected map is shifted north-south by up to several hundred meters in some latitudes.\n * Since the inaccuracy is hardware-dependant and may change in the future, we need to measure the error at runtime.\n *\n * Our approach relies on several assumptions:\n *\n * - the error is only present in the \"latitude\" component (longitude doesn't need any inverse trigonometry)\n * - the error is continuous and changes slowly with latitude\n * - at zoom levels where the error is noticeable, the error is more-or-less the same across the entire visible map area (and thus can be described with a single number)\n *\n * Solution:\n *\n * Every few frames, launch a GPU shader that measures the error for the current map center latitude, and writes it to a 1x1 texture.\n * Read back that texture, and offset the globe projection matrix according to the error (interpolating smoothly from old error to new error if needed).\n * The texture readback is done asynchronously using Pixel Pack Buffers (WebGL2) when possible, and has a few frames of latency, but that should not be a problem.\n *\n * General operation of this class each frame is:\n *\n * - render the error shader into a fbo, read that pixel into a PBO, place a fence\n * - wait a few frames to allow the GPU (and driver) to actually execute the shader\n * - wait for the fence to be signalled (guaranteeing the shader to actually be executed)\n * - read back the PBO's contents\n * - wait a few more frames\n * - repeat\n */\nexport class ProjectionErrorMeasurement {\n    // We wait at least this many frames after measuring until we read back the value.\n    // After this period, we might wait more frames until a fence is signalled to make sure the rendering is completed.\n    private readonly _readbackWaitFrames = 4;\n    // We wait this many frames after *reading back* a measurement until we trigger measure again.\n    // We could in theory render the measurement pixel immediately, but we wait to make sure\n    // no pipeline stall happens.\n    private readonly _measureWaitFrames = 6;\n    private readonly _texWidth = 1;\n    private readonly _texHeight = 1;\n    private readonly _texFormat: number;\n    private readonly _texType: number;\n\n    private _fullscreenTriangle: Mesh;\n    private _fbo: Framebuffer;\n    private _resultBuffer: Uint8Array;\n    private _pbo: WebGLBuffer;\n    private _cachedRenderContext: ProjectionGPUContext;\n\n    private _measuredError: number = 0; // Result of last measurement\n    private _updateCount: number = 0;\n    private _lastReadbackFrame: number = -1000;\n\n    get awaitingQuery(): boolean {\n        return !!this._readbackQueue;\n    }\n\n    // There is never more than one readback waiting\n    private _readbackQueue: {\n        frameNumberIssued: number; // Frame number when the data was first computed\n        sync: WebGLSync;\n    } = null;\n\n    public constructor(renderContext: ProjectionGPUContext) {\n        this._cachedRenderContext = renderContext;\n\n        const context = renderContext.context;\n        const gl = context.gl;\n\n        this._texFormat = gl.RGBA;\n        this._texType = gl.UNSIGNED_BYTE;\n\n        const vertexArray = new PosArray();\n        vertexArray.emplaceBack(-1, -1);\n        vertexArray.emplaceBack(2, -1);\n        vertexArray.emplaceBack(-1, 2);\n        const indexArray = new TriangleIndexArray();\n        indexArray.emplaceBack(0, 1, 2);\n\n        this._fullscreenTriangle = new Mesh(\n            context.createVertexBuffer(vertexArray, posAttributes.members),\n            context.createIndexBuffer(indexArray),\n            SegmentVector.simpleSegment(0, 0, vertexArray.length, indexArray.length)\n        );\n\n        this._resultBuffer = new Uint8Array(4);\n\n        context.activeTexture.set(gl.TEXTURE1);\n\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.NEAREST);\n        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);\n        gl.texImage2D(gl.TEXTURE_2D, 0, this._texFormat, this._texWidth, this._texHeight, 0, this._texFormat, this._texType, null);\n\n        this._fbo = context.createFramebuffer(this._texWidth, this._texHeight, false, false);\n        this._fbo.colorAttachment.set(texture);\n\n        if (isWebGL2(gl)) {\n            this._pbo = gl.createBuffer();\n            gl.bindBuffer(gl.PIXEL_PACK_BUFFER, this._pbo);\n            gl.bufferData(gl.PIXEL_PACK_BUFFER, 4, gl.STREAM_READ);\n            gl.bindBuffer(gl.PIXEL_PACK_BUFFER, null);\n        }\n    }\n\n    public destroy() {\n        const gl = this._cachedRenderContext.context.gl;\n        this._fullscreenTriangle.destroy();\n        this._fbo.destroy();\n        gl.deleteBuffer(this._pbo);\n        this._fullscreenTriangle = null;\n        this._fbo = null;\n        this._pbo = null;\n        this._resultBuffer = null;\n    }\n\n    public updateErrorLoop(normalizedMercatorY: number, expectedAngleY: number): number {\n        const currentFrame = this._updateCount;\n\n        if (this._readbackQueue) {\n            // Try to read back if enough frames elapsed. Otherwise do nothing, just wait another frame.\n            if (currentFrame >= this._readbackQueue.frameNumberIssued + this._readbackWaitFrames) {\n                // Try to read back - it is possible that this method does nothing, then\n                // the readback queue will not be cleared and we will retry next frame.\n                this._tryReadback();\n            }\n        } else {\n            if (currentFrame >= this._lastReadbackFrame + this._measureWaitFrames) {\n                this._renderErrorTexture(normalizedMercatorY, expectedAngleY);\n            }\n        }\n\n        this._updateCount++;\n        return this._measuredError;\n    }\n\n    private _bindFramebuffer() {\n        const context = this._cachedRenderContext.context;\n        const gl = context.gl;\n        context.activeTexture.set(gl.TEXTURE1);\n        gl.bindTexture(gl.TEXTURE_2D, this._fbo.colorAttachment.get());\n        context.bindFramebuffer.set(this._fbo.framebuffer);\n    }\n\n    private _renderErrorTexture(input: number, outputExpected: number): void {\n        const context = this._cachedRenderContext.context;\n        const gl = context.gl;\n\n        // Update framebuffer contents\n        this._bindFramebuffer();\n        context.viewport.set([0, 0, this._texWidth, this._texHeight]);\n        context.clear({color: Color.transparent});\n\n        const program = this._cachedRenderContext.useProgram('projectionErrorMeasurement');\n\n        program.draw(context, gl.TRIANGLES,\n            DepthMode.disabled, StencilMode.disabled,\n            ColorMode.unblended, CullFaceMode.disabled,\n            projectionErrorMeasurementUniformValues(input, outputExpected), null, null,\n            '$clipping', this._fullscreenTriangle.vertexBuffer, this._fullscreenTriangle.indexBuffer,\n            this._fullscreenTriangle.segments);\n\n        if (this._pbo && isWebGL2(gl)) {\n            // Read back into PBO\n            gl.bindBuffer(gl.PIXEL_PACK_BUFFER, this._pbo);\n            gl.readBuffer(gl.COLOR_ATTACHMENT0);\n            gl.readPixels(0, 0, this._texWidth, this._texHeight, this._texFormat, this._texType, 0);\n            gl.bindBuffer(gl.PIXEL_PACK_BUFFER, null);\n            const sync = gl.fenceSync(gl.SYNC_GPU_COMMANDS_COMPLETE, 0);\n            gl.flush();\n\n            this._readbackQueue = {\n                frameNumberIssued: this._updateCount,\n                sync,\n            };\n        } else {\n            // Read it back later.\n            this._readbackQueue = {\n                frameNumberIssued: this._updateCount,\n                sync: null,\n            };\n        }\n    }\n\n    private _tryReadback(): void {\n        const gl = this._cachedRenderContext.context.gl;\n\n        if (this._pbo && this._readbackQueue && isWebGL2(gl)) {\n            // WebGL 2 path\n            const waitResult = gl.clientWaitSync(this._readbackQueue.sync, 0, 0);\n\n            if (waitResult === gl.WAIT_FAILED) {\n                warnOnce('WebGL2 clientWaitSync failed.');\n                this._readbackQueue = null;\n                this._lastReadbackFrame = this._updateCount;\n                return;\n            }\n\n            if (waitResult === gl.TIMEOUT_EXPIRED) {\n                return; // Wait one more frame\n            }\n\n            gl.bindBuffer(gl.PIXEL_PACK_BUFFER, this._pbo);\n            gl.getBufferSubData(gl.PIXEL_PACK_BUFFER, 0, this._resultBuffer, 0, 4);\n            gl.bindBuffer(gl.PIXEL_PACK_BUFFER, null);\n        } else {\n            // WebGL1 compatible\n            this._bindFramebuffer();\n            gl.readPixels(0, 0, this._texWidth, this._texHeight, this._texFormat, this._texType, this._resultBuffer);\n        }\n\n        // If we made it here, _resultBuffer contains the new measurement\n        this._readbackQueue = null;\n        this._measuredError = ProjectionErrorMeasurement._parseRGBA8float(this._resultBuffer);\n        this._lastReadbackFrame = this._updateCount;\n    }\n\n    private static _parseRGBA8float(buffer: Uint8Array): number {\n        let result = 0;\n        result += buffer[0] / 256.0;\n        result += buffer[1] / 65536.0;\n        result += buffer[2] / 16777216.0;\n        if (buffer[3] < 127.0) {\n            result = -result;\n        }\n        return result / 128.0;\n    }\n}\n", "import {Uniform1f} from '../uniform_binding';\nimport type {Context} from '../../webgl/context';\nimport type {UniformValues, UniformLocations} from '../uniform_binding';\n\nexport type ProjectionErrorMeasurementUniformsType = {\n    'u_input': Uniform1f;\n    'u_output_expected': Uniform1f;\n};\n\nconst projectionErrorMeasurementUniforms = (context: Context, locations: UniformLocations): ProjectionErrorMeasurementUniformsType => ({\n    'u_input': new Uniform1f(context, locations.u_input),\n    'u_output_expected': new Uniform1f(context, locations.u_output_expected),\n});\n\nconst projectionErrorMeasurementUniformValues = (\n    input: number,\n    outputExpected: number\n): UniformValues<ProjectionErrorMeasurementUniformsType> => ({\n    'u_input': input,\n    'u_output_expected': outputExpected,\n});\n\nexport {projectionErrorMeasurementUniforms, projectionErrorMeasurementUniformValues};\n", "import {type Context} from '../webgl/context';\nimport {Mesh} from '../render/mesh';\nimport {PosArray, TriangleIndexArray} from '../data/array_types.g';\nimport {SegmentVector} from '../data/segment';\nimport {NORTH_POLE_Y, SOUTH_POLE_Y} from '../render/subdivision';\nimport {EXTENT} from '../data/extent';\nimport posAttributes from '../data/pos_attributes';\n\n/**\n * The size of border region for stencil masks, in internal tile coordinates.\n * Used for globe rendering.\n */\nconst EXTENT_STENCIL_BORDER = EXTENT / 128;\n\n/**\n * Options for generating a tile mesh.\n * Can optionally configure any of the following:\n * - mesh subdivision granularity\n * - border presence\n * - special geometry for the north and/or south pole\n */\nexport type CreateTileMeshOptions = {\n    /**\n     * Specifies how much should the tile mesh be subdivided.\n     * A value of 1 leads to a simple quad, a value of 4 will result in a grid of 4x4 quads.\n     */\n    granularity?: number;\n    /**\n     * When true, an additional ring of quads is generated along the border, always extending `EXTENT_STENCIL_BORDER` units away from the main mesh.\n     */\n    generateBorders?: boolean;\n    /**\n     * When true, additional geometry is generated along the north edge of the mesh, connecting it to the pole special vertex position.\n     * This geometry replaces the mesh border along this edge, if one is present.\n     */\n    extendToNorthPole?: boolean;\n    /**\n     * When true, additional geometry is generated along the south edge of the mesh, connecting it to the pole special vertex position.\n     * This geometry replaces the mesh border along this edge, if one is present.\n     */\n    extendToSouthPole?: boolean;\n};\n\n/**\n * Stores the prepared vertex and index buffer bytes for a mesh.\n */\nexport type TileMesh = {\n    /**\n     * The vertex data. Each vertex is two 16 bit signed integers, one for X, one for Y.\n     */\n    vertices: ArrayBuffer;\n    /**\n     * The index data. Each triangle is defined by three indices. The indices may either be 16 bit or 32 bit unsigned integers,\n     * depending on the mesh creation arguments and on whether the mesh can fit into 16 bit indices.\n     */\n    indices: ArrayBuffer;\n    /**\n     * A helper boolean indicating whether the indices are 32 bit.\n     */\n    uses32bitIndices: boolean;\n};\n\n/**\n * Describes desired type of vertex indices, either 16 bit uint, 32 bit uint, or, if undefined, any of the two options.\n */\nexport type IndicesType = '32bit' | '16bit' | undefined;\n\n/**\n * @internal\n * Creates a mesh of a quad that covers the entire tile (covering positions in range 0..EXTENT),\n * is optionally subdivided into finer quads, optionally includes a border\n * and optionally extends to the north and/or special pole vertices.\n * Also allocates and populates WebGL buffers for the mesh.\n * Forces 16 bit indices that are used throughout MapLibre.\n * @param context - The WebGL context wrapper.\n * @param options - Specify options for tile mesh creation such as granularity or border.\n * @returns The mesh vertices and indices, already allocated and uploaded into WebGL buffers.\n */\nexport function createTileMeshWithBuffers(context: Context, options: CreateTileMeshOptions): Mesh {\n    const tileMesh = createTileMesh(options, '16bit');\n    const vertices = PosArray.deserialize({\n        arrayBuffer: tileMesh.vertices,\n        length: tileMesh.vertices.byteLength / 2 / 2, // Two values per vertex, 16 bit\n    });\n    const indices = TriangleIndexArray.deserialize({\n        arrayBuffer: tileMesh.indices,\n        length: tileMesh.indices.byteLength / 2 / 3, // Three values per triangle, 16 bit\n    });\n    return new Mesh(\n        context.createVertexBuffer(vertices, posAttributes.members),\n        context.createIndexBuffer(indices),\n        SegmentVector.simpleSegment(0, 0, vertices.length, indices.length)\n    );\n}\n\n/**\n * Creates a mesh of a quad that covers the entire tile (covering positions in range 0..EXTENT),\n * is optionally subdivided into finer quads, optionally includes a border\n * and optionally extends to the north and/or special pole vertices.\n * Additionally the resulting mesh indices type can be specified using `forceIndicesSize`.\n * @example\n * ```\n * // Creating a mesh for a tile that can be used for raster layers, hillshade, etc.\n * const meshBuffers = createTileMesh({\n *     granularity: map.style.projection.subdivisionGranularity.tile.getGranularityForZoomLevel(tileID.z),\n *     generateBorders: true,\n *     extendToNorthPole: tileID.y === 0,\n *     extendToSouthPole: tileID.y === (1 << tileID.z) - 1,\n * }, '16bit');\n * ```\n * @see [Add a custom layer with tiles to a globe](https://maplibre.org/maplibre-gl-js/docs/examples/add-a-custom-layer-with-tiles-to-a-globe/)\n * @param options - Specify options for tile mesh creation such as granularity or border.\n * @param forceIndicesSize - Specifies what indices type to use. The values '32bit' and '16bit' force their respective indices size. If undefined, the mesh may use either size, and will pick 16 bit indices if possible. If '16bit' is specified and the mesh exceeds 65536 vertices, an exception is thrown.\n * @returns Typed arrays of the mesh vertices and indices.\n */\nexport function createTileMesh(options: CreateTileMeshOptions, forceIndicesSize?: IndicesType): TileMesh {\n    // We only want to generate the north/south border if the tile\n    // does NOT border the north/south edge of the mercator range.\n    const granularity = options.granularity !== undefined ? Math.max(options.granularity, 1) : 1;\n\n    const quadsPerAxisX = granularity + (options.generateBorders ? 2 : 0); // two extra quads for border\n    const quadsPerAxisY = granularity + ((options.extendToNorthPole || options.generateBorders) ? 1 : 0) + (options.extendToSouthPole || options.generateBorders ? 1 : 0);\n    const verticesPerAxisX = quadsPerAxisX + 1; // one more vertex than quads\n    const verticesPerAxisY = quadsPerAxisY + 1; // one more vertex than quads\n    const offsetX = options.generateBorders ? -1 : 0;\n    const offsetY = (options.generateBorders || options.extendToNorthPole) ? -1 : 0;\n    const endX = granularity + (options.generateBorders ? 1 : 0);\n    const endY = granularity + ((options.generateBorders || options.extendToSouthPole) ? 1 : 0);\n\n    const vertexCount = verticesPerAxisX * verticesPerAxisY;\n    const indexCount = quadsPerAxisX * quadsPerAxisY * 6;\n\n    const overflows16bitIndices = verticesPerAxisX * verticesPerAxisY > (1 << 16);\n\n    if (overflows16bitIndices && forceIndicesSize === '16bit') {\n        throw new Error('Granularity is too large and meshes would not fit inside 16 bit vertex indices.');\n    }\n\n    const use32bitIndices = overflows16bitIndices || forceIndicesSize === '32bit';\n\n    const vertices = new Int16Array(vertexCount * 2);\n\n    let vertexId = 0;\n\n    for (let y = offsetY; y <= endY; y++) {\n        for (let x = offsetX; x <= endX; x++) {\n            let vx = x / granularity * EXTENT;\n            if (x === -1) {\n                vx = -EXTENT_STENCIL_BORDER;\n            }\n            if (x === granularity + 1) {\n                vx = EXTENT + EXTENT_STENCIL_BORDER;\n            }\n            let vy = y / granularity * EXTENT;\n            if (y === -1) {\n                vy = options.extendToNorthPole ? NORTH_POLE_Y : (-EXTENT_STENCIL_BORDER);\n            }\n            if (y === granularity + 1) {\n                vy = options.extendToSouthPole ? SOUTH_POLE_Y : EXTENT + EXTENT_STENCIL_BORDER;\n            }\n\n            vertices[vertexId++] = vx;\n            vertices[vertexId++] = vy;\n        }\n    }\n\n    const indices = use32bitIndices ? new Uint32Array(indexCount) : new Uint16Array(indexCount);\n\n    let indexId = 0;\n\n    for (let y = 0; y < quadsPerAxisY; y++) {\n        for (let x = 0; x < quadsPerAxisX; x++) {\n            const v0 = x + y * verticesPerAxisX;\n            const v1 = (x + 1) + y * verticesPerAxisX;\n            const v2 = x + (y + 1) * verticesPerAxisX;\n            const v3 = (x + 1) + (y + 1) * verticesPerAxisX;\n\n            // v0----v1\n            //  |  / |\n            //  | /  |\n            // v2----v3\n            indices[indexId++] = v0;\n            indices[indexId++] = v2;\n            indices[indexId++] = v1;\n\n            indices[indexId++] = v1;\n            indices[indexId++] = v2;\n            indices[indexId++] = v3;\n        }\n    }\n\n    return {\n        vertices: vertices.buffer.slice(0),\n        indices: indices.buffer.slice(0),\n        uses32bitIndices: use32bitIndices,\n    };\n}\n", "import type {Context} from '../../webgl/context';\nimport type {CanonicalTileID} from '../../tile/tile_id';\nimport {type Mesh} from '../../render/mesh';\nimport {now} from '../../util/time_control';\nimport {easeCubicInOut, lerp} from '../../util/util';\nimport {mercatorYfromLat} from '../mercator_coordinate';\nimport {SubdivisionGranularityExpression, SubdivisionGranularitySetting} from '../../render/subdivision_granularity_settings';\nimport type {Projection, ProjectionGPUContext, TileMeshUsage} from './projection';\nimport {type PreparedShader, shaders} from '../../shaders/shaders';\nimport {ProjectionErrorMeasurement} from './globe_projection_error_measurement';\nimport {createTileMeshWithBuffers, type CreateTileMeshOptions} from '../../util/create_tile_mesh';\nimport {type EvaluationParameters} from '../../style/evaluation_parameters';\n\nexport const VerticalPerspectiveShaderDefine = '#define GLOBE';\nexport const VerticalPerspectiveShaderVariantKey = 'globe';\n\nexport const globeConstants = {\n    errorTransitionTimeSeconds: 0.5\n};\n\nconst granularitySettingsGlobe: SubdivisionGranularitySetting = new SubdivisionGranularitySetting({\n    fill: new SubdivisionGranularityExpression(128, 2),\n    line: new SubdivisionGranularityExpression(512, 0),\n    // Always keep at least some subdivision on raster tiles, etc,\n    // otherwise they will be visibly warped at high zooms (before mercator transition).\n    // This si not needed on fill, because fill geometry tends to already be\n    // highly tessellated and granular at high zooms.\n    tile: new SubdivisionGranularityExpression(128, 32),\n    // Stencil granularity must never be higher than fill granularity,\n    // otherwise we would get seams in the oceans at zoom levels where\n    // stencil has higher granularity than fill.\n    stencil: new SubdivisionGranularityExpression(128, 1),\n    circle: 3\n});\n\nexport class VerticalPerspectiveProjection implements Projection {\n    private _tileMeshCache: {[_: string]: Mesh} = {};\n\n    // GPU atan() error correction\n    private _errorMeasurement: ProjectionErrorMeasurement;\n    private _errorQueryLatitudeDegrees: number;\n    private _errorCorrectionUsable: number = 0.0;\n    private _errorMeasurementLastValue: number = 0.0;\n    private _errorCorrectionPreviousValue: number = 0.0;\n    private _errorMeasurementLastChangeTime: number = -1000.0;\n\n    get name(): 'vertical-perspective' {\n        return 'vertical-perspective';\n    }\n\n    get transitionState(): number {\n        return 1;\n    }\n\n    get useSubdivision(): boolean {\n        return true;\n    }\n\n    get shaderVariantName(): string {\n        return VerticalPerspectiveShaderVariantKey;\n    }\n\n    get shaderDefine(): string {\n        return VerticalPerspectiveShaderDefine;\n    }\n\n    get shaderPreludeCode(): PreparedShader {\n        return shaders.projectionGlobe;\n    }\n\n    get vertexShaderPreludeCode(): string {\n        return shaders.projectionMercator.vertexSource;\n    }\n\n    get subdivisionGranularity(): SubdivisionGranularitySetting {\n        return granularitySettingsGlobe;\n    }\n\n    get useGlobeControls(): boolean {\n        return true;\n    }\n\n    /**\n     * @internal\n     * Globe projection periodically measures the error of the GPU's\n     * projection from mercator to globe and computes how much to correct\n     * the globe's latitude alignment.\n     * This stores the correction that should be applied to the projection matrix.\n     */\n    get latitudeErrorCorrectionRadians(): number { return this._errorCorrectionUsable; }\n\n    public destroy() {\n        if (this._errorMeasurement) {\n            this._errorMeasurement.destroy();\n        }\n    }\n\n    public updateGPUdependent(renderContext: ProjectionGPUContext): void {\n        this._errorMeasurement ||= new ProjectionErrorMeasurement(renderContext);\n        const mercatorY = mercatorYfromLat(this._errorQueryLatitudeDegrees);\n        const expectedResult = 2.0 * Math.atan(Math.exp(Math.PI - (mercatorY * Math.PI * 2.0))) - Math.PI * 0.5;\n        const newValue = this._errorMeasurement.updateErrorLoop(mercatorY, expectedResult);\n\n        const currentTime = now();\n\n        if (newValue !== this._errorMeasurementLastValue) {\n            this._errorCorrectionPreviousValue = this._errorCorrectionUsable; // store the interpolated value\n            this._errorMeasurementLastValue = newValue;\n            this._errorMeasurementLastChangeTime = currentTime;\n        }\n\n        const sinceUpdateSeconds = (currentTime - this._errorMeasurementLastChangeTime) / 1000.0;\n        const mix = Math.min(Math.max(sinceUpdateSeconds / globeConstants.errorTransitionTimeSeconds, 0.0), 1.0);\n        const newCorrection = -this._errorMeasurementLastValue; // Note the negation\n        this._errorCorrectionUsable = lerp(this._errorCorrectionPreviousValue, newCorrection, easeCubicInOut(mix));\n    }\n\n    private _getMeshKey(options: CreateTileMeshOptions): string {\n        return `${options.granularity.toString(36)}_${options.generateBorders ? 'b' : ''}${options.extendToNorthPole ? 'n' : ''}${options.extendToSouthPole ? 's' : ''}`;\n    }\n\n    public getMeshFromTileID(context: Context, canonical: CanonicalTileID, hasBorder: boolean, allowPoles: boolean, usage: TileMeshUsage): Mesh {\n        // Stencil granularity must match fill granularity\n        const granularityConfig = usage === 'stencil' ? granularitySettingsGlobe.stencil : granularitySettingsGlobe.tile;\n        const granularity = granularityConfig.getGranularityForZoomLevel(canonical.z);\n        const north = (canonical.y === 0) && allowPoles;\n        const south = (canonical.y === (1 << canonical.z) - 1) && allowPoles;\n        return this._getMesh(context, {\n            granularity,\n            generateBorders: hasBorder,\n            extendToNorthPole: north,\n            extendToSouthPole: south,\n        });\n    }\n\n    private _getMesh(context: Context, options: CreateTileMeshOptions): Mesh {\n        const key = this._getMeshKey(options);\n\n        if (key in this._tileMeshCache) {\n            return this._tileMeshCache[key];\n        }\n\n        const mesh = createTileMeshWithBuffers(context, options);\n        this._tileMeshCache[key] = mesh;\n        return mesh;\n    }\n\n    recalculate(_params: EvaluationParameters): void {\n        // Do nothing.\n    }\n\n    hasTransition(): boolean {\n        const currentTime = now();\n        let dirty = false;\n        // Error correction transition\n        dirty ||= (currentTime - this._errorMeasurementLastChangeTime) / 1000.0 < (globeConstants.errorTransitionTimeSeconds + 0.2);\n        // Error correction query in flight\n        dirty ||= (this._errorMeasurement?.awaitingQuery);\n        return dirty;\n    }\n\n    setErrorQueryLatitudeDegrees(value: number) {\n        this._errorQueryLatitudeDegrees = value;\n    }\n}", "import {ProjectionDefinition, type ProjectionDefinitionSpecification, type ProjectionSpecification, type StylePropertySpecification, latest as styleSpec} from '@maplibre/maplibre-gl-style-spec';\nimport {DataConstantProperty, type PossiblyEvaluated, Properties, Transitionable, type Transitioning, type TransitionParameters} from '../../style/properties';\nimport {Evented} from '../../util/evented';\nimport {EvaluationParameters} from '../../style/evaluation_parameters';\nimport {MercatorProjection} from './mercator_projection';\nimport {VerticalPerspectiveProjection} from './vertical_perspective_projection';\nimport {type Projection, type ProjectionGPUContext, type TileMeshUsage} from './projection';\nimport {type PreparedShader} from '../../shaders/shaders';\nimport {type SubdivisionGranularitySetting} from '../../render/subdivision_granularity_settings';\nimport {type Context} from '../../webgl/context';\nimport {type CanonicalTileID} from '../../tile/tile_id';\nimport {type Mesh} from '../../render/mesh';\n\ntype ProjectionProps = {\n    type: DataConstantProperty<ProjectionDefinition>;\n};\n\ntype ProjectionPossiblyEvaluated = {\n    type: ProjectionDefinitionSpecification;\n};\n\nconst properties: Properties<ProjectionProps> = new Properties({\n    'type': new DataConstantProperty(styleSpec.projection.type as StylePropertySpecification)\n});\n\nexport class GlobeProjection extends Evented implements Projection {\n    properties: PossiblyEvaluated<ProjectionProps, ProjectionPossiblyEvaluated>;\n\n    _transitionable: Transitionable<ProjectionProps>;\n    _transitioning: Transitioning<ProjectionProps>;\n    _mercatorProjection: MercatorProjection;\n    _verticalPerspectiveProjection: VerticalPerspectiveProjection;\n\n    constructor(projection?: ProjectionSpecification) {\n        super();\n        this._transitionable = new Transitionable(properties, undefined);\n        this.setProjection(projection);\n        this._transitioning = this._transitionable.untransitioned();\n        this.recalculate(new EvaluationParameters(0));\n        this._mercatorProjection = new MercatorProjection();\n        this._verticalPerspectiveProjection = new VerticalPerspectiveProjection();\n    }\n\n    public get transitionState(): number {\n        const currentProjectionSpecValue = this.properties.get('type');\n        if (typeof currentProjectionSpecValue === 'string' && currentProjectionSpecValue === 'mercator') {\n            return 0;\n        }\n        if (typeof currentProjectionSpecValue === 'string' && currentProjectionSpecValue === 'vertical-perspective') {\n            return 1;\n        }\n        if (currentProjectionSpecValue instanceof ProjectionDefinition) {\n            if (currentProjectionSpecValue.from === 'vertical-perspective' && currentProjectionSpecValue.to === 'mercator') {\n                return 1 - currentProjectionSpecValue.transition;\n            }\n            if (currentProjectionSpecValue.from === 'mercator' && currentProjectionSpecValue.to === 'vertical-perspective') {\n                return currentProjectionSpecValue.transition;\n            }\n        };\n        return 1;\n    }\n\n    get useGlobeRendering(): boolean {\n        return this.transitionState > 0;\n    }\n\n    get latitudeErrorCorrectionRadians(): number { return this._verticalPerspectiveProjection.latitudeErrorCorrectionRadians; }\n\n    private get currentProjection(): Projection {\n        return this.useGlobeRendering ? this._verticalPerspectiveProjection : this._mercatorProjection;\n    }\n\n    get name(): ProjectionSpecification['type'] {\n        return 'globe';\n    }\n\n    get useSubdivision(): boolean {\n        return this.currentProjection.useSubdivision;\n    }\n\n    get shaderVariantName(): string {\n        return this.currentProjection.shaderVariantName;\n    }\n\n    get shaderDefine(): string {\n        return this.currentProjection.shaderDefine;\n    }\n\n    get shaderPreludeCode(): PreparedShader {\n        return this.currentProjection.shaderPreludeCode;\n    }\n\n    get vertexShaderPreludeCode(): string {\n        return this.currentProjection.vertexShaderPreludeCode;\n    }\n\n    get subdivisionGranularity(): SubdivisionGranularitySetting {\n        return this.currentProjection.subdivisionGranularity;\n    }\n\n    get useGlobeControls(): boolean {\n        return this.transitionState > 0;\n    }\n\n    public destroy(): void {\n        this._mercatorProjection.destroy();\n        this._verticalPerspectiveProjection.destroy();\n    }\n\n    public updateGPUdependent(context: ProjectionGPUContext): void {\n        this._mercatorProjection.updateGPUdependent(context);\n        this._verticalPerspectiveProjection.updateGPUdependent(context);\n    }\n\n    public getMeshFromTileID(context: Context, _tileID: CanonicalTileID, _hasBorder: boolean, _allowPoles: boolean, _usage: TileMeshUsage): Mesh {\n        return this.currentProjection.getMeshFromTileID(context, _tileID, _hasBorder, _allowPoles, _usage);\n    }\n\n    setProjection(projection?: ProjectionSpecification) {\n        this._transitionable.setValue('type', projection?.type || 'mercator');\n    }\n\n    updateTransitions(parameters: TransitionParameters) {\n        this._transitioning = this._transitionable.transitioned(parameters, this._transitioning);\n    }\n\n    hasTransition(): boolean {\n        return this._transitioning.hasTransition() || this.currentProjection.hasTransition();\n    }\n\n    recalculate(parameters: EvaluationParameters) {\n        this.properties = this._transitioning.possiblyEvaluate(parameters);\n    }\n\n    setErrorQueryLatitudeDegrees(value: number) {\n        this._verticalPerspectiveProjection.setErrorQueryLatitudeDegrees(value);\n        this._mercatorProjection.setErrorQueryLatitudeDegrees(value);\n    }\n}\n", "import {type ReadonlyVec4, vec3} from 'gl-matrix';\nimport {clamp, createVec3f64, lerp, MAX_VALID_LATITUDE, mod, remapSaturate, scaleZoom, wrap} from '../../util/util';\nimport {LngLat} from '../lng_lat';\nimport {EXTENT} from '../../data/extent';\nimport type Point from '@mapbox/point-geometry';\n\nexport function getGlobeCircumferencePixels(transform: {worldSize: number; center: {lat: number}}): number {\n    const radius = getGlobeRadiusPixels(transform.worldSize, transform.center.lat);\n    return 2.0 * Math.PI * radius;\n}\n\nexport function globeDistanceOfLocationsPixels(transform: {worldSize: number; center: {lat: number}}, a: LngLat, b: LngLat): number {\n    const vecA = angularCoordinatesToSurfaceVector(a);\n    const vecB = angularCoordinatesToSurfaceVector(b);\n    const dot = vec3.dot(vecA, vecB);\n    const radians = Math.acos(dot);\n    const circumference = getGlobeCircumferencePixels(transform);\n    return radians / (2.0 * Math.PI) * circumference;\n}\n\n/**\n * For given mercator coordinates in range 0..1, returns the angular coordinates on the sphere's surface, in radians.\n */\nexport function mercatorCoordinatesToAngularCoordinatesRadians(mercatorX: number, mercatorY: number): [number, number] {\n    const sphericalX = mod(mercatorX * Math.PI * 2.0 + Math.PI, Math.PI * 2);\n    const sphericalY = 2.0 * Math.atan(Math.exp(Math.PI - (mercatorY * Math.PI * 2.0))) - Math.PI * 0.5;\n    return [sphericalX, sphericalY];\n}\n\n/**\n * For a given longitude and latitude (note: in radians) returns the normalized vector from the planet center to the specified place on the surface.\n * @param lngRadians - Longitude in radians.\n * @param latRadians - Latitude in radians.\n */\nexport function angularCoordinatesRadiansToVector(lngRadians: number, latRadians: number): vec3 {\n    const len = Math.cos(latRadians);\n    const vec = new Float64Array(3) as any;\n    vec[0] = Math.sin(lngRadians) * len;\n    vec[1] = Math.sin(latRadians);\n    vec[2] = Math.cos(lngRadians) * len;\n    return vec;\n}\n\n/**\n * Projects a point within a tile to the surface of the unit sphere globe.\n * @param inTileX - X coordinate inside the tile in range [0 .. 8192].\n * @param inTileY - Y coordinate inside the tile in range [0 .. 8192].\n * @param tileIdX - Tile's X coordinate in range [0 .. 2^zoom - 1].\n * @param tileIdY - Tile's Y coordinate in range [0 .. 2^zoom - 1].\n * @param tileIdZ - Tile's zoom.\n * @returns A 3D vector - coordinates of the projected point on a unit sphere.\n */\nexport function projectTileCoordinatesToSphere(inTileX: number, inTileY: number, tileIdX: number, tileIdY: number, tileIdZ: number): vec3 {\n    // This code could be assembled from 3 functions, but this is a hot path for symbol placement,\n    // so for optimization purposes everything is inlined by hand.\n    //\n    // Non-inlined variant of this function would be this:\n    //     const mercator = tileCoordinatesToMercatorCoordinates(inTileX, inTileY, tileID);\n    //     const angular = mercatorCoordinatesToAngularCoordinatesRadians(mercator.x, mercator.y);\n    //     const sphere = angularCoordinatesRadiansToVector(angular[0], angular[1]);\n    //     return sphere;\n    const scale = 1.0 / (1 << tileIdZ);\n    const mercatorX = inTileX / EXTENT * scale + tileIdX * scale;\n    const mercatorY = inTileY / EXTENT * scale + tileIdY * scale;\n    const sphericalX = mod(mercatorX * Math.PI * 2.0 + Math.PI, Math.PI * 2);\n    const sphericalY = 2.0 * Math.atan(Math.exp(Math.PI - (mercatorY * Math.PI * 2.0))) - Math.PI * 0.5;\n    const len = Math.cos(sphericalY);\n    const vec = new Float64Array(3) as any;\n    vec[0] = Math.sin(sphericalX) * len;\n    vec[1] = Math.sin(sphericalY);\n    vec[2] = Math.cos(sphericalX) * len;\n    return vec;\n}\n\n/**\n * For a given longitude and latitude (note: in degrees) returns the normalized vector from the planet center to the specified place on the surface.\n */\nexport function angularCoordinatesToSurfaceVector(lngLat: LngLat): vec3 {\n    return angularCoordinatesRadiansToVector(lngLat.lng * Math.PI / 180, lngLat.lat * Math.PI / 180);\n}\n\nexport function getGlobeRadiusPixels(worldSize: number, latitudeDegrees: number) {\n    // We want zoom levels to be consistent between globe and flat views.\n    // This means that the pixel size of features at the map center point\n    // should be the same for both globe and flat view.\n    // For this reason we scale the globe up when map center is nearer to the poles.\n    return worldSize / (2.0 * Math.PI) / Math.cos(latitudeDegrees * Math.PI / 180);\n}\n\n/**\n * Given a 3D point on the surface of a unit sphere, returns its angular coordinates in degrees.\n * The input vector must be normalized.\n */\nexport function sphereSurfacePointToCoordinates(surface: vec3): LngLat {\n    const latRadians = Math.asin(surface[1]);\n    const latDegrees = latRadians / Math.PI * 180.0;\n    const lengthXZ = Math.sqrt(surface[0] * surface[0] + surface[2] * surface[2]);\n    if (lengthXZ > 1e-6) {\n        const projX = surface[0] / lengthXZ;\n        const projZ = surface[2] / lengthXZ;\n        const acosZ = Math.acos(projZ);\n        const lngRadians = (projX > 0) ? acosZ : -acosZ;\n        const lngDegrees = lngRadians / Math.PI * 180.0;\n        return new LngLat(wrap(lngDegrees, -180, 180), latDegrees);\n    } else {\n        return new LngLat(0.0, latDegrees);\n    }\n}\n\n/**\n * Given a normalized horizon plane in Ax+By+Cz+D=0 format, compute the center and radius of\n * the circle in that plain that contains the entire visible portion of the unit sphere from horizon\n * to horizon.\n * @param horizonPlane - The plane that passes through visible horizon in Ax + By + Cz + D = 0 format where mag(A,B,C)=1\n * @returns the center point and radius of the disc that passes through the entire visible horizon\n */\nexport function horizonPlaneToCenterAndRadius(horizonPlane: ReadonlyVec4): { center: vec3; radius: number } {\n    const center = createVec3f64();\n    center[0] = horizonPlane[0] * -horizonPlane[3];\n    center[1] = horizonPlane[1] * -horizonPlane[3];\n    center[2] = horizonPlane[2] * -horizonPlane[3];\n    /*\n                     .*******\n                 ****|\\\n               **    | \\\n             **      |  1\n            * radius |   \\\n           *         |    \\\n           *  center +--D--+(0,0,0)\n     */\n    const radius = Math.sqrt(1 - horizonPlane[3] * horizonPlane[3]);\n    return {center, radius};\n}\n\n/**\n * Computes the closest point on a sphere to `point`.\n * @param center - Center of the sphere\n * @param radius - Radius of the sphere\n * @param point - Point inside or outside the sphere\n * @returns A 3d vector of the point on the sphere closest to `point`\n */\nexport function clampToSphere(center: vec3, radius: number, point: vec3) {\n    const relativeToCenter = createVec3f64();\n    vec3.sub(relativeToCenter, point, center);\n    const clamped = createVec3f64();\n    vec3.scaleAndAdd(clamped, center, relativeToCenter, radius / vec3.len(relativeToCenter));\n    return clamped;\n}\n\nfunction planetScaleAtLatitude(latitudeDegrees: number): number {\n    return Math.cos(latitudeDegrees * Math.PI / 180);\n}\n\n/**\n * Computes how much to modify zoom to keep the globe size constant when changing latitude.\n * @param transform - An instance of any transform. Does not have any relation on the computed values.\n * @param oldLat - Latitude before change, in degrees.\n * @param newLat - Latitude after change, in degrees.\n * @returns A value to add to zoom level used for old latitude to keep same planet radius at new latitude.\n */\nexport function getZoomAdjustment(oldLat: number, newLat: number): number {\n    const oldCircumference = planetScaleAtLatitude(oldLat);\n    const newCircumference = planetScaleAtLatitude(newLat);\n    return scaleZoom(newCircumference / oldCircumference);\n}\n\nexport function getDegreesPerPixel(worldSize: number, lat: number): number {\n    return 360.0 / getGlobeCircumferencePixels({worldSize, center: {lat}});\n}\n\n/**\n * Returns transform's new center rotation after applying panning.\n * @param panDelta - Panning delta, in same units as what is supplied to {@link HandlerManager}.\n * @param tr - Current transform. This object is not modified by the function.\n * @returns New center location to set to the map's transform to apply the specified panning.\n */\nexport function computeGlobePanCenter(panDelta: Point, tr: {\n    readonly bearingInRadians: number;\n    readonly worldSize: number;\n    readonly center: LngLat;\n    readonly zoom: number;\n}): LngLat {\n    // Apply map bearing to the panning vector\n    const rotatedPanDelta = panDelta.rotate(tr.bearingInRadians);\n    // Compute what the current zoom would be if the transform center would be moved to latitude 0.\n    const normalizedGlobeZoom = tr.zoom + getZoomAdjustment(tr.center.lat, 0);\n    // Note: we divide longitude speed by planet width at the given latitude. But we diminish this effect when the globe is zoomed out a lot.\n    const lngSpeed = lerp(\n        1.0 / planetScaleAtLatitude(tr.center.lat), // speed adjusted by latitude\n        1.0 / planetScaleAtLatitude(Math.min(Math.abs(tr.center.lat), 60)), // also adjusted, but latitude is clamped to 60\u00B0 to avoid too large speeds near poles\n        remapSaturate(normalizedGlobeZoom, 7, 3, 0, 1.0) // Values chosen so that globe interactions feel good. Not scientific by any means.\n    );\n    const panningDegreesPerPixel = getDegreesPerPixel(tr.worldSize, tr.center.lat);\n    return new LngLat(\n        tr.center.lng - rotatedPanDelta.x * panningDegreesPerPixel * lngSpeed,\n        clamp(tr.center.lat + rotatedPanDelta.y * panningDegreesPerPixel, -MAX_VALID_LATITUDE, MAX_VALID_LATITUDE)\n    );\n}\n\n/**\n * Integration of `1 / cos(x)`.\n */\nfunction integrateSecX(x: number): number {\n    const xHalf = 0.5 * x;\n    const sin = Math.sin(xHalf);\n    const cos = Math.cos(xHalf);\n    return Math.log(sin + cos) - Math.log(cos - sin);\n}\n\n/**\n * Interpolates globe center between two locations while preserving apparent rotation speed during interpolation.\n * @param start - The starting location of the interpolation.\n * @param deltaLng - Longitude delta to the end of the interpolation.\n * @param deltaLat - Latitude delta to the end of the interpolation.\n * @param t - The interpolation point in [0..1], where 0 is starting location, 1 is end location and other values are in between.\n * @returns The interpolated location.\n */\nexport function interpolateLngLatForGlobe(start: LngLat, deltaLng: number, deltaLat: number, t: number): LngLat {\n    // Rate of change of longitude when moving the globe should be roughly 1/cos(latitude)\n    // We want to use this rate of change, even for interpolation during easing.\n    // Thus we know the derivative of our interpolation function: 1/cos(x)\n    // To get our interpolation function, we need to integrate that.\n\n    const interpolatedLat = start.lat + deltaLat * t;\n\n    if (Math.abs(deltaLat) > 1) {\n        const endLat = start.lat + deltaLat;\n        const onDifferentHemispheres = Math.sign(endLat) !== Math.sign(start.lat);\n        // Where do we sample the integrated speed curve?\n        const samplePointStart = (onDifferentHemispheres ? -Math.abs(start.lat) : Math.abs(start.lat)) * Math.PI / 180;\n        const samplePointEnd = Math.abs(start.lat + deltaLat) * Math.PI / 180;\n        // Read the integrated speed curve at those points, and at the interpolation value \"t\".\n        const valueT = integrateSecX(samplePointStart + t * (samplePointEnd - samplePointStart));\n        const valueStart = integrateSecX(samplePointStart);\n        const valueEnd = integrateSecX(samplePointEnd);\n        // Compute new interpolation factor based on the speed curve\n        const newT = (valueT - valueStart) / (valueEnd - valueStart);\n        // Interpolate using that factor\n        const interpolatedLng = start.lng + deltaLng * newT;\n        return new LngLat(\n            interpolatedLng,\n            interpolatedLat\n        );\n    } else {\n        // Fall back to simple interpolation when latitude doesn't change much.\n        const interpolatedLng = start.lng + deltaLng * t;\n        return new LngLat(\n            interpolatedLng,\n            interpolatedLat\n        );\n    }\n}\n", "import {type CoveringTilesOptionsInternal} from '../../geo/projection/covering_tiles';\nimport {type IBoundingVolume} from './bounding_volume';\n\ntype BoundingVolumeFactory<T extends IBoundingVolume> = (tileID: {x: number; y: number; z: number}, wrap: number, elevation: number, options: CoveringTilesOptionsInternal) => T;\n\nexport class BoundingVolumeCache<T extends IBoundingVolume> {\n    private _cachePrevious: Map<string, T> = new Map();\n    private _cache: Map<string, T> = new Map();\n    private _hadAnyChanges = false;\n    private _boundingVolumeFactory: BoundingVolumeFactory<T>;\n\n    constructor(boundingVolumeFactory: BoundingVolumeFactory<T>) {\n        this._boundingVolumeFactory = boundingVolumeFactory;\n    }\n\n    /**\n     * Prepares bounding volume cache for next frame. Call at the beginning of a frame.\n     * Bounding volume of any tile accesses in the last frame is kept in the cache, other (unaccessed) bounding volumes are deleted.\n     */\n    swapBuffers() {\n        if (!this._hadAnyChanges) {\n            // If no new bounding volumes were added this frame, no need to conserve memory, do not clear caches.\n            return;\n        }\n        const oldCache = this._cachePrevious;\n        this._cachePrevious = this._cache;\n        this._cache = oldCache;\n        this._cache.clear();\n        this._hadAnyChanges = false;\n    }\n\n    /**\n     * Returns the bounding volume of the specified tile, fetching it from cache or creating it using the factory function if needed.\n     * @param tileID - Tile x, y and z for zoom.\n     */\n    getTileBoundingVolume(tileID: {x: number; y: number; z: number}, wrap: number, elevation: number, options: CoveringTilesOptionsInternal): T {\n        const key = `${tileID.z}_${tileID.x}_${tileID.y}_${options?.terrain ? 't' : ''}`;\n        const cached = this._cache.get(key);\n        if (cached) {\n            return cached;\n        }\n        const cachedPrevious = this._cachePrevious.get(key);\n        if (cachedPrevious) {\n            this._cache.set(key, cachedPrevious);\n            return cachedPrevious;\n        }\n        const boundingVolume = this._boundingVolumeFactory(tileID, wrap, elevation, options);\n        this._cache.set(key, boundingVolume);\n        this._hadAnyChanges = true;\n        return boundingVolume;\n    }\n}\n", "import {quat, vec3, type vec4} from 'gl-matrix';\nimport {type Frustum} from './frustum';\nimport {IntersectionResult, type IBoundingVolume} from './bounding_volume';\n\n/**\n * A general convex bounding volume, defined by a set of points.\n */\nexport class ConvexVolume implements IBoundingVolume {\n    // Precomputed AABB for rejecting frustum intersection.\n    min: vec3;\n    max: vec3;\n\n    points: vec3[];\n    planes: vec4[];\n\n    /**\n     * Creates an instance of a general convex bounding volume.\n     * Note that the provided points array is used *as is*, its contents are not copied!\n     *\n     * Additionally, an AABB must be provided for rejecting frustum intersections.\n     * This AABB does not need to bound this convex volume (it may be smaller),\n     * but it *must* accurately bound the actual shape this volume is approximating.\n     * @param points - Points forming the convex shape. Note that this array reference is used *as is*, its contents are not copied!\n     * @param min - The bounding AABB's min point.\n     * @param max - The bounding AABB's min point.\n     */\n    constructor(points: vec3[], planes: vec4[], min: vec3, max: vec3) {\n        this.min = min;\n        this.max = max;\n        this.points = points;\n        this.planes = planes;\n    }\n\n    /**\n     * Creates a convex BV equivalent to the specified AABB.\n     * @param min - The AABB's min point.\n     * @param max - The AABB's max point.\n     */\n    public static fromAabb(min: vec3, max: vec3): ConvexVolume {\n        const points = [];\n        for (let i = 0; i < 8; i++) {\n            points.push([\n                ((i >> 0) & 1) === 1 ? max[0] : min[0],\n                ((i >> 1) & 1) === 1 ? max[1] : min[1],\n                ((i >> 2) & 1) === 1 ? max[2] : min[2]\n            ]);\n        }\n        return new ConvexVolume(points, [\n            [-1, 0, 0, max[0]],\n            [1, 0, 0, -min[0]],\n            [0, -1, 0, max[1]],\n            [0, 1, 0, -min[1]],\n            [0, 0, -1, max[2]],\n            [0, 0, 1, -min[2]]\n        ], min, max);\n    }\n\n    /**\n     * Creates a convex bounding volume that is actually an oriented bounding box created from the specified center, half-size and rotation angles.\n     * @param center - Center of the OBB.\n     * @param halfSize - The half-size of the OBB in each axis. The box will extend by this value in each direction for the given axis.\n     * @param angles - The rotation of the box. Euler angles, in degrees.\n     */\n    public static fromCenterSizeAngles(center: vec3, halfSize: vec3, angles: vec3): ConvexVolume {\n        const q = quat.fromEuler([] as any, angles[0], angles[1], angles[2]);\n        const axisX = vec3.transformQuat([] as any, [halfSize[0], 0, 0], q);\n        const axisY = vec3.transformQuat([] as any, [0, halfSize[1], 0], q);\n        const axisZ = vec3.transformQuat([] as any, [0, 0, halfSize[2]], q);\n        // Find the AABB min/max\n        const min = [...center] as vec3;\n        const max = [...center] as vec3;\n        for (let i = 0; i < 8; i++) {\n            for (let axis = 0; axis < 3; axis++) {\n                const point = center[axis]\n                    + axisX[axis] * ((((i >> 0) & 1) === 1) ? 1 : -1)\n                    + axisY[axis] * ((((i >> 1) & 1) === 1) ? 1 : -1)\n                    + axisZ[axis] * ((((i >> 2) & 1) === 1) ? 1 : -1);\n                min[axis] = Math.min(min[axis], point);\n                max[axis] = Math.max(max[axis], point);\n            }\n        }\n        const points = [];\n        for (let i = 0; i < 8; i++) {\n            const p = [...center] as vec3;\n            vec3.add(p, p, vec3.scale([] as any, axisX, ((i >> 0) & 1) === 1 ? 1 : -1));\n            vec3.add(p, p, vec3.scale([] as any, axisY, ((i >> 1) & 1) === 1 ? 1 : -1));\n            vec3.add(p, p, vec3.scale([] as any, axisZ, ((i >> 2) & 1) === 1 ? 1 : -1));\n            points.push(p);\n        }\n        return new ConvexVolume(points, [\n            [...axisX, -vec3.dot(axisX, points[0])] as vec4,\n            [...axisY, -vec3.dot(axisY, points[0])] as vec4,\n            [...axisZ, -vec3.dot(axisZ, points[0])] as vec4,\n            [-axisX[0], -axisX[1], -axisX[2], -vec3.dot(axisX, points[7])] as vec4,\n            [-axisY[0], -axisY[1], -axisY[2], -vec3.dot(axisY, points[7])] as vec4,\n            [-axisZ[0], -axisZ[1], -axisZ[2], -vec3.dot(axisZ, points[7])] as vec4,\n        ], min, max);\n    }\n\n    /**\n     * Performs an approximate frustum-obb intersection test.\n     */\n    intersectsFrustum(frustum: Frustum): IntersectionResult {\n        // Performance-critical\n        let fullyInside = true;\n\n        const boxPointCount = this.points.length;\n        const boxPlaneCount = this.planes.length;\n        const frustumPlaneCount = frustum.planes.length;\n        const frustumPointCount = frustum.points.length;\n\n        // Test whether this volume's points are inside the frustum\n        for (let i = 0; i < frustumPlaneCount; i++) {\n            const plane = frustum.planes[i];\n            let boxPointsPassed = 0;\n            for(let j = 0; j < boxPointCount; j++) {\n                const point = this.points[j];\n                // Get point-plane distance sign\n                if (plane[0] * point[0] + plane[1] * point[1] + plane[2] * point[2] + plane[3] >= 0) {\n                    boxPointsPassed++;\n                }\n            }\n\n            if (boxPointsPassed === 0) {\n                return IntersectionResult.None;\n            }\n            if (boxPointsPassed < boxPointCount) {\n                fullyInside = false;\n            }\n        }\n\n        if (fullyInside) {\n            return IntersectionResult.Full;\n        }\n\n        // Test whether the frustum's points are inside this volume.\n        for (let i = 0; i < boxPlaneCount; i++) {\n            const plane = this.planes[i];\n            let frustumPointsPassed = 0;\n            for (let j = 0; j < frustumPointCount; j++) {\n                const point = frustum.points[j];\n                if (plane[0] * point[0] + plane[1] * point[1] + plane[2] * point[2] + plane[3] >= 0) {\n                    frustumPointsPassed++;\n                }\n            }\n            if (frustumPointsPassed === 0) {\n                return IntersectionResult.None;\n            }\n        }\n\n        return IntersectionResult.Partial;\n    }\n\n    /**\n     * Performs an intersection test with a halfspace.\n     */\n    intersectsPlane(plane: vec4): IntersectionResult {\n        const pointCount = this.points.length;\n        let positivePoints = 0;\n        for (let i = 0; i < pointCount; i++) {\n            const point = this.points[i];\n            if (plane[0] * point[0] + plane[1] * point[1] + plane[2] * point[2] + plane[3] >= 0) {\n                positivePoints++;\n            }\n        }\n\n        if (positivePoints === pointCount) {\n            return IntersectionResult.Full;\n        }\n        if (positivePoints === 0) {\n            return IntersectionResult.None;\n        }\n        return IntersectionResult.Partial;\n    }\n}\n", "import {EXTENT} from '../../data/extent';\nimport {projectTileCoordinatesToSphere} from './globe_utils';\nimport {BoundingVolumeCache} from '../../util/primitives/bounding_volume_cache';\nimport {coveringZoomLevel, type CoveringTilesOptionsInternal} from './covering_tiles';\nimport {vec3, type vec4} from 'gl-matrix';\nimport type {IReadonlyTransform} from '../transform_interface';\nimport type {MercatorCoordinate} from '../mercator_coordinate';\nimport type {CoveringTilesDetailsProvider} from './covering_tiles_details_provider';\nimport {OverscaledTileID} from '../../tile/tile_id';\nimport {earthRadius} from '../lng_lat';\nimport {ConvexVolume} from '../../util/primitives/convex_volume';\nimport type {IBoundingVolume} from '../../util/primitives/bounding_volume';\nimport {threePlaneIntersection} from '../../util/util';\n\n/**\n * Computes distance of a point to a tile in an arbitrary axis.\n * World is assumed to have size 1, distance returned is to the nearer tile edge.\n * @param point - Point position.\n * @param tile - Tile position.\n * @param tileSize - Tile size.\n */\nfunction distanceToTileSimple(point: number, tile: number, tileSize: number): number {\n    const delta = point - tile;\n    return (delta < 0) ? -delta : Math.max(0, delta - tileSize);\n}\n\nfunction distanceToTileWrapX(pointX: number, pointY: number, tileCornerX: number, tileCornerY: number, tileSize: number): number {\n    const tileCornerToPointX = pointX - tileCornerX;\n\n    let distanceX: number;\n    if (tileCornerToPointX < 0) {\n        // Point is left of tile\n        distanceX = Math.min(-tileCornerToPointX, 1.0 + tileCornerToPointX - tileSize);\n    } else if (tileCornerToPointX > tileSize) {\n        // Point is right of tile\n        distanceX = Math.min(Math.max(tileCornerToPointX - tileSize, 0), 1.0 - tileCornerToPointX);\n    } else {\n        // Point is inside tile in the X axis.\n        distanceX = 0;\n    }\n\n    return Math.max(distanceX, distanceToTileSimple(pointY, tileCornerY, tileSize));\n}\n\nexport class GlobeCoveringTilesDetailsProvider implements CoveringTilesDetailsProvider {\n    private _boundingVolumeCache: BoundingVolumeCache<ConvexVolume> = new BoundingVolumeCache(this._computeTileBoundingVolume);\n\n    /**\n     * Prepares the internal bounding volume cache for the next frame.\n     */\n    prepareNextFrame() {\n        this._boundingVolumeCache.swapBuffers();\n    }\n\n    /**\n     * Returns the distance of a point to a square tile. If the point is inside the tile, returns 0.\n     * Assumes the world to be of size 1.\n     * Handles distances on a sphere correctly: X is wrapped when crossing the antimeridian,\n     * when crossing the poles Y is mirrored and X is shifted by half world size.\n     */\n    distanceToTile2d(pointX: number, pointY: number, tileID: {x: number; y: number; z: number}, _bv: IBoundingVolume): number {\n        const scale = 1 << tileID.z;\n        const tileMercatorSize = 1.0 / scale;\n        const tileCornerX = tileID.x / scale; // In range 0..1\n        const tileCornerY = tileID.y / scale; // In range 0..1\n\n        const worldSize = 1.0;\n        const halfWorld = 0.5 * worldSize;\n        let smallestDistance = 2.0 * worldSize;\n        // Original tile\n        smallestDistance = Math.min(smallestDistance, distanceToTileWrapX(pointX, pointY, tileCornerX, tileCornerY, tileMercatorSize));\n        // Up\n        smallestDistance = Math.min(smallestDistance, distanceToTileWrapX(pointX, pointY, tileCornerX + halfWorld, -tileCornerY - tileMercatorSize, tileMercatorSize));\n        // Down\n        smallestDistance = Math.min(smallestDistance, distanceToTileWrapX(pointX, pointY, tileCornerX + halfWorld, worldSize + worldSize - tileCornerY - tileMercatorSize, tileMercatorSize));\n\n        return smallestDistance;\n    }\n\n    /**\n     * Returns the wrap value for a given tile, computed so that tiles will remain loaded when crossing the antimeridian.\n     */\n    getWrap(centerCoord: MercatorCoordinate, tileID: {x: number; y: number; z: number}, _parentWrap: number): number {\n        const scale = 1 << tileID.z;\n        const tileMercatorSize = 1.0 / scale;\n        const tileX = tileID.x / scale; // In range 0..1\n        const distanceCurrent = distanceToTileSimple(centerCoord.x, tileX, tileMercatorSize);\n        const distanceLeft = distanceToTileSimple(centerCoord.x, tileX - 1.0, tileMercatorSize);\n        const distanceRight = distanceToTileSimple(centerCoord.x, tileX + 1.0, tileMercatorSize);\n        const distanceSmallest = Math.min(distanceCurrent, distanceLeft, distanceRight);\n        if (distanceSmallest === distanceRight) {\n            return 1;\n        }\n        if (distanceSmallest === distanceLeft) {\n            return -1;\n        }\n        return 0;\n    }\n    \n    allowVariableZoom(transform: IReadonlyTransform, options: CoveringTilesOptionsInternal): boolean {\n        return coveringZoomLevel(transform, options) > 4;\n    }\n\n    allowWorldCopies(): boolean {\n        return false;\n    }\n\n    getTileBoundingVolume(tileID: { x: number; y: number; z: number }, wrap: number, elevation: number, options: CoveringTilesOptionsInternal) {\n        return this._boundingVolumeCache.getTileBoundingVolume(tileID, wrap, elevation, options);\n    }\n\n    private _computeTileBoundingVolume(tileID: {x: number; y: number; z: number}, wrap: number, elevation: number, options: CoveringTilesOptionsInternal): ConvexVolume {\n        let minElevation = 0;\n        let maxElevation = 0;\n        if (options?.terrain) {\n            const overscaledTileID = new OverscaledTileID(tileID.z, wrap, tileID.z, tileID.x, tileID.y);\n            const minMax = options.terrain.getMinMaxElevation(overscaledTileID);\n            minElevation = minMax.minElevation ?? Math.min(0, elevation);\n            maxElevation = minMax.maxElevation ?? Math.max(0, elevation);\n        }\n        // Convert elevation to distances from center of a unit sphere planet (so that 1 is surface)\n        minElevation /= earthRadius;\n        maxElevation /= earthRadius;\n        minElevation += 1;\n        maxElevation += 1;\n\n        if (tileID.z <= 0) {\n            // Tile covers the entire sphere.\n            return ConvexVolume.fromAabb( // We return an AABB in this case.\n                [-maxElevation, -maxElevation, -maxElevation],\n                [maxElevation, maxElevation, maxElevation]\n            );\n        } else if (tileID.z === 1) {\n            // Tile covers a quarter of the sphere.\n            // X is 1 at lng=E90\u00B0\n            // Y is 1 at **north** pole\n            // Z is 1 at null island\n            return ConvexVolume.fromAabb( // We also just use AABBs for this zoom level.\n                [tileID.x === 0 ? -maxElevation : 0, tileID.y === 0 ? 0 : -maxElevation, -maxElevation],\n                [tileID.x === 0 ? 0 : maxElevation, tileID.y === 0 ? maxElevation : 0, maxElevation]\n            );\n        } else {\n            const corners = [\n                projectTileCoordinatesToSphere(0, 0, tileID.x, tileID.y, tileID.z),\n                projectTileCoordinatesToSphere(EXTENT, 0, tileID.x, tileID.y, tileID.z),\n                projectTileCoordinatesToSphere(EXTENT, EXTENT, tileID.x, tileID.y, tileID.z),\n                projectTileCoordinatesToSphere(0, EXTENT, tileID.x, tileID.y, tileID.z),\n            ];\n\n            const extremesPoints = [];\n\n            for (const c of corners) {\n                extremesPoints.push(vec3.scale([] as any, c, maxElevation));\n            }\n\n            if (maxElevation !== minElevation) {\n                // Only add additional points if terrain is enabled and is not flat.\n                for (const c of corners) {\n                    extremesPoints.push(vec3.scale([] as any, c, minElevation));\n                }\n            }\n\n            // Special handling of poles - we need to extend the tile AABB\n            // to include the pole for tiles that border mercator north/south edge.\n            if (tileID.y === 0) {\n                extremesPoints.push([0, 1, 0]); // North pole\n            }\n            if (tileID.y === (1 << tileID.z) - 1) {\n                extremesPoints.push([0, -1, 0]); // South pole\n            }\n\n            // Compute a best-fit AABB for the frustum rejection test\n            const aabbMin: vec3 = [1, 1, 1];\n            const aabbMax: vec3 = [-1, -1, -1];\n\n            for (const c of extremesPoints) {\n                for (let i = 0; i < 3; i++) {\n                    aabbMin[i] = Math.min(aabbMin[i], c[i]);\n                    aabbMax[i] = Math.max(aabbMax[i], c[i]);\n                }\n            }\n\n            // Now we compute the actual bounding volume.\n            // The up/down plane will be normal to the tile's center.\n            // The north/south plane will be used for the tile's north and south edge and will be orthogonal to the up/down plane.\n            // The left and right planes will be determined by the tile's east/west edges and will differ slightly - we are not creating a box!\n            // We will find the min and max extents for the up/down and north/south planes using the set of points\n            // where the extremes are likely to lie.\n\n            // Vector \"center\" (from planet center to tile center) will be our up/down axis.\n            const center = projectTileCoordinatesToSphere(EXTENT / 2, EXTENT / 2, tileID.x, tileID.y, tileID.z);\n            // Vector to the east of \"center\".\n            const centerEast = vec3.cross([] as any, [0, 1, 0], center);\n            vec3.normalize(centerEast, centerEast);\n            // Vector to the north of \"center\" will be our north/south axis.\n            const north = vec3.cross([] as any, center, centerEast);\n            vec3.normalize(north, north);\n\n            // Axes for the east and west edge of our bounding volume.\n            // These axes are NOT opposites of each other, they differ!\n            // They are also not orthogonal to the up/down and north/south axes.\n            const axisEast = vec3.cross([] as any, corners[2], corners[1]);\n            vec3.normalize(axisEast, axisEast);\n            const axisWest = vec3.cross([] as any, corners[0], corners[3]);\n            vec3.normalize(axisWest, axisWest);\n\n            // Now we will expand the extremes point set for bounding volume creation.\n            // We will also include the tile center point, since it will always be an extreme for the \"center\" axis.\n            extremesPoints.push(vec3.scale([] as any, center, maxElevation));\n            // No need to include a minElevation-scaled center, since we already have minElevation corners in the set and these will always lie lower than the center.\n\n            // The extremes might also lie on the midpoint of the north or south edge.\n            // For tiles in the north hemisphere, only the south edge can contain an extreme,\n            // since when we imagine the tile's actual shape projected onto the plane normal to \"center\" vector,\n            // the tile's north edge will curve towards the tile center, thus its extremes are accounted for by the\n            // corners, however the south edge will curve away from the center point, extending beyond the tile's edges,\n            // thus it must be included.\n            // The poles are an exception - they must always be included in the extremes, if the tile touches the north/south mercator range edge.\n            //\n            // A tile's exaggerated shape on the northern hemisphere, projected onto the normal plane of \"center\".\n            // The \"c\" is the tile's center point. The \"m\" is the edge mid point we are looking for.\n            //\n            //      /--       --\\\n            //     /   -------   \\\n            //    /               \\\n            //   /        c        \\\n            //  /                   \\\n            // /--                 --\\\n            //    -----       -----\n            //         ---m---\n            \n            if (tileID.y >= (1 << tileID.z) / 2) {\n                // South hemisphere - include the tile's north edge midpoint\n                extremesPoints.push(vec3.scale([] as any, projectTileCoordinatesToSphere(EXTENT / 2, 0, tileID.x, tileID.y, tileID.z), maxElevation));\n                // No need to include minElevation variant of this point, for the same reason why we don't include minElevation center.\n            }\n            if (tileID.y < (1 << tileID.z) / 2) {\n                // North hemisphere - include the tile's south edge midpoint\n                extremesPoints.push(vec3.scale([] as any, projectTileCoordinatesToSphere(EXTENT / 2, EXTENT, tileID.x, tileID.y, tileID.z), maxElevation));\n                // No need to include minElevation variant of this point, for the same reason why we don't include minElevation center.\n            }\n\n            // Find the min and max extends and the midpoints along each axis,\n            // using the set of extreme points.\n            const upDownMinMax = findAxisMinMax(center, extremesPoints);\n            const northSouthMinMax = findAxisMinMax(north, extremesPoints);\n\n            const planeUp = [-center[0], -center[1], -center[2], upDownMinMax.max] as vec4;\n            const planeDown = [center[0], center[1], center[2], -upDownMinMax.min] as vec4;\n            const planeNorth = [-north[0], -north[1], -north[2], northSouthMinMax.max] as vec4;\n            const planeSouth = [north[0], north[1], north[2], -northSouthMinMax.min] as vec4;\n            const planeEast = [...axisEast, 0] as vec4;\n            const planeWest = [...axisWest, 0] as vec4;\n\n            const points: vec3[] = [];\n\n            // North points\n            if (tileID.y === 0) {\n                // If the tile borders a pole, then \n                points.push(\n                    threePlaneIntersection(planeWest, planeEast, planeUp),\n                    threePlaneIntersection(planeWest, planeEast, planeDown),\n                );\n            } else {\n                points.push(\n                    threePlaneIntersection(planeNorth, planeEast, planeUp),\n                    threePlaneIntersection(planeNorth, planeEast, planeDown),\n                    threePlaneIntersection(planeNorth, planeWest, planeUp),\n                    threePlaneIntersection(planeNorth, planeWest, planeDown)\n                );\n            }\n\n            // South points\n            if (tileID.y === (1 << tileID.z) - 1) {\n                points.push(\n                    threePlaneIntersection(planeWest, planeEast, planeUp),\n                    threePlaneIntersection(planeWest, planeEast, planeDown),\n                );\n            } else {\n                points.push(\n                    threePlaneIntersection(planeSouth, planeEast, planeUp),\n                    threePlaneIntersection(planeSouth, planeEast, planeDown),\n                    threePlaneIntersection(planeSouth, planeWest, planeUp),\n                    threePlaneIntersection(planeSouth, planeWest, planeDown)\n                );\n            }\n\n            return new ConvexVolume(points, [\n                planeUp,\n                planeDown,\n                planeNorth,\n                planeSouth,\n                planeEast,\n                planeWest\n            ], aabbMin, aabbMax);\n        }\n    }\n}\n\nfunction findAxisMinMax(axis: vec3, points: vec3[]) {\n    let min = +Infinity;\n    let max = -Infinity;\n    for (const c of points) {\n        const dot = vec3.dot(axis, c);\n        min = Math.min(min, dot);\n        max = Math.max(max, dot);\n    }\n    return {\n        min,\n        max\n    };\n}", "import {type mat2, mat4, vec3, vec4} from 'gl-matrix';\nimport {TransformHelper} from '../transform_helper';\nimport {LngLat, type LngLatLike, earthRadius} from '../lng_lat';\nimport {angleToRotateBetweenVectors2D, clamp, createIdentityMat4f32, createIdentityMat4f64, createMat4f64, createVec3f64, createVec4f64, differenceOfAnglesDegrees, distanceOfAnglesRadians, MAX_VALID_LATITUDE, pointPlaneSignedDistance, warnOnce} from '../../util/util';\nimport {OverscaledTileID, UnwrappedTileID, type CanonicalTileID} from '../../tile/tile_id';\nimport Point from '@mapbox/point-geometry';\nimport {MercatorCoordinate} from '../mercator_coordinate';\nimport {LngLatBounds} from '../lng_lat_bounds';\nimport {tileCoordinatesToMercatorCoordinates} from './mercator_utils';\nimport {angularCoordinatesToSurfaceVector, clampToSphere, getGlobeRadiusPixels, getZoomAdjustment, horizonPlaneToCenterAndRadius, mercatorCoordinatesToAngularCoordinatesRadians, projectTileCoordinatesToSphere, sphereSurfacePointToCoordinates} from './globe_utils';\nimport {GlobeCoveringTilesDetailsProvider} from './globe_covering_tiles_details_provider';\nimport {Frustum} from '../../util/primitives/frustum';\n\nimport type {Terrain} from '../../render/terrain';\nimport type {PointProjection} from '../../symbol/projection';\nimport type {IReadonlyTransform, ITransform, TransformConstrainFunction} from '../transform_interface';\nimport type {TransformOptions} from '../transform_helper';\nimport type {PaddingOptions} from '../edge_insets';\nimport type {ProjectionData, ProjectionDataParams} from './projection_data';\nimport type {CoveringTilesDetailsProvider} from './covering_tiles_details_provider';\n\n/**\n * Describes the intersection of ray and sphere.\n * When null, no intersection occurred.\n * When both \"t\" values are the same, the ray just touched the sphere's surface.\n * When both value are different, a full intersection occurred.\n */\ntype RaySphereIntersection = {\n    /**\n     * The ray parameter for intersection that is \"less\" along the ray direction.\n     * Note that this value can be negative, meaning that this intersection occurred before the ray's origin.\n     * The intersection point can be computed as `origin + direction * tMin`.\n     */\n    tMin: number;\n    /**\n     * The ray parameter for intersection that is \"more\" along the ray direction.\n     * Note that this value can be negative, meaning that this intersection occurred before the ray's origin.\n     * The intersection point can be computed as `origin + direction * tMax`.\n     */\n    tMax: number;\n} | null;\n\nexport class VerticalPerspectiveTransform implements ITransform {\n    private _helper: TransformHelper;\n\n    //\n    // Implementation of transform getters and setters\n    //\n\n    get pixelsToClipSpaceMatrix(): mat4 {\n        return this._helper.pixelsToClipSpaceMatrix;\n    }\n    get clipSpaceToPixelsMatrix(): mat4 {\n        return this._helper.clipSpaceToPixelsMatrix;\n    }\n    get pixelsToGLUnits(): [number, number] {\n        return this._helper.pixelsToGLUnits;\n    }\n    get centerOffset(): Point {\n        return this._helper.centerOffset;\n    }\n    get size(): Point {\n        return this._helper.size;\n    }\n    get rotationMatrix(): mat2 {\n        return this._helper.rotationMatrix;\n    }\n    get centerPoint(): Point {\n        return this._helper.centerPoint;\n    }\n    get pixelsPerMeter(): number {\n        return this._helper.pixelsPerMeter;\n    }\n    setMinZoom(zoom: number): void {\n        this._helper.setMinZoom(zoom);\n    }\n    setMaxZoom(zoom: number): void {\n        this._helper.setMaxZoom(zoom);\n    }\n    setMinPitch(pitch: number): void {\n        this._helper.setMinPitch(pitch);\n    }\n    setMaxPitch(pitch: number): void {\n        this._helper.setMaxPitch(pitch);\n    }\n    setRenderWorldCopies(renderWorldCopies: boolean): void {\n        this._helper.setRenderWorldCopies(renderWorldCopies);\n    }\n    setBearing(bearing: number): void {\n        this._helper.setBearing(bearing);\n    }\n    setPitch(pitch: number): void {\n        this._helper.setPitch(pitch);\n    }\n    setRoll(roll: number): void {\n        this._helper.setRoll(roll);\n    }\n    setFov(fov: number): void {\n        this._helper.setFov(fov);\n    }\n    setZoom(zoom: number): void {\n        this._helper.setZoom(zoom);\n    }\n    setCenter(center: LngLat): void {\n        this._helper.setCenter(center);\n    }\n    setElevation(elevation: number): void {\n        this._helper.setElevation(elevation);\n    }\n    setMinElevationForCurrentTile(elevation: number): void {\n        this._helper.setMinElevationForCurrentTile(elevation);\n    }\n    setPadding(padding: PaddingOptions): void {\n        this._helper.setPadding(padding);\n    }\n    interpolatePadding(start: PaddingOptions, target: PaddingOptions, t: number): void {\n        this._helper.interpolatePadding(start, target, t);\n    }\n    isPaddingEqual(padding: PaddingOptions): boolean {\n        return this._helper.isPaddingEqual(padding);\n    }\n    resize(width: number, height: number): void {\n        this._helper.resize(width, height);\n    }\n    getMaxBounds(): LngLatBounds {\n        return this._helper.getMaxBounds();\n    }\n    setMaxBounds(bounds?: LngLatBounds): void {\n        this._helper.setMaxBounds(bounds);\n    }\n    setConstrainOverride(constrain?: TransformConstrainFunction | null): void {\n        this._helper.setConstrainOverride(constrain);\n    }\n    overrideNearFarZ(nearZ: number, farZ: number): void {\n        this._helper.overrideNearFarZ(nearZ, farZ);\n    }\n    clearNearFarZOverride(): void {\n        this._helper.clearNearFarZOverride();\n    }\n    getCameraQueryGeometry(queryGeometry: Point[]): Point[] {\n        return this._helper.getCameraQueryGeometry(this.getCameraPoint(), queryGeometry);\n    }\n\n    get tileSize(): number {\n        return this._helper.tileSize;\n    }\n    get tileZoom(): number {\n        return this._helper.tileZoom;\n    }\n    get scale(): number {\n        return this._helper.scale;\n    }\n    get worldSize(): number {\n        return this._helper.worldSize;\n    }\n    get width(): number {\n        return this._helper.width;\n    }\n    get height(): number {\n        return this._helper.height;\n    }\n    get lngRange(): [number, number] {\n        return this._helper.lngRange;\n    }\n    get latRange(): [number, number] {\n        return this._helper.latRange;\n    }\n    get minZoom(): number {\n        return this._helper.minZoom;\n    }\n    get maxZoom(): number {\n        return this._helper.maxZoom;\n    }\n    get zoom(): number {\n        return this._helper.zoom;\n    }\n    get center(): LngLat {\n        return this._helper.center;\n    }\n    get minPitch(): number {\n        return this._helper.minPitch;\n    }\n    get maxPitch(): number {\n        return this._helper.maxPitch;\n    }\n    get pitch(): number {\n        return this._helper.pitch;\n    }\n    get pitchInRadians(): number {\n        return this._helper.pitchInRadians;\n    }\n    get roll(): number {\n        return this._helper.roll;\n    }\n    get rollInRadians(): number {\n        return this._helper.rollInRadians;\n    }\n    get bearing(): number {\n        return this._helper.bearing;\n    }\n    get bearingInRadians(): number {\n        return this._helper.bearingInRadians;\n    }\n    get fov(): number {\n        return this._helper.fov;\n    }\n    get fovInRadians(): number {\n        return this._helper.fovInRadians;\n    }\n    get elevation(): number {\n        return this._helper.elevation;\n    }\n    get minElevationForCurrentTile(): number {\n        return this._helper.minElevationForCurrentTile;\n    }\n    get padding(): PaddingOptions {\n        return this._helper.padding;\n    }\n    get unmodified(): boolean {\n        return this._helper.unmodified;\n    }\n    get renderWorldCopies(): boolean {\n        return this._helper.renderWorldCopies;\n    }\n    get constrainOverride(): TransformConstrainFunction {\n        return this._helper.constrainOverride;\n    }\n    public get nearZ(): number {\n        return this._helper.nearZ;\n    }\n    public get farZ(): number {\n        return this._helper.farZ;\n    }\n    public get autoCalculateNearFarZ(): boolean {\n        return this._helper.autoCalculateNearFarZ;\n    }\n    setTransitionState(_value: number): void {\n        // Do nothing\n    }\n    //\n    // Implementation of globe transform\n    //\n\n    private _cachedClippingPlane: vec4 = createVec4f64();\n    private _cachedFrustum: Frustum;\n    private _projectionMatrix: mat4 = createIdentityMat4f64();\n    private _globeViewProjMatrix32f: mat4 = createIdentityMat4f32(); // Must be 32 bit floats, otherwise WebGL calls in Chrome get very slow.\n    private _globeViewProjMatrixNoCorrection: mat4 = createIdentityMat4f64();\n    private _globeViewProjMatrixNoCorrectionInverted: mat4 = createIdentityMat4f64();\n    private _globeProjMatrixInverted: mat4 = createIdentityMat4f64();\n\n    private _cameraPosition: vec3 = createVec3f64();\n    private _globeLatitudeErrorCorrectionRadians: number = 0;\n    /**\n     * Globe projection can smoothly interpolate between globe view and mercator. This variable controls this interpolation.\n     * Value 0 is mercator, value 1 is globe, anything between is an interpolation between the two projections.\n     */\n\n    private _coveringTilesDetailsProvider: GlobeCoveringTilesDetailsProvider;\n\n    public constructor(options?: TransformOptions) {\n        this._helper = new TransformHelper({\n            calcMatrices: () => this._calcMatrices(),\n            defaultConstrain: (center, zoom) => { return this.defaultConstrain(center, zoom); }\n        }, options);\n        this._coveringTilesDetailsProvider = new GlobeCoveringTilesDetailsProvider();\n    }\n\n    clone(): ITransform {\n        const clone = new VerticalPerspectiveTransform();\n        clone.apply(this, false);\n        return clone;\n    }\n\n    public apply(that: IReadonlyTransform, constrain: boolean, globeLatitudeErrorCorrectionRadians?: number): void {\n        this._globeLatitudeErrorCorrectionRadians = globeLatitudeErrorCorrectionRadians || 0;\n        this._helper.apply(that, constrain);\n    }\n\n    public get projectionMatrix(): mat4 { return this._projectionMatrix; }\n\n    public get modelViewProjectionMatrix(): mat4 { return this._globeViewProjMatrixNoCorrection; }\n\n    public get inverseProjectionMatrix(): mat4 { return this._globeProjMatrixInverted; }\n\n    public get cameraPosition(): vec3 {\n        // Return a copy - don't let outside code mutate our precomputed camera position.\n        const copy = createVec3f64(); // Ensure the resulting vector is float64s\n        copy[0] = this._cameraPosition[0];\n        copy[1] = this._cameraPosition[1];\n        copy[2] = this._cameraPosition[2];\n        return copy;\n    }\n\n    get cameraToCenterDistance(): number {\n        // Globe uses the same cameraToCenterDistance as mercator.\n        return this._helper.cameraToCenterDistance;\n    }\n\n    getProjectionData(params: ProjectionDataParams): ProjectionData {\n        const {overscaledTileID, applyGlobeMatrix} = params;\n        const mercatorTileCoordinates = this._helper.getMercatorTileCoordinates(overscaledTileID);\n        return {\n            mainMatrix: this._globeViewProjMatrix32f,\n            tileMercatorCoords: mercatorTileCoordinates,\n            clippingPlane: this._cachedClippingPlane as [number, number, number, number],\n            projectionTransition: applyGlobeMatrix ? 1 : 0,\n            fallbackMatrix: this._globeViewProjMatrix32f,\n        };\n    }\n\n    private _computeClippingPlane(globeRadiusPixels: number): vec4 {\n        // We want to compute a plane equation that, when applied to the unit sphere generated\n        // in the vertex shader, places all visible parts of the sphere into the positive half-space\n        // and all the non-visible parts in the negative half-space.\n        // We can then use that to accurately clip all non-visible geometry.\n\n        // cam....------------A\n        //        ....        |\n        //            ....    |\n        //                ....B\n        //                ggggggggg\n        //          gggggg    |   .gggggg\n        //       ggg          |       ...ggg    ^\n        //     gg             |                 |\n        //    g               |                 y\n        //    g               |                 |\n        //   g                C                 #---x--->\n        //\n        // Notes:\n        // - note the coordinate axes\n        // - \"g\" marks the globe edge\n        // - the dotted line is the camera center \"ray\" - we are looking in this direction\n        // - \"cam\" is camera origin\n        // - \"C\" is globe center\n        // - \"B\" is the point on \"top\" of the globe - camera is looking at B - \"B\" is the intersection between the camera center ray and the globe\n        // - this._pitchInRadians is the angle at B between points cam,B,A\n        // - this.cameraToCenterDistance is the distance from camera to \"B\"\n        // - globe radius is (0.5 * this.worldSize)\n        // - \"T\" is any point where a tangent line from \"cam\" touches the globe surface\n        // - elevation is assumed to be zero - globe rendering must be separate from terrain rendering anyway\n\n        const pitch = this.pitchInRadians;\n        // scale things so that the globe radius is 1\n        const distanceCameraToB = this.cameraToCenterDistance / globeRadiusPixels;\n        const radius = 1;\n\n        // Distance from camera to \"A\" - the point at the same elevation as camera, right above center point on globe\n        const distanceCameraToA = Math.sin(pitch) * distanceCameraToB;\n        // Distance from \"A\" to \"C\"\n        const distanceAtoC = (Math.cos(pitch) * distanceCameraToB + radius);\n        // Distance from camera to \"C\" - the globe center\n        const distanceCameraToC = Math.sqrt(distanceCameraToA * distanceCameraToA + distanceAtoC * distanceAtoC);\n        // cam - C - T angle cosine (at C)\n        const camCTcosine = radius / distanceCameraToC;\n        // Distance from globe center to the plane defined by all possible \"T\" points\n        const tangentPlaneDistanceToC = camCTcosine * radius;\n\n        let vectorCtoCamX = -distanceCameraToA;\n        let vectorCtoCamY = distanceAtoC;\n        // Normalize the vector\n        const vectorCtoCamLength = Math.sqrt(vectorCtoCamX * vectorCtoCamX + vectorCtoCamY * vectorCtoCamY);\n        vectorCtoCamX /= vectorCtoCamLength;\n        vectorCtoCamY /= vectorCtoCamLength;\n\n        // Note the swizzled components\n        const planeVector: vec3 = [0, vectorCtoCamX, vectorCtoCamY];\n        // Apply transforms - lat, lng and angle (NOT pitch - already accounted for, as it affects the tangent plane)\n        vec3.rotateZ(planeVector, planeVector, [0, 0, 0], -this.bearingInRadians);\n        vec3.rotateX(planeVector, planeVector, [0, 0, 0], -1 * this.center.lat * Math.PI / 180.0);\n        vec3.rotateY(planeVector, planeVector, [0, 0, 0], this.center.lng * Math.PI / 180.0);\n        // Normalize the plane vector\n        const scale = 1 / vec3.length(planeVector);\n        vec3.scale(planeVector, planeVector, scale);\n        return [...planeVector, -tangentPlaneDistanceToC * scale];\n    }\n\n    public isLocationOccluded(location: LngLat): boolean {\n        return !this.isSurfacePointVisible(angularCoordinatesToSurfaceVector(location));\n    }\n\n    public transformLightDirection(dir: vec3): vec3 {\n        const sphereX = this._helper._center.lng * Math.PI / 180.0;\n        const sphereY = this._helper._center.lat * Math.PI / 180.0;\n\n        const len = Math.cos(sphereY);\n        const spherePos: vec3 = [\n            Math.sin(sphereX) * len,\n            Math.sin(sphereY),\n            Math.cos(sphereX) * len\n        ];\n\n        const axisRight: vec3 = [spherePos[2], 0.0, -spherePos[0]]; // Equivalent to cross(vec3(0.0, 1.0, 0.0), vec)\n        const axisDown: vec3 = [0, 0, 0];\n        vec3.cross(axisDown, axisRight, spherePos);\n        vec3.normalize(axisRight, axisRight);\n        vec3.normalize(axisDown, axisDown);\n\n        const transformed: vec3 = [\n            axisRight[0] * dir[0] + axisDown[0] * dir[1] + spherePos[0] * dir[2],\n            axisRight[1] * dir[0] + axisDown[1] * dir[1] + spherePos[1] * dir[2],\n            axisRight[2] * dir[0] + axisDown[2] * dir[1] + spherePos[2] * dir[2]\n        ];\n\n        const normalized: vec3 = [0, 0, 0];\n        vec3.normalize(normalized, transformed);\n        return normalized;\n    }\n\n    public getPixelScale(): number {\n        return 1.0 / Math.cos(this._helper._center.lat * Math.PI / 180);\n    }\n\n    public getCircleRadiusCorrection(): number {\n        return Math.cos(this._helper._center.lat * Math.PI / 180);\n    }\n\n    public getPitchedTextCorrection(textAnchorX: number, textAnchorY: number, tileID: UnwrappedTileID): number {\n        const mercator = tileCoordinatesToMercatorCoordinates(textAnchorX, textAnchorY, tileID.canonical);\n        const angular = mercatorCoordinatesToAngularCoordinatesRadians(mercator.x, mercator.y);\n        return this.getCircleRadiusCorrection() / Math.cos(angular[1]);\n    }\n\n    public projectTileCoordinates(x: number, y: number, unwrappedTileID: UnwrappedTileID, getElevation: (x: number, y: number) => number): PointProjection {\n        const canonical = unwrappedTileID.canonical;\n        const spherePos = projectTileCoordinatesToSphere(x, y, canonical.x, canonical.y, canonical.z);\n        const elevation = getElevation ? getElevation(x, y) : 0.0;\n        const vectorMultiplier = 1.0 + elevation / earthRadius;\n        const pos: vec4 = [spherePos[0] * vectorMultiplier, spherePos[1] * vectorMultiplier, spherePos[2] * vectorMultiplier, 1];\n        vec4.transformMat4(pos, pos, this._globeViewProjMatrixNoCorrection);\n\n        // Also check whether the point projects to the backfacing side of the sphere.\n        const plane = this._cachedClippingPlane;\n        // dot(position on sphere, occlusion plane equation)\n        const dotResult = plane[0] * spherePos[0] + plane[1] * spherePos[1] + plane[2] * spherePos[2] + plane[3];\n        const isOccluded = dotResult < 0.0;\n\n        return {\n            point: new Point(pos[0] / pos[3], pos[1] / pos[3]),\n            signedDistanceFromCamera: pos[3],\n            isOccluded\n        };\n    }\n\n    private _calcMatrices(): void {\n        if (!this._helper._width || !this._helper._height) {\n            return;\n        }\n\n        const globeRadiusPixels = getGlobeRadiusPixels(this.worldSize, this.center.lat);\n\n        // Construct a completely separate matrix for globe view\n        const globeMatrix = createMat4f64();\n        const globeMatrixUncorrected = createMat4f64();\n        if (this._helper.autoCalculateNearFarZ) {\n            this._helper._nearZ = 0.5;\n            this._helper._farZ = this.cameraToCenterDistance + globeRadiusPixels * 2.0; // just set the far plane far enough - we will calculate our own z in the vertex shader anyway\n        }\n        mat4.perspective(globeMatrix, this.fovInRadians, this.width / this.height, this._helper._nearZ, this._helper._farZ);\n\n        // Apply center of perspective offset\n        const offset = this.centerOffset;\n        globeMatrix[8] = -offset.x * 2 / this._helper._width;\n        globeMatrix[9] = offset.y * 2 / this._helper._height;\n        this._projectionMatrix = mat4.clone(globeMatrix);\n\n        this._globeProjMatrixInverted = createMat4f64();\n        mat4.invert(this._globeProjMatrixInverted, globeMatrix);\n        mat4.translate(globeMatrix, globeMatrix, [0, 0, -this.cameraToCenterDistance]);\n        mat4.rotateZ(globeMatrix, globeMatrix, this.rollInRadians);\n        mat4.rotateX(globeMatrix, globeMatrix, -this.pitchInRadians);\n        mat4.rotateZ(globeMatrix, globeMatrix, this.bearingInRadians);\n        mat4.translate(globeMatrix, globeMatrix, [0.0, 0, -globeRadiusPixels]);\n        // Rotate the sphere to center it on viewed coordinates\n\n        const scaleVec = createVec3f64();\n        scaleVec[0] = globeRadiusPixels;\n        scaleVec[1] = globeRadiusPixels;\n        scaleVec[2] = globeRadiusPixels;\n\n        // Keep a atan-correction-free matrix for transformations done on the CPU with accurate math\n        mat4.rotateX(globeMatrixUncorrected, globeMatrix, this.center.lat * Math.PI / 180.0);\n        mat4.rotateY(globeMatrixUncorrected, globeMatrixUncorrected, -this.center.lng * Math.PI / 180.0);\n        mat4.scale(globeMatrixUncorrected, globeMatrixUncorrected, scaleVec); // Scale the unit sphere to a sphere with diameter of 1\n        this._globeViewProjMatrixNoCorrection = globeMatrixUncorrected;\n\n        mat4.rotateX(globeMatrix, globeMatrix, this.center.lat * Math.PI / 180.0 - this._globeLatitudeErrorCorrectionRadians);\n        mat4.rotateY(globeMatrix, globeMatrix, -this.center.lng * Math.PI / 180.0);\n        mat4.scale(globeMatrix, globeMatrix, scaleVec); // Scale the unit sphere to a sphere with diameter of 1\n        this._globeViewProjMatrix32f = new Float32Array(globeMatrix);\n\n        this._globeViewProjMatrixNoCorrectionInverted = createMat4f64();\n        mat4.invert(this._globeViewProjMatrixNoCorrectionInverted, globeMatrixUncorrected);\n\n        const zero = createVec3f64();\n        this._cameraPosition = createVec3f64();\n        this._cameraPosition[2] = this.cameraToCenterDistance / globeRadiusPixels;\n        vec3.rotateZ(this._cameraPosition, this._cameraPosition, zero, -this.rollInRadians);\n        vec3.rotateX(this._cameraPosition, this._cameraPosition, zero, this.pitchInRadians);\n        vec3.rotateZ(this._cameraPosition, this._cameraPosition, zero, -this.bearingInRadians);\n        vec3.add(this._cameraPosition, this._cameraPosition, [0, 0, 1]);\n        vec3.rotateX(this._cameraPosition, this._cameraPosition, zero, -this.center.lat * Math.PI / 180.0);\n        vec3.rotateY(this._cameraPosition, this._cameraPosition, zero, this.center.lng * Math.PI / 180.0);\n\n        this._cachedClippingPlane = this._computeClippingPlane(globeRadiusPixels);\n\n        const matrix = mat4.clone(this._globeViewProjMatrixNoCorrectionInverted);\n        mat4.scale(matrix, matrix, [1, 1, -1]);\n        this._cachedFrustum = Frustum.fromInvProjectionMatrix(matrix, 1, 0, this._cachedClippingPlane, true);\n    }\n\n    calculateFogMatrix(_unwrappedTileID: UnwrappedTileID): mat4 {\n        warnOnce('calculateFogMatrix is not supported on globe projection.');\n        const m = createMat4f64();\n        mat4.identity(m);\n        return m;\n    }\n\n    getVisibleUnwrappedCoordinates(tileID: CanonicalTileID): UnwrappedTileID[] {\n        // Globe has no wrap.\n        return [new UnwrappedTileID(0, tileID)];\n    }\n\n    getCameraFrustum(): Frustum {\n        return this._cachedFrustum;\n    }\n    getClippingPlane(): vec4 | null {\n        return this._cachedClippingPlane;\n    }\n    getCoveringTilesDetailsProvider(): CoveringTilesDetailsProvider {\n        return this._coveringTilesDetailsProvider;\n    }\n\n    recalculateZoomAndCenter(terrain?: Terrain): void {\n        if (terrain) {\n            warnOnce('terrain is not fully supported on vertical perspective projection.');\n        }\n        this._helper.recalculateZoomAndCenter(0);\n    }\n\n    maxPitchScaleFactor(): number {\n        // In mercaltor it uses the pixelMatrix, but this is not available here...\n        return 1;\n    }\n\n    getCameraPoint(): Point {\n        return this._helper.getCameraPoint();\n    }\n\n    getCameraAltitude(): number {\n        return this._helper.getCameraAltitude();\n    }\n\n    getCameraLngLat(): LngLat {\n        return this._helper.getCameraLngLat();\n    }\n\n    lngLatToCameraDepth(lngLat: LngLat, elevation: number): number {\n        if (!this._globeViewProjMatrixNoCorrection) {\n            return 1.0; // _calcMatrices hasn't run yet\n        }\n        const vec = angularCoordinatesToSurfaceVector(lngLat);\n        vec3.scale(vec, vec, (1.0 + elevation / earthRadius));\n        const result = createVec4f64();\n        vec4.transformMat4(result, [vec[0], vec[1], vec[2], 1], this._globeViewProjMatrixNoCorrection);\n        return result[2] / result[3];\n    }\n\n    populateCache(_coords: OverscaledTileID[]): void {\n        // Do nothing\n    }\n\n    getBounds(): LngLatBounds {\n        const xMid = this.width * 0.5;\n        const yMid = this.height * 0.5;\n\n        // LngLat extremes will probably tend to be in screen corners or in middle of screen edges.\n        // These test points should result in a pretty good approximation.\n        const testPoints = [\n            new Point(0, 0),\n            new Point(xMid, 0),\n            new Point(this.width, 0),\n            new Point(this.width, yMid),\n            new Point(this.width, this.height),\n            new Point(xMid, this.height),\n            new Point(0, this.height),\n            new Point(0, yMid),\n        ];\n\n        const projectedPoints = [];\n        for (const p of testPoints) {\n            projectedPoints.push(this.unprojectScreenPoint(p));\n        }\n\n        // We can't construct a simple min/max aabb, since points might lie on either side of the antimeridian.\n        // We will instead compute the furthest points relative to map center.\n        // We also take advantage of the fact that `unprojectScreenPoint` will snap pixels\n        // outside the planet to the closest point on the planet's horizon.\n        let mostEast = 0, mostWest = 0, mostNorth = 0, mostSouth = 0; // We will store these values signed.\n        const center = this.center;\n        for (const p of projectedPoints) {\n            const dLng = differenceOfAnglesDegrees(center.lng, p.lng);\n            const dLat = differenceOfAnglesDegrees(center.lat, p.lat);\n            if (dLng < mostWest) {\n                mostWest = dLng;\n            }\n            if (dLng > mostEast) {\n                mostEast = dLng;\n            }\n            if (dLat < mostSouth) {\n                mostSouth = dLat;\n            }\n            if (dLat > mostNorth) {\n                mostNorth = dLat;\n            }\n        }\n\n        const boundsArray: [number, number, number, number] = [\n            center.lng + mostWest,  // west\n            center.lat + mostSouth, // south\n            center.lng + mostEast,  // east\n            center.lat + mostNorth  // north\n        ];\n\n        // Sometimes the poles might end up not being on the horizon,\n        // thus not being detected as the northernmost/southernmost points.\n        // We fix that here.\n        if (this.isSurfacePointOnScreen([0, 1, 0])) {\n            // North pole is visible\n            // This also means that the entire longitude range must be visible\n            boundsArray[3] = 90;\n            boundsArray[0] = -180;\n            boundsArray[2] = 180;\n        }\n        if (this.isSurfacePointOnScreen([0, -1, 0])) {\n            // South pole is visible\n            boundsArray[1] = -90;\n            boundsArray[0] = -180;\n            boundsArray[2] = 180;\n        }\n\n        return new LngLatBounds(boundsArray);\n    }\n\n    defaultConstrain: TransformConstrainFunction = (lngLat, zoom) => {\n        // Globe: TODO: respect _lngRange, _latRange\n        // It is possible to implement exact constrain for globe, but I don't think it is worth the effort.\n        const constrainedLat = clamp(lngLat.lat, -MAX_VALID_LATITUDE, MAX_VALID_LATITUDE);\n        const constrainedZoom = clamp(+zoom, this.minZoom + getZoomAdjustment(0, constrainedLat), this.maxZoom);\n        return {\n            center: new LngLat(\n                lngLat.lng,\n                constrainedLat\n            ),\n            zoom: constrainedZoom\n        };\n    };\n\n    applyConstrain: TransformConstrainFunction = (lngLat, zoom) => {\n        return this._helper.applyConstrain(lngLat, zoom);\n    };\n\n    calculateCenterFromCameraLngLatAlt(lngLat: LngLatLike, alt: number, bearing?: number, pitch?: number): {center: LngLat; elevation: number; zoom: number} {\n        return this._helper.calculateCenterFromCameraLngLatAlt(lngLat, alt, bearing, pitch);\n    }\n\n    /**\n     * Note: automatically adjusts zoom to keep planet size consistent\n     * (same size before and after a {@link setLocationAtPoint} call).\n     */\n    setLocationAtPoint(lnglat: LngLat, point: Point): void {\n        // This returns some fake coordinates for pixels that do not lie on the planet.\n        // Whatever uses this `setLocationAtPoint` function will need to account for that.\n        const pointLngLat = this.unprojectScreenPoint(point);\n        const vecToPixelCurrent = angularCoordinatesToSurfaceVector(pointLngLat);\n        const vecToTarget = angularCoordinatesToSurfaceVector(lnglat);\n\n        const zero = createVec3f64();\n        vec3.zero(zero);\n\n        const rotatedPixelVector = createVec3f64();\n        vec3.rotateY(rotatedPixelVector, vecToPixelCurrent, zero, -this.center.lng * Math.PI / 180.0);\n        vec3.rotateX(rotatedPixelVector, rotatedPixelVector, zero, this.center.lat * Math.PI / 180.0);\n\n        // We are looking for the lng,lat that will rotate `vecToTarget`\n        // so that it is equal to `rotatedPixelVector`.\n\n        // The second rotation around X axis cannot change the X component,\n        // so we first must find the longitude such that rotating `vecToTarget` with it\n        // will place it so its X component is equal to X component of `rotatedPixelVector`.\n        // There will exist zero, one or two longitudes that satisfy this.\n\n        //      x  |\n        //     /   |\n        //    /    | the line is the target X - rotatedPixelVector.x\n        //   /     | the x is vecToTarget projected to x,z plane\n        //  .      | the dot is origin\n        //\n        // We need to rotate vecToTarget so that it intersects the line.\n        // If vecToTarget is shorter than the distance to the line from origin, it is impossible.\n\n        // Otherwise, we compute the intersection of the line with a ring with radius equal to\n        // length of vecToTarget projected to XZ plane.\n\n        const vecToTargetXZLengthSquared = vecToTarget[0] * vecToTarget[0] + vecToTarget[2] * vecToTarget[2];\n        const targetXSquared = rotatedPixelVector[0] * rotatedPixelVector[0];\n        if (vecToTargetXZLengthSquared < targetXSquared) {\n            // Zero solutions - setLocationAtPoint is impossible.\n            return;\n        }\n\n        // The intersection's Z coordinates\n        const intersectionA = Math.sqrt(vecToTargetXZLengthSquared - targetXSquared);\n        const intersectionB = -intersectionA; // the second solution\n\n        const lngA = angleToRotateBetweenVectors2D(vecToTarget[0], vecToTarget[2], rotatedPixelVector[0], intersectionA);\n        const lngB = angleToRotateBetweenVectors2D(vecToTarget[0], vecToTarget[2], rotatedPixelVector[0], intersectionB);\n\n        const vecToTargetLngA = createVec3f64();\n        vec3.rotateY(vecToTargetLngA, vecToTarget, zero, -lngA);\n        const latA = angleToRotateBetweenVectors2D(vecToTargetLngA[1], vecToTargetLngA[2], rotatedPixelVector[1], rotatedPixelVector[2]);\n        const vecToTargetLngB = createVec3f64();\n        vec3.rotateY(vecToTargetLngB, vecToTarget, zero, -lngB);\n        const latB = angleToRotateBetweenVectors2D(vecToTargetLngB[1], vecToTargetLngB[2], rotatedPixelVector[1], rotatedPixelVector[2]);\n        // Is at least one of the needed latitudes valid?\n\n        const limit = Math.PI * 0.5;\n\n        const isValidA = latA >= -limit && latA <= limit;\n        const isValidB = latB >= -limit && latB <= limit;\n\n        let validLng: number;\n        let validLat: number;\n        if (isValidA && isValidB) {\n            // Pick the solution that is closer to current map center.\n            const centerLngRadians = this.center.lng * Math.PI / 180.0;\n            const centerLatRadians = this.center.lat * Math.PI / 180.0;\n            const lngDistA = distanceOfAnglesRadians(lngA, centerLngRadians);\n            const latDistA = distanceOfAnglesRadians(latA, centerLatRadians);\n            const lngDistB = distanceOfAnglesRadians(lngB, centerLngRadians);\n            const latDistB = distanceOfAnglesRadians(latB, centerLatRadians);\n\n            if ((lngDistA + latDistA) < (lngDistB + latDistB)) {\n                validLng = lngA;\n                validLat = latA;\n            } else {\n                validLng = lngB;\n                validLat = latB;\n            }\n        } else if (isValidA) {\n            validLng = lngA;\n            validLat = latA;\n        } else if (isValidB) {\n            validLng = lngB;\n            validLat = latB;\n        } else {\n            // No solution.\n            return;\n        }\n\n        const newLng = validLng / Math.PI * 180;\n        const newLat = validLat / Math.PI * 180;\n        const oldLat = this.center.lat;\n        this.setCenter(new LngLat(newLng, clamp(newLat, -90, 90)));\n        this.setZoom(this.zoom + getZoomAdjustment(oldLat, this.center.lat));\n    }\n\n    locationToScreenPoint(lnglat: LngLat, terrain?: Terrain): Point {\n        const pos = angularCoordinatesToSurfaceVector(lnglat);\n\n        if (terrain) {\n            const elevation = terrain.getElevationForLngLatZoom(lnglat, this._helper._tileZoom);\n            vec3.scale(pos, pos, 1.0 + elevation / earthRadius);\n        }\n\n        return this._projectSurfacePointToScreen(pos);\n    }\n\n    /**\n     * Projects a given vector on the surface of a unit sphere (or possible above the surface)\n     * and returns its coordinates on screen in pixels.\n     */\n    private _projectSurfacePointToScreen(pos: vec3): Point {\n        const projected = createVec4f64();\n        vec4.transformMat4(projected, [...pos, 1] as vec4, this._globeViewProjMatrixNoCorrection);\n        projected[0] /= projected[3];\n        projected[1] /= projected[3];\n        return new Point(\n            (projected[0] * 0.5 + 0.5) * this.width,\n            (-projected[1] * 0.5 + 0.5) * this.height\n        );\n    }\n\n    screenPointToMercatorCoordinate(p: Point, terrain?: Terrain): MercatorCoordinate {\n        if (terrain) {\n            // Mercator has terrain handling implemented properly and since terrain\n            // simply draws tile coordinates into a special framebuffer, this works well even for globe.\n            const coordinate = terrain.pointCoordinate(p);\n            if (coordinate) {\n                return coordinate;\n            }\n        }\n        return MercatorCoordinate.fromLngLat(this.unprojectScreenPoint(p));\n    }\n\n    screenPointToLocation(p: Point, terrain?: Terrain): LngLat {\n        return this.screenPointToMercatorCoordinate(p, terrain)?.toLngLat();\n    }\n\n    isPointOnMapSurface(p: Point, _terrain?: Terrain): boolean {\n        const rayOrigin = this._cameraPosition;\n        const rayDirection = this.getRayDirectionFromPixel(p);\n\n        const intersection = this.rayPlanetIntersection(rayOrigin, rayDirection);\n\n        return !!intersection;\n    }\n\n    /**\n     * Computes normalized direction of a ray from the camera to the given screen pixel.\n     */\n    getRayDirectionFromPixel(p: Point): vec3 {\n        const pos = createVec4f64();\n        pos[0] = (p.x / this.width) * 2.0 - 1.0;\n        pos[1] = ((p.y / this.height) * 2.0 - 1.0) * -1.0;\n        pos[2] = 1;\n        pos[3] = 1;\n        vec4.transformMat4(pos, pos, this._globeViewProjMatrixNoCorrectionInverted);\n        pos[0] /= pos[3];\n        pos[1] /= pos[3];\n        pos[2] /= pos[3];\n        const ray = createVec3f64();\n        ray[0] = pos[0] - this._cameraPosition[0];\n        ray[1] = pos[1] - this._cameraPosition[1];\n        ray[2] = pos[2] - this._cameraPosition[2];\n        const rayNormalized: vec3 = createVec3f64();\n        vec3.normalize(rayNormalized, ray);\n        return rayNormalized;\n    }\n\n    /**\n     * For a given point on the unit sphere of the planet, returns whether it is visible from\n     * camera's position (not taking into account camera rotation at all).\n     */\n    private isSurfacePointVisible(p: vec3): boolean {\n        const plane = this._cachedClippingPlane;\n        // dot(position on sphere, occlusion plane equation)\n        const dotResult = plane[0] * p[0] + plane[1] * p[1] + plane[2] * p[2] + plane[3];\n        return dotResult >= 0.0;\n    }\n\n    /**\n     * Returns whether surface point is visible on screen.\n     * It must both project to a pixel in screen bounds and not be occluded by the planet.\n     */\n    private isSurfacePointOnScreen(vec: vec3): boolean {\n        if (!this.isSurfacePointVisible(vec)) {\n            return false;\n        }\n\n        const projected = createVec4f64();\n        vec4.transformMat4(projected, [...vec, 1] as vec4, this._globeViewProjMatrixNoCorrection);\n        projected[0] /= projected[3];\n        projected[1] /= projected[3];\n        projected[2] /= projected[3];\n        return projected[0] > -1 && projected[0] < 1 &&\n            projected[1] > -1 && projected[1] < 1 &&\n            projected[2] > -1 && projected[2] < 1;\n    }\n\n    /**\n     * Returns the two intersection points of the ray and the planet's sphere,\n     * or null if no intersection occurs.\n     * The intersections are encoded as the parameter for parametric ray equation,\n     * with `tMin` being the first intersection and `tMax` being the second.\n     * Eg. the nearer intersection point can then be computed as `origin + direction * tMin`.\n     * @param origin - The ray origin.\n     * @param direction - The normalized ray direction.\n     */\n    private rayPlanetIntersection(origin: vec3, direction: vec3): RaySphereIntersection {\n        const originDotDirection = vec3.dot(origin, direction);\n        const planetRadiusSquared = 1.0; // planet is a unit sphere, so its radius squared is 1\n\n        // Ray-sphere intersection involves a quadratic equation.\n        // However solving it in the traditional schoolbook way leads to floating point precision issues.\n        // Here we instead use the approach suggested in the book Ray Tracing Gems, chapter 7.\n        // https://www.realtimerendering.com/raytracinggems/rtg/index.html\n        const inner = createVec3f64();\n        const scaledDir = createVec3f64();\n        vec3.scale(scaledDir, direction, originDotDirection);\n        vec3.sub(inner, origin, scaledDir);\n        const discriminant = planetRadiusSquared - vec3.dot(inner, inner);\n\n        if (discriminant < 0) {\n            return null;\n        }\n\n        const c = vec3.dot(origin, origin) - planetRadiusSquared;\n        const q = -originDotDirection + (originDotDirection < 0 ? 1 : -1) * Math.sqrt(discriminant);\n        const t0 = c / q;\n        const t1 = q;\n        // Assume the ray origin is never inside the sphere\n        const tMin = Math.min(t0, t1);\n        const tMax = Math.max(t0, t1);\n        return {\n            tMin,\n            tMax\n        };\n    }\n\n    /**\n     * @internal\n     * Returns a {@link LngLat} representing geographical coordinates that correspond to the specified pixel coordinates.\n     * Note: if the point does not lie on the globe, returns a location on the visible globe horizon (edge) that is\n     * as close to the point as possible.\n     * @param p - Screen point in pixels to unproject.\n     * @param terrain - Optional terrain.\n     */\n    private unprojectScreenPoint(p: Point): LngLat {\n        // Here we compute the intersection of the ray towards the pixel at `p` and the planet sphere.\n        // As always, we assume that the planet is centered at 0,0,0 and has radius 1.\n        // Ray origin is `_cameraPosition` and direction is `rayNormalized`.\n        const rayOrigin = this._cameraPosition;\n        const rayDirection = this.getRayDirectionFromPixel(p);\n        const intersection = this.rayPlanetIntersection(rayOrigin, rayDirection);\n\n        if (intersection) {\n            // Ray intersects the sphere -> compute intersection LngLat.\n            // Assume the ray origin is never inside the sphere - just use tMin\n            const intersectionPoint = createVec3f64();\n            vec3.add(intersectionPoint, rayOrigin, [\n                rayDirection[0] * intersection.tMin,\n                rayDirection[1] * intersection.tMin,\n                rayDirection[2] * intersection.tMin\n            ]);\n            const sphereSurface = createVec3f64();\n            vec3.normalize(sphereSurface, intersectionPoint);\n            return sphereSurfacePointToCoordinates(sphereSurface);\n        }\n\n        // Ray does not intersect the sphere -> find the closest point on the horizon to the ray.\n        // Intersect the ray with the clipping plane, since we know that the intersection of the clipping plane and the sphere is the horizon.\n        const horizonPlane = this._cachedClippingPlane;\n        const directionDotPlaneXyz = horizonPlane[0] * rayDirection[0] + horizonPlane[1] * rayDirection[1] + horizonPlane[2] * rayDirection[2];\n        const originToPlaneDistance = pointPlaneSignedDistance(horizonPlane, rayOrigin);\n        const distanceToIntersection = -originToPlaneDistance / directionDotPlaneXyz;\n\n        const maxRayLength = 2.0; // One globe diameter\n        const planeIntersection = createVec3f64();\n\n        if (distanceToIntersection > 0) {\n            vec3.add(planeIntersection, rayOrigin, [\n                rayDirection[0] * distanceToIntersection,\n                rayDirection[1] * distanceToIntersection,\n                rayDirection[2] * distanceToIntersection\n            ]);\n        } else {\n            // When the ray takes too long to hit the plane (>maxRayLength), or if the plane intersection is behind the camera, handle things differently.\n            // Take a point along the ray at distance maxRayLength, project it to clipping plane, then continue as normal to find the horizon point.\n            const distantPoint = createVec3f64();\n            vec3.add(distantPoint, rayOrigin, [\n                rayDirection[0] * maxRayLength,\n                rayDirection[1] * maxRayLength,\n                rayDirection[2] * maxRayLength\n            ]);\n            const distanceFromPlane = pointPlaneSignedDistance(this._cachedClippingPlane, distantPoint);\n            vec3.sub(planeIntersection, distantPoint, [\n                this._cachedClippingPlane[0] * distanceFromPlane,\n                this._cachedClippingPlane[1] * distanceFromPlane,\n                this._cachedClippingPlane[2] * distanceFromPlane\n            ]);\n        }\n\n        const horizonDisk = horizonPlaneToCenterAndRadius(horizonPlane);\n        const closestOnHorizon = clampToSphere(horizonDisk.center, horizonDisk.radius, planeIntersection);\n\n        return sphereSurfacePointToCoordinates(closestOnHorizon);\n    }\n\n    getMatrixForModel(location: LngLatLike, altitude?: number): mat4 {\n        const lnglat = LngLat.convert(location);\n        const scale = 1.0 / earthRadius;\n\n        const m = createIdentityMat4f64();\n        mat4.rotateY(m, m, lnglat.lng / 180.0 * Math.PI);\n        mat4.rotateX(m, m, -lnglat.lat / 180.0 * Math.PI);\n        mat4.translate(m, m, [0, 0, 1 + altitude / earthRadius]);\n        mat4.rotateX(m, m, Math.PI * 0.5);\n        mat4.scale(m, m, [scale, scale, scale]);\n        return m;\n    }\n\n    getProjectionDataForCustomLayer(applyGlobeMatrix: boolean = true): ProjectionData {\n        const globeData = this.getProjectionData({overscaledTileID: new OverscaledTileID(0, 0, 0, 0, 0), applyGlobeMatrix});\n        globeData.tileMercatorCoords = [0, 0, 1, 1];\n        return globeData;\n    }\n\n    getFastPathSimpleProjectionMatrix(_tileID: OverscaledTileID): mat4 {\n        return undefined;\n    }\n}\n", "import type {mat2, mat4, vec3, vec4} from 'gl-matrix';\nimport {TransformHelper} from '../transform_helper';\nimport {MercatorTransform} from './mercator_transform';\nimport {VerticalPerspectiveTransform} from './vertical_perspective_transform';\nimport {type LngLat, type LngLatLike,} from '../lng_lat';\nimport {lerp} from '../../util/util';\nimport type {OverscaledTileID, UnwrappedTileID, CanonicalTileID} from '../../tile/tile_id';\n\nimport type Point from '@mapbox/point-geometry';\nimport type {MercatorCoordinate} from '../mercator_coordinate';\nimport type {LngLatBounds} from '../lng_lat_bounds';\nimport type {Frustum} from '../../util/primitives/frustum';\nimport type {Terrain} from '../../render/terrain';\nimport type {PointProjection} from '../../symbol/projection';\nimport type {IReadonlyTransform, ITransform, TransformConstrainFunction} from '../transform_interface';\nimport type {TransformOptions} from '../transform_helper';\nimport type {PaddingOptions} from '../edge_insets';\nimport type {ProjectionData, ProjectionDataParams} from './projection_data';\nimport type {CoveringTilesDetailsProvider} from './covering_tiles_details_provider';\n\n/**\n * Globe transform is a transform that moves between vertical perspective and mercator projections.\n */\nexport class GlobeTransform implements ITransform {\n    private _helper: TransformHelper;\n\n    //\n    // Implementation of transform getters and setters\n    //\n\n    get pixelsToClipSpaceMatrix(): mat4 {\n        return this._helper.pixelsToClipSpaceMatrix;\n    }\n    get clipSpaceToPixelsMatrix(): mat4 {\n        return this._helper.clipSpaceToPixelsMatrix;\n    }\n    get pixelsToGLUnits(): [number, number] {\n        return this._helper.pixelsToGLUnits;\n    }\n    get centerOffset(): Point {\n        return this._helper.centerOffset;\n    }\n    get size(): Point {\n        return this._helper.size;\n    }\n    get rotationMatrix(): mat2 {\n        return this._helper.rotationMatrix;\n    }\n    get centerPoint(): Point {\n        return this._helper.centerPoint;\n    }\n    get pixelsPerMeter(): number {\n        return this._helper.pixelsPerMeter;\n    }\n    setMinZoom(zoom: number): void {\n        this._helper.setMinZoom(zoom);\n    }\n    setMaxZoom(zoom: number): void {\n        this._helper.setMaxZoom(zoom);\n    }\n    setMinPitch(pitch: number): void {\n        this._helper.setMinPitch(pitch);\n    }\n    setMaxPitch(pitch: number): void {\n        this._helper.setMaxPitch(pitch);\n    }\n    setRenderWorldCopies(renderWorldCopies: boolean): void {\n        this._helper.setRenderWorldCopies(renderWorldCopies);\n    }\n    setBearing(bearing: number): void {\n        this._helper.setBearing(bearing);\n    }\n    setPitch(pitch: number): void {\n        this._helper.setPitch(pitch);\n    }\n    setRoll(roll: number): void {\n        this._helper.setRoll(roll);\n    }\n    setFov(fov: number): void {\n        this._helper.setFov(fov);\n    }\n    setZoom(zoom: number): void {\n        this._helper.setZoom(zoom);\n    }\n    setCenter(center: LngLat): void {\n        this._helper.setCenter(center);\n    }\n    setElevation(elevation: number): void {\n        this._helper.setElevation(elevation);\n    }\n    setMinElevationForCurrentTile(elevation: number): void {\n        this._helper.setMinElevationForCurrentTile(elevation);\n    }\n    setPadding(padding: PaddingOptions): void {\n        this._helper.setPadding(padding);\n    }\n    interpolatePadding(start: PaddingOptions, target: PaddingOptions, t: number): void {\n        this._helper.interpolatePadding(start, target, t);\n    }\n    isPaddingEqual(padding: PaddingOptions): boolean {\n        return this._helper.isPaddingEqual(padding);\n    }\n    resize(width: number, height: number, constrainTransform: boolean = true): void {\n        this._helper.resize(width, height, constrainTransform);\n    }\n    getMaxBounds(): LngLatBounds {\n        return this._helper.getMaxBounds();\n    }\n    setMaxBounds(bounds?: LngLatBounds): void {\n        this._helper.setMaxBounds(bounds);\n    }\n    setConstrainOverride(constrain?: TransformConstrainFunction | null): void {\n        this._helper.setConstrainOverride(constrain);\n    }\n    overrideNearFarZ(nearZ: number, farZ: number): void {\n        this._helper.overrideNearFarZ(nearZ, farZ);\n    }\n    clearNearFarZOverride(): void {\n        this._helper.clearNearFarZOverride();\n    }\n    getCameraQueryGeometry(queryGeometry: Point[]): Point[] {\n        return this._helper.getCameraQueryGeometry(this.getCameraPoint(), queryGeometry);\n    }\n\n    get tileSize(): number {\n        return this._helper.tileSize;\n    }\n    get tileZoom(): number {\n        return this._helper.tileZoom;\n    }\n    get scale(): number {\n        return this._helper.scale;\n    }\n    get worldSize(): number {\n        return this._helper.worldSize;\n    }\n    get width(): number {\n        return this._helper.width;\n    }\n    get height(): number {\n        return this._helper.height;\n    }\n    get lngRange(): [number, number] {\n        return this._helper.lngRange;\n    }\n    get latRange(): [number, number] {\n        return this._helper.latRange;\n    }\n    get minZoom(): number {\n        return this._helper.minZoom;\n    }\n    get maxZoom(): number {\n        return this._helper.maxZoom;\n    }\n    get zoom(): number {\n        return this._helper.zoom;\n    }\n    get center(): LngLat {\n        return this._helper.center;\n    }\n    get minPitch(): number {\n        return this._helper.minPitch;\n    }\n    get maxPitch(): number {\n        return this._helper.maxPitch;\n    }\n    get pitch(): number {\n        return this._helper.pitch;\n    }\n    get pitchInRadians(): number {\n        return this._helper.pitchInRadians;\n    }\n    get roll(): number {\n        return this._helper.roll;\n    }\n    get rollInRadians(): number {\n        return this._helper.rollInRadians;\n    }\n    get bearing(): number {\n        return this._helper.bearing;\n    }\n    get bearingInRadians(): number {\n        return this._helper.bearingInRadians;\n    }\n    get fov(): number {\n        return this._helper.fov;\n    }\n    get fovInRadians(): number {\n        return this._helper.fovInRadians;\n    }\n    get elevation(): number {\n        return this._helper.elevation;\n    }\n    get minElevationForCurrentTile(): number {\n        return this._helper.minElevationForCurrentTile;\n    }\n    get padding(): PaddingOptions {\n        return this._helper.padding;\n    }\n    get unmodified(): boolean {\n        return this._helper.unmodified;\n    }\n    get renderWorldCopies(): boolean {\n        return this._helper.renderWorldCopies;\n    }\n    get cameraToCenterDistance(): number {\n        return this._helper.cameraToCenterDistance;\n    }\n    get constrainOverride(): TransformConstrainFunction {\n        return this._helper.constrainOverride;\n    }\n    public get nearZ(): number {\n        return this._helper.nearZ;\n    }\n    public get farZ(): number {\n        return this._helper.farZ;\n    }\n    public get autoCalculateNearFarZ(): boolean {\n        return this._helper.autoCalculateNearFarZ;\n    }\n    //\n    // Implementation of globe transform\n    //\n\n    private _globeLatitudeErrorCorrectionRadians: number = 0;\n\n    /**\n     * True when globe render path should be used instead of the old but simpler mercator rendering.\n     * Globe automatically transitions to mercator at high zoom levels, which causes a switch from\n     * globe to mercator render path.\n     */\n    get isGlobeRendering(): boolean {\n        return this._globeness > 0;\n    }\n\n    setTransitionState(globeness: number, errorCorrectionValue: number): void {\n        this._globeness = globeness;\n        this._globeLatitudeErrorCorrectionRadians = errorCorrectionValue;\n        this._calcMatrices();\n        this._verticalPerspectiveTransform.getCoveringTilesDetailsProvider().prepareNextFrame();\n        this._mercatorTransform.getCoveringTilesDetailsProvider().prepareNextFrame();\n    }\n\n    private get currentTransform(): ITransform {\n        return this.isGlobeRendering ? this._verticalPerspectiveTransform : this._mercatorTransform;\n    }\n\n    /**\n     * Globe projection can smoothly interpolate between globe view and mercator. This variable controls this interpolation.\n     * Value 0 is mercator, value 1 is globe, anything between is an interpolation between the two projections.\n     */\n    private _globeness: number = 1.0;\n    private _mercatorTransform: MercatorTransform;\n    private _verticalPerspectiveTransform: VerticalPerspectiveTransform;\n\n    public constructor(options?: TransformOptions) {\n        this._helper = new TransformHelper({\n            calcMatrices: () => this._calcMatrices(),\n            defaultConstrain: (center, zoom) => { return this.defaultConstrain(center, zoom); }\n        }, options);\n        this._globeness = 1; // When transform is cloned for use in symbols, `_updateAnimation` function which usually sets this value never gets called.\n        this._mercatorTransform = new MercatorTransform();\n        this._verticalPerspectiveTransform = new VerticalPerspectiveTransform();\n    }\n\n    clone(): ITransform {\n        const clone = new GlobeTransform();\n        clone._globeness = this._globeness;\n        clone._globeLatitudeErrorCorrectionRadians = this._globeLatitudeErrorCorrectionRadians;\n        clone.apply(this, false);\n        return clone;\n    }\n\n    public apply(that: IReadonlyTransform, constrain: boolean): void {\n        this._helper.apply(that, constrain);\n        this._mercatorTransform.apply(this, false);\n        this._verticalPerspectiveTransform.apply(this, false, this._globeLatitudeErrorCorrectionRadians);\n    }\n\n    public get projectionMatrix(): mat4 { return this.currentTransform.projectionMatrix; }\n\n    public get modelViewProjectionMatrix(): mat4 { return this.currentTransform.modelViewProjectionMatrix; }\n\n    public get inverseProjectionMatrix(): mat4 { return this.currentTransform.inverseProjectionMatrix; }\n\n    public get cameraPosition(): vec3 { return this.currentTransform.cameraPosition; }\n\n    getProjectionData(params: ProjectionDataParams): ProjectionData {\n        const mercatorProjectionData = this._mercatorTransform.getProjectionData(params);\n        const verticalPerspectiveProjectionData = this._verticalPerspectiveTransform.getProjectionData(params);\n\n        return {\n            mainMatrix: this.isGlobeRendering ? verticalPerspectiveProjectionData.mainMatrix : mercatorProjectionData.mainMatrix,\n            clippingPlane: verticalPerspectiveProjectionData.clippingPlane,\n            tileMercatorCoords: verticalPerspectiveProjectionData.tileMercatorCoords,\n            projectionTransition: params.applyGlobeMatrix ? this._globeness : 0,\n            fallbackMatrix: mercatorProjectionData.fallbackMatrix,\n        };\n    }\n\n    public isLocationOccluded(location: LngLat): boolean {\n        return this.currentTransform.isLocationOccluded(location);\n    }\n\n    public transformLightDirection(dir: vec3): vec3 {\n        return this.currentTransform.transformLightDirection(dir);\n    }\n\n    public getPixelScale(): number {\n        return lerp(this._mercatorTransform.getPixelScale(), this._verticalPerspectiveTransform.getPixelScale(), this._globeness);\n    }\n\n    public getCircleRadiusCorrection(): number {\n        return lerp(this._mercatorTransform.getCircleRadiusCorrection(), this._verticalPerspectiveTransform.getCircleRadiusCorrection(), this._globeness);\n    }\n\n    public getPitchedTextCorrection(textAnchorX: number, textAnchorY: number, tileID: UnwrappedTileID): number {\n        const mercatorCorrection = this._mercatorTransform.getPitchedTextCorrection(textAnchorX, textAnchorY, tileID);\n        const verticalCorrection = this._verticalPerspectiveTransform.getPitchedTextCorrection(textAnchorX, textAnchorY, tileID);\n        return lerp(mercatorCorrection, verticalCorrection, this._globeness);\n    }\n\n    public projectTileCoordinates(x: number, y: number, unwrappedTileID: UnwrappedTileID, getElevation: (x: number, y: number) => number): PointProjection {\n        return this.currentTransform.projectTileCoordinates(x, y, unwrappedTileID, getElevation);\n    }\n\n    private _calcMatrices(): void {\n        if (!this._helper._width || !this._helper._height) {\n            return;\n        }\n        // VerticalPerspective reads our near/farZ values and autoCalculateNearFarZ:\n        // - if autoCalculateNearFarZ is true then it computes globe Z values\n        // - if autoCalculateNearFarZ is false then it inherits our Z values\n        // In either case, its Z values are consistent with out settings and we want to copy its Z values to our helper.\n        this._verticalPerspectiveTransform.apply(this, false, this._globeLatitudeErrorCorrectionRadians);\n        this._helper._nearZ = this._verticalPerspectiveTransform.nearZ;\n        this._helper._farZ = this._verticalPerspectiveTransform.farZ;\n\n        // When transitioning between globe and mercator, we need to synchronize the depth values in both transforms.\n        // For this reason we first update vertical perspective and then sync our Z values to its result.\n        // Now if globe rendering, we always want to force mercator transform to adapt our Z values.\n        // If not, it will either compute its own (autoCalculateNearFarZ=false) or adapt our (autoCalculateNearFarZ=true).\n        // In either case we want to (again) sync our Z values, this time with\n        this._mercatorTransform.apply(this, true, this.isGlobeRendering);\n        this._helper._nearZ = this._mercatorTransform.nearZ;\n        this._helper._farZ = this._mercatorTransform.farZ;\n    }\n\n    calculateFogMatrix(unwrappedTileID: UnwrappedTileID): mat4 {\n        return this.currentTransform.calculateFogMatrix(unwrappedTileID);\n    }\n\n    getVisibleUnwrappedCoordinates(tileID: CanonicalTileID): UnwrappedTileID[] {\n        return this.currentTransform.getVisibleUnwrappedCoordinates(tileID);\n    }\n\n    getCameraFrustum(): Frustum {\n        return this.currentTransform.getCameraFrustum();\n    }\n    getClippingPlane(): vec4 | null {\n        return this.currentTransform.getClippingPlane();\n    }\n    getCoveringTilesDetailsProvider(): CoveringTilesDetailsProvider {\n        return this.currentTransform.getCoveringTilesDetailsProvider();\n    }\n\n    recalculateZoomAndCenter(terrain?: Terrain): void {\n        this._mercatorTransform.recalculateZoomAndCenter(terrain);\n        this._verticalPerspectiveTransform.recalculateZoomAndCenter(terrain);\n    }\n\n    maxPitchScaleFactor(): number {\n        // Using mercator version of this should be good enough approximation for globe.\n        return this._mercatorTransform.maxPitchScaleFactor();\n    }\n\n    getCameraPoint(): Point {\n        return this._helper.getCameraPoint();\n    }\n\n    getCameraAltitude(): number {\n        return this._helper.getCameraAltitude();\n    }\n\n    getCameraLngLat(): LngLat {\n        return this._helper.getCameraLngLat();\n    }\n\n    lngLatToCameraDepth(lngLat: LngLat, elevation: number): number {\n        return this.currentTransform.lngLatToCameraDepth(lngLat, elevation);\n    }\n\n    populateCache(coords: OverscaledTileID[]): void {\n        this._mercatorTransform.populateCache(coords);\n        this._verticalPerspectiveTransform.populateCache(coords);\n    }\n\n    getBounds(): LngLatBounds {\n        return this.currentTransform.getBounds();\n    }\n\n    defaultConstrain: TransformConstrainFunction = (lngLat, zoom) => {\n        return this.currentTransform.defaultConstrain(lngLat, zoom);\n    };\n\n    applyConstrain: TransformConstrainFunction = (lngLat, zoom) => {\n        return this._helper.applyConstrain(lngLat, zoom);\n    };\n\n    calculateCenterFromCameraLngLatAlt(lngLat: LngLatLike, alt: number, bearing?: number, pitch?: number): {center: LngLat; elevation: number; zoom: number} {\n        return this._helper.calculateCenterFromCameraLngLatAlt(lngLat, alt, bearing, pitch);\n    }\n\n    /**\n     * Note: automatically adjusts zoom to keep planet size consistent\n     * (same size before and after a {@link setLocationAtPoint} call).\n     */\n    setLocationAtPoint(lnglat: LngLat, point: Point): void {\n        if (!this.isGlobeRendering) {\n            this._mercatorTransform.setLocationAtPoint(lnglat, point);\n            this.apply(this._mercatorTransform, false);\n            return;\n        }\n        this._verticalPerspectiveTransform.setLocationAtPoint(lnglat, point);\n        this.apply(this._verticalPerspectiveTransform, false);\n        return;\n    }\n\n    locationToScreenPoint(lnglat: LngLat, terrain?: Terrain): Point {\n        return this.currentTransform.locationToScreenPoint(lnglat, terrain);\n    }\n\n    screenPointToMercatorCoordinate(p: Point, terrain?: Terrain): MercatorCoordinate {\n        return this.currentTransform.screenPointToMercatorCoordinate(p, terrain);\n    }\n\n    screenPointToLocation(p: Point, terrain?: Terrain): LngLat {\n        return this.currentTransform.screenPointToLocation(p, terrain);\n    }\n\n    isPointOnMapSurface(p: Point, terrain?: Terrain): boolean {\n        return this.currentTransform.isPointOnMapSurface(p, terrain);\n    }\n\n    /**\n     * Computes normalized direction of a ray from the camera to the given screen pixel.\n     */\n    getRayDirectionFromPixel(p: Point): vec3 {\n        return this._verticalPerspectiveTransform.getRayDirectionFromPixel(p);\n    }\n\n    getMatrixForModel(location: LngLatLike, altitude?: number): mat4 {\n        return this.currentTransform.getMatrixForModel(location, altitude);\n    }\n\n    getProjectionDataForCustomLayer(applyGlobeMatrix: boolean = true): ProjectionData {\n        const mercatorData = this._mercatorTransform.getProjectionDataForCustomLayer(applyGlobeMatrix);\n\n        if (!this.isGlobeRendering) {\n            return mercatorData;\n        }\n\n        const globeData = this._verticalPerspectiveTransform.getProjectionDataForCustomLayer(applyGlobeMatrix);\n        globeData.fallbackMatrix = mercatorData.mainMatrix;\n        return globeData;\n    }\n\n    getFastPathSimpleProjectionMatrix(tileID: OverscaledTileID): mat4 {\n        return this.currentTransform.getFastPathSimpleProjectionMatrix(tileID);\n    }\n}\n", "import Point from '@mapbox/point-geometry';\nimport {cameraBoundsWarning, type CameraForBoxAndBearingHandlerResult, type EaseToHandlerResult, type EaseToHandlerOptions, type FlyToHandlerResult, type FlyToHandlerOptions, type ICameraHelper, type MapControlsDeltas, updateRotation, type UpdateRotationArgs, cameraForBoxAndBearing} from './camera_helper';\nimport {LngLat, type LngLatLike} from '../lng_lat';\nimport {angularCoordinatesToSurfaceVector, computeGlobePanCenter, getGlobeRadiusPixels, getZoomAdjustment, globeDistanceOfLocationsPixels, interpolateLngLatForGlobe} from './globe_utils';\nimport {clamp, createVec3f64, differenceOfAnglesDegrees, MAX_VALID_LATITUDE, remapSaturate, rollPitchBearingEqual, scaleZoom, warnOnce, zoomScale} from '../../util/util';\nimport {type mat4, vec3} from 'gl-matrix';\nimport {normalizeCenter} from '../transform_helper';\nimport {interpolates} from '@maplibre/maplibre-gl-style-spec';\n\nimport type {IReadonlyTransform, ITransform} from '../transform_interface';\nimport type {CameraForBoundsOptions} from '../../ui/camera';\nimport type {LngLatBounds} from '../lng_lat_bounds';\nimport type {PaddingOptions} from '../edge_insets';\n\n/**\n * @internal\n */\nexport class VerticalPerspectiveCameraHelper implements ICameraHelper {\n\n    get useGlobeControls(): boolean { return true; }\n\n    handlePanInertia(pan: Point, transform: IReadonlyTransform): {\n        easingCenter: LngLat;\n        easingOffset: Point;\n    } {\n        const panCenter = computeGlobePanCenter(pan, transform);\n        if (Math.abs(panCenter.lng - transform.center.lng) > 180) {\n            // If easeTo target would be over 180\u00B0 distant, the animation would move\n            // in the opposite direction that what the user intended.\n            // Thus we clamp the movement to 179.5\u00B0.\n            panCenter.lng = transform.center.lng + 179.5 * Math.sign(panCenter.lng - transform.center.lng);\n        }\n        return {\n            easingCenter: panCenter,\n            easingOffset: new Point(0, 0),\n        };\n    }\n\n    handleMapControlsRollPitchBearingZoom(deltas: MapControlsDeltas, tr: ITransform): void {\n        const zoomPixel = deltas.around;\n        const zoomLoc = tr.screenPointToLocation(zoomPixel);\n\n        if (deltas.bearingDelta) tr.setBearing(tr.bearing + deltas.bearingDelta);\n        if (deltas.pitchDelta) tr.setPitch(tr.pitch + deltas.pitchDelta);\n        if (deltas.rollDelta) tr.setRoll(tr.roll + deltas.rollDelta);\n        const oldZoomPreZoomDelta = tr.zoom;\n        if (deltas.zoomDelta) tr.setZoom(tr.zoom + deltas.zoomDelta);\n        const actualZoomDelta = tr.zoom - oldZoomPreZoomDelta;\n\n        if (actualZoomDelta === 0) {\n            return;\n        }\n\n        // Problem: `setLocationAtPoint` for globe works when it is called a single time, but is a little glitchy in practice when used repeatedly for zooming.\n        // - `setLocationAtPoint` repeatedly called at a location behind a pole will eventually glitch out\n        // - `setLocationAtPoint` at location the longitude of which is more than 90\u00B0 different from current center will eventually glitch out\n        // But otherwise works fine at higher zooms, or when the target is somewhat near the current map center.\n        // Solution: use a heuristic zooming in the problematic cases and interpolate to `setLocationAtPoint` when possible.\n\n        // Magic numbers that control:\n        // - when zoom movement slowing starts for cursor not on globe (avoid unnatural map movements)\n        // - when we interpolate from exact zooming to heuristic zooming based on longitude difference of target location to current center\n        // - when we interpolate from exact zooming to heuristic zooming based on globe being too small on screen\n        // - when zoom movement slowing starts for globe being too small on viewport (avoids unnatural/unwanted map movements when map is zoomed out a lot)\n        const raySurfaceDistanceForSlowingStart = 0.3; // Zoom movement slowing will start when the planet surface to ray distance is greater than this number (globe radius is 1, so 0.3 is ~2000km form the surface).\n        const slowingMultiplier = 0.5; // The lower this value, the slower will the \"zoom movement slowing\" occur.\n        const interpolateToHeuristicStartLng = 45; // When zoom location longitude is this many degrees away from map center, we start interpolating from exact zooming to heuristic zooming.\n        const interpolateToHeuristicEndLng = 85; // Longitude difference at which interpolation to heuristic zooming ends.\n        const interpolateToHeuristicExponent = 0.25; // Makes interpolation smoother.\n        const interpolateToHeuristicStartRadius = 0.75; // When globe is this many times larger than the smaller viewport dimension, we start interpolating from exact zooming to heuristic zooming.\n        const interpolateToHeuristicEndRadius = 0.35; // Globe size at which interpolation to heuristic zooming ends.\n        const slowingRadiusStart = 0.9; // If globe is this many times larger than the smaller viewport dimension, start inhibiting map movement while zooming\n        const slowingRadiusStop = 0.5;\n        const slowingRadiusSlowFactor = 0.25; // How much is movement slowed when globe is too small\n\n        const dLngRaw = differenceOfAnglesDegrees(tr.center.lng, zoomLoc.lng);\n        const dLng = dLngRaw / (Math.abs(dLngRaw / 180) + 1.0); // This gradually reduces the amount of longitude change if the zoom location is very far, eg. on the other side of the pole (possible when looking at a pole).\n        const dLat = differenceOfAnglesDegrees(tr.center.lat, zoomLoc.lat);\n\n        // Slow zoom movement down if the mouse ray is far from the planet.\n        const rayDirection = tr.getRayDirectionFromPixel(zoomPixel);\n        const rayOrigin = tr.cameraPosition;\n        const distanceToClosestPoint = vec3.dot(rayOrigin, rayDirection) * -1; // Globe center relative to ray origin is equal to -rayOrigin and rayDirection is normalized, thus we want to compute dot(-rayOrigin, rayDirection).\n        const closestPoint = createVec3f64();\n        vec3.add(closestPoint, rayOrigin, [\n            rayDirection[0] * distanceToClosestPoint,\n            rayDirection[1] * distanceToClosestPoint,\n            rayDirection[2] * distanceToClosestPoint\n        ]);\n        const distanceFromSurface = vec3.length(closestPoint) - 1;\n        const distanceFactor = Math.exp(-Math.max(distanceFromSurface - raySurfaceDistanceForSlowingStart, 0) * slowingMultiplier);\n\n        // Slow zoom movement down if the globe is too small on viewport\n        const radius = getGlobeRadiusPixels(tr.worldSize, tr.center.lat) / Math.min(tr.width, tr.height); // Radius relative to larger viewport dimension\n        const radiusFactor = remapSaturate(radius, slowingRadiusStart, slowingRadiusStop, 1.0, slowingRadiusSlowFactor);\n\n        // Compute how much to move towards the zoom location\n        const factor = (1.0 - zoomScale(-actualZoomDelta)) * Math.min(distanceFactor, radiusFactor);\n\n        const oldCenterLat = tr.center.lat;\n        const oldZoom = tr.zoom;\n        const heuristicCenter = new LngLat(\n            tr.center.lng + dLng * factor,\n            clamp(tr.center.lat + dLat * factor, -MAX_VALID_LATITUDE, MAX_VALID_LATITUDE)\n        );\n\n        // Now compute the map center exact zoom\n        tr.setLocationAtPoint(zoomLoc, zoomPixel);\n        const exactCenter = tr.center;\n\n        // Interpolate between exact zooming and heuristic zooming depending on the longitude difference between current center and zoom location.\n        const interpolationFactorLongitude = remapSaturate(Math.abs(dLngRaw), interpolateToHeuristicStartLng, interpolateToHeuristicEndLng, 0, 1);\n        const interpolationFactorRadius = remapSaturate(radius, interpolateToHeuristicStartRadius, interpolateToHeuristicEndRadius, 0, 1);\n        const heuristicFactor = Math.pow(Math.max(interpolationFactorLongitude, interpolationFactorRadius), interpolateToHeuristicExponent);\n\n        const lngExactToHeuristic = differenceOfAnglesDegrees(exactCenter.lng, heuristicCenter.lng);\n        const latExactToHeuristic = differenceOfAnglesDegrees(exactCenter.lat, heuristicCenter.lat);\n\n        tr.setCenter(new LngLat(\n            exactCenter.lng + lngExactToHeuristic * heuristicFactor,\n            exactCenter.lat + latExactToHeuristic * heuristicFactor\n        ).wrap());\n        tr.setZoom(oldZoom + getZoomAdjustment(oldCenterLat, tr.center.lat));\n    }\n\n    handleMapControlsPan(deltas: MapControlsDeltas, tr: ITransform, _preZoomAroundLoc: LngLat): void {\n        if (!deltas.panDelta) {\n            return;\n        }\n\n        // These are actually very similar to mercator controls, and should converge to them at high zooms.\n        // We avoid using the \"grab a place and move it around\" approach from mercator here,\n        // since it is not a very pleasant way to pan a globe.\n        const oldLat = tr.center.lat;\n        const oldZoom = tr.zoom;\n        tr.setCenter(computeGlobePanCenter(deltas.panDelta, tr).wrap());\n        // Setting the center might adjust zoom to keep globe size constant, we need to avoid adding this adjustment a second time\n        tr.setZoom(oldZoom + getZoomAdjustment(oldLat, tr.center.lat));\n    }\n\n    cameraForBoxAndBearing(options: CameraForBoundsOptions, padding: PaddingOptions, bounds: LngLatBounds, bearing: number, tr: ITransform): CameraForBoxAndBearingHandlerResult {\n        const result = cameraForBoxAndBearing(options, padding, bounds, bearing, tr);\n        // If globe is enabled, we use the parameters computed for mercator, and just update the zoom to fit the bounds.\n\n        // Get clip space bounds including padding\n        const xLeft = (padding.left) / tr.width * 2.0 - 1.0;\n        const xRight = (tr.width - padding.right) / tr.width * 2.0 - 1.0;\n        const yTop = (padding.top) / tr.height * -2.0 + 1.0;\n        const yBottom = (tr.height - padding.bottom) / tr.height * -2.0 + 1.0;\n\n        // Get camera bounds\n        const flipEastWest = differenceOfAnglesDegrees(bounds.getWest(), bounds.getEast()) < 0;\n        const lngWest = flipEastWest ? bounds.getEast() : bounds.getWest();\n        const lngEast = flipEastWest ? bounds.getWest() : bounds.getEast();\n\n        const latNorth = Math.max(bounds.getNorth(), bounds.getSouth()); // \"getNorth\" doesn't always return north...\n        const latSouth = Math.min(bounds.getNorth(), bounds.getSouth());\n\n        // Additional vectors will be tested for the rectangle midpoints\n        const lngMid = lngWest + differenceOfAnglesDegrees(lngWest, lngEast) * 0.5;\n        const latMid = latNorth + differenceOfAnglesDegrees(latNorth, latSouth) * 0.5;\n\n        // Obtain a globe projection matrix that does not include pitch (unsupported)\n        const clonedTr = tr.clone();\n        clonedTr.setCenter(result.center);\n        clonedTr.setBearing(result.bearing);\n        clonedTr.setPitch(0);\n        clonedTr.setRoll(0);\n        clonedTr.setZoom(result.zoom);\n        const matrix = clonedTr.modelViewProjectionMatrix;\n\n        // Vectors to test - the bounds' corners and edge midpoints\n        const testVectors = [\n            angularCoordinatesToSurfaceVector(bounds.getNorthWest()),\n            angularCoordinatesToSurfaceVector(bounds.getNorthEast()),\n            angularCoordinatesToSurfaceVector(bounds.getSouthWest()),\n            angularCoordinatesToSurfaceVector(bounds.getSouthEast()),\n            // Also test edge midpoints\n            angularCoordinatesToSurfaceVector(new LngLat(lngEast, latMid)),\n            angularCoordinatesToSurfaceVector(new LngLat(lngWest, latMid)),\n            angularCoordinatesToSurfaceVector(new LngLat(lngMid, latNorth)),\n            angularCoordinatesToSurfaceVector(new LngLat(lngMid, latSouth))\n        ];\n        const vecToCenter = angularCoordinatesToSurfaceVector(result.center);\n\n        // Test each vector, measure how much to scale down the globe to satisfy all tested points that they are inside clip space.\n        let smallestNeededScale = Number.POSITIVE_INFINITY;\n        for (const vec of testVectors) {\n            if (xLeft < 0)\n                smallestNeededScale = VerticalPerspectiveCameraHelper.getLesserNonNegativeNonNull(smallestNeededScale, VerticalPerspectiveCameraHelper.solveVectorScale(vec, vecToCenter, matrix, 'x', xLeft));\n            if (xRight > 0)\n                smallestNeededScale = VerticalPerspectiveCameraHelper.getLesserNonNegativeNonNull(smallestNeededScale, VerticalPerspectiveCameraHelper.solveVectorScale(vec, vecToCenter, matrix, 'x', xRight));\n            if (yTop > 0)\n                smallestNeededScale = VerticalPerspectiveCameraHelper.getLesserNonNegativeNonNull(smallestNeededScale, VerticalPerspectiveCameraHelper.solveVectorScale(vec, vecToCenter, matrix, 'y', yTop));\n            if (yBottom < 0)\n                smallestNeededScale = VerticalPerspectiveCameraHelper.getLesserNonNegativeNonNull(smallestNeededScale, VerticalPerspectiveCameraHelper.solveVectorScale(vec, vecToCenter, matrix, 'y', yBottom));\n        }\n\n        if (!Number.isFinite(smallestNeededScale) || smallestNeededScale === 0) {\n            cameraBoundsWarning();\n            return undefined;\n        }\n\n        // Compute target zoom from the obtained scale.\n        result.zoom = Math.min(clonedTr.zoom + scaleZoom(smallestNeededScale), options.maxZoom);\n        return result;\n    }\n\n    /**\n     * Handles the zoom and center change during camera jumpTo.\n     */\n    handleJumpToCenterZoom(tr: ITransform, options: { zoom?: number; center?: LngLatLike }): void {\n        // Special zoom & center handling for globe:\n        // Globe constrained center isn't dependent on zoom level\n        const startingLat = tr.center.lat;\n        const constrainedCenter = tr.applyConstrain(options.center ? LngLat.convert(options.center) : tr.center, tr.zoom).center;\n        tr.setCenter(constrainedCenter.wrap());\n\n        // Make sure to compute correct target zoom level if no zoom is specified\n        const targetZoom = (typeof options.zoom !== 'undefined') ? +options.zoom : (tr.zoom + getZoomAdjustment(startingLat, constrainedCenter.lat));\n        if (tr.zoom !== targetZoom) {\n            tr.setZoom(targetZoom);\n        }\n    }\n\n    handleEaseTo(tr: ITransform, options: EaseToHandlerOptions): EaseToHandlerResult {\n        const startZoom = tr.zoom;\n        const startCenter = tr.center;\n        const startPadding = tr.padding;\n        const startEulerAngles = {roll: tr.roll, pitch: tr.pitch, bearing: tr.bearing};\n        const endRoll = options.roll === undefined ? tr.roll : options.roll;\n        const endPitch = options.pitch === undefined ? tr.pitch : options.pitch;\n        const endBearing = options.bearing === undefined ? tr.bearing : options.bearing;\n        const endEulerAngles = {roll: endRoll, pitch: endPitch, bearing: endBearing};\n\n        const optionsZoom = typeof options.zoom !== 'undefined';\n\n        const doPadding = !tr.isPaddingEqual(options.padding);\n\n        let isZooming = false;\n\n        // Globe needs special handling for how zoom should be animated.\n        // 1) if zoom is set, ease to the given mercator zoom\n        // 2) if neither is set, assume constant apparent zoom (constant planet size) is to be kept\n        const preConstrainCenter = options.center ?\n            LngLat.convert(options.center) :\n            startCenter;\n        const constrainedCenter = tr.applyConstrain(\n            preConstrainCenter,\n            startZoom // zoom can be whatever at this stage, it should not affect anything if globe is enabled\n        ).center;\n        normalizeCenter(tr, constrainedCenter);\n\n        const clonedTr = tr.clone();\n        clonedTr.setCenter(constrainedCenter);\n\n        clonedTr.setZoom(optionsZoom ?\n            +options.zoom :\n            startZoom + getZoomAdjustment(startCenter.lat, preConstrainCenter.lat));\n        clonedTr.setBearing(options.bearing);\n        const clampedPoint = new Point(\n            clamp(tr.centerPoint.x + options.offsetAsPoint.x, 0, tr.width),\n            clamp(tr.centerPoint.y + options.offsetAsPoint.y, 0, tr.height)\n        );\n        clonedTr.setLocationAtPoint(constrainedCenter, clampedPoint);\n        // Find final animation targets\n        const endCenterWithShift = (options.offset && options.offsetAsPoint.mag()) > 0 ? clonedTr.center : constrainedCenter;\n        const endZoomWithShift = optionsZoom ?\n            +options.zoom :\n            startZoom + getZoomAdjustment(startCenter.lat, endCenterWithShift.lat);\n\n        // Planet radius for a given zoom level differs according to latitude\n        // Convert zooms to what they would be at equator for the given planet radius\n        const normalizedStartZoom = startZoom + getZoomAdjustment(startCenter.lat, 0);\n        const normalizedEndZoom = endZoomWithShift + getZoomAdjustment(endCenterWithShift.lat, 0);\n        const deltaLng = differenceOfAnglesDegrees(startCenter.lng, endCenterWithShift.lng);\n        const deltaLat = differenceOfAnglesDegrees(startCenter.lat, endCenterWithShift.lat);\n\n        const finalScale = zoomScale(normalizedEndZoom - normalizedStartZoom);\n        isZooming = (endZoomWithShift !== startZoom);\n\n        const easeFunc = (k: number) => {\n            if (!rollPitchBearingEqual(startEulerAngles, endEulerAngles)) {\n                updateRotation({\n                    startEulerAngles,\n                    endEulerAngles,\n                    tr,\n                    k,\n                    useSlerp: startEulerAngles.roll != endEulerAngles.roll} as UpdateRotationArgs);\n            }\n\n            if (doPadding) {\n                tr.interpolatePadding(startPadding, options.padding,k);\n            }\n\n            if (options.around) {\n                warnOnce('Easing around a point is not supported under globe projection.');\n                tr.setLocationAtPoint(options.around, options.aroundPoint);\n            } else {\n                const base = normalizedEndZoom > normalizedStartZoom ?\n                    Math.min(2, finalScale) :\n                    Math.max(0.5, finalScale);\n                const speedup = Math.pow(base, 1 - k);\n                const factor = k * speedup;\n\n                // Spherical lerp might be used here instead, but that was tested and it leads to very weird paths when the interpolated arc gets near the poles.\n                // Instead we interpolate LngLat almost directly, but taking into account that\n                // one degree of longitude gets progressively smaller relative to latitude towards the poles.\n                const newCenter = interpolateLngLatForGlobe(startCenter, deltaLng, deltaLat, factor);\n                tr.setCenter(newCenter.wrap());\n            }\n\n            if (isZooming) {\n                const normalizedInterpolatedZoom = interpolates.number(normalizedStartZoom, normalizedEndZoom, k);\n                const interpolatedZoom = normalizedInterpolatedZoom + getZoomAdjustment(0, tr.center.lat);\n                tr.setZoom(interpolatedZoom);\n            }\n        };\n\n        return {\n            easeFunc,\n            isZooming,\n            elevationCenter: endCenterWithShift,\n        };\n    }\n\n    handleFlyTo(tr: ITransform, options: FlyToHandlerOptions): FlyToHandlerResult {\n        const optionsZoom = typeof options.zoom !== 'undefined';\n\n        const startCenter = tr.center;\n        const startZoom = tr.zoom;\n        const startPadding = tr.padding;\n\n        const doPadding = !tr.isPaddingEqual(options.padding);\n\n        // Obtain target center and zoom\n        const constrainedCenter = tr.applyConstrain(\n            LngLat.convert(options.center || options.locationAtOffset),\n            startZoom\n        ).center;\n        const targetZoom = optionsZoom ? +options.zoom : tr.zoom + getZoomAdjustment(tr.center.lat, constrainedCenter.lat);\n\n        // Compute target center that respects offset by creating a temporary transform and calling its `setLocationAtPoint`.\n        const clonedTr = tr.clone();\n        clonedTr.setCenter(constrainedCenter);\n\n        clonedTr.setZoom(targetZoom);\n        clonedTr.setBearing(options.bearing);\n        const clampedPoint = new Point(\n            clamp(tr.centerPoint.x + options.offsetAsPoint.x, 0, tr.width),\n            clamp(tr.centerPoint.y + options.offsetAsPoint.y, 0, tr.height)\n        );\n        clonedTr.setLocationAtPoint(constrainedCenter, clampedPoint);\n        const targetCenter = clonedTr.center;\n\n        normalizeCenter(tr, targetCenter);\n\n        const pixelPathLength = globeDistanceOfLocationsPixels(tr, startCenter, targetCenter);\n\n        const normalizedStartZoom = startZoom + getZoomAdjustment(startCenter.lat, 0);\n        const normalizedTargetZoom = targetZoom + getZoomAdjustment(targetCenter.lat, 0);\n        const scaleOfZoom = zoomScale(normalizedTargetZoom - normalizedStartZoom);\n\n        const optionsMinZoom = typeof options.minZoom === 'number';\n\n        let scaleOfMinZoom: number;\n\n        if (optionsMinZoom) {\n            const normalizedOptionsMinZoom = +options.minZoom + getZoomAdjustment(targetCenter.lat, 0);\n            const normalizedMinZoomPreConstrain = Math.min(normalizedOptionsMinZoom, normalizedStartZoom, normalizedTargetZoom);\n            const minZoomPreConstrain = normalizedMinZoomPreConstrain + getZoomAdjustment(0, targetCenter.lat);\n            const minZoom = tr.applyConstrain(targetCenter, minZoomPreConstrain).zoom;\n            const normalizedMinZoom = minZoom + getZoomAdjustment(targetCenter.lat, 0);\n            scaleOfMinZoom = zoomScale(normalizedMinZoom - normalizedStartZoom);\n        }\n\n        const deltaLng = differenceOfAnglesDegrees(startCenter.lng, targetCenter.lng);\n        const deltaLat = differenceOfAnglesDegrees(startCenter.lat, targetCenter.lat);\n\n        const easeFunc = (k: number, scale: number, centerFactor: number, _pointAtOffset: Point) => {\n            const interpolatedCenter = interpolateLngLatForGlobe(startCenter, deltaLng, deltaLat, centerFactor);\n\n            if (doPadding) {\n                tr.interpolatePadding(startPadding, options.padding,k);\n            }\n\n            const newCenter = k === 1 ? targetCenter : interpolatedCenter;\n            tr.setCenter(newCenter.wrap());\n\n            const interpolatedZoom = normalizedStartZoom + scaleZoom(scale);\n            tr.setZoom(k === 1 ? targetZoom : (interpolatedZoom + getZoomAdjustment(0, newCenter.lat)));\n        };\n\n        return {\n            easeFunc,\n            scaleOfZoom,\n            targetCenter,\n            scaleOfMinZoom,\n            pixelPathLength,\n        };\n    }\n\n    /**\n     * Computes how much to scale the globe in order for a given point on its surface (a location) to project to a given clip space coordinate in either the X or the Y axis.\n     * @param vector - Position of the queried location on the surface of the unit sphere globe.\n     * @param toCenter - Position of current transform center on the surface of the unit sphere globe.\n     * This is needed because zooming the globe not only changes its scale,\n     * but also moves the camera closer or further away along this vector (pitch is disregarded).\n     * @param projection - The globe projection matrix.\n     * @param targetDimension - The dimension in which the scaled vector must match the target value in clip space.\n     * @param targetValue - The target clip space value in the specified dimension to which the queried vector must project.\n     * @returns How much to scale the globe.\n     */\n    private static solveVectorScale(vector: vec3, toCenter: vec3, projection: mat4, targetDimension: 'x' | 'y', targetValue: number): number | null {\n        // We want to compute how much to scale the sphere in order for the input `vector` to project to `targetValue` in the given `targetDimension` (X or Y).\n        const k = targetValue;\n        const columnXorY = targetDimension === 'x' ?\n            [projection[0], projection[4], projection[8], projection[12]] : // X\n            [projection[1], projection[5], projection[9], projection[13]];  // Y\n        const columnZ = [projection[3], projection[7], projection[11], projection[15]];\n\n        const vecDotXY = vector[0] * columnXorY[0] + vector[1] * columnXorY[1] + vector[2] * columnXorY[2];\n        const vecDotZ = vector[0] * columnZ[0] + vector[1] * columnZ[1] + vector[2] * columnZ[2];\n        const toCenterDotXY = toCenter[0] * columnXorY[0] + toCenter[1] * columnXorY[1] + toCenter[2] * columnXorY[2];\n        const toCenterDotZ = toCenter[0] * columnZ[0] + toCenter[1] * columnZ[1] + toCenter[2] * columnZ[2];\n\n        // The following can be derived from writing down what happens to a vector scaled by a parameter (\"V * t\") when it is multiplied by a projection matrix, then solving for \"t\".\n        // Or rather, we derive it for a vector \"V * t + (1-t) * C\". Where V is `vector` and C is `toCenter`. The extra addition is needed because zooming out also moves the camera along \"C\".\n\n        const t = (toCenterDotXY + columnXorY[3] - k * toCenterDotZ - k * columnZ[3]) / (toCenterDotXY - vecDotXY - k * toCenterDotZ + k * vecDotZ);\n\n        if (\n            toCenterDotXY + k * vecDotZ === vecDotXY + k * toCenterDotZ ||\n            columnZ[3] * (vecDotXY - toCenterDotXY) + columnXorY[3] * (toCenterDotZ - vecDotZ) + vecDotXY * toCenterDotZ === toCenterDotXY * vecDotZ\n        ) {\n            // The computed result is invalid.\n            return null;\n        }\n        return t;\n    }\n\n    /**\n     * Returns `newValue` if it is:\n     *\n     * - not null AND\n     * - not negative AND\n     * - smaller than `newValue`,\n     *\n     * ...otherwise returns `oldValue`.\n     */\n    private static getLesserNonNegativeNonNull(oldValue: number, newValue: number): number {\n        if (newValue !== null && newValue >= 0 && newValue < oldValue) {\n            return newValue;\n        } else {\n            return oldValue;\n        }\n    }\n}\n", "import {MercatorCameraHelper} from './mercator_camera_helper';\nimport {VerticalPerspectiveCameraHelper} from './vertical_perspective_camera_helper';\n\nimport type Point from '@mapbox/point-geometry';\nimport type {CameraForBoxAndBearingHandlerResult, EaseToHandlerResult, EaseToHandlerOptions, FlyToHandlerResult, FlyToHandlerOptions, ICameraHelper, MapControlsDeltas} from './camera_helper';\nimport type {LngLat, LngLatLike} from '../lng_lat';\nimport type {IReadonlyTransform, ITransform} from '../transform_interface';\nimport type {GlobeProjection} from './globe_projection';\nimport type {CameraForBoundsOptions} from '../../ui/camera';\nimport type {LngLatBounds} from '../lng_lat_bounds';\nimport type {PaddingOptions} from '../edge_insets';\n\n/**\n * @internal\n */\nexport class GlobeCameraHelper implements ICameraHelper {\n    private _globe: GlobeProjection;\n    private _mercatorCameraHelper: MercatorCameraHelper;\n    private _verticalPerspectiveCameraHelper: VerticalPerspectiveCameraHelper;\n\n    constructor(globe: GlobeProjection) {\n        this._globe = globe;\n        this._mercatorCameraHelper = new MercatorCameraHelper();\n        this._verticalPerspectiveCameraHelper = new VerticalPerspectiveCameraHelper();\n    }\n\n    get useGlobeControls(): boolean { return this._globe.useGlobeRendering; }\n\n    get currentHelper(): ICameraHelper {\n        return this.useGlobeControls ? this._verticalPerspectiveCameraHelper : this._mercatorCameraHelper;\n    }\n\n    handlePanInertia(pan: Point, transform: IReadonlyTransform): {\n        easingCenter: LngLat;\n        easingOffset: Point;\n    } {\n        return this.currentHelper.handlePanInertia(pan, transform);\n    }\n\n    handleMapControlsRollPitchBearingZoom(deltas: MapControlsDeltas, tr: ITransform): void {\n        this.currentHelper.handleMapControlsRollPitchBearingZoom(deltas, tr);\n    }\n\n    handleMapControlsPan(deltas: MapControlsDeltas, tr: ITransform, preZoomAroundLoc: LngLat): void {\n        this.currentHelper.handleMapControlsPan(deltas, tr, preZoomAroundLoc);\n    }\n\n    cameraForBoxAndBearing(options: CameraForBoundsOptions, padding: PaddingOptions, bounds: LngLatBounds, bearing: number, tr: ITransform): CameraForBoxAndBearingHandlerResult {\n        return this.currentHelper.cameraForBoxAndBearing(options, padding, bounds, bearing, tr);\n    }\n\n    /**\n     * Handles the zoom and center change during camera jumpTo.\n     */\n    handleJumpToCenterZoom(tr: ITransform, options: { zoom?: number; center?: LngLatLike }): void {\n        this.currentHelper.handleJumpToCenterZoom(tr, options);\n    }\n\n    handleEaseTo(tr: ITransform, options: EaseToHandlerOptions): EaseToHandlerResult {\n        return this.currentHelper.handleEaseTo(tr, options);\n    }\n\n    handleFlyTo(tr: ITransform, options: FlyToHandlerOptions): FlyToHandlerResult {\n        return this.currentHelper.handleFlyTo(tr, options);\n    }\n}", "import {throwIfAborted} from '../util/abort_error';\nimport {Event, ErrorEvent, Evented} from '../util/evented';\nimport {type StyleLayer} from './style_layer';\nimport {isRasterStyleLayer} from './style_layer/raster_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, ensureError, 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 {now} from '../util/time_control';\nimport {Dispatcher} from '../util/dispatcher';\nimport {validateStyle, emitValidationErrors as _emitValidationErrors} from './validate_style';\nimport {type Source} from '../source/source';\nimport {type QueryRenderedFeaturesOptions, type QueryRenderedFeaturesOptionsStrict, type QueryRenderedFeaturesResults, type QueryRenderedFeaturesResultsItem, type QuerySourceFeatureOptions, queryRenderedFeatures, queryRenderedSymbols, querySourceFeatures} from '../source/query_features';\nimport {TileManager} from '../tile/tile_manager';\nimport {type GeoJSONSource} from '../source/geojson_source';\nimport {latest as styleSpec, derefLayers, emptyStyle, diff as diffStyles, type 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';\nimport type Point from '@mapbox/point-geometry';\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?.filter(error => error.identifier !== 'source.canvas'));\n\nimport type {Map} from '../ui/map';\nimport type {IReadonlyTransform, ITransform} from '../geo/transform_interface';\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    ProjectionSpecification,\n    SkySpecification,\n    StateSpecification\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    type GetDashesParameters,\n    type GetDashesResponse,\n    MessageType,\n    type GetGlyphsParameters,\n    type GetGlyphsResponse,\n    type GetImagesParameters,\n    type GetImagesResponse\n} from '../util/actor_messages';\nimport {type Projection} from '../geo/projection/projection';\nimport {createProjectionFromName} from '../geo/projection/projection_factory';\nimport type {OverscaledTileID} from '../tile/tile_id';\n\nconst empty = emptyStyle();\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 * - when an incoming style uses relative paths, which need to be converted to absolute.\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 *       // make relative sprite path like \"../sprite\" absolute\n *       sprite: new URL(nextStyle.sprite, \"https://demotiles.maplibre.org/styles/osm-bright-gl-style/sprites/\").href,\n *       // make relative glyphs path like \"../fonts/{fontstack}/{range}.pbf\" absolute\n *       glyphs: new URL(nextStyle.glyphs, \"https://demotiles.maplibre.org/font/\").href,\n *       sources: {\n *           // make relative vector url like \"../../\" absolute\n *           ...nextStyle.sources.map(source => {\n *              if (source.url) {\n *                  source.url = new URL(source.url, \"https://tiles.openfreemap.org/planet\");\n *              }\n *              return source;\n *           }),\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    projection: Projection | undefined;\n    sky: Sky;\n\n    _frameRequest: AbortController;\n    _loadStyleRequest: AbortController;\n    _spriteRequest: AbortController;\n    _layers: {[_: string]: StyleLayer};\n    _serializedLayers: {[_: string]: LayerSpecification};\n    _order: string[];\n    tileManagers: {[_: string]: TileManager};\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: string[];\n    _globalState: Record<string, any>;\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.dispatcher.registerMessageHandler(MessageType.getDashes, (mapId, params) => {\n            return this.getDashes(mapId, params);\n        });\n        this.imageManager = new ImageManager();\n        this.imageManager.setEventedParent(this);\n        const glyphLang = map._container?.lang || (typeof document !== 'undefined' && document.documentElement?.lang) || undefined;\n        this.glyphManager = new GlyphManager(map._requestManager, options.localIdeographFontFamily, glyphLang);\n        this.lineAtlas = new LineAtlas(256, 512);\n        this.crossTileSymbolIndex = new CrossTileSymbolIndex();\n\n        this._setInitialValues();\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 tileManager = this.tileManagers[event.sourceId];\n            if (!tileManager) {\n                return;\n            }\n\n            const source = tileManager.getSource();\n            if (!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    private _setInitialValues() {\n        this._spritesImagesIds = {};\n        this._layers = {};\n        this._order = [];\n        this.tileManagers = {};\n        this.zoomHistory = new ZoomHistory();\n        this._availableImages = [];\n        this._globalState = {};\n        this._serializedLayers = {};\n        this.stylesheet = null;\n        this.light = null;\n        this.sky = null;\n        if (this.projection) {\n            this.projection.destroy();\n            delete this.projection;\n        }\n        this._loaded = false;\n        this._changed = false;\n        this._updatedLayers = {};\n        this._updatedSources = {};\n        this._changedImages = {};\n        this._glyphsDidChange = false;\n        this._updatedPaintProps = {};\n        this._layerOrderChanged = false;\n        this.crossTileSymbolIndex = new (this.crossTileSymbolIndex?.constructor || Object)();\n        this.pauseablePlacement = undefined;\n        this.placement = undefined;\n        this.z = 0;\n    }\n\n    _rtlPluginLoaded = () => {\n        for (const id in this.tileManagers) {\n            const sourceType = this.tileManagers[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.tileManagers[id].reload(); // Should be a no-op if the plugin loads before any tiles load\n            }\n        }\n    };\n\n    setGlobalStateProperty(name: string, value: any) {\n        this._checkLoaded();\n\n        const newValue = value === null ?\n            this.stylesheet.state?.[name]?.default ?? null :\n            value;\n\n        if (deepEqual(newValue, this._globalState[name])) {\n            return this;\n        }\n\n        this._globalState[name] = newValue;\n\n        this._applyGlobalStateChanges([name]);\n    }\n\n    getGlobalState() {\n        return this._globalState;\n    }\n\n    setGlobalState(newStylesheetState: StateSpecification) {\n        this._checkLoaded();\n\n        const changedGlobalStateRefs = [];\n\n        for (const propertyName in newStylesheetState) {\n            const didChange = !deepEqual(this._globalState[propertyName], newStylesheetState[propertyName].default);\n\n            if (didChange) {\n                changedGlobalStateRefs.push(propertyName);\n                this._globalState[propertyName] = newStylesheetState[propertyName].default;\n            }\n        }\n\n        this._applyGlobalStateChanges(changedGlobalStateRefs);\n    }\n\n    /**\n     * @internal\n     * Find all sources that are affected by the global state changes and reload them.\n     * Find all paint properties that are affected by the global state changes and update them.\n     * For example, if a layer filter uses global-state expression, this function will find the source id of that layer.\n     */\n    _applyGlobalStateChanges(globalStateRefs: string[]) {\n        if (globalStateRefs.length === 0) {\n            return;\n        }\n\n        const sourceIdsToReload = new Set<string>();\n        const globalStateChange = {};\n\n        for (const ref of globalStateRefs) {\n            globalStateChange[ref] = this._globalState[ref];\n\n            for (const layerId in this._layers) {\n                const layer = this._layers[layerId];\n                const layoutAffectingGlobalStateRefs = layer.getLayoutAffectingGlobalStateRefs();\n                const paintAffectingGlobalStateRefs = layer.getPaintAffectingGlobalStateRefs();\n                const visibilityAffectingGlobalStateRefs = layer.getVisibilityAffectingGlobalStateRefs();\n\n                if (layoutAffectingGlobalStateRefs.has(ref)) {\n                    sourceIdsToReload.add(layer.source);\n                }\n                if (paintAffectingGlobalStateRefs.has(ref)) {\n                    for (const {name, value} of paintAffectingGlobalStateRefs.get(ref)) {\n                        this._updatePaintProperty(layer, name, value);\n                    }\n                }\n                if (visibilityAffectingGlobalStateRefs?.has(ref)) {\n                    layer.recalculateVisibility();\n                    this._updateLayer(layer);\n                }\n            }\n        }\n\n        // Propagate global state changes to workers\n        this.dispatcher.broadcast(MessageType.updateGlobalState, globalStateChange);\n\n        for (const id in this.tileManagers) {\n            if (sourceIdsToReload.has(id)) {\n                this._reloadSource(id);\n                this._changed = true;\n            }\n        }\n    }\n\n    async 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        this._loadStyleRequest = new AbortController();\n        const abortController = this._loadStyleRequest;\n        try {\n            const request = await this.map._requestManager.transformRequest(url, ResourceType.Style);\n            throwIfAborted(abortController.signal);\n\n            const response = await getJSON<StyleSpecification>(request, abortController);\n            if (this._loadStyleRequest === abortController) {\n                // Clear this request only if it is still the active style load. A stale\n                // request can finish after a newer loadURL() call has already installed\n                // another controller, and must not clear that newer abort handle.\n                this._loadStyleRequest = null;\n            }\n            this._load(response.data, options, previousStyle);\n        } catch (error) {\n            if (this._loadStyleRequest === abortController) {\n                this._loadStyleRequest = null;\n            }\n            if (error && !abortController.signal.aborted) { // ignore abort\n                this.fire(new ErrorEvent(ensureError(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, this.map._ownerWindow).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        let nextState = options.transformStyle ? options.transformStyle(previousStyle, json) : json;\n        if (options.validate && emitValidationErrors(this, validateStyle(nextState))) {\n            return;\n        }\n\n        nextState = {...nextState};\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._setProjectionInternal(this.stylesheet.projection?.type || 'mercator');\n\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 = derefLayers(this.stylesheet.layers);\n\n        this.setGlobalState(this.stylesheet.state ?? null);\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, this._globalState);\n            styledLayer.setEventedParent(this, {layer: {id: layer.id}});\n            this._layers[layer.id] = styledLayer;\n\n            if (isRasterStyleLayer(styledLayer) && this.tileManagers[styledLayer.source]) {\n                const rasterFadeDuration = layer.paint?.['raster-fade-duration'] ?? styledLayer.paint.get('raster-fade-duration');\n                this.tileManagers[styledLayer.source].setRasterFadeDuration(rasterFadeDuration);\n            }\n        }\n    }\n\n    _loadSprite(sprite: SpriteSpecification, isUpdate: boolean = false, completion: (err: Error) => void = undefined) {\n        this.imageManager.setLoaded(false);\n\n        const abortController = new AbortController();\n        this._spriteRequest = 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            if (!abortController.signal.aborted) { // ignore abort\n                this.fire(new ErrorEvent(err));\n            }\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 tileManager = this.tileManagers[layer.source];\n        if (!tileManager) {\n            return;\n        }\n\n        const sourceLayer = layer.sourceLayer;\n        if (!sourceLayer) {\n            return;\n        }\n\n        const source = tileManager.getSource();\n        if (source.type === 'geojson' || (source.vectorLayerIds && !source.vectorLayerIds.includes(sourceLayer))) {\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.tileManagers)\n            if (!this.tileManagers[id].loaded())\n                return false;\n\n        return this.imageManager.isLoaded();\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 returnClone - if true, return a clone of the layer object\n     * @returns generated result\n     */\n    private _serializeByIds(ids: string[], returnClone: boolean = false): 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?.hasTransition()) {\n            return true;\n        }\n\n        if (this.sky?.hasTransition()) {\n            return true;\n        }\n\n        if (this.projection?.hasTransition()) {\n            return true;\n        }\n\n        for (const id in this.tileManagers) {\n            if (this.tileManagers[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 managersUsedBefore = {};\n\n        // save 'used' status to managersUsedBefore object and reset all tileManagers 'used' field to false\n        for (const id in this.tileManagers) {\n            const tileManager = this.tileManagers[id];\n\n            // tileManager.used could be undefined, and managersUsedBefore[id] is also 'undefined'\n            managersUsedBefore[id] = tileManager.used;\n            tileManager.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 tileManagers 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.tileManagers[layer.source].used = true;\n            }\n        }\n\n        // cross check managersUsedBefore against updated this.tileManagers dictionary\n        // if \"used\" field is different fire visibility event\n        for (const id in managersUsedBefore) {\n            const tileManager = this.tileManagers[id];\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 (!!managersUsedBefore[id] !== !!tileManager.used) {\n                tileManager.fire(new Event('data',\n                    {\n                        sourceDataType: 'visibility',\n                        dataType: 'source',\n                        sourceId: id\n                    }));\n            }\n        }\n\n        this.light.recalculate(parameters);\n        this.sky.recalculate(parameters);\n        this.projection.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.tileManagers) {\n                this.tileManagers[name].reloadTilesForDependencies(['icons', 'patterns'], changedImages);\n            }\n            this._changedImages = {};\n        }\n    }\n\n    _updateTilesForChangedGlyphs() {\n        if (this._glyphsDidChange) {\n            for (const name in this.tileManagers) {\n                this.tileManagers[name].reloadTilesForDependencies(['glyphs'], ['']);\n            }\n            this._glyphsDidChange = false;\n        }\n    }\n\n    _updateWorkerLayers(updatedIds: string[], removedIds: 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 = derefLayers(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        this.fire(new Event('style.load', {style: this}));\n\n        return true;\n    }\n\n    _getOperationsToPerform(diff: Array<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                case 'setRoll':\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 'setTerrain':\n                    operations.push(() => this.map.setTerrain.apply(this, op.args));\n                    break;\n                case 'setSky':\n                    operations.push(() => this.setSky.apply(this, op.args));\n                    break;\n                case 'setProjection':\n                    this.setProjection.apply(this, op.args);\n                    break;\n                case 'setGlobalState':\n                    operations.push(() => this.setGlobalState.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.tileManagers[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.includes(source.type);\n        if (shouldValidate && this._validate(validateStyle.source, `sources.${id}`, source, null, options)) return;\n        if (this.map?._collectResourceTiming) (source as any).collectResourceTiming = true;\n        const tileManager = this.tileManagers[id] = new TileManager(id, source, this.dispatcher);\n        tileManager.style = this;\n        tileManager.setEventedParent(this, () => ({\n            isSourceLoaded: tileManager.loaded(),\n            source: tileManager.serialize(),\n            sourceId: id\n        }));\n\n        tileManager.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.tileManagers[id] === undefined) {\n            throw new Error(`There is no source with this ID=${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 tileManager = this.tileManagers[id];\n        delete this.tileManagers[id];\n        delete this._updatedSources[id];\n        tileManager.fire(new Event('data', {sourceDataType: 'metadata', dataType: 'source', sourceId: id}));\n        tileManager.setEventedParent(null);\n        tileManager.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.tileManagers[id] === undefined) throw new Error(`There is no source with this ID=${id}`);\n        const geojsonSource: GeoJSONSource = (this.tileManagers[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.tileManagers[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, this._globalState);\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, this._globalState);\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.tileManagers[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.setFilter(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.setFilter(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        this._updatePaintProperty(layer, name, value, options);\n    }\n\n    _updatePaintProperty(layer: StyleLayer, name: string, value: any, options: StyleSetterOptions = {}) {\n        const requiresRelayout = layer.setPaintProperty(name, value, options);\n        if (requiresRelayout) {\n            this._updateLayer(layer);\n        }\n\n        if (isRasterStyleLayer(layer) && name === 'raster-fade-duration') {\n            this.tileManagers[layer.source].setRasterFadeDuration(value);\n        }\n\n        this._changed = true;\n        this._updatedPaintProps[layer.id] = 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 tileManager = this.tileManagers[sourceId];\n\n        if (tileManager === 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 = tileManager.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        tileManager.setFeatureState(sourceLayer, target.id, state);\n    }\n\n    removeFeatureState(target: FeatureIdentifier, key?: string) {\n        this._checkLoaded();\n        const sourceId = target.source;\n        const tileManager = this.tileManagers[sourceId];\n\n        if (tileManager === 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 = tileManager.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        tileManager.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 tileManager = this.tileManagers[sourceId];\n\n        if (tileManager === 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 = tileManager.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 tileManager.getFeatureState(sourceLayer, target.id);\n    }\n\n    getTransition() {\n        return extend({duration: 300, delay: 0}, 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.tileManagers, (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            projection: myStyleSheet.projection,\n            sources,\n            layers,\n            terrain\n        },\n        (value) => 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.tileManagers[layer.source].getSource().type !== 'raster') {\n            this._updatedSources[layer.source] = 'reload';\n            this.tileManagers[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: QueryRenderedFeaturesResults[]): 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: QueryRenderedFeaturesResultsItem[] = [];\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 as number) - (a.intersectionZ as number);\n        });\n\n        const features: MapGeoJSONFeature[] = [];\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: Point[], params: QueryRenderedFeaturesOptions, transform: IReadonlyTransform): MapGeoJSONFeature[] {\n        if (params?.filter) {\n            this._validate(validateStyle.filter, 'queryRenderedFeatures.filter', params.filter, null, params);\n        }\n\n        const includedSources = {};\n        if (params?.layers) {\n            const isArrayOrSet = Array.isArray(params.layers) || params.layers instanceof Set;\n            if (!isArrayOrSet) {\n                this.fire(new ErrorEvent(new Error('parameters.layers must be an Array or a Set of strings')));\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: QueryRenderedFeaturesResults[] = [];\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        const layersAsSet = params.layers instanceof Set ? params.layers : Array.isArray(params.layers) ? new Set(params.layers) : null;\n        const paramsStrict: QueryRenderedFeaturesOptionsStrict = {\n            ...params,\n            layers: layersAsSet,\n            globalState: this._globalState\n        };\n\n        for (const id in this.tileManagers) {\n            if (params.layers && !includedSources[id]) continue;\n            sourceResults.push(\n                queryRenderedFeatures(\n                    this.tileManagers[id],\n                    this._layers,\n                    serializedLayers,\n                    queryGeometry,\n                    paramsStrict,\n                    transform,\n                    this.map.terrain ?\n                        (id: OverscaledTileID, x: number, y: number) =>\n                            this.map.terrain.getElevation(id, x, y) :\n                        undefined)\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.tileManagers,\n                    queryGeometry,\n                    paramsStrict,\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?.filter) {\n            this._validate(validateStyle.filter, 'querySourceFeatures.filter', params.filter, null, params);\n        }\n        const tileManager = this.tileManagers[sourceID];\n        return tileManager ? querySourceFeatures(tileManager, params ? {...params, globalState: this._globalState} : {globalState: this._globalState}) : [];\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: 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    getProjection(): ProjectionSpecification {\n        return this.stylesheet?.projection;\n    }\n\n    setProjection(projection?: ProjectionSpecification) {\n        this._checkLoaded();\n        const resolvedProjection = projection ?? {type: 'mercator'};\n        this.stylesheet.projection = projection;\n        if (this.projection) {\n            if (this.projection.name === resolvedProjection.type) {\n                return;\n            }\n            this.projection.destroy();\n            delete this.projection;\n        }\n        this._setProjectionInternal(resolvedProjection.type);\n    }\n\n    getSky(): SkySpecification {\n        return this.stylesheet?.sky;\n    }\n\n    setSky(skyOptions?: SkySpecification, options: StyleSetterOptions = {}) {\n        this._checkLoaded();\n        const sky = this.getSky();\n\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: 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    _setProjectionInternal(name: ProjectionSpecification['type']) {\n        const projectionObjects = createProjectionFromName(name, this.map.transformConstrain);\n        this.projection = projectionObjects.projection;\n        this.map.migrateProjection(projectionObjects.transform, projectionObjects.cameraHelper);\n        for (const key in this.tileManagers) {\n            this.tileManagers[key].reload();\n        }\n    }\n\n    _validate(validate: Validator, key: string, value: any, props: any, options: {\n        validate?: boolean;\n    } = {}) {\n        if (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.tileManagers) {\n            const tileManager = this.tileManagers[id];\n            tileManager.setEventedParent(null);\n            tileManager.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.tileManagers[id].clearTiles();\n    }\n\n    _reloadSource(id: string) {\n        this.tileManagers[id].resume();\n        this.tileManagers[id].reload();\n    }\n\n    _updateSources(transform: ITransform) {\n        for (const id in this.tileManagers) {\n            this.tileManagers[id].update(transform, this.map.terrain);\n        }\n    }\n\n    _generateCollisionBoxes() {\n        for (const id in this.tileManagers) {\n            this._reloadSource(id);\n        }\n    }\n\n    _updatePlacement(transform: ITransform, 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 tileManager = this.tileManagers[styleLayer.source];\n                layerTiles[styleLayer.source] = tileManager.getRenderableIds(true)\n                    .map((id) => tileManager.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 ||= 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 ||= this._layerOrderChanged || fadeDuration === 0;\n\n        if (forceFullPlacement || !this.pauseablePlacement || (this.pauseablePlacement.isDone() && !this.placement.stillRecent(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\u2019t\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(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        // false when we have just finished a placement that didn't change the visibility of any symbols\n        return !this.pauseablePlacement.isDone() || this.placement.hasTransitions(now());\n    }\n\n    _releaseSymbolFadeTiles() {\n        for (const id in this.tileManagers) {\n            this.tileManagers[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 tileManager = this.tileManagers[params.source];\n        if (tileManager) {\n            tileManager.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 glyphs = await this.glyphManager.getGlyphs(params.stacks);\n        const tileManager = this.tileManagers[params.source];\n        if (tileManager) {\n            // we are not setting stacks as dependencies since for now\n            // we just need to know which tiles have glyph dependencies\n            tileManager.setDependencies(params.tileID.key, params.type, ['']);\n        }\n        return glyphs;\n    }\n\n    getGlyphsUrl(): string | null {\n        return this.stylesheet.glyphs || null;\n    }\n\n    setGlyphs(glyphsUrl: string | null | undefined, options: StyleSetterOptions = {}) {\n        this._checkLoaded();\n\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    async getDashes(mapId: string | number, params: GetDashesParameters): Promise<GetDashesResponse> {\n        const result: GetDashesResponse = {};\n        for (const [key, dash] of Object.entries(params.dashes)) {\n            result[key] = this.lineAtlas.getDash(dash.dasharray, dash.round);\n        }\n        return result;\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    /**\n     * Destroys all internal resources of the style (sources, images, layers, etc.)\n     */\n    destroy() {\n        // cancel any pending requests\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\n        // remove sourcecaches\n        for (const id in this.tileManagers) {\n            const tileManager = this.tileManagers[id];\n            tileManager.setEventedParent(null);\n            tileManager.onRemove(this.map);\n        }\n        this.tileManagers = {};\n\n        // Destroy imageManager and clear images\n        if (this.imageManager) {\n            this.imageManager.setEventedParent(null);\n            this.imageManager.destroy();\n            this._availableImages = [];\n            this._spritesImagesIds = {};\n        }\n\n        // Destroy glyphManager\n        if (this.glyphManager) {\n            this.glyphManager.destroy();\n        }\n\n        // Remove layers\n        for (const layerId in this._layers) {\n            const layer = this._layers[layerId];\n            layer.setEventedParent(null);\n            if (layer.onRemove) layer.onRemove(this.map);\n        }\n\n        // reset internal state\n        this._setInitialValues();\n\n        // Remove event listeners\n        this.setEventedParent(null);\n        this.dispatcher.unregisterMessageHandler(MessageType.getGlyphs);\n        this.dispatcher.unregisterMessageHandler(MessageType.getImages);\n        this.dispatcher.unregisterMessageHandler(MessageType.getDashes);\n        this.dispatcher.remove(true);\n        this._listeners = {};\n        this._oneTimeListeners = {};\n    }\n}\n", "import {warnOnce} from '../../util/util';\nimport {MercatorProjection} from './mercator_projection';\nimport {MercatorTransform} from './mercator_transform';\nimport {MercatorCameraHelper} from './mercator_camera_helper';\nimport {GlobeProjection} from './globe_projection';\nimport {GlobeTransform} from './globe_transform';\nimport {GlobeCameraHelper} from './globe_camera_helper';\nimport {VerticalPerspectiveCameraHelper} from './vertical_perspective_camera_helper';\nimport {VerticalPerspectiveTransform} from './vertical_perspective_transform';\nimport {VerticalPerspectiveProjection} from './vertical_perspective_projection';\n\nimport type {ProjectionSpecification} from '@maplibre/maplibre-gl-style-spec';\nimport type {Projection} from './projection';\nimport type {ITransform, TransformConstrainFunction} from '../transform_interface';\nimport type {ICameraHelper} from './camera_helper';\n\nexport function createProjectionFromName(name: ProjectionSpecification['type'], transformConstrain?: TransformConstrainFunction): {\n    projection: Projection;\n    transform: ITransform;\n    cameraHelper: ICameraHelper;\n} {\n    const transformOptions = {constrainOverride: transformConstrain};\n    if (Array.isArray(name)) {\n        const globeProjection = new GlobeProjection({type: name});\n        return {\n            projection: globeProjection,\n            transform: new GlobeTransform(transformOptions),\n            cameraHelper: new GlobeCameraHelper(globeProjection),\n        };\n    }\n    switch (name) {\n        case 'mercator':\n        {\n            return {\n                projection: new MercatorProjection(),\n                transform: new MercatorTransform(transformOptions),\n                cameraHelper: new MercatorCameraHelper(),\n            };\n        }\n        case 'globe':\n        {\n            const globeProjection = new GlobeProjection({type: [\n                'interpolate',\n                ['linear'],\n                ['zoom'],\n                11,\n                'vertical-perspective',\n                12,\n                'mercator'\n            ]});\n            return {\n                projection: globeProjection,\n                transform: new GlobeTransform(transformOptions),\n                cameraHelper: new GlobeCameraHelper(globeProjection),\n            };\n        }\n        case 'vertical-perspective':\n        {\n            return {\n                projection: new VerticalPerspectiveProjection(),\n                transform: new VerticalPerspectiveTransform(transformOptions),\n                cameraHelper: new VerticalPerspectiveCameraHelper(),\n            };\n        }\n        default:\n        {\n            warnOnce(`Unknown projection name: ${name}. Falling back to mercator projection.`);\n            return {\n                projection: new MercatorProjection(),\n                transform: new MercatorTransform(transformOptions),\n                cameraHelper: new MercatorCameraHelper(),\n            };\n        }\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", "\nimport type {Program} from './program';\nimport type {VertexBuffer} from './vertex_buffer';\nimport type {IndexBuffer} from './index_buffer';\nimport type {Context} from './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: 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: 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?.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: 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 '../../webgl/context';\nimport type {UniformValues, UniformLocations} from '../uniform_binding';\nimport {type Sky} from '../../style/sky';\nimport {Color} from '@maplibre/maplibre-gl-style-spec';\nimport {type mat4} from 'gl-matrix';\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_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    'u_is_globe_mode': Uniform1f;\n};\n\nexport type TerrainDepthUniformsType = {\n    'u_ele_delta': Uniform1f;\n};\n\nexport type TerrainCoordsUniformsType = {\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_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    'u_is_globe_mode': new Uniform1f(context, locations.u_is_globe_mode)\n});\n\nconst terrainDepthUniforms = (context: Context, locations: UniformLocations): TerrainDepthUniformsType => ({\n    'u_ele_delta': new Uniform1f(context, locations.u_ele_delta)\n});\n\nconst terrainCoordsUniforms = (context: Context, locations: UniformLocations): TerrainCoordsUniformsType => ({\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    eleDelta: number,\n    fogMatrix: mat4,\n    sky: Sky,\n    pitch: number,\n    isGlobeMode: boolean): UniformValues<TerrainUniformsType> => ({\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    // Set opacity to 0 when in globe mode to disable fog\n    'u_fog_ground_blend_opacity': isGlobeMode ? 0 : (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    'u_is_globe_mode': isGlobeMode ? 1 : 0\n});\n\nconst terrainDepthUniformValues = (\n    eleDelta: number\n): UniformValues<TerrainDepthUniformsType> => ({\n    'u_ele_delta': eleDelta\n});\n\nconst terrainCoordsUniformValues = (\n    coordsId: number,\n    eleDelta: number\n): UniformValues<TerrainCoordsUniformsType> => ({\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 {Uniform1f, Uniform4f, type UniformLocations, UniformMatrix4f} from '../uniform_binding';\nimport {type Context} from '../../webgl/context';\n// This next import is needed for the \"@link\" in the documentation to work properly.\n\nimport type {ProjectionData} from '../../geo/projection/projection_data';\n\nexport type ProjectionPreludeUniformsType = {\n    'u_projection_matrix': UniformMatrix4f;\n    'u_projection_tile_mercator_coords': Uniform4f;\n    'u_projection_clipping_plane': Uniform4f;\n    'u_projection_transition': Uniform1f;\n    'u_projection_fallback_matrix': UniformMatrix4f;\n};\n\nexport const projectionUniforms = (context: Context, locations: UniformLocations): ProjectionPreludeUniformsType => ({\n    'u_projection_matrix': new UniformMatrix4f(context, locations.u_projection_matrix),\n    'u_projection_tile_mercator_coords': new Uniform4f(context, locations.u_projection_tile_mercator_coords),\n    'u_projection_clipping_plane': new Uniform4f(context, locations.u_projection_clipping_plane),\n    'u_projection_transition': new Uniform1f(context, locations.u_projection_transition),\n    'u_projection_fallback_matrix': new UniformMatrix4f(context, locations.u_projection_fallback_matrix),\n});\n\n/**\n * Maps a field name in {@link ProjectionData} to its corresponding uniform name in {@link ProjectionPreludeUniformsType}.\n */\nexport const projectionObjectToUniformMap: {[field in keyof ProjectionData]: keyof ProjectionPreludeUniformsType} = {\n    mainMatrix: 'u_projection_matrix',\n    tileMercatorCoords: 'u_projection_tile_mercator_coords',\n    clippingPlane: 'u_projection_clipping_plane',\n    projectionTransition: 'u_projection_transition',\n    fallbackMatrix: 'u_projection_fallback_matrix',\n};\n", "import {type PreparedShader, shaders, transpileVertexShaderToWebGL1, transpileFragmentShaderToWebGL1} from '../shaders/shaders';\nimport {type ProgramConfiguration} from '../data/program_configuration';\nimport {VertexArrayObject} from './vertex_array_object';\nimport {type Context} from './context';\nimport {isWebGL2} from './webgl2';\n\nimport type {SegmentVector} from '../data/segment';\nimport type {VertexBuffer} from './vertex_buffer';\nimport type {IndexBuffer} from './index_buffer';\nimport type {DepthMode} from './depth_mode';\nimport type {StencilMode} from './stencil_mode';\nimport type {ColorMode} from './color_mode';\nimport type {CullFaceMode} from './cull_face_mode';\nimport type {UniformBindings, UniformValues, UniformLocations} from './uniform_binding';\nimport type {BinderUniform} from '../data/program_configuration';\nimport {terrainPreludeUniforms, type TerrainPreludeUniformsType} from './program/terrain_program';\nimport type {TerrainData} from '../render/terrain';\nimport {projectionObjectToUniformMap, type ProjectionPreludeUniformsType, projectionUniforms} from './program/projection_program';\nimport type {ProjectionData} from '../geo/projection/projection_data';\n\nexport type DrawMode = WebGLRenderingContextBase['LINES'] | WebGLRenderingContextBase['TRIANGLES'] | WebGL2RenderingContext['LINE_STRIP'];\n\nfunction getTokenizedAttributesAndUniforms(array: string[]): string[] {\n    const result = [];\n\n    for (const entry of array) {\n        if (entry === null) continue;\n        const token = entry.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    projectionUniforms: ProjectionPreludeUniformsType;\n    binderUniforms: BinderUniform[];\n    failedToCreate: boolean;\n\n    constructor(context: Context,\n        source: PreparedShader,\n        configuration: ProgramConfiguration,\n        fixedUniforms: (b: Context, a: UniformLocations) => Us,\n        showOverdrawInspector: boolean,\n        hasTerrain: boolean,\n        projectionPrelude: PreparedShader,\n        projectionDefine: string,\n        extraDefines: string[] = []) {\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 projectionPreludeUniformsInfo = projectionPrelude.staticUniforms ? getTokenizedAttributesAndUniforms(projectionPrelude.staticUniforms) : [];\n        const staticUniformsInfo = source.staticUniforms ? getTokenizedAttributesAndUniforms(source.staticUniforms) : [];\n        const dynamicUniformsInfo = configuration ? configuration.getBinderUniforms() : [];\n        // remove duplicate uniforms\n        const uniformList = preludeUniformsInfo.concat(projectionPreludeUniformsInfo).concat(staticUniformsInfo).concat(dynamicUniformsInfo);\n        const allUniformsInfo = [];\n        for (const uniform of uniformList) {\n            if (!allUniformsInfo.includes(uniform)) allUniformsInfo.push(uniform);\n        }\n\n        const defines = configuration ? configuration.defines() : [];\n        if (isWebGL2(gl)) {\n            defines.unshift('#version 300 es');\n        }\n        if (showOverdrawInspector) {\n            defines.push('#define OVERDRAW_INSPECTOR;');\n        }\n        if (hasTerrain) {\n            defines.push('#define TERRAIN3D;');\n        }\n        if (projectionDefine) {\n            defines.push(projectionDefine);\n        }\n        if (extraDefines) {\n            defines.push(...extraDefines);\n        }\n\n        let fragmentSource = defines.concat(shaders.prelude.fragmentSource, projectionPrelude.fragmentSource, source.fragmentSource).join('\\n');\n        let vertexSource = defines.concat(shaders.prelude.vertexSource, projectionPrelude.vertexSource, source.vertexSource).join('\\n');\n\n        if (!isWebGL2(gl)) {\n            fragmentSource = transpileFragmentShaderToWebGL1(fragmentSource);\n            vertexSource = transpileVertexShaderToWebGL1(vertexSource);\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 (const uniform of allUniformsInfo) {\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.projectionUniforms = projectionUniforms(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        projectionData: ProjectionData,\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        if (projectionData) {\n            for (const fieldName in projectionData) {\n                const uniformName = projectionObjectToUniformMap[fieldName];\n                this.projectionUniforms[uniformName].set(projectionData[fieldName]);\n            }\n        }\n\n        if (uniformValues) {\n            for (const name in this.fixedUniforms) {\n                this.fixedUniforms[name].set(uniformValues[name]);\n            }\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            segment.vaos ||= {};\n            segment.vaos[layerID] ||= new VertexArrayObject();\n            segment.vaos[layerID].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    type Uniform1i,\n    type Uniform1f,\n    type Uniform2f,\n    type Uniform3f\n} from '../uniform_binding';\nimport {pixelsToTileUnits} from '../../source/pixels_to_tile_units';\n\nimport type {Painter} from '../../render/painter';\nimport type {OverscaledTileID} from '../../tile/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 '../../tile/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} from '../uniform_binding';\n\nimport {mat3, vec3} from 'gl-matrix';\nimport {extend} from '../../util/util';\n\nimport type {Context} from '../../webgl/context';\nimport type {Painter} from '../../render/painter';\nimport type {OverscaledTileID} from '../../tile/tile_id';\nimport type {UniformValues, UniformLocations} from '../uniform_binding';\nimport type {CrossfadeParameters} from '../../style/evaluation_parameters';\nimport type {Tile} from '../../tile/tile';\n\nexport type FillExtrusionUniformsType = {\n    'u_lightpos': Uniform3f;\n    'u_lightpos_globe': Uniform3f;\n    'u_lightintensity': Uniform1f;\n    'u_lightcolor': Uniform3f;\n    'u_vertical_gradient': Uniform1f;\n    'u_opacity': Uniform1f;\n    'u_fill_translate': Uniform2f;\n};\n\nexport type FillExtrusionPatternUniformsType = {\n    'u_lightpos': Uniform3f;\n    'u_lightpos_globe': Uniform3f;\n    'u_lightintensity': Uniform1f;\n    'u_lightcolor': Uniform3f;\n    'u_height_factor': Uniform1f;\n    'u_vertical_gradient': Uniform1f;\n    'u_opacity': Uniform1f;\n    'u_fill_translate': 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 fillExtrusionUniforms = (context: Context, locations: UniformLocations): FillExtrusionUniformsType => ({\n    'u_lightpos': new Uniform3f(context, locations.u_lightpos),\n    'u_lightpos_globe': new Uniform3f(context, locations.u_lightpos_globe),\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    'u_fill_translate': new Uniform2f(context, locations.u_fill_translate),\n});\n\nconst fillExtrusionPatternUniforms = (context: Context, locations: UniformLocations): FillExtrusionPatternUniformsType => ({\n    'u_lightpos': new Uniform3f(context, locations.u_lightpos),\n    'u_lightpos_globe': new Uniform3f(context, locations.u_lightpos_globe),\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    'u_opacity': new Uniform1f(context, locations.u_opacity),\n    'u_fill_translate': new Uniform2f(context, locations.u_fill_translate),\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});\n\nconst fillExtrusionUniformValues = (\n    painter: Painter,\n    shouldUseVerticalGradient: boolean,\n    opacity: number,\n    translate: [number, 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.bearingInRadians);\n    }\n    vec3.transformMat3(lightPos, lightPos, lightMat);\n    const transformedLightPos = painter.transform.transformLightDirection(lightPos);\n\n    const lightColor = light.properties.get('color');\n\n    return {\n        'u_lightpos': lightPos,\n        'u_lightpos_globe': transformedLightPos,\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        'u_fill_translate': translate,\n    };\n};\n\nconst fillExtrusionPatternUniformValues = (\n    painter: Painter,\n    shouldUseVerticalGradient: boolean,\n    opacity: number,\n    translate: [number, number],\n    coord: OverscaledTileID,\n    crossfade: CrossfadeParameters,\n    tile: Tile\n): UniformValues<FillExtrusionPatternUniformsType> => {\n    return extend(fillExtrusionUniformValues(painter, shouldUseVerticalGradient, opacity, translate),\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 {patternUniformValues} from './pattern';\nimport {\n    Uniform1i,\n    Uniform1f,\n    Uniform2f,\n    Uniform3f,\n} from '../uniform_binding';\nimport {extend} from '../../util/util';\n\nimport type {Painter} from '../../render/painter';\nimport type {UniformValues, UniformLocations} from '../uniform_binding';\nimport type {Context} from '../../webgl/context';\nimport type {CrossfadeParameters} from '../../style/evaluation_parameters';\nimport type {Tile} from '../../tile/tile';\n\nexport type FillUniformsType = {\n    'u_fill_translate': Uniform2f;\n};\n\nexport type FillOutlineUniformsType = {\n    'u_world': Uniform2f;\n    'u_fill_translate': Uniform2f;\n};\n\nexport type FillPatternUniformsType = {\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_fill_translate': Uniform2f;\n};\n\nexport type FillOutlinePatternUniformsType = {\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    'u_fill_translate': Uniform2f;\n};\n\nconst fillUniforms = (context: Context, locations: UniformLocations): FillUniformsType => ({\n    'u_fill_translate': new Uniform2f(context, locations.u_fill_translate)\n});\n\nconst fillPatternUniforms = (context: Context, locations: UniformLocations): FillPatternUniformsType => ({\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_fill_translate': new Uniform2f(context, locations.u_fill_translate)\n});\n\nconst fillOutlineUniforms = (context: Context, locations: UniformLocations): FillOutlineUniformsType => ({\n    'u_world': new Uniform2f(context, locations.u_world),\n    'u_fill_translate': new Uniform2f(context, locations.u_fill_translate)\n});\n\nconst fillOutlinePatternUniforms = (context: Context, locations: UniformLocations): FillOutlinePatternUniformsType => ({\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    'u_fill_translate': new Uniform2f(context, locations.u_fill_translate)\n});\n\nconst fillPatternUniformValues = (\n    painter: Painter,\n    crossfade: CrossfadeParameters,\n    tile: Tile,\n    translate: [number, number]\n): UniformValues<FillPatternUniformsType> => extend(\n    patternUniformValues(crossfade, painter, tile),\n    {\n        'u_fill_translate': translate,\n    }\n);\n\nconst fillUniformValues = (translate: [number, number]): UniformValues<FillUniformsType> => ({\n    'u_fill_translate': translate,\n});\n\nconst fillOutlineUniformValues = (drawingBufferSize: [number, number], translate: [number, number]): UniformValues<FillOutlineUniformsType> => ({\n    'u_world': drawingBufferSize,\n    'u_fill_translate': translate,\n});\n\nconst fillOutlinePatternUniformValues = (\n    painter: Painter,\n    crossfade: CrossfadeParameters,\n    tile: Tile,\n    drawingBufferSize: [number, number],\n    translate: [number, number]\n): UniformValues<FillOutlinePatternUniformsType> => extend(\n    fillPatternUniformValues(painter, crossfade, tile, translate),\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} from '../uniform_binding';\nimport {pixelsToTileUnits} from '../../source/pixels_to_tile_units';\n\nimport type {Context} from '../../webgl/context';\nimport type {UniformValues, UniformLocations} from '../uniform_binding';\nimport type {Tile} from '../../tile/tile';\nimport type {CircleStyleLayer} from '../../style/style_layer/circle_style_layer';\nimport type {Painter} from '../../render/painter';\nimport {EXTENT} from '../../data/extent';\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_globe_extrude_scale': Uniform1f;\n    'u_translate': Uniform2f;\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_globe_extrude_scale': new Uniform1f(context, locations.u_globe_extrude_scale),\n    'u_translate': new Uniform2f(context, locations.u_translate),\n});\n\nconst circleUniformValues = (\n    painter: Painter,\n    tile: Tile,\n    layer: CircleStyleLayer,\n    translate: [number, number],\n    radiusCorrectionFactor: number\n): UniformValues<CircleUniformsType> => {\n    const transform = painter.transform;\n\n    let pitchWithMap: boolean, extrudeScale: [number, number];\n    let globeExtrudeScale: number = 0;\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\n        // For globe rendering we need to know how much to extrude the circle as an *angle*.\n        // The calculation: (one pixel in tile units) / (earth circumference in tile units) * (2PI radians) * radiusCorrectionFactor\n        globeExtrudeScale = pixelRatio / (EXTENT * Math.pow(2, tile.tileID.overscaledZ)) * 2.0 * Math.PI * radiusCorrectionFactor;\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_pitch_with_map': +(pitchWithMap),\n        'u_device_pixel_ratio': painter.pixelRatio,\n        'u_extrude_scale': extrudeScale,\n        'u_globe_extrude_scale': globeExtrudeScale,\n        'u_translate': translate,\n    };\n};\n\nexport {circleUniforms, circleUniformValues};\n", "import {Uniform2f} from '../uniform_binding';\nimport type {Context} from '../../webgl/context';\nimport type {UniformValues, UniformLocations} from '../uniform_binding';\nimport type {IReadonlyTransform} from '../../geo/transform_interface';\n\nexport type CollisionUniformsType = {\n    'u_pixel_extrude_scale': Uniform2f;\n};\n\nexport type CollisionCircleUniformsType = {\n    'u_viewport_size': Uniform2f;\n};\n\nconst collisionUniforms = (context: Context, locations: UniformLocations): CollisionUniformsType => ({\n    'u_pixel_extrude_scale': new Uniform2f(context, locations.u_pixel_extrude_scale)\n});\n\nconst collisionCircleUniforms = (context: Context, locations: UniformLocations): CollisionCircleUniformsType => ({\n    'u_viewport_size': new Uniform2f(context, locations.u_viewport_size)\n});\n\nconst collisionUniformValues = (transform: {width: number; height: number}): UniformValues<CollisionUniformsType> => {\n    return {\n        'u_pixel_extrude_scale': [1.0 / transform.width, 1.0 / transform.height],\n    };\n};\n\nconst collisionCircleUniformValues = (transform: IReadonlyTransform): UniformValues<CollisionCircleUniformsType> => {\n    return {\n        'u_viewport_size': [transform.width, transform.height]\n    };\n};\n\nexport {collisionUniforms, collisionUniformValues, collisionCircleUniforms, collisionCircleUniformValues};\n", "import {UniformColor, Uniform1i, Uniform1f} from '../uniform_binding';\n\nimport type {Context} from '../../webgl/context';\nimport type {UniformValues, UniformLocations} from '../uniform_binding';\nimport type {Color} from '@maplibre/maplibre-gl-style-spec';\n\nexport type DebugUniformsType = {\n    'u_color': UniformColor;\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_overlay': new Uniform1i(context, locations.u_overlay),\n    'u_overlay_scale': new Uniform1f(context, locations.u_overlay_scale)\n});\n\nconst debugUniformValues = (color: Color, scaleRatio: number = 1): UniformValues<DebugUniformsType> => ({\n    'u_color': color,\n    'u_overlay': 0,\n    'u_overlay_scale': scaleRatio\n});\n\nexport {debugUniforms, debugUniformValues};\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 '../../webgl/context';\nimport type {Tile} from '../../tile/tile';\nimport type {UniformValues, UniformLocations} from '../uniform_binding';\nimport type {Painter} from '../../render/painter';\nimport type {HeatmapStyleLayer} from '../../style/style_layer/heatmap_style_layer';\nimport {EXTENT} from '../../data/extent';\n\nexport type HeatmapUniformsType = {\n    'u_extrude_scale': Uniform1f;\n    'u_intensity': Uniform1f;\n    'u_globe_extrude_scale': Uniform1f;\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_globe_extrude_scale': new Uniform1f(context, locations.u_globe_extrude_scale)\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 = (tile: Tile, zoom: number, intensity: number, radiusCorrectionFactor: number): UniformValues<HeatmapUniformsType> => {\n    const pixelRatio = pixelsToTileUnits(tile, 1, zoom);\n    // See comment in circle_program.ts\n    const globeExtrudeScale = pixelRatio / (EXTENT * Math.pow(2, tile.tileID.overscaledZ)) * 2.0 * Math.PI * radiusCorrectionFactor;\n    return {\n        'u_extrude_scale': pixelsToTileUnits(tile, 1, zoom),\n        'u_intensity': intensity,\n        'u_globe_extrude_scale': globeExtrudeScale\n    };\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    UniformFloatArray,\n    UniformColorArray,\n    UniformMatrix4f,\n    Uniform4f\n} from '../uniform_binding';\nimport {EXTENT} from '../../data/extent';\nimport {MercatorCoordinate} from '../../geo/mercator_coordinate';\n\nimport type {Context} from '../../webgl/context';\nimport type {UniformValues, UniformLocations} from '../uniform_binding';\nimport type {Tile} from '../../tile/tile';\nimport type {Painter} from '../../render/painter';\nimport type {HillshadeStyleLayer} from '../../style/style_layer/hillshade_style_layer';\nimport type {DEMData} from '../../data/dem_data';\nimport type {OverscaledTileID} from '../../tile/tile_id';\n\nexport type HillshadeUniformsType = {\n    'u_image': Uniform1i;\n    'u_latrange': Uniform2f;\n    'u_exaggeration': Uniform1f;\n    'u_altitudes': UniformFloatArray;\n    'u_azimuths': UniformFloatArray;\n    'u_accent': UniformColor;\n    'u_method': Uniform1i;\n    'u_shadows': UniformColorArray;\n    'u_highlights': UniformColorArray;\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_image': new Uniform1i(context, locations.u_image),\n    'u_latrange': new Uniform2f(context, locations.u_latrange),\n    'u_exaggeration': new Uniform1f(context, locations.u_exaggeration),\n    'u_altitudes': new UniformFloatArray(context, locations.u_altitudes),\n    'u_azimuths': new UniformFloatArray(context, locations.u_azimuths),\n    'u_accent': new UniformColor(context, locations.u_accent),\n    'u_method': new Uniform1i(context, locations.u_method),\n    'u_shadows': new UniformColorArray(context, locations.u_shadows),\n    'u_highlights': new UniformColorArray(context, locations.u_highlights)\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): UniformValues<HillshadeUniformsType> => {\n    const accent = layer.paint.get('hillshade-accent-color');\n    let method;\n    switch (layer.paint.get('hillshade-method')) {\n        case 'basic':\n            method = 4;\n            break;\n        case 'combined':\n            method = 1;\n            break;\n        case 'igor':\n            method = 2;\n            break;\n        case 'multidirectional':\n            method = 3;\n            break;\n        case 'standard':\n        default:\n            method = 0;\n            break;\n    }\n\n    const illumination = layer.getIlluminationProperties();\n\n    for (let i = 0; i < illumination.directionRadians.length; i++) {\n        // modify azimuthal angle by map rotation if light is anchored at the viewport\n        if (layer.paint.get('hillshade-illumination-anchor') === 'viewport') {\n            illumination.directionRadians[i] += painter.transform.bearingInRadians;\n        }\n    }\n    return {\n        'u_image': 0,\n        'u_latrange': getTileLatRange(painter, tile.tileID),\n        'u_exaggeration': layer.paint.get('hillshade-exaggeration'),\n        'u_altitudes': illumination.altitudeRadians,\n        'u_azimuths': illumination.directionRadians,\n        'u_accent': accent,\n        'u_method': method,\n        'u_highlights': illumination.highlightColor,\n        'u_shadows': illumination.shadowColor\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 {\n    Uniform1i,\n    Uniform1f,\n    Uniform2f,\n    Uniform4f\n} from '../uniform_binding';\n\nimport type {Context} from '../../webgl/context';\nimport type {UniformValues, UniformLocations} from '../uniform_binding';\nimport type {ColorReliefStyleLayer} from '../../style/style_layer/color_relief_style_layer';\nimport type {DEMData} from '../../data/dem_data';\n\nexport type ColorReliefUniformsType = {\n    'u_image': Uniform1i;\n    'u_unpack': Uniform4f;\n    'u_dimension': Uniform2f;\n    'u_elevation_stops': Uniform1i;\n    'u_color_stops': Uniform1i;\n    'u_color_ramp_size': Uniform1i;\n    'u_opacity': Uniform1f;\n};\n\nconst colorReliefUniforms = (context: Context, locations: UniformLocations): ColorReliefUniformsType => ({\n    'u_image': new Uniform1i(context, locations.u_image),\n    'u_unpack': new Uniform4f(context, locations.u_unpack),\n    'u_dimension': new Uniform2f(context, locations.u_dimension),\n    'u_elevation_stops': new Uniform1i(context, locations.u_elevation_stops),\n    'u_color_stops': new Uniform1i(context, locations.u_color_stops),\n    'u_color_ramp_size': new Uniform1i(context, locations.u_color_ramp_size),\n    'u_opacity': new Uniform1f(context, locations.u_opacity)\n});\n\nconst colorReliefUniformValues = (\n    layer: ColorReliefStyleLayer,\n    dem: DEMData,\n    colorRampSize: number = 0\n): UniformValues<ColorReliefUniformsType> => {\n\n    return {\n        'u_image': 0,\n        'u_unpack': dem.getUnpackVector(),\n        'u_dimension': [dem.stride, dem.stride],\n        'u_elevation_stops': 1,\n        'u_color_stops': 4,\n        'u_color_ramp_size': colorRampSize,\n        'u_opacity': layer.paint.get('color-relief-opacity')\n    };\n};\n\nexport {\n    colorReliefUniforms,\n    colorReliefUniformValues,\n};\n", "import {Uniform1i, Uniform1f, Uniform2f, Uniform3f} from '../uniform_binding';\nimport {pixelsToTileUnits} from '../../source/pixels_to_tile_units';\nimport {extend, translatePosition} from '../../util/util';\n\nimport type {Context} from '../../webgl/context';\nimport type {UniformValues, UniformLocations} from '../uniform_binding';\nimport type {IReadonlyTransform} from '../../geo/transform_interface';\nimport type {Tile} from '../../tile/tile';\nimport type {LineStyleLayer} from '../../style/style_layer/line_style_layer';\nimport type {Painter} from '../../render/painter';\nimport type {CrossfadeParameters} from '../../style/evaluation_parameters';\n\nexport type LineUniformsType = {\n    'u_translation': Uniform2f;\n    'u_ratio': Uniform1f;\n    'u_device_pixel_ratio': Uniform1f;\n    'u_units_to_pixels': Uniform2f;\n};\n\nexport type LineGradientUniformsType = {\n    'u_translation': Uniform2f;\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_translation': Uniform2f;\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_translation': Uniform2f;\n    'u_ratio': Uniform1f;\n    'u_device_pixel_ratio': Uniform1f;\n    'u_units_to_pixels': Uniform2f;\n    'u_tileratio': Uniform1f;\n    'u_crossfade_from': Uniform1f;\n    'u_crossfade_to': Uniform1f;\n    'u_image': Uniform1i;\n    'u_mix': Uniform1f;\n    'u_lineatlas_width': Uniform1f;\n    'u_lineatlas_height': Uniform1f;\n};\n\nexport type LineGradientSDFUniformsType = {\n    'u_translation': Uniform2f;\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    'u_tileratio': Uniform1f;\n    'u_crossfade_from': Uniform1f;\n    'u_crossfade_to': Uniform1f;\n    'u_image_dash': Uniform1i;\n    'u_mix': Uniform1f;\n    'u_lineatlas_width': Uniform1f;\n    'u_lineatlas_height': Uniform1f;\n};\n\nconst lineUniforms = (context: Context, locations: UniformLocations): LineUniformsType => ({\n    'u_translation': new Uniform2f(context, locations.u_translation),\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_translation': new Uniform2f(context, locations.u_translation),\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_translation': new Uniform2f(context, locations.u_translation),\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_translation': new Uniform2f(context, locations.u_translation),\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_mix': new Uniform1f(context, locations.u_mix),\n    'u_tileratio': new Uniform1f(context, locations.u_tileratio),\n    'u_crossfade_from': new Uniform1f(context, locations.u_crossfade_from),\n    'u_crossfade_to': new Uniform1f(context, locations.u_crossfade_to),\n    'u_lineatlas_width': new Uniform1f(context, locations.u_lineatlas_width),\n    'u_lineatlas_height': new Uniform1f(context, locations.u_lineatlas_height)\n});\n\nconst lineGradientSDFUniforms = (context: Context, locations: UniformLocations): LineGradientSDFUniformsType => ({\n    'u_translation': new Uniform2f(context, locations.u_translation),\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    'u_tileratio': new Uniform1f(context, locations.u_tileratio),\n    'u_crossfade_from': new Uniform1f(context, locations.u_crossfade_from),\n    'u_crossfade_to': new Uniform1f(context, locations.u_crossfade_to),\n    'u_image_dash': new Uniform1i(context, locations.u_image_dash),\n    'u_mix': new Uniform1f(context, locations.u_mix),\n    'u_lineatlas_width': new Uniform1f(context, locations.u_lineatlas_width),\n    'u_lineatlas_height': new Uniform1f(context, locations.u_lineatlas_height)\n});\n\nconst lineUniformValues = (\n    painter: Painter,\n    tile: Tile,\n    layer: LineStyleLayer,\n    ratioScale: number,\n): UniformValues<LineUniformsType> => {\n    const transform = painter.transform;\n\n    return {\n        'u_translation': calculateTranslation(painter, tile, layer),\n        'u_ratio': ratioScale / 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    ratioScale: number,\n    imageHeight: number,\n): UniformValues<LineGradientUniformsType> => {\n    return extend(lineUniformValues(painter, tile, layer, ratioScale), {\n        'u_image': 0,\n        'u_image_height': imageHeight,\n    });\n};\n\nconst linePatternUniformValues = (\n    painter: Painter,\n    tile: Tile,\n    layer: LineStyleLayer,\n    ratioScale: number,\n    crossfade: CrossfadeParameters,\n): UniformValues<LinePatternUniformsType> => {\n    const transform = painter.transform;\n    const tileZoomRatio = calculateTileRatio(tile, transform);\n    return {\n        'u_translation': calculateTranslation(painter, tile, layer),\n        'u_texsize': tile.imageAtlasTexture.size,\n        // camera zoom ratio\n        'u_ratio': ratioScale / 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    ratioScale: number,\n    crossfade: CrossfadeParameters,\n): UniformValues<LineSDFUniformsType> => {\n    const transform = painter.transform;\n    const tileRatio = calculateTileRatio(tile, transform);\n\n    return extend(lineUniformValues(painter, tile, layer, ratioScale), {\n        'u_tileratio': tileRatio,\n        'u_crossfade_from': crossfade.fromScale,\n        'u_crossfade_to': crossfade.toScale,\n        'u_image': 0,\n        'u_mix': crossfade.t,\n        'u_lineatlas_width': painter.lineAtlas.width,\n        'u_lineatlas_height': painter.lineAtlas.height,\n    });\n};\n\nconst lineGradientSDFUniformValues = (\n    painter: Painter,\n    tile: Tile,\n    layer: LineStyleLayer,\n    ratioScale: number,\n    crossfade: CrossfadeParameters,\n    imageHeight: number,\n): UniformValues<LineGradientSDFUniformsType> => {\n    const transform = painter.transform;\n    const tileRatio = calculateTileRatio(tile, transform);\n\n    return extend(lineUniformValues(painter, tile, layer, ratioScale), {\n        'u_image': 0,\n        'u_image_height': imageHeight,\n        'u_tileratio': tileRatio,\n        'u_crossfade_from': crossfade.fromScale,\n        'u_crossfade_to': crossfade.toScale,\n        'u_image_dash': 1,\n        'u_mix': crossfade.t,\n        'u_lineatlas_width': painter.lineAtlas.width,\n        'u_lineatlas_height': painter.lineAtlas.height,\n    });\n};\n\nfunction calculateTileRatio(tile: Tile, transform: IReadonlyTransform) {\n    return 1 / pixelsToTileUnits(tile, 1, transform.tileZoom);\n}\n\nfunction calculateTranslation(painter: Painter, tile: Tile, layer: LineStyleLayer): [number, number] {\n    // Translate line points prior to any transformation\n    return translatePosition(\n        painter.transform,\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    lineGradientSDFUniforms,\n    lineUniformValues,\n    lineGradientUniformValues,\n    linePatternUniformValues,\n    lineSDFUniformValues,\n    lineGradientSDFUniformValues\n};\n", "import {Uniform1i, Uniform1f, Uniform2f, Uniform3f, Uniform4f} from '../uniform_binding';\n\nimport type {Context} from '../../webgl/context';\nimport type {UniformValues, UniformLocations} from '../uniform_binding';\nimport type {RasterStyleLayer} from '../../style/style_layer/raster_style_layer';\nimport type Point from '@mapbox/point-geometry';\n\nexport type RasterUniformsType = {\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    'u_coords_top': Uniform4f;\n    'u_coords_bottom': Uniform4f;\n};\n\nconst rasterUniforms = (context: Context, locations: UniformLocations): RasterUniformsType => ({\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    'u_coords_top': new Uniform4f(context, locations.u_coords_top),\n    'u_coords_bottom': new Uniform4f(context, locations.u_coords_bottom)\n});\n\nconst rasterUniformValues = (\n    parentTL: [number, number],\n    parentScaleBy: number,\n    fade: {\n        mix: number;\n        opacity: number;\n    },\n    layer: RasterStyleLayer,\n    cornerCoords: Point[],\n): UniformValues<RasterUniformsType> => ({\n    'u_tl_parent': parentTL,\n    'u_scale_parent': parentScaleBy,\n    // If u_buffer_scale is ever something else than a constant 1,\n    // the north/south pole handling in the vertex shader might need modification\n    // so that the texture coordinares for poles always lie beyond the edge of the texture.\n    // Right now the coordinates are placed right at the texture border.\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    'u_coords_top': [cornerCoords[0].x, cornerCoords[0].y, cornerCoords[1].x, cornerCoords[1].y],\n    'u_coords_bottom': [cornerCoords[3].x, cornerCoords[3].y, cornerCoords[2].x, cornerCoords[2].y]\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 '../../webgl/context';\nimport type {Painter} from '../../render/painter';\nimport type {UniformValues, UniformLocations} from '../uniform_binding';\nimport {type 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_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_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_is_plain': 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_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_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_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_is_plain': new Uniform1i(context, locations.u_is_plain),\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_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    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_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    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, labelPlaneMatrix,\n        glCoordMatrix, translation, isText, texSize, pitchedScale), {\n        'u_gamma_scale': (pitchWithMap ? Math.cos(transform.pitch * Math.PI / 180.0) * transform.cameraToCenterDistance : 1),\n        'u_device_pixel_ratio': painter.pixelRatio,\n        'u_is_halo': isHalo ? 1 : 0,\n        'u_is_plain': 1\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    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, 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} from '../uniform_binding';\nimport {extend} from '../../util/util';\n\nimport type {Painter} from '../../render/painter';\nimport type {UniformValues, UniformLocations} from '../uniform_binding';\nimport type {Context} from '../../webgl/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 '../../tile/tile_id';\n\nexport type BackgroundUniformsType = {\n    'u_opacity': Uniform1f;\n    'u_color': UniformColor;\n};\n\nexport type BackgroundPatternUniformsType = {\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_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_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 = (opacity: number, color: Color): UniformValues<BackgroundUniformsType> => ({\n    'u_opacity': opacity,\n    'u_color': color\n});\n\nconst backgroundPatternUniformValues = (\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_opacity': opacity\n    }\n);\n\nexport {\n    backgroundUniforms,\n    backgroundPatternUniforms,\n    backgroundUniformValues,\n    backgroundPatternUniformValues\n};\n", "import {fillExtrusionUniforms, fillExtrusionPatternUniforms} from './fill_extrusion_program';\nimport {fillPatternUniforms, fillOutlineUniforms, fillOutlinePatternUniforms, fillUniforms} from './fill_program';\nimport {circleUniforms} from './circle_program';\nimport {collisionUniforms, collisionCircleUniforms} from './collision_program';\nimport {debugUniforms} from './debug_program';\nimport {heatmapUniforms, heatmapTextureUniforms} from './heatmap_program';\nimport {hillshadeUniforms, hillshadePrepareUniforms} from './hillshade_program';\nimport {colorReliefUniforms} from './color_relief_program';\nimport {lineUniforms, lineGradientUniforms, linePatternUniforms, lineSDFUniforms, lineGradientSDFUniforms} 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 {projectionErrorMeasurementUniforms} from './projection_error_measurement_program';\nimport {atmosphereUniforms} from './atmosphere_program';\nimport {skyUniforms} from './sky_program';\n\nconst emptyUniforms = (_: any, __: any): any => {};\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    depth: emptyUniforms,\n    clippingMask: emptyUniforms,\n    heatmap: heatmapUniforms,\n    heatmapTexture: heatmapTextureUniforms,\n    hillshade: hillshadeUniforms,\n    hillshadePrepare: hillshadePrepareUniforms,\n    colorRelief: colorReliefUniforms,\n    line: lineUniforms,\n    lineGradient: lineGradientUniforms,\n    linePattern: linePatternUniforms,\n    lineSDF: lineSDFUniforms,\n    lineGradientSDF: lineGradientSDFUniforms,\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    projectionErrorMeasurement: projectionErrorMeasurementUniforms,\n    atmosphere: atmosphereUniforms,\n    sky: skyUniforms\n};\n", "import type {Context} from '../../webgl/context';\nimport {type UniformValues, type UniformLocations, Uniform1f, Uniform3f, UniformMatrix4f} from '../uniform_binding';\nimport {type mat4, type vec3} from 'gl-matrix';\n\nexport type atmosphereUniformsType = {\n    'u_sun_pos': Uniform3f;\n    'u_atmosphere_blend': Uniform1f;\n    'u_globe_position': Uniform3f;\n    'u_globe_radius': Uniform1f;\n    'u_inv_proj_matrix': UniformMatrix4f;\n};\n\nconst atmosphereUniforms = (context: Context, locations: UniformLocations): atmosphereUniformsType => ({\n    'u_sun_pos': new Uniform3f(context, locations.u_sun_pos),\n    'u_atmosphere_blend': new Uniform1f(context, locations.u_atmosphere_blend),\n    'u_globe_position': new Uniform3f(context, locations.u_globe_position),\n    'u_globe_radius': new Uniform1f(context, locations.u_globe_radius),\n    'u_inv_proj_matrix': new UniformMatrix4f(context, locations.u_inv_proj_matrix),\n});\n\nconst atmosphereUniformValues = (\n    sunPos: vec3,\n    atmosphereBlend: number,\n    globePosition: vec3,\n    globeRadius: number,\n    invProjMatrix: mat4,\n): UniformValues<atmosphereUniformsType> => ({\n    'u_sun_pos': sunPos,\n    'u_atmosphere_blend': atmosphereBlend,\n    'u_globe_position': globePosition,\n    'u_globe_radius': globeRadius,\n    'u_inv_proj_matrix': invProjMatrix,\n});\n\nexport {atmosphereUniforms, atmosphereUniformValues};\n", "import {UniformColor, Uniform1f, Uniform2f} from '../uniform_binding';\nimport type {Context} from '../../webgl/context';\nimport type {UniformValues, UniformLocations} from '../uniform_binding';\nimport {type IReadonlyTransform} from '../../geo/transform_interface';\nimport {type Sky} from '../../style/sky';\nimport {getMercatorHorizon} from '../../geo/projection/mercator_utils';\n\nexport type SkyUniformsType = {\n    'u_sky_color': UniformColor;\n    'u_horizon_color': UniformColor;\n    'u_horizon': Uniform2f;\n    'u_horizon_normal': Uniform2f;\n    'u_sky_horizon_blend': Uniform1f;\n    'u_sky_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 Uniform2f(context, locations.u_horizon),\n    'u_horizon_normal': new Uniform2f(context, locations.u_horizon_normal),\n    'u_sky_horizon_blend': new Uniform1f(context, locations.u_sky_horizon_blend),\n    'u_sky_blend': new Uniform1f(context, locations.u_sky_blend),\n});\n\nconst skyUniformValues = (sky: Sky, transform: IReadonlyTransform, pixelRatio: number): UniformValues<SkyUniformsType> => {\n    const cosRoll = Math.cos(transform.rollInRadians);\n    const sinRoll = Math.sin(transform.rollInRadians);\n    const mercatorHorizon  = getMercatorHorizon(transform);\n    const projectionData = transform.getProjectionData({overscaledTileID: null, applyGlobeMatrix: true, applyTerrainMatrix: true});\n    const skyBlend = projectionData.projectionTransition;\n    return {\n        'u_sky_color': sky.properties.get('sky-color'),\n        'u_horizon_color': sky.properties.get('horizon-color'),\n        'u_horizon': [(transform.width / 2 - mercatorHorizon * sinRoll)  * pixelRatio,\n            (transform.height / 2 + mercatorHorizon * cosRoll) * pixelRatio],\n        'u_horizon_normal': [-sinRoll, cosRoll],\n        'u_sky_horizon_blend': (sky.properties.get('sky-horizon-blend') * transform.height / 2) * pixelRatio,\n        'u_sky_blend': skyBlend,\n    };\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 './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            array.freeBufferAfterUpload();\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 './program';\nimport type {Context} from './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: readonly 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: readonly 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            array.freeBufferAfterUpload();\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 (const member of this.attributes) {\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 (const member of this.attributes) {\n            const attribIndex: number | void = program.attributes[member.name];\n\n            if (attribIndex !== undefined) {\n                gl.vertexAttribPointer(\n                    attribIndex,\n                    member.components,\n                    gl[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", "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", "/**\n * Error message to use when framebuffer is incomplete\n */\nexport const FRAMEBUFFER_NOT_COMPLETE_ERROR = 'Framebuffer is not complete';\n\n/**\n * Check if an error is a framebuffer not complete error\n * @param error - An error object\n * @returns - true if the error is a framebuffer not complete error\n */\nexport function isFramebufferNotCompleteError(error: Error): boolean {\n    return error.message === FRAMEBUFFER_NOT_COMPLETE_ERROR;\n}\n\n/**\n * Use this when you need to create a framebuffer not complete error.\n * @returns An error object with the message \"Framebuffer is not complete\"\n */\nexport function createFramebufferNotCompleteError(): Error {\n    return new Error(FRAMEBUFFER_NOT_COMPLETE_ERROR);\n}\n", "import {ColorAttachment, DepthAttachment, DepthStencilAttachment} from './value';\n\nimport type {Context} from './context';\nimport {createFramebufferNotCompleteError} from '../util/framebuffer_error';\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 createFramebufferNotCompleteError();\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 {IndexBuffer} from './index_buffer';\n\nimport {VertexBuffer} from './vertex_buffer';\nimport {Framebuffer} from './framebuffer';\nimport {type DepthMode} from './depth_mode';\nimport {type StencilMode} from './stencil_mode';\nimport {ColorMode} from './color_mode';\nimport {type 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 abstraction\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    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 = gl.getExtension('EXT_texture_filter_anisotropic');\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: readonly 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            this.gl.deleteVertexArray(x);\n            return;\n        }\n        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 {Painter} from '../../render/painter';\nimport type {TileManager} from '../../tile/tile_manager';\nimport type {StyleLayer} from '../../style/style_layer';\nimport type {OverscaledTileID} from '../../tile/tile_id';\nimport type {SymbolBucket} from '../../data/bucket/symbol_bucket';\nimport {DepthMode} from '../depth_mode';\nimport {StencilMode} from '../stencil_mode';\nimport {CullFaceMode} from '../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 {type VertexBuffer} from '../vertex_buffer';\nimport {type IndexBuffer} from '../index_buffer';\n\ntype TileBatch = {\n    circleArray: number[];\n    circleOffset: number;\n    coord: OverscaledTileID;\n};\n\nlet quadTriangles: QuadTriangleArray;\n\nexport function drawCollisionDebug(painter: Painter, tileManager: TileManager, layer: StyleLayer, coords: OverscaledTileID[], isText: boolean) {\n    const context = painter.context;\n    const transform = painter.transform;\n    const gl = context.gl;\n    const program = painter.useProgram('collisionBox');\n    const tileBatches: TileBatch[] = [];\n    let circleCount = 0;\n    let circleOffset = 0;\n\n    for (const coord of coords) {\n        const tile = tileManager.getTile(coord);\n        const bucket: SymbolBucket = (tile.getBucket(layer) as any);\n        if (!bucket) {\n            continue;\n        }\n        const buffers = isText ? bucket.textCollisionBox : bucket.iconCollisionBox;\n        // Get collision circle data of this bucket\n        const circleArray: number[] = bucket.collisionCircleArray;\n        if (circleArray.length > 0) {\n            tileBatches.push({\n                circleArray,\n                circleOffset,\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),\n            painter.style.map.terrain?.getTerrainData(coord),\n            transform.getProjectionData({overscaledTileID: coord, applyGlobeMatrix: true, applyTerrainMatrix: true}),\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(painter.transform);\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?.getTerrainData(batch.coord),\n            null,\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 {type EvaluatedZoomSize, evaluateSizeForFeature, evaluateSizeForZoom} from '../../symbol/symbol_size';\nimport {mat4} from 'gl-matrix';\nimport {StencilMode} from '../stencil_mode';\nimport {DepthMode} from '../depth_mode';\nimport {CullFaceMode} from '../cull_face_mode';\nimport {addDynamicAttributes} from '../../data/bucket/symbol_bucket';\nimport {fastInvertTransformMat4} from '../../util/fast_maths';\nimport {getAnchorAlignment, WritingMode} from '../../symbol/shaping';\nimport ONE_EM from '../../symbol/one_em';\n\nimport {\n    type SymbolIconUniformsType,\n    symbolIconUniformValues,\n    symbolSDFUniformValues,\n    symbolTextAndIconUniformValues\n} from '../program/symbol_program';\n\nimport type {Painter, RenderOptions} from '../../render/painter';\nimport type {TileManager} from '../../tile/tile_manager';\nimport type {SymbolStyleLayer} from '../../style/style_layer/symbol_style_layer';\n\nimport type {Texture, TextureFilter} from '../texture';\nimport type {OverscaledTileID, UnwrappedTileID} from '../../tile/tile_id';\nimport type {UniformValues} from '../uniform_binding';\nimport type {SymbolSDFUniformsType} from '../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 {IReadonlyTransform} from '../../geo/transform_interface';\nimport type {ColorMode} from '../color_mode';\nimport type {Program} from '../program';\nimport type {TextAnchor} from '../../style/style_layer/variable_text_anchor';\nimport {getGlCoordMatrix, getPerspectiveRatio, getPitchedLabelPlaneMatrix, hideGlyphs, projectWithMatrix, projectTileCoordinatesToClipSpace, projectTileCoordinatesToLabelPlane, type SymbolProjectionContext, updateLineLabels} from '../../symbol/projection';\nimport {translatePosition} from '../../util/util';\nimport type {ProjectionData} from '../../geo/projection/projection_data';\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        projectionData: ProjectionData;\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, tileManager: TileManager, layer: SymbolStyleLayer, coords: OverscaledTileID[], variableOffsets: {\n    [_ in CrossTileID]: VariableOffset;\n}, renderOptions: RenderOptions) {\n    if (painter.renderPass !== 'translucent') return;\n\n    const {isRenderingToTexture} = renderOptions;\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, tileManager,\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, tileManager, 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, isRenderingToTexture\n        );\n    }\n\n    if (layer.paint.get('text-opacity').constantOr(1) !== 0) {\n        drawLayerSymbols(painter, tileManager, 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, isRenderingToTexture\n        );\n    }\n\n    if (tileManager.map.showCollisionBoxes) {\n        drawCollisionDebug(painter, tileManager, layer, coords, true);\n        drawCollisionDebug(painter, tileManager, 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: OverscaledTileID[],\n    painter: Painter,\n    layer:SymbolStyleLayer, tileManager: TileManager,\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 terrain = painter.style.map.terrain;\n    const rotateWithMap = rotationAlignment === 'map';\n    const pitchWithMap = pitchAlignment === 'map';\n\n    for (const coord of coords) {\n        const tile = tileManager.getTile(coord);\n        const bucket = tile.getBucket(layer) as SymbolBucket;\n        if (!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 pitchedLabelPlaneMatrix = getPitchedLabelPlaneMatrix(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 = terrain ? (x: number, y: number) => terrain.getElevation(coord, x, y) : null;\n            const translation = translatePosition(transform, tile, translate, translateAnchor);\n            updateVariableAnchorsForBucket(bucket, rotateWithMap, pitchWithMap, variableOffsets,\n                transform, pitchedLabelPlaneMatrix, tileScale, size, updateTextFitIcon, translation, coord.toUnwrapped(), getElevation);\n        }\n    }\n}\n\nfunction getShiftedAnchor(projectedAnchorPoint: Point, projectionContext: 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 projectWithMatrix(tileAnchorShifted.x, tileAnchorShifted.y, projectionContext.pitchedLabelPlaneMatrix, 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            // Note that the label plane must be screen pixels here.\n            const projectedAnchorRight = projectTileCoordinatesToLabelPlane(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: IReadonlyTransform,\n    pitchedLabelPlaneMatrix: mat4,\n    tileScale: number,\n    size: EvaluatedZoomSize,\n    updateTextFitIcon: boolean,\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            hideGlyphs(symbol.numGlyphs, dynamicTextLayoutVertexArray);\n        } else  {\n            const tileAnchor = new Point(symbol.anchorX, symbol.anchorY);\n            const projectionContext: SymbolProjectionContext = {\n                getElevation,\n                width: transform.width,\n                height: transform.height,\n                pitchedLabelPlaneMatrix,\n                lineVertexArray: null,\n                pitchWithMap,\n                transform,\n                projectionCache: null,\n                tileAnchorPoint: tileAnchor,\n                translation,\n                unwrappedTileID\n            };\n            const projectedAnchor = pitchWithMap ?\n                projectTileCoordinatesToClipSpace(tileAnchor.x, tileAnchor.y, projectionContext) :\n                projectTileCoordinatesToLabelPlane(tileAnchor.x, tileAnchor.y, projectionContext);\n            const perspectiveRatio = 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 = transform.getPitchedTextCorrection(tileAnchor.x + translation[0], tileAnchor.y + translation[1], unwrappedTileID);\n            const shiftedAnchor = getShiftedAnchor(projectedAnchor.point, projectionContext, rotateWithMap, shift, -transform.bearingInRadians, 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                hideGlyphs(placedIcon.numGlyphs, dynamicIconLayoutVertexArray);\n            } else {\n                const shift = placedTextShifts[i];\n                if (!shift) {\n                    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    tileManager: TileManager,\n    layer: SymbolStyleLayer,\n    coords: 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    isRenderingToTexture: boolean) {\n\n    const context = painter.context;\n    const gl = context.gl;\n    const transform = painter.transform;\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 pitchedLabelPlaneMatrix projection\n    // Unpitched point labels need to have their rotation applied after projection\n    const rotateInShader = rotateWithMap && !pitchWithMap && !alongLine;\n\n    const hasSortKey = !layer.layout.get('symbol-sort-key').isConstant();\n    let sortFeaturesByKey = false;\n\n    const depthMode = painter.getDepthModeForSublayer(0, DepthMode.ReadOnly);\n\n    const hasVariablePlacement = layer._unevaluatedLayout.hasValue('text-variable-anchor') || layer._unevaluatedLayout.hasValue('text-variable-anchor-offset');\n\n    const tileRenderState: SymbolTileRenderState[] = [];\n\n    const pitchedTextRescaling = transform.getCircleRadiusCorrection();\n\n    for (const coord of coords) {\n        const tile = tileManager.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?.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 || transform.pitch !== 0;\n\n        const program = painter.useProgram(getSymbolProgramName(isSDF, isText, bucket), programConfiguration);\n        const size = evaluateSizeForZoom(sizeData, transform.zoom);\n        const terrainData = 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        // See the comment at the beginning of src/symbol/projection.ts for an overview of the symbol projection process\n        const s = pixelsToTileUnits(tile, 1, painter.transform.zoom);\n        const pitchedLabelPlaneMatrix = getPitchedLabelPlaneMatrix(rotateWithMap, painter.transform, s);\n        const glCoordMatrixForShader = getGlCoordMatrix(pitchWithMap, rotateWithMap, painter.transform, s);\n\n        const translation = translatePosition(transform, tile, translate, translateAnchor);\n        const projectionData = transform.getProjectionData({overscaledTileID: coord, applyGlobeMatrix: !isRenderingToTexture, applyTerrainMatrix: true});\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 pitchedLabelPlaneMatrixInverse = mat4.create();\n            fastInvertTransformMat4(pitchedLabelPlaneMatrixInverse, pitchedLabelPlaneMatrix);\n\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            updateLineLabels(bucket, painter, isText, pitchedLabelPlaneMatrix, pitchedLabelPlaneMatrixInverse, pitchWithMap, keepUpright, rotateToLine, coord.toUnwrapped(), transform.width, transform.height, translation, getElevation);\n        }\n\n        const shaderVariableAnchor = (isText && hasVariablePlacement) || updateTextFitIcon;\n\n        // If the label plane matrix is used, it transforms either map-pitch-aligned pixels, or to screenspace pixels\n        const combinedLabelPlaneMatrix = pitchWithMap ? pitchedLabelPlaneMatrix : painter.transform.clipSpaceToPixelsMatrix;\n        // Label plane matrix is unused in the shader if variable anchors are used or the text is placed along a line\n        const noLabelPlane = (alongLine || shaderVariableAnchor);\n        const uLabelPlaneMatrix = noLabelPlane ? identityMat4 : combinedLabelPlaneMatrix;\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,\n                    uLabelPlaneMatrix, glCoordMatrixForShader, translation, isText, texSize, hasHalo, pitchedTextRescaling);\n            } else {\n                uniformValues = symbolTextAndIconUniformValues(sizeData.kind,\n                    size, rotateInShader, pitchWithMap, alongLine, shaderVariableAnchor, painter,\n                    uLabelPlaneMatrix, glCoordMatrixForShader, translation, texSize, texSizeIcon, pitchedTextRescaling);\n            }\n        } else {\n            uniformValues = symbolIconUniformValues(sizeData.kind,\n                size, rotateInShader, pitchWithMap, alongLine, shaderVariableAnchor, painter,\n                uLabelPlaneMatrix, glCoordMatrixForShader, translation, isText, texSize, pitchedTextRescaling);\n        }\n\n        const state = {\n            program,\n            buffers,\n            uniformValues,\n            projectionData,\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    const haloWidthProperty = layer.paint.get(isText ? 'text-halo-width' : 'icon-halo-width');\n    const haloWidth = haloWidthProperty.constantOr(null) ?? Infinity;\n    const isGlyphOverlap = layer.layout.get('text-letter-spacing').constantOr(0) * ONE_EM < 0 || haloWidth > 1;\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        const isHalo = state.isSDF && state.hasHalo;\n        if (isHalo) {\n            const uniformValues = state.uniformValues;\n            uniformValues['u_is_halo'] = 1;\n            if (isGlyphOverlap){\n                // render halo in 2 pass (1 for the halo only, 1 for the text only)\n                uniformValues['u_is_plain'] = 0;\n                drawSymbolElements(state.buffers, segmentState.segments, layer, painter, state.program, depthMode, stencilMode, colorMode, uniformValues, state.projectionData, segmentState.terrainData);\n                uniformValues['u_is_halo'] = 0;\n                uniformValues['u_is_plain'] = 1;\n            }\n        }\n\n        drawSymbolElements(state.buffers, segmentState.segments, layer, painter, state.program, depthMode, stencilMode, colorMode, state.uniformValues, state.projectionData, segmentState.terrainData);\n\n        if (isHalo && !isGlyphOverlap) {\n            // for 1 pass halo rendering, restore the uniforms state\n            state.uniformValues['u_is_halo'] = 0;\n        }\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    projectionData: ProjectionData,\n    terrainData: TerrainData) {\n    const context = painter.context;\n    const gl = context.gl;\n    program.draw(context, gl.TRIANGLES, depthMode, stencilMode, colorMode, CullFaceMode.backCCW,\n        uniformValues, terrainData, projectionData, 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 '../depth_mode';\nimport {StencilMode} from '../stencil_mode';\nimport {ColorMode} from '../color_mode';\nimport {CullFaceMode} from '../cull_face_mode';\nimport {type Context} from '../context';\nimport {type Framebuffer} from '../framebuffer';\nimport {type Tile} from '../../tile/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, RenderOptions} from '../../render/painter';\nimport type {TileManager} from '../../tile/tile_manager';\nimport type {HeatmapStyleLayer} from '../../style/style_layer/heatmap_style_layer';\nimport type {HeatmapBucket} from '../../data/bucket/heatmap_bucket';\nimport type {OverscaledTileID} from '../../tile/tile_id';\n\nexport function drawHeatmap(painter: Painter, tileManager: TileManager, layer: HeatmapStyleLayer, tileIDs: OverscaledTileID[], renderOptions: RenderOptions) {\n    if (layer.paint.get('heatmap-opacity') === 0) {\n        return;\n    }\n    const context = painter.context;\n    const {isRenderingToTexture, isRenderingGlobe} = renderOptions;\n\n    if (painter.style.map.terrain) {\n        for (const coord of tileIDs) {\n            const tile = tileManager.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 (tileManager.hasRenderableParent(coord)) continue;\n            if (painter.renderPass === 'offscreen') {\n                prepareHeatmapTerrain(painter, tile, layer, coord, isRenderingGlobe);\n            } else if (painter.renderPass === 'translucent') {\n                renderHeatmapTerrain(painter, layer, coord, isRenderingToTexture, isRenderingGlobe);\n            }\n        }\n        context.viewport.set([0, 0, painter.width, painter.height]);\n    } else {\n        if (painter.renderPass === 'offscreen') {\n            prepareHeatmapFlat(painter, tileManager, layer, tileIDs);\n        } else if (painter.renderPass === 'translucent') {\n            renderHeatmapFlat(painter, layer);\n        }\n\n    }\n}\n\nfunction prepareHeatmapFlat(painter: Painter, tileManager: TileManager, layer: HeatmapStyleLayer, coords: OverscaledTileID[]) {\n    const context = painter.context;\n    const gl = context.gl;\n    const transform = painter.transform;\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 (const coord of coords) {\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 (tileManager.hasRenderableParent(coord)) continue;\n\n        const tile = tileManager.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\n        const projectionData = transform.getProjectionData({overscaledTileID: coord, applyGlobeMatrix: true, applyTerrainMatrix: false});\n\n        const radiusCorrectionFactor = transform.getCircleRadiusCorrection();\n\n        program.draw(context, gl.TRIANGLES, DepthMode.disabled, stencilMode, colorMode, CullFaceMode.backCCW,\n            heatmapUniformValues(tile, transform.zoom, layer.paint.get('heatmap-intensity'), radiusCorrectionFactor),\n            null, projectionData,\n            layer.id, bucket.layoutVertexBuffer, bucket.indexBuffer,\n            bucket.segments, layer.paint, 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, 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, isRenderingGlobe: boolean) {\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, !isRenderingGlobe);\n\n    const projectionData = painter.transform.getProjectionData({overscaledTileID: tile.tileID, applyGlobeMatrix: true, applyTerrainMatrix: true});\n\n    const terrainData = painter.style.map.terrain.getTerrainData(coord);\n    program.draw(context, gl.TRIANGLES, DepthMode.disabled, stencilMode, colorMode, CullFaceMode.disabled,\n        heatmapUniformValues(tile, painter.transform.zoom, layer.paint.get('heatmap-intensity'), 1.0), terrainData, projectionData,\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, isRenderingToTexture: boolean, isRenderingGlobe: boolean) {\n    const context = painter.context;\n    const gl = context.gl;\n    const transform = painter.transform;\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    const projectionData = transform.getProjectionData({overscaledTileID: coord, applyTerrainMatrix: isRenderingGlobe, applyGlobeMatrix: !isRenderingToTexture});\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, projectionData,\n        layer.id, painter.rasterBoundsBuffer, painter.quadTriangleIndexBuffer,\n        painter.rasterBoundsSegments, layer.paint, 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    layer.colorRampTexture ||= new Texture(context, layer.colorRamp, context.gl.RGBA);\n    return layer.colorRampTexture;\n}\n", "import {DepthMode} from '../depth_mode';\nimport {CullFaceMode} from '../cull_face_mode';\nimport {Texture} from '../texture';\nimport {\n    lineUniformValues,\n    linePatternUniformValues,\n    lineSDFUniformValues,\n    lineGradientUniformValues,\n    lineGradientSDFUniformValues\n} from '../program/line_program';\n\nimport type {Painter, RenderOptions} from '../../render/painter';\nimport type {TileManager} from '../../tile/tile_manager';\nimport type {LineStyleLayer} from '../../style/style_layer/line_style_layer';\nimport type {LineBucket} from '../../data/bucket/line_bucket';\nimport type {OverscaledTileID} from '../../tile/tile_id';\nimport type {Tile} from '../../tile/tile';\nimport type {Context} from '../context';\nimport type {ProgramConfiguration} from '../../data/program_configuration';\nimport {clamp, nextPowerOfTwo} from '../../util/util';\nimport {renderColorRamp} from '../../util/color_ramp';\nimport {EXTENT} from '../../data/extent';\nimport type {RGBAImage} from '../../util/image';\n\ntype GradientTexture = {\n    texture?: Texture;\n    gradient?: RGBAImage;\n    version?: number;\n};\n\nfunction updateGradientTexture(\n    painter: Painter,\n    tileManager: TileManager,\n    context: Context,\n    gl: WebGLRenderingContext,\n    layer: LineStyleLayer,\n    bucket: LineBucket,\n    coord: OverscaledTileID,\n    layerGradient: GradientTexture\n): Texture {\n    let textureResolution = 256;\n    if (layer.stepInterpolant) {\n        const sourceMaxZoom = tileManager.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    return layerGradient.texture;\n}\n\nfunction bindImagePatternTextures(\n    context: Context,\n    gl: WebGLRenderingContext,\n    tile: Tile,\n    programConfiguration: ProgramConfiguration,\n    crossfade: ReturnType<LineStyleLayer['getCrossfadeParameters']>\n) {\n    context.activeTexture.set(gl.TEXTURE0);\n    tile.imageAtlasTexture.bind(gl.LINEAR, gl.CLAMP_TO_EDGE);\n    programConfiguration.updatePaintBuffers(crossfade);\n}\n\nfunction bindDasharrayTextures(\n    painter: Painter,\n    context: Context,\n    gl: WebGLRenderingContext,\n    programConfiguration: ProgramConfiguration,\n    programChanged: boolean,\n    crossfade: ReturnType<LineStyleLayer['getCrossfadeParameters']>\n) {\n    if (programChanged || painter.lineAtlas.dirty) {\n        context.activeTexture.set(gl.TEXTURE0);\n        painter.lineAtlas.bind(context);\n    }\n    programConfiguration.updatePaintBuffers(crossfade);\n}\n\nfunction bindGradientTextures(\n    painter: Painter,\n    tileManager: TileManager,\n    context: Context,\n    gl: WebGLRenderingContext,\n    layer: LineStyleLayer,\n    bucket: LineBucket,\n    coord: OverscaledTileID\n) {\n    const layerGradient = bucket.gradients[layer.id];\n    let gradientTexture = layerGradient.texture;\n    if (layer.gradientVersion !== layerGradient.version) {\n        gradientTexture = updateGradientTexture(painter, tileManager, context, gl, layer, bucket, coord, layerGradient);\n    }\n    context.activeTexture.set(gl.TEXTURE0);\n    gradientTexture.bind(layer.stepInterpolant ? gl.NEAREST : gl.LINEAR, gl.CLAMP_TO_EDGE);\n}\n\nfunction bindGradientAndDashTextures(\n    painter: Painter,\n    tileManager: TileManager,\n    context: Context,\n    gl: WebGLRenderingContext,\n    layer: LineStyleLayer,\n    bucket: LineBucket,\n    coord: OverscaledTileID,\n    programConfiguration: ProgramConfiguration,\n    crossfade: ReturnType<LineStyleLayer['getCrossfadeParameters']>\n) {\n    // Bind gradient texture to TEXTURE0\n    const layerGradient = bucket.gradients[layer.id];\n    let gradientTexture = layerGradient.texture;\n    if (layer.gradientVersion !== layerGradient.version) {\n        gradientTexture = updateGradientTexture(painter, tileManager, context, gl, layer, bucket, coord, layerGradient);\n    }\n    context.activeTexture.set(gl.TEXTURE0);\n    gradientTexture.bind(layer.stepInterpolant ? gl.NEAREST : gl.LINEAR, gl.CLAMP_TO_EDGE);\n\n    // Bind dash atlas to TEXTURE1\n    context.activeTexture.set(gl.TEXTURE1);\n    painter.lineAtlas.bind(context);\n\n    programConfiguration.updatePaintBuffers(crossfade);\n}\n\nexport function drawLine(painter: Painter, tileManager: TileManager, layer: LineStyleLayer, coords: OverscaledTileID[], renderOptions: RenderOptions) {\n    if (painter.renderPass !== 'translucent') return;\n\n    const {isRenderingToTexture} = renderOptions;\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.getDepthModeForSublayer(0, DepthMode.ReadOnly);\n    const colorMode = painter.colorModeForRenderPass();\n\n    const dasharrayProperty = layer.paint.get('line-dasharray');\n    const dasharray = dasharrayProperty.constantOr(1 as any);\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    let programId: string;\n    if (image) programId = 'linePattern';\n    else if (dasharray && gradient) programId = 'lineGradientSDF';\n    else if (dasharray) programId = 'lineSDF';\n    else if (gradient) programId = 'lineGradient';\n    else programId = 'line';\n\n    const context = painter.context;\n    const gl = context.gl;\n    const transform = painter.transform;\n\n    let firstTile = true;\n\n    for (const coord of coords) {\n        const tile = tileManager.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?.getTerrainData(coord);\n\n        const constantPattern = patternProperty.constantOr(null);\n        const constantDasharray = dasharrayProperty?.constantOr(null);\n\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        } else if (constantDasharray) {\n            const round = layer.layout.get('line-cap').constantOr(null) === 'round';\n            const dashTo = painter.lineAtlas.getDash(constantDasharray.to, round);\n            const dashFrom = painter.lineAtlas.getDash(constantDasharray.from, round);\n            programConfiguration.setConstantDashPositions(dashTo, dashFrom);\n        }\n\n        const projectionData = transform.getProjectionData({\n            overscaledTileID: coord,\n            applyGlobeMatrix: !isRenderingToTexture,\n            applyTerrainMatrix: true\n        });\n\n        const pixelRatio = transform.getPixelScale();\n\n        let uniformValues;\n        if (image) {\n            uniformValues = linePatternUniformValues(painter, tile, layer, pixelRatio, crossfade);\n            bindImagePatternTextures(context, gl, tile, programConfiguration, crossfade);\n        } else if (dasharray && gradient) {\n            uniformValues = lineGradientSDFUniformValues(painter, tile, layer, pixelRatio, crossfade, bucket.lineClipsArray.length);\n            bindGradientAndDashTextures(painter, tileManager, context, gl, layer, bucket, coord, programConfiguration, crossfade);\n        } else if (dasharray) {\n            uniformValues = lineSDFUniformValues(painter, tile, layer, pixelRatio, crossfade);\n            bindDasharrayTextures(painter, context, gl, programConfiguration, programChanged, crossfade);\n        } else if (gradient) {\n            uniformValues = lineGradientUniformValues(painter, tile, layer, pixelRatio, bucket.lineClipsArray.length);\n            bindGradientTextures(painter, tileManager, context, gl, layer, bucket, coord);\n        } else {\n            uniformValues = lineUniformValues(painter, tile, layer, pixelRatio);\n        }\n\n        const stencil = painter.stencilModeForClipping(coord);\n\n        program.draw(context, gl.TRIANGLES, depthMode,\n            stencil, colorMode, CullFaceMode.disabled, uniformValues, terrainData, projectionData,\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 type {CrossFaded} from '../style/properties';\nimport type {ResolvedImage} from '@maplibre/maplibre-gl-style-spec';\nimport type {Tile} from '../tile/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?.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 '../depth_mode';\nimport {CullFaceMode} from '../cull_face_mode';\nimport {type ColorMode} from '../color_mode';\nimport {\n    fillUniformValues,\n    fillPatternUniformValues,\n    fillOutlineUniformValues,\n    fillOutlinePatternUniformValues\n} from '../program/fill_program';\n\nimport type {Painter, RenderOptions} from '../../render/painter';\nimport type {TileManager} from '../../tile/tile_manager';\nimport type {FillStyleLayer} from '../../style/style_layer/fill_style_layer';\nimport type {FillBucket} from '../../data/bucket/fill_bucket';\nimport type {OverscaledTileID} from '../../tile/tile_id';\nimport {updatePatternPositionsInProgram} from '../../render/update_pattern_positions_in_program';\nimport {translatePosition} from '../../util/util';\n\nexport function drawFill(painter: Painter, tileManager: TileManager, layer: FillStyleLayer, coords: OverscaledTileID[], renderOptions: RenderOptions) {\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 {isRenderingToTexture} = renderOptions;\n    const colorMode = painter.colorModeForRenderPass();\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.getDepthModeForSublayer(\n            1, painter.renderPass === 'opaque' ? DepthMode.ReadWrite : DepthMode.ReadOnly);\n        drawFillTiles(painter, tileManager, layer, coords, depthMode, colorMode, false, isRenderingToTexture);\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.getDepthModeForSublayer(\n            layer.getPaintProperty('fill-outline-color') ? 2 : 0, DepthMode.ReadOnly);\n        drawFillTiles(painter, tileManager, layer, coords, depthMode, colorMode, true, isRenderingToTexture);\n    }\n}\n\nfunction drawFillTiles(\n    painter: Painter,\n    tileManager: TileManager,\n    layer: FillStyleLayer,\n    coords: OverscaledTileID[],\n    depthMode: Readonly<DepthMode>,\n    colorMode: Readonly<ColorMode>,\n    isOutline: boolean,\n    isRenderingToTexture: boolean) {\n    const gl = painter.context.gl;\n    const fillPropertyName = 'fill-pattern';\n    const patternProperty = layer.paint.get(fillPropertyName);\n    const image = patternProperty?.constantOr(1 as any);\n    const crossfade = layer.getCrossfadeParameters();\n    let drawMode, programName, uniformValues, indexBuffer, segments;\n\n    const transform = painter.transform;\n\n    const propertyFillTranslate = layer.paint.get('fill-translate');\n    const propertyFillTranslateAnchor = layer.paint.get('fill-translate-anchor');\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 = tileManager.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?.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 projectionData = transform.getProjectionData({\n            overscaledTileID: coord,\n            applyGlobeMatrix: !isRenderingToTexture,\n            applyTerrainMatrix: true\n        });\n\n        const translateForUniforms = translatePosition(transform, tile, propertyFillTranslate, propertyFillTranslateAnchor);\n\n        if (!isOutline) {\n            indexBuffer = bucket.indexBuffer;\n            segments = bucket.segments;\n            uniformValues = image ? fillPatternUniformValues(painter, crossfade, tile, translateForUniforms) : fillUniformValues(translateForUniforms);\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(painter, crossfade, tile, drawingBufferSize, translateForUniforms) :\n                fillOutlineUniformValues(drawingBufferSize, translateForUniforms);\n        }\n\n        const stencil = painter.stencilModeForClipping(coord);\n\n        program.draw(painter.context, drawMode, depthMode,\n            stencil, colorMode, CullFaceMode.backCCW, uniformValues, terrainData, projectionData,\n            layer.id, bucket.layoutVertexBuffer, indexBuffer, segments,\n            layer.paint, painter.transform.zoom, programConfiguration);\n    }\n}\n", "import {DepthMode} from '../depth_mode';\nimport {StencilMode} from '../stencil_mode';\nimport {ColorMode} from '../color_mode';\nimport {CullFaceMode} from '../cull_face_mode';\nimport {\n    fillExtrusionUniformValues,\n    fillExtrusionPatternUniformValues,\n} from '../program/fill_extrusion_program';\n\nimport type {Painter, RenderOptions} from '../../render/painter';\nimport type {TileManager} from '../../tile/tile_manager';\nimport type {FillExtrusionStyleLayer} from '../../style/style_layer/fill_extrusion_style_layer';\nimport type {FillExtrusionBucket} from '../../data/bucket/fill_extrusion_bucket';\nimport type {OverscaledTileID} from '../../tile/tile_id';\n\nimport {updatePatternPositionsInProgram} from '../../render/update_pattern_positions_in_program';\nimport {translatePosition} from '../../util/util';\n\nexport function drawFillExtrusion(painter: Painter, tileManager: TileManager, layer: FillExtrusionStyleLayer, coords: OverscaledTileID[], renderOptions: RenderOptions) {\n    const opacity = layer.paint.get('fill-extrusion-opacity');\n    if (opacity === 0) {\n        return;\n    }\n\n    const {isRenderingToTexture} = renderOptions;\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, tileManager, layer, coords, depthMode, StencilMode.disabled, colorMode, isRenderingToTexture);\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, tileManager, layer, coords, depthMode,\n                StencilMode.disabled,\n                ColorMode.disabled, isRenderingToTexture);\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, tileManager, layer, coords, depthMode,\n                painter.stencilModeFor3D(),\n                painter.colorModeForRenderPass(), isRenderingToTexture);\n        }\n    }\n}\n\nfunction drawExtrusionTiles(\n    painter: Painter,\n    tileManager: TileManager,\n    layer: FillExtrusionStyleLayer,\n    coords: OverscaledTileID[],\n    depthMode: DepthMode,\n    stencilMode: Readonly<StencilMode>,\n    colorMode: Readonly<ColorMode>,\n    isRenderingToTexture: boolean) {\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    const transform = painter.transform;\n\n    for (const coord of coords) {\n        const tile = tileManager.getTile(coord);\n        const bucket: FillExtrusionBucket = (tile.getBucket(layer) as any);\n        if (!bucket) continue;\n\n        const terrainData = 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        const projectionData = transform.getProjectionData({overscaledTileID: coord, applyGlobeMatrix: !isRenderingToTexture, applyTerrainMatrix: true});\n        updatePatternPositionsInProgram(programConfiguration, fillPropertyName, constantPattern, tile, layer);\n\n        const translate = translatePosition(\n            transform,\n            tile,\n            layer.paint.get('fill-extrusion-translate'),\n            layer.paint.get('fill-extrusion-translate-anchor')\n        );\n\n        const shouldUseVerticalGradient = layer.paint.get('fill-extrusion-vertical-gradient');\n        const uniformValues = image ?\n            fillExtrusionPatternUniformValues(painter, shouldUseVerticalGradient, opacity, translate, coord, crossfade, tile) :\n            fillExtrusionUniformValues(painter, shouldUseVerticalGradient, opacity, translate);\n\n        program.draw(context, context.gl.TRIANGLES, depthMode, stencilMode, colorMode, CullFaceMode.backCCW,\n            uniformValues, terrainData, projectionData, 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 '../stencil_mode';\nimport {DepthMode} from '../depth_mode';\nimport {CullFaceMode} from '../cull_face_mode';\nimport {type ColorMode} from '../color_mode';\nimport {\n    hillshadeUniformValues,\n    hillshadeUniformPrepareValues\n} from '../program/hillshade_program';\n\nimport type {Painter, RenderOptions} from '../../render/painter';\nimport type {TileManager} from '../../tile/tile_manager';\nimport type {HillshadeStyleLayer} from '../../style/style_layer/hillshade_style_layer';\nimport type {OverscaledTileID} from '../../tile/tile_id';\n\nexport function drawHillshade(painter: Painter, tileManager: TileManager, layer: HillshadeStyleLayer, tileIDs: OverscaledTileID[], renderOptions: RenderOptions) {\n    if (painter.renderPass !== 'offscreen' && painter.renderPass !== 'translucent') return;\n\n    const {isRenderingToTexture} = renderOptions;\n    const context = painter.context;\n    const projection = painter.style.projection;\n    const useSubdivision = projection.useSubdivision;\n\n    const depthMode = painter.getDepthModeForSublayer(0, DepthMode.ReadOnly);\n    const colorMode = painter.colorModeForRenderPass();\n\n    if (painter.renderPass === 'offscreen') {\n        // Prepare tiles\n        prepareHillshade(painter, tileManager, tileIDs, layer, depthMode, StencilMode.disabled, colorMode);\n        context.viewport.set([0, 0, painter.width, painter.height]);\n    } else if (painter.renderPass === 'translucent') {\n        // Globe (or any projection with subdivision) needs two-pass rendering to avoid artifacts when rendering texture tiles.\n        // See comments in draw_raster.ts for more details.\n        if (useSubdivision) {\n            // Two-pass rendering\n            const [stencilBorderless, stencilBorders, coords] = painter.stencilConfigForOverlapTwoPass(tileIDs);\n            renderHillshade(painter, tileManager, layer, coords, stencilBorderless, depthMode, colorMode, false, isRenderingToTexture); // draw without borders\n            renderHillshade(painter, tileManager, layer, coords, stencilBorders, depthMode, colorMode, true, isRenderingToTexture); // draw with borders\n        } else {\n            // Simple rendering\n            const [stencil, coords] = painter.getStencilConfigForOverlapAndUpdateStencilID(tileIDs);\n            renderHillshade(painter, tileManager, layer, coords, stencil, depthMode, colorMode, false, isRenderingToTexture);\n        }\n    }\n}\n\nfunction renderHillshade(\n    painter: Painter,\n    tileManager: TileManager,\n    layer: HillshadeStyleLayer,\n    coords: OverscaledTileID[],\n    stencilModes: {[_: number]: Readonly<StencilMode>},\n    depthMode: Readonly<DepthMode>,\n    colorMode: Readonly<ColorMode>,\n    useBorder: boolean,\n    isRenderingToTexture: boolean\n) {\n    const projection = painter.style.projection;\n    const context = painter.context;\n    const transform = painter.transform;\n    const gl = context.gl;\n\n    const defines = [`#define NUM_ILLUMINATION_SOURCES ${layer.paint.get('hillshade-highlight-color').values.length}`];\n    const program = painter.useProgram('hillshade', null, false, defines);\n    const align = !painter.options.moving;\n\n    for (const coord of coords) {\n        const tile = tileManager.getTile(coord);\n        const fbo = tile.fbo;\n        if (!fbo) {\n            continue;\n        }\n        const mesh = projection.getMeshFromTileID(context, coord.canonical, useBorder, true, 'raster');\n\n        const terrainData = 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 projectionData = transform.getProjectionData({\n            overscaledTileID: coord,\n            aligned: align,\n            applyGlobeMatrix: !isRenderingToTexture,\n            applyTerrainMatrix: true\n        });\n\n        program.draw(context, gl.TRIANGLES, depthMode, stencilModes[coord.overscaledZ], colorMode, CullFaceMode.backCCW,\n            hillshadeUniformValues(painter, tile, layer), terrainData, projectionData, layer.id, mesh.vertexBuffer, mesh.indexBuffer, mesh.segments);\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    tileManager: TileManager,\n    tileIDs: OverscaledTileID[],\n    layer: HillshadeStyleLayer,\n    depthMode: Readonly<DepthMode>,\n    stencilMode: Readonly<StencilMode>,\n    colorMode: Readonly<ColorMode>) {\n\n    const context = painter.context;\n    const gl = context.gl;\n\n    const textureFilter = layer.paint.get('resampling') === 'nearest' ?  gl.NEAREST : gl.LINEAR;\n\n    for (const coord of tileIDs) {\n        const tile = tileManager.getTile(coord);\n        const dem = tile.dem;\n\n        if (!dem?.data) {\n            continue;\n        }\n\n        if (!tile.needsHillshadePrepare) {\n            continue;\n        }\n\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 ||= 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(textureFilter, 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, null, layer.id, painter.rasterBoundsBuffer,\n            painter.quadTriangleIndexBuffer, painter.rasterBoundsSegments);\n\n        tile.needsHillshadePrepare = false;\n    }\n}\n", "import {Texture} from '../texture';\nimport type {StencilMode} from '../stencil_mode';\nimport {DepthMode} from '../depth_mode';\nimport {CullFaceMode} from '../cull_face_mode';\nimport {type ColorMode} from '../color_mode';\nimport {\n    colorReliefUniformValues\n} from '../program/color_relief_program';\n\nimport type {Painter, RenderOptions} from '../../render/painter';\nimport type {TileManager} from '../../tile/tile_manager';\nimport type {ColorReliefStyleLayer} from '../../style/style_layer/color_relief_style_layer';\nimport type {OverscaledTileID} from '../../tile/tile_id';\n\nexport function drawColorRelief(painter: Painter, tileManager: TileManager, layer: ColorReliefStyleLayer, tileIDs: OverscaledTileID[], renderOptions: RenderOptions) {\n    if (painter.renderPass !== 'translucent') return;\n    if (!tileIDs.length) return;\n\n    const {isRenderingToTexture} = renderOptions;\n    const projection = painter.style.projection;\n    const useSubdivision = projection.useSubdivision;\n\n    const depthMode = painter.getDepthModeForSublayer(0, DepthMode.ReadOnly);\n    const colorMode = painter.colorModeForRenderPass();\n\n    // Globe (or any projection with subdivision) needs two-pass rendering to avoid artifacts when rendering texture tiles.\n    // See comments in draw_raster.ts for more details.\n    if (useSubdivision) {\n        // Two-pass rendering\n        const [stencilBorderless, stencilBorders, coords] = painter.stencilConfigForOverlapTwoPass(tileIDs);\n        renderColorRelief(painter, tileManager, layer, coords, stencilBorderless, depthMode, colorMode, false, isRenderingToTexture); // draw without borders\n        renderColorRelief(painter, tileManager, layer, coords, stencilBorders, depthMode, colorMode, true, isRenderingToTexture); // draw with borders\n    } else {\n        // Simple rendering\n        const [stencil, coords] = painter.getStencilConfigForOverlapAndUpdateStencilID(tileIDs);\n        renderColorRelief(painter, tileManager, layer, coords, stencil, depthMode, colorMode, false, isRenderingToTexture);\n    }\n}\n\nlet textureMaxSize = 0;\nfunction renderColorRelief(\n    painter: Painter,\n    tileManager: TileManager,\n    layer: ColorReliefStyleLayer,\n    coords: OverscaledTileID[],\n    stencilModes: {[_: number]: Readonly<StencilMode>},\n    depthMode: Readonly<DepthMode>,\n    colorMode: Readonly<ColorMode>,\n    useBorder: boolean,\n    isRenderingToTexture: boolean\n) {\n    const projection = painter.style.projection;\n    const context = painter.context;\n    const transform = painter.transform;\n    const gl = context.gl;\n    const program = painter.useProgram('colorRelief');\n    const align = !painter.options.moving;\n\n    const textureFilter = layer.paint.get('resampling') === 'nearest' ?  gl.NEAREST : gl.LINEAR;\n\n    let firstTile = true;\n    let colorRampSize = 0;\n\n    for (const coord of coords) {\n        const tile = tileManager.getTile(coord);\n        const dem = tile.dem;\n        if(firstTile) {\n            // we should avoid calling gl.getParameter at runtime (GPU stall risk)\n            textureMaxSize ||= gl.getParameter(gl.MAX_TEXTURE_SIZE);\n            const maxLength = textureMaxSize;\n            const {elevationTexture, colorTexture} = layer.getColorRampTextures(context, maxLength, dem.getUnpackVector());\n            context.activeTexture.set(gl.TEXTURE1);\n            elevationTexture.bind(gl.NEAREST, gl.CLAMP_TO_EDGE);\n            context.activeTexture.set(gl.TEXTURE4);\n            colorTexture.bind(gl.LINEAR, gl.CLAMP_TO_EDGE);\n            firstTile = false;\n            colorRampSize = elevationTexture.size[0];\n        }\n\n        if (!dem?.data) {\n            continue;\n        }\n\n        const textureStride = dem.stride;\n\n        const pixelData = dem.getPixels();\n        context.activeTexture.set(gl.TEXTURE0);\n\n        context.pixelStoreUnpackPremultiplyAlpha.set(false);\n        tile.demTexture ||= painter.getTileTexture(textureStride);\n        if (tile.demTexture) {\n            const demTexture = tile.demTexture;\n            demTexture.update(pixelData, {premultiply: false});\n            demTexture.bind(textureFilter, gl.CLAMP_TO_EDGE);\n        } else {\n            tile.demTexture = new Texture(context, pixelData, gl.RGBA, {premultiply: false});\n            tile.demTexture.bind(textureFilter, gl.CLAMP_TO_EDGE);\n        }\n\n        const mesh = projection.getMeshFromTileID(context, coord.canonical, useBorder, true, 'raster');\n\n        const terrainData = painter.style.map.terrain?.getTerrainData(coord);\n\n        const projectionData = transform.getProjectionData({\n            overscaledTileID: coord,\n            aligned: align,\n            applyGlobeMatrix: !isRenderingToTexture,\n            applyTerrainMatrix: true\n        });\n\n        program.draw(context, gl.TRIANGLES, depthMode, stencilModes[coord.overscaledZ], colorMode, CullFaceMode.backCCW,\n            colorReliefUniformValues(layer, tile.dem, colorRampSize), terrainData, projectionData, layer.id, mesh.vertexBuffer, mesh.indexBuffer, mesh.segments);\n    }\n}\n", "import {clamp} from '../../util/util';\n\nimport {ImageSource} from '../../source/image_source';\nimport {now} from '../../util/time_control';\nimport {StencilMode} from '../stencil_mode';\nimport {DepthMode} from '../depth_mode';\nimport {CullFaceMode} from '../cull_face_mode';\nimport {rasterUniformValues} from '../program/raster_program';\nimport {EXTENT} from '../../data/extent';\nimport {FadingDirections} from '../../tile/tile';\nimport Point from '@mapbox/point-geometry';\n\nimport type {Painter, RenderOptions} from '../../render/painter';\nimport type {TileManager} from '../../tile/tile_manager';\nimport type {RasterStyleLayer} from '../../style/style_layer/raster_style_layer';\nimport type {OverscaledTileID} from '../../tile/tile_id';\nimport type {Tile} from '../../tile/tile';\n\ntype FadeProperties = {\n    parentTile: Tile;\n    parentScaleBy: number;\n    parentTopLeft: [number, number];\n    fadeValues: FadeValues;\n};\n\ntype FadeValues = {\n    tileOpacity: number;\n    parentTileOpacity?: number;\n    fadeMix: {opacity: number; mix: number};\n};\n\nconst cornerCoords = [\n    new Point(0, 0),\n    new Point(EXTENT, 0),\n    new Point(EXTENT, EXTENT),\n    new Point(0, EXTENT),\n];\n\nexport function drawRaster(painter: Painter, tileManager: TileManager, layer: RasterStyleLayer, tileIDs: OverscaledTileID[], renderOptions: RenderOptions) {\n    if (painter.renderPass !== 'translucent') return;\n    if (layer.paint.get('raster-opacity') === 0) return;\n    if (!tileIDs.length) return;\n\n    const {isRenderingToTexture} = renderOptions;\n    const source = tileManager.getSource();\n\n    const projection = painter.style.projection;\n    const useSubdivision = projection.useSubdivision;\n\n    // When rendering globe (or any other subdivided projection), two passes are needed.\n    // Subdivided tiles with different granularities might have tiny gaps between them.\n    // To combat this, tile meshes for globe have a slight border region.\n    // However tiles borders will overlap, and a part of a tile often\n    // gets hidden by its neighbour's border, which displays an ugly stretched texture.\n    // To both hide the border stretch and avoid tiny gaps, tiles are first drawn without borders (with gaps),\n    // and then any missing pixels (gaps, not marked in stencil) get overdrawn with tile borders.\n    // This approach also avoids pixel shader overdraw, as any pixel is drawn at most once.\n\n    // Stencil mask and two-pass is not used for ImageSource sources regardless of projection.\n    if (source instanceof ImageSource) {\n        // Image source - no stencil is used\n        drawTiles(painter, tileManager, layer, tileIDs, null, false, false, source.tileCoords, source.flippedWindingOrder, isRenderingToTexture);\n    } else if (useSubdivision) {\n        // Two-pass rendering\n        const [stencilBorderless, stencilBorders, coords] = painter.stencilConfigForOverlapTwoPass(tileIDs);\n        drawTiles(painter, tileManager, layer, coords, stencilBorderless, false, true, cornerCoords, false, isRenderingToTexture); // draw without borders\n        drawTiles(painter, tileManager, layer, coords, stencilBorders, true, true, cornerCoords, false, isRenderingToTexture); // draw with borders\n    } else {\n        // Simple rendering\n        const [stencil, coords] = painter.getStencilConfigForOverlapAndUpdateStencilID(tileIDs);\n        drawTiles(painter, tileManager, layer, coords, stencil, false, true, cornerCoords, false, isRenderingToTexture);\n    }\n}\n\nfunction drawTiles(\n    painter: Painter,\n    tileManager: TileManager,\n    layer: RasterStyleLayer,\n    coords: OverscaledTileID[],\n    stencilModes: {[_: number]: Readonly<StencilMode>} | null,\n    useBorder: boolean,\n    allowPoles: boolean,\n    corners: Point[],\n    flipCullfaceMode: boolean = false,\n    isRenderingToTexture: boolean = false) {\n    const minTileZ = coords[coords.length - 1].overscaledZ;\n\n    const context = painter.context;\n    const gl = context.gl;\n    const program = painter.useProgram('raster');\n    const transform = painter.transform;\n\n    const projection = painter.style.projection;\n\n    const colorMode = painter.colorModeForRenderPass();\n    const align = !painter.options.moving;\n    const rasterOpacity = layer.paint.get('raster-opacity');\n    const useNearest = layer.paint.get('resampling') === 'nearest' || layer.paint.get('raster-resampling') === 'nearest';\n    const textureFilter = useNearest ?  gl.NEAREST : gl.LINEAR;\n    const fadeDuration = layer.paint.get('raster-fade-duration');\n    const isTerrain = !!painter.style.map.terrain;\n\n    // Draw all tiles\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.getDepthModeForSublayer(coord.overscaledZ - minTileZ,\n            rasterOpacity === 1 ? DepthMode.ReadWrite : DepthMode.ReadOnly, gl.LESS);\n\n        const tile = tileManager.getTile(coord);\n\n        // create and bind first texture\n        context.activeTexture.set(gl.TEXTURE0);\n        tile.texture.bind(textureFilter, gl.CLAMP_TO_EDGE, gl.LINEAR_MIPMAP_NEAREST);\n\n        // create second texture - use either the current tile or fade tile to bind second texture below\n        context.activeTexture.set(gl.TEXTURE1);\n        const {parentTile, parentScaleBy, parentTopLeft, fadeValues} = getFadeProperties(tile, tileManager, fadeDuration, isTerrain);\n        tile.fadeOpacity = fadeValues.tileOpacity;\n        if (parentTile) {\n            parentTile.fadeOpacity = fadeValues.parentTileOpacity;\n            parentTile.texture.bind(textureFilter, gl.CLAMP_TO_EDGE, gl.LINEAR_MIPMAP_NEAREST);\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 the threshold pitch.\n        // The default threshold is 20 degrees to preserve image sharpness on flat or slightly tilted maps.\n        if (tile.texture.useMipmap && context.extTextureFilterAnisotropic && painter.transform.pitch > painter.options.anisotropicFilterPitch) {\n            gl.texParameterf(gl.TEXTURE_2D, context.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,\n                context.extTextureFilterAnisotropicMax);\n        }\n\n        const terrainData = painter.style.map.terrain?.getTerrainData(coord);\n        const projectionData = transform.getProjectionData({overscaledTileID: coord, aligned: align, applyGlobeMatrix: !isRenderingToTexture, applyTerrainMatrix: true});\n        const uniformValues = rasterUniformValues(parentTopLeft, parentScaleBy, fadeValues.fadeMix, layer, corners);\n\n        const mesh = projection.getMeshFromTileID(context, coord.canonical, useBorder, allowPoles, 'raster');\n        const stencilMode = stencilModes ? stencilModes[coord.overscaledZ] : StencilMode.disabled;\n\n        program.draw(context, gl.TRIANGLES, depthMode, stencilMode, colorMode, flipCullfaceMode ? CullFaceMode.frontCCW : CullFaceMode.backCCW,\n            uniformValues, terrainData, projectionData, layer.id, mesh.vertexBuffer,\n            mesh.indexBuffer, mesh.segments);\n    }\n}\n\n/**\n * Get fade properties for current tile - either cross-fading or self-fading properties.\n */\nfunction getFadeProperties(tile: Tile, tileManager: TileManager, fadeDuration: number, isTerrain: boolean): FadeProperties {\n    const defaults: FadeProperties = {\n        parentTile: null,\n        parentScaleBy: 1,\n        parentTopLeft: [0, 0],\n        fadeValues: {tileOpacity: 1, parentTileOpacity: 1, fadeMix: {opacity: 1, mix: 0}}\n    };\n\n    if (fadeDuration === 0 || isTerrain) return defaults;\n\n    // cross-fade with parent first if available\n    if (tile.fadingParentID) {\n        const parentTile = tileManager.getLoadedTile(tile.fadingParentID);\n        if (!parentTile) return defaults;\n\n        const parentScaleBy = Math.pow(2, parentTile.tileID.overscaledZ - tile.tileID.overscaledZ);\n        const parentTopLeft: [number, number] = [\n            (tile.tileID.canonical.x * parentScaleBy) % 1,\n            (tile.tileID.canonical.y * parentScaleBy) % 1\n        ];\n\n        const fadeValues = getCrossFadeValues(tile, parentTile, fadeDuration);\n        return {parentTile, parentScaleBy, parentTopLeft, fadeValues};\n    }\n\n    // self-fade for edge tiles\n    if (tile.selfFading) {\n        const fadeValues = getSelfFadeValues(tile, fadeDuration);\n        return {parentTile: null, parentScaleBy: 1, parentTopLeft: [0, 0], fadeValues};\n    }\n\n    return defaults;\n}\n\n/**\n * Cross-fade values for a base tile with a parent tile (for zooming in/out)\n */\nfunction getCrossFadeValues(tile: Tile, parentTile: Tile, fadeDuration: number): FadeValues {\n    const currentTime = now();\n\n    const timeSinceTile = (currentTime - tile.timeAdded) / fadeDuration;\n    const timeSinceParent = (currentTime - parentTile.timeAdded) / fadeDuration;\n\n    // get fading opacity based on current fade direction\n    const doFadeIn = (tile.fadingDirection === FadingDirections.Incoming);\n    const opacity1 = clamp(timeSinceTile, 0, 1);\n    const opacity2 = clamp(1 - timeSinceParent, 0, 1);\n\n    const tileOpacity = doFadeIn ? opacity1 : opacity2;\n    const parentTileOpacity = doFadeIn ? opacity2 : opacity1;\n    const fadeMix = {\n        opacity: 1,\n        mix: 1 - tileOpacity\n    };\n\n    return {tileOpacity, parentTileOpacity, fadeMix};\n}\n\n/**\n * Simple fade-in values for tile without a parent (i.e. edge tiles)\n */\nfunction getSelfFadeValues(tile: Tile, fadeDuration: number): FadeValues {\n    const currentTime = now();\n\n    const timeSinceTile = (currentTime - tile.timeAdded) / fadeDuration;\n    const tileOpacity = clamp(timeSinceTile, 0, 1);\n    const fadeMix = {\n        opacity: tileOpacity,\n        mix: 0\n    };\n\n    return {tileOpacity, fadeMix};\n}\n", "import {DepthMode} from '../depth_mode';\nimport {StencilMode} from '../stencil_mode';\nimport {CullFaceMode} from '../cull_face_mode';\nimport {debugUniformValues} from '../program/debug_program';\nimport {Color} from '@maplibre/maplibre-gl-style-spec';\nimport {ColorMode} from '../color_mode';\n\nimport type {Painter} from '../../render/painter';\nimport type {TileManager} from '../../tile/tile_manager';\nimport type {OverscaledTileID} from '../../tile/tile_id';\nimport {type 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, tileManager: TileManager, coords: OverscaledTileID[]) {\n    for (const coord of coords) {\n        drawDebugTile(painter, tileManager, coord);\n    }\n}\n\nfunction drawDebugTile(painter: Painter, tileManager: TileManager, coord: OverscaledTileID) {\n    const context = painter.context;\n    const gl = context.gl;\n\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?.getTerrainData(coord);\n\n    context.activeTexture.set(gl.TEXTURE0);\n\n    const tileRawData = tileManager.getTileByID(coord.key).latestRawTileData;\n    const tileByteLength = (tileRawData?.byteLength) || 0;\n    const tileSizeKb = Math.floor(tileByteLength / 1024);\n    const tileSize = tileManager.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    const projectionData = painter.transform.getProjectionData({overscaledTileID: coord, applyGlobeMatrix: true, applyTerrainMatrix: true});\n\n    program.draw(context, gl.TRIANGLES, depthMode, stencilMode, ColorMode.alphaBlended, CullFaceMode.disabled,\n        debugUniformValues(Color.transparent, scaleRatio), null, projectionData, id,\n        painter.debugBuffer, painter.quadTriangleIndexBuffer, painter.debugSegments);\n    program.draw(context, gl.LINE_STRIP, depthMode, stencilMode, colorMode, CullFaceMode.disabled,\n        debugUniformValues(Color.red), terrainData, projectionData, 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): TileManager | null {\n    // Use vector source with highest maxzoom\n    // Else use source with highest maxzoom of any type\n    let selectedSource: TileManager = null;\n    const layers = Object.values(style._layers);\n    const sources = layers.flatMap((layer) => {\n        if (layer.source && !layer.isHidden(zoom)) {\n            const tileManager = style.tileManagers[layer.source];\n            return [tileManager];\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: TileManager) => {\n        if (!selectedSource || (selectedSource.getSource().maxzoom < source.getSource().maxzoom)) {\n            selectedSource = source;\n        }\n    };\n    for (const source of vectorSources) {\n        considerSource(source);\n    }\n    if (!selectedSource) {\n        for (const source of otherSources) {\n            considerSource(source);\n        }\n    }\n    return selectedSource;\n}\n", "import {StencilMode} from '../stencil_mode';\nimport {DepthMode} from '../depth_mode';\nimport {terrainUniformValues, terrainDepthUniformValues, terrainCoordsUniformValues} from '../program/terrain_program';\nimport type {Painter, RenderOptions} from '../../render/painter';\nimport type {Tile} from '../../tile/tile';\nimport {CullFaceMode} from '../cull_face_mode';\nimport {Color} from '@maplibre/maplibre-gl-style-spec';\nimport {ColorMode} from '../color_mode';\nimport {type Terrain} from '../../render/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 tr = painter.transform;\n    const colorMode = ColorMode.unblended;\n    const depthMode = new DepthMode(gl.LEQUAL, DepthMode.ReadWrite, [0, 1]);\n    const tiles = terrain.tileManager.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 mesh = terrain.getTerrainMesh(tile.tileID);\n        const terrainData = terrain.getTerrainData(tile.tileID);\n        const projectionData = tr.getProjectionData({overscaledTileID: tile.tileID, applyTerrainMatrix: false, applyGlobeMatrix: true});\n        const uniformValues = terrainDepthUniformValues(terrain.getMeshFrameDelta(tr.zoom));\n        program.draw(context, gl.TRIANGLES, depthMode, StencilMode.disabled, colorMode, CullFaceMode.backCCW, uniformValues, terrainData, projectionData, '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 tr = painter.transform;\n    const colorMode = ColorMode.unblended;\n    const depthMode = new DepthMode(gl.LEQUAL, DepthMode.ReadWrite, [0, 1]);\n    const coords = terrain.getCoordsTexture();\n    const tiles = terrain.tileManager.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 mesh = terrain.getTerrainMesh(tile.tileID);\n        const terrainData = terrain.getTerrainData(tile.tileID);\n        context.activeTexture.set(gl.TEXTURE0);\n        gl.bindTexture(gl.TEXTURE_2D, coords.texture);\n        const uniformValues = terrainCoordsUniformValues(255 - terrain.coordsIndex.length, terrain.getMeshFrameDelta(tr.zoom));\n        const projectionData = tr.getProjectionData({overscaledTileID: tile.tileID, applyTerrainMatrix: false, applyGlobeMatrix: true});\n        program.draw(context, gl.TRIANGLES, depthMode, StencilMode.disabled, colorMode, CullFaceMode.backCCW, uniformValues, terrainData, projectionData, '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: Tile[], renderOptions: RenderOptions) {\n    const {isRenderingGlobe} = renderOptions;\n    const context = painter.context;\n    const gl = context.gl;\n    const tr = painter.transform;\n    const colorMode = painter.colorModeForRenderPass();\n    const depthMode = painter.getDepthModeFor3D();\n    const program = painter.useProgram('terrain');\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 mesh = terrain.getTerrainMesh(tile.tileID);\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 eleDelta = terrain.getMeshFrameDelta(tr.zoom);\n        const fogMatrix = tr.calculateFogMatrix(tile.tileID.toUnwrapped());\n        const uniformValues = terrainUniformValues(eleDelta, fogMatrix, painter.style.sky, tr.pitch, isRenderingGlobe);\n        const projectionData = tr.getProjectionData({overscaledTileID: tile.tileID, applyTerrainMatrix: false, applyGlobeMatrix: true});\n        program.draw(context, gl.TRIANGLES, depthMode, StencilMode.disabled, colorMode, CullFaceMode.backCCW, uniformValues, terrainData, projectionData, 'terrain', mesh.vertexBuffer, mesh.indexBuffer, mesh.segments);\n    }\n}\n\nexport {\n    drawTerrain,\n    drawDepth,\n    drawCoords\n};\n", "import {StencilMode} from '../stencil_mode';\nimport {DepthMode} from '../depth_mode';\nimport {CullFaceMode} from '../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 {atmosphereUniformValues} from '../program/atmosphere_program';\nimport {type Sky} from '../../style/sky';\nimport {type Light} from '../../style/light';\nimport {Mesh} from '../../render/mesh';\nimport {mat4, vec3, vec4} from 'gl-matrix';\nimport {type IReadonlyTransform} from '../../geo/transform_interface';\nimport {ColorMode} from '../color_mode';\nimport type {Painter} from '../../render/painter';\nimport {type Context} from '../context';\nimport {getGlobeRadiusPixels} from '../../geo/projection/globe_utils';\n\nfunction getMesh(context: Context, sky: Sky): Mesh {\n    // Create the Sky mesh the first time we need it\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    return sky.mesh;\n}\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    const mesh = getMesh(context, sky);\n\n    program.draw(context, gl.TRIANGLES, depthMode, stencilMode, colorMode,\n        CullFaceMode.disabled, skyUniforms, null, undefined, 'sky', mesh.vertexBuffer,\n        mesh.indexBuffer, mesh.segments);\n}\n\nfunction getSunPos(light: Light, transform: IReadonlyTransform): vec3 {\n    const _lp = light.properties.get('position');\n    const lightPos = [-_lp.x, -_lp.y, -_lp.z] as vec3;\n\n    const lightMat = mat4.identity(new Float64Array(16) as any);\n\n    if (light.properties.get('anchor') === 'map') {\n        mat4.rotateZ(lightMat, lightMat, transform.rollInRadians);\n        mat4.rotateX(lightMat, lightMat, -transform.pitchInRadians);\n        mat4.rotateZ(lightMat, lightMat, transform.bearingInRadians);\n        mat4.rotateX(lightMat, lightMat, transform.center.lat * Math.PI / 180.0);\n        mat4.rotateY(lightMat, lightMat, -transform.center.lng * Math.PI / 180.0);\n    }\n\n    vec3.transformMat4(lightPos, lightPos, lightMat);\n\n    return lightPos;\n}\n\nexport function drawAtmosphere(painter: Painter, sky: Sky, light: Light) {\n    const context = painter.context;\n    const gl = context.gl;\n    const program = painter.useProgram('atmosphere');\n    const depthMode = new DepthMode(gl.LEQUAL, DepthMode.ReadOnly, [0, 1]);\n    const transform = painter.transform;\n\n    const sunPos = getSunPos(light, painter.transform);\n\n    const projectionData = transform.getProjectionData({overscaledTileID: null, applyGlobeMatrix: true, applyTerrainMatrix: true});\n    const atmosphereBlend = sky.properties.get('atmosphere-blend') * projectionData.projectionTransition;\n\n    if (atmosphereBlend === 0) {\n        // Don't draw anything if atmosphere is fully transparent\n        return;\n    }\n\n    const globeRadius = getGlobeRadiusPixels(transform.worldSize, transform.center.lat);\n    const invProjMatrix = transform.inverseProjectionMatrix;\n    const vec = new Float64Array(4) as any as vec4;\n    vec[3] = 1;\n    vec4.transformMat4(vec, vec, transform.modelViewProjectionMatrix);\n    vec[0] /= vec[3];\n    vec[1] /= vec[3];\n    vec[2] /= vec[3];\n    vec[3] = 1;\n    vec4.transformMat4(vec, vec, invProjMatrix);\n    vec[0] /= vec[3];\n    vec[1] /= vec[3];\n    vec[2] /= vec[3];\n    vec[3] = 1;\n    const globePosition = [vec[0], vec[1], vec[2]] as vec3;\n\n    const uniformValues = atmosphereUniformValues(sunPos, atmosphereBlend, globePosition, globeRadius, invProjMatrix);\n\n    const mesh = getMesh(context, sky);\n\n    program.draw(context, gl.TRIANGLES, depthMode, StencilMode.disabled, ColorMode.alphaBlended, CullFaceMode.disabled, uniformValues, null, null, 'atmosphere', mesh.vertexBuffer, mesh.indexBuffer, mesh.segments);\n}\n", "import {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 {drawColorRelief} from './draw_color_relief';\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 {drawSky, drawAtmosphere} from './draw_sky';\n\nexport {drawSymbols, drawCircles, drawHeatmap, drawLine, drawFill, drawFillExtrusion,\n    drawHillshade, drawColorRelief, drawRaster, drawBackground,\n    drawDebug, drawDebugPadding, selectDebugSource, drawCustom,\n    drawDepth, drawCoords, drawSky, drawAtmosphere};\n\nexport type DrawFunctions = {\n    symbol: typeof drawSymbols;\n    circle: typeof drawCircles;\n    heatmap: typeof drawHeatmap;\n    line: typeof drawLine;\n    fill: typeof drawFill;\n    fillExtrusion: typeof drawFillExtrusion;\n    hillshade: typeof drawHillshade;\n    colorRelief: typeof drawColorRelief;\n    raster: typeof drawRaster;\n    background: typeof drawBackground;\n    sky: typeof drawSky;\n    atmosphere: typeof drawAtmosphere;\n    custom: typeof drawCustom;\n    debug: typeof drawDebug;\n    debugPadding: typeof drawDebugPadding;\n    terrainDepth: typeof drawDepth;\n    terrainCoords: typeof drawCoords;\n};\n\nexport const webglDrawFunctions: DrawFunctions = {\n    symbol: drawSymbols,\n    circle: drawCircles,\n    heatmap: drawHeatmap,\n    line: drawLine,\n    fill: drawFill,\n    fillExtrusion: drawFillExtrusion,\n    hillshade: drawHillshade,\n    colorRelief: drawColorRelief,\n    raster: drawRaster,\n    background: drawBackground,\n    sky: drawSky,\n    atmosphere: drawAtmosphere,\n    custom: drawCustom,\n    debug: drawDebug,\n    debugPadding: drawDebugPadding,\n    terrainDepth: drawDepth,\n    terrainCoords: drawCoords,\n};\n", "import {StencilMode} from '../stencil_mode';\nimport {DepthMode} from '../depth_mode';\nimport {CullFaceMode} from '../cull_face_mode';\nimport {type Program} from '../program';\nimport {circleUniformValues} from '../program/circle_program';\nimport {SegmentVector} from '../../data/segment';\nimport {type OverscaledTileID} from '../../tile/tile_id';\n\nimport type {Painter, RenderOptions} from '../../render/painter';\nimport type {TileManager} from '../../tile/tile_manager';\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 '../vertex_buffer';\nimport type {IndexBuffer} from '../index_buffer';\nimport type {UniformValues} from '../uniform_binding';\nimport type {CircleUniformsType} from '../program/circle_program';\nimport type {TerrainData} from '../../render/terrain';\nimport {translatePosition} from '../../util/util';\nimport type {ProjectionData} from '../../geo/projection/projection_data';\n\ntype TileRenderState = {\n    programConfiguration: ProgramConfiguration;\n    program: Program<any>;\n    layoutVertexBuffer: VertexBuffer;\n    indexBuffer: IndexBuffer;\n    uniformValues: UniformValues<CircleUniformsType>;\n    terrainData: TerrainData;\n    projectionData: ProjectionData;\n};\n\ntype SegmentsTileRenderState = {\n    segments: SegmentVector;\n    sortKey: number;\n    state: TileRenderState;\n};\n\nexport function drawCircles(painter: Painter, tileManager: TileManager, layer: CircleStyleLayer, coords: OverscaledTileID[], renderOptions: RenderOptions) {\n    if (painter.renderPass !== 'translucent') return;\n\n    const {isRenderingToTexture} = renderOptions;\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    const transform = painter.transform;\n\n    const depthMode = painter.getDepthModeForSublayer(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: SegmentsTileRenderState[] = [];\n\n    // Note: due to how the shader is written, this value only has effect when globe rendering is enabled and `circle-pitch-alignment` is set to 'map'.\n    const radiusCorrectionFactor = transform.getCircleRadiusCorrection();\n\n    for (const coord of coords) {\n\n        const tile = tileManager.getTile(coord);\n        const bucket: CircleBucket<any> = (tile.getBucket(layer) as any);\n        if (!bucket) continue;\n\n        const styleTranslate = layer.paint.get('circle-translate');\n        const styleTranslateAnchor = layer.paint.get('circle-translate-anchor');\n        const translateForUniforms = translatePosition(transform, tile, styleTranslate, styleTranslateAnchor);\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?.getTerrainData(coord);\n        const uniformValues = circleUniformValues(painter, tile, layer, translateForUniforms, radiusCorrectionFactor);\n\n        const projectionData = transform.getProjectionData({overscaledTileID: coord, applyGlobeMatrix: !isRenderingToTexture, applyTerrainMatrix: true});\n\n        const state: TileRenderState = {\n            programConfiguration,\n            program,\n            layoutVertexBuffer,\n            indexBuffer,\n            uniformValues,\n            terrainData,\n            projectionData\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, projectionData} = segmentsState.state;\n        const segments = segmentsState.segments;\n\n        program.draw(context, gl.TRIANGLES, depthMode, stencilMode, colorMode, CullFaceMode.backCCW,\n            uniformValues, terrainData, projectionData, layer.id,\n            layoutVertexBuffer, indexBuffer, segments,\n            layer.paint, painter.transform.zoom, programConfiguration);\n    }\n}\n", "import {StencilMode} from '../stencil_mode';\nimport {DepthMode} from '../depth_mode';\nimport {CullFaceMode} from '../cull_face_mode';\nimport {\n    backgroundUniformValues,\n    backgroundPatternUniformValues\n} from '../program/background_program';\n\nimport type {Painter, RenderOptions} from '../../render/painter';\nimport type {TileManager} from '../../tile/tile_manager';\nimport type {BackgroundStyleLayer} from '../../style/style_layer/background_style_layer';\nimport {type OverscaledTileID} from '../../tile/tile_id';\nimport {coveringTiles} from '../../geo/projection/covering_tiles';\n\nexport function drawBackground(painter: Painter, tileManager: TileManager, layer: BackgroundStyleLayer, coords: OverscaledTileID[], renderOptions: RenderOptions) {\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 {isRenderingToTexture} = renderOptions;\n    const context = painter.context;\n    const gl = context.gl;\n    const projection = painter.style.projection;\n    const transform = painter.transform;\n    const tileSize = transform.tileSize;\n    const image = layer.paint.get('background-pattern');\n\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.getDepthModeForSublayer(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 : coveringTiles(transform, {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    \n    for (const tileID of tileIDs) {\n        const projectionData = transform.getProjectionData({\n            overscaledTileID: tileID,\n            applyGlobeMatrix: !isRenderingToTexture,\n            applyTerrainMatrix: true\n        });\n\n        const uniformValues = image ?\n            backgroundPatternUniformValues(opacity, painter, image, {tileID, tileSize}, crossfade) :\n            backgroundUniformValues(opacity, color);\n        const terrainData = painter.style.map.terrain?.getTerrainData(tileID);\n\n        // For globe rendering, background uses tile meshes *without* borders and no stencil clipping.\n        // This works assuming the tileIDs list contains only tiles of the same zoom level.\n        // This seems to always be the case for background layers, but I'm leaving this comment\n        // here in case this assumption is false in the future.\n\n        // In case background starts having tiny holes at tile boundaries, switch to meshes with borders\n        // and also enable stencil clipping. Make sure to render a proper tile clipping mask into stencil\n        // first though, as that doesn't seem to happen for background layers as of writing this.\n\n        const mesh = projection.getMeshFromTileID(context, tileID.canonical, false, true, 'raster');\n        program.draw(context, gl.TRIANGLES, depthMode, stencilMode, colorMode, CullFaceMode.backCCW,\n            uniformValues, terrainData, projectionData, layer.id,\n            mesh.vertexBuffer, mesh.indexBuffer, mesh.segments);\n    }\n}\n", "import {DepthMode} from '../depth_mode';\nimport {StencilMode} from '../stencil_mode';\n\nimport type {Painter, RenderOptions} from '../../render/painter';\nimport type {TileManager} from '../../tile/tile_manager';\nimport type {CustomRenderMethodInput, CustomStyleLayer} from '../../style/style_layer/custom_style_layer';\n\nexport function drawCustom(painter: Painter, tileManager: TileManager, layer: CustomStyleLayer, renderOptions: RenderOptions) {\n\n    const {isRenderingGlobe} = renderOptions;\n    const context = painter.context;\n    const implementation = layer.implementation;\n    const projection = painter.style.projection;\n    const transform = painter.transform;\n\n    const projectionData = transform.getProjectionDataForCustomLayer(isRenderingGlobe);\n\n    const customLayerArgs: CustomRenderMethodInput = {\n        farZ: transform.farZ,\n        nearZ: transform.nearZ,\n        fov: transform.fov * Math.PI / 180, // fov converted to radians\n        modelViewProjectionMatrix: transform.modelViewProjectionMatrix,\n        projectionMatrix: transform.projectionMatrix,\n        shaderData: {\n            variantName: projection.shaderVariantName,\n            vertexShaderPrelude: `const float PI = 3.141592653589793;\\nuniform mat4 u_projection_matrix;\\n${projection.shaderPreludeCode.vertexSource}`,\n            define: projection.shaderDefine,\n        },\n        defaultProjectionData: projectionData,\n    };\n\n    const renderingMode = implementation.renderingMode ? implementation.renderingMode : '2d';\n\n    if (painter.renderPass === 'offscreen') {\n        const prerender = implementation.prerender;\n        if (prerender) {\n            painter.setCustomLayerDefaults();\n            context.setColorMode(painter.colorModeForRenderPass());\n\n            prerender.call(implementation, context.gl, customLayerArgs);\n\n            context.setDirty();\n            painter.setBaseState();\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 = renderingMode === '3d' ?\n            painter.getDepthModeFor3D() :\n            painter.getDepthModeForSublayer(0, DepthMode.ReadOnly);\n\n        context.setDepthMode(depthMode);\n\n        implementation.render(context.gl, customLayerArgs);\n\n        context.setDirty();\n        painter.setBaseState();\n        context.bindFramebuffer.set(null);\n    }\n}\n", "import {now} from '../util/time_control';\nimport {mat4} from 'gl-matrix';\nimport {TileManager} from '../tile/tile_manager';\nimport {EXTENT} from '../data/extent';\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 {type ProgramConfiguration} from '../data/program_configuration';\nimport {CrossTileSymbolIndex} from '../symbol/cross_tile_symbol_index';\nimport {shaders} from '../shaders/shaders';\nimport {Program} from '../webgl/program';\nimport {programUniforms} from '../webgl/program/program_uniforms';\nimport {Context} from '../webgl/context';\nimport {DepthMode} from '../webgl/depth_mode';\nimport {StencilMode} from '../webgl/stencil_mode';\nimport {ColorMode} from '../webgl/color_mode';\nimport {CullFaceMode} from '../webgl/cull_face_mode';\nimport {Texture} from '../webgl/texture';\nimport {Color} from '@maplibre/maplibre-gl-style-spec';\nimport {selectDebugSource, webglDrawFunctions, type DrawFunctions} from '../webgl/draw';\nimport {type OverscaledTileID} from '../tile/tile_id';\nimport {Mesh} from './mesh';\nimport {MercatorShaderDefine, MercatorShaderVariantKey} from '../geo/projection/mercator_projection';\n\nimport type {IReadonlyTransform} from '../geo/transform_interface';\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 '../webgl/vertex_buffer';\nimport type {IndexBuffer} from '../webgl/index_buffer';\nimport type {DepthRangeType, DepthMaskType, DepthFuncType} from '../webgl/types';\nimport type {ResolvedImage} from '@maplibre/maplibre-gl-style-spec';\nimport type {IRenderToTexture} from './render_to_texture_interface';\nimport type {ProjectionData} from '../geo/projection/projection_data';\nimport {coveringTiles} from '../geo/projection/covering_tiles';\nimport {isSymbolStyleLayer} from '../style/style_layer/symbol_style_layer';\nimport {isCircleStyleLayer} from '../style/style_layer/circle_style_layer';\nimport {isHeatmapStyleLayer} from '../style/style_layer/heatmap_style_layer';\nimport {isLineStyleLayer} from '../style/style_layer/line_style_layer';\nimport {isFillStyleLayer} from '../style/style_layer/fill_style_layer';\nimport {isFillExtrusionStyleLayer} from '../style/style_layer/fill_extrusion_style_layer';\nimport {isHillshadeStyleLayer} from '../style/style_layer/hillshade_style_layer';\nimport {isColorReliefStyleLayer} from '../style/style_layer/color_relief_style_layer';\nimport {isRasterStyleLayer} from '../style/style_layer/raster_style_layer';\nimport {isBackgroundStyleLayer} from '../style/style_layer/background_style_layer';\nimport {isCustomStyleLayer} from '../style/style_layer/custom_style_layer';\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    anisotropicFilterPitch: number;\n};\n\nexport type RenderOptions = {\n    isRenderingToTexture: boolean;\n    isRenderingGlobe: boolean;\n};\n\n/**\n * @internal\n * Initialize a new painter object.\n */\n\nexport class Painter {\n    drawFunctions: DrawFunctions;\n    context: Context;\n    transform: IReadonlyTransform;\n    renderToTexture: IRenderToTexture;\n    _tileTextures: {\n        [_: number]: 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    tileExtentMesh: Mesh;\n\n    debugBuffer: VertexBuffer;\n    debugSegments: SegmentVector;\n    rasterBoundsBuffer: VertexBuffer;\n    rasterBoundsSegments: SegmentVector;\n    rasterBoundsBufferPosOnly: VertexBuffer;\n    rasterBoundsSegmentsPosOnly: 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: {depthDirty: boolean; coordsDirty: boolean; matrix: mat4; renderTime: number};\n\n    constructor(gl: WebGLRenderingContext | WebGL2RenderingContext, transform: IReadonlyTransform) {\n        this.drawFunctions = webglDrawFunctions;\n        this.context = new Context(gl);\n        this.transform = transform;\n        this._tileTextures = {};\n        this.terrainFacilitator = {depthDirty: true, coordsDirty: false, 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 = TileManager.maxOverzooming + TileManager.maxUnderzooming + 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 rasterBoundsArrayPosOnly = new PosArray();\n        rasterBoundsArrayPosOnly.emplaceBack(0, 0);\n        rasterBoundsArrayPosOnly.emplaceBack(EXTENT, 0);\n        rasterBoundsArrayPosOnly.emplaceBack(0, EXTENT);\n        rasterBoundsArrayPosOnly.emplaceBack(EXTENT, EXTENT);\n        this.rasterBoundsBufferPosOnly = context.createVertexBuffer(rasterBoundsArrayPosOnly, posAttributes.members);\n        this.rasterBoundsSegmentsPosOnly = SegmentVector.simpleSegment(0, 0, 4, 5);\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(1, 0, 2);\n        quadTriangleIndices.emplaceBack(1, 2, 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        this.tileExtentMesh = new Mesh(this.tileExtentBuffer, this.quadTriangleIndexBuffer, this.tileExtentSegments);\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        const projectionData: ProjectionData = {\n            mainMatrix: matrix,\n            tileMercatorCoords: [0, 0, 1, 1],\n            clippingPlane: [0, 0, 0, 0],\n            projectionTransition: 0.0,\n            fallbackMatrix: matrix,\n        };\n\n        // Note: we force a simple mercator projection for the shader, since we want to draw a fullscreen quad.\n        this.useProgram('clippingMask', null, true).draw(context, gl.TRIANGLES,\n            DepthMode.disabled, this.stencilClearMode, ColorMode.disabled, CullFaceMode.disabled,\n            null, null, projectionData,\n            '$clipping', this.viewportBuffer,\n            this.quadTriangleIndexBuffer, this.viewportSegments);\n    }\n\n    _renderTileClippingMasks(layer: StyleLayer, tileIDs: OverscaledTileID[], renderToTexture: boolean) {\n        if (this.currentStencilSource === layer.source || !layer.isTileClipped() || !tileIDs?.length) {\n            return;\n        }\n\n        this.currentStencilSource = layer.source;\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        const context = this.context;\n        context.setColorMode(ColorMode.disabled);\n        context.setDepthMode(DepthMode.disabled);\n\n        const stencilRefs = {};\n\n        // Set stencil ref values for all tiles\n        for (const tileID of tileIDs) {\n            stencilRefs[tileID.key] = this.nextStencilID++;\n        }\n\n        // A two-pass approach is needed. See comment in draw_raster.ts for more details.\n        // However, we use a simpler approach because we don't care about overdraw here.\n\n        // First pass - draw tiles with borders and with GL_ALWAYS\n        this._renderTileMasks(stencilRefs, tileIDs, renderToTexture, true);\n        // Second pass - draw borderless tiles with GL_ALWAYS\n        this._renderTileMasks(stencilRefs, tileIDs, renderToTexture, false);\n\n        this._tileClippingMaskIDs = stencilRefs;\n    }\n\n    _renderTileMasks(tileStencilRefs: {[_: string]: number}, tileIDs: OverscaledTileID[], renderToTexture: boolean, useBorders: boolean) {\n        const context = this.context;\n        const gl = context.gl;\n        const projection = this.style.projection;\n        const transform = this.transform;\n\n        const program = this.useProgram('clippingMask');\n\n        // tiles are usually supplied in ascending order of z, then y, then x\n        for (const tileID of tileIDs) {\n            const stencilRef = tileStencilRefs[tileID.key];\n            const terrainData = this.style.map.terrain?.getTerrainData(tileID);\n\n            const mesh = projection.getMeshFromTileID(this.context, tileID.canonical, useBorders, true, 'stencil');\n\n            const projectionData = transform.getProjectionData({overscaledTileID: tileID, applyGlobeMatrix: !renderToTexture, applyTerrainMatrix: true});\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}, stencilRef, 0xFF, gl.KEEP, gl.KEEP, gl.REPLACE),\n                ColorMode.disabled, renderToTexture ? CullFaceMode.disabled : CullFaceMode.backCCW, null,\n                terrainData, projectionData, '$clipping', mesh.vertexBuffer,\n                mesh.indexBuffer, mesh.segments);\n        }\n    }\n\n    /**\n     * Fills the depth buffer with the geometry of all supplied tiles.\n     * Does not change the color buffer or the stencil buffer.\n     */\n    _renderTilesDepthBuffer() {\n        const context = this.context;\n        const gl = context.gl;\n        const projection = this.style.projection;\n        const transform = this.transform;\n\n        const program = this.useProgram('depth');\n        const depthMode = this.getDepthModeFor3D();\n        const tileIDs = coveringTiles(transform, {tileSize: transform.tileSize});\n\n        // tiles are usually supplied in ascending order of z, then y, then x\n        for (const tileID of tileIDs) {\n            const terrainData = this.style.map.terrain?.getTerrainData(tileID);\n            const mesh = projection.getMeshFromTileID(this.context, tileID.canonical, true, true, 'raster');\n\n            const projectionData = transform.getProjectionData({overscaledTileID: tileID, applyGlobeMatrix: true, applyTerrainMatrix: true});\n\n            program.draw(context, gl.TRIANGLES, depthMode, StencilMode.disabled,\n                ColorMode.disabled, CullFaceMode.backCCW, null,\n                terrainData, projectionData, '$clipping', mesh.vertexBuffer,\n                mesh.indexBuffer, mesh.segments);\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     * Attention: This function changes this.nextStencilID even if the result of it\n     * is not used, which might cause problems when rendering due to invalid stencil\n     * values.\n     * Returns [StencilMode for tile overscaleZ map, sortedCoords].\n     */\n    getStencilConfigForOverlapAndUpdateStencilID(tileIDs: OverscaledTileID[]): [{\n        [_: number]: Readonly<StencilMode>;\n    }, 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    stencilConfigForOverlapTwoPass(tileIDs: OverscaledTileID[]): [\n        { [_: number]: Readonly<StencilMode> }, // borderless tiles - high priority & high stencil values\n        { [_: number]: Readonly<StencilMode> }, // tiles with border - low priority\n        OverscaledTileID[]\n    ] {\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\n        this.clearStencil();\n\n        if (stencilValues > 1) {\n            const zToStencilModeHigh = {};\n            const zToStencilModeLow = {};\n            for (let i = 0; i < stencilValues; i++) {\n                zToStencilModeHigh[i + minTileZ] = new StencilMode({func: gl.GREATER, mask: 0xFF}, stencilValues + 1 + i, 0xFF, gl.KEEP, gl.KEEP, gl.REPLACE);\n                zToStencilModeLow[i + minTileZ] = new StencilMode({func: gl.GREATER, mask: 0xFF}, 1 + i, 0xFF, gl.KEEP, gl.KEEP, gl.REPLACE);\n            }\n            this.nextStencilID = stencilValues * 2 + 1;\n            return [\n                zToStencilModeHigh,\n                zToStencilModeLow,\n                coords\n            ];\n        } else {\n            this.nextStencilID = 3;\n            return [\n                {[minTileZ]: new StencilMode({func: gl.GREATER, mask: 0xFF}, 2, 0xFF, gl.KEEP, gl.KEEP, gl.REPLACE)},\n                {[minTileZ]: new StencilMode({func: gl.GREATER, mask: 0xFF}, 1, 0xFF, gl.KEEP, gl.KEEP, gl.REPLACE)},\n                coords\n            ];\n        }\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    getDepthModeForSublayer(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    getDepthModeFor3D(): Readonly<DepthMode> {\n        return new DepthMode(this.context.gl.LEQUAL, DepthMode.ReadWrite, this.depthRangeFor3D);\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(now());\n\n        this.imageManager.beginFrame();\n\n        const layerIds = this.style._order;\n        const tileManagers = this.style.tileManagers;\n\n        const coordsAscending: {[_: string]: OverscaledTileID[]} = {};\n        const coordsDescending: {[_: string]: OverscaledTileID[]} = {};\n        const coordsDescendingSymbol: {[_: string]: OverscaledTileID[]} = {};\n        const renderOptions: RenderOptions = {isRenderingToTexture: false, isRenderingGlobe: style.projection?.transitionState > 0};\n\n        for (const id in tileManagers) {\n            const tileManager = tileManagers[id];\n            if (tileManager.used) {\n                tileManager.prepare(this.context);\n            }\n\n            coordsAscending[id] = tileManager.getVisibleCoordinates(false);\n            coordsDescending[id] = coordsAscending[id].slice().reverse();\n            coordsDescendingSymbol[id] = tileManager.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.maybeDrawDepth(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, tileManagers[layer.source], layer, coords, renderOptions);\n        }\n\n        // Execute offscreen GPU tasks of the projection manager\n        this.style.projection?.updateGPUdependent({\n            context: this.context,\n            useProgram: (name: string) => this.useProgram(name)\n        });\n\n        // Rebind the main framebuffer now that all offscreen layers have been rendered:\n        this.context.viewport.set([0, 0, this.width, this.height]);\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) this.drawFunctions.sky(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 tileManager = tileManagers[layer.source];\n                const coords = coordsAscending[layer.source];\n\n                this._renderTileClippingMasks(layer, coords, false);\n                this.renderLayer(this, tileManager, layer, coords, renderOptions);\n            }\n        }\n\n        // Translucent pass ===============================================\n        // Draw all other layers bottom-to-top.\n        this.renderPass = 'translucent';\n\n        let globeDepthRendered = false;\n\n        for (this.currentLayer = 0; this.currentLayer < layerIds.length; this.currentLayer++) {\n            const layer = this.style._layers[layerIds[this.currentLayer]];\n            const tileManager = tileManagers[layer.source];\n\n            if (this.renderToTexture?.renderLayer(layer, renderOptions)) continue;\n\n            if (!this.opaquePassEnabledForLayer() && !globeDepthRendered) {\n                globeDepthRendered = true;\n                // Render the globe sphere into the depth buffer - but only if globe is enabled and terrain is disabled.\n                // There should be no need for explicitly writing tile depths when terrain is enabled.\n                if (renderOptions.isRenderingGlobe && !this.style.map.terrain) {\n                    this._renderTilesDepthBuffer();\n                }\n            }\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], !!this.renderToTexture);\n            this.renderLayer(this, tileManager, layer, coords, renderOptions);\n        }\n\n        // Render atmosphere, only for Globe projection\n        if (renderOptions.isRenderingGlobe) {\n            this.drawFunctions.atmosphere(this, this.style.sky, this.style.light);\n        }\n\n        if (this.options.showTileBoundaries) {\n            const selectedSource = selectDebugSource(this.style, this.transform.zoom);\n            if (selectedSource) {\n                this.drawFunctions.debug(this, selectedSource, selectedSource.getVisibleCoordinates());\n            }\n        }\n\n        if (this.options.showPadding) {\n            this.drawFunctions.debugPadding(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 framebuffer if the camera has moved or tiles have reloaded.\n     * Marks coords as depthDirty so they are re-rendered on next demand.\n     */\n    maybeDrawDepth(requireExact: boolean) {\n        if (!this.style?.map?.terrain) {\n            return;\n        }\n        const prevMatrix = this.terrainFacilitator.matrix;\n        const currMatrix = this.transform.modelViewProjectionMatrix;\n\n        // Update depth-framebuffer on camera movement, or tile reloading\n        let doUpdate = this.terrainFacilitator.depthDirty;\n        doUpdate ||= requireExact ? !mat4.exactEquals(prevMatrix, currMatrix) : !mat4.equals(prevMatrix, currMatrix);\n        doUpdate ||= this.style.map.terrain.tileManager.anyTilesAfterTime(this.terrainFacilitator.renderTime);\n\n        if (!doUpdate) {\n            return;\n        }\n\n        mat4.copy(prevMatrix, currMatrix);\n        this.terrainFacilitator.renderTime = Date.now();\n        this.terrainFacilitator.depthDirty = false;\n        this.terrainFacilitator.coordsDirty = true;\n        this.drawFunctions.terrainDepth(this, this.style.map.terrain);\n    }\n\n    /**\n     * Render the coords framebuffer if it is coordsDirty\n     */\n    maybeDrawCoords() {\n        if (!this.style?.map?.terrain || !this.terrainFacilitator.coordsDirty) {\n            return;\n        }\n        this.terrainFacilitator.coordsDirty = false;\n        this.drawFunctions.terrainCoords(this, this.style.map.terrain);\n    }\n\n    renderLayer(painter: Painter, tileManager: TileManager, layer: StyleLayer, coords: OverscaledTileID[], renderOptions: RenderOptions) {\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        const draw = this.drawFunctions;\n        if (isSymbolStyleLayer(layer)) {\n            draw.symbol(painter, tileManager, layer, coords, this.style.placement.variableOffsets, renderOptions);\n        } else if (isCircleStyleLayer(layer)) {\n            draw.circle(painter, tileManager, layer, coords, renderOptions);\n        } else if (isHeatmapStyleLayer(layer)) {\n            draw.heatmap(painter, tileManager, layer, coords, renderOptions);\n        } else if (isLineStyleLayer(layer)) {\n            draw.line(painter, tileManager, layer, coords, renderOptions);\n        } else if (isFillStyleLayer(layer)) {\n            draw.fill(painter, tileManager, layer, coords, renderOptions);\n        } else if (isFillExtrusionStyleLayer(layer)) {\n            draw.fillExtrusion(painter, tileManager, layer, coords, renderOptions);\n        } else if (isHillshadeStyleLayer(layer)) {\n            draw.hillshade(painter, tileManager, layer, coords, renderOptions);\n        } else if (isColorReliefStyleLayer(layer)) {\n            draw.colorRelief(painter, tileManager, layer, coords, renderOptions);\n        } else if (isRasterStyleLayer(layer)) {\n            draw.raster(painter, tileManager, layer, coords, renderOptions);\n        } else if (isBackgroundStyleLayer(layer)) {\n            draw.background(painter, tileManager, layer, coords, renderOptions);\n        } else if (isCustomStyleLayer(layer)) {\n            draw.custom(painter, tileManager, layer, renderOptions);\n        }\n    }\n\n    static readonly MAX_TEXTURE_POOL_SIZE_PER_BUCKET = 50;\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 if (textures.length < Painter.MAX_TEXTURE_POOL_SIZE_PER_BUCKET) {\n            textures.push(texture);\n        } else {\n            texture.destroy();\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    /**\n     * Finds the required shader and its variant (base/terrain/globe, etc.) and binds it, compiling a new shader if required.\n     * @param name - Name of the desired shader.\n     * @param programConfiguration - Configuration of shader's inputs.\n     * @param forceSimpleProjection - Whether to force the use of a shader variant with simple mercator projection vertex shader.\n     * @param defines - Additional macros to be injected at the beginning of the shader. Expected format is `['#define XYZ']`, etc.\n     * False by default. Use true when drawing with a simple projection matrix is desired, eg. when drawing a fullscreen quad.\n     * @returns\n     */\n    useProgram(name: string, programConfiguration?: ProgramConfiguration | null, forceSimpleProjection: boolean = false, defines: string[] = []): Program<any> {\n        this.cache ||= {};\n        const useTerrain = !!this.style.map.terrain;\n\n        const projection = this.style.projection;\n\n        const projectionPrelude = forceSimpleProjection ? shaders.projectionMercator : projection.shaderPreludeCode;\n        const projectionDefine = forceSimpleProjection ? MercatorShaderDefine : projection.shaderDefine;\n        const projectionKey = `/${forceSimpleProjection ? MercatorShaderVariantKey : projection.shaderVariantName}`;\n\n        const configurationKey = (programConfiguration ? programConfiguration.cacheKey : '');\n        const overdrawKey = (this._showOverdrawInspector ? '/overdraw' : '');\n        const terrainKey = (useTerrain ? '/terrain' : '');\n        const definesKey = (defines ? `/${defines.join('/')}` : '');\n\n        const key = name + configurationKey + projectionKey + overdrawKey + terrainKey + definesKey;\n\n        this.cache[key] ||= new Program(\n            this.context,\n            shaders[name],\n            programConfiguration,\n            programUniforms[name],\n            this._showOverdrawInspector,\n            useTerrain,\n            projectionPrelude,\n            projectionDefine,\n            defines\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._tileTextures) {\n            for (const size in this._tileTextures) {\n                const textures = this._tileTextures[size];\n                if (textures) {\n                    for (const texture of textures) {\n                        texture.destroy();\n                    }\n                }\n            }\n            this._tileTextures = {};\n        }\n\n        if (this.tileExtentBuffer) this.tileExtentBuffer.destroy();\n        if (this.debugBuffer) this.debugBuffer.destroy();\n        if (this.rasterBoundsBuffer) this.rasterBoundsBuffer.destroy();\n        if (this.rasterBoundsBufferPosOnly) this.rasterBoundsBufferPosOnly.destroy();\n        if (this.viewportBuffer) this.viewportBuffer.destroy();\n        if (this.tileBorderIndexBuffer) this.tileBorderIndexBuffer.destroy();\n        if (this.quadTriangleIndexBuffer) this.quadTriangleIndexBuffer.destroy();\n        if (this.tileExtentMesh) this.tileExtentMesh.vertexBuffer?.destroy();\n        if (this.tileExtentMesh) this.tileExtentMesh.indexBuffer?.destroy();\n\n        if (this.debugOverlayTexture) {\n            this.debugOverlayTexture.destroy();\n        }\n\n        if (this.cache) {\n            for (const key in this.cache) {\n                const program = this.cache[key];\n                if (program?.program) {\n                    this.context.gl.deleteProgram(program.program);\n                }\n            }\n            this.cache = {};\n        }\n\n        if (this.context) {\n            this.context.setDefault();\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", "/**\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 lastCallArgs: Parameters<T>;\n\n    const later = () => {\n        timerId = null;\n        if (pending) {\n            fn(...lastCallArgs);\n            timerId = setTimeout(later, time);\n            pending = false;\n        }\n    };\n\n    return (...args: Parameters<T>) => {\n        pending = true;\n        lastCallArgs = args;\n        if (!timerId) {\n            later();\n        }\n        return timerId;\n    };\n}\n", "import {throttle} from '../util/throttle';\nimport {LngLat} from '../geo/lng_lat';\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            const parts = hash.split('&').map(part => part.split('='));\n            for (const part of parts) {\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 hash = this._getCurrentHash();\n\n        if (!this._isValidHash(hash)) {\n            return false;\n        }\n\n        const bearing = this._map.dragRotate.isEnabled() && this._map.touchZoomRotate.isEnabled() ? +(hash[3] || 0) : this._map.getBearing();\n        this._map.jumpTo({\n            center: [+hash[2], +hash[1]],\n            zoom: +hash[0],\n            bearing,\n            pitch: +(hash[4] || 0)\n        });\n\n        return true;\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    _isValidHash(hash: number[]) {\n        if (hash.length < 3 || hash.some(isNaN)) {\n            return false;\n        }\n\n        // LngLat() throws error if latitude is out of range, and it's valid if it succeeds.\n        try {\n            new LngLat(+hash[2], +hash[1]);\n        } catch {\n            return false;\n        }\n\n        const zoom = +hash[0];\n        const bearing = +(hash[3] || 0);\n        const pitch = +(hash[4] || 0);\n\n        return zoom >= this._map.getMinZoom() && zoom <= this._map.getMaxZoom() &&\n            bearing >= -180 && bearing <= 180 &&\n            pitch >= this._map.getMinPitch() && pitch <= this._map.getMaxPitch();\n    };\n}\n", "import {now} from '../util/time_control';\nimport type {Map} from './map';\nimport {bezier, clamp, extend, evaluateZoomSnap} from '../util/util';\nimport Point from '@mapbox/point-geometry';\nimport type {DragPanOptions} from './handler/shim/drag_pan';\nimport {type EaseToOptions} from './camera';\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\nconst defaultRollInertiaOptions = extend({\n    deceleration: 1000,\n    maxSpeed: 360\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: now(), settings});\n    }\n\n    _drainInertiaBuffer() {\n        const inertia = this._inertiaBuffer,\n            currentTime = now(),\n            cutoff = 160;   //msec\n\n        while (inertia.length > 0 && currentTime - inertia[0].time > cutoff)\n            inertia.shift();\n    }\n\n    _onMoveEnd(panInertiaOptions?: DragPanOptions | boolean): EaseToOptions {\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            roll: 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            deltas.roll += settings.rollDelta || 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            const finalPan = deltas.pan.mult(result.amount / deltas.pan.mag());\n            const computedEaseOptions = this._map.cameraHelper.handlePanInertia(finalPan, this._map.transform);\n            easeOptions.center = computedEaseOptions.easingCenter;\n            easeOptions.offset = computedEaseOptions.easingOffset;\n            extendDuration(easeOptions, result);\n        }\n\n        if (deltas.zoom) {\n            const result = calculateEasing(deltas.zoom, duration, defaultZoomInertiaOptions);\n            easeOptions.zoom = evaluateZoomSnap(this._map.transform.zoom + result.amount, this._map.getZoomSnap(), 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 (deltas.roll) {\n            const result = calculateEasing(deltas.roll, duration, defaultRollInertiaOptions);\n            easeOptions.roll = this._map.transform.roll + clamp(result.amount, -179, 179);\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 {ProjectionSpecification, SourceSpecification} from '@maplibre/maplibre-gl-style-spec';\nimport {type GeoJSONSourceShouldReloadTileOptions} from '../source/geojson_source';\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\n *     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-distances/)\n     * @see [Center the map on a clicked symbol](https://maplibre.org/maplibre-gl-js/docs/examples/center-the-map-on-a-clicked-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\n     *     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/create-a-draggable-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/create-a-draggable-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/get-coordinates-of-the-mouse-pointer/)\n     * @see [Highlight features under the mouse pointer](https://maplibre.org/maplibre-gl-js/docs/examples/create-a-hover-effect/)\n     * @see [Display a popup on over](https://maplibre.org/maplibre-gl-js/docs/examples/display-a-popup-on-hover/)\n     * @see [Animate symbol to follow the mouse](https://maplibre.org/maplibre-gl-js/docs/examples/animate-symbol-to-follow-the-mouse/)\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-the-map-on-a-clicked-symbol/)\n     * @see [Display a popup on click](https://maplibre.org/maplibre-gl-js/docs/examples/display-a-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/create-a-hover-effect/)\n     * @see [Display a popup on click](https://maplibre.org/maplibre-gl-js/docs/examples/display-a-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/get-coordinates-of-the-mouse-pointer/)\n     * @see [Highlight features under the mouse pointer](https://maplibre.org/maplibre-gl-js/docs/examples/create-a-hover-effect/)\n     * @see [Display a popup on hover](https://maplibre.org/maplibre-gl-js/docs/examples/display-a-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/create-a-draggable-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/create-a-draggable-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/create-a-draggable-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/draw-geojson-points/)\n     * @see [Add live realtime data](https://maplibre.org/maplibre-gl-js/docs/examples/add-live-realtime-data/)\n     * @see [Animate a point](https://maplibre.org/maplibre-gl-js/docs/examples/animate-a-point/)\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/display-html-clusters-with-custom-properties/)\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/generate-and-add-a-missing-icon-to-the-map/)\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/create-a-draggable-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/create-a-draggable-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/create-a-draggable-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-distances/)\n     * @see [Center the map on a clicked symbol](https://maplibre.org/maplibre-gl-js/docs/examples/center-the-map-on-a-clicked-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\n     *     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/get-coordinates-of-the-mouse-pointer/)\n     * @see [Highlight features under the mouse pointer](https://maplibre.org/maplibre-gl-js/docs/examples/create-a-hover-effect/)\n     * @see [Display a popup on over](https://maplibre.org/maplibre-gl-js/docs/examples/display-a-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/create-a-draggable-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/create-a-draggable-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/get-coordinates-of-the-mouse-pointer/)\n     * @see [Highlight features under the mouse pointer](https://maplibre.org/maplibre-gl-js/docs/examples/create-a-hover-effect/)\n     * @see [Display a popup on hover](https://maplibre.org/maplibre-gl-js/docs/examples/display-a-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/display-html-clusters-with-custom-properties/)\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/display-html-clusters-with-custom-properties/)\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/create-a-draggable-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     * Fired when map's projection is modified in other ways than by map being moved.\n     */\n    projectiontransition: MapProjectionEvent;\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    sourceDataChanged?: boolean;\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     * Options to determine whether a tile should be reloaded.\n     * @internal\n     */\n    shouldReloadTileOptions: GeoJSONSourceShouldReloadTileOptions;\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        originalEvent = originalEvent instanceof MouseEvent ? originalEvent : new MouseEvent(type, originalEvent);\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: 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: 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 * The map projection event\n *\n * @group Event Related\n */\nexport type MapProjectionEvent = {\n    type: 'projectiontransition';\n    /**\n     * Specifies the name of the new projection.\n     * For example:\n     *\n     *  - `globe` to describe globe that has internally switched to mercator\n     *  - `vertical-perspective` to describe a globe that doesn't change to mercator\n     *  - `mercator` to describe mercator projection\n     */\n    newProjection: ProjectionSpecification['type'];\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/generate-and-add-a-missing-icon-to-the-map/)\n */\nexport type MapStyleImageMissingEvent = MapLibreEvent & {\n    type: 'styleimagemissing';\n    id: string;\n};\n", "import {MapMouseEvent, MapTouchEvent, MapWheelEvent} from '../events';\nimport {type 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 {IReadonlyTransform} from '../../geo/transform_interface';\nimport Point from '@mapbox/point-geometry';\nimport {type 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(): IReadonlyTransform {\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.screenPointToLocation(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 {type Handler} from '../handler_manager';\n\n/**\n * Callback for customizing what happens when a box zoom gesture ends.\n */\nexport type BoxZoomEndHandler = (map: Map, startPos: Point, endPos: Point, originalEvent: MouseEvent) => void;\n\n/**\n * A {@link BoxZoomHandler} options object.\n */\nexport type BoxZoomHandlerOptions = {\n    /**\n     * A callback that runs when the user completes the Shift-drag box gesture.\n     * Providing this callback suppresses the default fit-to-box zoom behavior.\n     */\n    boxZoomEnd?: BoxZoomEndHandler;\n};\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    _boxZoomEnd?: BoxZoomEndHandler;\n\n    /** @internal */\n    constructor(map: Map, options: {\n        clickTolerance: number;\n        boxZoom?: boolean | BoxZoomHandlerOptions;\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        if (options.boxZoom && typeof options.boxZoom === 'object') {\n            this._boxZoomEnd = options.boxZoom.boxZoomEnd;\n        }\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        this._box.style.transform = `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            if (this._boxZoomEnd) {\n                this._boxZoomEnd(this._map, p0, p1, e);\n                return;\n            }\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            this._box.remove();\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 type Point from '@mapbox/point-geometry';\n\nexport function indexTouches(touches: Touch[], points: 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: 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: Point[], mapTouches: 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: Point[], mapTouches: 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: Point[], mapTouches: 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: Point[], mapTouches: Touch[]) {\n        this.singleTap.touchstart(e, points, mapTouches);\n    }\n\n    touchmove(e: TouchEvent, points: Point[], mapTouches: Touch[]) {\n        this.singleTap.touchmove(e, points, mapTouches);\n    }\n\n    touchend(e: TouchEvent, points: Point[], mapTouches: 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 {type Handler} from '../handler_manager';\nimport {evaluateZoomSnap} from '../../util/util';\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: Point[], mapTouches: Touch[]) {\n        this._zoomIn.touchstart(e, points, mapTouches);\n        this._zoomOut.touchstart(e, points, mapTouches);\n    }\n\n    touchmove(e: TouchEvent, points: Point[], mapTouches: Touch[]) {\n        this._zoomIn.touchmove(e, points, mapTouches);\n        this._zoomOut.touchmove(e, points, mapTouches);\n    }\n\n    touchend(e: TouchEvent, points: Point[], mapTouches: 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: evaluateZoomSnap(tr.zoom + 1, map.getZoomSnap()),\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: evaluateZoomSnap(tr.zoom - 1, map.getZoomSnap()),\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 {type DragMoveStateManager} from './drag_move_state_manager';\nimport {type Handler} from '../handler_manager';\n\ntype DragMovementResult = {\n    bearingDelta?: number;\n    pitchDelta?: number;\n    rollDelta?: 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\nexport interface DragRollResult extends DragMovementResult {\n    rollDelta: number;\n}\n\ntype DragMoveFunction<T extends DragMovementResult> = (lastPoint: Point, currnetPoint: 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}\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.rollDelta || 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 = Array.isArray(point) ? 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 = Array.isArray(point) ? 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", "const 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        this._eventButton = e.button;\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 = e.button;\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        this._firstTouch = e.targetTouches[0].identifier;\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\nexport class MouseOrTouchMoveStateManager implements DragMoveStateManager<MouseEvent | TouchEvent> {\n    constructor(\n        private mouseMoveStateManager = new MouseMoveStateManager({checkCorrectEvent: () => true}),\n        private oneFingerTouchMoveStateManager = new OneFingerTouchMoveStateManager()\n    ) {}\n\n    _executeRelevantHandler(e: MouseEvent | TouchEvent, onMouseEvent: (MouseEvent) => any, onTouchEvent: (TouchEvent) => any) {\n        if (e instanceof MouseEvent) return onMouseEvent(e);\n        if (typeof TouchEvent !== 'undefined' && e instanceof TouchEvent) return onTouchEvent(e);\n    }\n\n    startMove(e: MouseEvent | TouchEvent) {\n        this._executeRelevantHandler(e,\n            e => { this.mouseMoveStateManager.startMove(e); },\n            e => { this.oneFingerTouchMoveStateManager.startMove(e); });\n    }\n\n    endMove(e?: MouseEvent | TouchEvent) {\n        this._executeRelevantHandler(e,\n            e => { this.mouseMoveStateManager.endMove(e); },\n            e => { this.oneFingerTouchMoveStateManager.endMove(e); });\n    }\n\n    isValidStartEvent(e: MouseEvent | TouchEvent) {\n        return this._executeRelevantHandler(e,\n            e => this.mouseMoveStateManager.isValidStartEvent(e),\n            e => this.oneFingerTouchMoveStateManager.isValidStartEvent(e));\n    }\n\n    isValidMoveEvent(e: MouseEvent | TouchEvent) {\n        return this._executeRelevantHandler(e,\n            e => this.mouseMoveStateManager.isValidMoveEvent(e),\n            e => this.oneFingerTouchMoveStateManager.isValidMoveEvent(e));\n    }\n\n    isValidEndEvent(e?: MouseEvent | TouchEvent) {\n        return this._executeRelevantHandler(e,\n            e => this.mouseMoveStateManager.isValidEndEvent(e),\n            e => this.oneFingerTouchMoveStateManager.isValidEndEvent(e));\n    }\n}\n", "import Point from '@mapbox/point-geometry';\n\nimport {type DragMoveHandler, type DragPanResult, type DragRotateResult, type DragPitchResult, DragHandler, type DragRollResult} from './drag_handler';\nimport {MouseMoveStateManager} from './drag_move_state_manager';\nimport {getAngleDelta} from '../../util/util';\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/**\n * `MouseRollHandler` allows the user to roll the camera by holding `Ctrl`, right-clicking and dragging\n */\nexport interface MouseRollHandler extends DragMoveHandler<DragRollResult, 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 function generateMousePanHandler({enable, clickTolerance}: {\n    clickTolerance: number;\n    enable?: boolean;\n}): MousePanHandler {\n    const mouseMoveStateManager = new MouseMoveStateManager({\n        checkCorrectEvent: (e: MouseEvent) => e.button === 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 function generateMouseRotationHandler({enable, clickTolerance, aroundCenter = true, minPixelCenterThreshold = 100, rotateDegreesPerPixelMoved = 0.8}: {\n    clickTolerance: number;\n    enable?: boolean;\n    aroundCenter?: boolean;\n    minPixelCenterThreshold?: number;\n    rotateDegreesPerPixelMoved?: number;\n}, getCenter: () => Point): MouseRotateHandler {\n    const mouseMoveStateManager = new MouseMoveStateManager({\n        checkCorrectEvent: (e: MouseEvent): boolean =>\n            (e.button === LEFT_BUTTON && e.ctrlKey) ||\n            (e.button === RIGHT_BUTTON && !e.ctrlKey),\n    });\n    return new DragHandler<DragRotateResult, MouseEvent>({\n        clickTolerance,\n        move: (lastPoint: Point, currentPoint: Point) => {\n            const center = getCenter();\n            if (aroundCenter && Math.abs(center.y - lastPoint.y) > minPixelCenterThreshold) {\n                // Avoid rotation related to y axis since it is \"saved\" for pitch\n                return {bearingDelta: getAngleDelta(new Point(lastPoint.x, currentPoint.y), currentPoint, center)};\n            }\n            let bearingDelta = (currentPoint.x - lastPoint.x) * rotateDegreesPerPixelMoved;\n            if (aroundCenter && currentPoint.y < center.y) {\n                bearingDelta = -bearingDelta;\n            }\n            return {bearingDelta};\n        },\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 function 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            (e.button === LEFT_BUTTON && e.ctrlKey) ||\n            (e.button === 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\nexport function generateMouseRollHandler({enable, clickTolerance, rollDegreesPerPixelMoved = 0.3}: {\n    clickTolerance: number;\n    rollDegreesPerPixelMoved?: number;\n    enable?: boolean;\n}, getCenter: () => Point): MouseRollHandler {\n    const mouseMoveStateManager = new MouseMoveStateManager({\n        checkCorrectEvent: (e: MouseEvent): boolean =>\n            (e.button === RIGHT_BUTTON && e.ctrlKey),\n    });\n    return new DragHandler<DragRollResult, MouseEvent>({\n        clickTolerance,\n        move: (lastPoint: Point, currentPoint: Point) => {\n            const center = getCenter();\n            let rollDelta = (currentPoint.x - lastPoint.x) * rollDegreesPerPixelMoved;\n            if (currentPoint.y < center.y) {\n                rollDelta = -rollDelta;\n            }\n            return {rollDelta};\n        },\n        // prevent browser context menu when necessary; we don't allow it with roll\n        // because we can't discern roll 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 {type 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: Point[], mapTouches: Touch[]) {\n        return this._calculateTransform(e, points, mapTouches);\n    }\n\n    touchmove(e: TouchEvent, points: Point[], mapTouches: 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: Point[], mapTouches: 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: Point[], mapTouches: 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 type Point from '@mapbox/point-geometry';\nimport {DOM} from '../../util/dom';\nimport type {Map} from '../map';\nimport {type Handler, type 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: Point[], mapTouches: Touch[]): void {\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: Point[], mapTouches: 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: Point[], mapTouches: 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: Touch[], points: 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 defaultZoomRate = 1;\nconst defaultZoomThreshold = 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    _zoomRate: number;\n    _zoomThreshold: number;\n\n    constructor() {\n        super();\n        this._zoomRate = defaultZoomRate;\n        this._zoomThreshold = defaultZoomThreshold;\n    }\n\n    /**\n     * Sets the zoom rate of touch gestures.\n     * @param zoomRate - 1 The rate used to scale touch movement to a zoom value. Set to `undefined` to restore the default.\n     * @example\n     * Slow down touch zoom\n     * ```ts\n     * map.touchZoomRotate.setZoomRate(0.5);\n     * ```\n     */\n    setZoomRate(zoomRate?: number) {\n        this._zoomRate = zoomRate ?? defaultZoomRate;\n    }\n\n    /**\n     * Sets the threshold before a pinch gesture starts zooming.\n     * @param zoomThreshold - 0.1 The minimum zoom delta before the pinch gesture becomes active. Set to `undefined` to restore the default.\n     * @example\n     * Make pinch zoom less sensitive\n     * ```ts\n     * map.touchZoomRotate.setZoomThreshold(0.3);\n     * ```\n     */\n    setZoomThreshold(zoomThreshold?: number) {\n        this._zoomThreshold = zoomThreshold ?? defaultZoomThreshold;\n    }\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)) < this._zoomThreshold) return;\n        this._active = true;\n        return {\n            zoomDelta: getZoomDelta(this._distance, lastDistance) * this._zoomRate,\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: Point[], mapTouches: 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 {type Handler} from '../handler_manager';\nimport type {Map} from '../map';\nimport {TransformProvider} from './transform-provider';\nimport {evaluateZoomSnap} from '../../util/util';\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+\u21E2`: Increase the rotation by 15 degrees.\n * - `Shift+\u21E0`: Decrease the rotation by 15 degrees.\n * - `Shift+\u21E1`: Increase the pitch by 10 degrees.\n * - `Shift+\u21E3`: 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 ? evaluateZoomSnap(tr.zoom + zoomDir * (e.shiftKey ? 2 : 1), map.getZoomSnap()) : 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, zoomScale, scaleZoom, evaluateZoomSnap} from '../../util/util';\nimport {now} from '../../util/time_control';\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 type {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// Minimum time difference value to be used for calculating zoom easing in renderFrame();\n// this is used to normalise very fast (typically 0 to 0.3ms) repeating lastWheelEventTimeDiff\n// values generated by Chromium based browsers during fast scrolling wheel events.\nconst wheelEventTimeDiffAdjustment = 5;\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    _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    _lastExpectedZoom: number;\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    _needsRerender: 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 currentTime = now(),\n            timeDelta = currentTime - (this._lastWheelEventTime || 0);\n\n        this._lastWheelEventTime = currentTime;\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        this._needsRerender = false;\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        // Whether aroundPoint is actually unprojectable is not a problem to be solved here, but in handler_manager.ts instead.\n        if (this._aroundCenter) {\n            this._aroundPoint = tr.transform.locationToScreenPoint(LngLat.convert(tr.center));\n        } else {\n            this._aroundPoint = pos;\n        }\n\n        if (!this._needsRerender) {\n            this._needsRerender = true;\n            this._triggerRenderFrame();\n        }\n    }\n\n    renderFrame() {\n        if (!this._needsRerender) return;\n        this._needsRerender = false;\n\n        if (!this.isActive()) return;\n        const tr = this._tr.transform;\n\n        // When globe is enabled zoom might be modified by the map center latitude being changes (either by panning or by zoom moving the map)\n        if (typeof this._lastExpectedZoom === 'number') {\n            const externalZoomChange = tr.zoom - this._lastExpectedZoom;\n            if (typeof this._startZoom === 'number') {\n                this._startZoom += externalZoomChange;\n            }\n            if (typeof this._targetZoom === 'number') {\n                this._targetZoom += externalZoomChange;\n            }\n        }\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 so the map responds to small scrolls and compresses large scrolls\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.scale : zoomScale(this._targetZoom);\n            const target = tr.applyConstrain(tr.getCameraLngLat(), scaleZoom(fromScale * scale)).zoom;\n            const zoomSnap = this._map.getZoomSnap();\n\n            if (this._type === 'wheel' && zoomSnap > 0) {\n                const currentSnapped = evaluateZoomSnap(tr.zoom, zoomSnap);\n                this._targetZoom = evaluateZoomSnap(target, zoomSnap, target - currentSnapped);\n            } else {\n                this._targetZoom = target;\n            }\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' ? tr.zoom : this._targetZoom;\n        const startZoom = this._startZoom;\n        const easing = this._easing;\n\n        let finished = false;\n        let zoom;\n\n        if (this._type === 'wheel' && startZoom && easing) {\n            const lastWheelEventTimeDiff = now() - this._lastWheelEventTime;\n\n            const t = Math.min((lastWheelEventTimeDiff + wheelEventTimeDiffAdjustment) / 200, 1);\n\n            const k = easing(t);\n            zoom = interpolates.number(startZoom, targetZoom, k);\n            if (t < 1) {\n                this._needsRerender = true;\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._lastExpectedZoom;\n                delete this._finishTimeout;\n            }, 200);\n        }\n\n        this._lastExpectedZoom = zoom;\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 = (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: 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        delete this._lastExpectedZoom;\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 {type Handler} from '../handler_manager';\nimport {evaluateZoomSnap} from '../../util/util';\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: evaluateZoomSnap(this._tr.zoom + (e.shiftKey ? -1 : 1), map.getZoomSnap()),\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 {type Handler} from '../handler_manager';\nimport {TapRecognizer, MAX_TAP_INTERVAL, MAX_DIST} from './tap_recognizer';\nimport type Point from '@mapbox/point-geometry';\n\nconst defaultZoomRate = 1;\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    _zoomRate: number;\n\n    constructor() {\n\n        this._tap = new TapRecognizer({\n            numTouches: 1,\n            numTaps: 1\n        });\n        this._zoomRate = defaultZoomRate;\n\n        this.reset();\n    }\n\n    setZoomRate(zoomRate?: number) {\n        this._zoomRate = zoomRate ?? defaultZoomRate;\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: Point[], mapTouches: 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: Point[], mapTouches: 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 * this._zoomRate\n            };\n        }\n    }\n\n    touchend(e: TouchEvent, points: Point[], mapTouches: 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, MouseRollHandler, 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     * Control the map roll in addition to the bearing\n     * @defaultValue false\n     */\n    rollEnabled: 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    _mouseRoll: MouseRollHandler;\n    _pitchWithRotate: boolean;\n    _rollEnabled: boolean;\n\n    /** @internal */\n    constructor(options: DragRotateHandlerOptions, mouseRotate: MouseRotateHandler, mousePitch: MousePitchHandler, mouseRoll: MouseRollHandler) {\n        this._pitchWithRotate = options.pitchWithRotate;\n        this._rollEnabled = options.rollEnabled;\n        this._mouseRotate = mouseRotate;\n        this._mousePitch = mousePitch;\n        this._mouseRoll = mouseRoll;\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        if (this._rollEnabled) this._mouseRoll.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        this._mouseRoll.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()) && (!this._rollEnabled || this._mouseRoll.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() || this._mouseRoll.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     * Sets the zoom rate of touch gestures.\n     * @param zoomRate - 1 The rate used to scale touch movement to a zoom value. Set to `undefined` to restore the default.\n     * @example\n     * Slow down touch zoom\n     * ```ts\n     * map.touchZoomRotate.setZoomRate(0.5);\n     * ```\n     */\n    setZoomRate(zoomRate?: number) {\n        this._touchZoom.setZoomRate(zoomRate);\n        this._tapDragZoom.setZoomRate(zoomRate);\n    }\n\n    /**\n     * Sets the threshold before a pinch gesture starts zooming.\n     * @param zoomThreshold - 0.1 The minimum zoom delta before the pinch gesture becomes active. Set to `undefined` to restore the default.\n     * @example\n     * Make pinch zoom less sensitive\n     * ```ts\n     * map.touchZoomRotate.setZoomThreshold(0.3);\n     * ```\n     */\n    setZoomThreshold(zoomThreshold?: number) {\n        this._touchZoom.setZoomThreshold(zoomThreshold);\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 {type 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.includes('Mac') ? '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            this._container.remove();\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 {type Map, type 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, generateMouseRollHandler} 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, isPointableEvent, isTouchableEvent, isTouchableOrPointableType} from '../util/util';\nimport {browser} from '../util/browser';\nimport Point from '@mapbox/point-geometry';\nimport {type MapControlsDeltas} from '../geo/projection/camera_helper';\nimport type {LngLat} from '../geo/lng_lat';\nimport type {ITransform} from '../geo/transform_interface';\nimport type {Terrain} from '../render/terrain';\n\nconst isMoving = (p: EventsInProgress) => p.zoom || p.drag || p.roll || 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: Point[], mapTouches: Touch[]) => HandlerResult | void;\n    readonly touchmove?: (e: TouchEvent, points: Point[], mapTouches: Touch[]) => HandlerResult | void;\n    readonly touchmoveWindow?: (e: TouchEvent, points: Point[], mapTouches: Touch[]) => HandlerResult | void;\n    readonly touchend?: (e: TouchEvent, points: Point[], mapTouches: Touch[]) => HandlerResult | void;\n    readonly touchcancel?: (e: TouchEvent, points: Point[], mapTouches: 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    rollDelta?: 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) => void;\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    roll?: EventInProgress;\n    pitch?: EventInProgress;\n    rotate?: EventInProgress;\n    drag?: EventInProgress;\n};\n\nexport type MapControlsScenarioOptions = {\n    terrain?: Terrain | null;\n    tr: ITransform;\n    deltasForHelper: MapControlsDeltas;\n    preZoomAroundLoc: LngLat;\n    combinedEventsInProgress: EventsInProgress;\n    panDelta?: Point;\n};\n\nfunction hasChange(result: HandlerResult) {\n    return result.panDelta?.mag() || result.zoomDelta || result.bearingDelta || result.pitchDelta || result.rollDelta;\n}\n\nexport class HandlerManager {\n    _map: Map;\n    _el: HTMLElement;\n    _handlers: Array<{\n        handlerName: string;\n        handler: Handler;\n        allowed: 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    /**\n     * @internal\n     * The document that contains the map container element, for cross-window support.\n     */\n    get _ownerDocument(): Document {\n        return this._el?.ownerDocument || document;\n    }\n\n    /**\n     * @internal\n     * The window that contains the map container element, for cross-window support.\n     */\n    get _ownerWindow(): Window {\n        return this._el?.ownerDocument?.defaultView || window;\n    }\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            [this._ownerDocument, 'mousemove', {capture: true}],\n            [this._ownerDocument, '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            [this._ownerWindow, 'blur', undefined]\n        ];\n\n        for (const [target, type, listenerOptions] of this._listeners) {\n            target.addEventListener(type, target === this._ownerDocument ? this.handleWindowEvent : this.handleEvent, listenerOptions);\n        }\n    }\n\n    destroy() {\n        for (const [target, type, listenerOptions] of this._listeners) {\n            target.removeEventListener(type, target === this._ownerDocument ? 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        const getCenter = () => map.project(map.getCenter());\n        const mouseRotate = generateMouseRotationHandler(options, getCenter);\n        const mousePitch = generateMousePitchHandler(options);\n        const mouseRoll = generateMouseRollHandler(options, getCenter);\n        map.dragRotate = new DragRotateHandler(options, mouseRotate, mousePitch, mouseRoll);\n        this._add('mouseRotate', mouseRotate, ['mousePitch']);\n        this._add('mousePitch', mousePitch, ['mouseRotate', 'mouseRoll']);\n        this._add('mouseRoll', mouseRoll, ['mousePitch']);\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        this._add('blockableMapEvent', new BlockableMapEventHandler(map));\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\n    _add(handlerName: string, handler: Handler, allowed?: 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: string[], myName: string) {\n        for (const name in activeHandlers) {\n            if (name === myName) continue;\n            if (!allowed?.includes(name)) {\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\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                    if (isPointableEvent(e, eventName || e.type)){\n                        const point = DOM.mousePos(this._map.getCanvas(), e);\n                        data = handler[eventName || e.type](e, point);\n                    } else if (isTouchableEvent(e, eventName || e.type)) {\n                        const eventTouches = e.touches;\n                        const mapTouches = this._getMapTouches(eventTouches);\n                        const points = DOM.touchPos(this._map.getCanvas(), mapTouches);\n                        data = handler[eventName || e.type](e, points, mapTouches);\n                    } else if (!isTouchableOrPointableType(eventName || e.type)) {\n                        data = handler[eventName || e.type](e);\n                    }\n                    this.mergeHandlerResult(mergedHandlerResult, eventsInProgress, data, handlerName, inputEvent);\n                    if (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.rollDelta !== undefined) {\n            eventsInProgress.roll = 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.rollDelta) combined.rollDelta = (combined.rollDelta || 0) + change.rollDelta;\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            this._fireEvents(combinedEventsInProgress, deactivatedHandlers, true); return;\n        }\n\n        // stop any ongoing camera animations (easeTo, flyTo)\n        map._stop(true);\n\n        let {panDelta, zoomDelta, bearingDelta, pitchDelta, rollDelta, around, pinchAround} = combinedResult;\n\n        if (pinchAround !== undefined) {\n            around = pinchAround;\n        }\n\n        around ||= map.transform.centerPoint;\n\n        if (terrain && !tr.isPointOnMapSurface(around)) {\n            around = tr.centerPoint;\n        }\n\n        const deltasForHelper: MapControlsDeltas = {\n            panDelta,\n            zoomDelta,\n            rollDelta,\n            pitchDelta,\n            bearingDelta,\n            around,\n        };\n\n        // Pre-zoom location under the mouse cursor is required for accurate mercator panning and zooming\n        if (this._map.cameraHelper.useGlobeControls && !tr.isPointOnMapSurface(around)) {\n            around = tr.centerPoint;\n        }\n        // If we are rotating about the center point, avoid numerical issues near the horizon by using the transform's\n        // center directly, instead of computing it from the screen point\n        const preZoomAroundLoc = around.distSqr(tr.centerPoint) < 1.0e-2 ?\n            tr.center :\n            tr.screenPointToLocation(panDelta ? around.sub(panDelta) : around);\n\n        this._handleMapControls({\n            terrain,\n            tr,\n            deltasForHelper,\n            preZoomAroundLoc,\n            combinedEventsInProgress,\n            panDelta,\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    _handleMapControls({\n        terrain,\n        tr,\n        deltasForHelper,\n        preZoomAroundLoc,\n        combinedEventsInProgress,\n        panDelta}: MapControlsScenarioOptions) {\n\n        const cameraHelper = this._map.cameraHelper;\n\n        cameraHelper.handleMapControlsRollPitchBearingZoom(deltasForHelper, tr);\n\n        if (!terrain) {\n            cameraHelper.handleMapControlsPan(deltasForHelper, tr, preZoomAroundLoc);\n            return;\n        }\n\n        if (cameraHelper.useGlobeControls) {\n            if (!this._terrainMovement && (combinedEventsInProgress.drag || combinedEventsInProgress.zoom)) {\n                this._terrainMovement = true;\n                this._map._elevationFreeze = true;\n            }\n            cameraHelper.handleMapControlsPan(deltasForHelper, tr, preZoomAroundLoc);\n            return;\n        }\n\n        if (!this._terrainMovement && (combinedEventsInProgress.drag || combinedEventsInProgress.zoom)) {\n            this._terrainMovement = true;\n            this._map._elevationFreeze = true;\n            cameraHelper.handleMapControlsPan(deltasForHelper, tr, preZoomAroundLoc);\n            return;\n        }\n\n        if (combinedEventsInProgress.drag && this._terrainMovement && panDelta) {\n            tr.setCenter(tr.screenPointToLocation(tr.centerPoint.sub(panDelta)));\n            return;\n        }\n\n        cameraHelper.handleMapControlsPan(deltasForHelper, tr, preZoomAroundLoc);\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            if (this._map.getCenterClampedToGround()) {\n                tr.recalculateZoomAndCenter(this._map.terrain);\n            }\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, wrap, defaultEasing, pick, scaleZoom, evaluateZoomSnap} from '../util/util';\nimport {interpolates} from '@maplibre/maplibre-gl-style-spec';\nimport {browser} from '../util/browser';\nimport {now} from '../util/time_control';\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 {MercatorCoordinate} from '../geo/mercator_coordinate';\n\nimport type {Terrain} from '../render/terrain';\nimport type {ITransform} from '../geo/transform_interface';\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';\nimport type {ICameraHelper} from '../geo/projection/camera_helper';\n\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 * Options common to {@link Map.jumpTo}, {@link Map.easeTo}, and {@link Map.flyTo}, controlling the desired location,\n * zoom, bearing, pitch, and roll 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-pitch-and-bearing/)\n * @see [Jump to a series of locations](https://maplibre.org/maplibre-gl-js/docs/examples/jump-to-a-series-of-locations/)\n * @see [Fly to a location](https://maplibre.org/maplibre-gl-js/docs/examples/fly-to-a-location/)\n * @see [Display buildings in 3D](https://maplibre.org/maplibre-gl-js/docs/examples/display-buildings-in-3d/)\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     * The desired roll in degrees. The roll is the angle about the camera boresight.\n     */\n    roll?: number;\n    /**\n     * The elevation of the center point in meters above sea level.\n     */\n    elevation?: number;\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 mercator 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 | 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` screenfulls every second. A _screenfull_ 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 screenfulls\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 | PaddingOptions;\n};\n\n/**\n * The {@link Map.easeTo} options object\n */\nexport type EaseToOptions = AnimationOptions & CameraOptions & {\n    delayEndEvents?: number;\n    padding?: number | PaddingOptions;\n    /**\n     * If `zoom` is specified, `around` determines the point around which the zoom is centered.\n     */\n    around?: LngLatLike;\n    easeId?: string;\n    noMoveStart?: boolean;\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    roll: number;\n    pitch: number;\n    bearing: number;\n    elevation: number;\n}) => {\n    center?: LngLat;\n    zoom?: number;\n    roll?: number;\n    pitch?: number;\n    bearing?: number;\n    elevation?: number;\n};\n\nexport abstract class Camera extends Evented {\n    transform: ITransform;\n    cameraHelper: ICameraHelper;\n    terrain: Terrain;\n    handlers: HandlerManager;\n\n    _moving: boolean;\n    _zooming: boolean;\n    _rotating: boolean;\n    _pitching: boolean;\n    _rolling: boolean;\n    _padding: boolean;\n\n    _bearingSnap: number;\n    _zoomSnap: 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?: ITransform;\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    /**\n     * @internal\n     * If true, the elevation of the center point will automatically be set to the terrain elevation\n     * (or zero if terrain is not enabled). If false, the elevation of the center point will default\n     * to sea level and will not automatically update. Defaults to true. Needs to be set to false to\n     * keep the camera above ground when pitch \\> 90 degrees.\n     */\n    _centerClampedToGround: boolean;\n\n    abstract _requestRenderFrame(a: () => void): TaskID;\n    abstract _cancelRenderFrame(_: TaskID): void;\n\n    constructor(transform: ITransform, cameraHelper: ICameraHelper, options: {\n        bearingSnap: number;\n        zoomSnap: number;\n    }) {\n        super();\n        this._moving = false;\n        this._zooming = false;\n        this.transform = transform;\n        this._bearingSnap = options.bearingSnap;\n        this._zoomSnap = options.zoomSnap;\n        this.cameraHelper = cameraHelper;\n\n        this.on('moveend', () => {\n            delete this._requestedCameraState;\n        });\n    }\n\n    /**\n     * @internal\n     * Creates a new specialized transform instance from a projection instance and migrates\n     * to this new transform, carrying over all the properties of the old transform (center, pitch, etc.).\n     * When the style's projection is changed (or first set), this function should be called.\n     */\n    migrateProjection(newTransform: ITransform, newCameraHelper: ICameraHelper) {\n        newTransform.apply(this.transform, true);\n        this.transform = newTransform;\n        this.cameraHelper = newCameraHelper;\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     * Returns the elevation of the map's center point.\n     *\n     * @returns The elevation of the map's center point, in meters above sea level.\n     */\n    getCenterElevation(): number { return this.transform.elevation; }\n\n    /**\n     * Sets the elevation of the map's center point, in meters above sea level. Equivalent to `jumpTo({elevation: elevation})`.\n     *\n     * Triggers the following events: `movestart` and `moveend`.\n     *\n     * @param elevation - The elevation to set, in meters above sea level.\n     * @param eventData - Additional properties to be added to event objects of events triggered by this method.\n     */\n    setCenterElevation(elevation: number, eventData?: any): this {\n        this.jumpTo({elevation}, eventData);\n        return this;\n    }\n\n    /**\n     * Returns the value of `centerClampedToGround`.\n     *\n     * If true, the elevation of the center point will automatically be set to the terrain elevation\n     * (or zero if terrain is not enabled). If false, the elevation of the center point will default\n     * to sea level and will not automatically update. Defaults to true. Needs to be set to false to\n     * keep the camera above ground when pitch \\> 90 degrees.\n     */\n    getCenterClampedToGround(): boolean { return this._centerClampedToGround; }\n\n    /**\n     * Sets the value of `centerClampedToGround`.\n     *\n     * If true, the elevation of the center point will automatically be set to the terrain elevation\n     * (or zero if terrain is not enabled). If false, the elevation of the center point will default\n     * to sea level and will not automatically update. Defaults to true. Needs to be set to false to\n     * keep the camera above ground when pitch \\> 90 degrees.\n     */\n    setCenterClampedToGround(centerClampedToGround: boolean): void {\n        this._centerClampedToGround = centerClampedToGround;\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/navigate-the-map-with-game-like-controls/)\n     */\n    panBy(offset: PointLike, options?: EaseToOptions, 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/update-a-feature-in-realtime/)\n     */\n    panTo(lnglat: LngLatLike, options?: EaseToOptions, 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?: EaseToOptions | null, eventData?: any): this {\n        return this.easeTo(extend({\n            zoom\n        }, options), eventData);\n    }\n\n    /**\n     * Incrementally increases the map's zoom level by 1, first snapping to the nearest `zoomSnap` increment.\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(evaluateZoomSnap(this.getZoom() + 1, this._zoomSnap), options, eventData);\n        return this;\n    }\n\n    /**\n     * Decreases the map's zoom level by 1, first snapping to the nearest `zoomSnap` increment.\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(evaluateZoomSnap(this.getZoom() - 1, this._zoomSnap), options, eventData);\n        return this;\n    }\n\n    /**\n     * Returns the map's current vertical field of view, in degrees.\n     *\n     * @returns The map's current vertical field of view.\n     * @defaultValue 36.87\n     * @example\n     * ```ts\n     * const verticalFieldOfView = map.getVerticalFieldOfView();\n     * ```\n     */\n    getVerticalFieldOfView(): number { return this.transform.fov; }\n\n    /**\n     * Sets the map's vertical field of view, in degrees.\n     *\n     * Triggers the following events: `movestart`, `move`, and `moveend`.\n     *\n     * @param fov - The vertical field of view to set, in degrees (0-180).\n     * @param eventData - Additional properties to be added to event objects of events triggered by this method.\n     * @defaultValue 36.87\n     * @example\n     * Change vertical field of view to 30 degrees\n     * ```ts\n     * map.setVerticalFieldOfView(30);\n     * ```\n     */\n    setVerticalFieldOfView(fov: number, eventData?: any): this {\n        if (fov != this.transform.fov) {\n            this.transform.setFov(fov);\n            this.fire(new Event('movestart', eventData))\n                .fire(new Event('move', eventData))\n                .fire(new Event('moveend', eventData));\n        }\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\u00B0 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/navigate-the-map-with-game-like-controls/)\n     */\n    getBearing(): number { return this.transform.bearing; }\n\n    /**\n     * Sets the map's zoom snap level.\n     *\n     * @param snap - The zoom snap level to set.\n     */\n    setZoomSnap(snap: number): this {\n        this._zoomSnap = snap;\n        return this;\n    }\n\n    /**\n     * Returns the map's current zoom snap level.\n     *\n     * @returns The map's current zoom snap level.\n     */\n    getZoomSnap(): number {\n        return this._zoomSnap;\n    }\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\u00B0 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\u00B0 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?: EaseToOptions, 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\u00B0 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\u00B0 bearing) and pitch and roll are 0\u00B0, with an animated transition.\n     *\n     * Triggers the following events: `movestart`, `move`, `moveend`, `pitchstart`, `pitch`, `pitchend`, `rollstart`, `roll`, `rollend`, 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            roll: 0,\n            duration: 1000\n        }, options), eventData);\n        return this;\n    }\n\n    /**\n     * Snaps the map so that north is up (0\u00B0 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     * Returns the map's current roll angle.\n     *\n     * @returns The map's current roll, measured in degrees about the camera boresight.\n     */\n    getRoll(): number { return this.transform.roll; }\n\n    /**\n     * Sets the map's roll angle. Equivalent to `jumpTo({roll: roll})`.\n     *\n     * Triggers the following events: `movestart`, `moveend`, `rollstart`, and `rollend`.\n     *\n     * @param roll - The roll to set, measured in degrees about the camera boresight\n     * @param eventData - Additional properties to be added to event objects of events triggered by this method.\n     */\n    setRoll(roll: number, eventData?: any): this {\n        this.jumpTo({roll}, 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 {@link 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?.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 {@link Map.getMaxZoom} that fits\n     * the AABB defined by these 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        const padding = extend(defaultPadding, options.padding) as PaddingOptions;\n        options.padding = padding;\n        const tr = this.transform;\n        const bounds = new LngLatBounds(p0, p1);\n\n        const result = this.cameraHelper.cameraForBoxAndBearing(options, padding, bounds, bearing, tr);\n        if (result && this._zoomSnap) {\n            result.zoom = evaluateZoomSnap(result.zoom, this._zoomSnap, -1);\n        }\n        return result;\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 {@link 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/fit-a-map-to-a-bounding-box/)\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.screenPointToLocation(Point.convert(p0)),\n                this.transform.screenPointToLocation(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, pitch, and roll, 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`, `rollstart`, `roll`, `rollend` 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-a-series-of-locations/)\n     * @see [Update a feature in realtime](https://maplibre.org/maplibre-gl-js/docs/examples/update-a-feature-in-realtime/)\n     */\n    jumpTo(options: JumpToOptions, eventData?: any): this {\n        this.stop();\n\n        if ('zoom' in options && this._zoomSnap) {\n            options.zoom = evaluateZoomSnap(options.zoom, this._zoomSnap);\n        }\n\n        const tr = this._getTransformForUpdate();\n        let bearingChanged = false,\n            pitchChanged = false;\n        let rollChanged = false;\n\n        const oldZoom = tr.zoom;\n        if (this.terrain) {\n            tr.setElevation(this.terrain.getElevationForLngLatZoom(options.center ? LngLat.convert(options.center) : tr.center, options.zoom || tr.tileZoom));\n        }\n        this.cameraHelper.handleJumpToCenterZoom(tr, options);\n\n        const zoomChanged = tr.zoom !== oldZoom;\n\n        if ('elevation' in options && tr.elevation !== +options.elevation) {\n            tr.setElevation(+options.elevation);\n        }\n\n        if ('bearing' in options && tr.bearing !== +options.bearing) {\n            bearingChanged = true;\n            tr.setBearing(+options.bearing);\n        }\n\n        if ('pitch' in options && tr.pitch !== +options.pitch) {\n            pitchChanged = true;\n            tr.setPitch(+options.pitch);\n        }\n\n        if ('roll' in options && tr.roll !== +options.roll) {\n            rollChanged = true;\n            tr.setRoll(+options.roll);\n        }\n\n        if (options.padding != null && !tr.isPaddingEqual(options.padding)) {\n            tr.setPadding(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        if (rollChanged) {\n            this.fire(new Event('rollstart', eventData))\n                .fire(new Event('roll', eventData))\n                .fire(new Event('rollend', eventData));\n        }\n\n        return this.fire(new Event('moveend', eventData));\n    }\n\n    /**\n     * Given a camera 'from' position and a position to look at (`to`), calculates zoom and camera rotation 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     * @example\n     * ```ts\n     * // Calculate options to look from (1\u00B0, 0\u00B0, 1000m) to (1\u00B0, 1\u00B0, 0m)\n     * const cameraLngLat = new LngLat(1, 0);\n     * const cameraAltitude = 1000;\n     * const targetLngLat = new LngLat(1, 1);\n     * const targetAltitude = 0;\n     * const cameraOptions = map.calculateCameraOptionsFromTo(cameraLngLat, cameraAltitude, targetLngLat, targetAltitude);\n     * // Apply calculated options\n     * map.jumpTo(cameraOptions);\n     * ```\n     */\n    calculateCameraOptionsFromTo(from: LngLatLike, altitudeFrom: number, to: LngLatLike, altitudeTo: number = 0): CameraOptions {\n        const fromMercator = MercatorCoordinate.fromLngLat(from, altitudeFrom);\n        const toMercator = MercatorCoordinate.fromLngLat(to, altitudeTo);\n        const dx = toMercator.x - fromMercator.x;\n        const dy = toMercator.y - fromMercator.y;\n        const dz = toMercator.z - fromMercator.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 = 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: toMercator.toLngLat(),\n            elevation: altitudeTo,\n            zoom,\n            pitch,\n            bearing\n        };\n    }\n\n    /**\n     * Given a camera position and rotation, calculates zoom and center point and returns them as {@link CameraOptions}.\n     * @param cameraLngLat - The lng, lat of the camera to look from\n     * @param cameraAlt - The altitude of the camera to look from, in meters above sea level\n     * @param bearing - Bearing of the camera, in degrees\n     * @param pitch - Pitch of the camera, in degrees\n     * @param roll - Roll of the camera, in degrees\n     * @returns the calculated camera options\n     * @example\n     * ```ts\n     * // Calculate options to look from camera position(1\u00B0, 0\u00B0, 1000m) with bearing = 90\u00B0, pitch = 30\u00B0, and roll = 45\u00B0\n     * const cameraLngLat = new LngLat(1, 0);\n     * const cameraAltitude = 1000;\n     * const bearing = 90;\n     * const pitch = 30;\n     * const roll = 45;\n     * const cameraOptions = map.calculateCameraOptionsFromCameraLngLatAltRotation(cameraLngLat, cameraAltitude, bearing, pitch, roll);\n     * // Apply calculated options\n     * map.jumpTo(cameraOptions);\n     * ```\n     */\n    calculateCameraOptionsFromCameraLngLatAltRotation(cameraLngLat: LngLatLike, cameraAlt: number, bearing: number, pitch: number, roll?: number): CameraOptions {\n        const centerInfo = this.transform.calculateCenterFromCameraLngLatAlt(cameraLngLat, cameraAlt, bearing, pitch);\n        return {\n            center: centerInfo.center,\n            elevation: centerInfo.elevation,\n            zoom: centerInfo.zoom,\n            bearing,\n            pitch,\n            roll\n        };\n    }\n\n    /**\n     * Changes any combination of `center`, `zoom`, `bearing`, `pitch`, `roll`, 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 \"Reduced Motion\"\n     *     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`, `rollstart`, `roll`, `rollend`, 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/navigate-the-map-with-game-like-controls/)\n     */\n    easeTo(options: EaseToOptions, 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 ('zoom' in options && this._zoomSnap) {\n            options.zoom = evaluateZoomSnap(options.zoom, this._zoomSnap);\n        }\n\n        if (options.animate === false || (!options.essential && browser.prefersReducedMotion)) {\n            options.duration = 0;\n        }\n\n        const tr = this._getTransformForUpdate();\n        const startBearing = this.getBearing(),\n            startPitch = tr.pitch,\n            startRoll = tr.roll,\n            bearing = 'bearing' in options ? this._normalizeBearing(options.bearing, startBearing) : startBearing,\n            pitch = 'pitch' in options ? +options.pitch : startPitch,\n            roll = 'roll' in options ? this._normalizeBearing(options.roll, startRoll) : startRoll,\n            padding = ('padding' in options ? options.padding : tr.padding) as PaddingOptions;\n        const offsetAsPoint = Point.convert(options.offset);\n\n        let around, aroundPoint;\n\n        if (options.around) {\n            around = LngLat.convert(options.around);\n            aroundPoint = tr.locationToScreenPoint(around);\n        }\n\n        const currently = {\n            moving: this._moving,\n            zooming: this._zooming,\n            rotating: this._rotating,\n            pitching: this._pitching,\n            rolling: this._rolling\n        };\n\n        const easeHandler = this.cameraHelper.handleEaseTo(tr, {\n            bearing,\n            pitch,\n            roll,\n            padding,\n            around,\n            aroundPoint,\n            offsetAsPoint,\n            offset: options.offset,\n            zoom: options.zoom,\n            center: options.center,\n        });\n\n        this._rotating ||= (startBearing !== bearing);\n        this._pitching ||= (pitch !== startPitch);\n        this._rolling ||= (roll !== startRoll);\n        this._padding = !tr.isPaddingEqual(padding);\n        this._zooming ||= easeHandler.isZooming;\n        this._easeId = options.easeId;\n        this._prepareEase(eventData, options.noMoveStart, currently);\n\n        if (this.terrain) {\n            this._prepareElevation(easeHandler.elevationCenter);\n        }\n\n        this._ease((k) => {\n            easeHandler.easeFunc(k);\n\n            if (this.terrain && !options.freezeElevation) this._updateElevation(k);\n            this._applyUpdatedTransform(tr);\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,\n        currently: { moving?: boolean; zooming?: boolean; rotating?: boolean; pitching?: boolean; rolling?: boolean} = {}) {\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        if (this._rolling && !currently.rolling) {\n            this.fire(new Event('rollstart', 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\n        if (this._elevationStart === undefined || this._elevationCenter === undefined) {\n            this._prepareElevation(this.transform.center);\n        }\n\n        this.transform.setMinElevationForCurrentTile(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.setElevation(interpolates.number(this._elevationStart, this._elevationTarget, k));\n    }\n\n    _finalizeElevation() {\n        this._elevationFreeze = false;\n        if (this.getCenterClampedToGround()) {\n            this.transform.recalculateZoomAndCenter(this.terrain);\n        }\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(): ITransform {\n        if (!this.transformCameraUpdate && !this.terrain) return this.transform;\n\n        this._requestedCameraState ||= this.transform.clone();\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: ITransform) : { pitch?: number; zoom?: number } {\n        if (!this.terrain && tr.elevation >= 0 && tr.pitch <= 90) {\n            return {};\n        }\n        const cameraLngLat = tr.getCameraLngLat();\n        const cameraAltitude = tr.getCameraAltitude();\n        const minAltitude = this.terrain ? this.terrain.getElevationForLngLatZoom(cameraLngLat, tr.zoom) : 0;\n        if (cameraAltitude < minAltitude) {\n            const newCamera = this.calculateCameraOptionsFromTo(\n                cameraLngLat, 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: ITransform) {\n        const modifiers : Array<(tr: ITransform) => ReturnType<CameraUpdateTransformFunction>> = [];\n        modifiers.push(tr => this._elevateCameraIfInsideTerrain(tr));\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                roll,\n                pitch,\n                bearing,\n                elevation\n            } = modifier(nextTransform);\n            if (center) nextTransform.setCenter(center);\n            if (elevation !== undefined) nextTransform.setElevation(elevation);\n            if (zoom !== undefined) nextTransform.setZoom(zoom);\n            if (roll !== undefined) nextTransform.setRoll(roll);\n            if (pitch !== undefined) nextTransform.setPitch(pitch);\n            if (bearing !== undefined) nextTransform.setBearing(bearing);\n            finalTransform.apply(nextTransform, false);\n        }\n        this.transform.apply(finalTransform, false);\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        if (this._rolling) {\n            this.fire(new Event('roll', 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        const wasRolling = this._rolling;\n        this._moving = false;\n        this._zooming = false;\n        this._rotating = false;\n        this._pitching = false;\n        this._rolling = 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        if (wasRolling) {\n            this.fire(new Event('rollend', eventData));\n        }\n        this.fire(new Event('moveend', eventData));\n    }\n\n    /**\n     * Changes any combination of center, zoom, bearing, pitch, and roll, 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 \"Reduced Motion\"\n     *     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`, `rollstart`, `roll`, `rollend`, 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/fly-to-a-location/)\n     * @see [Slowly fly to a location](https://maplibre.org/maplibre-gl-js/docs/examples/slowly-fly-to-a-location/)\n     * @see [Fly to a location based on scroll position](https://maplibre.org/maplibre-gl-js/docs/examples/fly-to-a-location-based-on-scroll-position/)\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', 'roll', 'elevation', 'padding']) as JumpToOptions;\n            return this.jumpTo(coercedOptions, eventData);\n        }\n\n        // This method implements an \u201Coptimal path\u201D animation, as detailed in:\n        //\n        // Van Wijk, Jarke J.; Nuij, Wim A. A. \u201CSmooth and efficient zooming and panning.\u201D INFOVIS\n        //   \u201903. pp. 15\u201322. <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        if ('zoom' in options && this._zoomSnap) {\n            options.zoom = evaluateZoomSnap(options.zoom, this._zoomSnap);\n        }\n\n        const tr = this._getTransformForUpdate(),\n            startBearing = tr.bearing,\n            startPitch = tr.pitch,\n            startRoll = tr.roll,\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 roll = 'roll' in options ? this._normalizeBearing(options.roll, startRoll) : startRoll;\n        const padding = ('padding' in options ? options.padding : tr.padding) as PaddingOptions;\n\n        const offsetAsPoint = Point.convert(options.offset);\n        let pointAtOffset = tr.centerPoint.add(offsetAsPoint);\n        const locationAtOffset = tr.screenPointToLocation(pointAtOffset);\n\n        const flyToHandler = this.cameraHelper.handleFlyTo(tr, {\n            bearing,\n            pitch,\n            roll,\n            padding,\n            locationAtOffset,\n            offsetAsPoint,\n            center: options.center,\n            minZoom: options.minZoom,\n            zoom: options.zoom,\n        });\n\n        let rho = options.curve;\n\n        // w\u2080: Initial visible span, measured in pixels at the initial scale.\n        const w0 = Math.max(tr.width, tr.height);\n        // w\u2081: Final visible span, measured in pixels with respect to the initial scale.\n        const w1 = w0 / flyToHandler.scaleOfZoom;\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        const u1 = flyToHandler.pixelPathLength;\n\n        if (typeof flyToHandler.scaleOfMinZoom === 'number') {\n            // w<sub>m</sub>: Maximum visible span, measured in pixels with respect to the initial\n            // scale.\n            const wMax = w0 / flyToHandler.scaleOfMinZoom;\n            rho = Math.sqrt(wMax / u1 * 2);\n        }\n\n        // \u03C1\u00B2\n        const rho2 = rho * rho;\n\n        /**\n         * r\u1D62: 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\u2080: 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. Uses the current vertical field of view setting.\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 \u03C1-screenfulls.\n        let S = (zoomOutFactor(true) - r0) / rho;\n\n        // When u\u2080 = u\u2081, the optimal path doesn\u2019t require both ascent and descent.\n        if (Math.abs(u1) < 0.000002 || !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._rolling = (roll !== startRoll);\n        this._padding = !tr.isPaddingEqual(padding);\n\n        this._prepareEase(eventData, false);\n        if (this.terrain) this._prepareElevation(flyToHandler.targetCenter);\n\n        this._ease((k) => {\n            // s: The distance traveled along the flight path, measured in \u03C1-screenfulls.\n            const s = k * S;\n            const scale = 1 / w(s);\n            const centerFactor = u(s);\n            if (this._rotating) {\n                tr.setBearing(interpolates.number(startBearing, bearing, k));\n            }\n            if (this._pitching) {\n                tr.setPitch(interpolates.number(startPitch, pitch, k));\n            }\n            if (this._rolling) {\n                tr.setRoll(interpolates.number(startRoll, roll, k));\n            }\n            if (this._padding) {\n                tr.interpolatePadding(startPadding, padding, 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            flyToHandler.easeFunc(k, scale, centerFactor, pointAtOffset);\n\n            if (this.terrain && !options.freezeElevation) this._updateElevation(k);\n            this._applyUpdatedTransform(tr);\n            this._fireMoveEvents(eventData);\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 = 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((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    /**\n     * Gets the elevation at a given location, in meters above sea level.\n     * Returns null if terrain is not enabled.\n     * If terrain is enabled with some exaggeration value, the value returned here will be reflective of (multiplied by) that exaggeration value.\n     * This method should be used for proper positioning of custom 3d objects, as explained [here](https://maplibre.org/maplibre-gl-js/docs/examples/adding-3d-models-using-threejs-on-terrain/)\n     * @param lngLatLike - [x,y] or LngLat coordinates of the location\n     * @returns elevation in meters\n     */\n    queryTerrainElevation(lngLatLike: LngLatLike): number | null {\n        if (!this.terrain) {\n            return null;\n        }\n        return this.terrain.getElevationForLngLat(LngLat.convert(lngLatLike), this.transform);\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 | 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 * @see [Change the default position for attribution](https://maplibre.org/maplibre-gl-js/docs/examples/change-the-default-position-for-attribution/)\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        this._container.remove();\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: 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 tileManagers = this._map.style.tileManagers;\n        for (const id in tileManagers) {\n            const tileManager = tileManagers[id];\n            if (tileManager.used || tileManager.usedForTerrain) {\n                const source = tileManager.getSource();\n                if (source.attribution && !attributions.includes(source.attribution)) {\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].includes(attrib)) { 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 = DOM.sanitize(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 */\nexport type 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?.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        this._container.remove();\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: Task[];\n    _id: TaskID;\n    _cleared: boolean;\n    _currentlyRunning: 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 {type 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 {ITransform} from '../geo/transform_interface';\nimport type {TileManager} from './tile_manager';\nimport type {Source} from '../source/source';\nimport {type Terrain} from '../render/terrain';\nimport {now} from '../util/time_control';\nimport {coveringTiles} from '../geo/projection/covering_tiles';\nimport {createMat4f64} from '../util/util';\nimport {type CanonicalTileRange} from '../source/image_source';\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 TerrainTileManager extends Evented {\n    /**\n     * tile manager for the raster-dem source.\n     */\n    tileManager: TileManager;\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: 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     * used to determine whether depth & coord framebuffers need updating\n     */\n    _lastTilesetChange: number = now();\n\n    constructor(tileManager: TileManager) {\n        super();\n        this.tileManager = tileManager;\n        this._tiles = {};\n        this._renderableTilesKeys = [];\n        this._sourceTileCache = {};\n        this.minzoom = 0;\n        this.maxzoom = 22;\n        this.deltaZoom = 1;\n        this.tileSize = tileManager._source.tileSize * 2 ** this.deltaZoom;\n        tileManager.usedForTerrain = true;\n        tileManager.tileSize = this.tileSize;\n    }\n\n    destruct() {\n        this.tileManager.usedForTerrain = false;\n        this.tileManager.tileSize = null;\n    }\n\n    getSource(): Source {\n        return this.tileManager._source;\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: ITransform, terrain: Terrain): void {\n        // load raster-dem tiles for the current scene.\n        this.tileManager.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 coveringTiles(transform, {\n            tileSize: this.tileSize,\n            minzoom: this.minzoom,\n            maxzoom: this.maxzoom,\n            reparseOverscaled: false,\n            terrain,\n            calculateTileZoom: this.tileManager._source.calculateTileZoom\n        })) {\n            keys[tileID.key] = true;\n            this._renderableTilesKeys.push(tileID.key);\n            if (!this._tiles[tileID.key]) {\n                tileID.terrainRttPosMatrix32f = new Float64Array(16) as any;\n                mat4.ortho(tileID.terrainRttPosMatrix32f, 0, EXTENT, EXTENT, 0, 0, 1);\n                this._tiles[tileID.key] = new Tile(tileID, this.tileSize);\n                this._lastTilesetChange = now();\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(): 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(\n        tileID: OverscaledTileID,\n        terrainTileRanges?: {[zoom: string]: CanonicalTileRange}\n    ): Record<string, OverscaledTileID> {\n        if (terrainTileRanges) {\n            return this._getTerrainCoordsForTileRanges(tileID, terrainTileRanges);\n        } else {\n            return this._getTerrainCoordsForRegularTile(tileID);\n        }\n    }\n\n    /**\n     * Searches for the corresponding current renderable terrain-tiles.\n     * Includes terrain tiles that are either:\n     * - the same as the tileID\n     * - a parent of the tileID\n     * - a child of the tileID\n     * @param tileID - the tile to look for\n     * @returns the tiles that were found\n     */\n    _getTerrainCoordsForRegularTile(tileID: OverscaledTileID): Record<string, OverscaledTileID> {\n        const coords: Record<string, OverscaledTileID> = {};\n        for (const key of this._renderableTilesKeys) {\n            const terrainTileID = this._tiles[key].tileID;\n            const coord = tileID.clone();\n            const mat = createMat4f64();\n            if (terrainTileID.canonical.equals(tileID.canonical)) {\n                mat4.ortho(mat, 0, EXTENT, EXTENT, 0, 0, 1);\n            } else if (terrainTileID.canonical.isChildOf(tileID.canonical)) {\n                const dz = terrainTileID.canonical.z - tileID.canonical.z;\n                const dx = terrainTileID.canonical.x - (terrainTileID.canonical.x >> dz << dz);\n                const dy = terrainTileID.canonical.y - (terrainTileID.canonical.y >> dz << dz);\n                const size = EXTENT >> dz;\n                mat4.ortho(mat, 0, size, size, 0, 0, 1); // Note: we are using `size` instead of `EXTENT` here\n                mat4.translate(mat, mat, [-dx * size, -dy * size, 0]);\n            } else if (tileID.canonical.isChildOf(terrainTileID.canonical)) {\n                const dz = tileID.canonical.z - terrainTileID.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(mat, 0, EXTENT, EXTENT, 0, 0, 1);\n                mat4.translate(mat, mat, [dx * size, dy * size, 0]);\n                mat4.scale(mat, mat, [1 / (2 ** dz), 1 / (2 ** dz), 0]);\n            } else {\n                continue;\n            }\n            coord.terrainRttPosMatrix32f = new Float32Array(mat);\n            coords[key] = coord;\n        }\n        return coords;\n    }\n\n    /**\n     * Searches for the corresponding current renderable terrain-tiles.\n     * Includes terrain tiles that are within terrain tile ranges.\n     * @param tileID - the tile to look for\n     * @returns the tiles that were found\n     */\n    _getTerrainCoordsForTileRanges(\n        tileID: OverscaledTileID,\n        terrainTileRanges: {[zoom: string]: CanonicalTileRange}\n    ): Record<string, OverscaledTileID> {\n        const coords: Record<string, OverscaledTileID> = {};\n        for (const key of this._renderableTilesKeys) {\n            const terrainTileID = this._tiles[key].tileID;\n            if (!this._isWithinTileRanges(terrainTileID, terrainTileRanges)) {\n                continue;\n            }\n\n            const coord = tileID.clone();\n            const mat = createMat4f64();\n            if (terrainTileID.canonical.z === tileID.canonical.z) {\n                const dx = tileID.canonical.x - terrainTileID.canonical.x\n                    + tileID.wrap * (1 << tileID.canonical.z); // include wrap shift\n                const dy = tileID.canonical.y - terrainTileID.canonical.y;\n                mat4.ortho(mat, 0, EXTENT, EXTENT, 0, 0, 1);\n                mat4.translate(mat, mat, [dx * EXTENT, dy * EXTENT, 0]);\n            } else if (terrainTileID.canonical.z > tileID.canonical.z) {\n                const dz = terrainTileID.canonical.z - tileID.canonical.z;\n                // this translation is needed to project tileID to terrainTileID zoom level\n                const dx = terrainTileID.canonical.x - (terrainTileID.canonical.x >> dz << dz)\n                    + tileID.wrap * (1 << terrainTileID.canonical.z); // include wrap shift\n                const dy = terrainTileID.canonical.y - (terrainTileID.canonical.y >> dz << dz);\n                // this translation is needed if terrainTileID is not a parent of tileID\n                const dx2 = tileID.canonical.x - (terrainTileID.canonical.x >> dz);\n                const dy2 = tileID.canonical.y - (terrainTileID.canonical.y >> dz);\n\n                const size = EXTENT >> dz;\n                mat4.ortho(mat, 0, size, size, 0, 0, 1);\n                mat4.translate(mat, mat, [-dx * size + dx2 * EXTENT, -dy * size + dy2 * EXTENT, 0]);\n            } else { // terrainTileID.canonical.z < tileID.canonical.z\n                const dz = tileID.canonical.z - terrainTileID.canonical.z;\n                // this translation is needed to project tileID to terrainTileID zoom level\n                const dx = tileID.canonical.x - (tileID.canonical.x >> dz << dz)\n                    + tileID.wrap * (1 << tileID.canonical.z); // include wrap shift\n                const dy = tileID.canonical.y - (tileID.canonical.y >> dz << dz);\n                // this translation is needed if terrainTileID is not a parent of tileID\n                const dx2 = (tileID.canonical.x >> dz) - terrainTileID.canonical.x;\n                const dy2 = (tileID.canonical.y >> dz) - terrainTileID.canonical.y;\n\n                const size = EXTENT << dz;\n                mat4.ortho(mat, 0, size, size, 0, 0, 1);\n                mat4.translate(mat, mat, [dx * EXTENT + dx2 * size, dy * EXTENT + dy2 * size, 0]);\n            }\n            coord.terrainRttPosMatrix32f = new Float32Array(mat);\n            coords[key] = coord;\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) source tiles with loaded dem.\n     * @returns the tile\n     */\n    getSourceTile(tileID: OverscaledTileID, searchForDEM?: boolean): Tile | undefined {\n        const source = this.tileManager._source;\n        let z = tileID.overscaledZ - this.deltaZoom;\n        if (z > source.maxzoom) z = source.maxzoom;\n        if (z < source.minzoom) return undefined;\n        // cache for tileID to terrain-tileID\n        this._sourceTileCache[tileID.key] ||= tileID.scaledTo(z).key;\n        let tile = this.findTileInCaches(this._sourceTileCache[tileID.key]);\n        // during tile-loading phase look if parent tiles (with loaded dem) are available.\n        if (!tile?.dem && searchForDEM) {\n            while (z >= source.minzoom && !tile?.dem)\n                tile = this.findTileInCaches(tileID.scaledTo(z--).key);\n        }\n        return tile;\n    }\n\n    findTileInCaches(key: string): Tile | undefined {\n        let tile = this.tileManager.getTileByID(key);\n        if (tile) {\n            return tile;\n        }\n        tile = this.tileManager._outOfViewCache.getByKey(key);\n        return tile;\n    }\n\n    /**\n     * gets whether any tiles were loaded after a specific time. This is used to update depth & coords framebuffers.\n     * @param time - the time\n     * @returns true if any tiles came into view at or after the specified time\n     */\n    anyTilesAfterTime(time = Date.now()): boolean {\n        return this._lastTilesetChange >= time;\n    }\n\n    /**\n     * Checks whether a tile is within the canonical tile ranges.\n     * @param tileID - Tile to check\n     * @param canonicalTileRanges - Canonical tile ranges\n     * @returns\n     */\n    private _isWithinTileRanges(\n        tileID: OverscaledTileID,\n        canonicalTileRanges: {[zoom: string]: CanonicalTileRange}\n    ): boolean {\n        const range = canonicalTileRanges[tileID.canonical.z];\n\n        return !!range && (\n            tileID.wrap > range.minWrap || tileID.wrap < range.maxWrap ||\n            tileID.canonical.x >= range.minTileXWrapped &&\n            tileID.canonical.x <= range.maxTileXWrapped &&\n            tileID.canonical.y >= range.minTileY &&\n            tileID.canonical.y <= range.maxTileY\n        );\n    }\n}\n", "import {mat4, vec2} from 'gl-matrix';\nimport {OverscaledTileID} from '../tile/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 {Texture} from '../webgl/texture';\nimport {MercatorCoordinate} from '../geo/mercator_coordinate';\nimport {TerrainTileManager} from '../tile/terrain_tile_manager';\nimport {EXTENT} from '../data/extent';\nimport {earthRadius, type LngLat} from '../geo/lng_lat';\nimport {Mesh} from './mesh';\nimport {isInBoundsForZoomLngLat} from '../util/world_bounds';\nimport {NORTH_POLE_Y, SOUTH_POLE_Y} from './subdivision';\nimport {coveringTiles} from '../geo/projection/covering_tiles';\nimport type Point from '@mapbox/point-geometry';\nimport type {Tile} from '../tile/tile';\nimport type {Framebuffer} from '../webgl/framebuffer';\nimport type {TileManager} from '../tile/tile_manager';\nimport type {TerrainSpecification} from '@maplibre/maplibre-gl-style-spec';\nimport type {Painter} from './painter';\nimport type {IReadonlyTransform} from '../geo/transform_interface';\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 tileManager this.tileManager\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.tileManager._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 tilemanager this terrain is based on\n     */\n    tileManager: TerrainTileManager;\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    _meshCache: { [key: string]: 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: 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, tileManager: TileManager, options: TerrainSpecification) {\n        this.painter = painter;\n        this.tileManager = new TerrainTileManager(tileManager);\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    destroy() {\n        if (this._fbo) {\n            this._fbo.destroy();\n            this._fbo = null;\n        }\n        if (this._fboCoordsTexture) {\n            this._fboCoordsTexture.destroy();\n            this._fboCoordsTexture = null;\n        }\n        if (this._fboDepthTexture) {\n            this._fboDepthTexture.destroy();\n            this._fboDepthTexture = null;\n        }\n        if (this._emptyDemTexture) {\n            this._emptyDemTexture.destroy();\n            this._emptyDemTexture = null;\n        }\n        if (this._emptyDepthTexture) {\n            this._emptyDepthTexture.destroy();\n            this._emptyDepthTexture = null;\n        }\n        if (this._coordsTexture) {\n            this._coordsTexture.destroy();\n            this._coordsTexture = null;\n        }\n        for (const key in this._meshCache) {\n            this._meshCache[key].destroy();\n        }\n        this._meshCache = {};\n        this.tileManager.destruct();\n    }\n\n    /**\n     * Get the elevation-value from original dem-data for a given tile-coordinate.\n     * Coordinates that fall outside `[0, extent)` are normalized to the\n     * appropriate neighbor tile before lookup.\n     * @param tileID - the tile to get the elevation for\n     * @param x - x coordinate relative to the tile, may be outside `[0, extent)`\n     * @param y - y coordinate relative to the tile, may be outside `[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        const normalized = tileID.normalizeCoordinates(x, y, extent);\n        if (!normalized) return 0;\n\n        const terrain = this.getTerrainData(normalized.tileID);\n        const dem = terrain.tile?.dem;\n        if (!dem) return 0;\n\n        const pos = vec2.transformMat4([] as any, [normalized.x / extent * EXTENT, normalized.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, use {@link getElevationForLngLat} if you don't want a specific zoom level, but more accurate results.\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 {@link LngLat} in respect of exaggeration.\n     * This will traverse up the zoom levels to find the first tile with data to return.\n     * @param lnglat - the location\n     * @returns the elevation\n     */\n    getElevationForLngLat(lnglat: LngLat, transform: IReadonlyTransform) {\n        const terrainCoveringTiles = coveringTiles(transform, {maxzoom: this.tileManager.maxzoom, minzoom: this.tileManager.minzoom, tileSize: 512, terrain: this});\n        let zoom = 0;\n        for (const tile of terrainCoveringTiles) {\n            if (tile.canonical.z > zoom) {\n                zoom = Math.min(tile.canonical.z, this.tileManager.maxzoom);\n            }\n        }\n        return this.getElevationForLngLatZoom(lnglat, zoom);\n    }\n\n    /**\n     * Get the elevation for given coordinate in respect of exaggeration.\n     * @param tileID - the tile id\n     * @param x - x coordinate relative to the tile, may be outside `[0, extent)`\n     * @param y - y coordinate relative to the tile, may be outside `[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.tileManager.getSourceTile(tileID, true);\n        if (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.toString() + sourceTile.tileID.key + tileID.key;\n        if (matrixKey && !this._demMatrixCache[matrixKey]) {\n            const maxzoom = this.tileManager.getSource().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[matrixKey] = {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?.dem?.dim || 1,\n            'u_terrain_matrix': matrixKey ? this._demMatrixCache[matrixKey].matrix : this._emptyDemMatrix,\n            'u_terrain_unpack': sourceTile?.dem?.getUnpackVector() || this._emptyDemUnpack,\n            'u_terrain_exaggeration': this.exaggeration,\n            texture: (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 set 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, or null, if the pixel doesn't lie on the terrain's surface (but the sky instead).\n     * @param p - Screen-Coordinate\n     * @returns Mercator coordinate for a screen pixel, or null, if the pixel is not covered by terrain (is in the sky).\n     */\n    pointCoordinate(p: Point): MercatorCoordinate {\n        // First, ensure the coords framebuffer is up to date.\n        this.painter.maybeDrawDepth(true);\n        this.painter.maybeDrawCoords();\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.tileManager.getTileByID(tileID);\n\n        if (!tile) {\n            return null;\n        }\n\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        return (rgba[0] / (256 * 256 * 256) + rgba[1] / (256 * 256) + rgba[2] / 256 + rgba[3]) / 256;\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(tileId: OverscaledTileID): Mesh {\n        const globeEnabled = this.painter.style.projection?.transitionState > 0;\n        const northPole = globeEnabled && tileId.canonical.y === 0;\n        const southPole = globeEnabled && tileId.canonical.y === (1 << tileId.canonical.z) - 1;\n        const key = `m_${northPole ? 'n' : ''}_${southPole ? 's' : ''}`;\n        if (this._meshCache[key]) {\n            return this._meshCache[key];\n        }\n        const context = this.painter.context;\n\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        }\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 stitching on tile boundaries with different zoomlevels\n        // top-bottom frame + pole vertices, if needed\n        const offsetTop = vertexArray.length;\n        const offsetTopEdge = 0;\n        const offsetBottom = offsetTop + (meshSize + 1);\n        const offsetBottomEdge = (meshSize + 1) * meshSize;\n        const northY = northPole ? NORTH_POLE_Y : 0;\n        const northZ = northPole ? 0 : 1;\n        const southY = southPole ? SOUTH_POLE_Y : EXTENT;\n        const southZ = southPole ? 0 : 1;\n        for (let x = 0; x <= meshSize; x++) {\n            vertexArray.emplaceBack(x * delta, northY, northZ);\n        }\n        for (let x = 0; x <= meshSize; x++) {\n            vertexArray.emplaceBack(x * delta, southY, southZ);\n        }\n        for (let x = 0; x < meshSize; x++) {\n            indexArray.emplaceBack(offsetBottomEdge + x, offsetBottom + x, offsetBottom + x + 1);\n            indexArray.emplaceBack(offsetBottomEdge + x, offsetBottom + x + 1, offsetBottomEdge + x + 1);\n            indexArray.emplaceBack(offsetTopEdge + x, offsetTop + x + 1, offsetTop + x);\n            indexArray.emplaceBack(offsetTopEdge + x, offsetTopEdge + x + 1, offsetTop + x + 1);\n        }\n        // left-right frame\n        const offsetLeft = vertexArray.length;\n        const 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        }\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\n        const mesh = new Mesh(\n            context.createVertexBuffer(vertexArray, pos3dAttributes.members),\n            context.createIndexBuffer(indexArray),\n            SegmentVector.simpleSegment(0, 0, vertexArray.length, indexArray.length)\n        );\n        this._meshCache[key] = mesh;\n        return mesh;\n    }\n\n    /**\n     * Calculates a height of the frame around the terrain-mesh to avoid stitching 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, Math.max(zoom, 0)) / 5;\n    }\n\n    getMinTileElevationForLngLatZoom(lnglat: LngLat, zoom: number) {\n        if (!isInBoundsForZoomLngLat(zoom, lnglat.wrap())) return 0;\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?.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 './texture';\nimport {type Context} from './context';\nimport {type 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: 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: 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        if (this._context.extTextureFilterAnisotropic) {\n            this._context.gl.texParameterf(this._context.gl.TEXTURE_2D, this._context.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT, this._context.extTextureFilterAnisotropicMax);\n        }\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 {type Painter, type RenderOptions} from '../render/painter';\nimport {type Tile} from '../tile/tile';\nimport {Color} from '@maplibre/maplibre-gl-style-spec';\nimport {type OverscaledTileID} from '../tile/tile_id';\nimport {drawTerrain} from './draw/draw_terrain';\nimport {type Style} from '../style/style';\nimport {type Terrain} from '../render/terrain';\nimport {RenderPool} from './render_pool';\nimport {type Texture} from './texture';\nimport type {StyleLayer} from '../style/style_layer';\nimport {ImageSource} from '../source/image_source';\n\n/**\n * lookup table which layers should rendered to texture\n */\nconst LAYERS_TO_TEXTURES: { [keyof in StyleLayer['type']]?: boolean } = {\n    background: true,\n    fill: true,\n    line: true,\n    raster: true,\n    hillshade: true,\n    'color-relief': 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     * coordsAscending 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    _coordsAscending: {[_: string]: {[_:string]: OverscaledTileID[]}};\n    /**\n     * fingerprint string representing the unique state of source tiles and revision\n     * for a given render-to-texture tile. Used to detect changes and trigger re-rendering.\n     * Format: \"sorted_tile_keys#revision\"\n     */\n    _rttFingerprints: {[sourceId: string]: {[rttTileKey: 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: 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: Tile[];\n    /**\n     * a list of tiles that should be rendered to screen in the next render-call\n     */\n    _rttTiles: Tile[];\n    /**\n     * a list of all layer-ids which should be rendered\n     */\n    _renderableLayerIds: string[];\n    constructor(painter: Painter, terrain: Terrain) {\n        this.painter = painter;\n        this.terrain = terrain;\n        this.pool = new RenderPool(painter.context, 30, terrain.tileManager.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.tileManager.getRenderableTiles();\n        this._renderableLayerIds = style._order.filter(id => !style._layers[id].isHidden(zoom));\n\n        this._coordsAscending = {};\n        for (const id in style.tileManagers) {\n            this._coordsAscending[id] = {};\n            const tileIDs = style.tileManagers[id].getVisibleCoordinates();\n            const source = style.tileManagers[id].getSource();\n            const terrainTileRanges = source instanceof ImageSource ? source.terrainTileRanges : null;\n            for (const tileID of tileIDs) {\n                const keys = this.terrain.tileManager.getTerrainCoords(tileID, terrainTileRanges);\n                for (const key in keys) {\n                    this._coordsAscending[id][key] ||= [];\n                    this._coordsAscending[id][key].push(keys[key]);\n                }\n            }\n\n        }\n\n        this._rttFingerprints = {};\n        for (const id of style._order) {\n            const layer = style._layers[id];\n            const source = layer.source;\n            const shouldRenderToTexture = LAYERS_TO_TEXTURES[layer.type];\n\n            if (shouldRenderToTexture && !this._rttFingerprints[source]) {\n                this._rttFingerprints[source] = {};\n                const revision = style.tileManagers[source]?.getState().revision ?? 0;\n                for (const key in this._coordsAscending[source])\n                    this._rttFingerprints[source][key] = `${this._coordsAscending[source][key].map(c => c.key).sort().join()}#${revision}`;\n            }\n        }\n\n        // check tiles to render\n        for (const tile of this._renderableTiles) {\n            for (const source in this._rttFingerprints) {\n                // rerender if there are different coords to render than in the last rendering\n                // or if the source revision has changed\n                const fingerprint = this._rttFingerprints[source][tile.tileID.key];\n                if (fingerprint && fingerprint !== tile.rttFingerprint[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     * @param renderOptions - flags describing how to render the layer\n     * @returns if true layer is rendered to texture, otherwise false\n     */\n    renderLayer(layer: StyleLayer, renderOptions: RenderOptions): boolean {\n        if (layer.isHidden(this.painter.transform.zoom)) return false;\n\n        const options: RenderOptions = {...renderOptions, isRenderingToTexture: true};\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_TO_TEXTURES[type]) {\n            // create a new stack if previous layer was not rendered to texture (f.e. symbols)\n            if (!this._prevType || !LAYERS_TO_TEXTURES[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_TO_TEXTURES[this._prevType] || (LAYERS_TO_TEXTURES[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, options);\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 (const layerId of layers) {\n                    const layer = painter.style._layers[layerId];\n                    const coords = layer.source ? this._coordsAscending[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, true);\n                    painter.renderLayer(painter, painter.style.tileManagers[layer.source], layer, coords, options);\n                    if (layer.source) tile.rttFingerprint[layer.source] = this._rttFingerprints[layer.source][tile.tileID.key];\n                }\n            }\n            drawTerrain(this.painter, this.terrain, this._rttTiles, options);\n            this._rttTiles = [];\n            this.pool.freeAllObjects();\n\n            return LAYERS_TO_TEXTURES[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': 'Drag to rotate map, click to reset 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    'GlobeControl.Enable': 'Enable globe',\n    'GlobeControl.Disable': 'Disable globe',\n    'TerrainControl.Enable': 'Enable terrain',\n    'TerrainControl.Disable': 'Disable terrain',\n    'CooperativeGesturesHandler.WindowsHelpText': 'Use Ctrl + scroll to zoom the map',\n    'CooperativeGesturesHandler.MacHelpText': 'Use \u2318 + scroll to zoom the map',\n    'CooperativeGesturesHandler.MobileHelpText': 'Use two fingers to move the map',\n};\n", "import {ensureError, extend, warnOnce, uniqueId, isImageBitmap, type Complete, pick, type Subscription} from '../util/util';\nimport {browser} from '../util/browser';\nimport {now} from '../util/time_control';\nimport {DOM} from '../util/dom';\nimport packageJSON from '../../package.json' with {type: 'json'};\nimport {type GetResourceResponse, getJSON} from '../util/ajax';\nimport {ImageRequest} from '../util/image_request';\nimport {RequestManager, ResourceType} from '../util/request_manager';\nimport {Style, type StyleSwapOptions} from '../style/style';\nimport {EvaluationParameters} from '../style/evaluation_parameters';\nimport {Painter} from '../render/painter';\nimport {Hash} from './hash';\nimport {HandlerManager} from './handler_manager';\nimport {Camera, type CameraOptions, type CameraUpdateTransformFunction, type FitBoundsOptions} from './camera';\nimport {LngLat} from '../geo/lng_lat';\nimport {LngLatBounds} from '../geo/lng_lat_bounds';\nimport Point from '@mapbox/point-geometry';\nimport {AttributionControl, type AttributionControlOptions, defaultAttributionControlOptions} from './control/attribution_control';\nimport {LogoControl} from './control/logo_control';\nimport {RGBAImage} from '../util/image';\nimport {Event, ErrorEvent, type Listener} from '../util/evented';\nimport {type MapEventType, type MapLayerEventType, MapMouseEvent, type MapSourceDataEvent, type MapStyleDataEvent} from './events';\nimport {TaskQueue} from '../util/task_queue';\nimport {throttle} from '../util/throttle';\nimport {type Source} from '../source/source';\nimport {type StyleLayer} from '../style/style_layer';\nimport {Terrain} from '../render/terrain';\nimport {RenderToTexture} from '../webgl/render_to_texture';\nimport {config} from '../util/config';\nimport {defaultLocale} from './default_locale';\nimport {MercatorTransform} from '../geo/projection/mercator_transform';\nimport {MercatorCameraHelper} from '../geo/projection/mercator_camera_helper';\nimport {isAbortError} from '../util/abort_error';\nimport {isFramebufferNotCompleteError} from '../util/framebuffer_error';\nimport {coveringTiles, type CoveringTilesOptions, createCalculateTileZoomFunction} from '../geo/projection/covering_tiles';\nimport {CanonicalTileID, type OverscaledTileID} from '../tile/tile_id';\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, BoxZoomHandlerOptions} 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    ProjectionSpecification,\n    SkySpecification,\n} from '@maplibre/maplibre-gl-style-spec';\nimport type {CanvasSourceSpecification} from '../source/canvas_source';\nimport type {GeoJSONFeature, MapGeoJSONFeature} from '../util/vectortile_to_geojson';\nimport type {ControlPosition, IControl} from './control/control';\nimport type {QueryRenderedFeaturesOptions, QuerySourceFeatureOptions} from '../source/query_features';\nimport type {ITransform, TransformConstrainFunction} from '../geo/transform_interface';\nimport type {ICameraHelper} from '../geo/projection/camera_helper';\n\nconst version = packageJSON.version;\n\nexport type WebGLSupportedVersions = 'webgl2' | 'webgl' | undefined;\nexport type WebGLContextAttributesWithType = WebGLContextAttributes & {contextType?: WebGLSupportedVersions};\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, `https://example.com#2.59/39.26/53.07/-24.1/60`.\n     * \n     * An additional string may optionally be provided as an alternative to indicate a parameter-styled hash.\n     * For example, passing `hash: \"foo\"` will produce a hash like `https://example.com#foo=2.59/39.26/53.07/-24.1/60`.\n     * This is usefull for allowing multiple maps or other state.\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     * The step increment the zoom level will snap to.\n     * For example, if `zoomSnap` is 1, the map will snap to whole integers during discrete zoom operations.\n     * If set to 0, zooming is continuous.\n     * @defaultValue 0\n     */\n    zoomSnap?: 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\n     *     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     * Set of WebGLContextAttributes that are applied to the WebGL context of the map.\n     * See https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/getContext for more details.\n     * `contextType` can be set to `webgl2` or `webgl` to force a WebGL version. Not setting it, Maplibre will do it's best to get a suitable context.\n     * @defaultValue antialias: false, powerPreference: 'high-performance', preserveDrawingBuffer: false, failIfMajorPerformanceCaveat: false, desynchronized: false, contextType: 'webgl2withfallback'\n     */\n    canvasContextAttributes?: WebGLContextAttributesWithType;\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. Users cannot zoom out beyond this level. (0\u201324)\n     * @defaultValue 0\n     */\n    minZoom?: number | null;\n    /**\n     * The maximum zoom level of the map. Users cannot zoom in beyond this level. (0\u201324)\n     * @defaultValue 22\n     */\n    maxZoom?: number | null;\n    /**\n     * The minimum pitch of the map (0-180).\n     * @defaultValue 0\n     */\n    minPitch?: number | null;\n    /**\n     * The maximum pitch of the map (0-180).\n     * @defaultValue 60\n     */\n    maxPitch?: number | null;\n    /**\n     * The pitch above which to apply anisotropic filtering to the map's raster layers (0-180).\n     * @defaultValue 20\n     */\n    anisotropicFilterPitch?: number | null;\n    /**\n     * If `true`, the \"box zoom\" interaction is enabled (see {@link BoxZoomHandler}).\n     * An `Object` value configures {@link BoxZoomHandler} options.\n     * If `boxZoomEnd` is provided, the callback runs instead of the default fit-to-box zoom.\n     * @defaultValue true\n     */\n    boxZoom?: boolean | BoxZoomHandlerOptions;\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]`\n     * !!! note\n     *     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 elevation of the initial geographical centerpoint of the map, in meters above sea level. If `elevation` is not specified in the constructor options, it will default to `0`.\n     * @defaultValue 0\n     */\n    elevation?: number;\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     * The initial roll angle of the map, measured in degrees counter-clockwise about the camera boresight. If `roll` 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    roll?: 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 callback that overrides how the map constrains the viewport's lnglat and zoom to respect the longitude and latitude bounds.\n     * @see [Customize the map transform constrain](https://maplibre.org/maplibre-gl-js/docs/examples/customize-the-map-transform-constrain/)\n     * Expected to return an object containing center and zoom.\n     * @defaultValue null\n     */\n    transformConstrain?: TransformConstrainFunction | 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     * For an example, see https://maplibre.org/maplibre-gl-js/docs/examples/locale-switching/\n     * Alternatively, search the official plugins page for plugins related to localization.\n     * @defaultValue null\n     */\n    locale?: Record<string, string>;\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.\n     * @see [Use locally generated ideographs](https://maplibre.org/maplibre-gl-js/docs/examples/use-locally-generated-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     * If `false`, the map's roll control with \"drag to rotate\" interaction will be disabled.\n     * @defaultValue false\n     */\n    rollEnabled?: boolean;\n    /**\n     * If `true`, gesture inertia (such as panning) is disabled. If not provided, gesture inertia defaults to the user's device settings.\n     * @defaultValue undefined\n     */\n    reduceMotion?: boolean | undefined;\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.\n     * Useful in production environments due to enabling tree-shaking of the validation code in some environments and minor performance improvements.\n     * Disabling this option comes at the cost of less clear error messages\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     * If true, the elevation of the center point will automatically be set to the terrain elevation\n     * (or zero if terrain is not enabled). If false, the elevation of the center point will default\n     * to sea level and will not automatically update. Defaults to true. Needs to be set to false to\n     * keep the camera above ground when pitch \\> 90 degrees.\n     */\n    centerClampedToGround?: boolean;\n    /**\n     * Allows overzooming by splitting vector tiles after max zoom.\n     * Defines the number of zoom level that will overscale from map's max zoom and below.\n     * For example if the map's max zoom is 20 and this is set to 3, the zoom levels of 20, 19 and 18 will be overscaled\n     * and the rest will be split.\n     * When undefined, all zoom levels after source's max zoom will be overscaled.\n     * This can help in reducing the size of the overscaling and improve performance in high zoom levels.\n     * The drawback is that it changes rendering for polygon centered labels and changes the results of query rendered features.\n     * @defaultValue undefined\n     * @experimental\n     */\n    experimentalZoomLevelsToOverscale?: number;\n    /**\n     * Determines the rotation interaction model:\n     * - When true: Uses \"Orbital\" logic where rotation is relative to the pivot center.\n     *   Dragging right at the top rotates clockwise, while dragging right at the bottom\n     *   rotates counter-clockwise (like spinning a physical globe).\n     * - When false: Uses \"Linear\" logic where horizontal mouse movement translates directly\n     *   to bearing change regardless of cursor position.\n     */\n    aroundCenter?: 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\ntype LostContextStyle = {\n    style: StyleSpecification | null;\n    images: {[_: string]: StyleImage} | null;\n};\n\nconst defaultMinZoom = -2;\nconst defaultMaxZoom = 22;\n\n// the default values, but also the valid range\nconst defaultMinPitch = 0;\nconst defaultMaxPitch = 60;\nconst defaultAnisotropicFilterPitch = 20;\n\n// use this variable to check maxPitch and anisotropicFilterPitch for validity\nconst maxPitchThreshold = 180;\n\nconst defaultOptions: Readonly<Partial<MapOptions>> = {\n    hash: false,\n    interactive: true,\n    bearingSnap: 7,\n    zoomSnap: 0,\n    attributionControl: defaultAttributionControlOptions,\n    maplibreLogo: false,\n    refreshExpiredTiles: true,\n\n    canvasContextAttributes: {\n        antialias: false,\n        preserveDrawingBuffer: false,\n        powerPreference: 'high-performance',\n        failIfMajorPerformanceCaveat: false,\n        desynchronized: false,\n        contextType: undefined\n    },\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    elevation: 0,\n    zoom: 0,\n    bearing: 0,\n    pitch: 0,\n    roll: 0,\n\n    renderWorldCopies: true,\n    maxTileCacheSize: null,\n    maxTileCacheZoomLevels: config.MAX_TILE_CACHE_ZOOM_LEVELS,\n    transformRequest: null,\n    transformCameraUpdate: null,\n    transformConstrain: null,\n    fadeDuration: 300,\n    crossSourceCollisions: true,\n    clickTolerance: 3,\n    localIdeographFontFamily: 'sans-serif',\n    pitchWithRotate: true,\n    rollEnabled: false,\n    reduceMotion: undefined,\n    validateStyle: true,\n    /**Because GL MAX_TEXTURE_SIZE is usually at least 4096px. */\n    maxCanvasSize: [4096, 4096],\n    cancelPendingTileRequestsWhileZooming: true,\n    centerClampedToGround: true,\n    experimentalZoomLevelsToOverscale: undefined,\n    anisotropicFilterPitch: defaultAnisotropicFilterPitch,\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/display-a-map/)\n */\nexport class Map extends Camera {\n    style: Style;\n    painter: Painter;\n    handlers: HandlerManager;\n\n    _container: HTMLElement;\n    _canvasContainer: HTMLElement;\n    _controlContainer: HTMLElement;\n    _controlPositions: Partial<Record<ControlPosition, 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    _anisotropicFilterPitch: number;\n\n    _loaded: boolean;\n    _idleTriggered = false;\n    // accounts for placement finishing as well\n    _fullyLoaded: boolean;\n    _trackResize: boolean;\n    _resizeObserver: ResizeObserver;\n    _canvasContextAttributes: WebGLContextAttributesWithType;\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: IControl[] = [];\n    _mapId = uniqueId();\n    _localIdeographFontFamily: string | false;\n    _validateStyle: boolean;\n    _requestManager: RequestManager;\n    _locale: Record<string, string>;\n    _removed: boolean;\n    _diffStyleRequest: AbortController;\n    _clickTolerance: number;\n    _overridePixelRatio: number | null | undefined;\n    _maxCanvasSize: [number, number];\n    _terrainDataCallback: (e: MapStyleDataEvent | MapSourceDataEvent) => void;\n    /** @internal */\n    _zoomLevelsToOverscale: number | undefined;\n\n    /**\n     * @internal\n     * The window that owns the map container element, for cross-window support.\n     * Returns `typeof window` to include global constructors like ResizeObserver.\n     */\n    get _ownerWindow(): typeof window {\n        return this._container?.ownerDocument?.defaultView || window;\n    }\n\n    /**\n     * @internal\n     * image queue throttling handle. To be used later when clean up\n     */\n    _imageQueueHandle: number;\n\n    /**\n     * @internal\n     * Used to store the previous style and images when a context loss occurs, so they can be restored.\n     */\n    _lostContextStyle: LostContextStyle = {\n        style: null,\n        images: null\n    };\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    /**\n     * The map transform's callback that overrides the default constrain function.\n     * @defaultValue null\n     */\n    transformConstrain: TransformConstrainFunction | null;\n\n    constructor(options: MapOptions) {\n        const resolvedOptions = {...defaultOptions, ...options, canvasContextAttributes: {\n            ...defaultOptions.canvasContextAttributes,\n            ...options.canvasContextAttributes\n        }} 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        // For now we will use a temporary MercatorTransform instance.\n        // Transform specialization will later be set by style when it creates its projection instance.\n        // When this happens, the new transform will inherit all properties of this temporary transform.\n        const transform = new MercatorTransform();\n        const cameraHelper = new MercatorCameraHelper();\n        if (resolvedOptions.minZoom !== undefined) {\n            transform.setMinZoom(resolvedOptions.minZoom);\n        }\n        if (resolvedOptions.maxZoom !== undefined) {\n            transform.setMaxZoom(resolvedOptions.maxZoom);\n        }\n        if (resolvedOptions.minPitch !== undefined) {\n            transform.setMinPitch(resolvedOptions.minPitch);\n        }\n        if (resolvedOptions.maxPitch !== undefined) {\n            transform.setMaxPitch(resolvedOptions.maxPitch);\n        }\n        if (resolvedOptions.renderWorldCopies !== undefined) {\n            transform.setRenderWorldCopies(resolvedOptions.renderWorldCopies);\n        }\n        if (resolvedOptions.transformConstrain !== null) {\n            transform.setConstrainOverride(resolvedOptions.transformConstrain);\n        }\n\n        super(transform, cameraHelper, {\n            bearingSnap: resolvedOptions.bearingSnap,\n            zoomSnap: resolvedOptions.zoomSnap\n        });\n\n        this._interactive = resolvedOptions.interactive;\n        this._maxTileCacheSize = resolvedOptions.maxTileCacheSize;\n        this._maxTileCacheZoomLevels = resolvedOptions.maxTileCacheZoomLevels;\n        this._canvasContextAttributes = {...resolvedOptions.canvasContextAttributes};\n        this._trackResize = resolvedOptions.trackResize === true;\n        this._bearingSnap = resolvedOptions.bearingSnap;\n        this._zoomSnap = resolvedOptions.zoomSnap;\n        this._centerClampedToGround = resolvedOptions.centerClampedToGround;\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._zoomLevelsToOverscale = resolvedOptions.experimentalZoomLevelsToOverscale;\n        this.transformCameraUpdate = resolvedOptions.transformCameraUpdate;\n        this.transformConstrain = resolvedOptions.transformConstrain;\n        this.cancelPendingTileRequestsWhileZooming = resolvedOptions.cancelPendingTileRequestsWhileZooming === true;\n        this.setAnisotropicFilterPitch(resolvedOptions.anisotropicFilterPitch);\n\n        if (resolvedOptions.reduceMotion !== undefined) {\n            browser.prefersReducedMotion = resolvedOptions.reduceMotion;\n        }\n\n        this._imageQueueHandle = ImageRequest.addThrottleControl(() => this.isMoving());\n\n        this._requestManager = new RequestManager(resolvedOptions.transformRequest);\n\n        this._container = this._resolveContainer(resolvedOptions.container);\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        this.on('moveend', () => this._update(false));\n        this.on('zoom', () => this._update(true));\n        this.on('terrain', () => {\n            this.painter.terrainFacilitator.depthDirty = true;\n            this._update(true);\n        });\n        this.once('idle', () => this._idleTriggered = true);\n\n        if (typeof window !== 'undefined') {\n            this._ownerWindow.addEventListener('online', this._onWindowOnline, false);\n            this._setupResizeObserver();\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) : undefined;\n        // don't set position from options if set through hash\n        if (!this._hash?._onHashChange()) {\n            this.jumpTo({\n                center: resolvedOptions.center,\n                elevation: resolvedOptions.elevation,\n                zoom: resolvedOptions.zoom,\n                bearing: resolvedOptions.bearing,\n                pitch: resolvedOptions.pitch,\n                roll: resolvedOptions.roll\n            });\n\n            if (resolvedOptions.bounds) {\n                this.resize();\n                this.fitBounds(resolvedOptions.bounds, extend({}, resolvedOptions.fitBoundsOptions, {duration: 0}));\n            }\n        }\n\n        // When no style is set or it's using something other than the globe projection, we can constrain the camera.\n        // When a style is set with other projections though, we can't constrain the camera until the style is loaded\n        // and the correct transform is used. Otherwise, valid points in the desired projection could be rejected\n        const shouldConstrainUsingMercatorTransform = typeof resolvedOptions.style === 'string' || !(resolvedOptions.style?.projection?.type === 'globe');\n        this.resize(null, shouldConstrainUsingMercatorTransform);\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 we didn't constrain the camera before, we do it now\n            if (!shouldConstrainUsingMercatorTransform) this._resizeTransform();\n            if (this.transform.unmodified) {\n                const coercedOptions = pick(this.style.stylesheet, ['center', 'zoom', 'bearing', 'pitch', 'roll']) as CameraOptions;\n                this.jumpTo(coercedOptions);\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     * Sets a global state property that can be retrieved with the [`global-state` expression](https://maplibre.org/maplibre-style-spec/expressions/#global-state).\n     * If the value is null, it resets the property to its default value defined in the [`state` style property](https://maplibre.org/maplibre-style-spec/root/#state).\n     *\n     * @param propertyName - The name of the state property to set.\n     * @param value - The value of the state property to set.\n     */\n    setGlobalStateProperty(propertyName: string, value: any) {\n        this.style.setGlobalStateProperty(propertyName, value);\n        return this._update(true);\n    }\n\n    /**\n     * Returns the global map state\n     *\n     * @returns The map state object.\n    */\n    getGlobalState(): Record<string, any> {\n        return this.style.getGlobalState();\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 control is invalid.\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/display-map-navigation-controls/)\n     */\n    addControl(control: IControl, position?: ControlPosition): this {\n        if (position === undefined) {\n            if (control.getDefaultPosition) {\n                position = control.getDefaultPosition();\n            } else {\n                position = 'top-right';\n            }\n        }\n        if (!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.includes('bottom')) {\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 control is invalid.\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): this {\n        if (!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.includes(control);\n    }\n\n    /**\n    * Returns an array of `OverscaledTileID` objects that cover the current viewport for a given tile size.\n    * This method is useful for determining which tiles are visible in the current viewport.\n    *\n    * @param options - Options for calculating the covering tiles.\n    * @returns An array of `OverscaledTileID` objects.\n    * @example\n    * ```ts\n    * // Get the tiles to cover the view for a 512x512px tile source\n    * const tiles = map.coveringTiles({tileSize: 512});\n    * ```\n    */\n    coveringTiles(options: CoveringTilesOptions): OverscaledTileID[] {\n        return coveringTiles(this.transform, options);\n    }\n\n    calculateCameraOptionsFromTo(from: LngLat, altitudeFrom: number, to: LngLat, altitudeTo?: number): CameraOptions {\n        if (altitudeTo == null && this.terrain) {\n            altitudeTo = this.terrain.getElevationForLngLat(to, this.transform);\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, constrainTransform = true): this {\n        // Early out if the context is lost\n        // causes a blank map otherwise\n        const isContextLost = this._lostContextStyle.style !== null;\n        if (isContextLost) return this;\n        this._resizeInternal(constrainTransform);\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     * Resizes the map according to the dimensions of its\n     * `container` element.\n     *\n     * It does not trigger any events, and does not check for context loss.\n     *\n     * It is used internally and by {@link Map.resize}.\n     *\n     * @internal\n     *\n     * @param constrainTransform - whether to constrain the transform after resizing.\n     */\n    _resizeInternal(constrainTransform = true) {\n        const [width, height] = this._containerDimensions();\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._resizeTransform(constrainTransform);\n    }\n\n    _resizeTransform(constrainTransform = true) {\n        const [width, height] = this._containerDimensions();\n\n        this.transform.resize(width, height, constrainTransform);\n        this._requestedCameraState?.resize(width, height, constrainTransform);\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): this {\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 and trigger the following events:\n     * `movestart`, `move`, `moveend`, `zoomstart`, `zoom`, and `zoomend`.\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): this {\n\n        minZoom = minZoom === null || minZoom === undefined ? defaultMinZoom : minZoom;\n\n        if (minZoom >= defaultMinZoom && minZoom <= this.transform.maxZoom) {\n            const zoomBefore = this.transform.zoom;\n            const tr = this._getTransformForUpdate();\n            tr.setMinZoom(minZoom);\n            this._applyUpdatedTransform(tr);\n            this._update();\n            if (zoomBefore !== this.transform.zoom) {\n                this.fire(new Event('zoomstart'))\n                    .fire(new Event('zoom'))\n                    .fire(new Event('zoomend'))\n                    .fire(new Event('movestart'))\n                    .fire(new Event('move'))\n                    .fire(new Event('moveend'));\n            }\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 and trigger the following events:\n     * `movestart`, `move`, `moveend`, `zoomstart`, `zoom`, and `zoomend`.\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): this {\n\n        maxZoom = maxZoom === null || maxZoom === undefined ? defaultMaxZoom : maxZoom;\n\n        if (maxZoom >= this.transform.minZoom) {\n            const zoomBefore = this.transform.zoom;\n            const tr = this._getTransformForUpdate();\n            tr.setMaxZoom(maxZoom);\n            this._applyUpdatedTransform(tr);\n            this._update();\n            if (zoomBefore !== this.transform.zoom) {\n                this.fire(new Event('zoomstart'))\n                    .fire(new Event('zoom'))\n                    .fire(new Event('zoomend'))\n                    .fire(new Event('movestart'))\n                    .fire(new Event('move'))\n                    .fire(new Event('moveend'));\n            }\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 and trigger the following events:\n     * `movestart`, `move`, `moveend`, `pitchstart`, `pitch`, and `pitchend`.\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-180). 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): this {\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            const pitchBefore = this.transform.pitch;\n            const tr = this._getTransformForUpdate();\n            tr.setMinPitch(minPitch);\n            this._applyUpdatedTransform(tr);\n            this._update();\n            if (pitchBefore !== this.transform.pitch) {\n                this.fire(new Event('pitchstart'))\n                    .fire(new Event('pitch'))\n                    .fire(new Event('pitchend'))\n                    .fire(new Event('movestart'))\n                    .fire(new Event('move'))\n                    .fire(new Event('moveend'));\n            }\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 and trigger the following events:\n     * `movestart`, `move`, `moveend`, `pitchstart`, `pitch`, and `pitchend`.\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-180). 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): this {\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            const pitchBefore = this.transform.pitch;\n            const tr = this._getTransformForUpdate();\n            tr.setMaxPitch(maxPitch);\n            this._applyUpdatedTransform(tr);\n            this._update();\n            if (pitchBefore !== this.transform.pitch) {\n                this.fire(new Event('pitchstart'))\n                    .fire(new Event('pitch'))\n                    .fire(new Event('pitchend'))\n                    .fire(new Event('movestart'))\n                    .fire(new Event('move'))\n                    .fire(new Event('moveend'));\n            }\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 map's anisotropic filter pitch.\n     * If the map is pitched beyond this threshold, anisotropic filtering will be applied to all raster layers.\n     *\n     * @returns The anisotropicFilterPitch\n     * @example\n     * ```ts\n     * let anisotropicFilterPitch = map.getAnisotropicFilterPitch();\n     * ```\n     */\n    getAnisotropicFilterPitch(): number { return this._anisotropicFilterPitch; }\n\n    /**\n     * Sets the map's anisotropic filter pitch or reverts it to its default.\n     *\n     * A {@link ErrorEvent} event will be fired if anisotropicFilterPitch is out of bounds.\n     *\n     * @param anisotropicFilterPitch - The pitch above which to apply anisotropic filtering to the map's raster layers (0-180).\n     * If `null` or `undefined` is provided, the function reverts to the default pitch threshold (20).\n     *\n     *\n     * @example\n     * ```ts\n     * map.setAnisotropicFilterPitch(85);\n     * ```\n     */\n    setAnisotropicFilterPitch(anisotropicFilterPitch?: number | null): this {\n\n        anisotropicFilterPitch = anisotropicFilterPitch === null || anisotropicFilterPitch === undefined ? defaultAnisotropicFilterPitch : anisotropicFilterPitch;\n\n        if (anisotropicFilterPitch > maxPitchThreshold) {\n            throw new Error(`anisotropicFilterPitch must be less than or equal to ${maxPitchThreshold}`);\n        }\n\n        if (anisotropicFilterPitch < defaultMinPitch) {\n            throw new Error(`anisotropicFilterPitch must be greater than or equal to ${defaultMinPitch}`);\n        }\n\n        this._anisotropicFilterPitch = anisotropicFilterPitch;\n        return this._update();\n    }\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): this {\n        this.transform.setRenderWorldCopies(renderWorldCopies);\n        return this._update();\n    }\n\n    /** Sets or clears the callback overriding how the map constrains the viewport's lnglat and zoom to respect the longitude and latitude bounds.\n     *\n     * @param constrain - A {@link TransformConstrainFunction} callback defining how the viewport should respect the bounds.\n     *\n     * `null` clears the callback and reverts the constrain to the map transform's default constrain function.\n     * @example\n     * ```ts\n     * function customTransformConstrain(lngLat, zoom) {\n     *   return {center: lngLat, zoom: zoom ?? 0};\n     * };\n     * map.setTransformConstrain(customTransformConstrain);\n     * ```\n     * @see [Customize the map transform constrain](https://maplibre.org/maplibre-gl-js/docs/examples/customize-the-map-transform-constrain/)\n     */\n    setTransformConstrain(constrain?: TransformConstrainFunction | null): this {\n        this.transform.setConstrainOverride(constrain);\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.locationToScreenPoint(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.screenPointToLocation(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 ||= {};\n        this._delegatedListeners[type] ||= [];\n        this._delegatedListeners[type].push(delegatedListener);\n    }\n\n    _removeDelegatedListener(type: string, layerIds: string[], listener: Listener) {\n        if (!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/display-a-popup-on-click/)\n     * @see [Center the map on a clicked symbol](https://maplibre.org/maplibre-gl-js/docs/examples/center-the-map-on-a-clicked-symbol/)\n     * @see [Create a hover effect](https://maplibre.org/maplibre-gl-js/docs/examples/create-a-hover-effect/)\n     * @see [Create a draggable marker](https://maplibre.org/maplibre-gl-js/docs/examples/create-a-draggable-point/)\n     */\n    on<T extends keyof MapLayerEventType>(\n        type: T,\n        layer: string,\n        listener: (ev: MapLayerEventType[T] & Object) => void,\n    ): Subscription;\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    ): Subscription;\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): Subscription;\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): Subscription;\n    on(type: keyof MapEventType | string, layerIdsOrListener: string | string[] | Listener, listener?: Listener): Subscription {\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 {\n            unsubscribe: () => {\n                this._removeDelegatedListener(type, layerIds, listener);\n            }\n        };\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 `{@link 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 in pixel points within the map viewport:\n     * either a single pixel point or a pair of top-left and bottom-right pixel points describing a bounding box.\n     * The origin of the pixel points is at the top-left of the map viewport.\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/get-features-under-the-mouse-pointer/)\n     */\n    queryRenderedFeatures(geometryOrOptions?: PointLike | [PointLike, PointLike] | QueryRenderedFeaturesOptions, options?: QueryRenderedFeaturesOptions): MapGeoJSONFeature[] {\n        if (!this.style) {\n            return [];\n        }\n        let queryGeometry: Point[];\n        const isGeometry = geometryOrOptions instanceof Point || Array.isArray(geometryOrOptions);\n        const geometry = isGeometry ? geometryOrOptions : [[0, 0], [this.transform.width, this.transform.height]];\n        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): GeoJSONFeature[] {\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 | null): 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        this._diffStyleRequest?.abort();\n        this._diffStyleRequest = null;\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            if (this._frameRequest) {\n                this._frameRequest.abort();\n                this._frameRequest = null;\n            }\n            this.style?.projection?.destroy();\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    async _diffStyle(style: StyleSpecification | string, options?: StyleSwapOptions & StyleOptions) {\n        this._diffStyleRequest?.abort();\n        if (typeof style === 'string') {\n            const url = style;\n            this._diffStyleRequest = new AbortController();\n            const abortController = this._diffStyleRequest;\n            try {\n                const request = await this._requestManager.transformRequest(url, ResourceType.Style);\n                if (abortController.signal.aborted) {\n                    this._diffStyleRequest = null;\n                    return;\n                }\n\n                const response = await getJSON<StyleSpecification>(request, abortController);\n                this._diffStyleRequest = null;\n                this._updateDiff(response.data, options);\n            } catch (error) {\n                this._diffStyleRequest = null;\n                if (!isAbortError(error)) {\n                    this.fire(new ErrorEvent(ensureError(error)));\n                }\n            }\n        } else if (typeof style === 'object') {\n            this._diffStyleRequest = null;\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: ${ensureError(e).message}.  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     * @internal\n     * Returns the map's style and cloned images to restore context.\n     * @returns An object containing the style and images.\n     */\n    _getStyleAndImages(): LostContextStyle {\n        if (this.style) {\n            return {\n                style: this.style.serialize(),\n                images: this.style.imageManager.cloneImages()\n            };\n        }\n        return {style: null, images: {}};\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) {\n            warnOnce('There is no style added to the map.');\n            return;\n        }\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/add-live-realtime-data/)\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 with 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 tileManager = this.style?.tileManagers[id];\n        if (tileManager === undefined) {\n            this.fire(new ErrorEvent(new Error(`There is no tile manager with ID '${id}'`)));\n            return;\n        }\n        return tileManager.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) {\n                this.terrain.destroy();\n            }\n            this.terrain = null;\n            if (this.painter.renderToTexture) this.painter.renderToTexture.destruct();\n            this.painter.renderToTexture = null;\n            this.transform.setMinElevationForCurrentTile(0);\n            if (this._centerClampedToGround) {\n                this.transform.setElevation(0);\n            }\n        } else {\n            // add terrain\n            const tileManager = this.style.tileManagers[options.source];\n            if (!tileManager) 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) tileManager.reload();\n            // Warn once if user is using the same source for hillshade/color-relief 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                if (thisLayer.type === 'color-relief' && thisLayer.source === options.source) {\n                    warnOnce('You are using the same source for a color-relief layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.');\n                }\n            }\n            this.terrain = new Terrain(this.painter, tileManager, options);\n            this.painter.renderToTexture = new RenderToTexture(this.painter, this.terrain);\n            this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this.transform.center, this.transform.tileZoom));\n            this.transform.setElevation(this.terrain.getElevationForLngLatZoom(this.transform.center, this.transform.tileZoom));\n            this._terrainDataCallback = e => {\n                if (e.dataType === 'style') {\n                    this.terrain.tileManager.freeRtt();\n                } else if (e.dataType === 'source' && e.tile) {\n                    if (e.sourceId === options.source && !this._elevationFreeze) {\n                        this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this.transform.center, this.transform.tileZoom));\n                        if (this._centerClampedToGround) {\n                            this.transform.setElevation(this.terrain.getElevationForLngLatZoom(this.transform.center, this.transform.tileZoom));\n                        }\n                    }\n\n                    if (e.source?.type === 'image') {\n                        this.terrain.tileManager.freeRtt();\n                    } else {\n                        this.terrain.tileManager.freeRtt(e.tile.tileID);\n                    }\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 tileManagers = this.style?.tileManagers;\n        for (const tileManager of Object.values(tileManagers)) {\n            if (!tileManager.areTilesLoaded()) {\n                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): this {\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/create-a-draggable-point/)\n     * @see [Animate a point](https://maplibre.org/maplibre-gl-js/docs/examples/animate-a-point/)\n     * @see [Add live realtime data](https://maplibre.org/maplibre-gl-js/docs/examples/add-live-realtime-data/)\n     */\n    getSource<TSource extends Source>(id: string): TSource | undefined {\n        return this.style.getSource(id) as TSource;\n    }\n\n    /**\n     * Change the tile Level of Detail behavior of the specified source. These parameters have no effect when\n     * pitch == 0, and the largest effect when the horizon is visible on screen.\n     *\n     * @param maxZoomLevelsOnScreen - The maximum number of distinct zoom levels allowed on screen at a time.\n     * There will generally be fewer zoom levels on the screen, the maximum can only be reached when the horizon\n     * is at the top of the screen. Increasing the maximum number of zoom levels causes the zoom level to decay\n     * faster toward the horizon.\n     * @param tileCountMaxMinRatio - The ratio of the maximum number of tiles loaded (at high pitch) to the minimum\n     * number of tiles loaded. Increasing this ratio allows more tiles to be loaded at high pitch angles. If the ratio\n     * would otherwise be exceeded, the zoom level is reduced uniformly to keep the number of tiles within the limit.\n     * @param sourceId - The ID of the source to set tile LOD parameters for. All sources will be updated if unspecified.\n     * If `sourceId` is specified but a corresponding source does not exist, an error is thrown.\n     * @example\n     * ```ts\n     * map.setSourceTileLodParams(4.0, 3.0, 'terrain');\n     * ```\n     * @see [Modify Level of Detail behavior](https://maplibre.org/maplibre-gl-js/docs/examples/level-of-detail-control/)\n\n     */\n    setSourceTileLodParams(maxZoomLevelsOnScreen: number, tileCountMaxMinRatio: number, sourceId?: string) : this {\n        if (sourceId) {\n            const source = this.getSource(sourceId);\n            if(!source) {\n                throw new Error(`There is no source with ID \"${sourceId}\", cannot set LOD parameters`);\n            }\n            source.calculateTileZoom = createCalculateTileZoomFunction(Math.max(1, maxZoomLevelsOnScreen), Math.max(1, tileCountMaxMinRatio));\n        } else {\n            for (const id in this.style.tileManagers) {\n                this.style.tileManagers[id].getSource().calculateTileZoom = createCalculateTileZoomFunction(Math.max(1, maxZoomLevelsOnScreen), Math.max(1, tileCountMaxMinRatio));\n            }\n        }\n        this._update(true);\n        return this;\n    }\n\n    /**\n     * Triggers a reload of the selected tiles\n     *\n     * @param sourceId - The ID of the source\n     * @param tileIds - An array of tile IDs to be reloaded. If not defined, all tiles will be reloaded.\n     * @example\n     * ```ts\n     * map.refreshTiles('satellite', [{x:1024, y: 1023, z: 11}, {x:1023, y: 1023, z: 11}]);\n     * ```\n     */\n    refreshTiles(sourceId: string, tileIds?: Array<{x: number; y: number; z: number}>) {\n        const tileManager = this.style.tileManagers[sourceId];\n        if(!tileManager) {\n            throw new Error(`There is no tile manager with ID \"${sourceId}\", cannot refresh tile`);\n        }\n        if (tileIds === undefined) {\n            tileManager.reload(true);\n        } else {\n            tileManager.refreshTiles(tileIds.map((tileId) => {return new CanonicalTileID(tileId.z, tileId.x, tileId.y);}));\n        }\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-an-icon-to-the-map/)\n     * @see Use `ImageData`: [Add a generated icon to the map](https://maplibre.org/maplibre-gl-js/docs/examples/add-a-generated-icon-to-the-map/)\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 invalid.\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 ID is missing.\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-an-icon-to-the-map/)\n     */\n    async loadImage(url: string): Promise<GetResourceResponse<HTMLImageElement | ImageBitmap>> {\n        return ImageRequest.getImage(await 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(): 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/create-and-style-clusters/)\n     * @see [Add a vector tile source](https://maplibre.org/maplibre-gl-js/docs/examples/add-a-vector-tile-source/)\n     * @see [Add a WMS source](https://maplibre.org/maplibre-gl-js/docs/examples/add-a-wms-source/)\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 no such layer exists.\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-symbols-by-toggling-a-list/)\n     * @see [Filter symbols by text input](https://maplibre.org/maplibre-gl-js/docs/examples/filter-symbols-by-text-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\n     *     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/create-a-time-slider/)\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/change-a-layers-color-with-buttons/)\n     * @see [Create a draggable point](https://maplibre.org/maplibre-gl-js/docs/examples/create-a-draggable-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. Pass a falsy value (null or undefined)\n    * to unset glyphs.\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 | undefined, 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, or `null` if glyphs are unset.\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(): Array<{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     * Sets the value of style's sky properties.\n     *\n     * @param sky - Sky properties to set. Must conform to the [MapLibre Style Specification](https://maplibre.org/maplibre-style-spec/sky/).\n     * @param options - Options object.\n     *\n     * @example\n     * ```ts\n     * map.setSky({'atmosphere-blend': 1.0});\n     * ```\n     */\n    setSky(sky: SkySpecification, options: StyleSetterOptions = {}) {\n        this._lazyInitEmptyStyle();\n        this.style.setSky(sky, options);\n        return this._update(true);\n    }\n\n    /**\n     * Returns the value of the style's sky.\n     *\n     * @returns the sky properties of the style.\n     * @example\n     * ```ts\n     * map.getSky();\n     * ```\n     */\n    getSky(): SkySpecification {\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/#promoteid) option at the time the source is defined.\n     * - For GeoJSON sources, using the [`generateId`](https://maplibre.org/maplibre-style-spec/sources/#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\n     *     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/create-a-hover-effect/)\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\n     *     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/create-a-draggable-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-distances/)\n     * @see [Display a popup on hover](https://maplibre.org/maplibre-gl-js/docs/examples/display-a-popup-on-hover/)\n     * @see [Center the map on a clicked symbol](https://maplibre.org/maplibre-gl-js/docs/examples/center-the-map-on-a-clicked-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    /**\n     * @internal\n     * Sets up the ResizeObserver to track container size changes.\n     * Uses the owning window's ResizeObserver for cross-window support.\n     */\n    private _setupResizeObserver() {\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        // Use owning window's ResizeObserver for cross-window support\n        const ResizeObserverClass = this._ownerWindow.ResizeObserver ?? ResizeObserver;\n        this._resizeObserver = new ResizeObserverClass((entries: ResizeObserverEntry[]) => {\n            if (!initialResizeEventCaptured) {\n                initialResizeEventCaptured = true;\n                return;\n            }\n            throttledResizeCallback(entries);\n        });\n        this._resizeObserver.observe(this._container);\n    }\n\n    /**\n     * @internal\n     * Resolves the container option to an HTMLElement.\n     * Supports string ID, HTMLElement, or cross-window elements (using nodeType check).\n     */\n    private _resolveContainer(container: string | HTMLElement): HTMLElement {\n        if (typeof container === 'string') {\n            const element = document.getElementById(container);\n            if (!element) {\n                throw new Error(`Container '${container}' not found.`);\n            }\n            return element;\n        }\n        if (container instanceof HTMLElement) {\n            return container;\n        }\n        // Cross-window support: use nodeType check as instanceof fails across windows\n        if (container && typeof container === 'object' && (container as Node).nodeType === 1) {\n            return container as HTMLElement;\n        }\n        throw new Error('Invalid type: \\'container\\' must be a String or HTMLElement.');\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        for (const positionName of ['top-left', 'top-right', 'bottom-left', 'bottom-right'] as const) {\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        // Maplibre WebGL context requires alpha, depth and stencil buffers. It also forces premultipliedAlpha: true.\n        // We use the values provided in the map constructor for the rest of context attributes\n        const attributes = {\n            ...this._canvasContextAttributes,\n            alpha: true,\n            depth: true,\n            stencil: true,\n            premultipliedAlpha: true\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        let gl: WebGL2RenderingContext | WebGLRenderingContext | null = null;\n        if (this._canvasContextAttributes.contextType) {\n            gl = this._canvas.getContext(this._canvasContextAttributes.contextType, attributes) as WebGL2RenderingContext | WebGLRenderingContext;\n        } else {\n            gl = this._canvas.getContext('webgl2', attributes) || this._canvas.getContext('webgl', attributes);\n        }\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\n    override migrateProjection(newTransform: ITransform, newCameraHelper: ICameraHelper) {\n        super.migrateProjection(newTransform, newCameraHelper);\n        this.painter.transform = newTransform;\n        this.fire(new Event('projectiontransition', {\n            newProjection: this.style.projection.name,\n        }));\n    }\n\n    _contextLost = (event: any) => {\n        event.preventDefault();\n        if (this._frameRequest) {\n            this._frameRequest.abort();\n            this._frameRequest = null;\n        }\n        this.painter.destroy();\n\n        this._lostContextStyle = this._getStyleAndImages();\n\n        if (!this.style) {\n            this.fire(new Event('webglcontextlost', {originalEvent: event}));\n            return;\n        }\n\n        // check if style contains custom layers to warn user that they can't be restored automatically\n        for (const layer of Object.values(this.style._layers)) {\n            if (layer.type === 'custom') {\n                console.warn(`Custom layer with id '${layer.id}' cannot be restored after WebGL context loss. You will need to re-add it manually after context restoration.`);\n            }\n\n            if (layer._listeners) {\n                for (const [event] of Object.entries(layer._listeners)) {\n                    console.warn(`Custom layer with id '${layer.id}' had event listeners for event '${event}' which cannot be restored after WebGL context loss. You will need to re-add them manually after context restoration.`);\n                }\n            }\n        }\n\n        this.style.destroy();\n        this.style = null;\n\n        this.fire(new Event('webglcontextlost', {originalEvent: event}));\n    };\n\n    _contextRestored = (event: any) => {\n        if (this._lostContextStyle.style) {\n            this.setStyle(this._lostContextStyle.style, {diff: false});\n        }\n\n        if (this._lostContextStyle.images && this.style) {\n            this.style.imageManager.images = this._lostContextStyle.images;\n        }\n\n        this._lostContextStyle = {style: null, images: null};\n\n        this._setupPainter();\n        this.resize();\n        this._update();\n        this._resizeInternal();\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?._loaded) return this;\n\n        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        const isGlobeRendering = this.style.projection?.transitionState > 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 currentTime = now();\n            this.style.zoomHistory.update(zoom, currentTime);\n\n            const parameters = new EvaluationParameters(zoom, {\n                now: currentTime,\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        const globeRenderingChanged = this.style.projection?.transitionState > 0 !== isGlobeRendering;\n        this.style.projection?.setErrorQueryLatitudeDegrees(this.transform.center.lat);\n        this.transform.setTransitionState(this.style.projection?.transitionState, this.style.projection?.latitudeErrorCorrectionRadians);\n\n        // If we are in _render for any reason other than an in-progress paint\n        // transition, update tile managers to check for and load any tiles we\n        // need for the current transform\n        if (this.style && (this._sourcesDirty || globeRenderingChanged)) {\n            this._sourcesDirty = false;\n            this.style._updateSources(this.transform);\n        }\n\n        // update terrain stuff\n        if (this.terrain) {\n            this.terrain.tileManager.update(this.transform, this.terrain);\n            this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this.transform.center, this.transform.tileZoom));\n            if (!this._elevationFreeze && this._centerClampedToGround) {\n                this.transform.setElevation(this.terrain.getElevationForLngLatZoom(this.transform.center, this.transform.tileZoom));\n            }\n        } else {\n            this.transform.setMinElevationForCurrentTile(0);\n            if (this._centerClampedToGround) {\n                this.transform.setElevation(0);\n            }\n        }\n\n        this._placementDirty = this.style?._updatePlacement(this.transform, this.showCollisionBoxes, fadeDuration, this._crossSourceCollisions, globeRenderingChanged);\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            anisotropicFilterPitch: this.getAnisotropicFilterPitch(),\n        });\n\n        this.fire(new Event('render'));\n\n        if (this.loaded() && !this._loaded) {\n            this._loaded = true;\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 TileManagers 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        }\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._diffStyleRequest?.abort();\n        this.painter.destroy();\n        this.handlers.destroy();\n        delete this.handlers;\n        this.setStyle(null);\n        if (typeof window !== 'undefined') {\n            this._ownerWindow.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        this._canvasContainer.remove();\n        this._controlContainer.remove();\n        this._container.removeEventListener('scroll', this._onMapScroll, false);\n        this._container.classList.remove('maplibregl-map');\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-a-3d-model-using-threejs/)\n     * @see [Add an animated icon to the map](https://maplibre.org/maplibre-gl-js/docs/examples/add-an-animated-icon-to-the-map/)\n     */\n    triggerRepaint() {\n        if (this.style && !this._frameRequest) {\n            this._frameRequest = new AbortController();\n            browser.frame(\n                this._frameRequest,\n                (paintStartTimeStamp) => {\n                    this._frameRequest = null;\n                    try {\n                        this._render(paintStartTimeStamp);\n                    } catch(error) {\n                        if (!isAbortError(error) && !isFramebufferNotCompleteError(error)) {\n                            throw error;\n                        }\n                    }\n                },\n                () => {},\n                this._ownerWindow\n            );\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    /**\n     * Gets the {@link ProjectionSpecification}.\n     * @returns the projection specification.\n     * @example\n     * ```ts\n     * let projection = map.getProjection();\n     * ```\n     */\n    getProjection(): ProjectionSpecification { return this.style.getProjection(); }\n\n    /**\n     * Sets the {@link ProjectionSpecification}.\n     * @param projection - the projection specification to set\n     * @returns\n     */\n    setProjection(projection: ProjectionSpecification) {\n        this._lazyInitEmptyStyle();\n        this.style.setProjection(projection);\n        return this._update(true);\n    }\n}\n", "import Point from '@mapbox/point-geometry';\n\nimport {DOM} from '../../util/dom';\nimport {extend, getAngleDelta} from '../../util/util';\nimport {DragHandler, type DragMoveHandler, type DragRotateResult} from '../handler/drag_handler';\nimport {MouseOrTouchMoveStateManager} from '../handler/drag_move_state_manager';\n\nimport type {Map} from '../map';\nimport type {IControl} from './control';\n\n/**\n * The {@link NavigationControl} options object\n */\nexport type 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     * If `true` the roll is visualized by rotating the compass.\n     */\n    visualizeRoll?: boolean;\n};\n\nconst defaultOptions: NavigationControlOptions = {\n    showCompass: true,\n    showZoom: true,\n    visualizePitch: false,\n    visualizeRoll: true\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/display-map-navigation-controls/)\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        if (this.options.visualizePitch && this.options.visualizeRoll) {\n            this._compassIcon.style.transform = `scale(${1 / Math.pow(Math.cos(this._map.transform.pitchInRadians), 0.5)}) rotateZ(${-this._map.transform.roll}deg) rotateX(${this._map.transform.pitch}deg) rotateZ(${-this._map.transform.bearing}deg)`;\n            return;\n        }\n        if (this.options.visualizePitch) {\n            this._compassIcon.style.transform = `scale(${1 / Math.pow(Math.cos(this._map.transform.pitchInRadians), 0.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${-this._map.transform.bearing}deg)`;\n            return;\n        }\n        if (this.options.visualizeRoll) {\n            this._compassIcon.style.transform = `rotate(${-this._map.transform.bearing - this._map.transform.roll}deg)`;\n            return;\n        }\n        this._compassIcon.style.transform = `rotate(${-this._map.transform.bearing}deg)`;\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            if (this.options.visualizeRoll) {\n                this._map.on('roll', 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        this._container.remove();\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            if (this.options.visualizeRoll) {\n                this._map.off('roll', 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);\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    _rotatePitchHandler: DragMoveHandler<DragRotateResult, MouseEvent | TouchEvent>;\n    _startPos: Point;\n    _lastPos: Point;\n\n    constructor(map: Map, element: HTMLElement, pitch: boolean = false) {\n        this._clickTolerance = 10;\n        this.element = element;\n\n        const moveStateManager = new MouseOrTouchMoveStateManager();\n        this._rotatePitchHandler = new DragHandler<DragRotateResult, MouseEvent | TouchEvent>({\n            clickTolerance: 3,\n            move: (lastPoint: Point, currentPoint: Point) => {\n                const rect = element.getBoundingClientRect();\n                const center = new Point((rect.bottom - rect.top) / 2, (rect.right - rect.left) / 2);\n                const bearingDelta = getAngleDelta(new Point(lastPoint.x, currentPoint.y), currentPoint, center);\n                const pitchDelta = pitch ? (currentPoint.y - lastPoint.y) * -0.5 : undefined;\n                return {bearingDelta, pitchDelta};\n            },\n            moveStateManager,\n            enable: true,\n            assignEvents: () => {},\n        });\n        this.map = map;\n\n        element.addEventListener('mousedown', this.mousedown);\n        element.addEventListener('touchstart', this.touchstart, {passive: false});\n        element.addEventListener('touchcancel', this.reset);\n    }\n\n    startMove(e: MouseEvent | TouchEvent, point: Point) {\n        this._rotatePitchHandler.dragStart(e, point);\n        DOM.disableDrag();\n    }\n\n    move(e: MouseEvent | TouchEvent, point: Point) {\n        const map = this.map;\n        const {bearingDelta, pitchDelta} = this._rotatePitchHandler.dragMove(e, point) || {};\n        if (bearingDelta) map.setBearing(map.getBearing() + bearingDelta);\n        if (pitchDelta) map.setPitch(map.getPitch() + pitchDelta);\n    }\n\n    off() {\n        const element = this.element;\n        element.removeEventListener('mousedown', this.mousedown);\n        element.removeEventListener('touchstart', this.touchstart);\n        window.removeEventListener('touchmove', this.touchmove);\n        window.removeEventListener('touchend', this.touchend);\n        element.removeEventListener('touchcancel', this.reset);\n        this.offTemp();\n    }\n\n    offTemp() {\n        DOM.enableDrag();\n        window.removeEventListener('mousemove', this.mousemove);\n        window.removeEventListener('mouseup', this.mouseup);\n        window.removeEventListener('touchmove', this.touchmove);\n        window.removeEventListener('touchend', this.touchend);\n    }\n\n    mousedown = (e: MouseEvent) => {\n        this.startMove(e, DOM.mousePos(this.element, e));\n        window.addEventListener('mousemove', this.mousemove);\n        window.addEventListener('mouseup', this.mouseup);\n    };\n\n    mousemove = (e: MouseEvent) => {\n        this.move(e, DOM.mousePos(this.element, e));\n    };\n\n    mouseup = (e: MouseEvent) => {\n        this._rotatePitchHandler.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.startMove(e, this._startPos);\n            window.addEventListener('touchmove', this.touchmove, {passive: false});\n            window.addEventListener('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.move(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._rotatePitchHandler.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';\n    } catch {\n        // Fix for iOS16 which rejects query but still supports geolocation\n        supportsGeolocation = !!window.navigator.geolocation;\n    }\n    return supportsGeolocation;\n}\n", "import {LngLat} from '../geo/lng_lat';\n\nimport type Point from '@mapbox/point-geometry';\nimport type {IReadonlyTransform} from '../geo/transform_interface';\n\n/**\n * Given a LngLat, prior projected position, and a transform, return a new LngLat shifted\n * n \u00D7 360\u00B0 east or west for some n \u2265 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 \u00B1360\u00B0 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: IReadonlyTransform, useNormalWrap: boolean = false): LngLat {\n    if (useNormalWrap || !transform.getCoveringTilesDetailsProvider().allowWorldCopies()) {\n        return lngLat?.wrap();\n    }\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.locationToScreenPoint(lngLat).distSqr(priorPos);\n        if (transform.locationToScreenPoint(left).distSqr(priorPos) < delta) {\n            lngLat = left;\n        } else if (transform.locationToScreenPoint(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.locationToScreenPoint(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 && transform.isPointOnMapSurface(transform.locationToScreenPoint(lngLat))) {\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 {type Popup, type 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 */\nexport type Alignment = 'map' | 'viewport' | 'auto';\n\n/**\n * The {@link Marker} options object\n */\nexport type 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     * Accepts any valid CSS opacity value as a number or string.\n     * @defaultValue 1\n     */\n    opacity?: string | number;\n    /**\n     * Marker's opacity when it's behind 3d terrain\n     * Accepts any valid CSS opacity value as a number or string.\n     * @defaultValue 0.2\n     */\n    opacityWhenCovered?: string | number;\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 a default marker](https://maplibre.org/maplibre-gl-js/docs/examples/add-a-default-marker/)\n * @see [Add custom icons with Markers](https://maplibre.org/maplibre-gl-js/docs/examples/add-custom-icons-with-markers/)\n * @see [Create a draggable Marker](https://maplibre.org/maplibre-gl-js/docs/examples/create-a-draggable-marker/)\n * @see [Animate a marker](https://maplibre.org/maplibre-gl-js/docs/examples/animate-a-marker/)\n * @see [Attach a popup to a marker instance](https://maplibre.org/maplibre-gl-js/docs/examples/attach-a-popup-to-a-marker-instance/)\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 *\n * **Event** `click` of type {@link Event} will be fired when the marker is clicked.\n *\n * ## CSS Classes\n *\n * **CSS class** `maplibregl-marker-covered` is toggled on the marker element when the marker\n * is hidden behind 3D terrain or on the back of a globe.\n * Use this class to apply custom styles to covered markers.\n *\n * @example\n * ```css\n * .maplibregl-marker-covered {\n *     pointer-events: none;\n *     cursor: default;\n * }\n * ```\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?.anchor || 'center';\n        this._color = options?.color || '#3FB1CE';\n        this._scale = options?.scale || 1;\n        this._draggable = options?.draggable || false;\n        this._clickTolerance = options?.clickTolerance || 0;\n        this._subpixelPositioning = options?.subpixelPositioning || false;\n        this._isDragging = false;\n        this._state = 'inactive';\n        this._rotation = options?.rotation || 0;\n        this._rotationAlignment = options?.rotationAlignment || 'auto';\n        this._pitchAlignment = options?.pitchAlignment && options.pitchAlignment !== 'auto' ?  options.pitchAlignment : this._rotationAlignment;\n        this.setOpacity(options?.opacity, options?.opacityWhenCovered);\n\n        if (!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?.offset || [0, -14]);\n        } else {\n            this._element = options.element;\n            this._offset = Point.convert(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?.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\n        if (!this._element.hasAttribute('aria-label')) {\n            this._element.setAttribute('aria-label', map._getUIString('Marker.Title'));\n        }\n\n        // aria-label is set either by user or above default, so set role\n        // since div is interactive and cannot have aria-label without a role\n        if (!this._element.hasAttribute('role')) {\n            this._element.setAttribute('role', 'button');\n        }\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        map.on('projectiontransition', this._update);\n\n        this._element.addEventListener('click', this._onClick);\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('projectiontransition', 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        this._element.removeEventListener('click', this._onClick);\n        this._element.remove();\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/create-a-draggable-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/add-custom-icons-with-markers/)\n     * @see [Create a draggable Marker](https://maplibre.org/maplibre-gl-js/docs/examples/create-a-draggable-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/attach-a-popup-to-a-marker-instance/)\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    _onClick = (e: MouseEvent) => {\n        this.fire(new Event('click', {originalEvent: e}));\n    };\n\n    _onKeyPress = (e: KeyboardEvent) => {\n        if (e.code === 'Space' || e.code === 'Enter') {\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        const occluded = this._map.transform.isLocationOccluded(this._lngLat);\n        if (!terrain || occluded) {\n            const targetOpacity = occluded ? this._opacityWhenCovered : this._opacity;\n            if (this._element.style.opacity !== targetOpacity) {\n                this._element.style.opacity = targetOpacity;\n                this._element.classList.toggle('maplibregl-marker-covered', occluded);\n            }\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.getElevationForLngLat(this._lngLat, map.transform);\n        const markerDistance = map.transform.lngLatToCameraDepth(this._lngLat, elevation);\n        const forgiveness = .006;\n        if (markerDistance - terrainDistance < forgiveness) {\n            this._element.style.opacity = this._opacity;\n            this._element.classList.remove('maplibregl-marker-covered');\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.pixelsPerMeter;\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        this._element.classList.toggle('maplibregl-marker-covered', centerIsInvisible);\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        this._lngLat = smartWrap(this._lngLat, this._flatPos, this._map.transform);\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.locationToScreenPoint(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        this._element.style.transform = `${anchorTranslate[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${pitch} ${rotation}`;\n\n        browser.frameAsync(new AbortController(), this._map._ownerWindow).then(() => { // Run _updateOpacity only after painter.render and drawDepth\n            this._updateOpacity(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 | number, opacityWhenCovered?: string | number): this {\n        // Reset opacity when called without params or from constructor\n        if (this._opacity === undefined || (opacity === undefined && opacityWhenCovered === undefined)) {\n            this._opacity = '1';\n            this._opacityWhenCovered = '0.2';\n        }\n\n        if (opacity !== undefined) {\n            this._opacity = String(opacity);\n        }\n        if (opacityWhenCovered !== undefined) {\n            this._opacityWhenCovered = String(opacityWhenCovered);\n        }\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 */\nexport type 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-the-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        this._container.remove();\n        this._map.off('movestart', this._onMoveStart);\n        this._map.off('zoom', this._onUpdate);\n        this._map.off('move', this._onUpdate);\n        this._map.off('rotate', this._onUpdate);\n        this._map.off('pitch', this._onUpdate);\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            case 'BACKGROUND_ERROR':\n                // already in error state\n                break;\n            case 'OFF':\n            case undefined:\n                // when trackUserLocation is false, watchState is undefined\n                // when trackUserLocation is true but not activated, watchState is 'OFF'\n                // in both cases, no error state transition is needed\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            this._updateCircleRadiusIfNeeded();\n        } else {\n            this._userLocationDotMarker.remove();\n            this._accuracyCircleMarker.remove();\n        }\n    };\n\n    _updateCircleRadiusIfNeeded() {\n        const userLocation = this._userLocationDotMarker.getLngLat();\n        if (!this.options.showUserLocation || !this.options.showAccuracyCircle || !this._accuracy || !userLocation) {\n            return;\n        }\n        const screenPosition = this._map.project(userLocation);\n        const userLocationWith100Px = this._map.unproject([screenPosition.x + 100, screenPosition.y]);\n        const pixelsToMeters = userLocation.distanceTo(userLocationWith100Px) / 100;\n        const circleDiameter = 2 * this._accuracy / pixelsToMeters;\n        this._circleElement.style.width = `${circleDiameter.toFixed(2)}px`;\n        this._circleElement.style.height = `${circleDiameter.toFixed(2)}px`;\n    }\n\n    _onUpdate = () => {\n        this._updateCircleRadiusIfNeeded();\n    };\n\n    _onError = (error: GeolocationPositionError) => {\n        if (!this._map) {\n            // control has since been removed\n            return;\n        }\n\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        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    _onMoveStart = (event: any) => {\n        if (!this._map) return;\n        const fromResize = event?.[0] instanceof ResizeObserverEntry;\n        if (!event.geolocateSource && this._watchState === 'ACTIVE_LOCK' && !fromResize && !this._map.isZooming()) {\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    _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._onUpdate);\n            this._map.on('move', this._onUpdate);\n            this._map.on('rotate', this._onUpdate);\n            this._map.on('pitch', this._onUpdate);\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', this._onMoveStart);\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", "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 */\nexport type 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        this._container.remove();\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: Map, container: HTMLElement, options: ScaleControlOptions) {\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    // Minimum maxWidth is calculated for the scale box.\n    const optWidth = options?.maxWidth || 100;\n    const y = map._container.clientHeight / 2;\n    const x = map._container.clientWidth / 2;\n    const left = map.unproject([x - optWidth / 2, y]);\n    const right = map.unproject([x + optWidth / 2, y]);\n\n    const globeWidth = Math.round(map.project(right).x - map.project(left).x);\n    const maxWidth = Math.min(optWidth, globeWidth, map._container.clientWidth);\n\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?.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?.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: HTMLElement, maxWidth: number, maxDistance: number, unit: string) {\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 {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 {MapLibreEvent, MapMouseEvent} from './events';\nimport type {PositionAnchor} from './anchor';\nimport type {Map} from './map';\nimport type {LngLatLike} from '../geo/lng_lat';\nimport type {PointLike} from './camera';\nimport type {PaddingOptions} from '../geo/edge_insets';\n\nconst defaultOptions = {\n    closeButton: true,\n    closeOnClick: true,\n    focusAfterOpen: true,\n    className: '',\n    maxWidth: '240px',\n    subpixelPositioning: false,\n    locationOccludedOpacity: undefined,\n    padding: undefined,\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 PointLike}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     * Optional opacity when the location is behind the globe.\n     * Note that if a number is provided, it will be converted to a string.\n     * @defaultValue undefined\n     */\n    locationOccludedOpacity?: number | string;\n    /**\n     * A pixel padding applied to the popup's positioning constraints.\n     * The popup will be positioned to avoid being placed within this padding area\n     * from the edges of the map container.\n     * @defaultValue undefined\n     */\n    padding?: PaddingOptions;\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/display-a-popup/)\n * @see [Display a popup on hover](https://maplibre.org/maplibre-gl-js/docs/examples/display-a-popup-on-hover/)\n * @see [Display a popup on click](https://maplibre.org/maplibre-gl-js/docs/examples/display-a-popup-on-click/)\n * @see [Attach a popup to a marker instance](https://maplibre.org/maplibre-gl-js/docs/examples/attach-a-popup-to-a-marker-instance/)\n * @see [Show polygon information on click](https://maplibre.org/maplibre-gl-js/docs/examples/show-polygon-information-on-click/)\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/display-a-popup/)\n     * @see [Display a popup on hover](https://maplibre.org/maplibre-gl-js/docs/examples/display-a-popup-on-hover/)\n     * @see [Display a popup on click](https://maplibre.org/maplibre-gl-js/docs/examples/display-a-popup-on-click/)\n     * @see [Show polygon information on click](https://maplibre.org/maplibre-gl-js/docs/examples/show-polygon-information-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._map.on('terrain', this._update);\n        this._map.on('projectiontransition', this._update);\n        this._update();\n        this._focusFirstElement();\n\n        if (this._trackPointer) {\n            this._map.on('mousemove', this._update);\n            this._map.on('mouseup', this._update);\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     * Add opacity to popup if in globe projection and location is behind view\n     */\n    _updateOpacity = () => {\n        if (this.options.locationOccludedOpacity === undefined) {\n            return;\n        }\n        if (this._map.transform.isLocationOccluded(this.getLngLat())) {\n            this._container.style.opacity = `${this.options.locationOccludedOpacity}`;\n        } else {\n            this._container.style.opacity = '';\n        }\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            this._content.remove();\n        }\n\n        if (this._container) {\n            this._container.remove();\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('terrain', this._update);\n            this._map.off('projectiontransition', this._update);\n            this._map.off('mousemove', this._update);\n            this._map.off('mouseup', this._update);\n            this._map.off('drag', this._update);\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._update);\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._update);\n            this._map.on('drag', this._update);\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/display-a-popup/)\n     * @see [Display a popup on hover](https://maplibre.org/maplibre-gl-js/docs/examples/display-a-popup-on-hover/)\n     * @see [Display a popup on click](https://maplibre.org/maplibre-gl-js/docs/examples/display-a-popup-on-click/)\n     * @see [Attach a popup to a marker instance](https://maplibre.org/maplibre-gl-js/docs/examples/attach-a-popup-to-a-marker-instance/)\n     */\n    setHTML(html: string): this {\n        const frag = document.createDocumentFragment();\n        const temp = document.createElement('body');\n        let child: ChildNode;\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    /**\n     * Sets the popup's padding constraints for positioning.\n     *\n     * @param padding - The padding to apply as a {@link PaddingOptions} object.\n     * @example\n     * ```ts\n     * popup.setPadding({ top: 10, right: 20, bottom: 30, left: 40 });\n     * ```\n     */\n    setPadding(padding?: PaddingOptions) {\n        this.options.padding = padding;\n        this._update();\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    _update = (event?: MapLibreEvent | MapMouseEvent) => {\n        \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        this._lngLat = smartWrap(this._lngLat, this._flatPos, this._map.transform, this._trackPointer);\n\n        let cursor: Point;\n        if (event && 'point' in event && event.point) {\n            cursor = event.point;\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.locationToScreenPoint(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            const padding = normalizePadding(this.options.padding);\n            let anchorComponents: string[];\n\n            if (pos.y + offset.bottom.y < height + padding.top) {\n                anchorComponents = ['top'];\n            } else if (pos.y > this._map.transform.height - height - padding.bottom) {\n                anchorComponents = ['bottom'];\n            } else {\n                anchorComponents = [];\n            }\n\n            if (pos.x < width / 2 + padding.left) {\n                anchorComponents.push('left');\n            } else if (pos.x > this._map.transform.width - width / 2 - padding.right) {\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        this._container.style.transform = `${anchorTranslate[anchor]} translate(${offsetedPos.x}px,${offsetedPos.y}px)`;\n        applyAnchorClass(this._container, anchor, 'popup');\n\n        this._updateOpacity();\n    };\n\n    _focusFirstElement() {\n        if (!this.options.focusAfterOpen || !this._container) return;\n\n        const firstFocusable = this._container.querySelector<HTMLElement>(focusQuerySelector);\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\nfunction normalizePadding(padding?: PaddingOptions | null): {top: number; right: number; bottom: number; left: number} {\n    if (!padding) {\n        return {top: 0, right: 0, bottom: 0, left: 0};\n    }\n\n    return {\n        top: padding.top ?? 0,\n        right: padding.right ?? 0,\n        bottom: padding.bottom ?? 0,\n        left: padding.left ?? 0\n    };\n}\n", "import packageJSON from '../package.json' with {type: 'json'};\nimport {Map, type MapOptions, type WebGLContextAttributesWithType} from './ui/map';\nimport {NavigationControl, type NavigationControlOptions} from './ui/control/navigation_control';\nimport {GeolocateControl, type GeolocateControlOptions} from './ui/control/geolocate_control';\nimport {AttributionControl, type AttributionControlOptions} from './ui/control/attribution_control';\nimport {LogoControl, type LogoControlOptions} from './ui/control/logo_control';\nimport {ScaleControl, type ScaleControlOptions, type Unit} from './ui/control/scale_control';\nimport {FullscreenControl, type FullscreenControlOptions} from './ui/control/fullscreen_control';\nimport {TerrainControl} from './ui/control/terrain_control';\nimport {GlobeControl} from './ui/control/globe_control';\nimport {type Offset, Popup, type PopupOptions} from './ui/popup';\nimport {type Alignment, Marker, type MarkerOptions} from './ui/marker';\nimport {type AddLayerObject, type FeatureIdentifier, Style, type StyleOptions, type StyleSetterOptions, type StyleSwapOptions, type TransformStyleFunction} from './style/style';\nimport {LngLat, type LngLatLike} from './geo/lng_lat';\nimport {LngLatBounds, type LngLatBoundsLike} from './geo/lng_lat_bounds';\nimport Point from '@mapbox/point-geometry';\nimport {MercatorCoordinate} from './geo/mercator_coordinate';\nimport {Evented, type ErrorEvent, Event, type Listener} from './util/evented';\nimport {type AddProtocolAction, config} from './util/config';\nimport {rtlMainThreadPluginFactory} from './source/rtl_text_plugin_main_thread';\nimport {now, setNow, restoreNow, isTimeFrozen} from './util/time_control';\nimport {WorkerPool} from './util/worker_pool';\nimport {prewarm, clearPrewarmedResources} from './util/global_worker_pool';\nimport {AJAXError, type ExpiryData, type GetResourceResponse, type RequestParameters} from './util/ajax';\nimport {GeoJSONSource, type SetClusterOptions} from './source/geojson_source';\nimport {CanvasSource, type CanvasSourceSpecification} from './source/canvas_source';\nimport {type CanonicalTileRange, type Coordinates, ImageSource, type UpdateImageOptions} from './source/image_source';\nimport {RasterDEMTileSource} from './source/raster_dem_tile_source';\nimport {RasterTileSource} from './source/raster_tile_source';\nimport {VectorTileSource, type LoadTileResult} from './source/vector_tile_source';\nimport {VideoSource} from './source/video_source';\nimport {type Source, type SourceClass, addSourceType} from './source/source';\nimport {addProtocol, removeProtocol} from './source/protocol_crud';\nimport {type Dispatcher, getGlobalDispatcher} from './util/dispatcher';\nimport {EdgeInsets, type PaddingOptions} from './geo/edge_insets';\nimport {type MapTerrainEvent, type MapStyleImageMissingEvent, type MapStyleDataEvent, type MapSourceDataEvent, type MapLibreZoomEvent, type MapLibreEvent, type MapLayerTouchEvent, type MapLayerMouseEvent, type MapLayerEventType, type MapEventType, type MapDataEvent, type MapContextEvent, MapWheelEvent, MapTouchEvent, MapMouseEvent, type MapSourceDataType, type MapProjectionEvent} from './ui/events';\nimport {BoxZoomHandler, type BoxZoomEndHandler, type BoxZoomHandlerOptions} from './ui/handler/box_zoom';\nimport {DragRotateHandler} from './ui/handler/shim/drag_rotate';\nimport {DragPanHandler, type DragPanOptions} from './ui/handler/shim/drag_pan';\nimport {ScrollZoomHandler} from './ui/handler/scroll_zoom';\nimport {TwoFingersTouchZoomRotateHandler} from './ui/handler/shim/two_fingers_touch';\nimport {Hash} from './ui/hash';\nimport {CooperativeGesturesHandler, type GestureOptions} from './ui/handler/cooperative_gestures';\nimport {DoubleClickZoomHandler} from './ui/handler/shim/dblclick_zoom';\nimport {KeyboardHandler} from './ui/handler/keyboard';\nimport {TwoFingersTouchPitchHandler, TwoFingersTouchRotateHandler, TwoFingersTouchZoomHandler, type AroundCenterOptions} from './ui/handler/two_fingers_touch';\nimport {MessageType, type ActorMessage, type RequestResponseMessageMap} from './util/actor_messages';\nimport {createTileMesh, type CreateTileMeshOptions, type IndicesType, type TileMesh} from './util/create_tile_mesh';\nimport type {ControlPosition, IControl} from './ui/control/control';\nimport type {CustomRenderMethod, CustomLayerInterface, CustomRenderMethodInput} from './style/style_layer/custom_style_layer';\nimport type {AnimationOptions, CameraForBoundsOptions, CameraOptions, CameraUpdateTransformFunction, CenterZoomBearing, EaseToOptions, FitBoundsOptions, FlyToOptions, JumpToOptions, PointLike} from './ui/camera';\nimport type {DistributiveKeys, DistributiveOmit, GeoJSONFeature, MapGeoJSONFeature} from './util/vectortile_to_geojson';\nimport type {Handler, HandlerResult} from './ui/handler_manager';\nimport type {Complete, RequireAtLeastOne, Subscription} from './util/util';\nimport type {CalculateTileZoomFunction, CoveringTilesOptions} from './geo/projection/covering_tiles';\nimport type {TransformConstrainFunction} from './geo/transform_interface';\nimport type {StyleImage, StyleImageData, StyleImageInterface, StyleImageMetadata, TextFit} from './style/style_image';\nimport type {StyleLayer} from './style/style_layer';\nimport type {Tile} from './tile/tile';\nimport type {GeoJSONFeatureDiff, GeoJSONFeatureId, GeoJSONSourceDiff} from './source/geojson_source_diff';\nimport type {QueryRenderedFeaturesOptions, QuerySourceFeatureOptions} from './source/query_features';\nimport type {RequestTransformFunction, ResourceType} from './util/request_manager';\nimport {EXTENT} from './data/extent';\nimport type {OverscaledTileID} from './tile/tile_id';\nimport type {PositionAnchor} from './ui/anchor';\nimport type {ProjectionData} from './geo/projection/projection_data';\nimport type {WorkerTileResult} from './source/worker_source';\nimport type {Actor, IActor} from './util/actor';\nimport type {Bucket} from './data/bucket';\nimport type {CollisionBoxArray} from './data/array_types.g';\nimport type {AlphaImage} from './util/image';\nimport type {GlyphPosition, GlyphPositions} from './render/glyph_atlas';\nimport type {ImageAtlas} from './render/image_atlas';\nimport type {StyleGlyph} from './style/style_glyph';\nimport type {FeatureIndex} from './data/feature_index';\nimport type {DashEntry} from './render/line_atlas';\nimport type {Painter} from './render/painter';\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.3.0/dist/mapbox-gl-rtl-text.js', false);\n * ```\n * @see [Add support for right-to-left scripts](https://maplibre.org/maplibre-gl-js/docs/examples/add-support-for-right-to-left-scripts/)\n * @see [Display and style rich text labels](https://maplibre.org/maplibre-gl-js/docs/examples/display-and-style-rich-text-labels/)\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    Map as MapLibreMap,\n    NavigationControl,\n    GeolocateControl,\n    AttributionControl,\n    LogoControl,\n    ScaleControl,\n    FullscreenControl,\n    TerrainControl,\n    GlobeControl,\n    Hash,\n    Popup,\n    Marker,\n    Style,\n    LngLat,\n    LngLatBounds,\n    Point,\n    MercatorCoordinate,\n    Evented,\n    Event,\n    AJAXError,\n    config,\n    CanvasSource,\n    GeoJSONSource,\n    ImageSource,\n    RasterDEMTileSource,\n    RasterTileSource,\n    VectorTileSource,\n    LoadTileResult,\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 Handler,\n    type RequireAtLeastOne,\n    type CameraUpdateTransformFunction,\n    type TransformConstrainFunction,\n    type CustomRenderMethod,\n    type CalculateTileZoomFunction,\n    type MapSourceDataType,\n    type TileMesh,\n    type CreateTileMeshOptions,\n    type ControlPosition,\n    type Subscription,\n    type Complete,\n    type CameraOptions,\n    type CenterZoomBearing,\n    type StyleImage,\n    type StyleImageData,\n    type StyleImageMetadata,\n    type StyleLayer,\n    type GetResourceResponse,\n    type MapGeoJSONFeature,\n    type Alignment,\n    type AddProtocolAction,\n    type SourceClass,\n    type IndicesType,\n    type AttributionControlOptions,\n    type CanonicalTileRange,\n    type Tile,\n    type Listener,\n    type Coordinates,\n    type UpdateImageOptions,\n    type DragPanOptions,\n    type FullscreenControlOptions,\n    type SetClusterOptions,\n    type GeoJSONSourceDiff,\n    type GeolocateControlOptions,\n    type LogoControlOptions,\n    type StyleImageInterface,\n    type AddLayerObject,\n    type StyleSetterOptions,\n    type CameraForBoundsOptions,\n    type EaseToOptions,\n    type FitBoundsOptions,\n    type FlyToOptions,\n    type FeatureIdentifier,\n    type JumpToOptions,\n    type QueryRenderedFeaturesOptions,\n    type QuerySourceFeatureOptions,\n    type AnimationOptions,\n    type StyleSwapOptions,\n    type StyleOptions,\n    type RequestTransformFunction,\n    type MarkerOptions,\n    type NavigationControlOptions,\n    type PopupOptions,\n    type Offset,\n    type OverscaledTileID,\n    type ScaleControlOptions,\n    type Unit,\n    type AroundCenterOptions,\n    type BoxZoomEndHandler,\n    type BoxZoomHandlerOptions,\n    type HandlerResult,\n    type CustomRenderMethodInput,\n    type ExpiryData,\n    type PositionAnchor,\n    type ProjectionData,\n    type GeoJSONFeatureId,\n    type GeoJSONFeatureDiff,\n    type TextFit,\n    type TransformStyleFunction,\n    type DistributiveOmit,\n    type DistributiveKeys,\n    type RequestParameters,\n    type RequestResponseMessageMap,\n    type WorkerTileResult,\n    type ResourceType,\n    type Dispatcher,\n    type Actor,\n    type IActor,\n    type ActorMessage,\n    type Bucket,\n    type CollisionBoxArray,\n    type FeatureIndex,\n    type AlphaImage,\n    type GlyphPositions,\n    type GlyphPosition,\n    type ImageAtlas,\n    type MessageType,\n    type StyleGlyph,\n    type MapOptions,\n    type GestureOptions,\n    type WebGLContextAttributesWithType,\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 MapProjectionEvent,\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    type ErrorEvent,\n    type GeoJSONFeature,\n    type CoveringTilesOptions,\n    type DashEntry,\n    type Painter,\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    createTileMesh,\n    now,\n    setNow,\n    restoreNow,\n    isTimeFrozen,\n    getGlobalDispatcher,\n    EXTENT\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 */\nexport type 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     * If `true`, the fullscreen control will always use pseudo fullscreen mode (CSS-based, expanding to browser viewport) instead of native fullscreen API.\n     * This can be useful for faster transitions and to allow multiple maps to be \"fullscreen\" simultaneously in different browser windows.\n     * @defaultValue false\n     */\n    pseudo?: boolean;\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/view-a-fullscreen-map/)\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    _pseudo: boolean;\n\n    /**\n     * @param options - the control's options\n     */\n    constructor(options: FullscreenControlOptions = {}) {\n        super();\n        this._fullscreen = false;\n        this._pseudo = options.pseudo ?? false;\n\n        if (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        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        this._controlContainer.remove();\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        // WebKit due to https://caniuse.com/mdn-api_document_fullscreenelement\n        let fullscreenElement =\n            window.document.fullscreenElement ||\n            (window.document as any).webkitFullscreenElement;\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 (this._pseudo) {\n            this._togglePseudoFullScreen();\n        } else if (window.document.exitFullscreen) {\n            (window.document as any).exitFullscreen();\n        } else if ((window.document as any).webkitCancelFullScreen) {\n            // due to https://caniuse.com/mdn-api_document_exitfullscreen\n            (window.document as any).webkitCancelFullScreen();\n        } else {\n            this._togglePseudoFullScreen();\n        }\n    }\n\n    _requestFullscreen() {\n        if (this._pseudo) {\n            this._togglePseudoFullScreen();\n        } else if (this._container.requestFullscreen) {\n            this._container.requestFullscreen();\n        } else if ((this._container as any).webkitRequestFullscreen) {\n            // due to https://caniuse.com/mdn-api_element_requestfullscreen\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';\n\n/**\n * A `GlobeControl` control contains a button for toggling the map projection between \"mercator\" and \"globe\".\n *\n * @group Markers and Controls\n *\n * @example\n * ```ts\n * let map = new Map()\n *     .addControl(new GlobeControl());\n * ```\n *\n * @see [Display a globe with a fill extrusion layer](https://maplibre.org/maplibre-gl-js/docs/examples/display-a-globe-with-a-fill-extrusion-layer/)\n * @see [Sky, Fog, Terrain](https://maplibre.org/maplibre-gl-js/docs/examples/sky-fog-terrain/)\n */\nexport class GlobeControl implements IControl {\n    _map: Map;\n    _container: HTMLElement;\n    _globeButton: HTMLButtonElement;\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._globeButton = DOM.create('button', 'maplibregl-ctrl-globe', this._container);\n        DOM.create('span', 'maplibregl-ctrl-icon', this._globeButton).setAttribute('aria-hidden', 'true');\n        this._globeButton.type = 'button';\n        this._globeButton.addEventListener('click', this._toggleProjection);\n\n        this._updateGlobeIcon();\n        this._map.on('styledata', this._updateGlobeIcon);\n        this._map.on('projectiontransition', this._updateGlobeIcon);\n        return this._container;\n    }\n\n    /** {@inheritDoc IControl.onRemove} */\n    onRemove() {\n        this._container.remove();\n        this._map.off('styledata', this._updateGlobeIcon);\n        this._map.off('projectiontransition', this._updateGlobeIcon);\n        this._globeButton.removeEventListener('click', this._toggleProjection);\n        this._map = undefined;\n    }\n\n    _toggleProjection = () => {\n        const currentProjection = this._map.getProjection()?.type;\n        if (currentProjection === 'mercator' || !currentProjection) {\n            this._map.setProjection({type: 'globe'});\n        } else {\n            this._map.setProjection({type: 'mercator'});\n        }\n        this._updateGlobeIcon();\n    };\n\n    _updateGlobeIcon = () => {\n        this._globeButton.classList.remove('maplibregl-ctrl-globe');\n        this._globeButton.classList.remove('maplibregl-ctrl-globe-enabled');\n        if (this._map.getProjection()?.type === 'globe') {\n            this._globeButton.classList.add('maplibregl-ctrl-globe-enabled');\n            this._globeButton.title = this._map._getUIString('GlobeControl.Disable');\n        } else {\n            this._globeButton.classList.add('maplibregl-ctrl-globe');\n            this._globeButton.title = this._map._getUIString('GlobeControl.Enable');\n        }\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 * @see [3D Terrain](https://maplibre.org/maplibre-gl-js/docs/examples/3d-terrain/)\n * @see [Create a Heatmap layer on a globe with terrain elevation](https://maplibre.org/maplibre-gl-js/docs/examples/create-a-heatmap-layer-on-a-globe-with-terrain-elevation/)\n * @see [Display a hybrid satellite map with terrain elevation](https://maplibre.org/maplibre-gl-js/docs/examples/display-a-hybrid-satellite-map-with-terrain-elevation/)\n * @see [Sky, Fog, Terrain](https://maplibre.org/maplibre-gl-js/docs/examples/sky-fog-terrain/)\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        this._container.remove();\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", "/*!\n * jQuery JavaScript Library v3.7.1\n * https://jquery.com/\n *\n * Copyright OpenJS Foundation and other contributors\n * Released under the MIT license\n * https://jquery.org/license\n *\n * Date: 2023-08-28T13:37Z\n */\n( function( global, factory ) {\n\n\t\"use strict\";\n\n\tif ( typeof module === \"object\" && typeof module.exports === \"object\" ) {\n\n\t\t// For CommonJS and CommonJS-like environments where a proper `window`\n\t\t// is present, execute the factory and get jQuery.\n\t\t// For environments that do not have a `window` with a `document`\n\t\t// (such as Node.js), expose a factory as module.exports.\n\t\t// This accentuates the need for the creation of a real `window`.\n\t\t// e.g. var jQuery = require(\"jquery\")(window);\n\t\t// See ticket trac-14549 for more info.\n\t\tmodule.exports = global.document ?\n\t\t\tfactory( global, true ) :\n\t\t\tfunction( w ) {\n\t\t\t\tif ( !w.document ) {\n\t\t\t\t\tthrow new Error( \"jQuery requires a window with a document\" );\n\t\t\t\t}\n\t\t\t\treturn factory( w );\n\t\t\t};\n\t} else {\n\t\tfactory( global );\n\t}\n\n// Pass this if window is not defined yet\n} )( typeof window !== \"undefined\" ? window : this, function( window, noGlobal ) {\n\n// Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1\n// throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode\n// arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common\n// enough that all such attempts are guarded in a try block.\n\"use strict\";\n\nvar arr = [];\n\nvar getProto = Object.getPrototypeOf;\n\nvar slice = arr.slice;\n\nvar flat = arr.flat ? function( array ) {\n\treturn arr.flat.call( array );\n} : function( array ) {\n\treturn arr.concat.apply( [], array );\n};\n\n\nvar push = arr.push;\n\nvar indexOf = arr.indexOf;\n\nvar class2type = {};\n\nvar toString = class2type.toString;\n\nvar hasOwn = class2type.hasOwnProperty;\n\nvar fnToString = hasOwn.toString;\n\nvar ObjectFunctionString = fnToString.call( Object );\n\nvar support = {};\n\nvar isFunction = function isFunction( obj ) {\n\n\t\t// Support: Chrome <=57, Firefox <=52\n\t\t// In some browsers, typeof returns \"function\" for HTML <object> elements\n\t\t// (i.e., `typeof document.createElement( \"object\" ) === \"function\"`).\n\t\t// We don't want to classify *any* DOM node as a function.\n\t\t// Support: QtWeb <=3.8.5, WebKit <=534.34, wkhtmltopdf tool <=0.12.5\n\t\t// Plus for old WebKit, typeof returns \"function\" for HTML collections\n\t\t// (e.g., `typeof document.getElementsByTagName(\"div\") === \"function\"`). (gh-4756)\n\t\treturn typeof obj === \"function\" && typeof obj.nodeType !== \"number\" &&\n\t\t\ttypeof obj.item !== \"function\";\n\t};\n\n\nvar isWindow = function isWindow( obj ) {\n\t\treturn obj != null && obj === obj.window;\n\t};\n\n\nvar document = window.document;\n\n\n\n\tvar preservedScriptAttributes = {\n\t\ttype: true,\n\t\tsrc: true,\n\t\tnonce: true,\n\t\tnoModule: true\n\t};\n\n\tfunction DOMEval( code, node, doc ) {\n\t\tdoc = doc || document;\n\n\t\tvar i, val,\n\t\t\tscript = doc.createElement( \"script\" );\n\n\t\tscript.text = code;\n\t\tif ( node ) {\n\t\t\tfor ( i in preservedScriptAttributes ) {\n\n\t\t\t\t// Support: Firefox 64+, Edge 18+\n\t\t\t\t// Some browsers don't support the \"nonce\" property on scripts.\n\t\t\t\t// On the other hand, just using `getAttribute` is not enough as\n\t\t\t\t// the `nonce` attribute is reset to an empty string whenever it\n\t\t\t\t// becomes browsing-context connected.\n\t\t\t\t// See https://github.com/whatwg/html/issues/2369\n\t\t\t\t// See https://html.spec.whatwg.org/#nonce-attributes\n\t\t\t\t// The `node.getAttribute` check was added for the sake of\n\t\t\t\t// `jQuery.globalEval` so that it can fake a nonce-containing node\n\t\t\t\t// via an object.\n\t\t\t\tval = node[ i ] || node.getAttribute && node.getAttribute( i );\n\t\t\t\tif ( val ) {\n\t\t\t\t\tscript.setAttribute( i, val );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tdoc.head.appendChild( script ).parentNode.removeChild( script );\n\t}\n\n\nfunction toType( obj ) {\n\tif ( obj == null ) {\n\t\treturn obj + \"\";\n\t}\n\n\t// Support: Android <=2.3 only (functionish RegExp)\n\treturn typeof obj === \"object\" || typeof obj === \"function\" ?\n\t\tclass2type[ toString.call( obj ) ] || \"object\" :\n\t\ttypeof obj;\n}\n/* global Symbol */\n// Defining this global in .eslintrc.json would create a danger of using the global\n// unguarded in another place, it seems safer to define global only for this module\n\n\n\nvar version = \"3.7.1\",\n\n\trhtmlSuffix = /HTML$/i,\n\n\t// Define a local copy of jQuery\n\tjQuery = function( selector, context ) {\n\n\t\t// The jQuery object is actually just the init constructor 'enhanced'\n\t\t// Need init if jQuery is called (just allow error to be thrown if not included)\n\t\treturn new jQuery.fn.init( selector, context );\n\t};\n\njQuery.fn = jQuery.prototype = {\n\n\t// The current version of jQuery being used\n\tjquery: version,\n\n\tconstructor: jQuery,\n\n\t// The default length of a jQuery object is 0\n\tlength: 0,\n\n\ttoArray: function() {\n\t\treturn slice.call( this );\n\t},\n\n\t// Get the Nth element in the matched element set OR\n\t// Get the whole matched element set as a clean array\n\tget: function( num ) {\n\n\t\t// Return all the elements in a clean array\n\t\tif ( num == null ) {\n\t\t\treturn slice.call( this );\n\t\t}\n\n\t\t// Return just the one element from the set\n\t\treturn num < 0 ? this[ num + this.length ] : this[ num ];\n\t},\n\n\t// Take an array of elements and push it onto the stack\n\t// (returning the new matched element set)\n\tpushStack: function( elems ) {\n\n\t\t// Build a new jQuery matched element set\n\t\tvar ret = jQuery.merge( this.constructor(), elems );\n\n\t\t// Add the old object onto the stack (as a reference)\n\t\tret.prevObject = this;\n\n\t\t// Return the newly-formed element set\n\t\treturn ret;\n\t},\n\n\t// Execute a callback for every element in the matched set.\n\teach: function( callback ) {\n\t\treturn jQuery.each( this, callback );\n\t},\n\n\tmap: function( callback ) {\n\t\treturn this.pushStack( jQuery.map( this, function( elem, i ) {\n\t\t\treturn callback.call( elem, i, elem );\n\t\t} ) );\n\t},\n\n\tslice: function() {\n\t\treturn this.pushStack( slice.apply( this, arguments ) );\n\t},\n\n\tfirst: function() {\n\t\treturn this.eq( 0 );\n\t},\n\n\tlast: function() {\n\t\treturn this.eq( -1 );\n\t},\n\n\teven: function() {\n\t\treturn this.pushStack( jQuery.grep( this, function( _elem, i ) {\n\t\t\treturn ( i + 1 ) % 2;\n\t\t} ) );\n\t},\n\n\todd: function() {\n\t\treturn this.pushStack( jQuery.grep( this, function( _elem, i ) {\n\t\t\treturn i % 2;\n\t\t} ) );\n\t},\n\n\teq: function( i ) {\n\t\tvar len = this.length,\n\t\t\tj = +i + ( i < 0 ? len : 0 );\n\t\treturn this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] );\n\t},\n\n\tend: function() {\n\t\treturn this.prevObject || this.constructor();\n\t},\n\n\t// For internal use only.\n\t// Behaves like an Array's method, not like a jQuery method.\n\tpush: push,\n\tsort: arr.sort,\n\tsplice: arr.splice\n};\n\njQuery.extend = jQuery.fn.extend = function() {\n\tvar options, name, src, copy, copyIsArray, clone,\n\t\ttarget = arguments[ 0 ] || {},\n\t\ti = 1,\n\t\tlength = arguments.length,\n\t\tdeep = false;\n\n\t// Handle a deep copy situation\n\tif ( typeof target === \"boolean\" ) {\n\t\tdeep = target;\n\n\t\t// Skip the boolean and the target\n\t\ttarget = arguments[ i ] || {};\n\t\ti++;\n\t}\n\n\t// Handle case when target is a string or something (possible in deep copy)\n\tif ( typeof target !== \"object\" && !isFunction( target ) ) {\n\t\ttarget = {};\n\t}\n\n\t// Extend jQuery itself if only one argument is passed\n\tif ( i === length ) {\n\t\ttarget = this;\n\t\ti--;\n\t}\n\n\tfor ( ; i < length; i++ ) {\n\n\t\t// Only deal with non-null/undefined values\n\t\tif ( ( options = arguments[ i ] ) != null ) {\n\n\t\t\t// Extend the base object\n\t\t\tfor ( name in options ) {\n\t\t\t\tcopy = options[ name ];\n\n\t\t\t\t// Prevent Object.prototype pollution\n\t\t\t\t// Prevent never-ending loop\n\t\t\t\tif ( name === \"__proto__\" || target === copy ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Recurse if we're merging plain objects or arrays\n\t\t\t\tif ( deep && copy && ( jQuery.isPlainObject( copy ) ||\n\t\t\t\t\t( copyIsArray = Array.isArray( copy ) ) ) ) {\n\t\t\t\t\tsrc = target[ name ];\n\n\t\t\t\t\t// Ensure proper type for the source value\n\t\t\t\t\tif ( copyIsArray && !Array.isArray( src ) ) {\n\t\t\t\t\t\tclone = [];\n\t\t\t\t\t} else if ( !copyIsArray && !jQuery.isPlainObject( src ) ) {\n\t\t\t\t\t\tclone = {};\n\t\t\t\t\t} else {\n\t\t\t\t\t\tclone = src;\n\t\t\t\t\t}\n\t\t\t\t\tcopyIsArray = false;\n\n\t\t\t\t\t// Never move original objects, clone them\n\t\t\t\t\ttarget[ name ] = jQuery.extend( deep, clone, copy );\n\n\t\t\t\t// Don't bring in undefined values\n\t\t\t\t} else if ( copy !== undefined ) {\n\t\t\t\t\ttarget[ name ] = copy;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Return the modified object\n\treturn target;\n};\n\njQuery.extend( {\n\n\t// Unique for each copy of jQuery on the page\n\texpando: \"jQuery\" + ( version + Math.random() ).replace( /\\D/g, \"\" ),\n\n\t// Assume jQuery is ready without the ready module\n\tisReady: true,\n\n\terror: function( msg ) {\n\t\tthrow new Error( msg );\n\t},\n\n\tnoop: function() {},\n\n\tisPlainObject: function( obj ) {\n\t\tvar proto, Ctor;\n\n\t\t// Detect obvious negatives\n\t\t// Use toString instead of jQuery.type to catch host objects\n\t\tif ( !obj || toString.call( obj ) !== \"[object Object]\" ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tproto = getProto( obj );\n\n\t\t// Objects with no prototype (e.g., `Object.create( null )`) are plain\n\t\tif ( !proto ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// Objects with prototype are plain iff they were constructed by a global Object function\n\t\tCtor = hasOwn.call( proto, \"constructor\" ) && proto.constructor;\n\t\treturn typeof Ctor === \"function\" && fnToString.call( Ctor ) === ObjectFunctionString;\n\t},\n\n\tisEmptyObject: function( obj ) {\n\t\tvar name;\n\n\t\tfor ( name in obj ) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t},\n\n\t// Evaluates a script in a provided context; falls back to the global one\n\t// if not specified.\n\tglobalEval: function( code, options, doc ) {\n\t\tDOMEval( code, { nonce: options && options.nonce }, doc );\n\t},\n\n\teach: function( obj, callback ) {\n\t\tvar length, i = 0;\n\n\t\tif ( isArrayLike( obj ) ) {\n\t\t\tlength = obj.length;\n\t\t\tfor ( ; i < length; i++ ) {\n\t\t\t\tif ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tfor ( i in obj ) {\n\t\t\t\tif ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn obj;\n\t},\n\n\n\t// Retrieve the text value of an array of DOM nodes\n\ttext: function( elem ) {\n\t\tvar node,\n\t\t\tret = \"\",\n\t\t\ti = 0,\n\t\t\tnodeType = elem.nodeType;\n\n\t\tif ( !nodeType ) {\n\n\t\t\t// If no nodeType, this is expected to be an array\n\t\t\twhile ( ( node = elem[ i++ ] ) ) {\n\n\t\t\t\t// Do not traverse comment nodes\n\t\t\t\tret += jQuery.text( node );\n\t\t\t}\n\t\t}\n\t\tif ( nodeType === 1 || nodeType === 11 ) {\n\t\t\treturn elem.textContent;\n\t\t}\n\t\tif ( nodeType === 9 ) {\n\t\t\treturn elem.documentElement.textContent;\n\t\t}\n\t\tif ( nodeType === 3 || nodeType === 4 ) {\n\t\t\treturn elem.nodeValue;\n\t\t}\n\n\t\t// Do not include comment or processing instruction nodes\n\n\t\treturn ret;\n\t},\n\n\t// results is for internal usage only\n\tmakeArray: function( arr, results ) {\n\t\tvar ret = results || [];\n\n\t\tif ( arr != null ) {\n\t\t\tif ( isArrayLike( Object( arr ) ) ) {\n\t\t\t\tjQuery.merge( ret,\n\t\t\t\t\ttypeof arr === \"string\" ?\n\t\t\t\t\t\t[ arr ] : arr\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tpush.call( ret, arr );\n\t\t\t}\n\t\t}\n\n\t\treturn ret;\n\t},\n\n\tinArray: function( elem, arr, i ) {\n\t\treturn arr == null ? -1 : indexOf.call( arr, elem, i );\n\t},\n\n\tisXMLDoc: function( elem ) {\n\t\tvar namespace = elem && elem.namespaceURI,\n\t\t\tdocElem = elem && ( elem.ownerDocument || elem ).documentElement;\n\n\t\t// Assume HTML when documentElement doesn't yet exist, such as inside\n\t\t// document fragments.\n\t\treturn !rhtmlSuffix.test( namespace || docElem && docElem.nodeName || \"HTML\" );\n\t},\n\n\t// Support: Android <=4.0 only, PhantomJS 1 only\n\t// push.apply(_, arraylike) throws on ancient WebKit\n\tmerge: function( first, second ) {\n\t\tvar len = +second.length,\n\t\t\tj = 0,\n\t\t\ti = first.length;\n\n\t\tfor ( ; j < len; j++ ) {\n\t\t\tfirst[ i++ ] = second[ j ];\n\t\t}\n\n\t\tfirst.length = i;\n\n\t\treturn first;\n\t},\n\n\tgrep: function( elems, callback, invert ) {\n\t\tvar callbackInverse,\n\t\t\tmatches = [],\n\t\t\ti = 0,\n\t\t\tlength = elems.length,\n\t\t\tcallbackExpect = !invert;\n\n\t\t// Go through the array, only saving the items\n\t\t// that pass the validator function\n\t\tfor ( ; i < length; i++ ) {\n\t\t\tcallbackInverse = !callback( elems[ i ], i );\n\t\t\tif ( callbackInverse !== callbackExpect ) {\n\t\t\t\tmatches.push( elems[ i ] );\n\t\t\t}\n\t\t}\n\n\t\treturn matches;\n\t},\n\n\t// arg is for internal usage only\n\tmap: function( elems, callback, arg ) {\n\t\tvar length, value,\n\t\t\ti = 0,\n\t\t\tret = [];\n\n\t\t// Go through the array, translating each of the items to their new values\n\t\tif ( isArrayLike( elems ) ) {\n\t\t\tlength = elems.length;\n\t\t\tfor ( ; i < length; i++ ) {\n\t\t\t\tvalue = callback( elems[ i ], i, arg );\n\n\t\t\t\tif ( value != null ) {\n\t\t\t\t\tret.push( value );\n\t\t\t\t}\n\t\t\t}\n\n\t\t// Go through every key on the object,\n\t\t} else {\n\t\t\tfor ( i in elems ) {\n\t\t\t\tvalue = callback( elems[ i ], i, arg );\n\n\t\t\t\tif ( value != null ) {\n\t\t\t\t\tret.push( value );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Flatten any nested arrays\n\t\treturn flat( ret );\n\t},\n\n\t// A global GUID counter for objects\n\tguid: 1,\n\n\t// jQuery.support is not used in Core but other projects attach their\n\t// properties to it so it needs to exist.\n\tsupport: support\n} );\n\nif ( typeof Symbol === \"function\" ) {\n\tjQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ];\n}\n\n// Populate the class2type map\njQuery.each( \"Boolean Number String Function Array Date RegExp Object Error Symbol\".split( \" \" ),\n\tfunction( _i, name ) {\n\t\tclass2type[ \"[object \" + name + \"]\" ] = name.toLowerCase();\n\t} );\n\nfunction isArrayLike( obj ) {\n\n\t// Support: real iOS 8.2 only (not reproducible in simulator)\n\t// `in` check used to prevent JIT error (gh-2145)\n\t// hasOwn isn't used here due to false negatives\n\t// regarding Nodelist length in IE\n\tvar length = !!obj && \"length\" in obj && obj.length,\n\t\ttype = toType( obj );\n\n\tif ( isFunction( obj ) || isWindow( obj ) ) {\n\t\treturn false;\n\t}\n\n\treturn type === \"array\" || length === 0 ||\n\t\ttypeof length === \"number\" && length > 0 && ( length - 1 ) in obj;\n}\n\n\nfunction nodeName( elem, name ) {\n\n\treturn elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();\n\n}\nvar pop = arr.pop;\n\n\nvar sort = arr.sort;\n\n\nvar splice = arr.splice;\n\n\nvar whitespace = \"[\\\\x20\\\\t\\\\r\\\\n\\\\f]\";\n\n\nvar rtrimCSS = new RegExp(\n\t\"^\" + whitespace + \"+|((?:^|[^\\\\\\\\])(?:\\\\\\\\.)*)\" + whitespace + \"+$\",\n\t\"g\"\n);\n\n\n\n\n// Note: an element does not contain itself\njQuery.contains = function( a, b ) {\n\tvar bup = b && b.parentNode;\n\n\treturn a === bup || !!( bup && bup.nodeType === 1 && (\n\n\t\t// Support: IE 9 - 11+\n\t\t// IE doesn't have `contains` on SVG.\n\t\ta.contains ?\n\t\t\ta.contains( bup ) :\n\t\t\ta.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16\n\t) );\n};\n\n\n\n\n// CSS string/identifier serialization\n// https://drafts.csswg.org/cssom/#common-serializing-idioms\nvar rcssescape = /([\\0-\\x1f\\x7f]|^-?\\d)|^-$|[^\\x80-\\uFFFF\\w-]/g;\n\nfunction fcssescape( ch, asCodePoint ) {\n\tif ( asCodePoint ) {\n\n\t\t// U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER\n\t\tif ( ch === \"\\0\" ) {\n\t\t\treturn \"\\uFFFD\";\n\t\t}\n\n\t\t// Control characters and (dependent upon position) numbers get escaped as code points\n\t\treturn ch.slice( 0, -1 ) + \"\\\\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + \" \";\n\t}\n\n\t// Other potentially-special ASCII characters get backslash-escaped\n\treturn \"\\\\\" + ch;\n}\n\njQuery.escapeSelector = function( sel ) {\n\treturn ( sel + \"\" ).replace( rcssescape, fcssescape );\n};\n\n\n\n\nvar preferredDoc = document,\n\tpushNative = push;\n\n( function() {\n\nvar i,\n\tExpr,\n\toutermostContext,\n\tsortInput,\n\thasDuplicate,\n\tpush = pushNative,\n\n\t// Local document vars\n\tdocument,\n\tdocumentElement,\n\tdocumentIsHTML,\n\trbuggyQSA,\n\tmatches,\n\n\t// Instance-specific data\n\texpando = jQuery.expando,\n\tdirruns = 0,\n\tdone = 0,\n\tclassCache = createCache(),\n\ttokenCache = createCache(),\n\tcompilerCache = createCache(),\n\tnonnativeSelectorCache = createCache(),\n\tsortOrder = function( a, b ) {\n\t\tif ( a === b ) {\n\t\t\thasDuplicate = true;\n\t\t}\n\t\treturn 0;\n\t},\n\n\tbooleans = \"checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|\" +\n\t\t\"loop|multiple|open|readonly|required|scoped\",\n\n\t// Regular expressions\n\n\t// https://www.w3.org/TR/css-syntax-3/#ident-token-diagram\n\tidentifier = \"(?:\\\\\\\\[\\\\da-fA-F]{1,6}\" + whitespace +\n\t\t\"?|\\\\\\\\[^\\\\r\\\\n\\\\f]|[\\\\w-]|[^\\0-\\\\x7f])+\",\n\n\t// Attribute selectors: https://www.w3.org/TR/selectors/#attribute-selectors\n\tattributes = \"\\\\[\" + whitespace + \"*(\" + identifier + \")(?:\" + whitespace +\n\n\t\t// Operator (capture 2)\n\t\t\"*([*^$|!~]?=)\" + whitespace +\n\n\t\t// \"Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]\"\n\t\t\"*(?:'((?:\\\\\\\\.|[^\\\\\\\\'])*)'|\\\"((?:\\\\\\\\.|[^\\\\\\\\\\\"])*)\\\"|(\" + identifier + \"))|)\" +\n\t\twhitespace + \"*\\\\]\",\n\n\tpseudos = \":(\" + identifier + \")(?:\\\\((\" +\n\n\t\t// To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:\n\t\t// 1. quoted (capture 3; capture 4 or capture 5)\n\t\t\"('((?:\\\\\\\\.|[^\\\\\\\\'])*)'|\\\"((?:\\\\\\\\.|[^\\\\\\\\\\\"])*)\\\")|\" +\n\n\t\t// 2. simple (capture 6)\n\t\t\"((?:\\\\\\\\.|[^\\\\\\\\()[\\\\]]|\" + attributes + \")*)|\" +\n\n\t\t// 3. anything else (capture 2)\n\t\t\".*\" +\n\t\t\")\\\\)|)\",\n\n\t// Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter\n\trwhitespace = new RegExp( whitespace + \"+\", \"g\" ),\n\n\trcomma = new RegExp( \"^\" + whitespace + \"*,\" + whitespace + \"*\" ),\n\trleadingCombinator = new RegExp( \"^\" + whitespace + \"*([>+~]|\" + whitespace + \")\" +\n\t\twhitespace + \"*\" ),\n\trdescend = new RegExp( whitespace + \"|>\" ),\n\n\trpseudo = new RegExp( pseudos ),\n\tridentifier = new RegExp( \"^\" + identifier + \"$\" ),\n\n\tmatchExpr = {\n\t\tID: new RegExp( \"^#(\" + identifier + \")\" ),\n\t\tCLASS: new RegExp( \"^\\\\.(\" + identifier + \")\" ),\n\t\tTAG: new RegExp( \"^(\" + identifier + \"|[*])\" ),\n\t\tATTR: new RegExp( \"^\" + attributes ),\n\t\tPSEUDO: new RegExp( \"^\" + pseudos ),\n\t\tCHILD: new RegExp(\n\t\t\t\"^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\\\(\" +\n\t\t\t\twhitespace + \"*(even|odd|(([+-]|)(\\\\d*)n|)\" + whitespace + \"*(?:([+-]|)\" +\n\t\t\t\twhitespace + \"*(\\\\d+)|))\" + whitespace + \"*\\\\)|)\", \"i\" ),\n\t\tbool: new RegExp( \"^(?:\" + booleans + \")$\", \"i\" ),\n\n\t\t// For use in libraries implementing .is()\n\t\t// We use this for POS matching in `select`\n\t\tneedsContext: new RegExp( \"^\" + whitespace +\n\t\t\t\"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\\\(\" + whitespace +\n\t\t\t\"*((?:-\\\\d)?\\\\d*)\" + whitespace + \"*\\\\)|)(?=[^-]|$)\", \"i\" )\n\t},\n\n\trinputs = /^(?:input|select|textarea|button)$/i,\n\trheader = /^h\\d$/i,\n\n\t// Easily-parseable/retrievable ID or TAG or CLASS selectors\n\trquickExpr = /^(?:#([\\w-]+)|(\\w+)|\\.([\\w-]+))$/,\n\n\trsibling = /[+~]/,\n\n\t// CSS escapes\n\t// https://www.w3.org/TR/CSS21/syndata.html#escaped-characters\n\trunescape = new RegExp( \"\\\\\\\\[\\\\da-fA-F]{1,6}\" + whitespace +\n\t\t\"?|\\\\\\\\([^\\\\r\\\\n\\\\f])\", \"g\" ),\n\tfunescape = function( escape, nonHex ) {\n\t\tvar high = \"0x\" + escape.slice( 1 ) - 0x10000;\n\n\t\tif ( nonHex ) {\n\n\t\t\t// Strip the backslash prefix from a non-hex escape sequence\n\t\t\treturn nonHex;\n\t\t}\n\n\t\t// Replace a hexadecimal escape sequence with the encoded Unicode code point\n\t\t// Support: IE <=11+\n\t\t// For values outside the Basic Multilingual Plane (BMP), manually construct a\n\t\t// surrogate pair\n\t\treturn high < 0 ?\n\t\t\tString.fromCharCode( high + 0x10000 ) :\n\t\t\tString.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );\n\t},\n\n\t// Used for iframes; see `setDocument`.\n\t// Support: IE 9 - 11+, Edge 12 - 18+\n\t// Removing the function wrapper causes a \"Permission Denied\"\n\t// error in IE/Edge.\n\tunloadHandler = function() {\n\t\tsetDocument();\n\t},\n\n\tinDisabledFieldset = addCombinator(\n\t\tfunction( elem ) {\n\t\t\treturn elem.disabled === true && nodeName( elem, \"fieldset\" );\n\t\t},\n\t\t{ dir: \"parentNode\", next: \"legend\" }\n\t);\n\n// Support: IE <=9 only\n// Accessing document.activeElement can throw unexpectedly\n// https://bugs.jquery.com/ticket/13393\nfunction safeActiveElement() {\n\ttry {\n\t\treturn document.activeElement;\n\t} catch ( err ) { }\n}\n\n// Optimize for push.apply( _, NodeList )\ntry {\n\tpush.apply(\n\t\t( arr = slice.call( preferredDoc.childNodes ) ),\n\t\tpreferredDoc.childNodes\n\t);\n\n\t// Support: Android <=4.0\n\t// Detect silently failing push.apply\n\t// eslint-disable-next-line no-unused-expressions\n\tarr[ preferredDoc.childNodes.length ].nodeType;\n} catch ( e ) {\n\tpush = {\n\t\tapply: function( target, els ) {\n\t\t\tpushNative.apply( target, slice.call( els ) );\n\t\t},\n\t\tcall: function( target ) {\n\t\t\tpushNative.apply( target, slice.call( arguments, 1 ) );\n\t\t}\n\t};\n}\n\nfunction find( selector, context, results, seed ) {\n\tvar m, i, elem, nid, match, groups, newSelector,\n\t\tnewContext = context && context.ownerDocument,\n\n\t\t// nodeType defaults to 9, since context defaults to document\n\t\tnodeType = context ? context.nodeType : 9;\n\n\tresults = results || [];\n\n\t// Return early from calls with invalid selector or context\n\tif ( typeof selector !== \"string\" || !selector ||\n\t\tnodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {\n\n\t\treturn results;\n\t}\n\n\t// Try to shortcut find operations (as opposed to filters) in HTML documents\n\tif ( !seed ) {\n\t\tsetDocument( context );\n\t\tcontext = context || document;\n\n\t\tif ( documentIsHTML ) {\n\n\t\t\t// If the selector is sufficiently simple, try using a \"get*By*\" DOM method\n\t\t\t// (excepting DocumentFragment context, where the methods don't exist)\n\t\t\tif ( nodeType !== 11 && ( match = rquickExpr.exec( selector ) ) ) {\n\n\t\t\t\t// ID selector\n\t\t\t\tif ( ( m = match[ 1 ] ) ) {\n\n\t\t\t\t\t// Document context\n\t\t\t\t\tif ( nodeType === 9 ) {\n\t\t\t\t\t\tif ( ( elem = context.getElementById( m ) ) ) {\n\n\t\t\t\t\t\t\t// Support: IE 9 only\n\t\t\t\t\t\t\t// getElementById can match elements by name instead of ID\n\t\t\t\t\t\t\tif ( elem.id === m ) {\n\t\t\t\t\t\t\t\tpush.call( results, elem );\n\t\t\t\t\t\t\t\treturn results;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn results;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t// Element context\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t// Support: IE 9 only\n\t\t\t\t\t\t// getElementById can match elements by name instead of ID\n\t\t\t\t\t\tif ( newContext && ( elem = newContext.getElementById( m ) ) &&\n\t\t\t\t\t\t\tfind.contains( context, elem ) &&\n\t\t\t\t\t\t\telem.id === m ) {\n\n\t\t\t\t\t\t\tpush.call( results, elem );\n\t\t\t\t\t\t\treturn results;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t// Type selector\n\t\t\t\t} else if ( match[ 2 ] ) {\n\t\t\t\t\tpush.apply( results, context.getElementsByTagName( selector ) );\n\t\t\t\t\treturn results;\n\n\t\t\t\t// Class selector\n\t\t\t\t} else if ( ( m = match[ 3 ] ) && context.getElementsByClassName ) {\n\t\t\t\t\tpush.apply( results, context.getElementsByClassName( m ) );\n\t\t\t\t\treturn results;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Take advantage of querySelectorAll\n\t\t\tif ( !nonnativeSelectorCache[ selector + \" \" ] &&\n\t\t\t\t( !rbuggyQSA || !rbuggyQSA.test( selector ) ) ) {\n\n\t\t\t\tnewSelector = selector;\n\t\t\t\tnewContext = context;\n\n\t\t\t\t// qSA considers elements outside a scoping root when evaluating child or\n\t\t\t\t// descendant combinators, which is not what we want.\n\t\t\t\t// In such cases, we work around the behavior by prefixing every selector in the\n\t\t\t\t// list with an ID selector referencing the scope context.\n\t\t\t\t// The technique has to be used as well when a leading combinator is used\n\t\t\t\t// as such selectors are not recognized by querySelectorAll.\n\t\t\t\t// Thanks to Andrew Dupont for this technique.\n\t\t\t\tif ( nodeType === 1 &&\n\t\t\t\t\t( rdescend.test( selector ) || rleadingCombinator.test( selector ) ) ) {\n\n\t\t\t\t\t// Expand context for sibling selectors\n\t\t\t\t\tnewContext = rsibling.test( selector ) && testContext( context.parentNode ) ||\n\t\t\t\t\t\tcontext;\n\n\t\t\t\t\t// We can use :scope instead of the ID hack if the browser\n\t\t\t\t\t// supports it & if we're not changing the context.\n\t\t\t\t\t// Support: IE 11+, Edge 17 - 18+\n\t\t\t\t\t// IE/Edge sometimes throw a \"Permission denied\" error when\n\t\t\t\t\t// strict-comparing two documents; shallow comparisons work.\n\t\t\t\t\t// eslint-disable-next-line eqeqeq\n\t\t\t\t\tif ( newContext != context || !support.scope ) {\n\n\t\t\t\t\t\t// Capture the context ID, setting it first if necessary\n\t\t\t\t\t\tif ( ( nid = context.getAttribute( \"id\" ) ) ) {\n\t\t\t\t\t\t\tnid = jQuery.escapeSelector( nid );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tcontext.setAttribute( \"id\", ( nid = expando ) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Prefix every selector in the list\n\t\t\t\t\tgroups = tokenize( selector );\n\t\t\t\t\ti = groups.length;\n\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\tgroups[ i ] = ( nid ? \"#\" + nid : \":scope\" ) + \" \" +\n\t\t\t\t\t\t\ttoSelector( groups[ i ] );\n\t\t\t\t\t}\n\t\t\t\t\tnewSelector = groups.join( \",\" );\n\t\t\t\t}\n\n\t\t\t\ttry {\n\t\t\t\t\tpush.apply( results,\n\t\t\t\t\t\tnewContext.querySelectorAll( newSelector )\n\t\t\t\t\t);\n\t\t\t\t\treturn results;\n\t\t\t\t} catch ( qsaError ) {\n\t\t\t\t\tnonnativeSelectorCache( selector, true );\n\t\t\t\t} finally {\n\t\t\t\t\tif ( nid === expando ) {\n\t\t\t\t\t\tcontext.removeAttribute( \"id\" );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// All others\n\treturn select( selector.replace( rtrimCSS, \"$1\" ), context, results, seed );\n}\n\n/**\n * Create key-value caches of limited size\n * @returns {function(string, object)} Returns the Object data after storing it on itself with\n *\tproperty name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)\n *\tdeleting the oldest entry\n */\nfunction createCache() {\n\tvar keys = [];\n\n\tfunction cache( key, value ) {\n\n\t\t// Use (key + \" \") to avoid collision with native prototype properties\n\t\t// (see https://github.com/jquery/sizzle/issues/157)\n\t\tif ( keys.push( key + \" \" ) > Expr.cacheLength ) {\n\n\t\t\t// Only keep the most recent entries\n\t\t\tdelete cache[ keys.shift() ];\n\t\t}\n\t\treturn ( cache[ key + \" \" ] = value );\n\t}\n\treturn cache;\n}\n\n/**\n * Mark a function for special use by jQuery selector module\n * @param {Function} fn The function to mark\n */\nfunction markFunction( fn ) {\n\tfn[ expando ] = true;\n\treturn fn;\n}\n\n/**\n * Support testing using an element\n * @param {Function} fn Passed the created element and returns a boolean result\n */\nfunction assert( fn ) {\n\tvar el = document.createElement( \"fieldset\" );\n\n\ttry {\n\t\treturn !!fn( el );\n\t} catch ( e ) {\n\t\treturn false;\n\t} finally {\n\n\t\t// Remove from its parent by default\n\t\tif ( el.parentNode ) {\n\t\t\tel.parentNode.removeChild( el );\n\t\t}\n\n\t\t// release memory in IE\n\t\tel = null;\n\t}\n}\n\n/**\n * Returns a function to use in pseudos for input types\n * @param {String} type\n */\nfunction createInputPseudo( type ) {\n\treturn function( elem ) {\n\t\treturn nodeName( elem, \"input\" ) && elem.type === type;\n\t};\n}\n\n/**\n * Returns a function to use in pseudos for buttons\n * @param {String} type\n */\nfunction createButtonPseudo( type ) {\n\treturn function( elem ) {\n\t\treturn ( nodeName( elem, \"input\" ) || nodeName( elem, \"button\" ) ) &&\n\t\t\telem.type === type;\n\t};\n}\n\n/**\n * Returns a function to use in pseudos for :enabled/:disabled\n * @param {Boolean} disabled true for :disabled; false for :enabled\n */\nfunction createDisabledPseudo( disabled ) {\n\n\t// Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable\n\treturn function( elem ) {\n\n\t\t// Only certain elements can match :enabled or :disabled\n\t\t// https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled\n\t\t// https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled\n\t\tif ( \"form\" in elem ) {\n\n\t\t\t// Check for inherited disabledness on relevant non-disabled elements:\n\t\t\t// * listed form-associated elements in a disabled fieldset\n\t\t\t//   https://html.spec.whatwg.org/multipage/forms.html#category-listed\n\t\t\t//   https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled\n\t\t\t// * option elements in a disabled optgroup\n\t\t\t//   https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled\n\t\t\t// All such elements have a \"form\" property.\n\t\t\tif ( elem.parentNode && elem.disabled === false ) {\n\n\t\t\t\t// Option elements defer to a parent optgroup if present\n\t\t\t\tif ( \"label\" in elem ) {\n\t\t\t\t\tif ( \"label\" in elem.parentNode ) {\n\t\t\t\t\t\treturn elem.parentNode.disabled === disabled;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn elem.disabled === disabled;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Support: IE 6 - 11+\n\t\t\t\t// Use the isDisabled shortcut property to check for disabled fieldset ancestors\n\t\t\t\treturn elem.isDisabled === disabled ||\n\n\t\t\t\t\t// Where there is no isDisabled, check manually\n\t\t\t\t\telem.isDisabled !== !disabled &&\n\t\t\t\t\t\tinDisabledFieldset( elem ) === disabled;\n\t\t\t}\n\n\t\t\treturn elem.disabled === disabled;\n\n\t\t// Try to winnow out elements that can't be disabled before trusting the disabled property.\n\t\t// Some victims get caught in our net (label, legend, menu, track), but it shouldn't\n\t\t// even exist on them, let alone have a boolean value.\n\t\t} else if ( \"label\" in elem ) {\n\t\t\treturn elem.disabled === disabled;\n\t\t}\n\n\t\t// Remaining elements are neither :enabled nor :disabled\n\t\treturn false;\n\t};\n}\n\n/**\n * Returns a function to use in pseudos for positionals\n * @param {Function} fn\n */\nfunction createPositionalPseudo( fn ) {\n\treturn markFunction( function( argument ) {\n\t\targument = +argument;\n\t\treturn markFunction( function( seed, matches ) {\n\t\t\tvar j,\n\t\t\t\tmatchIndexes = fn( [], seed.length, argument ),\n\t\t\t\ti = matchIndexes.length;\n\n\t\t\t// Match elements found at the specified indexes\n\t\t\twhile ( i-- ) {\n\t\t\t\tif ( seed[ ( j = matchIndexes[ i ] ) ] ) {\n\t\t\t\t\tseed[ j ] = !( matches[ j ] = seed[ j ] );\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t} );\n}\n\n/**\n * Checks a node for validity as a jQuery selector context\n * @param {Element|Object=} context\n * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value\n */\nfunction testContext( context ) {\n\treturn context && typeof context.getElementsByTagName !== \"undefined\" && context;\n}\n\n/**\n * Sets document-related variables once based on the current document\n * @param {Element|Object} [node] An element or document object to use to set the document\n * @returns {Object} Returns the current document\n */\nfunction setDocument( node ) {\n\tvar subWindow,\n\t\tdoc = node ? node.ownerDocument || node : preferredDoc;\n\n\t// Return early if doc is invalid or already selected\n\t// Support: IE 11+, Edge 17 - 18+\n\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t// two documents; shallow comparisons work.\n\t// eslint-disable-next-line eqeqeq\n\tif ( doc == document || doc.nodeType !== 9 || !doc.documentElement ) {\n\t\treturn document;\n\t}\n\n\t// Update global variables\n\tdocument = doc;\n\tdocumentElement = document.documentElement;\n\tdocumentIsHTML = !jQuery.isXMLDoc( document );\n\n\t// Support: iOS 7 only, IE 9 - 11+\n\t// Older browsers didn't support unprefixed `matches`.\n\tmatches = documentElement.matches ||\n\t\tdocumentElement.webkitMatchesSelector ||\n\t\tdocumentElement.msMatchesSelector;\n\n\t// Support: IE 9 - 11+, Edge 12 - 18+\n\t// Accessing iframe documents after unload throws \"permission denied\" errors\n\t// (see trac-13936).\n\t// Limit the fix to IE & Edge Legacy; despite Edge 15+ implementing `matches`,\n\t// all IE 9+ and Edge Legacy versions implement `msMatchesSelector` as well.\n\tif ( documentElement.msMatchesSelector &&\n\n\t\t// Support: IE 11+, Edge 17 - 18+\n\t\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t\t// two documents; shallow comparisons work.\n\t\t// eslint-disable-next-line eqeqeq\n\t\tpreferredDoc != document &&\n\t\t( subWindow = document.defaultView ) && subWindow.top !== subWindow ) {\n\n\t\t// Support: IE 9 - 11+, Edge 12 - 18+\n\t\tsubWindow.addEventListener( \"unload\", unloadHandler );\n\t}\n\n\t// Support: IE <10\n\t// Check if getElementById returns elements by name\n\t// The broken getElementById methods don't pick up programmatically-set names,\n\t// so use a roundabout getElementsByName test\n\tsupport.getById = assert( function( el ) {\n\t\tdocumentElement.appendChild( el ).id = jQuery.expando;\n\t\treturn !document.getElementsByName ||\n\t\t\t!document.getElementsByName( jQuery.expando ).length;\n\t} );\n\n\t// Support: IE 9 only\n\t// Check to see if it's possible to do matchesSelector\n\t// on a disconnected node.\n\tsupport.disconnectedMatch = assert( function( el ) {\n\t\treturn matches.call( el, \"*\" );\n\t} );\n\n\t// Support: IE 9 - 11+, Edge 12 - 18+\n\t// IE/Edge don't support the :scope pseudo-class.\n\tsupport.scope = assert( function() {\n\t\treturn document.querySelectorAll( \":scope\" );\n\t} );\n\n\t// Support: Chrome 105 - 111 only, Safari 15.4 - 16.3 only\n\t// Make sure the `:has()` argument is parsed unforgivingly.\n\t// We include `*` in the test to detect buggy implementations that are\n\t// _selectively_ forgiving (specifically when the list includes at least\n\t// one valid selector).\n\t// Note that we treat complete lack of support for `:has()` as if it were\n\t// spec-compliant support, which is fine because use of `:has()` in such\n\t// environments will fail in the qSA path and fall back to jQuery traversal\n\t// anyway.\n\tsupport.cssHas = assert( function() {\n\t\ttry {\n\t\t\tdocument.querySelector( \":has(*,:jqfake)\" );\n\t\t\treturn false;\n\t\t} catch ( e ) {\n\t\t\treturn true;\n\t\t}\n\t} );\n\n\t// ID filter and find\n\tif ( support.getById ) {\n\t\tExpr.filter.ID = function( id ) {\n\t\t\tvar attrId = id.replace( runescape, funescape );\n\t\t\treturn function( elem ) {\n\t\t\t\treturn elem.getAttribute( \"id\" ) === attrId;\n\t\t\t};\n\t\t};\n\t\tExpr.find.ID = function( id, context ) {\n\t\t\tif ( typeof context.getElementById !== \"undefined\" && documentIsHTML ) {\n\t\t\t\tvar elem = context.getElementById( id );\n\t\t\t\treturn elem ? [ elem ] : [];\n\t\t\t}\n\t\t};\n\t} else {\n\t\tExpr.filter.ID =  function( id ) {\n\t\t\tvar attrId = id.replace( runescape, funescape );\n\t\t\treturn function( elem ) {\n\t\t\t\tvar node = typeof elem.getAttributeNode !== \"undefined\" &&\n\t\t\t\t\telem.getAttributeNode( \"id\" );\n\t\t\t\treturn node && node.value === attrId;\n\t\t\t};\n\t\t};\n\n\t\t// Support: IE 6 - 7 only\n\t\t// getElementById is not reliable as a find shortcut\n\t\tExpr.find.ID = function( id, context ) {\n\t\t\tif ( typeof context.getElementById !== \"undefined\" && documentIsHTML ) {\n\t\t\t\tvar node, i, elems,\n\t\t\t\t\telem = context.getElementById( id );\n\n\t\t\t\tif ( elem ) {\n\n\t\t\t\t\t// Verify the id attribute\n\t\t\t\t\tnode = elem.getAttributeNode( \"id\" );\n\t\t\t\t\tif ( node && node.value === id ) {\n\t\t\t\t\t\treturn [ elem ];\n\t\t\t\t\t}\n\n\t\t\t\t\t// Fall back on getElementsByName\n\t\t\t\t\telems = context.getElementsByName( id );\n\t\t\t\t\ti = 0;\n\t\t\t\t\twhile ( ( elem = elems[ i++ ] ) ) {\n\t\t\t\t\t\tnode = elem.getAttributeNode( \"id\" );\n\t\t\t\t\t\tif ( node && node.value === id ) {\n\t\t\t\t\t\t\treturn [ elem ];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn [];\n\t\t\t}\n\t\t};\n\t}\n\n\t// Tag\n\tExpr.find.TAG = function( tag, context ) {\n\t\tif ( typeof context.getElementsByTagName !== \"undefined\" ) {\n\t\t\treturn context.getElementsByTagName( tag );\n\n\t\t// DocumentFragment nodes don't have gEBTN\n\t\t} else {\n\t\t\treturn context.querySelectorAll( tag );\n\t\t}\n\t};\n\n\t// Class\n\tExpr.find.CLASS = function( className, context ) {\n\t\tif ( typeof context.getElementsByClassName !== \"undefined\" && documentIsHTML ) {\n\t\t\treturn context.getElementsByClassName( className );\n\t\t}\n\t};\n\n\t/* QSA/matchesSelector\n\t---------------------------------------------------------------------- */\n\n\t// QSA and matchesSelector support\n\n\trbuggyQSA = [];\n\n\t// Build QSA regex\n\t// Regex strategy adopted from Diego Perini\n\tassert( function( el ) {\n\n\t\tvar input;\n\n\t\tdocumentElement.appendChild( el ).innerHTML =\n\t\t\t\"<a id='\" + expando + \"' href='' disabled='disabled'></a>\" +\n\t\t\t\"<select id='\" + expando + \"-\\r\\\\' disabled='disabled'>\" +\n\t\t\t\"<option selected=''></option></select>\";\n\n\t\t// Support: iOS <=7 - 8 only\n\t\t// Boolean attributes and \"value\" are not treated correctly in some XML documents\n\t\tif ( !el.querySelectorAll( \"[selected]\" ).length ) {\n\t\t\trbuggyQSA.push( \"\\\\[\" + whitespace + \"*(?:value|\" + booleans + \")\" );\n\t\t}\n\n\t\t// Support: iOS <=7 - 8 only\n\t\tif ( !el.querySelectorAll( \"[id~=\" + expando + \"-]\" ).length ) {\n\t\t\trbuggyQSA.push( \"~=\" );\n\t\t}\n\n\t\t// Support: iOS 8 only\n\t\t// https://bugs.webkit.org/show_bug.cgi?id=136851\n\t\t// In-page `selector#id sibling-combinator selector` fails\n\t\tif ( !el.querySelectorAll( \"a#\" + expando + \"+*\" ).length ) {\n\t\t\trbuggyQSA.push( \".#.+[+~]\" );\n\t\t}\n\n\t\t// Support: Chrome <=105+, Firefox <=104+, Safari <=15.4+\n\t\t// In some of the document kinds, these selectors wouldn't work natively.\n\t\t// This is probably OK but for backwards compatibility we want to maintain\n\t\t// handling them through jQuery traversal in jQuery 3.x.\n\t\tif ( !el.querySelectorAll( \":checked\" ).length ) {\n\t\t\trbuggyQSA.push( \":checked\" );\n\t\t}\n\n\t\t// Support: Windows 8 Native Apps\n\t\t// The type and name attributes are restricted during .innerHTML assignment\n\t\tinput = document.createElement( \"input\" );\n\t\tinput.setAttribute( \"type\", \"hidden\" );\n\t\tel.appendChild( input ).setAttribute( \"name\", \"D\" );\n\n\t\t// Support: IE 9 - 11+\n\t\t// IE's :disabled selector does not pick up the children of disabled fieldsets\n\t\t// Support: Chrome <=105+, Firefox <=104+, Safari <=15.4+\n\t\t// In some of the document kinds, these selectors wouldn't work natively.\n\t\t// This is probably OK but for backwards compatibility we want to maintain\n\t\t// handling them through jQuery traversal in jQuery 3.x.\n\t\tdocumentElement.appendChild( el ).disabled = true;\n\t\tif ( el.querySelectorAll( \":disabled\" ).length !== 2 ) {\n\t\t\trbuggyQSA.push( \":enabled\", \":disabled\" );\n\t\t}\n\n\t\t// Support: IE 11+, Edge 15 - 18+\n\t\t// IE 11/Edge don't find elements on a `[name='']` query in some cases.\n\t\t// Adding a temporary attribute to the document before the selection works\n\t\t// around the issue.\n\t\t// Interestingly, IE 10 & older don't seem to have the issue.\n\t\tinput = document.createElement( \"input\" );\n\t\tinput.setAttribute( \"name\", \"\" );\n\t\tel.appendChild( input );\n\t\tif ( !el.querySelectorAll( \"[name='']\" ).length ) {\n\t\t\trbuggyQSA.push( \"\\\\[\" + whitespace + \"*name\" + whitespace + \"*=\" +\n\t\t\t\twhitespace + \"*(?:''|\\\"\\\")\" );\n\t\t}\n\t} );\n\n\tif ( !support.cssHas ) {\n\n\t\t// Support: Chrome 105 - 110+, Safari 15.4 - 16.3+\n\t\t// Our regular `try-catch` mechanism fails to detect natively-unsupported\n\t\t// pseudo-classes inside `:has()` (such as `:has(:contains(\"Foo\"))`)\n\t\t// in browsers that parse the `:has()` argument as a forgiving selector list.\n\t\t// https://drafts.csswg.org/selectors/#relational now requires the argument\n\t\t// to be parsed unforgivingly, but browsers have not yet fully adjusted.\n\t\trbuggyQSA.push( \":has\" );\n\t}\n\n\trbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join( \"|\" ) );\n\n\t/* Sorting\n\t---------------------------------------------------------------------- */\n\n\t// Document order sorting\n\tsortOrder = function( a, b ) {\n\n\t\t// Flag for duplicate removal\n\t\tif ( a === b ) {\n\t\t\thasDuplicate = true;\n\t\t\treturn 0;\n\t\t}\n\n\t\t// Sort on method existence if only one input has compareDocumentPosition\n\t\tvar compare = !a.compareDocumentPosition - !b.compareDocumentPosition;\n\t\tif ( compare ) {\n\t\t\treturn compare;\n\t\t}\n\n\t\t// Calculate position if both inputs belong to the same document\n\t\t// Support: IE 11+, Edge 17 - 18+\n\t\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t\t// two documents; shallow comparisons work.\n\t\t// eslint-disable-next-line eqeqeq\n\t\tcompare = ( a.ownerDocument || a ) == ( b.ownerDocument || b ) ?\n\t\t\ta.compareDocumentPosition( b ) :\n\n\t\t\t// Otherwise we know they are disconnected\n\t\t\t1;\n\n\t\t// Disconnected nodes\n\t\tif ( compare & 1 ||\n\t\t\t( !support.sortDetached && b.compareDocumentPosition( a ) === compare ) ) {\n\n\t\t\t// Choose the first element that is related to our preferred document\n\t\t\t// Support: IE 11+, Edge 17 - 18+\n\t\t\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t\t\t// two documents; shallow comparisons work.\n\t\t\t// eslint-disable-next-line eqeqeq\n\t\t\tif ( a === document || a.ownerDocument == preferredDoc &&\n\t\t\t\tfind.contains( preferredDoc, a ) ) {\n\t\t\t\treturn -1;\n\t\t\t}\n\n\t\t\t// Support: IE 11+, Edge 17 - 18+\n\t\t\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t\t\t// two documents; shallow comparisons work.\n\t\t\t// eslint-disable-next-line eqeqeq\n\t\t\tif ( b === document || b.ownerDocument == preferredDoc &&\n\t\t\t\tfind.contains( preferredDoc, b ) ) {\n\t\t\t\treturn 1;\n\t\t\t}\n\n\t\t\t// Maintain original order\n\t\t\treturn sortInput ?\n\t\t\t\t( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) :\n\t\t\t\t0;\n\t\t}\n\n\t\treturn compare & 4 ? -1 : 1;\n\t};\n\n\treturn document;\n}\n\nfind.matches = function( expr, elements ) {\n\treturn find( expr, null, null, elements );\n};\n\nfind.matchesSelector = function( elem, expr ) {\n\tsetDocument( elem );\n\n\tif ( documentIsHTML &&\n\t\t!nonnativeSelectorCache[ expr + \" \" ] &&\n\t\t( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {\n\n\t\ttry {\n\t\t\tvar ret = matches.call( elem, expr );\n\n\t\t\t// IE 9's matchesSelector returns false on disconnected nodes\n\t\t\tif ( ret || support.disconnectedMatch ||\n\n\t\t\t\t\t// As well, disconnected nodes are said to be in a document\n\t\t\t\t\t// fragment in IE 9\n\t\t\t\t\telem.document && elem.document.nodeType !== 11 ) {\n\t\t\t\treturn ret;\n\t\t\t}\n\t\t} catch ( e ) {\n\t\t\tnonnativeSelectorCache( expr, true );\n\t\t}\n\t}\n\n\treturn find( expr, document, null, [ elem ] ).length > 0;\n};\n\nfind.contains = function( context, elem ) {\n\n\t// Set document vars if needed\n\t// Support: IE 11+, Edge 17 - 18+\n\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t// two documents; shallow comparisons work.\n\t// eslint-disable-next-line eqeqeq\n\tif ( ( context.ownerDocument || context ) != document ) {\n\t\tsetDocument( context );\n\t}\n\treturn jQuery.contains( context, elem );\n};\n\n\nfind.attr = function( elem, name ) {\n\n\t// Set document vars if needed\n\t// Support: IE 11+, Edge 17 - 18+\n\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t// two documents; shallow comparisons work.\n\t// eslint-disable-next-line eqeqeq\n\tif ( ( elem.ownerDocument || elem ) != document ) {\n\t\tsetDocument( elem );\n\t}\n\n\tvar fn = Expr.attrHandle[ name.toLowerCase() ],\n\n\t\t// Don't get fooled by Object.prototype properties (see trac-13807)\n\t\tval = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?\n\t\t\tfn( elem, name, !documentIsHTML ) :\n\t\t\tundefined;\n\n\tif ( val !== undefined ) {\n\t\treturn val;\n\t}\n\n\treturn elem.getAttribute( name );\n};\n\nfind.error = function( msg ) {\n\tthrow new Error( \"Syntax error, unrecognized expression: \" + msg );\n};\n\n/**\n * Document sorting and removing duplicates\n * @param {ArrayLike} results\n */\njQuery.uniqueSort = function( results ) {\n\tvar elem,\n\t\tduplicates = [],\n\t\tj = 0,\n\t\ti = 0;\n\n\t// Unless we *know* we can detect duplicates, assume their presence\n\t//\n\t// Support: Android <=4.0+\n\t// Testing for detecting duplicates is unpredictable so instead assume we can't\n\t// depend on duplicate detection in all browsers without a stable sort.\n\thasDuplicate = !support.sortStable;\n\tsortInput = !support.sortStable && slice.call( results, 0 );\n\tsort.call( results, sortOrder );\n\n\tif ( hasDuplicate ) {\n\t\twhile ( ( elem = results[ i++ ] ) ) {\n\t\t\tif ( elem === results[ i ] ) {\n\t\t\t\tj = duplicates.push( i );\n\t\t\t}\n\t\t}\n\t\twhile ( j-- ) {\n\t\t\tsplice.call( results, duplicates[ j ], 1 );\n\t\t}\n\t}\n\n\t// Clear input after sorting to release objects\n\t// See https://github.com/jquery/sizzle/pull/225\n\tsortInput = null;\n\n\treturn results;\n};\n\njQuery.fn.uniqueSort = function() {\n\treturn this.pushStack( jQuery.uniqueSort( slice.apply( this ) ) );\n};\n\nExpr = jQuery.expr = {\n\n\t// Can be adjusted by the user\n\tcacheLength: 50,\n\n\tcreatePseudo: markFunction,\n\n\tmatch: matchExpr,\n\n\tattrHandle: {},\n\n\tfind: {},\n\n\trelative: {\n\t\t\">\": { dir: \"parentNode\", first: true },\n\t\t\" \": { dir: \"parentNode\" },\n\t\t\"+\": { dir: \"previousSibling\", first: true },\n\t\t\"~\": { dir: \"previousSibling\" }\n\t},\n\n\tpreFilter: {\n\t\tATTR: function( match ) {\n\t\t\tmatch[ 1 ] = match[ 1 ].replace( runescape, funescape );\n\n\t\t\t// Move the given value to match[3] whether quoted or unquoted\n\t\t\tmatch[ 3 ] = ( match[ 3 ] || match[ 4 ] || match[ 5 ] || \"\" )\n\t\t\t\t.replace( runescape, funescape );\n\n\t\t\tif ( match[ 2 ] === \"~=\" ) {\n\t\t\t\tmatch[ 3 ] = \" \" + match[ 3 ] + \" \";\n\t\t\t}\n\n\t\t\treturn match.slice( 0, 4 );\n\t\t},\n\n\t\tCHILD: function( match ) {\n\n\t\t\t/* matches from matchExpr[\"CHILD\"]\n\t\t\t\t1 type (only|nth|...)\n\t\t\t\t2 what (child|of-type)\n\t\t\t\t3 argument (even|odd|\\d*|\\d*n([+-]\\d+)?|...)\n\t\t\t\t4 xn-component of xn+y argument ([+-]?\\d*n|)\n\t\t\t\t5 sign of xn-component\n\t\t\t\t6 x of xn-component\n\t\t\t\t7 sign of y-component\n\t\t\t\t8 y of y-component\n\t\t\t*/\n\t\t\tmatch[ 1 ] = match[ 1 ].toLowerCase();\n\n\t\t\tif ( match[ 1 ].slice( 0, 3 ) === \"nth\" ) {\n\n\t\t\t\t// nth-* requires argument\n\t\t\t\tif ( !match[ 3 ] ) {\n\t\t\t\t\tfind.error( match[ 0 ] );\n\t\t\t\t}\n\n\t\t\t\t// numeric x and y parameters for Expr.filter.CHILD\n\t\t\t\t// remember that false/true cast respectively to 0/1\n\t\t\t\tmatch[ 4 ] = +( match[ 4 ] ?\n\t\t\t\t\tmatch[ 5 ] + ( match[ 6 ] || 1 ) :\n\t\t\t\t\t2 * ( match[ 3 ] === \"even\" || match[ 3 ] === \"odd\" )\n\t\t\t\t);\n\t\t\t\tmatch[ 5 ] = +( ( match[ 7 ] + match[ 8 ] ) || match[ 3 ] === \"odd\" );\n\n\t\t\t// other types prohibit arguments\n\t\t\t} else if ( match[ 3 ] ) {\n\t\t\t\tfind.error( match[ 0 ] );\n\t\t\t}\n\n\t\t\treturn match;\n\t\t},\n\n\t\tPSEUDO: function( match ) {\n\t\t\tvar excess,\n\t\t\t\tunquoted = !match[ 6 ] && match[ 2 ];\n\n\t\t\tif ( matchExpr.CHILD.test( match[ 0 ] ) ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t// Accept quoted arguments as-is\n\t\t\tif ( match[ 3 ] ) {\n\t\t\t\tmatch[ 2 ] = match[ 4 ] || match[ 5 ] || \"\";\n\n\t\t\t// Strip excess characters from unquoted arguments\n\t\t\t} else if ( unquoted && rpseudo.test( unquoted ) &&\n\n\t\t\t\t// Get excess from tokenize (recursively)\n\t\t\t\t( excess = tokenize( unquoted, true ) ) &&\n\n\t\t\t\t// advance to the next closing parenthesis\n\t\t\t\t( excess = unquoted.indexOf( \")\", unquoted.length - excess ) - unquoted.length ) ) {\n\n\t\t\t\t// excess is a negative index\n\t\t\t\tmatch[ 0 ] = match[ 0 ].slice( 0, excess );\n\t\t\t\tmatch[ 2 ] = unquoted.slice( 0, excess );\n\t\t\t}\n\n\t\t\t// Return only captures needed by the pseudo filter method (type and argument)\n\t\t\treturn match.slice( 0, 3 );\n\t\t}\n\t},\n\n\tfilter: {\n\n\t\tTAG: function( nodeNameSelector ) {\n\t\t\tvar expectedNodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();\n\t\t\treturn nodeNameSelector === \"*\" ?\n\t\t\t\tfunction() {\n\t\t\t\t\treturn true;\n\t\t\t\t} :\n\t\t\t\tfunction( elem ) {\n\t\t\t\t\treturn nodeName( elem, expectedNodeName );\n\t\t\t\t};\n\t\t},\n\n\t\tCLASS: function( className ) {\n\t\t\tvar pattern = classCache[ className + \" \" ];\n\n\t\t\treturn pattern ||\n\t\t\t\t( pattern = new RegExp( \"(^|\" + whitespace + \")\" + className +\n\t\t\t\t\t\"(\" + whitespace + \"|$)\" ) ) &&\n\t\t\t\tclassCache( className, function( elem ) {\n\t\t\t\t\treturn pattern.test(\n\t\t\t\t\t\ttypeof elem.className === \"string\" && elem.className ||\n\t\t\t\t\t\t\ttypeof elem.getAttribute !== \"undefined\" &&\n\t\t\t\t\t\t\t\telem.getAttribute( \"class\" ) ||\n\t\t\t\t\t\t\t\"\"\n\t\t\t\t\t);\n\t\t\t\t} );\n\t\t},\n\n\t\tATTR: function( name, operator, check ) {\n\t\t\treturn function( elem ) {\n\t\t\t\tvar result = find.attr( elem, name );\n\n\t\t\t\tif ( result == null ) {\n\t\t\t\t\treturn operator === \"!=\";\n\t\t\t\t}\n\t\t\t\tif ( !operator ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\tresult += \"\";\n\n\t\t\t\tif ( operator === \"=\" ) {\n\t\t\t\t\treturn result === check;\n\t\t\t\t}\n\t\t\t\tif ( operator === \"!=\" ) {\n\t\t\t\t\treturn result !== check;\n\t\t\t\t}\n\t\t\t\tif ( operator === \"^=\" ) {\n\t\t\t\t\treturn check && result.indexOf( check ) === 0;\n\t\t\t\t}\n\t\t\t\tif ( operator === \"*=\" ) {\n\t\t\t\t\treturn check && result.indexOf( check ) > -1;\n\t\t\t\t}\n\t\t\t\tif ( operator === \"$=\" ) {\n\t\t\t\t\treturn check && result.slice( -check.length ) === check;\n\t\t\t\t}\n\t\t\t\tif ( operator === \"~=\" ) {\n\t\t\t\t\treturn ( \" \" + result.replace( rwhitespace, \" \" ) + \" \" )\n\t\t\t\t\t\t.indexOf( check ) > -1;\n\t\t\t\t}\n\t\t\t\tif ( operator === \"|=\" ) {\n\t\t\t\t\treturn result === check || result.slice( 0, check.length + 1 ) === check + \"-\";\n\t\t\t\t}\n\n\t\t\t\treturn false;\n\t\t\t};\n\t\t},\n\n\t\tCHILD: function( type, what, _argument, first, last ) {\n\t\t\tvar simple = type.slice( 0, 3 ) !== \"nth\",\n\t\t\t\tforward = type.slice( -4 ) !== \"last\",\n\t\t\t\tofType = what === \"of-type\";\n\n\t\t\treturn first === 1 && last === 0 ?\n\n\t\t\t\t// Shortcut for :nth-*(n)\n\t\t\t\tfunction( elem ) {\n\t\t\t\t\treturn !!elem.parentNode;\n\t\t\t\t} :\n\n\t\t\t\tfunction( elem, _context, xml ) {\n\t\t\t\t\tvar cache, outerCache, node, nodeIndex, start,\n\t\t\t\t\t\tdir = simple !== forward ? \"nextSibling\" : \"previousSibling\",\n\t\t\t\t\t\tparent = elem.parentNode,\n\t\t\t\t\t\tname = ofType && elem.nodeName.toLowerCase(),\n\t\t\t\t\t\tuseCache = !xml && !ofType,\n\t\t\t\t\t\tdiff = false;\n\n\t\t\t\t\tif ( parent ) {\n\n\t\t\t\t\t\t// :(first|last|only)-(child|of-type)\n\t\t\t\t\t\tif ( simple ) {\n\t\t\t\t\t\t\twhile ( dir ) {\n\t\t\t\t\t\t\t\tnode = elem;\n\t\t\t\t\t\t\t\twhile ( ( node = node[ dir ] ) ) {\n\t\t\t\t\t\t\t\t\tif ( ofType ?\n\t\t\t\t\t\t\t\t\t\tnodeName( node, name ) :\n\t\t\t\t\t\t\t\t\t\tnode.nodeType === 1 ) {\n\n\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Reverse direction for :only-* (if we haven't yet done so)\n\t\t\t\t\t\t\t\tstart = dir = type === \"only\" && !start && \"nextSibling\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tstart = [ forward ? parent.firstChild : parent.lastChild ];\n\n\t\t\t\t\t\t// non-xml :nth-child(...) stores cache data on `parent`\n\t\t\t\t\t\tif ( forward && useCache ) {\n\n\t\t\t\t\t\t\t// Seek `elem` from a previously-cached index\n\t\t\t\t\t\t\touterCache = parent[ expando ] || ( parent[ expando ] = {} );\n\t\t\t\t\t\t\tcache = outerCache[ type ] || [];\n\t\t\t\t\t\t\tnodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];\n\t\t\t\t\t\t\tdiff = nodeIndex && cache[ 2 ];\n\t\t\t\t\t\t\tnode = nodeIndex && parent.childNodes[ nodeIndex ];\n\n\t\t\t\t\t\t\twhile ( ( node = ++nodeIndex && node && node[ dir ] ||\n\n\t\t\t\t\t\t\t\t// Fallback to seeking `elem` from the start\n\t\t\t\t\t\t\t\t( diff = nodeIndex = 0 ) || start.pop() ) ) {\n\n\t\t\t\t\t\t\t\t// When found, cache indexes on `parent` and break\n\t\t\t\t\t\t\t\tif ( node.nodeType === 1 && ++diff && node === elem ) {\n\t\t\t\t\t\t\t\t\touterCache[ type ] = [ dirruns, nodeIndex, diff ];\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t// Use previously-cached element index if available\n\t\t\t\t\t\t\tif ( useCache ) {\n\t\t\t\t\t\t\t\touterCache = elem[ expando ] || ( elem[ expando ] = {} );\n\t\t\t\t\t\t\t\tcache = outerCache[ type ] || [];\n\t\t\t\t\t\t\t\tnodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];\n\t\t\t\t\t\t\t\tdiff = nodeIndex;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// xml :nth-child(...)\n\t\t\t\t\t\t\t// or :nth-last-child(...) or :nth(-last)?-of-type(...)\n\t\t\t\t\t\t\tif ( diff === false ) {\n\n\t\t\t\t\t\t\t\t// Use the same loop as above to seek `elem` from the start\n\t\t\t\t\t\t\t\twhile ( ( node = ++nodeIndex && node && node[ dir ] ||\n\t\t\t\t\t\t\t\t\t( diff = nodeIndex = 0 ) || start.pop() ) ) {\n\n\t\t\t\t\t\t\t\t\tif ( ( ofType ?\n\t\t\t\t\t\t\t\t\t\tnodeName( node, name ) :\n\t\t\t\t\t\t\t\t\t\tnode.nodeType === 1 ) &&\n\t\t\t\t\t\t\t\t\t\t++diff ) {\n\n\t\t\t\t\t\t\t\t\t\t// Cache the index of each encountered element\n\t\t\t\t\t\t\t\t\t\tif ( useCache ) {\n\t\t\t\t\t\t\t\t\t\t\touterCache = node[ expando ] ||\n\t\t\t\t\t\t\t\t\t\t\t\t( node[ expando ] = {} );\n\t\t\t\t\t\t\t\t\t\t\touterCache[ type ] = [ dirruns, diff ];\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\tif ( node === elem ) {\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Incorporate the offset, then check against cycle size\n\t\t\t\t\t\tdiff -= last;\n\t\t\t\t\t\treturn diff === first || ( diff % first === 0 && diff / first >= 0 );\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t},\n\n\t\tPSEUDO: function( pseudo, argument ) {\n\n\t\t\t// pseudo-class names are case-insensitive\n\t\t\t// https://www.w3.org/TR/selectors/#pseudo-classes\n\t\t\t// Prioritize by case sensitivity in case custom pseudos are added with uppercase letters\n\t\t\t// Remember that setFilters inherits from pseudos\n\t\t\tvar args,\n\t\t\t\tfn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||\n\t\t\t\t\tfind.error( \"unsupported pseudo: \" + pseudo );\n\n\t\t\t// The user may use createPseudo to indicate that\n\t\t\t// arguments are needed to create the filter function\n\t\t\t// just as jQuery does\n\t\t\tif ( fn[ expando ] ) {\n\t\t\t\treturn fn( argument );\n\t\t\t}\n\n\t\t\t// But maintain support for old signatures\n\t\t\tif ( fn.length > 1 ) {\n\t\t\t\targs = [ pseudo, pseudo, \"\", argument ];\n\t\t\t\treturn Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?\n\t\t\t\t\tmarkFunction( function( seed, matches ) {\n\t\t\t\t\t\tvar idx,\n\t\t\t\t\t\t\tmatched = fn( seed, argument ),\n\t\t\t\t\t\t\ti = matched.length;\n\t\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\t\tidx = indexOf.call( seed, matched[ i ] );\n\t\t\t\t\t\t\tseed[ idx ] = !( matches[ idx ] = matched[ i ] );\n\t\t\t\t\t\t}\n\t\t\t\t\t} ) :\n\t\t\t\t\tfunction( elem ) {\n\t\t\t\t\t\treturn fn( elem, 0, args );\n\t\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn fn;\n\t\t}\n\t},\n\n\tpseudos: {\n\n\t\t// Potentially complex pseudos\n\t\tnot: markFunction( function( selector ) {\n\n\t\t\t// Trim the selector passed to compile\n\t\t\t// to avoid treating leading and trailing\n\t\t\t// spaces as combinators\n\t\t\tvar input = [],\n\t\t\t\tresults = [],\n\t\t\t\tmatcher = compile( selector.replace( rtrimCSS, \"$1\" ) );\n\n\t\t\treturn matcher[ expando ] ?\n\t\t\t\tmarkFunction( function( seed, matches, _context, xml ) {\n\t\t\t\t\tvar elem,\n\t\t\t\t\t\tunmatched = matcher( seed, null, xml, [] ),\n\t\t\t\t\t\ti = seed.length;\n\n\t\t\t\t\t// Match elements unmatched by `matcher`\n\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\tif ( ( elem = unmatched[ i ] ) ) {\n\t\t\t\t\t\t\tseed[ i ] = !( matches[ i ] = elem );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} ) :\n\t\t\t\tfunction( elem, _context, xml ) {\n\t\t\t\t\tinput[ 0 ] = elem;\n\t\t\t\t\tmatcher( input, null, xml, results );\n\n\t\t\t\t\t// Don't keep the element\n\t\t\t\t\t// (see https://github.com/jquery/sizzle/issues/299)\n\t\t\t\t\tinput[ 0 ] = null;\n\t\t\t\t\treturn !results.pop();\n\t\t\t\t};\n\t\t} ),\n\n\t\thas: markFunction( function( selector ) {\n\t\t\treturn function( elem ) {\n\t\t\t\treturn find( selector, elem ).length > 0;\n\t\t\t};\n\t\t} ),\n\n\t\tcontains: markFunction( function( text ) {\n\t\t\ttext = text.replace( runescape, funescape );\n\t\t\treturn function( elem ) {\n\t\t\t\treturn ( elem.textContent || jQuery.text( elem ) ).indexOf( text ) > -1;\n\t\t\t};\n\t\t} ),\n\n\t\t// \"Whether an element is represented by a :lang() selector\n\t\t// is based solely on the element's language value\n\t\t// being equal to the identifier C,\n\t\t// or beginning with the identifier C immediately followed by \"-\".\n\t\t// The matching of C against the element's language value is performed case-insensitively.\n\t\t// The identifier C does not have to be a valid language name.\"\n\t\t// https://www.w3.org/TR/selectors/#lang-pseudo\n\t\tlang: markFunction( function( lang ) {\n\n\t\t\t// lang value must be a valid identifier\n\t\t\tif ( !ridentifier.test( lang || \"\" ) ) {\n\t\t\t\tfind.error( \"unsupported lang: \" + lang );\n\t\t\t}\n\t\t\tlang = lang.replace( runescape, funescape ).toLowerCase();\n\t\t\treturn function( elem ) {\n\t\t\t\tvar elemLang;\n\t\t\t\tdo {\n\t\t\t\t\tif ( ( elemLang = documentIsHTML ?\n\t\t\t\t\t\telem.lang :\n\t\t\t\t\t\telem.getAttribute( \"xml:lang\" ) || elem.getAttribute( \"lang\" ) ) ) {\n\n\t\t\t\t\t\telemLang = elemLang.toLowerCase();\n\t\t\t\t\t\treturn elemLang === lang || elemLang.indexOf( lang + \"-\" ) === 0;\n\t\t\t\t\t}\n\t\t\t\t} while ( ( elem = elem.parentNode ) && elem.nodeType === 1 );\n\t\t\t\treturn false;\n\t\t\t};\n\t\t} ),\n\n\t\t// Miscellaneous\n\t\ttarget: function( elem ) {\n\t\t\tvar hash = window.location && window.location.hash;\n\t\t\treturn hash && hash.slice( 1 ) === elem.id;\n\t\t},\n\n\t\troot: function( elem ) {\n\t\t\treturn elem === documentElement;\n\t\t},\n\n\t\tfocus: function( elem ) {\n\t\t\treturn elem === safeActiveElement() &&\n\t\t\t\tdocument.hasFocus() &&\n\t\t\t\t!!( elem.type || elem.href || ~elem.tabIndex );\n\t\t},\n\n\t\t// Boolean properties\n\t\tenabled: createDisabledPseudo( false ),\n\t\tdisabled: createDisabledPseudo( true ),\n\n\t\tchecked: function( elem ) {\n\n\t\t\t// In CSS3, :checked should return both checked and selected elements\n\t\t\t// https://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked\n\t\t\treturn ( nodeName( elem, \"input\" ) && !!elem.checked ) ||\n\t\t\t\t( nodeName( elem, \"option\" ) && !!elem.selected );\n\t\t},\n\n\t\tselected: function( elem ) {\n\n\t\t\t// Support: IE <=11+\n\t\t\t// Accessing the selectedIndex property\n\t\t\t// forces the browser to treat the default option as\n\t\t\t// selected when in an optgroup.\n\t\t\tif ( elem.parentNode ) {\n\t\t\t\t// eslint-disable-next-line no-unused-expressions\n\t\t\t\telem.parentNode.selectedIndex;\n\t\t\t}\n\n\t\t\treturn elem.selected === true;\n\t\t},\n\n\t\t// Contents\n\t\tempty: function( elem ) {\n\n\t\t\t// https://www.w3.org/TR/selectors/#empty-pseudo\n\t\t\t// :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),\n\t\t\t//   but not by others (comment: 8; processing instruction: 7; etc.)\n\t\t\t// nodeType < 6 works because attributes (2) do not appear as children\n\t\t\tfor ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {\n\t\t\t\tif ( elem.nodeType < 6 ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t},\n\n\t\tparent: function( elem ) {\n\t\t\treturn !Expr.pseudos.empty( elem );\n\t\t},\n\n\t\t// Element/input types\n\t\theader: function( elem ) {\n\t\t\treturn rheader.test( elem.nodeName );\n\t\t},\n\n\t\tinput: function( elem ) {\n\t\t\treturn rinputs.test( elem.nodeName );\n\t\t},\n\n\t\tbutton: function( elem ) {\n\t\t\treturn nodeName( elem, \"input\" ) && elem.type === \"button\" ||\n\t\t\t\tnodeName( elem, \"button\" );\n\t\t},\n\n\t\ttext: function( elem ) {\n\t\t\tvar attr;\n\t\t\treturn nodeName( elem, \"input\" ) && elem.type === \"text\" &&\n\n\t\t\t\t// Support: IE <10 only\n\t\t\t\t// New HTML5 attribute values (e.g., \"search\") appear\n\t\t\t\t// with elem.type === \"text\"\n\t\t\t\t( ( attr = elem.getAttribute( \"type\" ) ) == null ||\n\t\t\t\t\tattr.toLowerCase() === \"text\" );\n\t\t},\n\n\t\t// Position-in-collection\n\t\tfirst: createPositionalPseudo( function() {\n\t\t\treturn [ 0 ];\n\t\t} ),\n\n\t\tlast: createPositionalPseudo( function( _matchIndexes, length ) {\n\t\t\treturn [ length - 1 ];\n\t\t} ),\n\n\t\teq: createPositionalPseudo( function( _matchIndexes, length, argument ) {\n\t\t\treturn [ argument < 0 ? argument + length : argument ];\n\t\t} ),\n\n\t\teven: createPositionalPseudo( function( matchIndexes, length ) {\n\t\t\tvar i = 0;\n\t\t\tfor ( ; i < length; i += 2 ) {\n\t\t\t\tmatchIndexes.push( i );\n\t\t\t}\n\t\t\treturn matchIndexes;\n\t\t} ),\n\n\t\todd: createPositionalPseudo( function( matchIndexes, length ) {\n\t\t\tvar i = 1;\n\t\t\tfor ( ; i < length; i += 2 ) {\n\t\t\t\tmatchIndexes.push( i );\n\t\t\t}\n\t\t\treturn matchIndexes;\n\t\t} ),\n\n\t\tlt: createPositionalPseudo( function( matchIndexes, length, argument ) {\n\t\t\tvar i;\n\n\t\t\tif ( argument < 0 ) {\n\t\t\t\ti = argument + length;\n\t\t\t} else if ( argument > length ) {\n\t\t\t\ti = length;\n\t\t\t} else {\n\t\t\t\ti = argument;\n\t\t\t}\n\n\t\t\tfor ( ; --i >= 0; ) {\n\t\t\t\tmatchIndexes.push( i );\n\t\t\t}\n\t\t\treturn matchIndexes;\n\t\t} ),\n\n\t\tgt: createPositionalPseudo( function( matchIndexes, length, argument ) {\n\t\t\tvar i = argument < 0 ? argument + length : argument;\n\t\t\tfor ( ; ++i < length; ) {\n\t\t\t\tmatchIndexes.push( i );\n\t\t\t}\n\t\t\treturn matchIndexes;\n\t\t} )\n\t}\n};\n\nExpr.pseudos.nth = Expr.pseudos.eq;\n\n// Add button/input type pseudos\nfor ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {\n\tExpr.pseudos[ i ] = createInputPseudo( i );\n}\nfor ( i in { submit: true, reset: true } ) {\n\tExpr.pseudos[ i ] = createButtonPseudo( i );\n}\n\n// Easy API for creating new setFilters\nfunction setFilters() {}\nsetFilters.prototype = Expr.filters = Expr.pseudos;\nExpr.setFilters = new setFilters();\n\nfunction tokenize( selector, parseOnly ) {\n\tvar matched, match, tokens, type,\n\t\tsoFar, groups, preFilters,\n\t\tcached = tokenCache[ selector + \" \" ];\n\n\tif ( cached ) {\n\t\treturn parseOnly ? 0 : cached.slice( 0 );\n\t}\n\n\tsoFar = selector;\n\tgroups = [];\n\tpreFilters = Expr.preFilter;\n\n\twhile ( soFar ) {\n\n\t\t// Comma and first run\n\t\tif ( !matched || ( match = rcomma.exec( soFar ) ) ) {\n\t\t\tif ( match ) {\n\n\t\t\t\t// Don't consume trailing commas as valid\n\t\t\t\tsoFar = soFar.slice( match[ 0 ].length ) || soFar;\n\t\t\t}\n\t\t\tgroups.push( ( tokens = [] ) );\n\t\t}\n\n\t\tmatched = false;\n\n\t\t// Combinators\n\t\tif ( ( match = rleadingCombinator.exec( soFar ) ) ) {\n\t\t\tmatched = match.shift();\n\t\t\ttokens.push( {\n\t\t\t\tvalue: matched,\n\n\t\t\t\t// Cast descendant combinators to space\n\t\t\t\ttype: match[ 0 ].replace( rtrimCSS, \" \" )\n\t\t\t} );\n\t\t\tsoFar = soFar.slice( matched.length );\n\t\t}\n\n\t\t// Filters\n\t\tfor ( type in Expr.filter ) {\n\t\t\tif ( ( match = matchExpr[ type ].exec( soFar ) ) && ( !preFilters[ type ] ||\n\t\t\t\t( match = preFilters[ type ]( match ) ) ) ) {\n\t\t\t\tmatched = match.shift();\n\t\t\t\ttokens.push( {\n\t\t\t\t\tvalue: matched,\n\t\t\t\t\ttype: type,\n\t\t\t\t\tmatches: match\n\t\t\t\t} );\n\t\t\t\tsoFar = soFar.slice( matched.length );\n\t\t\t}\n\t\t}\n\n\t\tif ( !matched ) {\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t// Return the length of the invalid excess\n\t// if we're just parsing\n\t// Otherwise, throw an error or return tokens\n\tif ( parseOnly ) {\n\t\treturn soFar.length;\n\t}\n\n\treturn soFar ?\n\t\tfind.error( selector ) :\n\n\t\t// Cache the tokens\n\t\ttokenCache( selector, groups ).slice( 0 );\n}\n\nfunction toSelector( tokens ) {\n\tvar i = 0,\n\t\tlen = tokens.length,\n\t\tselector = \"\";\n\tfor ( ; i < len; i++ ) {\n\t\tselector += tokens[ i ].value;\n\t}\n\treturn selector;\n}\n\nfunction addCombinator( matcher, combinator, base ) {\n\tvar dir = combinator.dir,\n\t\tskip = combinator.next,\n\t\tkey = skip || dir,\n\t\tcheckNonElements = base && key === \"parentNode\",\n\t\tdoneName = done++;\n\n\treturn combinator.first ?\n\n\t\t// Check against closest ancestor/preceding element\n\t\tfunction( elem, context, xml ) {\n\t\t\twhile ( ( elem = elem[ dir ] ) ) {\n\t\t\t\tif ( elem.nodeType === 1 || checkNonElements ) {\n\t\t\t\t\treturn matcher( elem, context, xml );\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t} :\n\n\t\t// Check against all ancestor/preceding elements\n\t\tfunction( elem, context, xml ) {\n\t\t\tvar oldCache, outerCache,\n\t\t\t\tnewCache = [ dirruns, doneName ];\n\n\t\t\t// We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching\n\t\t\tif ( xml ) {\n\t\t\t\twhile ( ( elem = elem[ dir ] ) ) {\n\t\t\t\t\tif ( elem.nodeType === 1 || checkNonElements ) {\n\t\t\t\t\t\tif ( matcher( elem, context, xml ) ) {\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\twhile ( ( elem = elem[ dir ] ) ) {\n\t\t\t\t\tif ( elem.nodeType === 1 || checkNonElements ) {\n\t\t\t\t\t\touterCache = elem[ expando ] || ( elem[ expando ] = {} );\n\n\t\t\t\t\t\tif ( skip && nodeName( elem, skip ) ) {\n\t\t\t\t\t\t\telem = elem[ dir ] || elem;\n\t\t\t\t\t\t} else if ( ( oldCache = outerCache[ key ] ) &&\n\t\t\t\t\t\t\toldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {\n\n\t\t\t\t\t\t\t// Assign to newCache so results back-propagate to previous elements\n\t\t\t\t\t\t\treturn ( newCache[ 2 ] = oldCache[ 2 ] );\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t// Reuse newcache so results back-propagate to previous elements\n\t\t\t\t\t\t\touterCache[ key ] = newCache;\n\n\t\t\t\t\t\t\t// A match means we're done; a fail means we have to keep checking\n\t\t\t\t\t\t\tif ( ( newCache[ 2 ] = matcher( elem, context, xml ) ) ) {\n\t\t\t\t\t\t\t\treturn true;\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\treturn false;\n\t\t};\n}\n\nfunction elementMatcher( matchers ) {\n\treturn matchers.length > 1 ?\n\t\tfunction( elem, context, xml ) {\n\t\t\tvar i = matchers.length;\n\t\t\twhile ( i-- ) {\n\t\t\t\tif ( !matchers[ i ]( elem, context, xml ) ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t} :\n\t\tmatchers[ 0 ];\n}\n\nfunction multipleContexts( selector, contexts, results ) {\n\tvar i = 0,\n\t\tlen = contexts.length;\n\tfor ( ; i < len; i++ ) {\n\t\tfind( selector, contexts[ i ], results );\n\t}\n\treturn results;\n}\n\nfunction condense( unmatched, map, filter, context, xml ) {\n\tvar elem,\n\t\tnewUnmatched = [],\n\t\ti = 0,\n\t\tlen = unmatched.length,\n\t\tmapped = map != null;\n\n\tfor ( ; i < len; i++ ) {\n\t\tif ( ( elem = unmatched[ i ] ) ) {\n\t\t\tif ( !filter || filter( elem, context, xml ) ) {\n\t\t\t\tnewUnmatched.push( elem );\n\t\t\t\tif ( mapped ) {\n\t\t\t\t\tmap.push( i );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn newUnmatched;\n}\n\nfunction setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {\n\tif ( postFilter && !postFilter[ expando ] ) {\n\t\tpostFilter = setMatcher( postFilter );\n\t}\n\tif ( postFinder && !postFinder[ expando ] ) {\n\t\tpostFinder = setMatcher( postFinder, postSelector );\n\t}\n\treturn markFunction( function( seed, results, context, xml ) {\n\t\tvar temp, i, elem, matcherOut,\n\t\t\tpreMap = [],\n\t\t\tpostMap = [],\n\t\t\tpreexisting = results.length,\n\n\t\t\t// Get initial elements from seed or context\n\t\t\telems = seed ||\n\t\t\t\tmultipleContexts( selector || \"*\",\n\t\t\t\t\tcontext.nodeType ? [ context ] : context, [] ),\n\n\t\t\t// Prefilter to get matcher input, preserving a map for seed-results synchronization\n\t\t\tmatcherIn = preFilter && ( seed || !selector ) ?\n\t\t\t\tcondense( elems, preMap, preFilter, context, xml ) :\n\t\t\t\telems;\n\n\t\tif ( matcher ) {\n\n\t\t\t// If we have a postFinder, or filtered seed, or non-seed postFilter\n\t\t\t// or preexisting results,\n\t\t\tmatcherOut = postFinder || ( seed ? preFilter : preexisting || postFilter ) ?\n\n\t\t\t\t// ...intermediate processing is necessary\n\t\t\t\t[] :\n\n\t\t\t\t// ...otherwise use results directly\n\t\t\t\tresults;\n\n\t\t\t// Find primary matches\n\t\t\tmatcher( matcherIn, matcherOut, context, xml );\n\t\t} else {\n\t\t\tmatcherOut = matcherIn;\n\t\t}\n\n\t\t// Apply postFilter\n\t\tif ( postFilter ) {\n\t\t\ttemp = condense( matcherOut, postMap );\n\t\t\tpostFilter( temp, [], context, xml );\n\n\t\t\t// Un-match failing elements by moving them back to matcherIn\n\t\t\ti = temp.length;\n\t\t\twhile ( i-- ) {\n\t\t\t\tif ( ( elem = temp[ i ] ) ) {\n\t\t\t\t\tmatcherOut[ postMap[ i ] ] = !( matcherIn[ postMap[ i ] ] = elem );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( seed ) {\n\t\t\tif ( postFinder || preFilter ) {\n\t\t\t\tif ( postFinder ) {\n\n\t\t\t\t\t// Get the final matcherOut by condensing this intermediate into postFinder contexts\n\t\t\t\t\ttemp = [];\n\t\t\t\t\ti = matcherOut.length;\n\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\tif ( ( elem = matcherOut[ i ] ) ) {\n\n\t\t\t\t\t\t\t// Restore matcherIn since elem is not yet a final match\n\t\t\t\t\t\t\ttemp.push( ( matcherIn[ i ] = elem ) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tpostFinder( null, ( matcherOut = [] ), temp, xml );\n\t\t\t\t}\n\n\t\t\t\t// Move matched elements from seed to results to keep them synchronized\n\t\t\t\ti = matcherOut.length;\n\t\t\t\twhile ( i-- ) {\n\t\t\t\t\tif ( ( elem = matcherOut[ i ] ) &&\n\t\t\t\t\t\t( temp = postFinder ? indexOf.call( seed, elem ) : preMap[ i ] ) > -1 ) {\n\n\t\t\t\t\t\tseed[ temp ] = !( results[ temp ] = elem );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t// Add elements to results, through postFinder if defined\n\t\t} else {\n\t\t\tmatcherOut = condense(\n\t\t\t\tmatcherOut === results ?\n\t\t\t\t\tmatcherOut.splice( preexisting, matcherOut.length ) :\n\t\t\t\t\tmatcherOut\n\t\t\t);\n\t\t\tif ( postFinder ) {\n\t\t\t\tpostFinder( null, results, matcherOut, xml );\n\t\t\t} else {\n\t\t\t\tpush.apply( results, matcherOut );\n\t\t\t}\n\t\t}\n\t} );\n}\n\nfunction matcherFromTokens( tokens ) {\n\tvar checkContext, matcher, j,\n\t\tlen = tokens.length,\n\t\tleadingRelative = Expr.relative[ tokens[ 0 ].type ],\n\t\timplicitRelative = leadingRelative || Expr.relative[ \" \" ],\n\t\ti = leadingRelative ? 1 : 0,\n\n\t\t// The foundational matcher ensures that elements are reachable from top-level context(s)\n\t\tmatchContext = addCombinator( function( elem ) {\n\t\t\treturn elem === checkContext;\n\t\t}, implicitRelative, true ),\n\t\tmatchAnyContext = addCombinator( function( elem ) {\n\t\t\treturn indexOf.call( checkContext, elem ) > -1;\n\t\t}, implicitRelative, true ),\n\t\tmatchers = [ function( elem, context, xml ) {\n\n\t\t\t// Support: IE 11+, Edge 17 - 18+\n\t\t\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t\t\t// two documents; shallow comparisons work.\n\t\t\t// eslint-disable-next-line eqeqeq\n\t\t\tvar ret = ( !leadingRelative && ( xml || context != outermostContext ) ) || (\n\t\t\t\t( checkContext = context ).nodeType ?\n\t\t\t\t\tmatchContext( elem, context, xml ) :\n\t\t\t\t\tmatchAnyContext( elem, context, xml ) );\n\n\t\t\t// Avoid hanging onto element\n\t\t\t// (see https://github.com/jquery/sizzle/issues/299)\n\t\t\tcheckContext = null;\n\t\t\treturn ret;\n\t\t} ];\n\n\tfor ( ; i < len; i++ ) {\n\t\tif ( ( matcher = Expr.relative[ tokens[ i ].type ] ) ) {\n\t\t\tmatchers = [ addCombinator( elementMatcher( matchers ), matcher ) ];\n\t\t} else {\n\t\t\tmatcher = Expr.filter[ tokens[ i ].type ].apply( null, tokens[ i ].matches );\n\n\t\t\t// Return special upon seeing a positional matcher\n\t\t\tif ( matcher[ expando ] ) {\n\n\t\t\t\t// Find the next relative operator (if any) for proper handling\n\t\t\t\tj = ++i;\n\t\t\t\tfor ( ; j < len; j++ ) {\n\t\t\t\t\tif ( Expr.relative[ tokens[ j ].type ] ) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn setMatcher(\n\t\t\t\t\ti > 1 && elementMatcher( matchers ),\n\t\t\t\t\ti > 1 && toSelector(\n\n\t\t\t\t\t\t// If the preceding token was a descendant combinator, insert an implicit any-element `*`\n\t\t\t\t\t\ttokens.slice( 0, i - 1 )\n\t\t\t\t\t\t\t.concat( { value: tokens[ i - 2 ].type === \" \" ? \"*\" : \"\" } )\n\t\t\t\t\t).replace( rtrimCSS, \"$1\" ),\n\t\t\t\t\tmatcher,\n\t\t\t\t\ti < j && matcherFromTokens( tokens.slice( i, j ) ),\n\t\t\t\t\tj < len && matcherFromTokens( ( tokens = tokens.slice( j ) ) ),\n\t\t\t\t\tj < len && toSelector( tokens )\n\t\t\t\t);\n\t\t\t}\n\t\t\tmatchers.push( matcher );\n\t\t}\n\t}\n\n\treturn elementMatcher( matchers );\n}\n\nfunction matcherFromGroupMatchers( elementMatchers, setMatchers ) {\n\tvar bySet = setMatchers.length > 0,\n\t\tbyElement = elementMatchers.length > 0,\n\t\tsuperMatcher = function( seed, context, xml, results, outermost ) {\n\t\t\tvar elem, j, matcher,\n\t\t\t\tmatchedCount = 0,\n\t\t\t\ti = \"0\",\n\t\t\t\tunmatched = seed && [],\n\t\t\t\tsetMatched = [],\n\t\t\t\tcontextBackup = outermostContext,\n\n\t\t\t\t// We must always have either seed elements or outermost context\n\t\t\t\telems = seed || byElement && Expr.find.TAG( \"*\", outermost ),\n\n\t\t\t\t// Use integer dirruns iff this is the outermost matcher\n\t\t\t\tdirrunsUnique = ( dirruns += contextBackup == null ? 1 : Math.random() || 0.1 ),\n\t\t\t\tlen = elems.length;\n\n\t\t\tif ( outermost ) {\n\n\t\t\t\t// Support: IE 11+, Edge 17 - 18+\n\t\t\t\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t\t\t\t// two documents; shallow comparisons work.\n\t\t\t\t// eslint-disable-next-line eqeqeq\n\t\t\t\toutermostContext = context == document || context || outermost;\n\t\t\t}\n\n\t\t\t// Add elements passing elementMatchers directly to results\n\t\t\t// Support: iOS <=7 - 9 only\n\t\t\t// Tolerate NodeList properties (IE: \"length\"; Safari: <number>) matching\n\t\t\t// elements by id. (see trac-14142)\n\t\t\tfor ( ; i !== len && ( elem = elems[ i ] ) != null; i++ ) {\n\t\t\t\tif ( byElement && elem ) {\n\t\t\t\t\tj = 0;\n\n\t\t\t\t\t// Support: IE 11+, Edge 17 - 18+\n\t\t\t\t\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t\t\t\t\t// two documents; shallow comparisons work.\n\t\t\t\t\t// eslint-disable-next-line eqeqeq\n\t\t\t\t\tif ( !context && elem.ownerDocument != document ) {\n\t\t\t\t\t\tsetDocument( elem );\n\t\t\t\t\t\txml = !documentIsHTML;\n\t\t\t\t\t}\n\t\t\t\t\twhile ( ( matcher = elementMatchers[ j++ ] ) ) {\n\t\t\t\t\t\tif ( matcher( elem, context || document, xml ) ) {\n\t\t\t\t\t\t\tpush.call( results, elem );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ( outermost ) {\n\t\t\t\t\t\tdirruns = dirrunsUnique;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Track unmatched elements for set filters\n\t\t\t\tif ( bySet ) {\n\n\t\t\t\t\t// They will have gone through all possible matchers\n\t\t\t\t\tif ( ( elem = !matcher && elem ) ) {\n\t\t\t\t\t\tmatchedCount--;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Lengthen the array for every element, matched or not\n\t\t\t\t\tif ( seed ) {\n\t\t\t\t\t\tunmatched.push( elem );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// `i` is now the count of elements visited above, and adding it to `matchedCount`\n\t\t\t// makes the latter nonnegative.\n\t\t\tmatchedCount += i;\n\n\t\t\t// Apply set filters to unmatched elements\n\t\t\t// NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount`\n\t\t\t// equals `i`), unless we didn't visit _any_ elements in the above loop because we have\n\t\t\t// no element matchers and no seed.\n\t\t\t// Incrementing an initially-string \"0\" `i` allows `i` to remain a string only in that\n\t\t\t// case, which will result in a \"00\" `matchedCount` that differs from `i` but is also\n\t\t\t// numerically zero.\n\t\t\tif ( bySet && i !== matchedCount ) {\n\t\t\t\tj = 0;\n\t\t\t\twhile ( ( matcher = setMatchers[ j++ ] ) ) {\n\t\t\t\t\tmatcher( unmatched, setMatched, context, xml );\n\t\t\t\t}\n\n\t\t\t\tif ( seed ) {\n\n\t\t\t\t\t// Reintegrate element matches to eliminate the need for sorting\n\t\t\t\t\tif ( matchedCount > 0 ) {\n\t\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\t\tif ( !( unmatched[ i ] || setMatched[ i ] ) ) {\n\t\t\t\t\t\t\t\tsetMatched[ i ] = pop.call( results );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Discard index placeholder values to get only actual matches\n\t\t\t\t\tsetMatched = condense( setMatched );\n\t\t\t\t}\n\n\t\t\t\t// Add matches to results\n\t\t\t\tpush.apply( results, setMatched );\n\n\t\t\t\t// Seedless set matches succeeding multiple successful matchers stipulate sorting\n\t\t\t\tif ( outermost && !seed && setMatched.length > 0 &&\n\t\t\t\t\t( matchedCount + setMatchers.length ) > 1 ) {\n\n\t\t\t\t\tjQuery.uniqueSort( results );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Override manipulation of globals by nested matchers\n\t\t\tif ( outermost ) {\n\t\t\t\tdirruns = dirrunsUnique;\n\t\t\t\toutermostContext = contextBackup;\n\t\t\t}\n\n\t\t\treturn unmatched;\n\t\t};\n\n\treturn bySet ?\n\t\tmarkFunction( superMatcher ) :\n\t\tsuperMatcher;\n}\n\nfunction compile( selector, match /* Internal Use Only */ ) {\n\tvar i,\n\t\tsetMatchers = [],\n\t\telementMatchers = [],\n\t\tcached = compilerCache[ selector + \" \" ];\n\n\tif ( !cached ) {\n\n\t\t// Generate a function of recursive functions that can be used to check each element\n\t\tif ( !match ) {\n\t\t\tmatch = tokenize( selector );\n\t\t}\n\t\ti = match.length;\n\t\twhile ( i-- ) {\n\t\t\tcached = matcherFromTokens( match[ i ] );\n\t\t\tif ( cached[ expando ] ) {\n\t\t\t\tsetMatchers.push( cached );\n\t\t\t} else {\n\t\t\t\telementMatchers.push( cached );\n\t\t\t}\n\t\t}\n\n\t\t// Cache the compiled function\n\t\tcached = compilerCache( selector,\n\t\t\tmatcherFromGroupMatchers( elementMatchers, setMatchers ) );\n\n\t\t// Save selector and tokenization\n\t\tcached.selector = selector;\n\t}\n\treturn cached;\n}\n\n/**\n * A low-level selection function that works with jQuery's compiled\n *  selector functions\n * @param {String|Function} selector A selector or a pre-compiled\n *  selector function built with jQuery selector compile\n * @param {Element} context\n * @param {Array} [results]\n * @param {Array} [seed] A set of elements to match against\n */\nfunction select( selector, context, results, seed ) {\n\tvar i, tokens, token, type, find,\n\t\tcompiled = typeof selector === \"function\" && selector,\n\t\tmatch = !seed && tokenize( ( selector = compiled.selector || selector ) );\n\n\tresults = results || [];\n\n\t// Try to minimize operations if there is only one selector in the list and no seed\n\t// (the latter of which guarantees us context)\n\tif ( match.length === 1 ) {\n\n\t\t// Reduce context if the leading compound selector is an ID\n\t\ttokens = match[ 0 ] = match[ 0 ].slice( 0 );\n\t\tif ( tokens.length > 2 && ( token = tokens[ 0 ] ).type === \"ID\" &&\n\t\t\t\tcontext.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[ 1 ].type ] ) {\n\n\t\t\tcontext = ( Expr.find.ID(\n\t\t\t\ttoken.matches[ 0 ].replace( runescape, funescape ),\n\t\t\t\tcontext\n\t\t\t) || [] )[ 0 ];\n\t\t\tif ( !context ) {\n\t\t\t\treturn results;\n\n\t\t\t// Precompiled matchers will still verify ancestry, so step up a level\n\t\t\t} else if ( compiled ) {\n\t\t\t\tcontext = context.parentNode;\n\t\t\t}\n\n\t\t\tselector = selector.slice( tokens.shift().value.length );\n\t\t}\n\n\t\t// Fetch a seed set for right-to-left matching\n\t\ti = matchExpr.needsContext.test( selector ) ? 0 : tokens.length;\n\t\twhile ( i-- ) {\n\t\t\ttoken = tokens[ i ];\n\n\t\t\t// Abort if we hit a combinator\n\t\t\tif ( Expr.relative[ ( type = token.type ) ] ) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( ( find = Expr.find[ type ] ) ) {\n\n\t\t\t\t// Search, expanding context for leading sibling combinators\n\t\t\t\tif ( ( seed = find(\n\t\t\t\t\ttoken.matches[ 0 ].replace( runescape, funescape ),\n\t\t\t\t\trsibling.test( tokens[ 0 ].type ) &&\n\t\t\t\t\t\ttestContext( context.parentNode ) || context\n\t\t\t\t) ) ) {\n\n\t\t\t\t\t// If seed is empty or no tokens remain, we can return early\n\t\t\t\t\ttokens.splice( i, 1 );\n\t\t\t\t\tselector = seed.length && toSelector( tokens );\n\t\t\t\t\tif ( !selector ) {\n\t\t\t\t\t\tpush.apply( results, seed );\n\t\t\t\t\t\treturn results;\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Compile and execute a filtering function if one is not provided\n\t// Provide `match` to avoid retokenization if we modified the selector above\n\t( compiled || compile( selector, match ) )(\n\t\tseed,\n\t\tcontext,\n\t\t!documentIsHTML,\n\t\tresults,\n\t\t!context || rsibling.test( selector ) && testContext( context.parentNode ) || context\n\t);\n\treturn results;\n}\n\n// One-time assignments\n\n// Support: Android <=4.0 - 4.1+\n// Sort stability\nsupport.sortStable = expando.split( \"\" ).sort( sortOrder ).join( \"\" ) === expando;\n\n// Initialize against the default document\nsetDocument();\n\n// Support: Android <=4.0 - 4.1+\n// Detached nodes confoundingly follow *each other*\nsupport.sortDetached = assert( function( el ) {\n\n\t// Should return 1, but returns 4 (following)\n\treturn el.compareDocumentPosition( document.createElement( \"fieldset\" ) ) & 1;\n} );\n\njQuery.find = find;\n\n// Deprecated\njQuery.expr[ \":\" ] = jQuery.expr.pseudos;\njQuery.unique = jQuery.uniqueSort;\n\n// These have always been private, but they used to be documented as part of\n// Sizzle so let's maintain them for now for backwards compatibility purposes.\nfind.compile = compile;\nfind.select = select;\nfind.setDocument = setDocument;\nfind.tokenize = tokenize;\n\nfind.escape = jQuery.escapeSelector;\nfind.getText = jQuery.text;\nfind.isXML = jQuery.isXMLDoc;\nfind.selectors = jQuery.expr;\nfind.support = jQuery.support;\nfind.uniqueSort = jQuery.uniqueSort;\n\n\t/* eslint-enable */\n\n} )();\n\n\nvar dir = function( elem, dir, until ) {\n\tvar matched = [],\n\t\ttruncate = until !== undefined;\n\n\twhile ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) {\n\t\tif ( elem.nodeType === 1 ) {\n\t\t\tif ( truncate && jQuery( elem ).is( until ) ) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tmatched.push( elem );\n\t\t}\n\t}\n\treturn matched;\n};\n\n\nvar siblings = function( n, elem ) {\n\tvar matched = [];\n\n\tfor ( ; n; n = n.nextSibling ) {\n\t\tif ( n.nodeType === 1 && n !== elem ) {\n\t\t\tmatched.push( n );\n\t\t}\n\t}\n\n\treturn matched;\n};\n\n\nvar rneedsContext = jQuery.expr.match.needsContext;\n\nvar rsingleTag = ( /^<([a-z][^\\/\\0>:\\x20\\t\\r\\n\\f]*)[\\x20\\t\\r\\n\\f]*\\/?>(?:<\\/\\1>|)$/i );\n\n\n\n// Implement the identical functionality for filter and not\nfunction winnow( elements, qualifier, not ) {\n\tif ( isFunction( qualifier ) ) {\n\t\treturn jQuery.grep( elements, function( elem, i ) {\n\t\t\treturn !!qualifier.call( elem, i, elem ) !== not;\n\t\t} );\n\t}\n\n\t// Single element\n\tif ( qualifier.nodeType ) {\n\t\treturn jQuery.grep( elements, function( elem ) {\n\t\t\treturn ( elem === qualifier ) !== not;\n\t\t} );\n\t}\n\n\t// Arraylike of elements (jQuery, arguments, Array)\n\tif ( typeof qualifier !== \"string\" ) {\n\t\treturn jQuery.grep( elements, function( elem ) {\n\t\t\treturn ( indexOf.call( qualifier, elem ) > -1 ) !== not;\n\t\t} );\n\t}\n\n\t// Filtered directly for both simple and complex selectors\n\treturn jQuery.filter( qualifier, elements, not );\n}\n\njQuery.filter = function( expr, elems, not ) {\n\tvar elem = elems[ 0 ];\n\n\tif ( not ) {\n\t\texpr = \":not(\" + expr + \")\";\n\t}\n\n\tif ( elems.length === 1 && elem.nodeType === 1 ) {\n\t\treturn jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [];\n\t}\n\n\treturn jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {\n\t\treturn elem.nodeType === 1;\n\t} ) );\n};\n\njQuery.fn.extend( {\n\tfind: function( selector ) {\n\t\tvar i, ret,\n\t\t\tlen = this.length,\n\t\t\tself = this;\n\n\t\tif ( typeof selector !== \"string\" ) {\n\t\t\treturn this.pushStack( jQuery( selector ).filter( function() {\n\t\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\t\tif ( jQuery.contains( self[ i ], this ) ) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} ) );\n\t\t}\n\n\t\tret = this.pushStack( [] );\n\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tjQuery.find( selector, self[ i ], ret );\n\t\t}\n\n\t\treturn len > 1 ? jQuery.uniqueSort( ret ) : ret;\n\t},\n\tfilter: function( selector ) {\n\t\treturn this.pushStack( winnow( this, selector || [], false ) );\n\t},\n\tnot: function( selector ) {\n\t\treturn this.pushStack( winnow( this, selector || [], true ) );\n\t},\n\tis: function( selector ) {\n\t\treturn !!winnow(\n\t\t\tthis,\n\n\t\t\t// If this is a positional/relative selector, check membership in the returned set\n\t\t\t// so $(\"p:first\").is(\"p:last\") won't return true for a doc with two \"p\".\n\t\t\ttypeof selector === \"string\" && rneedsContext.test( selector ) ?\n\t\t\t\tjQuery( selector ) :\n\t\t\t\tselector || [],\n\t\t\tfalse\n\t\t).length;\n\t}\n} );\n\n\n// Initialize a jQuery object\n\n\n// A central reference to the root jQuery(document)\nvar rootjQuery,\n\n\t// A simple way to check for HTML strings\n\t// Prioritize #id over <tag> to avoid XSS via location.hash (trac-9521)\n\t// Strict HTML recognition (trac-11290: must start with <)\n\t// Shortcut simple #id case for speed\n\trquickExpr = /^(?:\\s*(<[\\w\\W]+>)[^>]*|#([\\w-]+))$/,\n\n\tinit = jQuery.fn.init = function( selector, context, root ) {\n\t\tvar match, elem;\n\n\t\t// HANDLE: $(\"\"), $(null), $(undefined), $(false)\n\t\tif ( !selector ) {\n\t\t\treturn this;\n\t\t}\n\n\t\t// Method init() accepts an alternate rootjQuery\n\t\t// so migrate can support jQuery.sub (gh-2101)\n\t\troot = root || rootjQuery;\n\n\t\t// Handle HTML strings\n\t\tif ( typeof selector === \"string\" ) {\n\t\t\tif ( selector[ 0 ] === \"<\" &&\n\t\t\t\tselector[ selector.length - 1 ] === \">\" &&\n\t\t\t\tselector.length >= 3 ) {\n\n\t\t\t\t// Assume that strings that start and end with <> are HTML and skip the regex check\n\t\t\t\tmatch = [ null, selector, null ];\n\n\t\t\t} else {\n\t\t\t\tmatch = rquickExpr.exec( selector );\n\t\t\t}\n\n\t\t\t// Match html or make sure no context is specified for #id\n\t\t\tif ( match && ( match[ 1 ] || !context ) ) {\n\n\t\t\t\t// HANDLE: $(html) -> $(array)\n\t\t\t\tif ( match[ 1 ] ) {\n\t\t\t\t\tcontext = context instanceof jQuery ? context[ 0 ] : context;\n\n\t\t\t\t\t// Option to run scripts is true for back-compat\n\t\t\t\t\t// Intentionally let the error be thrown if parseHTML is not present\n\t\t\t\t\tjQuery.merge( this, jQuery.parseHTML(\n\t\t\t\t\t\tmatch[ 1 ],\n\t\t\t\t\t\tcontext && context.nodeType ? context.ownerDocument || context : document,\n\t\t\t\t\t\ttrue\n\t\t\t\t\t) );\n\n\t\t\t\t\t// HANDLE: $(html, props)\n\t\t\t\t\tif ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) {\n\t\t\t\t\t\tfor ( match in context ) {\n\n\t\t\t\t\t\t\t// Properties of context are called as methods if possible\n\t\t\t\t\t\t\tif ( isFunction( this[ match ] ) ) {\n\t\t\t\t\t\t\t\tthis[ match ]( context[ match ] );\n\n\t\t\t\t\t\t\t// ...and otherwise set as attributes\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthis.attr( match, context[ match ] );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn this;\n\n\t\t\t\t// HANDLE: $(#id)\n\t\t\t\t} else {\n\t\t\t\t\telem = document.getElementById( match[ 2 ] );\n\n\t\t\t\t\tif ( elem ) {\n\n\t\t\t\t\t\t// Inject the element directly into the jQuery object\n\t\t\t\t\t\tthis[ 0 ] = elem;\n\t\t\t\t\t\tthis.length = 1;\n\t\t\t\t\t}\n\t\t\t\t\treturn this;\n\t\t\t\t}\n\n\t\t\t// HANDLE: $(expr, $(...))\n\t\t\t} else if ( !context || context.jquery ) {\n\t\t\t\treturn ( context || root ).find( selector );\n\n\t\t\t// HANDLE: $(expr, context)\n\t\t\t// (which is just equivalent to: $(context).find(expr)\n\t\t\t} else {\n\t\t\t\treturn this.constructor( context ).find( selector );\n\t\t\t}\n\n\t\t// HANDLE: $(DOMElement)\n\t\t} else if ( selector.nodeType ) {\n\t\t\tthis[ 0 ] = selector;\n\t\t\tthis.length = 1;\n\t\t\treturn this;\n\n\t\t// HANDLE: $(function)\n\t\t// Shortcut for document ready\n\t\t} else if ( isFunction( selector ) ) {\n\t\t\treturn root.ready !== undefined ?\n\t\t\t\troot.ready( selector ) :\n\n\t\t\t\t// Execute immediately if ready is not present\n\t\t\t\tselector( jQuery );\n\t\t}\n\n\t\treturn jQuery.makeArray( selector, this );\n\t};\n\n// Give the init function the jQuery prototype for later instantiation\ninit.prototype = jQuery.fn;\n\n// Initialize central reference\nrootjQuery = jQuery( document );\n\n\nvar rparentsprev = /^(?:parents|prev(?:Until|All))/,\n\n\t// Methods guaranteed to produce a unique set when starting from a unique set\n\tguaranteedUnique = {\n\t\tchildren: true,\n\t\tcontents: true,\n\t\tnext: true,\n\t\tprev: true\n\t};\n\njQuery.fn.extend( {\n\thas: function( target ) {\n\t\tvar targets = jQuery( target, this ),\n\t\t\tl = targets.length;\n\n\t\treturn this.filter( function() {\n\t\t\tvar i = 0;\n\t\t\tfor ( ; i < l; i++ ) {\n\t\t\t\tif ( jQuery.contains( this, targets[ i ] ) ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t},\n\n\tclosest: function( selectors, context ) {\n\t\tvar cur,\n\t\t\ti = 0,\n\t\t\tl = this.length,\n\t\t\tmatched = [],\n\t\t\ttargets = typeof selectors !== \"string\" && jQuery( selectors );\n\n\t\t// Positional selectors never match, since there's no _selection_ context\n\t\tif ( !rneedsContext.test( selectors ) ) {\n\t\t\tfor ( ; i < l; i++ ) {\n\t\t\t\tfor ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) {\n\n\t\t\t\t\t// Always skip document fragments\n\t\t\t\t\tif ( cur.nodeType < 11 && ( targets ?\n\t\t\t\t\t\ttargets.index( cur ) > -1 :\n\n\t\t\t\t\t\t// Don't pass non-elements to jQuery#find\n\t\t\t\t\t\tcur.nodeType === 1 &&\n\t\t\t\t\t\t\tjQuery.find.matchesSelector( cur, selectors ) ) ) {\n\n\t\t\t\t\t\tmatched.push( cur );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched );\n\t},\n\n\t// Determine the position of an element within the set\n\tindex: function( elem ) {\n\n\t\t// No argument, return index in parent\n\t\tif ( !elem ) {\n\t\t\treturn ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1;\n\t\t}\n\n\t\t// Index in selector\n\t\tif ( typeof elem === \"string\" ) {\n\t\t\treturn indexOf.call( jQuery( elem ), this[ 0 ] );\n\t\t}\n\n\t\t// Locate the position of the desired element\n\t\treturn indexOf.call( this,\n\n\t\t\t// If it receives a jQuery object, the first element is used\n\t\t\telem.jquery ? elem[ 0 ] : elem\n\t\t);\n\t},\n\n\tadd: function( selector, context ) {\n\t\treturn this.pushStack(\n\t\t\tjQuery.uniqueSort(\n\t\t\t\tjQuery.merge( this.get(), jQuery( selector, context ) )\n\t\t\t)\n\t\t);\n\t},\n\n\taddBack: function( selector ) {\n\t\treturn this.add( selector == null ?\n\t\t\tthis.prevObject : this.prevObject.filter( selector )\n\t\t);\n\t}\n} );\n\nfunction sibling( cur, dir ) {\n\twhile ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {}\n\treturn cur;\n}\n\njQuery.each( {\n\tparent: function( elem ) {\n\t\tvar parent = elem.parentNode;\n\t\treturn parent && parent.nodeType !== 11 ? parent : null;\n\t},\n\tparents: function( elem ) {\n\t\treturn dir( elem, \"parentNode\" );\n\t},\n\tparentsUntil: function( elem, _i, until ) {\n\t\treturn dir( elem, \"parentNode\", until );\n\t},\n\tnext: function( elem ) {\n\t\treturn sibling( elem, \"nextSibling\" );\n\t},\n\tprev: function( elem ) {\n\t\treturn sibling( elem, \"previousSibling\" );\n\t},\n\tnextAll: function( elem ) {\n\t\treturn dir( elem, \"nextSibling\" );\n\t},\n\tprevAll: function( elem ) {\n\t\treturn dir( elem, \"previousSibling\" );\n\t},\n\tnextUntil: function( elem, _i, until ) {\n\t\treturn dir( elem, \"nextSibling\", until );\n\t},\n\tprevUntil: function( elem, _i, until ) {\n\t\treturn dir( elem, \"previousSibling\", until );\n\t},\n\tsiblings: function( elem ) {\n\t\treturn siblings( ( elem.parentNode || {} ).firstChild, elem );\n\t},\n\tchildren: function( elem ) {\n\t\treturn siblings( elem.firstChild );\n\t},\n\tcontents: function( elem ) {\n\t\tif ( elem.contentDocument != null &&\n\n\t\t\t// Support: IE 11+\n\t\t\t// <object> elements with no `data` attribute has an object\n\t\t\t// `contentDocument` with a `null` prototype.\n\t\t\tgetProto( elem.contentDocument ) ) {\n\n\t\t\treturn elem.contentDocument;\n\t\t}\n\n\t\t// Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only\n\t\t// Treat the template element as a regular one in browsers that\n\t\t// don't support it.\n\t\tif ( nodeName( elem, \"template\" ) ) {\n\t\t\telem = elem.content || elem;\n\t\t}\n\n\t\treturn jQuery.merge( [], elem.childNodes );\n\t}\n}, function( name, fn ) {\n\tjQuery.fn[ name ] = function( until, selector ) {\n\t\tvar matched = jQuery.map( this, fn, until );\n\n\t\tif ( name.slice( -5 ) !== \"Until\" ) {\n\t\t\tselector = until;\n\t\t}\n\n\t\tif ( selector && typeof selector === \"string\" ) {\n\t\t\tmatched = jQuery.filter( selector, matched );\n\t\t}\n\n\t\tif ( this.length > 1 ) {\n\n\t\t\t// Remove duplicates\n\t\t\tif ( !guaranteedUnique[ name ] ) {\n\t\t\t\tjQuery.uniqueSort( matched );\n\t\t\t}\n\n\t\t\t// Reverse order for parents* and prev-derivatives\n\t\t\tif ( rparentsprev.test( name ) ) {\n\t\t\t\tmatched.reverse();\n\t\t\t}\n\t\t}\n\n\t\treturn this.pushStack( matched );\n\t};\n} );\nvar rnothtmlwhite = ( /[^\\x20\\t\\r\\n\\f]+/g );\n\n\n\n// Convert String-formatted options into Object-formatted ones\nfunction createOptions( options ) {\n\tvar object = {};\n\tjQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t} );\n\treturn object;\n}\n\n/*\n * Create a callback list using the following parameters:\n *\n *\toptions: an optional list of space-separated options that will change how\n *\t\t\tthe callback list behaves or a more traditional option object\n *\n * By default a callback list will act like an event callback list and can be\n * \"fired\" multiple times.\n *\n * Possible options:\n *\n *\tonce:\t\t\twill ensure the callback list can only be fired once (like a Deferred)\n *\n *\tmemory:\t\t\twill keep track of previous values and will call any callback added\n *\t\t\t\t\tafter the list has been fired right away with the latest \"memorized\"\n *\t\t\t\t\tvalues (like a Deferred)\n *\n *\tunique:\t\t\twill ensure a callback can only be added once (no duplicate in the list)\n *\n *\tstopOnFalse:\tinterrupt callings when a callback returns false\n *\n */\njQuery.Callbacks = function( options ) {\n\n\t// Convert options from String-formatted to Object-formatted if needed\n\t// (we check in cache first)\n\toptions = typeof options === \"string\" ?\n\t\tcreateOptions( options ) :\n\t\tjQuery.extend( {}, options );\n\n\tvar // Flag to know if list is currently firing\n\t\tfiring,\n\n\t\t// Last fire value for non-forgettable lists\n\t\tmemory,\n\n\t\t// Flag to know if list was already fired\n\t\tfired,\n\n\t\t// Flag to prevent firing\n\t\tlocked,\n\n\t\t// Actual callback list\n\t\tlist = [],\n\n\t\t// Queue of execution data for repeatable lists\n\t\tqueue = [],\n\n\t\t// Index of currently firing callback (modified by add/remove as needed)\n\t\tfiringIndex = -1,\n\n\t\t// Fire callbacks\n\t\tfire = function() {\n\n\t\t\t// Enforce single-firing\n\t\t\tlocked = locked || options.once;\n\n\t\t\t// Execute callbacks for all pending executions,\n\t\t\t// respecting firingIndex overrides and runtime changes\n\t\t\tfired = firing = true;\n\t\t\tfor ( ; queue.length; firingIndex = -1 ) {\n\t\t\t\tmemory = queue.shift();\n\t\t\t\twhile ( ++firingIndex < list.length ) {\n\n\t\t\t\t\t// Run callback and check for early termination\n\t\t\t\t\tif ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false &&\n\t\t\t\t\t\toptions.stopOnFalse ) {\n\n\t\t\t\t\t\t// Jump to end and forget the data so .add doesn't re-fire\n\t\t\t\t\t\tfiringIndex = list.length;\n\t\t\t\t\t\tmemory = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Forget the data if we're done with it\n\t\t\tif ( !options.memory ) {\n\t\t\t\tmemory = false;\n\t\t\t}\n\n\t\t\tfiring = false;\n\n\t\t\t// Clean up if we're done firing for good\n\t\t\tif ( locked ) {\n\n\t\t\t\t// Keep an empty list if we have data for future add calls\n\t\t\t\tif ( memory ) {\n\t\t\t\t\tlist = [];\n\n\t\t\t\t// Otherwise, this object is spent\n\t\t\t\t} else {\n\t\t\t\t\tlist = \"\";\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t// Actual Callbacks object\n\t\tself = {\n\n\t\t\t// Add a callback or a collection of callbacks to the list\n\t\t\tadd: function() {\n\t\t\t\tif ( list ) {\n\n\t\t\t\t\t// If we have memory from a past run, we should fire after adding\n\t\t\t\t\tif ( memory && !firing ) {\n\t\t\t\t\t\tfiringIndex = list.length - 1;\n\t\t\t\t\t\tqueue.push( memory );\n\t\t\t\t\t}\n\n\t\t\t\t\t( function add( args ) {\n\t\t\t\t\t\tjQuery.each( args, function( _, arg ) {\n\t\t\t\t\t\t\tif ( isFunction( arg ) ) {\n\t\t\t\t\t\t\t\tif ( !options.unique || !self.has( arg ) ) {\n\t\t\t\t\t\t\t\t\tlist.push( arg );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else if ( arg && arg.length && toType( arg ) !== \"string\" ) {\n\n\t\t\t\t\t\t\t\t// Inspect recursively\n\t\t\t\t\t\t\t\tadd( arg );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} );\n\t\t\t\t\t} )( arguments );\n\n\t\t\t\t\tif ( memory && !firing ) {\n\t\t\t\t\t\tfire();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\n\t\t\t// Remove a callback from the list\n\t\t\tremove: function() {\n\t\t\t\tjQuery.each( arguments, function( _, arg ) {\n\t\t\t\t\tvar index;\n\t\t\t\t\twhile ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {\n\t\t\t\t\t\tlist.splice( index, 1 );\n\n\t\t\t\t\t\t// Handle firing indexes\n\t\t\t\t\t\tif ( index <= firingIndex ) {\n\t\t\t\t\t\t\tfiringIndex--;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t\treturn this;\n\t\t\t},\n\n\t\t\t// Check if a given callback is in the list.\n\t\t\t// If no argument is given, return whether or not list has callbacks attached.\n\t\t\thas: function( fn ) {\n\t\t\t\treturn fn ?\n\t\t\t\t\tjQuery.inArray( fn, list ) > -1 :\n\t\t\t\t\tlist.length > 0;\n\t\t\t},\n\n\t\t\t// Remove all callbacks from the list\n\t\t\tempty: function() {\n\t\t\t\tif ( list ) {\n\t\t\t\t\tlist = [];\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\n\t\t\t// Disable .fire and .add\n\t\t\t// Abort any current/pending executions\n\t\t\t// Clear all callbacks and values\n\t\t\tdisable: function() {\n\t\t\t\tlocked = queue = [];\n\t\t\t\tlist = memory = \"\";\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\tdisabled: function() {\n\t\t\t\treturn !list;\n\t\t\t},\n\n\t\t\t// Disable .fire\n\t\t\t// Also disable .add unless we have memory (since it would have no effect)\n\t\t\t// Abort any pending executions\n\t\t\tlock: function() {\n\t\t\t\tlocked = queue = [];\n\t\t\t\tif ( !memory && !firing ) {\n\t\t\t\t\tlist = memory = \"\";\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\tlocked: function() {\n\t\t\t\treturn !!locked;\n\t\t\t},\n\n\t\t\t// Call all callbacks with the given context and arguments\n\t\t\tfireWith: function( context, args ) {\n\t\t\t\tif ( !locked ) {\n\t\t\t\t\targs = args || [];\n\t\t\t\t\targs = [ context, args.slice ? args.slice() : args ];\n\t\t\t\t\tqueue.push( args );\n\t\t\t\t\tif ( !firing ) {\n\t\t\t\t\t\tfire();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\n\t\t\t// Call all the callbacks with the given arguments\n\t\t\tfire: function() {\n\t\t\t\tself.fireWith( this, arguments );\n\t\t\t\treturn this;\n\t\t\t},\n\n\t\t\t// To know if the callbacks have already been called at least once\n\t\t\tfired: function() {\n\t\t\t\treturn !!fired;\n\t\t\t}\n\t\t};\n\n\treturn self;\n};\n\n\nfunction Identity( v ) {\n\treturn v;\n}\nfunction Thrower( ex ) {\n\tthrow ex;\n}\n\nfunction adoptValue( value, resolve, reject, noValue ) {\n\tvar method;\n\n\ttry {\n\n\t\t// Check for promise aspect first to privilege synchronous behavior\n\t\tif ( value && isFunction( ( method = value.promise ) ) ) {\n\t\t\tmethod.call( value ).done( resolve ).fail( reject );\n\n\t\t// Other thenables\n\t\t} else if ( value && isFunction( ( method = value.then ) ) ) {\n\t\t\tmethod.call( value, resolve, reject );\n\n\t\t// Other non-thenables\n\t\t} else {\n\n\t\t\t// Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer:\n\t\t\t// * false: [ value ].slice( 0 ) => resolve( value )\n\t\t\t// * true: [ value ].slice( 1 ) => resolve()\n\t\t\tresolve.apply( undefined, [ value ].slice( noValue ) );\n\t\t}\n\n\t// For Promises/A+, convert exceptions into rejections\n\t// Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in\n\t// Deferred#then to conditionally suppress rejection.\n\t} catch ( value ) {\n\n\t\t// Support: Android 4.0 only\n\t\t// Strict mode functions invoked without .call/.apply get global-object context\n\t\treject.apply( undefined, [ value ] );\n\t}\n}\n\njQuery.extend( {\n\n\tDeferred: function( func ) {\n\t\tvar tuples = [\n\n\t\t\t\t// action, add listener, callbacks,\n\t\t\t\t// ... .then handlers, argument index, [final state]\n\t\t\t\t[ \"notify\", \"progress\", jQuery.Callbacks( \"memory\" ),\n\t\t\t\t\tjQuery.Callbacks( \"memory\" ), 2 ],\n\t\t\t\t[ \"resolve\", \"done\", jQuery.Callbacks( \"once memory\" ),\n\t\t\t\t\tjQuery.Callbacks( \"once memory\" ), 0, \"resolved\" ],\n\t\t\t\t[ \"reject\", \"fail\", jQuery.Callbacks( \"once memory\" ),\n\t\t\t\t\tjQuery.Callbacks( \"once memory\" ), 1, \"rejected\" ]\n\t\t\t],\n\t\t\tstate = \"pending\",\n\t\t\tpromise = {\n\t\t\t\tstate: function() {\n\t\t\t\t\treturn state;\n\t\t\t\t},\n\t\t\t\talways: function() {\n\t\t\t\t\tdeferred.done( arguments ).fail( arguments );\n\t\t\t\t\treturn this;\n\t\t\t\t},\n\t\t\t\t\"catch\": function( fn ) {\n\t\t\t\t\treturn promise.then( null, fn );\n\t\t\t\t},\n\n\t\t\t\t// Keep pipe for back-compat\n\t\t\t\tpipe: function( /* fnDone, fnFail, fnProgress */ ) {\n\t\t\t\t\tvar fns = arguments;\n\n\t\t\t\t\treturn jQuery.Deferred( function( newDefer ) {\n\t\t\t\t\t\tjQuery.each( tuples, function( _i, tuple ) {\n\n\t\t\t\t\t\t\t// Map tuples (progress, done, fail) to arguments (done, fail, progress)\n\t\t\t\t\t\t\tvar fn = isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ];\n\n\t\t\t\t\t\t\t// deferred.progress(function() { bind to newDefer or newDefer.notify })\n\t\t\t\t\t\t\t// deferred.done(function() { bind to newDefer or newDefer.resolve })\n\t\t\t\t\t\t\t// deferred.fail(function() { bind to newDefer or newDefer.reject })\n\t\t\t\t\t\t\tdeferred[ tuple[ 1 ] ]( function() {\n\t\t\t\t\t\t\t\tvar returned = fn && fn.apply( this, arguments );\n\t\t\t\t\t\t\t\tif ( returned && isFunction( returned.promise ) ) {\n\t\t\t\t\t\t\t\t\treturned.promise()\n\t\t\t\t\t\t\t\t\t\t.progress( newDefer.notify )\n\t\t\t\t\t\t\t\t\t\t.done( newDefer.resolve )\n\t\t\t\t\t\t\t\t\t\t.fail( newDefer.reject );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tnewDefer[ tuple[ 0 ] + \"With\" ](\n\t\t\t\t\t\t\t\t\t\tthis,\n\t\t\t\t\t\t\t\t\t\tfn ? [ returned ] : arguments\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} );\n\t\t\t\t\t\tfns = null;\n\t\t\t\t\t} ).promise();\n\t\t\t\t},\n\t\t\t\tthen: function( onFulfilled, onRejected, onProgress ) {\n\t\t\t\t\tvar maxDepth = 0;\n\t\t\t\t\tfunction resolve( depth, deferred, handler, special ) {\n\t\t\t\t\t\treturn function() {\n\t\t\t\t\t\t\tvar that = this,\n\t\t\t\t\t\t\t\targs = arguments,\n\t\t\t\t\t\t\t\tmightThrow = function() {\n\t\t\t\t\t\t\t\t\tvar returned, then;\n\n\t\t\t\t\t\t\t\t\t// Support: Promises/A+ section 2.3.3.3.3\n\t\t\t\t\t\t\t\t\t// https://promisesaplus.com/#point-59\n\t\t\t\t\t\t\t\t\t// Ignore double-resolution attempts\n\t\t\t\t\t\t\t\t\tif ( depth < maxDepth ) {\n\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\treturned = handler.apply( that, args );\n\n\t\t\t\t\t\t\t\t\t// Support: Promises/A+ section 2.3.1\n\t\t\t\t\t\t\t\t\t// https://promisesaplus.com/#point-48\n\t\t\t\t\t\t\t\t\tif ( returned === deferred.promise() ) {\n\t\t\t\t\t\t\t\t\t\tthrow new TypeError( \"Thenable self-resolution\" );\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t// Support: Promises/A+ sections 2.3.3.1, 3.5\n\t\t\t\t\t\t\t\t\t// https://promisesaplus.com/#point-54\n\t\t\t\t\t\t\t\t\t// https://promisesaplus.com/#point-75\n\t\t\t\t\t\t\t\t\t// Retrieve `then` only once\n\t\t\t\t\t\t\t\t\tthen = returned &&\n\n\t\t\t\t\t\t\t\t\t\t// Support: Promises/A+ section 2.3.4\n\t\t\t\t\t\t\t\t\t\t// https://promisesaplus.com/#point-64\n\t\t\t\t\t\t\t\t\t\t// Only check objects and functions for thenability\n\t\t\t\t\t\t\t\t\t\t( typeof returned === \"object\" ||\n\t\t\t\t\t\t\t\t\t\t\ttypeof returned === \"function\" ) &&\n\t\t\t\t\t\t\t\t\t\treturned.then;\n\n\t\t\t\t\t\t\t\t\t// Handle a returned thenable\n\t\t\t\t\t\t\t\t\tif ( isFunction( then ) ) {\n\n\t\t\t\t\t\t\t\t\t\t// Special processors (notify) just wait for resolution\n\t\t\t\t\t\t\t\t\t\tif ( special ) {\n\t\t\t\t\t\t\t\t\t\t\tthen.call(\n\t\t\t\t\t\t\t\t\t\t\t\treturned,\n\t\t\t\t\t\t\t\t\t\t\t\tresolve( maxDepth, deferred, Identity, special ),\n\t\t\t\t\t\t\t\t\t\t\t\tresolve( maxDepth, deferred, Thrower, special )\n\t\t\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\t\t// Normal processors (resolve) also hook into progress\n\t\t\t\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t\t\t\t// ...and disregard older resolution values\n\t\t\t\t\t\t\t\t\t\t\tmaxDepth++;\n\n\t\t\t\t\t\t\t\t\t\t\tthen.call(\n\t\t\t\t\t\t\t\t\t\t\t\treturned,\n\t\t\t\t\t\t\t\t\t\t\t\tresolve( maxDepth, deferred, Identity, special ),\n\t\t\t\t\t\t\t\t\t\t\t\tresolve( maxDepth, deferred, Thrower, special ),\n\t\t\t\t\t\t\t\t\t\t\t\tresolve( maxDepth, deferred, Identity,\n\t\t\t\t\t\t\t\t\t\t\t\t\tdeferred.notifyWith )\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t// Handle all other returned values\n\t\t\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t\t\t// Only substitute handlers pass on context\n\t\t\t\t\t\t\t\t\t\t// and multiple values (non-spec behavior)\n\t\t\t\t\t\t\t\t\t\tif ( handler !== Identity ) {\n\t\t\t\t\t\t\t\t\t\t\tthat = undefined;\n\t\t\t\t\t\t\t\t\t\t\targs = [ returned ];\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t// Process the value(s)\n\t\t\t\t\t\t\t\t\t\t// Default process is resolve\n\t\t\t\t\t\t\t\t\t\t( special || deferred.resolveWith )( that, args );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t// Only normal processors (resolve) catch and reject exceptions\n\t\t\t\t\t\t\t\tprocess = special ?\n\t\t\t\t\t\t\t\t\tmightThrow :\n\t\t\t\t\t\t\t\t\tfunction() {\n\t\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\t\tmightThrow();\n\t\t\t\t\t\t\t\t\t\t} catch ( e ) {\n\n\t\t\t\t\t\t\t\t\t\t\tif ( jQuery.Deferred.exceptionHook ) {\n\t\t\t\t\t\t\t\t\t\t\t\tjQuery.Deferred.exceptionHook( e,\n\t\t\t\t\t\t\t\t\t\t\t\t\tprocess.error );\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t// Support: Promises/A+ section 2.3.3.3.4.1\n\t\t\t\t\t\t\t\t\t\t\t// https://promisesaplus.com/#point-61\n\t\t\t\t\t\t\t\t\t\t\t// Ignore post-resolution exceptions\n\t\t\t\t\t\t\t\t\t\t\tif ( depth + 1 >= maxDepth ) {\n\n\t\t\t\t\t\t\t\t\t\t\t\t// Only substitute handlers pass on context\n\t\t\t\t\t\t\t\t\t\t\t\t// and multiple values (non-spec behavior)\n\t\t\t\t\t\t\t\t\t\t\t\tif ( handler !== Thrower ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tthat = undefined;\n\t\t\t\t\t\t\t\t\t\t\t\t\targs = [ e ];\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\tdeferred.rejectWith( that, args );\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\t// Support: Promises/A+ section 2.3.3.3.1\n\t\t\t\t\t\t\t// https://promisesaplus.com/#point-57\n\t\t\t\t\t\t\t// Re-resolve promises immediately to dodge false rejection from\n\t\t\t\t\t\t\t// subsequent errors\n\t\t\t\t\t\t\tif ( depth ) {\n\t\t\t\t\t\t\t\tprocess();\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t// Call an optional hook to record the error, in case of exception\n\t\t\t\t\t\t\t\t// since it's otherwise lost when execution goes async\n\t\t\t\t\t\t\t\tif ( jQuery.Deferred.getErrorHook ) {\n\t\t\t\t\t\t\t\t\tprocess.error = jQuery.Deferred.getErrorHook();\n\n\t\t\t\t\t\t\t\t// The deprecated alias of the above. While the name suggests\n\t\t\t\t\t\t\t\t// returning the stack, not an error instance, jQuery just passes\n\t\t\t\t\t\t\t\t// it directly to `console.warn` so both will work; an instance\n\t\t\t\t\t\t\t\t// just better cooperates with source maps.\n\t\t\t\t\t\t\t\t} else if ( jQuery.Deferred.getStackHook ) {\n\t\t\t\t\t\t\t\t\tprocess.error = jQuery.Deferred.getStackHook();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\twindow.setTimeout( process );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\n\t\t\t\t\treturn jQuery.Deferred( function( newDefer ) {\n\n\t\t\t\t\t\t// progress_handlers.add( ... )\n\t\t\t\t\t\ttuples[ 0 ][ 3 ].add(\n\t\t\t\t\t\t\tresolve(\n\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\tnewDefer,\n\t\t\t\t\t\t\t\tisFunction( onProgress ) ?\n\t\t\t\t\t\t\t\t\tonProgress :\n\t\t\t\t\t\t\t\t\tIdentity,\n\t\t\t\t\t\t\t\tnewDefer.notifyWith\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t// fulfilled_handlers.add( ... )\n\t\t\t\t\t\ttuples[ 1 ][ 3 ].add(\n\t\t\t\t\t\t\tresolve(\n\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\tnewDefer,\n\t\t\t\t\t\t\t\tisFunction( onFulfilled ) ?\n\t\t\t\t\t\t\t\t\tonFulfilled :\n\t\t\t\t\t\t\t\t\tIdentity\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t// rejected_handlers.add( ... )\n\t\t\t\t\t\ttuples[ 2 ][ 3 ].add(\n\t\t\t\t\t\t\tresolve(\n\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\tnewDefer,\n\t\t\t\t\t\t\t\tisFunction( onRejected ) ?\n\t\t\t\t\t\t\t\t\tonRejected :\n\t\t\t\t\t\t\t\t\tThrower\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t} ).promise();\n\t\t\t\t},\n\n\t\t\t\t// Get a promise for this deferred\n\t\t\t\t// If obj is provided, the promise aspect is added to the object\n\t\t\t\tpromise: function( obj ) {\n\t\t\t\t\treturn obj != null ? jQuery.extend( obj, promise ) : promise;\n\t\t\t\t}\n\t\t\t},\n\t\t\tdeferred = {};\n\n\t\t// Add list-specific methods\n\t\tjQuery.each( tuples, function( i, tuple ) {\n\t\t\tvar list = tuple[ 2 ],\n\t\t\t\tstateString = tuple[ 5 ];\n\n\t\t\t// promise.progress = list.add\n\t\t\t// promise.done = list.add\n\t\t\t// promise.fail = list.add\n\t\t\tpromise[ tuple[ 1 ] ] = list.add;\n\n\t\t\t// Handle state\n\t\t\tif ( stateString ) {\n\t\t\t\tlist.add(\n\t\t\t\t\tfunction() {\n\n\t\t\t\t\t\t// state = \"resolved\" (i.e., fulfilled)\n\t\t\t\t\t\t// state = \"rejected\"\n\t\t\t\t\t\tstate = stateString;\n\t\t\t\t\t},\n\n\t\t\t\t\t// rejected_callbacks.disable\n\t\t\t\t\t// fulfilled_callbacks.disable\n\t\t\t\t\ttuples[ 3 - i ][ 2 ].disable,\n\n\t\t\t\t\t// rejected_handlers.disable\n\t\t\t\t\t// fulfilled_handlers.disable\n\t\t\t\t\ttuples[ 3 - i ][ 3 ].disable,\n\n\t\t\t\t\t// progress_callbacks.lock\n\t\t\t\t\ttuples[ 0 ][ 2 ].lock,\n\n\t\t\t\t\t// progress_handlers.lock\n\t\t\t\t\ttuples[ 0 ][ 3 ].lock\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// progress_handlers.fire\n\t\t\t// fulfilled_handlers.fire\n\t\t\t// rejected_handlers.fire\n\t\t\tlist.add( tuple[ 3 ].fire );\n\n\t\t\t// deferred.notify = function() { deferred.notifyWith(...) }\n\t\t\t// deferred.resolve = function() { deferred.resolveWith(...) }\n\t\t\t// deferred.reject = function() { deferred.rejectWith(...) }\n\t\t\tdeferred[ tuple[ 0 ] ] = function() {\n\t\t\t\tdeferred[ tuple[ 0 ] + \"With\" ]( this === deferred ? undefined : this, arguments );\n\t\t\t\treturn this;\n\t\t\t};\n\n\t\t\t// deferred.notifyWith = list.fireWith\n\t\t\t// deferred.resolveWith = list.fireWith\n\t\t\t// deferred.rejectWith = list.fireWith\n\t\t\tdeferred[ tuple[ 0 ] + \"With\" ] = list.fireWith;\n\t\t} );\n\n\t\t// Make the deferred a promise\n\t\tpromise.promise( deferred );\n\n\t\t// Call given func if any\n\t\tif ( func ) {\n\t\t\tfunc.call( deferred, deferred );\n\t\t}\n\n\t\t// All done!\n\t\treturn deferred;\n\t},\n\n\t// Deferred helper\n\twhen: function( singleValue ) {\n\t\tvar\n\n\t\t\t// count of uncompleted subordinates\n\t\t\tremaining = arguments.length,\n\n\t\t\t// count of unprocessed arguments\n\t\t\ti = remaining,\n\n\t\t\t// subordinate fulfillment data\n\t\t\tresolveContexts = Array( i ),\n\t\t\tresolveValues = slice.call( arguments ),\n\n\t\t\t// the primary Deferred\n\t\t\tprimary = jQuery.Deferred(),\n\n\t\t\t// subordinate callback factory\n\t\t\tupdateFunc = function( i ) {\n\t\t\t\treturn function( value ) {\n\t\t\t\t\tresolveContexts[ i ] = this;\n\t\t\t\t\tresolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;\n\t\t\t\t\tif ( !( --remaining ) ) {\n\t\t\t\t\t\tprimary.resolveWith( resolveContexts, resolveValues );\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t};\n\n\t\t// Single- and empty arguments are adopted like Promise.resolve\n\t\tif ( remaining <= 1 ) {\n\t\t\tadoptValue( singleValue, primary.done( updateFunc( i ) ).resolve, primary.reject,\n\t\t\t\t!remaining );\n\n\t\t\t// Use .then() to unwrap secondary thenables (cf. gh-3000)\n\t\t\tif ( primary.state() === \"pending\" ||\n\t\t\t\tisFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) {\n\n\t\t\t\treturn primary.then();\n\t\t\t}\n\t\t}\n\n\t\t// Multiple arguments are aggregated like Promise.all array elements\n\t\twhile ( i-- ) {\n\t\t\tadoptValue( resolveValues[ i ], updateFunc( i ), primary.reject );\n\t\t}\n\n\t\treturn primary.promise();\n\t}\n} );\n\n\n// These usually indicate a programmer mistake during development,\n// warn about them ASAP rather than swallowing them by default.\nvar rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;\n\n// If `jQuery.Deferred.getErrorHook` is defined, `asyncError` is an error\n// captured before the async barrier to get the original error cause\n// which may otherwise be hidden.\njQuery.Deferred.exceptionHook = function( error, asyncError ) {\n\n\t// Support: IE 8 - 9 only\n\t// Console exists when dev tools are open, which can happen at any time\n\tif ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) {\n\t\twindow.console.warn( \"jQuery.Deferred exception: \" + error.message,\n\t\t\terror.stack, asyncError );\n\t}\n};\n\n\n\n\njQuery.readyException = function( error ) {\n\twindow.setTimeout( function() {\n\t\tthrow error;\n\t} );\n};\n\n\n\n\n// The deferred used on DOM ready\nvar readyList = jQuery.Deferred();\n\njQuery.fn.ready = function( fn ) {\n\n\treadyList\n\t\t.then( fn )\n\n\t\t// Wrap jQuery.readyException in a function so that the lookup\n\t\t// happens at the time of error handling instead of callback\n\t\t// registration.\n\t\t.catch( function( error ) {\n\t\t\tjQuery.readyException( error );\n\t\t} );\n\n\treturn this;\n};\n\njQuery.extend( {\n\n\t// Is the DOM ready to be used? Set to true once it occurs.\n\tisReady: false,\n\n\t// A counter to track how many items to wait for before\n\t// the ready event fires. See trac-6781\n\treadyWait: 1,\n\n\t// Handle when the DOM is ready\n\tready: function( wait ) {\n\n\t\t// Abort if there are pending holds or we're already ready\n\t\tif ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Remember that the DOM is ready\n\t\tjQuery.isReady = true;\n\n\t\t// If a normal DOM Ready event fired, decrement, and wait if need be\n\t\tif ( wait !== true && --jQuery.readyWait > 0 ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If there are functions bound, to execute\n\t\treadyList.resolveWith( document, [ jQuery ] );\n\t}\n} );\n\njQuery.ready.then = readyList.then;\n\n// The ready event handler and self cleanup method\nfunction completed() {\n\tdocument.removeEventListener( \"DOMContentLoaded\", completed );\n\twindow.removeEventListener( \"load\", completed );\n\tjQuery.ready();\n}\n\n// Catch cases where $(document).ready() is called\n// after the browser event has already occurred.\n// Support: IE <=9 - 10 only\n// Older IE sometimes signals \"interactive\" too soon\nif ( document.readyState === \"complete\" ||\n\t( document.readyState !== \"loading\" && !document.documentElement.doScroll ) ) {\n\n\t// Handle it asynchronously to allow scripts the opportunity to delay ready\n\twindow.setTimeout( jQuery.ready );\n\n} else {\n\n\t// Use the handy event callback\n\tdocument.addEventListener( \"DOMContentLoaded\", completed );\n\n\t// A fallback to window.onload, that will always work\n\twindow.addEventListener( \"load\", completed );\n}\n\n\n\n\n// Multifunctional method to get and set values of a collection\n// The value/s can optionally be executed if it's a function\nvar access = function( elems, fn, key, value, chainable, emptyGet, raw ) {\n\tvar i = 0,\n\t\tlen = elems.length,\n\t\tbulk = key == null;\n\n\t// Sets many values\n\tif ( toType( key ) === \"object\" ) {\n\t\tchainable = true;\n\t\tfor ( i in key ) {\n\t\t\taccess( elems, fn, i, key[ i ], true, emptyGet, raw );\n\t\t}\n\n\t// Sets one value\n\t} else if ( value !== undefined ) {\n\t\tchainable = true;\n\n\t\tif ( !isFunction( value ) ) {\n\t\t\traw = true;\n\t\t}\n\n\t\tif ( bulk ) {\n\n\t\t\t// Bulk operations run against the entire set\n\t\t\tif ( raw ) {\n\t\t\t\tfn.call( elems, value );\n\t\t\t\tfn = null;\n\n\t\t\t// ...except when executing function values\n\t\t\t} else {\n\t\t\t\tbulk = fn;\n\t\t\t\tfn = function( elem, _key, value ) {\n\t\t\t\t\treturn bulk.call( jQuery( elem ), value );\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\tif ( fn ) {\n\t\t\tfor ( ; i < len; i++ ) {\n\t\t\t\tfn(\n\t\t\t\t\telems[ i ], key, raw ?\n\t\t\t\t\t\tvalue :\n\t\t\t\t\t\tvalue.call( elems[ i ], i, fn( elems[ i ], key ) )\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( chainable ) {\n\t\treturn elems;\n\t}\n\n\t// Gets\n\tif ( bulk ) {\n\t\treturn fn.call( elems );\n\t}\n\n\treturn len ? fn( elems[ 0 ], key ) : emptyGet;\n};\n\n\n// Matches dashed string for camelizing\nvar rmsPrefix = /^-ms-/,\n\trdashAlpha = /-([a-z])/g;\n\n// Used by camelCase as callback to replace()\nfunction fcamelCase( _all, letter ) {\n\treturn letter.toUpperCase();\n}\n\n// Convert dashed to camelCase; used by the css and data modules\n// Support: IE <=9 - 11, Edge 12 - 15\n// Microsoft forgot to hump their vendor prefix (trac-9572)\nfunction camelCase( string ) {\n\treturn string.replace( rmsPrefix, \"ms-\" ).replace( rdashAlpha, fcamelCase );\n}\nvar acceptData = function( owner ) {\n\n\t// Accepts only:\n\t//  - Node\n\t//    - Node.ELEMENT_NODE\n\t//    - Node.DOCUMENT_NODE\n\t//  - Object\n\t//    - Any\n\treturn owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType );\n};\n\n\n\n\nfunction Data() {\n\tthis.expando = jQuery.expando + Data.uid++;\n}\n\nData.uid = 1;\n\nData.prototype = {\n\n\tcache: function( owner ) {\n\n\t\t// Check if the owner object already has a cache\n\t\tvar value = owner[ this.expando ];\n\n\t\t// If not, create one\n\t\tif ( !value ) {\n\t\t\tvalue = {};\n\n\t\t\t// We can accept data for non-element nodes in modern browsers,\n\t\t\t// but we should not, see trac-8335.\n\t\t\t// Always return an empty object.\n\t\t\tif ( acceptData( owner ) ) {\n\n\t\t\t\t// If it is a node unlikely to be stringify-ed or looped over\n\t\t\t\t// use plain assignment\n\t\t\t\tif ( owner.nodeType ) {\n\t\t\t\t\towner[ this.expando ] = value;\n\n\t\t\t\t// Otherwise secure it in a non-enumerable property\n\t\t\t\t// configurable must be true to allow the property to be\n\t\t\t\t// deleted when data is removed\n\t\t\t\t} else {\n\t\t\t\t\tObject.defineProperty( owner, this.expando, {\n\t\t\t\t\t\tvalue: value,\n\t\t\t\t\t\tconfigurable: true\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn value;\n\t},\n\tset: function( owner, data, value ) {\n\t\tvar prop,\n\t\t\tcache = this.cache( owner );\n\n\t\t// Handle: [ owner, key, value ] args\n\t\t// Always use camelCase key (gh-2257)\n\t\tif ( typeof data === \"string\" ) {\n\t\t\tcache[ camelCase( data ) ] = value;\n\n\t\t// Handle: [ owner, { properties } ] args\n\t\t} else {\n\n\t\t\t// Copy the properties one-by-one to the cache object\n\t\t\tfor ( prop in data ) {\n\t\t\t\tcache[ camelCase( prop ) ] = data[ prop ];\n\t\t\t}\n\t\t}\n\t\treturn cache;\n\t},\n\tget: function( owner, key ) {\n\t\treturn key === undefined ?\n\t\t\tthis.cache( owner ) :\n\n\t\t\t// Always use camelCase key (gh-2257)\n\t\t\towner[ this.expando ] && owner[ this.expando ][ camelCase( key ) ];\n\t},\n\taccess: function( owner, key, value ) {\n\n\t\t// In cases where either:\n\t\t//\n\t\t//   1. No key was specified\n\t\t//   2. A string key was specified, but no value provided\n\t\t//\n\t\t// Take the \"read\" path and allow the get method to determine\n\t\t// which value to return, respectively either:\n\t\t//\n\t\t//   1. The entire cache object\n\t\t//   2. The data stored at the key\n\t\t//\n\t\tif ( key === undefined ||\n\t\t\t\t( ( key && typeof key === \"string\" ) && value === undefined ) ) {\n\n\t\t\treturn this.get( owner, key );\n\t\t}\n\n\t\t// When the key is not a string, or both a key and value\n\t\t// are specified, set or extend (existing objects) with either:\n\t\t//\n\t\t//   1. An object of properties\n\t\t//   2. A key and value\n\t\t//\n\t\tthis.set( owner, key, value );\n\n\t\t// Since the \"set\" path can have two possible entry points\n\t\t// return the expected data based on which path was taken[*]\n\t\treturn value !== undefined ? value : key;\n\t},\n\tremove: function( owner, key ) {\n\t\tvar i,\n\t\t\tcache = owner[ this.expando ];\n\n\t\tif ( cache === undefined ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( key !== undefined ) {\n\n\t\t\t// Support array or space separated string of keys\n\t\t\tif ( Array.isArray( key ) ) {\n\n\t\t\t\t// If key is an array of keys...\n\t\t\t\t// We always set camelCase keys, so remove that.\n\t\t\t\tkey = key.map( camelCase );\n\t\t\t} else {\n\t\t\t\tkey = camelCase( key );\n\n\t\t\t\t// If a key with the spaces exists, use it.\n\t\t\t\t// Otherwise, create an array by matching non-whitespace\n\t\t\t\tkey = key in cache ?\n\t\t\t\t\t[ key ] :\n\t\t\t\t\t( key.match( rnothtmlwhite ) || [] );\n\t\t\t}\n\n\t\t\ti = key.length;\n\n\t\t\twhile ( i-- ) {\n\t\t\t\tdelete cache[ key[ i ] ];\n\t\t\t}\n\t\t}\n\n\t\t// Remove the expando if there's no more data\n\t\tif ( key === undefined || jQuery.isEmptyObject( cache ) ) {\n\n\t\t\t// Support: Chrome <=35 - 45\n\t\t\t// Webkit & Blink performance suffers when deleting properties\n\t\t\t// from DOM nodes, so set to undefined instead\n\t\t\t// https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted)\n\t\t\tif ( owner.nodeType ) {\n\t\t\t\towner[ this.expando ] = undefined;\n\t\t\t} else {\n\t\t\t\tdelete owner[ this.expando ];\n\t\t\t}\n\t\t}\n\t},\n\thasData: function( owner ) {\n\t\tvar cache = owner[ this.expando ];\n\t\treturn cache !== undefined && !jQuery.isEmptyObject( cache );\n\t}\n};\nvar dataPriv = new Data();\n\nvar dataUser = new Data();\n\n\n\n//\tImplementation Summary\n//\n//\t1. Enforce API surface and semantic compatibility with 1.9.x branch\n//\t2. Improve the module's maintainability by reducing the storage\n//\t\tpaths to a single mechanism.\n//\t3. Use the same single mechanism to support \"private\" and \"user\" data.\n//\t4. _Never_ expose \"private\" data to user code (TODO: Drop _data, _removeData)\n//\t5. Avoid exposing implementation details on user objects (eg. expando properties)\n//\t6. Provide a clear path for implementation upgrade to WeakMap in 2014\n\nvar rbrace = /^(?:\\{[\\w\\W]*\\}|\\[[\\w\\W]*\\])$/,\n\trmultiDash = /[A-Z]/g;\n\nfunction getData( data ) {\n\tif ( data === \"true\" ) {\n\t\treturn true;\n\t}\n\n\tif ( data === \"false\" ) {\n\t\treturn false;\n\t}\n\n\tif ( data === \"null\" ) {\n\t\treturn null;\n\t}\n\n\t// Only convert to a number if it doesn't change the string\n\tif ( data === +data + \"\" ) {\n\t\treturn +data;\n\t}\n\n\tif ( rbrace.test( data ) ) {\n\t\treturn JSON.parse( data );\n\t}\n\n\treturn data;\n}\n\nfunction dataAttr( elem, key, data ) {\n\tvar name;\n\n\t// If nothing was found internally, try to fetch any\n\t// data from the HTML5 data-* attribute\n\tif ( data === undefined && elem.nodeType === 1 ) {\n\t\tname = \"data-\" + key.replace( rmultiDash, \"-$&\" ).toLowerCase();\n\t\tdata = elem.getAttribute( name );\n\n\t\tif ( typeof data === \"string\" ) {\n\t\t\ttry {\n\t\t\t\tdata = getData( data );\n\t\t\t} catch ( e ) {}\n\n\t\t\t// Make sure we set the data so it isn't changed later\n\t\t\tdataUser.set( elem, key, data );\n\t\t} else {\n\t\t\tdata = undefined;\n\t\t}\n\t}\n\treturn data;\n}\n\njQuery.extend( {\n\thasData: function( elem ) {\n\t\treturn dataUser.hasData( elem ) || dataPriv.hasData( elem );\n\t},\n\n\tdata: function( elem, name, data ) {\n\t\treturn dataUser.access( elem, name, data );\n\t},\n\n\tremoveData: function( elem, name ) {\n\t\tdataUser.remove( elem, name );\n\t},\n\n\t// TODO: Now that all calls to _data and _removeData have been replaced\n\t// with direct calls to dataPriv methods, these can be deprecated.\n\t_data: function( elem, name, data ) {\n\t\treturn dataPriv.access( elem, name, data );\n\t},\n\n\t_removeData: function( elem, name ) {\n\t\tdataPriv.remove( elem, name );\n\t}\n} );\n\njQuery.fn.extend( {\n\tdata: function( key, value ) {\n\t\tvar i, name, data,\n\t\t\telem = this[ 0 ],\n\t\t\tattrs = elem && elem.attributes;\n\n\t\t// Gets all values\n\t\tif ( key === undefined ) {\n\t\t\tif ( this.length ) {\n\t\t\t\tdata = dataUser.get( elem );\n\n\t\t\t\tif ( elem.nodeType === 1 && !dataPriv.get( elem, \"hasDataAttrs\" ) ) {\n\t\t\t\t\ti = attrs.length;\n\t\t\t\t\twhile ( i-- ) {\n\n\t\t\t\t\t\t// Support: IE 11 only\n\t\t\t\t\t\t// The attrs elements can be null (trac-14894)\n\t\t\t\t\t\tif ( attrs[ i ] ) {\n\t\t\t\t\t\t\tname = attrs[ i ].name;\n\t\t\t\t\t\t\tif ( name.indexOf( \"data-\" ) === 0 ) {\n\t\t\t\t\t\t\t\tname = camelCase( name.slice( 5 ) );\n\t\t\t\t\t\t\t\tdataAttr( elem, name, data[ name ] );\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\tdataPriv.set( elem, \"hasDataAttrs\", true );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn data;\n\t\t}\n\n\t\t// Sets multiple values\n\t\tif ( typeof key === \"object\" ) {\n\t\t\treturn this.each( function() {\n\t\t\t\tdataUser.set( this, key );\n\t\t\t} );\n\t\t}\n\n\t\treturn access( this, function( value ) {\n\t\t\tvar data;\n\n\t\t\t// The calling jQuery object (element matches) is not empty\n\t\t\t// (and therefore has an element appears at this[ 0 ]) and the\n\t\t\t// `value` parameter was not undefined. An empty jQuery object\n\t\t\t// will result in `undefined` for elem = this[ 0 ] which will\n\t\t\t// throw an exception if an attempt to read a data cache is made.\n\t\t\tif ( elem && value === undefined ) {\n\n\t\t\t\t// Attempt to get data from the cache\n\t\t\t\t// The key will always be camelCased in Data\n\t\t\t\tdata = dataUser.get( elem, key );\n\t\t\t\tif ( data !== undefined ) {\n\t\t\t\t\treturn data;\n\t\t\t\t}\n\n\t\t\t\t// Attempt to \"discover\" the data in\n\t\t\t\t// HTML5 custom data-* attrs\n\t\t\t\tdata = dataAttr( elem, key );\n\t\t\t\tif ( data !== undefined ) {\n\t\t\t\t\treturn data;\n\t\t\t\t}\n\n\t\t\t\t// We tried really hard, but the data doesn't exist.\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Set the data...\n\t\t\tthis.each( function() {\n\n\t\t\t\t// We always store the camelCased key\n\t\t\t\tdataUser.set( this, key, value );\n\t\t\t} );\n\t\t}, null, value, arguments.length > 1, null, true );\n\t},\n\n\tremoveData: function( key ) {\n\t\treturn this.each( function() {\n\t\t\tdataUser.remove( this, key );\n\t\t} );\n\t}\n} );\n\n\njQuery.extend( {\n\tqueue: function( elem, type, data ) {\n\t\tvar queue;\n\n\t\tif ( elem ) {\n\t\t\ttype = ( type || \"fx\" ) + \"queue\";\n\t\t\tqueue = dataPriv.get( elem, type );\n\n\t\t\t// Speed up dequeue by getting out quickly if this is just a lookup\n\t\t\tif ( data ) {\n\t\t\t\tif ( !queue || Array.isArray( data ) ) {\n\t\t\t\t\tqueue = dataPriv.access( elem, type, jQuery.makeArray( data ) );\n\t\t\t\t} else {\n\t\t\t\t\tqueue.push( data );\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn queue || [];\n\t\t}\n\t},\n\n\tdequeue: function( elem, type ) {\n\t\ttype = type || \"fx\";\n\n\t\tvar queue = jQuery.queue( elem, type ),\n\t\t\tstartLength = queue.length,\n\t\t\tfn = queue.shift(),\n\t\t\thooks = jQuery._queueHooks( elem, type ),\n\t\t\tnext = function() {\n\t\t\t\tjQuery.dequeue( elem, type );\n\t\t\t};\n\n\t\t// If the fx queue is dequeued, always remove the progress sentinel\n\t\tif ( fn === \"inprogress\" ) {\n\t\t\tfn = queue.shift();\n\t\t\tstartLength--;\n\t\t}\n\n\t\tif ( fn ) {\n\n\t\t\t// Add a progress sentinel to prevent the fx queue from being\n\t\t\t// automatically dequeued\n\t\t\tif ( type === \"fx\" ) {\n\t\t\t\tqueue.unshift( \"inprogress\" );\n\t\t\t}\n\n\t\t\t// Clear up the last queue stop function\n\t\t\tdelete hooks.stop;\n\t\t\tfn.call( elem, next, hooks );\n\t\t}\n\n\t\tif ( !startLength && hooks ) {\n\t\t\thooks.empty.fire();\n\t\t}\n\t},\n\n\t// Not public - generate a queueHooks object, or return the current one\n\t_queueHooks: function( elem, type ) {\n\t\tvar key = type + \"queueHooks\";\n\t\treturn dataPriv.get( elem, key ) || dataPriv.access( elem, key, {\n\t\t\tempty: jQuery.Callbacks( \"once memory\" ).add( function() {\n\t\t\t\tdataPriv.remove( elem, [ type + \"queue\", key ] );\n\t\t\t} )\n\t\t} );\n\t}\n} );\n\njQuery.fn.extend( {\n\tqueue: function( type, data ) {\n\t\tvar setter = 2;\n\n\t\tif ( typeof type !== \"string\" ) {\n\t\t\tdata = type;\n\t\t\ttype = \"fx\";\n\t\t\tsetter--;\n\t\t}\n\n\t\tif ( arguments.length < setter ) {\n\t\t\treturn jQuery.queue( this[ 0 ], type );\n\t\t}\n\n\t\treturn data === undefined ?\n\t\t\tthis :\n\t\t\tthis.each( function() {\n\t\t\t\tvar queue = jQuery.queue( this, type, data );\n\n\t\t\t\t// Ensure a hooks for this queue\n\t\t\t\tjQuery._queueHooks( this, type );\n\n\t\t\t\tif ( type === \"fx\" && queue[ 0 ] !== \"inprogress\" ) {\n\t\t\t\t\tjQuery.dequeue( this, type );\n\t\t\t\t}\n\t\t\t} );\n\t},\n\tdequeue: function( type ) {\n\t\treturn this.each( function() {\n\t\t\tjQuery.dequeue( this, type );\n\t\t} );\n\t},\n\tclearQueue: function( type ) {\n\t\treturn this.queue( type || \"fx\", [] );\n\t},\n\n\t// Get a promise resolved when queues of a certain type\n\t// are emptied (fx is the type by default)\n\tpromise: function( type, obj ) {\n\t\tvar tmp,\n\t\t\tcount = 1,\n\t\t\tdefer = jQuery.Deferred(),\n\t\t\telements = this,\n\t\t\ti = this.length,\n\t\t\tresolve = function() {\n\t\t\t\tif ( !( --count ) ) {\n\t\t\t\t\tdefer.resolveWith( elements, [ elements ] );\n\t\t\t\t}\n\t\t\t};\n\n\t\tif ( typeof type !== \"string\" ) {\n\t\t\tobj = type;\n\t\t\ttype = undefined;\n\t\t}\n\t\ttype = type || \"fx\";\n\n\t\twhile ( i-- ) {\n\t\t\ttmp = dataPriv.get( elements[ i ], type + \"queueHooks\" );\n\t\t\tif ( tmp && tmp.empty ) {\n\t\t\t\tcount++;\n\t\t\t\ttmp.empty.add( resolve );\n\t\t\t}\n\t\t}\n\t\tresolve();\n\t\treturn defer.promise( obj );\n\t}\n} );\nvar pnum = ( /[+-]?(?:\\d*\\.|)\\d+(?:[eE][+-]?\\d+|)/ ).source;\n\nvar rcssNum = new RegExp( \"^(?:([+-])=|)(\" + pnum + \")([a-z%]*)$\", \"i\" );\n\n\nvar cssExpand = [ \"Top\", \"Right\", \"Bottom\", \"Left\" ];\n\nvar documentElement = document.documentElement;\n\n\n\n\tvar isAttached = function( elem ) {\n\t\t\treturn jQuery.contains( elem.ownerDocument, elem );\n\t\t},\n\t\tcomposed = { composed: true };\n\n\t// Support: IE 9 - 11+, Edge 12 - 18+, iOS 10.0 - 10.2 only\n\t// Check attachment across shadow DOM boundaries when possible (gh-3504)\n\t// Support: iOS 10.0-10.2 only\n\t// Early iOS 10 versions support `attachShadow` but not `getRootNode`,\n\t// leading to errors. We need to check for `getRootNode`.\n\tif ( documentElement.getRootNode ) {\n\t\tisAttached = function( elem ) {\n\t\t\treturn jQuery.contains( elem.ownerDocument, elem ) ||\n\t\t\t\telem.getRootNode( composed ) === elem.ownerDocument;\n\t\t};\n\t}\nvar isHiddenWithinTree = function( elem, el ) {\n\n\t\t// isHiddenWithinTree might be called from jQuery#filter function;\n\t\t// in that case, element will be second argument\n\t\telem = el || elem;\n\n\t\t// Inline style trumps all\n\t\treturn elem.style.display === \"none\" ||\n\t\t\telem.style.display === \"\" &&\n\n\t\t\t// Otherwise, check computed style\n\t\t\t// Support: Firefox <=43 - 45\n\t\t\t// Disconnected elements can have computed display: none, so first confirm that elem is\n\t\t\t// in the document.\n\t\t\tisAttached( elem ) &&\n\n\t\t\tjQuery.css( elem, \"display\" ) === \"none\";\n\t};\n\n\n\nfunction adjustCSS( elem, prop, valueParts, tween ) {\n\tvar adjusted, scale,\n\t\tmaxIterations = 20,\n\t\tcurrentValue = tween ?\n\t\t\tfunction() {\n\t\t\t\treturn tween.cur();\n\t\t\t} :\n\t\t\tfunction() {\n\t\t\t\treturn jQuery.css( elem, prop, \"\" );\n\t\t\t},\n\t\tinitial = currentValue(),\n\t\tunit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? \"\" : \"px\" ),\n\n\t\t// Starting value computation is required for potential unit mismatches\n\t\tinitialInUnit = elem.nodeType &&\n\t\t\t( jQuery.cssNumber[ prop ] || unit !== \"px\" && +initial ) &&\n\t\t\trcssNum.exec( jQuery.css( elem, prop ) );\n\n\tif ( initialInUnit && initialInUnit[ 3 ] !== unit ) {\n\n\t\t// Support: Firefox <=54\n\t\t// Halve the iteration target value to prevent interference from CSS upper bounds (gh-2144)\n\t\tinitial = initial / 2;\n\n\t\t// Trust units reported by jQuery.css\n\t\tunit = unit || initialInUnit[ 3 ];\n\n\t\t// Iteratively approximate from a nonzero starting point\n\t\tinitialInUnit = +initial || 1;\n\n\t\twhile ( maxIterations-- ) {\n\n\t\t\t// Evaluate and update our best guess (doubling guesses that zero out).\n\t\t\t// Finish if the scale equals or crosses 1 (making the old*new product non-positive).\n\t\t\tjQuery.style( elem, prop, initialInUnit + unit );\n\t\t\tif ( ( 1 - scale ) * ( 1 - ( scale = currentValue() / initial || 0.5 ) ) <= 0 ) {\n\t\t\t\tmaxIterations = 0;\n\t\t\t}\n\t\t\tinitialInUnit = initialInUnit / scale;\n\n\t\t}\n\n\t\tinitialInUnit = initialInUnit * 2;\n\t\tjQuery.style( elem, prop, initialInUnit + unit );\n\n\t\t// Make sure we update the tween properties later on\n\t\tvalueParts = valueParts || [];\n\t}\n\n\tif ( valueParts ) {\n\t\tinitialInUnit = +initialInUnit || +initial || 0;\n\n\t\t// Apply relative offset (+=/-=) if specified\n\t\tadjusted = valueParts[ 1 ] ?\n\t\t\tinitialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] :\n\t\t\t+valueParts[ 2 ];\n\t\tif ( tween ) {\n\t\t\ttween.unit = unit;\n\t\t\ttween.start = initialInUnit;\n\t\t\ttween.end = adjusted;\n\t\t}\n\t}\n\treturn adjusted;\n}\n\n\nvar defaultDisplayMap = {};\n\nfunction getDefaultDisplay( elem ) {\n\tvar temp,\n\t\tdoc = elem.ownerDocument,\n\t\tnodeName = elem.nodeName,\n\t\tdisplay = defaultDisplayMap[ nodeName ];\n\n\tif ( display ) {\n\t\treturn display;\n\t}\n\n\ttemp = doc.body.appendChild( doc.createElement( nodeName ) );\n\tdisplay = jQuery.css( temp, \"display\" );\n\n\ttemp.parentNode.removeChild( temp );\n\n\tif ( display === \"none\" ) {\n\t\tdisplay = \"block\";\n\t}\n\tdefaultDisplayMap[ nodeName ] = display;\n\n\treturn display;\n}\n\nfunction showHide( elements, show ) {\n\tvar display, elem,\n\t\tvalues = [],\n\t\tindex = 0,\n\t\tlength = elements.length;\n\n\t// Determine new display value for elements that need to change\n\tfor ( ; index < length; index++ ) {\n\t\telem = elements[ index ];\n\t\tif ( !elem.style ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tdisplay = elem.style.display;\n\t\tif ( show ) {\n\n\t\t\t// Since we force visibility upon cascade-hidden elements, an immediate (and slow)\n\t\t\t// check is required in this first loop unless we have a nonempty display value (either\n\t\t\t// inline or about-to-be-restored)\n\t\t\tif ( display === \"none\" ) {\n\t\t\t\tvalues[ index ] = dataPriv.get( elem, \"display\" ) || null;\n\t\t\t\tif ( !values[ index ] ) {\n\t\t\t\t\telem.style.display = \"\";\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( elem.style.display === \"\" && isHiddenWithinTree( elem ) ) {\n\t\t\t\tvalues[ index ] = getDefaultDisplay( elem );\n\t\t\t}\n\t\t} else {\n\t\t\tif ( display !== \"none\" ) {\n\t\t\t\tvalues[ index ] = \"none\";\n\n\t\t\t\t// Remember what we're overwriting\n\t\t\t\tdataPriv.set( elem, \"display\", display );\n\t\t\t}\n\t\t}\n\t}\n\n\t// Set the display of the elements in a second loop to avoid constant reflow\n\tfor ( index = 0; index < length; index++ ) {\n\t\tif ( values[ index ] != null ) {\n\t\t\telements[ index ].style.display = values[ index ];\n\t\t}\n\t}\n\n\treturn elements;\n}\n\njQuery.fn.extend( {\n\tshow: function() {\n\t\treturn showHide( this, true );\n\t},\n\thide: function() {\n\t\treturn showHide( this );\n\t},\n\ttoggle: function( state ) {\n\t\tif ( typeof state === \"boolean\" ) {\n\t\t\treturn state ? this.show() : this.hide();\n\t\t}\n\n\t\treturn this.each( function() {\n\t\t\tif ( isHiddenWithinTree( this ) ) {\n\t\t\t\tjQuery( this ).show();\n\t\t\t} else {\n\t\t\t\tjQuery( this ).hide();\n\t\t\t}\n\t\t} );\n\t}\n} );\nvar rcheckableType = ( /^(?:checkbox|radio)$/i );\n\nvar rtagName = ( /<([a-z][^\\/\\0>\\x20\\t\\r\\n\\f]*)/i );\n\nvar rscriptType = ( /^$|^module$|\\/(?:java|ecma)script/i );\n\n\n\n( function() {\n\tvar fragment = document.createDocumentFragment(),\n\t\tdiv = fragment.appendChild( document.createElement( \"div\" ) ),\n\t\tinput = document.createElement( \"input\" );\n\n\t// Support: Android 4.0 - 4.3 only\n\t// Check state lost if the name is set (trac-11217)\n\t// Support: Windows Web Apps (WWA)\n\t// `name` and `type` must use .setAttribute for WWA (trac-14901)\n\tinput.setAttribute( \"type\", \"radio\" );\n\tinput.setAttribute( \"checked\", \"checked\" );\n\tinput.setAttribute( \"name\", \"t\" );\n\n\tdiv.appendChild( input );\n\n\t// Support: Android <=4.1 only\n\t// Older WebKit doesn't clone checked state correctly in fragments\n\tsupport.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;\n\n\t// Support: IE <=11 only\n\t// Make sure textarea (and checkbox) defaultValue is properly cloned\n\tdiv.innerHTML = \"<textarea>x</textarea>\";\n\tsupport.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;\n\n\t// Support: IE <=9 only\n\t// IE <=9 replaces <option> tags with their contents when inserted outside of\n\t// the select element.\n\tdiv.innerHTML = \"<option></option>\";\n\tsupport.option = !!div.lastChild;\n} )();\n\n\n// We have to close these tags to support XHTML (trac-13200)\nvar wrapMap = {\n\n\t// XHTML parsers do not magically insert elements in the\n\t// same way that tag soup parsers do. So we cannot shorten\n\t// this by omitting <tbody> or other required elements.\n\tthead: [ 1, \"<table>\", \"</table>\" ],\n\tcol: [ 2, \"<table><colgroup>\", \"</colgroup></table>\" ],\n\ttr: [ 2, \"<table><tbody>\", \"</tbody></table>\" ],\n\ttd: [ 3, \"<table><tbody><tr>\", \"</tr></tbody></table>\" ],\n\n\t_default: [ 0, \"\", \"\" ]\n};\n\nwrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;\nwrapMap.th = wrapMap.td;\n\n// Support: IE <=9 only\nif ( !support.option ) {\n\twrapMap.optgroup = wrapMap.option = [ 1, \"<select multiple='multiple'>\", \"</select>\" ];\n}\n\n\nfunction getAll( context, tag ) {\n\n\t// Support: IE <=9 - 11 only\n\t// Use typeof to avoid zero-argument method invocation on host objects (trac-15151)\n\tvar ret;\n\n\tif ( typeof context.getElementsByTagName !== \"undefined\" ) {\n\t\tret = context.getElementsByTagName( tag || \"*\" );\n\n\t} else if ( typeof context.querySelectorAll !== \"undefined\" ) {\n\t\tret = context.querySelectorAll( tag || \"*\" );\n\n\t} else {\n\t\tret = [];\n\t}\n\n\tif ( tag === undefined || tag && nodeName( context, tag ) ) {\n\t\treturn jQuery.merge( [ context ], ret );\n\t}\n\n\treturn ret;\n}\n\n\n// Mark scripts as having already been evaluated\nfunction setGlobalEval( elems, refElements ) {\n\tvar i = 0,\n\t\tl = elems.length;\n\n\tfor ( ; i < l; i++ ) {\n\t\tdataPriv.set(\n\t\t\telems[ i ],\n\t\t\t\"globalEval\",\n\t\t\t!refElements || dataPriv.get( refElements[ i ], \"globalEval\" )\n\t\t);\n\t}\n}\n\n\nvar rhtml = /<|&#?\\w+;/;\n\nfunction buildFragment( elems, context, scripts, selection, ignored ) {\n\tvar elem, tmp, tag, wrap, attached, j,\n\t\tfragment = context.createDocumentFragment(),\n\t\tnodes = [],\n\t\ti = 0,\n\t\tl = elems.length;\n\n\tfor ( ; i < l; i++ ) {\n\t\telem = elems[ i ];\n\n\t\tif ( elem || elem === 0 ) {\n\n\t\t\t// Add nodes directly\n\t\t\tif ( toType( elem ) === \"object\" ) {\n\n\t\t\t\t// Support: Android <=4.0 only, PhantomJS 1 only\n\t\t\t\t// push.apply(_, arraylike) throws on ancient WebKit\n\t\t\t\tjQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );\n\n\t\t\t// Convert non-html into a text node\n\t\t\t} else if ( !rhtml.test( elem ) ) {\n\t\t\t\tnodes.push( context.createTextNode( elem ) );\n\n\t\t\t// Convert html into DOM nodes\n\t\t\t} else {\n\t\t\t\ttmp = tmp || fragment.appendChild( context.createElement( \"div\" ) );\n\n\t\t\t\t// Deserialize a standard representation\n\t\t\t\ttag = ( rtagName.exec( elem ) || [ \"\", \"\" ] )[ 1 ].toLowerCase();\n\t\t\t\twrap = wrapMap[ tag ] || wrapMap._default;\n\t\t\t\ttmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ];\n\n\t\t\t\t// Descend through wrappers to the right content\n\t\t\t\tj = wrap[ 0 ];\n\t\t\t\twhile ( j-- ) {\n\t\t\t\t\ttmp = tmp.lastChild;\n\t\t\t\t}\n\n\t\t\t\t// Support: Android <=4.0 only, PhantomJS 1 only\n\t\t\t\t// push.apply(_, arraylike) throws on ancient WebKit\n\t\t\t\tjQuery.merge( nodes, tmp.childNodes );\n\n\t\t\t\t// Remember the top-level container\n\t\t\t\ttmp = fragment.firstChild;\n\n\t\t\t\t// Ensure the created nodes are orphaned (trac-12392)\n\t\t\t\ttmp.textContent = \"\";\n\t\t\t}\n\t\t}\n\t}\n\n\t// Remove wrapper from fragment\n\tfragment.textContent = \"\";\n\n\ti = 0;\n\twhile ( ( elem = nodes[ i++ ] ) ) {\n\n\t\t// Skip elements already in the context collection (trac-4087)\n\t\tif ( selection && jQuery.inArray( elem, selection ) > -1 ) {\n\t\t\tif ( ignored ) {\n\t\t\t\tignored.push( elem );\n\t\t\t}\n\t\t\tcontinue;\n\t\t}\n\n\t\tattached = isAttached( elem );\n\n\t\t// Append to fragment\n\t\ttmp = getAll( fragment.appendChild( elem ), \"script\" );\n\n\t\t// Preserve script evaluation history\n\t\tif ( attached ) {\n\t\t\tsetGlobalEval( tmp );\n\t\t}\n\n\t\t// Capture executables\n\t\tif ( scripts ) {\n\t\t\tj = 0;\n\t\t\twhile ( ( elem = tmp[ j++ ] ) ) {\n\t\t\t\tif ( rscriptType.test( elem.type || \"\" ) ) {\n\t\t\t\t\tscripts.push( elem );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn fragment;\n}\n\n\nvar rtypenamespace = /^([^.]*)(?:\\.(.+)|)/;\n\nfunction returnTrue() {\n\treturn true;\n}\n\nfunction returnFalse() {\n\treturn false;\n}\n\nfunction on( elem, types, selector, data, fn, one ) {\n\tvar origFn, type;\n\n\t// Types can be a map of types/handlers\n\tif ( typeof types === \"object\" ) {\n\n\t\t// ( types-Object, selector, data )\n\t\tif ( typeof selector !== \"string\" ) {\n\n\t\t\t// ( types-Object, data )\n\t\t\tdata = data || selector;\n\t\t\tselector = undefined;\n\t\t}\n\t\tfor ( type in types ) {\n\t\t\ton( elem, type, selector, data, types[ type ], one );\n\t\t}\n\t\treturn elem;\n\t}\n\n\tif ( data == null && fn == null ) {\n\n\t\t// ( types, fn )\n\t\tfn = selector;\n\t\tdata = selector = undefined;\n\t} else if ( fn == null ) {\n\t\tif ( typeof selector === \"string\" ) {\n\n\t\t\t// ( types, selector, fn )\n\t\t\tfn = data;\n\t\t\tdata = undefined;\n\t\t} else {\n\n\t\t\t// ( types, data, fn )\n\t\t\tfn = data;\n\t\t\tdata = selector;\n\t\t\tselector = undefined;\n\t\t}\n\t}\n\tif ( fn === false ) {\n\t\tfn = returnFalse;\n\t} else if ( !fn ) {\n\t\treturn elem;\n\t}\n\n\tif ( one === 1 ) {\n\t\torigFn = fn;\n\t\tfn = function( event ) {\n\n\t\t\t// Can use an empty set, since event contains the info\n\t\t\tjQuery().off( event );\n\t\t\treturn origFn.apply( this, arguments );\n\t\t};\n\n\t\t// Use same guid so caller can remove using origFn\n\t\tfn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );\n\t}\n\treturn elem.each( function() {\n\t\tjQuery.event.add( this, types, fn, data, selector );\n\t} );\n}\n\n/*\n * Helper functions for managing events -- not part of the public interface.\n * Props to Dean Edwards' addEvent library for many of the ideas.\n */\njQuery.event = {\n\n\tglobal: {},\n\n\tadd: function( elem, types, handler, data, selector ) {\n\n\t\tvar handleObjIn, eventHandle, tmp,\n\t\t\tevents, t, handleObj,\n\t\t\tspecial, handlers, type, namespaces, origType,\n\t\t\telemData = dataPriv.get( elem );\n\n\t\t// Only attach events to objects that accept data\n\t\tif ( !acceptData( elem ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Caller can pass in an object of custom data in lieu of the handler\n\t\tif ( handler.handler ) {\n\t\t\thandleObjIn = handler;\n\t\t\thandler = handleObjIn.handler;\n\t\t\tselector = handleObjIn.selector;\n\t\t}\n\n\t\t// Ensure that invalid selectors throw exceptions at attach time\n\t\t// Evaluate against documentElement in case elem is a non-element node (e.g., document)\n\t\tif ( selector ) {\n\t\t\tjQuery.find.matchesSelector( documentElement, selector );\n\t\t}\n\n\t\t// Make sure that the handler has a unique ID, used to find/remove it later\n\t\tif ( !handler.guid ) {\n\t\t\thandler.guid = jQuery.guid++;\n\t\t}\n\n\t\t// Init the element's event structure and main handler, if this is the first\n\t\tif ( !( events = elemData.events ) ) {\n\t\t\tevents = elemData.events = Object.create( null );\n\t\t}\n\t\tif ( !( eventHandle = elemData.handle ) ) {\n\t\t\teventHandle = elemData.handle = function( e ) {\n\n\t\t\t\t// Discard the second event of a jQuery.event.trigger() and\n\t\t\t\t// when an event is called after a page has unloaded\n\t\t\t\treturn typeof jQuery !== \"undefined\" && jQuery.event.triggered !== e.type ?\n\t\t\t\t\tjQuery.event.dispatch.apply( elem, arguments ) : undefined;\n\t\t\t};\n\t\t}\n\n\t\t// Handle multiple events separated by a space\n\t\ttypes = ( types || \"\" ).match( rnothtmlwhite ) || [ \"\" ];\n\t\tt = types.length;\n\t\twhile ( t-- ) {\n\t\t\ttmp = rtypenamespace.exec( types[ t ] ) || [];\n\t\t\ttype = origType = tmp[ 1 ];\n\t\t\tnamespaces = ( tmp[ 2 ] || \"\" ).split( \".\" ).sort();\n\n\t\t\t// There *must* be a type, no attaching namespace-only handlers\n\t\t\tif ( !type ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// If event changes its type, use the special event handlers for the changed type\n\t\t\tspecial = jQuery.event.special[ type ] || {};\n\n\t\t\t// If selector defined, determine special event api type, otherwise given type\n\t\t\ttype = ( selector ? special.delegateType : special.bindType ) || type;\n\n\t\t\t// Update special based on newly reset type\n\t\t\tspecial = jQuery.event.special[ type ] || {};\n\n\t\t\t// handleObj is passed to all event handlers\n\t\t\thandleObj = jQuery.extend( {\n\t\t\t\ttype: type,\n\t\t\t\torigType: origType,\n\t\t\t\tdata: data,\n\t\t\t\thandler: handler,\n\t\t\t\tguid: handler.guid,\n\t\t\t\tselector: selector,\n\t\t\t\tneedsContext: selector && jQuery.expr.match.needsContext.test( selector ),\n\t\t\t\tnamespace: namespaces.join( \".\" )\n\t\t\t}, handleObjIn );\n\n\t\t\t// Init the event handler queue if we're the first\n\t\t\tif ( !( handlers = events[ type ] ) ) {\n\t\t\t\thandlers = events[ type ] = [];\n\t\t\t\thandlers.delegateCount = 0;\n\n\t\t\t\t// Only use addEventListener if the special events handler returns false\n\t\t\t\tif ( !special.setup ||\n\t\t\t\t\tspecial.setup.call( elem, data, namespaces, eventHandle ) === false ) {\n\n\t\t\t\t\tif ( elem.addEventListener ) {\n\t\t\t\t\t\telem.addEventListener( type, eventHandle );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( special.add ) {\n\t\t\t\tspecial.add.call( elem, handleObj );\n\n\t\t\t\tif ( !handleObj.handler.guid ) {\n\t\t\t\t\thandleObj.handler.guid = handler.guid;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Add to the element's handler list, delegates in front\n\t\t\tif ( selector ) {\n\t\t\t\thandlers.splice( handlers.delegateCount++, 0, handleObj );\n\t\t\t} else {\n\t\t\t\thandlers.push( handleObj );\n\t\t\t}\n\n\t\t\t// Keep track of which events have ever been used, for event optimization\n\t\t\tjQuery.event.global[ type ] = true;\n\t\t}\n\n\t},\n\n\t// Detach an event or set of events from an element\n\tremove: function( elem, types, handler, selector, mappedTypes ) {\n\n\t\tvar j, origCount, tmp,\n\t\t\tevents, t, handleObj,\n\t\t\tspecial, handlers, type, namespaces, origType,\n\t\t\telemData = dataPriv.hasData( elem ) && dataPriv.get( elem );\n\n\t\tif ( !elemData || !( events = elemData.events ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Once for each type.namespace in types; type may be omitted\n\t\ttypes = ( types || \"\" ).match( rnothtmlwhite ) || [ \"\" ];\n\t\tt = types.length;\n\t\twhile ( t-- ) {\n\t\t\ttmp = rtypenamespace.exec( types[ t ] ) || [];\n\t\t\ttype = origType = tmp[ 1 ];\n\t\t\tnamespaces = ( tmp[ 2 ] || \"\" ).split( \".\" ).sort();\n\n\t\t\t// Unbind all events (on this namespace, if provided) for the element\n\t\t\tif ( !type ) {\n\t\t\t\tfor ( type in events ) {\n\t\t\t\t\tjQuery.event.remove( elem, type + types[ t ], handler, selector, true );\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tspecial = jQuery.event.special[ type ] || {};\n\t\t\ttype = ( selector ? special.delegateType : special.bindType ) || type;\n\t\t\thandlers = events[ type ] || [];\n\t\t\ttmp = tmp[ 2 ] &&\n\t\t\t\tnew RegExp( \"(^|\\\\.)\" + namespaces.join( \"\\\\.(?:.*\\\\.|)\" ) + \"(\\\\.|$)\" );\n\n\t\t\t// Remove matching events\n\t\t\torigCount = j = handlers.length;\n\t\t\twhile ( j-- ) {\n\t\t\t\thandleObj = handlers[ j ];\n\n\t\t\t\tif ( ( mappedTypes || origType === handleObj.origType ) &&\n\t\t\t\t\t( !handler || handler.guid === handleObj.guid ) &&\n\t\t\t\t\t( !tmp || tmp.test( handleObj.namespace ) ) &&\n\t\t\t\t\t( !selector || selector === handleObj.selector ||\n\t\t\t\t\t\tselector === \"**\" && handleObj.selector ) ) {\n\t\t\t\t\thandlers.splice( j, 1 );\n\n\t\t\t\t\tif ( handleObj.selector ) {\n\t\t\t\t\t\thandlers.delegateCount--;\n\t\t\t\t\t}\n\t\t\t\t\tif ( special.remove ) {\n\t\t\t\t\t\tspecial.remove.call( elem, handleObj );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Remove generic event handler if we removed something and no more handlers exist\n\t\t\t// (avoids potential for endless recursion during removal of special event handlers)\n\t\t\tif ( origCount && !handlers.length ) {\n\t\t\t\tif ( !special.teardown ||\n\t\t\t\t\tspecial.teardown.call( elem, namespaces, elemData.handle ) === false ) {\n\n\t\t\t\t\tjQuery.removeEvent( elem, type, elemData.handle );\n\t\t\t\t}\n\n\t\t\t\tdelete events[ type ];\n\t\t\t}\n\t\t}\n\n\t\t// Remove data and the expando if it's no longer used\n\t\tif ( jQuery.isEmptyObject( events ) ) {\n\t\t\tdataPriv.remove( elem, \"handle events\" );\n\t\t}\n\t},\n\n\tdispatch: function( nativeEvent ) {\n\n\t\tvar i, j, ret, matched, handleObj, handlerQueue,\n\t\t\targs = new Array( arguments.length ),\n\n\t\t\t// Make a writable jQuery.Event from the native event object\n\t\t\tevent = jQuery.event.fix( nativeEvent ),\n\n\t\t\thandlers = (\n\t\t\t\tdataPriv.get( this, \"events\" ) || Object.create( null )\n\t\t\t)[ event.type ] || [],\n\t\t\tspecial = jQuery.event.special[ event.type ] || {};\n\n\t\t// Use the fix-ed jQuery.Event rather than the (read-only) native event\n\t\targs[ 0 ] = event;\n\n\t\tfor ( i = 1; i < arguments.length; i++ ) {\n\t\t\targs[ i ] = arguments[ i ];\n\t\t}\n\n\t\tevent.delegateTarget = this;\n\n\t\t// Call the preDispatch hook for the mapped type, and let it bail if desired\n\t\tif ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Determine handlers\n\t\thandlerQueue = jQuery.event.handlers.call( this, event, handlers );\n\n\t\t// Run delegates first; they may want to stop propagation beneath us\n\t\ti = 0;\n\t\twhile ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) {\n\t\t\tevent.currentTarget = matched.elem;\n\n\t\t\tj = 0;\n\t\t\twhile ( ( handleObj = matched.handlers[ j++ ] ) &&\n\t\t\t\t!event.isImmediatePropagationStopped() ) {\n\n\t\t\t\t// If the event is namespaced, then each handler is only invoked if it is\n\t\t\t\t// specially universal or its namespaces are a superset of the event's.\n\t\t\t\tif ( !event.rnamespace || handleObj.namespace === false ||\n\t\t\t\t\tevent.rnamespace.test( handleObj.namespace ) ) {\n\n\t\t\t\t\tevent.handleObj = handleObj;\n\t\t\t\t\tevent.data = handleObj.data;\n\n\t\t\t\t\tret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle ||\n\t\t\t\t\t\thandleObj.handler ).apply( matched.elem, args );\n\n\t\t\t\t\tif ( ret !== undefined ) {\n\t\t\t\t\t\tif ( ( event.result = ret ) === false ) {\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\tevent.stopPropagation();\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\n\t\t// Call the postDispatch hook for the mapped type\n\t\tif ( special.postDispatch ) {\n\t\t\tspecial.postDispatch.call( this, event );\n\t\t}\n\n\t\treturn event.result;\n\t},\n\n\thandlers: function( event, handlers ) {\n\t\tvar i, handleObj, sel, matchedHandlers, matchedSelectors,\n\t\t\thandlerQueue = [],\n\t\t\tdelegateCount = handlers.delegateCount,\n\t\t\tcur = event.target;\n\n\t\t// Find delegate handlers\n\t\tif ( delegateCount &&\n\n\t\t\t// Support: IE <=9\n\t\t\t// Black-hole SVG <use> instance trees (trac-13180)\n\t\t\tcur.nodeType &&\n\n\t\t\t// Support: Firefox <=42\n\t\t\t// Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861)\n\t\t\t// https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click\n\t\t\t// Support: IE 11 only\n\t\t\t// ...but not arrow key \"clicks\" of radio inputs, which can have `button` -1 (gh-2343)\n\t\t\t!( event.type === \"click\" && event.button >= 1 ) ) {\n\n\t\t\tfor ( ; cur !== this; cur = cur.parentNode || this ) {\n\n\t\t\t\t// Don't check non-elements (trac-13208)\n\t\t\t\t// Don't process clicks on disabled elements (trac-6911, trac-8165, trac-11382, trac-11764)\n\t\t\t\tif ( cur.nodeType === 1 && !( event.type === \"click\" && cur.disabled === true ) ) {\n\t\t\t\t\tmatchedHandlers = [];\n\t\t\t\t\tmatchedSelectors = {};\n\t\t\t\t\tfor ( i = 0; i < delegateCount; i++ ) {\n\t\t\t\t\t\thandleObj = handlers[ i ];\n\n\t\t\t\t\t\t// Don't conflict with Object.prototype properties (trac-13203)\n\t\t\t\t\t\tsel = handleObj.selector + \" \";\n\n\t\t\t\t\t\tif ( matchedSelectors[ sel ] === undefined ) {\n\t\t\t\t\t\t\tmatchedSelectors[ sel ] = handleObj.needsContext ?\n\t\t\t\t\t\t\t\tjQuery( sel, this ).index( cur ) > -1 :\n\t\t\t\t\t\t\t\tjQuery.find( sel, this, null, [ cur ] ).length;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( matchedSelectors[ sel ] ) {\n\t\t\t\t\t\t\tmatchedHandlers.push( handleObj );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ( matchedHandlers.length ) {\n\t\t\t\t\t\thandlerQueue.push( { elem: cur, handlers: matchedHandlers } );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Add the remaining (directly-bound) handlers\n\t\tcur = this;\n\t\tif ( delegateCount < handlers.length ) {\n\t\t\thandlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } );\n\t\t}\n\n\t\treturn handlerQueue;\n\t},\n\n\taddProp: function( name, hook ) {\n\t\tObject.defineProperty( jQuery.Event.prototype, name, {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: true,\n\n\t\t\tget: isFunction( hook ) ?\n\t\t\t\tfunction() {\n\t\t\t\t\tif ( this.originalEvent ) {\n\t\t\t\t\t\treturn hook( this.originalEvent );\n\t\t\t\t\t}\n\t\t\t\t} :\n\t\t\t\tfunction() {\n\t\t\t\t\tif ( this.originalEvent ) {\n\t\t\t\t\t\treturn this.originalEvent[ name ];\n\t\t\t\t\t}\n\t\t\t\t},\n\n\t\t\tset: function( value ) {\n\t\t\t\tObject.defineProperty( this, name, {\n\t\t\t\t\tenumerable: true,\n\t\t\t\t\tconfigurable: true,\n\t\t\t\t\twritable: true,\n\t\t\t\t\tvalue: value\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\t},\n\n\tfix: function( originalEvent ) {\n\t\treturn originalEvent[ jQuery.expando ] ?\n\t\t\toriginalEvent :\n\t\t\tnew jQuery.Event( originalEvent );\n\t},\n\n\tspecial: {\n\t\tload: {\n\n\t\t\t// Prevent triggered image.load events from bubbling to window.load\n\t\t\tnoBubble: true\n\t\t},\n\t\tclick: {\n\n\t\t\t// Utilize native event to ensure correct state for checkable inputs\n\t\t\tsetup: function( data ) {\n\n\t\t\t\t// For mutual compressibility with _default, replace `this` access with a local var.\n\t\t\t\t// `|| data` is dead code meant only to preserve the variable through minification.\n\t\t\t\tvar el = this || data;\n\n\t\t\t\t// Claim the first handler\n\t\t\t\tif ( rcheckableType.test( el.type ) &&\n\t\t\t\t\tel.click && nodeName( el, \"input\" ) ) {\n\n\t\t\t\t\t// dataPriv.set( el, \"click\", ... )\n\t\t\t\t\tleverageNative( el, \"click\", true );\n\t\t\t\t}\n\n\t\t\t\t// Return false to allow normal processing in the caller\n\t\t\t\treturn false;\n\t\t\t},\n\t\t\ttrigger: function( data ) {\n\n\t\t\t\t// For mutual compressibility with _default, replace `this` access with a local var.\n\t\t\t\t// `|| data` is dead code meant only to preserve the variable through minification.\n\t\t\t\tvar el = this || data;\n\n\t\t\t\t// Force setup before triggering a click\n\t\t\t\tif ( rcheckableType.test( el.type ) &&\n\t\t\t\t\tel.click && nodeName( el, \"input\" ) ) {\n\n\t\t\t\t\tleverageNative( el, \"click\" );\n\t\t\t\t}\n\n\t\t\t\t// Return non-false to allow normal event-path propagation\n\t\t\t\treturn true;\n\t\t\t},\n\n\t\t\t// For cross-browser consistency, suppress native .click() on links\n\t\t\t// Also prevent it if we're currently inside a leveraged native-event stack\n\t\t\t_default: function( event ) {\n\t\t\t\tvar target = event.target;\n\t\t\t\treturn rcheckableType.test( target.type ) &&\n\t\t\t\t\ttarget.click && nodeName( target, \"input\" ) &&\n\t\t\t\t\tdataPriv.get( target, \"click\" ) ||\n\t\t\t\t\tnodeName( target, \"a\" );\n\t\t\t}\n\t\t},\n\n\t\tbeforeunload: {\n\t\t\tpostDispatch: function( event ) {\n\n\t\t\t\t// Support: Firefox 20+\n\t\t\t\t// Firefox doesn't alert if the returnValue field is not set.\n\t\t\t\tif ( event.result !== undefined && event.originalEvent ) {\n\t\t\t\t\tevent.originalEvent.returnValue = event.result;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n};\n\n// Ensure the presence of an event listener that handles manually-triggered\n// synthetic events by interrupting progress until reinvoked in response to\n// *native* events that it fires directly, ensuring that state changes have\n// already occurred before other listeners are invoked.\nfunction leverageNative( el, type, isSetup ) {\n\n\t// Missing `isSetup` indicates a trigger call, which must force setup through jQuery.event.add\n\tif ( !isSetup ) {\n\t\tif ( dataPriv.get( el, type ) === undefined ) {\n\t\t\tjQuery.event.add( el, type, returnTrue );\n\t\t}\n\t\treturn;\n\t}\n\n\t// Register the controller as a special universal handler for all event namespaces\n\tdataPriv.set( el, type, false );\n\tjQuery.event.add( el, type, {\n\t\tnamespace: false,\n\t\thandler: function( event ) {\n\t\t\tvar result,\n\t\t\t\tsaved = dataPriv.get( this, type );\n\n\t\t\tif ( ( event.isTrigger & 1 ) && this[ type ] ) {\n\n\t\t\t\t// Interrupt processing of the outer synthetic .trigger()ed event\n\t\t\t\tif ( !saved ) {\n\n\t\t\t\t\t// Store arguments for use when handling the inner native event\n\t\t\t\t\t// There will always be at least one argument (an event object), so this array\n\t\t\t\t\t// will not be confused with a leftover capture object.\n\t\t\t\t\tsaved = slice.call( arguments );\n\t\t\t\t\tdataPriv.set( this, type, saved );\n\n\t\t\t\t\t// Trigger the native event and capture its result\n\t\t\t\t\tthis[ type ]();\n\t\t\t\t\tresult = dataPriv.get( this, type );\n\t\t\t\t\tdataPriv.set( this, type, false );\n\n\t\t\t\t\tif ( saved !== result ) {\n\n\t\t\t\t\t\t// Cancel the outer synthetic event\n\t\t\t\t\t\tevent.stopImmediatePropagation();\n\t\t\t\t\t\tevent.preventDefault();\n\n\t\t\t\t\t\treturn result;\n\t\t\t\t\t}\n\n\t\t\t\t// If this is an inner synthetic event for an event with a bubbling surrogate\n\t\t\t\t// (focus or blur), assume that the surrogate already propagated from triggering\n\t\t\t\t// the native event and prevent that from happening again here.\n\t\t\t\t// This technically gets the ordering wrong w.r.t. to `.trigger()` (in which the\n\t\t\t\t// bubbling surrogate propagates *after* the non-bubbling base), but that seems\n\t\t\t\t// less bad than duplication.\n\t\t\t\t} else if ( ( jQuery.event.special[ type ] || {} ).delegateType ) {\n\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t}\n\n\t\t\t// If this is a native event triggered above, everything is now in order\n\t\t\t// Fire an inner synthetic event with the original arguments\n\t\t\t} else if ( saved ) {\n\n\t\t\t\t// ...and capture the result\n\t\t\t\tdataPriv.set( this, type, jQuery.event.trigger(\n\t\t\t\t\tsaved[ 0 ],\n\t\t\t\t\tsaved.slice( 1 ),\n\t\t\t\t\tthis\n\t\t\t\t) );\n\n\t\t\t\t// Abort handling of the native event by all jQuery handlers while allowing\n\t\t\t\t// native handlers on the same element to run. On target, this is achieved\n\t\t\t\t// by stopping immediate propagation just on the jQuery event. However,\n\t\t\t\t// the native event is re-wrapped by a jQuery one on each level of the\n\t\t\t\t// propagation so the only way to stop it for jQuery is to stop it for\n\t\t\t\t// everyone via native `stopPropagation()`. This is not a problem for\n\t\t\t\t// focus/blur which don't bubble, but it does also stop click on checkboxes\n\t\t\t\t// and radios. We accept this limitation.\n\t\t\t\tevent.stopPropagation();\n\t\t\t\tevent.isImmediatePropagationStopped = returnTrue;\n\t\t\t}\n\t\t}\n\t} );\n}\n\njQuery.removeEvent = function( elem, type, handle ) {\n\n\t// This \"if\" is needed for plain objects\n\tif ( elem.removeEventListener ) {\n\t\telem.removeEventListener( type, handle );\n\t}\n};\n\njQuery.Event = function( src, props ) {\n\n\t// Allow instantiation without the 'new' keyword\n\tif ( !( this instanceof jQuery.Event ) ) {\n\t\treturn new jQuery.Event( src, props );\n\t}\n\n\t// Event object\n\tif ( src && src.type ) {\n\t\tthis.originalEvent = src;\n\t\tthis.type = src.type;\n\n\t\t// Events bubbling up the document may have been marked as prevented\n\t\t// by a handler lower down the tree; reflect the correct value.\n\t\tthis.isDefaultPrevented = src.defaultPrevented ||\n\t\t\t\tsrc.defaultPrevented === undefined &&\n\n\t\t\t\t// Support: Android <=2.3 only\n\t\t\t\tsrc.returnValue === false ?\n\t\t\treturnTrue :\n\t\t\treturnFalse;\n\n\t\t// Create target properties\n\t\t// Support: Safari <=6 - 7 only\n\t\t// Target should not be a text node (trac-504, trac-13143)\n\t\tthis.target = ( src.target && src.target.nodeType === 3 ) ?\n\t\t\tsrc.target.parentNode :\n\t\t\tsrc.target;\n\n\t\tthis.currentTarget = src.currentTarget;\n\t\tthis.relatedTarget = src.relatedTarget;\n\n\t// Event type\n\t} else {\n\t\tthis.type = src;\n\t}\n\n\t// Put explicitly provided properties onto the event object\n\tif ( props ) {\n\t\tjQuery.extend( this, props );\n\t}\n\n\t// Create a timestamp if incoming event doesn't have one\n\tthis.timeStamp = src && src.timeStamp || Date.now();\n\n\t// Mark it as fixed\n\tthis[ jQuery.expando ] = true;\n};\n\n// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding\n// https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html\njQuery.Event.prototype = {\n\tconstructor: jQuery.Event,\n\tisDefaultPrevented: returnFalse,\n\tisPropagationStopped: returnFalse,\n\tisImmediatePropagationStopped: returnFalse,\n\tisSimulated: false,\n\n\tpreventDefault: function() {\n\t\tvar e = this.originalEvent;\n\n\t\tthis.isDefaultPrevented = returnTrue;\n\n\t\tif ( e && !this.isSimulated ) {\n\t\t\te.preventDefault();\n\t\t}\n\t},\n\tstopPropagation: function() {\n\t\tvar e = this.originalEvent;\n\n\t\tthis.isPropagationStopped = returnTrue;\n\n\t\tif ( e && !this.isSimulated ) {\n\t\t\te.stopPropagation();\n\t\t}\n\t},\n\tstopImmediatePropagation: function() {\n\t\tvar e = this.originalEvent;\n\n\t\tthis.isImmediatePropagationStopped = returnTrue;\n\n\t\tif ( e && !this.isSimulated ) {\n\t\t\te.stopImmediatePropagation();\n\t\t}\n\n\t\tthis.stopPropagation();\n\t}\n};\n\n// Includes all common event props including KeyEvent and MouseEvent specific props\njQuery.each( {\n\taltKey: true,\n\tbubbles: true,\n\tcancelable: true,\n\tchangedTouches: true,\n\tctrlKey: true,\n\tdetail: true,\n\teventPhase: true,\n\tmetaKey: true,\n\tpageX: true,\n\tpageY: true,\n\tshiftKey: true,\n\tview: true,\n\t\"char\": true,\n\tcode: true,\n\tcharCode: true,\n\tkey: true,\n\tkeyCode: true,\n\tbutton: true,\n\tbuttons: true,\n\tclientX: true,\n\tclientY: true,\n\toffsetX: true,\n\toffsetY: true,\n\tpointerId: true,\n\tpointerType: true,\n\tscreenX: true,\n\tscreenY: true,\n\ttargetTouches: true,\n\ttoElement: true,\n\ttouches: true,\n\twhich: true\n}, jQuery.event.addProp );\n\njQuery.each( { focus: \"focusin\", blur: \"focusout\" }, function( type, delegateType ) {\n\n\tfunction focusMappedHandler( nativeEvent ) {\n\t\tif ( document.documentMode ) {\n\n\t\t\t// Support: IE 11+\n\t\t\t// Attach a single focusin/focusout handler on the document while someone wants\n\t\t\t// focus/blur. This is because the former are synchronous in IE while the latter\n\t\t\t// are async. In other browsers, all those handlers are invoked synchronously.\n\n\t\t\t// `handle` from private data would already wrap the event, but we need\n\t\t\t// to change the `type` here.\n\t\t\tvar handle = dataPriv.get( this, \"handle\" ),\n\t\t\t\tevent = jQuery.event.fix( nativeEvent );\n\t\t\tevent.type = nativeEvent.type === \"focusin\" ? \"focus\" : \"blur\";\n\t\t\tevent.isSimulated = true;\n\n\t\t\t// First, handle focusin/focusout\n\t\t\thandle( nativeEvent );\n\n\t\t\t// ...then, handle focus/blur\n\t\t\t//\n\t\t\t// focus/blur don't bubble while focusin/focusout do; simulate the former by only\n\t\t\t// invoking the handler at the lower level.\n\t\t\tif ( event.target === event.currentTarget ) {\n\n\t\t\t\t// The setup part calls `leverageNative`, which, in turn, calls\n\t\t\t\t// `jQuery.event.add`, so event handle will already have been set\n\t\t\t\t// by this point.\n\t\t\t\thandle( event );\n\t\t\t}\n\t\t} else {\n\n\t\t\t// For non-IE browsers, attach a single capturing handler on the document\n\t\t\t// while someone wants focusin/focusout.\n\t\t\tjQuery.event.simulate( delegateType, nativeEvent.target,\n\t\t\t\tjQuery.event.fix( nativeEvent ) );\n\t\t}\n\t}\n\n\tjQuery.event.special[ type ] = {\n\n\t\t// Utilize native event if possible so blur/focus sequence is correct\n\t\tsetup: function() {\n\n\t\t\tvar attaches;\n\n\t\t\t// Claim the first handler\n\t\t\t// dataPriv.set( this, \"focus\", ... )\n\t\t\t// dataPriv.set( this, \"blur\", ... )\n\t\t\tleverageNative( this, type, true );\n\n\t\t\tif ( document.documentMode ) {\n\n\t\t\t\t// Support: IE 9 - 11+\n\t\t\t\t// We use the same native handler for focusin & focus (and focusout & blur)\n\t\t\t\t// so we need to coordinate setup & teardown parts between those events.\n\t\t\t\t// Use `delegateType` as the key as `type` is already used by `leverageNative`.\n\t\t\t\tattaches = dataPriv.get( this, delegateType );\n\t\t\t\tif ( !attaches ) {\n\t\t\t\t\tthis.addEventListener( delegateType, focusMappedHandler );\n\t\t\t\t}\n\t\t\t\tdataPriv.set( this, delegateType, ( attaches || 0 ) + 1 );\n\t\t\t} else {\n\n\t\t\t\t// Return false to allow normal processing in the caller\n\t\t\t\treturn false;\n\t\t\t}\n\t\t},\n\t\ttrigger: function() {\n\n\t\t\t// Force setup before trigger\n\t\t\tleverageNative( this, type );\n\n\t\t\t// Return non-false to allow normal event-path propagation\n\t\t\treturn true;\n\t\t},\n\n\t\tteardown: function() {\n\t\t\tvar attaches;\n\n\t\t\tif ( document.documentMode ) {\n\t\t\t\tattaches = dataPriv.get( this, delegateType ) - 1;\n\t\t\t\tif ( !attaches ) {\n\t\t\t\t\tthis.removeEventListener( delegateType, focusMappedHandler );\n\t\t\t\t\tdataPriv.remove( this, delegateType );\n\t\t\t\t} else {\n\t\t\t\t\tdataPriv.set( this, delegateType, attaches );\n\t\t\t\t}\n\t\t\t} else {\n\n\t\t\t\t// Return false to indicate standard teardown should be applied\n\t\t\t\treturn false;\n\t\t\t}\n\t\t},\n\n\t\t// Suppress native focus or blur if we're currently inside\n\t\t// a leveraged native-event stack\n\t\t_default: function( event ) {\n\t\t\treturn dataPriv.get( event.target, type );\n\t\t},\n\n\t\tdelegateType: delegateType\n\t};\n\n\t// Support: Firefox <=44\n\t// Firefox doesn't have focus(in | out) events\n\t// Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787\n\t//\n\t// Support: Chrome <=48 - 49, Safari <=9.0 - 9.1\n\t// focus(in | out) events fire after focus & blur events,\n\t// which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order\n\t// Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857\n\t//\n\t// Support: IE 9 - 11+\n\t// To preserve relative focusin/focus & focusout/blur event order guaranteed on the 3.x branch,\n\t// attach a single handler for both events in IE.\n\tjQuery.event.special[ delegateType ] = {\n\t\tsetup: function() {\n\n\t\t\t// Handle: regular nodes (via `this.ownerDocument`), window\n\t\t\t// (via `this.document`) & document (via `this`).\n\t\t\tvar doc = this.ownerDocument || this.document || this,\n\t\t\t\tdataHolder = document.documentMode ? this : doc,\n\t\t\t\tattaches = dataPriv.get( dataHolder, delegateType );\n\n\t\t\t// Support: IE 9 - 11+\n\t\t\t// We use the same native handler for focusin & focus (and focusout & blur)\n\t\t\t// so we need to coordinate setup & teardown parts between those events.\n\t\t\t// Use `delegateType` as the key as `type` is already used by `leverageNative`.\n\t\t\tif ( !attaches ) {\n\t\t\t\tif ( document.documentMode ) {\n\t\t\t\t\tthis.addEventListener( delegateType, focusMappedHandler );\n\t\t\t\t} else {\n\t\t\t\t\tdoc.addEventListener( type, focusMappedHandler, true );\n\t\t\t\t}\n\t\t\t}\n\t\t\tdataPriv.set( dataHolder, delegateType, ( attaches || 0 ) + 1 );\n\t\t},\n\t\tteardown: function() {\n\t\t\tvar doc = this.ownerDocument || this.document || this,\n\t\t\t\tdataHolder = document.documentMode ? this : doc,\n\t\t\t\tattaches = dataPriv.get( dataHolder, delegateType ) - 1;\n\n\t\t\tif ( !attaches ) {\n\t\t\t\tif ( document.documentMode ) {\n\t\t\t\t\tthis.removeEventListener( delegateType, focusMappedHandler );\n\t\t\t\t} else {\n\t\t\t\t\tdoc.removeEventListener( type, focusMappedHandler, true );\n\t\t\t\t}\n\t\t\t\tdataPriv.remove( dataHolder, delegateType );\n\t\t\t} else {\n\t\t\t\tdataPriv.set( dataHolder, delegateType, attaches );\n\t\t\t}\n\t\t}\n\t};\n} );\n\n// Create mouseenter/leave events using mouseover/out and event-time checks\n// so that event delegation works in jQuery.\n// Do the same for pointerenter/pointerleave and pointerover/pointerout\n//\n// Support: Safari 7 only\n// Safari sends mouseenter too often; see:\n// https://bugs.chromium.org/p/chromium/issues/detail?id=470258\n// for the description of the bug (it existed in older Chrome versions as well).\njQuery.each( {\n\tmouseenter: \"mouseover\",\n\tmouseleave: \"mouseout\",\n\tpointerenter: \"pointerover\",\n\tpointerleave: \"pointerout\"\n}, function( orig, fix ) {\n\tjQuery.event.special[ orig ] = {\n\t\tdelegateType: fix,\n\t\tbindType: fix,\n\n\t\thandle: function( event ) {\n\t\t\tvar ret,\n\t\t\t\ttarget = this,\n\t\t\t\trelated = event.relatedTarget,\n\t\t\t\thandleObj = event.handleObj;\n\n\t\t\t// For mouseenter/leave call the handler if related is outside the target.\n\t\t\t// NB: No relatedTarget if the mouse left/entered the browser window\n\t\t\tif ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) {\n\t\t\t\tevent.type = handleObj.origType;\n\t\t\t\tret = handleObj.handler.apply( this, arguments );\n\t\t\t\tevent.type = fix;\n\t\t\t}\n\t\t\treturn ret;\n\t\t}\n\t};\n} );\n\njQuery.fn.extend( {\n\n\ton: function( types, selector, data, fn ) {\n\t\treturn on( this, types, selector, data, fn );\n\t},\n\tone: function( types, selector, data, fn ) {\n\t\treturn on( this, types, selector, data, fn, 1 );\n\t},\n\toff: function( types, selector, fn ) {\n\t\tvar handleObj, type;\n\t\tif ( types && types.preventDefault && types.handleObj ) {\n\n\t\t\t// ( event )  dispatched jQuery.Event\n\t\t\thandleObj = types.handleObj;\n\t\t\tjQuery( types.delegateTarget ).off(\n\t\t\t\thandleObj.namespace ?\n\t\t\t\t\thandleObj.origType + \".\" + handleObj.namespace :\n\t\t\t\t\thandleObj.origType,\n\t\t\t\thandleObj.selector,\n\t\t\t\thandleObj.handler\n\t\t\t);\n\t\t\treturn this;\n\t\t}\n\t\tif ( typeof types === \"object\" ) {\n\n\t\t\t// ( types-object [, selector] )\n\t\t\tfor ( type in types ) {\n\t\t\t\tthis.off( type, selector, types[ type ] );\n\t\t\t}\n\t\t\treturn this;\n\t\t}\n\t\tif ( selector === false || typeof selector === \"function\" ) {\n\n\t\t\t// ( types [, fn] )\n\t\t\tfn = selector;\n\t\t\tselector = undefined;\n\t\t}\n\t\tif ( fn === false ) {\n\t\t\tfn = returnFalse;\n\t\t}\n\t\treturn this.each( function() {\n\t\t\tjQuery.event.remove( this, types, fn, selector );\n\t\t} );\n\t}\n} );\n\n\nvar\n\n\t// Support: IE <=10 - 11, Edge 12 - 13 only\n\t// In IE/Edge using regex groups here causes severe slowdowns.\n\t// See https://connect.microsoft.com/IE/feedback/details/1736512/\n\trnoInnerhtml = /<script|<style|<link/i,\n\n\t// checked=\"checked\" or checked\n\trchecked = /checked\\s*(?:[^=]|=\\s*.checked.)/i,\n\n\trcleanScript = /^\\s*<!\\[CDATA\\[|\\]\\]>\\s*$/g;\n\n// Prefer a tbody over its parent table for containing new rows\nfunction manipulationTarget( elem, content ) {\n\tif ( nodeName( elem, \"table\" ) &&\n\t\tnodeName( content.nodeType !== 11 ? content : content.firstChild, \"tr\" ) ) {\n\n\t\treturn jQuery( elem ).children( \"tbody\" )[ 0 ] || elem;\n\t}\n\n\treturn elem;\n}\n\n// Replace/restore the type attribute of script elements for safe DOM manipulation\nfunction disableScript( elem ) {\n\telem.type = ( elem.getAttribute( \"type\" ) !== null ) + \"/\" + elem.type;\n\treturn elem;\n}\nfunction restoreScript( elem ) {\n\tif ( ( elem.type || \"\" ).slice( 0, 5 ) === \"true/\" ) {\n\t\telem.type = elem.type.slice( 5 );\n\t} else {\n\t\telem.removeAttribute( \"type\" );\n\t}\n\n\treturn elem;\n}\n\nfunction cloneCopyEvent( src, dest ) {\n\tvar i, l, type, pdataOld, udataOld, udataCur, events;\n\n\tif ( dest.nodeType !== 1 ) {\n\t\treturn;\n\t}\n\n\t// 1. Copy private data: events, handlers, etc.\n\tif ( dataPriv.hasData( src ) ) {\n\t\tpdataOld = dataPriv.get( src );\n\t\tevents = pdataOld.events;\n\n\t\tif ( events ) {\n\t\t\tdataPriv.remove( dest, \"handle events\" );\n\n\t\t\tfor ( type in events ) {\n\t\t\t\tfor ( i = 0, l = events[ type ].length; i < l; i++ ) {\n\t\t\t\t\tjQuery.event.add( dest, type, events[ type ][ i ] );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// 2. Copy user data\n\tif ( dataUser.hasData( src ) ) {\n\t\tudataOld = dataUser.access( src );\n\t\tudataCur = jQuery.extend( {}, udataOld );\n\n\t\tdataUser.set( dest, udataCur );\n\t}\n}\n\n// Fix IE bugs, see support tests\nfunction fixInput( src, dest ) {\n\tvar nodeName = dest.nodeName.toLowerCase();\n\n\t// Fails to persist the checked state of a cloned checkbox or radio button.\n\tif ( nodeName === \"input\" && rcheckableType.test( src.type ) ) {\n\t\tdest.checked = src.checked;\n\n\t// Fails to return the selected option to the default selected state when cloning options\n\t} else if ( nodeName === \"input\" || nodeName === \"textarea\" ) {\n\t\tdest.defaultValue = src.defaultValue;\n\t}\n}\n\nfunction domManip( collection, args, callback, ignored ) {\n\n\t// Flatten any nested arrays\n\targs = flat( args );\n\n\tvar fragment, first, scripts, hasScripts, node, doc,\n\t\ti = 0,\n\t\tl = collection.length,\n\t\tiNoClone = l - 1,\n\t\tvalue = args[ 0 ],\n\t\tvalueIsFunction = isFunction( value );\n\n\t// We can't cloneNode fragments that contain checked, in WebKit\n\tif ( valueIsFunction ||\n\t\t\t( l > 1 && typeof value === \"string\" &&\n\t\t\t\t!support.checkClone && rchecked.test( value ) ) ) {\n\t\treturn collection.each( function( index ) {\n\t\t\tvar self = collection.eq( index );\n\t\t\tif ( valueIsFunction ) {\n\t\t\t\targs[ 0 ] = value.call( this, index, self.html() );\n\t\t\t}\n\t\t\tdomManip( self, args, callback, ignored );\n\t\t} );\n\t}\n\n\tif ( l ) {\n\t\tfragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored );\n\t\tfirst = fragment.firstChild;\n\n\t\tif ( fragment.childNodes.length === 1 ) {\n\t\t\tfragment = first;\n\t\t}\n\n\t\t// Require either new content or an interest in ignored elements to invoke the callback\n\t\tif ( first || ignored ) {\n\t\t\tscripts = jQuery.map( getAll( fragment, \"script\" ), disableScript );\n\t\t\thasScripts = scripts.length;\n\n\t\t\t// Use the original fragment for the last item\n\t\t\t// instead of the first because it can end up\n\t\t\t// being emptied incorrectly in certain situations (trac-8070).\n\t\t\tfor ( ; i < l; i++ ) {\n\t\t\t\tnode = fragment;\n\n\t\t\t\tif ( i !== iNoClone ) {\n\t\t\t\t\tnode = jQuery.clone( node, true, true );\n\n\t\t\t\t\t// Keep references to cloned scripts for later restoration\n\t\t\t\t\tif ( hasScripts ) {\n\n\t\t\t\t\t\t// Support: Android <=4.0 only, PhantomJS 1 only\n\t\t\t\t\t\t// push.apply(_, arraylike) throws on ancient WebKit\n\t\t\t\t\t\tjQuery.merge( scripts, getAll( node, \"script\" ) );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tcallback.call( collection[ i ], node, i );\n\t\t\t}\n\n\t\t\tif ( hasScripts ) {\n\t\t\t\tdoc = scripts[ scripts.length - 1 ].ownerDocument;\n\n\t\t\t\t// Re-enable scripts\n\t\t\t\tjQuery.map( scripts, restoreScript );\n\n\t\t\t\t// Evaluate executable scripts on first document insertion\n\t\t\t\tfor ( i = 0; i < hasScripts; i++ ) {\n\t\t\t\t\tnode = scripts[ i ];\n\t\t\t\t\tif ( rscriptType.test( node.type || \"\" ) &&\n\t\t\t\t\t\t!dataPriv.access( node, \"globalEval\" ) &&\n\t\t\t\t\t\tjQuery.contains( doc, node ) ) {\n\n\t\t\t\t\t\tif ( node.src && ( node.type || \"\" ).toLowerCase()  !== \"module\" ) {\n\n\t\t\t\t\t\t\t// Optional AJAX dependency, but won't run scripts if not present\n\t\t\t\t\t\t\tif ( jQuery._evalUrl && !node.noModule ) {\n\t\t\t\t\t\t\t\tjQuery._evalUrl( node.src, {\n\t\t\t\t\t\t\t\t\tnonce: node.nonce || node.getAttribute( \"nonce\" )\n\t\t\t\t\t\t\t\t}, doc );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t// Unwrap a CDATA section containing script contents. This shouldn't be\n\t\t\t\t\t\t\t// needed as in XML documents they're already not visible when\n\t\t\t\t\t\t\t// inspecting element contents and in HTML documents they have no\n\t\t\t\t\t\t\t// meaning but we're preserving that logic for backwards compatibility.\n\t\t\t\t\t\t\t// This will be removed completely in 4.0. See gh-4904.\n\t\t\t\t\t\t\tDOMEval( node.textContent.replace( rcleanScript, \"\" ), node, doc );\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\treturn collection;\n}\n\nfunction remove( elem, selector, keepData ) {\n\tvar node,\n\t\tnodes = selector ? jQuery.filter( selector, elem ) : elem,\n\t\ti = 0;\n\n\tfor ( ; ( node = nodes[ i ] ) != null; i++ ) {\n\t\tif ( !keepData && node.nodeType === 1 ) {\n\t\t\tjQuery.cleanData( getAll( node ) );\n\t\t}\n\n\t\tif ( node.parentNode ) {\n\t\t\tif ( keepData && isAttached( node ) ) {\n\t\t\t\tsetGlobalEval( getAll( node, \"script\" ) );\n\t\t\t}\n\t\t\tnode.parentNode.removeChild( node );\n\t\t}\n\t}\n\n\treturn elem;\n}\n\njQuery.extend( {\n\thtmlPrefilter: function( html ) {\n\t\treturn html;\n\t},\n\n\tclone: function( elem, dataAndEvents, deepDataAndEvents ) {\n\t\tvar i, l, srcElements, destElements,\n\t\t\tclone = elem.cloneNode( true ),\n\t\t\tinPage = isAttached( elem );\n\n\t\t// Fix IE cloning issues\n\t\tif ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) &&\n\t\t\t\t!jQuery.isXMLDoc( elem ) ) {\n\n\t\t\t// We eschew jQuery#find here for performance reasons:\n\t\t\t// https://jsperf.com/getall-vs-sizzle/2\n\t\t\tdestElements = getAll( clone );\n\t\t\tsrcElements = getAll( elem );\n\n\t\t\tfor ( i = 0, l = srcElements.length; i < l; i++ ) {\n\t\t\t\tfixInput( srcElements[ i ], destElements[ i ] );\n\t\t\t}\n\t\t}\n\n\t\t// Copy the events from the original to the clone\n\t\tif ( dataAndEvents ) {\n\t\t\tif ( deepDataAndEvents ) {\n\t\t\t\tsrcElements = srcElements || getAll( elem );\n\t\t\t\tdestElements = destElements || getAll( clone );\n\n\t\t\t\tfor ( i = 0, l = srcElements.length; i < l; i++ ) {\n\t\t\t\t\tcloneCopyEvent( srcElements[ i ], destElements[ i ] );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcloneCopyEvent( elem, clone );\n\t\t\t}\n\t\t}\n\n\t\t// Preserve script evaluation history\n\t\tdestElements = getAll( clone, \"script\" );\n\t\tif ( destElements.length > 0 ) {\n\t\t\tsetGlobalEval( destElements, !inPage && getAll( elem, \"script\" ) );\n\t\t}\n\n\t\t// Return the cloned set\n\t\treturn clone;\n\t},\n\n\tcleanData: function( elems ) {\n\t\tvar data, elem, type,\n\t\t\tspecial = jQuery.event.special,\n\t\t\ti = 0;\n\n\t\tfor ( ; ( elem = elems[ i ] ) !== undefined; i++ ) {\n\t\t\tif ( acceptData( elem ) ) {\n\t\t\t\tif ( ( data = elem[ dataPriv.expando ] ) ) {\n\t\t\t\t\tif ( data.events ) {\n\t\t\t\t\t\tfor ( type in data.events ) {\n\t\t\t\t\t\t\tif ( special[ type ] ) {\n\t\t\t\t\t\t\t\tjQuery.event.remove( elem, type );\n\n\t\t\t\t\t\t\t// This is a shortcut to avoid jQuery.event.remove's overhead\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tjQuery.removeEvent( elem, type, data.handle );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Support: Chrome <=35 - 45+\n\t\t\t\t\t// Assign undefined instead of using delete, see Data#remove\n\t\t\t\t\telem[ dataPriv.expando ] = undefined;\n\t\t\t\t}\n\t\t\t\tif ( elem[ dataUser.expando ] ) {\n\n\t\t\t\t\t// Support: Chrome <=35 - 45+\n\t\t\t\t\t// Assign undefined instead of using delete, see Data#remove\n\t\t\t\t\telem[ dataUser.expando ] = undefined;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n} );\n\njQuery.fn.extend( {\n\tdetach: function( selector ) {\n\t\treturn remove( this, selector, true );\n\t},\n\n\tremove: function( selector ) {\n\t\treturn remove( this, selector );\n\t},\n\n\ttext: function( value ) {\n\t\treturn access( this, function( value ) {\n\t\t\treturn value === undefined ?\n\t\t\t\tjQuery.text( this ) :\n\t\t\t\tthis.empty().each( function() {\n\t\t\t\t\tif ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {\n\t\t\t\t\t\tthis.textContent = value;\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t}, null, value, arguments.length );\n\t},\n\n\tappend: function() {\n\t\treturn domManip( this, arguments, function( elem ) {\n\t\t\tif ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {\n\t\t\t\tvar target = manipulationTarget( this, elem );\n\t\t\t\ttarget.appendChild( elem );\n\t\t\t}\n\t\t} );\n\t},\n\n\tprepend: function() {\n\t\treturn domManip( this, arguments, function( elem ) {\n\t\t\tif ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {\n\t\t\t\tvar target = manipulationTarget( this, elem );\n\t\t\t\ttarget.insertBefore( elem, target.firstChild );\n\t\t\t}\n\t\t} );\n\t},\n\n\tbefore: function() {\n\t\treturn domManip( this, arguments, function( elem ) {\n\t\t\tif ( this.parentNode ) {\n\t\t\t\tthis.parentNode.insertBefore( elem, this );\n\t\t\t}\n\t\t} );\n\t},\n\n\tafter: function() {\n\t\treturn domManip( this, arguments, function( elem ) {\n\t\t\tif ( this.parentNode ) {\n\t\t\t\tthis.parentNode.insertBefore( elem, this.nextSibling );\n\t\t\t}\n\t\t} );\n\t},\n\n\tempty: function() {\n\t\tvar elem,\n\t\t\ti = 0;\n\n\t\tfor ( ; ( elem = this[ i ] ) != null; i++ ) {\n\t\t\tif ( elem.nodeType === 1 ) {\n\n\t\t\t\t// Prevent memory leaks\n\t\t\t\tjQuery.cleanData( getAll( elem, false ) );\n\n\t\t\t\t// Remove any remaining nodes\n\t\t\t\telem.textContent = \"\";\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\t},\n\n\tclone: function( dataAndEvents, deepDataAndEvents ) {\n\t\tdataAndEvents = dataAndEvents == null ? false : dataAndEvents;\n\t\tdeepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;\n\n\t\treturn this.map( function() {\n\t\t\treturn jQuery.clone( this, dataAndEvents, deepDataAndEvents );\n\t\t} );\n\t},\n\n\thtml: function( value ) {\n\t\treturn access( this, function( value ) {\n\t\t\tvar elem = this[ 0 ] || {},\n\t\t\t\ti = 0,\n\t\t\t\tl = this.length;\n\n\t\t\tif ( value === undefined && elem.nodeType === 1 ) {\n\t\t\t\treturn elem.innerHTML;\n\t\t\t}\n\n\t\t\t// See if we can take a shortcut and just use innerHTML\n\t\t\tif ( typeof value === \"string\" && !rnoInnerhtml.test( value ) &&\n\t\t\t\t!wrapMap[ ( rtagName.exec( value ) || [ \"\", \"\" ] )[ 1 ].toLowerCase() ] ) {\n\n\t\t\t\tvalue = jQuery.htmlPrefilter( value );\n\n\t\t\t\ttry {\n\t\t\t\t\tfor ( ; i < l; i++ ) {\n\t\t\t\t\t\telem = this[ i ] || {};\n\n\t\t\t\t\t\t// Remove element nodes and prevent memory leaks\n\t\t\t\t\t\tif ( elem.nodeType === 1 ) {\n\t\t\t\t\t\t\tjQuery.cleanData( getAll( elem, false ) );\n\t\t\t\t\t\t\telem.innerHTML = value;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\telem = 0;\n\n\t\t\t\t// If using innerHTML throws an exception, use the fallback method\n\t\t\t\t} catch ( e ) {}\n\t\t\t}\n\n\t\t\tif ( elem ) {\n\t\t\t\tthis.empty().append( value );\n\t\t\t}\n\t\t}, null, value, arguments.length );\n\t},\n\n\treplaceWith: function() {\n\t\tvar ignored = [];\n\n\t\t// Make the changes, replacing each non-ignored context element with the new content\n\t\treturn domManip( this, arguments, function( elem ) {\n\t\t\tvar parent = this.parentNode;\n\n\t\t\tif ( jQuery.inArray( this, ignored ) < 0 ) {\n\t\t\t\tjQuery.cleanData( getAll( this ) );\n\t\t\t\tif ( parent ) {\n\t\t\t\t\tparent.replaceChild( elem, this );\n\t\t\t\t}\n\t\t\t}\n\n\t\t// Force callback invocation\n\t\t}, ignored );\n\t}\n} );\n\njQuery.each( {\n\tappendTo: \"append\",\n\tprependTo: \"prepend\",\n\tinsertBefore: \"before\",\n\tinsertAfter: \"after\",\n\treplaceAll: \"replaceWith\"\n}, function( name, original ) {\n\tjQuery.fn[ name ] = function( selector ) {\n\t\tvar elems,\n\t\t\tret = [],\n\t\t\tinsert = jQuery( selector ),\n\t\t\tlast = insert.length - 1,\n\t\t\ti = 0;\n\n\t\tfor ( ; i <= last; i++ ) {\n\t\t\telems = i === last ? this : this.clone( true );\n\t\t\tjQuery( insert[ i ] )[ original ]( elems );\n\n\t\t\t// Support: Android <=4.0 only, PhantomJS 1 only\n\t\t\t// .get() because push.apply(_, arraylike) throws on ancient WebKit\n\t\t\tpush.apply( ret, elems.get() );\n\t\t}\n\n\t\treturn this.pushStack( ret );\n\t};\n} );\nvar rnumnonpx = new RegExp( \"^(\" + pnum + \")(?!px)[a-z%]+$\", \"i\" );\n\nvar rcustomProp = /^--/;\n\n\nvar getStyles = function( elem ) {\n\n\t\t// Support: IE <=11 only, Firefox <=30 (trac-15098, trac-14150)\n\t\t// IE throws on elements created in popups\n\t\t// FF meanwhile throws on frame elements through \"defaultView.getComputedStyle\"\n\t\tvar view = elem.ownerDocument.defaultView;\n\n\t\tif ( !view || !view.opener ) {\n\t\t\tview = window;\n\t\t}\n\n\t\treturn view.getComputedStyle( elem );\n\t};\n\nvar swap = function( elem, options, callback ) {\n\tvar ret, name,\n\t\told = {};\n\n\t// Remember the old values, and insert the new ones\n\tfor ( name in options ) {\n\t\told[ name ] = elem.style[ name ];\n\t\telem.style[ name ] = options[ name ];\n\t}\n\n\tret = callback.call( elem );\n\n\t// Revert the old values\n\tfor ( name in options ) {\n\t\telem.style[ name ] = old[ name ];\n\t}\n\n\treturn ret;\n};\n\n\nvar rboxStyle = new RegExp( cssExpand.join( \"|\" ), \"i\" );\n\n\n\n( function() {\n\n\t// Executing both pixelPosition & boxSizingReliable tests require only one layout\n\t// so they're executed at the same time to save the second computation.\n\tfunction computeStyleTests() {\n\n\t\t// This is a singleton, we need to execute it only once\n\t\tif ( !div ) {\n\t\t\treturn;\n\t\t}\n\n\t\tcontainer.style.cssText = \"position:absolute;left:-11111px;width:60px;\" +\n\t\t\t\"margin-top:1px;padding:0;border:0\";\n\t\tdiv.style.cssText =\n\t\t\t\"position:relative;display:block;box-sizing:border-box;overflow:scroll;\" +\n\t\t\t\"margin:auto;border:1px;padding:1px;\" +\n\t\t\t\"width:60%;top:1%\";\n\t\tdocumentElement.appendChild( container ).appendChild( div );\n\n\t\tvar divStyle = window.getComputedStyle( div );\n\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\n\t\t// Support: Android 4.0 - 4.3 only, Firefox <=3 - 44\n\t\treliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12;\n\n\t\t// Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3\n\t\t// Some styles come back with percentage values, even though they shouldn't\n\t\tdiv.style.right = \"60%\";\n\t\tpixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36;\n\n\t\t// Support: IE 9 - 11 only\n\t\t// Detect misreporting of content dimensions for box-sizing:border-box elements\n\t\tboxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36;\n\n\t\t// Support: IE 9 only\n\t\t// Detect overflow:scroll screwiness (gh-3699)\n\t\t// Support: Chrome <=64\n\t\t// Don't get tricked when zoom affects offsetWidth (gh-4029)\n\t\tdiv.style.position = \"absolute\";\n\t\tscrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12;\n\n\t\tdocumentElement.removeChild( container );\n\n\t\t// Nullify the div so it wouldn't be stored in the memory and\n\t\t// it will also be a sign that checks already performed\n\t\tdiv = null;\n\t}\n\n\tfunction roundPixelMeasures( measure ) {\n\t\treturn Math.round( parseFloat( measure ) );\n\t}\n\n\tvar pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal,\n\t\treliableTrDimensionsVal, reliableMarginLeftVal,\n\t\tcontainer = document.createElement( \"div\" ),\n\t\tdiv = document.createElement( \"div\" );\n\n\t// Finish early in limited (non-browser) environments\n\tif ( !div.style ) {\n\t\treturn;\n\t}\n\n\t// Support: IE <=9 - 11 only\n\t// Style of cloned element affects source element cloned (trac-8908)\n\tdiv.style.backgroundClip = \"content-box\";\n\tdiv.cloneNode( true ).style.backgroundClip = \"\";\n\tsupport.clearCloneStyle = div.style.backgroundClip === \"content-box\";\n\n\tjQuery.extend( support, {\n\t\tboxSizingReliable: function() {\n\t\t\tcomputeStyleTests();\n\t\t\treturn boxSizingReliableVal;\n\t\t},\n\t\tpixelBoxStyles: function() {\n\t\t\tcomputeStyleTests();\n\t\t\treturn pixelBoxStylesVal;\n\t\t},\n\t\tpixelPosition: function() {\n\t\t\tcomputeStyleTests();\n\t\t\treturn pixelPositionVal;\n\t\t},\n\t\treliableMarginLeft: function() {\n\t\t\tcomputeStyleTests();\n\t\t\treturn reliableMarginLeftVal;\n\t\t},\n\t\tscrollboxSize: function() {\n\t\t\tcomputeStyleTests();\n\t\t\treturn scrollboxSizeVal;\n\t\t},\n\n\t\t// Support: IE 9 - 11+, Edge 15 - 18+\n\t\t// IE/Edge misreport `getComputedStyle` of table rows with width/height\n\t\t// set in CSS while `offset*` properties report correct values.\n\t\t// Behavior in IE 9 is more subtle than in newer versions & it passes\n\t\t// some versions of this test; make sure not to make it pass there!\n\t\t//\n\t\t// Support: Firefox 70+\n\t\t// Only Firefox includes border widths\n\t\t// in computed dimensions. (gh-4529)\n\t\treliableTrDimensions: function() {\n\t\t\tvar table, tr, trChild, trStyle;\n\t\t\tif ( reliableTrDimensionsVal == null ) {\n\t\t\t\ttable = document.createElement( \"table\" );\n\t\t\t\ttr = document.createElement( \"tr\" );\n\t\t\t\ttrChild = document.createElement( \"div\" );\n\n\t\t\t\ttable.style.cssText = \"position:absolute;left:-11111px;border-collapse:separate\";\n\t\t\t\ttr.style.cssText = \"box-sizing:content-box;border:1px solid\";\n\n\t\t\t\t// Support: Chrome 86+\n\t\t\t\t// Height set through cssText does not get applied.\n\t\t\t\t// Computed height then comes back as 0.\n\t\t\t\ttr.style.height = \"1px\";\n\t\t\t\ttrChild.style.height = \"9px\";\n\n\t\t\t\t// Support: Android 8 Chrome 86+\n\t\t\t\t// In our bodyBackground.html iframe,\n\t\t\t\t// display for all div elements is set to \"inline\",\n\t\t\t\t// which causes a problem only in Android 8 Chrome 86.\n\t\t\t\t// Ensuring the div is `display: block`\n\t\t\t\t// gets around this issue.\n\t\t\t\ttrChild.style.display = \"block\";\n\n\t\t\t\tdocumentElement\n\t\t\t\t\t.appendChild( table )\n\t\t\t\t\t.appendChild( tr )\n\t\t\t\t\t.appendChild( trChild );\n\n\t\t\t\ttrStyle = window.getComputedStyle( tr );\n\t\t\t\treliableTrDimensionsVal = ( parseInt( trStyle.height, 10 ) +\n\t\t\t\t\tparseInt( trStyle.borderTopWidth, 10 ) +\n\t\t\t\t\tparseInt( trStyle.borderBottomWidth, 10 ) ) === tr.offsetHeight;\n\n\t\t\t\tdocumentElement.removeChild( table );\n\t\t\t}\n\t\t\treturn reliableTrDimensionsVal;\n\t\t}\n\t} );\n} )();\n\n\nfunction curCSS( elem, name, computed ) {\n\tvar width, minWidth, maxWidth, ret,\n\t\tisCustomProp = rcustomProp.test( name ),\n\n\t\t// Support: Firefox 51+\n\t\t// Retrieving style before computed somehow\n\t\t// fixes an issue with getting wrong values\n\t\t// on detached elements\n\t\tstyle = elem.style;\n\n\tcomputed = computed || getStyles( elem );\n\n\t// getPropertyValue is needed for:\n\t//   .css('filter') (IE 9 only, trac-12537)\n\t//   .css('--customProperty) (gh-3144)\n\tif ( computed ) {\n\n\t\t// Support: IE <=9 - 11+\n\t\t// IE only supports `\"float\"` in `getPropertyValue`; in computed styles\n\t\t// it's only available as `\"cssFloat\"`. We no longer modify properties\n\t\t// sent to `.css()` apart from camelCasing, so we need to check both.\n\t\t// Normally, this would create difference in behavior: if\n\t\t// `getPropertyValue` returns an empty string, the value returned\n\t\t// by `.css()` would be `undefined`. This is usually the case for\n\t\t// disconnected elements. However, in IE even disconnected elements\n\t\t// with no styles return `\"none\"` for `getPropertyValue( \"float\" )`\n\t\tret = computed.getPropertyValue( name ) || computed[ name ];\n\n\t\tif ( isCustomProp && ret ) {\n\n\t\t\t// Support: Firefox 105+, Chrome <=105+\n\t\t\t// Spec requires trimming whitespace for custom properties (gh-4926).\n\t\t\t// Firefox only trims leading whitespace. Chrome just collapses\n\t\t\t// both leading & trailing whitespace to a single space.\n\t\t\t//\n\t\t\t// Fall back to `undefined` if empty string returned.\n\t\t\t// This collapses a missing definition with property defined\n\t\t\t// and set to an empty string but there's no standard API\n\t\t\t// allowing us to differentiate them without a performance penalty\n\t\t\t// and returning `undefined` aligns with older jQuery.\n\t\t\t//\n\t\t\t// rtrimCSS treats U+000D CARRIAGE RETURN and U+000C FORM FEED\n\t\t\t// as whitespace while CSS does not, but this is not a problem\n\t\t\t// because CSS preprocessing replaces them with U+000A LINE FEED\n\t\t\t// (which *is* CSS whitespace)\n\t\t\t// https://www.w3.org/TR/css-syntax-3/#input-preprocessing\n\t\t\tret = ret.replace( rtrimCSS, \"$1\" ) || undefined;\n\t\t}\n\n\t\tif ( ret === \"\" && !isAttached( elem ) ) {\n\t\t\tret = jQuery.style( elem, name );\n\t\t}\n\n\t\t// A tribute to the \"awesome hack by Dean Edwards\"\n\t\t// Android Browser returns percentage for some values,\n\t\t// but width seems to be reliably pixels.\n\t\t// This is against the CSSOM draft spec:\n\t\t// https://drafts.csswg.org/cssom/#resolved-values\n\t\tif ( !support.pixelBoxStyles() && rnumnonpx.test( ret ) && rboxStyle.test( name ) ) {\n\n\t\t\t// Remember the original values\n\t\t\twidth = style.width;\n\t\t\tminWidth = style.minWidth;\n\t\t\tmaxWidth = style.maxWidth;\n\n\t\t\t// Put in the new values to get a computed value out\n\t\t\tstyle.minWidth = style.maxWidth = style.width = ret;\n\t\t\tret = computed.width;\n\n\t\t\t// Revert the changed values\n\t\t\tstyle.width = width;\n\t\t\tstyle.minWidth = minWidth;\n\t\t\tstyle.maxWidth = maxWidth;\n\t\t}\n\t}\n\n\treturn ret !== undefined ?\n\n\t\t// Support: IE <=9 - 11 only\n\t\t// IE returns zIndex value as an integer.\n\t\tret + \"\" :\n\t\tret;\n}\n\n\nfunction addGetHookIf( conditionFn, hookFn ) {\n\n\t// Define the hook, we'll check on the first run if it's really needed.\n\treturn {\n\t\tget: function() {\n\t\t\tif ( conditionFn() ) {\n\n\t\t\t\t// Hook not needed (or it's not possible to use it due\n\t\t\t\t// to missing dependency), remove it.\n\t\t\t\tdelete this.get;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Hook needed; redefine it so that the support test is not executed again.\n\t\t\treturn ( this.get = hookFn ).apply( this, arguments );\n\t\t}\n\t};\n}\n\n\nvar cssPrefixes = [ \"Webkit\", \"Moz\", \"ms\" ],\n\temptyStyle = document.createElement( \"div\" ).style,\n\tvendorProps = {};\n\n// Return a vendor-prefixed property or undefined\nfunction vendorPropName( name ) {\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}\n\n// Return a potentially-mapped jQuery.cssProps or vendor prefixed property\nfunction finalPropName( name ) {\n\tvar final = jQuery.cssProps[ name ] || vendorProps[ name ];\n\n\tif ( final ) {\n\t\treturn final;\n\t}\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\treturn vendorProps[ name ] = vendorPropName( name ) || name;\n}\n\n\nvar\n\n\t// Swappable if display is none or starts with table\n\t// except \"table\", \"table-cell\", or \"table-caption\"\n\t// See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display\n\trdisplayswap = /^(none|table(?!-c[ea]).+)/,\n\tcssShow = { position: \"absolute\", visibility: \"hidden\", display: \"block\" },\n\tcssNormalTransform = {\n\t\tletterSpacing: \"0\",\n\t\tfontWeight: \"400\"\n\t};\n\nfunction setPositiveNumber( _elem, value, subtract ) {\n\n\t// Any relative (+/-) values have already been\n\t// normalized at this point\n\tvar matches = rcssNum.exec( value );\n\treturn matches ?\n\n\t\t// Guard against undefined \"subtract\", e.g., when used as in cssHooks\n\t\tMath.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || \"px\" ) :\n\t\tvalue;\n}\n\nfunction boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computedVal ) {\n\tvar i = dimension === \"width\" ? 1 : 0,\n\t\textra = 0,\n\t\tdelta = 0,\n\t\tmarginDelta = 0;\n\n\t// Adjustment may not be necessary\n\tif ( box === ( isBorderBox ? \"border\" : \"content\" ) ) {\n\t\treturn 0;\n\t}\n\n\tfor ( ; i < 4; i += 2 ) {\n\n\t\t// Both box models exclude margin\n\t\t// Count margin delta separately to only add it after scroll gutter adjustment.\n\t\t// This is needed to make negative margins work with `outerHeight( true )` (gh-3982).\n\t\tif ( box === \"margin\" ) {\n\t\t\tmarginDelta += jQuery.css( elem, box + cssExpand[ i ], true, styles );\n\t\t}\n\n\t\t// If we get here with a content-box, we're seeking \"padding\" or \"border\" or \"margin\"\n\t\tif ( !isBorderBox ) {\n\n\t\t\t// Add padding\n\t\t\tdelta += jQuery.css( elem, \"padding\" + cssExpand[ i ], true, styles );\n\n\t\t\t// For \"border\" or \"margin\", add border\n\t\t\tif ( box !== \"padding\" ) {\n\t\t\t\tdelta += jQuery.css( elem, \"border\" + cssExpand[ i ] + \"Width\", true, styles );\n\n\t\t\t// But still keep track of it otherwise\n\t\t\t} else {\n\t\t\t\textra += jQuery.css( elem, \"border\" + cssExpand[ i ] + \"Width\", true, styles );\n\t\t\t}\n\n\t\t// If we get here with a border-box (content + padding + border), we're seeking \"content\" or\n\t\t// \"padding\" or \"margin\"\n\t\t} else {\n\n\t\t\t// For \"content\", subtract padding\n\t\t\tif ( box === \"content\" ) {\n\t\t\t\tdelta -= jQuery.css( elem, \"padding\" + cssExpand[ i ], true, styles );\n\t\t\t}\n\n\t\t\t// For \"content\" or \"padding\", subtract border\n\t\t\tif ( box !== \"margin\" ) {\n\t\t\t\tdelta -= jQuery.css( elem, \"border\" + cssExpand[ i ] + \"Width\", true, styles );\n\t\t\t}\n\t\t}\n\t}\n\n\t// Account for positive content-box scroll gutter when requested by providing computedVal\n\tif ( !isBorderBox && computedVal >= 0 ) {\n\n\t\t// offsetWidth/offsetHeight is a rounded sum of content, padding, scroll gutter, and border\n\t\t// Assuming integer scroll gutter, subtract the rest and round down\n\t\tdelta += Math.max( 0, Math.ceil(\n\t\t\telem[ \"offset\" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] -\n\t\t\tcomputedVal -\n\t\t\tdelta -\n\t\t\textra -\n\t\t\t0.5\n\n\t\t// If offsetWidth/offsetHeight is unknown, then we can't determine content-box scroll gutter\n\t\t// Use an explicit zero to avoid NaN (gh-3964)\n\t\t) ) || 0;\n\t}\n\n\treturn delta + marginDelta;\n}\n\nfunction getWidthOrHeight( elem, dimension, extra ) {\n\n\t// Start with computed style\n\tvar styles = getStyles( elem ),\n\n\t\t// To avoid forcing a reflow, only fetch boxSizing if we need it (gh-4322).\n\t\t// Fake content-box until we know it's needed to know the true value.\n\t\tboxSizingNeeded = !support.boxSizingReliable() || extra,\n\t\tisBorderBox = boxSizingNeeded &&\n\t\t\tjQuery.css( elem, \"boxSizing\", false, styles ) === \"border-box\",\n\t\tvalueIsBorderBox = isBorderBox,\n\n\t\tval = curCSS( elem, dimension, styles ),\n\t\toffsetProp = \"offset\" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 );\n\n\t// Support: Firefox <=54\n\t// Return a confounding non-pixel value or feign ignorance, as appropriate.\n\tif ( rnumnonpx.test( val ) ) {\n\t\tif ( !extra ) {\n\t\t\treturn val;\n\t\t}\n\t\tval = \"auto\";\n\t}\n\n\n\t// Support: IE 9 - 11 only\n\t// Use offsetWidth/offsetHeight for when box sizing is unreliable.\n\t// In those cases, the computed value can be trusted to be border-box.\n\tif ( ( !support.boxSizingReliable() && isBorderBox ||\n\n\t\t// Support: IE 10 - 11+, Edge 15 - 18+\n\t\t// IE/Edge misreport `getComputedStyle` of table rows with width/height\n\t\t// set in CSS while `offset*` properties report correct values.\n\t\t// Interestingly, in some cases IE 9 doesn't suffer from this issue.\n\t\t!support.reliableTrDimensions() && nodeName( elem, \"tr\" ) ||\n\n\t\t// Fall back to offsetWidth/offsetHeight when value is \"auto\"\n\t\t// This happens for inline elements with no explicit setting (gh-3571)\n\t\tval === \"auto\" ||\n\n\t\t// Support: Android <=4.1 - 4.3 only\n\t\t// Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602)\n\t\t!parseFloat( val ) && jQuery.css( elem, \"display\", false, styles ) === \"inline\" ) &&\n\n\t\t// Make sure the element is visible & connected\n\t\telem.getClientRects().length ) {\n\n\t\tisBorderBox = jQuery.css( elem, \"boxSizing\", false, styles ) === \"border-box\";\n\n\t\t// Where available, offsetWidth/offsetHeight approximate border box dimensions.\n\t\t// Where not available (e.g., SVG), assume unreliable box-sizing and interpret the\n\t\t// retrieved value as a content box dimension.\n\t\tvalueIsBorderBox = offsetProp in elem;\n\t\tif ( valueIsBorderBox ) {\n\t\t\tval = elem[ offsetProp ];\n\t\t}\n\t}\n\n\t// Normalize \"\" and auto\n\tval = parseFloat( val ) || 0;\n\n\t// Adjust for the element's box model\n\treturn ( val +\n\t\tboxModelAdjustment(\n\t\t\telem,\n\t\t\tdimension,\n\t\t\textra || ( isBorderBox ? \"border\" : \"content\" ),\n\t\t\tvalueIsBorderBox,\n\t\t\tstyles,\n\n\t\t\t// Provide the current computed size to request scroll gutter calculation (gh-3589)\n\t\t\tval\n\t\t)\n\t) + \"px\";\n}\n\njQuery.extend( {\n\n\t// Add in style property hooks for overriding the default\n\t// behavior of getting and setting a style property\n\tcssHooks: {\n\t\topacity: {\n\t\t\tget: function( elem, computed ) {\n\t\t\t\tif ( computed ) {\n\n\t\t\t\t\t// We should always get a number back from opacity\n\t\t\t\t\tvar ret = curCSS( elem, \"opacity\" );\n\t\t\t\t\treturn ret === \"\" ? \"1\" : ret;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\n\t// Don't automatically add \"px\" to these possibly-unitless properties\n\tcssNumber: {\n\t\tanimationIterationCount: true,\n\t\taspectRatio: true,\n\t\tborderImageSlice: true,\n\t\tcolumnCount: true,\n\t\tflexGrow: true,\n\t\tflexShrink: true,\n\t\tfontWeight: true,\n\t\tgridArea: true,\n\t\tgridColumn: true,\n\t\tgridColumnEnd: true,\n\t\tgridColumnStart: true,\n\t\tgridRow: true,\n\t\tgridRowEnd: true,\n\t\tgridRowStart: true,\n\t\tlineHeight: true,\n\t\topacity: true,\n\t\torder: true,\n\t\torphans: true,\n\t\tscale: true,\n\t\twidows: true,\n\t\tzIndex: true,\n\t\tzoom: true,\n\n\t\t// SVG-related\n\t\tfillOpacity: true,\n\t\tfloodOpacity: true,\n\t\tstopOpacity: true,\n\t\tstrokeMiterlimit: true,\n\t\tstrokeOpacity: true\n\t},\n\n\t// Add in properties whose names you wish to fix before\n\t// setting or getting the value\n\tcssProps: {},\n\n\t// Get and set the style property on a DOM Node\n\tstyle: function( elem, name, value, extra ) {\n\n\t\t// Don't set styles on text and comment nodes\n\t\tif ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Make sure that we're working with the right name\n\t\tvar ret, type, hooks,\n\t\t\torigName = camelCase( name ),\n\t\t\tisCustomProp = rcustomProp.test( name ),\n\t\t\tstyle = elem.style;\n\n\t\t// Make sure that we're working with the right name. We don't\n\t\t// want to query the value if it is a CSS custom property\n\t\t// since they are user-defined.\n\t\tif ( !isCustomProp ) {\n\t\t\tname = finalPropName( origName );\n\t\t}\n\n\t\t// Gets hook for the prefixed version, then unprefixed version\n\t\thooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];\n\n\t\t// Check if we're setting a value\n\t\tif ( value !== undefined ) {\n\t\t\ttype = typeof value;\n\n\t\t\t// Convert \"+=\" or \"-=\" to relative numbers (trac-7345)\n\t\t\tif ( type === \"string\" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) {\n\t\t\t\tvalue = adjustCSS( elem, name, ret );\n\n\t\t\t\t// Fixes bug trac-9237\n\t\t\t\ttype = \"number\";\n\t\t\t}\n\n\t\t\t// Make sure that null and NaN values aren't set (trac-7116)\n\t\t\tif ( value == null || value !== value ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// If a number was passed in, add the unit (except for certain CSS properties)\n\t\t\t// The isCustomProp check can be removed in jQuery 4.0 when we only auto-append\n\t\t\t// \"px\" to a few hardcoded values.\n\t\t\tif ( type === \"number\" && !isCustomProp ) {\n\t\t\t\tvalue += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? \"\" : \"px\" );\n\t\t\t}\n\n\t\t\t// background-* props affect original clone's values\n\t\t\tif ( !support.clearCloneStyle && value === \"\" && name.indexOf( \"background\" ) === 0 ) {\n\t\t\t\tstyle[ name ] = \"inherit\";\n\t\t\t}\n\n\t\t\t// If a hook was provided, use that value, otherwise just set the specified value\n\t\t\tif ( !hooks || !( \"set\" in hooks ) ||\n\t\t\t\t( value = hooks.set( elem, value, extra ) ) !== undefined ) {\n\n\t\t\t\tif ( isCustomProp ) {\n\t\t\t\t\tstyle.setProperty( name, value );\n\t\t\t\t} else {\n\t\t\t\t\tstyle[ name ] = value;\n\t\t\t\t}\n\t\t\t}\n\n\t\t} else {\n\n\t\t\t// If a hook was provided get the non-computed value from there\n\t\t\tif ( hooks && \"get\" in hooks &&\n\t\t\t\t( ret = hooks.get( elem, false, extra ) ) !== undefined ) {\n\n\t\t\t\treturn ret;\n\t\t\t}\n\n\t\t\t// Otherwise just get the value from the style object\n\t\t\treturn style[ name ];\n\t\t}\n\t},\n\n\tcss: function( elem, name, extra, styles ) {\n\t\tvar val, num, hooks,\n\t\t\torigName = camelCase( name ),\n\t\t\tisCustomProp = rcustomProp.test( name );\n\n\t\t// Make sure that we're working with the right name. We don't\n\t\t// want to modify the value if it is a CSS custom property\n\t\t// since they are user-defined.\n\t\tif ( !isCustomProp ) {\n\t\t\tname = finalPropName( origName );\n\t\t}\n\n\t\t// Try prefixed name followed by the unprefixed name\n\t\thooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];\n\n\t\t// If a hook was provided get the computed value from there\n\t\tif ( hooks && \"get\" in hooks ) {\n\t\t\tval = hooks.get( elem, true, extra );\n\t\t}\n\n\t\t// Otherwise, if a way to get the computed value exists, use that\n\t\tif ( val === undefined ) {\n\t\t\tval = curCSS( elem, name, styles );\n\t\t}\n\n\t\t// Convert \"normal\" to computed value\n\t\tif ( val === \"normal\" && name in cssNormalTransform ) {\n\t\t\tval = cssNormalTransform[ name ];\n\t\t}\n\n\t\t// Make numeric if forced or a qualifier was provided and val looks numeric\n\t\tif ( extra === \"\" || extra ) {\n\t\t\tnum = parseFloat( val );\n\t\t\treturn extra === true || isFinite( num ) ? num || 0 : val;\n\t\t}\n\n\t\treturn val;\n\t}\n} );\n\njQuery.each( [ \"height\", \"width\" ], function( _i, dimension ) {\n\tjQuery.cssHooks[ dimension ] = {\n\t\tget: function( elem, computed, extra ) {\n\t\t\tif ( computed ) {\n\n\t\t\t\t// Certain elements can have dimension info if we invisibly show them\n\t\t\t\t// but it must have a current display style that would benefit\n\t\t\t\treturn rdisplayswap.test( jQuery.css( elem, \"display\" ) ) &&\n\n\t\t\t\t\t// Support: Safari 8+\n\t\t\t\t\t// Table columns in Safari have non-zero offsetWidth & zero\n\t\t\t\t\t// getBoundingClientRect().width unless display is changed.\n\t\t\t\t\t// Support: IE <=11 only\n\t\t\t\t\t// Running getBoundingClientRect on a disconnected node\n\t\t\t\t\t// in IE throws an error.\n\t\t\t\t\t( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ?\n\t\t\t\t\tswap( elem, cssShow, function() {\n\t\t\t\t\t\treturn getWidthOrHeight( elem, dimension, extra );\n\t\t\t\t\t} ) :\n\t\t\t\t\tgetWidthOrHeight( elem, dimension, extra );\n\t\t\t}\n\t\t},\n\n\t\tset: function( elem, value, extra ) {\n\t\t\tvar matches,\n\t\t\t\tstyles = getStyles( elem ),\n\n\t\t\t\t// Only read styles.position if the test has a chance to fail\n\t\t\t\t// to avoid forcing a reflow.\n\t\t\t\tscrollboxSizeBuggy = !support.scrollboxSize() &&\n\t\t\t\t\tstyles.position === \"absolute\",\n\n\t\t\t\t// To avoid forcing a reflow, only fetch boxSizing if we need it (gh-3991)\n\t\t\t\tboxSizingNeeded = scrollboxSizeBuggy || extra,\n\t\t\t\tisBorderBox = boxSizingNeeded &&\n\t\t\t\t\tjQuery.css( elem, \"boxSizing\", false, styles ) === \"border-box\",\n\t\t\t\tsubtract = extra ?\n\t\t\t\t\tboxModelAdjustment(\n\t\t\t\t\t\telem,\n\t\t\t\t\t\tdimension,\n\t\t\t\t\t\textra,\n\t\t\t\t\t\tisBorderBox,\n\t\t\t\t\t\tstyles\n\t\t\t\t\t) :\n\t\t\t\t\t0;\n\n\t\t\t// Account for unreliable border-box dimensions by comparing offset* to computed and\n\t\t\t// faking a content-box to get border and padding (gh-3699)\n\t\t\tif ( isBorderBox && scrollboxSizeBuggy ) {\n\t\t\t\tsubtract -= Math.ceil(\n\t\t\t\t\telem[ \"offset\" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] -\n\t\t\t\t\tparseFloat( styles[ dimension ] ) -\n\t\t\t\t\tboxModelAdjustment( elem, dimension, \"border\", false, styles ) -\n\t\t\t\t\t0.5\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Convert to pixels if value adjustment is needed\n\t\t\tif ( subtract && ( matches = rcssNum.exec( value ) ) &&\n\t\t\t\t( matches[ 3 ] || \"px\" ) !== \"px\" ) {\n\n\t\t\t\telem.style[ dimension ] = value;\n\t\t\t\tvalue = jQuery.css( elem, dimension );\n\t\t\t}\n\n\t\t\treturn setPositiveNumber( elem, value, subtract );\n\t\t}\n\t};\n} );\n\njQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft,\n\tfunction( elem, computed ) {\n\t\tif ( computed ) {\n\t\t\treturn ( parseFloat( curCSS( elem, \"marginLeft\" ) ) ||\n\t\t\t\telem.getBoundingClientRect().left -\n\t\t\t\t\tswap( elem, { marginLeft: 0 }, function() {\n\t\t\t\t\t\treturn elem.getBoundingClientRect().left;\n\t\t\t\t\t} )\n\t\t\t) + \"px\";\n\t\t}\n\t}\n);\n\n// These hooks are used by animate to expand properties\njQuery.each( {\n\tmargin: \"\",\n\tpadding: \"\",\n\tborder: \"Width\"\n}, function( prefix, suffix ) {\n\tjQuery.cssHooks[ prefix + suffix ] = {\n\t\texpand: function( value ) {\n\t\t\tvar i = 0,\n\t\t\t\texpanded = {},\n\n\t\t\t\t// Assumes a single number if not a string\n\t\t\t\tparts = typeof value === \"string\" ? value.split( \" \" ) : [ value ];\n\n\t\t\tfor ( ; i < 4; i++ ) {\n\t\t\t\texpanded[ prefix + cssExpand[ i ] + suffix ] =\n\t\t\t\t\tparts[ i ] || parts[ i - 2 ] || parts[ 0 ];\n\t\t\t}\n\n\t\t\treturn expanded;\n\t\t}\n\t};\n\n\tif ( prefix !== \"margin\" ) {\n\t\tjQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;\n\t}\n} );\n\njQuery.fn.extend( {\n\tcss: function( name, value ) {\n\t\treturn access( this, function( elem, name, value ) {\n\t\t\tvar styles, len,\n\t\t\t\tmap = {},\n\t\t\t\ti = 0;\n\n\t\t\tif ( Array.isArray( name ) ) {\n\t\t\t\tstyles = getStyles( elem );\n\t\t\t\tlen = name.length;\n\n\t\t\t\tfor ( ; i < len; i++ ) {\n\t\t\t\t\tmap[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );\n\t\t\t\t}\n\n\t\t\t\treturn map;\n\t\t\t}\n\n\t\t\treturn value !== undefined ?\n\t\t\t\tjQuery.style( elem, name, value ) :\n\t\t\t\tjQuery.css( elem, name );\n\t\t}, name, value, arguments.length > 1 );\n\t}\n} );\n\n\nfunction Tween( elem, options, prop, end, easing ) {\n\treturn new Tween.prototype.init( elem, options, prop, end, easing );\n}\njQuery.Tween = Tween;\n\nTween.prototype = {\n\tconstructor: Tween,\n\tinit: function( elem, options, prop, end, easing, unit ) {\n\t\tthis.elem = elem;\n\t\tthis.prop = prop;\n\t\tthis.easing = easing || jQuery.easing._default;\n\t\tthis.options = options;\n\t\tthis.start = this.now = this.cur();\n\t\tthis.end = end;\n\t\tthis.unit = unit || ( jQuery.cssNumber[ prop ] ? \"\" : \"px\" );\n\t},\n\tcur: function() {\n\t\tvar hooks = Tween.propHooks[ this.prop ];\n\n\t\treturn hooks && hooks.get ?\n\t\t\thooks.get( this ) :\n\t\t\tTween.propHooks._default.get( this );\n\t},\n\trun: function( percent ) {\n\t\tvar eased,\n\t\t\thooks = Tween.propHooks[ this.prop ];\n\n\t\tif ( this.options.duration ) {\n\t\t\tthis.pos = eased = jQuery.easing[ this.easing ](\n\t\t\t\tpercent, this.options.duration * percent, 0, 1, this.options.duration\n\t\t\t);\n\t\t} else {\n\t\t\tthis.pos = eased = percent;\n\t\t}\n\t\tthis.now = ( this.end - this.start ) * eased + this.start;\n\n\t\tif ( this.options.step ) {\n\t\t\tthis.options.step.call( this.elem, this.now, this );\n\t\t}\n\n\t\tif ( hooks && hooks.set ) {\n\t\t\thooks.set( this );\n\t\t} else {\n\t\t\tTween.propHooks._default.set( this );\n\t\t}\n\t\treturn this;\n\t}\n};\n\nTween.prototype.init.prototype = Tween.prototype;\n\nTween.propHooks = {\n\t_default: {\n\t\tget: function( tween ) {\n\t\t\tvar result;\n\n\t\t\t// Use a property on the element directly when it is not a DOM element,\n\t\t\t// or when there is no matching style property that exists.\n\t\t\tif ( tween.elem.nodeType !== 1 ||\n\t\t\t\ttween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) {\n\t\t\t\treturn tween.elem[ tween.prop ];\n\t\t\t}\n\n\t\t\t// Passing an empty string as a 3rd parameter to .css will automatically\n\t\t\t// attempt a parseFloat and fallback to a string if the parse fails.\n\t\t\t// Simple values such as \"10px\" are parsed to Float;\n\t\t\t// complex values such as \"rotate(1rad)\" are returned as-is.\n\t\t\tresult = jQuery.css( tween.elem, tween.prop, \"\" );\n\n\t\t\t// Empty strings, null, undefined and \"auto\" are converted to 0.\n\t\t\treturn !result || result === \"auto\" ? 0 : result;\n\t\t},\n\t\tset: function( tween ) {\n\n\t\t\t// Use step hook for back compat.\n\t\t\t// Use cssHook if its there.\n\t\t\t// Use .style if available and use plain properties where available.\n\t\t\tif ( jQuery.fx.step[ tween.prop ] ) {\n\t\t\t\tjQuery.fx.step[ tween.prop ]( tween );\n\t\t\t} else if ( tween.elem.nodeType === 1 && (\n\t\t\t\tjQuery.cssHooks[ tween.prop ] ||\n\t\t\t\t\ttween.elem.style[ finalPropName( tween.prop ) ] != null ) ) {\n\t\t\t\tjQuery.style( tween.elem, tween.prop, tween.now + tween.unit );\n\t\t\t} else {\n\t\t\t\ttween.elem[ tween.prop ] = tween.now;\n\t\t\t}\n\t\t}\n\t}\n};\n\n// Support: IE <=9 only\n// Panic based approach to setting things on disconnected nodes\nTween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {\n\tset: function( tween ) {\n\t\tif ( tween.elem.nodeType && tween.elem.parentNode ) {\n\t\t\ttween.elem[ tween.prop ] = tween.now;\n\t\t}\n\t}\n};\n\njQuery.easing = {\n\tlinear: function( p ) {\n\t\treturn p;\n\t},\n\tswing: function( p ) {\n\t\treturn 0.5 - Math.cos( p * Math.PI ) / 2;\n\t},\n\t_default: \"swing\"\n};\n\njQuery.fx = Tween.prototype.init;\n\n// Back compat <1.8 extension point\njQuery.fx.step = {};\n\n\n\n\nvar\n\tfxNow, inProgress,\n\trfxtypes = /^(?:toggle|show|hide)$/,\n\trrun = /queueHooks$/;\n\nfunction schedule() {\n\tif ( inProgress ) {\n\t\tif ( document.hidden === false && window.requestAnimationFrame ) {\n\t\t\twindow.requestAnimationFrame( schedule );\n\t\t} else {\n\t\t\twindow.setTimeout( schedule, jQuery.fx.interval );\n\t\t}\n\n\t\tjQuery.fx.tick();\n\t}\n}\n\n// Animations created synchronously will run synchronously\nfunction createFxNow() {\n\twindow.setTimeout( function() {\n\t\tfxNow = undefined;\n\t} );\n\treturn ( fxNow = Date.now() );\n}\n\n// Generate parameters to create a standard animation\nfunction genFx( type, includeWidth ) {\n\tvar which,\n\t\ti = 0,\n\t\tattrs = { height: type };\n\n\t// If we include width, step value is 1 to do all cssExpand values,\n\t// otherwise step value is 2 to skip over Left and Right\n\tincludeWidth = includeWidth ? 1 : 0;\n\tfor ( ; i < 4; i += 2 - includeWidth ) {\n\t\twhich = cssExpand[ i ];\n\t\tattrs[ \"margin\" + which ] = attrs[ \"padding\" + which ] = type;\n\t}\n\n\tif ( includeWidth ) {\n\t\tattrs.opacity = attrs.width = type;\n\t}\n\n\treturn attrs;\n}\n\nfunction createTween( value, prop, animation ) {\n\tvar tween,\n\t\tcollection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ \"*\" ] ),\n\t\tindex = 0,\n\t\tlength = collection.length;\n\tfor ( ; index < length; index++ ) {\n\t\tif ( ( tween = collection[ index ].call( animation, prop, value ) ) ) {\n\n\t\t\t// We're done with this property\n\t\t\treturn tween;\n\t\t}\n\t}\n}\n\nfunction defaultPrefilter( elem, props, opts ) {\n\tvar prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display,\n\t\tisBox = \"width\" in props || \"height\" in props,\n\t\tanim = this,\n\t\torig = {},\n\t\tstyle = elem.style,\n\t\thidden = elem.nodeType && isHiddenWithinTree( elem ),\n\t\tdataShow = dataPriv.get( elem, \"fxshow\" );\n\n\t// Queue-skipping animations hijack the fx hooks\n\tif ( !opts.queue ) {\n\t\thooks = jQuery._queueHooks( elem, \"fx\" );\n\t\tif ( hooks.unqueued == null ) {\n\t\t\thooks.unqueued = 0;\n\t\t\toldfire = hooks.empty.fire;\n\t\t\thooks.empty.fire = function() {\n\t\t\t\tif ( !hooks.unqueued ) {\n\t\t\t\t\toldfire();\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t\thooks.unqueued++;\n\n\t\tanim.always( function() {\n\n\t\t\t// Ensure the complete handler is called before this completes\n\t\t\tanim.always( function() {\n\t\t\t\thooks.unqueued--;\n\t\t\t\tif ( !jQuery.queue( elem, \"fx\" ).length ) {\n\t\t\t\t\thooks.empty.fire();\n\t\t\t\t}\n\t\t\t} );\n\t\t} );\n\t}\n\n\t// Detect show/hide animations\n\tfor ( prop in props ) {\n\t\tvalue = props[ prop ];\n\t\tif ( rfxtypes.test( value ) ) {\n\t\t\tdelete props[ prop ];\n\t\t\ttoggle = toggle || value === \"toggle\";\n\t\t\tif ( value === ( hidden ? \"hide\" : \"show\" ) ) {\n\n\t\t\t\t// Pretend to be hidden if this is a \"show\" and\n\t\t\t\t// there is still data from a stopped show/hide\n\t\t\t\tif ( value === \"show\" && dataShow && dataShow[ prop ] !== undefined ) {\n\t\t\t\t\thidden = true;\n\n\t\t\t\t// Ignore all other no-op show/hide data\n\t\t\t\t} else {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\torig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );\n\t\t}\n\t}\n\n\t// Bail out if this is a no-op like .hide().hide()\n\tpropTween = !jQuery.isEmptyObject( props );\n\tif ( !propTween && jQuery.isEmptyObject( orig ) ) {\n\t\treturn;\n\t}\n\n\t// Restrict \"overflow\" and \"display\" styles during box animations\n\tif ( isBox && elem.nodeType === 1 ) {\n\n\t\t// Support: IE <=9 - 11, Edge 12 - 15\n\t\t// Record all 3 overflow attributes because IE does not infer the shorthand\n\t\t// from identically-valued overflowX and overflowY and Edge just mirrors\n\t\t// the overflowX value there.\n\t\topts.overflow = [ style.overflow, style.overflowX, style.overflowY ];\n\n\t\t// Identify a display type, preferring old show/hide data over the CSS cascade\n\t\trestoreDisplay = dataShow && dataShow.display;\n\t\tif ( restoreDisplay == null ) {\n\t\t\trestoreDisplay = dataPriv.get( elem, \"display\" );\n\t\t}\n\t\tdisplay = jQuery.css( elem, \"display\" );\n\t\tif ( display === \"none\" ) {\n\t\t\tif ( restoreDisplay ) {\n\t\t\t\tdisplay = restoreDisplay;\n\t\t\t} else {\n\n\t\t\t\t// Get nonempty value(s) by temporarily forcing visibility\n\t\t\t\tshowHide( [ elem ], true );\n\t\t\t\trestoreDisplay = elem.style.display || restoreDisplay;\n\t\t\t\tdisplay = jQuery.css( elem, \"display\" );\n\t\t\t\tshowHide( [ elem ] );\n\t\t\t}\n\t\t}\n\n\t\t// Animate inline elements as inline-block\n\t\tif ( display === \"inline\" || display === \"inline-block\" && restoreDisplay != null ) {\n\t\t\tif ( jQuery.css( elem, \"float\" ) === \"none\" ) {\n\n\t\t\t\t// Restore the original display value at the end of pure show/hide animations\n\t\t\t\tif ( !propTween ) {\n\t\t\t\t\tanim.done( function() {\n\t\t\t\t\t\tstyle.display = restoreDisplay;\n\t\t\t\t\t} );\n\t\t\t\t\tif ( restoreDisplay == null ) {\n\t\t\t\t\t\tdisplay = style.display;\n\t\t\t\t\t\trestoreDisplay = display === \"none\" ? \"\" : display;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tstyle.display = \"inline-block\";\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( opts.overflow ) {\n\t\tstyle.overflow = \"hidden\";\n\t\tanim.always( function() {\n\t\t\tstyle.overflow = opts.overflow[ 0 ];\n\t\t\tstyle.overflowX = opts.overflow[ 1 ];\n\t\t\tstyle.overflowY = opts.overflow[ 2 ];\n\t\t} );\n\t}\n\n\t// Implement show/hide animations\n\tpropTween = false;\n\tfor ( prop in orig ) {\n\n\t\t// General show/hide setup for this element animation\n\t\tif ( !propTween ) {\n\t\t\tif ( dataShow ) {\n\t\t\t\tif ( \"hidden\" in dataShow ) {\n\t\t\t\t\thidden = dataShow.hidden;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tdataShow = dataPriv.access( elem, \"fxshow\", { display: restoreDisplay } );\n\t\t\t}\n\n\t\t\t// Store hidden/visible for toggle so `.stop().toggle()` \"reverses\"\n\t\t\tif ( toggle ) {\n\t\t\t\tdataShow.hidden = !hidden;\n\t\t\t}\n\n\t\t\t// Show elements before animating them\n\t\t\tif ( hidden ) {\n\t\t\t\tshowHide( [ elem ], true );\n\t\t\t}\n\n\t\t\t/* eslint-disable no-loop-func */\n\n\t\t\tanim.done( function() {\n\n\t\t\t\t/* eslint-enable no-loop-func */\n\n\t\t\t\t// The final step of a \"hide\" animation is actually hiding the element\n\t\t\t\tif ( !hidden ) {\n\t\t\t\t\tshowHide( [ elem ] );\n\t\t\t\t}\n\t\t\t\tdataPriv.remove( elem, \"fxshow\" );\n\t\t\t\tfor ( prop in orig ) {\n\t\t\t\t\tjQuery.style( elem, prop, orig[ prop ] );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t\t// Per-property setup\n\t\tpropTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );\n\t\tif ( !( prop in dataShow ) ) {\n\t\t\tdataShow[ prop ] = propTween.start;\n\t\t\tif ( hidden ) {\n\t\t\t\tpropTween.end = propTween.start;\n\t\t\t\tpropTween.start = 0;\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction propFilter( props, specialEasing ) {\n\tvar index, name, easing, value, hooks;\n\n\t// camelCase, specialEasing and expand cssHook pass\n\tfor ( index in props ) {\n\t\tname = camelCase( index );\n\t\teasing = specialEasing[ name ];\n\t\tvalue = props[ index ];\n\t\tif ( Array.isArray( value ) ) {\n\t\t\teasing = value[ 1 ];\n\t\t\tvalue = props[ index ] = value[ 0 ];\n\t\t}\n\n\t\tif ( index !== name ) {\n\t\t\tprops[ name ] = value;\n\t\t\tdelete props[ index ];\n\t\t}\n\n\t\thooks = jQuery.cssHooks[ name ];\n\t\tif ( hooks && \"expand\" in hooks ) {\n\t\t\tvalue = hooks.expand( value );\n\t\t\tdelete props[ name ];\n\n\t\t\t// Not quite $.extend, this won't overwrite existing keys.\n\t\t\t// Reusing 'index' because we have the correct \"name\"\n\t\t\tfor ( index in value ) {\n\t\t\t\tif ( !( index in props ) ) {\n\t\t\t\t\tprops[ index ] = value[ index ];\n\t\t\t\t\tspecialEasing[ index ] = easing;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tspecialEasing[ name ] = easing;\n\t\t}\n\t}\n}\n\nfunction Animation( elem, properties, options ) {\n\tvar result,\n\t\tstopped,\n\t\tindex = 0,\n\t\tlength = Animation.prefilters.length,\n\t\tdeferred = jQuery.Deferred().always( function() {\n\n\t\t\t// Don't match elem in the :animated selector\n\t\t\tdelete tick.elem;\n\t\t} ),\n\t\ttick = function() {\n\t\t\tif ( stopped ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tvar currentTime = fxNow || createFxNow(),\n\t\t\t\tremaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),\n\n\t\t\t\t// Support: Android 2.3 only\n\t\t\t\t// Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (trac-12497)\n\t\t\t\ttemp = remaining / animation.duration || 0,\n\t\t\t\tpercent = 1 - temp,\n\t\t\t\tindex = 0,\n\t\t\t\tlength = animation.tweens.length;\n\n\t\t\tfor ( ; index < length; index++ ) {\n\t\t\t\tanimation.tweens[ index ].run( percent );\n\t\t\t}\n\n\t\t\tdeferred.notifyWith( elem, [ animation, percent, remaining ] );\n\n\t\t\t// If there's more to do, yield\n\t\t\tif ( percent < 1 && length ) {\n\t\t\t\treturn remaining;\n\t\t\t}\n\n\t\t\t// If this was an empty animation, synthesize a final progress notification\n\t\t\tif ( !length ) {\n\t\t\t\tdeferred.notifyWith( elem, [ animation, 1, 0 ] );\n\t\t\t}\n\n\t\t\t// Resolve the animation and report its conclusion\n\t\t\tdeferred.resolveWith( elem, [ animation ] );\n\t\t\treturn false;\n\t\t},\n\t\tanimation = deferred.promise( {\n\t\t\telem: elem,\n\t\t\tprops: jQuery.extend( {}, properties ),\n\t\t\topts: jQuery.extend( true, {\n\t\t\t\tspecialEasing: {},\n\t\t\t\teasing: jQuery.easing._default\n\t\t\t}, options ),\n\t\t\toriginalProperties: properties,\n\t\t\toriginalOptions: options,\n\t\t\tstartTime: fxNow || createFxNow(),\n\t\t\tduration: options.duration,\n\t\t\ttweens: [],\n\t\t\tcreateTween: function( prop, end ) {\n\t\t\t\tvar tween = jQuery.Tween( elem, animation.opts, prop, end,\n\t\t\t\t\tanimation.opts.specialEasing[ prop ] || animation.opts.easing );\n\t\t\t\tanimation.tweens.push( tween );\n\t\t\t\treturn tween;\n\t\t\t},\n\t\t\tstop: function( gotoEnd ) {\n\t\t\t\tvar index = 0,\n\n\t\t\t\t\t// If we are going to the end, we want to run all the tweens\n\t\t\t\t\t// otherwise we skip this part\n\t\t\t\t\tlength = gotoEnd ? animation.tweens.length : 0;\n\t\t\t\tif ( stopped ) {\n\t\t\t\t\treturn this;\n\t\t\t\t}\n\t\t\t\tstopped = true;\n\t\t\t\tfor ( ; index < length; index++ ) {\n\t\t\t\t\tanimation.tweens[ index ].run( 1 );\n\t\t\t\t}\n\n\t\t\t\t// Resolve when we played the last frame; otherwise, reject\n\t\t\t\tif ( gotoEnd ) {\n\t\t\t\t\tdeferred.notifyWith( elem, [ animation, 1, 0 ] );\n\t\t\t\t\tdeferred.resolveWith( elem, [ animation, gotoEnd ] );\n\t\t\t\t} else {\n\t\t\t\t\tdeferred.rejectWith( elem, [ animation, gotoEnd ] );\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t}\n\t\t} ),\n\t\tprops = animation.props;\n\n\tpropFilter( props, animation.opts.specialEasing );\n\n\tfor ( ; index < length; index++ ) {\n\t\tresult = Animation.prefilters[ index ].call( animation, elem, props, animation.opts );\n\t\tif ( result ) {\n\t\t\tif ( isFunction( result.stop ) ) {\n\t\t\t\tjQuery._queueHooks( animation.elem, animation.opts.queue ).stop =\n\t\t\t\t\tresult.stop.bind( result );\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t}\n\n\tjQuery.map( props, createTween, animation );\n\n\tif ( isFunction( animation.opts.start ) ) {\n\t\tanimation.opts.start.call( elem, animation );\n\t}\n\n\t// Attach callbacks from options\n\tanimation\n\t\t.progress( animation.opts.progress )\n\t\t.done( animation.opts.done, animation.opts.complete )\n\t\t.fail( animation.opts.fail )\n\t\t.always( animation.opts.always );\n\n\tjQuery.fx.timer(\n\t\tjQuery.extend( tick, {\n\t\t\telem: elem,\n\t\t\tanim: animation,\n\t\t\tqueue: animation.opts.queue\n\t\t} )\n\t);\n\n\treturn animation;\n}\n\njQuery.Animation = jQuery.extend( Animation, {\n\n\ttweeners: {\n\t\t\"*\": [ function( prop, value ) {\n\t\t\tvar tween = this.createTween( prop, value );\n\t\t\tadjustCSS( tween.elem, prop, rcssNum.exec( value ), tween );\n\t\t\treturn tween;\n\t\t} ]\n\t},\n\n\ttweener: function( props, callback ) {\n\t\tif ( isFunction( props ) ) {\n\t\t\tcallback = props;\n\t\t\tprops = [ \"*\" ];\n\t\t} else {\n\t\t\tprops = props.match( rnothtmlwhite );\n\t\t}\n\n\t\tvar prop,\n\t\t\tindex = 0,\n\t\t\tlength = props.length;\n\n\t\tfor ( ; index < length; index++ ) {\n\t\t\tprop = props[ index ];\n\t\t\tAnimation.tweeners[ prop ] = Animation.tweeners[ prop ] || [];\n\t\t\tAnimation.tweeners[ prop ].unshift( callback );\n\t\t}\n\t},\n\n\tprefilters: [ defaultPrefilter ],\n\n\tprefilter: function( callback, prepend ) {\n\t\tif ( prepend ) {\n\t\t\tAnimation.prefilters.unshift( callback );\n\t\t} else {\n\t\t\tAnimation.prefilters.push( callback );\n\t\t}\n\t}\n} );\n\njQuery.speed = function( speed, easing, fn ) {\n\tvar opt = speed && typeof speed === \"object\" ? jQuery.extend( {}, speed ) : {\n\t\tcomplete: fn || !fn && easing ||\n\t\t\tisFunction( speed ) && speed,\n\t\tduration: speed,\n\t\teasing: fn && easing || easing && !isFunction( easing ) && easing\n\t};\n\n\t// Go to the end state if fx are off\n\tif ( jQuery.fx.off ) {\n\t\topt.duration = 0;\n\n\t} else {\n\t\tif ( typeof opt.duration !== \"number\" ) {\n\t\t\tif ( opt.duration in jQuery.fx.speeds ) {\n\t\t\t\topt.duration = jQuery.fx.speeds[ opt.duration ];\n\n\t\t\t} else {\n\t\t\t\topt.duration = jQuery.fx.speeds._default;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Normalize opt.queue - true/undefined/null -> \"fx\"\n\tif ( opt.queue == null || opt.queue === true ) {\n\t\topt.queue = \"fx\";\n\t}\n\n\t// Queueing\n\topt.old = opt.complete;\n\n\topt.complete = function() {\n\t\tif ( isFunction( opt.old ) ) {\n\t\t\topt.old.call( this );\n\t\t}\n\n\t\tif ( opt.queue ) {\n\t\t\tjQuery.dequeue( this, opt.queue );\n\t\t}\n\t};\n\n\treturn opt;\n};\n\njQuery.fn.extend( {\n\tfadeTo: function( speed, to, easing, callback ) {\n\n\t\t// Show any hidden elements after setting opacity to 0\n\t\treturn this.filter( isHiddenWithinTree ).css( \"opacity\", 0 ).show()\n\n\t\t\t// Animate to the value specified\n\t\t\t.end().animate( { opacity: to }, speed, easing, callback );\n\t},\n\tanimate: function( prop, speed, easing, callback ) {\n\t\tvar empty = jQuery.isEmptyObject( prop ),\n\t\t\toptall = jQuery.speed( speed, easing, callback ),\n\t\t\tdoAnimation = function() {\n\n\t\t\t\t// Operate on a copy of prop so per-property easing won't be lost\n\t\t\t\tvar anim = Animation( this, jQuery.extend( {}, prop ), optall );\n\n\t\t\t\t// Empty animations, or finishing resolves immediately\n\t\t\t\tif ( empty || dataPriv.get( this, \"finish\" ) ) {\n\t\t\t\t\tanim.stop( true );\n\t\t\t\t}\n\t\t\t};\n\n\t\tdoAnimation.finish = doAnimation;\n\n\t\treturn empty || optall.queue === false ?\n\t\t\tthis.each( doAnimation ) :\n\t\t\tthis.queue( optall.queue, doAnimation );\n\t},\n\tstop: function( type, clearQueue, gotoEnd ) {\n\t\tvar stopQueue = function( hooks ) {\n\t\t\tvar stop = hooks.stop;\n\t\t\tdelete hooks.stop;\n\t\t\tstop( gotoEnd );\n\t\t};\n\n\t\tif ( typeof type !== \"string\" ) {\n\t\t\tgotoEnd = clearQueue;\n\t\t\tclearQueue = type;\n\t\t\ttype = undefined;\n\t\t}\n\t\tif ( clearQueue ) {\n\t\t\tthis.queue( type || \"fx\", [] );\n\t\t}\n\n\t\treturn this.each( function() {\n\t\t\tvar dequeue = true,\n\t\t\t\tindex = type != null && type + \"queueHooks\",\n\t\t\t\ttimers = jQuery.timers,\n\t\t\t\tdata = dataPriv.get( this );\n\n\t\t\tif ( index ) {\n\t\t\t\tif ( data[ index ] && data[ index ].stop ) {\n\t\t\t\t\tstopQueue( data[ index ] );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor ( index in data ) {\n\t\t\t\t\tif ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {\n\t\t\t\t\t\tstopQueue( data[ index ] );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor ( index = timers.length; index--; ) {\n\t\t\t\tif ( timers[ index ].elem === this &&\n\t\t\t\t\t( type == null || timers[ index ].queue === type ) ) {\n\n\t\t\t\t\ttimers[ index ].anim.stop( gotoEnd );\n\t\t\t\t\tdequeue = false;\n\t\t\t\t\ttimers.splice( index, 1 );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Start the next in the queue if the last step wasn't forced.\n\t\t\t// Timers currently will call their complete callbacks, which\n\t\t\t// will dequeue but only if they were gotoEnd.\n\t\t\tif ( dequeue || !gotoEnd ) {\n\t\t\t\tjQuery.dequeue( this, type );\n\t\t\t}\n\t\t} );\n\t},\n\tfinish: function( type ) {\n\t\tif ( type !== false ) {\n\t\t\ttype = type || \"fx\";\n\t\t}\n\t\treturn this.each( function() {\n\t\t\tvar index,\n\t\t\t\tdata = dataPriv.get( this ),\n\t\t\t\tqueue = data[ type + \"queue\" ],\n\t\t\t\thooks = data[ type + \"queueHooks\" ],\n\t\t\t\ttimers = jQuery.timers,\n\t\t\t\tlength = queue ? queue.length : 0;\n\n\t\t\t// Enable finishing flag on private data\n\t\t\tdata.finish = true;\n\n\t\t\t// Empty the queue first\n\t\t\tjQuery.queue( this, type, [] );\n\n\t\t\tif ( hooks && hooks.stop ) {\n\t\t\t\thooks.stop.call( this, true );\n\t\t\t}\n\n\t\t\t// Look for any active animations, and finish them\n\t\t\tfor ( index = timers.length; index--; ) {\n\t\t\t\tif ( timers[ index ].elem === this && timers[ index ].queue === type ) {\n\t\t\t\t\ttimers[ index ].anim.stop( true );\n\t\t\t\t\ttimers.splice( index, 1 );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Look for any animations in the old queue and finish them\n\t\t\tfor ( index = 0; index < length; index++ ) {\n\t\t\t\tif ( queue[ index ] && queue[ index ].finish ) {\n\t\t\t\t\tqueue[ index ].finish.call( this );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Turn off finishing flag\n\t\t\tdelete data.finish;\n\t\t} );\n\t}\n} );\n\njQuery.each( [ \"toggle\", \"show\", \"hide\" ], function( _i, name ) {\n\tvar cssFn = jQuery.fn[ name ];\n\tjQuery.fn[ name ] = function( speed, easing, callback ) {\n\t\treturn speed == null || typeof speed === \"boolean\" ?\n\t\t\tcssFn.apply( this, arguments ) :\n\t\t\tthis.animate( genFx( name, true ), speed, easing, callback );\n\t};\n} );\n\n// Generate shortcuts for custom animations\njQuery.each( {\n\tslideDown: genFx( \"show\" ),\n\tslideUp: genFx( \"hide\" ),\n\tslideToggle: genFx( \"toggle\" ),\n\tfadeIn: { opacity: \"show\" },\n\tfadeOut: { opacity: \"hide\" },\n\tfadeToggle: { opacity: \"toggle\" }\n}, function( name, props ) {\n\tjQuery.fn[ name ] = function( speed, easing, callback ) {\n\t\treturn this.animate( props, speed, easing, callback );\n\t};\n} );\n\njQuery.timers = [];\njQuery.fx.tick = function() {\n\tvar timer,\n\t\ti = 0,\n\t\ttimers = jQuery.timers;\n\n\tfxNow = Date.now();\n\n\tfor ( ; i < timers.length; i++ ) {\n\t\ttimer = timers[ i ];\n\n\t\t// Run the timer and safely remove it when done (allowing for external removal)\n\t\tif ( !timer() && timers[ i ] === timer ) {\n\t\t\ttimers.splice( i--, 1 );\n\t\t}\n\t}\n\n\tif ( !timers.length ) {\n\t\tjQuery.fx.stop();\n\t}\n\tfxNow = undefined;\n};\n\njQuery.fx.timer = function( timer ) {\n\tjQuery.timers.push( timer );\n\tjQuery.fx.start();\n};\n\njQuery.fx.interval = 13;\njQuery.fx.start = function() {\n\tif ( inProgress ) {\n\t\treturn;\n\t}\n\n\tinProgress = true;\n\tschedule();\n};\n\njQuery.fx.stop = function() {\n\tinProgress = null;\n};\n\njQuery.fx.speeds = {\n\tslow: 600,\n\tfast: 200,\n\n\t// Default speed\n\t_default: 400\n};\n\n\n// Based off of the plugin by Clint Helfers, with permission.\njQuery.fn.delay = function( time, type ) {\n\ttime = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;\n\ttype = type || \"fx\";\n\n\treturn this.queue( type, function( next, hooks ) {\n\t\tvar timeout = window.setTimeout( next, time );\n\t\thooks.stop = function() {\n\t\t\twindow.clearTimeout( timeout );\n\t\t};\n\t} );\n};\n\n\n( function() {\n\tvar input = document.createElement( \"input\" ),\n\t\tselect = document.createElement( \"select\" ),\n\t\topt = select.appendChild( document.createElement( \"option\" ) );\n\n\tinput.type = \"checkbox\";\n\n\t// Support: Android <=4.3 only\n\t// Default value for a checkbox should be \"on\"\n\tsupport.checkOn = input.value !== \"\";\n\n\t// Support: IE <=11 only\n\t// Must access selectedIndex to make default options select\n\tsupport.optSelected = opt.selected;\n\n\t// Support: IE <=11 only\n\t// An input loses its value after becoming a radio\n\tinput = document.createElement( \"input\" );\n\tinput.value = \"t\";\n\tinput.type = \"radio\";\n\tsupport.radioValue = input.value === \"t\";\n} )();\n\n\nvar boolHook,\n\tattrHandle = jQuery.expr.attrHandle;\n\njQuery.fn.extend( {\n\tattr: function( name, value ) {\n\t\treturn access( this, jQuery.attr, name, value, arguments.length > 1 );\n\t},\n\n\tremoveAttr: function( name ) {\n\t\treturn this.each( function() {\n\t\t\tjQuery.removeAttr( this, name );\n\t\t} );\n\t}\n} );\n\njQuery.extend( {\n\tattr: function( elem, name, value ) {\n\t\tvar ret, hooks,\n\t\t\tnType = elem.nodeType;\n\n\t\t// Don't get/set attributes on text, comment and attribute nodes\n\t\tif ( nType === 3 || nType === 8 || nType === 2 ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Fallback to prop when attributes are not supported\n\t\tif ( typeof elem.getAttribute === \"undefined\" ) {\n\t\t\treturn jQuery.prop( elem, name, value );\n\t\t}\n\n\t\t// Attribute hooks are determined by the lowercase version\n\t\t// Grab necessary hook if one is defined\n\t\tif ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {\n\t\t\thooks = jQuery.attrHooks[ name.toLowerCase() ] ||\n\t\t\t\t( jQuery.expr.match.bool.test( name ) ? boolHook : undefined );\n\t\t}\n\n\t\tif ( value !== undefined ) {\n\t\t\tif ( value === null ) {\n\t\t\t\tjQuery.removeAttr( elem, name );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( hooks && \"set\" in hooks &&\n\t\t\t\t( ret = hooks.set( elem, value, name ) ) !== undefined ) {\n\t\t\t\treturn ret;\n\t\t\t}\n\n\t\t\telem.setAttribute( name, value + \"\" );\n\t\t\treturn value;\n\t\t}\n\n\t\tif ( hooks && \"get\" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {\n\t\t\treturn ret;\n\t\t}\n\n\t\tret = jQuery.find.attr( elem, name );\n\n\t\t// Non-existent attributes return null, we normalize to undefined\n\t\treturn ret == null ? undefined : ret;\n\t},\n\n\tattrHooks: {\n\t\ttype: {\n\t\t\tset: function( elem, value ) {\n\t\t\t\tif ( !support.radioValue && value === \"radio\" &&\n\t\t\t\t\tnodeName( elem, \"input\" ) ) {\n\t\t\t\t\tvar val = elem.value;\n\t\t\t\t\telem.setAttribute( \"type\", value );\n\t\t\t\t\tif ( val ) {\n\t\t\t\t\t\telem.value = val;\n\t\t\t\t\t}\n\t\t\t\t\treturn value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\n\tremoveAttr: function( elem, value ) {\n\t\tvar name,\n\t\t\ti = 0,\n\n\t\t\t// Attribute names can contain non-HTML whitespace characters\n\t\t\t// https://html.spec.whatwg.org/multipage/syntax.html#attributes-2\n\t\t\tattrNames = value && value.match( rnothtmlwhite );\n\n\t\tif ( attrNames && elem.nodeType === 1 ) {\n\t\t\twhile ( ( name = attrNames[ i++ ] ) ) {\n\t\t\t\telem.removeAttribute( name );\n\t\t\t}\n\t\t}\n\t}\n} );\n\n// Hooks for boolean attributes\nboolHook = {\n\tset: function( elem, value, name ) {\n\t\tif ( value === false ) {\n\n\t\t\t// Remove boolean attributes when set to false\n\t\t\tjQuery.removeAttr( elem, name );\n\t\t} else {\n\t\t\telem.setAttribute( name, name );\n\t\t}\n\t\treturn name;\n\t}\n};\n\njQuery.each( jQuery.expr.match.bool.source.match( /\\w+/g ), function( _i, name ) {\n\tvar getter = attrHandle[ name ] || jQuery.find.attr;\n\n\tattrHandle[ name ] = function( elem, name, isXML ) {\n\t\tvar ret, handle,\n\t\t\tlowercaseName = name.toLowerCase();\n\n\t\tif ( !isXML ) {\n\n\t\t\t// Avoid an infinite loop by temporarily removing this function from the getter\n\t\t\thandle = attrHandle[ lowercaseName ];\n\t\t\tattrHandle[ lowercaseName ] = ret;\n\t\t\tret = getter( elem, name, isXML ) != null ?\n\t\t\t\tlowercaseName :\n\t\t\t\tnull;\n\t\t\tattrHandle[ lowercaseName ] = handle;\n\t\t}\n\t\treturn ret;\n\t};\n} );\n\n\n\n\nvar rfocusable = /^(?:input|select|textarea|button)$/i,\n\trclickable = /^(?:a|area)$/i;\n\njQuery.fn.extend( {\n\tprop: function( name, value ) {\n\t\treturn access( this, jQuery.prop, name, value, arguments.length > 1 );\n\t},\n\n\tremoveProp: function( name ) {\n\t\treturn this.each( function() {\n\t\t\tdelete this[ jQuery.propFix[ name ] || name ];\n\t\t} );\n\t}\n} );\n\njQuery.extend( {\n\tprop: function( elem, name, value ) {\n\t\tvar ret, hooks,\n\t\t\tnType = elem.nodeType;\n\n\t\t// Don't get/set properties on text, comment and attribute nodes\n\t\tif ( nType === 3 || nType === 8 || nType === 2 ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {\n\n\t\t\t// Fix name and attach hooks\n\t\t\tname = jQuery.propFix[ name ] || name;\n\t\t\thooks = jQuery.propHooks[ name ];\n\t\t}\n\n\t\tif ( value !== undefined ) {\n\t\t\tif ( hooks && \"set\" in hooks &&\n\t\t\t\t( ret = hooks.set( elem, value, name ) ) !== undefined ) {\n\t\t\t\treturn ret;\n\t\t\t}\n\n\t\t\treturn ( elem[ name ] = value );\n\t\t}\n\n\t\tif ( hooks && \"get\" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {\n\t\t\treturn ret;\n\t\t}\n\n\t\treturn elem[ name ];\n\t},\n\n\tpropHooks: {\n\t\ttabIndex: {\n\t\t\tget: function( elem ) {\n\n\t\t\t\t// Support: IE <=9 - 11 only\n\t\t\t\t// elem.tabIndex doesn't always return the\n\t\t\t\t// correct value when it hasn't been explicitly set\n\t\t\t\t// Use proper attribute retrieval (trac-12072)\n\t\t\t\tvar tabindex = jQuery.find.attr( elem, \"tabindex\" );\n\n\t\t\t\tif ( tabindex ) {\n\t\t\t\t\treturn parseInt( tabindex, 10 );\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\trfocusable.test( elem.nodeName ) ||\n\t\t\t\t\trclickable.test( elem.nodeName ) &&\n\t\t\t\t\telem.href\n\t\t\t\t) {\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t}\n\t},\n\n\tpropFix: {\n\t\t\"for\": \"htmlFor\",\n\t\t\"class\": \"className\"\n\t}\n} );\n\n// Support: IE <=11 only\n// Accessing the selectedIndex property\n// forces the browser to respect setting selected\n// on the option\n// The getter ensures a default option is selected\n// when in an optgroup\n// eslint rule \"no-unused-expressions\" is disabled for this code\n// since it considers such accessions noop\nif ( !support.optSelected ) {\n\tjQuery.propHooks.selected = {\n\t\tget: function( elem ) {\n\n\t\t\t/* eslint no-unused-expressions: \"off\" */\n\n\t\t\tvar parent = elem.parentNode;\n\t\t\tif ( parent && parent.parentNode ) {\n\t\t\t\tparent.parentNode.selectedIndex;\n\t\t\t}\n\t\t\treturn null;\n\t\t},\n\t\tset: function( elem ) {\n\n\t\t\t/* eslint no-unused-expressions: \"off\" */\n\n\t\t\tvar parent = elem.parentNode;\n\t\t\tif ( parent ) {\n\t\t\t\tparent.selectedIndex;\n\n\t\t\t\tif ( parent.parentNode ) {\n\t\t\t\t\tparent.parentNode.selectedIndex;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n}\n\njQuery.each( [\n\t\"tabIndex\",\n\t\"readOnly\",\n\t\"maxLength\",\n\t\"cellSpacing\",\n\t\"cellPadding\",\n\t\"rowSpan\",\n\t\"colSpan\",\n\t\"useMap\",\n\t\"frameBorder\",\n\t\"contentEditable\"\n], function() {\n\tjQuery.propFix[ this.toLowerCase() ] = this;\n} );\n\n\n\n\n\t// Strip and collapse whitespace according to HTML spec\n\t// https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace\n\tfunction stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}\n\n\nfunction getClass( elem ) {\n\treturn elem.getAttribute && elem.getAttribute( \"class\" ) || \"\";\n}\n\nfunction classesToArray( value ) {\n\tif ( Array.isArray( value ) ) {\n\t\treturn value;\n\t}\n\tif ( typeof value === \"string\" ) {\n\t\treturn value.match( rnothtmlwhite ) || [];\n\t}\n\treturn [];\n}\n\njQuery.fn.extend( {\n\taddClass: function( value ) {\n\t\tvar classNames, cur, curValue, className, i, finalValue;\n\n\t\tif ( isFunction( value ) ) {\n\t\t\treturn this.each( function( j ) {\n\t\t\t\tjQuery( this ).addClass( value.call( this, j, getClass( this ) ) );\n\t\t\t} );\n\t\t}\n\n\t\tclassNames = classesToArray( value );\n\n\t\tif ( classNames.length ) {\n\t\t\treturn this.each( function() {\n\t\t\t\tcurValue = getClass( this );\n\t\t\t\tcur = this.nodeType === 1 && ( \" \" + stripAndCollapse( curValue ) + \" \" );\n\n\t\t\t\tif ( cur ) {\n\t\t\t\t\tfor ( i = 0; i < classNames.length; i++ ) {\n\t\t\t\t\t\tclassName = classNames[ i ];\n\t\t\t\t\t\tif ( cur.indexOf( \" \" + className + \" \" ) < 0 ) {\n\t\t\t\t\t\t\tcur += className + \" \";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Only assign if different to avoid unneeded rendering.\n\t\t\t\t\tfinalValue = stripAndCollapse( cur );\n\t\t\t\t\tif ( curValue !== finalValue ) {\n\t\t\t\t\t\tthis.setAttribute( \"class\", finalValue );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t\treturn this;\n\t},\n\n\tremoveClass: function( value ) {\n\t\tvar classNames, cur, curValue, className, i, finalValue;\n\n\t\tif ( isFunction( value ) ) {\n\t\t\treturn this.each( function( j ) {\n\t\t\t\tjQuery( this ).removeClass( value.call( this, j, getClass( this ) ) );\n\t\t\t} );\n\t\t}\n\n\t\tif ( !arguments.length ) {\n\t\t\treturn this.attr( \"class\", \"\" );\n\t\t}\n\n\t\tclassNames = classesToArray( value );\n\n\t\tif ( classNames.length ) {\n\t\t\treturn this.each( function() {\n\t\t\t\tcurValue = getClass( this );\n\n\t\t\t\t// This expression is here for better compressibility (see addClass)\n\t\t\t\tcur = this.nodeType === 1 && ( \" \" + stripAndCollapse( curValue ) + \" \" );\n\n\t\t\t\tif ( cur ) {\n\t\t\t\t\tfor ( i = 0; i < classNames.length; i++ ) {\n\t\t\t\t\t\tclassName = classNames[ i ];\n\n\t\t\t\t\t\t// Remove *all* instances\n\t\t\t\t\t\twhile ( cur.indexOf( \" \" + className + \" \" ) > -1 ) {\n\t\t\t\t\t\t\tcur = cur.replace( \" \" + className + \" \", \" \" );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Only assign if different to avoid unneeded rendering.\n\t\t\t\t\tfinalValue = stripAndCollapse( cur );\n\t\t\t\t\tif ( curValue !== finalValue ) {\n\t\t\t\t\t\tthis.setAttribute( \"class\", finalValue );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t\treturn this;\n\t},\n\n\ttoggleClass: function( value, stateVal ) {\n\t\tvar classNames, className, i, self,\n\t\t\ttype = typeof value,\n\t\t\tisValidValue = type === \"string\" || Array.isArray( value );\n\n\t\tif ( isFunction( value ) ) {\n\t\t\treturn this.each( function( i ) {\n\t\t\t\tjQuery( this ).toggleClass(\n\t\t\t\t\tvalue.call( this, i, getClass( this ), stateVal ),\n\t\t\t\t\tstateVal\n\t\t\t\t);\n\t\t\t} );\n\t\t}\n\n\t\tif ( typeof stateVal === \"boolean\" && isValidValue ) {\n\t\t\treturn stateVal ? this.addClass( value ) : this.removeClass( value );\n\t\t}\n\n\t\tclassNames = classesToArray( value );\n\n\t\treturn this.each( function() {\n\t\t\tif ( isValidValue ) {\n\n\t\t\t\t// Toggle individual class names\n\t\t\t\tself = jQuery( this );\n\n\t\t\t\tfor ( i = 0; i < classNames.length; i++ ) {\n\t\t\t\t\tclassName = classNames[ i ];\n\n\t\t\t\t\t// Check each className given, space separated list\n\t\t\t\t\tif ( self.hasClass( className ) ) {\n\t\t\t\t\t\tself.removeClass( className );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tself.addClass( className );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t// Toggle whole class name\n\t\t\t} else if ( value === undefined || type === \"boolean\" ) {\n\t\t\t\tclassName = getClass( this );\n\t\t\t\tif ( className ) {\n\n\t\t\t\t\t// Store className if set\n\t\t\t\t\tdataPriv.set( this, \"__className__\", className );\n\t\t\t\t}\n\n\t\t\t\t// If the element has a class name or if we're passed `false`,\n\t\t\t\t// then remove the whole classname (if there was one, the above saved it).\n\t\t\t\t// Otherwise bring back whatever was previously saved (if anything),\n\t\t\t\t// falling back to the empty string if nothing was stored.\n\t\t\t\tif ( this.setAttribute ) {\n\t\t\t\t\tthis.setAttribute( \"class\",\n\t\t\t\t\t\tclassName || value === false ?\n\t\t\t\t\t\t\t\"\" :\n\t\t\t\t\t\t\tdataPriv.get( this, \"__className__\" ) || \"\"\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t},\n\n\thasClass: function( selector ) {\n\t\tvar className, elem,\n\t\t\ti = 0;\n\n\t\tclassName = \" \" + selector + \" \";\n\t\twhile ( ( elem = this[ i++ ] ) ) {\n\t\t\tif ( elem.nodeType === 1 &&\n\t\t\t\t( \" \" + stripAndCollapse( getClass( elem ) ) + \" \" ).indexOf( className ) > -1 ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n} );\n\n\n\n\nvar rreturn = /\\r/g;\n\njQuery.fn.extend( {\n\tval: function( value ) {\n\t\tvar hooks, ret, valueIsFunction,\n\t\t\telem = this[ 0 ];\n\n\t\tif ( !arguments.length ) {\n\t\t\tif ( elem ) {\n\t\t\t\thooks = jQuery.valHooks[ elem.type ] ||\n\t\t\t\t\tjQuery.valHooks[ elem.nodeName.toLowerCase() ];\n\n\t\t\t\tif ( hooks &&\n\t\t\t\t\t\"get\" in hooks &&\n\t\t\t\t\t( ret = hooks.get( elem, \"value\" ) ) !== undefined\n\t\t\t\t) {\n\t\t\t\t\treturn ret;\n\t\t\t\t}\n\n\t\t\t\tret = elem.value;\n\n\t\t\t\t// Handle most common string cases\n\t\t\t\tif ( typeof ret === \"string\" ) {\n\t\t\t\t\treturn ret.replace( rreturn, \"\" );\n\t\t\t\t}\n\n\t\t\t\t// Handle cases where value is null/undef or number\n\t\t\t\treturn ret == null ? \"\" : ret;\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\tvalueIsFunction = isFunction( value );\n\n\t\treturn this.each( function( i ) {\n\t\t\tvar val;\n\n\t\t\tif ( this.nodeType !== 1 ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( valueIsFunction ) {\n\t\t\t\tval = value.call( this, i, jQuery( this ).val() );\n\t\t\t} else {\n\t\t\t\tval = value;\n\t\t\t}\n\n\t\t\t// Treat null/undefined as \"\"; convert numbers to string\n\t\t\tif ( val == null ) {\n\t\t\t\tval = \"\";\n\n\t\t\t} else if ( typeof val === \"number\" ) {\n\t\t\t\tval += \"\";\n\n\t\t\t} else if ( Array.isArray( val ) ) {\n\t\t\t\tval = jQuery.map( val, function( value ) {\n\t\t\t\t\treturn value == null ? \"\" : value + \"\";\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\thooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];\n\n\t\t\t// If set returns undefined, fall back to normal setting\n\t\t\tif ( !hooks || !( \"set\" in hooks ) || hooks.set( this, val, \"value\" ) === undefined ) {\n\t\t\t\tthis.value = val;\n\t\t\t}\n\t\t} );\n\t}\n} );\n\njQuery.extend( {\n\tvalHooks: {\n\t\toption: {\n\t\t\tget: function( elem ) {\n\n\t\t\t\tvar val = jQuery.find.attr( elem, \"value\" );\n\t\t\t\treturn val != null ?\n\t\t\t\t\tval :\n\n\t\t\t\t\t// Support: IE <=10 - 11 only\n\t\t\t\t\t// option.text throws exceptions (trac-14686, trac-14858)\n\t\t\t\t\t// Strip and collapse whitespace\n\t\t\t\t\t// https://html.spec.whatwg.org/#strip-and-collapse-whitespace\n\t\t\t\t\tstripAndCollapse( jQuery.text( elem ) );\n\t\t\t}\n\t\t},\n\t\tselect: {\n\t\t\tget: function( elem ) {\n\t\t\t\tvar value, option, i,\n\t\t\t\t\toptions = elem.options,\n\t\t\t\t\tindex = elem.selectedIndex,\n\t\t\t\t\tone = elem.type === \"select-one\",\n\t\t\t\t\tvalues = one ? null : [],\n\t\t\t\t\tmax = one ? index + 1 : options.length;\n\n\t\t\t\tif ( index < 0 ) {\n\t\t\t\t\ti = max;\n\n\t\t\t\t} else {\n\t\t\t\t\ti = one ? index : 0;\n\t\t\t\t}\n\n\t\t\t\t// Loop through all the selected options\n\t\t\t\tfor ( ; i < max; i++ ) {\n\t\t\t\t\toption = options[ i ];\n\n\t\t\t\t\t// Support: IE <=9 only\n\t\t\t\t\t// IE8-9 doesn't update selected after form reset (trac-2551)\n\t\t\t\t\tif ( ( option.selected || i === index ) &&\n\n\t\t\t\t\t\t\t// Don't return options that are disabled or in a disabled optgroup\n\t\t\t\t\t\t\t!option.disabled &&\n\t\t\t\t\t\t\t( !option.parentNode.disabled ||\n\t\t\t\t\t\t\t\t!nodeName( option.parentNode, \"optgroup\" ) ) ) {\n\n\t\t\t\t\t\t// Get the specific value for the option\n\t\t\t\t\t\tvalue = jQuery( option ).val();\n\n\t\t\t\t\t\t// We don't need an array for one selects\n\t\t\t\t\t\tif ( one ) {\n\t\t\t\t\t\t\treturn value;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Multi-Selects return an array\n\t\t\t\t\t\tvalues.push( value );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn values;\n\t\t\t},\n\n\t\t\tset: function( elem, value ) {\n\t\t\t\tvar optionSet, option,\n\t\t\t\t\toptions = elem.options,\n\t\t\t\t\tvalues = jQuery.makeArray( value ),\n\t\t\t\t\ti = options.length;\n\n\t\t\t\twhile ( i-- ) {\n\t\t\t\t\toption = options[ i ];\n\n\t\t\t\t\t/* eslint-disable no-cond-assign */\n\n\t\t\t\t\tif ( option.selected =\n\t\t\t\t\t\tjQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1\n\t\t\t\t\t) {\n\t\t\t\t\t\toptionSet = true;\n\t\t\t\t\t}\n\n\t\t\t\t\t/* eslint-enable no-cond-assign */\n\t\t\t\t}\n\n\t\t\t\t// Force browsers to behave consistently when non-matching value is set\n\t\t\t\tif ( !optionSet ) {\n\t\t\t\t\telem.selectedIndex = -1;\n\t\t\t\t}\n\t\t\t\treturn values;\n\t\t\t}\n\t\t}\n\t}\n} );\n\n// Radios and checkboxes getter/setter\njQuery.each( [ \"radio\", \"checkbox\" ], function() {\n\tjQuery.valHooks[ this ] = {\n\t\tset: function( elem, value ) {\n\t\t\tif ( Array.isArray( value ) ) {\n\t\t\t\treturn ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 );\n\t\t\t}\n\t\t}\n\t};\n\tif ( !support.checkOn ) {\n\t\tjQuery.valHooks[ this ].get = function( elem ) {\n\t\t\treturn elem.getAttribute( \"value\" ) === null ? \"on\" : elem.value;\n\t\t};\n\t}\n} );\n\n\n\n\n// Return jQuery for attributes-only inclusion\nvar location = window.location;\n\nvar nonce = { guid: Date.now() };\n\nvar rquery = ( /\\?/ );\n\n\n\n// Cross-browser xml parsing\njQuery.parseXML = function( data ) {\n\tvar xml, parserErrorElem;\n\tif ( !data || typeof data !== \"string\" ) {\n\t\treturn null;\n\t}\n\n\t// Support: IE 9 - 11 only\n\t// IE throws on parseFromString with invalid input.\n\ttry {\n\t\txml = ( new window.DOMParser() ).parseFromString( data, \"text/xml\" );\n\t} catch ( e ) {}\n\n\tparserErrorElem = xml && xml.getElementsByTagName( \"parsererror\" )[ 0 ];\n\tif ( !xml || parserErrorElem ) {\n\t\tjQuery.error( \"Invalid XML: \" + (\n\t\t\tparserErrorElem ?\n\t\t\t\tjQuery.map( parserErrorElem.childNodes, function( el ) {\n\t\t\t\t\treturn el.textContent;\n\t\t\t\t} ).join( \"\\n\" ) :\n\t\t\t\tdata\n\t\t) );\n\t}\n\treturn xml;\n};\n\n\nvar rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,\n\tstopPropagationCallback = function( e ) {\n\t\te.stopPropagation();\n\t};\n\njQuery.extend( jQuery.event, {\n\n\ttrigger: function( event, data, elem, onlyHandlers ) {\n\n\t\tvar i, cur, tmp, bubbleType, ontype, handle, special, lastElement,\n\t\t\teventPath = [ elem || document ],\n\t\t\ttype = hasOwn.call( event, \"type\" ) ? event.type : event,\n\t\t\tnamespaces = hasOwn.call( event, \"namespace\" ) ? event.namespace.split( \".\" ) : [];\n\n\t\tcur = lastElement = tmp = elem = elem || document;\n\n\t\t// Don't do events on text and comment nodes\n\t\tif ( elem.nodeType === 3 || elem.nodeType === 8 ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// focus/blur morphs to focusin/out; ensure we're not firing them right now\n\t\tif ( rfocusMorph.test( type + jQuery.event.triggered ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( type.indexOf( \".\" ) > -1 ) {\n\n\t\t\t// Namespaced trigger; create a regexp to match event type in handle()\n\t\t\tnamespaces = type.split( \".\" );\n\t\t\ttype = namespaces.shift();\n\t\t\tnamespaces.sort();\n\t\t}\n\t\tontype = type.indexOf( \":\" ) < 0 && \"on\" + type;\n\n\t\t// Caller can pass in a jQuery.Event object, Object, or just an event type string\n\t\tevent = event[ jQuery.expando ] ?\n\t\t\tevent :\n\t\t\tnew jQuery.Event( type, typeof event === \"object\" && event );\n\n\t\t// Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)\n\t\tevent.isTrigger = onlyHandlers ? 2 : 3;\n\t\tevent.namespace = namespaces.join( \".\" );\n\t\tevent.rnamespace = event.namespace ?\n\t\t\tnew RegExp( \"(^|\\\\.)\" + namespaces.join( \"\\\\.(?:.*\\\\.|)\" ) + \"(\\\\.|$)\" ) :\n\t\t\tnull;\n\n\t\t// Clean up the event in case it is being reused\n\t\tevent.result = undefined;\n\t\tif ( !event.target ) {\n\t\t\tevent.target = elem;\n\t\t}\n\n\t\t// Clone any incoming data and prepend the event, creating the handler arg list\n\t\tdata = data == null ?\n\t\t\t[ event ] :\n\t\t\tjQuery.makeArray( data, [ event ] );\n\n\t\t// Allow special events to draw outside the lines\n\t\tspecial = jQuery.event.special[ type ] || {};\n\t\tif ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Determine event propagation path in advance, per W3C events spec (trac-9951)\n\t\t// Bubble up to document, then to window; watch for a global ownerDocument var (trac-9724)\n\t\tif ( !onlyHandlers && !special.noBubble && !isWindow( elem ) ) {\n\n\t\t\tbubbleType = special.delegateType || type;\n\t\t\tif ( !rfocusMorph.test( bubbleType + type ) ) {\n\t\t\t\tcur = cur.parentNode;\n\t\t\t}\n\t\t\tfor ( ; cur; cur = cur.parentNode ) {\n\t\t\t\teventPath.push( cur );\n\t\t\t\ttmp = cur;\n\t\t\t}\n\n\t\t\t// Only add window if we got to document (e.g., not plain obj or detached DOM)\n\t\t\tif ( tmp === ( elem.ownerDocument || document ) ) {\n\t\t\t\teventPath.push( tmp.defaultView || tmp.parentWindow || window );\n\t\t\t}\n\t\t}\n\n\t\t// Fire handlers on the event path\n\t\ti = 0;\n\t\twhile ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) {\n\t\t\tlastElement = cur;\n\t\t\tevent.type = i > 1 ?\n\t\t\t\tbubbleType :\n\t\t\t\tspecial.bindType || type;\n\n\t\t\t// jQuery handler\n\t\t\thandle = ( dataPriv.get( cur, \"events\" ) || Object.create( null ) )[ event.type ] &&\n\t\t\t\tdataPriv.get( cur, \"handle\" );\n\t\t\tif ( handle ) {\n\t\t\t\thandle.apply( cur, data );\n\t\t\t}\n\n\t\t\t// Native handler\n\t\t\thandle = ontype && cur[ ontype ];\n\t\t\tif ( handle && handle.apply && acceptData( cur ) ) {\n\t\t\t\tevent.result = handle.apply( cur, data );\n\t\t\t\tif ( event.result === false ) {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tevent.type = type;\n\n\t\t// If nobody prevented the default action, do it now\n\t\tif ( !onlyHandlers && !event.isDefaultPrevented() ) {\n\n\t\t\tif ( ( !special._default ||\n\t\t\t\tspecial._default.apply( eventPath.pop(), data ) === false ) &&\n\t\t\t\tacceptData( elem ) ) {\n\n\t\t\t\t// Call a native DOM method on the target with the same name as the event.\n\t\t\t\t// Don't do default actions on window, that's where global variables be (trac-6170)\n\t\t\t\tif ( ontype && isFunction( elem[ type ] ) && !isWindow( elem ) ) {\n\n\t\t\t\t\t// Don't re-trigger an onFOO event when we call its FOO() method\n\t\t\t\t\ttmp = elem[ ontype ];\n\n\t\t\t\t\tif ( tmp ) {\n\t\t\t\t\t\telem[ ontype ] = null;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Prevent re-triggering of the same event, since we already bubbled it above\n\t\t\t\t\tjQuery.event.triggered = type;\n\n\t\t\t\t\tif ( event.isPropagationStopped() ) {\n\t\t\t\t\t\tlastElement.addEventListener( type, stopPropagationCallback );\n\t\t\t\t\t}\n\n\t\t\t\t\telem[ type ]();\n\n\t\t\t\t\tif ( event.isPropagationStopped() ) {\n\t\t\t\t\t\tlastElement.removeEventListener( type, stopPropagationCallback );\n\t\t\t\t\t}\n\n\t\t\t\t\tjQuery.event.triggered = undefined;\n\n\t\t\t\t\tif ( tmp ) {\n\t\t\t\t\t\telem[ ontype ] = tmp;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn event.result;\n\t},\n\n\t// Piggyback on a donor event to simulate a different one\n\t// Used only for `focus(in | out)` events\n\tsimulate: function( type, elem, event ) {\n\t\tvar e = jQuery.extend(\n\t\t\tnew jQuery.Event(),\n\t\t\tevent,\n\t\t\t{\n\t\t\t\ttype: type,\n\t\t\t\tisSimulated: true\n\t\t\t}\n\t\t);\n\n\t\tjQuery.event.trigger( e, null, elem );\n\t}\n\n} );\n\njQuery.fn.extend( {\n\n\ttrigger: function( type, data ) {\n\t\treturn this.each( function() {\n\t\t\tjQuery.event.trigger( type, data, this );\n\t\t} );\n\t},\n\ttriggerHandler: function( type, data ) {\n\t\tvar elem = this[ 0 ];\n\t\tif ( elem ) {\n\t\t\treturn jQuery.event.trigger( type, data, elem, true );\n\t\t}\n\t}\n} );\n\n\nvar\n\trbracket = /\\[\\]$/,\n\trCRLF = /\\r?\\n/g,\n\trsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,\n\trsubmittable = /^(?:input|select|textarea|keygen)/i;\n\nfunction buildParams( prefix, obj, traditional, add ) {\n\tvar name;\n\n\tif ( Array.isArray( obj ) ) {\n\n\t\t// Serialize array item.\n\t\tjQuery.each( obj, function( i, v ) {\n\t\t\tif ( traditional || rbracket.test( prefix ) ) {\n\n\t\t\t\t// Treat each array item as a scalar.\n\t\t\t\tadd( prefix, v );\n\n\t\t\t} else {\n\n\t\t\t\t// Item is non-scalar (array or object), encode its numeric index.\n\t\t\t\tbuildParams(\n\t\t\t\t\tprefix + \"[\" + ( typeof v === \"object\" && v != null ? i : \"\" ) + \"]\",\n\t\t\t\t\tv,\n\t\t\t\t\ttraditional,\n\t\t\t\t\tadd\n\t\t\t\t);\n\t\t\t}\n\t\t} );\n\n\t} else if ( !traditional && toType( obj ) === \"object\" ) {\n\n\t\t// Serialize object item.\n\t\tfor ( name in obj ) {\n\t\t\tbuildParams( prefix + \"[\" + name + \"]\", obj[ name ], traditional, add );\n\t\t}\n\n\t} else {\n\n\t\t// Serialize scalar item.\n\t\tadd( prefix, obj );\n\t}\n}\n\n// Serialize an array of form elements or a set of\n// key/values into a query string\njQuery.param = function( a, traditional ) {\n\tvar prefix,\n\t\ts = [],\n\t\tadd = function( key, valueOrFunction ) {\n\n\t\t\t// If value is a function, invoke it and use its return value\n\t\t\tvar value = isFunction( valueOrFunction ) ?\n\t\t\t\tvalueOrFunction() :\n\t\t\t\tvalueOrFunction;\n\n\t\t\ts[ s.length ] = encodeURIComponent( key ) + \"=\" +\n\t\t\t\tencodeURIComponent( value == null ? \"\" : value );\n\t\t};\n\n\tif ( a == null ) {\n\t\treturn \"\";\n\t}\n\n\t// If an array was passed in, assume that it is an array of form elements.\n\tif ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {\n\n\t\t// Serialize the form elements\n\t\tjQuery.each( a, function() {\n\t\t\tadd( this.name, this.value );\n\t\t} );\n\n\t} else {\n\n\t\t// If traditional, encode the \"old\" way (the way 1.3.2 or older\n\t\t// did it), otherwise encode params recursively.\n\t\tfor ( prefix in a ) {\n\t\t\tbuildParams( prefix, a[ prefix ], traditional, add );\n\t\t}\n\t}\n\n\t// Return the resulting serialization\n\treturn s.join( \"&\" );\n};\n\njQuery.fn.extend( {\n\tserialize: function() {\n\t\treturn jQuery.param( this.serializeArray() );\n\t},\n\tserializeArray: function() {\n\t\treturn this.map( function() {\n\n\t\t\t// Can add propHook for \"elements\" to filter or add form elements\n\t\t\tvar elements = jQuery.prop( this, \"elements\" );\n\t\t\treturn elements ? jQuery.makeArray( elements ) : this;\n\t\t} ).filter( function() {\n\t\t\tvar type = this.type;\n\n\t\t\t// Use .is( \":disabled\" ) so that fieldset[disabled] works\n\t\t\treturn this.name && !jQuery( this ).is( \":disabled\" ) &&\n\t\t\t\trsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&\n\t\t\t\t( this.checked || !rcheckableType.test( type ) );\n\t\t} ).map( function( _i, elem ) {\n\t\t\tvar val = jQuery( this ).val();\n\n\t\t\tif ( val == null ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif ( Array.isArray( val ) ) {\n\t\t\t\treturn jQuery.map( val, function( val ) {\n\t\t\t\t\treturn { name: elem.name, value: val.replace( rCRLF, \"\\r\\n\" ) };\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\treturn { name: elem.name, value: val.replace( rCRLF, \"\\r\\n\" ) };\n\t\t} ).get();\n\t}\n} );\n\n\nvar\n\tr20 = /%20/g,\n\trhash = /#.*$/,\n\trantiCache = /([?&])_=[^&]*/,\n\trheaders = /^(.*?):[ \\t]*([^\\r\\n]*)$/mg,\n\n\t// trac-7653, trac-8125, trac-8152: local protocol detection\n\trlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,\n\trnoContent = /^(?:GET|HEAD)$/,\n\trprotocol = /^\\/\\//,\n\n\t/* Prefilters\n\t * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)\n\t * 2) These are called:\n\t *    - BEFORE asking for a transport\n\t *    - AFTER param serialization (s.data is a string if s.processData is true)\n\t * 3) key is the dataType\n\t * 4) the catchall symbol \"*\" can be used\n\t * 5) execution will start with transport dataType and THEN continue down to \"*\" if needed\n\t */\n\tprefilters = {},\n\n\t/* Transports bindings\n\t * 1) key is the dataType\n\t * 2) the catchall symbol \"*\" can be used\n\t * 3) selection will start with transport dataType and THEN go to \"*\" if needed\n\t */\n\ttransports = {},\n\n\t// Avoid comment-prolog char sequence (trac-10098); must appease lint and evade compression\n\tallTypes = \"*/\".concat( \"*\" ),\n\n\t// Anchor tag for parsing the document origin\n\toriginAnchor = document.createElement( \"a\" );\n\noriginAnchor.href = location.href;\n\n// Base \"constructor\" for jQuery.ajaxPrefilter and jQuery.ajaxTransport\nfunction addToPrefiltersOrTransports( structure ) {\n\n\t// dataTypeExpression is optional and defaults to \"*\"\n\treturn function( dataTypeExpression, func ) {\n\n\t\tif ( typeof dataTypeExpression !== \"string\" ) {\n\t\t\tfunc = dataTypeExpression;\n\t\t\tdataTypeExpression = \"*\";\n\t\t}\n\n\t\tvar dataType,\n\t\t\ti = 0,\n\t\t\tdataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || [];\n\n\t\tif ( isFunction( func ) ) {\n\n\t\t\t// For each dataType in the dataTypeExpression\n\t\t\twhile ( ( dataType = dataTypes[ i++ ] ) ) {\n\n\t\t\t\t// Prepend if requested\n\t\t\t\tif ( dataType[ 0 ] === \"+\" ) {\n\t\t\t\t\tdataType = dataType.slice( 1 ) || \"*\";\n\t\t\t\t\t( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func );\n\n\t\t\t\t// Otherwise append\n\t\t\t\t} else {\n\t\t\t\t\t( structure[ dataType ] = structure[ dataType ] || [] ).push( func );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n}\n\n// Base inspection function for prefilters and transports\nfunction inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t} );\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}\n\n// A special extend for ajax options\n// that takes \"flat\" options (not to be deep extended)\n// Fixes trac-9887\nfunction ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}\n\n/* Handles responses to an ajax request:\n * - finds the right dataType (mediates between content-type and expected dataType)\n * - returns the corresponding response\n */\nfunction ajaxHandleResponses( s, jqXHR, responses ) {\n\n\tvar ct, type, finalDataType, firstDataType,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}\n\n/* Chain conversions given the request and the original response\n * Also sets the responseXXX fields on the jqXHR instance\n */\nfunction ajaxConvert( s, response, jqXHR, isSuccess ) {\n\tvar conv2, current, conv, tmp, prev,\n\t\tconverters = {},\n\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice();\n\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\n\tcurrent = dataTypes.shift();\n\n\t// Convert to each sequential dataType\n\twhile ( current ) {\n\n\t\tif ( s.responseFields[ current ] ) {\n\t\t\tjqXHR[ s.responseFields[ current ] ] = response;\n\t\t}\n\n\t\t// Apply the dataFilter if provided\n\t\tif ( !prev && isSuccess && s.dataFilter ) {\n\t\t\tresponse = s.dataFilter( response, s.dataType );\n\t\t}\n\n\t\tprev = current;\n\t\tcurrent = dataTypes.shift();\n\n\t\tif ( current ) {\n\n\t\t\t// There's only work to do if current dataType is non-auto\n\t\t\tif ( current === \"*\" ) {\n\n\t\t\t\tcurrent = prev;\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t} else if ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split( \" \" );\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.unshift( tmp[ 1 ] );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\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\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s.throws ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\tstate: \"parsererror\",\n\t\t\t\t\t\t\t\terror: conv ? e : \"No conversion from \" + prev + \" to \" + current\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}\n\n\treturn { state: \"success\", data: response };\n}\n\njQuery.extend( {\n\n\t// Counter for holding the number of active queries\n\tactive: 0,\n\n\t// Last-Modified header cache for next request\n\tlastModified: {},\n\tetag: {},\n\n\tajaxSettings: {\n\t\turl: location.href,\n\t\ttype: \"GET\",\n\t\tisLocal: rlocalProtocol.test( location.protocol ),\n\t\tglobal: true,\n\t\tprocessData: true,\n\t\tasync: true,\n\t\tcontentType: \"application/x-www-form-urlencoded; charset=UTF-8\",\n\n\t\t/*\n\t\ttimeout: 0,\n\t\tdata: null,\n\t\tdataType: null,\n\t\tusername: null,\n\t\tpassword: null,\n\t\tcache: null,\n\t\tthrows: false,\n\t\ttraditional: false,\n\t\theaders: {},\n\t\t*/\n\n\t\taccepts: {\n\t\t\t\"*\": allTypes,\n\t\t\ttext: \"text/plain\",\n\t\t\thtml: \"text/html\",\n\t\t\txml: \"application/xml, text/xml\",\n\t\t\tjson: \"application/json, text/javascript\"\n\t\t},\n\n\t\tcontents: {\n\t\t\txml: /\\bxml\\b/,\n\t\t\thtml: /\\bhtml/,\n\t\t\tjson: /\\bjson\\b/\n\t\t},\n\n\t\tresponseFields: {\n\t\t\txml: \"responseXML\",\n\t\t\ttext: \"responseText\",\n\t\t\tjson: \"responseJSON\"\n\t\t},\n\n\t\t// Data converters\n\t\t// Keys separate source (or catchall \"*\") and destination types with a single space\n\t\tconverters: {\n\n\t\t\t// Convert anything to text\n\t\t\t\"* text\": String,\n\n\t\t\t// Text to html (true = no transformation)\n\t\t\t\"text html\": true,\n\n\t\t\t// Evaluate text as a json expression\n\t\t\t\"text json\": JSON.parse,\n\n\t\t\t// Parse text as xml\n\t\t\t\"text xml\": jQuery.parseXML\n\t\t},\n\n\t\t// For options that shouldn't be deep extended:\n\t\t// you can add your own custom options here if\n\t\t// and when you create one that shouldn't be\n\t\t// deep extended (see ajaxExtend)\n\t\tflatOptions: {\n\t\t\turl: true,\n\t\t\tcontext: true\n\t\t}\n\t},\n\n\t// Creates a full fledged settings object into target\n\t// with both ajaxSettings and settings fields.\n\t// If target is omitted, writes into ajaxSettings.\n\tajaxSetup: function( target, settings ) {\n\t\treturn settings ?\n\n\t\t\t// Building a settings object\n\t\t\tajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :\n\n\t\t\t// Extending ajaxSettings\n\t\t\tajaxExtend( jQuery.ajaxSettings, target );\n\t},\n\n\tajaxPrefilter: addToPrefiltersOrTransports( prefilters ),\n\tajaxTransport: addToPrefiltersOrTransports( transports ),\n\n\t// Main method\n\tajax: function( url, options ) {\n\n\t\t// If url is an object, simulate pre-1.5 signature\n\t\tif ( typeof url === \"object\" ) {\n\t\t\toptions = url;\n\t\t\turl = undefined;\n\t\t}\n\n\t\t// Force options to be an object\n\t\toptions = options || {};\n\n\t\tvar transport,\n\n\t\t\t// URL without anti-cache param\n\t\t\tcacheURL,\n\n\t\t\t// Response headers\n\t\t\tresponseHeadersString,\n\t\t\tresponseHeaders,\n\n\t\t\t// timeout handle\n\t\t\ttimeoutTimer,\n\n\t\t\t// Url cleanup var\n\t\t\turlAnchor,\n\n\t\t\t// Request state (becomes false upon send and true upon completion)\n\t\t\tcompleted,\n\n\t\t\t// To know if global events are to be dispatched\n\t\t\tfireGlobals,\n\n\t\t\t// Loop variable\n\t\t\ti,\n\n\t\t\t// uncached part of the url\n\t\t\tuncached,\n\n\t\t\t// Create the final options object\n\t\t\ts = jQuery.ajaxSetup( {}, options ),\n\n\t\t\t// Callbacks context\n\t\t\tcallbackContext = s.context || s,\n\n\t\t\t// Context for global events is callbackContext if it is a DOM node or jQuery collection\n\t\t\tglobalEventContext = s.context &&\n\t\t\t\t( callbackContext.nodeType || callbackContext.jquery ) ?\n\t\t\t\tjQuery( callbackContext ) :\n\t\t\t\tjQuery.event,\n\n\t\t\t// Deferreds\n\t\t\tdeferred = jQuery.Deferred(),\n\t\t\tcompleteDeferred = jQuery.Callbacks( \"once memory\" ),\n\n\t\t\t// Status-dependent callbacks\n\t\t\tstatusCode = s.statusCode || {},\n\n\t\t\t// Headers (they are sent all at once)\n\t\t\trequestHeaders = {},\n\t\t\trequestHeadersNames = {},\n\n\t\t\t// Default abort message\n\t\t\tstrAbort = \"canceled\",\n\n\t\t\t// Fake xhr\n\t\t\tjqXHR = {\n\t\t\t\treadyState: 0,\n\n\t\t\t\t// Builds headers hashtable if needed\n\t\t\t\tgetResponseHeader: function( key ) {\n\t\t\t\t\tvar match;\n\t\t\t\t\tif ( completed ) {\n\t\t\t\t\t\tif ( !responseHeaders ) {\n\t\t\t\t\t\t\tresponseHeaders = {};\n\t\t\t\t\t\t\twhile ( ( match = rheaders.exec( responseHeadersString ) ) ) {\n\t\t\t\t\t\t\t\tresponseHeaders[ match[ 1 ].toLowerCase() + \" \" ] =\n\t\t\t\t\t\t\t\t\t( responseHeaders[ match[ 1 ].toLowerCase() + \" \" ] || [] )\n\t\t\t\t\t\t\t\t\t\t.concat( match[ 2 ] );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tmatch = responseHeaders[ key.toLowerCase() + \" \" ];\n\t\t\t\t\t}\n\t\t\t\t\treturn match == null ? null : match.join( \", \" );\n\t\t\t\t},\n\n\t\t\t\t// Raw string\n\t\t\t\tgetAllResponseHeaders: function() {\n\t\t\t\t\treturn completed ? responseHeadersString : null;\n\t\t\t\t},\n\n\t\t\t\t// Caches the header\n\t\t\t\tsetRequestHeader: function( name, value ) {\n\t\t\t\t\tif ( completed == null ) {\n\t\t\t\t\t\tname = requestHeadersNames[ name.toLowerCase() ] =\n\t\t\t\t\t\t\trequestHeadersNames[ name.toLowerCase() ] || name;\n\t\t\t\t\t\trequestHeaders[ name ] = value;\n\t\t\t\t\t}\n\t\t\t\t\treturn this;\n\t\t\t\t},\n\n\t\t\t\t// Overrides response content-type header\n\t\t\t\toverrideMimeType: function( type ) {\n\t\t\t\t\tif ( completed == null ) {\n\t\t\t\t\t\ts.mimeType = type;\n\t\t\t\t\t}\n\t\t\t\t\treturn this;\n\t\t\t\t},\n\n\t\t\t\t// Status-dependent callbacks\n\t\t\t\tstatusCode: function( map ) {\n\t\t\t\t\tvar code;\n\t\t\t\t\tif ( map ) {\n\t\t\t\t\t\tif ( completed ) {\n\n\t\t\t\t\t\t\t// Execute the appropriate callbacks\n\t\t\t\t\t\t\tjqXHR.always( map[ jqXHR.status ] );\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t// Lazy-add the new callbacks in a way that preserves old ones\n\t\t\t\t\t\t\tfor ( code in map ) {\n\t\t\t\t\t\t\t\tstatusCode[ code ] = [ statusCode[ code ], map[ code ] ];\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\treturn this;\n\t\t\t\t},\n\n\t\t\t\t// Cancel the request\n\t\t\t\tabort: function( statusText ) {\n\t\t\t\t\tvar finalText = statusText || strAbort;\n\t\t\t\t\tif ( transport ) {\n\t\t\t\t\t\ttransport.abort( finalText );\n\t\t\t\t\t}\n\t\t\t\t\tdone( 0, finalText );\n\t\t\t\t\treturn this;\n\t\t\t\t}\n\t\t\t};\n\n\t\t// Attach deferreds\n\t\tdeferred.promise( jqXHR );\n\n\t\t// Add protocol if not provided (prefilters might expect it)\n\t\t// Handle falsy url in the settings object (trac-10093: consistency with old signature)\n\t\t// We also use the url parameter if available\n\t\ts.url = ( ( url || s.url || location.href ) + \"\" )\n\t\t\t.replace( rprotocol, location.protocol + \"//\" );\n\n\t\t// Alias method option to type as per ticket trac-12004\n\t\ts.type = options.method || options.type || s.method || s.type;\n\n\t\t// Extract dataTypes list\n\t\ts.dataTypes = ( s.dataType || \"*\" ).toLowerCase().match( rnothtmlwhite ) || [ \"\" ];\n\n\t\t// A cross-domain request is in order when the origin doesn't match the current origin.\n\t\tif ( s.crossDomain == null ) {\n\t\t\turlAnchor = document.createElement( \"a\" );\n\n\t\t\t// Support: IE <=8 - 11, Edge 12 - 15\n\t\t\t// IE throws exception on accessing the href property if url is malformed,\n\t\t\t// e.g. http://example.com:80x/\n\t\t\ttry {\n\t\t\t\turlAnchor.href = s.url;\n\n\t\t\t\t// Support: IE <=8 - 11 only\n\t\t\t\t// Anchor's host property isn't correctly set when s.url is relative\n\t\t\t\turlAnchor.href = urlAnchor.href;\n\t\t\t\ts.crossDomain = originAnchor.protocol + \"//\" + originAnchor.host !==\n\t\t\t\t\turlAnchor.protocol + \"//\" + urlAnchor.host;\n\t\t\t} catch ( e ) {\n\n\t\t\t\t// If there is an error parsing the URL, assume it is crossDomain,\n\t\t\t\t// it can be rejected by the transport if it is invalid\n\t\t\t\ts.crossDomain = true;\n\t\t\t}\n\t\t}\n\n\t\t// Convert data if not already a string\n\t\tif ( s.data && s.processData && typeof s.data !== \"string\" ) {\n\t\t\ts.data = jQuery.param( s.data, s.traditional );\n\t\t}\n\n\t\t// Apply prefilters\n\t\tinspectPrefiltersOrTransports( prefilters, s, options, jqXHR );\n\n\t\t// If request was aborted inside a prefilter, stop there\n\t\tif ( completed ) {\n\t\t\treturn jqXHR;\n\t\t}\n\n\t\t// We can fire global events as of now if asked to\n\t\t// Don't fire events if jQuery.event is undefined in an AMD-usage scenario (trac-15118)\n\t\tfireGlobals = jQuery.event && s.global;\n\n\t\t// Watch for a new set of requests\n\t\tif ( fireGlobals && jQuery.active++ === 0 ) {\n\t\t\tjQuery.event.trigger( \"ajaxStart\" );\n\t\t}\n\n\t\t// Uppercase the type\n\t\ts.type = s.type.toUpperCase();\n\n\t\t// Determine if request has content\n\t\ts.hasContent = !rnoContent.test( s.type );\n\n\t\t// Save the URL in case we're toying with the If-Modified-Since\n\t\t// and/or If-None-Match header later on\n\t\t// Remove hash to simplify url manipulation\n\t\tcacheURL = s.url.replace( rhash, \"\" );\n\n\t\t// More options handling for requests with no content\n\t\tif ( !s.hasContent ) {\n\n\t\t\t// Remember the hash so we can put it back\n\t\t\tuncached = s.url.slice( cacheURL.length );\n\n\t\t\t// If data is available and should be processed, append data to url\n\t\t\tif ( s.data && ( s.processData || typeof s.data === \"string\" ) ) {\n\t\t\t\tcacheURL += ( rquery.test( cacheURL ) ? \"&\" : \"?\" ) + s.data;\n\n\t\t\t\t// trac-9682: remove data so that it's not used in an eventual retry\n\t\t\t\tdelete s.data;\n\t\t\t}\n\n\t\t\t// Add or update anti-cache param if needed\n\t\t\tif ( s.cache === false ) {\n\t\t\t\tcacheURL = cacheURL.replace( rantiCache, \"$1\" );\n\t\t\t\tuncached = ( rquery.test( cacheURL ) ? \"&\" : \"?\" ) + \"_=\" + ( nonce.guid++ ) +\n\t\t\t\t\tuncached;\n\t\t\t}\n\n\t\t\t// Put hash and anti-cache on the URL that will be requested (gh-1732)\n\t\t\ts.url = cacheURL + uncached;\n\n\t\t// Change '%20' to '+' if this is encoded form body content (gh-2658)\n\t\t} else if ( s.data && s.processData &&\n\t\t\t( s.contentType || \"\" ).indexOf( \"application/x-www-form-urlencoded\" ) === 0 ) {\n\t\t\ts.data = s.data.replace( r20, \"+\" );\n\t\t}\n\n\t\t// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.\n\t\tif ( s.ifModified ) {\n\t\t\tif ( jQuery.lastModified[ cacheURL ] ) {\n\t\t\t\tjqXHR.setRequestHeader( \"If-Modified-Since\", jQuery.lastModified[ cacheURL ] );\n\t\t\t}\n\t\t\tif ( jQuery.etag[ cacheURL ] ) {\n\t\t\t\tjqXHR.setRequestHeader( \"If-None-Match\", jQuery.etag[ cacheURL ] );\n\t\t\t}\n\t\t}\n\n\t\t// Set the correct header, if data is being sent\n\t\tif ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {\n\t\t\tjqXHR.setRequestHeader( \"Content-Type\", s.contentType );\n\t\t}\n\n\t\t// Set the Accepts header for the server, depending on the dataType\n\t\tjqXHR.setRequestHeader(\n\t\t\t\"Accept\",\n\t\t\ts.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ?\n\t\t\t\ts.accepts[ s.dataTypes[ 0 ] ] +\n\t\t\t\t\t( s.dataTypes[ 0 ] !== \"*\" ? \", \" + allTypes + \"; q=0.01\" : \"\" ) :\n\t\t\t\ts.accepts[ \"*\" ]\n\t\t);\n\n\t\t// Check for headers option\n\t\tfor ( i in s.headers ) {\n\t\t\tjqXHR.setRequestHeader( i, s.headers[ i ] );\n\t\t}\n\n\t\t// Allow custom headers/mimetypes and early abort\n\t\tif ( s.beforeSend &&\n\t\t\t( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) {\n\n\t\t\t// Abort if not done already and return\n\t\t\treturn jqXHR.abort();\n\t\t}\n\n\t\t// Aborting is no longer a cancellation\n\t\tstrAbort = \"abort\";\n\n\t\t// Install callbacks on deferreds\n\t\tcompleteDeferred.add( s.complete );\n\t\tjqXHR.done( s.success );\n\t\tjqXHR.fail( s.error );\n\n\t\t// Get transport\n\t\ttransport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );\n\n\t\t// If no transport, we auto-abort\n\t\tif ( !transport ) {\n\t\t\tdone( -1, \"No Transport\" );\n\t\t} else {\n\t\t\tjqXHR.readyState = 1;\n\n\t\t\t// Send global event\n\t\t\tif ( fireGlobals ) {\n\t\t\t\tglobalEventContext.trigger( \"ajaxSend\", [ jqXHR, s ] );\n\t\t\t}\n\n\t\t\t// If request was aborted inside ajaxSend, stop there\n\t\t\tif ( completed ) {\n\t\t\t\treturn jqXHR;\n\t\t\t}\n\n\t\t\t// Timeout\n\t\t\tif ( s.async && s.timeout > 0 ) {\n\t\t\t\ttimeoutTimer = window.setTimeout( function() {\n\t\t\t\t\tjqXHR.abort( \"timeout\" );\n\t\t\t\t}, s.timeout );\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tcompleted = false;\n\t\t\t\ttransport.send( requestHeaders, done );\n\t\t\t} catch ( e ) {\n\n\t\t\t\t// Rethrow post-completion exceptions\n\t\t\t\tif ( completed ) {\n\t\t\t\t\tthrow e;\n\t\t\t\t}\n\n\t\t\t\t// Propagate others as results\n\t\t\t\tdone( -1, e );\n\t\t\t}\n\t\t}\n\n\t\t// Callback for when everything is done\n\t\tfunction done( status, nativeStatusText, responses, headers ) {\n\t\t\tvar isSuccess, success, error, response, modified,\n\t\t\t\tstatusText = nativeStatusText;\n\n\t\t\t// Ignore repeat invocations\n\t\t\tif ( completed ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tcompleted = true;\n\n\t\t\t// Clear timeout if it exists\n\t\t\tif ( timeoutTimer ) {\n\t\t\t\twindow.clearTimeout( timeoutTimer );\n\t\t\t}\n\n\t\t\t// Dereference transport for early garbage collection\n\t\t\t// (no matter how long the jqXHR object will be used)\n\t\t\ttransport = undefined;\n\n\t\t\t// Cache response headers\n\t\t\tresponseHeadersString = headers || \"\";\n\n\t\t\t// Set readyState\n\t\t\tjqXHR.readyState = status > 0 ? 4 : 0;\n\n\t\t\t// Determine if successful\n\t\t\tisSuccess = status >= 200 && status < 300 || status === 304;\n\n\t\t\t// Get response data\n\t\t\tif ( responses ) {\n\t\t\t\tresponse = ajaxHandleResponses( s, jqXHR, responses );\n\t\t\t}\n\n\t\t\t// Use a noop converter for missing script but not if jsonp\n\t\t\tif ( !isSuccess &&\n\t\t\t\tjQuery.inArray( \"script\", s.dataTypes ) > -1 &&\n\t\t\t\tjQuery.inArray( \"json\", s.dataTypes ) < 0 ) {\n\t\t\t\ts.converters[ \"text script\" ] = function() {};\n\t\t\t}\n\n\t\t\t// Convert no matter what (that way responseXXX fields are always set)\n\t\t\tresponse = ajaxConvert( s, response, jqXHR, isSuccess );\n\n\t\t\t// If successful, handle type chaining\n\t\t\tif ( isSuccess ) {\n\n\t\t\t\t// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.\n\t\t\t\tif ( s.ifModified ) {\n\t\t\t\t\tmodified = jqXHR.getResponseHeader( \"Last-Modified\" );\n\t\t\t\t\tif ( modified ) {\n\t\t\t\t\t\tjQuery.lastModified[ cacheURL ] = modified;\n\t\t\t\t\t}\n\t\t\t\t\tmodified = jqXHR.getResponseHeader( \"etag\" );\n\t\t\t\t\tif ( modified ) {\n\t\t\t\t\t\tjQuery.etag[ cacheURL ] = modified;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// if no content\n\t\t\t\tif ( status === 204 || s.type === \"HEAD\" ) {\n\t\t\t\t\tstatusText = \"nocontent\";\n\n\t\t\t\t// if not modified\n\t\t\t\t} else if ( status === 304 ) {\n\t\t\t\t\tstatusText = \"notmodified\";\n\n\t\t\t\t// If we have data, let's convert it\n\t\t\t\t} else {\n\t\t\t\t\tstatusText = response.state;\n\t\t\t\t\tsuccess = response.data;\n\t\t\t\t\terror = response.error;\n\t\t\t\t\tisSuccess = !error;\n\t\t\t\t}\n\t\t\t} else {\n\n\t\t\t\t// Extract error from statusText and normalize for non-aborts\n\t\t\t\terror = statusText;\n\t\t\t\tif ( status || !statusText ) {\n\t\t\t\t\tstatusText = \"error\";\n\t\t\t\t\tif ( status < 0 ) {\n\t\t\t\t\t\tstatus = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Set data for the fake xhr object\n\t\t\tjqXHR.status = status;\n\t\t\tjqXHR.statusText = ( nativeStatusText || statusText ) + \"\";\n\n\t\t\t// Success/Error\n\t\t\tif ( isSuccess ) {\n\t\t\t\tdeferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );\n\t\t\t} else {\n\t\t\t\tdeferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );\n\t\t\t}\n\n\t\t\t// Status-dependent callbacks\n\t\t\tjqXHR.statusCode( statusCode );\n\t\t\tstatusCode = undefined;\n\n\t\t\tif ( fireGlobals ) {\n\t\t\t\tglobalEventContext.trigger( isSuccess ? \"ajaxSuccess\" : \"ajaxError\",\n\t\t\t\t\t[ jqXHR, s, isSuccess ? success : error ] );\n\t\t\t}\n\n\t\t\t// Complete\n\t\t\tcompleteDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );\n\n\t\t\tif ( fireGlobals ) {\n\t\t\t\tglobalEventContext.trigger( \"ajaxComplete\", [ jqXHR, s ] );\n\n\t\t\t\t// Handle the global AJAX counter\n\t\t\t\tif ( !( --jQuery.active ) ) {\n\t\t\t\t\tjQuery.event.trigger( \"ajaxStop\" );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn jqXHR;\n\t},\n\n\tgetJSON: function( url, data, callback ) {\n\t\treturn jQuery.get( url, data, callback, \"json\" );\n\t},\n\n\tgetScript: function( url, callback ) {\n\t\treturn jQuery.get( url, undefined, callback, \"script\" );\n\t}\n} );\n\njQuery.each( [ \"get\", \"post\" ], function( _i, method ) {\n\tjQuery[ method ] = function( url, data, callback, type ) {\n\n\t\t// Shift arguments if data argument was omitted\n\t\tif ( isFunction( data ) ) {\n\t\t\ttype = type || callback;\n\t\t\tcallback = data;\n\t\t\tdata = undefined;\n\t\t}\n\n\t\t// The url can be an options object (which then must have .url)\n\t\treturn jQuery.ajax( jQuery.extend( {\n\t\t\turl: url,\n\t\t\ttype: method,\n\t\t\tdataType: type,\n\t\t\tdata: data,\n\t\t\tsuccess: callback\n\t\t}, jQuery.isPlainObject( url ) && url ) );\n\t};\n} );\n\njQuery.ajaxPrefilter( function( s ) {\n\tvar i;\n\tfor ( i in s.headers ) {\n\t\tif ( i.toLowerCase() === \"content-type\" ) {\n\t\t\ts.contentType = s.headers[ i ] || \"\";\n\t\t}\n\t}\n} );\n\n\njQuery._evalUrl = function( url, options, doc ) {\n\treturn jQuery.ajax( {\n\t\turl: url,\n\n\t\t// Make this explicit, since user can override this through ajaxSetup (trac-11264)\n\t\ttype: \"GET\",\n\t\tdataType: \"script\",\n\t\tcache: true,\n\t\tasync: false,\n\t\tglobal: false,\n\n\t\t// Only evaluate the response if it is successful (gh-4126)\n\t\t// dataFilter is not invoked for failure responses, so using it instead\n\t\t// of the default converter is kludgy but it works.\n\t\tconverters: {\n\t\t\t\"text script\": function() {}\n\t\t},\n\t\tdataFilter: function( response ) {\n\t\t\tjQuery.globalEval( response, options, doc );\n\t\t}\n\t} );\n};\n\n\njQuery.fn.extend( {\n\twrapAll: function( html ) {\n\t\tvar wrap;\n\n\t\tif ( this[ 0 ] ) {\n\t\t\tif ( isFunction( html ) ) {\n\t\t\t\thtml = html.call( this[ 0 ] );\n\t\t\t}\n\n\t\t\t// The elements to wrap the target around\n\t\t\twrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true );\n\n\t\t\tif ( this[ 0 ].parentNode ) {\n\t\t\t\twrap.insertBefore( this[ 0 ] );\n\t\t\t}\n\n\t\t\twrap.map( function() {\n\t\t\t\tvar elem = this;\n\n\t\t\t\twhile ( elem.firstElementChild ) {\n\t\t\t\t\telem = elem.firstElementChild;\n\t\t\t\t}\n\n\t\t\t\treturn elem;\n\t\t\t} ).append( this );\n\t\t}\n\n\t\treturn this;\n\t},\n\n\twrapInner: function( html ) {\n\t\tif ( isFunction( html ) ) {\n\t\t\treturn this.each( function( i ) {\n\t\t\t\tjQuery( this ).wrapInner( html.call( this, i ) );\n\t\t\t} );\n\t\t}\n\n\t\treturn this.each( function() {\n\t\t\tvar self = jQuery( this ),\n\t\t\t\tcontents = self.contents();\n\n\t\t\tif ( contents.length ) {\n\t\t\t\tcontents.wrapAll( html );\n\n\t\t\t} else {\n\t\t\t\tself.append( html );\n\t\t\t}\n\t\t} );\n\t},\n\n\twrap: function( html ) {\n\t\tvar htmlIsFunction = isFunction( html );\n\n\t\treturn this.each( function( i ) {\n\t\t\tjQuery( this ).wrapAll( htmlIsFunction ? html.call( this, i ) : html );\n\t\t} );\n\t},\n\n\tunwrap: function( selector ) {\n\t\tthis.parent( selector ).not( \"body\" ).each( function() {\n\t\t\tjQuery( this ).replaceWith( this.childNodes );\n\t\t} );\n\t\treturn this;\n\t}\n} );\n\n\njQuery.expr.pseudos.hidden = function( elem ) {\n\treturn !jQuery.expr.pseudos.visible( elem );\n};\njQuery.expr.pseudos.visible = function( elem ) {\n\treturn !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length );\n};\n\n\n\n\njQuery.ajaxSettings.xhr = function() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n};\n\nvar xhrSuccessStatus = {\n\n\t\t// File protocol always yields status code 0, assume 200\n\t\t0: 200,\n\n\t\t// Support: IE <=9 only\n\t\t// trac-1450: sometimes IE returns 1223 when it should be 204\n\t\t1223: 204\n\t},\n\txhrSupported = jQuery.ajaxSettings.xhr();\n\nsupport.cors = !!xhrSupported && ( \"withCredentials\" in xhrSupported );\nsupport.ajax = xhrSupported = !!xhrSupported;\n\njQuery.ajaxTransport( function( options ) {\n\tvar callback, errorCallback;\n\n\t// Cross domain only allowed if supported through XMLHttpRequest\n\tif ( support.cors || xhrSupported && !options.crossDomain ) {\n\t\treturn {\n\t\t\tsend: function( headers, complete ) {\n\t\t\t\tvar i,\n\t\t\t\t\txhr = options.xhr();\n\n\t\t\t\txhr.open(\n\t\t\t\t\toptions.type,\n\t\t\t\t\toptions.url,\n\t\t\t\t\toptions.async,\n\t\t\t\t\toptions.username,\n\t\t\t\t\toptions.password\n\t\t\t\t);\n\n\t\t\t\t// Apply custom fields if provided\n\t\t\t\tif ( options.xhrFields ) {\n\t\t\t\t\tfor ( i in options.xhrFields ) {\n\t\t\t\t\t\txhr[ i ] = options.xhrFields[ i ];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Override mime type if needed\n\t\t\t\tif ( options.mimeType && xhr.overrideMimeType ) {\n\t\t\t\t\txhr.overrideMimeType( options.mimeType );\n\t\t\t\t}\n\n\t\t\t\t// X-Requested-With header\n\t\t\t\t// For cross-domain requests, seeing as conditions for a preflight are\n\t\t\t\t// akin to a jigsaw puzzle, we simply never set it to be sure.\n\t\t\t\t// (it can always be set on a per-request basis or even using ajaxSetup)\n\t\t\t\t// For same-domain requests, won't change header if already provided.\n\t\t\t\tif ( !options.crossDomain && !headers[ \"X-Requested-With\" ] ) {\n\t\t\t\t\theaders[ \"X-Requested-With\" ] = \"XMLHttpRequest\";\n\t\t\t\t}\n\n\t\t\t\t// Set headers\n\t\t\t\tfor ( i in headers ) {\n\t\t\t\t\txhr.setRequestHeader( i, headers[ i ] );\n\t\t\t\t}\n\n\t\t\t\t// Callback\n\t\t\t\tcallback = function( type ) {\n\t\t\t\t\treturn function() {\n\t\t\t\t\t\tif ( callback ) {\n\t\t\t\t\t\t\tcallback = errorCallback = xhr.onload =\n\t\t\t\t\t\t\t\txhr.onerror = xhr.onabort = xhr.ontimeout =\n\t\t\t\t\t\t\t\t\txhr.onreadystatechange = null;\n\n\t\t\t\t\t\t\tif ( type === \"abort\" ) {\n\t\t\t\t\t\t\t\txhr.abort();\n\t\t\t\t\t\t\t} else if ( type === \"error\" ) {\n\n\t\t\t\t\t\t\t\t// Support: IE <=9 only\n\t\t\t\t\t\t\t\t// On a manual native abort, IE9 throws\n\t\t\t\t\t\t\t\t// errors on any property access that is not readyState\n\t\t\t\t\t\t\t\tif ( typeof xhr.status !== \"number\" ) {\n\t\t\t\t\t\t\t\t\tcomplete( 0, \"error\" );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tcomplete(\n\n\t\t\t\t\t\t\t\t\t\t// File: protocol always yields status 0; see trac-8605, trac-14207\n\t\t\t\t\t\t\t\t\t\txhr.status,\n\t\t\t\t\t\t\t\t\t\txhr.statusText\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tcomplete(\n\t\t\t\t\t\t\t\t\txhrSuccessStatus[ xhr.status ] || xhr.status,\n\t\t\t\t\t\t\t\t\txhr.statusText,\n\n\t\t\t\t\t\t\t\t\t// Support: IE <=9 only\n\t\t\t\t\t\t\t\t\t// IE9 has no XHR2 but throws on binary (trac-11426)\n\t\t\t\t\t\t\t\t\t// For XHR2 non-text, let the caller handle it (gh-2498)\n\t\t\t\t\t\t\t\t\t( xhr.responseType || \"text\" ) !== \"text\"  ||\n\t\t\t\t\t\t\t\t\ttypeof xhr.responseText !== \"string\" ?\n\t\t\t\t\t\t\t\t\t\t{ binary: xhr.response } :\n\t\t\t\t\t\t\t\t\t\t{ text: xhr.responseText },\n\t\t\t\t\t\t\t\t\txhr.getAllResponseHeaders()\n\t\t\t\t\t\t\t\t);\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\n\t\t\t\t// Listen to events\n\t\t\t\txhr.onload = callback();\n\t\t\t\terrorCallback = xhr.onerror = xhr.ontimeout = callback( \"error\" );\n\n\t\t\t\t// Support: IE 9 only\n\t\t\t\t// Use onreadystatechange to replace onabort\n\t\t\t\t// to handle uncaught aborts\n\t\t\t\tif ( xhr.onabort !== undefined ) {\n\t\t\t\t\txhr.onabort = errorCallback;\n\t\t\t\t} else {\n\t\t\t\t\txhr.onreadystatechange = function() {\n\n\t\t\t\t\t\t// Check readyState before timeout as it changes\n\t\t\t\t\t\tif ( xhr.readyState === 4 ) {\n\n\t\t\t\t\t\t\t// Allow onerror to be called first,\n\t\t\t\t\t\t\t// but that will not handle a native abort\n\t\t\t\t\t\t\t// Also, save errorCallback to a variable\n\t\t\t\t\t\t\t// as xhr.onerror cannot be accessed\n\t\t\t\t\t\t\twindow.setTimeout( function() {\n\t\t\t\t\t\t\t\tif ( callback ) {\n\t\t\t\t\t\t\t\t\terrorCallback();\n\t\t\t\t\t\t\t\t}\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\n\t\t\t\t// Create the abort callback\n\t\t\t\tcallback = callback( \"abort\" );\n\n\t\t\t\ttry {\n\n\t\t\t\t\t// Do send the request (this may raise an exception)\n\t\t\t\t\txhr.send( options.hasContent && options.data || null );\n\t\t\t\t} catch ( e ) {\n\n\t\t\t\t\t// trac-14683: Only rethrow if this hasn't been notified as an error yet\n\t\t\t\t\tif ( callback ) {\n\t\t\t\t\t\tthrow e;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\n\t\t\tabort: function() {\n\t\t\t\tif ( callback ) {\n\t\t\t\t\tcallback();\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n} );\n\n\n\n\n// Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432)\njQuery.ajaxPrefilter( function( s ) {\n\tif ( s.crossDomain ) {\n\t\ts.contents.script = false;\n\t}\n} );\n\n// Install script dataType\njQuery.ajaxSetup( {\n\taccepts: {\n\t\tscript: \"text/javascript, application/javascript, \" +\n\t\t\t\"application/ecmascript, application/x-ecmascript\"\n\t},\n\tcontents: {\n\t\tscript: /\\b(?:java|ecma)script\\b/\n\t},\n\tconverters: {\n\t\t\"text script\": function( text ) {\n\t\t\tjQuery.globalEval( text );\n\t\t\treturn text;\n\t\t}\n\t}\n} );\n\n// Handle cache's special case and crossDomain\njQuery.ajaxPrefilter( \"script\", function( s ) {\n\tif ( s.cache === undefined ) {\n\t\ts.cache = false;\n\t}\n\tif ( s.crossDomain ) {\n\t\ts.type = \"GET\";\n\t}\n} );\n\n// Bind script tag hack transport\njQuery.ajaxTransport( \"script\", function( s ) {\n\n\t// This transport only deals with cross domain or forced-by-attrs requests\n\tif ( s.crossDomain || s.scriptAttrs ) {\n\t\tvar script, callback;\n\t\treturn {\n\t\t\tsend: function( _, complete ) {\n\t\t\t\tscript = jQuery( \"<script>\" )\n\t\t\t\t\t.attr( s.scriptAttrs || {} )\n\t\t\t\t\t.prop( { charset: s.scriptCharset, src: s.url } )\n\t\t\t\t\t.on( \"load error\", callback = function( evt ) {\n\t\t\t\t\t\tscript.remove();\n\t\t\t\t\t\tcallback = null;\n\t\t\t\t\t\tif ( evt ) {\n\t\t\t\t\t\t\tcomplete( evt.type === \"error\" ? 404 : 200, evt.type );\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\n\t\t\t\t// Use native DOM manipulation to avoid our domManip AJAX trickery\n\t\t\t\tdocument.head.appendChild( script[ 0 ] );\n\t\t\t},\n\t\t\tabort: function() {\n\t\t\t\tif ( callback ) {\n\t\t\t\t\tcallback();\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n} );\n\n\n\n\nvar oldCallbacks = [],\n\trjsonp = /(=)\\?(?=&|$)|\\?\\?/;\n\n// Default jsonp settings\njQuery.ajaxSetup( {\n\tjsonp: \"callback\",\n\tjsonpCallback: function() {\n\t\tvar callback = oldCallbacks.pop() || ( jQuery.expando + \"_\" + ( nonce.guid++ ) );\n\t\tthis[ callback ] = true;\n\t\treturn callback;\n\t}\n} );\n\n// Detect, normalize options and install callbacks for jsonp requests\njQuery.ajaxPrefilter( \"json jsonp\", function( s, originalSettings, jqXHR ) {\n\n\tvar callbackName, overwritten, responseContainer,\n\t\tjsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?\n\t\t\t\"url\" :\n\t\t\ttypeof s.data === \"string\" &&\n\t\t\t\t( s.contentType || \"\" )\n\t\t\t\t\t.indexOf( \"application/x-www-form-urlencoded\" ) === 0 &&\n\t\t\t\trjsonp.test( s.data ) && \"data\"\n\t\t);\n\n\t// Handle iff the expected data type is \"jsonp\" or we have a parameter to set\n\tif ( jsonProp || s.dataTypes[ 0 ] === \"jsonp\" ) {\n\n\t\t// Get callback name, remembering preexisting value associated with it\n\t\tcallbackName = s.jsonpCallback = isFunction( s.jsonpCallback ) ?\n\t\t\ts.jsonpCallback() :\n\t\t\ts.jsonpCallback;\n\n\t\t// Insert callback into url or form data\n\t\tif ( jsonProp ) {\n\t\t\ts[ jsonProp ] = s[ jsonProp ].replace( rjsonp, \"$1\" + callbackName );\n\t\t} else if ( s.jsonp !== false ) {\n\t\t\ts.url += ( rquery.test( s.url ) ? \"&\" : \"?\" ) + s.jsonp + \"=\" + callbackName;\n\t\t}\n\n\t\t// Use data converter to retrieve json after script execution\n\t\ts.converters[ \"script json\" ] = function() {\n\t\t\tif ( !responseContainer ) {\n\t\t\t\tjQuery.error( callbackName + \" was not called\" );\n\t\t\t}\n\t\t\treturn responseContainer[ 0 ];\n\t\t};\n\n\t\t// Force json dataType\n\t\ts.dataTypes[ 0 ] = \"json\";\n\n\t\t// Install callback\n\t\toverwritten = window[ callbackName ];\n\t\twindow[ callbackName ] = function() {\n\t\t\tresponseContainer = arguments;\n\t\t};\n\n\t\t// Clean-up function (fires after converters)\n\t\tjqXHR.always( function() {\n\n\t\t\t// If previous value didn't exist - remove it\n\t\t\tif ( overwritten === undefined ) {\n\t\t\t\tjQuery( window ).removeProp( callbackName );\n\n\t\t\t// Otherwise restore preexisting value\n\t\t\t} else {\n\t\t\t\twindow[ callbackName ] = overwritten;\n\t\t\t}\n\n\t\t\t// Save back as free\n\t\t\tif ( s[ callbackName ] ) {\n\n\t\t\t\t// Make sure that re-using the options doesn't screw things around\n\t\t\t\ts.jsonpCallback = originalSettings.jsonpCallback;\n\n\t\t\t\t// Save the callback name for future use\n\t\t\t\toldCallbacks.push( callbackName );\n\t\t\t}\n\n\t\t\t// Call if it was a function and we have a response\n\t\t\tif ( responseContainer && isFunction( overwritten ) ) {\n\t\t\t\toverwritten( responseContainer[ 0 ] );\n\t\t\t}\n\n\t\t\tresponseContainer = overwritten = undefined;\n\t\t} );\n\n\t\t// Delegate to script\n\t\treturn \"script\";\n\t}\n} );\n\n\n\n\n// Support: Safari 8 only\n// In Safari 8 documents created via document.implementation.createHTMLDocument\n// collapse sibling forms: the second one becomes a child of the first one.\n// Because of that, this security measure has to be disabled in Safari 8.\n// https://bugs.webkit.org/show_bug.cgi?id=137337\nsupport.createHTMLDocument = ( function() {\n\tvar body = document.implementation.createHTMLDocument( \"\" ).body;\n\tbody.innerHTML = \"<form></form><form></form>\";\n\treturn body.childNodes.length === 2;\n} )();\n\n\n// Argument \"data\" should be string of html\n// context (optional): If specified, the fragment will be created in this context,\n// defaults to document\n// keepScripts (optional): If true, will include scripts passed in the html string\njQuery.parseHTML = function( data, context, keepScripts ) {\n\tif ( typeof data !== \"string\" ) {\n\t\treturn [];\n\t}\n\tif ( typeof context === \"boolean\" ) {\n\t\tkeepScripts = context;\n\t\tcontext = false;\n\t}\n\n\tvar base, parsed, scripts;\n\n\tif ( !context ) {\n\n\t\t// Stop scripts or inline event handlers from being executed immediately\n\t\t// by using document.implementation\n\t\tif ( support.createHTMLDocument ) {\n\t\t\tcontext = document.implementation.createHTMLDocument( \"\" );\n\n\t\t\t// Set the base href for the created document\n\t\t\t// so any parsed elements with URLs\n\t\t\t// are based on the document's URL (gh-2965)\n\t\t\tbase = context.createElement( \"base\" );\n\t\t\tbase.href = document.location.href;\n\t\t\tcontext.head.appendChild( base );\n\t\t} else {\n\t\t\tcontext = document;\n\t\t}\n\t}\n\n\tparsed = rsingleTag.exec( data );\n\tscripts = !keepScripts && [];\n\n\t// Single tag\n\tif ( parsed ) {\n\t\treturn [ context.createElement( parsed[ 1 ] ) ];\n\t}\n\n\tparsed = buildFragment( [ data ], context, scripts );\n\n\tif ( scripts && scripts.length ) {\n\t\tjQuery( scripts ).remove();\n\t}\n\n\treturn jQuery.merge( [], parsed.childNodes );\n};\n\n\n/**\n * Load a url into a page\n */\njQuery.fn.load = function( url, params, callback ) {\n\tvar selector, type, response,\n\t\tself = this,\n\t\toff = url.indexOf( \" \" );\n\n\tif ( off > -1 ) {\n\t\tselector = stripAndCollapse( url.slice( off ) );\n\t\turl = url.slice( 0, off );\n\t}\n\n\t// If it's a function\n\tif ( isFunction( params ) ) {\n\n\t\t// We assume that it's the callback\n\t\tcallback = params;\n\t\tparams = undefined;\n\n\t// Otherwise, build a param string\n\t} else if ( params && typeof params === \"object\" ) {\n\t\ttype = \"POST\";\n\t}\n\n\t// If we have elements to modify, make the request\n\tif ( self.length > 0 ) {\n\t\tjQuery.ajax( {\n\t\t\turl: url,\n\n\t\t\t// If \"type\" variable is undefined, then \"GET\" method will be used.\n\t\t\t// Make value of this field explicit since\n\t\t\t// user can override it through ajaxSetup method\n\t\t\ttype: type || \"GET\",\n\t\t\tdataType: \"html\",\n\t\t\tdata: params\n\t\t} ).done( function( responseText ) {\n\n\t\t\t// Save response for use in complete callback\n\t\t\tresponse = arguments;\n\n\t\t\tself.html( selector ?\n\n\t\t\t\t// If a selector was specified, locate the right elements in a dummy div\n\t\t\t\t// Exclude scripts to avoid IE 'Permission Denied' errors\n\t\t\t\tjQuery( \"<div>\" ).append( jQuery.parseHTML( responseText ) ).find( selector ) :\n\n\t\t\t\t// Otherwise use the full result\n\t\t\t\tresponseText );\n\n\t\t// If the request succeeds, this function gets \"data\", \"status\", \"jqXHR\"\n\t\t// but they are ignored because response was set above.\n\t\t// If it fails, this function gets \"jqXHR\", \"status\", \"error\"\n\t\t} ).always( callback && function( jqXHR, status ) {\n\t\t\tself.each( function() {\n\t\t\t\tcallback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] );\n\t\t\t} );\n\t\t} );\n\t}\n\n\treturn this;\n};\n\n\n\n\njQuery.expr.pseudos.animated = function( elem ) {\n\treturn jQuery.grep( jQuery.timers, function( fn ) {\n\t\treturn elem === fn.elem;\n\t} ).length;\n};\n\n\n\n\njQuery.offset = {\n\tsetOffset: function( elem, options, i ) {\n\t\tvar curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,\n\t\t\tposition = jQuery.css( elem, \"position\" ),\n\t\t\tcurElem = jQuery( elem ),\n\t\t\tprops = {};\n\n\t\t// Set position first, in-case top/left are set even on static elem\n\t\tif ( position === \"static\" ) {\n\t\t\telem.style.position = \"relative\";\n\t\t}\n\n\t\tcurOffset = curElem.offset();\n\t\tcurCSSTop = jQuery.css( elem, \"top\" );\n\t\tcurCSSLeft = jQuery.css( elem, \"left\" );\n\t\tcalculatePosition = ( position === \"absolute\" || position === \"fixed\" ) &&\n\t\t\t( curCSSTop + curCSSLeft ).indexOf( \"auto\" ) > -1;\n\n\t\t// Need to be able to calculate position if either\n\t\t// top or left is auto and position is either absolute or fixed\n\t\tif ( calculatePosition ) {\n\t\t\tcurPosition = curElem.position();\n\t\t\tcurTop = curPosition.top;\n\t\t\tcurLeft = curPosition.left;\n\n\t\t} else {\n\t\t\tcurTop = parseFloat( curCSSTop ) || 0;\n\t\t\tcurLeft = parseFloat( curCSSLeft ) || 0;\n\t\t}\n\n\t\tif ( isFunction( options ) ) {\n\n\t\t\t// Use jQuery.extend here to allow modification of coordinates argument (gh-1848)\n\t\t\toptions = options.call( elem, i, jQuery.extend( {}, curOffset ) );\n\t\t}\n\n\t\tif ( options.top != null ) {\n\t\t\tprops.top = ( options.top - curOffset.top ) + curTop;\n\t\t}\n\t\tif ( options.left != null ) {\n\t\t\tprops.left = ( options.left - curOffset.left ) + curLeft;\n\t\t}\n\n\t\tif ( \"using\" in options ) {\n\t\t\toptions.using.call( elem, props );\n\n\t\t} else {\n\t\t\tcurElem.css( props );\n\t\t}\n\t}\n};\n\njQuery.fn.extend( {\n\n\t// offset() relates an element's border box to the document origin\n\toffset: function( options ) {\n\n\t\t// Preserve chaining for setter\n\t\tif ( arguments.length ) {\n\t\t\treturn options === undefined ?\n\t\t\t\tthis :\n\t\t\t\tthis.each( function( i ) {\n\t\t\t\t\tjQuery.offset.setOffset( this, options, i );\n\t\t\t\t} );\n\t\t}\n\n\t\tvar rect, win,\n\t\t\telem = this[ 0 ];\n\n\t\tif ( !elem ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Return zeros for disconnected and hidden (display: none) elements (gh-2310)\n\t\t// Support: IE <=11 only\n\t\t// Running getBoundingClientRect on a\n\t\t// disconnected node in IE throws an error\n\t\tif ( !elem.getClientRects().length ) {\n\t\t\treturn { top: 0, left: 0 };\n\t\t}\n\n\t\t// Get document-relative position by adding viewport scroll to viewport-relative gBCR\n\t\trect = elem.getBoundingClientRect();\n\t\twin = elem.ownerDocument.defaultView;\n\t\treturn {\n\t\t\ttop: rect.top + win.pageYOffset,\n\t\t\tleft: rect.left + win.pageXOffset\n\t\t};\n\t},\n\n\t// position() relates an element's margin box to its offset parent's padding box\n\t// This corresponds to the behavior of CSS absolute positioning\n\tposition: function() {\n\t\tif ( !this[ 0 ] ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar offsetParent, offset, doc,\n\t\t\telem = this[ 0 ],\n\t\t\tparentOffset = { top: 0, left: 0 };\n\n\t\t// position:fixed elements are offset from the viewport, which itself always has zero offset\n\t\tif ( jQuery.css( elem, \"position\" ) === \"fixed\" ) {\n\n\t\t\t// Assume position:fixed implies availability of getBoundingClientRect\n\t\t\toffset = elem.getBoundingClientRect();\n\n\t\t} else {\n\t\t\toffset = this.offset();\n\n\t\t\t// Account for the *real* offset parent, which can be the document or its root element\n\t\t\t// when a statically positioned element is identified\n\t\t\tdoc = elem.ownerDocument;\n\t\t\toffsetParent = elem.offsetParent || doc.documentElement;\n\t\t\twhile ( offsetParent &&\n\t\t\t\t( offsetParent === doc.body || offsetParent === doc.documentElement ) &&\n\t\t\t\tjQuery.css( offsetParent, \"position\" ) === \"static\" ) {\n\n\t\t\t\toffsetParent = offsetParent.parentNode;\n\t\t\t}\n\t\t\tif ( offsetParent && offsetParent !== elem && offsetParent.nodeType === 1 ) {\n\n\t\t\t\t// Incorporate borders into its offset, since they are outside its content origin\n\t\t\t\tparentOffset = jQuery( offsetParent ).offset();\n\t\t\t\tparentOffset.top += jQuery.css( offsetParent, \"borderTopWidth\", true );\n\t\t\t\tparentOffset.left += jQuery.css( offsetParent, \"borderLeftWidth\", true );\n\t\t\t}\n\t\t}\n\n\t\t// Subtract parent offsets and element margins\n\t\treturn {\n\t\t\ttop: offset.top - parentOffset.top - jQuery.css( elem, \"marginTop\", true ),\n\t\t\tleft: offset.left - parentOffset.left - jQuery.css( elem, \"marginLeft\", true )\n\t\t};\n\t},\n\n\t// This method will return documentElement in the following cases:\n\t// 1) For the element inside the iframe without offsetParent, this method will return\n\t//    documentElement of the parent window\n\t// 2) For the hidden or detached element\n\t// 3) For body or html element, i.e. in case of the html node - it will return itself\n\t//\n\t// but those exceptions were never presented as a real life use-cases\n\t// and might be considered as more preferable results.\n\t//\n\t// This logic, however, is not guaranteed and can change at any point in the future\n\toffsetParent: function() {\n\t\treturn this.map( function() {\n\t\t\tvar offsetParent = this.offsetParent;\n\n\t\t\twhile ( offsetParent && jQuery.css( offsetParent, \"position\" ) === \"static\" ) {\n\t\t\t\toffsetParent = offsetParent.offsetParent;\n\t\t\t}\n\n\t\t\treturn offsetParent || documentElement;\n\t\t} );\n\t}\n} );\n\n// Create scrollLeft and scrollTop methods\njQuery.each( { scrollLeft: \"pageXOffset\", scrollTop: \"pageYOffset\" }, function( method, prop ) {\n\tvar top = \"pageYOffset\" === prop;\n\n\tjQuery.fn[ method ] = function( val ) {\n\t\treturn access( this, function( elem, method, val ) {\n\n\t\t\t// Coalesce documents and windows\n\t\t\tvar win;\n\t\t\tif ( isWindow( elem ) ) {\n\t\t\t\twin = elem;\n\t\t\t} else if ( elem.nodeType === 9 ) {\n\t\t\t\twin = elem.defaultView;\n\t\t\t}\n\n\t\t\tif ( val === undefined ) {\n\t\t\t\treturn win ? win[ prop ] : elem[ method ];\n\t\t\t}\n\n\t\t\tif ( win ) {\n\t\t\t\twin.scrollTo(\n\t\t\t\t\t!top ? val : win.pageXOffset,\n\t\t\t\t\ttop ? val : win.pageYOffset\n\t\t\t\t);\n\n\t\t\t} else {\n\t\t\t\telem[ method ] = val;\n\t\t\t}\n\t\t}, method, val, arguments.length );\n\t};\n} );\n\n// Support: Safari <=7 - 9.1, Chrome <=37 - 49\n// Add the top/left cssHooks using jQuery.fn.position\n// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084\n// Blink bug: https://bugs.chromium.org/p/chromium/issues/detail?id=589347\n// getComputedStyle returns percent when specified for top/left/bottom/right;\n// rather than make the css module depend on the offset module, just check for it here\njQuery.each( [ \"top\", \"left\" ], function( _i, prop ) {\n\tjQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,\n\t\tfunction( elem, computed ) {\n\t\t\tif ( computed ) {\n\t\t\t\tcomputed = curCSS( elem, prop );\n\n\t\t\t\t// If curCSS returns percentage, fallback to offset\n\t\t\t\treturn rnumnonpx.test( computed ) ?\n\t\t\t\t\tjQuery( elem ).position()[ prop ] + \"px\" :\n\t\t\t\t\tcomputed;\n\t\t\t}\n\t\t}\n\t);\n} );\n\n\n// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods\njQuery.each( { Height: \"height\", Width: \"width\" }, function( name, type ) {\n\tjQuery.each( {\n\t\tpadding: \"inner\" + name,\n\t\tcontent: type,\n\t\t\"\": \"outer\" + name\n\t}, function( defaultExtra, funcName ) {\n\n\t\t// Margin is only for outerHeight, outerWidth\n\t\tjQuery.fn[ funcName ] = function( margin, value ) {\n\t\t\tvar chainable = arguments.length && ( defaultExtra || typeof margin !== \"boolean\" ),\n\t\t\t\textra = defaultExtra || ( margin === true || value === true ? \"margin\" : \"border\" );\n\n\t\t\treturn access( this, function( elem, type, value ) {\n\t\t\t\tvar doc;\n\n\t\t\t\tif ( isWindow( elem ) ) {\n\n\t\t\t\t\t// $( window ).outerWidth/Height return w/h including scrollbars (gh-1729)\n\t\t\t\t\treturn funcName.indexOf( \"outer\" ) === 0 ?\n\t\t\t\t\t\telem[ \"inner\" + name ] :\n\t\t\t\t\t\telem.document.documentElement[ \"client\" + name ];\n\t\t\t\t}\n\n\t\t\t\t// Get document width or height\n\t\t\t\tif ( elem.nodeType === 9 ) {\n\t\t\t\t\tdoc = elem.documentElement;\n\n\t\t\t\t\t// Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height],\n\t\t\t\t\t// whichever is greatest\n\t\t\t\t\treturn Math.max(\n\t\t\t\t\t\telem.body[ \"scroll\" + name ], doc[ \"scroll\" + name ],\n\t\t\t\t\t\telem.body[ \"offset\" + name ], doc[ \"offset\" + name ],\n\t\t\t\t\t\tdoc[ \"client\" + name ]\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn value === undefined ?\n\n\t\t\t\t\t// Get width or height on the element, requesting but not forcing parseFloat\n\t\t\t\t\tjQuery.css( elem, type, extra ) :\n\n\t\t\t\t\t// Set width or height on the element\n\t\t\t\t\tjQuery.style( elem, type, value, extra );\n\t\t\t}, type, chainable ? margin : undefined, chainable );\n\t\t};\n\t} );\n} );\n\n\njQuery.each( [\n\t\"ajaxStart\",\n\t\"ajaxStop\",\n\t\"ajaxComplete\",\n\t\"ajaxError\",\n\t\"ajaxSuccess\",\n\t\"ajaxSend\"\n], function( _i, type ) {\n\tjQuery.fn[ type ] = function( fn ) {\n\t\treturn this.on( type, fn );\n\t};\n} );\n\n\n\n\njQuery.fn.extend( {\n\n\tbind: function( types, data, fn ) {\n\t\treturn this.on( types, null, data, fn );\n\t},\n\tunbind: function( types, fn ) {\n\t\treturn this.off( types, null, fn );\n\t},\n\n\tdelegate: function( selector, types, data, fn ) {\n\t\treturn this.on( types, selector, data, fn );\n\t},\n\tundelegate: function( selector, types, fn ) {\n\n\t\t// ( namespace ) or ( selector, types [, fn] )\n\t\treturn arguments.length === 1 ?\n\t\t\tthis.off( selector, \"**\" ) :\n\t\t\tthis.off( types, selector || \"**\", fn );\n\t},\n\n\thover: function( fnOver, fnOut ) {\n\t\treturn this\n\t\t\t.on( \"mouseenter\", fnOver )\n\t\t\t.on( \"mouseleave\", fnOut || fnOver );\n\t}\n} );\n\njQuery.each(\n\t( \"blur focus focusin focusout resize scroll click dblclick \" +\n\t\"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave \" +\n\t\"change select submit keydown keypress keyup contextmenu\" ).split( \" \" ),\n\tfunction( _i, name ) {\n\n\t\t// Handle event binding\n\t\tjQuery.fn[ name ] = function( data, fn ) {\n\t\t\treturn arguments.length > 0 ?\n\t\t\t\tthis.on( name, null, data, fn ) :\n\t\t\t\tthis.trigger( name );\n\t\t};\n\t}\n);\n\n\n\n\n// Support: Android <=4.0 only\n// Make sure we trim BOM and NBSP\n// Require that the \"whitespace run\" starts from a non-whitespace\n// to avoid O(N^2) behavior when the engine would try matching \"\\s+$\" at each space position.\nvar rtrim = /^[\\s\\uFEFF\\xA0]+|([^\\s\\uFEFF\\xA0])[\\s\\uFEFF\\xA0]+$/g;\n\n// Bind a function to a context, optionally partially applying any\n// arguments.\n// jQuery.proxy is deprecated to promote standards (specifically Function#bind)\n// However, it is not slated for removal any time soon\njQuery.proxy = function( fn, context ) {\n\tvar tmp, args, proxy;\n\n\tif ( typeof context === \"string\" ) {\n\t\ttmp = fn[ context ];\n\t\tcontext = fn;\n\t\tfn = tmp;\n\t}\n\n\t// Quick check to determine if target is callable, in the spec\n\t// this throws a TypeError, but we will just return undefined.\n\tif ( !isFunction( fn ) ) {\n\t\treturn undefined;\n\t}\n\n\t// Simulated bind\n\targs = slice.call( arguments, 2 );\n\tproxy = function() {\n\t\treturn fn.apply( context || this, args.concat( slice.call( arguments ) ) );\n\t};\n\n\t// Set the guid of unique handler to the same of original handler, so it can be removed\n\tproxy.guid = fn.guid = fn.guid || jQuery.guid++;\n\n\treturn proxy;\n};\n\njQuery.holdReady = function( hold ) {\n\tif ( hold ) {\n\t\tjQuery.readyWait++;\n\t} else {\n\t\tjQuery.ready( true );\n\t}\n};\njQuery.isArray = Array.isArray;\njQuery.parseJSON = JSON.parse;\njQuery.nodeName = nodeName;\njQuery.isFunction = isFunction;\njQuery.isWindow = isWindow;\njQuery.camelCase = camelCase;\njQuery.type = toType;\n\njQuery.now = Date.now;\n\njQuery.isNumeric = function( obj ) {\n\n\t// As of jQuery 3.0, isNumeric is limited to\n\t// strings and numbers (primitives or objects)\n\t// that can be coerced to finite numbers (gh-2662)\n\tvar type = jQuery.type( obj );\n\treturn ( type === \"number\" || type === \"string\" ) &&\n\n\t\t// parseFloat NaNs numeric-cast false positives (\"\")\n\t\t// ...but misinterprets leading-number strings, particularly hex literals (\"0x...\")\n\t\t// subtraction forces infinities to NaN\n\t\t!isNaN( obj - parseFloat( obj ) );\n};\n\njQuery.trim = function( text ) {\n\treturn text == null ?\n\t\t\"\" :\n\t\t( text + \"\" ).replace( rtrim, \"$1\" );\n};\n\n\n\n// Register as a named AMD module, since jQuery can be concatenated with other\n// files that may use define, but not via a proper concatenation script that\n// understands anonymous AMD modules. A named AMD is safest and most robust\n// way to register. Lowercase jquery is used because AMD module names are\n// derived from file names, and jQuery is normally delivered in a lowercase\n// file name. Do this after creating the global so that if an AMD module wants\n// to call noConflict to hide this version of jQuery, it will work.\n\n// Note that for maximum portability, libraries that are not jQuery should\n// declare themselves as anonymous modules, and avoid setting a global if an\n// AMD loader is present. jQuery is a special case. For more information, see\n// https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon\n\nif ( typeof define === \"function\" && define.amd ) {\n\tdefine( \"jquery\", [], function() {\n\t\treturn jQuery;\n\t} );\n}\n\n\n\n\nvar\n\n\t// Map over jQuery in case of overwrite\n\t_jQuery = window.jQuery,\n\n\t// Map over the $ in case of overwrite\n\t_$ = window.$;\n\njQuery.noConflict = function( deep ) {\n\tif ( window.$ === jQuery ) {\n\t\twindow.$ = _$;\n\t}\n\n\tif ( deep && window.jQuery === jQuery ) {\n\t\twindow.jQuery = _jQuery;\n\t}\n\n\treturn jQuery;\n};\n\n// Expose jQuery and $ identifiers, even in AMD\n// (trac-7102#comment:10, https://github.com/jquery/jquery/pull/557)\n// and CommonJS for browser emulators (trac-13566)\nif ( typeof noGlobal === \"undefined\" ) {\n\twindow.jQuery = window.$ = jQuery;\n}\n\n\n\n\nreturn jQuery;\n} );\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap dom/data.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n/**\n * Constants\n */\n\nconst elementMap = new Map()\n\nexport default {\n  set(element, key, instance) {\n    if (!elementMap.has(element)) {\n      elementMap.set(element, new Map())\n    }\n\n    const instanceMap = elementMap.get(element)\n\n    // make it clear we only want one instance per element\n    // can be removed later when multiple key/instances are fine to be used\n    if (!instanceMap.has(key) && instanceMap.size !== 0) {\n      // eslint-disable-next-line no-console\n      console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(instanceMap.keys())[0]}.`)\n      return\n    }\n\n    instanceMap.set(key, instance)\n  },\n\n  get(element, key) {\n    if (elementMap.has(element)) {\n      return elementMap.get(element).get(key) || null\n    }\n\n    return null\n  },\n\n  remove(element, key) {\n    if (!elementMap.has(element)) {\n      return\n    }\n\n    const instanceMap = elementMap.get(element)\n\n    instanceMap.delete(key)\n\n    // free up element references if there are no instances left for an element\n    if (instanceMap.size === 0) {\n      elementMap.delete(element)\n    }\n  }\n}\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap util/index.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst MAX_UID = 1_000_000\nconst MILLISECONDS_MULTIPLIER = 1000\nconst TRANSITION_END = 'transitionend'\n\n/**\n * Properly escape IDs selectors to handle weird IDs\n * @param {string} selector\n * @returns {string}\n */\nconst parseSelector = selector => {\n  if (selector && window.CSS && window.CSS.escape) {\n    // document.querySelector needs escaping to handle IDs (html5+) containing for instance /\n    selector = selector.replace(/#([^\\s\"#']+)/g, (match, id) => `#${CSS.escape(id)}`)\n  }\n\n  return selector\n}\n\n// Shout-out Angus Croll (https://goo.gl/pxwQGp)\nconst toType = object => {\n  if (object === null || object === undefined) {\n    return `${object}`\n  }\n\n  return Object.prototype.toString.call(object).match(/\\s([a-z]+)/i)[1].toLowerCase()\n}\n\n/**\n * Public Util API\n */\n\nconst getUID = prefix => {\n  do {\n    prefix += Math.floor(Math.random() * MAX_UID)\n  } while (document.getElementById(prefix))\n\n  return prefix\n}\n\nconst getTransitionDurationFromElement = element => {\n  if (!element) {\n    return 0\n  }\n\n  // Get transition-duration of the element\n  let { transitionDuration, transitionDelay } = window.getComputedStyle(element)\n\n  const floatTransitionDuration = Number.parseFloat(transitionDuration)\n  const floatTransitionDelay = Number.parseFloat(transitionDelay)\n\n  // Return 0 if element or transition duration is not found\n  if (!floatTransitionDuration && !floatTransitionDelay) {\n    return 0\n  }\n\n  // If multiple durations are defined, take the first\n  transitionDuration = transitionDuration.split(',')[0]\n  transitionDelay = transitionDelay.split(',')[0]\n\n  return (Number.parseFloat(transitionDuration) + Number.parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER\n}\n\nconst triggerTransitionEnd = element => {\n  element.dispatchEvent(new Event(TRANSITION_END))\n}\n\nconst isElement = object => {\n  if (!object || typeof object !== 'object') {\n    return false\n  }\n\n  if (typeof object.jquery !== 'undefined') {\n    object = object[0]\n  }\n\n  return typeof object.nodeType !== 'undefined'\n}\n\nconst getElement = object => {\n  // it's a jQuery object or a node element\n  if (isElement(object)) {\n    return object.jquery ? object[0] : object\n  }\n\n  if (typeof object === 'string' && object.length > 0) {\n    return document.querySelector(parseSelector(object))\n  }\n\n  return null\n}\n\nconst isVisible = element => {\n  if (!isElement(element) || element.getClientRects().length === 0) {\n    return false\n  }\n\n  const elementIsVisible = getComputedStyle(element).getPropertyValue('visibility') === 'visible'\n  // Handle `details` element as its content may falsie appear visible when it is closed\n  const closedDetails = element.closest('details:not([open])')\n\n  if (!closedDetails) {\n    return elementIsVisible\n  }\n\n  if (closedDetails !== element) {\n    const summary = element.closest('summary')\n    if (summary && summary.parentNode !== closedDetails) {\n      return false\n    }\n\n    if (summary === null) {\n      return false\n    }\n  }\n\n  return elementIsVisible\n}\n\nconst isDisabled = element => {\n  if (!element || element.nodeType !== Node.ELEMENT_NODE) {\n    return true\n  }\n\n  if (element.classList.contains('disabled')) {\n    return true\n  }\n\n  if (typeof element.disabled !== 'undefined') {\n    return element.disabled\n  }\n\n  return element.hasAttribute('disabled') && element.getAttribute('disabled') !== 'false'\n}\n\nconst findShadowRoot = element => {\n  if (!document.documentElement.attachShadow) {\n    return null\n  }\n\n  // Can find the shadow root otherwise it'll return the document\n  if (typeof element.getRootNode === 'function') {\n    const root = element.getRootNode()\n    return root instanceof ShadowRoot ? root : null\n  }\n\n  if (element instanceof ShadowRoot) {\n    return element\n  }\n\n  // when we don't find a shadow root\n  if (!element.parentNode) {\n    return null\n  }\n\n  return findShadowRoot(element.parentNode)\n}\n\nconst noop = () => {}\n\n/**\n * Trick to restart an element's animation\n *\n * @param {HTMLElement} element\n * @return void\n *\n * @see https://www.harrytheo.com/blog/2021/02/restart-a-css-animation-with-javascript/#restarting-a-css-animation\n */\nconst reflow = element => {\n  element.offsetHeight // eslint-disable-line no-unused-expressions\n}\n\nconst getjQuery = () => {\n  if (window.jQuery && !document.body.hasAttribute('data-bs-no-jquery')) {\n    return window.jQuery\n  }\n\n  return null\n}\n\nconst DOMContentLoadedCallbacks = []\n\nconst onDOMContentLoaded = callback => {\n  if (document.readyState === 'loading') {\n    // add listener on the first call when the document is in loading state\n    if (!DOMContentLoadedCallbacks.length) {\n      document.addEventListener('DOMContentLoaded', () => {\n        for (const callback of DOMContentLoadedCallbacks) {\n          callback()\n        }\n      })\n    }\n\n    DOMContentLoadedCallbacks.push(callback)\n  } else {\n    callback()\n  }\n}\n\nconst isRTL = () => document.documentElement.dir === 'rtl'\n\nconst defineJQueryPlugin = plugin => {\n  onDOMContentLoaded(() => {\n    const $ = getjQuery()\n    /* istanbul ignore if */\n    if ($) {\n      const name = plugin.NAME\n      const JQUERY_NO_CONFLICT = $.fn[name]\n      $.fn[name] = plugin.jQueryInterface\n      $.fn[name].Constructor = plugin\n      $.fn[name].noConflict = () => {\n        $.fn[name] = JQUERY_NO_CONFLICT\n        return plugin.jQueryInterface\n      }\n    }\n  })\n}\n\nconst execute = (possibleCallback, args = [], defaultValue = possibleCallback) => {\n  return typeof possibleCallback === 'function' ? possibleCallback.call(...args) : defaultValue\n}\n\nconst executeAfterTransition = (callback, transitionElement, waitForTransition = true) => {\n  if (!waitForTransition) {\n    execute(callback)\n    return\n  }\n\n  const durationPadding = 5\n  const emulatedDuration = getTransitionDurationFromElement(transitionElement) + durationPadding\n\n  let called = false\n\n  const handler = ({ target }) => {\n    if (target !== transitionElement) {\n      return\n    }\n\n    called = true\n    transitionElement.removeEventListener(TRANSITION_END, handler)\n    execute(callback)\n  }\n\n  transitionElement.addEventListener(TRANSITION_END, handler)\n  setTimeout(() => {\n    if (!called) {\n      triggerTransitionEnd(transitionElement)\n    }\n  }, emulatedDuration)\n}\n\n/**\n * Return the previous/next element of a list.\n *\n * @param {array} list    The list of elements\n * @param activeElement   The active element\n * @param shouldGetNext   Choose to get next or previous element\n * @param isCycleAllowed\n * @return {Element|elem} The proper element\n */\nconst getNextActiveElement = (list, activeElement, shouldGetNext, isCycleAllowed) => {\n  const listLength = list.length\n  let index = list.indexOf(activeElement)\n\n  // if the element does not exist in the list return an element\n  // depending on the direction and if cycle is allowed\n  if (index === -1) {\n    return !shouldGetNext && isCycleAllowed ? list[listLength - 1] : list[0]\n  }\n\n  index += shouldGetNext ? 1 : -1\n\n  if (isCycleAllowed) {\n    index = (index + listLength) % listLength\n  }\n\n  return list[Math.max(0, Math.min(index, listLength - 1))]\n}\n\nexport {\n  defineJQueryPlugin,\n  execute,\n  executeAfterTransition,\n  findShadowRoot,\n  getElement,\n  getjQuery,\n  getNextActiveElement,\n  getTransitionDurationFromElement,\n  getUID,\n  isDisabled,\n  isElement,\n  isRTL,\n  isVisible,\n  noop,\n  onDOMContentLoaded,\n  parseSelector,\n  reflow,\n  triggerTransitionEnd,\n  toType\n}\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap dom/event-handler.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport { getjQuery } from '../util/index.js'\n\n/**\n * Constants\n */\n\nconst namespaceRegex = /[^.]*(?=\\..*)\\.|.*/\nconst stripNameRegex = /\\..*/\nconst stripUidRegex = /::\\d+$/\nconst eventRegistry = {} // Events storage\nlet uidEvent = 1\nconst customEvents = {\n  mouseenter: 'mouseover',\n  mouseleave: 'mouseout'\n}\n\nconst nativeEvents = new Set([\n  'click',\n  'dblclick',\n  'mouseup',\n  'mousedown',\n  'contextmenu',\n  'mousewheel',\n  'DOMMouseScroll',\n  'mouseover',\n  'mouseout',\n  'mousemove',\n  'selectstart',\n  'selectend',\n  'keydown',\n  'keypress',\n  'keyup',\n  'orientationchange',\n  'touchstart',\n  'touchmove',\n  'touchend',\n  'touchcancel',\n  'pointerdown',\n  'pointermove',\n  'pointerup',\n  'pointerleave',\n  'pointercancel',\n  'gesturestart',\n  'gesturechange',\n  'gestureend',\n  'focus',\n  'blur',\n  'change',\n  'reset',\n  'select',\n  'submit',\n  'focusin',\n  'focusout',\n  'load',\n  'unload',\n  'beforeunload',\n  'resize',\n  'move',\n  'DOMContentLoaded',\n  'readystatechange',\n  'error',\n  'abort',\n  'scroll'\n])\n\n/**\n * Private methods\n */\n\nfunction makeEventUid(element, uid) {\n  return (uid && `${uid}::${uidEvent++}`) || element.uidEvent || uidEvent++\n}\n\nfunction getElementEvents(element) {\n  const uid = makeEventUid(element)\n\n  element.uidEvent = uid\n  eventRegistry[uid] = eventRegistry[uid] || {}\n\n  return eventRegistry[uid]\n}\n\nfunction bootstrapHandler(element, fn) {\n  return function handler(event) {\n    hydrateObj(event, { delegateTarget: element })\n\n    if (handler.oneOff) {\n      EventHandler.off(element, event.type, fn)\n    }\n\n    return fn.apply(element, [event])\n  }\n}\n\nfunction bootstrapDelegationHandler(element, selector, fn) {\n  return function handler(event) {\n    const domElements = element.querySelectorAll(selector)\n\n    for (let { target } = event; target && target !== this; target = target.parentNode) {\n      for (const domElement of domElements) {\n        if (domElement !== target) {\n          continue\n        }\n\n        hydrateObj(event, { delegateTarget: target })\n\n        if (handler.oneOff) {\n          EventHandler.off(element, event.type, selector, fn)\n        }\n\n        return fn.apply(target, [event])\n      }\n    }\n  }\n}\n\nfunction findHandler(events, callable, delegationSelector = null) {\n  return Object.values(events)\n    .find(event => event.callable === callable && event.delegationSelector === delegationSelector)\n}\n\nfunction normalizeParameters(originalTypeEvent, handler, delegationFunction) {\n  const isDelegated = typeof handler === 'string'\n  // TODO: tooltip passes `false` instead of selector, so we need to check\n  const callable = isDelegated ? delegationFunction : (handler || delegationFunction)\n  let typeEvent = getTypeEvent(originalTypeEvent)\n\n  if (!nativeEvents.has(typeEvent)) {\n    typeEvent = originalTypeEvent\n  }\n\n  return [isDelegated, callable, typeEvent]\n}\n\nfunction addHandler(element, originalTypeEvent, handler, delegationFunction, oneOff) {\n  if (typeof originalTypeEvent !== 'string' || !element) {\n    return\n  }\n\n  let [isDelegated, callable, typeEvent] = normalizeParameters(originalTypeEvent, handler, delegationFunction)\n\n  // in case of mouseenter or mouseleave wrap the handler within a function that checks for its DOM position\n  // this prevents the handler from being dispatched the same way as mouseover or mouseout does\n  if (originalTypeEvent in customEvents) {\n    const wrapFunction = fn => {\n      return function (event) {\n        if (!event.relatedTarget || (event.relatedTarget !== event.delegateTarget && !event.delegateTarget.contains(event.relatedTarget))) {\n          return fn.call(this, event)\n        }\n      }\n    }\n\n    callable = wrapFunction(callable)\n  }\n\n  const events = getElementEvents(element)\n  const handlers = events[typeEvent] || (events[typeEvent] = {})\n  const previousFunction = findHandler(handlers, callable, isDelegated ? handler : null)\n\n  if (previousFunction) {\n    previousFunction.oneOff = previousFunction.oneOff && oneOff\n\n    return\n  }\n\n  const uid = makeEventUid(callable, originalTypeEvent.replace(namespaceRegex, ''))\n  const fn = isDelegated ?\n    bootstrapDelegationHandler(element, handler, callable) :\n    bootstrapHandler(element, callable)\n\n  fn.delegationSelector = isDelegated ? handler : null\n  fn.callable = callable\n  fn.oneOff = oneOff\n  fn.uidEvent = uid\n  handlers[uid] = fn\n\n  element.addEventListener(typeEvent, fn, isDelegated)\n}\n\nfunction removeHandler(element, events, typeEvent, handler, delegationSelector) {\n  const fn = findHandler(events[typeEvent], handler, delegationSelector)\n\n  if (!fn) {\n    return\n  }\n\n  element.removeEventListener(typeEvent, fn, Boolean(delegationSelector))\n  delete events[typeEvent][fn.uidEvent]\n}\n\nfunction removeNamespacedHandlers(element, events, typeEvent, namespace) {\n  const storeElementEvent = events[typeEvent] || {}\n\n  for (const [handlerKey, event] of Object.entries(storeElementEvent)) {\n    if (handlerKey.includes(namespace)) {\n      removeHandler(element, events, typeEvent, event.callable, event.delegationSelector)\n    }\n  }\n}\n\nfunction getTypeEvent(event) {\n  // allow to get the native events from namespaced events ('click.bs.button' --> 'click')\n  event = event.replace(stripNameRegex, '')\n  return customEvents[event] || event\n}\n\nconst EventHandler = {\n  on(element, event, handler, delegationFunction) {\n    addHandler(element, event, handler, delegationFunction, false)\n  },\n\n  one(element, event, handler, delegationFunction) {\n    addHandler(element, event, handler, delegationFunction, true)\n  },\n\n  off(element, originalTypeEvent, handler, delegationFunction) {\n    if (typeof originalTypeEvent !== 'string' || !element) {\n      return\n    }\n\n    const [isDelegated, callable, typeEvent] = normalizeParameters(originalTypeEvent, handler, delegationFunction)\n    const inNamespace = typeEvent !== originalTypeEvent\n    const events = getElementEvents(element)\n    const storeElementEvent = events[typeEvent] || {}\n    const isNamespace = originalTypeEvent.startsWith('.')\n\n    if (typeof callable !== 'undefined') {\n      // Simplest case: handler is passed, remove that listener ONLY.\n      if (!Object.keys(storeElementEvent).length) {\n        return\n      }\n\n      removeHandler(element, events, typeEvent, callable, isDelegated ? handler : null)\n      return\n    }\n\n    if (isNamespace) {\n      for (const elementEvent of Object.keys(events)) {\n        removeNamespacedHandlers(element, events, elementEvent, originalTypeEvent.slice(1))\n      }\n    }\n\n    for (const [keyHandlers, event] of Object.entries(storeElementEvent)) {\n      const handlerKey = keyHandlers.replace(stripUidRegex, '')\n\n      if (!inNamespace || originalTypeEvent.includes(handlerKey)) {\n        removeHandler(element, events, typeEvent, event.callable, event.delegationSelector)\n      }\n    }\n  },\n\n  trigger(element, event, args) {\n    if (typeof event !== 'string' || !element) {\n      return null\n    }\n\n    const $ = getjQuery()\n    const typeEvent = getTypeEvent(event)\n    const inNamespace = event !== typeEvent\n\n    let jQueryEvent = null\n    let bubbles = true\n    let nativeDispatch = true\n    let defaultPrevented = false\n\n    if (inNamespace && $) {\n      jQueryEvent = $.Event(event, args)\n\n      $(element).trigger(jQueryEvent)\n      bubbles = !jQueryEvent.isPropagationStopped()\n      nativeDispatch = !jQueryEvent.isImmediatePropagationStopped()\n      defaultPrevented = jQueryEvent.isDefaultPrevented()\n    }\n\n    const evt = hydrateObj(new Event(event, { bubbles, cancelable: true }), args)\n\n    if (defaultPrevented) {\n      evt.preventDefault()\n    }\n\n    if (nativeDispatch) {\n      element.dispatchEvent(evt)\n    }\n\n    if (evt.defaultPrevented && jQueryEvent) {\n      jQueryEvent.preventDefault()\n    }\n\n    return evt\n  }\n}\n\nfunction hydrateObj(obj, meta = {}) {\n  for (const [key, value] of Object.entries(meta)) {\n    try {\n      obj[key] = value\n    } catch {\n      Object.defineProperty(obj, key, {\n        configurable: true,\n        get() {\n          return value\n        }\n      })\n    }\n  }\n\n  return obj\n}\n\nexport default EventHandler\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap dom/manipulator.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nfunction normalizeData(value) {\n  if (value === 'true') {\n    return true\n  }\n\n  if (value === 'false') {\n    return false\n  }\n\n  if (value === Number(value).toString()) {\n    return Number(value)\n  }\n\n  if (value === '' || value === 'null') {\n    return null\n  }\n\n  if (typeof value !== 'string') {\n    return value\n  }\n\n  try {\n    return JSON.parse(decodeURIComponent(value))\n  } catch {\n    return value\n  }\n}\n\nfunction normalizeDataKey(key) {\n  return key.replace(/[A-Z]/g, chr => `-${chr.toLowerCase()}`)\n}\n\nconst Manipulator = {\n  setDataAttribute(element, key, value) {\n    element.setAttribute(`data-bs-${normalizeDataKey(key)}`, value)\n  },\n\n  removeDataAttribute(element, key) {\n    element.removeAttribute(`data-bs-${normalizeDataKey(key)}`)\n  },\n\n  getDataAttributes(element) {\n    if (!element) {\n      return {}\n    }\n\n    const attributes = {}\n    const bsKeys = Object.keys(element.dataset).filter(key => key.startsWith('bs') && !key.startsWith('bsConfig'))\n\n    for (const key of bsKeys) {\n      let pureKey = key.replace(/^bs/, '')\n      pureKey = pureKey.charAt(0).toLowerCase() + pureKey.slice(1)\n      attributes[pureKey] = normalizeData(element.dataset[key])\n    }\n\n    return attributes\n  },\n\n  getDataAttribute(element, key) {\n    return normalizeData(element.getAttribute(`data-bs-${normalizeDataKey(key)}`))\n  }\n}\n\nexport default Manipulator\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap util/config.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport Manipulator from '../dom/manipulator.js'\nimport { isElement, toType } from './index.js'\n\n/**\n * Class definition\n */\n\nclass Config {\n  // Getters\n  static get Default() {\n    return {}\n  }\n\n  static get DefaultType() {\n    return {}\n  }\n\n  static get NAME() {\n    throw new Error('You have to implement the static method \"NAME\", for each component!')\n  }\n\n  _getConfig(config) {\n    config = this._mergeConfigObj(config)\n    config = this._configAfterMerge(config)\n    this._typeCheckConfig(config)\n    return config\n  }\n\n  _configAfterMerge(config) {\n    return config\n  }\n\n  _mergeConfigObj(config, element) {\n    const jsonConfig = isElement(element) ? Manipulator.getDataAttribute(element, 'config') : {} // try to parse\n\n    return {\n      ...this.constructor.Default,\n      ...(typeof jsonConfig === 'object' ? jsonConfig : {}),\n      ...(isElement(element) ? Manipulator.getDataAttributes(element) : {}),\n      ...(typeof config === 'object' ? config : {})\n    }\n  }\n\n  _typeCheckConfig(config, configTypes = this.constructor.DefaultType) {\n    for (const [property, expectedTypes] of Object.entries(configTypes)) {\n      const value = config[property]\n      const valueType = isElement(value) ? 'element' : toType(value)\n\n      if (!new RegExp(expectedTypes).test(valueType)) {\n        throw new TypeError(\n          `${this.constructor.NAME.toUpperCase()}: Option \"${property}\" provided type \"${valueType}\" but expected type \"${expectedTypes}\".`\n        )\n      }\n    }\n  }\n}\n\nexport default Config\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap base-component.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport Data from './dom/data.js'\nimport EventHandler from './dom/event-handler.js'\nimport Config from './util/config.js'\nimport { executeAfterTransition, getElement } from './util/index.js'\n\n/**\n * Constants\n */\n\nconst VERSION = '5.3.7'\n\n/**\n * Class definition\n */\n\nclass BaseComponent extends Config {\n  constructor(element, config) {\n    super()\n\n    element = getElement(element)\n    if (!element) {\n      return\n    }\n\n    this._element = element\n    this._config = this._getConfig(config)\n\n    Data.set(this._element, this.constructor.DATA_KEY, this)\n  }\n\n  // Public\n  dispose() {\n    Data.remove(this._element, this.constructor.DATA_KEY)\n    EventHandler.off(this._element, this.constructor.EVENT_KEY)\n\n    for (const propertyName of Object.getOwnPropertyNames(this)) {\n      this[propertyName] = null\n    }\n  }\n\n  // Private\n  _queueCallback(callback, element, isAnimated = true) {\n    executeAfterTransition(callback, element, isAnimated)\n  }\n\n  _getConfig(config) {\n    config = this._mergeConfigObj(config, this._element)\n    config = this._configAfterMerge(config)\n    this._typeCheckConfig(config)\n    return config\n  }\n\n  // Static\n  static getInstance(element) {\n    return Data.get(getElement(element), this.DATA_KEY)\n  }\n\n  static getOrCreateInstance(element, config = {}) {\n    return this.getInstance(element) || new this(element, typeof config === 'object' ? config : null)\n  }\n\n  static get VERSION() {\n    return VERSION\n  }\n\n  static get DATA_KEY() {\n    return `bs.${this.NAME}`\n  }\n\n  static get EVENT_KEY() {\n    return `.${this.DATA_KEY}`\n  }\n\n  static eventName(name) {\n    return `${name}${this.EVENT_KEY}`\n  }\n}\n\nexport default BaseComponent\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap dom/selector-engine.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport { isDisabled, isVisible, parseSelector } from '../util/index.js'\n\nconst getSelector = element => {\n  let selector = element.getAttribute('data-bs-target')\n\n  if (!selector || selector === '#') {\n    let hrefAttribute = element.getAttribute('href')\n\n    // The only valid content that could double as a selector are IDs or classes,\n    // so everything starting with `#` or `.`. If a \"real\" URL is used as the selector,\n    // `document.querySelector` will rightfully complain it is invalid.\n    // See https://github.com/twbs/bootstrap/issues/32273\n    if (!hrefAttribute || (!hrefAttribute.includes('#') && !hrefAttribute.startsWith('.'))) {\n      return null\n    }\n\n    // Just in case some CMS puts out a full URL with the anchor appended\n    if (hrefAttribute.includes('#') && !hrefAttribute.startsWith('#')) {\n      hrefAttribute = `#${hrefAttribute.split('#')[1]}`\n    }\n\n    selector = hrefAttribute && hrefAttribute !== '#' ? hrefAttribute.trim() : null\n  }\n\n  return selector ? selector.split(',').map(sel => parseSelector(sel)).join(',') : null\n}\n\nconst SelectorEngine = {\n  find(selector, element = document.documentElement) {\n    return [].concat(...Element.prototype.querySelectorAll.call(element, selector))\n  },\n\n  findOne(selector, element = document.documentElement) {\n    return Element.prototype.querySelector.call(element, selector)\n  },\n\n  children(element, selector) {\n    return [].concat(...element.children).filter(child => child.matches(selector))\n  },\n\n  parents(element, selector) {\n    const parents = []\n    let ancestor = element.parentNode.closest(selector)\n\n    while (ancestor) {\n      parents.push(ancestor)\n      ancestor = ancestor.parentNode.closest(selector)\n    }\n\n    return parents\n  },\n\n  prev(element, selector) {\n    let previous = element.previousElementSibling\n\n    while (previous) {\n      if (previous.matches(selector)) {\n        return [previous]\n      }\n\n      previous = previous.previousElementSibling\n    }\n\n    return []\n  },\n  // TODO: this is now unused; remove later along with prev()\n  next(element, selector) {\n    let next = element.nextElementSibling\n\n    while (next) {\n      if (next.matches(selector)) {\n        return [next]\n      }\n\n      next = next.nextElementSibling\n    }\n\n    return []\n  },\n\n  focusableChildren(element) {\n    const focusables = [\n      'a',\n      'button',\n      'input',\n      'textarea',\n      'select',\n      'details',\n      '[tabindex]',\n      '[contenteditable=\"true\"]'\n    ].map(selector => `${selector}:not([tabindex^=\"-\"])`).join(',')\n\n    return this.find(focusables, element).filter(el => !isDisabled(el) && isVisible(el))\n  },\n\n  getSelectorFromElement(element) {\n    const selector = getSelector(element)\n\n    if (selector) {\n      return SelectorEngine.findOne(selector) ? selector : null\n    }\n\n    return null\n  },\n\n  getElementFromSelector(element) {\n    const selector = getSelector(element)\n\n    return selector ? SelectorEngine.findOne(selector) : null\n  },\n\n  getMultipleElementsFromSelector(element) {\n    const selector = getSelector(element)\n\n    return selector ? SelectorEngine.find(selector) : []\n  }\n}\n\nexport default SelectorEngine\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap util/component-functions.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport EventHandler from '../dom/event-handler.js'\nimport SelectorEngine from '../dom/selector-engine.js'\nimport { isDisabled } from './index.js'\n\nconst enableDismissTrigger = (component, method = 'hide') => {\n  const clickEvent = `click.dismiss${component.EVENT_KEY}`\n  const name = component.NAME\n\n  EventHandler.on(document, clickEvent, `[data-bs-dismiss=\"${name}\"]`, function (event) {\n    if (['A', 'AREA'].includes(this.tagName)) {\n      event.preventDefault()\n    }\n\n    if (isDisabled(this)) {\n      return\n    }\n\n    const target = SelectorEngine.getElementFromSelector(this) || this.closest(`.${name}`)\n    const instance = component.getOrCreateInstance(target)\n\n    // Method argument is left, for Alert and only, as it doesn't implement the 'hide' method\n    instance[method]()\n  })\n}\n\nexport {\n  enableDismissTrigger\n}\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap alert.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport BaseComponent from './base-component.js'\nimport EventHandler from './dom/event-handler.js'\nimport { enableDismissTrigger } from './util/component-functions.js'\nimport { defineJQueryPlugin } from './util/index.js'\n\n/**\n * Constants\n */\n\nconst NAME = 'alert'\nconst DATA_KEY = 'bs.alert'\nconst EVENT_KEY = `.${DATA_KEY}`\n\nconst EVENT_CLOSE = `close${EVENT_KEY}`\nconst EVENT_CLOSED = `closed${EVENT_KEY}`\nconst CLASS_NAME_FADE = 'fade'\nconst CLASS_NAME_SHOW = 'show'\n\n/**\n * Class definition\n */\n\nclass Alert extends BaseComponent {\n  // Getters\n  static get NAME() {\n    return NAME\n  }\n\n  // Public\n  close() {\n    const closeEvent = EventHandler.trigger(this._element, EVENT_CLOSE)\n\n    if (closeEvent.defaultPrevented) {\n      return\n    }\n\n    this._element.classList.remove(CLASS_NAME_SHOW)\n\n    const isAnimated = this._element.classList.contains(CLASS_NAME_FADE)\n    this._queueCallback(() => this._destroyElement(), this._element, isAnimated)\n  }\n\n  // Private\n  _destroyElement() {\n    this._element.remove()\n    EventHandler.trigger(this._element, EVENT_CLOSED)\n    this.dispose()\n  }\n\n  // Static\n  static jQueryInterface(config) {\n    return this.each(function () {\n      const data = Alert.getOrCreateInstance(this)\n\n      if (typeof config !== 'string') {\n        return\n      }\n\n      if (data[config] === undefined || config.startsWith('_') || config === 'constructor') {\n        throw new TypeError(`No method named \"${config}\"`)\n      }\n\n      data[config](this)\n    })\n  }\n}\n\n/**\n * Data API implementation\n */\n\nenableDismissTrigger(Alert, 'close')\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Alert)\n\nexport default Alert\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap button.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport BaseComponent from './base-component.js'\nimport EventHandler from './dom/event-handler.js'\nimport { defineJQueryPlugin } from './util/index.js'\n\n/**\n * Constants\n */\n\nconst NAME = 'button'\nconst DATA_KEY = 'bs.button'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst DATA_API_KEY = '.data-api'\n\nconst CLASS_NAME_ACTIVE = 'active'\nconst SELECTOR_DATA_TOGGLE = '[data-bs-toggle=\"button\"]'\nconst EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`\n\n/**\n * Class definition\n */\n\nclass Button extends BaseComponent {\n  // Getters\n  static get NAME() {\n    return NAME\n  }\n\n  // Public\n  toggle() {\n    // Toggle class and sync the `aria-pressed` attribute with the return value of the `.toggle()` method\n    this._element.setAttribute('aria-pressed', this._element.classList.toggle(CLASS_NAME_ACTIVE))\n  }\n\n  // Static\n  static jQueryInterface(config) {\n    return this.each(function () {\n      const data = Button.getOrCreateInstance(this)\n\n      if (config === 'toggle') {\n        data[config]()\n      }\n    })\n  }\n}\n\n/**\n * Data API implementation\n */\n\nEventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, event => {\n  event.preventDefault()\n\n  const button = event.target.closest(SELECTOR_DATA_TOGGLE)\n  const data = Button.getOrCreateInstance(button)\n\n  data.toggle()\n})\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Button)\n\nexport default Button\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap util/swipe.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport EventHandler from '../dom/event-handler.js'\nimport Config from './config.js'\nimport { execute } from './index.js'\n\n/**\n * Constants\n */\n\nconst NAME = 'swipe'\nconst EVENT_KEY = '.bs.swipe'\nconst EVENT_TOUCHSTART = `touchstart${EVENT_KEY}`\nconst EVENT_TOUCHMOVE = `touchmove${EVENT_KEY}`\nconst EVENT_TOUCHEND = `touchend${EVENT_KEY}`\nconst EVENT_POINTERDOWN = `pointerdown${EVENT_KEY}`\nconst EVENT_POINTERUP = `pointerup${EVENT_KEY}`\nconst POINTER_TYPE_TOUCH = 'touch'\nconst POINTER_TYPE_PEN = 'pen'\nconst CLASS_NAME_POINTER_EVENT = 'pointer-event'\nconst SWIPE_THRESHOLD = 40\n\nconst Default = {\n  endCallback: null,\n  leftCallback: null,\n  rightCallback: null\n}\n\nconst DefaultType = {\n  endCallback: '(function|null)',\n  leftCallback: '(function|null)',\n  rightCallback: '(function|null)'\n}\n\n/**\n * Class definition\n */\n\nclass Swipe extends Config {\n  constructor(element, config) {\n    super()\n    this._element = element\n\n    if (!element || !Swipe.isSupported()) {\n      return\n    }\n\n    this._config = this._getConfig(config)\n    this._deltaX = 0\n    this._supportPointerEvents = Boolean(window.PointerEvent)\n    this._initEvents()\n  }\n\n  // Getters\n  static get Default() {\n    return Default\n  }\n\n  static get DefaultType() {\n    return DefaultType\n  }\n\n  static get NAME() {\n    return NAME\n  }\n\n  // Public\n  dispose() {\n    EventHandler.off(this._element, EVENT_KEY)\n  }\n\n  // Private\n  _start(event) {\n    if (!this._supportPointerEvents) {\n      this._deltaX = event.touches[0].clientX\n\n      return\n    }\n\n    if (this._eventIsPointerPenTouch(event)) {\n      this._deltaX = event.clientX\n    }\n  }\n\n  _end(event) {\n    if (this._eventIsPointerPenTouch(event)) {\n      this._deltaX = event.clientX - this._deltaX\n    }\n\n    this._handleSwipe()\n    execute(this._config.endCallback)\n  }\n\n  _move(event) {\n    this._deltaX = event.touches && event.touches.length > 1 ?\n      0 :\n      event.touches[0].clientX - this._deltaX\n  }\n\n  _handleSwipe() {\n    const absDeltaX = Math.abs(this._deltaX)\n\n    if (absDeltaX <= SWIPE_THRESHOLD) {\n      return\n    }\n\n    const direction = absDeltaX / this._deltaX\n\n    this._deltaX = 0\n\n    if (!direction) {\n      return\n    }\n\n    execute(direction > 0 ? this._config.rightCallback : this._config.leftCallback)\n  }\n\n  _initEvents() {\n    if (this._supportPointerEvents) {\n      EventHandler.on(this._element, EVENT_POINTERDOWN, event => this._start(event))\n      EventHandler.on(this._element, EVENT_POINTERUP, event => this._end(event))\n\n      this._element.classList.add(CLASS_NAME_POINTER_EVENT)\n    } else {\n      EventHandler.on(this._element, EVENT_TOUCHSTART, event => this._start(event))\n      EventHandler.on(this._element, EVENT_TOUCHMOVE, event => this._move(event))\n      EventHandler.on(this._element, EVENT_TOUCHEND, event => this._end(event))\n    }\n  }\n\n  _eventIsPointerPenTouch(event) {\n    return this._supportPointerEvents && (event.pointerType === POINTER_TYPE_PEN || event.pointerType === POINTER_TYPE_TOUCH)\n  }\n\n  // Static\n  static isSupported() {\n    return 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0\n  }\n}\n\nexport default Swipe\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap carousel.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport BaseComponent from './base-component.js'\nimport EventHandler from './dom/event-handler.js'\nimport Manipulator from './dom/manipulator.js'\nimport SelectorEngine from './dom/selector-engine.js'\nimport {\n  defineJQueryPlugin,\n  getNextActiveElement,\n  isRTL,\n  isVisible,\n  reflow,\n  triggerTransitionEnd\n} from './util/index.js'\nimport Swipe from './util/swipe.js'\n\n/**\n * Constants\n */\n\nconst NAME = 'carousel'\nconst DATA_KEY = 'bs.carousel'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst DATA_API_KEY = '.data-api'\n\nconst ARROW_LEFT_KEY = 'ArrowLeft'\nconst ARROW_RIGHT_KEY = 'ArrowRight'\nconst TOUCHEVENT_COMPAT_WAIT = 500 // Time for mouse compat events to fire after touch\n\nconst ORDER_NEXT = 'next'\nconst ORDER_PREV = 'prev'\nconst DIRECTION_LEFT = 'left'\nconst DIRECTION_RIGHT = 'right'\n\nconst EVENT_SLIDE = `slide${EVENT_KEY}`\nconst EVENT_SLID = `slid${EVENT_KEY}`\nconst EVENT_KEYDOWN = `keydown${EVENT_KEY}`\nconst EVENT_MOUSEENTER = `mouseenter${EVENT_KEY}`\nconst EVENT_MOUSELEAVE = `mouseleave${EVENT_KEY}`\nconst EVENT_DRAG_START = `dragstart${EVENT_KEY}`\nconst EVENT_LOAD_DATA_API = `load${EVENT_KEY}${DATA_API_KEY}`\nconst EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`\n\nconst CLASS_NAME_CAROUSEL = 'carousel'\nconst CLASS_NAME_ACTIVE = 'active'\nconst CLASS_NAME_SLIDE = 'slide'\nconst CLASS_NAME_END = 'carousel-item-end'\nconst CLASS_NAME_START = 'carousel-item-start'\nconst CLASS_NAME_NEXT = 'carousel-item-next'\nconst CLASS_NAME_PREV = 'carousel-item-prev'\n\nconst SELECTOR_ACTIVE = '.active'\nconst SELECTOR_ITEM = '.carousel-item'\nconst SELECTOR_ACTIVE_ITEM = SELECTOR_ACTIVE + SELECTOR_ITEM\nconst SELECTOR_ITEM_IMG = '.carousel-item img'\nconst SELECTOR_INDICATORS = '.carousel-indicators'\nconst SELECTOR_DATA_SLIDE = '[data-bs-slide], [data-bs-slide-to]'\nconst SELECTOR_DATA_RIDE = '[data-bs-ride=\"carousel\"]'\n\nconst KEY_TO_DIRECTION = {\n  [ARROW_LEFT_KEY]: DIRECTION_RIGHT,\n  [ARROW_RIGHT_KEY]: DIRECTION_LEFT\n}\n\nconst Default = {\n  interval: 5000,\n  keyboard: true,\n  pause: 'hover',\n  ride: false,\n  touch: true,\n  wrap: true\n}\n\nconst DefaultType = {\n  interval: '(number|boolean)', // TODO:v6 remove boolean support\n  keyboard: 'boolean',\n  pause: '(string|boolean)',\n  ride: '(boolean|string)',\n  touch: 'boolean',\n  wrap: 'boolean'\n}\n\n/**\n * Class definition\n */\n\nclass Carousel extends BaseComponent {\n  constructor(element, config) {\n    super(element, config)\n\n    this._interval = null\n    this._activeElement = null\n    this._isSliding = false\n    this.touchTimeout = null\n    this._swipeHelper = null\n\n    this._indicatorsElement = SelectorEngine.findOne(SELECTOR_INDICATORS, this._element)\n    this._addEventListeners()\n\n    if (this._config.ride === CLASS_NAME_CAROUSEL) {\n      this.cycle()\n    }\n  }\n\n  // Getters\n  static get Default() {\n    return Default\n  }\n\n  static get DefaultType() {\n    return DefaultType\n  }\n\n  static get NAME() {\n    return NAME\n  }\n\n  // Public\n  next() {\n    this._slide(ORDER_NEXT)\n  }\n\n  nextWhenVisible() {\n    // FIXME TODO use `document.visibilityState`\n    // Don't call next when the page isn't visible\n    // or the carousel or its parent isn't visible\n    if (!document.hidden && isVisible(this._element)) {\n      this.next()\n    }\n  }\n\n  prev() {\n    this._slide(ORDER_PREV)\n  }\n\n  pause() {\n    if (this._isSliding) {\n      triggerTransitionEnd(this._element)\n    }\n\n    this._clearInterval()\n  }\n\n  cycle() {\n    this._clearInterval()\n    this._updateInterval()\n\n    this._interval = setInterval(() => this.nextWhenVisible(), this._config.interval)\n  }\n\n  _maybeEnableCycle() {\n    if (!this._config.ride) {\n      return\n    }\n\n    if (this._isSliding) {\n      EventHandler.one(this._element, EVENT_SLID, () => this.cycle())\n      return\n    }\n\n    this.cycle()\n  }\n\n  to(index) {\n    const items = this._getItems()\n    if (index > items.length - 1 || index < 0) {\n      return\n    }\n\n    if (this._isSliding) {\n      EventHandler.one(this._element, EVENT_SLID, () => this.to(index))\n      return\n    }\n\n    const activeIndex = this._getItemIndex(this._getActive())\n    if (activeIndex === index) {\n      return\n    }\n\n    const order = index > activeIndex ? ORDER_NEXT : ORDER_PREV\n\n    this._slide(order, items[index])\n  }\n\n  dispose() {\n    if (this._swipeHelper) {\n      this._swipeHelper.dispose()\n    }\n\n    super.dispose()\n  }\n\n  // Private\n  _configAfterMerge(config) {\n    config.defaultInterval = config.interval\n    return config\n  }\n\n  _addEventListeners() {\n    if (this._config.keyboard) {\n      EventHandler.on(this._element, EVENT_KEYDOWN, event => this._keydown(event))\n    }\n\n    if (this._config.pause === 'hover') {\n      EventHandler.on(this._element, EVENT_MOUSEENTER, () => this.pause())\n      EventHandler.on(this._element, EVENT_MOUSELEAVE, () => this._maybeEnableCycle())\n    }\n\n    if (this._config.touch && Swipe.isSupported()) {\n      this._addTouchEventListeners()\n    }\n  }\n\n  _addTouchEventListeners() {\n    for (const img of SelectorEngine.find(SELECTOR_ITEM_IMG, this._element)) {\n      EventHandler.on(img, EVENT_DRAG_START, event => event.preventDefault())\n    }\n\n    const endCallBack = () => {\n      if (this._config.pause !== 'hover') {\n        return\n      }\n\n      // If it's a touch-enabled device, mouseenter/leave are fired as\n      // part of the mouse compatibility events on first tap - the carousel\n      // would stop cycling until user tapped out of it;\n      // here, we listen for touchend, explicitly pause the carousel\n      // (as if it's the second time we tap on it, mouseenter compat event\n      // is NOT fired) and after a timeout (to allow for mouse compatibility\n      // events to fire) we explicitly restart cycling\n\n      this.pause()\n      if (this.touchTimeout) {\n        clearTimeout(this.touchTimeout)\n      }\n\n      this.touchTimeout = setTimeout(() => this._maybeEnableCycle(), TOUCHEVENT_COMPAT_WAIT + this._config.interval)\n    }\n\n    const swipeConfig = {\n      leftCallback: () => this._slide(this._directionToOrder(DIRECTION_LEFT)),\n      rightCallback: () => this._slide(this._directionToOrder(DIRECTION_RIGHT)),\n      endCallback: endCallBack\n    }\n\n    this._swipeHelper = new Swipe(this._element, swipeConfig)\n  }\n\n  _keydown(event) {\n    if (/input|textarea/i.test(event.target.tagName)) {\n      return\n    }\n\n    const direction = KEY_TO_DIRECTION[event.key]\n    if (direction) {\n      event.preventDefault()\n      this._slide(this._directionToOrder(direction))\n    }\n  }\n\n  _getItemIndex(element) {\n    return this._getItems().indexOf(element)\n  }\n\n  _setActiveIndicatorElement(index) {\n    if (!this._indicatorsElement) {\n      return\n    }\n\n    const activeIndicator = SelectorEngine.findOne(SELECTOR_ACTIVE, this._indicatorsElement)\n\n    activeIndicator.classList.remove(CLASS_NAME_ACTIVE)\n    activeIndicator.removeAttribute('aria-current')\n\n    const newActiveIndicator = SelectorEngine.findOne(`[data-bs-slide-to=\"${index}\"]`, this._indicatorsElement)\n\n    if (newActiveIndicator) {\n      newActiveIndicator.classList.add(CLASS_NAME_ACTIVE)\n      newActiveIndicator.setAttribute('aria-current', 'true')\n    }\n  }\n\n  _updateInterval() {\n    const element = this._activeElement || this._getActive()\n\n    if (!element) {\n      return\n    }\n\n    const elementInterval = Number.parseInt(element.getAttribute('data-bs-interval'), 10)\n\n    this._config.interval = elementInterval || this._config.defaultInterval\n  }\n\n  _slide(order, element = null) {\n    if (this._isSliding) {\n      return\n    }\n\n    const activeElement = this._getActive()\n    const isNext = order === ORDER_NEXT\n    const nextElement = element || getNextActiveElement(this._getItems(), activeElement, isNext, this._config.wrap)\n\n    if (nextElement === activeElement) {\n      return\n    }\n\n    const nextElementIndex = this._getItemIndex(nextElement)\n\n    const triggerEvent = eventName => {\n      return EventHandler.trigger(this._element, eventName, {\n        relatedTarget: nextElement,\n        direction: this._orderToDirection(order),\n        from: this._getItemIndex(activeElement),\n        to: nextElementIndex\n      })\n    }\n\n    const slideEvent = triggerEvent(EVENT_SLIDE)\n\n    if (slideEvent.defaultPrevented) {\n      return\n    }\n\n    if (!activeElement || !nextElement) {\n      // Some weirdness is happening, so we bail\n      // TODO: change tests that use empty divs to avoid this check\n      return\n    }\n\n    const isCycling = Boolean(this._interval)\n    this.pause()\n\n    this._isSliding = true\n\n    this._setActiveIndicatorElement(nextElementIndex)\n    this._activeElement = nextElement\n\n    const directionalClassName = isNext ? CLASS_NAME_START : CLASS_NAME_END\n    const orderClassName = isNext ? CLASS_NAME_NEXT : CLASS_NAME_PREV\n\n    nextElement.classList.add(orderClassName)\n\n    reflow(nextElement)\n\n    activeElement.classList.add(directionalClassName)\n    nextElement.classList.add(directionalClassName)\n\n    const completeCallBack = () => {\n      nextElement.classList.remove(directionalClassName, orderClassName)\n      nextElement.classList.add(CLASS_NAME_ACTIVE)\n\n      activeElement.classList.remove(CLASS_NAME_ACTIVE, orderClassName, directionalClassName)\n\n      this._isSliding = false\n\n      triggerEvent(EVENT_SLID)\n    }\n\n    this._queueCallback(completeCallBack, activeElement, this._isAnimated())\n\n    if (isCycling) {\n      this.cycle()\n    }\n  }\n\n  _isAnimated() {\n    return this._element.classList.contains(CLASS_NAME_SLIDE)\n  }\n\n  _getActive() {\n    return SelectorEngine.findOne(SELECTOR_ACTIVE_ITEM, this._element)\n  }\n\n  _getItems() {\n    return SelectorEngine.find(SELECTOR_ITEM, this._element)\n  }\n\n  _clearInterval() {\n    if (this._interval) {\n      clearInterval(this._interval)\n      this._interval = null\n    }\n  }\n\n  _directionToOrder(direction) {\n    if (isRTL()) {\n      return direction === DIRECTION_LEFT ? ORDER_PREV : ORDER_NEXT\n    }\n\n    return direction === DIRECTION_LEFT ? ORDER_NEXT : ORDER_PREV\n  }\n\n  _orderToDirection(order) {\n    if (isRTL()) {\n      return order === ORDER_PREV ? DIRECTION_LEFT : DIRECTION_RIGHT\n    }\n\n    return order === ORDER_PREV ? DIRECTION_RIGHT : DIRECTION_LEFT\n  }\n\n  // Static\n  static jQueryInterface(config) {\n    return this.each(function () {\n      const data = Carousel.getOrCreateInstance(this, config)\n\n      if (typeof config === 'number') {\n        data.to(config)\n        return\n      }\n\n      if (typeof config === 'string') {\n        if (data[config] === undefined || config.startsWith('_') || config === 'constructor') {\n          throw new TypeError(`No method named \"${config}\"`)\n        }\n\n        data[config]()\n      }\n    })\n  }\n}\n\n/**\n * Data API implementation\n */\n\nEventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_SLIDE, function (event) {\n  const target = SelectorEngine.getElementFromSelector(this)\n\n  if (!target || !target.classList.contains(CLASS_NAME_CAROUSEL)) {\n    return\n  }\n\n  event.preventDefault()\n\n  const carousel = Carousel.getOrCreateInstance(target)\n  const slideIndex = this.getAttribute('data-bs-slide-to')\n\n  if (slideIndex) {\n    carousel.to(slideIndex)\n    carousel._maybeEnableCycle()\n    return\n  }\n\n  if (Manipulator.getDataAttribute(this, 'slide') === 'next') {\n    carousel.next()\n    carousel._maybeEnableCycle()\n    return\n  }\n\n  carousel.prev()\n  carousel._maybeEnableCycle()\n})\n\nEventHandler.on(window, EVENT_LOAD_DATA_API, () => {\n  const carousels = SelectorEngine.find(SELECTOR_DATA_RIDE)\n\n  for (const carousel of carousels) {\n    Carousel.getOrCreateInstance(carousel)\n  }\n})\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Carousel)\n\nexport default Carousel\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap collapse.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport BaseComponent from './base-component.js'\nimport EventHandler from './dom/event-handler.js'\nimport SelectorEngine from './dom/selector-engine.js'\nimport {\n  defineJQueryPlugin,\n  getElement,\n  reflow\n} from './util/index.js'\n\n/**\n * Constants\n */\n\nconst NAME = 'collapse'\nconst DATA_KEY = 'bs.collapse'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst DATA_API_KEY = '.data-api'\n\nconst EVENT_SHOW = `show${EVENT_KEY}`\nconst EVENT_SHOWN = `shown${EVENT_KEY}`\nconst EVENT_HIDE = `hide${EVENT_KEY}`\nconst EVENT_HIDDEN = `hidden${EVENT_KEY}`\nconst EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`\n\nconst CLASS_NAME_SHOW = 'show'\nconst CLASS_NAME_COLLAPSE = 'collapse'\nconst CLASS_NAME_COLLAPSING = 'collapsing'\nconst CLASS_NAME_COLLAPSED = 'collapsed'\nconst CLASS_NAME_DEEPER_CHILDREN = `:scope .${CLASS_NAME_COLLAPSE} .${CLASS_NAME_COLLAPSE}`\nconst CLASS_NAME_HORIZONTAL = 'collapse-horizontal'\n\nconst WIDTH = 'width'\nconst HEIGHT = 'height'\n\nconst SELECTOR_ACTIVES = '.collapse.show, .collapse.collapsing'\nconst SELECTOR_DATA_TOGGLE = '[data-bs-toggle=\"collapse\"]'\n\nconst Default = {\n  parent: null,\n  toggle: true\n}\n\nconst DefaultType = {\n  parent: '(null|element)',\n  toggle: 'boolean'\n}\n\n/**\n * Class definition\n */\n\nclass Collapse extends BaseComponent {\n  constructor(element, config) {\n    super(element, config)\n\n    this._isTransitioning = false\n    this._triggerArray = []\n\n    const toggleList = SelectorEngine.find(SELECTOR_DATA_TOGGLE)\n\n    for (const elem of toggleList) {\n      const selector = SelectorEngine.getSelectorFromElement(elem)\n      const filterElement = SelectorEngine.find(selector)\n        .filter(foundElement => foundElement === this._element)\n\n      if (selector !== null && filterElement.length) {\n        this._triggerArray.push(elem)\n      }\n    }\n\n    this._initializeChildren()\n\n    if (!this._config.parent) {\n      this._addAriaAndCollapsedClass(this._triggerArray, this._isShown())\n    }\n\n    if (this._config.toggle) {\n      this.toggle()\n    }\n  }\n\n  // Getters\n  static get Default() {\n    return Default\n  }\n\n  static get DefaultType() {\n    return DefaultType\n  }\n\n  static get NAME() {\n    return NAME\n  }\n\n  // Public\n  toggle() {\n    if (this._isShown()) {\n      this.hide()\n    } else {\n      this.show()\n    }\n  }\n\n  show() {\n    if (this._isTransitioning || this._isShown()) {\n      return\n    }\n\n    let activeChildren = []\n\n    // find active children\n    if (this._config.parent) {\n      activeChildren = this._getFirstLevelChildren(SELECTOR_ACTIVES)\n        .filter(element => element !== this._element)\n        .map(element => Collapse.getOrCreateInstance(element, { toggle: false }))\n    }\n\n    if (activeChildren.length && activeChildren[0]._isTransitioning) {\n      return\n    }\n\n    const startEvent = EventHandler.trigger(this._element, EVENT_SHOW)\n    if (startEvent.defaultPrevented) {\n      return\n    }\n\n    for (const activeInstance of activeChildren) {\n      activeInstance.hide()\n    }\n\n    const dimension = this._getDimension()\n\n    this._element.classList.remove(CLASS_NAME_COLLAPSE)\n    this._element.classList.add(CLASS_NAME_COLLAPSING)\n\n    this._element.style[dimension] = 0\n\n    this._addAriaAndCollapsedClass(this._triggerArray, true)\n    this._isTransitioning = true\n\n    const complete = () => {\n      this._isTransitioning = false\n\n      this._element.classList.remove(CLASS_NAME_COLLAPSING)\n      this._element.classList.add(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW)\n\n      this._element.style[dimension] = ''\n\n      EventHandler.trigger(this._element, EVENT_SHOWN)\n    }\n\n    const capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1)\n    const scrollSize = `scroll${capitalizedDimension}`\n\n    this._queueCallback(complete, this._element, true)\n    this._element.style[dimension] = `${this._element[scrollSize]}px`\n  }\n\n  hide() {\n    if (this._isTransitioning || !this._isShown()) {\n      return\n    }\n\n    const startEvent = EventHandler.trigger(this._element, EVENT_HIDE)\n    if (startEvent.defaultPrevented) {\n      return\n    }\n\n    const dimension = this._getDimension()\n\n    this._element.style[dimension] = `${this._element.getBoundingClientRect()[dimension]}px`\n\n    reflow(this._element)\n\n    this._element.classList.add(CLASS_NAME_COLLAPSING)\n    this._element.classList.remove(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW)\n\n    for (const trigger of this._triggerArray) {\n      const element = SelectorEngine.getElementFromSelector(trigger)\n\n      if (element && !this._isShown(element)) {\n        this._addAriaAndCollapsedClass([trigger], false)\n      }\n    }\n\n    this._isTransitioning = true\n\n    const complete = () => {\n      this._isTransitioning = false\n      this._element.classList.remove(CLASS_NAME_COLLAPSING)\n      this._element.classList.add(CLASS_NAME_COLLAPSE)\n      EventHandler.trigger(this._element, EVENT_HIDDEN)\n    }\n\n    this._element.style[dimension] = ''\n\n    this._queueCallback(complete, this._element, true)\n  }\n\n  // Private\n  _isShown(element = this._element) {\n    return element.classList.contains(CLASS_NAME_SHOW)\n  }\n\n  _configAfterMerge(config) {\n    config.toggle = Boolean(config.toggle) // Coerce string values\n    config.parent = getElement(config.parent)\n    return config\n  }\n\n  _getDimension() {\n    return this._element.classList.contains(CLASS_NAME_HORIZONTAL) ? WIDTH : HEIGHT\n  }\n\n  _initializeChildren() {\n    if (!this._config.parent) {\n      return\n    }\n\n    const children = this._getFirstLevelChildren(SELECTOR_DATA_TOGGLE)\n\n    for (const element of children) {\n      const selected = SelectorEngine.getElementFromSelector(element)\n\n      if (selected) {\n        this._addAriaAndCollapsedClass([element], this._isShown(selected))\n      }\n    }\n  }\n\n  _getFirstLevelChildren(selector) {\n    const children = SelectorEngine.find(CLASS_NAME_DEEPER_CHILDREN, this._config.parent)\n    // remove children if greater depth\n    return SelectorEngine.find(selector, this._config.parent).filter(element => !children.includes(element))\n  }\n\n  _addAriaAndCollapsedClass(triggerArray, isOpen) {\n    if (!triggerArray.length) {\n      return\n    }\n\n    for (const element of triggerArray) {\n      element.classList.toggle(CLASS_NAME_COLLAPSED, !isOpen)\n      element.setAttribute('aria-expanded', isOpen)\n    }\n  }\n\n  // Static\n  static jQueryInterface(config) {\n    const _config = {}\n    if (typeof config === 'string' && /show|hide/.test(config)) {\n      _config.toggle = false\n    }\n\n    return this.each(function () {\n      const data = Collapse.getOrCreateInstance(this, _config)\n\n      if (typeof config === 'string') {\n        if (typeof data[config] === 'undefined') {\n          throw new TypeError(`No method named \"${config}\"`)\n        }\n\n        data[config]()\n      }\n    })\n  }\n}\n\n/**\n * Data API implementation\n */\n\nEventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {\n  // preventDefault only for <a> elements (which change the URL) not inside the collapsible element\n  if (event.target.tagName === 'A' || (event.delegateTarget && event.delegateTarget.tagName === 'A')) {\n    event.preventDefault()\n  }\n\n  for (const element of SelectorEngine.getMultipleElementsFromSelector(this)) {\n    Collapse.getOrCreateInstance(element, { toggle: false }).toggle()\n  }\n})\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Collapse)\n\nexport default Collapse\n", "export var top = 'top';\nexport var bottom = 'bottom';\nexport var right = 'right';\nexport var left = 'left';\nexport var auto = 'auto';\nexport var basePlacements = [top, bottom, right, left];\nexport var start = 'start';\nexport var end = 'end';\nexport var clippingParents = 'clippingParents';\nexport var viewport = 'viewport';\nexport var popper = 'popper';\nexport var reference = 'reference';\nexport var variationPlacements = /*#__PURE__*/basePlacements.reduce(function (acc, placement) {\n  return acc.concat([placement + \"-\" + start, placement + \"-\" + end]);\n}, []);\nexport var placements = /*#__PURE__*/[].concat(basePlacements, [auto]).reduce(function (acc, placement) {\n  return acc.concat([placement, placement + \"-\" + start, placement + \"-\" + end]);\n}, []); // modifiers that need to read the DOM\n\nexport var beforeRead = 'beforeRead';\nexport var read = 'read';\nexport var afterRead = 'afterRead'; // pure-logic modifiers\n\nexport var beforeMain = 'beforeMain';\nexport var main = 'main';\nexport var afterMain = 'afterMain'; // modifier with the purpose to write to the DOM (or write into a framework state)\n\nexport var beforeWrite = 'beforeWrite';\nexport var write = 'write';\nexport var afterWrite = 'afterWrite';\nexport var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];", "export default function getNodeName(element) {\n  return element ? (element.nodeName || '').toLowerCase() : null;\n}", "export default function getWindow(node) {\n  if (node == null) {\n    return window;\n  }\n\n  if (node.toString() !== '[object Window]') {\n    var ownerDocument = node.ownerDocument;\n    return ownerDocument ? ownerDocument.defaultView || window : window;\n  }\n\n  return node;\n}", "import getWindow from \"./getWindow.js\";\n\nfunction isElement(node) {\n  var OwnElement = getWindow(node).Element;\n  return node instanceof OwnElement || node instanceof Element;\n}\n\nfunction isHTMLElement(node) {\n  var OwnElement = getWindow(node).HTMLElement;\n  return node instanceof OwnElement || node instanceof HTMLElement;\n}\n\nfunction isShadowRoot(node) {\n  // IE 11 has no ShadowRoot\n  if (typeof ShadowRoot === 'undefined') {\n    return false;\n  }\n\n  var OwnElement = getWindow(node).ShadowRoot;\n  return node instanceof OwnElement || node instanceof ShadowRoot;\n}\n\nexport { isElement, isHTMLElement, isShadowRoot };", "import getNodeName from \"../dom-utils/getNodeName.js\";\nimport { isHTMLElement } from \"../dom-utils/instanceOf.js\"; // This modifier takes the styles prepared by the `computeStyles` modifier\n// and applies them to the HTMLElements such as popper and arrow\n\nfunction applyStyles(_ref) {\n  var state = _ref.state;\n  Object.keys(state.elements).forEach(function (name) {\n    var style = state.styles[name] || {};\n    var attributes = state.attributes[name] || {};\n    var element = state.elements[name]; // arrow is optional + virtual elements\n\n    if (!isHTMLElement(element) || !getNodeName(element)) {\n      return;\n    } // Flow doesn't support to extend this property, but it's the most\n    // effective way to apply styles to an HTMLElement\n    // $FlowFixMe[cannot-write]\n\n\n    Object.assign(element.style, style);\n    Object.keys(attributes).forEach(function (name) {\n      var value = attributes[name];\n\n      if (value === false) {\n        element.removeAttribute(name);\n      } else {\n        element.setAttribute(name, value === true ? '' : value);\n      }\n    });\n  });\n}\n\nfunction effect(_ref2) {\n  var state = _ref2.state;\n  var initialStyles = {\n    popper: {\n      position: state.options.strategy,\n      left: '0',\n      top: '0',\n      margin: '0'\n    },\n    arrow: {\n      position: 'absolute'\n    },\n    reference: {}\n  };\n  Object.assign(state.elements.popper.style, initialStyles.popper);\n  state.styles = initialStyles;\n\n  if (state.elements.arrow) {\n    Object.assign(state.elements.arrow.style, initialStyles.arrow);\n  }\n\n  return function () {\n    Object.keys(state.elements).forEach(function (name) {\n      var element = state.elements[name];\n      var attributes = state.attributes[name] || {};\n      var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]); // Set all values to an empty string to unset them\n\n      var style = styleProperties.reduce(function (style, property) {\n        style[property] = '';\n        return style;\n      }, {}); // arrow is optional + virtual elements\n\n      if (!isHTMLElement(element) || !getNodeName(element)) {\n        return;\n      }\n\n      Object.assign(element.style, style);\n      Object.keys(attributes).forEach(function (attribute) {\n        element.removeAttribute(attribute);\n      });\n    });\n  };\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n  name: 'applyStyles',\n  enabled: true,\n  phase: 'write',\n  fn: applyStyles,\n  effect: effect,\n  requires: ['computeStyles']\n};", "import { auto } from \"../enums.js\";\nexport default function getBasePlacement(placement) {\n  return placement.split('-')[0];\n}", "export var max = Math.max;\nexport var min = Math.min;\nexport var round = Math.round;", "export default function getUAString() {\n  var uaData = navigator.userAgentData;\n\n  if (uaData != null && uaData.brands && Array.isArray(uaData.brands)) {\n    return uaData.brands.map(function (item) {\n      return item.brand + \"/\" + item.version;\n    }).join(' ');\n  }\n\n  return navigator.userAgent;\n}", "import getUAString from \"../utils/userAgent.js\";\nexport default function isLayoutViewport() {\n  return !/^((?!chrome|android).)*safari/i.test(getUAString());\n}", "import { isElement, isHTMLElement } from \"./instanceOf.js\";\nimport { round } from \"../utils/math.js\";\nimport getWindow from \"./getWindow.js\";\nimport isLayoutViewport from \"./isLayoutViewport.js\";\nexport default function getBoundingClientRect(element, includeScale, isFixedStrategy) {\n  if (includeScale === void 0) {\n    includeScale = false;\n  }\n\n  if (isFixedStrategy === void 0) {\n    isFixedStrategy = false;\n  }\n\n  var clientRect = element.getBoundingClientRect();\n  var scaleX = 1;\n  var scaleY = 1;\n\n  if (includeScale && isHTMLElement(element)) {\n    scaleX = element.offsetWidth > 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1;\n    scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1;\n  }\n\n  var _ref = isElement(element) ? getWindow(element) : window,\n      visualViewport = _ref.visualViewport;\n\n  var addVisualOffsets = !isLayoutViewport() && isFixedStrategy;\n  var x = (clientRect.left + (addVisualOffsets && visualViewport ? visualViewport.offsetLeft : 0)) / scaleX;\n  var y = (clientRect.top + (addVisualOffsets && visualViewport ? visualViewport.offsetTop : 0)) / scaleY;\n  var width = clientRect.width / scaleX;\n  var height = clientRect.height / scaleY;\n  return {\n    width: width,\n    height: height,\n    top: y,\n    right: x + width,\n    bottom: y + height,\n    left: x,\n    x: x,\n    y: y\n  };\n}", "import getBoundingClientRect from \"./getBoundingClientRect.js\"; // Returns the layout rect of an element relative to its offsetParent. Layout\n// means it doesn't take into account transforms.\n\nexport default function getLayoutRect(element) {\n  var clientRect = getBoundingClientRect(element); // Use the clientRect sizes if it's not been transformed.\n  // Fixes https://github.com/popperjs/popper-core/issues/1223\n\n  var width = element.offsetWidth;\n  var height = element.offsetHeight;\n\n  if (Math.abs(clientRect.width - width) <= 1) {\n    width = clientRect.width;\n  }\n\n  if (Math.abs(clientRect.height - height) <= 1) {\n    height = clientRect.height;\n  }\n\n  return {\n    x: element.offsetLeft,\n    y: element.offsetTop,\n    width: width,\n    height: height\n  };\n}", "import { isShadowRoot } from \"./instanceOf.js\";\nexport default function contains(parent, child) {\n  var rootNode = child.getRootNode && child.getRootNode(); // First, attempt with faster native method\n\n  if (parent.contains(child)) {\n    return true;\n  } // then fallback to custom implementation with Shadow DOM support\n  else if (rootNode && isShadowRoot(rootNode)) {\n      var next = child;\n\n      do {\n        if (next && parent.isSameNode(next)) {\n          return true;\n        } // $FlowFixMe[prop-missing]: need a better way to handle this...\n\n\n        next = next.parentNode || next.host;\n      } while (next);\n    } // Give up, the result is false\n\n\n  return false;\n}", "import getWindow from \"./getWindow.js\";\nexport default function getComputedStyle(element) {\n  return getWindow(element).getComputedStyle(element);\n}", "import getNodeName from \"./getNodeName.js\";\nexport default function isTableElement(element) {\n  return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0;\n}", "import { isElement } from \"./instanceOf.js\";\nexport default function getDocumentElement(element) {\n  // $FlowFixMe[incompatible-return]: assume body is always available\n  return ((isElement(element) ? element.ownerDocument : // $FlowFixMe[prop-missing]\n  element.document) || window.document).documentElement;\n}", "import getNodeName from \"./getNodeName.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport { isShadowRoot } from \"./instanceOf.js\";\nexport default function getParentNode(element) {\n  if (getNodeName(element) === 'html') {\n    return element;\n  }\n\n  return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle\n    // $FlowFixMe[incompatible-return]\n    // $FlowFixMe[prop-missing]\n    element.assignedSlot || // step into the shadow DOM of the parent of a slotted node\n    element.parentNode || ( // DOM Element detected\n    isShadowRoot(element) ? element.host : null) || // ShadowRoot detected\n    // $FlowFixMe[incompatible-call]: HTMLElement is a Node\n    getDocumentElement(element) // fallback\n\n  );\n}", "import getWindow from \"./getWindow.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport { isHTMLElement, isShadowRoot } from \"./instanceOf.js\";\nimport isTableElement from \"./isTableElement.js\";\nimport getParentNode from \"./getParentNode.js\";\nimport getUAString from \"../utils/userAgent.js\";\n\nfunction getTrueOffsetParent(element) {\n  if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837\n  getComputedStyle(element).position === 'fixed') {\n    return null;\n  }\n\n  return element.offsetParent;\n} // `.offsetParent` reports `null` for fixed elements, while absolute elements\n// return the containing block\n\n\nfunction getContainingBlock(element) {\n  var isFirefox = /firefox/i.test(getUAString());\n  var isIE = /Trident/i.test(getUAString());\n\n  if (isIE && isHTMLElement(element)) {\n    // In IE 9, 10 and 11 fixed elements containing block is always established by the viewport\n    var elementCss = getComputedStyle(element);\n\n    if (elementCss.position === 'fixed') {\n      return null;\n    }\n  }\n\n  var currentNode = getParentNode(element);\n\n  if (isShadowRoot(currentNode)) {\n    currentNode = currentNode.host;\n  }\n\n  while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) {\n    var css = getComputedStyle(currentNode); // This is non-exhaustive but covers the most common CSS properties that\n    // create a containing block.\n    // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n\n    if (css.transform !== 'none' || css.perspective !== 'none' || css.contain === 'paint' || ['transform', 'perspective'].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === 'filter' || isFirefox && css.filter && css.filter !== 'none') {\n      return currentNode;\n    } else {\n      currentNode = currentNode.parentNode;\n    }\n  }\n\n  return null;\n} // Gets the closest ancestor positioned element. Handles some edge cases,\n// such as table ancestors and cross browser bugs.\n\n\nexport default function getOffsetParent(element) {\n  var window = getWindow(element);\n  var offsetParent = getTrueOffsetParent(element);\n\n  while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') {\n    offsetParent = getTrueOffsetParent(offsetParent);\n  }\n\n  if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static')) {\n    return window;\n  }\n\n  return offsetParent || getContainingBlock(element) || window;\n}", "export default function getMainAxisFromPlacement(placement) {\n  return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';\n}", "import { max as mathMax, min as mathMin } from \"./math.js\";\nexport function within(min, value, max) {\n  return mathMax(min, mathMin(value, max));\n}\nexport function withinMaxClamp(min, value, max) {\n  var v = within(min, value, max);\n  return v > max ? max : v;\n}", "export default function getFreshSideObject() {\n  return {\n    top: 0,\n    right: 0,\n    bottom: 0,\n    left: 0\n  };\n}", "import getFreshSideObject from \"./getFreshSideObject.js\";\nexport default function mergePaddingObject(paddingObject) {\n  return Object.assign({}, getFreshSideObject(), paddingObject);\n}", "export default function expandToHashMap(value, keys) {\n  return keys.reduce(function (hashMap, key) {\n    hashMap[key] = value;\n    return hashMap;\n  }, {});\n}", "import getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getLayoutRect from \"../dom-utils/getLayoutRect.js\";\nimport contains from \"../dom-utils/contains.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport getMainAxisFromPlacement from \"../utils/getMainAxisFromPlacement.js\";\nimport { within } from \"../utils/within.js\";\nimport mergePaddingObject from \"../utils/mergePaddingObject.js\";\nimport expandToHashMap from \"../utils/expandToHashMap.js\";\nimport { left, right, basePlacements, top, bottom } from \"../enums.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar toPaddingObject = function toPaddingObject(padding, state) {\n  padding = typeof padding === 'function' ? padding(Object.assign({}, state.rects, {\n    placement: state.placement\n  })) : padding;\n  return mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));\n};\n\nfunction arrow(_ref) {\n  var _state$modifiersData$;\n\n  var state = _ref.state,\n      name = _ref.name,\n      options = _ref.options;\n  var arrowElement = state.elements.arrow;\n  var popperOffsets = state.modifiersData.popperOffsets;\n  var basePlacement = getBasePlacement(state.placement);\n  var axis = getMainAxisFromPlacement(basePlacement);\n  var isVertical = [left, right].indexOf(basePlacement) >= 0;\n  var len = isVertical ? 'height' : 'width';\n\n  if (!arrowElement || !popperOffsets) {\n    return;\n  }\n\n  var paddingObject = toPaddingObject(options.padding, state);\n  var arrowRect = getLayoutRect(arrowElement);\n  var minProp = axis === 'y' ? top : left;\n  var maxProp = axis === 'y' ? bottom : right;\n  var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len];\n  var startDiff = popperOffsets[axis] - state.rects.reference[axis];\n  var arrowOffsetParent = getOffsetParent(arrowElement);\n  var clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;\n  var centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the popper if the center point is\n  // outside of the popper bounds\n\n  var min = paddingObject[minProp];\n  var max = clientSize - arrowRect[len] - paddingObject[maxProp];\n  var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;\n  var offset = within(min, center, max); // Prevents breaking syntax highlighting...\n\n  var axisProp = axis;\n  state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset, _state$modifiersData$.centerOffset = offset - center, _state$modifiersData$);\n}\n\nfunction effect(_ref2) {\n  var state = _ref2.state,\n      options = _ref2.options;\n  var _options$element = options.element,\n      arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element;\n\n  if (arrowElement == null) {\n    return;\n  } // CSS selector\n\n\n  if (typeof arrowElement === 'string') {\n    arrowElement = state.elements.popper.querySelector(arrowElement);\n\n    if (!arrowElement) {\n      return;\n    }\n  }\n\n  if (!contains(state.elements.popper, arrowElement)) {\n    return;\n  }\n\n  state.elements.arrow = arrowElement;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n  name: 'arrow',\n  enabled: true,\n  phase: 'main',\n  fn: arrow,\n  effect: effect,\n  requires: ['popperOffsets'],\n  requiresIfExists: ['preventOverflow']\n};", "export default function getVariation(placement) {\n  return placement.split('-')[1];\n}", "import { top, left, right, bottom, end } from \"../enums.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport getWindow from \"../dom-utils/getWindow.js\";\nimport getDocumentElement from \"../dom-utils/getDocumentElement.js\";\nimport getComputedStyle from \"../dom-utils/getComputedStyle.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getVariation from \"../utils/getVariation.js\";\nimport { round } from \"../utils/math.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar unsetSides = {\n  top: 'auto',\n  right: 'auto',\n  bottom: 'auto',\n  left: 'auto'\n}; // Round the offsets to the nearest suitable subpixel based on the DPR.\n// Zooming can change the DPR, but it seems to report a value that will\n// cleanly divide the values into the appropriate subpixels.\n\nfunction roundOffsetsByDPR(_ref, win) {\n  var x = _ref.x,\n      y = _ref.y;\n  var dpr = win.devicePixelRatio || 1;\n  return {\n    x: round(x * dpr) / dpr || 0,\n    y: round(y * dpr) / dpr || 0\n  };\n}\n\nexport function mapToStyles(_ref2) {\n  var _Object$assign2;\n\n  var popper = _ref2.popper,\n      popperRect = _ref2.popperRect,\n      placement = _ref2.placement,\n      variation = _ref2.variation,\n      offsets = _ref2.offsets,\n      position = _ref2.position,\n      gpuAcceleration = _ref2.gpuAcceleration,\n      adaptive = _ref2.adaptive,\n      roundOffsets = _ref2.roundOffsets,\n      isFixed = _ref2.isFixed;\n  var _offsets$x = offsets.x,\n      x = _offsets$x === void 0 ? 0 : _offsets$x,\n      _offsets$y = offsets.y,\n      y = _offsets$y === void 0 ? 0 : _offsets$y;\n\n  var _ref3 = typeof roundOffsets === 'function' ? roundOffsets({\n    x: x,\n    y: y\n  }) : {\n    x: x,\n    y: y\n  };\n\n  x = _ref3.x;\n  y = _ref3.y;\n  var hasX = offsets.hasOwnProperty('x');\n  var hasY = offsets.hasOwnProperty('y');\n  var sideX = left;\n  var sideY = top;\n  var win = window;\n\n  if (adaptive) {\n    var offsetParent = getOffsetParent(popper);\n    var heightProp = 'clientHeight';\n    var widthProp = 'clientWidth';\n\n    if (offsetParent === getWindow(popper)) {\n      offsetParent = getDocumentElement(popper);\n\n      if (getComputedStyle(offsetParent).position !== 'static' && position === 'absolute') {\n        heightProp = 'scrollHeight';\n        widthProp = 'scrollWidth';\n      }\n    } // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it\n\n\n    offsetParent = offsetParent;\n\n    if (placement === top || (placement === left || placement === right) && variation === end) {\n      sideY = bottom;\n      var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing]\n      offsetParent[heightProp];\n      y -= offsetY - popperRect.height;\n      y *= gpuAcceleration ? 1 : -1;\n    }\n\n    if (placement === left || (placement === top || placement === bottom) && variation === end) {\n      sideX = right;\n      var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing]\n      offsetParent[widthProp];\n      x -= offsetX - popperRect.width;\n      x *= gpuAcceleration ? 1 : -1;\n    }\n  }\n\n  var commonStyles = Object.assign({\n    position: position\n  }, adaptive && unsetSides);\n\n  var _ref4 = roundOffsets === true ? roundOffsetsByDPR({\n    x: x,\n    y: y\n  }, getWindow(popper)) : {\n    x: x,\n    y: y\n  };\n\n  x = _ref4.x;\n  y = _ref4.y;\n\n  if (gpuAcceleration) {\n    var _Object$assign;\n\n    return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? \"translate(\" + x + \"px, \" + y + \"px)\" : \"translate3d(\" + x + \"px, \" + y + \"px, 0)\", _Object$assign));\n  }\n\n  return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + \"px\" : '', _Object$assign2[sideX] = hasX ? x + \"px\" : '', _Object$assign2.transform = '', _Object$assign2));\n}\n\nfunction computeStyles(_ref5) {\n  var state = _ref5.state,\n      options = _ref5.options;\n  var _options$gpuAccelerat = options.gpuAcceleration,\n      gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat,\n      _options$adaptive = options.adaptive,\n      adaptive = _options$adaptive === void 0 ? true : _options$adaptive,\n      _options$roundOffsets = options.roundOffsets,\n      roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;\n  var commonStyles = {\n    placement: getBasePlacement(state.placement),\n    variation: getVariation(state.placement),\n    popper: state.elements.popper,\n    popperRect: state.rects.popper,\n    gpuAcceleration: gpuAcceleration,\n    isFixed: state.options.strategy === 'fixed'\n  };\n\n  if (state.modifiersData.popperOffsets != null) {\n    state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, {\n      offsets: state.modifiersData.popperOffsets,\n      position: state.options.strategy,\n      adaptive: adaptive,\n      roundOffsets: roundOffsets\n    })));\n  }\n\n  if (state.modifiersData.arrow != null) {\n    state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, {\n      offsets: state.modifiersData.arrow,\n      position: 'absolute',\n      adaptive: false,\n      roundOffsets: roundOffsets\n    })));\n  }\n\n  state.attributes.popper = Object.assign({}, state.attributes.popper, {\n    'data-popper-placement': state.placement\n  });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n  name: 'computeStyles',\n  enabled: true,\n  phase: 'beforeWrite',\n  fn: computeStyles,\n  data: {}\n};", "import getWindow from \"../dom-utils/getWindow.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar passive = {\n  passive: true\n};\n\nfunction effect(_ref) {\n  var state = _ref.state,\n      instance = _ref.instance,\n      options = _ref.options;\n  var _options$scroll = options.scroll,\n      scroll = _options$scroll === void 0 ? true : _options$scroll,\n      _options$resize = options.resize,\n      resize = _options$resize === void 0 ? true : _options$resize;\n  var window = getWindow(state.elements.popper);\n  var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);\n\n  if (scroll) {\n    scrollParents.forEach(function (scrollParent) {\n      scrollParent.addEventListener('scroll', instance.update, passive);\n    });\n  }\n\n  if (resize) {\n    window.addEventListener('resize', instance.update, passive);\n  }\n\n  return function () {\n    if (scroll) {\n      scrollParents.forEach(function (scrollParent) {\n        scrollParent.removeEventListener('scroll', instance.update, passive);\n      });\n    }\n\n    if (resize) {\n      window.removeEventListener('resize', instance.update, passive);\n    }\n  };\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n  name: 'eventListeners',\n  enabled: true,\n  phase: 'write',\n  fn: function fn() {},\n  effect: effect,\n  data: {}\n};", "var hash = {\n  left: 'right',\n  right: 'left',\n  bottom: 'top',\n  top: 'bottom'\n};\nexport default function getOppositePlacement(placement) {\n  return placement.replace(/left|right|bottom|top/g, function (matched) {\n    return hash[matched];\n  });\n}", "var hash = {\n  start: 'end',\n  end: 'start'\n};\nexport default function getOppositeVariationPlacement(placement) {\n  return placement.replace(/start|end/g, function (matched) {\n    return hash[matched];\n  });\n}", "import getWindow from \"./getWindow.js\";\nexport default function getWindowScroll(node) {\n  var win = getWindow(node);\n  var scrollLeft = win.pageXOffset;\n  var scrollTop = win.pageYOffset;\n  return {\n    scrollLeft: scrollLeft,\n    scrollTop: scrollTop\n  };\n}", "import getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getWindowScroll from \"./getWindowScroll.js\";\nexport default function getWindowScrollBarX(element) {\n  // If <html> has a CSS width greater than the viewport, then this will be\n  // incorrect for RTL.\n  // Popper 1 is broken in this case and never had a bug report so let's assume\n  // it's not an issue. I don't think anyone ever specifies width on <html>\n  // anyway.\n  // Browsers where the left scrollbar doesn't cause an issue report `0` for\n  // this (e.g. Edge 2019, IE11, Safari)\n  return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;\n}", "import getWindow from \"./getWindow.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nimport isLayoutViewport from \"./isLayoutViewport.js\";\nexport default function getViewportRect(element, strategy) {\n  var win = getWindow(element);\n  var html = getDocumentElement(element);\n  var visualViewport = win.visualViewport;\n  var width = html.clientWidth;\n  var height = html.clientHeight;\n  var x = 0;\n  var y = 0;\n\n  if (visualViewport) {\n    width = visualViewport.width;\n    height = visualViewport.height;\n    var layoutViewport = isLayoutViewport();\n\n    if (layoutViewport || !layoutViewport && strategy === 'fixed') {\n      x = visualViewport.offsetLeft;\n      y = visualViewport.offsetTop;\n    }\n  }\n\n  return {\n    width: width,\n    height: height,\n    x: x + getWindowScrollBarX(element),\n    y: y\n  };\n}", "import getDocumentElement from \"./getDocumentElement.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nimport getWindowScroll from \"./getWindowScroll.js\";\nimport { max } from \"../utils/math.js\"; // Gets the entire size of the scrollable document area, even extending outside\n// of the `<html>` and `<body>` rect bounds if horizontally scrollable\n\nexport default function getDocumentRect(element) {\n  var _element$ownerDocumen;\n\n  var html = getDocumentElement(element);\n  var winScroll = getWindowScroll(element);\n  var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;\n  var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);\n  var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);\n  var x = -winScroll.scrollLeft + getWindowScrollBarX(element);\n  var y = -winScroll.scrollTop;\n\n  if (getComputedStyle(body || html).direction === 'rtl') {\n    x += max(html.clientWidth, body ? body.clientWidth : 0) - width;\n  }\n\n  return {\n    width: width,\n    height: height,\n    x: x,\n    y: y\n  };\n}", "import getComputedStyle from \"./getComputedStyle.js\";\nexport default function isScrollParent(element) {\n  // Firefox wants us to check `-x` and `-y` variations as well\n  var _getComputedStyle = getComputedStyle(element),\n      overflow = _getComputedStyle.overflow,\n      overflowX = _getComputedStyle.overflowX,\n      overflowY = _getComputedStyle.overflowY;\n\n  return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);\n}", "import getParentNode from \"./getParentNode.js\";\nimport isScrollParent from \"./isScrollParent.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nexport default function getScrollParent(node) {\n  if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) {\n    // $FlowFixMe[incompatible-return]: assume body is always available\n    return node.ownerDocument.body;\n  }\n\n  if (isHTMLElement(node) && isScrollParent(node)) {\n    return node;\n  }\n\n  return getScrollParent(getParentNode(node));\n}", "import getScrollParent from \"./getScrollParent.js\";\nimport getParentNode from \"./getParentNode.js\";\nimport getWindow from \"./getWindow.js\";\nimport isScrollParent from \"./isScrollParent.js\";\n/*\ngiven a DOM element, return the list of all scroll parents, up the list of ancesors\nuntil we get to the top window object. This list is what we attach scroll listeners\nto, because if any of these parent elements scroll, we'll need to re-calculate the\nreference element's position.\n*/\n\nexport default function listScrollParents(element, list) {\n  var _element$ownerDocumen;\n\n  if (list === void 0) {\n    list = [];\n  }\n\n  var scrollParent = getScrollParent(element);\n  var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);\n  var win = getWindow(scrollParent);\n  var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;\n  var updatedList = list.concat(target);\n  return isBody ? updatedList : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here\n  updatedList.concat(listScrollParents(getParentNode(target)));\n}", "export default function rectToClientRect(rect) {\n  return Object.assign({}, rect, {\n    left: rect.x,\n    top: rect.y,\n    right: rect.x + rect.width,\n    bottom: rect.y + rect.height\n  });\n}", "import { viewport } from \"../enums.js\";\nimport getViewportRect from \"./getViewportRect.js\";\nimport getDocumentRect from \"./getDocumentRect.js\";\nimport listScrollParents from \"./listScrollParents.js\";\nimport getOffsetParent from \"./getOffsetParent.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport { isElement, isHTMLElement } from \"./instanceOf.js\";\nimport getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getParentNode from \"./getParentNode.js\";\nimport contains from \"./contains.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport rectToClientRect from \"../utils/rectToClientRect.js\";\nimport { max, min } from \"../utils/math.js\";\n\nfunction getInnerBoundingClientRect(element, strategy) {\n  var rect = getBoundingClientRect(element, false, strategy === 'fixed');\n  rect.top = rect.top + element.clientTop;\n  rect.left = rect.left + element.clientLeft;\n  rect.bottom = rect.top + element.clientHeight;\n  rect.right = rect.left + element.clientWidth;\n  rect.width = element.clientWidth;\n  rect.height = element.clientHeight;\n  rect.x = rect.left;\n  rect.y = rect.top;\n  return rect;\n}\n\nfunction getClientRectFromMixedType(element, clippingParent, strategy) {\n  return clippingParent === viewport ? rectToClientRect(getViewportRect(element, strategy)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent, strategy) : rectToClientRect(getDocumentRect(getDocumentElement(element)));\n} // A \"clipping parent\" is an overflowable container with the characteristic of\n// clipping (or hiding) overflowing elements with a position different from\n// `initial`\n\n\nfunction getClippingParents(element) {\n  var clippingParents = listScrollParents(getParentNode(element));\n  var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle(element).position) >= 0;\n  var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;\n\n  if (!isElement(clipperElement)) {\n    return [];\n  } // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414\n\n\n  return clippingParents.filter(function (clippingParent) {\n    return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body';\n  });\n} // Gets the maximum area that the element is visible in due to any number of\n// clipping parents\n\n\nexport default function getClippingRect(element, boundary, rootBoundary, strategy) {\n  var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary);\n  var clippingParents = [].concat(mainClippingParents, [rootBoundary]);\n  var firstClippingParent = clippingParents[0];\n  var clippingRect = clippingParents.reduce(function (accRect, clippingParent) {\n    var rect = getClientRectFromMixedType(element, clippingParent, strategy);\n    accRect.top = max(rect.top, accRect.top);\n    accRect.right = min(rect.right, accRect.right);\n    accRect.bottom = min(rect.bottom, accRect.bottom);\n    accRect.left = max(rect.left, accRect.left);\n    return accRect;\n  }, getClientRectFromMixedType(element, firstClippingParent, strategy));\n  clippingRect.width = clippingRect.right - clippingRect.left;\n  clippingRect.height = clippingRect.bottom - clippingRect.top;\n  clippingRect.x = clippingRect.left;\n  clippingRect.y = clippingRect.top;\n  return clippingRect;\n}", "import getBasePlacement from \"./getBasePlacement.js\";\nimport getVariation from \"./getVariation.js\";\nimport getMainAxisFromPlacement from \"./getMainAxisFromPlacement.js\";\nimport { top, right, bottom, left, start, end } from \"../enums.js\";\nexport default function computeOffsets(_ref) {\n  var reference = _ref.reference,\n      element = _ref.element,\n      placement = _ref.placement;\n  var basePlacement = placement ? getBasePlacement(placement) : null;\n  var variation = placement ? getVariation(placement) : null;\n  var commonX = reference.x + reference.width / 2 - element.width / 2;\n  var commonY = reference.y + reference.height / 2 - element.height / 2;\n  var offsets;\n\n  switch (basePlacement) {\n    case top:\n      offsets = {\n        x: commonX,\n        y: reference.y - element.height\n      };\n      break;\n\n    case bottom:\n      offsets = {\n        x: commonX,\n        y: reference.y + reference.height\n      };\n      break;\n\n    case right:\n      offsets = {\n        x: reference.x + reference.width,\n        y: commonY\n      };\n      break;\n\n    case left:\n      offsets = {\n        x: reference.x - element.width,\n        y: commonY\n      };\n      break;\n\n    default:\n      offsets = {\n        x: reference.x,\n        y: reference.y\n      };\n  }\n\n  var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;\n\n  if (mainAxis != null) {\n    var len = mainAxis === 'y' ? 'height' : 'width';\n\n    switch (variation) {\n      case start:\n        offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2);\n        break;\n\n      case end:\n        offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2);\n        break;\n\n      default:\n    }\n  }\n\n  return offsets;\n}", "import getClippingRect from \"../dom-utils/getClippingRect.js\";\nimport getDocumentElement from \"../dom-utils/getDocumentElement.js\";\nimport getBoundingClientRect from \"../dom-utils/getBoundingClientRect.js\";\nimport computeOffsets from \"./computeOffsets.js\";\nimport rectToClientRect from \"./rectToClientRect.js\";\nimport { clippingParents, reference, popper, bottom, top, right, basePlacements, viewport } from \"../enums.js\";\nimport { isElement } from \"../dom-utils/instanceOf.js\";\nimport mergePaddingObject from \"./mergePaddingObject.js\";\nimport expandToHashMap from \"./expandToHashMap.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport default function detectOverflow(state, options) {\n  if (options === void 0) {\n    options = {};\n  }\n\n  var _options = options,\n      _options$placement = _options.placement,\n      placement = _options$placement === void 0 ? state.placement : _options$placement,\n      _options$strategy = _options.strategy,\n      strategy = _options$strategy === void 0 ? state.strategy : _options$strategy,\n      _options$boundary = _options.boundary,\n      boundary = _options$boundary === void 0 ? clippingParents : _options$boundary,\n      _options$rootBoundary = _options.rootBoundary,\n      rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary,\n      _options$elementConte = _options.elementContext,\n      elementContext = _options$elementConte === void 0 ? popper : _options$elementConte,\n      _options$altBoundary = _options.altBoundary,\n      altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary,\n      _options$padding = _options.padding,\n      padding = _options$padding === void 0 ? 0 : _options$padding;\n  var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));\n  var altContext = elementContext === popper ? reference : popper;\n  var popperRect = state.rects.popper;\n  var element = state.elements[altBoundary ? altContext : elementContext];\n  var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary, strategy);\n  var referenceClientRect = getBoundingClientRect(state.elements.reference);\n  var popperOffsets = computeOffsets({\n    reference: referenceClientRect,\n    element: popperRect,\n    strategy: 'absolute',\n    placement: placement\n  });\n  var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets));\n  var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect\n  // 0 or negative = within the clipping rect\n\n  var overflowOffsets = {\n    top: clippingClientRect.top - elementClientRect.top + paddingObject.top,\n    bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,\n    left: clippingClientRect.left - elementClientRect.left + paddingObject.left,\n    right: elementClientRect.right - clippingClientRect.right + paddingObject.right\n  };\n  var offsetData = state.modifiersData.offset; // Offsets can be applied only to the popper element\n\n  if (elementContext === popper && offsetData) {\n    var offset = offsetData[placement];\n    Object.keys(overflowOffsets).forEach(function (key) {\n      var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1;\n      var axis = [top, bottom].indexOf(key) >= 0 ? 'y' : 'x';\n      overflowOffsets[key] += offset[axis] * multiply;\n    });\n  }\n\n  return overflowOffsets;\n}", "import getVariation from \"./getVariation.js\";\nimport { variationPlacements, basePlacements, placements as allPlacements } from \"../enums.js\";\nimport detectOverflow from \"./detectOverflow.js\";\nimport getBasePlacement from \"./getBasePlacement.js\";\nexport default function computeAutoPlacement(state, options) {\n  if (options === void 0) {\n    options = {};\n  }\n\n  var _options = options,\n      placement = _options.placement,\n      boundary = _options.boundary,\n      rootBoundary = _options.rootBoundary,\n      padding = _options.padding,\n      flipVariations = _options.flipVariations,\n      _options$allowedAutoP = _options.allowedAutoPlacements,\n      allowedAutoPlacements = _options$allowedAutoP === void 0 ? allPlacements : _options$allowedAutoP;\n  var variation = getVariation(placement);\n  var placements = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function (placement) {\n    return getVariation(placement) === variation;\n  }) : basePlacements;\n  var allowedPlacements = placements.filter(function (placement) {\n    return allowedAutoPlacements.indexOf(placement) >= 0;\n  });\n\n  if (allowedPlacements.length === 0) {\n    allowedPlacements = placements;\n  } // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions...\n\n\n  var overflows = allowedPlacements.reduce(function (acc, placement) {\n    acc[placement] = detectOverflow(state, {\n      placement: placement,\n      boundary: boundary,\n      rootBoundary: rootBoundary,\n      padding: padding\n    })[getBasePlacement(placement)];\n    return acc;\n  }, {});\n  return Object.keys(overflows).sort(function (a, b) {\n    return overflows[a] - overflows[b];\n  });\n}", "import getOppositePlacement from \"../utils/getOppositePlacement.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getOppositeVariationPlacement from \"../utils/getOppositeVariationPlacement.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\nimport computeAutoPlacement from \"../utils/computeAutoPlacement.js\";\nimport { bottom, top, start, right, left, auto } from \"../enums.js\";\nimport getVariation from \"../utils/getVariation.js\"; // eslint-disable-next-line import/no-unused-modules\n\nfunction getExpandedFallbackPlacements(placement) {\n  if (getBasePlacement(placement) === auto) {\n    return [];\n  }\n\n  var oppositePlacement = getOppositePlacement(placement);\n  return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)];\n}\n\nfunction flip(_ref) {\n  var state = _ref.state,\n      options = _ref.options,\n      name = _ref.name;\n\n  if (state.modifiersData[name]._skip) {\n    return;\n  }\n\n  var _options$mainAxis = options.mainAxis,\n      checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,\n      _options$altAxis = options.altAxis,\n      checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis,\n      specifiedFallbackPlacements = options.fallbackPlacements,\n      padding = options.padding,\n      boundary = options.boundary,\n      rootBoundary = options.rootBoundary,\n      altBoundary = options.altBoundary,\n      _options$flipVariatio = options.flipVariations,\n      flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio,\n      allowedAutoPlacements = options.allowedAutoPlacements;\n  var preferredPlacement = state.options.placement;\n  var basePlacement = getBasePlacement(preferredPlacement);\n  var isBasePlacement = basePlacement === preferredPlacement;\n  var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement));\n  var placements = [preferredPlacement].concat(fallbackPlacements).reduce(function (acc, placement) {\n    return acc.concat(getBasePlacement(placement) === auto ? computeAutoPlacement(state, {\n      placement: placement,\n      boundary: boundary,\n      rootBoundary: rootBoundary,\n      padding: padding,\n      flipVariations: flipVariations,\n      allowedAutoPlacements: allowedAutoPlacements\n    }) : placement);\n  }, []);\n  var referenceRect = state.rects.reference;\n  var popperRect = state.rects.popper;\n  var checksMap = new Map();\n  var makeFallbackChecks = true;\n  var firstFittingPlacement = placements[0];\n\n  for (var i = 0; i < placements.length; i++) {\n    var placement = placements[i];\n\n    var _basePlacement = getBasePlacement(placement);\n\n    var isStartVariation = getVariation(placement) === start;\n    var isVertical = [top, bottom].indexOf(_basePlacement) >= 0;\n    var len = isVertical ? 'width' : 'height';\n    var overflow = detectOverflow(state, {\n      placement: placement,\n      boundary: boundary,\n      rootBoundary: rootBoundary,\n      altBoundary: altBoundary,\n      padding: padding\n    });\n    var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top;\n\n    if (referenceRect[len] > popperRect[len]) {\n      mainVariationSide = getOppositePlacement(mainVariationSide);\n    }\n\n    var altVariationSide = getOppositePlacement(mainVariationSide);\n    var checks = [];\n\n    if (checkMainAxis) {\n      checks.push(overflow[_basePlacement] <= 0);\n    }\n\n    if (checkAltAxis) {\n      checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0);\n    }\n\n    if (checks.every(function (check) {\n      return check;\n    })) {\n      firstFittingPlacement = placement;\n      makeFallbackChecks = false;\n      break;\n    }\n\n    checksMap.set(placement, checks);\n  }\n\n  if (makeFallbackChecks) {\n    // `2` may be desired in some cases \u2013 research later\n    var numberOfChecks = flipVariations ? 3 : 1;\n\n    var _loop = function _loop(_i) {\n      var fittingPlacement = placements.find(function (placement) {\n        var checks = checksMap.get(placement);\n\n        if (checks) {\n          return checks.slice(0, _i).every(function (check) {\n            return check;\n          });\n        }\n      });\n\n      if (fittingPlacement) {\n        firstFittingPlacement = fittingPlacement;\n        return \"break\";\n      }\n    };\n\n    for (var _i = numberOfChecks; _i > 0; _i--) {\n      var _ret = _loop(_i);\n\n      if (_ret === \"break\") break;\n    }\n  }\n\n  if (state.placement !== firstFittingPlacement) {\n    state.modifiersData[name]._skip = true;\n    state.placement = firstFittingPlacement;\n    state.reset = true;\n  }\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n  name: 'flip',\n  enabled: true,\n  phase: 'main',\n  fn: flip,\n  requiresIfExists: ['offset'],\n  data: {\n    _skip: false\n  }\n};", "import { top, bottom, left, right } from \"../enums.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\n\nfunction getSideOffsets(overflow, rect, preventedOffsets) {\n  if (preventedOffsets === void 0) {\n    preventedOffsets = {\n      x: 0,\n      y: 0\n    };\n  }\n\n  return {\n    top: overflow.top - rect.height - preventedOffsets.y,\n    right: overflow.right - rect.width + preventedOffsets.x,\n    bottom: overflow.bottom - rect.height + preventedOffsets.y,\n    left: overflow.left - rect.width - preventedOffsets.x\n  };\n}\n\nfunction isAnySideFullyClipped(overflow) {\n  return [top, right, bottom, left].some(function (side) {\n    return overflow[side] >= 0;\n  });\n}\n\nfunction hide(_ref) {\n  var state = _ref.state,\n      name = _ref.name;\n  var referenceRect = state.rects.reference;\n  var popperRect = state.rects.popper;\n  var preventedOffsets = state.modifiersData.preventOverflow;\n  var referenceOverflow = detectOverflow(state, {\n    elementContext: 'reference'\n  });\n  var popperAltOverflow = detectOverflow(state, {\n    altBoundary: true\n  });\n  var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect);\n  var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets);\n  var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);\n  var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);\n  state.modifiersData[name] = {\n    referenceClippingOffsets: referenceClippingOffsets,\n    popperEscapeOffsets: popperEscapeOffsets,\n    isReferenceHidden: isReferenceHidden,\n    hasPopperEscaped: hasPopperEscaped\n  };\n  state.attributes.popper = Object.assign({}, state.attributes.popper, {\n    'data-popper-reference-hidden': isReferenceHidden,\n    'data-popper-escaped': hasPopperEscaped\n  });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n  name: 'hide',\n  enabled: true,\n  phase: 'main',\n  requiresIfExists: ['preventOverflow'],\n  fn: hide\n};", "import getBasePlacement from \"../utils/getBasePlacement.js\";\nimport { top, left, right, placements } from \"../enums.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport function distanceAndSkiddingToXY(placement, rects, offset) {\n  var basePlacement = getBasePlacement(placement);\n  var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1;\n\n  var _ref = typeof offset === 'function' ? offset(Object.assign({}, rects, {\n    placement: placement\n  })) : offset,\n      skidding = _ref[0],\n      distance = _ref[1];\n\n  skidding = skidding || 0;\n  distance = (distance || 0) * invertDistance;\n  return [left, right].indexOf(basePlacement) >= 0 ? {\n    x: distance,\n    y: skidding\n  } : {\n    x: skidding,\n    y: distance\n  };\n}\n\nfunction offset(_ref2) {\n  var state = _ref2.state,\n      options = _ref2.options,\n      name = _ref2.name;\n  var _options$offset = options.offset,\n      offset = _options$offset === void 0 ? [0, 0] : _options$offset;\n  var data = placements.reduce(function (acc, placement) {\n    acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset);\n    return acc;\n  }, {});\n  var _data$state$placement = data[state.placement],\n      x = _data$state$placement.x,\n      y = _data$state$placement.y;\n\n  if (state.modifiersData.popperOffsets != null) {\n    state.modifiersData.popperOffsets.x += x;\n    state.modifiersData.popperOffsets.y += y;\n  }\n\n  state.modifiersData[name] = data;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n  name: 'offset',\n  enabled: true,\n  phase: 'main',\n  requires: ['popperOffsets'],\n  fn: offset\n};", "import computeOffsets from \"../utils/computeOffsets.js\";\n\nfunction popperOffsets(_ref) {\n  var state = _ref.state,\n      name = _ref.name;\n  // Offsets are the actual position the popper needs to have to be\n  // properly positioned near its reference element\n  // This is the most basic placement, and will be adjusted by\n  // the modifiers in the next step\n  state.modifiersData[name] = computeOffsets({\n    reference: state.rects.reference,\n    element: state.rects.popper,\n    strategy: 'absolute',\n    placement: state.placement\n  });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n  name: 'popperOffsets',\n  enabled: true,\n  phase: 'read',\n  fn: popperOffsets,\n  data: {}\n};", "export default function getAltAxis(axis) {\n  return axis === 'x' ? 'y' : 'x';\n}", "import { top, left, right, bottom, start } from \"../enums.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getMainAxisFromPlacement from \"../utils/getMainAxisFromPlacement.js\";\nimport getAltAxis from \"../utils/getAltAxis.js\";\nimport { within, withinMaxClamp } from \"../utils/within.js\";\nimport getLayoutRect from \"../dom-utils/getLayoutRect.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\nimport getVariation from \"../utils/getVariation.js\";\nimport getFreshSideObject from \"../utils/getFreshSideObject.js\";\nimport { min as mathMin, max as mathMax } from \"../utils/math.js\";\n\nfunction preventOverflow(_ref) {\n  var state = _ref.state,\n      options = _ref.options,\n      name = _ref.name;\n  var _options$mainAxis = options.mainAxis,\n      checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,\n      _options$altAxis = options.altAxis,\n      checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis,\n      boundary = options.boundary,\n      rootBoundary = options.rootBoundary,\n      altBoundary = options.altBoundary,\n      padding = options.padding,\n      _options$tether = options.tether,\n      tether = _options$tether === void 0 ? true : _options$tether,\n      _options$tetherOffset = options.tetherOffset,\n      tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset;\n  var overflow = detectOverflow(state, {\n    boundary: boundary,\n    rootBoundary: rootBoundary,\n    padding: padding,\n    altBoundary: altBoundary\n  });\n  var basePlacement = getBasePlacement(state.placement);\n  var variation = getVariation(state.placement);\n  var isBasePlacement = !variation;\n  var mainAxis = getMainAxisFromPlacement(basePlacement);\n  var altAxis = getAltAxis(mainAxis);\n  var popperOffsets = state.modifiersData.popperOffsets;\n  var referenceRect = state.rects.reference;\n  var popperRect = state.rects.popper;\n  var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, {\n    placement: state.placement\n  })) : tetherOffset;\n  var normalizedTetherOffsetValue = typeof tetherOffsetValue === 'number' ? {\n    mainAxis: tetherOffsetValue,\n    altAxis: tetherOffsetValue\n  } : Object.assign({\n    mainAxis: 0,\n    altAxis: 0\n  }, tetherOffsetValue);\n  var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null;\n  var data = {\n    x: 0,\n    y: 0\n  };\n\n  if (!popperOffsets) {\n    return;\n  }\n\n  if (checkMainAxis) {\n    var _offsetModifierState$;\n\n    var mainSide = mainAxis === 'y' ? top : left;\n    var altSide = mainAxis === 'y' ? bottom : right;\n    var len = mainAxis === 'y' ? 'height' : 'width';\n    var offset = popperOffsets[mainAxis];\n    var min = offset + overflow[mainSide];\n    var max = offset - overflow[altSide];\n    var additive = tether ? -popperRect[len] / 2 : 0;\n    var minLen = variation === start ? referenceRect[len] : popperRect[len];\n    var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go\n    // outside the reference bounds\n\n    var arrowElement = state.elements.arrow;\n    var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : {\n      width: 0,\n      height: 0\n    };\n    var arrowPaddingObject = state.modifiersData['arrow#persistent'] ? state.modifiersData['arrow#persistent'].padding : getFreshSideObject();\n    var arrowPaddingMin = arrowPaddingObject[mainSide];\n    var arrowPaddingMax = arrowPaddingObject[altSide]; // If the reference length is smaller than the arrow length, we don't want\n    // to include its full size in the calculation. If the reference is small\n    // and near the edge of a boundary, the popper can overflow even if the\n    // reference is not overflowing as well (e.g. virtual elements with no\n    // width or height)\n\n    var arrowLen = within(0, referenceRect[len], arrowRect[len]);\n    var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis;\n    var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis;\n    var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);\n    var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;\n    var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0;\n    var tetherMin = offset + minOffset - offsetModifierValue - clientOffset;\n    var tetherMax = offset + maxOffset - offsetModifierValue;\n    var preventedOffset = within(tether ? mathMin(min, tetherMin) : min, offset, tether ? mathMax(max, tetherMax) : max);\n    popperOffsets[mainAxis] = preventedOffset;\n    data[mainAxis] = preventedOffset - offset;\n  }\n\n  if (checkAltAxis) {\n    var _offsetModifierState$2;\n\n    var _mainSide = mainAxis === 'x' ? top : left;\n\n    var _altSide = mainAxis === 'x' ? bottom : right;\n\n    var _offset = popperOffsets[altAxis];\n\n    var _len = altAxis === 'y' ? 'height' : 'width';\n\n    var _min = _offset + overflow[_mainSide];\n\n    var _max = _offset - overflow[_altSide];\n\n    var isOriginSide = [top, left].indexOf(basePlacement) !== -1;\n\n    var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0;\n\n    var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis;\n\n    var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max;\n\n    var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max);\n\n    popperOffsets[altAxis] = _preventedOffset;\n    data[altAxis] = _preventedOffset - _offset;\n  }\n\n  state.modifiersData[name] = data;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n  name: 'preventOverflow',\n  enabled: true,\n  phase: 'main',\n  fn: preventOverflow,\n  requiresIfExists: ['offset']\n};", "export default function getHTMLElementScroll(element) {\n  return {\n    scrollLeft: element.scrollLeft,\n    scrollTop: element.scrollTop\n  };\n}", "import getWindowScroll from \"./getWindowScroll.js\";\nimport getWindow from \"./getWindow.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nimport getHTMLElementScroll from \"./getHTMLElementScroll.js\";\nexport default function getNodeScroll(node) {\n  if (node === getWindow(node) || !isHTMLElement(node)) {\n    return getWindowScroll(node);\n  } else {\n    return getHTMLElementScroll(node);\n  }\n}", "import getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getNodeScroll from \"./getNodeScroll.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport isScrollParent from \"./isScrollParent.js\";\nimport { round } from \"../utils/math.js\";\n\nfunction isElementScaled(element) {\n  var rect = element.getBoundingClientRect();\n  var scaleX = round(rect.width) / element.offsetWidth || 1;\n  var scaleY = round(rect.height) / element.offsetHeight || 1;\n  return scaleX !== 1 || scaleY !== 1;\n} // Returns the composite rect of an element relative to its offsetParent.\n// Composite means it takes into account transforms as well as layout.\n\n\nexport default function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {\n  if (isFixed === void 0) {\n    isFixed = false;\n  }\n\n  var isOffsetParentAnElement = isHTMLElement(offsetParent);\n  var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent);\n  var documentElement = getDocumentElement(offsetParent);\n  var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled, isFixed);\n  var scroll = {\n    scrollLeft: 0,\n    scrollTop: 0\n  };\n  var offsets = {\n    x: 0,\n    y: 0\n  };\n\n  if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n    if (getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078\n    isScrollParent(documentElement)) {\n      scroll = getNodeScroll(offsetParent);\n    }\n\n    if (isHTMLElement(offsetParent)) {\n      offsets = getBoundingClientRect(offsetParent, true);\n      offsets.x += offsetParent.clientLeft;\n      offsets.y += offsetParent.clientTop;\n    } else if (documentElement) {\n      offsets.x = getWindowScrollBarX(documentElement);\n    }\n  }\n\n  return {\n    x: rect.left + scroll.scrollLeft - offsets.x,\n    y: rect.top + scroll.scrollTop - offsets.y,\n    width: rect.width,\n    height: rect.height\n  };\n}", "import { modifierPhases } from \"../enums.js\"; // source: https://stackoverflow.com/questions/49875255\n\nfunction order(modifiers) {\n  var map = new Map();\n  var visited = new Set();\n  var result = [];\n  modifiers.forEach(function (modifier) {\n    map.set(modifier.name, modifier);\n  }); // On visiting object, check for its dependencies and visit them recursively\n\n  function sort(modifier) {\n    visited.add(modifier.name);\n    var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);\n    requires.forEach(function (dep) {\n      if (!visited.has(dep)) {\n        var depModifier = map.get(dep);\n\n        if (depModifier) {\n          sort(depModifier);\n        }\n      }\n    });\n    result.push(modifier);\n  }\n\n  modifiers.forEach(function (modifier) {\n    if (!visited.has(modifier.name)) {\n      // check for visited object\n      sort(modifier);\n    }\n  });\n  return result;\n}\n\nexport default function orderModifiers(modifiers) {\n  // order based on dependencies\n  var orderedModifiers = order(modifiers); // order based on phase\n\n  return modifierPhases.reduce(function (acc, phase) {\n    return acc.concat(orderedModifiers.filter(function (modifier) {\n      return modifier.phase === phase;\n    }));\n  }, []);\n}", "export default function debounce(fn) {\n  var pending;\n  return function () {\n    if (!pending) {\n      pending = new Promise(function (resolve) {\n        Promise.resolve().then(function () {\n          pending = undefined;\n          resolve(fn());\n        });\n      });\n    }\n\n    return pending;\n  };\n}", "export default function mergeByName(modifiers) {\n  var merged = modifiers.reduce(function (merged, current) {\n    var existing = merged[current.name];\n    merged[current.name] = existing ? Object.assign({}, existing, current, {\n      options: Object.assign({}, existing.options, current.options),\n      data: Object.assign({}, existing.data, current.data)\n    }) : current;\n    return merged;\n  }, {}); // IE11 does not support Object.values\n\n  return Object.keys(merged).map(function (key) {\n    return merged[key];\n  });\n}", "import getCompositeRect from \"./dom-utils/getCompositeRect.js\";\nimport getLayoutRect from \"./dom-utils/getLayoutRect.js\";\nimport listScrollParents from \"./dom-utils/listScrollParents.js\";\nimport getOffsetParent from \"./dom-utils/getOffsetParent.js\";\nimport orderModifiers from \"./utils/orderModifiers.js\";\nimport debounce from \"./utils/debounce.js\";\nimport mergeByName from \"./utils/mergeByName.js\";\nimport detectOverflow from \"./utils/detectOverflow.js\";\nimport { isElement } from \"./dom-utils/instanceOf.js\";\nvar DEFAULT_OPTIONS = {\n  placement: 'bottom',\n  modifiers: [],\n  strategy: 'absolute'\n};\n\nfunction areValidElements() {\n  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n    args[_key] = arguments[_key];\n  }\n\n  return !args.some(function (element) {\n    return !(element && typeof element.getBoundingClientRect === 'function');\n  });\n}\n\nexport function popperGenerator(generatorOptions) {\n  if (generatorOptions === void 0) {\n    generatorOptions = {};\n  }\n\n  var _generatorOptions = generatorOptions,\n      _generatorOptions$def = _generatorOptions.defaultModifiers,\n      defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def,\n      _generatorOptions$def2 = _generatorOptions.defaultOptions,\n      defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2;\n  return function createPopper(reference, popper, options) {\n    if (options === void 0) {\n      options = defaultOptions;\n    }\n\n    var state = {\n      placement: 'bottom',\n      orderedModifiers: [],\n      options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions),\n      modifiersData: {},\n      elements: {\n        reference: reference,\n        popper: popper\n      },\n      attributes: {},\n      styles: {}\n    };\n    var effectCleanupFns = [];\n    var isDestroyed = false;\n    var instance = {\n      state: state,\n      setOptions: function setOptions(setOptionsAction) {\n        var options = typeof setOptionsAction === 'function' ? setOptionsAction(state.options) : setOptionsAction;\n        cleanupModifierEffects();\n        state.options = Object.assign({}, defaultOptions, state.options, options);\n        state.scrollParents = {\n          reference: isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [],\n          popper: listScrollParents(popper)\n        }; // Orders the modifiers based on their dependencies and `phase`\n        // properties\n\n        var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers, state.options.modifiers))); // Strip out disabled modifiers\n\n        state.orderedModifiers = orderedModifiers.filter(function (m) {\n          return m.enabled;\n        });\n        runModifierEffects();\n        return instance.update();\n      },\n      // Sync update \u2013 it will always be executed, even if not necessary. This\n      // is useful for low frequency updates where sync behavior simplifies the\n      // logic.\n      // For high frequency updates (e.g. `resize` and `scroll` events), always\n      // prefer the async Popper#update method\n      forceUpdate: function forceUpdate() {\n        if (isDestroyed) {\n          return;\n        }\n\n        var _state$elements = state.elements,\n            reference = _state$elements.reference,\n            popper = _state$elements.popper; // Don't proceed if `reference` or `popper` are not valid elements\n        // anymore\n\n        if (!areValidElements(reference, popper)) {\n          return;\n        } // Store the reference and popper rects to be read by modifiers\n\n\n        state.rects = {\n          reference: getCompositeRect(reference, getOffsetParent(popper), state.options.strategy === 'fixed'),\n          popper: getLayoutRect(popper)\n        }; // Modifiers have the ability to reset the current update cycle. The\n        // most common use case for this is the `flip` modifier changing the\n        // placement, which then needs to re-run all the modifiers, because the\n        // logic was previously ran for the previous placement and is therefore\n        // stale/incorrect\n\n        state.reset = false;\n        state.placement = state.options.placement; // On each update cycle, the `modifiersData` property for each modifier\n        // is filled with the initial data specified by the modifier. This means\n        // it doesn't persist and is fresh on each update.\n        // To ensure persistent data, use `${name}#persistent`\n\n        state.orderedModifiers.forEach(function (modifier) {\n          return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);\n        });\n\n        for (var index = 0; index < state.orderedModifiers.length; index++) {\n          if (state.reset === true) {\n            state.reset = false;\n            index = -1;\n            continue;\n          }\n\n          var _state$orderedModifie = state.orderedModifiers[index],\n              fn = _state$orderedModifie.fn,\n              _state$orderedModifie2 = _state$orderedModifie.options,\n              _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2,\n              name = _state$orderedModifie.name;\n\n          if (typeof fn === 'function') {\n            state = fn({\n              state: state,\n              options: _options,\n              name: name,\n              instance: instance\n            }) || state;\n          }\n        }\n      },\n      // Async and optimistically optimized update \u2013 it will not be executed if\n      // not necessary (debounced to run at most once-per-tick)\n      update: debounce(function () {\n        return new Promise(function (resolve) {\n          instance.forceUpdate();\n          resolve(state);\n        });\n      }),\n      destroy: function destroy() {\n        cleanupModifierEffects();\n        isDestroyed = true;\n      }\n    };\n\n    if (!areValidElements(reference, popper)) {\n      return instance;\n    }\n\n    instance.setOptions(options).then(function (state) {\n      if (!isDestroyed && options.onFirstUpdate) {\n        options.onFirstUpdate(state);\n      }\n    }); // Modifiers have the ability to execute arbitrary code before the first\n    // update cycle runs. They will be executed in the same order as the update\n    // cycle. This is useful when a modifier adds some persistent data that\n    // other modifiers need to use, but the modifier is run after the dependent\n    // one.\n\n    function runModifierEffects() {\n      state.orderedModifiers.forEach(function (_ref) {\n        var name = _ref.name,\n            _ref$options = _ref.options,\n            options = _ref$options === void 0 ? {} : _ref$options,\n            effect = _ref.effect;\n\n        if (typeof effect === 'function') {\n          var cleanupFn = effect({\n            state: state,\n            name: name,\n            instance: instance,\n            options: options\n          });\n\n          var noopFn = function noopFn() {};\n\n          effectCleanupFns.push(cleanupFn || noopFn);\n        }\n      });\n    }\n\n    function cleanupModifierEffects() {\n      effectCleanupFns.forEach(function (fn) {\n        return fn();\n      });\n      effectCleanupFns = [];\n    }\n\n    return instance;\n  };\n}\nexport var createPopper = /*#__PURE__*/popperGenerator(); // eslint-disable-next-line import/no-unused-modules\n\nexport { detectOverflow };", "import { popperGenerator, detectOverflow } from \"./createPopper.js\";\nimport eventListeners from \"./modifiers/eventListeners.js\";\nimport popperOffsets from \"./modifiers/popperOffsets.js\";\nimport computeStyles from \"./modifiers/computeStyles.js\";\nimport applyStyles from \"./modifiers/applyStyles.js\";\nvar defaultModifiers = [eventListeners, popperOffsets, computeStyles, applyStyles];\nvar createPopper = /*#__PURE__*/popperGenerator({\n  defaultModifiers: defaultModifiers\n}); // eslint-disable-next-line import/no-unused-modules\n\nexport { createPopper, popperGenerator, defaultModifiers, detectOverflow };", "import { popperGenerator, detectOverflow } from \"./createPopper.js\";\nimport eventListeners from \"./modifiers/eventListeners.js\";\nimport popperOffsets from \"./modifiers/popperOffsets.js\";\nimport computeStyles from \"./modifiers/computeStyles.js\";\nimport applyStyles from \"./modifiers/applyStyles.js\";\nimport offset from \"./modifiers/offset.js\";\nimport flip from \"./modifiers/flip.js\";\nimport preventOverflow from \"./modifiers/preventOverflow.js\";\nimport arrow from \"./modifiers/arrow.js\";\nimport hide from \"./modifiers/hide.js\";\nvar defaultModifiers = [eventListeners, popperOffsets, computeStyles, applyStyles, offset, flip, preventOverflow, arrow, hide];\nvar createPopper = /*#__PURE__*/popperGenerator({\n  defaultModifiers: defaultModifiers\n}); // eslint-disable-next-line import/no-unused-modules\n\nexport { createPopper, popperGenerator, defaultModifiers, detectOverflow }; // eslint-disable-next-line import/no-unused-modules\n\nexport { createPopper as createPopperLite } from \"./popper-lite.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport * from \"./modifiers/index.js\";", "/**\n * --------------------------------------------------------------------------\n * Bootstrap dropdown.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport * as Popper from '@popperjs/core'\nimport BaseComponent from './base-component.js'\nimport EventHandler from './dom/event-handler.js'\nimport Manipulator from './dom/manipulator.js'\nimport SelectorEngine from './dom/selector-engine.js'\nimport {\n  defineJQueryPlugin,\n  execute,\n  getElement,\n  getNextActiveElement,\n  isDisabled,\n  isElement,\n  isRTL,\n  isVisible,\n  noop\n} from './util/index.js'\n\n/**\n * Constants\n */\n\nconst NAME = 'dropdown'\nconst DATA_KEY = 'bs.dropdown'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst DATA_API_KEY = '.data-api'\n\nconst ESCAPE_KEY = 'Escape'\nconst TAB_KEY = 'Tab'\nconst ARROW_UP_KEY = 'ArrowUp'\nconst ARROW_DOWN_KEY = 'ArrowDown'\nconst RIGHT_MOUSE_BUTTON = 2 // MouseEvent.button value for the secondary button, usually the right button\n\nconst EVENT_HIDE = `hide${EVENT_KEY}`\nconst EVENT_HIDDEN = `hidden${EVENT_KEY}`\nconst EVENT_SHOW = `show${EVENT_KEY}`\nconst EVENT_SHOWN = `shown${EVENT_KEY}`\nconst EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`\nconst EVENT_KEYDOWN_DATA_API = `keydown${EVENT_KEY}${DATA_API_KEY}`\nconst EVENT_KEYUP_DATA_API = `keyup${EVENT_KEY}${DATA_API_KEY}`\n\nconst CLASS_NAME_SHOW = 'show'\nconst CLASS_NAME_DROPUP = 'dropup'\nconst CLASS_NAME_DROPEND = 'dropend'\nconst CLASS_NAME_DROPSTART = 'dropstart'\nconst CLASS_NAME_DROPUP_CENTER = 'dropup-center'\nconst CLASS_NAME_DROPDOWN_CENTER = 'dropdown-center'\n\nconst SELECTOR_DATA_TOGGLE = '[data-bs-toggle=\"dropdown\"]:not(.disabled):not(:disabled)'\nconst SELECTOR_DATA_TOGGLE_SHOWN = `${SELECTOR_DATA_TOGGLE}.${CLASS_NAME_SHOW}`\nconst SELECTOR_MENU = '.dropdown-menu'\nconst SELECTOR_NAVBAR = '.navbar'\nconst SELECTOR_NAVBAR_NAV = '.navbar-nav'\nconst SELECTOR_VISIBLE_ITEMS = '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)'\n\nconst PLACEMENT_TOP = isRTL() ? 'top-end' : 'top-start'\nconst PLACEMENT_TOPEND = isRTL() ? 'top-start' : 'top-end'\nconst PLACEMENT_BOTTOM = isRTL() ? 'bottom-end' : 'bottom-start'\nconst PLACEMENT_BOTTOMEND = isRTL() ? 'bottom-start' : 'bottom-end'\nconst PLACEMENT_RIGHT = isRTL() ? 'left-start' : 'right-start'\nconst PLACEMENT_LEFT = isRTL() ? 'right-start' : 'left-start'\nconst PLACEMENT_TOPCENTER = 'top'\nconst PLACEMENT_BOTTOMCENTER = 'bottom'\n\nconst Default = {\n  autoClose: true,\n  boundary: 'clippingParents',\n  display: 'dynamic',\n  offset: [0, 2],\n  popperConfig: null,\n  reference: 'toggle'\n}\n\nconst DefaultType = {\n  autoClose: '(boolean|string)',\n  boundary: '(string|element)',\n  display: 'string',\n  offset: '(array|string|function)',\n  popperConfig: '(null|object|function)',\n  reference: '(string|element|object)'\n}\n\n/**\n * Class definition\n */\n\nclass Dropdown extends BaseComponent {\n  constructor(element, config) {\n    super(element, config)\n\n    this._popper = null\n    this._parent = this._element.parentNode // dropdown wrapper\n    // TODO: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.3/forms/input-group/\n    this._menu = SelectorEngine.next(this._element, SELECTOR_MENU)[0] ||\n      SelectorEngine.prev(this._element, SELECTOR_MENU)[0] ||\n      SelectorEngine.findOne(SELECTOR_MENU, this._parent)\n    this._inNavbar = this._detectNavbar()\n  }\n\n  // Getters\n  static get Default() {\n    return Default\n  }\n\n  static get DefaultType() {\n    return DefaultType\n  }\n\n  static get NAME() {\n    return NAME\n  }\n\n  // Public\n  toggle() {\n    return this._isShown() ? this.hide() : this.show()\n  }\n\n  show() {\n    if (isDisabled(this._element) || this._isShown()) {\n      return\n    }\n\n    const relatedTarget = {\n      relatedTarget: this._element\n    }\n\n    const showEvent = EventHandler.trigger(this._element, EVENT_SHOW, relatedTarget)\n\n    if (showEvent.defaultPrevented) {\n      return\n    }\n\n    this._createPopper()\n\n    // If this is a touch-enabled device we add extra\n    // empty mouseover listeners to the body's immediate children;\n    // only needed because of broken event delegation on iOS\n    // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html\n    if ('ontouchstart' in document.documentElement && !this._parent.closest(SELECTOR_NAVBAR_NAV)) {\n      for (const element of [].concat(...document.body.children)) {\n        EventHandler.on(element, 'mouseover', noop)\n      }\n    }\n\n    this._element.focus()\n    this._element.setAttribute('aria-expanded', true)\n\n    this._menu.classList.add(CLASS_NAME_SHOW)\n    this._element.classList.add(CLASS_NAME_SHOW)\n    EventHandler.trigger(this._element, EVENT_SHOWN, relatedTarget)\n  }\n\n  hide() {\n    if (isDisabled(this._element) || !this._isShown()) {\n      return\n    }\n\n    const relatedTarget = {\n      relatedTarget: this._element\n    }\n\n    this._completeHide(relatedTarget)\n  }\n\n  dispose() {\n    if (this._popper) {\n      this._popper.destroy()\n    }\n\n    super.dispose()\n  }\n\n  update() {\n    this._inNavbar = this._detectNavbar()\n    if (this._popper) {\n      this._popper.update()\n    }\n  }\n\n  // Private\n  _completeHide(relatedTarget) {\n    const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE, relatedTarget)\n    if (hideEvent.defaultPrevented) {\n      return\n    }\n\n    // If this is a touch-enabled device we remove the extra\n    // empty mouseover listeners we added for iOS support\n    if ('ontouchstart' in document.documentElement) {\n      for (const element of [].concat(...document.body.children)) {\n        EventHandler.off(element, 'mouseover', noop)\n      }\n    }\n\n    if (this._popper) {\n      this._popper.destroy()\n    }\n\n    this._menu.classList.remove(CLASS_NAME_SHOW)\n    this._element.classList.remove(CLASS_NAME_SHOW)\n    this._element.setAttribute('aria-expanded', 'false')\n    Manipulator.removeDataAttribute(this._menu, 'popper')\n    EventHandler.trigger(this._element, EVENT_HIDDEN, relatedTarget)\n\n    // Explicitly return focus to the trigger element\n    this._element.focus()\n  }\n\n  _getConfig(config) {\n    config = super._getConfig(config)\n\n    if (typeof config.reference === 'object' && !isElement(config.reference) &&\n      typeof config.reference.getBoundingClientRect !== 'function'\n    ) {\n      // Popper virtual elements require a getBoundingClientRect method\n      throw new TypeError(`${NAME.toUpperCase()}: Option \"reference\" provided type \"object\" without a required \"getBoundingClientRect\" method.`)\n    }\n\n    return config\n  }\n\n  _createPopper() {\n    if (typeof Popper === 'undefined') {\n      throw new TypeError('Bootstrap\\'s dropdowns require Popper (https://popper.js.org/docs/v2/)')\n    }\n\n    let referenceElement = this._element\n\n    if (this._config.reference === 'parent') {\n      referenceElement = this._parent\n    } else if (isElement(this._config.reference)) {\n      referenceElement = getElement(this._config.reference)\n    } else if (typeof this._config.reference === 'object') {\n      referenceElement = this._config.reference\n    }\n\n    const popperConfig = this._getPopperConfig()\n    this._popper = Popper.createPopper(referenceElement, this._menu, popperConfig)\n  }\n\n  _isShown() {\n    return this._menu.classList.contains(CLASS_NAME_SHOW)\n  }\n\n  _getPlacement() {\n    const parentDropdown = this._parent\n\n    if (parentDropdown.classList.contains(CLASS_NAME_DROPEND)) {\n      return PLACEMENT_RIGHT\n    }\n\n    if (parentDropdown.classList.contains(CLASS_NAME_DROPSTART)) {\n      return PLACEMENT_LEFT\n    }\n\n    if (parentDropdown.classList.contains(CLASS_NAME_DROPUP_CENTER)) {\n      return PLACEMENT_TOPCENTER\n    }\n\n    if (parentDropdown.classList.contains(CLASS_NAME_DROPDOWN_CENTER)) {\n      return PLACEMENT_BOTTOMCENTER\n    }\n\n    // We need to trim the value because custom properties can also include spaces\n    const isEnd = getComputedStyle(this._menu).getPropertyValue('--bs-position').trim() === 'end'\n\n    if (parentDropdown.classList.contains(CLASS_NAME_DROPUP)) {\n      return isEnd ? PLACEMENT_TOPEND : PLACEMENT_TOP\n    }\n\n    return isEnd ? PLACEMENT_BOTTOMEND : PLACEMENT_BOTTOM\n  }\n\n  _detectNavbar() {\n    return this._element.closest(SELECTOR_NAVBAR) !== null\n  }\n\n  _getOffset() {\n    const { offset } = this._config\n\n    if (typeof offset === 'string') {\n      return offset.split(',').map(value => Number.parseInt(value, 10))\n    }\n\n    if (typeof offset === 'function') {\n      return popperData => offset(popperData, this._element)\n    }\n\n    return offset\n  }\n\n  _getPopperConfig() {\n    const defaultBsPopperConfig = {\n      placement: this._getPlacement(),\n      modifiers: [{\n        name: 'preventOverflow',\n        options: {\n          boundary: this._config.boundary\n        }\n      },\n      {\n        name: 'offset',\n        options: {\n          offset: this._getOffset()\n        }\n      }]\n    }\n\n    // Disable Popper if we have a static display or Dropdown is in Navbar\n    if (this._inNavbar || this._config.display === 'static') {\n      Manipulator.setDataAttribute(this._menu, 'popper', 'static') // TODO: v6 remove\n      defaultBsPopperConfig.modifiers = [{\n        name: 'applyStyles',\n        enabled: false\n      }]\n    }\n\n    return {\n      ...defaultBsPopperConfig,\n      ...execute(this._config.popperConfig, [undefined, defaultBsPopperConfig])\n    }\n  }\n\n  _selectMenuItem({ key, target }) {\n    const items = SelectorEngine.find(SELECTOR_VISIBLE_ITEMS, this._menu).filter(element => isVisible(element))\n\n    if (!items.length) {\n      return\n    }\n\n    // if target isn't included in items (e.g. when expanding the dropdown)\n    // allow cycling to get the last item in case key equals ARROW_UP_KEY\n    getNextActiveElement(items, target, key === ARROW_DOWN_KEY, !items.includes(target)).focus()\n  }\n\n  // Static\n  static jQueryInterface(config) {\n    return this.each(function () {\n      const data = Dropdown.getOrCreateInstance(this, config)\n\n      if (typeof config !== 'string') {\n        return\n      }\n\n      if (typeof data[config] === 'undefined') {\n        throw new TypeError(`No method named \"${config}\"`)\n      }\n\n      data[config]()\n    })\n  }\n\n  static clearMenus(event) {\n    if (event.button === RIGHT_MOUSE_BUTTON || (event.type === 'keyup' && event.key !== TAB_KEY)) {\n      return\n    }\n\n    const openToggles = SelectorEngine.find(SELECTOR_DATA_TOGGLE_SHOWN)\n\n    for (const toggle of openToggles) {\n      const context = Dropdown.getInstance(toggle)\n      if (!context || context._config.autoClose === false) {\n        continue\n      }\n\n      const composedPath = event.composedPath()\n      const isMenuTarget = composedPath.includes(context._menu)\n      if (\n        composedPath.includes(context._element) ||\n        (context._config.autoClose === 'inside' && !isMenuTarget) ||\n        (context._config.autoClose === 'outside' && isMenuTarget)\n      ) {\n        continue\n      }\n\n      // Tab navigation through the dropdown menu or events from contained inputs shouldn't close the menu\n      if (context._menu.contains(event.target) && ((event.type === 'keyup' && event.key === TAB_KEY) || /input|select|option|textarea|form/i.test(event.target.tagName))) {\n        continue\n      }\n\n      const relatedTarget = { relatedTarget: context._element }\n\n      if (event.type === 'click') {\n        relatedTarget.clickEvent = event\n      }\n\n      context._completeHide(relatedTarget)\n    }\n  }\n\n  static dataApiKeydownHandler(event) {\n    // If not an UP | DOWN | ESCAPE key => not a dropdown command\n    // If input/textarea && if key is other than ESCAPE => not a dropdown command\n\n    const isInput = /input|textarea/i.test(event.target.tagName)\n    const isEscapeEvent = event.key === ESCAPE_KEY\n    const isUpOrDownEvent = [ARROW_UP_KEY, ARROW_DOWN_KEY].includes(event.key)\n\n    if (!isUpOrDownEvent && !isEscapeEvent) {\n      return\n    }\n\n    if (isInput && !isEscapeEvent) {\n      return\n    }\n\n    event.preventDefault()\n\n    // TODO: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.3/forms/input-group/\n    const getToggleButton = this.matches(SELECTOR_DATA_TOGGLE) ?\n      this :\n      (SelectorEngine.prev(this, SELECTOR_DATA_TOGGLE)[0] ||\n        SelectorEngine.next(this, SELECTOR_DATA_TOGGLE)[0] ||\n        SelectorEngine.findOne(SELECTOR_DATA_TOGGLE, event.delegateTarget.parentNode))\n\n    const instance = Dropdown.getOrCreateInstance(getToggleButton)\n\n    if (isUpOrDownEvent) {\n      event.stopPropagation()\n      instance.show()\n      instance._selectMenuItem(event)\n      return\n    }\n\n    if (instance._isShown()) { // else is escape and we check if it is shown\n      event.stopPropagation()\n      instance.hide()\n      getToggleButton.focus()\n    }\n  }\n}\n\n/**\n * Data API implementation\n */\n\nEventHandler.on(document, EVENT_KEYDOWN_DATA_API, SELECTOR_DATA_TOGGLE, Dropdown.dataApiKeydownHandler)\nEventHandler.on(document, EVENT_KEYDOWN_DATA_API, SELECTOR_MENU, Dropdown.dataApiKeydownHandler)\nEventHandler.on(document, EVENT_CLICK_DATA_API, Dropdown.clearMenus)\nEventHandler.on(document, EVENT_KEYUP_DATA_API, Dropdown.clearMenus)\nEventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {\n  event.preventDefault()\n  Dropdown.getOrCreateInstance(this).toggle()\n})\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Dropdown)\n\nexport default Dropdown\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap util/backdrop.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport EventHandler from '../dom/event-handler.js'\nimport Config from './config.js'\nimport {\n  execute, executeAfterTransition, getElement, reflow\n} from './index.js'\n\n/**\n * Constants\n */\n\nconst NAME = 'backdrop'\nconst CLASS_NAME_FADE = 'fade'\nconst CLASS_NAME_SHOW = 'show'\nconst EVENT_MOUSEDOWN = `mousedown.bs.${NAME}`\n\nconst Default = {\n  className: 'modal-backdrop',\n  clickCallback: null,\n  isAnimated: false,\n  isVisible: true, // if false, we use the backdrop helper without adding any element to the dom\n  rootElement: 'body' // give the choice to place backdrop under different elements\n}\n\nconst DefaultType = {\n  className: 'string',\n  clickCallback: '(function|null)',\n  isAnimated: 'boolean',\n  isVisible: 'boolean',\n  rootElement: '(element|string)'\n}\n\n/**\n * Class definition\n */\n\nclass Backdrop extends Config {\n  constructor(config) {\n    super()\n    this._config = this._getConfig(config)\n    this._isAppended = false\n    this._element = null\n  }\n\n  // Getters\n  static get Default() {\n    return Default\n  }\n\n  static get DefaultType() {\n    return DefaultType\n  }\n\n  static get NAME() {\n    return NAME\n  }\n\n  // Public\n  show(callback) {\n    if (!this._config.isVisible) {\n      execute(callback)\n      return\n    }\n\n    this._append()\n\n    const element = this._getElement()\n    if (this._config.isAnimated) {\n      reflow(element)\n    }\n\n    element.classList.add(CLASS_NAME_SHOW)\n\n    this._emulateAnimation(() => {\n      execute(callback)\n    })\n  }\n\n  hide(callback) {\n    if (!this._config.isVisible) {\n      execute(callback)\n      return\n    }\n\n    this._getElement().classList.remove(CLASS_NAME_SHOW)\n\n    this._emulateAnimation(() => {\n      this.dispose()\n      execute(callback)\n    })\n  }\n\n  dispose() {\n    if (!this._isAppended) {\n      return\n    }\n\n    EventHandler.off(this._element, EVENT_MOUSEDOWN)\n\n    this._element.remove()\n    this._isAppended = false\n  }\n\n  // Private\n  _getElement() {\n    if (!this._element) {\n      const backdrop = document.createElement('div')\n      backdrop.className = this._config.className\n      if (this._config.isAnimated) {\n        backdrop.classList.add(CLASS_NAME_FADE)\n      }\n\n      this._element = backdrop\n    }\n\n    return this._element\n  }\n\n  _configAfterMerge(config) {\n    // use getElement() with the default \"body\" to get a fresh Element on each instantiation\n    config.rootElement = getElement(config.rootElement)\n    return config\n  }\n\n  _append() {\n    if (this._isAppended) {\n      return\n    }\n\n    const element = this._getElement()\n    this._config.rootElement.append(element)\n\n    EventHandler.on(element, EVENT_MOUSEDOWN, () => {\n      execute(this._config.clickCallback)\n    })\n\n    this._isAppended = true\n  }\n\n  _emulateAnimation(callback) {\n    executeAfterTransition(callback, this._getElement(), this._config.isAnimated)\n  }\n}\n\nexport default Backdrop\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap util/focustrap.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport EventHandler from '../dom/event-handler.js'\nimport SelectorEngine from '../dom/selector-engine.js'\nimport Config from './config.js'\n\n/**\n * Constants\n */\n\nconst NAME = 'focustrap'\nconst DATA_KEY = 'bs.focustrap'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst EVENT_FOCUSIN = `focusin${EVENT_KEY}`\nconst EVENT_KEYDOWN_TAB = `keydown.tab${EVENT_KEY}`\n\nconst TAB_KEY = 'Tab'\nconst TAB_NAV_FORWARD = 'forward'\nconst TAB_NAV_BACKWARD = 'backward'\n\nconst Default = {\n  autofocus: true,\n  trapElement: null // The element to trap focus inside of\n}\n\nconst DefaultType = {\n  autofocus: 'boolean',\n  trapElement: 'element'\n}\n\n/**\n * Class definition\n */\n\nclass FocusTrap extends Config {\n  constructor(config) {\n    super()\n    this._config = this._getConfig(config)\n    this._isActive = false\n    this._lastTabNavDirection = null\n  }\n\n  // Getters\n  static get Default() {\n    return Default\n  }\n\n  static get DefaultType() {\n    return DefaultType\n  }\n\n  static get NAME() {\n    return NAME\n  }\n\n  // Public\n  activate() {\n    if (this._isActive) {\n      return\n    }\n\n    if (this._config.autofocus) {\n      this._config.trapElement.focus()\n    }\n\n    EventHandler.off(document, EVENT_KEY) // guard against infinite focus loop\n    EventHandler.on(document, EVENT_FOCUSIN, event => this._handleFocusin(event))\n    EventHandler.on(document, EVENT_KEYDOWN_TAB, event => this._handleKeydown(event))\n\n    this._isActive = true\n  }\n\n  deactivate() {\n    if (!this._isActive) {\n      return\n    }\n\n    this._isActive = false\n    EventHandler.off(document, EVENT_KEY)\n  }\n\n  // Private\n  _handleFocusin(event) {\n    const { trapElement } = this._config\n\n    if (event.target === document || event.target === trapElement || trapElement.contains(event.target)) {\n      return\n    }\n\n    const elements = SelectorEngine.focusableChildren(trapElement)\n\n    if (elements.length === 0) {\n      trapElement.focus()\n    } else if (this._lastTabNavDirection === TAB_NAV_BACKWARD) {\n      elements[elements.length - 1].focus()\n    } else {\n      elements[0].focus()\n    }\n  }\n\n  _handleKeydown(event) {\n    if (event.key !== TAB_KEY) {\n      return\n    }\n\n    this._lastTabNavDirection = event.shiftKey ? TAB_NAV_BACKWARD : TAB_NAV_FORWARD\n  }\n}\n\nexport default FocusTrap\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap util/scrollBar.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport Manipulator from '../dom/manipulator.js'\nimport SelectorEngine from '../dom/selector-engine.js'\nimport { isElement } from './index.js'\n\n/**\n * Constants\n */\n\nconst SELECTOR_FIXED_CONTENT = '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top'\nconst SELECTOR_STICKY_CONTENT = '.sticky-top'\nconst PROPERTY_PADDING = 'padding-right'\nconst PROPERTY_MARGIN = 'margin-right'\n\n/**\n * Class definition\n */\n\nclass ScrollBarHelper {\n  constructor() {\n    this._element = document.body\n  }\n\n  // Public\n  getWidth() {\n    // https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth#usage_notes\n    const documentWidth = document.documentElement.clientWidth\n    return Math.abs(window.innerWidth - documentWidth)\n  }\n\n  hide() {\n    const width = this.getWidth()\n    this._disableOverFlow()\n    // give padding to element to balance the hidden scrollbar width\n    this._setElementAttributes(this._element, PROPERTY_PADDING, calculatedValue => calculatedValue + width)\n    // trick: We adjust positive paddingRight and negative marginRight to sticky-top elements to keep showing fullwidth\n    this._setElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING, calculatedValue => calculatedValue + width)\n    this._setElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN, calculatedValue => calculatedValue - width)\n  }\n\n  reset() {\n    this._resetElementAttributes(this._element, 'overflow')\n    this._resetElementAttributes(this._element, PROPERTY_PADDING)\n    this._resetElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING)\n    this._resetElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN)\n  }\n\n  isOverflowing() {\n    return this.getWidth() > 0\n  }\n\n  // Private\n  _disableOverFlow() {\n    this._saveInitialAttribute(this._element, 'overflow')\n    this._element.style.overflow = 'hidden'\n  }\n\n  _setElementAttributes(selector, styleProperty, callback) {\n    const scrollbarWidth = this.getWidth()\n    const manipulationCallBack = element => {\n      if (element !== this._element && window.innerWidth > element.clientWidth + scrollbarWidth) {\n        return\n      }\n\n      this._saveInitialAttribute(element, styleProperty)\n      const calculatedValue = window.getComputedStyle(element).getPropertyValue(styleProperty)\n      element.style.setProperty(styleProperty, `${callback(Number.parseFloat(calculatedValue))}px`)\n    }\n\n    this._applyManipulationCallback(selector, manipulationCallBack)\n  }\n\n  _saveInitialAttribute(element, styleProperty) {\n    const actualValue = element.style.getPropertyValue(styleProperty)\n    if (actualValue) {\n      Manipulator.setDataAttribute(element, styleProperty, actualValue)\n    }\n  }\n\n  _resetElementAttributes(selector, styleProperty) {\n    const manipulationCallBack = element => {\n      const value = Manipulator.getDataAttribute(element, styleProperty)\n      // We only want to remove the property if the value is `null`; the value can also be zero\n      if (value === null) {\n        element.style.removeProperty(styleProperty)\n        return\n      }\n\n      Manipulator.removeDataAttribute(element, styleProperty)\n      element.style.setProperty(styleProperty, value)\n    }\n\n    this._applyManipulationCallback(selector, manipulationCallBack)\n  }\n\n  _applyManipulationCallback(selector, callBack) {\n    if (isElement(selector)) {\n      callBack(selector)\n      return\n    }\n\n    for (const sel of SelectorEngine.find(selector, this._element)) {\n      callBack(sel)\n    }\n  }\n}\n\nexport default ScrollBarHelper\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap modal.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport BaseComponent from './base-component.js'\nimport EventHandler from './dom/event-handler.js'\nimport SelectorEngine from './dom/selector-engine.js'\nimport Backdrop from './util/backdrop.js'\nimport { enableDismissTrigger } from './util/component-functions.js'\nimport FocusTrap from './util/focustrap.js'\nimport {\n  defineJQueryPlugin, isRTL, isVisible, reflow\n} from './util/index.js'\nimport ScrollBarHelper from './util/scrollbar.js'\n\n/**\n * Constants\n */\n\nconst NAME = 'modal'\nconst DATA_KEY = 'bs.modal'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst DATA_API_KEY = '.data-api'\nconst ESCAPE_KEY = 'Escape'\n\nconst EVENT_HIDE = `hide${EVENT_KEY}`\nconst EVENT_HIDE_PREVENTED = `hidePrevented${EVENT_KEY}`\nconst EVENT_HIDDEN = `hidden${EVENT_KEY}`\nconst EVENT_SHOW = `show${EVENT_KEY}`\nconst EVENT_SHOWN = `shown${EVENT_KEY}`\nconst EVENT_RESIZE = `resize${EVENT_KEY}`\nconst EVENT_CLICK_DISMISS = `click.dismiss${EVENT_KEY}`\nconst EVENT_MOUSEDOWN_DISMISS = `mousedown.dismiss${EVENT_KEY}`\nconst EVENT_KEYDOWN_DISMISS = `keydown.dismiss${EVENT_KEY}`\nconst EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`\n\nconst CLASS_NAME_OPEN = 'modal-open'\nconst CLASS_NAME_FADE = 'fade'\nconst CLASS_NAME_SHOW = 'show'\nconst CLASS_NAME_STATIC = 'modal-static'\n\nconst OPEN_SELECTOR = '.modal.show'\nconst SELECTOR_DIALOG = '.modal-dialog'\nconst SELECTOR_MODAL_BODY = '.modal-body'\nconst SELECTOR_DATA_TOGGLE = '[data-bs-toggle=\"modal\"]'\n\nconst Default = {\n  backdrop: true,\n  focus: true,\n  keyboard: true\n}\n\nconst DefaultType = {\n  backdrop: '(boolean|string)',\n  focus: 'boolean',\n  keyboard: 'boolean'\n}\n\n/**\n * Class definition\n */\n\nclass Modal extends BaseComponent {\n  constructor(element, config) {\n    super(element, config)\n\n    this._dialog = SelectorEngine.findOne(SELECTOR_DIALOG, this._element)\n    this._backdrop = this._initializeBackDrop()\n    this._focustrap = this._initializeFocusTrap()\n    this._isShown = false\n    this._isTransitioning = false\n    this._scrollBar = new ScrollBarHelper()\n\n    this._addEventListeners()\n  }\n\n  // Getters\n  static get Default() {\n    return Default\n  }\n\n  static get DefaultType() {\n    return DefaultType\n  }\n\n  static get NAME() {\n    return NAME\n  }\n\n  // Public\n  toggle(relatedTarget) {\n    return this._isShown ? this.hide() : this.show(relatedTarget)\n  }\n\n  show(relatedTarget) {\n    if (this._isShown || this._isTransitioning) {\n      return\n    }\n\n    const showEvent = EventHandler.trigger(this._element, EVENT_SHOW, {\n      relatedTarget\n    })\n\n    if (showEvent.defaultPrevented) {\n      return\n    }\n\n    this._isShown = true\n    this._isTransitioning = true\n\n    this._scrollBar.hide()\n\n    document.body.classList.add(CLASS_NAME_OPEN)\n\n    this._adjustDialog()\n\n    this._backdrop.show(() => this._showElement(relatedTarget))\n  }\n\n  hide() {\n    if (!this._isShown || this._isTransitioning) {\n      return\n    }\n\n    const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE)\n\n    if (hideEvent.defaultPrevented) {\n      return\n    }\n\n    this._isShown = false\n    this._isTransitioning = true\n    this._focustrap.deactivate()\n\n    this._element.classList.remove(CLASS_NAME_SHOW)\n\n    this._queueCallback(() => this._hideModal(), this._element, this._isAnimated())\n  }\n\n  dispose() {\n    EventHandler.off(window, EVENT_KEY)\n    EventHandler.off(this._dialog, EVENT_KEY)\n\n    this._backdrop.dispose()\n    this._focustrap.deactivate()\n\n    super.dispose()\n  }\n\n  handleUpdate() {\n    this._adjustDialog()\n  }\n\n  // Private\n  _initializeBackDrop() {\n    return new Backdrop({\n      isVisible: Boolean(this._config.backdrop), // 'static' option will be translated to true, and booleans will keep their value,\n      isAnimated: this._isAnimated()\n    })\n  }\n\n  _initializeFocusTrap() {\n    return new FocusTrap({\n      trapElement: this._element\n    })\n  }\n\n  _showElement(relatedTarget) {\n    // try to append dynamic modal\n    if (!document.body.contains(this._element)) {\n      document.body.append(this._element)\n    }\n\n    this._element.style.display = 'block'\n    this._element.removeAttribute('aria-hidden')\n    this._element.setAttribute('aria-modal', true)\n    this._element.setAttribute('role', 'dialog')\n    this._element.scrollTop = 0\n\n    const modalBody = SelectorEngine.findOne(SELECTOR_MODAL_BODY, this._dialog)\n    if (modalBody) {\n      modalBody.scrollTop = 0\n    }\n\n    reflow(this._element)\n\n    this._element.classList.add(CLASS_NAME_SHOW)\n\n    const transitionComplete = () => {\n      if (this._config.focus) {\n        this._focustrap.activate()\n      }\n\n      this._isTransitioning = false\n      EventHandler.trigger(this._element, EVENT_SHOWN, {\n        relatedTarget\n      })\n    }\n\n    this._queueCallback(transitionComplete, this._dialog, this._isAnimated())\n  }\n\n  _addEventListeners() {\n    EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS, event => {\n      if (event.key !== ESCAPE_KEY) {\n        return\n      }\n\n      if (this._config.keyboard) {\n        this.hide()\n        return\n      }\n\n      this._triggerBackdropTransition()\n    })\n\n    EventHandler.on(window, EVENT_RESIZE, () => {\n      if (this._isShown && !this._isTransitioning) {\n        this._adjustDialog()\n      }\n    })\n\n    EventHandler.on(this._element, EVENT_MOUSEDOWN_DISMISS, event => {\n      // a bad trick to segregate clicks that may start inside dialog but end outside, and avoid listen to scrollbar clicks\n      EventHandler.one(this._element, EVENT_CLICK_DISMISS, event2 => {\n        if (this._element !== event.target || this._element !== event2.target) {\n          return\n        }\n\n        if (this._config.backdrop === 'static') {\n          this._triggerBackdropTransition()\n          return\n        }\n\n        if (this._config.backdrop) {\n          this.hide()\n        }\n      })\n    })\n  }\n\n  _hideModal() {\n    this._element.style.display = 'none'\n    this._element.setAttribute('aria-hidden', true)\n    this._element.removeAttribute('aria-modal')\n    this._element.removeAttribute('role')\n    this._isTransitioning = false\n\n    this._backdrop.hide(() => {\n      document.body.classList.remove(CLASS_NAME_OPEN)\n      this._resetAdjustments()\n      this._scrollBar.reset()\n      EventHandler.trigger(this._element, EVENT_HIDDEN)\n    })\n  }\n\n  _isAnimated() {\n    return this._element.classList.contains(CLASS_NAME_FADE)\n  }\n\n  _triggerBackdropTransition() {\n    const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED)\n    if (hideEvent.defaultPrevented) {\n      return\n    }\n\n    const isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight\n    const initialOverflowY = this._element.style.overflowY\n    // return if the following background transition hasn't yet completed\n    if (initialOverflowY === 'hidden' || this._element.classList.contains(CLASS_NAME_STATIC)) {\n      return\n    }\n\n    if (!isModalOverflowing) {\n      this._element.style.overflowY = 'hidden'\n    }\n\n    this._element.classList.add(CLASS_NAME_STATIC)\n    this._queueCallback(() => {\n      this._element.classList.remove(CLASS_NAME_STATIC)\n      this._queueCallback(() => {\n        this._element.style.overflowY = initialOverflowY\n      }, this._dialog)\n    }, this._dialog)\n\n    this._element.focus()\n  }\n\n  /**\n   * The following methods are used to handle overflowing modals\n   */\n\n  _adjustDialog() {\n    const isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight\n    const scrollbarWidth = this._scrollBar.getWidth()\n    const isBodyOverflowing = scrollbarWidth > 0\n\n    if (isBodyOverflowing && !isModalOverflowing) {\n      const property = isRTL() ? 'paddingLeft' : 'paddingRight'\n      this._element.style[property] = `${scrollbarWidth}px`\n    }\n\n    if (!isBodyOverflowing && isModalOverflowing) {\n      const property = isRTL() ? 'paddingRight' : 'paddingLeft'\n      this._element.style[property] = `${scrollbarWidth}px`\n    }\n  }\n\n  _resetAdjustments() {\n    this._element.style.paddingLeft = ''\n    this._element.style.paddingRight = ''\n  }\n\n  // Static\n  static jQueryInterface(config, relatedTarget) {\n    return this.each(function () {\n      const data = Modal.getOrCreateInstance(this, config)\n\n      if (typeof config !== 'string') {\n        return\n      }\n\n      if (typeof data[config] === 'undefined') {\n        throw new TypeError(`No method named \"${config}\"`)\n      }\n\n      data[config](relatedTarget)\n    })\n  }\n}\n\n/**\n * Data API implementation\n */\n\nEventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {\n  const target = SelectorEngine.getElementFromSelector(this)\n\n  if (['A', 'AREA'].includes(this.tagName)) {\n    event.preventDefault()\n  }\n\n  EventHandler.one(target, EVENT_SHOW, showEvent => {\n    if (showEvent.defaultPrevented) {\n      // only register focus restorer if modal will actually get shown\n      return\n    }\n\n    EventHandler.one(target, EVENT_HIDDEN, () => {\n      if (isVisible(this)) {\n        this.focus()\n      }\n    })\n  })\n\n  // avoid conflict when clicking modal toggler while another one is open\n  const alreadyOpen = SelectorEngine.findOne(OPEN_SELECTOR)\n  if (alreadyOpen) {\n    Modal.getInstance(alreadyOpen).hide()\n  }\n\n  const data = Modal.getOrCreateInstance(target)\n\n  data.toggle(this)\n})\n\nenableDismissTrigger(Modal)\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Modal)\n\nexport default Modal\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap offcanvas.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport BaseComponent from './base-component.js'\nimport EventHandler from './dom/event-handler.js'\nimport SelectorEngine from './dom/selector-engine.js'\nimport Backdrop from './util/backdrop.js'\nimport { enableDismissTrigger } from './util/component-functions.js'\nimport FocusTrap from './util/focustrap.js'\nimport {\n  defineJQueryPlugin,\n  isDisabled,\n  isVisible\n} from './util/index.js'\nimport ScrollBarHelper from './util/scrollbar.js'\n\n/**\n * Constants\n */\n\nconst NAME = 'offcanvas'\nconst DATA_KEY = 'bs.offcanvas'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst DATA_API_KEY = '.data-api'\nconst EVENT_LOAD_DATA_API = `load${EVENT_KEY}${DATA_API_KEY}`\nconst ESCAPE_KEY = 'Escape'\n\nconst CLASS_NAME_SHOW = 'show'\nconst CLASS_NAME_SHOWING = 'showing'\nconst CLASS_NAME_HIDING = 'hiding'\nconst CLASS_NAME_BACKDROP = 'offcanvas-backdrop'\nconst OPEN_SELECTOR = '.offcanvas.show'\n\nconst EVENT_SHOW = `show${EVENT_KEY}`\nconst EVENT_SHOWN = `shown${EVENT_KEY}`\nconst EVENT_HIDE = `hide${EVENT_KEY}`\nconst EVENT_HIDE_PREVENTED = `hidePrevented${EVENT_KEY}`\nconst EVENT_HIDDEN = `hidden${EVENT_KEY}`\nconst EVENT_RESIZE = `resize${EVENT_KEY}`\nconst EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`\nconst EVENT_KEYDOWN_DISMISS = `keydown.dismiss${EVENT_KEY}`\n\nconst SELECTOR_DATA_TOGGLE = '[data-bs-toggle=\"offcanvas\"]'\n\nconst Default = {\n  backdrop: true,\n  keyboard: true,\n  scroll: false\n}\n\nconst DefaultType = {\n  backdrop: '(boolean|string)',\n  keyboard: 'boolean',\n  scroll: 'boolean'\n}\n\n/**\n * Class definition\n */\n\nclass Offcanvas extends BaseComponent {\n  constructor(element, config) {\n    super(element, config)\n\n    this._isShown = false\n    this._backdrop = this._initializeBackDrop()\n    this._focustrap = this._initializeFocusTrap()\n    this._addEventListeners()\n  }\n\n  // Getters\n  static get Default() {\n    return Default\n  }\n\n  static get DefaultType() {\n    return DefaultType\n  }\n\n  static get NAME() {\n    return NAME\n  }\n\n  // Public\n  toggle(relatedTarget) {\n    return this._isShown ? this.hide() : this.show(relatedTarget)\n  }\n\n  show(relatedTarget) {\n    if (this._isShown) {\n      return\n    }\n\n    const showEvent = EventHandler.trigger(this._element, EVENT_SHOW, { relatedTarget })\n\n    if (showEvent.defaultPrevented) {\n      return\n    }\n\n    this._isShown = true\n    this._backdrop.show()\n\n    if (!this._config.scroll) {\n      new ScrollBarHelper().hide()\n    }\n\n    this._element.setAttribute('aria-modal', true)\n    this._element.setAttribute('role', 'dialog')\n    this._element.classList.add(CLASS_NAME_SHOWING)\n\n    const completeCallBack = () => {\n      if (!this._config.scroll || this._config.backdrop) {\n        this._focustrap.activate()\n      }\n\n      this._element.classList.add(CLASS_NAME_SHOW)\n      this._element.classList.remove(CLASS_NAME_SHOWING)\n      EventHandler.trigger(this._element, EVENT_SHOWN, { relatedTarget })\n    }\n\n    this._queueCallback(completeCallBack, this._element, true)\n  }\n\n  hide() {\n    if (!this._isShown) {\n      return\n    }\n\n    const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE)\n\n    if (hideEvent.defaultPrevented) {\n      return\n    }\n\n    this._focustrap.deactivate()\n    this._element.blur()\n    this._isShown = false\n    this._element.classList.add(CLASS_NAME_HIDING)\n    this._backdrop.hide()\n\n    const completeCallback = () => {\n      this._element.classList.remove(CLASS_NAME_SHOW, CLASS_NAME_HIDING)\n      this._element.removeAttribute('aria-modal')\n      this._element.removeAttribute('role')\n\n      if (!this._config.scroll) {\n        new ScrollBarHelper().reset()\n      }\n\n      EventHandler.trigger(this._element, EVENT_HIDDEN)\n    }\n\n    this._queueCallback(completeCallback, this._element, true)\n  }\n\n  dispose() {\n    this._backdrop.dispose()\n    this._focustrap.deactivate()\n    super.dispose()\n  }\n\n  // Private\n  _initializeBackDrop() {\n    const clickCallback = () => {\n      if (this._config.backdrop === 'static') {\n        EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED)\n        return\n      }\n\n      this.hide()\n    }\n\n    // 'static' option will be translated to true, and booleans will keep their value\n    const isVisible = Boolean(this._config.backdrop)\n\n    return new Backdrop({\n      className: CLASS_NAME_BACKDROP,\n      isVisible,\n      isAnimated: true,\n      rootElement: this._element.parentNode,\n      clickCallback: isVisible ? clickCallback : null\n    })\n  }\n\n  _initializeFocusTrap() {\n    return new FocusTrap({\n      trapElement: this._element\n    })\n  }\n\n  _addEventListeners() {\n    EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS, event => {\n      if (event.key !== ESCAPE_KEY) {\n        return\n      }\n\n      if (this._config.keyboard) {\n        this.hide()\n        return\n      }\n\n      EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED)\n    })\n  }\n\n  // Static\n  static jQueryInterface(config) {\n    return this.each(function () {\n      const data = Offcanvas.getOrCreateInstance(this, config)\n\n      if (typeof config !== 'string') {\n        return\n      }\n\n      if (data[config] === undefined || config.startsWith('_') || config === 'constructor') {\n        throw new TypeError(`No method named \"${config}\"`)\n      }\n\n      data[config](this)\n    })\n  }\n}\n\n/**\n * Data API implementation\n */\n\nEventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {\n  const target = SelectorEngine.getElementFromSelector(this)\n\n  if (['A', 'AREA'].includes(this.tagName)) {\n    event.preventDefault()\n  }\n\n  if (isDisabled(this)) {\n    return\n  }\n\n  EventHandler.one(target, EVENT_HIDDEN, () => {\n    // focus on trigger when it is closed\n    if (isVisible(this)) {\n      this.focus()\n    }\n  })\n\n  // avoid conflict when clicking a toggler of an offcanvas, while another is open\n  const alreadyOpen = SelectorEngine.findOne(OPEN_SELECTOR)\n  if (alreadyOpen && alreadyOpen !== target) {\n    Offcanvas.getInstance(alreadyOpen).hide()\n  }\n\n  const data = Offcanvas.getOrCreateInstance(target)\n  data.toggle(this)\n})\n\nEventHandler.on(window, EVENT_LOAD_DATA_API, () => {\n  for (const selector of SelectorEngine.find(OPEN_SELECTOR)) {\n    Offcanvas.getOrCreateInstance(selector).show()\n  }\n})\n\nEventHandler.on(window, EVENT_RESIZE, () => {\n  for (const element of SelectorEngine.find('[aria-modal][class*=show][class*=offcanvas-]')) {\n    if (getComputedStyle(element).position !== 'fixed') {\n      Offcanvas.getOrCreateInstance(element).hide()\n    }\n  }\n})\n\nenableDismissTrigger(Offcanvas)\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Offcanvas)\n\nexport default Offcanvas\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap util/sanitizer.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n// js-docs-start allow-list\nconst ARIA_ATTRIBUTE_PATTERN = /^aria-[\\w-]*$/i\n\nexport const DefaultAllowlist = {\n  // Global attributes allowed on any supplied element below.\n  '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN],\n  a: ['target', 'href', 'title', 'rel'],\n  area: [],\n  b: [],\n  br: [],\n  col: [],\n  code: [],\n  dd: [],\n  div: [],\n  dl: [],\n  dt: [],\n  em: [],\n  hr: [],\n  h1: [],\n  h2: [],\n  h3: [],\n  h4: [],\n  h5: [],\n  h6: [],\n  i: [],\n  img: ['src', 'srcset', 'alt', 'title', 'width', 'height'],\n  li: [],\n  ol: [],\n  p: [],\n  pre: [],\n  s: [],\n  small: [],\n  span: [],\n  sub: [],\n  sup: [],\n  strong: [],\n  u: [],\n  ul: []\n}\n// js-docs-end allow-list\n\nconst uriAttributes = new Set([\n  'background',\n  'cite',\n  'href',\n  'itemtype',\n  'longdesc',\n  'poster',\n  'src',\n  'xlink:href'\n])\n\n/**\n * A pattern that recognizes URLs that are safe wrt. XSS in URL navigation\n * contexts.\n *\n * Shout-out to Angular https://github.com/angular/angular/blob/15.2.8/packages/core/src/sanitization/url_sanitizer.ts#L38\n */\nconst SAFE_URL_PATTERN = /^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i\n\nconst allowedAttribute = (attribute, allowedAttributeList) => {\n  const attributeName = attribute.nodeName.toLowerCase()\n\n  if (allowedAttributeList.includes(attributeName)) {\n    if (uriAttributes.has(attributeName)) {\n      return Boolean(SAFE_URL_PATTERN.test(attribute.nodeValue))\n    }\n\n    return true\n  }\n\n  // Check if a regular expression validates the attribute.\n  return allowedAttributeList.filter(attributeRegex => attributeRegex instanceof RegExp)\n    .some(regex => regex.test(attributeName))\n}\n\nexport function sanitizeHtml(unsafeHtml, allowList, sanitizeFunction) {\n  if (!unsafeHtml.length) {\n    return unsafeHtml\n  }\n\n  if (sanitizeFunction && typeof sanitizeFunction === 'function') {\n    return sanitizeFunction(unsafeHtml)\n  }\n\n  const domParser = new window.DOMParser()\n  const createdDocument = domParser.parseFromString(unsafeHtml, 'text/html')\n  const elements = [].concat(...createdDocument.body.querySelectorAll('*'))\n\n  for (const element of elements) {\n    const elementName = element.nodeName.toLowerCase()\n\n    if (!Object.keys(allowList).includes(elementName)) {\n      element.remove()\n      continue\n    }\n\n    const attributeList = [].concat(...element.attributes)\n    const allowedAttributes = [].concat(allowList['*'] || [], allowList[elementName] || [])\n\n    for (const attribute of attributeList) {\n      if (!allowedAttribute(attribute, allowedAttributes)) {\n        element.removeAttribute(attribute.nodeName)\n      }\n    }\n  }\n\n  return createdDocument.body.innerHTML\n}\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap util/template-factory.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport SelectorEngine from '../dom/selector-engine.js'\nimport Config from './config.js'\nimport { DefaultAllowlist, sanitizeHtml } from './sanitizer.js'\nimport { execute, getElement, isElement } from './index.js'\n\n/**\n * Constants\n */\n\nconst NAME = 'TemplateFactory'\n\nconst Default = {\n  allowList: DefaultAllowlist,\n  content: {}, // { selector : text ,  selector2 : text2 , }\n  extraClass: '',\n  html: false,\n  sanitize: true,\n  sanitizeFn: null,\n  template: '<div></div>'\n}\n\nconst DefaultType = {\n  allowList: 'object',\n  content: 'object',\n  extraClass: '(string|function)',\n  html: 'boolean',\n  sanitize: 'boolean',\n  sanitizeFn: '(null|function)',\n  template: 'string'\n}\n\nconst DefaultContentType = {\n  entry: '(string|element|function|null)',\n  selector: '(string|element)'\n}\n\n/**\n * Class definition\n */\n\nclass TemplateFactory extends Config {\n  constructor(config) {\n    super()\n    this._config = this._getConfig(config)\n  }\n\n  // Getters\n  static get Default() {\n    return Default\n  }\n\n  static get DefaultType() {\n    return DefaultType\n  }\n\n  static get NAME() {\n    return NAME\n  }\n\n  // Public\n  getContent() {\n    return Object.values(this._config.content)\n      .map(config => this._resolvePossibleFunction(config))\n      .filter(Boolean)\n  }\n\n  hasContent() {\n    return this.getContent().length > 0\n  }\n\n  changeContent(content) {\n    this._checkContent(content)\n    this._config.content = { ...this._config.content, ...content }\n    return this\n  }\n\n  toHtml() {\n    const templateWrapper = document.createElement('div')\n    templateWrapper.innerHTML = this._maybeSanitize(this._config.template)\n\n    for (const [selector, text] of Object.entries(this._config.content)) {\n      this._setContent(templateWrapper, text, selector)\n    }\n\n    const template = templateWrapper.children[0]\n    const extraClass = this._resolvePossibleFunction(this._config.extraClass)\n\n    if (extraClass) {\n      template.classList.add(...extraClass.split(' '))\n    }\n\n    return template\n  }\n\n  // Private\n  _typeCheckConfig(config) {\n    super._typeCheckConfig(config)\n    this._checkContent(config.content)\n  }\n\n  _checkContent(arg) {\n    for (const [selector, content] of Object.entries(arg)) {\n      super._typeCheckConfig({ selector, entry: content }, DefaultContentType)\n    }\n  }\n\n  _setContent(template, content, selector) {\n    const templateElement = SelectorEngine.findOne(selector, template)\n\n    if (!templateElement) {\n      return\n    }\n\n    content = this._resolvePossibleFunction(content)\n\n    if (!content) {\n      templateElement.remove()\n      return\n    }\n\n    if (isElement(content)) {\n      this._putElementInTemplate(getElement(content), templateElement)\n      return\n    }\n\n    if (this._config.html) {\n      templateElement.innerHTML = this._maybeSanitize(content)\n      return\n    }\n\n    templateElement.textContent = content\n  }\n\n  _maybeSanitize(arg) {\n    return this._config.sanitize ? sanitizeHtml(arg, this._config.allowList, this._config.sanitizeFn) : arg\n  }\n\n  _resolvePossibleFunction(arg) {\n    return execute(arg, [undefined, this])\n  }\n\n  _putElementInTemplate(element, templateElement) {\n    if (this._config.html) {\n      templateElement.innerHTML = ''\n      templateElement.append(element)\n      return\n    }\n\n    templateElement.textContent = element.textContent\n  }\n}\n\nexport default TemplateFactory\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap tooltip.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport * as Popper from '@popperjs/core'\nimport BaseComponent from './base-component.js'\nimport EventHandler from './dom/event-handler.js'\nimport Manipulator from './dom/manipulator.js'\nimport {\n  defineJQueryPlugin, execute, findShadowRoot, getElement, getUID, isRTL, noop\n} from './util/index.js'\nimport { DefaultAllowlist } from './util/sanitizer.js'\nimport TemplateFactory from './util/template-factory.js'\n\n/**\n * Constants\n */\n\nconst NAME = 'tooltip'\nconst DISALLOWED_ATTRIBUTES = new Set(['sanitize', 'allowList', 'sanitizeFn'])\n\nconst CLASS_NAME_FADE = 'fade'\nconst CLASS_NAME_MODAL = 'modal'\nconst CLASS_NAME_SHOW = 'show'\n\nconst SELECTOR_TOOLTIP_INNER = '.tooltip-inner'\nconst SELECTOR_MODAL = `.${CLASS_NAME_MODAL}`\n\nconst EVENT_MODAL_HIDE = 'hide.bs.modal'\n\nconst TRIGGER_HOVER = 'hover'\nconst TRIGGER_FOCUS = 'focus'\nconst TRIGGER_CLICK = 'click'\nconst TRIGGER_MANUAL = 'manual'\n\nconst EVENT_HIDE = 'hide'\nconst EVENT_HIDDEN = 'hidden'\nconst EVENT_SHOW = 'show'\nconst EVENT_SHOWN = 'shown'\nconst EVENT_INSERTED = 'inserted'\nconst EVENT_CLICK = 'click'\nconst EVENT_FOCUSIN = 'focusin'\nconst EVENT_FOCUSOUT = 'focusout'\nconst EVENT_MOUSEENTER = 'mouseenter'\nconst EVENT_MOUSELEAVE = 'mouseleave'\n\nconst AttachmentMap = {\n  AUTO: 'auto',\n  TOP: 'top',\n  RIGHT: isRTL() ? 'left' : 'right',\n  BOTTOM: 'bottom',\n  LEFT: isRTL() ? 'right' : 'left'\n}\n\nconst Default = {\n  allowList: DefaultAllowlist,\n  animation: true,\n  boundary: 'clippingParents',\n  container: false,\n  customClass: '',\n  delay: 0,\n  fallbackPlacements: ['top', 'right', 'bottom', 'left'],\n  html: false,\n  offset: [0, 6],\n  placement: 'top',\n  popperConfig: null,\n  sanitize: true,\n  sanitizeFn: null,\n  selector: false,\n  template: '<div class=\"tooltip\" role=\"tooltip\">' +\n            '<div class=\"tooltip-arrow\"></div>' +\n            '<div class=\"tooltip-inner\"></div>' +\n            '</div>',\n  title: '',\n  trigger: 'hover focus'\n}\n\nconst DefaultType = {\n  allowList: 'object',\n  animation: 'boolean',\n  boundary: '(string|element)',\n  container: '(string|element|boolean)',\n  customClass: '(string|function)',\n  delay: '(number|object)',\n  fallbackPlacements: 'array',\n  html: 'boolean',\n  offset: '(array|string|function)',\n  placement: '(string|function)',\n  popperConfig: '(null|object|function)',\n  sanitize: 'boolean',\n  sanitizeFn: '(null|function)',\n  selector: '(string|boolean)',\n  template: 'string',\n  title: '(string|element|function)',\n  trigger: 'string'\n}\n\n/**\n * Class definition\n */\n\nclass Tooltip extends BaseComponent {\n  constructor(element, config) {\n    if (typeof Popper === 'undefined') {\n      throw new TypeError('Bootstrap\\'s tooltips require Popper (https://popper.js.org/docs/v2/)')\n    }\n\n    super(element, config)\n\n    // Private\n    this._isEnabled = true\n    this._timeout = 0\n    this._isHovered = null\n    this._activeTrigger = {}\n    this._popper = null\n    this._templateFactory = null\n    this._newContent = null\n\n    // Protected\n    this.tip = null\n\n    this._setListeners()\n\n    if (!this._config.selector) {\n      this._fixTitle()\n    }\n  }\n\n  // Getters\n  static get Default() {\n    return Default\n  }\n\n  static get DefaultType() {\n    return DefaultType\n  }\n\n  static get NAME() {\n    return NAME\n  }\n\n  // Public\n  enable() {\n    this._isEnabled = true\n  }\n\n  disable() {\n    this._isEnabled = false\n  }\n\n  toggleEnabled() {\n    this._isEnabled = !this._isEnabled\n  }\n\n  toggle() {\n    if (!this._isEnabled) {\n      return\n    }\n\n    if (this._isShown()) {\n      this._leave()\n      return\n    }\n\n    this._enter()\n  }\n\n  dispose() {\n    clearTimeout(this._timeout)\n\n    EventHandler.off(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE, this._hideModalHandler)\n\n    if (this._element.getAttribute('data-bs-original-title')) {\n      this._element.setAttribute('title', this._element.getAttribute('data-bs-original-title'))\n    }\n\n    this._disposePopper()\n    super.dispose()\n  }\n\n  show() {\n    if (this._element.style.display === 'none') {\n      throw new Error('Please use show on visible elements')\n    }\n\n    if (!(this._isWithContent() && this._isEnabled)) {\n      return\n    }\n\n    const showEvent = EventHandler.trigger(this._element, this.constructor.eventName(EVENT_SHOW))\n    const shadowRoot = findShadowRoot(this._element)\n    const isInTheDom = (shadowRoot || this._element.ownerDocument.documentElement).contains(this._element)\n\n    if (showEvent.defaultPrevented || !isInTheDom) {\n      return\n    }\n\n    // TODO: v6 remove this or make it optional\n    this._disposePopper()\n\n    const tip = this._getTipElement()\n\n    this._element.setAttribute('aria-describedby', tip.getAttribute('id'))\n\n    const { container } = this._config\n\n    if (!this._element.ownerDocument.documentElement.contains(this.tip)) {\n      container.append(tip)\n      EventHandler.trigger(this._element, this.constructor.eventName(EVENT_INSERTED))\n    }\n\n    this._popper = this._createPopper(tip)\n\n    tip.classList.add(CLASS_NAME_SHOW)\n\n    // If this is a touch-enabled device we add extra\n    // empty mouseover listeners to the body's immediate children;\n    // only needed because of broken event delegation on iOS\n    // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html\n    if ('ontouchstart' in document.documentElement) {\n      for (const element of [].concat(...document.body.children)) {\n        EventHandler.on(element, 'mouseover', noop)\n      }\n    }\n\n    const complete = () => {\n      EventHandler.trigger(this._element, this.constructor.eventName(EVENT_SHOWN))\n\n      if (this._isHovered === false) {\n        this._leave()\n      }\n\n      this._isHovered = false\n    }\n\n    this._queueCallback(complete, this.tip, this._isAnimated())\n  }\n\n  hide() {\n    if (!this._isShown()) {\n      return\n    }\n\n    const hideEvent = EventHandler.trigger(this._element, this.constructor.eventName(EVENT_HIDE))\n    if (hideEvent.defaultPrevented) {\n      return\n    }\n\n    const tip = this._getTipElement()\n    tip.classList.remove(CLASS_NAME_SHOW)\n\n    // If this is a touch-enabled device we remove the extra\n    // empty mouseover listeners we added for iOS support\n    if ('ontouchstart' in document.documentElement) {\n      for (const element of [].concat(...document.body.children)) {\n        EventHandler.off(element, 'mouseover', noop)\n      }\n    }\n\n    this._activeTrigger[TRIGGER_CLICK] = false\n    this._activeTrigger[TRIGGER_FOCUS] = false\n    this._activeTrigger[TRIGGER_HOVER] = false\n    this._isHovered = null // it is a trick to support manual triggering\n\n    const complete = () => {\n      if (this._isWithActiveTrigger()) {\n        return\n      }\n\n      if (!this._isHovered) {\n        this._disposePopper()\n      }\n\n      this._element.removeAttribute('aria-describedby')\n      EventHandler.trigger(this._element, this.constructor.eventName(EVENT_HIDDEN))\n    }\n\n    this._queueCallback(complete, this.tip, this._isAnimated())\n  }\n\n  update() {\n    if (this._popper) {\n      this._popper.update()\n    }\n  }\n\n  // Protected\n  _isWithContent() {\n    return Boolean(this._getTitle())\n  }\n\n  _getTipElement() {\n    if (!this.tip) {\n      this.tip = this._createTipElement(this._newContent || this._getContentForTemplate())\n    }\n\n    return this.tip\n  }\n\n  _createTipElement(content) {\n    const tip = this._getTemplateFactory(content).toHtml()\n\n    // TODO: remove this check in v6\n    if (!tip) {\n      return null\n    }\n\n    tip.classList.remove(CLASS_NAME_FADE, CLASS_NAME_SHOW)\n    // TODO: v6 the following can be achieved with CSS only\n    tip.classList.add(`bs-${this.constructor.NAME}-auto`)\n\n    const tipId = getUID(this.constructor.NAME).toString()\n\n    tip.setAttribute('id', tipId)\n\n    if (this._isAnimated()) {\n      tip.classList.add(CLASS_NAME_FADE)\n    }\n\n    return tip\n  }\n\n  setContent(content) {\n    this._newContent = content\n    if (this._isShown()) {\n      this._disposePopper()\n      this.show()\n    }\n  }\n\n  _getTemplateFactory(content) {\n    if (this._templateFactory) {\n      this._templateFactory.changeContent(content)\n    } else {\n      this._templateFactory = new TemplateFactory({\n        ...this._config,\n        // the `content` var has to be after `this._config`\n        // to override config.content in case of popover\n        content,\n        extraClass: this._resolvePossibleFunction(this._config.customClass)\n      })\n    }\n\n    return this._templateFactory\n  }\n\n  _getContentForTemplate() {\n    return {\n      [SELECTOR_TOOLTIP_INNER]: this._getTitle()\n    }\n  }\n\n  _getTitle() {\n    return this._resolvePossibleFunction(this._config.title) || this._element.getAttribute('data-bs-original-title')\n  }\n\n  // Private\n  _initializeOnDelegatedTarget(event) {\n    return this.constructor.getOrCreateInstance(event.delegateTarget, this._getDelegateConfig())\n  }\n\n  _isAnimated() {\n    return this._config.animation || (this.tip && this.tip.classList.contains(CLASS_NAME_FADE))\n  }\n\n  _isShown() {\n    return this.tip && this.tip.classList.contains(CLASS_NAME_SHOW)\n  }\n\n  _createPopper(tip) {\n    const placement = execute(this._config.placement, [this, tip, this._element])\n    const attachment = AttachmentMap[placement.toUpperCase()]\n    return Popper.createPopper(this._element, tip, this._getPopperConfig(attachment))\n  }\n\n  _getOffset() {\n    const { offset } = this._config\n\n    if (typeof offset === 'string') {\n      return offset.split(',').map(value => Number.parseInt(value, 10))\n    }\n\n    if (typeof offset === 'function') {\n      return popperData => offset(popperData, this._element)\n    }\n\n    return offset\n  }\n\n  _resolvePossibleFunction(arg) {\n    return execute(arg, [this._element, this._element])\n  }\n\n  _getPopperConfig(attachment) {\n    const defaultBsPopperConfig = {\n      placement: attachment,\n      modifiers: [\n        {\n          name: 'flip',\n          options: {\n            fallbackPlacements: this._config.fallbackPlacements\n          }\n        },\n        {\n          name: 'offset',\n          options: {\n            offset: this._getOffset()\n          }\n        },\n        {\n          name: 'preventOverflow',\n          options: {\n            boundary: this._config.boundary\n          }\n        },\n        {\n          name: 'arrow',\n          options: {\n            element: `.${this.constructor.NAME}-arrow`\n          }\n        },\n        {\n          name: 'preSetPlacement',\n          enabled: true,\n          phase: 'beforeMain',\n          fn: data => {\n            // Pre-set Popper's placement attribute in order to read the arrow sizes properly.\n            // Otherwise, Popper mixes up the width and height dimensions since the initial arrow style is for top placement\n            this._getTipElement().setAttribute('data-popper-placement', data.state.placement)\n          }\n        }\n      ]\n    }\n\n    return {\n      ...defaultBsPopperConfig,\n      ...execute(this._config.popperConfig, [undefined, defaultBsPopperConfig])\n    }\n  }\n\n  _setListeners() {\n    const triggers = this._config.trigger.split(' ')\n\n    for (const trigger of triggers) {\n      if (trigger === 'click') {\n        EventHandler.on(this._element, this.constructor.eventName(EVENT_CLICK), this._config.selector, event => {\n          const context = this._initializeOnDelegatedTarget(event)\n          context._activeTrigger[TRIGGER_CLICK] = !(context._isShown() && context._activeTrigger[TRIGGER_CLICK])\n          context.toggle()\n        })\n      } else if (trigger !== TRIGGER_MANUAL) {\n        const eventIn = trigger === TRIGGER_HOVER ?\n          this.constructor.eventName(EVENT_MOUSEENTER) :\n          this.constructor.eventName(EVENT_FOCUSIN)\n        const eventOut = trigger === TRIGGER_HOVER ?\n          this.constructor.eventName(EVENT_MOUSELEAVE) :\n          this.constructor.eventName(EVENT_FOCUSOUT)\n\n        EventHandler.on(this._element, eventIn, this._config.selector, event => {\n          const context = this._initializeOnDelegatedTarget(event)\n          context._activeTrigger[event.type === 'focusin' ? TRIGGER_FOCUS : TRIGGER_HOVER] = true\n          context._enter()\n        })\n        EventHandler.on(this._element, eventOut, this._config.selector, event => {\n          const context = this._initializeOnDelegatedTarget(event)\n          context._activeTrigger[event.type === 'focusout' ? TRIGGER_FOCUS : TRIGGER_HOVER] =\n            context._element.contains(event.relatedTarget)\n\n          context._leave()\n        })\n      }\n    }\n\n    this._hideModalHandler = () => {\n      if (this._element) {\n        this.hide()\n      }\n    }\n\n    EventHandler.on(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE, this._hideModalHandler)\n  }\n\n  _fixTitle() {\n    const title = this._element.getAttribute('title')\n\n    if (!title) {\n      return\n    }\n\n    if (!this._element.getAttribute('aria-label') && !this._element.textContent.trim()) {\n      this._element.setAttribute('aria-label', title)\n    }\n\n    this._element.setAttribute('data-bs-original-title', title) // DO NOT USE IT. Is only for backwards compatibility\n    this._element.removeAttribute('title')\n  }\n\n  _enter() {\n    if (this._isShown() || this._isHovered) {\n      this._isHovered = true\n      return\n    }\n\n    this._isHovered = true\n\n    this._setTimeout(() => {\n      if (this._isHovered) {\n        this.show()\n      }\n    }, this._config.delay.show)\n  }\n\n  _leave() {\n    if (this._isWithActiveTrigger()) {\n      return\n    }\n\n    this._isHovered = false\n\n    this._setTimeout(() => {\n      if (!this._isHovered) {\n        this.hide()\n      }\n    }, this._config.delay.hide)\n  }\n\n  _setTimeout(handler, timeout) {\n    clearTimeout(this._timeout)\n    this._timeout = setTimeout(handler, timeout)\n  }\n\n  _isWithActiveTrigger() {\n    return Object.values(this._activeTrigger).includes(true)\n  }\n\n  _getConfig(config) {\n    const dataAttributes = Manipulator.getDataAttributes(this._element)\n\n    for (const dataAttribute of Object.keys(dataAttributes)) {\n      if (DISALLOWED_ATTRIBUTES.has(dataAttribute)) {\n        delete dataAttributes[dataAttribute]\n      }\n    }\n\n    config = {\n      ...dataAttributes,\n      ...(typeof config === 'object' && config ? config : {})\n    }\n    config = this._mergeConfigObj(config)\n    config = this._configAfterMerge(config)\n    this._typeCheckConfig(config)\n    return config\n  }\n\n  _configAfterMerge(config) {\n    config.container = config.container === false ? document.body : getElement(config.container)\n\n    if (typeof config.delay === 'number') {\n      config.delay = {\n        show: config.delay,\n        hide: config.delay\n      }\n    }\n\n    if (typeof config.title === 'number') {\n      config.title = config.title.toString()\n    }\n\n    if (typeof config.content === 'number') {\n      config.content = config.content.toString()\n    }\n\n    return config\n  }\n\n  _getDelegateConfig() {\n    const config = {}\n\n    for (const [key, value] of Object.entries(this._config)) {\n      if (this.constructor.Default[key] !== value) {\n        config[key] = value\n      }\n    }\n\n    config.selector = false\n    config.trigger = 'manual'\n\n    // In the future can be replaced with:\n    // const keysWithDifferentValues = Object.entries(this._config).filter(entry => this.constructor.Default[entry[0]] !== this._config[entry[0]])\n    // `Object.fromEntries(keysWithDifferentValues)`\n    return config\n  }\n\n  _disposePopper() {\n    if (this._popper) {\n      this._popper.destroy()\n      this._popper = null\n    }\n\n    if (this.tip) {\n      this.tip.remove()\n      this.tip = null\n    }\n  }\n\n  // Static\n  static jQueryInterface(config) {\n    return this.each(function () {\n      const data = Tooltip.getOrCreateInstance(this, config)\n\n      if (typeof config !== 'string') {\n        return\n      }\n\n      if (typeof data[config] === 'undefined') {\n        throw new TypeError(`No method named \"${config}\"`)\n      }\n\n      data[config]()\n    })\n  }\n}\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Tooltip)\n\nexport default Tooltip\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap popover.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport Tooltip from './tooltip.js'\nimport { defineJQueryPlugin } from './util/index.js'\n\n/**\n * Constants\n */\n\nconst NAME = 'popover'\n\nconst SELECTOR_TITLE = '.popover-header'\nconst SELECTOR_CONTENT = '.popover-body'\n\nconst Default = {\n  ...Tooltip.Default,\n  content: '',\n  offset: [0, 8],\n  placement: 'right',\n  template: '<div class=\"popover\" role=\"tooltip\">' +\n    '<div class=\"popover-arrow\"></div>' +\n    '<h3 class=\"popover-header\"></h3>' +\n    '<div class=\"popover-body\"></div>' +\n    '</div>',\n  trigger: 'click'\n}\n\nconst DefaultType = {\n  ...Tooltip.DefaultType,\n  content: '(null|string|element|function)'\n}\n\n/**\n * Class definition\n */\n\nclass Popover extends Tooltip {\n  // Getters\n  static get Default() {\n    return Default\n  }\n\n  static get DefaultType() {\n    return DefaultType\n  }\n\n  static get NAME() {\n    return NAME\n  }\n\n  // Overrides\n  _isWithContent() {\n    return this._getTitle() || this._getContent()\n  }\n\n  // Private\n  _getContentForTemplate() {\n    return {\n      [SELECTOR_TITLE]: this._getTitle(),\n      [SELECTOR_CONTENT]: this._getContent()\n    }\n  }\n\n  _getContent() {\n    return this._resolvePossibleFunction(this._config.content)\n  }\n\n  // Static\n  static jQueryInterface(config) {\n    return this.each(function () {\n      const data = Popover.getOrCreateInstance(this, config)\n\n      if (typeof config !== 'string') {\n        return\n      }\n\n      if (typeof data[config] === 'undefined') {\n        throw new TypeError(`No method named \"${config}\"`)\n      }\n\n      data[config]()\n    })\n  }\n}\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Popover)\n\nexport default Popover\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap scrollspy.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport BaseComponent from './base-component.js'\nimport EventHandler from './dom/event-handler.js'\nimport SelectorEngine from './dom/selector-engine.js'\nimport {\n  defineJQueryPlugin, getElement, isDisabled, isVisible\n} from './util/index.js'\n\n/**\n * Constants\n */\n\nconst NAME = 'scrollspy'\nconst DATA_KEY = 'bs.scrollspy'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst DATA_API_KEY = '.data-api'\n\nconst EVENT_ACTIVATE = `activate${EVENT_KEY}`\nconst EVENT_CLICK = `click${EVENT_KEY}`\nconst EVENT_LOAD_DATA_API = `load${EVENT_KEY}${DATA_API_KEY}`\n\nconst CLASS_NAME_DROPDOWN_ITEM = 'dropdown-item'\nconst CLASS_NAME_ACTIVE = 'active'\n\nconst SELECTOR_DATA_SPY = '[data-bs-spy=\"scroll\"]'\nconst SELECTOR_TARGET_LINKS = '[href]'\nconst SELECTOR_NAV_LIST_GROUP = '.nav, .list-group'\nconst SELECTOR_NAV_LINKS = '.nav-link'\nconst SELECTOR_NAV_ITEMS = '.nav-item'\nconst SELECTOR_LIST_ITEMS = '.list-group-item'\nconst SELECTOR_LINK_ITEMS = `${SELECTOR_NAV_LINKS}, ${SELECTOR_NAV_ITEMS} > ${SELECTOR_NAV_LINKS}, ${SELECTOR_LIST_ITEMS}`\nconst SELECTOR_DROPDOWN = '.dropdown'\nconst SELECTOR_DROPDOWN_TOGGLE = '.dropdown-toggle'\n\nconst Default = {\n  offset: null, // TODO: v6 @deprecated, keep it for backwards compatibility reasons\n  rootMargin: '0px 0px -25%',\n  smoothScroll: false,\n  target: null,\n  threshold: [0.1, 0.5, 1]\n}\n\nconst DefaultType = {\n  offset: '(number|null)', // TODO v6 @deprecated, keep it for backwards compatibility reasons\n  rootMargin: 'string',\n  smoothScroll: 'boolean',\n  target: 'element',\n  threshold: 'array'\n}\n\n/**\n * Class definition\n */\n\nclass ScrollSpy extends BaseComponent {\n  constructor(element, config) {\n    super(element, config)\n\n    // this._element is the observablesContainer and config.target the menu links wrapper\n    this._targetLinks = new Map()\n    this._observableSections = new Map()\n    this._rootElement = getComputedStyle(this._element).overflowY === 'visible' ? null : this._element\n    this._activeTarget = null\n    this._observer = null\n    this._previousScrollData = {\n      visibleEntryTop: 0,\n      parentScrollTop: 0\n    }\n    this.refresh() // initialize\n  }\n\n  // Getters\n  static get Default() {\n    return Default\n  }\n\n  static get DefaultType() {\n    return DefaultType\n  }\n\n  static get NAME() {\n    return NAME\n  }\n\n  // Public\n  refresh() {\n    this._initializeTargetsAndObservables()\n    this._maybeEnableSmoothScroll()\n\n    if (this._observer) {\n      this._observer.disconnect()\n    } else {\n      this._observer = this._getNewObserver()\n    }\n\n    for (const section of this._observableSections.values()) {\n      this._observer.observe(section)\n    }\n  }\n\n  dispose() {\n    this._observer.disconnect()\n    super.dispose()\n  }\n\n  // Private\n  _configAfterMerge(config) {\n    // TODO: on v6 target should be given explicitly & remove the {target: 'ss-target'} case\n    config.target = getElement(config.target) || document.body\n\n    // TODO: v6 Only for backwards compatibility reasons. Use rootMargin only\n    config.rootMargin = config.offset ? `${config.offset}px 0px -30%` : config.rootMargin\n\n    if (typeof config.threshold === 'string') {\n      config.threshold = config.threshold.split(',').map(value => Number.parseFloat(value))\n    }\n\n    return config\n  }\n\n  _maybeEnableSmoothScroll() {\n    if (!this._config.smoothScroll) {\n      return\n    }\n\n    // unregister any previous listeners\n    EventHandler.off(this._config.target, EVENT_CLICK)\n\n    EventHandler.on(this._config.target, EVENT_CLICK, SELECTOR_TARGET_LINKS, event => {\n      const observableSection = this._observableSections.get(event.target.hash)\n      if (observableSection) {\n        event.preventDefault()\n        const root = this._rootElement || window\n        const height = observableSection.offsetTop - this._element.offsetTop\n        if (root.scrollTo) {\n          root.scrollTo({ top: height, behavior: 'smooth' })\n          return\n        }\n\n        // Chrome 60 doesn't support `scrollTo`\n        root.scrollTop = height\n      }\n    })\n  }\n\n  _getNewObserver() {\n    const options = {\n      root: this._rootElement,\n      threshold: this._config.threshold,\n      rootMargin: this._config.rootMargin\n    }\n\n    return new IntersectionObserver(entries => this._observerCallback(entries), options)\n  }\n\n  // The logic of selection\n  _observerCallback(entries) {\n    const targetElement = entry => this._targetLinks.get(`#${entry.target.id}`)\n    const activate = entry => {\n      this._previousScrollData.visibleEntryTop = entry.target.offsetTop\n      this._process(targetElement(entry))\n    }\n\n    const parentScrollTop = (this._rootElement || document.documentElement).scrollTop\n    const userScrollsDown = parentScrollTop >= this._previousScrollData.parentScrollTop\n    this._previousScrollData.parentScrollTop = parentScrollTop\n\n    for (const entry of entries) {\n      if (!entry.isIntersecting) {\n        this._activeTarget = null\n        this._clearActiveClass(targetElement(entry))\n\n        continue\n      }\n\n      const entryIsLowerThanPrevious = entry.target.offsetTop >= this._previousScrollData.visibleEntryTop\n      // if we are scrolling down, pick the bigger offsetTop\n      if (userScrollsDown && entryIsLowerThanPrevious) {\n        activate(entry)\n        // if parent isn't scrolled, let's keep the first visible item, breaking the iteration\n        if (!parentScrollTop) {\n          return\n        }\n\n        continue\n      }\n\n      // if we are scrolling up, pick the smallest offsetTop\n      if (!userScrollsDown && !entryIsLowerThanPrevious) {\n        activate(entry)\n      }\n    }\n  }\n\n  _initializeTargetsAndObservables() {\n    this._targetLinks = new Map()\n    this._observableSections = new Map()\n\n    const targetLinks = SelectorEngine.find(SELECTOR_TARGET_LINKS, this._config.target)\n\n    for (const anchor of targetLinks) {\n      // ensure that the anchor has an id and is not disabled\n      if (!anchor.hash || isDisabled(anchor)) {\n        continue\n      }\n\n      const observableSection = SelectorEngine.findOne(decodeURI(anchor.hash), this._element)\n\n      // ensure that the observableSection exists & is visible\n      if (isVisible(observableSection)) {\n        this._targetLinks.set(decodeURI(anchor.hash), anchor)\n        this._observableSections.set(anchor.hash, observableSection)\n      }\n    }\n  }\n\n  _process(target) {\n    if (this._activeTarget === target) {\n      return\n    }\n\n    this._clearActiveClass(this._config.target)\n    this._activeTarget = target\n    target.classList.add(CLASS_NAME_ACTIVE)\n    this._activateParents(target)\n\n    EventHandler.trigger(this._element, EVENT_ACTIVATE, { relatedTarget: target })\n  }\n\n  _activateParents(target) {\n    // Activate dropdown parents\n    if (target.classList.contains(CLASS_NAME_DROPDOWN_ITEM)) {\n      SelectorEngine.findOne(SELECTOR_DROPDOWN_TOGGLE, target.closest(SELECTOR_DROPDOWN))\n        .classList.add(CLASS_NAME_ACTIVE)\n      return\n    }\n\n    for (const listGroup of SelectorEngine.parents(target, SELECTOR_NAV_LIST_GROUP)) {\n      // Set triggered links parents as active\n      // With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor\n      for (const item of SelectorEngine.prev(listGroup, SELECTOR_LINK_ITEMS)) {\n        item.classList.add(CLASS_NAME_ACTIVE)\n      }\n    }\n  }\n\n  _clearActiveClass(parent) {\n    parent.classList.remove(CLASS_NAME_ACTIVE)\n\n    const activeNodes = SelectorEngine.find(`${SELECTOR_TARGET_LINKS}.${CLASS_NAME_ACTIVE}`, parent)\n    for (const node of activeNodes) {\n      node.classList.remove(CLASS_NAME_ACTIVE)\n    }\n  }\n\n  // Static\n  static jQueryInterface(config) {\n    return this.each(function () {\n      const data = ScrollSpy.getOrCreateInstance(this, config)\n\n      if (typeof config !== 'string') {\n        return\n      }\n\n      if (data[config] === undefined || config.startsWith('_') || config === 'constructor') {\n        throw new TypeError(`No method named \"${config}\"`)\n      }\n\n      data[config]()\n    })\n  }\n}\n\n/**\n * Data API implementation\n */\n\nEventHandler.on(window, EVENT_LOAD_DATA_API, () => {\n  for (const spy of SelectorEngine.find(SELECTOR_DATA_SPY)) {\n    ScrollSpy.getOrCreateInstance(spy)\n  }\n})\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(ScrollSpy)\n\nexport default ScrollSpy\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap tab.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport BaseComponent from './base-component.js'\nimport EventHandler from './dom/event-handler.js'\nimport SelectorEngine from './dom/selector-engine.js'\nimport { defineJQueryPlugin, getNextActiveElement, isDisabled } from './util/index.js'\n\n/**\n * Constants\n */\n\nconst NAME = 'tab'\nconst DATA_KEY = 'bs.tab'\nconst EVENT_KEY = `.${DATA_KEY}`\n\nconst EVENT_HIDE = `hide${EVENT_KEY}`\nconst EVENT_HIDDEN = `hidden${EVENT_KEY}`\nconst EVENT_SHOW = `show${EVENT_KEY}`\nconst EVENT_SHOWN = `shown${EVENT_KEY}`\nconst EVENT_CLICK_DATA_API = `click${EVENT_KEY}`\nconst EVENT_KEYDOWN = `keydown${EVENT_KEY}`\nconst EVENT_LOAD_DATA_API = `load${EVENT_KEY}`\n\nconst ARROW_LEFT_KEY = 'ArrowLeft'\nconst ARROW_RIGHT_KEY = 'ArrowRight'\nconst ARROW_UP_KEY = 'ArrowUp'\nconst ARROW_DOWN_KEY = 'ArrowDown'\nconst HOME_KEY = 'Home'\nconst END_KEY = 'End'\n\nconst CLASS_NAME_ACTIVE = 'active'\nconst CLASS_NAME_FADE = 'fade'\nconst CLASS_NAME_SHOW = 'show'\nconst CLASS_DROPDOWN = 'dropdown'\n\nconst SELECTOR_DROPDOWN_TOGGLE = '.dropdown-toggle'\nconst SELECTOR_DROPDOWN_MENU = '.dropdown-menu'\nconst NOT_SELECTOR_DROPDOWN_TOGGLE = `:not(${SELECTOR_DROPDOWN_TOGGLE})`\n\nconst SELECTOR_TAB_PANEL = '.list-group, .nav, [role=\"tablist\"]'\nconst SELECTOR_OUTER = '.nav-item, .list-group-item'\nconst SELECTOR_INNER = `.nav-link${NOT_SELECTOR_DROPDOWN_TOGGLE}, .list-group-item${NOT_SELECTOR_DROPDOWN_TOGGLE}, [role=\"tab\"]${NOT_SELECTOR_DROPDOWN_TOGGLE}`\nconst SELECTOR_DATA_TOGGLE = '[data-bs-toggle=\"tab\"], [data-bs-toggle=\"pill\"], [data-bs-toggle=\"list\"]' // TODO: could only be `tab` in v6\nconst SELECTOR_INNER_ELEM = `${SELECTOR_INNER}, ${SELECTOR_DATA_TOGGLE}`\n\nconst SELECTOR_DATA_TOGGLE_ACTIVE = `.${CLASS_NAME_ACTIVE}[data-bs-toggle=\"tab\"], .${CLASS_NAME_ACTIVE}[data-bs-toggle=\"pill\"], .${CLASS_NAME_ACTIVE}[data-bs-toggle=\"list\"]`\n\n/**\n * Class definition\n */\n\nclass Tab extends BaseComponent {\n  constructor(element) {\n    super(element)\n    this._parent = this._element.closest(SELECTOR_TAB_PANEL)\n\n    if (!this._parent) {\n      return\n      // TODO: should throw exception in v6\n      // throw new TypeError(`${element.outerHTML} has not a valid parent ${SELECTOR_INNER_ELEM}`)\n    }\n\n    // Set up initial aria attributes\n    this._setInitialAttributes(this._parent, this._getChildren())\n\n    EventHandler.on(this._element, EVENT_KEYDOWN, event => this._keydown(event))\n  }\n\n  // Getters\n  static get NAME() {\n    return NAME\n  }\n\n  // Public\n  show() { // Shows this elem and deactivate the active sibling if exists\n    const innerElem = this._element\n    if (this._elemIsActive(innerElem)) {\n      return\n    }\n\n    // Search for active tab on same parent to deactivate it\n    const active = this._getActiveElem()\n\n    const hideEvent = active ?\n      EventHandler.trigger(active, EVENT_HIDE, { relatedTarget: innerElem }) :\n      null\n\n    const showEvent = EventHandler.trigger(innerElem, EVENT_SHOW, { relatedTarget: active })\n\n    if (showEvent.defaultPrevented || (hideEvent && hideEvent.defaultPrevented)) {\n      return\n    }\n\n    this._deactivate(active, innerElem)\n    this._activate(innerElem, active)\n  }\n\n  // Private\n  _activate(element, relatedElem) {\n    if (!element) {\n      return\n    }\n\n    element.classList.add(CLASS_NAME_ACTIVE)\n\n    this._activate(SelectorEngine.getElementFromSelector(element)) // Search and activate/show the proper section\n\n    const complete = () => {\n      if (element.getAttribute('role') !== 'tab') {\n        element.classList.add(CLASS_NAME_SHOW)\n        return\n      }\n\n      element.removeAttribute('tabindex')\n      element.setAttribute('aria-selected', true)\n      this._toggleDropDown(element, true)\n      EventHandler.trigger(element, EVENT_SHOWN, {\n        relatedTarget: relatedElem\n      })\n    }\n\n    this._queueCallback(complete, element, element.classList.contains(CLASS_NAME_FADE))\n  }\n\n  _deactivate(element, relatedElem) {\n    if (!element) {\n      return\n    }\n\n    element.classList.remove(CLASS_NAME_ACTIVE)\n    element.blur()\n\n    this._deactivate(SelectorEngine.getElementFromSelector(element)) // Search and deactivate the shown section too\n\n    const complete = () => {\n      if (element.getAttribute('role') !== 'tab') {\n        element.classList.remove(CLASS_NAME_SHOW)\n        return\n      }\n\n      element.setAttribute('aria-selected', false)\n      element.setAttribute('tabindex', '-1')\n      this._toggleDropDown(element, false)\n      EventHandler.trigger(element, EVENT_HIDDEN, { relatedTarget: relatedElem })\n    }\n\n    this._queueCallback(complete, element, element.classList.contains(CLASS_NAME_FADE))\n  }\n\n  _keydown(event) {\n    if (!([ARROW_LEFT_KEY, ARROW_RIGHT_KEY, ARROW_UP_KEY, ARROW_DOWN_KEY, HOME_KEY, END_KEY].includes(event.key))) {\n      return\n    }\n\n    event.stopPropagation()// stopPropagation/preventDefault both added to support up/down keys without scrolling the page\n    event.preventDefault()\n\n    const children = this._getChildren().filter(element => !isDisabled(element))\n    let nextActiveElement\n\n    if ([HOME_KEY, END_KEY].includes(event.key)) {\n      nextActiveElement = children[event.key === HOME_KEY ? 0 : children.length - 1]\n    } else {\n      const isNext = [ARROW_RIGHT_KEY, ARROW_DOWN_KEY].includes(event.key)\n      nextActiveElement = getNextActiveElement(children, event.target, isNext, true)\n    }\n\n    if (nextActiveElement) {\n      nextActiveElement.focus({ preventScroll: true })\n      Tab.getOrCreateInstance(nextActiveElement).show()\n    }\n  }\n\n  _getChildren() { // collection of inner elements\n    return SelectorEngine.find(SELECTOR_INNER_ELEM, this._parent)\n  }\n\n  _getActiveElem() {\n    return this._getChildren().find(child => this._elemIsActive(child)) || null\n  }\n\n  _setInitialAttributes(parent, children) {\n    this._setAttributeIfNotExists(parent, 'role', 'tablist')\n\n    for (const child of children) {\n      this._setInitialAttributesOnChild(child)\n    }\n  }\n\n  _setInitialAttributesOnChild(child) {\n    child = this._getInnerElement(child)\n    const isActive = this._elemIsActive(child)\n    const outerElem = this._getOuterElement(child)\n    child.setAttribute('aria-selected', isActive)\n\n    if (outerElem !== child) {\n      this._setAttributeIfNotExists(outerElem, 'role', 'presentation')\n    }\n\n    if (!isActive) {\n      child.setAttribute('tabindex', '-1')\n    }\n\n    this._setAttributeIfNotExists(child, 'role', 'tab')\n\n    // set attributes to the related panel too\n    this._setInitialAttributesOnTargetPanel(child)\n  }\n\n  _setInitialAttributesOnTargetPanel(child) {\n    const target = SelectorEngine.getElementFromSelector(child)\n\n    if (!target) {\n      return\n    }\n\n    this._setAttributeIfNotExists(target, 'role', 'tabpanel')\n\n    if (child.id) {\n      this._setAttributeIfNotExists(target, 'aria-labelledby', `${child.id}`)\n    }\n  }\n\n  _toggleDropDown(element, open) {\n    const outerElem = this._getOuterElement(element)\n    if (!outerElem.classList.contains(CLASS_DROPDOWN)) {\n      return\n    }\n\n    const toggle = (selector, className) => {\n      const element = SelectorEngine.findOne(selector, outerElem)\n      if (element) {\n        element.classList.toggle(className, open)\n      }\n    }\n\n    toggle(SELECTOR_DROPDOWN_TOGGLE, CLASS_NAME_ACTIVE)\n    toggle(SELECTOR_DROPDOWN_MENU, CLASS_NAME_SHOW)\n    outerElem.setAttribute('aria-expanded', open)\n  }\n\n  _setAttributeIfNotExists(element, attribute, value) {\n    if (!element.hasAttribute(attribute)) {\n      element.setAttribute(attribute, value)\n    }\n  }\n\n  _elemIsActive(elem) {\n    return elem.classList.contains(CLASS_NAME_ACTIVE)\n  }\n\n  // Try to get the inner element (usually the .nav-link)\n  _getInnerElement(elem) {\n    return elem.matches(SELECTOR_INNER_ELEM) ? elem : SelectorEngine.findOne(SELECTOR_INNER_ELEM, elem)\n  }\n\n  // Try to get the outer element (usually the .nav-item)\n  _getOuterElement(elem) {\n    return elem.closest(SELECTOR_OUTER) || elem\n  }\n\n  // Static\n  static jQueryInterface(config) {\n    return this.each(function () {\n      const data = Tab.getOrCreateInstance(this)\n\n      if (typeof config !== 'string') {\n        return\n      }\n\n      if (data[config] === undefined || config.startsWith('_') || config === 'constructor') {\n        throw new TypeError(`No method named \"${config}\"`)\n      }\n\n      data[config]()\n    })\n  }\n}\n\n/**\n * Data API implementation\n */\n\nEventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {\n  if (['A', 'AREA'].includes(this.tagName)) {\n    event.preventDefault()\n  }\n\n  if (isDisabled(this)) {\n    return\n  }\n\n  Tab.getOrCreateInstance(this).show()\n})\n\n/**\n * Initialize on focus\n */\nEventHandler.on(window, EVENT_LOAD_DATA_API, () => {\n  for (const element of SelectorEngine.find(SELECTOR_DATA_TOGGLE_ACTIVE)) {\n    Tab.getOrCreateInstance(element)\n  }\n})\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Tab)\n\nexport default Tab\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap toast.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport BaseComponent from './base-component.js'\nimport EventHandler from './dom/event-handler.js'\nimport { enableDismissTrigger } from './util/component-functions.js'\nimport { defineJQueryPlugin, reflow } from './util/index.js'\n\n/**\n * Constants\n */\n\nconst NAME = 'toast'\nconst DATA_KEY = 'bs.toast'\nconst EVENT_KEY = `.${DATA_KEY}`\n\nconst EVENT_MOUSEOVER = `mouseover${EVENT_KEY}`\nconst EVENT_MOUSEOUT = `mouseout${EVENT_KEY}`\nconst EVENT_FOCUSIN = `focusin${EVENT_KEY}`\nconst EVENT_FOCUSOUT = `focusout${EVENT_KEY}`\nconst EVENT_HIDE = `hide${EVENT_KEY}`\nconst EVENT_HIDDEN = `hidden${EVENT_KEY}`\nconst EVENT_SHOW = `show${EVENT_KEY}`\nconst EVENT_SHOWN = `shown${EVENT_KEY}`\n\nconst CLASS_NAME_FADE = 'fade'\nconst CLASS_NAME_HIDE = 'hide' // @deprecated - kept here only for backwards compatibility\nconst CLASS_NAME_SHOW = 'show'\nconst CLASS_NAME_SHOWING = 'showing'\n\nconst DefaultType = {\n  animation: 'boolean',\n  autohide: 'boolean',\n  delay: 'number'\n}\n\nconst Default = {\n  animation: true,\n  autohide: true,\n  delay: 5000\n}\n\n/**\n * Class definition\n */\n\nclass Toast extends BaseComponent {\n  constructor(element, config) {\n    super(element, config)\n\n    this._timeout = null\n    this._hasMouseInteraction = false\n    this._hasKeyboardInteraction = false\n    this._setListeners()\n  }\n\n  // Getters\n  static get Default() {\n    return Default\n  }\n\n  static get DefaultType() {\n    return DefaultType\n  }\n\n  static get NAME() {\n    return NAME\n  }\n\n  // Public\n  show() {\n    const showEvent = EventHandler.trigger(this._element, EVENT_SHOW)\n\n    if (showEvent.defaultPrevented) {\n      return\n    }\n\n    this._clearTimeout()\n\n    if (this._config.animation) {\n      this._element.classList.add(CLASS_NAME_FADE)\n    }\n\n    const complete = () => {\n      this._element.classList.remove(CLASS_NAME_SHOWING)\n      EventHandler.trigger(this._element, EVENT_SHOWN)\n\n      this._maybeScheduleHide()\n    }\n\n    this._element.classList.remove(CLASS_NAME_HIDE) // @deprecated\n    reflow(this._element)\n    this._element.classList.add(CLASS_NAME_SHOW, CLASS_NAME_SHOWING)\n\n    this._queueCallback(complete, this._element, this._config.animation)\n  }\n\n  hide() {\n    if (!this.isShown()) {\n      return\n    }\n\n    const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE)\n\n    if (hideEvent.defaultPrevented) {\n      return\n    }\n\n    const complete = () => {\n      this._element.classList.add(CLASS_NAME_HIDE) // @deprecated\n      this._element.classList.remove(CLASS_NAME_SHOWING, CLASS_NAME_SHOW)\n      EventHandler.trigger(this._element, EVENT_HIDDEN)\n    }\n\n    this._element.classList.add(CLASS_NAME_SHOWING)\n    this._queueCallback(complete, this._element, this._config.animation)\n  }\n\n  dispose() {\n    this._clearTimeout()\n\n    if (this.isShown()) {\n      this._element.classList.remove(CLASS_NAME_SHOW)\n    }\n\n    super.dispose()\n  }\n\n  isShown() {\n    return this._element.classList.contains(CLASS_NAME_SHOW)\n  }\n\n  // Private\n  _maybeScheduleHide() {\n    if (!this._config.autohide) {\n      return\n    }\n\n    if (this._hasMouseInteraction || this._hasKeyboardInteraction) {\n      return\n    }\n\n    this._timeout = setTimeout(() => {\n      this.hide()\n    }, this._config.delay)\n  }\n\n  _onInteraction(event, isInteracting) {\n    switch (event.type) {\n      case 'mouseover':\n      case 'mouseout': {\n        this._hasMouseInteraction = isInteracting\n        break\n      }\n\n      case 'focusin':\n      case 'focusout': {\n        this._hasKeyboardInteraction = isInteracting\n        break\n      }\n\n      default: {\n        break\n      }\n    }\n\n    if (isInteracting) {\n      this._clearTimeout()\n      return\n    }\n\n    const nextElement = event.relatedTarget\n    if (this._element === nextElement || this._element.contains(nextElement)) {\n      return\n    }\n\n    this._maybeScheduleHide()\n  }\n\n  _setListeners() {\n    EventHandler.on(this._element, EVENT_MOUSEOVER, event => this._onInteraction(event, true))\n    EventHandler.on(this._element, EVENT_MOUSEOUT, event => this._onInteraction(event, false))\n    EventHandler.on(this._element, EVENT_FOCUSIN, event => this._onInteraction(event, true))\n    EventHandler.on(this._element, EVENT_FOCUSOUT, event => this._onInteraction(event, false))\n  }\n\n  _clearTimeout() {\n    clearTimeout(this._timeout)\n    this._timeout = null\n  }\n\n  // Static\n  static jQueryInterface(config) {\n    return this.each(function () {\n      const data = Toast.getOrCreateInstance(this, config)\n\n      if (typeof config === 'string') {\n        if (typeof data[config] === 'undefined') {\n          throw new TypeError(`No method named \"${config}\"`)\n        }\n\n        data[config](this)\n      }\n    })\n  }\n}\n\n/**\n * Data API implementation\n */\n\nenableDismissTrigger(Toast)\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Toast)\n\nexport default Toast\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap index.umd.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport Alert from './src/alert.js'\nimport Button from './src/button.js'\nimport Carousel from './src/carousel.js'\nimport Collapse from './src/collapse.js'\nimport Dropdown from './src/dropdown.js'\nimport Modal from './src/modal.js'\nimport Offcanvas from './src/offcanvas.js'\nimport Popover from './src/popover.js'\nimport ScrollSpy from './src/scrollspy.js'\nimport Tab from './src/tab.js'\nimport Toast from './src/toast.js'\nimport Tooltip from './src/tooltip.js'\n\nexport default {\n  Alert,\n  Button,\n  Carousel,\n  Collapse,\n  Dropdown,\n  Modal,\n  Offcanvas,\n  Popover,\n  ScrollSpy,\n  Tab,\n  Toast,\n  Tooltip\n}\n", "// Aggiorna lo stato del campo layer del catasto in base al dataset selezionato.\nconst aggiornaCampiCatastoMappe = () => {\n  const dataset = document.querySelector(\"[data-mappe-catasto-dataset]\");\n  const layer = document.querySelector(\"[data-mappe-catasto-layer]\");\n\n  if (!dataset || !layer) return;\n\n  const terreni = dataset.value === \"terreni\";\n  layer.disabled = !terreni;\n  layer.required = terreni;\n\n  if (!terreni) layer.value = \"\";\n};\n\nconst MAPPE_CACHE_SIZE = 24;\nconst MAPPE_FALLBACK_CENTER = [42.5, 12.5];\nconst MAPPE_FALLBACK_ZOOM = 6;\nconst MAPPE_SUBALTERNI_PER_PAGINA_RADIALE = 8;\nconst MAPPE_SCHEDE_PER_PAGINA_RADIALE = 4;\nconst MAPPE_VECTOR_LAYER_CONFIGS = {\n  terreni_acque: {\n    sourceId: \"mappe-terreni-acque-source\",\n    fillLayerId: \"mappe-terreni-acque-fill\",\n    lineLayerId: \"mappe-terreni-acque-line\",\n    sourceLayer: \"terreni_acque\",\n    dataset: \"terreni\",\n    layer: \"acque\",\n    minzoom: 12,\n    maxzoom: 19,\n  },\n  terreni_particelle: {\n    sourceId: \"mappe-terreni-particelle-source\",\n    fillLayerId: \"mappe-terreni-particelle-fill\",\n    lineLayerId: \"mappe-terreni-particelle-line\",\n    sourceLayer: \"terreni_particelle\",\n    dataset: \"terreni\",\n    layer: \"particelle\",\n    minzoom: 12,\n    maxzoom: 19,\n  },\n  terreni_strade: {\n    sourceId: \"mappe-terreni-strade-source\",\n    fillLayerId: \"mappe-terreni-strade-fill\",\n    lineLayerId: \"mappe-terreni-strade-line\",\n    sourceLayer: \"terreni_strade\",\n    dataset: \"terreni\",\n    layer: \"strade\",\n    minzoom: 12,\n    maxzoom: 19,\n  },\n  fabbricati: {\n    sourceId: \"mappe-fabbricati-source\",\n    fillLayerId: \"mappe-fabbricati-fill\",\n    lineLayerId: \"mappe-fabbricati-line\",\n    sourceLayer: \"fabbricati\",\n    dataset: \"fabbricati\",\n    layer: \"\",\n    minzoom: 12,\n    maxzoom: 19,\n  },\n  schede: {\n    sourceId: \"mappe-schede-source\",\n    fillLayerId: \"mappe-schede-fill\",\n    lineLayerId: \"mappe-schede-line\",\n    sourceLayer: null,\n    dataset: \"schede\",\n    layer: \"\",\n    minzoom: 12,\n    maxzoom: 19,\n    geojson: true,\n  },\n};\nconst MAPPE_VECTOR_LAYER_ORDER = [\"terreni_acque\", \"terreni_particelle\", \"terreni_strade\", \"fabbricati\", \"schede\"];\nconst MAPPE_BASELAYER_SOURCE_IDS = {\n  chiara: \"mappe-baselayer-chiara-source\",\n  satellitare: \"mappe-baselayer-satellitare-source\",\n};\nconst MAPPE_BASELAYER_LAYER_IDS = {\n  chiara: \"mappe-baselayer-chiara-layer\",\n  satellitare: \"mappe-baselayer-satellitare-layer\",\n};\nconst MAPPE_FABBRICATI_LABEL_SOURCE_ID = \"mappe-fabbricati-etichette-source\";\nconst MAPPE_FABBRICATI_LABEL_LAYER_ID = \"mappe-fabbricati-etichette-layer\";\nconst MAPPE_SELECTION_FILL_SUFFIX = \"-selection-fill\";\nconst MAPPE_SELECTION_LINE_SUFFIX = \"-selection-line\";\nconst MAPPE_LAYER_COLORI = {\n  fabbricati: { fill: \"#d98b82\", hoverFill: \"#cc7267\", textFill: \"#4a1f1a\", line: \"#9f2d20\", fillOpacity: 0.48 },\n  terreni: {\n    acque: { fill: \"#ffffff\", hoverFill: \"#f3f4f6\", textFill: \"#111827\", line: \"#9ca3af\", fillOpacity: 0.45 },\n    particelle: { fill: \"#ffffff\", hoverFill: \"#f3f4f6\", textFill: \"#111827\", line: \"#b6bec9\", fillOpacity: 0.25 },\n    strade: { fill: \"#ffffff\", hoverFill: \"#f3f4f6\", textFill: \"#111827\", line: \"#aab3bf\", fillOpacity: 0.3 },\n  },\n  controlli: { fill: \"#b7d2ea\", hoverFill: \"#9fc1df\", textFill: \"#183a59\", line: \"#7aa8cf\", fillOpacity: 0.75 },\n  vuoto: { fill: \"#eef1f4\", hoverFill: \"#eef1f4\", textFill: \"#6c757d\", line: \"#ffffff\", fillOpacity: 0.74 },\n};\nconst MAPPE_STATI_SCHEDE_COLORI = {\n  vincolata: { fill: \"#8ecae6\", hoverFill: \"#6fb6d8\", textFill: \"#123449\", line: \"#3b82a0\" },\n  liberalizzata: { fill: \"#9bd3ae\", hoverFill: \"#7fc796\", textFill: \"#173b24\", line: \"#4f9a65\" },\n  bloccata: { fill: \"#f1d98a\", hoverFill: \"#e6ca69\", textFill: \"#4a3710\", line: \"#b7952e\" },\n};\nlet nodoMappeInizializzato = null;\n\n// Aggiorna gli attributi interni selezionabili per i vincoli in base al dataset scelto.\nconst aggiornaAttributiVincoliMappe = () => {\n  const dataset = document.querySelector(\"[data-mappe-vincoli-dataset]\");\n  const attributo = document.querySelector(\"[data-mappe-vincoli-attributo]\");\n\n  if (!dataset || !attributo) return;\n\n  const optionsKey = dataset.value === \"gruppi\" ? \"gruppiOptions\" : \"compartiOptions\";\n  const options = JSON.parse(attributo.dataset[optionsKey] || \"[]\");\n\n  attributo.innerHTML = \"\";\n  options.forEach(([label, value]) => {\n    const option = document.createElement(\"option\");\n    option.value = value;\n    option.textContent = label;\n    attributo.appendChild(option);\n    });\n};\n\n// Aggiorna la riga di una importazione leggendo lo stato corrente dal controller JSON.\nconst aggiornaRigaImportazioneMappe = async (row) => {\n  const url = row.dataset.mappeImportazioneStatoUrl;\n  if (!url) return false;\n\n  const response = await fetch(url, {\n    headers: { Accept: \"application/json\" },\n    credentials: \"same-origin\",\n  });\n  if (!response.ok) return false;\n\n  const payload = await response.json();\n  const statoNode = row.querySelector(\"[data-mappe-importazione-stato]\");\n  const scartiNode = row.querySelector(\"[data-mappe-importazione-scarti]\");\n  const recordNode = row.querySelector(\"[data-mappe-importazione-record]\");\n\n  if (statoNode) statoNode.textContent = payload.messaggio || payload.stato;\n  if (scartiNode) scartiNode.textContent = payload.scarti;\n  if (recordNode) recordNode.textContent = payload.numero_record || \"-\";\n\n  return [\"queued\", \"running\"].includes(payload.stato);\n};\n\n// Restituisce la lista dei checkbox layer selezionabili presenti nella schermata mappa.\nconst checkboxLayerMappa = () => Array.from(document.querySelectorAll(\"[data-mappe-layer-key]\"));\n\n// Restituisce il dizionario dei tileset pubblicati reso disponibile dalla view per il viewer MapLibre.\nconst tilesetsMappe = () => {\n  const scriptNode = document.querySelector(\"#mappe-tilesets-data\");\n  const rawJsonTilesets = scriptNode?.textContent?.trim();\n  if (!rawJsonTilesets) return {};\n\n  try {\n    return JSON.parse(rawJsonTilesets) || {};\n  } catch (_error) {\n    return {};\n  }\n};\n\n// Indica se la schermata corrente ha gia' a disposizione almeno un tileset pubblicato e quindi deve usare il viewer MapLibre al posto del vecchio viewer GeoJSON Leaflet.\nconst viewerMaplibreAttivoMappe = () => {\n  return Object.keys(tilesetsMappe()).length > 0 && Boolean(window.maplibregl);\n};\n\n// Normalizza il template URL delle tile locali sull'origin corrente del browser evitando parser URL che encoderebbero i placeholder {z}/{x}/{y}.\nconst normalizzaUrlTilesetMappe = (url) => {\n  if (!url) return \"\";\n\n  if (url.startsWith(\"/mappe/tiles/\")) return `${window.location.origin}${url}`;\n\n  const matchLocale = url.match(/^https?:\\/\\/[^/]+(\\/mappe\\/tiles\\/.+)$/);\n  if (matchLocale) return `${window.location.origin}${matchLocale[1]}`;\n\n  return url;\n};\n\n// Restituisce il template URL del tileset pubblicato per il layer richiesto.\nconst urlTilesetLayerMappe = (layerKey) => {\n  const url = tilesetsMappe()?.[layerKey]?.url_template;\n  if (url) return normalizzaUrlTilesetMappe(url);\n\n  const wrapper = document.querySelector(\"#mappe-mappa\");\n  if (layerKey === \"terreni_particelle\") return normalizzaUrlTilesetMappe(wrapper?.dataset.mappeTilesetParticelleUrl || \"\");\n\n  return \"\";\n};\n\n// Restituisce la chiave cache del layer in base a dataset, layer, bbox e zoom correnti.\nconst cacheKeyLayerMappe = (layerConfig, viewportKey) => `${layerConfig.key}:${schedaFocusMappe() || \"all\"}:${viewportKey}`;\n\n// Restituisce l'id della scheda da isolare in mappa quando si arriva dal dettaglio scheda.\nconst schedaFocusMappe = () => {\n  const wrapper = document.querySelector(\"#mappe-mappa\");\n  return wrapper?.dataset.mappeFocusSchedaId || \"\";\n};\n\n// Mostra o nasconde il piccolo indicatore di aggiornamento dei layer senza oscurare la mappa.\nconst mostraIndicatoreLayerMappe = (visible) => {\n  const indicator = document.querySelector(\"[data-mappe-layer-loading]\");\n  if (!indicator) return;\n\n  indicator.classList.toggle(\"d-none\", !visible);\n};\n\n// Restituisce il payload layer dalla cache client quando il bbox e lo zoom coincidono con una richiesta gia' eseguita.\nconst leggiCacheLayerMappe = (layerConfig, viewportKey) => {\n  const cacheKey = cacheKeyLayerMappe(layerConfig, viewportKey);\n  return window.elinkMappePayloadCache?.[cacheKey] || null;\n};\n\n// Salva in cache il payload layer corrente mantenendo una dimensione massima controllata per il browser.\nconst scriviCacheLayerMappe = (layerConfig, viewportKey, payload) => {\n  const cacheKey = cacheKeyLayerMappe(layerConfig, viewportKey);\n  window.elinkMappePayloadCache = window.elinkMappePayloadCache || {};\n  window.elinkMappePayloadCacheOrder = window.elinkMappePayloadCacheOrder || [];\n\n  if (!window.elinkMappePayloadCache[cacheKey]) window.elinkMappePayloadCacheOrder.push(cacheKey);\n  window.elinkMappePayloadCache[cacheKey] = payload;\n\n  while (window.elinkMappePayloadCacheOrder.length > MAPPE_CACHE_SIZE) {\n    const oldestKey = window.elinkMappePayloadCacheOrder.shift();\n    delete window.elinkMappePayloadCache[oldestKey];\n  }\n};\n\n// Restituisce la lista dei layer attualmente selezionati dall'utente nel pannello mappa.\nconst layerSelezionatiMappa = () => checkboxLayerMappa()\n  .filter((node) => node.checked)\n  .map((node) => ({\n    key: node.dataset.mappeLayerKey,\n    dataset: node.dataset.mappeLayerDataset,\n    layer: node.dataset.mappeLayerValue || \"\",\n    label: node.parentElement?.textContent?.trim() || node.dataset.mappeLayerKey,\n  }));\n\n// Restituisce il testo segnaposto della ricerca in base ai layer attualmente selezionati.\nconst placeholderRicercaMappe = (layers) => {\n  const hasSchede = layers.some((layer) => layer.dataset === \"schede\");\n  const hasCatasto = layers.some((layer) => [\"fabbricati\", \"terreni\"].includes(layer.dataset));\n\n  if (hasSchede && hasCatasto) return \"Cerca foglio-mappale o nominativo scheda\";\n  if (hasSchede) return \"Cerca nominativo scheda o foglio-mappale\";\n  if (hasCatasto) return \"Cerca foglio-mappale\";\n  return \"Seleziona un layer per cercare\";\n};\n\n// Aggiorna abilitazione, placeholder e risultati della barra di ricerca quando cambiano i layer aperti.\nconst aggiornaStatoRicercaMappe = () => {\n  const input = document.querySelector(\"[data-mappe-search-input]\");\n  const results = document.querySelector(\"[data-mappe-search-results]\");\n  if (!input) return;\n\n  const layers = layerSelezionatiMappa();\n  input.disabled = layers.length === 0;\n  input.placeholder = placeholderRicercaMappe(layers);\n\n  if (results) {\n    results.innerHTML = \"\";\n    results.classList.add(\"d-none\");\n  }\n\n  if (layers.length === 0) {\n    input.value = \"\";\n  }\n};\n\n// Converte un risultato di ricerca nel markup compatto mostrato sotto la barra.\nconst costruisciRigaRisultatoRicercaMappe = (result) => {\n  const button = document.createElement(\"button\");\n  button.type = \"button\";\n  button.className = \"btn btn-sm w-100 text-start rounded-0 border-0 px-3 py-2\";\n  button.dataset.mappeSearchResult = \"true\";\n  button.innerHTML = `\n    <span class=\"d-block fw-semibold text-dark\">${escapeHtmlMappe(result.label || \"-\")}</span>\n    <span class=\"d-block text-600 fs--2\">${escapeHtmlMappe(result.subtitle || \"\")}</span>\n  `;\n  button.addEventListener(\"click\", (event) => {\n    event.preventDefault();\n    event.stopPropagation();\n    apriRisultatoRicercaMappe(result);\n  });\n  return button;\n};\n\n// Mostra nella tendina della ricerca i risultati restituiti dal backend o un messaggio sintetico.\nconst mostraRisultatiRicercaMappe = (results, message = \"\") => {\n  const container = document.querySelector(\"[data-mappe-search-results]\");\n  if (!container) return;\n\n  container.innerHTML = \"\";\n  if (message) {\n    container.innerHTML = `<div class=\"px-3 py-2 fs--1 text-600\">${escapeHtmlMappe(message)}</div>`;\n    container.classList.remove(\"d-none\");\n    return;\n  }\n\n  if (!results.length) {\n    container.innerHTML = '<div class=\"px-3 py-2 fs--1 text-600\">Nessun risultato</div>';\n    container.classList.remove(\"d-none\");\n    return;\n  }\n\n  results.forEach((result) => container.appendChild(costruisciRigaRisultatoRicercaMappe(result)));\n  container.classList.remove(\"d-none\");\n};\n\n// Esegue la ricerca backend sui layer aperti, scartando richieste troppo brevi o prive di layer selezionati.\nconst eseguiRicercaLayerMappe = async () => {\n  const input = document.querySelector(\"[data-mappe-search-input]\");\n  if (!input || input.disabled) return;\n\n  const query = input.value.trim();\n  const layers = layerSelezionatiMappa();\n  if (query.length < 2 || !layers.length) {\n    if (query.length) {\n      mostraRisultatiRicercaMappe([], \"Inserisci almeno 2 caratteri\");\n    } else {\n      const results = document.querySelector(\"[data-mappe-search-results]\");\n      if (results) {\n        results.innerHTML = \"\";\n        results.classList.add(\"d-none\");\n      }\n    }\n    return;\n  }\n\n  const requestId = Date.now();\n  window.elinkMappeSearchRequestId = requestId;\n  mostraRisultatiRicercaMappe([], \"Ricerca in corso...\");\n\n  try {\n    const url = urlRicercaLayerMappe();\n    url.searchParams.set(\"q\", query);\n    url.searchParams.set(\"layers\", layers.map((layer) => layer.key).join(\",\"));\n\n    const response = await fetch(url.toString(), {\n      headers: { Accept: \"application/json\" },\n      credentials: \"same-origin\",\n    });\n    if (!response.ok) throw new Error(\"Errore nella ricerca mappa.\");\n\n    const payload = await response.json();\n    if (window.elinkMappeSearchRequestId !== requestId) return;\n    mostraRisultatiRicercaMappe(payload.results || []);\n  } catch (_error) {\n    mostraRisultatiRicercaMappe([], \"Errore nella ricerca\");\n  }\n};\n\n// Pianifica la ricerca con un piccolo debounce per evitare una chiamata backend a ogni tasto.\nconst pianificaRicercaLayerMappe = () => {\n  if (window.elinkMappeSearchTimer) window.clearTimeout(window.elinkMappeSearchTimer);\n\n  window.elinkMappeSearchTimer = window.setTimeout(eseguiRicercaLayerMappe, 250);\n};\n\n// Sincronizza lo stato del checkbox padre Terreni in base ai layer figli attualmente selezionati.\nconst sincronizzaCheckboxPadreTerreniMappe = () => {\n  const parent = document.querySelector(\"[data-mappe-layer-group-parent='terreni']\");\n  const children = Array.from(document.querySelectorAll(\"[data-mappe-layer-child='terreni']\"));\n\n  if (!parent || !children.length) return;\n\n  const checkedChildren = children.filter((node) => node.checked).length;\n  parent.checked = checkedChildren > 0;\n  parent.indeterminate = checkedChildren > 0 && checkedChildren < children.length;\n};\n\n// Applica al gruppo Terreni la selezione o deselezione massiva dei layer figli.\nconst aggiornaFigliTerreniDaPadreMappe = (checked) => {\n  document.querySelectorAll(\"[data-mappe-layer-child='terreni']\").forEach((node) => {\n    node.checked = checked;\n  });\n\n  sincronizzaCheckboxPadreTerreniMappe();\n};\n\n// Apre o chiude il gruppo Terreni mantenendo coerente l'icona del pulsante di espansione.\nconst toggleGruppoTerreniMappe = () => {\n  const container = document.querySelector(\"[data-mappe-layer-group-children='terreni']\");\n  const button = document.querySelector(\"[data-mappe-layer-group-toggle='terreni']\");\n  const icon = document.querySelector(\"[data-mappe-layer-group-toggle-icon='terreni']\");\n\n  if (!container || !button || !icon) return;\n\n  const hidden = container.classList.toggle(\"d-none\");\n  button.setAttribute(\"aria-expanded\", hidden ? \"false\" : \"true\");\n  icon.classList.toggle(\"bi-chevron-down\", !hidden);\n  icon.classList.toggle(\"bi-chevron-right\", hidden);\n};\n\n// Apre o chiude il pannello layer dentro la mappa, lasciando il pulsante sempre fermo a sinistra e mostrando il menu accanto.\nconst toggleSidebarViewerMappe = () => {\n  const panel = document.querySelector(\"[data-mappe-sidebar-panel]\");\n  const header = document.querySelector(\"[data-mappe-sidebar-header]\");\n  const sidebarBody = document.querySelector(\"[data-mappe-sidebar-body]\");\n  const title = document.querySelector(\"[data-mappe-sidebar-title]\");\n  const button = document.querySelector(\"[data-mappe-sidebar-toggle]\");\n\n  if (!panel || !header || !sidebarBody || !title || !button) return;\n\n  const hidden = sidebarBody.dataset.mappeSidebarCollapsed !== \"true\";\n  sidebarBody.dataset.mappeSidebarCollapsed = hidden ? \"true\" : \"false\";\n  title.classList.toggle(\"d-none\", hidden);\n  header.classList.toggle(\"rounded-bottom-3\", hidden);\n  panel.style.width = hidden ? \"52px\" : \"280px\";\n  sidebarBody.style.maxHeight = hidden ? \"0px\" : \"420px\";\n  sidebarBody.style.opacity = hidden ? \"0\" : \"1\";\n  sidebarBody.style.transform = hidden ? \"translateY(-8px)\" : \"translateY(0)\";\n  sidebarBody.style.pointerEvents = hidden ? \"none\" : \"auto\";\n  button.setAttribute(\"aria-expanded\", hidden ? \"false\" : \"true\");\n\n  if (window.elinkMappeViewer) {\n    window.setTimeout(() => window.elinkMappeViewer.invalidateSize(), 150);\n  }\n};\n\n// Rende la legenda semitrasparente a riposo e pienamente visibile al passaggio del mouse.\nconst inizializzaHoverLegendaMappe = () => {\n  const legenda = document.querySelector(\"[data-mappe-legenda-overlay]\");\n  if (!legenda) return;\n\n  legenda.addEventListener(\"mouseenter\", () => {\n    legenda.style.opacity = \"1\";\n  });\n\n  legenda.addEventListener(\"mouseleave\", () => {\n    legenda.style.opacity = \"0.74\";\n  });\n};\n\n// Rende il pannello layer semitrasparente a riposo e completamente visibile al passaggio del mouse.\nconst inizializzaHoverSidebarMappe = () => {\n  const sidebar = document.querySelector(\"[data-mappe-sidebar-panel]\");\n  if (!sidebar) return;\n\n  sidebar.addEventListener(\"mouseenter\", () => {\n    sidebar.style.opacity = \"1\";\n  });\n\n  sidebar.addEventListener(\"mouseleave\", () => {\n    sidebar.style.opacity = \"0.86\";\n  });\n};\n\n// Restituisce i colori associati allo stato di una scheda, usando vincolata come fallback.\nconst coloriStatoSchedaMappe = (stato) => MAPPE_STATI_SCHEDE_COLORI[stato] || MAPPE_STATI_SCHEDE_COLORI.vincolata;\n\n// Restituisce lo stile Leaflet della feature corrente in base al dataset e al layer selezionati.\nconst stileFeatureMappa = (dataset, layer, feature = null) => {\n  if (dataset === \"schede\") {\n    const colors = coloriStatoSchedaMappe(feature?.properties?.stato_scheda);\n    return { color: colors.line, weight: 2, fillColor: colors.fill, fillOpacity: 0.72 };\n  }\n\n  if (dataset === \"fabbricati\") {\n    return {\n      color: MAPPE_LAYER_COLORI.fabbricati.line,\n      weight: 1.5,\n      fillColor: MAPPE_LAYER_COLORI.fabbricati.fill,\n      fillOpacity: MAPPE_LAYER_COLORI.fabbricati.fillOpacity,\n    };\n  }\n\n  const stiliTerreni = MAPPE_LAYER_COLORI.terreni;\n  const terreno = stiliTerreni[layer] || stiliTerreni.particelle;\n\n  return { color: terreno.line, weight: layer === \"acque\" ? 1.4 : 1.2, fillColor: terreno.fill, fillOpacity: terreno.fillOpacity };\n};\n\n// Restituisce l'espressione colore MapLibre per colorare le schede in base allo stato.\nconst coloreRiempimentoMaplibreMappe = (layerConfig, style) => {\n  if (layerConfig.dataset !== \"schede\") return style.fillColor;\n\n  return [\n    \"match\",\n    [\"get\", \"stato_scheda\"],\n    \"liberalizzata\", MAPPE_STATI_SCHEDE_COLORI.liberalizzata.fill,\n    \"bloccata\", MAPPE_STATI_SCHEDE_COLORI.bloccata.fill,\n    \"vincolata\", MAPPE_STATI_SCHEDE_COLORI.vincolata.fill,\n    MAPPE_STATI_SCHEDE_COLORI.vincolata.fill,\n  ];\n};\n\n// Restituisce l'espressione colore MapLibre per il bordo coerente con lo stato delle schede.\nconst coloreLineaMaplibreMappe = (layerConfig, style) => {\n  if (layerConfig.dataset !== \"schede\") return style.color;\n\n  return [\n    \"match\",\n    [\"get\", \"stato_scheda\"],\n    \"liberalizzata\", MAPPE_STATI_SCHEDE_COLORI.liberalizzata.line,\n    \"bloccata\", MAPPE_STATI_SCHEDE_COLORI.bloccata.line,\n    \"vincolata\", MAPPE_STATI_SCHEDE_COLORI.vincolata.line,\n    MAPPE_STATI_SCHEDE_COLORI.vincolata.line,\n  ];\n};\n\n// Restituisce la configurazione colore dei layer da usare sia per la mappa sia per la legenda dinamica.\nconst configurazioneColoreLayerMappa = (dataset, layer) => {\n  const style = stileFeatureMappa(dataset, layer);\n  return {\n    borderColor: style.color,\n    fillColor: style.fillColor,\n  };\n};\n\n// Costruisce una riga della legenda usando i colori gia' applicati alla geometria corrispondente.\nconst costruisciRigaLegendaMappe = (labelText, colors) => {\n  const row = document.createElement(\"div\");\n  row.className = \"d-flex align-items-center gap-2\";\n\n  const swatch = document.createElement(\"span\");\n  swatch.className = \"d-inline-block border rounded-1 flex-shrink-0\";\n  swatch.style.width = \"18px\";\n  swatch.style.height = \"12px\";\n  swatch.style.backgroundColor = colors.fillColor;\n  swatch.style.borderColor = colors.borderColor;\n\n  const label = document.createElement(\"span\");\n  label.className = \"text-dark\";\n  label.textContent = labelText;\n\n  row.appendChild(swatch);\n  row.appendChild(label);\n  return row;\n};\n\n// Restituisce le righe di legenda specifiche per gli stati delle schede.\nconst righeLegendaSchedeMappe = () => [\n  costruisciRigaLegendaMappe(\"Schede vincolate\", {\n    fillColor: MAPPE_STATI_SCHEDE_COLORI.vincolata.fill,\n    borderColor: MAPPE_STATI_SCHEDE_COLORI.vincolata.line,\n  }),\n  costruisciRigaLegendaMappe(\"Schede liberalizzate\", {\n    fillColor: MAPPE_STATI_SCHEDE_COLORI.liberalizzata.fill,\n    borderColor: MAPPE_STATI_SCHEDE_COLORI.liberalizzata.line,\n  }),\n  costruisciRigaLegendaMappe(\"Schede bloccate\", {\n    fillColor: MAPPE_STATI_SCHEDE_COLORI.bloccata.fill,\n    borderColor: MAPPE_STATI_SCHEDE_COLORI.bloccata.line,\n  }),\n];\n\n// Aggiorna la legenda colori mostrando soltanto i layer attualmente selezionati nel pannello mappa.\nconst aggiornaLegendaViewerMappe = (layerSelezionati) => {\n  const container = document.querySelector(\"[data-mappe-mappa-legenda]\");\n  if (!container) return;\n\n  container.innerHTML = \"\";\n\n  if (!layerSelezionati.length) {\n    container.innerHTML = '<div class=\"text-600\">Nessun layer selezionato</div>';\n    return;\n  }\n\n  layerSelezionati.forEach((layer) => {\n    if (layer.dataset === \"schede\") {\n      righeLegendaSchedeMappe().forEach((row) => container.appendChild(row));\n      return;\n    }\n\n    const colors = configurazioneColoreLayerMappa(layer.dataset, layer.layer);\n    container.appendChild(costruisciRigaLegendaMappe(layer.label, colors));\n  });\n};\n\n// Converte un valore in testo HTML sicuro per i riquadri informativi della mappa.\nconst escapeHtmlMappe = (value) => String(value ?? \"\")\n  .replaceAll(\"&\", \"&amp;\")\n  .replaceAll(\"<\", \"&lt;\")\n  .replaceAll(\">\", \"&gt;\")\n  .replaceAll('\"', \"&quot;\")\n  .replaceAll(\"'\", \"&#39;\");\n\n// Costruisce il contenuto del riquadro dettagli per i terreni mostrando solo i dati catastali richiesti.\nconst costruisciPopupTerrenoMappa = (properties) => {\n  const rows = [];\n  if (properties.sezione) rows.push(`<div><strong>Sezione:</strong> ${escapeHtmlMappe(properties.sezione)}</div>`);\n  rows.push(`<div><strong>Foglio:</strong> ${escapeHtmlMappe(properties.foglio || \"-\")}</div>`);\n  rows.push(`<div><strong>Mappale:</strong> ${escapeHtmlMappe(properties.numero || \"-\")}</div>`);\n  rows.push(`<div><strong>Qualit\u00E0:</strong> ${escapeHtmlMappe(properties.qualita || properties.denominazione || \"-\")}</div>`);\n  return rows.join(\"\");\n};\n\n// Costruisce il contenuto del popup della feature catastale mantenendo visibili solo gli attributi principali.\nconst costruisciPopupFeatureMappa = (feature, dataset) => {\n  const properties = feature.properties || {};\n  const rows = [];\n  const featureCount = Number.parseInt(properties.feature_count || \"0\", 10);\n\n  if (featureCount > 1) {\n    rows.push(`<div><strong>Geometrie aggregate:</strong> ${featureCount}</div>`);\n    if (dataset === \"terreni\") rows.push(`<div><strong>Layer:</strong> ${properties.layer || \"-\"}</div>`);\n    return rows.join(\"\");\n  }\n\n  if (dataset === \"terreni\") return costruisciPopupTerrenoMappa(properties);\n\n  if (properties.sezione) rows.push(`<div><strong>Sezione:</strong> ${properties.sezione}</div>`);\n  rows.push(`<div><strong>Foglio:</strong> ${properties.foglio || \"-\"}</div>`);\n  rows.push(`<div><strong>Mappale:</strong> ${properties.numero || \"-\"}</div>`);\n\n  if (dataset === \"schede\") {\n    rows.push(`<div><strong>Schede collegate:</strong> ${properties.schede_count || \"-\"}</div>`);\n  }\n\n  return rows.join(\"\");\n};\n\n// Restituisce l'URL del backend che espone i subalterni collegati alla geometria di fabbricato selezionata.\nconst urlFabbricatiSubalterniMappe = (geometryId) => {\n  const wrapper = document.querySelector(\"#mappe-mappa\");\n  const baseUrl = wrapper?.getAttribute(\"data-mappe-fabbricati-subalterni-url\") || wrapper?.dataset.mappeFabbricatiSubalterniUrl || \"/mappe/layers/fabbricati/subalterni\";\n  const url = new URL(baseUrl, window.location.origin);\n  url.searchParams.set(\"id\", geometryId);\n  return url;\n};\n\n// Restituisce l'URL del backend che espone i dettagli essenziali della geometria terreno selezionata.\nconst urlTerrenoDettaglioMappe = (geometryId) => {\n  const wrapper = document.querySelector(\"#mappe-mappa\");\n  const baseUrl = wrapper?.getAttribute(\"data-mappe-terreno-dettaglio-url\") || wrapper?.dataset.mappeTerrenoDettaglioUrl || \"/mappe/layers/terreni/dettaglio\";\n  const url = new URL(baseUrl, window.location.origin);\n  url.searchParams.set(\"id\", geometryId);\n  return url;\n};\n\n// Carica dal backend i dettagli del terreno quando gli attributi presenti nel tile non sono sufficienti al riquadro.\nconst caricaDettaglioTerrenoMappe = async (properties) => {\n  const geometryId = properties?.id;\n  if (!geometryId) return properties || {};\n\n  try {\n    const response = await fetch(urlTerrenoDettaglioMappe(geometryId).toString(), {\n      headers: { Accept: \"application/json\" },\n      credentials: \"same-origin\",\n    });\n\n    if (!response.ok) return properties || {};\n\n    const detail = await response.json();\n    return { ...(properties || {}), ...detail };\n  } catch (_error) {\n    return properties || {};\n  }\n};\n\n// Restituisce l'URL del backend che espone le schede collegate alla geometria di fabbricato selezionata.\nconst urlFabbricatiSchedeMappe = (geometryId) => {\n  const wrapper = document.querySelector(\"#mappe-mappa\");\n  const baseUrl = wrapper?.getAttribute(\"data-mappe-fabbricati-schede-url\") || wrapper?.dataset.mappeFabbricatiSchedeUrl || \"/mappe/layers/fabbricati/schede\";\n  const url = new URL(baseUrl, window.location.origin);\n  url.searchParams.set(\"id\", geometryId);\n  return url;\n};\n\n// Restituisce l'URL del backend che espone i punti etichetta dei fabbricati nella viewport corrente.\nconst urlFabbricatiEtichetteMappe = () => {\n  const wrapper = document.querySelector(\"#mappe-mappa\");\n  const baseUrl = wrapper?.getAttribute(\"data-mappe-fabbricati-etichette-url\") || wrapper?.dataset.mappeFabbricatiEtichetteUrl || \"/mappe/layers/fabbricati/etichette\";\n  return new URL(baseUrl, window.location.origin);\n};\n\n// Calcola quali conteggi mostrare dentro ai fabbricati in base ai layer fabbricati e schede attualmente selezionati.\nconst modalitaEtichetteFabbricatiMappe = (layerKeys) => {\n  const modes = [];\n  if (layerKeys.includes(\"fabbricati\")) modes.push(\"subalterni\");\n  if (layerKeys.includes(\"schede\")) modes.push(\"schede\");\n  return modes;\n};\n\n// Carica dal backend le etichette dei fabbricati filtrate sulla viewport e sulle modalita' richieste.\nconst caricaEtichetteFabbricatiMappe = async (modalita) => {\n  const viewport = viewportCorrenteMappe();\n  const url = urlFabbricatiEtichetteMappe();\n  url.searchParams.set(\"modalita\", modalita.join(\",\"));\n  url.searchParams.set(\"bbox\", viewport.bbox);\n  url.searchParams.set(\"zoom\", viewport.zoom);\n  if (modalita.includes(\"schede\") && schedaFocusMappe()) url.searchParams.set(\"scheda_id\", schedaFocusMappe());\n\n  const response = await fetch(url.toString(), {\n    headers: { Accept: \"application/json\" },\n    credentials: \"same-origin\",\n    cache: \"no-store\",\n  });\n\n  if (!response.ok) throw new Error(\"Errore nel caricamento delle etichette fabbricati.\");\n\n  return response.json();\n};\n\n// Genera un identificativo progressivo per scartare risposte etichette superate da richieste piu recenti.\nconst prossimoIdRichiestaEtichetteMappe = () => {\n  window.elinkMappeLabelRequestSequence = (window.elinkMappeLabelRequestSequence || 0) + 1;\n  window.elinkMappeLabelRequestId = window.elinkMappeLabelRequestSequence;\n  return window.elinkMappeLabelRequestId;\n};\n\n// Chiude il menu radiale dei fabbricati rimuovendo l'overlay interattivo dalla mappa.\nconst chiudiMenuRadialeFabbricatiMappe = () => {\n  const menu = document.querySelector(\"[data-mappe-fabbricati-radial-menu]\");\n  if (!menu) return;\n\n  menu.classList.add(\"d-none\");\n  menu.innerHTML = \"\";\n  menu.style.pointerEvents = \"none\";\n  window.elinkMappeRadialMenuState = null;\n};\n\n// Chiude popup e menu radiale attivi e cancella l'evidenza selezionata senza distruggere i layer caricati.\nconst chiudiOverlayInterattiviMappe = () => {\n  chiudiMenuRadialeFabbricatiMappe();\n\n  if (window.elinkMappeVectorViewer) {\n    document.querySelectorAll(\".maplibregl-popup\").forEach((popup) => popup.remove());\n  }\n\n  if (window.elinkMappeViewer?.closePopup) {\n    window.elinkMappeViewer.closePopup();\n  }\n\n  selezionaRisultatoMappa(null);\n};\n\n// Ferma la propagazione dei click dentro ai popup cosi' la mappa non interpreta l'interazione come click esterno.\nconst bloccaPropagazionePopupMappe = (popupNode) => {\n  if (!popupNode) return;\n\n  [\"click\", \"mousedown\", \"dblclick\", \"touchstart\"].forEach((eventName) => {\n    popupNode.addEventListener(eventName, (event) => event.stopPropagation());\n  });\n};\n\n// Memorizza il risultato selezionato e aggiorna il layer di evidenza senza interferire con popup o radiali.\nconst selezionaRisultatoMappa = (result) => {\n  window.elinkMappeSelectedResult = result || null;\n\n  if (window.elinkMappeVectorViewer) aggiornaEvidenzaRicercaMaplibre(window.elinkMappeVectorViewer);\n  if (window.elinkMappeViewer && !window.elinkMappeVectorViewer) aggiornaEvidenzaRicercaLeaflet();\n};\n\n// Mostra il popup terreno standard per il risultato selezionato, usando gli stessi dati caricati dal click normale sul layer.\nconst mostraPopupTerrenoRisultatoRicercaMappe = async (result, latlng) => {\n  const properties = await caricaDettaglioTerrenoMappe({\n    id: result.id,\n    sezione: result.sezione,\n    foglio: result.foglio,\n    numero: result.numero,\n    layer: result.layer,\n  });\n  const html = costruisciPopupFeatureMappa({ properties }, \"terreni\");\n\n  if (window.elinkMappeVectorViewer) {\n    const popup = new window.maplibregl.Popup({ closeButton: false, closeOnClick: false, maxWidth: \"320px\" })\n      .setLngLat([latlng.lng, latlng.lat])\n      .setHTML(html)\n      .addTo(window.elinkMappeVectorViewer);\n    bloccaPropagazionePopupMappe(popup.getElement());\n    return;\n  }\n\n  if (window.elinkMappeViewer && window.L) {\n    const popup = window.L.popup({ autoClose: false, closeButton: false, closeOnClick: false, maxWidth: 320 })\n      .setLatLng([latlng.lat, latlng.lng])\n      .setContent(html)\n      .openOn(window.elinkMappeViewer);\n    bloccaPropagazionePopupMappe(popup.getElement?.());\n  }\n};\n\n// Mostra un messaggio puntuale quando l'overlay specifico del risultato non puo' essere aperto.\nconst mostraPopupErroreRisultatoRicercaMappe = (result, message) => {\n  const html = escapeHtmlMappe(message);\n\n  if (window.elinkMappeVectorViewer) {\n    const popup = new window.maplibregl.Popup({ closeButton: false, closeOnClick: false, maxWidth: \"320px\" })\n      .setLngLat([result.lng, result.lat])\n      .setHTML(html)\n      .addTo(window.elinkMappeVectorViewer);\n    bloccaPropagazionePopupMappe(popup.getElement());\n    return;\n  }\n\n  if (window.elinkMappeViewer && window.L) {\n    const popup = window.L.popup({ autoClose: false, closeButton: false, closeOnClick: false, maxWidth: 320 })\n      .setLatLng([result.lat, result.lng])\n      .setContent(html)\n      .openOn(window.elinkMappeViewer);\n    bloccaPropagazionePopupMappe(popup.getElement?.());\n  }\n};\n\n// Apre sul risultato di ricerca lo stesso overlay previsto dal click normale sul layer corrispondente.\nconst apriOverlayRisultatoRicercaMappe = async (result) => {\n  const latlng = { lat: result.lat, lng: result.lng };\n  const feature = { properties: { id: result.id } };\n\n  if (result.dataset === \"fabbricati\") {\n    try {\n      await caricaMenuRadialeFabbricatiMappe(feature, latlng);\n    } catch (_error) {\n      mostraPopupErroreRisultatoRicercaMappe(result, \"Nessun subalterno disponibile per il fabbricato selezionato.\");\n    }\n    return;\n  }\n\n  if (result.dataset === \"schede\") {\n    try {\n      await caricaMenuRadialeSchedeMappe(feature, latlng);\n    } catch (_error) {\n      mostraPopupErroreRisultatoRicercaMappe(result, \"Nessuna scheda disponibile per il fabbricato selezionato.\");\n    }\n    return;\n  }\n\n  try {\n    await mostraPopupTerrenoRisultatoRicercaMappe(result, latlng);\n  } catch (_error) {\n    mostraPopupErroreRisultatoRicercaMappe(result, \"Dettaglio terreno non disponibile.\");\n  }\n};\n\n// Costruisce un riferimento selezionabile partendo dagli attributi della feature cliccata o cercata.\nconst riferimentoSelezioneMappa = (properties, dataset, layer = \"\") => ({\n  id: properties?.id,\n  dataset,\n  layer,\n  sezione: properties?.sezione || \"\",\n  foglio: properties?.foglio || \"\",\n  numero: properties?.numero || \"\",\n});\n\n// Centra la mappa sul risultato scelto dalla ricerca e apre l'overlay coerente con il layer selezionato.\nconst apriRisultatoRicercaMappe = (result) => {\n  const results = document.querySelector(\"[data-mappe-search-results]\");\n  if (results) results.classList.add(\"d-none\");\n  if (!result || Number.isNaN(Number.parseFloat(result.lat)) || Number.isNaN(Number.parseFloat(result.lng))) return;\n\n  chiudiOverlayInterattiviMappe();\n  selezionaRisultatoMappa(result);\n  window.elinkMappePreservaOverlayFinoA = Date.now() + 1600;\n\n  if (window.elinkMappeVectorViewer) {\n    const zoom = Math.max(window.elinkMappeVectorViewer.getZoom(), 17);\n    window.elinkMappeVectorViewer.easeTo({ center: [result.lng, result.lat], zoom, duration: 450 });\n    window.setTimeout(() => apriOverlayRisultatoRicercaMappe(result), 480);\n    return;\n  }\n\n  if (window.elinkMappeViewer) {\n    const zoom = Math.max(window.elinkMappeViewer.getZoom(), 17);\n    window.elinkMappeViewer.setView([result.lat, result.lng], zoom);\n    window.setTimeout(() => apriOverlayRisultatoRicercaMappe(result), 0);\n  }\n};\n\n// Chiude overlay e selezione della mappa quando l'utente clicca fuori dal contenitore mappa.\nconst chiudiOverlayMappeClickEsterno = (event) => {\n  const wrapper = document.querySelector(\"#mappe-mappa\");\n  if (event.target?.closest?.(\".leaflet-popup, .maplibregl-popup\")) return;\n  if (!wrapper || wrapper.contains(event.target)) return;\n\n  chiudiOverlayInterattiviMappe();\n};\n\n// Indica se un refresh programmato deve mantenere aperti gli overlay appena aperti dalla ricerca.\nconst preservaOverlayDuranteRefreshMappe = () => Date.now() < (window.elinkMappePreservaOverlayFinoA || 0);\n\n// Restituisce il raggio del menu radiale in base al numero di spicchi, cosi' la corona resta leggibile anche con i controlli di pagina.\nconst raggioMenuRadialeFabbricatiMappe = (count) => {\n  if (count <= 4) return 74;\n  if (count <= 6) return 86;\n  if (count <= 8) return 98;\n  return 98;\n};\n\n// Restituisce la configurazione geometrica del radiale distinguendo tra fabbricati e schede.\nconst configurazioneMenuRadialeFabbricatiMappe = (payload) => {\n  if (payload.radialMode === \"schede\") {\n    return {\n      pageSize: MAPPE_SCHEDE_PER_PAGINA_RADIALE,\n      weights: [2, 2, 2, 2, 1, 1],\n      prevIndex: 4,\n      nextIndex: 5,\n    };\n  }\n\n  return {\n    pageSize: MAPPE_SUBALTERNI_PER_PAGINA_RADIALE,\n    weights: Array.from({ length: 10 }, () => 1),\n    prevIndex: 8,\n    nextIndex: 9,\n  };\n};\n\n// Posiziona il menu radiale vicino alla geometria cliccata usando le dimensioni effettive del contenuto, cosi' la hitbox coincide col menu visibile.\nconst posizionaMenuRadialeFabbricatiMappe = (menu, centerPoint, menuWidth, menuHeight) => {\n  const overlay = document.querySelector(\"[data-mappe-radial-layer]\");\n  if (!menu || !overlay) return;\n\n  const overlayRect = overlay.getBoundingClientRect();\n  const clamp = (value, min, max) => Math.min(Math.max(value, min), max);\n\n  const left = clamp(centerPoint.x, menuWidth / 2 + 12, overlayRect.width - menuWidth / 2 - 12);\n  const top = clamp(centerPoint.y, menuHeight / 2 + 12, overlayRect.height - menuHeight / 2 - 12);\n\n  menu.style.width = `${menuWidth}px`;\n  menu.style.height = `${menuHeight}px`;\n  menu.style.left = `${left - menuWidth / 2}px`;\n  menu.style.top = `${top - menuHeight / 2}px`;\n};\n\n// Aggiorna la posizione del menu radiale ricalcolandola dal latlng ancorato alla geometria selezionata, cosi' il menu resta attaccato al fabbricato durante i movimenti della mappa.\nconst aggiornaPosizioneMenuRadialeFabbricatiMappe = () => {\n  const menu = document.querySelector(\"[data-mappe-fabbricati-radial-menu]\");\n  const state = window.elinkMappeRadialMenuState;\n  if (!menu || menu.classList.contains(\"d-none\") || !state) return;\n\n  const centerPoint = puntoContenitoreMappaMappe(state.latlng);\n  if (!centerPoint) return;\n\n  posizionaMenuRadialeFabbricatiMappe(menu, centerPoint, state.menuWidth, state.menuHeight);\n};\n\n// Converte coordinate polari in coordinate cartesiane dell'SVG per costruire gli spicchi del menu radiale.\nconst polarToCartesianMappe = (centerX, centerY, radius, angleInDegrees) => {\n  const angleInRadians = (angleInDegrees - 90) * Math.PI / 180.0;\n  return {\n    x: centerX + (radius * Math.cos(angleInRadians)),\n    y: centerY + (radius * Math.sin(angleInRadians)),\n  };\n};\n\n// Costruisce il path SVG di uno spicchio anulare tra due angoli, usato come area cliccabile del subalterno.\nconst pathSpicchioRadialeMappe = (centerX, centerY, innerRadius, outerRadius, startAngle, endAngle) => {\n  const outerStart = polarToCartesianMappe(centerX, centerY, outerRadius, endAngle);\n  const outerEnd = polarToCartesianMappe(centerX, centerY, outerRadius, startAngle);\n  const innerStart = polarToCartesianMappe(centerX, centerY, innerRadius, startAngle);\n  const innerEnd = polarToCartesianMappe(centerX, centerY, innerRadius, endAngle);\n  const largeArcFlag = endAngle - startAngle <= 180 ? \"0\" : \"1\";\n\n  return [\n    `M ${outerStart.x} ${outerStart.y}`,\n    `A ${outerRadius} ${outerRadius} 0 ${largeArcFlag} 0 ${outerEnd.x} ${outerEnd.y}`,\n    `L ${innerStart.x} ${innerStart.y}`,\n    `A ${innerRadius} ${innerRadius} 0 ${largeArcFlag} 1 ${innerEnd.x} ${innerEnd.y}`,\n    \"Z\",\n  ].join(\" \");\n};\n\n// Costruisce il nodo centrale del menu radiale con il riferimento catastale del fabbricato selezionato.\nconst costruisciCentroMenuRadialeFabbricatiMappe = (payload) => {\n  const center = document.createElement(\"div\");\n  center.className = \"position-absolute bg-white border rounded-circle shadow-sm d-flex flex-column align-items-center justify-content-center text-center\";\n  center.style.width = \"82px\";\n  center.style.height = \"82px\";\n  center.style.left = \"50%\";\n  center.style.top = \"50%\";\n  center.style.transform = \"translate(-50%, -50%)\";\n  center.style.padding = \"10px\";\n  center.style.pointerEvents = \"auto\";\n\n  const title = document.createElement(\"div\");\n  title.className = \"fw-semibold text-dark\";\n  title.style.fontSize = \"0.74rem\";\n  title.textContent = `${payload.foglio || \"-\"} / ${payload.numero || \"-\"}`;\n\n  const subtitle = document.createElement(\"div\");\n  subtitle.className = \"text-600\";\n  subtitle.style.fontSize = \"0.62rem\";\n  subtitle.textContent = payload.radialTitle || payload.sezione || \"Fabbricato\";\n\n  center.appendChild(title);\n  center.appendChild(subtitle);\n  return center;\n};\n\n// Restituisce gli elementi e gli eventuali controlli di pagina da disegnare nel radiale corrente.\nconst elementiPaginaRadialeFabbricatiMappe = (payload, pagina) => {\n  const entries = payload.radialItems || (payload.subalterni || []).map((subalterno) => ({ type: \"subalterno\", subalterno }));\n  const config = configurazioneMenuRadialeFabbricatiMappe(payload);\n  const totalPages = Math.max(1, Math.ceil(entries.length / config.pageSize));\n  const currentPage = Math.min(Math.max(pagina || 0, 0), totalPages - 1);\n  const start = currentPage * config.pageSize;\n  const pageEntries = entries.slice(start, start + config.pageSize);\n  const items = Array.from({ length: config.weights.length }, (_, index) => {\n    if (index < config.pageSize) return pageEntries[index] || { type: \"empty\" };\n    if (index === config.prevIndex) return currentPage > 0 ? { type: \"prev\", label: \"<<\" } : { type: \"empty\" };\n    if (index === config.nextIndex) return currentPage < totalPages - 1 ? { type: \"next\", label: \">>\" } : { type: \"empty\" };\n    return { type: \"empty\" };\n  });\n\n  return { items, currentPage, totalPages, weights: config.weights };\n};\n\n// Gestisce il click su uno spicchio del menu radiale aprendo il subalterno o cambiando ottavina senza rifare chiamate al backend.\nconst gestisciClickSpicchioRadialeFabbricatiMappe = (entry) => {\n  const state = window.elinkMappeRadialMenuState;\n  if (!entry || !state) return;\n\n  if (entry.type === \"subalterno\") {\n    window.location.href = entry.subalterno.detail_url;\n    return;\n  }\n\n  if (entry.type === \"scheda\") {\n    window.location.href = entry.scheda.detail_url;\n    return;\n  }\n\n  if (entry.type === \"empty\") return;\n\n  const direction = entry.type === \"next\" ? 1 : -1;\n  renderMenuRadialeFabbricatiMappe(state.payload, state.latlng, state.page + direction);\n};\n\n// Restituisce etichetta e stile cromatico dello spicchio radiale in base al tipo di contenuto disegnato.\nconst contenutoSpicchioRadialeFabbricatiMappe = (entry, index) => {\n  if (entry.type === \"subalterno\") {\n    const colors = MAPPE_LAYER_COLORI.fabbricati;\n    return {\n      label: entry.subalterno.subalterno,\n      fill: colors.fill,\n      hoverFill: colors.hoverFill,\n      textFill: colors.textFill,\n    };\n  }\n\n  if (entry.type === \"scheda\") {\n    const colors = coloriStatoSchedaMappe(entry.scheda.stato);\n    return {\n      label: entry.scheda.label,\n      fill: colors.fill,\n      hoverFill: colors.hoverFill,\n      textFill: colors.textFill,\n    };\n  }\n\n  if (entry.type === \"empty\") {\n    const colors = MAPPE_LAYER_COLORI.vuoto;\n    return {\n      label: \"\",\n      fill: colors.fill,\n      hoverFill: colors.hoverFill,\n      textFill: colors.textFill,\n    };\n  }\n\n  const colors = MAPPE_LAYER_COLORI.controlli;\n  return {\n    label: entry.label,\n    fill: colors.fill,\n    hoverFill: colors.hoverFill,\n    textFill: colors.textFill,\n  };\n};\n\n// Divide le etichette lunghe del radiale in massimo due righe compatte, abbreviando l'ultima riga se non entra nello spicchio.\nconst righeEtichettaRadialeFabbricatiMappe = (text, entry) => {\n  const value = String(text || \"\").trim();\n  if (!value) return [];\n\n  const maxChars = entry.type === \"scheda\" ? 12 : 6;\n  const maxRows = entry.type === \"scheda\" ? 2 : 1;\n  const words = value.split(/\\s+/);\n  const rows = [];\n\n  words.forEach((word) => {\n    const current = rows[rows.length - 1] || \"\";\n    const candidate = current ? `${current} ${word}` : word;\n\n    if (candidate.length <= maxChars && rows.length) {\n      rows[rows.length - 1] = candidate;\n    } else if (rows.length < maxRows) {\n      rows.push(word);\n    } else {\n      rows[rows.length - 1] = `${rows[rows.length - 1]} ${word}`;\n    }\n  });\n\n  return rows.slice(0, maxRows).map((row) => (row.length > maxChars ? `${row.slice(0, Math.max(1, maxChars - 1))}\u2026` : row));\n};\n\n// Inserisce le righe dell'etichetta dentro il nodo SVG text mantenendole centrate nello spicchio.\nconst applicaRigheEtichettaRadialeFabbricatiMappe = (label, rows, x, y, fontSize) => {\n  label.textContent = \"\";\n  if (!rows.length) return;\n\n  const lineHeight = fontSize + 2;\n  const startOffset = -((rows.length - 1) * lineHeight) / 2;\n\n  rows.forEach((row, index) => {\n    const tspan = document.createElementNS(\"http://www.w3.org/2000/svg\", \"tspan\");\n    tspan.setAttribute(\"x\", `${x}`);\n    tspan.setAttribute(\"dy\", index === 0 ? `${startOffset}` : `${lineHeight}`);\n    tspan.textContent = row;\n    label.appendChild(tspan);\n  });\n\n  label.setAttribute(\"y\", `${y}`);\n};\n\n// Costruisce la corona SVG del menu radiale distribuendo elementi e controlli anche con spicchi di ampiezza diversa e intercettando gli spicchi vuoti.\nconst costruisciCoronaRadialeFabbricatiMappe = (entries, radius, weights) => {\n  const outerRadius = radius + 34;\n  const innerRadius = 52;\n  const size = outerRadius * 2 + 8;\n  const center = size / 2;\n  const segmentWeights = weights || entries.map(() => 1);\n  const totalWeight = segmentWeights.reduce((total, weight) => total + weight, 0);\n  let currentAngle = 0;\n  const svgNs = \"http://www.w3.org/2000/svg\";\n  const svg = document.createElementNS(svgNs, \"svg\");\n  svg.setAttribute(\"viewBox\", `0 0 ${size} ${size}`);\n  svg.setAttribute(\"width\", `${size}`);\n  svg.setAttribute(\"height\", `${size}`);\n  svg.style.pointerEvents = \"none\";\n\n  entries.forEach((entry, index, items) => {\n    const segmentAngle = 360 * ((segmentWeights[index] || 1) / totalWeight);\n    const startAngle = currentAngle;\n    const endAngle = startAngle + segmentAngle;\n    const midAngle = startAngle + segmentAngle / 2;\n    const path = document.createElementNS(svgNs, \"path\");\n    const label = document.createElementNS(svgNs, \"text\");\n    const textPoint = polarToCartesianMappe(center, center, (innerRadius + outerRadius) / 2, midAngle);\n    const content = contenutoSpicchioRadialeFabbricatiMappe(entry, index);\n\n    path.setAttribute(\"d\", pathSpicchioRadialeMappe(center, center, innerRadius, outerRadius, startAngle, endAngle));\n    path.setAttribute(\"fill\", content.fill);\n    path.setAttribute(\"stroke\", \"#ffffff\");\n    path.setAttribute(\"stroke-width\", \"1.5\");\n    path.setAttribute(\"fill-opacity\", entry.type === \"empty\" ? `${MAPPE_LAYER_COLORI.vuoto.fillOpacity}` : \"1\");\n    path.style.cursor = entry.type === \"empty\" ? \"default\" : \"pointer\";\n    path.style.pointerEvents = \"auto\";\n\n    if (entry.type === \"empty\") {\n      path.addEventListener(\"click\", (event) => {\n        event.preventDefault();\n        event.stopPropagation();\n      });\n    } else {\n      path.addEventListener(\"mouseenter\", () => path.setAttribute(\"fill\", content.hoverFill));\n      path.addEventListener(\"mouseleave\", () => path.setAttribute(\"fill\", content.fill));\n      path.addEventListener(\"click\", (event) => {\n        event.preventDefault();\n        event.stopPropagation();\n        gestisciClickSpicchioRadialeFabbricatiMappe(entry);\n      });\n    }\n\n    const fontSize = entry.type === \"scheda\" ? 10 : 14;\n    const labelRows = righeEtichettaRadialeFabbricatiMappe(content.label, entry);\n    label.setAttribute(\"x\", `${textPoint.x}`);\n    label.setAttribute(\"text-anchor\", \"middle\");\n    label.setAttribute(\"dominant-baseline\", \"middle\");\n    label.setAttribute(\"font-size\", `${fontSize}`);\n    label.setAttribute(\"font-weight\", \"600\");\n    label.setAttribute(\"fill\", content.textFill);\n    label.style.pointerEvents = \"none\";\n    applicaRigheEtichettaRadialeFabbricatiMappe(label, labelRows, textPoint.x, textPoint.y, fontSize);\n\n    svg.appendChild(path);\n    svg.appendChild(label);\n    currentAngle = endAngle;\n  });\n\n  return { svg, size };\n};\n\n// Converte una coordinata geografica nel punto pixel del contenitore mappa supportando sia Leaflet sia MapLibre.\nconst puntoContenitoreMappaMappe = (latlng) => {\n  const map = window.elinkMappeViewer;\n  if (!map || !latlng) return null;\n\n  if (window.elinkMappeVectorViewer && typeof map.project === \"function\") {\n    const point = map.project([latlng.lng, latlng.lat]);\n    return { x: point.x, y: point.y };\n  }\n\n  if (typeof map.latLngToContainerPoint === \"function\") return map.latLngToContainerPoint(latlng);\n\n  return null;\n};\n\n// Disegna il menu radiale come corona SVG usando la configurazione di spicchi prevista per fabbricati o schede.\nconst renderMenuRadialeFabbricatiMappe = (payload, latlng, pagina = 0) => {\n  const menu = document.querySelector(\"[data-mappe-fabbricati-radial-menu]\");\n  if (!menu) return;\n\n  const radialItems = payload.radialItems || (payload.subalterni || []).map((subalterno) => ({ type: \"subalterno\", subalterno }));\n  if (!radialItems.length) return;\n\n  const centerPoint = puntoContenitoreMappaMappe(latlng);\n  if (!centerPoint) return;\n\n  menu.innerHTML = \"\";\n  menu.className = \"position-absolute\";\n  menu.style.pointerEvents = \"none\";\n\n  const surface = document.createElement(\"div\");\n  surface.className = \"position-relative\";\n  surface.style.pointerEvents = \"none\";\n\n  const { items, currentPage, weights } = elementiPaginaRadialeFabbricatiMappe(payload, pagina);\n  const radius = raggioMenuRadialeFabbricatiMappe(items.length);\n  const { svg, size } = costruisciCoronaRadialeFabbricatiMappe(items, radius, weights);\n  surface.style.width = `${size}px`;\n  surface.style.height = `${size}px`;\n  surface.appendChild(svg);\n  surface.appendChild(costruisciCentroMenuRadialeFabbricatiMappe(payload));\n\n  menu.appendChild(surface);\n  posizionaMenuRadialeFabbricatiMappe(menu, centerPoint, size, size);\n  window.elinkMappeRadialMenuState = { payload, latlng, page: currentPage, menuWidth: size, menuHeight: size };\n  menu.classList.remove(\"d-none\");\n};\n\n// Carica dal backend l'elenco dei subalterni del fabbricato cliccato e apre il menu radiale sopra la mappa.\nconst caricaMenuRadialeFabbricatiMappe = async (feature, latlng) => {\n  const geometryId = feature?.properties?.id;\n  if (!geometryId) return;\n\n  const response = await fetch(urlFabbricatiSubalterniMappe(geometryId).toString(), {\n    headers: { Accept: \"application/json\" },\n    credentials: \"same-origin\",\n  });\n\n  if (!response.ok) throw new Error(\"Errore nel caricamento dei subalterni del fabbricato.\");\n\n  const payload = await response.json();\n  if (!payload.subalterni?.length) throw new Error(\"Nessun subalterno disponibile per il fabbricato selezionato.\");\n\n  renderMenuRadialeFabbricatiMappe(payload, latlng);\n};\n\n// Carica dal backend l'elenco delle schede del fabbricato cliccato e apre il menu radiale sopra la mappa.\nconst caricaMenuRadialeSchedeMappe = async (feature, latlng) => {\n  const geometryId = feature?.properties?.id;\n  if (!geometryId) return;\n\n  const response = await fetch(urlFabbricatiSchedeMappe(geometryId).toString(), {\n    headers: { Accept: \"application/json\" },\n    credentials: \"same-origin\",\n  });\n\n  if (!response.ok) throw new Error(\"Errore nel caricamento delle schede del fabbricato.\");\n\n  const payload = await response.json();\n  if (!payload.schede?.length) throw new Error(\"Nessuna scheda disponibile per il fabbricato selezionato.\");\n\n  renderMenuRadialeFabbricatiMappe({\n    ...payload,\n    radialMode: \"schede\",\n    radialTitle: \"Schede\",\n    radialItems: payload.schede.map((scheda) => ({ type: \"scheda\", scheda })),\n  }, latlng);\n};\n\n// Collega l'interazione della feature catastale scegliendo tra popup semplice e menu radiale in base al dataset e al livello di aggregazione.\nconst collegaInterazioneFeatureMappa = (feature, leafletLayer, layerConfig) => {\n  if (layerConfig.dataset === \"schede\") {\n    leafletLayer.on(\"click\", async (event) => {\n      if (event.originalEvent?.stopPropagation) event.originalEvent.stopPropagation();\n      chiudiMenuRadialeFabbricatiMappe();\n      selezionaRisultatoMappa(riferimentoSelezioneMappa(feature.properties || {}, layerConfig.dataset, layerConfig.layer));\n\n      try {\n        await caricaMenuRadialeSchedeMappe(feature, event.latlng);\n      } catch (_error) {\n        leafletLayer.bindPopup(\"Nessuna scheda disponibile per il fabbricato selezionato.\").openPopup(event.latlng);\n      }\n    });\n    return;\n  }\n\n  if (layerConfig.dataset !== \"fabbricati\") {\n    leafletLayer.on(\"click\", async (event) => {\n      if (event.originalEvent?.stopPropagation) event.originalEvent.stopPropagation();\n      chiudiOverlayInterattiviMappe();\n\n      const properties = layerConfig.dataset === \"terreni\"\n        ? await caricaDettaglioTerrenoMappe(feature.properties || {})\n        : feature.properties || {};\n      selezionaRisultatoMappa(riferimentoSelezioneMappa(properties, layerConfig.dataset, layerConfig.layer));\n      const popup = leafletLayer.bindPopup(costruisciPopupFeatureMappa({ properties }, layerConfig.dataset), {\n        autoClose: false,\n        closeOnClick: false,\n      }).openPopup(event.latlng).getPopup?.();\n      bloccaPropagazionePopupMappe(popup?.getElement?.());\n    });\n    return;\n  }\n\n  leafletLayer.on(\"click\", async (event) => {\n    if (event.originalEvent?.stopPropagation) event.originalEvent.stopPropagation();\n    chiudiMenuRadialeFabbricatiMappe();\n    selezionaRisultatoMappa(riferimentoSelezioneMappa(feature.properties || {}, layerConfig.dataset, layerConfig.layer));\n\n    if (Number.parseInt(feature?.properties?.feature_count || \"0\", 10) > 1) {\n      leafletLayer.bindPopup(\"Aumenta lo zoom per selezionare i singoli subalterni.\").openPopup(event.latlng);\n      return;\n    }\n\n    try {\n      await caricaMenuRadialeFabbricatiMappe(feature, event.latlng);\n    } catch (_error) {\n      leafletLayer.bindPopup(\"Nessun subalterno disponibile per il fabbricato selezionato.\").openPopup(event.latlng);\n    }\n  });\n};\n\n// Aggiorna il riquadro laterale della mappa con il riepilogo aggregato dei layer attivi e delle importazioni usate.\nconst aggiornaRiepilogoViewerMappe = (layerStates, layerSelezionati) => {\n  const payloads = layerStates.map((layerState) => layerState.payload || {});\n  const metadati = payloads.map((payload) => payload.metadata || {});\n  const origini = Array.from(new Set(layerStates.map((layerState) => layerState.source).filter(Boolean)));\n  const ultimoImport = metadati.find((metadata) => metadata.importazione_id);\n  const setText = (selector, value) => {\n    const node = document.querySelector(selector);\n    if (node) node.textContent = value || \"-\";\n  };\n\n  setText(\"[data-mappe-mappa-layer-attivi]\", layerSelezionati.length ? layerSelezionati.map((layer) => layer.label).join(\", \") : \"-\");\n  setText(\"[data-mappe-mappa-importazione]\", ultimoImport?.importazione_id ? `#${ultimoImport.importazione_id}` : \"-\");\n  setText(\"[data-mappe-mappa-validita]\", ultimoImport?.data_validita);\n  setText(\"[data-mappe-mappa-creato]\", ultimoImport?.creato_il);\n  setText(\"[data-mappe-mappa-feature-count]\", String(payloads.reduce((total, payload) => total + (payload.features || []).length, 0)));\n  setText(\"[data-mappe-mappa-origine]\", origini.length === 0 ? \"-\" : (origini.length === 1 ? (origini[0] === \"cache_client\" ? \"cache locale\" : \"caricamento live\") : \"mista\"));\n  aggiornaLegendaViewerMappe(layerSelezionati);\n\n  const messageNode = document.querySelector(\"[data-mappe-mappa-messaggio]\");\n  if (!messageNode) return;\n\n  if (!layerSelezionati.length) {\n    messageNode.textContent = \"Selezionare almeno un layer per aggiornare la mappa.\";\n    return;\n  }\n\n  if (metadati.some((metadata) => metadata.errore === \"layer_non_supportato\")) {\n    messageNode.textContent = \"Uno o piu' layer richiesti non sono supportati dalla mappa.\";\n    return;\n  }\n\n  if (payloads.every((payload) => (payload.features || []).length === 0)) {\n    messageNode.textContent = \"Nessuna geometria disponibile per le ultime importazioni completate dei layer selezionati.\";\n    return;\n  }\n\n  if (metadati.some((metadata) => metadata.rappresentazione === \"aggregata\")) {\n    messageNode.textContent = \"A questo livello di zoom la mappa mostra una rappresentazione aggregata dei layer piu' densi.\";\n    return;\n  }\n\n  if (metadati.some((metadata) => metadata.rappresentazione === \"semplificata\")) {\n    messageNode.textContent = \"A questo livello di zoom la mappa mostra una rappresentazione semplificata dei layer selezionati.\";\n    return;\n  }\n\n  messageNode.textContent = \"La mappa mostra le ultime importazioni completate disponibili per i layer selezionati.\";\n};\n\n// Restituisce l'URL di backend da usare per il caricamento dei layer catastali della mappa.\nconst urlLayerCatastoMappe = () => {\n  const wrapper = document.querySelector(\"#mappe-mappa\");\n  const layerUrl = wrapper?.getAttribute(\"data-mappe-layer-catasto-url\") || wrapper?.dataset.mappeLayerCatastoUrl || \"/mappe/layers/catasto\";\n  return new URL(layerUrl, window.location.origin);\n};\n\n// Restituisce l'URL di backend da usare per cercare sui layer attualmente selezionati.\nconst urlRicercaLayerMappe = () => {\n  const wrapper = document.querySelector(\"#mappe-mappa\");\n  const searchUrl = wrapper?.getAttribute(\"data-mappe-layer-ricerca-url\") || wrapper?.dataset.mappeLayerRicercaUrl || \"/mappe/layers/ricerca\";\n  return new URL(searchUrl, window.location.origin);\n};\n\n// Restituisce i bounds iniziali del comune corrente letti dal markup, nel formato Leaflet [[south, west], [north, east]].\nconst boundsInizialiComuneMappe = () => {\n  const scriptNode = document.querySelector(\"#mappe-bounds-data\");\n  const rawJsonBounds = scriptNode?.textContent?.trim();\n\n  if (rawJsonBounds && rawJsonBounds !== \"null\") {\n    try {\n      const values = JSON.parse(rawJsonBounds);\n      if (Array.isArray(values) && values.length === 4 && values.every((value) => !Number.isNaN(Number.parseFloat(value)))) {\n        return [\n          [Number.parseFloat(values[0]), Number.parseFloat(values[1])],\n          [Number.parseFloat(values[2]), Number.parseFloat(values[3])],\n        ];\n      }\n    } catch (_error) {\n      // Fallback ai data-attribute se il JSON inline non fosse leggibile.\n    }\n  }\n\n  const wrapper = document.querySelector(\"#mappe-mappa\");\n  if (!wrapper) return null;\n\n  const south = Number.parseFloat(wrapper.dataset.mappeBoundsSouth);\n  const west = Number.parseFloat(wrapper.dataset.mappeBoundsWest);\n  const north = Number.parseFloat(wrapper.dataset.mappeBoundsNorth);\n  const east = Number.parseFloat(wrapper.dataset.mappeBoundsEast);\n  const valuesSeparati = [south, west, north, east];\n\n  if (valuesSeparati.every((value) => !Number.isNaN(value))) {\n    return [[south, west], [north, east]];\n  }\n\n  const rawBounds = wrapper.dataset.mappeBounds;\n  if (!rawBounds) return null;\n\n  try {\n    const values = JSON.parse(rawBounds);\n    if (!Array.isArray(values) || values.length !== 4 || values.some((value) => Number.isNaN(Number.parseFloat(value)))) return null;\n\n    return [\n      [Number.parseFloat(values[0]), Number.parseFloat(values[1])],\n      [Number.parseFloat(values[2]), Number.parseFloat(values[3])],\n    ];\n  } catch (_error) {\n    return null;\n  }\n};\n\n// Restituisce i bounds della mappa standard, usati per calcolare zoom minimo e limiti anche quando il fit iniziale e' su una scheda.\nconst boundsBaseComuneMappe = () => {\n  const scriptNode = document.querySelector(\"#mappe-base-bounds-data\");\n  const rawJsonBounds = scriptNode?.textContent?.trim();\n  if (!rawJsonBounds || rawJsonBounds === \"null\") return null;\n\n  try {\n    const values = JSON.parse(rawJsonBounds);\n    if (!Array.isArray(values) || values.length !== 4 || values.some((value) => Number.isNaN(Number.parseFloat(value)))) return null;\n\n    return [\n      [Number.parseFloat(values[0]), Number.parseFloat(values[1])],\n      [Number.parseFloat(values[2]), Number.parseFloat(values[3])],\n    ];\n  } catch (_error) {\n    return null;\n  }\n};\n\n// Restituisce il centro neutro di fallback da usare quando il comune corrente non ha ancora geometrie caricate.\nconst centroFallbackMappe = () => ({\n  center: MAPPE_FALLBACK_CENTER,\n  zoom: MAPPE_FALLBACK_ZOOM,\n});\n\n// Calcola un padding uniforme e neutro per il fit iniziale, lasciando un piccolo margine attorno ai dati senza trattare gli overlay come area sottratta.\nconst paddingViewportComuneMappe = () => {\n  return {\n    top: 20,\n    right: 20,\n    bottom: 20,\n    left: 20,\n  };\n};\n\n// Restituisce i bounds geografici del comune con un margine percentuale, cosi' il vincolo di navigazione non taglia i bordi estremi delle geometrie.\nconst boundsComuneConMargineMappe = (bounds, ratio = 0.08) => {\n  if (!bounds) return null;\n\n  const south = bounds[0][0];\n  const west = bounds[0][1];\n  const north = bounds[1][0];\n  const east = bounds[1][1];\n  const latMargin = (north - south) * ratio;\n  const lngMargin = (east - west) * ratio;\n\n  return [\n    [south - latMargin, west - lngMargin],\n    [north + latMargin, east + lngMargin],\n  ];\n};\n\n// Restituisce il numero di decimali con cui stabilizzare il bbox in base allo zoom, cosi' piccoli pan non generano refresh inutili.\nconst precisioneViewportMappe = (zoom) => {\n  if (zoom >= 17) return 5;\n  if (zoom >= 15) return 4;\n  if (zoom >= 13) return 3;\n  return 2;\n};\n\n// Restituisce un bbox leggermente esteso in modo compatibile sia con Leaflet sia con MapLibre.\nconst boundsConPaddingMappe = (bounds, ratio = 0.2) => {\n  const west = bounds.getWest();\n  const south = bounds.getSouth();\n  const east = bounds.getEast();\n  const north = bounds.getNorth();\n  const lngMargin = (east - west) * ratio;\n  const latMargin = (north - south) * ratio;\n\n  return {\n    west: west - lngMargin,\n    south: south - latMargin,\n    east: east + lngMargin,\n    north: north + latMargin,\n  };\n};\n\n// Restituisce un bbox leggermente esteso e quantizzato, usato sia per la cache sia per ridurre richieste duplicate su piccoli spostamenti.\nconst bboxNormalizzatoMappe = (bounds, zoom) => {\n  const paddedBounds = boundsConPaddingMappe(bounds);\n  const precision = precisioneViewportMappe(zoom);\n  const round = (value) => Number.parseFloat(value).toFixed(precision);\n\n  return [\n    round(paddedBounds.west),\n    round(paddedBounds.south),\n    round(paddedBounds.east),\n    round(paddedBounds.north),\n  ];\n};\n\n// Applica al viewer i vincoli di estensione del comune corrente usando un solo fit iniziale stabile e uno zoom minimo compatibile con i bounds calcolati.\nconst applicaVincoliComuneMappe = (map) => {\n  const bounds = boundsInizialiComuneMappe();\n  if (!map || !bounds) return false;\n\n  const leafletBounds = window.L.latLngBounds(bounds);\n  const boundsVincoli = boundsBaseComuneMappe() || bounds;\n  const leafletBoundsVincoli = window.L.latLngBounds(boundsVincoli);\n  const maxLeafletBounds = window.L.latLngBounds(boundsComuneConMargineMappe(boundsVincoli));\n  if (!leafletBounds.isValid()) return false;\n\n  const padding = paddingViewportComuneMappe();\n  const paddingTopLeft = window.L.point(padding.left, padding.top);\n  const paddingBottomRight = window.L.point(padding.right, padding.bottom);\n  const fitZoom = map.getBoundsZoom(leafletBoundsVincoli, false, paddingTopLeft.add(paddingBottomRight));\n\n  map.invalidateSize(false);\n  map.setMaxBounds(maxLeafletBounds);\n  map.setMinZoom(Math.max(0, Math.min(MAPPE_FALLBACK_ZOOM, fitZoom) - 0.2));\n  map.fitBounds(leafletBounds, { paddingTopLeft, paddingBottomRight, animate: false });\n\n  return true;\n};\n\n// Applica al viewer MapLibre i bounds del comune corrente con una camera iniziale stabile, evitando correzioni ripetute di zoom.\nconst applicaVincoliComuneMappeMaplibre = (map) => {\n  const bounds = boundsInizialiComuneMappe();\n  if (!map || !bounds) return false;\n\n  const southWest = [bounds[0][1], bounds[0][0]];\n  const northEast = [bounds[1][1], bounds[1][0]];\n  const boundsVincoli = boundsBaseComuneMappe() || bounds;\n  const southWestVincoli = [boundsVincoli[0][1], boundsVincoli[0][0]];\n  const northEastVincoli = [boundsVincoli[1][1], boundsVincoli[1][0]];\n  const maxBounds = boundsComuneConMargineMappe(boundsVincoli);\n  const padding = paddingViewportComuneMappe();\n\n  map.resize();\n  const camera = map.cameraForBounds([southWest, northEast], { padding });\n  const cameraVincoli = map.cameraForBounds([southWestVincoli, northEastVincoli], { padding });\n  if (!camera || !cameraVincoli) return false;\n\n  map.setMaxBounds([\n    [maxBounds[0][1], maxBounds[0][0]],\n    [maxBounds[1][1], maxBounds[1][0]],\n  ]);\n  map.setMinZoom(Math.max(0, Math.min(MAPPE_FALLBACK_ZOOM, cameraVincoli.zoom) - 0.2));\n  map.jumpTo({ ...camera, bearing: 0, pitch: 0 });\n  return true;\n};\n\n// Restituisce il contenuto popup del layer vettoriale ricostruendo lo stesso layout del ramo GeoJSON a partire dagli attributi minimi persistiti nella tile.\nconst popupFeatureMaplibre = (properties, layerConfig) => costruisciPopupFeatureMappa({ properties }, layerConfig.dataset);\n\n// Aggiunge al viewer MapLibre la coppia di layer fill/line del layer richiesto usando il relativo tileset pubblicato.\nconst aggiungiLayerMaplibreMappe = (map, layerKey, layerConfig) => {\n  const tilesUrl = urlTilesetLayerMappe(layerKey);\n  if (!tilesUrl || map.getSource(layerConfig.sourceId)) return;\n\n  const style = stileFeatureMappa(layerConfig.dataset, layerConfig.layer);\n\n  map.addSource(layerConfig.sourceId, {\n    type: \"vector\",\n    tiles: [tilesUrl],\n    minzoom: layerConfig.minzoom,\n    maxzoom: layerConfig.maxzoom,\n  });\n\n  map.addLayer({\n    id: layerConfig.fillLayerId,\n    type: \"fill\",\n    source: layerConfig.sourceId,\n    \"source-layer\": layerConfig.sourceLayer,\n    paint: {\n      \"fill-color\": coloreRiempimentoMaplibreMappe(layerConfig, style),\n      \"fill-opacity\": style.fillOpacity,\n    },\n  });\n\n  map.addLayer({\n    id: layerConfig.lineLayerId,\n    type: \"line\",\n    source: layerConfig.sourceId,\n    \"source-layer\": layerConfig.sourceLayer,\n    paint: {\n      \"line-color\": coloreLineaMaplibreMappe(layerConfig, style),\n      \"line-width\": style.weight,\n    },\n  });\n};\n\n// Rimuove dal viewer MapLibre il layer dedicato alle etichette dei fabbricati.\nconst rimuoviEtichetteFabbricatiMaplibre = (map) => {\n  if (map.getLayer(MAPPE_FABBRICATI_LABEL_LAYER_ID)) map.removeLayer(MAPPE_FABBRICATI_LABEL_LAYER_ID);\n  if (map.getSource(MAPPE_FABBRICATI_LABEL_SOURCE_ID)) map.removeSource(MAPPE_FABBRICATI_LABEL_SOURCE_ID);\n};\n\n// Aggiunge o aggiorna in MapLibre le etichette dei fabbricati, unificando subalterni e schede quando entrambi i layer sono attivi.\nconst aggiornaEtichetteFabbricatiMaplibre = async (map, layerKeysSelezionati) => {\n  const modalita = modalitaEtichetteFabbricatiMappe(layerKeysSelezionati);\n  if (!modalita.length) {\n    rimuoviEtichetteFabbricatiMaplibre(map);\n    return;\n  }\n\n  const requestId = prossimoIdRichiestaEtichetteMappe();\n  const payload = await caricaEtichetteFabbricatiMappe(modalita);\n  if (window.elinkMappeLabelRequestId !== requestId) return;\n\n  const existingSource = map.getSource(MAPPE_FABBRICATI_LABEL_SOURCE_ID);\n\n  if (existingSource?.setData) {\n    existingSource.setData(payload);\n  } else {\n    map.addSource(MAPPE_FABBRICATI_LABEL_SOURCE_ID, {\n      type: \"geojson\",\n      data: payload,\n    });\n  }\n\n  if (!map.getLayer(MAPPE_FABBRICATI_LABEL_LAYER_ID)) {\n    map.addLayer({\n      id: MAPPE_FABBRICATI_LABEL_LAYER_ID,\n      type: \"symbol\",\n      source: MAPPE_FABBRICATI_LABEL_SOURCE_ID,\n      minzoom: 16,\n      layout: {\n        \"text-field\": [\"get\", \"label\"],\n        \"text-font\": [\"Open Sans Semibold\", \"Arial Unicode MS Bold\"],\n        \"text-size\": [\"interpolate\", [\"linear\"], [\"zoom\"], 16, 10, 19, 13],\n        \"text-line-height\": 1.05,\n        \"text-anchor\": \"center\",\n        \"text-allow-overlap\": false,\n        \"text-ignore-placement\": false,\n      },\n      paint: {\n        \"text-color\": \"#111827\",\n        \"text-halo-color\": \"#ffffff\",\n        \"text-halo-width\": 1.4,\n        \"text-halo-blur\": 0.4,\n      },\n    });\n  }\n};\n\n// Aggiunge o aggiorna nel viewer MapLibre un layer GeoJSON dinamico ottenuto dagli endpoint Rails della viewport corrente.\nconst aggiornaLayerGeojsonMaplibreMappe = async (map, layerConfig) => {\n  const result = await caricaPayloadLayerMappe(layerConfig);\n  const style = stileFeatureMappa(layerConfig.dataset, layerConfig.layer);\n  const existingSource = map.getSource(layerConfig.sourceId);\n\n  if (existingSource?.setData) {\n    existingSource.setData(result.payload);\n  } else {\n    map.addSource(layerConfig.sourceId, {\n      type: \"geojson\",\n      data: result.payload,\n    });\n  }\n\n  if (!map.getLayer(layerConfig.fillLayerId)) {\n    map.addLayer({\n      id: layerConfig.fillLayerId,\n      type: \"fill\",\n      source: layerConfig.sourceId,\n      paint: {\n        \"fill-color\": coloreRiempimentoMaplibreMappe(layerConfig, style),\n        \"fill-opacity\": style.fillOpacity,\n      },\n    });\n  }\n\n  if (!map.getLayer(layerConfig.lineLayerId)) {\n    map.addLayer({\n      id: layerConfig.lineLayerId,\n      type: \"line\",\n      source: layerConfig.sourceId,\n      paint: {\n        \"line-color\": coloreLineaMaplibreMappe(layerConfig, style),\n        \"line-width\": style.weight,\n      },\n    });\n  }\n\n  window.elinkMappeLayerState = window.elinkMappeLayerState || {};\n  window.elinkMappeLayerState[layerConfig.key] = { config: layerConfig, payload: result.payload, viewportKey: result.viewportKey, source: result.source };\n};\n\n// Rimuove dal viewer MapLibre il layer richiesto pulendo prima i layer di stile e poi la relativa source vettoriale.\nconst rimuoviLayerMaplibreMappe = (map, layerConfig) => {\n  rimuoviEvidenzaLayerMaplibre(map, layerConfig);\n  if (map.getLayer(layerConfig.lineLayerId)) map.removeLayer(layerConfig.lineLayerId);\n  if (map.getLayer(layerConfig.fillLayerId)) map.removeLayer(layerConfig.fillLayerId);\n  if (map.getSource(layerConfig.sourceId)) map.removeSource(layerConfig.sourceId);\n};\n\n// Restituisce gli id dei layer di evidenza collegati al layer MapLibre principale.\nconst layerIdsEvidenzaMaplibre = (layerConfig) => ({\n  fill: `${layerConfig.fillLayerId}${MAPPE_SELECTION_FILL_SUFFIX}`,\n  line: `${layerConfig.lineLayerId}${MAPPE_SELECTION_LINE_SUFFIX}`,\n});\n\n// Rimuove i layer di evidenza prima di rimuovere o ricreare la source di riferimento.\nconst rimuoviEvidenzaLayerMaplibre = (map, layerConfig) => {\n  const layerIds = layerIdsEvidenzaMaplibre(layerConfig);\n  if (map.getLayer(layerIds.line)) map.removeLayer(layerIds.line);\n  if (map.getLayer(layerIds.fill)) map.removeLayer(layerIds.fill);\n};\n\n// Crea il filtro MapLibre che seleziona tutte le geometrie con lo stesso foglio, mappale e sezione.\nconst filtroEvidenzaMaplibre = (selection) => [\n  \"all\",\n  [\"==\", [\"to-string\", [\"get\", \"foglio\"]], String(selection.foglio || \"\")],\n  [\"==\", [\"to-string\", [\"get\", \"numero\"]], String(selection.numero || \"\")],\n  [\"==\", [\"coalesce\", [\"get\", \"sezione\"], \"\"], String(selection.sezione || \"\")],\n];\n\n// Aggiunge o aggiorna l'evidenza MapLibre con bordo sottile sopra alle geometrie dello stesso immobile selezionato.\nconst aggiornaEvidenzaRicercaMaplibre = (map) => {\n  if (!map?.isStyleLoaded?.()) return;\n\n  const selection = window.elinkMappeSelectedResult;\n  Object.entries(MAPPE_VECTOR_LAYER_CONFIGS).forEach(([layerKey, layerConfig]) => {\n    rimuoviEvidenzaLayerMaplibre(map, layerConfig);\n    if (!selection || selection.dataset !== layerConfig.dataset || (selection.layer || \"\") !== (layerConfig.layer || \"\")) return;\n    if (!map.getSource(layerConfig.sourceId) || !map.getLayer(layerConfig.fillLayerId)) return;\n\n    const layerIds = layerIdsEvidenzaMaplibre(layerConfig);\n    const sourceLayer = layerConfig.sourceLayer ? { \"source-layer\": layerConfig.sourceLayer } : {};\n    const filter = filtroEvidenzaMaplibre(selection);\n\n    map.addLayer({\n      id: layerIds.fill,\n      type: \"fill\",\n      source: layerConfig.sourceId,\n      ...sourceLayer,\n      filter,\n      paint: {\n        \"fill-color\": \"#fff176\",\n        \"fill-opacity\": 0.36,\n      },\n    });\n\n    map.addLayer({\n      id: layerIds.line,\n      type: \"line\",\n      source: layerConfig.sourceId,\n      ...sourceLayer,\n      filter,\n      paint: {\n        \"line-color\": \"#111827\",\n        \"line-width\": [\"interpolate\", [\"linear\"], [\"zoom\"], 12, 1.5, 19, 3],\n        \"line-opacity\": 0.95,\n      },\n    });\n  });\n};\n\n// Riapplica l'ordine visivo dei layer MapLibre mantenendo sempre i fabbricati sopra i terreni.\nconst aggiornaOrdineLayerMaplibreMappe = (map) => {\n  MAPPE_VECTOR_LAYER_ORDER.forEach((layerKey) => {\n    const layerConfig = MAPPE_VECTOR_LAYER_CONFIGS[layerKey];\n    if (layerConfig && map.getLayer(layerConfig.fillLayerId)) map.moveLayer(layerConfig.fillLayerId);\n    if (layerConfig && map.getLayer(layerConfig.lineLayerId)) map.moveLayer(layerConfig.lineLayerId);\n    const layerIds = layerConfig ? layerIdsEvidenzaMaplibre(layerConfig) : null;\n    if (layerIds && map.getLayer(layerIds.fill)) map.moveLayer(layerIds.fill);\n    if (layerIds && map.getLayer(layerIds.line)) map.moveLayer(layerIds.line);\n  });\n  if (map.getLayer(MAPPE_FABBRICATI_LABEL_LAYER_ID)) map.moveLayer(MAPPE_FABBRICATI_LABEL_LAYER_ID);\n};\n\n// Aggiorna il viewer MapLibre aggiungendo o rimuovendo i layer catastali in base ai checkbox selezionati nel pannello laterale.\nconst aggiornaLayerViewerMaplibre = async () => {\n  const map = window.elinkMappeVectorViewer;\n  if (!map || !map.isStyleLoaded()) return;\n\n  const layerKeysSelezionati = layerSelezionatiMappa().map((layer) => layer.key);\n  const messageNode = document.querySelector(\"[data-mappe-mappa-messaggio]\");\n\n  try {\n    for (const [layerKey, layerConfig] of Object.entries(MAPPE_VECTOR_LAYER_CONFIGS)) {\n      if (layerKeysSelezionati.includes(layerKey) && layerConfig.geojson) {\n        await aggiornaLayerGeojsonMaplibreMappe(map, { ...layerConfig, key: layerKey });\n      } else if (layerKeysSelezionati.includes(layerKey) && urlTilesetLayerMappe(layerKey)) {\n        aggiungiLayerMaplibreMappe(map, layerKey, layerConfig);\n      } else {\n        rimuoviLayerMaplibreMappe(map, layerConfig);\n      }\n    }\n    await aggiornaEtichetteFabbricatiMaplibre(map, layerKeysSelezionati);\n    aggiornaEvidenzaRicercaMaplibre(map);\n  } catch (error) {\n    if (messageNode) messageNode.textContent = \"Errore nel caricamento del layer dinamico delle schede.\";\n    // Mantiene visibile in console il dettaglio tecnico della chiamata fallita senza interrompere il viewer.\n    console.error(error);\n    mostraIndicatoreLayerMappe(false);\n  }\n\n  if (!layerKeysSelezionati.includes(\"fabbricati\") && !layerKeysSelezionati.includes(\"schede\")) chiudiMenuRadialeFabbricatiMappe();\n\n  if (!window.elinkMappeVectorInteractionsReady) {\n    inizializzaInterazioniViewerMaplibre(map);\n    window.elinkMappeVectorInteractionsReady = true;\n  }\n\n  aggiornaOrdineLayerMaplibreMappe(map);\n  aggiornaLegendaViewerMappe(layerSelezionatiMappa());\n  aggiornaRiepilogoViewerMappe(\n    layerSelezionatiMappa().map((layerConfig) => window.elinkMappeLayerState?.[layerConfig.key]).filter(Boolean),\n    layerSelezionatiMappa()\n  );\n};\n\n// Gestisce il click sulla feature vettoriale in primo piano aprendo popup o menu radiale in modo coerente con il dataset associato al layer.\nconst gestisciClickFeatureMaplibre = async (map, event, layerKey, feature) => {\n  const layerConfig = MAPPE_VECTOR_LAYER_CONFIGS[layerKey];\n  if (!layerConfig || !feature) return;\n\n  if (layerConfig.dataset === \"schede\") {\n    try {\n      chiudiOverlayInterattiviMappe();\n      selezionaRisultatoMappa(riferimentoSelezioneMappa(feature.properties || {}, layerConfig.dataset, layerConfig.layer));\n      await caricaMenuRadialeSchedeMappe({ properties: feature.properties || {} }, event.lngLat);\n    } catch (_error) {\n      const popup = new window.maplibregl.Popup({ closeButton: false, closeOnClick: false, maxWidth: \"320px\" })\n        .setLngLat(event.lngLat)\n        .setHTML(\"Nessuna scheda disponibile per il fabbricato selezionato.\")\n        .addTo(map);\n      bloccaPropagazionePopupMappe(popup.getElement());\n    }\n    return;\n  }\n\n  if (layerConfig.dataset !== \"fabbricati\") {\n    chiudiOverlayInterattiviMappe();\n    const properties = layerConfig.dataset === \"terreni\"\n      ? await caricaDettaglioTerrenoMappe(feature.properties || {})\n      : feature.properties || {};\n    selezionaRisultatoMappa(riferimentoSelezioneMappa(properties, layerConfig.dataset, layerConfig.layer));\n    const popup = new window.maplibregl.Popup({ closeButton: false, closeOnClick: false, maxWidth: \"320px\" })\n      .setLngLat(event.lngLat)\n      .setHTML(popupFeatureMaplibre(properties, layerConfig))\n      .addTo(map);\n    bloccaPropagazionePopupMappe(popup.getElement());\n    return;\n  }\n\n  try {\n    chiudiOverlayInterattiviMappe();\n    selezionaRisultatoMappa(riferimentoSelezioneMappa(feature.properties || {}, layerConfig.dataset, layerConfig.layer));\n    await caricaMenuRadialeFabbricatiMappe({ properties: feature.properties || {} }, event.lngLat);\n  } catch (_error) {\n    const popup = new window.maplibregl.Popup({ closeButton: false, closeOnClick: false, maxWidth: \"320px\" })\n      .setLngLat(event.lngLat)\n      .setHTML(\"Nessun subalterno disponibile per il fabbricato selezionato.\")\n      .addTo(map);\n    bloccaPropagazionePopupMappe(popup.getElement());\n  }\n};\n\n// Restituisce gli id dei layer MapLibre interrogabili, includendo fill e line per rendere il click piu' tollerante sui bordi.\nconst layerIdsInterattiviMaplibre = (map) => MAPPE_VECTOR_LAYER_ORDER\n  .slice()\n  .reverse()\n  .flatMap((layerKey) => {\n    const layerConfig = MAPPE_VECTOR_LAYER_CONFIGS[layerKey];\n    return [layerConfig?.fillLayerId, layerConfig?.lineLayerId];\n  })\n  .filter((layerId) => layerId && map.getLayer(layerId));\n\n// Restituisce la chiave logica del layer partendo dall'id MapLibre della feature renderizzata.\nconst layerKeyDaLayerIdMaplibre = (layerId) => Object.keys(MAPPE_VECTOR_LAYER_CONFIGS)\n  .find((key) => {\n    const layerConfig = MAPPE_VECTOR_LAYER_CONFIGS[key];\n    return layerConfig.fillLayerId === layerId || layerConfig.lineLayerId === layerId;\n  });\n\n// Restituisce la feature vettoriale in primo piano nel punto cliccato, con una piccola tolleranza attorno al puntatore.\nconst featureTopmostMaplibre = (map, point) => {\n  if (!map?.queryRenderedFeatures) return null;\n\n  const orderedLayerIds = layerIdsInterattiviMaplibre(map);\n  const queryArea = [\n    [point.x - 4, point.y - 4],\n    [point.x + 4, point.y + 4],\n  ];\n\n  const feature = map.queryRenderedFeatures(queryArea, { layers: orderedLayerIds })[0];\n  if (!feature) return null;\n\n  const layerKey = layerKeyDaLayerIdMaplibre(feature.layer.id);\n  if (!layerKey) return null;\n\n  return { layerKey, feature };\n};\n\n// Registra le interazioni di click e hover dei layer MapLibre mantenendo una sola azione per click anche quando i layer sono sovrapposti.\nconst inizializzaInterazioniViewerMaplibre = (map) => {\n  map.on(\"click\", async (event) => {\n    const topmost = featureTopmostMaplibre(map, event.point);\n    if (!topmost) {\n      chiudiOverlayInterattiviMappe();\n      return;\n    }\n\n    await gestisciClickFeatureMaplibre(map, event, topmost.layerKey, topmost.feature);\n  });\n\n  map.on(\"mousemove\", (event) => {\n    map.getCanvas().style.cursor = featureTopmostMaplibre(map, event.point) ? \"pointer\" : \"\";\n  });\n\n  map.on(\"move\", aggiornaPosizioneMenuRadialeFabbricatiMappe);\n  map.on(\"zoom\", aggiornaPosizioneMenuRadialeFabbricatiMappe);\n  map.on(\"moveend\", pianificaAggiornamentoViewportMaplibreMappe);\n  map.on(\"zoomend\", pianificaAggiornamentoViewportMaplibreMappe);\n  map.on(\"rotate\", aggiornaPosizioneMenuRadialeFabbricatiMappe);\n  map.on(\"pitch\", aggiornaPosizioneMenuRadialeFabbricatiMappe);\n};\n\n// Rimuove in modo idempotente il viewer corrente evitando di chiamare due volte remove sulla stessa istanza condivisa tra riferimenti globali.\nconst distruggiViewerCorrenteMappe = () => {\n  const viewer = window.elinkMappeVectorViewer || window.elinkMappeViewer;\n  if (!viewer?.remove) return;\n\n  viewer.remove();\n  window.elinkMappeViewer = null;\n  window.elinkMappeVectorViewer = null;\n};\n\n// Inizializza il viewer MapLibre per i layer tile-based mantenendo overlay, legenda e controlli custom coerenti con il viewer precedente.\nconst inizializzaViewerMaplibreMappe = () => {\n  const container = document.querySelector(\"[data-mappe-leaflet]\");\n  if (!container || !viewerMaplibreAttivoMappe()) return false;\n\n  distruggiViewerCorrenteMappe();\n\n  const map = new window.maplibregl.Map({\n    container,\n    style: {\n      version: 8,\n      glyphs: \"https://demotiles.maplibre.org/font/{fontstack}/{range}.pbf\",\n      sources: {\n        [MAPPE_BASELAYER_SOURCE_IDS.chiara]: {\n          type: \"raster\",\n          tiles: [\"https://a.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png\"],\n          tileSize: 256,\n          attribution: \"&copy; OpenStreetMap contributors &copy; CARTO\",\n        },\n        [MAPPE_BASELAYER_SOURCE_IDS.satellitare]: {\n          type: \"raster\",\n          tiles: [\"https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}\"],\n          tileSize: 256,\n          attribution: \"Tiles &copy; Esri\",\n        },\n      },\n      layers: [\n        {\n          id: MAPPE_BASELAYER_LAYER_IDS.chiara,\n          type: \"raster\",\n          source: MAPPE_BASELAYER_SOURCE_IDS.chiara,\n        },\n        {\n          id: MAPPE_BASELAYER_LAYER_IDS.satellitare,\n          type: \"raster\",\n          source: MAPPE_BASELAYER_SOURCE_IDS.satellitare,\n          layout: { visibility: \"none\" },\n        },\n      ],\n    },\n    center: [MAPPE_FALLBACK_CENTER[1], MAPPE_FALLBACK_CENTER[0]],\n    zoom: MAPPE_FALLBACK_ZOOM,\n    attributionControl: false,\n  });\n\n  map.addControl(new window.maplibregl.AttributionControl({ compact: true }), \"bottom-right\");\n  map.addControl(new window.maplibregl.NavigationControl({ visualizePitch: false }), \"bottom-right\");\n  map.on(\"load\", () => {\n    window.elinkMappeBaseLayerKey = \"chiara\";\n    applicaBaseLayerMaplibre(map, window.elinkMappeBaseLayerKey);\n    aggiungiSelettoreBaseLayerMaplibre(map);\n    applicaVincoliComuneMappeMaplibre(map);\n    aggiornaLayerViewerMaplibre();\n  });\n\n  window.elinkMappeVectorViewer = map;\n  window.elinkMappeViewer = map;\n  window.elinkMappeVectorInteractionsReady = false;\n  return true;\n};\n\n// Costruisce i layer base disponibili per il viewer, mantenendo una mappa chiara di default e una variante satellitare selezionabile.\nconst costruisciBaseLayerMappe = () => {\n  const chiara = window.L.tileLayer(\"https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}{r}.png\", {\n    subdomains: \"abcd\",\n    attribution: \"&copy; OpenStreetMap contributors &copy; CARTO\",\n    maxZoom: 19,\n  });\n\n  const satellitare = window.L.tileLayer(\"https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}\", {\n    attribution: \"Tiles &copy; Esri\",\n    maxZoom: 19,\n  });\n\n  return {\n    chiara,\n    satellitare,\n  };\n};\n\n// Applica il layer base richiesto al viewer rimuovendo quello precedente e mantenendo traccia della scelta corrente.\nconst applicaBaseLayerMappe = (map, baseLayers, baseLayerKey) => {\n  if (!map || !baseLayers || !baseLayers[baseLayerKey]) return;\n\n  Object.entries(baseLayers).forEach(([key, layer]) => {\n    if (key === baseLayerKey) {\n      if (!map.hasLayer(layer)) layer.addTo(map);\n    } else if (map.hasLayer(layer)) {\n      map.removeLayer(layer);\n    }\n  });\n\n  window.elinkMappeBaseLayerKey = baseLayerKey;\n};\n\n// Aggiorna lo stato visivo della tray dei layer base, evidenziando l'opzione attiva e sincronizzando la preview compatta.\nconst aggiornaStatoSelettoreBaseLayerMappe = (container) => {\n  if (!container) return;\n\n  const currentKey = window.elinkMappeBaseLayerKey || \"chiara\";\n  const previewLabel = container.querySelector(\"[data-mappe-baselayer-preview-label]\");\n  const previewThumb = container.querySelector(\"[data-mappe-baselayer-preview-thumb]\");\n  container.querySelectorAll(\"[data-mappe-baselayer-option]\").forEach((button) => {\n    const active = button.dataset.mappeBaselayerOption === currentKey;\n    button.classList.toggle(\"d-none\", active);\n  });\n\n  if (previewLabel) previewLabel.textContent = currentKey === \"satellitare\" ? \"Satellitare\" : \"Mappa\";\n  if (previewThumb) previewThumb.style.background = currentKey === \"satellitare\"\n    ? \"linear-gradient(135deg, #41643d 0%, #41643d 28%, #7d8f52 28%, #7d8f52 48%, #8c7453 48%, #8c7453 67%, #c5b58a 67%, #c5b58a 100%)\"\n    : \"linear-gradient(180deg, #d8e8cf 0%, #d8e8cf 42%, #c9c9c9 42%, #c9c9c9 52%, #f2efe4 52%, #f2efe4 100%)\";\n};\n\n// Mostra o nasconde la tray dei layer base in hover, mantenendo sempre visibile la preview compatta della mappa attiva.\nconst mostraMenuBaseLayerMappe = (container, visible) => {\n  if (!container) return;\n\n  const menu = container.querySelector(\"[data-mappe-baselayer-menu]\");\n  if (!menu) return;\n\n  menu.classList.toggle(\"d-none\", !visible);\n};\n\n// Annulla l'eventuale chiusura differita del menu layer base, mantenendolo aperto finche' il mouse resta nell'area di controllo.\nconst annullaChiusuraMenuBaseLayerMappe = (container) => {\n  if (!container?.mappeBaseLayerHideTimer) return;\n\n  window.clearTimeout(container.mappeBaseLayerHideTimer);\n  container.mappeBaseLayerHideTimer = null;\n};\n\n// Pianifica la chiusura ritardata del menu layer base, cosi' l'utente ha tempo di spostare il mouse sulle opzioni.\nconst pianificaChiusuraMenuBaseLayerMappe = (container) => {\n  if (!container) return;\n\n  annullaChiusuraMenuBaseLayerMappe(container);\n  container.mappeBaseLayerHideTimer = window.setTimeout(() => {\n    mostraMenuBaseLayerMappe(container, false);\n    container.mappeBaseLayerHideTimer = null;\n  }, 1000);\n};\n\n// Restituisce la prossima mappa base disponibile, cosi' il click sulla preview cicla direttamente tra le alternative.\nconst prossimaBaseLayerMappe = () => ((window.elinkMappeBaseLayerKey || \"chiara\") === \"chiara\" ? \"satellitare\" : \"chiara\");\n\n// Restituisce il markup condiviso del selettore hover della mappa base, usato sia dal viewer Leaflet sia dal viewer MapLibre.\nconst markupSelettoreBaseLayerMappe = () => `\n  <button type=\"button\"\n          class=\"bg-white border rounded-3 shadow-sm d-flex align-items-end position-relative overflow-hidden p-0\"\n          title=\"Cambia mappa base\"\n          aria-label=\"Cambia mappa base\"\n          style=\"width: 84px; height: 64px;\"\n          data-mappe-baselayer-preview>\n    <span class=\"position-absolute top-0 start-0 w-100 h-100\"\n          style=\"background: linear-gradient(180deg, #d8e8cf 0%, #d8e8cf 42%, #c9c9c9 42%, #c9c9c9 52%, #f2efe4 52%, #f2efe4 100%);\"\n          data-mappe-baselayer-preview-thumb></span>\n    <span class=\"position-absolute bottom-0 start-0 w-100 px-2 py-1 text-white fw-semibold\"\n          style=\"font-size: 0.72rem; background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.68) 100%);\"\n          data-mappe-baselayer-preview-label>Mappa</span>\n  </button>\n  <div class=\"d-none bg-white border rounded-3 shadow-sm position-absolute p-2\"\n       style=\"left: calc(100% + 10px); bottom: 0; min-width: 84px; z-index: 1000;\"\n       data-mappe-baselayer-menu>\n    <div class=\"d-flex align-items-stretch\">\n      <button type=\"button\"\n              class=\"btn btn-sm d-flex flex-column align-items-start gap-1 text-start rounded-3 px-2 py-2 border\"\n              data-mappe-baselayer-option=\"chiara\">\n        <span class=\"d-inline-flex rounded-2 border flex-shrink-0 overflow-hidden\"\n              style=\"width: 64px; height: 46px; background: linear-gradient(180deg, #d8e8cf 0%, #d8e8cf 42%, #c9c9c9 42%, #c9c9c9 52%, #f2efe4 52%, #f2efe4 100%);\"></span>\n        <span class=\"text-dark fw-semibold lh-sm fs--2\">Mappa</span>\n      </button>\n      <button type=\"button\"\n              class=\"btn btn-sm d-flex flex-column align-items-start gap-1 text-start rounded-3 px-2 py-2 border\"\n              data-mappe-baselayer-option=\"satellitare\">\n        <span class=\"d-inline-flex rounded-2 border flex-shrink-0 overflow-hidden\"\n              style=\"width: 64px; height: 46px; background: linear-gradient(135deg, #41643d 0%, #41643d 28%, #7d8f52 28%, #7d8f52 48%, #8c7453 48%, #8c7453 67%, #c5b58a 67%, #c5b58a 100%);\"></span>\n        <span class=\"text-dark fw-semibold lh-sm fs--2\">Satellitare</span>\n      </button>\n    </div>\n  </div>\n`;\n\n// Aggiunge al viewer una preview-card hover dei layer base, con tray orizzontale simile ai controlli dei viewer cartografici moderni.\nconst aggiungiSelettoreBaseLayerMappe = (map, baseLayers) => {\n  if (!map || !baseLayers) return;\n\n  const BaseLayerControl = window.L.Control.extend({\n    options: {\n      position: \"bottomleft\",\n    },\n\n    onAdd() {\n      const container = window.L.DomUtil.create(\"div\", \"position-relative\");\n      container.style.overflow = \"visible\";\n      container.innerHTML = markupSelettoreBaseLayerMappe();\n\n      window.L.DomEvent.disableClickPropagation(container);\n      window.L.DomEvent.disableScrollPropagation(container);\n\n      const menu = container.querySelector(\"[data-mappe-baselayer-menu]\");\n      const preview = container.querySelector(\"[data-mappe-baselayer-preview]\");\n\n      preview.addEventListener(\"click\", () => {\n        applicaBaseLayerMappe(map, baseLayers, prossimaBaseLayerMappe());\n        aggiornaStatoSelettoreBaseLayerMappe(container);\n      });\n\n      container.addEventListener(\"mouseenter\", () => {\n        annullaChiusuraMenuBaseLayerMappe(container);\n        mostraMenuBaseLayerMappe(container, true);\n      });\n\n      container.addEventListener(\"mouseleave\", () => {\n        pianificaChiusuraMenuBaseLayerMappe(container);\n      });\n\n      container.querySelectorAll(\"[data-mappe-baselayer-option]\").forEach((button) => {\n        button.addEventListener(\"click\", () => {\n          const baseLayerKey = button.dataset.mappeBaselayerOption;\n          applicaBaseLayerMappe(map, baseLayers, baseLayerKey);\n          aggiornaStatoSelettoreBaseLayerMappe(container);\n          mostraMenuBaseLayerMappe(container, false);\n          annullaChiusuraMenuBaseLayerMappe(container);\n        });\n      });\n\n      aggiornaStatoSelettoreBaseLayerMappe(container);\n      return container;\n    },\n  });\n\n  const control = new BaseLayerControl();\n  map.addControl(control);\n};\n\n// Applica al viewer MapLibre il layer base richiesto mostrando solo il raster attivo e mantenendo traccia della scelta corrente.\nconst applicaBaseLayerMaplibre = (map, baseLayerKey) => {\n  if (!map) return;\n\n  Object.entries(MAPPE_BASELAYER_LAYER_IDS).forEach(([key, layerId]) => {\n    if (map.getLayer(layerId)) map.setLayoutProperty(layerId, \"visibility\", key === baseLayerKey ? \"visible\" : \"none\");\n  });\n\n  window.elinkMappeBaseLayerKey = baseLayerKey;\n};\n\n// Aggiunge al viewer MapLibre il selettore hover della mappa base riusando la stessa UI compatta del viewer Leaflet.\nconst aggiungiSelettoreBaseLayerMaplibre = (map) => {\n  if (!map?.getContainer) return;\n\n  const previousControl = map.getContainer().querySelector(\"[data-mappe-maplibre-baselayer-control]\");\n  if (previousControl) previousControl.remove();\n\n  const container = document.createElement(\"div\");\n  container.className = \"position-absolute\";\n  container.style.left = \"16px\";\n  container.style.bottom = \"16px\";\n  container.style.zIndex = \"1000\";\n  container.style.overflow = \"visible\";\n  container.dataset.mappeMaplibreBaselayerControl = \"true\";\n  container.innerHTML = markupSelettoreBaseLayerMappe();\n\n  const preview = container.querySelector(\"[data-mappe-baselayer-preview]\");\n\n  preview.addEventListener(\"click\", () => {\n    applicaBaseLayerMaplibre(map, prossimaBaseLayerMappe());\n    aggiornaStatoSelettoreBaseLayerMappe(container);\n  });\n\n  container.addEventListener(\"mouseenter\", () => {\n    annullaChiusuraMenuBaseLayerMappe(container);\n    mostraMenuBaseLayerMappe(container, true);\n  });\n\n  container.addEventListener(\"mouseleave\", () => {\n    pianificaChiusuraMenuBaseLayerMappe(container);\n  });\n\n  container.querySelectorAll(\"[data-mappe-baselayer-option]\").forEach((button) => {\n    button.addEventListener(\"click\", () => {\n      applicaBaseLayerMaplibre(map, button.dataset.mappeBaselayerOption);\n      aggiornaStatoSelettoreBaseLayerMappe(container);\n      mostraMenuBaseLayerMappe(container, false);\n      annullaChiusuraMenuBaseLayerMappe(container);\n    });\n  });\n\n  aggiornaStatoSelettoreBaseLayerMappe(container);\n  map.getContainer().appendChild(container);\n};\n\n// Restituisce il bbox e lo zoom della viewport corrente, usando il viewer attivo per servire solo le geometrie necessarie alla vista.\nconst viewportCorrenteMappe = () => {\n  const map = window.elinkMappeVectorViewer || window.elinkMappeViewer;\n  if (!map) return { bbox: \"\", zoom: 0, key: \"0:\" };\n\n  const bounds = map.getBounds();\n  const zoom = map.getZoom();\n  const bbox = bboxNormalizzatoMappe(bounds, zoom).join(\",\");\n\n  return { bbox, zoom, key: `${zoom}:${bbox}` };\n};\n\n// Rimuove dalla mappa il singolo layer richiesto e pulisce lo stato locale associato.\nconst rimuoviLayerViewerMappe = (layerKey) => {\n  const layer = window.elinkMappeGeojsonLayers?.[layerKey];\n  if (layer) layer.remove();\n\n  if (window.elinkMappeGeojsonLayers) delete window.elinkMappeGeojsonLayers[layerKey];\n  if (window.elinkMappeLayerState) delete window.elinkMappeLayerState[layerKey];\n  aggiornaEvidenzaRicercaLeaflet();\n};\n\n// Riapplica l'ordine visivo dei layer mantenendo schede e fabbricati sopra i terreni quando sono presenti.\nconst aggiornaOrdineLayerMappe = () => {\n  const map = window.elinkMappeViewer;\n  const layers = window.elinkMappeGeojsonLayers || {};\n  if (!map) return;\n\n  MAPPE_VECTOR_LAYER_ORDER.forEach((layerKey) => {\n    const layer = layers[layerKey];\n    if (layer?.bringToFront) layer.bringToFront();\n  });\n};\n\n// Elimina dalla mappa solo i layer non piu' selezionati, mantenendo visibili quelli che non hanno cambiato stato.\nconst rimuoviLayerDeselezionatiMappe = (layerKeysSelezionati) => {\n  Object.keys(window.elinkMappeGeojsonLayers || {}).forEach((layerKey) => {\n    if (!layerKeysSelezionati.includes(layerKey)) rimuoviLayerViewerMappe(layerKey);\n  });\n};\n\n// Aggiorna l'estensione della mappa usando solo i layer attualmente visibili dopo l'ultima variazione di selezione.\nconst aggiornaBoundsViewerMappe = () => {\n  const map = window.elinkMappeViewer;\n  if (!map) return;\n\n  const combinedBounds = window.L.latLngBounds([]);\n  Object.values(window.elinkMappeGeojsonLayers || {}).forEach((layer) => {\n    const bounds = layer.getBounds();\n    if (bounds.isValid()) combinedBounds.extend(bounds);\n  });\n\n  if (combinedBounds.isValid()) {\n    map.fitBounds(combinedBounds, { padding: [24, 24] });\n  }\n};\n\n// Carica un singolo layer catastale dal backend e restituisce il relativo payload GeoJSON.\nconst caricaPayloadLayerMappe = async (layerConfig) => {\n  const viewport = viewportCorrenteMappe();\n  const payloadCached = leggiCacheLayerMappe(layerConfig, viewport.key);\n  if (payloadCached) return { payload: payloadCached, viewportKey: viewport.key, source: \"cache_client\" };\n\n  const url = urlLayerCatastoMappe();\n  url.searchParams.set(\"dataset\", layerConfig.dataset);\n  if (layerConfig.dataset === \"terreni\") url.searchParams.set(\"layer\", layerConfig.layer);\n  if (layerConfig.dataset === \"schede\" && schedaFocusMappe()) url.searchParams.set(\"scheda_id\", schedaFocusMappe());\n  url.searchParams.set(\"bbox\", viewport.bbox);\n  url.searchParams.set(\"zoom\", viewport.zoom);\n\n  const response = await fetch(url.toString(), {\n    headers: { Accept: \"application/json\" },\n    credentials: \"same-origin\",\n  });\n\n  if (!response.ok) throw new Error(\"Errore nel caricamento del layer mappa.\");\n\n  const payload = await response.json();\n  scriviCacheLayerMappe(layerConfig, viewport.key, payload);\n  return { payload, viewportKey: viewport.key, source: \"fetch\" };\n};\n\n// Disegna o sostituisce il layer richiesto in mappa, aggiornando lo stato locale senza toccare i layer invariati.\nconst disegnaLayerViewerMappe = (payload, layerConfig, viewportKey, source) => {\n  const map = window.elinkMappeViewer;\n  if (!map) return;\n\n  rimuoviLayerViewerMappe(layerConfig.key);\n\n  const geojsonLayer = window.L.geoJSON(payload.features || [], {\n    style: (feature) => stileFeatureMappa(layerConfig.dataset, layerConfig.layer, feature),\n    onEachFeature: (feature, leafletLayer) => {\n      collegaInterazioneFeatureMappa(feature, leafletLayer, layerConfig);\n    },\n  });\n\n  geojsonLayer.addTo(map);\n  window.elinkMappeGeojsonLayers[layerConfig.key] = geojsonLayer;\n  window.elinkMappeLayerState[layerConfig.key] = { config: layerConfig, payload, viewportKey, source };\n  aggiornaOrdineLayerMappe();\n  aggiornaEvidenzaRicercaLeaflet();\n};\n\n// Rimuove dal fallback Leaflet il layer di evidenza della selezione corrente.\nconst rimuoviEvidenzaRicercaLeaflet = () => {\n  const layer = window.elinkMappeSelectionLayer;\n  if (layer?.remove) layer.remove();\n\n  window.elinkMappeSelectionLayer = null;\n};\n\n// Aggiorna l'evidenza Leaflet con bordo sottile duplicando le geometrie dello stesso immobile selezionato.\nconst aggiornaEvidenzaRicercaLeaflet = () => {\n  const map = window.elinkMappeViewer;\n  const selection = window.elinkMappeSelectedResult;\n  if (!map || !window.L) return;\n\n  rimuoviEvidenzaRicercaLeaflet();\n  if (!selection) return;\n\n  const features = Object.values(window.elinkMappeLayerState || {}).flatMap((layerState) => {\n    const config = layerState.config || {};\n    if (config.dataset !== selection.dataset || (config.layer || \"\") !== (selection.layer || \"\")) return [];\n\n    return (layerState.payload?.features || []).filter((feature) => {\n      const properties = feature.properties || {};\n      return String(properties.foglio || \"\") === String(selection.foglio || \"\")\n        && String(properties.numero || \"\") === String(selection.numero || \"\")\n        && String(properties.sezione || \"\") === String(selection.sezione || \"\");\n    });\n  });\n\n  if (!features.length) return;\n\n  const selectionLayer = window.L.geoJSON(features, {\n    interactive: false,\n    style: {\n      color: \"#111827\",\n      weight: 2.5,\n      opacity: 0.95,\n      fillColor: \"#fff176\",\n      fillOpacity: 0.28,\n    },\n  });\n  selectionLayer.addTo(map);\n  if (selectionLayer.bringToFront) selectionLayer.bringToFront();\n  window.elinkMappeSelectionLayer = selectionLayer;\n};\n\n// Rimuove dal viewer Leaflet il layer dedicato alle etichette dei conteggi sui fabbricati.\nconst rimuoviEtichetteFabbricatiLeaflet = () => {\n  const layer = window.elinkMappeFabbricatiLabelLayer;\n  if (layer?.remove) layer.remove();\n\n  window.elinkMappeFabbricatiLabelLayer = null;\n};\n\n// Disegna nel fallback Leaflet le etichette puntuali dentro ai fabbricati usando divIcon compatte.\nconst disegnaEtichetteFabbricatiLeaflet = (payload) => {\n  const map = window.elinkMappeViewer;\n  if (!map || !window.L) return;\n\n  rimuoviEtichetteFabbricatiLeaflet();\n\n  const labelLayer = window.L.geoJSON(payload.features || [], {\n    pointToLayer: (feature, latlng) => window.L.marker(latlng, {\n      interactive: false,\n      keyboard: false,\n      icon: window.L.divIcon({\n        className: \"mappe-fabbricato-label\",\n        html: escapeHtmlMappe(feature?.properties?.label || \"\").replaceAll(\"\\n\", \"<br>\"),\n        iconSize: null,\n        iconAnchor: [16, 10],\n      }),\n    }),\n  });\n\n  labelLayer.addTo(map);\n  window.elinkMappeFabbricatiLabelLayer = labelLayer;\n};\n\n// Aggiorna nel fallback Leaflet le etichette dei fabbricati in base ai layer visibili e alla viewport corrente.\nconst aggiornaEtichetteFabbricatiLeaflet = async (layerKeysSelezionati) => {\n  const modalita = modalitaEtichetteFabbricatiMappe(layerKeysSelezionati);\n  if (!modalita.length) {\n    rimuoviEtichetteFabbricatiLeaflet();\n    return;\n  }\n\n  const requestId = prossimoIdRichiestaEtichetteMappe();\n  const payload = await caricaEtichetteFabbricatiMappe(modalita);\n  if (window.elinkMappeLabelRequestId !== requestId) return;\n\n  disegnaEtichetteFabbricatiLeaflet(payload);\n};\n\n// Carica i layer selezionati dal backend aggiungendo o rimuovendo solo quelli variati, senza alterare la viewport corrente salvo richiesta esplicita.\nconst caricaLayerViewerMappe = async (options = {}) => {\n  const { aggiornaVista = false } = options;\n  const selezionati = layerSelezionatiMappa();\n  const messageNode = document.querySelector(\"[data-mappe-mappa-messaggio]\");\n  const viewport = viewportCorrenteMappe();\n  if (!window.elinkMappeViewer) return;\n\n  if (messageNode) messageNode.textContent = \"Caricamento layer in corso...\";\n  mostraIndicatoreLayerMappe(true);\n  window.elinkMappeGeojsonLayers = window.elinkMappeGeojsonLayers || {};\n  window.elinkMappeLayerState = window.elinkMappeLayerState || {};\n\n  rimuoviLayerDeselezionatiMappe(selezionati.map((layer) => layer.key));\n\n  if (!selezionati.length) {\n    rimuoviEtichetteFabbricatiLeaflet();\n    aggiornaRiepilogoViewerMappe([], []);\n    mostraIndicatoreLayerMappe(false);\n    return;\n  }\n\n  const layerDaCaricare = selezionati.filter((layer) => !window.elinkMappeLayerState[layer.key] || window.elinkMappeLayerState[layer.key].viewportKey !== viewport.key);\n\n  try {\n    const payloads = await Promise.all(layerDaCaricare.map((layerConfig) => caricaPayloadLayerMappe(layerConfig)));\n    payloads.forEach((result, index) => {\n      disegnaLayerViewerMappe(result.payload, layerDaCaricare[index], result.viewportKey, result.source);\n    });\n    await aggiornaEtichetteFabbricatiLeaflet(selezionati.map((layer) => layer.key));\n  } catch (_error) {\n    if (messageNode) messageNode.textContent = \"Errore nel caricamento del layer mappa.\";\n    mostraIndicatoreLayerMappe(false);\n    return;\n  }\n\n  const layerStatesAttivi = selezionati\n    .map((layerConfig) => window.elinkMappeLayerState[layerConfig.key])\n    .filter(Boolean);\n\n  aggiornaRiepilogoViewerMappe(layerStatesAttivi, selezionati);\n  if (aggiornaVista) aggiornaBoundsViewerMappe();\n  mostraIndicatoreLayerMappe(false);\n};\n\n// Pianifica il refresh dei layer quando l'utente cambia viewport, evitando richieste ripetute durante il movimento della mappa.\nconst pianificaAggiornamentoViewportMappe = () => {\n  if (window.elinkMappeRefreshTimer) window.clearTimeout(window.elinkMappeRefreshTimer);\n\n  window.elinkMappeRefreshTimer = window.setTimeout(() => {\n    if (!preservaOverlayDuranteRefreshMappe()) chiudiMenuRadialeFabbricatiMappe();\n    caricaLayerViewerMappe({ aggiornaVista: false });\n  }, 250);\n};\n\n// Pianifica il refresh dei layer GeoJSON dinamici nel viewer MapLibre quando cambia la viewport.\nconst pianificaAggiornamentoViewportMaplibreMappe = () => {\n  const layerKeysSelezionati = layerSelezionatiMappa().map((layer) => layer.key);\n  if (!layerKeysSelezionati.some((layerKey) => MAPPE_VECTOR_LAYER_CONFIGS[layerKey]?.geojson) && !modalitaEtichetteFabbricatiMappe(layerKeysSelezionati).length) return;\n  if (window.elinkMappeVectorRefreshTimer) window.clearTimeout(window.elinkMappeVectorRefreshTimer);\n\n  window.elinkMappeVectorRefreshTimer = window.setTimeout(() => {\n    if (!preservaOverlayDuranteRefreshMappe()) chiudiMenuRadialeFabbricatiMappe();\n    aggiornaLayerViewerMaplibre();\n  }, 250);\n};\n\n// Inizializza la mappa Leaflet della schermata Mappa e carica automaticamente il layer iniziale di default.\nconst inizializzaViewerMappe = () => {\n  const container = document.querySelector(\"[data-mappe-leaflet]\");\n  if (!container || !window.L || viewerMaplibreAttivoMappe()) return;\n\n  distruggiViewerCorrenteMappe();\n\n  const map = window.L.map(container, {\n    zoomControl: false,\n    minZoom: MAPPE_FALLBACK_ZOOM,\n  });\n\n  const baseLayers = costruisciBaseLayerMappe();\n  applicaBaseLayerMappe(map, baseLayers, \"chiara\");\n  window.L.control.zoom({ position: \"bottomright\" }).addTo(map);\n  aggiungiSelettoreBaseLayerMappe(map, baseLayers);\n\n  window.elinkMappeViewer = map;\n  window.elinkMappeGeojsonLayers = {};\n  window.elinkMappeLayerState = {};\n  window.elinkMappePayloadCache = {};\n  window.elinkMappePayloadCacheOrder = [];\n  if (!applicaVincoliComuneMappe(map)) {\n    map.setView(centroFallbackMappe().center, centroFallbackMappe().zoom);\n  }\n  map.on(\"click\", chiudiOverlayInterattiviMappe);\n  map.on(\"move\", aggiornaPosizioneMenuRadialeFabbricatiMappe);\n  map.on(\"zoom\", aggiornaPosizioneMenuRadialeFabbricatiMappe);\n  map.on(\"moveend\", pianificaAggiornamentoViewportMappe);\n  map.on(\"zoomend\", pianificaAggiornamentoViewportMappe);\n  caricaLayerViewerMappe({ aggiornaVista: false });\n};\n\n// Gestisce l'apertura e la chiusura del pannello caricamenti senza dipendere dal data-api automatico di Bootstrap.\nconst inizializzaTogglePannelloUploadMappe = () => {\n  $(document)\n    .off(\"click.mappeUploadPanel\", \"[data-mappe-toggle-upload-panel]\")\n    .on(\"click.mappeUploadPanel\", \"[data-mappe-toggle-upload-panel]\", function () {\n      const panel = document.querySelector(\"#mappe-upload-panel\");\n      if (!panel || !window.bootstrap?.Collapse) return;\n\n      const collapse = window.bootstrap.Collapse.getOrCreateInstance(panel, { toggle: false });\n      collapse.toggle();\n\n      const expanded = panel.classList.contains(\"show\");\n      this.setAttribute(\"aria-expanded\", expanded ? \"true\" : \"false\");\n    });\n};\n\n// Avvia il polling delle importazioni in corso per aggiornare la dashboard senza ricaricare la pagina.\nconst inizializzaPollingImportazioniMappe = () => {\n  const rows = Array.from(document.querySelectorAll(\"[data-mappe-importazione-row]\"));\n  if (!rows.length) return;\n\n  const poll = async () => {\n    let hasRunning = false;\n\n    for (const row of rows) {\n      try {\n        const running = await aggiornaRigaImportazioneMappe(row);\n        hasRunning = hasRunning || running;\n      } catch (_error) {\n        // Ignora errori temporanei di polling e riprova al giro successivo.\n      }\n    }\n\n    if (hasRunning) {\n      window.setTimeout(poll, 5000);\n    }\n  };\n\n  poll();\n};\n\n// Mostra lo stato di caricamento e blocca il form mappe durante l'import delle geometrie.\nconst inizializzaStatoCaricamentoMappe = () => {\n  $(document)\n    .off(\"submit.mappeImport\", \"[data-mappe-import-form]\")\n    .on(\"submit.mappeImport\", \"[data-mappe-import-form]\", function () {\n      const form = this;\n      const indicator = document.querySelector(\"#mappe-loading-indicator\");\n\n      if (indicator) indicator.classList.remove(\"d-none\");\n\n      form.querySelectorAll(\"input[type='submit'], button[type='submit']\").forEach((element) => {\n        if (element.type === \"submit\") {\n          if (element.tagName === \"INPUT\") element.value = \"Caricamento...\";\n          if (element.tagName === \"BUTTON\") element.textContent = \"Caricamento...\";\n        }\n\n        element.disabled = true;\n      });\n    });\n};\n\n// Inizializza la barra di ricerca della mappa intercettando input, invio e click per non propagare eventi al viewer.\nconst inizializzaRicercaViewerMappe = () => {\n  const control = document.querySelector(\"[data-mappe-search-control]\");\n  const input = document.querySelector(\"[data-mappe-search-input]\");\n  const results = document.querySelector(\"[data-mappe-search-results]\");\n  if (!control || !input || !results) return;\n\n  [\"click\", \"mousedown\", \"touchstart\", \"dblclick\"].forEach((eventName) => {\n    control.addEventListener(eventName, (event) => event.stopPropagation());\n  });\n\n  input.addEventListener(\"input\", pianificaRicercaLayerMappe);\n  input.addEventListener(\"keydown\", (event) => {\n    if (event.key === \"Enter\") {\n      event.preventDefault();\n      const firstResult = results.querySelector(\"[data-mappe-search-result]\");\n      if (firstResult) firstResult.click();\n    }\n\n    if (event.key === \"Escape\") {\n      results.classList.add(\"d-none\");\n      input.blur();\n    }\n  });\n\n  aggiornaStatoRicercaMappe();\n};\n\n// Inizializza il comportamento della dashboard mappe quando Turbo ha gia' caricato la pagina o quando il modulo arriva in ritardo.\nconst inizializzaDashboardMappe = () => {\n  const wrapper = document.querySelector(\"#mappe-mappa\");\n  if (!wrapper || nodoMappeInizializzato === wrapper) return;\n\n  nodoMappeInizializzato = wrapper;\n  const treeview = window.elinkSidebarTreeview;\n\n  if (document.URL.split(\"/\")[3] === \"mappe\" && treeview) {\n    treeview.clearHighlights();\n  }\n\n  aggiornaCampiCatastoMappe();\n  sincronizzaCheckboxPadreTerreniMappe();\n  aggiornaAttributiVincoliMappe();\n  inizializzaTogglePannelloUploadMappe();\n  inizializzaStatoCaricamentoMappe();\n  inizializzaPollingImportazioniMappe();\n  inizializzaViewerMaplibreMappe();\n  inizializzaViewerMappe();\n  inizializzaHoverLegendaMappe();\n  inizializzaHoverSidebarMappe();\n  inizializzaRicercaViewerMappe();\n\n  $(document)\n    .off(\"click.mappeOutsideOverlay\")\n    .on(\"click.mappeOutsideOverlay\", chiudiOverlayMappeClickEsterno);\n\n  $(document)\n    .off(\"click.mappePopupOverlay mousedown.mappePopupOverlay dblclick.mappePopupOverlay touchstart.mappePopupOverlay\", \".leaflet-popup, .maplibregl-popup\")\n    .on(\"click.mappePopupOverlay mousedown.mappePopupOverlay dblclick.mappePopupOverlay touchstart.mappePopupOverlay\", \".leaflet-popup, .maplibregl-popup\", (event) => {\n      event.stopPropagation();\n    });\n\n  $(document)\n    .off(\"change.mappeCatasto\", \"[data-mappe-catasto-dataset]\")\n    .on(\"change.mappeCatasto\", \"[data-mappe-catasto-dataset]\", aggiornaCampiCatastoMappe);\n\n  $(document)\n    .off(\"change.mappeViewerTerreniParent\", \"[data-mappe-layer-group-parent='terreni']\")\n    .on(\"change.mappeViewerTerreniParent\", \"[data-mappe-layer-group-parent='terreni']\", function () {\n      aggiornaFigliTerreniDaPadreMappe(this.checked);\n      aggiornaStatoRicercaMappe();\n      if (viewerMaplibreAttivoMappe()) {\n        aggiornaLayerViewerMaplibre();\n      } else {\n        caricaLayerViewerMappe({ aggiornaVista: false });\n      }\n    });\n\n  $(document)\n    .off(\"change.mappeViewerTerreniChild\", \"[data-mappe-layer-child='terreni']\")\n    .on(\"change.mappeViewerTerreniChild\", \"[data-mappe-layer-child='terreni']\", () => {\n      sincronizzaCheckboxPadreTerreniMappe();\n      aggiornaStatoRicercaMappe();\n      if (viewerMaplibreAttivoMappe()) {\n        aggiornaLayerViewerMaplibre();\n      } else {\n        caricaLayerViewerMappe({ aggiornaVista: false });\n      }\n    });\n\n  $(document)\n    .off(\"click.mappeViewerTerreniToggle\", \"[data-mappe-layer-group-toggle='terreni']\")\n    .on(\"click.mappeViewerTerreniToggle\", \"[data-mappe-layer-group-toggle='terreni']\", toggleGruppoTerreniMappe);\n\n  $(document)\n    .off(\"click.mappeViewerSidebarToggle\", \"[data-mappe-sidebar-toggle]\")\n    .on(\"click.mappeViewerSidebarToggle\", \"[data-mappe-sidebar-toggle]\", toggleSidebarViewerMappe);\n\n  $(document)\n    .off(\"change.mappeVincoli\", \"[data-mappe-vincoli-dataset]\")\n    .on(\"change.mappeVincoli\", \"[data-mappe-vincoli-dataset]\", aggiornaAttributiVincoliMappe);\n\n  $(document)\n    .off(\"change.mappeViewerLayerSingolo\", \"[data-mappe-layer-key='fabbricati']\")\n    .on(\"change.mappeViewerLayerSingolo\", \"[data-mappe-layer-key='fabbricati']\", () => {\n      aggiornaStatoRicercaMappe();\n      if (viewerMaplibreAttivoMappe()) {\n        aggiornaLayerViewerMaplibre();\n      } else {\n        caricaLayerViewerMappe({ aggiornaVista: false });\n      }\n    });\n\n  $(document)\n    .off(\"change.mappeViewerSchede\", \"[data-mappe-layer-key='schede']\")\n    .on(\"change.mappeViewerSchede\", \"[data-mappe-layer-key='schede']\", () => {\n      aggiornaStatoRicercaMappe();\n      if (viewerMaplibreAttivoMappe()) {\n        aggiornaLayerViewerMaplibre();\n      } else {\n        caricaLayerViewerMappe({ aggiornaVista: false });\n      }\n    });\n};\n\n$(document).on(\"turbo:load\", inizializzaDashboardMappe);\n\nif (document.readyState !== \"loading\") {\n  inizializzaDashboardMappe();\n}\n", "/*\nTurbo 7.3.0\nCopyright \u00A9 2023 37signals LLC\n */\n(function () {\n    if (window.Reflect === undefined ||\n        window.customElements === undefined ||\n        window.customElements.polyfillWrapFlushCallback) {\n        return;\n    }\n    const BuiltInHTMLElement = HTMLElement;\n    const wrapperForTheName = {\n        HTMLElement: function HTMLElement() {\n            return Reflect.construct(BuiltInHTMLElement, [], this.constructor);\n        },\n    };\n    window.HTMLElement = wrapperForTheName[\"HTMLElement\"];\n    HTMLElement.prototype = BuiltInHTMLElement.prototype;\n    HTMLElement.prototype.constructor = HTMLElement;\n    Object.setPrototypeOf(HTMLElement, BuiltInHTMLElement);\n})();\n\n/**\n * The MIT License (MIT)\n * \n * Copyright (c) 2019 Javan Makhmali\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n(function(prototype) {\n  if (typeof prototype.requestSubmit == \"function\") return\n\n  prototype.requestSubmit = function(submitter) {\n    if (submitter) {\n      validateSubmitter(submitter, this);\n      submitter.click();\n    } else {\n      submitter = document.createElement(\"input\");\n      submitter.type = \"submit\";\n      submitter.hidden = true;\n      this.appendChild(submitter);\n      submitter.click();\n      this.removeChild(submitter);\n    }\n  };\n\n  function validateSubmitter(submitter, form) {\n    submitter instanceof HTMLElement || raise(TypeError, \"parameter 1 is not of type 'HTMLElement'\");\n    submitter.type == \"submit\" || raise(TypeError, \"The specified element is not a submit button\");\n    submitter.form == form || raise(DOMException, \"The specified element is not owned by this form element\", \"NotFoundError\");\n  }\n\n  function raise(errorConstructor, message, name) {\n    throw new errorConstructor(\"Failed to execute 'requestSubmit' on 'HTMLFormElement': \" + message + \".\", name)\n  }\n})(HTMLFormElement.prototype);\n\nconst submittersByForm = new WeakMap();\nfunction findSubmitterFromClickTarget(target) {\n    const element = target instanceof Element ? target : target instanceof Node ? target.parentElement : null;\n    const candidate = element ? element.closest(\"input, button\") : null;\n    return (candidate === null || candidate === void 0 ? void 0 : candidate.type) == \"submit\" ? candidate : null;\n}\nfunction clickCaptured(event) {\n    const submitter = findSubmitterFromClickTarget(event.target);\n    if (submitter && submitter.form) {\n        submittersByForm.set(submitter.form, submitter);\n    }\n}\n(function () {\n    if (\"submitter\" in Event.prototype)\n        return;\n    let prototype = window.Event.prototype;\n    if (\"SubmitEvent\" in window && /Apple Computer/.test(navigator.vendor)) {\n        prototype = window.SubmitEvent.prototype;\n    }\n    else if (\"SubmitEvent\" in window) {\n        return;\n    }\n    addEventListener(\"click\", clickCaptured, true);\n    Object.defineProperty(prototype, \"submitter\", {\n        get() {\n            if (this.type == \"submit\" && this.target instanceof HTMLFormElement) {\n                return submittersByForm.get(this.target);\n            }\n        },\n    });\n})();\n\nvar FrameLoadingStyle;\n(function (FrameLoadingStyle) {\n    FrameLoadingStyle[\"eager\"] = \"eager\";\n    FrameLoadingStyle[\"lazy\"] = \"lazy\";\n})(FrameLoadingStyle || (FrameLoadingStyle = {}));\nclass FrameElement extends HTMLElement {\n    static get observedAttributes() {\n        return [\"disabled\", \"complete\", \"loading\", \"src\"];\n    }\n    constructor() {\n        super();\n        this.loaded = Promise.resolve();\n        this.delegate = new FrameElement.delegateConstructor(this);\n    }\n    connectedCallback() {\n        this.delegate.connect();\n    }\n    disconnectedCallback() {\n        this.delegate.disconnect();\n    }\n    reload() {\n        return this.delegate.sourceURLReloaded();\n    }\n    attributeChangedCallback(name) {\n        if (name == \"loading\") {\n            this.delegate.loadingStyleChanged();\n        }\n        else if (name == \"complete\") {\n            this.delegate.completeChanged();\n        }\n        else if (name == \"src\") {\n            this.delegate.sourceURLChanged();\n        }\n        else {\n            this.delegate.disabledChanged();\n        }\n    }\n    get src() {\n        return this.getAttribute(\"src\");\n    }\n    set src(value) {\n        if (value) {\n            this.setAttribute(\"src\", value);\n        }\n        else {\n            this.removeAttribute(\"src\");\n        }\n    }\n    get loading() {\n        return frameLoadingStyleFromString(this.getAttribute(\"loading\") || \"\");\n    }\n    set loading(value) {\n        if (value) {\n            this.setAttribute(\"loading\", value);\n        }\n        else {\n            this.removeAttribute(\"loading\");\n        }\n    }\n    get disabled() {\n        return this.hasAttribute(\"disabled\");\n    }\n    set disabled(value) {\n        if (value) {\n            this.setAttribute(\"disabled\", \"\");\n        }\n        else {\n            this.removeAttribute(\"disabled\");\n        }\n    }\n    get autoscroll() {\n        return this.hasAttribute(\"autoscroll\");\n    }\n    set autoscroll(value) {\n        if (value) {\n            this.setAttribute(\"autoscroll\", \"\");\n        }\n        else {\n            this.removeAttribute(\"autoscroll\");\n        }\n    }\n    get complete() {\n        return !this.delegate.isLoading;\n    }\n    get isActive() {\n        return this.ownerDocument === document && !this.isPreview;\n    }\n    get isPreview() {\n        var _a, _b;\n        return (_b = (_a = this.ownerDocument) === null || _a === void 0 ? void 0 : _a.documentElement) === null || _b === void 0 ? void 0 : _b.hasAttribute(\"data-turbo-preview\");\n    }\n}\nfunction frameLoadingStyleFromString(style) {\n    switch (style.toLowerCase()) {\n        case \"lazy\":\n            return FrameLoadingStyle.lazy;\n        default:\n            return FrameLoadingStyle.eager;\n    }\n}\n\nfunction expandURL(locatable) {\n    return new URL(locatable.toString(), document.baseURI);\n}\nfunction getAnchor(url) {\n    let anchorMatch;\n    if (url.hash) {\n        return url.hash.slice(1);\n    }\n    else if ((anchorMatch = url.href.match(/#(.*)$/))) {\n        return anchorMatch[1];\n    }\n}\nfunction getAction(form, submitter) {\n    const action = (submitter === null || submitter === void 0 ? void 0 : submitter.getAttribute(\"formaction\")) || form.getAttribute(\"action\") || form.action;\n    return expandURL(action);\n}\nfunction getExtension(url) {\n    return (getLastPathComponent(url).match(/\\.[^.]*$/) || [])[0] || \"\";\n}\nfunction isHTML(url) {\n    return !!getExtension(url).match(/^(?:|\\.(?:htm|html|xhtml|php))$/);\n}\nfunction isPrefixedBy(baseURL, url) {\n    const prefix = getPrefix(url);\n    return baseURL.href === expandURL(prefix).href || baseURL.href.startsWith(prefix);\n}\nfunction locationIsVisitable(location, rootLocation) {\n    return isPrefixedBy(location, rootLocation) && isHTML(location);\n}\nfunction getRequestURL(url) {\n    const anchor = getAnchor(url);\n    return anchor != null ? url.href.slice(0, -(anchor.length + 1)) : url.href;\n}\nfunction toCacheKey(url) {\n    return getRequestURL(url);\n}\nfunction urlsAreEqual(left, right) {\n    return expandURL(left).href == expandURL(right).href;\n}\nfunction getPathComponents(url) {\n    return url.pathname.split(\"/\").slice(1);\n}\nfunction getLastPathComponent(url) {\n    return getPathComponents(url).slice(-1)[0];\n}\nfunction getPrefix(url) {\n    return addTrailingSlash(url.origin + url.pathname);\n}\nfunction addTrailingSlash(value) {\n    return value.endsWith(\"/\") ? value : value + \"/\";\n}\n\nclass FetchResponse {\n    constructor(response) {\n        this.response = response;\n    }\n    get succeeded() {\n        return this.response.ok;\n    }\n    get failed() {\n        return !this.succeeded;\n    }\n    get clientError() {\n        return this.statusCode >= 400 && this.statusCode <= 499;\n    }\n    get serverError() {\n        return this.statusCode >= 500 && this.statusCode <= 599;\n    }\n    get redirected() {\n        return this.response.redirected;\n    }\n    get location() {\n        return expandURL(this.response.url);\n    }\n    get isHTML() {\n        return this.contentType && this.contentType.match(/^(?:text\\/([^\\s;,]+\\b)?html|application\\/xhtml\\+xml)\\b/);\n    }\n    get statusCode() {\n        return this.response.status;\n    }\n    get contentType() {\n        return this.header(\"Content-Type\");\n    }\n    get responseText() {\n        return this.response.clone().text();\n    }\n    get responseHTML() {\n        if (this.isHTML) {\n            return this.response.clone().text();\n        }\n        else {\n            return Promise.resolve(undefined);\n        }\n    }\n    header(name) {\n        return this.response.headers.get(name);\n    }\n}\n\nfunction activateScriptElement(element) {\n    if (element.getAttribute(\"data-turbo-eval\") == \"false\") {\n        return element;\n    }\n    else {\n        const createdScriptElement = document.createElement(\"script\");\n        const cspNonce = getMetaContent(\"csp-nonce\");\n        if (cspNonce) {\n            createdScriptElement.nonce = cspNonce;\n        }\n        createdScriptElement.textContent = element.textContent;\n        createdScriptElement.async = false;\n        copyElementAttributes(createdScriptElement, element);\n        return createdScriptElement;\n    }\n}\nfunction copyElementAttributes(destinationElement, sourceElement) {\n    for (const { name, value } of sourceElement.attributes) {\n        destinationElement.setAttribute(name, value);\n    }\n}\nfunction createDocumentFragment(html) {\n    const template = document.createElement(\"template\");\n    template.innerHTML = html;\n    return template.content;\n}\nfunction dispatch(eventName, { target, cancelable, detail } = {}) {\n    const event = new CustomEvent(eventName, {\n        cancelable,\n        bubbles: true,\n        composed: true,\n        detail,\n    });\n    if (target && target.isConnected) {\n        target.dispatchEvent(event);\n    }\n    else {\n        document.documentElement.dispatchEvent(event);\n    }\n    return event;\n}\nfunction nextAnimationFrame() {\n    return new Promise((resolve) => requestAnimationFrame(() => resolve()));\n}\nfunction nextEventLoopTick() {\n    return new Promise((resolve) => setTimeout(() => resolve(), 0));\n}\nfunction nextMicrotask() {\n    return Promise.resolve();\n}\nfunction parseHTMLDocument(html = \"\") {\n    return new DOMParser().parseFromString(html, \"text/html\");\n}\nfunction unindent(strings, ...values) {\n    const lines = interpolate(strings, values).replace(/^\\n/, \"\").split(\"\\n\");\n    const match = lines[0].match(/^\\s+/);\n    const indent = match ? match[0].length : 0;\n    return lines.map((line) => line.slice(indent)).join(\"\\n\");\n}\nfunction interpolate(strings, values) {\n    return strings.reduce((result, string, i) => {\n        const value = values[i] == undefined ? \"\" : values[i];\n        return result + string + value;\n    }, \"\");\n}\nfunction uuid() {\n    return Array.from({ length: 36 })\n        .map((_, i) => {\n        if (i == 8 || i == 13 || i == 18 || i == 23) {\n            return \"-\";\n        }\n        else if (i == 14) {\n            return \"4\";\n        }\n        else if (i == 19) {\n            return (Math.floor(Math.random() * 4) + 8).toString(16);\n        }\n        else {\n            return Math.floor(Math.random() * 15).toString(16);\n        }\n    })\n        .join(\"\");\n}\nfunction getAttribute(attributeName, ...elements) {\n    for (const value of elements.map((element) => element === null || element === void 0 ? void 0 : element.getAttribute(attributeName))) {\n        if (typeof value == \"string\")\n            return value;\n    }\n    return null;\n}\nfunction hasAttribute(attributeName, ...elements) {\n    return elements.some((element) => element && element.hasAttribute(attributeName));\n}\nfunction markAsBusy(...elements) {\n    for (const element of elements) {\n        if (element.localName == \"turbo-frame\") {\n            element.setAttribute(\"busy\", \"\");\n        }\n        element.setAttribute(\"aria-busy\", \"true\");\n    }\n}\nfunction clearBusyState(...elements) {\n    for (const element of elements) {\n        if (element.localName == \"turbo-frame\") {\n            element.removeAttribute(\"busy\");\n        }\n        element.removeAttribute(\"aria-busy\");\n    }\n}\nfunction waitForLoad(element, timeoutInMilliseconds = 2000) {\n    return new Promise((resolve) => {\n        const onComplete = () => {\n            element.removeEventListener(\"error\", onComplete);\n            element.removeEventListener(\"load\", onComplete);\n            resolve();\n        };\n        element.addEventListener(\"load\", onComplete, { once: true });\n        element.addEventListener(\"error\", onComplete, { once: true });\n        setTimeout(resolve, timeoutInMilliseconds);\n    });\n}\nfunction getHistoryMethodForAction(action) {\n    switch (action) {\n        case \"replace\":\n            return history.replaceState;\n        case \"advance\":\n        case \"restore\":\n            return history.pushState;\n    }\n}\nfunction isAction(action) {\n    return action == \"advance\" || action == \"replace\" || action == \"restore\";\n}\nfunction getVisitAction(...elements) {\n    const action = getAttribute(\"data-turbo-action\", ...elements);\n    return isAction(action) ? action : null;\n}\nfunction getMetaElement(name) {\n    return document.querySelector(`meta[name=\"${name}\"]`);\n}\nfunction getMetaContent(name) {\n    const element = getMetaElement(name);\n    return element && element.content;\n}\nfunction setMetaContent(name, content) {\n    let element = getMetaElement(name);\n    if (!element) {\n        element = document.createElement(\"meta\");\n        element.setAttribute(\"name\", name);\n        document.head.appendChild(element);\n    }\n    element.setAttribute(\"content\", content);\n    return element;\n}\nfunction findClosestRecursively(element, selector) {\n    var _a;\n    if (element instanceof Element) {\n        return (element.closest(selector) ||\n            findClosestRecursively(element.assignedSlot || ((_a = element.getRootNode()) === null || _a === void 0 ? void 0 : _a.host), selector));\n    }\n}\n\nvar FetchMethod;\n(function (FetchMethod) {\n    FetchMethod[FetchMethod[\"get\"] = 0] = \"get\";\n    FetchMethod[FetchMethod[\"post\"] = 1] = \"post\";\n    FetchMethod[FetchMethod[\"put\"] = 2] = \"put\";\n    FetchMethod[FetchMethod[\"patch\"] = 3] = \"patch\";\n    FetchMethod[FetchMethod[\"delete\"] = 4] = \"delete\";\n})(FetchMethod || (FetchMethod = {}));\nfunction fetchMethodFromString(method) {\n    switch (method.toLowerCase()) {\n        case \"get\":\n            return FetchMethod.get;\n        case \"post\":\n            return FetchMethod.post;\n        case \"put\":\n            return FetchMethod.put;\n        case \"patch\":\n            return FetchMethod.patch;\n        case \"delete\":\n            return FetchMethod.delete;\n    }\n}\nclass FetchRequest {\n    constructor(delegate, method, location, body = new URLSearchParams(), target = null) {\n        this.abortController = new AbortController();\n        this.resolveRequestPromise = (_value) => { };\n        this.delegate = delegate;\n        this.method = method;\n        this.headers = this.defaultHeaders;\n        this.body = body;\n        this.url = location;\n        this.target = target;\n    }\n    get location() {\n        return this.url;\n    }\n    get params() {\n        return this.url.searchParams;\n    }\n    get entries() {\n        return this.body ? Array.from(this.body.entries()) : [];\n    }\n    cancel() {\n        this.abortController.abort();\n    }\n    async perform() {\n        const { fetchOptions } = this;\n        this.delegate.prepareRequest(this);\n        await this.allowRequestToBeIntercepted(fetchOptions);\n        try {\n            this.delegate.requestStarted(this);\n            const response = await fetch(this.url.href, fetchOptions);\n            return await this.receive(response);\n        }\n        catch (error) {\n            if (error.name !== \"AbortError\") {\n                if (this.willDelegateErrorHandling(error)) {\n                    this.delegate.requestErrored(this, error);\n                }\n                throw error;\n            }\n        }\n        finally {\n            this.delegate.requestFinished(this);\n        }\n    }\n    async receive(response) {\n        const fetchResponse = new FetchResponse(response);\n        const event = dispatch(\"turbo:before-fetch-response\", {\n            cancelable: true,\n            detail: { fetchResponse },\n            target: this.target,\n        });\n        if (event.defaultPrevented) {\n            this.delegate.requestPreventedHandlingResponse(this, fetchResponse);\n        }\n        else if (fetchResponse.succeeded) {\n            this.delegate.requestSucceededWithResponse(this, fetchResponse);\n        }\n        else {\n            this.delegate.requestFailedWithResponse(this, fetchResponse);\n        }\n        return fetchResponse;\n    }\n    get fetchOptions() {\n        var _a;\n        return {\n            method: FetchMethod[this.method].toUpperCase(),\n            credentials: \"same-origin\",\n            headers: this.headers,\n            redirect: \"follow\",\n            body: this.isSafe ? null : this.body,\n            signal: this.abortSignal,\n            referrer: (_a = this.delegate.referrer) === null || _a === void 0 ? void 0 : _a.href,\n        };\n    }\n    get defaultHeaders() {\n        return {\n            Accept: \"text/html, application/xhtml+xml\",\n        };\n    }\n    get isSafe() {\n        return this.method === FetchMethod.get;\n    }\n    get abortSignal() {\n        return this.abortController.signal;\n    }\n    acceptResponseType(mimeType) {\n        this.headers[\"Accept\"] = [mimeType, this.headers[\"Accept\"]].join(\", \");\n    }\n    async allowRequestToBeIntercepted(fetchOptions) {\n        const requestInterception = new Promise((resolve) => (this.resolveRequestPromise = resolve));\n        const event = dispatch(\"turbo:before-fetch-request\", {\n            cancelable: true,\n            detail: {\n                fetchOptions,\n                url: this.url,\n                resume: this.resolveRequestPromise,\n            },\n            target: this.target,\n        });\n        if (event.defaultPrevented)\n            await requestInterception;\n    }\n    willDelegateErrorHandling(error) {\n        const event = dispatch(\"turbo:fetch-request-error\", {\n            target: this.target,\n            cancelable: true,\n            detail: { request: this, error: error },\n        });\n        return !event.defaultPrevented;\n    }\n}\n\nclass AppearanceObserver {\n    constructor(delegate, element) {\n        this.started = false;\n        this.intersect = (entries) => {\n            const lastEntry = entries.slice(-1)[0];\n            if (lastEntry === null || lastEntry === void 0 ? void 0 : lastEntry.isIntersecting) {\n                this.delegate.elementAppearedInViewport(this.element);\n            }\n        };\n        this.delegate = delegate;\n        this.element = element;\n        this.intersectionObserver = new IntersectionObserver(this.intersect);\n    }\n    start() {\n        if (!this.started) {\n            this.started = true;\n            this.intersectionObserver.observe(this.element);\n        }\n    }\n    stop() {\n        if (this.started) {\n            this.started = false;\n            this.intersectionObserver.unobserve(this.element);\n        }\n    }\n}\n\nclass StreamMessage {\n    static wrap(message) {\n        if (typeof message == \"string\") {\n            return new this(createDocumentFragment(message));\n        }\n        else {\n            return message;\n        }\n    }\n    constructor(fragment) {\n        this.fragment = importStreamElements(fragment);\n    }\n}\nStreamMessage.contentType = \"text/vnd.turbo-stream.html\";\nfunction importStreamElements(fragment) {\n    for (const element of fragment.querySelectorAll(\"turbo-stream\")) {\n        const streamElement = document.importNode(element, true);\n        for (const inertScriptElement of streamElement.templateElement.content.querySelectorAll(\"script\")) {\n            inertScriptElement.replaceWith(activateScriptElement(inertScriptElement));\n        }\n        element.replaceWith(streamElement);\n    }\n    return fragment;\n}\n\nvar FormSubmissionState;\n(function (FormSubmissionState) {\n    FormSubmissionState[FormSubmissionState[\"initialized\"] = 0] = \"initialized\";\n    FormSubmissionState[FormSubmissionState[\"requesting\"] = 1] = \"requesting\";\n    FormSubmissionState[FormSubmissionState[\"waiting\"] = 2] = \"waiting\";\n    FormSubmissionState[FormSubmissionState[\"receiving\"] = 3] = \"receiving\";\n    FormSubmissionState[FormSubmissionState[\"stopping\"] = 4] = \"stopping\";\n    FormSubmissionState[FormSubmissionState[\"stopped\"] = 5] = \"stopped\";\n})(FormSubmissionState || (FormSubmissionState = {}));\nvar FormEnctype;\n(function (FormEnctype) {\n    FormEnctype[\"urlEncoded\"] = \"application/x-www-form-urlencoded\";\n    FormEnctype[\"multipart\"] = \"multipart/form-data\";\n    FormEnctype[\"plain\"] = \"text/plain\";\n})(FormEnctype || (FormEnctype = {}));\nfunction formEnctypeFromString(encoding) {\n    switch (encoding.toLowerCase()) {\n        case FormEnctype.multipart:\n            return FormEnctype.multipart;\n        case FormEnctype.plain:\n            return FormEnctype.plain;\n        default:\n            return FormEnctype.urlEncoded;\n    }\n}\nclass FormSubmission {\n    static confirmMethod(message, _element, _submitter) {\n        return Promise.resolve(confirm(message));\n    }\n    constructor(delegate, formElement, submitter, mustRedirect = false) {\n        this.state = FormSubmissionState.initialized;\n        this.delegate = delegate;\n        this.formElement = formElement;\n        this.submitter = submitter;\n        this.formData = buildFormData(formElement, submitter);\n        this.location = expandURL(this.action);\n        if (this.method == FetchMethod.get) {\n            mergeFormDataEntries(this.location, [...this.body.entries()]);\n        }\n        this.fetchRequest = new FetchRequest(this, this.method, this.location, this.body, this.formElement);\n        this.mustRedirect = mustRedirect;\n    }\n    get method() {\n        var _a;\n        const method = ((_a = this.submitter) === null || _a === void 0 ? void 0 : _a.getAttribute(\"formmethod\")) || this.formElement.getAttribute(\"method\") || \"\";\n        return fetchMethodFromString(method.toLowerCase()) || FetchMethod.get;\n    }\n    get action() {\n        var _a;\n        const formElementAction = typeof this.formElement.action === \"string\" ? this.formElement.action : null;\n        if ((_a = this.submitter) === null || _a === void 0 ? void 0 : _a.hasAttribute(\"formaction\")) {\n            return this.submitter.getAttribute(\"formaction\") || \"\";\n        }\n        else {\n            return this.formElement.getAttribute(\"action\") || formElementAction || \"\";\n        }\n    }\n    get body() {\n        if (this.enctype == FormEnctype.urlEncoded || this.method == FetchMethod.get) {\n            return new URLSearchParams(this.stringFormData);\n        }\n        else {\n            return this.formData;\n        }\n    }\n    get enctype() {\n        var _a;\n        return formEnctypeFromString(((_a = this.submitter) === null || _a === void 0 ? void 0 : _a.getAttribute(\"formenctype\")) || this.formElement.enctype);\n    }\n    get isSafe() {\n        return this.fetchRequest.isSafe;\n    }\n    get stringFormData() {\n        return [...this.formData].reduce((entries, [name, value]) => {\n            return entries.concat(typeof value == \"string\" ? [[name, value]] : []);\n        }, []);\n    }\n    async start() {\n        const { initialized, requesting } = FormSubmissionState;\n        const confirmationMessage = getAttribute(\"data-turbo-confirm\", this.submitter, this.formElement);\n        if (typeof confirmationMessage === \"string\") {\n            const answer = await FormSubmission.confirmMethod(confirmationMessage, this.formElement, this.submitter);\n            if (!answer) {\n                return;\n            }\n        }\n        if (this.state == initialized) {\n            this.state = requesting;\n            return this.fetchRequest.perform();\n        }\n    }\n    stop() {\n        const { stopping, stopped } = FormSubmissionState;\n        if (this.state != stopping && this.state != stopped) {\n            this.state = stopping;\n            this.fetchRequest.cancel();\n            return true;\n        }\n    }\n    prepareRequest(request) {\n        if (!request.isSafe) {\n            const token = getCookieValue(getMetaContent(\"csrf-param\")) || getMetaContent(\"csrf-token\");\n            if (token) {\n                request.headers[\"X-CSRF-Token\"] = token;\n            }\n        }\n        if (this.requestAcceptsTurboStreamResponse(request)) {\n            request.acceptResponseType(StreamMessage.contentType);\n        }\n    }\n    requestStarted(_request) {\n        var _a;\n        this.state = FormSubmissionState.waiting;\n        (_a = this.submitter) === null || _a === void 0 ? void 0 : _a.setAttribute(\"disabled\", \"\");\n        this.setSubmitsWith();\n        dispatch(\"turbo:submit-start\", {\n            target: this.formElement,\n            detail: { formSubmission: this },\n        });\n        this.delegate.formSubmissionStarted(this);\n    }\n    requestPreventedHandlingResponse(request, response) {\n        this.result = { success: response.succeeded, fetchResponse: response };\n    }\n    requestSucceededWithResponse(request, response) {\n        if (response.clientError || response.serverError) {\n            this.delegate.formSubmissionFailedWithResponse(this, response);\n        }\n        else if (this.requestMustRedirect(request) && responseSucceededWithoutRedirect(response)) {\n            const error = new Error(\"Form responses must redirect to another location\");\n            this.delegate.formSubmissionErrored(this, error);\n        }\n        else {\n            this.state = FormSubmissionState.receiving;\n            this.result = { success: true, fetchResponse: response };\n            this.delegate.formSubmissionSucceededWithResponse(this, response);\n        }\n    }\n    requestFailedWithResponse(request, response) {\n        this.result = { success: false, fetchResponse: response };\n        this.delegate.formSubmissionFailedWithResponse(this, response);\n    }\n    requestErrored(request, error) {\n        this.result = { success: false, error };\n        this.delegate.formSubmissionErrored(this, error);\n    }\n    requestFinished(_request) {\n        var _a;\n        this.state = FormSubmissionState.stopped;\n        (_a = this.submitter) === null || _a === void 0 ? void 0 : _a.removeAttribute(\"disabled\");\n        this.resetSubmitterText();\n        dispatch(\"turbo:submit-end\", {\n            target: this.formElement,\n            detail: Object.assign({ formSubmission: this }, this.result),\n        });\n        this.delegate.formSubmissionFinished(this);\n    }\n    setSubmitsWith() {\n        if (!this.submitter || !this.submitsWith)\n            return;\n        if (this.submitter.matches(\"button\")) {\n            this.originalSubmitText = this.submitter.innerHTML;\n            this.submitter.innerHTML = this.submitsWith;\n        }\n        else if (this.submitter.matches(\"input\")) {\n            const input = this.submitter;\n            this.originalSubmitText = input.value;\n            input.value = this.submitsWith;\n        }\n    }\n    resetSubmitterText() {\n        if (!this.submitter || !this.originalSubmitText)\n            return;\n        if (this.submitter.matches(\"button\")) {\n            this.submitter.innerHTML = this.originalSubmitText;\n        }\n        else if (this.submitter.matches(\"input\")) {\n            const input = this.submitter;\n            input.value = this.originalSubmitText;\n        }\n    }\n    requestMustRedirect(request) {\n        return !request.isSafe && this.mustRedirect;\n    }\n    requestAcceptsTurboStreamResponse(request) {\n        return !request.isSafe || hasAttribute(\"data-turbo-stream\", this.submitter, this.formElement);\n    }\n    get submitsWith() {\n        var _a;\n        return (_a = this.submitter) === null || _a === void 0 ? void 0 : _a.getAttribute(\"data-turbo-submits-with\");\n    }\n}\nfunction buildFormData(formElement, submitter) {\n    const formData = new FormData(formElement);\n    const name = submitter === null || submitter === void 0 ? void 0 : submitter.getAttribute(\"name\");\n    const value = submitter === null || submitter === void 0 ? void 0 : submitter.getAttribute(\"value\");\n    if (name) {\n        formData.append(name, value || \"\");\n    }\n    return formData;\n}\nfunction getCookieValue(cookieName) {\n    if (cookieName != null) {\n        const cookies = document.cookie ? document.cookie.split(\"; \") : [];\n        const cookie = cookies.find((cookie) => cookie.startsWith(cookieName));\n        if (cookie) {\n            const value = cookie.split(\"=\").slice(1).join(\"=\");\n            return value ? decodeURIComponent(value) : undefined;\n        }\n    }\n}\nfunction responseSucceededWithoutRedirect(response) {\n    return response.statusCode == 200 && !response.redirected;\n}\nfunction mergeFormDataEntries(url, entries) {\n    const searchParams = new URLSearchParams();\n    for (const [name, value] of entries) {\n        if (value instanceof File)\n            continue;\n        searchParams.append(name, value);\n    }\n    url.search = searchParams.toString();\n    return url;\n}\n\nclass Snapshot {\n    constructor(element) {\n        this.element = element;\n    }\n    get activeElement() {\n        return this.element.ownerDocument.activeElement;\n    }\n    get children() {\n        return [...this.element.children];\n    }\n    hasAnchor(anchor) {\n        return this.getElementForAnchor(anchor) != null;\n    }\n    getElementForAnchor(anchor) {\n        return anchor ? this.element.querySelector(`[id='${anchor}'], a[name='${anchor}']`) : null;\n    }\n    get isConnected() {\n        return this.element.isConnected;\n    }\n    get firstAutofocusableElement() {\n        const inertDisabledOrHidden = \"[inert], :disabled, [hidden], details:not([open]), dialog:not([open])\";\n        for (const element of this.element.querySelectorAll(\"[autofocus]\")) {\n            if (element.closest(inertDisabledOrHidden) == null)\n                return element;\n            else\n                continue;\n        }\n        return null;\n    }\n    get permanentElements() {\n        return queryPermanentElementsAll(this.element);\n    }\n    getPermanentElementById(id) {\n        return getPermanentElementById(this.element, id);\n    }\n    getPermanentElementMapForSnapshot(snapshot) {\n        const permanentElementMap = {};\n        for (const currentPermanentElement of this.permanentElements) {\n            const { id } = currentPermanentElement;\n            const newPermanentElement = snapshot.getPermanentElementById(id);\n            if (newPermanentElement) {\n                permanentElementMap[id] = [currentPermanentElement, newPermanentElement];\n            }\n        }\n        return permanentElementMap;\n    }\n}\nfunction getPermanentElementById(node, id) {\n    return node.querySelector(`#${id}[data-turbo-permanent]`);\n}\nfunction queryPermanentElementsAll(node) {\n    return node.querySelectorAll(\"[id][data-turbo-permanent]\");\n}\n\nclass FormSubmitObserver {\n    constructor(delegate, eventTarget) {\n        this.started = false;\n        this.submitCaptured = () => {\n            this.eventTarget.removeEventListener(\"submit\", this.submitBubbled, false);\n            this.eventTarget.addEventListener(\"submit\", this.submitBubbled, false);\n        };\n        this.submitBubbled = ((event) => {\n            if (!event.defaultPrevented) {\n                const form = event.target instanceof HTMLFormElement ? event.target : undefined;\n                const submitter = event.submitter || undefined;\n                if (form &&\n                    submissionDoesNotDismissDialog(form, submitter) &&\n                    submissionDoesNotTargetIFrame(form, submitter) &&\n                    this.delegate.willSubmitForm(form, submitter)) {\n                    event.preventDefault();\n                    event.stopImmediatePropagation();\n                    this.delegate.formSubmitted(form, submitter);\n                }\n            }\n        });\n        this.delegate = delegate;\n        this.eventTarget = eventTarget;\n    }\n    start() {\n        if (!this.started) {\n            this.eventTarget.addEventListener(\"submit\", this.submitCaptured, true);\n            this.started = true;\n        }\n    }\n    stop() {\n        if (this.started) {\n            this.eventTarget.removeEventListener(\"submit\", this.submitCaptured, true);\n            this.started = false;\n        }\n    }\n}\nfunction submissionDoesNotDismissDialog(form, submitter) {\n    const method = (submitter === null || submitter === void 0 ? void 0 : submitter.getAttribute(\"formmethod\")) || form.getAttribute(\"method\");\n    return method != \"dialog\";\n}\nfunction submissionDoesNotTargetIFrame(form, submitter) {\n    if ((submitter === null || submitter === void 0 ? void 0 : submitter.hasAttribute(\"formtarget\")) || form.hasAttribute(\"target\")) {\n        const target = (submitter === null || submitter === void 0 ? void 0 : submitter.getAttribute(\"formtarget\")) || form.target;\n        for (const element of document.getElementsByName(target)) {\n            if (element instanceof HTMLIFrameElement)\n                return false;\n        }\n        return true;\n    }\n    else {\n        return true;\n    }\n}\n\nclass View {\n    constructor(delegate, element) {\n        this.resolveRenderPromise = (_value) => { };\n        this.resolveInterceptionPromise = (_value) => { };\n        this.delegate = delegate;\n        this.element = element;\n    }\n    scrollToAnchor(anchor) {\n        const element = this.snapshot.getElementForAnchor(anchor);\n        if (element) {\n            this.scrollToElement(element);\n            this.focusElement(element);\n        }\n        else {\n            this.scrollToPosition({ x: 0, y: 0 });\n        }\n    }\n    scrollToAnchorFromLocation(location) {\n        this.scrollToAnchor(getAnchor(location));\n    }\n    scrollToElement(element) {\n        element.scrollIntoView();\n    }\n    focusElement(element) {\n        if (element instanceof HTMLElement) {\n            if (element.hasAttribute(\"tabindex\")) {\n                element.focus();\n            }\n            else {\n                element.setAttribute(\"tabindex\", \"-1\");\n                element.focus();\n                element.removeAttribute(\"tabindex\");\n            }\n        }\n    }\n    scrollToPosition({ x, y }) {\n        this.scrollRoot.scrollTo(x, y);\n    }\n    scrollToTop() {\n        this.scrollToPosition({ x: 0, y: 0 });\n    }\n    get scrollRoot() {\n        return window;\n    }\n    async render(renderer) {\n        const { isPreview, shouldRender, newSnapshot: snapshot } = renderer;\n        if (shouldRender) {\n            try {\n                this.renderPromise = new Promise((resolve) => (this.resolveRenderPromise = resolve));\n                this.renderer = renderer;\n                await this.prepareToRenderSnapshot(renderer);\n                const renderInterception = new Promise((resolve) => (this.resolveInterceptionPromise = resolve));\n                const options = { resume: this.resolveInterceptionPromise, render: this.renderer.renderElement };\n                const immediateRender = this.delegate.allowsImmediateRender(snapshot, options);\n                if (!immediateRender)\n                    await renderInterception;\n                await this.renderSnapshot(renderer);\n                this.delegate.viewRenderedSnapshot(snapshot, isPreview);\n                this.delegate.preloadOnLoadLinksForView(this.element);\n                this.finishRenderingSnapshot(renderer);\n            }\n            finally {\n                delete this.renderer;\n                this.resolveRenderPromise(undefined);\n                delete this.renderPromise;\n            }\n        }\n        else {\n            this.invalidate(renderer.reloadReason);\n        }\n    }\n    invalidate(reason) {\n        this.delegate.viewInvalidated(reason);\n    }\n    async prepareToRenderSnapshot(renderer) {\n        this.markAsPreview(renderer.isPreview);\n        await renderer.prepareToRender();\n    }\n    markAsPreview(isPreview) {\n        if (isPreview) {\n            this.element.setAttribute(\"data-turbo-preview\", \"\");\n        }\n        else {\n            this.element.removeAttribute(\"data-turbo-preview\");\n        }\n    }\n    async renderSnapshot(renderer) {\n        await renderer.render();\n    }\n    finishRenderingSnapshot(renderer) {\n        renderer.finishRendering();\n    }\n}\n\nclass FrameView extends View {\n    missing() {\n        this.element.innerHTML = `<strong class=\"turbo-frame-error\">Content missing</strong>`;\n    }\n    get snapshot() {\n        return new Snapshot(this.element);\n    }\n}\n\nclass LinkInterceptor {\n    constructor(delegate, element) {\n        this.clickBubbled = (event) => {\n            if (this.respondsToEventTarget(event.target)) {\n                this.clickEvent = event;\n            }\n            else {\n                delete this.clickEvent;\n            }\n        };\n        this.linkClicked = ((event) => {\n            if (this.clickEvent && this.respondsToEventTarget(event.target) && event.target instanceof Element) {\n                if (this.delegate.shouldInterceptLinkClick(event.target, event.detail.url, event.detail.originalEvent)) {\n                    this.clickEvent.preventDefault();\n                    event.preventDefault();\n                    this.delegate.linkClickIntercepted(event.target, event.detail.url, event.detail.originalEvent);\n                }\n            }\n            delete this.clickEvent;\n        });\n        this.willVisit = ((_event) => {\n            delete this.clickEvent;\n        });\n        this.delegate = delegate;\n        this.element = element;\n    }\n    start() {\n        this.element.addEventListener(\"click\", this.clickBubbled);\n        document.addEventListener(\"turbo:click\", this.linkClicked);\n        document.addEventListener(\"turbo:before-visit\", this.willVisit);\n    }\n    stop() {\n        this.element.removeEventListener(\"click\", this.clickBubbled);\n        document.removeEventListener(\"turbo:click\", this.linkClicked);\n        document.removeEventListener(\"turbo:before-visit\", this.willVisit);\n    }\n    respondsToEventTarget(target) {\n        const element = target instanceof Element ? target : target instanceof Node ? target.parentElement : null;\n        return element && element.closest(\"turbo-frame, html\") == this.element;\n    }\n}\n\nclass LinkClickObserver {\n    constructor(delegate, eventTarget) {\n        this.started = false;\n        this.clickCaptured = () => {\n            this.eventTarget.removeEventListener(\"click\", this.clickBubbled, false);\n            this.eventTarget.addEventListener(\"click\", this.clickBubbled, false);\n        };\n        this.clickBubbled = (event) => {\n            if (event instanceof MouseEvent && this.clickEventIsSignificant(event)) {\n                const target = (event.composedPath && event.composedPath()[0]) || event.target;\n                const link = this.findLinkFromClickTarget(target);\n                if (link && doesNotTargetIFrame(link)) {\n                    const location = this.getLocationForLink(link);\n                    if (this.delegate.willFollowLinkToLocation(link, location, event)) {\n                        event.preventDefault();\n                        this.delegate.followedLinkToLocation(link, location);\n                    }\n                }\n            }\n        };\n        this.delegate = delegate;\n        this.eventTarget = eventTarget;\n    }\n    start() {\n        if (!this.started) {\n            this.eventTarget.addEventListener(\"click\", this.clickCaptured, true);\n            this.started = true;\n        }\n    }\n    stop() {\n        if (this.started) {\n            this.eventTarget.removeEventListener(\"click\", this.clickCaptured, true);\n            this.started = false;\n        }\n    }\n    clickEventIsSignificant(event) {\n        return !((event.target && event.target.isContentEditable) ||\n            event.defaultPrevented ||\n            event.which > 1 ||\n            event.altKey ||\n            event.ctrlKey ||\n            event.metaKey ||\n            event.shiftKey);\n    }\n    findLinkFromClickTarget(target) {\n        return findClosestRecursively(target, \"a[href]:not([target^=_]):not([download])\");\n    }\n    getLocationForLink(link) {\n        return expandURL(link.getAttribute(\"href\") || \"\");\n    }\n}\nfunction doesNotTargetIFrame(anchor) {\n    if (anchor.hasAttribute(\"target\")) {\n        for (const element of document.getElementsByName(anchor.target)) {\n            if (element instanceof HTMLIFrameElement)\n                return false;\n        }\n        return true;\n    }\n    else {\n        return true;\n    }\n}\n\nclass FormLinkClickObserver {\n    constructor(delegate, element) {\n        this.delegate = delegate;\n        this.linkInterceptor = new LinkClickObserver(this, element);\n    }\n    start() {\n        this.linkInterceptor.start();\n    }\n    stop() {\n        this.linkInterceptor.stop();\n    }\n    willFollowLinkToLocation(link, location, originalEvent) {\n        return (this.delegate.willSubmitFormLinkToLocation(link, location, originalEvent) &&\n            link.hasAttribute(\"data-turbo-method\"));\n    }\n    followedLinkToLocation(link, location) {\n        const form = document.createElement(\"form\");\n        const type = \"hidden\";\n        for (const [name, value] of location.searchParams) {\n            form.append(Object.assign(document.createElement(\"input\"), { type, name, value }));\n        }\n        const action = Object.assign(location, { search: \"\" });\n        form.setAttribute(\"data-turbo\", \"true\");\n        form.setAttribute(\"action\", action.href);\n        form.setAttribute(\"hidden\", \"\");\n        const method = link.getAttribute(\"data-turbo-method\");\n        if (method)\n            form.setAttribute(\"method\", method);\n        const turboFrame = link.getAttribute(\"data-turbo-frame\");\n        if (turboFrame)\n            form.setAttribute(\"data-turbo-frame\", turboFrame);\n        const turboAction = getVisitAction(link);\n        if (turboAction)\n            form.setAttribute(\"data-turbo-action\", turboAction);\n        const turboConfirm = link.getAttribute(\"data-turbo-confirm\");\n        if (turboConfirm)\n            form.setAttribute(\"data-turbo-confirm\", turboConfirm);\n        const turboStream = link.hasAttribute(\"data-turbo-stream\");\n        if (turboStream)\n            form.setAttribute(\"data-turbo-stream\", \"\");\n        this.delegate.submittedFormLinkToLocation(link, location, form);\n        document.body.appendChild(form);\n        form.addEventListener(\"turbo:submit-end\", () => form.remove(), { once: true });\n        requestAnimationFrame(() => form.requestSubmit());\n    }\n}\n\nclass Bardo {\n    static async preservingPermanentElements(delegate, permanentElementMap, callback) {\n        const bardo = new this(delegate, permanentElementMap);\n        bardo.enter();\n        await callback();\n        bardo.leave();\n    }\n    constructor(delegate, permanentElementMap) {\n        this.delegate = delegate;\n        this.permanentElementMap = permanentElementMap;\n    }\n    enter() {\n        for (const id in this.permanentElementMap) {\n            const [currentPermanentElement, newPermanentElement] = this.permanentElementMap[id];\n            this.delegate.enteringBardo(currentPermanentElement, newPermanentElement);\n            this.replaceNewPermanentElementWithPlaceholder(newPermanentElement);\n        }\n    }\n    leave() {\n        for (const id in this.permanentElementMap) {\n            const [currentPermanentElement] = this.permanentElementMap[id];\n            this.replaceCurrentPermanentElementWithClone(currentPermanentElement);\n            this.replacePlaceholderWithPermanentElement(currentPermanentElement);\n            this.delegate.leavingBardo(currentPermanentElement);\n        }\n    }\n    replaceNewPermanentElementWithPlaceholder(permanentElement) {\n        const placeholder = createPlaceholderForPermanentElement(permanentElement);\n        permanentElement.replaceWith(placeholder);\n    }\n    replaceCurrentPermanentElementWithClone(permanentElement) {\n        const clone = permanentElement.cloneNode(true);\n        permanentElement.replaceWith(clone);\n    }\n    replacePlaceholderWithPermanentElement(permanentElement) {\n        const placeholder = this.getPlaceholderById(permanentElement.id);\n        placeholder === null || placeholder === void 0 ? void 0 : placeholder.replaceWith(permanentElement);\n    }\n    getPlaceholderById(id) {\n        return this.placeholders.find((element) => element.content == id);\n    }\n    get placeholders() {\n        return [...document.querySelectorAll(\"meta[name=turbo-permanent-placeholder][content]\")];\n    }\n}\nfunction createPlaceholderForPermanentElement(permanentElement) {\n    const element = document.createElement(\"meta\");\n    element.setAttribute(\"name\", \"turbo-permanent-placeholder\");\n    element.setAttribute(\"content\", permanentElement.id);\n    return element;\n}\n\nclass Renderer {\n    constructor(currentSnapshot, newSnapshot, renderElement, isPreview, willRender = true) {\n        this.activeElement = null;\n        this.currentSnapshot = currentSnapshot;\n        this.newSnapshot = newSnapshot;\n        this.isPreview = isPreview;\n        this.willRender = willRender;\n        this.renderElement = renderElement;\n        this.promise = new Promise((resolve, reject) => (this.resolvingFunctions = { resolve, reject }));\n    }\n    get shouldRender() {\n        return true;\n    }\n    get reloadReason() {\n        return;\n    }\n    prepareToRender() {\n        return;\n    }\n    finishRendering() {\n        if (this.resolvingFunctions) {\n            this.resolvingFunctions.resolve();\n            delete this.resolvingFunctions;\n        }\n    }\n    async preservingPermanentElements(callback) {\n        await Bardo.preservingPermanentElements(this, this.permanentElementMap, callback);\n    }\n    focusFirstAutofocusableElement() {\n        const element = this.connectedSnapshot.firstAutofocusableElement;\n        if (elementIsFocusable(element)) {\n            element.focus();\n        }\n    }\n    enteringBardo(currentPermanentElement) {\n        if (this.activeElement)\n            return;\n        if (currentPermanentElement.contains(this.currentSnapshot.activeElement)) {\n            this.activeElement = this.currentSnapshot.activeElement;\n        }\n    }\n    leavingBardo(currentPermanentElement) {\n        if (currentPermanentElement.contains(this.activeElement) && this.activeElement instanceof HTMLElement) {\n            this.activeElement.focus();\n            this.activeElement = null;\n        }\n    }\n    get connectedSnapshot() {\n        return this.newSnapshot.isConnected ? this.newSnapshot : this.currentSnapshot;\n    }\n    get currentElement() {\n        return this.currentSnapshot.element;\n    }\n    get newElement() {\n        return this.newSnapshot.element;\n    }\n    get permanentElementMap() {\n        return this.currentSnapshot.getPermanentElementMapForSnapshot(this.newSnapshot);\n    }\n}\nfunction elementIsFocusable(element) {\n    return element && typeof element.focus == \"function\";\n}\n\nclass FrameRenderer extends Renderer {\n    static renderElement(currentElement, newElement) {\n        var _a;\n        const destinationRange = document.createRange();\n        destinationRange.selectNodeContents(currentElement);\n        destinationRange.deleteContents();\n        const frameElement = newElement;\n        const sourceRange = (_a = frameElement.ownerDocument) === null || _a === void 0 ? void 0 : _a.createRange();\n        if (sourceRange) {\n            sourceRange.selectNodeContents(frameElement);\n            currentElement.appendChild(sourceRange.extractContents());\n        }\n    }\n    constructor(delegate, currentSnapshot, newSnapshot, renderElement, isPreview, willRender = true) {\n        super(currentSnapshot, newSnapshot, renderElement, isPreview, willRender);\n        this.delegate = delegate;\n    }\n    get shouldRender() {\n        return true;\n    }\n    async render() {\n        await nextAnimationFrame();\n        this.preservingPermanentElements(() => {\n            this.loadFrameElement();\n        });\n        this.scrollFrameIntoView();\n        await nextAnimationFrame();\n        this.focusFirstAutofocusableElement();\n        await nextAnimationFrame();\n        this.activateScriptElements();\n    }\n    loadFrameElement() {\n        this.delegate.willRenderFrame(this.currentElement, this.newElement);\n        this.renderElement(this.currentElement, this.newElement);\n    }\n    scrollFrameIntoView() {\n        if (this.currentElement.autoscroll || this.newElement.autoscroll) {\n            const element = this.currentElement.firstElementChild;\n            const block = readScrollLogicalPosition(this.currentElement.getAttribute(\"data-autoscroll-block\"), \"end\");\n            const behavior = readScrollBehavior(this.currentElement.getAttribute(\"data-autoscroll-behavior\"), \"auto\");\n            if (element) {\n                element.scrollIntoView({ block, behavior });\n                return true;\n            }\n        }\n        return false;\n    }\n    activateScriptElements() {\n        for (const inertScriptElement of this.newScriptElements) {\n            const activatedScriptElement = activateScriptElement(inertScriptElement);\n            inertScriptElement.replaceWith(activatedScriptElement);\n        }\n    }\n    get newScriptElements() {\n        return this.currentElement.querySelectorAll(\"script\");\n    }\n}\nfunction readScrollLogicalPosition(value, defaultValue) {\n    if (value == \"end\" || value == \"start\" || value == \"center\" || value == \"nearest\") {\n        return value;\n    }\n    else {\n        return defaultValue;\n    }\n}\nfunction readScrollBehavior(value, defaultValue) {\n    if (value == \"auto\" || value == \"smooth\") {\n        return value;\n    }\n    else {\n        return defaultValue;\n    }\n}\n\nclass ProgressBar {\n    static get defaultCSS() {\n        return unindent `\n      .turbo-progress-bar {\n        position: fixed;\n        display: block;\n        top: 0;\n        left: 0;\n        height: 3px;\n        background: #0076ff;\n        z-index: 2147483647;\n        transition:\n          width ${ProgressBar.animationDuration}ms ease-out,\n          opacity ${ProgressBar.animationDuration / 2}ms ${ProgressBar.animationDuration / 2}ms ease-in;\n        transform: translate3d(0, 0, 0);\n      }\n    `;\n    }\n    constructor() {\n        this.hiding = false;\n        this.value = 0;\n        this.visible = false;\n        this.trickle = () => {\n            this.setValue(this.value + Math.random() / 100);\n        };\n        this.stylesheetElement = this.createStylesheetElement();\n        this.progressElement = this.createProgressElement();\n        this.installStylesheetElement();\n        this.setValue(0);\n    }\n    show() {\n        if (!this.visible) {\n            this.visible = true;\n            this.installProgressElement();\n            this.startTrickling();\n        }\n    }\n    hide() {\n        if (this.visible && !this.hiding) {\n            this.hiding = true;\n            this.fadeProgressElement(() => {\n                this.uninstallProgressElement();\n                this.stopTrickling();\n                this.visible = false;\n                this.hiding = false;\n            });\n        }\n    }\n    setValue(value) {\n        this.value = value;\n        this.refresh();\n    }\n    installStylesheetElement() {\n        document.head.insertBefore(this.stylesheetElement, document.head.firstChild);\n    }\n    installProgressElement() {\n        this.progressElement.style.width = \"0\";\n        this.progressElement.style.opacity = \"1\";\n        document.documentElement.insertBefore(this.progressElement, document.body);\n        this.refresh();\n    }\n    fadeProgressElement(callback) {\n        this.progressElement.style.opacity = \"0\";\n        setTimeout(callback, ProgressBar.animationDuration * 1.5);\n    }\n    uninstallProgressElement() {\n        if (this.progressElement.parentNode) {\n            document.documentElement.removeChild(this.progressElement);\n        }\n    }\n    startTrickling() {\n        if (!this.trickleInterval) {\n            this.trickleInterval = window.setInterval(this.trickle, ProgressBar.animationDuration);\n        }\n    }\n    stopTrickling() {\n        window.clearInterval(this.trickleInterval);\n        delete this.trickleInterval;\n    }\n    refresh() {\n        requestAnimationFrame(() => {\n            this.progressElement.style.width = `${10 + this.value * 90}%`;\n        });\n    }\n    createStylesheetElement() {\n        const element = document.createElement(\"style\");\n        element.type = \"text/css\";\n        element.textContent = ProgressBar.defaultCSS;\n        if (this.cspNonce) {\n            element.nonce = this.cspNonce;\n        }\n        return element;\n    }\n    createProgressElement() {\n        const element = document.createElement(\"div\");\n        element.className = \"turbo-progress-bar\";\n        return element;\n    }\n    get cspNonce() {\n        return getMetaContent(\"csp-nonce\");\n    }\n}\nProgressBar.animationDuration = 300;\n\nclass HeadSnapshot extends Snapshot {\n    constructor() {\n        super(...arguments);\n        this.detailsByOuterHTML = this.children\n            .filter((element) => !elementIsNoscript(element))\n            .map((element) => elementWithoutNonce(element))\n            .reduce((result, element) => {\n            const { outerHTML } = element;\n            const details = outerHTML in result\n                ? result[outerHTML]\n                : {\n                    type: elementType(element),\n                    tracked: elementIsTracked(element),\n                    elements: [],\n                };\n            return Object.assign(Object.assign({}, result), { [outerHTML]: Object.assign(Object.assign({}, details), { elements: [...details.elements, element] }) });\n        }, {});\n    }\n    get trackedElementSignature() {\n        return Object.keys(this.detailsByOuterHTML)\n            .filter((outerHTML) => this.detailsByOuterHTML[outerHTML].tracked)\n            .join(\"\");\n    }\n    getScriptElementsNotInSnapshot(snapshot) {\n        return this.getElementsMatchingTypeNotInSnapshot(\"script\", snapshot);\n    }\n    getStylesheetElementsNotInSnapshot(snapshot) {\n        return this.getElementsMatchingTypeNotInSnapshot(\"stylesheet\", snapshot);\n    }\n    getElementsMatchingTypeNotInSnapshot(matchedType, snapshot) {\n        return Object.keys(this.detailsByOuterHTML)\n            .filter((outerHTML) => !(outerHTML in snapshot.detailsByOuterHTML))\n            .map((outerHTML) => this.detailsByOuterHTML[outerHTML])\n            .filter(({ type }) => type == matchedType)\n            .map(({ elements: [element] }) => element);\n    }\n    get provisionalElements() {\n        return Object.keys(this.detailsByOuterHTML).reduce((result, outerHTML) => {\n            const { type, tracked, elements } = this.detailsByOuterHTML[outerHTML];\n            if (type == null && !tracked) {\n                return [...result, ...elements];\n            }\n            else if (elements.length > 1) {\n                return [...result, ...elements.slice(1)];\n            }\n            else {\n                return result;\n            }\n        }, []);\n    }\n    getMetaValue(name) {\n        const element = this.findMetaElementByName(name);\n        return element ? element.getAttribute(\"content\") : null;\n    }\n    findMetaElementByName(name) {\n        return Object.keys(this.detailsByOuterHTML).reduce((result, outerHTML) => {\n            const { elements: [element], } = this.detailsByOuterHTML[outerHTML];\n            return elementIsMetaElementWithName(element, name) ? element : result;\n        }, undefined);\n    }\n}\nfunction elementType(element) {\n    if (elementIsScript(element)) {\n        return \"script\";\n    }\n    else if (elementIsStylesheet(element)) {\n        return \"stylesheet\";\n    }\n}\nfunction elementIsTracked(element) {\n    return element.getAttribute(\"data-turbo-track\") == \"reload\";\n}\nfunction elementIsScript(element) {\n    const tagName = element.localName;\n    return tagName == \"script\";\n}\nfunction elementIsNoscript(element) {\n    const tagName = element.localName;\n    return tagName == \"noscript\";\n}\nfunction elementIsStylesheet(element) {\n    const tagName = element.localName;\n    return tagName == \"style\" || (tagName == \"link\" && element.getAttribute(\"rel\") == \"stylesheet\");\n}\nfunction elementIsMetaElementWithName(element, name) {\n    const tagName = element.localName;\n    return tagName == \"meta\" && element.getAttribute(\"name\") == name;\n}\nfunction elementWithoutNonce(element) {\n    if (element.hasAttribute(\"nonce\")) {\n        element.setAttribute(\"nonce\", \"\");\n    }\n    return element;\n}\n\nclass PageSnapshot extends Snapshot {\n    static fromHTMLString(html = \"\") {\n        return this.fromDocument(parseHTMLDocument(html));\n    }\n    static fromElement(element) {\n        return this.fromDocument(element.ownerDocument);\n    }\n    static fromDocument({ head, body }) {\n        return new this(body, new HeadSnapshot(head));\n    }\n    constructor(element, headSnapshot) {\n        super(element);\n        this.headSnapshot = headSnapshot;\n    }\n    clone() {\n        const clonedElement = this.element.cloneNode(true);\n        const selectElements = this.element.querySelectorAll(\"select\");\n        const clonedSelectElements = clonedElement.querySelectorAll(\"select\");\n        for (const [index, source] of selectElements.entries()) {\n            const clone = clonedSelectElements[index];\n            for (const option of clone.selectedOptions)\n                option.selected = false;\n            for (const option of source.selectedOptions)\n                clone.options[option.index].selected = true;\n        }\n        for (const clonedPasswordInput of clonedElement.querySelectorAll('input[type=\"password\"]')) {\n            clonedPasswordInput.value = \"\";\n        }\n        return new PageSnapshot(clonedElement, this.headSnapshot);\n    }\n    get headElement() {\n        return this.headSnapshot.element;\n    }\n    get rootLocation() {\n        var _a;\n        const root = (_a = this.getSetting(\"root\")) !== null && _a !== void 0 ? _a : \"/\";\n        return expandURL(root);\n    }\n    get cacheControlValue() {\n        return this.getSetting(\"cache-control\");\n    }\n    get isPreviewable() {\n        return this.cacheControlValue != \"no-preview\";\n    }\n    get isCacheable() {\n        return this.cacheControlValue != \"no-cache\";\n    }\n    get isVisitable() {\n        return this.getSetting(\"visit-control\") != \"reload\";\n    }\n    getSetting(name) {\n        return this.headSnapshot.getMetaValue(`turbo-${name}`);\n    }\n}\n\nvar TimingMetric;\n(function (TimingMetric) {\n    TimingMetric[\"visitStart\"] = \"visitStart\";\n    TimingMetric[\"requestStart\"] = \"requestStart\";\n    TimingMetric[\"requestEnd\"] = \"requestEnd\";\n    TimingMetric[\"visitEnd\"] = \"visitEnd\";\n})(TimingMetric || (TimingMetric = {}));\nvar VisitState;\n(function (VisitState) {\n    VisitState[\"initialized\"] = \"initialized\";\n    VisitState[\"started\"] = \"started\";\n    VisitState[\"canceled\"] = \"canceled\";\n    VisitState[\"failed\"] = \"failed\";\n    VisitState[\"completed\"] = \"completed\";\n})(VisitState || (VisitState = {}));\nconst defaultOptions = {\n    action: \"advance\",\n    historyChanged: false,\n    visitCachedSnapshot: () => { },\n    willRender: true,\n    updateHistory: true,\n    shouldCacheSnapshot: true,\n    acceptsStreamResponse: false,\n};\nvar SystemStatusCode;\n(function (SystemStatusCode) {\n    SystemStatusCode[SystemStatusCode[\"networkFailure\"] = 0] = \"networkFailure\";\n    SystemStatusCode[SystemStatusCode[\"timeoutFailure\"] = -1] = \"timeoutFailure\";\n    SystemStatusCode[SystemStatusCode[\"contentTypeMismatch\"] = -2] = \"contentTypeMismatch\";\n})(SystemStatusCode || (SystemStatusCode = {}));\nclass Visit {\n    constructor(delegate, location, restorationIdentifier, options = {}) {\n        this.identifier = uuid();\n        this.timingMetrics = {};\n        this.followedRedirect = false;\n        this.historyChanged = false;\n        this.scrolled = false;\n        this.shouldCacheSnapshot = true;\n        this.acceptsStreamResponse = false;\n        this.snapshotCached = false;\n        this.state = VisitState.initialized;\n        this.delegate = delegate;\n        this.location = location;\n        this.restorationIdentifier = restorationIdentifier || uuid();\n        const { action, historyChanged, referrer, snapshot, snapshotHTML, response, visitCachedSnapshot, willRender, updateHistory, shouldCacheSnapshot, acceptsStreamResponse, } = Object.assign(Object.assign({}, defaultOptions), options);\n        this.action = action;\n        this.historyChanged = historyChanged;\n        this.referrer = referrer;\n        this.snapshot = snapshot;\n        this.snapshotHTML = snapshotHTML;\n        this.response = response;\n        this.isSamePage = this.delegate.locationWithActionIsSamePage(this.location, this.action);\n        this.visitCachedSnapshot = visitCachedSnapshot;\n        this.willRender = willRender;\n        this.updateHistory = updateHistory;\n        this.scrolled = !willRender;\n        this.shouldCacheSnapshot = shouldCacheSnapshot;\n        this.acceptsStreamResponse = acceptsStreamResponse;\n    }\n    get adapter() {\n        return this.delegate.adapter;\n    }\n    get view() {\n        return this.delegate.view;\n    }\n    get history() {\n        return this.delegate.history;\n    }\n    get restorationData() {\n        return this.history.getRestorationDataForIdentifier(this.restorationIdentifier);\n    }\n    get silent() {\n        return this.isSamePage;\n    }\n    start() {\n        if (this.state == VisitState.initialized) {\n            this.recordTimingMetric(TimingMetric.visitStart);\n            this.state = VisitState.started;\n            this.adapter.visitStarted(this);\n            this.delegate.visitStarted(this);\n        }\n    }\n    cancel() {\n        if (this.state == VisitState.started) {\n            if (this.request) {\n                this.request.cancel();\n            }\n            this.cancelRender();\n            this.state = VisitState.canceled;\n        }\n    }\n    complete() {\n        if (this.state == VisitState.started) {\n            this.recordTimingMetric(TimingMetric.visitEnd);\n            this.state = VisitState.completed;\n            this.followRedirect();\n            if (!this.followedRedirect) {\n                this.adapter.visitCompleted(this);\n                this.delegate.visitCompleted(this);\n            }\n        }\n    }\n    fail() {\n        if (this.state == VisitState.started) {\n            this.state = VisitState.failed;\n            this.adapter.visitFailed(this);\n        }\n    }\n    changeHistory() {\n        var _a;\n        if (!this.historyChanged && this.updateHistory) {\n            const actionForHistory = this.location.href === ((_a = this.referrer) === null || _a === void 0 ? void 0 : _a.href) ? \"replace\" : this.action;\n            const method = getHistoryMethodForAction(actionForHistory);\n            this.history.update(method, this.location, this.restorationIdentifier);\n            this.historyChanged = true;\n        }\n    }\n    issueRequest() {\n        if (this.hasPreloadedResponse()) {\n            this.simulateRequest();\n        }\n        else if (this.shouldIssueRequest() && !this.request) {\n            this.request = new FetchRequest(this, FetchMethod.get, this.location);\n            this.request.perform();\n        }\n    }\n    simulateRequest() {\n        if (this.response) {\n            this.startRequest();\n            this.recordResponse();\n            this.finishRequest();\n        }\n    }\n    startRequest() {\n        this.recordTimingMetric(TimingMetric.requestStart);\n        this.adapter.visitRequestStarted(this);\n    }\n    recordResponse(response = this.response) {\n        this.response = response;\n        if (response) {\n            const { statusCode } = response;\n            if (isSuccessful(statusCode)) {\n                this.adapter.visitRequestCompleted(this);\n            }\n            else {\n                this.adapter.visitRequestFailedWithStatusCode(this, statusCode);\n            }\n        }\n    }\n    finishRequest() {\n        this.recordTimingMetric(TimingMetric.requestEnd);\n        this.adapter.visitRequestFinished(this);\n    }\n    loadResponse() {\n        if (this.response) {\n            const { statusCode, responseHTML } = this.response;\n            this.render(async () => {\n                if (this.shouldCacheSnapshot)\n                    this.cacheSnapshot();\n                if (this.view.renderPromise)\n                    await this.view.renderPromise;\n                if (isSuccessful(statusCode) && responseHTML != null) {\n                    await this.view.renderPage(PageSnapshot.fromHTMLString(responseHTML), false, this.willRender, this);\n                    this.performScroll();\n                    this.adapter.visitRendered(this);\n                    this.complete();\n                }\n                else {\n                    await this.view.renderError(PageSnapshot.fromHTMLString(responseHTML), this);\n                    this.adapter.visitRendered(this);\n                    this.fail();\n                }\n            });\n        }\n    }\n    getCachedSnapshot() {\n        const snapshot = this.view.getCachedSnapshotForLocation(this.location) || this.getPreloadedSnapshot();\n        if (snapshot && (!getAnchor(this.location) || snapshot.hasAnchor(getAnchor(this.location)))) {\n            if (this.action == \"restore\" || snapshot.isPreviewable) {\n                return snapshot;\n            }\n        }\n    }\n    getPreloadedSnapshot() {\n        if (this.snapshotHTML) {\n            return PageSnapshot.fromHTMLString(this.snapshotHTML);\n        }\n    }\n    hasCachedSnapshot() {\n        return this.getCachedSnapshot() != null;\n    }\n    loadCachedSnapshot() {\n        const snapshot = this.getCachedSnapshot();\n        if (snapshot) {\n            const isPreview = this.shouldIssueRequest();\n            this.render(async () => {\n                this.cacheSnapshot();\n                if (this.isSamePage) {\n                    this.adapter.visitRendered(this);\n                }\n                else {\n                    if (this.view.renderPromise)\n                        await this.view.renderPromise;\n                    await this.view.renderPage(snapshot, isPreview, this.willRender, this);\n                    this.performScroll();\n                    this.adapter.visitRendered(this);\n                    if (!isPreview) {\n                        this.complete();\n                    }\n                }\n            });\n        }\n    }\n    followRedirect() {\n        var _a;\n        if (this.redirectedToLocation && !this.followedRedirect && ((_a = this.response) === null || _a === void 0 ? void 0 : _a.redirected)) {\n            this.adapter.visitProposedToLocation(this.redirectedToLocation, {\n                action: \"replace\",\n                response: this.response,\n                shouldCacheSnapshot: false,\n                willRender: false,\n            });\n            this.followedRedirect = true;\n        }\n    }\n    goToSamePageAnchor() {\n        if (this.isSamePage) {\n            this.render(async () => {\n                this.cacheSnapshot();\n                this.performScroll();\n                this.changeHistory();\n                this.adapter.visitRendered(this);\n            });\n        }\n    }\n    prepareRequest(request) {\n        if (this.acceptsStreamResponse) {\n            request.acceptResponseType(StreamMessage.contentType);\n        }\n    }\n    requestStarted() {\n        this.startRequest();\n    }\n    requestPreventedHandlingResponse(_request, _response) { }\n    async requestSucceededWithResponse(request, response) {\n        const responseHTML = await response.responseHTML;\n        const { redirected, statusCode } = response;\n        if (responseHTML == undefined) {\n            this.recordResponse({\n                statusCode: SystemStatusCode.contentTypeMismatch,\n                redirected,\n            });\n        }\n        else {\n            this.redirectedToLocation = response.redirected ? response.location : undefined;\n            this.recordResponse({ statusCode: statusCode, responseHTML, redirected });\n        }\n    }\n    async requestFailedWithResponse(request, response) {\n        const responseHTML = await response.responseHTML;\n        const { redirected, statusCode } = response;\n        if (responseHTML == undefined) {\n            this.recordResponse({\n                statusCode: SystemStatusCode.contentTypeMismatch,\n                redirected,\n            });\n        }\n        else {\n            this.recordResponse({ statusCode: statusCode, responseHTML, redirected });\n        }\n    }\n    requestErrored(_request, _error) {\n        this.recordResponse({\n            statusCode: SystemStatusCode.networkFailure,\n            redirected: false,\n        });\n    }\n    requestFinished() {\n        this.finishRequest();\n    }\n    performScroll() {\n        if (!this.scrolled && !this.view.forceReloaded) {\n            if (this.action == \"restore\") {\n                this.scrollToRestoredPosition() || this.scrollToAnchor() || this.view.scrollToTop();\n            }\n            else {\n                this.scrollToAnchor() || this.view.scrollToTop();\n            }\n            if (this.isSamePage) {\n                this.delegate.visitScrolledToSamePageLocation(this.view.lastRenderedLocation, this.location);\n            }\n            this.scrolled = true;\n        }\n    }\n    scrollToRestoredPosition() {\n        const { scrollPosition } = this.restorationData;\n        if (scrollPosition) {\n            this.view.scrollToPosition(scrollPosition);\n            return true;\n        }\n    }\n    scrollToAnchor() {\n        const anchor = getAnchor(this.location);\n        if (anchor != null) {\n            this.view.scrollToAnchor(anchor);\n            return true;\n        }\n    }\n    recordTimingMetric(metric) {\n        this.timingMetrics[metric] = new Date().getTime();\n    }\n    getTimingMetrics() {\n        return Object.assign({}, this.timingMetrics);\n    }\n    getHistoryMethodForAction(action) {\n        switch (action) {\n            case \"replace\":\n                return history.replaceState;\n            case \"advance\":\n            case \"restore\":\n                return history.pushState;\n        }\n    }\n    hasPreloadedResponse() {\n        return typeof this.response == \"object\";\n    }\n    shouldIssueRequest() {\n        if (this.isSamePage) {\n            return false;\n        }\n        else if (this.action == \"restore\") {\n            return !this.hasCachedSnapshot();\n        }\n        else {\n            return this.willRender;\n        }\n    }\n    cacheSnapshot() {\n        if (!this.snapshotCached) {\n            this.view.cacheSnapshot(this.snapshot).then((snapshot) => snapshot && this.visitCachedSnapshot(snapshot));\n            this.snapshotCached = true;\n        }\n    }\n    async render(callback) {\n        this.cancelRender();\n        await new Promise((resolve) => {\n            this.frame = requestAnimationFrame(() => resolve());\n        });\n        await callback();\n        delete this.frame;\n    }\n    cancelRender() {\n        if (this.frame) {\n            cancelAnimationFrame(this.frame);\n            delete this.frame;\n        }\n    }\n}\nfunction isSuccessful(statusCode) {\n    return statusCode >= 200 && statusCode < 300;\n}\n\nclass BrowserAdapter {\n    constructor(session) {\n        this.progressBar = new ProgressBar();\n        this.showProgressBar = () => {\n            this.progressBar.show();\n        };\n        this.session = session;\n    }\n    visitProposedToLocation(location, options) {\n        this.navigator.startVisit(location, (options === null || options === void 0 ? void 0 : options.restorationIdentifier) || uuid(), options);\n    }\n    visitStarted(visit) {\n        this.location = visit.location;\n        visit.loadCachedSnapshot();\n        visit.issueRequest();\n        visit.goToSamePageAnchor();\n    }\n    visitRequestStarted(visit) {\n        this.progressBar.setValue(0);\n        if (visit.hasCachedSnapshot() || visit.action != \"restore\") {\n            this.showVisitProgressBarAfterDelay();\n        }\n        else {\n            this.showProgressBar();\n        }\n    }\n    visitRequestCompleted(visit) {\n        visit.loadResponse();\n    }\n    visitRequestFailedWithStatusCode(visit, statusCode) {\n        switch (statusCode) {\n            case SystemStatusCode.networkFailure:\n            case SystemStatusCode.timeoutFailure:\n            case SystemStatusCode.contentTypeMismatch:\n                return this.reload({\n                    reason: \"request_failed\",\n                    context: {\n                        statusCode,\n                    },\n                });\n            default:\n                return visit.loadResponse();\n        }\n    }\n    visitRequestFinished(_visit) {\n        this.progressBar.setValue(1);\n        this.hideVisitProgressBar();\n    }\n    visitCompleted(_visit) { }\n    pageInvalidated(reason) {\n        this.reload(reason);\n    }\n    visitFailed(_visit) { }\n    visitRendered(_visit) { }\n    formSubmissionStarted(_formSubmission) {\n        this.progressBar.setValue(0);\n        this.showFormProgressBarAfterDelay();\n    }\n    formSubmissionFinished(_formSubmission) {\n        this.progressBar.setValue(1);\n        this.hideFormProgressBar();\n    }\n    showVisitProgressBarAfterDelay() {\n        this.visitProgressBarTimeout = window.setTimeout(this.showProgressBar, this.session.progressBarDelay);\n    }\n    hideVisitProgressBar() {\n        this.progressBar.hide();\n        if (this.visitProgressBarTimeout != null) {\n            window.clearTimeout(this.visitProgressBarTimeout);\n            delete this.visitProgressBarTimeout;\n        }\n    }\n    showFormProgressBarAfterDelay() {\n        if (this.formProgressBarTimeout == null) {\n            this.formProgressBarTimeout = window.setTimeout(this.showProgressBar, this.session.progressBarDelay);\n        }\n    }\n    hideFormProgressBar() {\n        this.progressBar.hide();\n        if (this.formProgressBarTimeout != null) {\n            window.clearTimeout(this.formProgressBarTimeout);\n            delete this.formProgressBarTimeout;\n        }\n    }\n    reload(reason) {\n        var _a;\n        dispatch(\"turbo:reload\", { detail: reason });\n        window.location.href = ((_a = this.location) === null || _a === void 0 ? void 0 : _a.toString()) || window.location.href;\n    }\n    get navigator() {\n        return this.session.navigator;\n    }\n}\n\nclass CacheObserver {\n    constructor() {\n        this.selector = \"[data-turbo-temporary]\";\n        this.deprecatedSelector = \"[data-turbo-cache=false]\";\n        this.started = false;\n        this.removeTemporaryElements = ((_event) => {\n            for (const element of this.temporaryElements) {\n                element.remove();\n            }\n        });\n    }\n    start() {\n        if (!this.started) {\n            this.started = true;\n            addEventListener(\"turbo:before-cache\", this.removeTemporaryElements, false);\n        }\n    }\n    stop() {\n        if (this.started) {\n            this.started = false;\n            removeEventListener(\"turbo:before-cache\", this.removeTemporaryElements, false);\n        }\n    }\n    get temporaryElements() {\n        return [...document.querySelectorAll(this.selector), ...this.temporaryElementsWithDeprecation];\n    }\n    get temporaryElementsWithDeprecation() {\n        const elements = document.querySelectorAll(this.deprecatedSelector);\n        if (elements.length) {\n            console.warn(`The ${this.deprecatedSelector} selector is deprecated and will be removed in a future version. Use ${this.selector} instead.`);\n        }\n        return [...elements];\n    }\n}\n\nclass FrameRedirector {\n    constructor(session, element) {\n        this.session = session;\n        this.element = element;\n        this.linkInterceptor = new LinkInterceptor(this, element);\n        this.formSubmitObserver = new FormSubmitObserver(this, element);\n    }\n    start() {\n        this.linkInterceptor.start();\n        this.formSubmitObserver.start();\n    }\n    stop() {\n        this.linkInterceptor.stop();\n        this.formSubmitObserver.stop();\n    }\n    shouldInterceptLinkClick(element, _location, _event) {\n        return this.shouldRedirect(element);\n    }\n    linkClickIntercepted(element, url, event) {\n        const frame = this.findFrameElement(element);\n        if (frame) {\n            frame.delegate.linkClickIntercepted(element, url, event);\n        }\n    }\n    willSubmitForm(element, submitter) {\n        return (element.closest(\"turbo-frame\") == null &&\n            this.shouldSubmit(element, submitter) &&\n            this.shouldRedirect(element, submitter));\n    }\n    formSubmitted(element, submitter) {\n        const frame = this.findFrameElement(element, submitter);\n        if (frame) {\n            frame.delegate.formSubmitted(element, submitter);\n        }\n    }\n    shouldSubmit(form, submitter) {\n        var _a;\n        const action = getAction(form, submitter);\n        const meta = this.element.ownerDocument.querySelector(`meta[name=\"turbo-root\"]`);\n        const rootLocation = expandURL((_a = meta === null || meta === void 0 ? void 0 : meta.content) !== null && _a !== void 0 ? _a : \"/\");\n        return this.shouldRedirect(form, submitter) && locationIsVisitable(action, rootLocation);\n    }\n    shouldRedirect(element, submitter) {\n        const isNavigatable = element instanceof HTMLFormElement\n            ? this.session.submissionIsNavigatable(element, submitter)\n            : this.session.elementIsNavigatable(element);\n        if (isNavigatable) {\n            const frame = this.findFrameElement(element, submitter);\n            return frame ? frame != element.closest(\"turbo-frame\") : false;\n        }\n        else {\n            return false;\n        }\n    }\n    findFrameElement(element, submitter) {\n        const id = (submitter === null || submitter === void 0 ? void 0 : submitter.getAttribute(\"data-turbo-frame\")) || element.getAttribute(\"data-turbo-frame\");\n        if (id && id != \"_top\") {\n            const frame = this.element.querySelector(`#${id}:not([disabled])`);\n            if (frame instanceof FrameElement) {\n                return frame;\n            }\n        }\n    }\n}\n\nclass History {\n    constructor(delegate) {\n        this.restorationIdentifier = uuid();\n        this.restorationData = {};\n        this.started = false;\n        this.pageLoaded = false;\n        this.onPopState = (event) => {\n            if (this.shouldHandlePopState()) {\n                const { turbo } = event.state || {};\n                if (turbo) {\n                    this.location = new URL(window.location.href);\n                    const { restorationIdentifier } = turbo;\n                    this.restorationIdentifier = restorationIdentifier;\n                    this.delegate.historyPoppedToLocationWithRestorationIdentifier(this.location, restorationIdentifier);\n                }\n            }\n        };\n        this.onPageLoad = async (_event) => {\n            await nextMicrotask();\n            this.pageLoaded = true;\n        };\n        this.delegate = delegate;\n    }\n    start() {\n        if (!this.started) {\n            addEventListener(\"popstate\", this.onPopState, false);\n            addEventListener(\"load\", this.onPageLoad, false);\n            this.started = true;\n            this.replace(new URL(window.location.href));\n        }\n    }\n    stop() {\n        if (this.started) {\n            removeEventListener(\"popstate\", this.onPopState, false);\n            removeEventListener(\"load\", this.onPageLoad, false);\n            this.started = false;\n        }\n    }\n    push(location, restorationIdentifier) {\n        this.update(history.pushState, location, restorationIdentifier);\n    }\n    replace(location, restorationIdentifier) {\n        this.update(history.replaceState, location, restorationIdentifier);\n    }\n    update(method, location, restorationIdentifier = uuid()) {\n        const state = { turbo: { restorationIdentifier } };\n        method.call(history, state, \"\", location.href);\n        this.location = location;\n        this.restorationIdentifier = restorationIdentifier;\n    }\n    getRestorationDataForIdentifier(restorationIdentifier) {\n        return this.restorationData[restorationIdentifier] || {};\n    }\n    updateRestorationData(additionalData) {\n        const { restorationIdentifier } = this;\n        const restorationData = this.restorationData[restorationIdentifier];\n        this.restorationData[restorationIdentifier] = Object.assign(Object.assign({}, restorationData), additionalData);\n    }\n    assumeControlOfScrollRestoration() {\n        var _a;\n        if (!this.previousScrollRestoration) {\n            this.previousScrollRestoration = (_a = history.scrollRestoration) !== null && _a !== void 0 ? _a : \"auto\";\n            history.scrollRestoration = \"manual\";\n        }\n    }\n    relinquishControlOfScrollRestoration() {\n        if (this.previousScrollRestoration) {\n            history.scrollRestoration = this.previousScrollRestoration;\n            delete this.previousScrollRestoration;\n        }\n    }\n    shouldHandlePopState() {\n        return this.pageIsLoaded();\n    }\n    pageIsLoaded() {\n        return this.pageLoaded || document.readyState == \"complete\";\n    }\n}\n\nclass Navigator {\n    constructor(delegate) {\n        this.delegate = delegate;\n    }\n    proposeVisit(location, options = {}) {\n        if (this.delegate.allowsVisitingLocationWithAction(location, options.action)) {\n            if (locationIsVisitable(location, this.view.snapshot.rootLocation)) {\n                this.delegate.visitProposedToLocation(location, options);\n            }\n            else {\n                window.location.href = location.toString();\n            }\n        }\n    }\n    startVisit(locatable, restorationIdentifier, options = {}) {\n        this.stop();\n        this.currentVisit = new Visit(this, expandURL(locatable), restorationIdentifier, Object.assign({ referrer: this.location }, options));\n        this.currentVisit.start();\n    }\n    submitForm(form, submitter) {\n        this.stop();\n        this.formSubmission = new FormSubmission(this, form, submitter, true);\n        this.formSubmission.start();\n    }\n    stop() {\n        if (this.formSubmission) {\n            this.formSubmission.stop();\n            delete this.formSubmission;\n        }\n        if (this.currentVisit) {\n            this.currentVisit.cancel();\n            delete this.currentVisit;\n        }\n    }\n    get adapter() {\n        return this.delegate.adapter;\n    }\n    get view() {\n        return this.delegate.view;\n    }\n    get history() {\n        return this.delegate.history;\n    }\n    formSubmissionStarted(formSubmission) {\n        if (typeof this.adapter.formSubmissionStarted === \"function\") {\n            this.adapter.formSubmissionStarted(formSubmission);\n        }\n    }\n    async formSubmissionSucceededWithResponse(formSubmission, fetchResponse) {\n        if (formSubmission == this.formSubmission) {\n            const responseHTML = await fetchResponse.responseHTML;\n            if (responseHTML) {\n                const shouldCacheSnapshot = formSubmission.isSafe;\n                if (!shouldCacheSnapshot) {\n                    this.view.clearSnapshotCache();\n                }\n                const { statusCode, redirected } = fetchResponse;\n                const action = this.getActionForFormSubmission(formSubmission);\n                const visitOptions = {\n                    action,\n                    shouldCacheSnapshot,\n                    response: { statusCode, responseHTML, redirected },\n                };\n                this.proposeVisit(fetchResponse.location, visitOptions);\n            }\n        }\n    }\n    async formSubmissionFailedWithResponse(formSubmission, fetchResponse) {\n        const responseHTML = await fetchResponse.responseHTML;\n        if (responseHTML) {\n            const snapshot = PageSnapshot.fromHTMLString(responseHTML);\n            if (fetchResponse.serverError) {\n                await this.view.renderError(snapshot, this.currentVisit);\n            }\n            else {\n                await this.view.renderPage(snapshot, false, true, this.currentVisit);\n            }\n            this.view.scrollToTop();\n            this.view.clearSnapshotCache();\n        }\n    }\n    formSubmissionErrored(formSubmission, error) {\n        console.error(error);\n    }\n    formSubmissionFinished(formSubmission) {\n        if (typeof this.adapter.formSubmissionFinished === \"function\") {\n            this.adapter.formSubmissionFinished(formSubmission);\n        }\n    }\n    visitStarted(visit) {\n        this.delegate.visitStarted(visit);\n    }\n    visitCompleted(visit) {\n        this.delegate.visitCompleted(visit);\n    }\n    locationWithActionIsSamePage(location, action) {\n        const anchor = getAnchor(location);\n        const currentAnchor = getAnchor(this.view.lastRenderedLocation);\n        const isRestorationToTop = action === \"restore\" && typeof anchor === \"undefined\";\n        return (action !== \"replace\" &&\n            getRequestURL(location) === getRequestURL(this.view.lastRenderedLocation) &&\n            (isRestorationToTop || (anchor != null && anchor !== currentAnchor)));\n    }\n    visitScrolledToSamePageLocation(oldURL, newURL) {\n        this.delegate.visitScrolledToSamePageLocation(oldURL, newURL);\n    }\n    get location() {\n        return this.history.location;\n    }\n    get restorationIdentifier() {\n        return this.history.restorationIdentifier;\n    }\n    getActionForFormSubmission({ submitter, formElement }) {\n        return getVisitAction(submitter, formElement) || \"advance\";\n    }\n}\n\nvar PageStage;\n(function (PageStage) {\n    PageStage[PageStage[\"initial\"] = 0] = \"initial\";\n    PageStage[PageStage[\"loading\"] = 1] = \"loading\";\n    PageStage[PageStage[\"interactive\"] = 2] = \"interactive\";\n    PageStage[PageStage[\"complete\"] = 3] = \"complete\";\n})(PageStage || (PageStage = {}));\nclass PageObserver {\n    constructor(delegate) {\n        this.stage = PageStage.initial;\n        this.started = false;\n        this.interpretReadyState = () => {\n            const { readyState } = this;\n            if (readyState == \"interactive\") {\n                this.pageIsInteractive();\n            }\n            else if (readyState == \"complete\") {\n                this.pageIsComplete();\n            }\n        };\n        this.pageWillUnload = () => {\n            this.delegate.pageWillUnload();\n        };\n        this.delegate = delegate;\n    }\n    start() {\n        if (!this.started) {\n            if (this.stage == PageStage.initial) {\n                this.stage = PageStage.loading;\n            }\n            document.addEventListener(\"readystatechange\", this.interpretReadyState, false);\n            addEventListener(\"pagehide\", this.pageWillUnload, false);\n            this.started = true;\n        }\n    }\n    stop() {\n        if (this.started) {\n            document.removeEventListener(\"readystatechange\", this.interpretReadyState, false);\n            removeEventListener(\"pagehide\", this.pageWillUnload, false);\n            this.started = false;\n        }\n    }\n    pageIsInteractive() {\n        if (this.stage == PageStage.loading) {\n            this.stage = PageStage.interactive;\n            this.delegate.pageBecameInteractive();\n        }\n    }\n    pageIsComplete() {\n        this.pageIsInteractive();\n        if (this.stage == PageStage.interactive) {\n            this.stage = PageStage.complete;\n            this.delegate.pageLoaded();\n        }\n    }\n    get readyState() {\n        return document.readyState;\n    }\n}\n\nclass ScrollObserver {\n    constructor(delegate) {\n        this.started = false;\n        this.onScroll = () => {\n            this.updatePosition({ x: window.pageXOffset, y: window.pageYOffset });\n        };\n        this.delegate = delegate;\n    }\n    start() {\n        if (!this.started) {\n            addEventListener(\"scroll\", this.onScroll, false);\n            this.onScroll();\n            this.started = true;\n        }\n    }\n    stop() {\n        if (this.started) {\n            removeEventListener(\"scroll\", this.onScroll, false);\n            this.started = false;\n        }\n    }\n    updatePosition(position) {\n        this.delegate.scrollPositionChanged(position);\n    }\n}\n\nclass StreamMessageRenderer {\n    render({ fragment }) {\n        Bardo.preservingPermanentElements(this, getPermanentElementMapForFragment(fragment), () => document.documentElement.appendChild(fragment));\n    }\n    enteringBardo(currentPermanentElement, newPermanentElement) {\n        newPermanentElement.replaceWith(currentPermanentElement.cloneNode(true));\n    }\n    leavingBardo() { }\n}\nfunction getPermanentElementMapForFragment(fragment) {\n    const permanentElementsInDocument = queryPermanentElementsAll(document.documentElement);\n    const permanentElementMap = {};\n    for (const permanentElementInDocument of permanentElementsInDocument) {\n        const { id } = permanentElementInDocument;\n        for (const streamElement of fragment.querySelectorAll(\"turbo-stream\")) {\n            const elementInStream = getPermanentElementById(streamElement.templateElement.content, id);\n            if (elementInStream) {\n                permanentElementMap[id] = [permanentElementInDocument, elementInStream];\n            }\n        }\n    }\n    return permanentElementMap;\n}\n\nclass StreamObserver {\n    constructor(delegate) {\n        this.sources = new Set();\n        this.started = false;\n        this.inspectFetchResponse = ((event) => {\n            const response = fetchResponseFromEvent(event);\n            if (response && fetchResponseIsStream(response)) {\n                event.preventDefault();\n                this.receiveMessageResponse(response);\n            }\n        });\n        this.receiveMessageEvent = (event) => {\n            if (this.started && typeof event.data == \"string\") {\n                this.receiveMessageHTML(event.data);\n            }\n        };\n        this.delegate = delegate;\n    }\n    start() {\n        if (!this.started) {\n            this.started = true;\n            addEventListener(\"turbo:before-fetch-response\", this.inspectFetchResponse, false);\n        }\n    }\n    stop() {\n        if (this.started) {\n            this.started = false;\n            removeEventListener(\"turbo:before-fetch-response\", this.inspectFetchResponse, false);\n        }\n    }\n    connectStreamSource(source) {\n        if (!this.streamSourceIsConnected(source)) {\n            this.sources.add(source);\n            source.addEventListener(\"message\", this.receiveMessageEvent, false);\n        }\n    }\n    disconnectStreamSource(source) {\n        if (this.streamSourceIsConnected(source)) {\n            this.sources.delete(source);\n            source.removeEventListener(\"message\", this.receiveMessageEvent, false);\n        }\n    }\n    streamSourceIsConnected(source) {\n        return this.sources.has(source);\n    }\n    async receiveMessageResponse(response) {\n        const html = await response.responseHTML;\n        if (html) {\n            this.receiveMessageHTML(html);\n        }\n    }\n    receiveMessageHTML(html) {\n        this.delegate.receivedMessageFromStream(StreamMessage.wrap(html));\n    }\n}\nfunction fetchResponseFromEvent(event) {\n    var _a;\n    const fetchResponse = (_a = event.detail) === null || _a === void 0 ? void 0 : _a.fetchResponse;\n    if (fetchResponse instanceof FetchResponse) {\n        return fetchResponse;\n    }\n}\nfunction fetchResponseIsStream(response) {\n    var _a;\n    const contentType = (_a = response.contentType) !== null && _a !== void 0 ? _a : \"\";\n    return contentType.startsWith(StreamMessage.contentType);\n}\n\nclass ErrorRenderer extends Renderer {\n    static renderElement(currentElement, newElement) {\n        const { documentElement, body } = document;\n        documentElement.replaceChild(newElement, body);\n    }\n    async render() {\n        this.replaceHeadAndBody();\n        this.activateScriptElements();\n    }\n    replaceHeadAndBody() {\n        const { documentElement, head } = document;\n        documentElement.replaceChild(this.newHead, head);\n        this.renderElement(this.currentElement, this.newElement);\n    }\n    activateScriptElements() {\n        for (const replaceableElement of this.scriptElements) {\n            const parentNode = replaceableElement.parentNode;\n            if (parentNode) {\n                const element = activateScriptElement(replaceableElement);\n                parentNode.replaceChild(element, replaceableElement);\n            }\n        }\n    }\n    get newHead() {\n        return this.newSnapshot.headSnapshot.element;\n    }\n    get scriptElements() {\n        return document.documentElement.querySelectorAll(\"script\");\n    }\n}\n\nclass PageRenderer extends Renderer {\n    static renderElement(currentElement, newElement) {\n        if (document.body && newElement instanceof HTMLBodyElement) {\n            document.body.replaceWith(newElement);\n        }\n        else {\n            document.documentElement.appendChild(newElement);\n        }\n    }\n    get shouldRender() {\n        return this.newSnapshot.isVisitable && this.trackedElementsAreIdentical;\n    }\n    get reloadReason() {\n        if (!this.newSnapshot.isVisitable) {\n            return {\n                reason: \"turbo_visit_control_is_reload\",\n            };\n        }\n        if (!this.trackedElementsAreIdentical) {\n            return {\n                reason: \"tracked_element_mismatch\",\n            };\n        }\n    }\n    async prepareToRender() {\n        await this.mergeHead();\n    }\n    async render() {\n        if (this.willRender) {\n            await this.replaceBody();\n        }\n    }\n    finishRendering() {\n        super.finishRendering();\n        if (!this.isPreview) {\n            this.focusFirstAutofocusableElement();\n        }\n    }\n    get currentHeadSnapshot() {\n        return this.currentSnapshot.headSnapshot;\n    }\n    get newHeadSnapshot() {\n        return this.newSnapshot.headSnapshot;\n    }\n    get newElement() {\n        return this.newSnapshot.element;\n    }\n    async mergeHead() {\n        const mergedHeadElements = this.mergeProvisionalElements();\n        const newStylesheetElements = this.copyNewHeadStylesheetElements();\n        this.copyNewHeadScriptElements();\n        await mergedHeadElements;\n        await newStylesheetElements;\n    }\n    async replaceBody() {\n        await this.preservingPermanentElements(async () => {\n            this.activateNewBody();\n            await this.assignNewBody();\n        });\n    }\n    get trackedElementsAreIdentical() {\n        return this.currentHeadSnapshot.trackedElementSignature == this.newHeadSnapshot.trackedElementSignature;\n    }\n    async copyNewHeadStylesheetElements() {\n        const loadingElements = [];\n        for (const element of this.newHeadStylesheetElements) {\n            loadingElements.push(waitForLoad(element));\n            document.head.appendChild(element);\n        }\n        await Promise.all(loadingElements);\n    }\n    copyNewHeadScriptElements() {\n        for (const element of this.newHeadScriptElements) {\n            document.head.appendChild(activateScriptElement(element));\n        }\n    }\n    async mergeProvisionalElements() {\n        const newHeadElements = [...this.newHeadProvisionalElements];\n        for (const element of this.currentHeadProvisionalElements) {\n            if (!this.isCurrentElementInElementList(element, newHeadElements)) {\n                document.head.removeChild(element);\n            }\n        }\n        for (const element of newHeadElements) {\n            document.head.appendChild(element);\n        }\n    }\n    isCurrentElementInElementList(element, elementList) {\n        for (const [index, newElement] of elementList.entries()) {\n            if (element.tagName == \"TITLE\") {\n                if (newElement.tagName != \"TITLE\") {\n                    continue;\n                }\n                if (element.innerHTML == newElement.innerHTML) {\n                    elementList.splice(index, 1);\n                    return true;\n                }\n            }\n            if (newElement.isEqualNode(element)) {\n                elementList.splice(index, 1);\n                return true;\n            }\n        }\n        return false;\n    }\n    removeCurrentHeadProvisionalElements() {\n        for (const element of this.currentHeadProvisionalElements) {\n            document.head.removeChild(element);\n        }\n    }\n    copyNewHeadProvisionalElements() {\n        for (const element of this.newHeadProvisionalElements) {\n            document.head.appendChild(element);\n        }\n    }\n    activateNewBody() {\n        document.adoptNode(this.newElement);\n        this.activateNewBodyScriptElements();\n    }\n    activateNewBodyScriptElements() {\n        for (const inertScriptElement of this.newBodyScriptElements) {\n            const activatedScriptElement = activateScriptElement(inertScriptElement);\n            inertScriptElement.replaceWith(activatedScriptElement);\n        }\n    }\n    async assignNewBody() {\n        await this.renderElement(this.currentElement, this.newElement);\n    }\n    get newHeadStylesheetElements() {\n        return this.newHeadSnapshot.getStylesheetElementsNotInSnapshot(this.currentHeadSnapshot);\n    }\n    get newHeadScriptElements() {\n        return this.newHeadSnapshot.getScriptElementsNotInSnapshot(this.currentHeadSnapshot);\n    }\n    get currentHeadProvisionalElements() {\n        return this.currentHeadSnapshot.provisionalElements;\n    }\n    get newHeadProvisionalElements() {\n        return this.newHeadSnapshot.provisionalElements;\n    }\n    get newBodyScriptElements() {\n        return this.newElement.querySelectorAll(\"script\");\n    }\n}\n\nclass SnapshotCache {\n    constructor(size) {\n        this.keys = [];\n        this.snapshots = {};\n        this.size = size;\n    }\n    has(location) {\n        return toCacheKey(location) in this.snapshots;\n    }\n    get(location) {\n        if (this.has(location)) {\n            const snapshot = this.read(location);\n            this.touch(location);\n            return snapshot;\n        }\n    }\n    put(location, snapshot) {\n        this.write(location, snapshot);\n        this.touch(location);\n        return snapshot;\n    }\n    clear() {\n        this.snapshots = {};\n    }\n    read(location) {\n        return this.snapshots[toCacheKey(location)];\n    }\n    write(location, snapshot) {\n        this.snapshots[toCacheKey(location)] = snapshot;\n    }\n    touch(location) {\n        const key = toCacheKey(location);\n        const index = this.keys.indexOf(key);\n        if (index > -1)\n            this.keys.splice(index, 1);\n        this.keys.unshift(key);\n        this.trim();\n    }\n    trim() {\n        for (const key of this.keys.splice(this.size)) {\n            delete this.snapshots[key];\n        }\n    }\n}\n\nclass PageView extends View {\n    constructor() {\n        super(...arguments);\n        this.snapshotCache = new SnapshotCache(10);\n        this.lastRenderedLocation = new URL(location.href);\n        this.forceReloaded = false;\n    }\n    renderPage(snapshot, isPreview = false, willRender = true, visit) {\n        const renderer = new PageRenderer(this.snapshot, snapshot, PageRenderer.renderElement, isPreview, willRender);\n        if (!renderer.shouldRender) {\n            this.forceReloaded = true;\n        }\n        else {\n            visit === null || visit === void 0 ? void 0 : visit.changeHistory();\n        }\n        return this.render(renderer);\n    }\n    renderError(snapshot, visit) {\n        visit === null || visit === void 0 ? void 0 : visit.changeHistory();\n        const renderer = new ErrorRenderer(this.snapshot, snapshot, ErrorRenderer.renderElement, false);\n        return this.render(renderer);\n    }\n    clearSnapshotCache() {\n        this.snapshotCache.clear();\n    }\n    async cacheSnapshot(snapshot = this.snapshot) {\n        if (snapshot.isCacheable) {\n            this.delegate.viewWillCacheSnapshot();\n            const { lastRenderedLocation: location } = this;\n            await nextEventLoopTick();\n            const cachedSnapshot = snapshot.clone();\n            this.snapshotCache.put(location, cachedSnapshot);\n            return cachedSnapshot;\n        }\n    }\n    getCachedSnapshotForLocation(location) {\n        return this.snapshotCache.get(location);\n    }\n    get snapshot() {\n        return PageSnapshot.fromElement(this.element);\n    }\n}\n\nclass Preloader {\n    constructor(delegate) {\n        this.selector = \"a[data-turbo-preload]\";\n        this.delegate = delegate;\n    }\n    get snapshotCache() {\n        return this.delegate.navigator.view.snapshotCache;\n    }\n    start() {\n        if (document.readyState === \"loading\") {\n            return document.addEventListener(\"DOMContentLoaded\", () => {\n                this.preloadOnLoadLinksForView(document.body);\n            });\n        }\n        else {\n            this.preloadOnLoadLinksForView(document.body);\n        }\n    }\n    preloadOnLoadLinksForView(element) {\n        for (const link of element.querySelectorAll(this.selector)) {\n            this.preloadURL(link);\n        }\n    }\n    async preloadURL(link) {\n        const location = new URL(link.href);\n        if (this.snapshotCache.has(location)) {\n            return;\n        }\n        try {\n            const response = await fetch(location.toString(), { headers: { \"VND.PREFETCH\": \"true\", Accept: \"text/html\" } });\n            const responseText = await response.text();\n            const snapshot = PageSnapshot.fromHTMLString(responseText);\n            this.snapshotCache.put(location, snapshot);\n        }\n        catch (_) {\n        }\n    }\n}\n\nclass Session {\n    constructor() {\n        this.navigator = new Navigator(this);\n        this.history = new History(this);\n        this.preloader = new Preloader(this);\n        this.view = new PageView(this, document.documentElement);\n        this.adapter = new BrowserAdapter(this);\n        this.pageObserver = new PageObserver(this);\n        this.cacheObserver = new CacheObserver();\n        this.linkClickObserver = new LinkClickObserver(this, window);\n        this.formSubmitObserver = new FormSubmitObserver(this, document);\n        this.scrollObserver = new ScrollObserver(this);\n        this.streamObserver = new StreamObserver(this);\n        this.formLinkClickObserver = new FormLinkClickObserver(this, document.documentElement);\n        this.frameRedirector = new FrameRedirector(this, document.documentElement);\n        this.streamMessageRenderer = new StreamMessageRenderer();\n        this.drive = true;\n        this.enabled = true;\n        this.progressBarDelay = 500;\n        this.started = false;\n        this.formMode = \"on\";\n    }\n    start() {\n        if (!this.started) {\n            this.pageObserver.start();\n            this.cacheObserver.start();\n            this.formLinkClickObserver.start();\n            this.linkClickObserver.start();\n            this.formSubmitObserver.start();\n            this.scrollObserver.start();\n            this.streamObserver.start();\n            this.frameRedirector.start();\n            this.history.start();\n            this.preloader.start();\n            this.started = true;\n            this.enabled = true;\n        }\n    }\n    disable() {\n        this.enabled = false;\n    }\n    stop() {\n        if (this.started) {\n            this.pageObserver.stop();\n            this.cacheObserver.stop();\n            this.formLinkClickObserver.stop();\n            this.linkClickObserver.stop();\n            this.formSubmitObserver.stop();\n            this.scrollObserver.stop();\n            this.streamObserver.stop();\n            this.frameRedirector.stop();\n            this.history.stop();\n            this.started = false;\n        }\n    }\n    registerAdapter(adapter) {\n        this.adapter = adapter;\n    }\n    visit(location, options = {}) {\n        const frameElement = options.frame ? document.getElementById(options.frame) : null;\n        if (frameElement instanceof FrameElement) {\n            frameElement.src = location.toString();\n            frameElement.loaded;\n        }\n        else {\n            this.navigator.proposeVisit(expandURL(location), options);\n        }\n    }\n    connectStreamSource(source) {\n        this.streamObserver.connectStreamSource(source);\n    }\n    disconnectStreamSource(source) {\n        this.streamObserver.disconnectStreamSource(source);\n    }\n    renderStreamMessage(message) {\n        this.streamMessageRenderer.render(StreamMessage.wrap(message));\n    }\n    clearCache() {\n        this.view.clearSnapshotCache();\n    }\n    setProgressBarDelay(delay) {\n        this.progressBarDelay = delay;\n    }\n    setFormMode(mode) {\n        this.formMode = mode;\n    }\n    get location() {\n        return this.history.location;\n    }\n    get restorationIdentifier() {\n        return this.history.restorationIdentifier;\n    }\n    historyPoppedToLocationWithRestorationIdentifier(location, restorationIdentifier) {\n        if (this.enabled) {\n            this.navigator.startVisit(location, restorationIdentifier, {\n                action: \"restore\",\n                historyChanged: true,\n            });\n        }\n        else {\n            this.adapter.pageInvalidated({\n                reason: \"turbo_disabled\",\n            });\n        }\n    }\n    scrollPositionChanged(position) {\n        this.history.updateRestorationData({ scrollPosition: position });\n    }\n    willSubmitFormLinkToLocation(link, location) {\n        return this.elementIsNavigatable(link) && locationIsVisitable(location, this.snapshot.rootLocation);\n    }\n    submittedFormLinkToLocation() { }\n    willFollowLinkToLocation(link, location, event) {\n        return (this.elementIsNavigatable(link) &&\n            locationIsVisitable(location, this.snapshot.rootLocation) &&\n            this.applicationAllowsFollowingLinkToLocation(link, location, event));\n    }\n    followedLinkToLocation(link, location) {\n        const action = this.getActionForLink(link);\n        const acceptsStreamResponse = link.hasAttribute(\"data-turbo-stream\");\n        this.visit(location.href, { action, acceptsStreamResponse });\n    }\n    allowsVisitingLocationWithAction(location, action) {\n        return this.locationWithActionIsSamePage(location, action) || this.applicationAllowsVisitingLocation(location);\n    }\n    visitProposedToLocation(location, options) {\n        extendURLWithDeprecatedProperties(location);\n        this.adapter.visitProposedToLocation(location, options);\n    }\n    visitStarted(visit) {\n        if (!visit.acceptsStreamResponse) {\n            markAsBusy(document.documentElement);\n        }\n        extendURLWithDeprecatedProperties(visit.location);\n        if (!visit.silent) {\n            this.notifyApplicationAfterVisitingLocation(visit.location, visit.action);\n        }\n    }\n    visitCompleted(visit) {\n        clearBusyState(document.documentElement);\n        this.notifyApplicationAfterPageLoad(visit.getTimingMetrics());\n    }\n    locationWithActionIsSamePage(location, action) {\n        return this.navigator.locationWithActionIsSamePage(location, action);\n    }\n    visitScrolledToSamePageLocation(oldURL, newURL) {\n        this.notifyApplicationAfterVisitingSamePageLocation(oldURL, newURL);\n    }\n    willSubmitForm(form, submitter) {\n        const action = getAction(form, submitter);\n        return (this.submissionIsNavigatable(form, submitter) &&\n            locationIsVisitable(expandURL(action), this.snapshot.rootLocation));\n    }\n    formSubmitted(form, submitter) {\n        this.navigator.submitForm(form, submitter);\n    }\n    pageBecameInteractive() {\n        this.view.lastRenderedLocation = this.location;\n        this.notifyApplicationAfterPageLoad();\n    }\n    pageLoaded() {\n        this.history.assumeControlOfScrollRestoration();\n    }\n    pageWillUnload() {\n        this.history.relinquishControlOfScrollRestoration();\n    }\n    receivedMessageFromStream(message) {\n        this.renderStreamMessage(message);\n    }\n    viewWillCacheSnapshot() {\n        var _a;\n        if (!((_a = this.navigator.currentVisit) === null || _a === void 0 ? void 0 : _a.silent)) {\n            this.notifyApplicationBeforeCachingSnapshot();\n        }\n    }\n    allowsImmediateRender({ element }, options) {\n        const event = this.notifyApplicationBeforeRender(element, options);\n        const { defaultPrevented, detail: { render }, } = event;\n        if (this.view.renderer && render) {\n            this.view.renderer.renderElement = render;\n        }\n        return !defaultPrevented;\n    }\n    viewRenderedSnapshot(_snapshot, _isPreview) {\n        this.view.lastRenderedLocation = this.history.location;\n        this.notifyApplicationAfterRender();\n    }\n    preloadOnLoadLinksForView(element) {\n        this.preloader.preloadOnLoadLinksForView(element);\n    }\n    viewInvalidated(reason) {\n        this.adapter.pageInvalidated(reason);\n    }\n    frameLoaded(frame) {\n        this.notifyApplicationAfterFrameLoad(frame);\n    }\n    frameRendered(fetchResponse, frame) {\n        this.notifyApplicationAfterFrameRender(fetchResponse, frame);\n    }\n    applicationAllowsFollowingLinkToLocation(link, location, ev) {\n        const event = this.notifyApplicationAfterClickingLinkToLocation(link, location, ev);\n        return !event.defaultPrevented;\n    }\n    applicationAllowsVisitingLocation(location) {\n        const event = this.notifyApplicationBeforeVisitingLocation(location);\n        return !event.defaultPrevented;\n    }\n    notifyApplicationAfterClickingLinkToLocation(link, location, event) {\n        return dispatch(\"turbo:click\", {\n            target: link,\n            detail: { url: location.href, originalEvent: event },\n            cancelable: true,\n        });\n    }\n    notifyApplicationBeforeVisitingLocation(location) {\n        return dispatch(\"turbo:before-visit\", {\n            detail: { url: location.href },\n            cancelable: true,\n        });\n    }\n    notifyApplicationAfterVisitingLocation(location, action) {\n        return dispatch(\"turbo:visit\", { detail: { url: location.href, action } });\n    }\n    notifyApplicationBeforeCachingSnapshot() {\n        return dispatch(\"turbo:before-cache\");\n    }\n    notifyApplicationBeforeRender(newBody, options) {\n        return dispatch(\"turbo:before-render\", {\n            detail: Object.assign({ newBody }, options),\n            cancelable: true,\n        });\n    }\n    notifyApplicationAfterRender() {\n        return dispatch(\"turbo:render\");\n    }\n    notifyApplicationAfterPageLoad(timing = {}) {\n        return dispatch(\"turbo:load\", {\n            detail: { url: this.location.href, timing },\n        });\n    }\n    notifyApplicationAfterVisitingSamePageLocation(oldURL, newURL) {\n        dispatchEvent(new HashChangeEvent(\"hashchange\", {\n            oldURL: oldURL.toString(),\n            newURL: newURL.toString(),\n        }));\n    }\n    notifyApplicationAfterFrameLoad(frame) {\n        return dispatch(\"turbo:frame-load\", { target: frame });\n    }\n    notifyApplicationAfterFrameRender(fetchResponse, frame) {\n        return dispatch(\"turbo:frame-render\", {\n            detail: { fetchResponse },\n            target: frame,\n            cancelable: true,\n        });\n    }\n    submissionIsNavigatable(form, submitter) {\n        if (this.formMode == \"off\") {\n            return false;\n        }\n        else {\n            const submitterIsNavigatable = submitter ? this.elementIsNavigatable(submitter) : true;\n            if (this.formMode == \"optin\") {\n                return submitterIsNavigatable && form.closest('[data-turbo=\"true\"]') != null;\n            }\n            else {\n                return submitterIsNavigatable && this.elementIsNavigatable(form);\n            }\n        }\n    }\n    elementIsNavigatable(element) {\n        const container = findClosestRecursively(element, \"[data-turbo]\");\n        const withinFrame = findClosestRecursively(element, \"turbo-frame\");\n        if (this.drive || withinFrame) {\n            if (container) {\n                return container.getAttribute(\"data-turbo\") != \"false\";\n            }\n            else {\n                return true;\n            }\n        }\n        else {\n            if (container) {\n                return container.getAttribute(\"data-turbo\") == \"true\";\n            }\n            else {\n                return false;\n            }\n        }\n    }\n    getActionForLink(link) {\n        return getVisitAction(link) || \"advance\";\n    }\n    get snapshot() {\n        return this.view.snapshot;\n    }\n}\nfunction extendURLWithDeprecatedProperties(url) {\n    Object.defineProperties(url, deprecatedLocationPropertyDescriptors);\n}\nconst deprecatedLocationPropertyDescriptors = {\n    absoluteURL: {\n        get() {\n            return this.toString();\n        },\n    },\n};\n\nclass Cache {\n    constructor(session) {\n        this.session = session;\n    }\n    clear() {\n        this.session.clearCache();\n    }\n    resetCacheControl() {\n        this.setCacheControl(\"\");\n    }\n    exemptPageFromCache() {\n        this.setCacheControl(\"no-cache\");\n    }\n    exemptPageFromPreview() {\n        this.setCacheControl(\"no-preview\");\n    }\n    setCacheControl(value) {\n        setMetaContent(\"turbo-cache-control\", value);\n    }\n}\n\nconst StreamActions = {\n    after() {\n        this.targetElements.forEach((e) => { var _a; return (_a = e.parentElement) === null || _a === void 0 ? void 0 : _a.insertBefore(this.templateContent, e.nextSibling); });\n    },\n    append() {\n        this.removeDuplicateTargetChildren();\n        this.targetElements.forEach((e) => e.append(this.templateContent));\n    },\n    before() {\n        this.targetElements.forEach((e) => { var _a; return (_a = e.parentElement) === null || _a === void 0 ? void 0 : _a.insertBefore(this.templateContent, e); });\n    },\n    prepend() {\n        this.removeDuplicateTargetChildren();\n        this.targetElements.forEach((e) => e.prepend(this.templateContent));\n    },\n    remove() {\n        this.targetElements.forEach((e) => e.remove());\n    },\n    replace() {\n        this.targetElements.forEach((e) => e.replaceWith(this.templateContent));\n    },\n    update() {\n        this.targetElements.forEach((targetElement) => {\n            targetElement.innerHTML = \"\";\n            targetElement.append(this.templateContent);\n        });\n    },\n};\n\nconst session = new Session();\nconst cache = new Cache(session);\nconst { navigator: navigator$1 } = session;\nfunction start() {\n    session.start();\n}\nfunction registerAdapter(adapter) {\n    session.registerAdapter(adapter);\n}\nfunction visit(location, options) {\n    session.visit(location, options);\n}\nfunction connectStreamSource(source) {\n    session.connectStreamSource(source);\n}\nfunction disconnectStreamSource(source) {\n    session.disconnectStreamSource(source);\n}\nfunction renderStreamMessage(message) {\n    session.renderStreamMessage(message);\n}\nfunction clearCache() {\n    console.warn(\"Please replace `Turbo.clearCache()` with `Turbo.cache.clear()`. The top-level function is deprecated and will be removed in a future version of Turbo.`\");\n    session.clearCache();\n}\nfunction setProgressBarDelay(delay) {\n    session.setProgressBarDelay(delay);\n}\nfunction setConfirmMethod(confirmMethod) {\n    FormSubmission.confirmMethod = confirmMethod;\n}\nfunction setFormMode(mode) {\n    session.setFormMode(mode);\n}\n\nvar Turbo = /*#__PURE__*/Object.freeze({\n    __proto__: null,\n    navigator: navigator$1,\n    session: session,\n    cache: cache,\n    PageRenderer: PageRenderer,\n    PageSnapshot: PageSnapshot,\n    FrameRenderer: FrameRenderer,\n    start: start,\n    registerAdapter: registerAdapter,\n    visit: visit,\n    connectStreamSource: connectStreamSource,\n    disconnectStreamSource: disconnectStreamSource,\n    renderStreamMessage: renderStreamMessage,\n    clearCache: clearCache,\n    setProgressBarDelay: setProgressBarDelay,\n    setConfirmMethod: setConfirmMethod,\n    setFormMode: setFormMode,\n    StreamActions: StreamActions\n});\n\nclass TurboFrameMissingError extends Error {\n}\n\nclass FrameController {\n    constructor(element) {\n        this.fetchResponseLoaded = (_fetchResponse) => { };\n        this.currentFetchRequest = null;\n        this.resolveVisitPromise = () => { };\n        this.connected = false;\n        this.hasBeenLoaded = false;\n        this.ignoredAttributes = new Set();\n        this.action = null;\n        this.visitCachedSnapshot = ({ element }) => {\n            const frame = element.querySelector(\"#\" + this.element.id);\n            if (frame && this.previousFrameElement) {\n                frame.replaceChildren(...this.previousFrameElement.children);\n            }\n            delete this.previousFrameElement;\n        };\n        this.element = element;\n        this.view = new FrameView(this, this.element);\n        this.appearanceObserver = new AppearanceObserver(this, this.element);\n        this.formLinkClickObserver = new FormLinkClickObserver(this, this.element);\n        this.linkInterceptor = new LinkInterceptor(this, this.element);\n        this.restorationIdentifier = uuid();\n        this.formSubmitObserver = new FormSubmitObserver(this, this.element);\n    }\n    connect() {\n        if (!this.connected) {\n            this.connected = true;\n            if (this.loadingStyle == FrameLoadingStyle.lazy) {\n                this.appearanceObserver.start();\n            }\n            else {\n                this.loadSourceURL();\n            }\n            this.formLinkClickObserver.start();\n            this.linkInterceptor.start();\n            this.formSubmitObserver.start();\n        }\n    }\n    disconnect() {\n        if (this.connected) {\n            this.connected = false;\n            this.appearanceObserver.stop();\n            this.formLinkClickObserver.stop();\n            this.linkInterceptor.stop();\n            this.formSubmitObserver.stop();\n        }\n    }\n    disabledChanged() {\n        if (this.loadingStyle == FrameLoadingStyle.eager) {\n            this.loadSourceURL();\n        }\n    }\n    sourceURLChanged() {\n        if (this.isIgnoringChangesTo(\"src\"))\n            return;\n        if (this.element.isConnected) {\n            this.complete = false;\n        }\n        if (this.loadingStyle == FrameLoadingStyle.eager || this.hasBeenLoaded) {\n            this.loadSourceURL();\n        }\n    }\n    sourceURLReloaded() {\n        const { src } = this.element;\n        this.ignoringChangesToAttribute(\"complete\", () => {\n            this.element.removeAttribute(\"complete\");\n        });\n        this.element.src = null;\n        this.element.src = src;\n        return this.element.loaded;\n    }\n    completeChanged() {\n        if (this.isIgnoringChangesTo(\"complete\"))\n            return;\n        this.loadSourceURL();\n    }\n    loadingStyleChanged() {\n        if (this.loadingStyle == FrameLoadingStyle.lazy) {\n            this.appearanceObserver.start();\n        }\n        else {\n            this.appearanceObserver.stop();\n            this.loadSourceURL();\n        }\n    }\n    async loadSourceURL() {\n        if (this.enabled && this.isActive && !this.complete && this.sourceURL) {\n            this.element.loaded = this.visit(expandURL(this.sourceURL));\n            this.appearanceObserver.stop();\n            await this.element.loaded;\n            this.hasBeenLoaded = true;\n        }\n    }\n    async loadResponse(fetchResponse) {\n        if (fetchResponse.redirected || (fetchResponse.succeeded && fetchResponse.isHTML)) {\n            this.sourceURL = fetchResponse.response.url;\n        }\n        try {\n            const html = await fetchResponse.responseHTML;\n            if (html) {\n                const document = parseHTMLDocument(html);\n                const pageSnapshot = PageSnapshot.fromDocument(document);\n                if (pageSnapshot.isVisitable) {\n                    await this.loadFrameResponse(fetchResponse, document);\n                }\n                else {\n                    await this.handleUnvisitableFrameResponse(fetchResponse);\n                }\n            }\n        }\n        finally {\n            this.fetchResponseLoaded = () => { };\n        }\n    }\n    elementAppearedInViewport(element) {\n        this.proposeVisitIfNavigatedWithAction(element, element);\n        this.loadSourceURL();\n    }\n    willSubmitFormLinkToLocation(link) {\n        return this.shouldInterceptNavigation(link);\n    }\n    submittedFormLinkToLocation(link, _location, form) {\n        const frame = this.findFrameElement(link);\n        if (frame)\n            form.setAttribute(\"data-turbo-frame\", frame.id);\n    }\n    shouldInterceptLinkClick(element, _location, _event) {\n        return this.shouldInterceptNavigation(element);\n    }\n    linkClickIntercepted(element, location) {\n        this.navigateFrame(element, location);\n    }\n    willSubmitForm(element, submitter) {\n        return element.closest(\"turbo-frame\") == this.element && this.shouldInterceptNavigation(element, submitter);\n    }\n    formSubmitted(element, submitter) {\n        if (this.formSubmission) {\n            this.formSubmission.stop();\n        }\n        this.formSubmission = new FormSubmission(this, element, submitter);\n        const { fetchRequest } = this.formSubmission;\n        this.prepareRequest(fetchRequest);\n        this.formSubmission.start();\n    }\n    prepareRequest(request) {\n        var _a;\n        request.headers[\"Turbo-Frame\"] = this.id;\n        if ((_a = this.currentNavigationElement) === null || _a === void 0 ? void 0 : _a.hasAttribute(\"data-turbo-stream\")) {\n            request.acceptResponseType(StreamMessage.contentType);\n        }\n    }\n    requestStarted(_request) {\n        markAsBusy(this.element);\n    }\n    requestPreventedHandlingResponse(_request, _response) {\n        this.resolveVisitPromise();\n    }\n    async requestSucceededWithResponse(request, response) {\n        await this.loadResponse(response);\n        this.resolveVisitPromise();\n    }\n    async requestFailedWithResponse(request, response) {\n        await this.loadResponse(response);\n        this.resolveVisitPromise();\n    }\n    requestErrored(request, error) {\n        console.error(error);\n        this.resolveVisitPromise();\n    }\n    requestFinished(_request) {\n        clearBusyState(this.element);\n    }\n    formSubmissionStarted({ formElement }) {\n        markAsBusy(formElement, this.findFrameElement(formElement));\n    }\n    formSubmissionSucceededWithResponse(formSubmission, response) {\n        const frame = this.findFrameElement(formSubmission.formElement, formSubmission.submitter);\n        frame.delegate.proposeVisitIfNavigatedWithAction(frame, formSubmission.formElement, formSubmission.submitter);\n        frame.delegate.loadResponse(response);\n        if (!formSubmission.isSafe) {\n            session.clearCache();\n        }\n    }\n    formSubmissionFailedWithResponse(formSubmission, fetchResponse) {\n        this.element.delegate.loadResponse(fetchResponse);\n        session.clearCache();\n    }\n    formSubmissionErrored(formSubmission, error) {\n        console.error(error);\n    }\n    formSubmissionFinished({ formElement }) {\n        clearBusyState(formElement, this.findFrameElement(formElement));\n    }\n    allowsImmediateRender({ element: newFrame }, options) {\n        const event = dispatch(\"turbo:before-frame-render\", {\n            target: this.element,\n            detail: Object.assign({ newFrame }, options),\n            cancelable: true,\n        });\n        const { defaultPrevented, detail: { render }, } = event;\n        if (this.view.renderer && render) {\n            this.view.renderer.renderElement = render;\n        }\n        return !defaultPrevented;\n    }\n    viewRenderedSnapshot(_snapshot, _isPreview) { }\n    preloadOnLoadLinksForView(element) {\n        session.preloadOnLoadLinksForView(element);\n    }\n    viewInvalidated() { }\n    willRenderFrame(currentElement, _newElement) {\n        this.previousFrameElement = currentElement.cloneNode(true);\n    }\n    async loadFrameResponse(fetchResponse, document) {\n        const newFrameElement = await this.extractForeignFrameElement(document.body);\n        if (newFrameElement) {\n            const snapshot = new Snapshot(newFrameElement);\n            const renderer = new FrameRenderer(this, this.view.snapshot, snapshot, FrameRenderer.renderElement, false, false);\n            if (this.view.renderPromise)\n                await this.view.renderPromise;\n            this.changeHistory();\n            await this.view.render(renderer);\n            this.complete = true;\n            session.frameRendered(fetchResponse, this.element);\n            session.frameLoaded(this.element);\n            this.fetchResponseLoaded(fetchResponse);\n        }\n        else if (this.willHandleFrameMissingFromResponse(fetchResponse)) {\n            this.handleFrameMissingFromResponse(fetchResponse);\n        }\n    }\n    async visit(url) {\n        var _a;\n        const request = new FetchRequest(this, FetchMethod.get, url, new URLSearchParams(), this.element);\n        (_a = this.currentFetchRequest) === null || _a === void 0 ? void 0 : _a.cancel();\n        this.currentFetchRequest = request;\n        return new Promise((resolve) => {\n            this.resolveVisitPromise = () => {\n                this.resolveVisitPromise = () => { };\n                this.currentFetchRequest = null;\n                resolve();\n            };\n            request.perform();\n        });\n    }\n    navigateFrame(element, url, submitter) {\n        const frame = this.findFrameElement(element, submitter);\n        frame.delegate.proposeVisitIfNavigatedWithAction(frame, element, submitter);\n        this.withCurrentNavigationElement(element, () => {\n            frame.src = url;\n        });\n    }\n    proposeVisitIfNavigatedWithAction(frame, element, submitter) {\n        this.action = getVisitAction(submitter, element, frame);\n        if (this.action) {\n            const pageSnapshot = PageSnapshot.fromElement(frame).clone();\n            const { visitCachedSnapshot } = frame.delegate;\n            frame.delegate.fetchResponseLoaded = (fetchResponse) => {\n                if (frame.src) {\n                    const { statusCode, redirected } = fetchResponse;\n                    const responseHTML = frame.ownerDocument.documentElement.outerHTML;\n                    const response = { statusCode, redirected, responseHTML };\n                    const options = {\n                        response,\n                        visitCachedSnapshot,\n                        willRender: false,\n                        updateHistory: false,\n                        restorationIdentifier: this.restorationIdentifier,\n                        snapshot: pageSnapshot,\n                    };\n                    if (this.action)\n                        options.action = this.action;\n                    session.visit(frame.src, options);\n                }\n            };\n        }\n    }\n    changeHistory() {\n        if (this.action) {\n            const method = getHistoryMethodForAction(this.action);\n            session.history.update(method, expandURL(this.element.src || \"\"), this.restorationIdentifier);\n        }\n    }\n    async handleUnvisitableFrameResponse(fetchResponse) {\n        console.warn(`The response (${fetchResponse.statusCode}) from <turbo-frame id=\"${this.element.id}\"> is performing a full page visit due to turbo-visit-control.`);\n        await this.visitResponse(fetchResponse.response);\n    }\n    willHandleFrameMissingFromResponse(fetchResponse) {\n        this.element.setAttribute(\"complete\", \"\");\n        const response = fetchResponse.response;\n        const visit = async (url, options = {}) => {\n            if (url instanceof Response) {\n                this.visitResponse(url);\n            }\n            else {\n                session.visit(url, options);\n            }\n        };\n        const event = dispatch(\"turbo:frame-missing\", {\n            target: this.element,\n            detail: { response, visit },\n            cancelable: true,\n        });\n        return !event.defaultPrevented;\n    }\n    handleFrameMissingFromResponse(fetchResponse) {\n        this.view.missing();\n        this.throwFrameMissingError(fetchResponse);\n    }\n    throwFrameMissingError(fetchResponse) {\n        const message = `The response (${fetchResponse.statusCode}) did not contain the expected <turbo-frame id=\"${this.element.id}\"> and will be ignored. To perform a full page visit instead, set turbo-visit-control to reload.`;\n        throw new TurboFrameMissingError(message);\n    }\n    async visitResponse(response) {\n        const wrapped = new FetchResponse(response);\n        const responseHTML = await wrapped.responseHTML;\n        const { location, redirected, statusCode } = wrapped;\n        return session.visit(location, { response: { redirected, statusCode, responseHTML } });\n    }\n    findFrameElement(element, submitter) {\n        var _a;\n        const id = getAttribute(\"data-turbo-frame\", submitter, element) || this.element.getAttribute(\"target\");\n        return (_a = getFrameElementById(id)) !== null && _a !== void 0 ? _a : this.element;\n    }\n    async extractForeignFrameElement(container) {\n        let element;\n        const id = CSS.escape(this.id);\n        try {\n            element = activateElement(container.querySelector(`turbo-frame#${id}`), this.sourceURL);\n            if (element) {\n                return element;\n            }\n            element = activateElement(container.querySelector(`turbo-frame[src][recurse~=${id}]`), this.sourceURL);\n            if (element) {\n                await element.loaded;\n                return await this.extractForeignFrameElement(element);\n            }\n        }\n        catch (error) {\n            console.error(error);\n            return new FrameElement();\n        }\n        return null;\n    }\n    formActionIsVisitable(form, submitter) {\n        const action = getAction(form, submitter);\n        return locationIsVisitable(expandURL(action), this.rootLocation);\n    }\n    shouldInterceptNavigation(element, submitter) {\n        const id = getAttribute(\"data-turbo-frame\", submitter, element) || this.element.getAttribute(\"target\");\n        if (element instanceof HTMLFormElement && !this.formActionIsVisitable(element, submitter)) {\n            return false;\n        }\n        if (!this.enabled || id == \"_top\") {\n            return false;\n        }\n        if (id) {\n            const frameElement = getFrameElementById(id);\n            if (frameElement) {\n                return !frameElement.disabled;\n            }\n        }\n        if (!session.elementIsNavigatable(element)) {\n            return false;\n        }\n        if (submitter && !session.elementIsNavigatable(submitter)) {\n            return false;\n        }\n        return true;\n    }\n    get id() {\n        return this.element.id;\n    }\n    get enabled() {\n        return !this.element.disabled;\n    }\n    get sourceURL() {\n        if (this.element.src) {\n            return this.element.src;\n        }\n    }\n    set sourceURL(sourceURL) {\n        this.ignoringChangesToAttribute(\"src\", () => {\n            this.element.src = sourceURL !== null && sourceURL !== void 0 ? sourceURL : null;\n        });\n    }\n    get loadingStyle() {\n        return this.element.loading;\n    }\n    get isLoading() {\n        return this.formSubmission !== undefined || this.resolveVisitPromise() !== undefined;\n    }\n    get complete() {\n        return this.element.hasAttribute(\"complete\");\n    }\n    set complete(value) {\n        this.ignoringChangesToAttribute(\"complete\", () => {\n            if (value) {\n                this.element.setAttribute(\"complete\", \"\");\n            }\n            else {\n                this.element.removeAttribute(\"complete\");\n            }\n        });\n    }\n    get isActive() {\n        return this.element.isActive && this.connected;\n    }\n    get rootLocation() {\n        var _a;\n        const meta = this.element.ownerDocument.querySelector(`meta[name=\"turbo-root\"]`);\n        const root = (_a = meta === null || meta === void 0 ? void 0 : meta.content) !== null && _a !== void 0 ? _a : \"/\";\n        return expandURL(root);\n    }\n    isIgnoringChangesTo(attributeName) {\n        return this.ignoredAttributes.has(attributeName);\n    }\n    ignoringChangesToAttribute(attributeName, callback) {\n        this.ignoredAttributes.add(attributeName);\n        callback();\n        this.ignoredAttributes.delete(attributeName);\n    }\n    withCurrentNavigationElement(element, callback) {\n        this.currentNavigationElement = element;\n        callback();\n        delete this.currentNavigationElement;\n    }\n}\nfunction getFrameElementById(id) {\n    if (id != null) {\n        const element = document.getElementById(id);\n        if (element instanceof FrameElement) {\n            return element;\n        }\n    }\n}\nfunction activateElement(element, currentURL) {\n    if (element) {\n        const src = element.getAttribute(\"src\");\n        if (src != null && currentURL != null && urlsAreEqual(src, currentURL)) {\n            throw new Error(`Matching <turbo-frame id=\"${element.id}\"> element has a source URL which references itself`);\n        }\n        if (element.ownerDocument !== document) {\n            element = document.importNode(element, true);\n        }\n        if (element instanceof FrameElement) {\n            element.connectedCallback();\n            element.disconnectedCallback();\n            return element;\n        }\n    }\n}\n\nclass StreamElement extends HTMLElement {\n    static async renderElement(newElement) {\n        await newElement.performAction();\n    }\n    async connectedCallback() {\n        try {\n            await this.render();\n        }\n        catch (error) {\n            console.error(error);\n        }\n        finally {\n            this.disconnect();\n        }\n    }\n    async render() {\n        var _a;\n        return ((_a = this.renderPromise) !== null && _a !== void 0 ? _a : (this.renderPromise = (async () => {\n            const event = this.beforeRenderEvent;\n            if (this.dispatchEvent(event)) {\n                await nextAnimationFrame();\n                await event.detail.render(this);\n            }\n        })()));\n    }\n    disconnect() {\n        try {\n            this.remove();\n        }\n        catch (_a) { }\n    }\n    removeDuplicateTargetChildren() {\n        this.duplicateChildren.forEach((c) => c.remove());\n    }\n    get duplicateChildren() {\n        var _a;\n        const existingChildren = this.targetElements.flatMap((e) => [...e.children]).filter((c) => !!c.id);\n        const newChildrenIds = [...(((_a = this.templateContent) === null || _a === void 0 ? void 0 : _a.children) || [])].filter((c) => !!c.id).map((c) => c.id);\n        return existingChildren.filter((c) => newChildrenIds.includes(c.id));\n    }\n    get performAction() {\n        if (this.action) {\n            const actionFunction = StreamActions[this.action];\n            if (actionFunction) {\n                return actionFunction;\n            }\n            this.raise(\"unknown action\");\n        }\n        this.raise(\"action attribute is missing\");\n    }\n    get targetElements() {\n        if (this.target) {\n            return this.targetElementsById;\n        }\n        else if (this.targets) {\n            return this.targetElementsByQuery;\n        }\n        else {\n            this.raise(\"target or targets attribute is missing\");\n        }\n    }\n    get templateContent() {\n        return this.templateElement.content.cloneNode(true);\n    }\n    get templateElement() {\n        if (this.firstElementChild === null) {\n            const template = this.ownerDocument.createElement(\"template\");\n            this.appendChild(template);\n            return template;\n        }\n        else if (this.firstElementChild instanceof HTMLTemplateElement) {\n            return this.firstElementChild;\n        }\n        this.raise(\"first child element must be a <template> element\");\n    }\n    get action() {\n        return this.getAttribute(\"action\");\n    }\n    get target() {\n        return this.getAttribute(\"target\");\n    }\n    get targets() {\n        return this.getAttribute(\"targets\");\n    }\n    raise(message) {\n        throw new Error(`${this.description}: ${message}`);\n    }\n    get description() {\n        var _a, _b;\n        return (_b = ((_a = this.outerHTML.match(/<[^>]+>/)) !== null && _a !== void 0 ? _a : [])[0]) !== null && _b !== void 0 ? _b : \"<turbo-stream>\";\n    }\n    get beforeRenderEvent() {\n        return new CustomEvent(\"turbo:before-stream-render\", {\n            bubbles: true,\n            cancelable: true,\n            detail: { newStream: this, render: StreamElement.renderElement },\n        });\n    }\n    get targetElementsById() {\n        var _a;\n        const element = (_a = this.ownerDocument) === null || _a === void 0 ? void 0 : _a.getElementById(this.target);\n        if (element !== null) {\n            return [element];\n        }\n        else {\n            return [];\n        }\n    }\n    get targetElementsByQuery() {\n        var _a;\n        const elements = (_a = this.ownerDocument) === null || _a === void 0 ? void 0 : _a.querySelectorAll(this.targets);\n        if (elements.length !== 0) {\n            return Array.prototype.slice.call(elements);\n        }\n        else {\n            return [];\n        }\n    }\n}\n\nclass StreamSourceElement extends HTMLElement {\n    constructor() {\n        super(...arguments);\n        this.streamSource = null;\n    }\n    connectedCallback() {\n        this.streamSource = this.src.match(/^ws{1,2}:/) ? new WebSocket(this.src) : new EventSource(this.src);\n        connectStreamSource(this.streamSource);\n    }\n    disconnectedCallback() {\n        if (this.streamSource) {\n            disconnectStreamSource(this.streamSource);\n        }\n    }\n    get src() {\n        return this.getAttribute(\"src\") || \"\";\n    }\n}\n\nFrameElement.delegateConstructor = FrameController;\nif (customElements.get(\"turbo-frame\") === undefined) {\n    customElements.define(\"turbo-frame\", FrameElement);\n}\nif (customElements.get(\"turbo-stream\") === undefined) {\n    customElements.define(\"turbo-stream\", StreamElement);\n}\nif (customElements.get(\"turbo-stream-source\") === undefined) {\n    customElements.define(\"turbo-stream-source\", StreamSourceElement);\n}\n\n(() => {\n    let element = document.currentScript;\n    if (!element)\n        return;\n    if (element.hasAttribute(\"data-turbo-suppress-warning\"))\n        return;\n    element = element.parentElement;\n    while (element) {\n        if (element == document.body) {\n            return console.warn(unindent `\n        You are loading Turbo from a <script> element inside the <body> element. This is probably not what you meant to do!\n\n        Load your application\u2019s JavaScript bundle inside the <head> element instead. <script> elements in <body> are evaluated with each page change.\n\n        For more information, see: https://turbo.hotwired.dev/handbook/building#working-with-script-elements\n\n        \u2014\u2014\n        Suppress this warning by adding a \"data-turbo-suppress-warning\" attribute to: %s\n      `, element.outerHTML);\n        }\n        element = element.parentElement;\n    }\n})();\n\nwindow.Turbo = Turbo;\nstart();\n\nexport { FrameElement, FrameLoadingStyle, FrameRenderer, PageRenderer, PageSnapshot, StreamActions, StreamElement, StreamSourceElement, cache, clearCache, connectStreamSource, disconnectStreamSource, navigator$1 as navigator, registerAdapter, renderStreamMessage, session, setConfirmMethod, setFormMode, setProgressBarDelay, start, visit };\n", "let consumer\n\nexport async function getConsumer() {\n  return consumer || setConsumer(createConsumer().then(setConsumer))\n}\n\nexport function setConsumer(newConsumer) {\n  return consumer = newConsumer\n}\n\nexport async function createConsumer() {\n  const { createConsumer } = await import(/* webpackChunkName: \"actioncable\" */ \"@rails/actioncable/src\")\n  return createConsumer()\n}\n\nexport async function subscribeTo(channel, mixin) {\n  const { subscriptions } = await getConsumer()\n  return subscriptions.create(channel, mixin)\n}\n", "// Based on https://github.com/nathan7/snakeize\n//\n// This software is released under the MIT license:\n// Permission is hereby granted, free of charge, to any person obtaining a copy of\n// this software and associated documentation files (the \"Software\"), to deal in\n// the Software without restriction, including without limitation the rights to\n// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n// the Software, and to permit persons to whom the Software is furnished to do so,\n// subject to the following conditions:\n\n// The above copyright notice and this permission notice shall be included in all\n// copies or substantial portions of the Software.\n\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\nexport default function walk (obj) {\n    if (!obj || typeof obj !== 'object') return obj;\n    if (obj instanceof Date || obj instanceof RegExp) return obj;\n    if (Array.isArray(obj)) return obj.map(walk);\n    return Object.keys(obj).reduce(function (acc, key) {\n        var camel = key[0].toLowerCase() + key.slice(1).replace(/([A-Z]+)/g, function (m, x) {\n            return '_' + x.toLowerCase();\n        });\n        acc[camel] = walk(obj[key]);\n        return acc;\n    }, {});\n};", "import { connectStreamSource, disconnectStreamSource } from \"@hotwired/turbo\"\nimport { subscribeTo } from \"./cable\"\nimport snakeize from \"./snakeize\"\n\nclass TurboCableStreamSourceElement extends HTMLElement {\n  async connectedCallback() {\n    connectStreamSource(this)\n    this.subscription = await subscribeTo(this.channel, {\n      received: this.dispatchMessageEvent.bind(this),\n      connected: this.subscriptionConnected.bind(this),\n      disconnected: this.subscriptionDisconnected.bind(this)\n    })\n  }\n\n  disconnectedCallback() {\n    disconnectStreamSource(this)\n    if (this.subscription) this.subscription.unsubscribe()\n  }\n\n  dispatchMessageEvent(data) {\n    const event = new MessageEvent(\"message\", { data })\n    return this.dispatchEvent(event)\n  }\n\n  subscriptionConnected() {\n    this.setAttribute(\"connected\", \"\")\n  }\n\n  subscriptionDisconnected() {\n    this.removeAttribute(\"connected\")\n  }\n\n  get channel() {\n    const channel = this.getAttribute(\"channel\")\n    const signed_stream_name = this.getAttribute(\"signed-stream-name\")\n    return { channel, signed_stream_name, ...snakeize({ ...this.dataset }) }\n  }\n}\n\n\nif (customElements.get(\"turbo-cable-stream-source\") === undefined) {\n  customElements.define(\"turbo-cable-stream-source\", TurboCableStreamSourceElement)\n}\n", "export function encodeMethodIntoRequestBody(event) {\n  if (event.target instanceof HTMLFormElement) {\n    const { target: form, detail: { fetchOptions } } = event\n\n    form.addEventListener(\"turbo:submit-start\", ({ detail: { formSubmission: { submitter } } }) => {\n      const body = isBodyInit(fetchOptions.body) ? fetchOptions.body : new URLSearchParams()\n      const method = determineFetchMethod(submitter, body, form)\n\n      if (!/get/i.test(method)) {\n        if (/post/i.test(method)) {\n          body.delete(\"_method\")\n        } else {\n          body.set(\"_method\", method)\n        }\n\n        fetchOptions.method = \"post\"\n      }\n    }, { once: true })\n  }\n}\n\nfunction determineFetchMethod(submitter, body, form) {\n  const formMethod = determineFormMethod(submitter)\n  const overrideMethod = body.get(\"_method\")\n  const method = form.getAttribute(\"method\") || \"get\"\n\n  if (typeof formMethod == \"string\") {\n    return formMethod\n  } else if (typeof overrideMethod == \"string\") {\n    return overrideMethod\n  } else {\n    return method\n  }\n}\n\nfunction determineFormMethod(submitter) {\n  if (submitter instanceof HTMLButtonElement || submitter instanceof HTMLInputElement) {\n    if (submitter.hasAttribute(\"formmethod\")) {\n      return submitter.formMethod\n    } else {\n      return null\n    }\n  } else {\n    return null\n  }\n}\n\nfunction isBodyInit(body) {\n  return body instanceof FormData || body instanceof URLSearchParams\n}\n", "import \"./cable_stream_source_element\"\n\nimport * as Turbo from \"@hotwired/turbo\"\nexport { Turbo }\n\nimport * as cable from \"./cable\"\nexport { cable }\n\nimport { encodeMethodIntoRequestBody } from \"./fetch_requests\"\n\naddEventListener(\"turbo:before-fetch-request\", encodeMethodIntoRequestBody)\n", "/*\nStimulus 3.2.1\nCopyright \u00A9 2023 Basecamp, LLC\n */\nclass EventListener {\n    constructor(eventTarget, eventName, eventOptions) {\n        this.eventTarget = eventTarget;\n        this.eventName = eventName;\n        this.eventOptions = eventOptions;\n        this.unorderedBindings = new Set();\n    }\n    connect() {\n        this.eventTarget.addEventListener(this.eventName, this, this.eventOptions);\n    }\n    disconnect() {\n        this.eventTarget.removeEventListener(this.eventName, this, this.eventOptions);\n    }\n    bindingConnected(binding) {\n        this.unorderedBindings.add(binding);\n    }\n    bindingDisconnected(binding) {\n        this.unorderedBindings.delete(binding);\n    }\n    handleEvent(event) {\n        const extendedEvent = extendEvent(event);\n        for (const binding of this.bindings) {\n            if (extendedEvent.immediatePropagationStopped) {\n                break;\n            }\n            else {\n                binding.handleEvent(extendedEvent);\n            }\n        }\n    }\n    hasBindings() {\n        return this.unorderedBindings.size > 0;\n    }\n    get bindings() {\n        return Array.from(this.unorderedBindings).sort((left, right) => {\n            const leftIndex = left.index, rightIndex = right.index;\n            return leftIndex < rightIndex ? -1 : leftIndex > rightIndex ? 1 : 0;\n        });\n    }\n}\nfunction extendEvent(event) {\n    if (\"immediatePropagationStopped\" in event) {\n        return event;\n    }\n    else {\n        const { stopImmediatePropagation } = event;\n        return Object.assign(event, {\n            immediatePropagationStopped: false,\n            stopImmediatePropagation() {\n                this.immediatePropagationStopped = true;\n                stopImmediatePropagation.call(this);\n            },\n        });\n    }\n}\n\nclass Dispatcher {\n    constructor(application) {\n        this.application = application;\n        this.eventListenerMaps = new Map();\n        this.started = false;\n    }\n    start() {\n        if (!this.started) {\n            this.started = true;\n            this.eventListeners.forEach((eventListener) => eventListener.connect());\n        }\n    }\n    stop() {\n        if (this.started) {\n            this.started = false;\n            this.eventListeners.forEach((eventListener) => eventListener.disconnect());\n        }\n    }\n    get eventListeners() {\n        return Array.from(this.eventListenerMaps.values()).reduce((listeners, map) => listeners.concat(Array.from(map.values())), []);\n    }\n    bindingConnected(binding) {\n        this.fetchEventListenerForBinding(binding).bindingConnected(binding);\n    }\n    bindingDisconnected(binding, clearEventListeners = false) {\n        this.fetchEventListenerForBinding(binding).bindingDisconnected(binding);\n        if (clearEventListeners)\n            this.clearEventListenersForBinding(binding);\n    }\n    handleError(error, message, detail = {}) {\n        this.application.handleError(error, `Error ${message}`, detail);\n    }\n    clearEventListenersForBinding(binding) {\n        const eventListener = this.fetchEventListenerForBinding(binding);\n        if (!eventListener.hasBindings()) {\n            eventListener.disconnect();\n            this.removeMappedEventListenerFor(binding);\n        }\n    }\n    removeMappedEventListenerFor(binding) {\n        const { eventTarget, eventName, eventOptions } = binding;\n        const eventListenerMap = this.fetchEventListenerMapForEventTarget(eventTarget);\n        const cacheKey = this.cacheKey(eventName, eventOptions);\n        eventListenerMap.delete(cacheKey);\n        if (eventListenerMap.size == 0)\n            this.eventListenerMaps.delete(eventTarget);\n    }\n    fetchEventListenerForBinding(binding) {\n        const { eventTarget, eventName, eventOptions } = binding;\n        return this.fetchEventListener(eventTarget, eventName, eventOptions);\n    }\n    fetchEventListener(eventTarget, eventName, eventOptions) {\n        const eventListenerMap = this.fetchEventListenerMapForEventTarget(eventTarget);\n        const cacheKey = this.cacheKey(eventName, eventOptions);\n        let eventListener = eventListenerMap.get(cacheKey);\n        if (!eventListener) {\n            eventListener = this.createEventListener(eventTarget, eventName, eventOptions);\n            eventListenerMap.set(cacheKey, eventListener);\n        }\n        return eventListener;\n    }\n    createEventListener(eventTarget, eventName, eventOptions) {\n        const eventListener = new EventListener(eventTarget, eventName, eventOptions);\n        if (this.started) {\n            eventListener.connect();\n        }\n        return eventListener;\n    }\n    fetchEventListenerMapForEventTarget(eventTarget) {\n        let eventListenerMap = this.eventListenerMaps.get(eventTarget);\n        if (!eventListenerMap) {\n            eventListenerMap = new Map();\n            this.eventListenerMaps.set(eventTarget, eventListenerMap);\n        }\n        return eventListenerMap;\n    }\n    cacheKey(eventName, eventOptions) {\n        const parts = [eventName];\n        Object.keys(eventOptions)\n            .sort()\n            .forEach((key) => {\n            parts.push(`${eventOptions[key] ? \"\" : \"!\"}${key}`);\n        });\n        return parts.join(\":\");\n    }\n}\n\nconst defaultActionDescriptorFilters = {\n    stop({ event, value }) {\n        if (value)\n            event.stopPropagation();\n        return true;\n    },\n    prevent({ event, value }) {\n        if (value)\n            event.preventDefault();\n        return true;\n    },\n    self({ event, value, element }) {\n        if (value) {\n            return element === event.target;\n        }\n        else {\n            return true;\n        }\n    },\n};\nconst descriptorPattern = /^(?:(?:([^.]+?)\\+)?(.+?)(?:\\.(.+?))?(?:@(window|document))?->)?(.+?)(?:#([^:]+?))(?::(.+))?$/;\nfunction parseActionDescriptorString(descriptorString) {\n    const source = descriptorString.trim();\n    const matches = source.match(descriptorPattern) || [];\n    let eventName = matches[2];\n    let keyFilter = matches[3];\n    if (keyFilter && ![\"keydown\", \"keyup\", \"keypress\"].includes(eventName)) {\n        eventName += `.${keyFilter}`;\n        keyFilter = \"\";\n    }\n    return {\n        eventTarget: parseEventTarget(matches[4]),\n        eventName,\n        eventOptions: matches[7] ? parseEventOptions(matches[7]) : {},\n        identifier: matches[5],\n        methodName: matches[6],\n        keyFilter: matches[1] || keyFilter,\n    };\n}\nfunction parseEventTarget(eventTargetName) {\n    if (eventTargetName == \"window\") {\n        return window;\n    }\n    else if (eventTargetName == \"document\") {\n        return document;\n    }\n}\nfunction parseEventOptions(eventOptions) {\n    return eventOptions\n        .split(\":\")\n        .reduce((options, token) => Object.assign(options, { [token.replace(/^!/, \"\")]: !/^!/.test(token) }), {});\n}\nfunction stringifyEventTarget(eventTarget) {\n    if (eventTarget == window) {\n        return \"window\";\n    }\n    else if (eventTarget == document) {\n        return \"document\";\n    }\n}\n\nfunction camelize(value) {\n    return value.replace(/(?:[_-])([a-z0-9])/g, (_, char) => char.toUpperCase());\n}\nfunction namespaceCamelize(value) {\n    return camelize(value.replace(/--/g, \"-\").replace(/__/g, \"_\"));\n}\nfunction capitalize(value) {\n    return value.charAt(0).toUpperCase() + value.slice(1);\n}\nfunction dasherize(value) {\n    return value.replace(/([A-Z])/g, (_, char) => `-${char.toLowerCase()}`);\n}\nfunction tokenize(value) {\n    return value.match(/[^\\s]+/g) || [];\n}\n\nfunction isSomething(object) {\n    return object !== null && object !== undefined;\n}\nfunction hasProperty(object, property) {\n    return Object.prototype.hasOwnProperty.call(object, property);\n}\n\nconst allModifiers = [\"meta\", \"ctrl\", \"alt\", \"shift\"];\nclass Action {\n    constructor(element, index, descriptor, schema) {\n        this.element = element;\n        this.index = index;\n        this.eventTarget = descriptor.eventTarget || element;\n        this.eventName = descriptor.eventName || getDefaultEventNameForElement(element) || error(\"missing event name\");\n        this.eventOptions = descriptor.eventOptions || {};\n        this.identifier = descriptor.identifier || error(\"missing identifier\");\n        this.methodName = descriptor.methodName || error(\"missing method name\");\n        this.keyFilter = descriptor.keyFilter || \"\";\n        this.schema = schema;\n    }\n    static forToken(token, schema) {\n        return new this(token.element, token.index, parseActionDescriptorString(token.content), schema);\n    }\n    toString() {\n        const eventFilter = this.keyFilter ? `.${this.keyFilter}` : \"\";\n        const eventTarget = this.eventTargetName ? `@${this.eventTargetName}` : \"\";\n        return `${this.eventName}${eventFilter}${eventTarget}->${this.identifier}#${this.methodName}`;\n    }\n    shouldIgnoreKeyboardEvent(event) {\n        if (!this.keyFilter) {\n            return false;\n        }\n        const filters = this.keyFilter.split(\"+\");\n        if (this.keyFilterDissatisfied(event, filters)) {\n            return true;\n        }\n        const standardFilter = filters.filter((key) => !allModifiers.includes(key))[0];\n        if (!standardFilter) {\n            return false;\n        }\n        if (!hasProperty(this.keyMappings, standardFilter)) {\n            error(`contains unknown key filter: ${this.keyFilter}`);\n        }\n        return this.keyMappings[standardFilter].toLowerCase() !== event.key.toLowerCase();\n    }\n    shouldIgnoreMouseEvent(event) {\n        if (!this.keyFilter) {\n            return false;\n        }\n        const filters = [this.keyFilter];\n        if (this.keyFilterDissatisfied(event, filters)) {\n            return true;\n        }\n        return false;\n    }\n    get params() {\n        const params = {};\n        const pattern = new RegExp(`^data-${this.identifier}-(.+)-param$`, \"i\");\n        for (const { name, value } of Array.from(this.element.attributes)) {\n            const match = name.match(pattern);\n            const key = match && match[1];\n            if (key) {\n                params[camelize(key)] = typecast(value);\n            }\n        }\n        return params;\n    }\n    get eventTargetName() {\n        return stringifyEventTarget(this.eventTarget);\n    }\n    get keyMappings() {\n        return this.schema.keyMappings;\n    }\n    keyFilterDissatisfied(event, filters) {\n        const [meta, ctrl, alt, shift] = allModifiers.map((modifier) => filters.includes(modifier));\n        return event.metaKey !== meta || event.ctrlKey !== ctrl || event.altKey !== alt || event.shiftKey !== shift;\n    }\n}\nconst defaultEventNames = {\n    a: () => \"click\",\n    button: () => \"click\",\n    form: () => \"submit\",\n    details: () => \"toggle\",\n    input: (e) => (e.getAttribute(\"type\") == \"submit\" ? \"click\" : \"input\"),\n    select: () => \"change\",\n    textarea: () => \"input\",\n};\nfunction getDefaultEventNameForElement(element) {\n    const tagName = element.tagName.toLowerCase();\n    if (tagName in defaultEventNames) {\n        return defaultEventNames[tagName](element);\n    }\n}\nfunction error(message) {\n    throw new Error(message);\n}\nfunction typecast(value) {\n    try {\n        return JSON.parse(value);\n    }\n    catch (o_O) {\n        return value;\n    }\n}\n\nclass Binding {\n    constructor(context, action) {\n        this.context = context;\n        this.action = action;\n    }\n    get index() {\n        return this.action.index;\n    }\n    get eventTarget() {\n        return this.action.eventTarget;\n    }\n    get eventOptions() {\n        return this.action.eventOptions;\n    }\n    get identifier() {\n        return this.context.identifier;\n    }\n    handleEvent(event) {\n        const actionEvent = this.prepareActionEvent(event);\n        if (this.willBeInvokedByEvent(event) && this.applyEventModifiers(actionEvent)) {\n            this.invokeWithEvent(actionEvent);\n        }\n    }\n    get eventName() {\n        return this.action.eventName;\n    }\n    get method() {\n        const method = this.controller[this.methodName];\n        if (typeof method == \"function\") {\n            return method;\n        }\n        throw new Error(`Action \"${this.action}\" references undefined method \"${this.methodName}\"`);\n    }\n    applyEventModifiers(event) {\n        const { element } = this.action;\n        const { actionDescriptorFilters } = this.context.application;\n        const { controller } = this.context;\n        let passes = true;\n        for (const [name, value] of Object.entries(this.eventOptions)) {\n            if (name in actionDescriptorFilters) {\n                const filter = actionDescriptorFilters[name];\n                passes = passes && filter({ name, value, event, element, controller });\n            }\n            else {\n                continue;\n            }\n        }\n        return passes;\n    }\n    prepareActionEvent(event) {\n        return Object.assign(event, { params: this.action.params });\n    }\n    invokeWithEvent(event) {\n        const { target, currentTarget } = event;\n        try {\n            this.method.call(this.controller, event);\n            this.context.logDebugActivity(this.methodName, { event, target, currentTarget, action: this.methodName });\n        }\n        catch (error) {\n            const { identifier, controller, element, index } = this;\n            const detail = { identifier, controller, element, index, event };\n            this.context.handleError(error, `invoking action \"${this.action}\"`, detail);\n        }\n    }\n    willBeInvokedByEvent(event) {\n        const eventTarget = event.target;\n        if (event instanceof KeyboardEvent && this.action.shouldIgnoreKeyboardEvent(event)) {\n            return false;\n        }\n        if (event instanceof MouseEvent && this.action.shouldIgnoreMouseEvent(event)) {\n            return false;\n        }\n        if (this.element === eventTarget) {\n            return true;\n        }\n        else if (eventTarget instanceof Element && this.element.contains(eventTarget)) {\n            return this.scope.containsElement(eventTarget);\n        }\n        else {\n            return this.scope.containsElement(this.action.element);\n        }\n    }\n    get controller() {\n        return this.context.controller;\n    }\n    get methodName() {\n        return this.action.methodName;\n    }\n    get element() {\n        return this.scope.element;\n    }\n    get scope() {\n        return this.context.scope;\n    }\n}\n\nclass ElementObserver {\n    constructor(element, delegate) {\n        this.mutationObserverInit = { attributes: true, childList: true, subtree: true };\n        this.element = element;\n        this.started = false;\n        this.delegate = delegate;\n        this.elements = new Set();\n        this.mutationObserver = new MutationObserver((mutations) => this.processMutations(mutations));\n    }\n    start() {\n        if (!this.started) {\n            this.started = true;\n            this.mutationObserver.observe(this.element, this.mutationObserverInit);\n            this.refresh();\n        }\n    }\n    pause(callback) {\n        if (this.started) {\n            this.mutationObserver.disconnect();\n            this.started = false;\n        }\n        callback();\n        if (!this.started) {\n            this.mutationObserver.observe(this.element, this.mutationObserverInit);\n            this.started = true;\n        }\n    }\n    stop() {\n        if (this.started) {\n            this.mutationObserver.takeRecords();\n            this.mutationObserver.disconnect();\n            this.started = false;\n        }\n    }\n    refresh() {\n        if (this.started) {\n            const matches = new Set(this.matchElementsInTree());\n            for (const element of Array.from(this.elements)) {\n                if (!matches.has(element)) {\n                    this.removeElement(element);\n                }\n            }\n            for (const element of Array.from(matches)) {\n                this.addElement(element);\n            }\n        }\n    }\n    processMutations(mutations) {\n        if (this.started) {\n            for (const mutation of mutations) {\n                this.processMutation(mutation);\n            }\n        }\n    }\n    processMutation(mutation) {\n        if (mutation.type == \"attributes\") {\n            this.processAttributeChange(mutation.target, mutation.attributeName);\n        }\n        else if (mutation.type == \"childList\") {\n            this.processRemovedNodes(mutation.removedNodes);\n            this.processAddedNodes(mutation.addedNodes);\n        }\n    }\n    processAttributeChange(element, attributeName) {\n        if (this.elements.has(element)) {\n            if (this.delegate.elementAttributeChanged && this.matchElement(element)) {\n                this.delegate.elementAttributeChanged(element, attributeName);\n            }\n            else {\n                this.removeElement(element);\n            }\n        }\n        else if (this.matchElement(element)) {\n            this.addElement(element);\n        }\n    }\n    processRemovedNodes(nodes) {\n        for (const node of Array.from(nodes)) {\n            const element = this.elementFromNode(node);\n            if (element) {\n                this.processTree(element, this.removeElement);\n            }\n        }\n    }\n    processAddedNodes(nodes) {\n        for (const node of Array.from(nodes)) {\n            const element = this.elementFromNode(node);\n            if (element && this.elementIsActive(element)) {\n                this.processTree(element, this.addElement);\n            }\n        }\n    }\n    matchElement(element) {\n        return this.delegate.matchElement(element);\n    }\n    matchElementsInTree(tree = this.element) {\n        return this.delegate.matchElementsInTree(tree);\n    }\n    processTree(tree, processor) {\n        for (const element of this.matchElementsInTree(tree)) {\n            processor.call(this, element);\n        }\n    }\n    elementFromNode(node) {\n        if (node.nodeType == Node.ELEMENT_NODE) {\n            return node;\n        }\n    }\n    elementIsActive(element) {\n        if (element.isConnected != this.element.isConnected) {\n            return false;\n        }\n        else {\n            return this.element.contains(element);\n        }\n    }\n    addElement(element) {\n        if (!this.elements.has(element)) {\n            if (this.elementIsActive(element)) {\n                this.elements.add(element);\n                if (this.delegate.elementMatched) {\n                    this.delegate.elementMatched(element);\n                }\n            }\n        }\n    }\n    removeElement(element) {\n        if (this.elements.has(element)) {\n            this.elements.delete(element);\n            if (this.delegate.elementUnmatched) {\n                this.delegate.elementUnmatched(element);\n            }\n        }\n    }\n}\n\nclass AttributeObserver {\n    constructor(element, attributeName, delegate) {\n        this.attributeName = attributeName;\n        this.delegate = delegate;\n        this.elementObserver = new ElementObserver(element, this);\n    }\n    get element() {\n        return this.elementObserver.element;\n    }\n    get selector() {\n        return `[${this.attributeName}]`;\n    }\n    start() {\n        this.elementObserver.start();\n    }\n    pause(callback) {\n        this.elementObserver.pause(callback);\n    }\n    stop() {\n        this.elementObserver.stop();\n    }\n    refresh() {\n        this.elementObserver.refresh();\n    }\n    get started() {\n        return this.elementObserver.started;\n    }\n    matchElement(element) {\n        return element.hasAttribute(this.attributeName);\n    }\n    matchElementsInTree(tree) {\n        const match = this.matchElement(tree) ? [tree] : [];\n        const matches = Array.from(tree.querySelectorAll(this.selector));\n        return match.concat(matches);\n    }\n    elementMatched(element) {\n        if (this.delegate.elementMatchedAttribute) {\n            this.delegate.elementMatchedAttribute(element, this.attributeName);\n        }\n    }\n    elementUnmatched(element) {\n        if (this.delegate.elementUnmatchedAttribute) {\n            this.delegate.elementUnmatchedAttribute(element, this.attributeName);\n        }\n    }\n    elementAttributeChanged(element, attributeName) {\n        if (this.delegate.elementAttributeValueChanged && this.attributeName == attributeName) {\n            this.delegate.elementAttributeValueChanged(element, attributeName);\n        }\n    }\n}\n\nfunction add(map, key, value) {\n    fetch(map, key).add(value);\n}\nfunction del(map, key, value) {\n    fetch(map, key).delete(value);\n    prune(map, key);\n}\nfunction fetch(map, key) {\n    let values = map.get(key);\n    if (!values) {\n        values = new Set();\n        map.set(key, values);\n    }\n    return values;\n}\nfunction prune(map, key) {\n    const values = map.get(key);\n    if (values != null && values.size == 0) {\n        map.delete(key);\n    }\n}\n\nclass Multimap {\n    constructor() {\n        this.valuesByKey = new Map();\n    }\n    get keys() {\n        return Array.from(this.valuesByKey.keys());\n    }\n    get values() {\n        const sets = Array.from(this.valuesByKey.values());\n        return sets.reduce((values, set) => values.concat(Array.from(set)), []);\n    }\n    get size() {\n        const sets = Array.from(this.valuesByKey.values());\n        return sets.reduce((size, set) => size + set.size, 0);\n    }\n    add(key, value) {\n        add(this.valuesByKey, key, value);\n    }\n    delete(key, value) {\n        del(this.valuesByKey, key, value);\n    }\n    has(key, value) {\n        const values = this.valuesByKey.get(key);\n        return values != null && values.has(value);\n    }\n    hasKey(key) {\n        return this.valuesByKey.has(key);\n    }\n    hasValue(value) {\n        const sets = Array.from(this.valuesByKey.values());\n        return sets.some((set) => set.has(value));\n    }\n    getValuesForKey(key) {\n        const values = this.valuesByKey.get(key);\n        return values ? Array.from(values) : [];\n    }\n    getKeysForValue(value) {\n        return Array.from(this.valuesByKey)\n            .filter(([_key, values]) => values.has(value))\n            .map(([key, _values]) => key);\n    }\n}\n\nclass IndexedMultimap extends Multimap {\n    constructor() {\n        super();\n        this.keysByValue = new Map();\n    }\n    get values() {\n        return Array.from(this.keysByValue.keys());\n    }\n    add(key, value) {\n        super.add(key, value);\n        add(this.keysByValue, value, key);\n    }\n    delete(key, value) {\n        super.delete(key, value);\n        del(this.keysByValue, value, key);\n    }\n    hasValue(value) {\n        return this.keysByValue.has(value);\n    }\n    getKeysForValue(value) {\n        const set = this.keysByValue.get(value);\n        return set ? Array.from(set) : [];\n    }\n}\n\nclass SelectorObserver {\n    constructor(element, selector, delegate, details) {\n        this._selector = selector;\n        this.details = details;\n        this.elementObserver = new ElementObserver(element, this);\n        this.delegate = delegate;\n        this.matchesByElement = new Multimap();\n    }\n    get started() {\n        return this.elementObserver.started;\n    }\n    get selector() {\n        return this._selector;\n    }\n    set selector(selector) {\n        this._selector = selector;\n        this.refresh();\n    }\n    start() {\n        this.elementObserver.start();\n    }\n    pause(callback) {\n        this.elementObserver.pause(callback);\n    }\n    stop() {\n        this.elementObserver.stop();\n    }\n    refresh() {\n        this.elementObserver.refresh();\n    }\n    get element() {\n        return this.elementObserver.element;\n    }\n    matchElement(element) {\n        const { selector } = this;\n        if (selector) {\n            const matches = element.matches(selector);\n            if (this.delegate.selectorMatchElement) {\n                return matches && this.delegate.selectorMatchElement(element, this.details);\n            }\n            return matches;\n        }\n        else {\n            return false;\n        }\n    }\n    matchElementsInTree(tree) {\n        const { selector } = this;\n        if (selector) {\n            const match = this.matchElement(tree) ? [tree] : [];\n            const matches = Array.from(tree.querySelectorAll(selector)).filter((match) => this.matchElement(match));\n            return match.concat(matches);\n        }\n        else {\n            return [];\n        }\n    }\n    elementMatched(element) {\n        const { selector } = this;\n        if (selector) {\n            this.selectorMatched(element, selector);\n        }\n    }\n    elementUnmatched(element) {\n        const selectors = this.matchesByElement.getKeysForValue(element);\n        for (const selector of selectors) {\n            this.selectorUnmatched(element, selector);\n        }\n    }\n    elementAttributeChanged(element, _attributeName) {\n        const { selector } = this;\n        if (selector) {\n            const matches = this.matchElement(element);\n            const matchedBefore = this.matchesByElement.has(selector, element);\n            if (matches && !matchedBefore) {\n                this.selectorMatched(element, selector);\n            }\n            else if (!matches && matchedBefore) {\n                this.selectorUnmatched(element, selector);\n            }\n        }\n    }\n    selectorMatched(element, selector) {\n        this.delegate.selectorMatched(element, selector, this.details);\n        this.matchesByElement.add(selector, element);\n    }\n    selectorUnmatched(element, selector) {\n        this.delegate.selectorUnmatched(element, selector, this.details);\n        this.matchesByElement.delete(selector, element);\n    }\n}\n\nclass StringMapObserver {\n    constructor(element, delegate) {\n        this.element = element;\n        this.delegate = delegate;\n        this.started = false;\n        this.stringMap = new Map();\n        this.mutationObserver = new MutationObserver((mutations) => this.processMutations(mutations));\n    }\n    start() {\n        if (!this.started) {\n            this.started = true;\n            this.mutationObserver.observe(this.element, { attributes: true, attributeOldValue: true });\n            this.refresh();\n        }\n    }\n    stop() {\n        if (this.started) {\n            this.mutationObserver.takeRecords();\n            this.mutationObserver.disconnect();\n            this.started = false;\n        }\n    }\n    refresh() {\n        if (this.started) {\n            for (const attributeName of this.knownAttributeNames) {\n                this.refreshAttribute(attributeName, null);\n            }\n        }\n    }\n    processMutations(mutations) {\n        if (this.started) {\n            for (const mutation of mutations) {\n                this.processMutation(mutation);\n            }\n        }\n    }\n    processMutation(mutation) {\n        const attributeName = mutation.attributeName;\n        if (attributeName) {\n            this.refreshAttribute(attributeName, mutation.oldValue);\n        }\n    }\n    refreshAttribute(attributeName, oldValue) {\n        const key = this.delegate.getStringMapKeyForAttribute(attributeName);\n        if (key != null) {\n            if (!this.stringMap.has(attributeName)) {\n                this.stringMapKeyAdded(key, attributeName);\n            }\n            const value = this.element.getAttribute(attributeName);\n            if (this.stringMap.get(attributeName) != value) {\n                this.stringMapValueChanged(value, key, oldValue);\n            }\n            if (value == null) {\n                const oldValue = this.stringMap.get(attributeName);\n                this.stringMap.delete(attributeName);\n                if (oldValue)\n                    this.stringMapKeyRemoved(key, attributeName, oldValue);\n            }\n            else {\n                this.stringMap.set(attributeName, value);\n            }\n        }\n    }\n    stringMapKeyAdded(key, attributeName) {\n        if (this.delegate.stringMapKeyAdded) {\n            this.delegate.stringMapKeyAdded(key, attributeName);\n        }\n    }\n    stringMapValueChanged(value, key, oldValue) {\n        if (this.delegate.stringMapValueChanged) {\n            this.delegate.stringMapValueChanged(value, key, oldValue);\n        }\n    }\n    stringMapKeyRemoved(key, attributeName, oldValue) {\n        if (this.delegate.stringMapKeyRemoved) {\n            this.delegate.stringMapKeyRemoved(key, attributeName, oldValue);\n        }\n    }\n    get knownAttributeNames() {\n        return Array.from(new Set(this.currentAttributeNames.concat(this.recordedAttributeNames)));\n    }\n    get currentAttributeNames() {\n        return Array.from(this.element.attributes).map((attribute) => attribute.name);\n    }\n    get recordedAttributeNames() {\n        return Array.from(this.stringMap.keys());\n    }\n}\n\nclass TokenListObserver {\n    constructor(element, attributeName, delegate) {\n        this.attributeObserver = new AttributeObserver(element, attributeName, this);\n        this.delegate = delegate;\n        this.tokensByElement = new Multimap();\n    }\n    get started() {\n        return this.attributeObserver.started;\n    }\n    start() {\n        this.attributeObserver.start();\n    }\n    pause(callback) {\n        this.attributeObserver.pause(callback);\n    }\n    stop() {\n        this.attributeObserver.stop();\n    }\n    refresh() {\n        this.attributeObserver.refresh();\n    }\n    get element() {\n        return this.attributeObserver.element;\n    }\n    get attributeName() {\n        return this.attributeObserver.attributeName;\n    }\n    elementMatchedAttribute(element) {\n        this.tokensMatched(this.readTokensForElement(element));\n    }\n    elementAttributeValueChanged(element) {\n        const [unmatchedTokens, matchedTokens] = this.refreshTokensForElement(element);\n        this.tokensUnmatched(unmatchedTokens);\n        this.tokensMatched(matchedTokens);\n    }\n    elementUnmatchedAttribute(element) {\n        this.tokensUnmatched(this.tokensByElement.getValuesForKey(element));\n    }\n    tokensMatched(tokens) {\n        tokens.forEach((token) => this.tokenMatched(token));\n    }\n    tokensUnmatched(tokens) {\n        tokens.forEach((token) => this.tokenUnmatched(token));\n    }\n    tokenMatched(token) {\n        this.delegate.tokenMatched(token);\n        this.tokensByElement.add(token.element, token);\n    }\n    tokenUnmatched(token) {\n        this.delegate.tokenUnmatched(token);\n        this.tokensByElement.delete(token.element, token);\n    }\n    refreshTokensForElement(element) {\n        const previousTokens = this.tokensByElement.getValuesForKey(element);\n        const currentTokens = this.readTokensForElement(element);\n        const firstDifferingIndex = zip(previousTokens, currentTokens).findIndex(([previousToken, currentToken]) => !tokensAreEqual(previousToken, currentToken));\n        if (firstDifferingIndex == -1) {\n            return [[], []];\n        }\n        else {\n            return [previousTokens.slice(firstDifferingIndex), currentTokens.slice(firstDifferingIndex)];\n        }\n    }\n    readTokensForElement(element) {\n        const attributeName = this.attributeName;\n        const tokenString = element.getAttribute(attributeName) || \"\";\n        return parseTokenString(tokenString, element, attributeName);\n    }\n}\nfunction parseTokenString(tokenString, element, attributeName) {\n    return tokenString\n        .trim()\n        .split(/\\s+/)\n        .filter((content) => content.length)\n        .map((content, index) => ({ element, attributeName, content, index }));\n}\nfunction zip(left, right) {\n    const length = Math.max(left.length, right.length);\n    return Array.from({ length }, (_, index) => [left[index], right[index]]);\n}\nfunction tokensAreEqual(left, right) {\n    return left && right && left.index == right.index && left.content == right.content;\n}\n\nclass ValueListObserver {\n    constructor(element, attributeName, delegate) {\n        this.tokenListObserver = new TokenListObserver(element, attributeName, this);\n        this.delegate = delegate;\n        this.parseResultsByToken = new WeakMap();\n        this.valuesByTokenByElement = new WeakMap();\n    }\n    get started() {\n        return this.tokenListObserver.started;\n    }\n    start() {\n        this.tokenListObserver.start();\n    }\n    stop() {\n        this.tokenListObserver.stop();\n    }\n    refresh() {\n        this.tokenListObserver.refresh();\n    }\n    get element() {\n        return this.tokenListObserver.element;\n    }\n    get attributeName() {\n        return this.tokenListObserver.attributeName;\n    }\n    tokenMatched(token) {\n        const { element } = token;\n        const { value } = this.fetchParseResultForToken(token);\n        if (value) {\n            this.fetchValuesByTokenForElement(element).set(token, value);\n            this.delegate.elementMatchedValue(element, value);\n        }\n    }\n    tokenUnmatched(token) {\n        const { element } = token;\n        const { value } = this.fetchParseResultForToken(token);\n        if (value) {\n            this.fetchValuesByTokenForElement(element).delete(token);\n            this.delegate.elementUnmatchedValue(element, value);\n        }\n    }\n    fetchParseResultForToken(token) {\n        let parseResult = this.parseResultsByToken.get(token);\n        if (!parseResult) {\n            parseResult = this.parseToken(token);\n            this.parseResultsByToken.set(token, parseResult);\n        }\n        return parseResult;\n    }\n    fetchValuesByTokenForElement(element) {\n        let valuesByToken = this.valuesByTokenByElement.get(element);\n        if (!valuesByToken) {\n            valuesByToken = new Map();\n            this.valuesByTokenByElement.set(element, valuesByToken);\n        }\n        return valuesByToken;\n    }\n    parseToken(token) {\n        try {\n            const value = this.delegate.parseValueForToken(token);\n            return { value };\n        }\n        catch (error) {\n            return { error };\n        }\n    }\n}\n\nclass BindingObserver {\n    constructor(context, delegate) {\n        this.context = context;\n        this.delegate = delegate;\n        this.bindingsByAction = new Map();\n    }\n    start() {\n        if (!this.valueListObserver) {\n            this.valueListObserver = new ValueListObserver(this.element, this.actionAttribute, this);\n            this.valueListObserver.start();\n        }\n    }\n    stop() {\n        if (this.valueListObserver) {\n            this.valueListObserver.stop();\n            delete this.valueListObserver;\n            this.disconnectAllActions();\n        }\n    }\n    get element() {\n        return this.context.element;\n    }\n    get identifier() {\n        return this.context.identifier;\n    }\n    get actionAttribute() {\n        return this.schema.actionAttribute;\n    }\n    get schema() {\n        return this.context.schema;\n    }\n    get bindings() {\n        return Array.from(this.bindingsByAction.values());\n    }\n    connectAction(action) {\n        const binding = new Binding(this.context, action);\n        this.bindingsByAction.set(action, binding);\n        this.delegate.bindingConnected(binding);\n    }\n    disconnectAction(action) {\n        const binding = this.bindingsByAction.get(action);\n        if (binding) {\n            this.bindingsByAction.delete(action);\n            this.delegate.bindingDisconnected(binding);\n        }\n    }\n    disconnectAllActions() {\n        this.bindings.forEach((binding) => this.delegate.bindingDisconnected(binding, true));\n        this.bindingsByAction.clear();\n    }\n    parseValueForToken(token) {\n        const action = Action.forToken(token, this.schema);\n        if (action.identifier == this.identifier) {\n            return action;\n        }\n    }\n    elementMatchedValue(element, action) {\n        this.connectAction(action);\n    }\n    elementUnmatchedValue(element, action) {\n        this.disconnectAction(action);\n    }\n}\n\nclass ValueObserver {\n    constructor(context, receiver) {\n        this.context = context;\n        this.receiver = receiver;\n        this.stringMapObserver = new StringMapObserver(this.element, this);\n        this.valueDescriptorMap = this.controller.valueDescriptorMap;\n    }\n    start() {\n        this.stringMapObserver.start();\n        this.invokeChangedCallbacksForDefaultValues();\n    }\n    stop() {\n        this.stringMapObserver.stop();\n    }\n    get element() {\n        return this.context.element;\n    }\n    get controller() {\n        return this.context.controller;\n    }\n    getStringMapKeyForAttribute(attributeName) {\n        if (attributeName in this.valueDescriptorMap) {\n            return this.valueDescriptorMap[attributeName].name;\n        }\n    }\n    stringMapKeyAdded(key, attributeName) {\n        const descriptor = this.valueDescriptorMap[attributeName];\n        if (!this.hasValue(key)) {\n            this.invokeChangedCallback(key, descriptor.writer(this.receiver[key]), descriptor.writer(descriptor.defaultValue));\n        }\n    }\n    stringMapValueChanged(value, name, oldValue) {\n        const descriptor = this.valueDescriptorNameMap[name];\n        if (value === null)\n            return;\n        if (oldValue === null) {\n            oldValue = descriptor.writer(descriptor.defaultValue);\n        }\n        this.invokeChangedCallback(name, value, oldValue);\n    }\n    stringMapKeyRemoved(key, attributeName, oldValue) {\n        const descriptor = this.valueDescriptorNameMap[key];\n        if (this.hasValue(key)) {\n            this.invokeChangedCallback(key, descriptor.writer(this.receiver[key]), oldValue);\n        }\n        else {\n            this.invokeChangedCallback(key, descriptor.writer(descriptor.defaultValue), oldValue);\n        }\n    }\n    invokeChangedCallbacksForDefaultValues() {\n        for (const { key, name, defaultValue, writer } of this.valueDescriptors) {\n            if (defaultValue != undefined && !this.controller.data.has(key)) {\n                this.invokeChangedCallback(name, writer(defaultValue), undefined);\n            }\n        }\n    }\n    invokeChangedCallback(name, rawValue, rawOldValue) {\n        const changedMethodName = `${name}Changed`;\n        const changedMethod = this.receiver[changedMethodName];\n        if (typeof changedMethod == \"function\") {\n            const descriptor = this.valueDescriptorNameMap[name];\n            try {\n                const value = descriptor.reader(rawValue);\n                let oldValue = rawOldValue;\n                if (rawOldValue) {\n                    oldValue = descriptor.reader(rawOldValue);\n                }\n                changedMethod.call(this.receiver, value, oldValue);\n            }\n            catch (error) {\n                if (error instanceof TypeError) {\n                    error.message = `Stimulus Value \"${this.context.identifier}.${descriptor.name}\" - ${error.message}`;\n                }\n                throw error;\n            }\n        }\n    }\n    get valueDescriptors() {\n        const { valueDescriptorMap } = this;\n        return Object.keys(valueDescriptorMap).map((key) => valueDescriptorMap[key]);\n    }\n    get valueDescriptorNameMap() {\n        const descriptors = {};\n        Object.keys(this.valueDescriptorMap).forEach((key) => {\n            const descriptor = this.valueDescriptorMap[key];\n            descriptors[descriptor.name] = descriptor;\n        });\n        return descriptors;\n    }\n    hasValue(attributeName) {\n        const descriptor = this.valueDescriptorNameMap[attributeName];\n        const hasMethodName = `has${capitalize(descriptor.name)}`;\n        return this.receiver[hasMethodName];\n    }\n}\n\nclass TargetObserver {\n    constructor(context, delegate) {\n        this.context = context;\n        this.delegate = delegate;\n        this.targetsByName = new Multimap();\n    }\n    start() {\n        if (!this.tokenListObserver) {\n            this.tokenListObserver = new TokenListObserver(this.element, this.attributeName, this);\n            this.tokenListObserver.start();\n        }\n    }\n    stop() {\n        if (this.tokenListObserver) {\n            this.disconnectAllTargets();\n            this.tokenListObserver.stop();\n            delete this.tokenListObserver;\n        }\n    }\n    tokenMatched({ element, content: name }) {\n        if (this.scope.containsElement(element)) {\n            this.connectTarget(element, name);\n        }\n    }\n    tokenUnmatched({ element, content: name }) {\n        this.disconnectTarget(element, name);\n    }\n    connectTarget(element, name) {\n        var _a;\n        if (!this.targetsByName.has(name, element)) {\n            this.targetsByName.add(name, element);\n            (_a = this.tokenListObserver) === null || _a === void 0 ? void 0 : _a.pause(() => this.delegate.targetConnected(element, name));\n        }\n    }\n    disconnectTarget(element, name) {\n        var _a;\n        if (this.targetsByName.has(name, element)) {\n            this.targetsByName.delete(name, element);\n            (_a = this.tokenListObserver) === null || _a === void 0 ? void 0 : _a.pause(() => this.delegate.targetDisconnected(element, name));\n        }\n    }\n    disconnectAllTargets() {\n        for (const name of this.targetsByName.keys) {\n            for (const element of this.targetsByName.getValuesForKey(name)) {\n                this.disconnectTarget(element, name);\n            }\n        }\n    }\n    get attributeName() {\n        return `data-${this.context.identifier}-target`;\n    }\n    get element() {\n        return this.context.element;\n    }\n    get scope() {\n        return this.context.scope;\n    }\n}\n\nfunction readInheritableStaticArrayValues(constructor, propertyName) {\n    const ancestors = getAncestorsForConstructor(constructor);\n    return Array.from(ancestors.reduce((values, constructor) => {\n        getOwnStaticArrayValues(constructor, propertyName).forEach((name) => values.add(name));\n        return values;\n    }, new Set()));\n}\nfunction readInheritableStaticObjectPairs(constructor, propertyName) {\n    const ancestors = getAncestorsForConstructor(constructor);\n    return ancestors.reduce((pairs, constructor) => {\n        pairs.push(...getOwnStaticObjectPairs(constructor, propertyName));\n        return pairs;\n    }, []);\n}\nfunction getAncestorsForConstructor(constructor) {\n    const ancestors = [];\n    while (constructor) {\n        ancestors.push(constructor);\n        constructor = Object.getPrototypeOf(constructor);\n    }\n    return ancestors.reverse();\n}\nfunction getOwnStaticArrayValues(constructor, propertyName) {\n    const definition = constructor[propertyName];\n    return Array.isArray(definition) ? definition : [];\n}\nfunction getOwnStaticObjectPairs(constructor, propertyName) {\n    const definition = constructor[propertyName];\n    return definition ? Object.keys(definition).map((key) => [key, definition[key]]) : [];\n}\n\nclass OutletObserver {\n    constructor(context, delegate) {\n        this.started = false;\n        this.context = context;\n        this.delegate = delegate;\n        this.outletsByName = new Multimap();\n        this.outletElementsByName = new Multimap();\n        this.selectorObserverMap = new Map();\n        this.attributeObserverMap = new Map();\n    }\n    start() {\n        if (!this.started) {\n            this.outletDefinitions.forEach((outletName) => {\n                this.setupSelectorObserverForOutlet(outletName);\n                this.setupAttributeObserverForOutlet(outletName);\n            });\n            this.started = true;\n            this.dependentContexts.forEach((context) => context.refresh());\n        }\n    }\n    refresh() {\n        this.selectorObserverMap.forEach((observer) => observer.refresh());\n        this.attributeObserverMap.forEach((observer) => observer.refresh());\n    }\n    stop() {\n        if (this.started) {\n            this.started = false;\n            this.disconnectAllOutlets();\n            this.stopSelectorObservers();\n            this.stopAttributeObservers();\n        }\n    }\n    stopSelectorObservers() {\n        if (this.selectorObserverMap.size > 0) {\n            this.selectorObserverMap.forEach((observer) => observer.stop());\n            this.selectorObserverMap.clear();\n        }\n    }\n    stopAttributeObservers() {\n        if (this.attributeObserverMap.size > 0) {\n            this.attributeObserverMap.forEach((observer) => observer.stop());\n            this.attributeObserverMap.clear();\n        }\n    }\n    selectorMatched(element, _selector, { outletName }) {\n        const outlet = this.getOutlet(element, outletName);\n        if (outlet) {\n            this.connectOutlet(outlet, element, outletName);\n        }\n    }\n    selectorUnmatched(element, _selector, { outletName }) {\n        const outlet = this.getOutletFromMap(element, outletName);\n        if (outlet) {\n            this.disconnectOutlet(outlet, element, outletName);\n        }\n    }\n    selectorMatchElement(element, { outletName }) {\n        const selector = this.selector(outletName);\n        const hasOutlet = this.hasOutlet(element, outletName);\n        const hasOutletController = element.matches(`[${this.schema.controllerAttribute}~=${outletName}]`);\n        if (selector) {\n            return hasOutlet && hasOutletController && element.matches(selector);\n        }\n        else {\n            return false;\n        }\n    }\n    elementMatchedAttribute(_element, attributeName) {\n        const outletName = this.getOutletNameFromOutletAttributeName(attributeName);\n        if (outletName) {\n            this.updateSelectorObserverForOutlet(outletName);\n        }\n    }\n    elementAttributeValueChanged(_element, attributeName) {\n        const outletName = this.getOutletNameFromOutletAttributeName(attributeName);\n        if (outletName) {\n            this.updateSelectorObserverForOutlet(outletName);\n        }\n    }\n    elementUnmatchedAttribute(_element, attributeName) {\n        const outletName = this.getOutletNameFromOutletAttributeName(attributeName);\n        if (outletName) {\n            this.updateSelectorObserverForOutlet(outletName);\n        }\n    }\n    connectOutlet(outlet, element, outletName) {\n        var _a;\n        if (!this.outletElementsByName.has(outletName, element)) {\n            this.outletsByName.add(outletName, outlet);\n            this.outletElementsByName.add(outletName, element);\n            (_a = this.selectorObserverMap.get(outletName)) === null || _a === void 0 ? void 0 : _a.pause(() => this.delegate.outletConnected(outlet, element, outletName));\n        }\n    }\n    disconnectOutlet(outlet, element, outletName) {\n        var _a;\n        if (this.outletElementsByName.has(outletName, element)) {\n            this.outletsByName.delete(outletName, outlet);\n            this.outletElementsByName.delete(outletName, element);\n            (_a = this.selectorObserverMap\n                .get(outletName)) === null || _a === void 0 ? void 0 : _a.pause(() => this.delegate.outletDisconnected(outlet, element, outletName));\n        }\n    }\n    disconnectAllOutlets() {\n        for (const outletName of this.outletElementsByName.keys) {\n            for (const element of this.outletElementsByName.getValuesForKey(outletName)) {\n                for (const outlet of this.outletsByName.getValuesForKey(outletName)) {\n                    this.disconnectOutlet(outlet, element, outletName);\n                }\n            }\n        }\n    }\n    updateSelectorObserverForOutlet(outletName) {\n        const observer = this.selectorObserverMap.get(outletName);\n        if (observer) {\n            observer.selector = this.selector(outletName);\n        }\n    }\n    setupSelectorObserverForOutlet(outletName) {\n        const selector = this.selector(outletName);\n        const selectorObserver = new SelectorObserver(document.body, selector, this, { outletName });\n        this.selectorObserverMap.set(outletName, selectorObserver);\n        selectorObserver.start();\n    }\n    setupAttributeObserverForOutlet(outletName) {\n        const attributeName = this.attributeNameForOutletName(outletName);\n        const attributeObserver = new AttributeObserver(this.scope.element, attributeName, this);\n        this.attributeObserverMap.set(outletName, attributeObserver);\n        attributeObserver.start();\n    }\n    selector(outletName) {\n        return this.scope.outlets.getSelectorForOutletName(outletName);\n    }\n    attributeNameForOutletName(outletName) {\n        return this.scope.schema.outletAttributeForScope(this.identifier, outletName);\n    }\n    getOutletNameFromOutletAttributeName(attributeName) {\n        return this.outletDefinitions.find((outletName) => this.attributeNameForOutletName(outletName) === attributeName);\n    }\n    get outletDependencies() {\n        const dependencies = new Multimap();\n        this.router.modules.forEach((module) => {\n            const constructor = module.definition.controllerConstructor;\n            const outlets = readInheritableStaticArrayValues(constructor, \"outlets\");\n            outlets.forEach((outlet) => dependencies.add(outlet, module.identifier));\n        });\n        return dependencies;\n    }\n    get outletDefinitions() {\n        return this.outletDependencies.getKeysForValue(this.identifier);\n    }\n    get dependentControllerIdentifiers() {\n        return this.outletDependencies.getValuesForKey(this.identifier);\n    }\n    get dependentContexts() {\n        const identifiers = this.dependentControllerIdentifiers;\n        return this.router.contexts.filter((context) => identifiers.includes(context.identifier));\n    }\n    hasOutlet(element, outletName) {\n        return !!this.getOutlet(element, outletName) || !!this.getOutletFromMap(element, outletName);\n    }\n    getOutlet(element, outletName) {\n        return this.application.getControllerForElementAndIdentifier(element, outletName);\n    }\n    getOutletFromMap(element, outletName) {\n        return this.outletsByName.getValuesForKey(outletName).find((outlet) => outlet.element === element);\n    }\n    get scope() {\n        return this.context.scope;\n    }\n    get schema() {\n        return this.context.schema;\n    }\n    get identifier() {\n        return this.context.identifier;\n    }\n    get application() {\n        return this.context.application;\n    }\n    get router() {\n        return this.application.router;\n    }\n}\n\nclass Context {\n    constructor(module, scope) {\n        this.logDebugActivity = (functionName, detail = {}) => {\n            const { identifier, controller, element } = this;\n            detail = Object.assign({ identifier, controller, element }, detail);\n            this.application.logDebugActivity(this.identifier, functionName, detail);\n        };\n        this.module = module;\n        this.scope = scope;\n        this.controller = new module.controllerConstructor(this);\n        this.bindingObserver = new BindingObserver(this, this.dispatcher);\n        this.valueObserver = new ValueObserver(this, this.controller);\n        this.targetObserver = new TargetObserver(this, this);\n        this.outletObserver = new OutletObserver(this, this);\n        try {\n            this.controller.initialize();\n            this.logDebugActivity(\"initialize\");\n        }\n        catch (error) {\n            this.handleError(error, \"initializing controller\");\n        }\n    }\n    connect() {\n        this.bindingObserver.start();\n        this.valueObserver.start();\n        this.targetObserver.start();\n        this.outletObserver.start();\n        try {\n            this.controller.connect();\n            this.logDebugActivity(\"connect\");\n        }\n        catch (error) {\n            this.handleError(error, \"connecting controller\");\n        }\n    }\n    refresh() {\n        this.outletObserver.refresh();\n    }\n    disconnect() {\n        try {\n            this.controller.disconnect();\n            this.logDebugActivity(\"disconnect\");\n        }\n        catch (error) {\n            this.handleError(error, \"disconnecting controller\");\n        }\n        this.outletObserver.stop();\n        this.targetObserver.stop();\n        this.valueObserver.stop();\n        this.bindingObserver.stop();\n    }\n    get application() {\n        return this.module.application;\n    }\n    get identifier() {\n        return this.module.identifier;\n    }\n    get schema() {\n        return this.application.schema;\n    }\n    get dispatcher() {\n        return this.application.dispatcher;\n    }\n    get element() {\n        return this.scope.element;\n    }\n    get parentElement() {\n        return this.element.parentElement;\n    }\n    handleError(error, message, detail = {}) {\n        const { identifier, controller, element } = this;\n        detail = Object.assign({ identifier, controller, element }, detail);\n        this.application.handleError(error, `Error ${message}`, detail);\n    }\n    targetConnected(element, name) {\n        this.invokeControllerMethod(`${name}TargetConnected`, element);\n    }\n    targetDisconnected(element, name) {\n        this.invokeControllerMethod(`${name}TargetDisconnected`, element);\n    }\n    outletConnected(outlet, element, name) {\n        this.invokeControllerMethod(`${namespaceCamelize(name)}OutletConnected`, outlet, element);\n    }\n    outletDisconnected(outlet, element, name) {\n        this.invokeControllerMethod(`${namespaceCamelize(name)}OutletDisconnected`, outlet, element);\n    }\n    invokeControllerMethod(methodName, ...args) {\n        const controller = this.controller;\n        if (typeof controller[methodName] == \"function\") {\n            controller[methodName](...args);\n        }\n    }\n}\n\nfunction bless(constructor) {\n    return shadow(constructor, getBlessedProperties(constructor));\n}\nfunction shadow(constructor, properties) {\n    const shadowConstructor = extend(constructor);\n    const shadowProperties = getShadowProperties(constructor.prototype, properties);\n    Object.defineProperties(shadowConstructor.prototype, shadowProperties);\n    return shadowConstructor;\n}\nfunction getBlessedProperties(constructor) {\n    const blessings = readInheritableStaticArrayValues(constructor, \"blessings\");\n    return blessings.reduce((blessedProperties, blessing) => {\n        const properties = blessing(constructor);\n        for (const key in properties) {\n            const descriptor = blessedProperties[key] || {};\n            blessedProperties[key] = Object.assign(descriptor, properties[key]);\n        }\n        return blessedProperties;\n    }, {});\n}\nfunction getShadowProperties(prototype, properties) {\n    return getOwnKeys(properties).reduce((shadowProperties, key) => {\n        const descriptor = getShadowedDescriptor(prototype, properties, key);\n        if (descriptor) {\n            Object.assign(shadowProperties, { [key]: descriptor });\n        }\n        return shadowProperties;\n    }, {});\n}\nfunction getShadowedDescriptor(prototype, properties, key) {\n    const shadowingDescriptor = Object.getOwnPropertyDescriptor(prototype, key);\n    const shadowedByValue = shadowingDescriptor && \"value\" in shadowingDescriptor;\n    if (!shadowedByValue) {\n        const descriptor = Object.getOwnPropertyDescriptor(properties, key).value;\n        if (shadowingDescriptor) {\n            descriptor.get = shadowingDescriptor.get || descriptor.get;\n            descriptor.set = shadowingDescriptor.set || descriptor.set;\n        }\n        return descriptor;\n    }\n}\nconst getOwnKeys = (() => {\n    if (typeof Object.getOwnPropertySymbols == \"function\") {\n        return (object) => [...Object.getOwnPropertyNames(object), ...Object.getOwnPropertySymbols(object)];\n    }\n    else {\n        return Object.getOwnPropertyNames;\n    }\n})();\nconst extend = (() => {\n    function extendWithReflect(constructor) {\n        function extended() {\n            return Reflect.construct(constructor, arguments, new.target);\n        }\n        extended.prototype = Object.create(constructor.prototype, {\n            constructor: { value: extended },\n        });\n        Reflect.setPrototypeOf(extended, constructor);\n        return extended;\n    }\n    function testReflectExtension() {\n        const a = function () {\n            this.a.call(this);\n        };\n        const b = extendWithReflect(a);\n        b.prototype.a = function () { };\n        return new b();\n    }\n    try {\n        testReflectExtension();\n        return extendWithReflect;\n    }\n    catch (error) {\n        return (constructor) => class extended extends constructor {\n        };\n    }\n})();\n\nfunction blessDefinition(definition) {\n    return {\n        identifier: definition.identifier,\n        controllerConstructor: bless(definition.controllerConstructor),\n    };\n}\n\nclass Module {\n    constructor(application, definition) {\n        this.application = application;\n        this.definition = blessDefinition(definition);\n        this.contextsByScope = new WeakMap();\n        this.connectedContexts = new Set();\n    }\n    get identifier() {\n        return this.definition.identifier;\n    }\n    get controllerConstructor() {\n        return this.definition.controllerConstructor;\n    }\n    get contexts() {\n        return Array.from(this.connectedContexts);\n    }\n    connectContextForScope(scope) {\n        const context = this.fetchContextForScope(scope);\n        this.connectedContexts.add(context);\n        context.connect();\n    }\n    disconnectContextForScope(scope) {\n        const context = this.contextsByScope.get(scope);\n        if (context) {\n            this.connectedContexts.delete(context);\n            context.disconnect();\n        }\n    }\n    fetchContextForScope(scope) {\n        let context = this.contextsByScope.get(scope);\n        if (!context) {\n            context = new Context(this, scope);\n            this.contextsByScope.set(scope, context);\n        }\n        return context;\n    }\n}\n\nclass ClassMap {\n    constructor(scope) {\n        this.scope = scope;\n    }\n    has(name) {\n        return this.data.has(this.getDataKey(name));\n    }\n    get(name) {\n        return this.getAll(name)[0];\n    }\n    getAll(name) {\n        const tokenString = this.data.get(this.getDataKey(name)) || \"\";\n        return tokenize(tokenString);\n    }\n    getAttributeName(name) {\n        return this.data.getAttributeNameForKey(this.getDataKey(name));\n    }\n    getDataKey(name) {\n        return `${name}-class`;\n    }\n    get data() {\n        return this.scope.data;\n    }\n}\n\nclass DataMap {\n    constructor(scope) {\n        this.scope = scope;\n    }\n    get element() {\n        return this.scope.element;\n    }\n    get identifier() {\n        return this.scope.identifier;\n    }\n    get(key) {\n        const name = this.getAttributeNameForKey(key);\n        return this.element.getAttribute(name);\n    }\n    set(key, value) {\n        const name = this.getAttributeNameForKey(key);\n        this.element.setAttribute(name, value);\n        return this.get(key);\n    }\n    has(key) {\n        const name = this.getAttributeNameForKey(key);\n        return this.element.hasAttribute(name);\n    }\n    delete(key) {\n        if (this.has(key)) {\n            const name = this.getAttributeNameForKey(key);\n            this.element.removeAttribute(name);\n            return true;\n        }\n        else {\n            return false;\n        }\n    }\n    getAttributeNameForKey(key) {\n        return `data-${this.identifier}-${dasherize(key)}`;\n    }\n}\n\nclass Guide {\n    constructor(logger) {\n        this.warnedKeysByObject = new WeakMap();\n        this.logger = logger;\n    }\n    warn(object, key, message) {\n        let warnedKeys = this.warnedKeysByObject.get(object);\n        if (!warnedKeys) {\n            warnedKeys = new Set();\n            this.warnedKeysByObject.set(object, warnedKeys);\n        }\n        if (!warnedKeys.has(key)) {\n            warnedKeys.add(key);\n            this.logger.warn(message, object);\n        }\n    }\n}\n\nfunction attributeValueContainsToken(attributeName, token) {\n    return `[${attributeName}~=\"${token}\"]`;\n}\n\nclass TargetSet {\n    constructor(scope) {\n        this.scope = scope;\n    }\n    get element() {\n        return this.scope.element;\n    }\n    get identifier() {\n        return this.scope.identifier;\n    }\n    get schema() {\n        return this.scope.schema;\n    }\n    has(targetName) {\n        return this.find(targetName) != null;\n    }\n    find(...targetNames) {\n        return targetNames.reduce((target, targetName) => target || this.findTarget(targetName) || this.findLegacyTarget(targetName), undefined);\n    }\n    findAll(...targetNames) {\n        return targetNames.reduce((targets, targetName) => [\n            ...targets,\n            ...this.findAllTargets(targetName),\n            ...this.findAllLegacyTargets(targetName),\n        ], []);\n    }\n    findTarget(targetName) {\n        const selector = this.getSelectorForTargetName(targetName);\n        return this.scope.findElement(selector);\n    }\n    findAllTargets(targetName) {\n        const selector = this.getSelectorForTargetName(targetName);\n        return this.scope.findAllElements(selector);\n    }\n    getSelectorForTargetName(targetName) {\n        const attributeName = this.schema.targetAttributeForScope(this.identifier);\n        return attributeValueContainsToken(attributeName, targetName);\n    }\n    findLegacyTarget(targetName) {\n        const selector = this.getLegacySelectorForTargetName(targetName);\n        return this.deprecate(this.scope.findElement(selector), targetName);\n    }\n    findAllLegacyTargets(targetName) {\n        const selector = this.getLegacySelectorForTargetName(targetName);\n        return this.scope.findAllElements(selector).map((element) => this.deprecate(element, targetName));\n    }\n    getLegacySelectorForTargetName(targetName) {\n        const targetDescriptor = `${this.identifier}.${targetName}`;\n        return attributeValueContainsToken(this.schema.targetAttribute, targetDescriptor);\n    }\n    deprecate(element, targetName) {\n        if (element) {\n            const { identifier } = this;\n            const attributeName = this.schema.targetAttribute;\n            const revisedAttributeName = this.schema.targetAttributeForScope(identifier);\n            this.guide.warn(element, `target:${targetName}`, `Please replace ${attributeName}=\"${identifier}.${targetName}\" with ${revisedAttributeName}=\"${targetName}\". ` +\n                `The ${attributeName} attribute is deprecated and will be removed in a future version of Stimulus.`);\n        }\n        return element;\n    }\n    get guide() {\n        return this.scope.guide;\n    }\n}\n\nclass OutletSet {\n    constructor(scope, controllerElement) {\n        this.scope = scope;\n        this.controllerElement = controllerElement;\n    }\n    get element() {\n        return this.scope.element;\n    }\n    get identifier() {\n        return this.scope.identifier;\n    }\n    get schema() {\n        return this.scope.schema;\n    }\n    has(outletName) {\n        return this.find(outletName) != null;\n    }\n    find(...outletNames) {\n        return outletNames.reduce((outlet, outletName) => outlet || this.findOutlet(outletName), undefined);\n    }\n    findAll(...outletNames) {\n        return outletNames.reduce((outlets, outletName) => [...outlets, ...this.findAllOutlets(outletName)], []);\n    }\n    getSelectorForOutletName(outletName) {\n        const attributeName = this.schema.outletAttributeForScope(this.identifier, outletName);\n        return this.controllerElement.getAttribute(attributeName);\n    }\n    findOutlet(outletName) {\n        const selector = this.getSelectorForOutletName(outletName);\n        if (selector)\n            return this.findElement(selector, outletName);\n    }\n    findAllOutlets(outletName) {\n        const selector = this.getSelectorForOutletName(outletName);\n        return selector ? this.findAllElements(selector, outletName) : [];\n    }\n    findElement(selector, outletName) {\n        const elements = this.scope.queryElements(selector);\n        return elements.filter((element) => this.matchesElement(element, selector, outletName))[0];\n    }\n    findAllElements(selector, outletName) {\n        const elements = this.scope.queryElements(selector);\n        return elements.filter((element) => this.matchesElement(element, selector, outletName));\n    }\n    matchesElement(element, selector, outletName) {\n        const controllerAttribute = element.getAttribute(this.scope.schema.controllerAttribute) || \"\";\n        return element.matches(selector) && controllerAttribute.split(\" \").includes(outletName);\n    }\n}\n\nclass Scope {\n    constructor(schema, element, identifier, logger) {\n        this.targets = new TargetSet(this);\n        this.classes = new ClassMap(this);\n        this.data = new DataMap(this);\n        this.containsElement = (element) => {\n            return element.closest(this.controllerSelector) === this.element;\n        };\n        this.schema = schema;\n        this.element = element;\n        this.identifier = identifier;\n        this.guide = new Guide(logger);\n        this.outlets = new OutletSet(this.documentScope, element);\n    }\n    findElement(selector) {\n        return this.element.matches(selector) ? this.element : this.queryElements(selector).find(this.containsElement);\n    }\n    findAllElements(selector) {\n        return [\n            ...(this.element.matches(selector) ? [this.element] : []),\n            ...this.queryElements(selector).filter(this.containsElement),\n        ];\n    }\n    queryElements(selector) {\n        return Array.from(this.element.querySelectorAll(selector));\n    }\n    get controllerSelector() {\n        return attributeValueContainsToken(this.schema.controllerAttribute, this.identifier);\n    }\n    get isDocumentScope() {\n        return this.element === document.documentElement;\n    }\n    get documentScope() {\n        return this.isDocumentScope\n            ? this\n            : new Scope(this.schema, document.documentElement, this.identifier, this.guide.logger);\n    }\n}\n\nclass ScopeObserver {\n    constructor(element, schema, delegate) {\n        this.element = element;\n        this.schema = schema;\n        this.delegate = delegate;\n        this.valueListObserver = new ValueListObserver(this.element, this.controllerAttribute, this);\n        this.scopesByIdentifierByElement = new WeakMap();\n        this.scopeReferenceCounts = new WeakMap();\n    }\n    start() {\n        this.valueListObserver.start();\n    }\n    stop() {\n        this.valueListObserver.stop();\n    }\n    get controllerAttribute() {\n        return this.schema.controllerAttribute;\n    }\n    parseValueForToken(token) {\n        const { element, content: identifier } = token;\n        return this.parseValueForElementAndIdentifier(element, identifier);\n    }\n    parseValueForElementAndIdentifier(element, identifier) {\n        const scopesByIdentifier = this.fetchScopesByIdentifierForElement(element);\n        let scope = scopesByIdentifier.get(identifier);\n        if (!scope) {\n            scope = this.delegate.createScopeForElementAndIdentifier(element, identifier);\n            scopesByIdentifier.set(identifier, scope);\n        }\n        return scope;\n    }\n    elementMatchedValue(element, value) {\n        const referenceCount = (this.scopeReferenceCounts.get(value) || 0) + 1;\n        this.scopeReferenceCounts.set(value, referenceCount);\n        if (referenceCount == 1) {\n            this.delegate.scopeConnected(value);\n        }\n    }\n    elementUnmatchedValue(element, value) {\n        const referenceCount = this.scopeReferenceCounts.get(value);\n        if (referenceCount) {\n            this.scopeReferenceCounts.set(value, referenceCount - 1);\n            if (referenceCount == 1) {\n                this.delegate.scopeDisconnected(value);\n            }\n        }\n    }\n    fetchScopesByIdentifierForElement(element) {\n        let scopesByIdentifier = this.scopesByIdentifierByElement.get(element);\n        if (!scopesByIdentifier) {\n            scopesByIdentifier = new Map();\n            this.scopesByIdentifierByElement.set(element, scopesByIdentifier);\n        }\n        return scopesByIdentifier;\n    }\n}\n\nclass Router {\n    constructor(application) {\n        this.application = application;\n        this.scopeObserver = new ScopeObserver(this.element, this.schema, this);\n        this.scopesByIdentifier = new Multimap();\n        this.modulesByIdentifier = new Map();\n    }\n    get element() {\n        return this.application.element;\n    }\n    get schema() {\n        return this.application.schema;\n    }\n    get logger() {\n        return this.application.logger;\n    }\n    get controllerAttribute() {\n        return this.schema.controllerAttribute;\n    }\n    get modules() {\n        return Array.from(this.modulesByIdentifier.values());\n    }\n    get contexts() {\n        return this.modules.reduce((contexts, module) => contexts.concat(module.contexts), []);\n    }\n    start() {\n        this.scopeObserver.start();\n    }\n    stop() {\n        this.scopeObserver.stop();\n    }\n    loadDefinition(definition) {\n        this.unloadIdentifier(definition.identifier);\n        const module = new Module(this.application, definition);\n        this.connectModule(module);\n        const afterLoad = definition.controllerConstructor.afterLoad;\n        if (afterLoad) {\n            afterLoad.call(definition.controllerConstructor, definition.identifier, this.application);\n        }\n    }\n    unloadIdentifier(identifier) {\n        const module = this.modulesByIdentifier.get(identifier);\n        if (module) {\n            this.disconnectModule(module);\n        }\n    }\n    getContextForElementAndIdentifier(element, identifier) {\n        const module = this.modulesByIdentifier.get(identifier);\n        if (module) {\n            return module.contexts.find((context) => context.element == element);\n        }\n    }\n    proposeToConnectScopeForElementAndIdentifier(element, identifier) {\n        const scope = this.scopeObserver.parseValueForElementAndIdentifier(element, identifier);\n        if (scope) {\n            this.scopeObserver.elementMatchedValue(scope.element, scope);\n        }\n        else {\n            console.error(`Couldn't find or create scope for identifier: \"${identifier}\" and element:`, element);\n        }\n    }\n    handleError(error, message, detail) {\n        this.application.handleError(error, message, detail);\n    }\n    createScopeForElementAndIdentifier(element, identifier) {\n        return new Scope(this.schema, element, identifier, this.logger);\n    }\n    scopeConnected(scope) {\n        this.scopesByIdentifier.add(scope.identifier, scope);\n        const module = this.modulesByIdentifier.get(scope.identifier);\n        if (module) {\n            module.connectContextForScope(scope);\n        }\n    }\n    scopeDisconnected(scope) {\n        this.scopesByIdentifier.delete(scope.identifier, scope);\n        const module = this.modulesByIdentifier.get(scope.identifier);\n        if (module) {\n            module.disconnectContextForScope(scope);\n        }\n    }\n    connectModule(module) {\n        this.modulesByIdentifier.set(module.identifier, module);\n        const scopes = this.scopesByIdentifier.getValuesForKey(module.identifier);\n        scopes.forEach((scope) => module.connectContextForScope(scope));\n    }\n    disconnectModule(module) {\n        this.modulesByIdentifier.delete(module.identifier);\n        const scopes = this.scopesByIdentifier.getValuesForKey(module.identifier);\n        scopes.forEach((scope) => module.disconnectContextForScope(scope));\n    }\n}\n\nconst defaultSchema = {\n    controllerAttribute: \"data-controller\",\n    actionAttribute: \"data-action\",\n    targetAttribute: \"data-target\",\n    targetAttributeForScope: (identifier) => `data-${identifier}-target`,\n    outletAttributeForScope: (identifier, outlet) => `data-${identifier}-${outlet}-outlet`,\n    keyMappings: Object.assign(Object.assign({ enter: \"Enter\", tab: \"Tab\", esc: \"Escape\", space: \" \", up: \"ArrowUp\", down: \"ArrowDown\", left: \"ArrowLeft\", right: \"ArrowRight\", home: \"Home\", end: \"End\", page_up: \"PageUp\", page_down: \"PageDown\" }, objectFromEntries(\"abcdefghijklmnopqrstuvwxyz\".split(\"\").map((c) => [c, c]))), objectFromEntries(\"0123456789\".split(\"\").map((n) => [n, n]))),\n};\nfunction objectFromEntries(array) {\n    return array.reduce((memo, [k, v]) => (Object.assign(Object.assign({}, memo), { [k]: v })), {});\n}\n\nclass Application {\n    constructor(element = document.documentElement, schema = defaultSchema) {\n        this.logger = console;\n        this.debug = false;\n        this.logDebugActivity = (identifier, functionName, detail = {}) => {\n            if (this.debug) {\n                this.logFormattedMessage(identifier, functionName, detail);\n            }\n        };\n        this.element = element;\n        this.schema = schema;\n        this.dispatcher = new Dispatcher(this);\n        this.router = new Router(this);\n        this.actionDescriptorFilters = Object.assign({}, defaultActionDescriptorFilters);\n    }\n    static start(element, schema) {\n        const application = new this(element, schema);\n        application.start();\n        return application;\n    }\n    async start() {\n        await domReady();\n        this.logDebugActivity(\"application\", \"starting\");\n        this.dispatcher.start();\n        this.router.start();\n        this.logDebugActivity(\"application\", \"start\");\n    }\n    stop() {\n        this.logDebugActivity(\"application\", \"stopping\");\n        this.dispatcher.stop();\n        this.router.stop();\n        this.logDebugActivity(\"application\", \"stop\");\n    }\n    register(identifier, controllerConstructor) {\n        this.load({ identifier, controllerConstructor });\n    }\n    registerActionOption(name, filter) {\n        this.actionDescriptorFilters[name] = filter;\n    }\n    load(head, ...rest) {\n        const definitions = Array.isArray(head) ? head : [head, ...rest];\n        definitions.forEach((definition) => {\n            if (definition.controllerConstructor.shouldLoad) {\n                this.router.loadDefinition(definition);\n            }\n        });\n    }\n    unload(head, ...rest) {\n        const identifiers = Array.isArray(head) ? head : [head, ...rest];\n        identifiers.forEach((identifier) => this.router.unloadIdentifier(identifier));\n    }\n    get controllers() {\n        return this.router.contexts.map((context) => context.controller);\n    }\n    getControllerForElementAndIdentifier(element, identifier) {\n        const context = this.router.getContextForElementAndIdentifier(element, identifier);\n        return context ? context.controller : null;\n    }\n    handleError(error, message, detail) {\n        var _a;\n        this.logger.error(`%s\\n\\n%o\\n\\n%o`, message, error, detail);\n        (_a = window.onerror) === null || _a === void 0 ? void 0 : _a.call(window, message, \"\", 0, 0, error);\n    }\n    logFormattedMessage(identifier, functionName, detail = {}) {\n        detail = Object.assign({ application: this }, detail);\n        this.logger.groupCollapsed(`${identifier} #${functionName}`);\n        this.logger.log(\"details:\", Object.assign({}, detail));\n        this.logger.groupEnd();\n    }\n}\nfunction domReady() {\n    return new Promise((resolve) => {\n        if (document.readyState == \"loading\") {\n            document.addEventListener(\"DOMContentLoaded\", () => resolve());\n        }\n        else {\n            resolve();\n        }\n    });\n}\n\nfunction ClassPropertiesBlessing(constructor) {\n    const classes = readInheritableStaticArrayValues(constructor, \"classes\");\n    return classes.reduce((properties, classDefinition) => {\n        return Object.assign(properties, propertiesForClassDefinition(classDefinition));\n    }, {});\n}\nfunction propertiesForClassDefinition(key) {\n    return {\n        [`${key}Class`]: {\n            get() {\n                const { classes } = this;\n                if (classes.has(key)) {\n                    return classes.get(key);\n                }\n                else {\n                    const attribute = classes.getAttributeName(key);\n                    throw new Error(`Missing attribute \"${attribute}\"`);\n                }\n            },\n        },\n        [`${key}Classes`]: {\n            get() {\n                return this.classes.getAll(key);\n            },\n        },\n        [`has${capitalize(key)}Class`]: {\n            get() {\n                return this.classes.has(key);\n            },\n        },\n    };\n}\n\nfunction OutletPropertiesBlessing(constructor) {\n    const outlets = readInheritableStaticArrayValues(constructor, \"outlets\");\n    return outlets.reduce((properties, outletDefinition) => {\n        return Object.assign(properties, propertiesForOutletDefinition(outletDefinition));\n    }, {});\n}\nfunction getOutletController(controller, element, identifier) {\n    return controller.application.getControllerForElementAndIdentifier(element, identifier);\n}\nfunction getControllerAndEnsureConnectedScope(controller, element, outletName) {\n    let outletController = getOutletController(controller, element, outletName);\n    if (outletController)\n        return outletController;\n    controller.application.router.proposeToConnectScopeForElementAndIdentifier(element, outletName);\n    outletController = getOutletController(controller, element, outletName);\n    if (outletController)\n        return outletController;\n}\nfunction propertiesForOutletDefinition(name) {\n    const camelizedName = namespaceCamelize(name);\n    return {\n        [`${camelizedName}Outlet`]: {\n            get() {\n                const outletElement = this.outlets.find(name);\n                const selector = this.outlets.getSelectorForOutletName(name);\n                if (outletElement) {\n                    const outletController = getControllerAndEnsureConnectedScope(this, outletElement, name);\n                    if (outletController)\n                        return outletController;\n                    throw new Error(`The provided outlet element is missing an outlet controller \"${name}\" instance for host controller \"${this.identifier}\"`);\n                }\n                throw new Error(`Missing outlet element \"${name}\" for host controller \"${this.identifier}\". Stimulus couldn't find a matching outlet element using selector \"${selector}\".`);\n            },\n        },\n        [`${camelizedName}Outlets`]: {\n            get() {\n                const outlets = this.outlets.findAll(name);\n                if (outlets.length > 0) {\n                    return outlets\n                        .map((outletElement) => {\n                        const outletController = getControllerAndEnsureConnectedScope(this, outletElement, name);\n                        if (outletController)\n                            return outletController;\n                        console.warn(`The provided outlet element is missing an outlet controller \"${name}\" instance for host controller \"${this.identifier}\"`, outletElement);\n                    })\n                        .filter((controller) => controller);\n                }\n                return [];\n            },\n        },\n        [`${camelizedName}OutletElement`]: {\n            get() {\n                const outletElement = this.outlets.find(name);\n                const selector = this.outlets.getSelectorForOutletName(name);\n                if (outletElement) {\n                    return outletElement;\n                }\n                else {\n                    throw new Error(`Missing outlet element \"${name}\" for host controller \"${this.identifier}\". Stimulus couldn't find a matching outlet element using selector \"${selector}\".`);\n                }\n            },\n        },\n        [`${camelizedName}OutletElements`]: {\n            get() {\n                return this.outlets.findAll(name);\n            },\n        },\n        [`has${capitalize(camelizedName)}Outlet`]: {\n            get() {\n                return this.outlets.has(name);\n            },\n        },\n    };\n}\n\nfunction TargetPropertiesBlessing(constructor) {\n    const targets = readInheritableStaticArrayValues(constructor, \"targets\");\n    return targets.reduce((properties, targetDefinition) => {\n        return Object.assign(properties, propertiesForTargetDefinition(targetDefinition));\n    }, {});\n}\nfunction propertiesForTargetDefinition(name) {\n    return {\n        [`${name}Target`]: {\n            get() {\n                const target = this.targets.find(name);\n                if (target) {\n                    return target;\n                }\n                else {\n                    throw new Error(`Missing target element \"${name}\" for \"${this.identifier}\" controller`);\n                }\n            },\n        },\n        [`${name}Targets`]: {\n            get() {\n                return this.targets.findAll(name);\n            },\n        },\n        [`has${capitalize(name)}Target`]: {\n            get() {\n                return this.targets.has(name);\n            },\n        },\n    };\n}\n\nfunction ValuePropertiesBlessing(constructor) {\n    const valueDefinitionPairs = readInheritableStaticObjectPairs(constructor, \"values\");\n    const propertyDescriptorMap = {\n        valueDescriptorMap: {\n            get() {\n                return valueDefinitionPairs.reduce((result, valueDefinitionPair) => {\n                    const valueDescriptor = parseValueDefinitionPair(valueDefinitionPair, this.identifier);\n                    const attributeName = this.data.getAttributeNameForKey(valueDescriptor.key);\n                    return Object.assign(result, { [attributeName]: valueDescriptor });\n                }, {});\n            },\n        },\n    };\n    return valueDefinitionPairs.reduce((properties, valueDefinitionPair) => {\n        return Object.assign(properties, propertiesForValueDefinitionPair(valueDefinitionPair));\n    }, propertyDescriptorMap);\n}\nfunction propertiesForValueDefinitionPair(valueDefinitionPair, controller) {\n    const definition = parseValueDefinitionPair(valueDefinitionPair, controller);\n    const { key, name, reader: read, writer: write } = definition;\n    return {\n        [name]: {\n            get() {\n                const value = this.data.get(key);\n                if (value !== null) {\n                    return read(value);\n                }\n                else {\n                    return definition.defaultValue;\n                }\n            },\n            set(value) {\n                if (value === undefined) {\n                    this.data.delete(key);\n                }\n                else {\n                    this.data.set(key, write(value));\n                }\n            },\n        },\n        [`has${capitalize(name)}`]: {\n            get() {\n                return this.data.has(key) || definition.hasCustomDefaultValue;\n            },\n        },\n    };\n}\nfunction parseValueDefinitionPair([token, typeDefinition], controller) {\n    return valueDescriptorForTokenAndTypeDefinition({\n        controller,\n        token,\n        typeDefinition,\n    });\n}\nfunction parseValueTypeConstant(constant) {\n    switch (constant) {\n        case Array:\n            return \"array\";\n        case Boolean:\n            return \"boolean\";\n        case Number:\n            return \"number\";\n        case Object:\n            return \"object\";\n        case String:\n            return \"string\";\n    }\n}\nfunction parseValueTypeDefault(defaultValue) {\n    switch (typeof defaultValue) {\n        case \"boolean\":\n            return \"boolean\";\n        case \"number\":\n            return \"number\";\n        case \"string\":\n            return \"string\";\n    }\n    if (Array.isArray(defaultValue))\n        return \"array\";\n    if (Object.prototype.toString.call(defaultValue) === \"[object Object]\")\n        return \"object\";\n}\nfunction parseValueTypeObject(payload) {\n    const { controller, token, typeObject } = payload;\n    const hasType = isSomething(typeObject.type);\n    const hasDefault = isSomething(typeObject.default);\n    const fullObject = hasType && hasDefault;\n    const onlyType = hasType && !hasDefault;\n    const onlyDefault = !hasType && hasDefault;\n    const typeFromObject = parseValueTypeConstant(typeObject.type);\n    const typeFromDefaultValue = parseValueTypeDefault(payload.typeObject.default);\n    if (onlyType)\n        return typeFromObject;\n    if (onlyDefault)\n        return typeFromDefaultValue;\n    if (typeFromObject !== typeFromDefaultValue) {\n        const propertyPath = controller ? `${controller}.${token}` : token;\n        throw new Error(`The specified default value for the Stimulus Value \"${propertyPath}\" must match the defined type \"${typeFromObject}\". The provided default value of \"${typeObject.default}\" is of type \"${typeFromDefaultValue}\".`);\n    }\n    if (fullObject)\n        return typeFromObject;\n}\nfunction parseValueTypeDefinition(payload) {\n    const { controller, token, typeDefinition } = payload;\n    const typeObject = { controller, token, typeObject: typeDefinition };\n    const typeFromObject = parseValueTypeObject(typeObject);\n    const typeFromDefaultValue = parseValueTypeDefault(typeDefinition);\n    const typeFromConstant = parseValueTypeConstant(typeDefinition);\n    const type = typeFromObject || typeFromDefaultValue || typeFromConstant;\n    if (type)\n        return type;\n    const propertyPath = controller ? `${controller}.${typeDefinition}` : token;\n    throw new Error(`Unknown value type \"${propertyPath}\" for \"${token}\" value`);\n}\nfunction defaultValueForDefinition(typeDefinition) {\n    const constant = parseValueTypeConstant(typeDefinition);\n    if (constant)\n        return defaultValuesByType[constant];\n    const hasDefault = hasProperty(typeDefinition, \"default\");\n    const hasType = hasProperty(typeDefinition, \"type\");\n    const typeObject = typeDefinition;\n    if (hasDefault)\n        return typeObject.default;\n    if (hasType) {\n        const { type } = typeObject;\n        const constantFromType = parseValueTypeConstant(type);\n        if (constantFromType)\n            return defaultValuesByType[constantFromType];\n    }\n    return typeDefinition;\n}\nfunction valueDescriptorForTokenAndTypeDefinition(payload) {\n    const { token, typeDefinition } = payload;\n    const key = `${dasherize(token)}-value`;\n    const type = parseValueTypeDefinition(payload);\n    return {\n        type,\n        key,\n        name: camelize(key),\n        get defaultValue() {\n            return defaultValueForDefinition(typeDefinition);\n        },\n        get hasCustomDefaultValue() {\n            return parseValueTypeDefault(typeDefinition) !== undefined;\n        },\n        reader: readers[type],\n        writer: writers[type] || writers.default,\n    };\n}\nconst defaultValuesByType = {\n    get array() {\n        return [];\n    },\n    boolean: false,\n    number: 0,\n    get object() {\n        return {};\n    },\n    string: \"\",\n};\nconst readers = {\n    array(value) {\n        const array = JSON.parse(value);\n        if (!Array.isArray(array)) {\n            throw new TypeError(`expected value of type \"array\" but instead got value \"${value}\" of type \"${parseValueTypeDefault(array)}\"`);\n        }\n        return array;\n    },\n    boolean(value) {\n        return !(value == \"0\" || String(value).toLowerCase() == \"false\");\n    },\n    number(value) {\n        return Number(value.replace(/_/g, \"\"));\n    },\n    object(value) {\n        const object = JSON.parse(value);\n        if (object === null || typeof object != \"object\" || Array.isArray(object)) {\n            throw new TypeError(`expected value of type \"object\" but instead got value \"${value}\" of type \"${parseValueTypeDefault(object)}\"`);\n        }\n        return object;\n    },\n    string(value) {\n        return value;\n    },\n};\nconst writers = {\n    default: writeString,\n    array: writeJSON,\n    object: writeJSON,\n};\nfunction writeJSON(value) {\n    return JSON.stringify(value);\n}\nfunction writeString(value) {\n    return `${value}`;\n}\n\nclass Controller {\n    constructor(context) {\n        this.context = context;\n    }\n    static get shouldLoad() {\n        return true;\n    }\n    static afterLoad(_identifier, _application) {\n        return;\n    }\n    get application() {\n        return this.context.application;\n    }\n    get scope() {\n        return this.context.scope;\n    }\n    get element() {\n        return this.scope.element;\n    }\n    get identifier() {\n        return this.scope.identifier;\n    }\n    get targets() {\n        return this.scope.targets;\n    }\n    get outlets() {\n        return this.scope.outlets;\n    }\n    get classes() {\n        return this.scope.classes;\n    }\n    get data() {\n        return this.scope.data;\n    }\n    initialize() {\n    }\n    connect() {\n    }\n    disconnect() {\n    }\n    dispatch(eventName, { target = this.element, detail = {}, prefix = this.identifier, bubbles = true, cancelable = true, } = {}) {\n        const type = prefix ? `${prefix}:${eventName}` : eventName;\n        const event = new CustomEvent(type, { detail, bubbles, cancelable });\n        target.dispatchEvent(event);\n        return event;\n    }\n}\nController.blessings = [\n    ClassPropertiesBlessing,\n    TargetPropertiesBlessing,\n    ValuePropertiesBlessing,\n    OutletPropertiesBlessing,\n];\nController.targets = [];\nController.outlets = [];\nController.values = {};\n\nexport { Application, AttributeObserver, Context, Controller, ElementObserver, IndexedMultimap, Multimap, SelectorObserver, StringMapObserver, TokenListObserver, ValueListObserver, add, defaultSchema, del, fetch, prune };\n", "import { Application } from \"@hotwired/stimulus\"\n\nconst application = Application.start()\n\n// Configure Stimulus development experience\napplication.debug = false\nwindow.Stimulus   = application\n\nexport { application }\n", "import { Controller } from \"@hotwired/stimulus\"\n\nexport default class extends Controller {\n  connect() {\n    this.element.textContent = \"Hello World!\"\n  }\n\n  delete(event){\n    let confirmed = confirm(\"sicuro?\")\n\n    if(!confirmed){\n      event.preventDefault()\n    }\n  }\n}\n", "import tslib from '../tslib.js';\r\nconst {\r\n    __extends,\r\n    __assign,\r\n    __rest,\r\n    __decorate,\r\n    __param,\r\n    __metadata,\r\n    __awaiter,\r\n    __generator,\r\n    __exportStar,\r\n    __createBinding,\r\n    __values,\r\n    __read,\r\n    __spread,\r\n    __spreadArrays,\r\n    __spreadArray,\r\n    __await,\r\n    __asyncGenerator,\r\n    __asyncDelegator,\r\n    __asyncValues,\r\n    __makeTemplateObject,\r\n    __importStar,\r\n    __importDefault,\r\n    __classPrivateFieldGet,\r\n    __classPrivateFieldSet,\r\n} = tslib;\r\nexport {\r\n    __extends,\r\n    __assign,\r\n    __rest,\r\n    __decorate,\r\n    __param,\r\n    __metadata,\r\n    __awaiter,\r\n    __generator,\r\n    __exportStar,\r\n    __createBinding,\r\n    __values,\r\n    __read,\r\n    __spread,\r\n    __spreadArrays,\r\n    __spreadArray,\r\n    __await,\r\n    __asyncGenerator,\r\n    __asyncDelegator,\r\n    __asyncValues,\r\n    __makeTemplateObject,\r\n    __importStar,\r\n    __importDefault,\r\n    __classPrivateFieldGet,\r\n    __classPrivateFieldSet,\r\n};\r\n", "/*!\n* ZRender, a high performance 2d drawing library.\n*\n* Copyright (c) 2013, Baidu Inc.\n* All rights reserved.\n*\n* LICENSE\n* https://github.com/ecomfe/zrender/blob/master/LICENSE.txt\n*/\nimport env from './core/env.js';\nimport * as zrUtil from './core/util.js';\nimport Handler from './Handler.js';\nimport Storage from './Storage.js';\nimport Animation, { getTime } from './animation/Animation.js';\nimport HandlerProxy from './dom/HandlerProxy.js';\nimport { lum } from './tool/color.js';\nimport { DARK_MODE_THRESHOLD } from './config.js';\nimport Group from './graphic/Group.js';\nvar painterCtors = {};\nvar instances = {};\nfunction delInstance(id) {\n    delete instances[id];\n}\nfunction isDarkMode(backgroundColor) {\n    if (!backgroundColor) {\n        return false;\n    }\n    if (typeof backgroundColor === 'string') {\n        return lum(backgroundColor, 1) < DARK_MODE_THRESHOLD;\n    }\n    else if (backgroundColor.colorStops) {\n        var colorStops = backgroundColor.colorStops;\n        var totalLum = 0;\n        var len = colorStops.length;\n        for (var i = 0; i < len; i++) {\n            totalLum += lum(colorStops[i].color, 1);\n        }\n        totalLum /= len;\n        return totalLum < DARK_MODE_THRESHOLD;\n    }\n    return false;\n}\nvar ZRender = (function () {\n    function ZRender(id, dom, opts) {\n        var _this = this;\n        this._sleepAfterStill = 10;\n        this._stillFrameAccum = 0;\n        this._needsRefresh = true;\n        this._needsRefreshHover = true;\n        this._darkMode = false;\n        opts = opts || {};\n        this.dom = dom;\n        this.id = id;\n        var storage = new Storage();\n        var rendererType = opts.renderer || 'canvas';\n        if (!painterCtors[rendererType]) {\n            rendererType = zrUtil.keys(painterCtors)[0];\n        }\n        if (process.env.NODE_ENV !== 'production') {\n            if (!painterCtors[rendererType]) {\n                throw new Error(\"Renderer '\" + rendererType + \"' is not imported. Please import it first.\");\n            }\n        }\n        opts.useDirtyRect = opts.useDirtyRect == null\n            ? false\n            : opts.useDirtyRect;\n        var painter = new painterCtors[rendererType](dom, storage, opts, id);\n        var ssrMode = opts.ssr || painter.ssrOnly;\n        this.storage = storage;\n        this.painter = painter;\n        var handlerProxy = (!env.node && !env.worker && !ssrMode)\n            ? new HandlerProxy(painter.getViewportRoot(), painter.root)\n            : null;\n        var useCoarsePointer = opts.useCoarsePointer;\n        var usePointerSize = (useCoarsePointer == null || useCoarsePointer === 'auto')\n            ? env.touchEventsSupported\n            : !!useCoarsePointer;\n        var defaultPointerSize = 44;\n        var pointerSize;\n        if (usePointerSize) {\n            pointerSize = zrUtil.retrieve2(opts.pointerSize, defaultPointerSize);\n        }\n        this.handler = new Handler(storage, painter, handlerProxy, painter.root, pointerSize);\n        this.animation = new Animation({\n            stage: {\n                update: ssrMode ? null : function () { return _this._flush(true); }\n            }\n        });\n        if (!ssrMode) {\n            this.animation.start();\n        }\n    }\n    ZRender.prototype.add = function (el) {\n        if (this._disposed || !el) {\n            return;\n        }\n        this.storage.addRoot(el);\n        el.addSelfToZr(this);\n        this.refresh();\n    };\n    ZRender.prototype.remove = function (el) {\n        if (this._disposed || !el) {\n            return;\n        }\n        this.storage.delRoot(el);\n        el.removeSelfFromZr(this);\n        this.refresh();\n    };\n    ZRender.prototype.configLayer = function (zLevel, config) {\n        if (this._disposed) {\n            return;\n        }\n        if (this.painter.configLayer) {\n            this.painter.configLayer(zLevel, config);\n        }\n        this.refresh();\n    };\n    ZRender.prototype.setBackgroundColor = function (backgroundColor) {\n        if (this._disposed) {\n            return;\n        }\n        if (this.painter.setBackgroundColor) {\n            this.painter.setBackgroundColor(backgroundColor);\n        }\n        this.refresh();\n        this._backgroundColor = backgroundColor;\n        this._darkMode = isDarkMode(backgroundColor);\n    };\n    ZRender.prototype.getBackgroundColor = function () {\n        return this._backgroundColor;\n    };\n    ZRender.prototype.setDarkMode = function (darkMode) {\n        this._darkMode = darkMode;\n    };\n    ZRender.prototype.isDarkMode = function () {\n        return this._darkMode;\n    };\n    ZRender.prototype.refreshImmediately = function (fromInside) {\n        if (this._disposed) {\n            return;\n        }\n        if (!fromInside) {\n            this.animation.update(true);\n        }\n        this._needsRefresh = false;\n        this.painter.refresh();\n        this._needsRefresh = false;\n    };\n    ZRender.prototype.refresh = function () {\n        if (this._disposed) {\n            return;\n        }\n        this._needsRefresh = true;\n        this.animation.start();\n    };\n    ZRender.prototype.flush = function () {\n        if (this._disposed) {\n            return;\n        }\n        this._flush(false);\n    };\n    ZRender.prototype._flush = function (fromInside) {\n        var triggerRendered;\n        var start = getTime();\n        if (this._needsRefresh) {\n            triggerRendered = true;\n            this.refreshImmediately(fromInside);\n        }\n        if (this._needsRefreshHover) {\n            triggerRendered = true;\n            this.refreshHoverImmediately();\n        }\n        var end = getTime();\n        if (triggerRendered) {\n            this._stillFrameAccum = 0;\n            this.trigger('rendered', {\n                elapsedTime: end - start\n            });\n        }\n        else if (this._sleepAfterStill > 0) {\n            this._stillFrameAccum++;\n            if (this._stillFrameAccum > this._sleepAfterStill) {\n                this.animation.stop();\n            }\n        }\n    };\n    ZRender.prototype.setSleepAfterStill = function (stillFramesCount) {\n        this._sleepAfterStill = stillFramesCount;\n    };\n    ZRender.prototype.wakeUp = function () {\n        if (this._disposed) {\n            return;\n        }\n        this.animation.start();\n        this._stillFrameAccum = 0;\n    };\n    ZRender.prototype.refreshHover = function () {\n        this._needsRefreshHover = true;\n    };\n    ZRender.prototype.refreshHoverImmediately = function () {\n        if (this._disposed) {\n            return;\n        }\n        this._needsRefreshHover = false;\n        if (this.painter.refreshHover && this.painter.getType() === 'canvas') {\n            this.painter.refreshHover();\n        }\n    };\n    ZRender.prototype.resize = function (opts) {\n        if (this._disposed) {\n            return;\n        }\n        opts = opts || {};\n        this.painter.resize(opts.width, opts.height);\n        this.handler.resize();\n    };\n    ZRender.prototype.clearAnimation = function () {\n        if (this._disposed) {\n            return;\n        }\n        this.animation.clear();\n    };\n    ZRender.prototype.getWidth = function () {\n        if (this._disposed) {\n            return;\n        }\n        return this.painter.getWidth();\n    };\n    ZRender.prototype.getHeight = function () {\n        if (this._disposed) {\n            return;\n        }\n        return this.painter.getHeight();\n    };\n    ZRender.prototype.setCursorStyle = function (cursorStyle) {\n        if (this._disposed) {\n            return;\n        }\n        this.handler.setCursorStyle(cursorStyle);\n    };\n    ZRender.prototype.findHover = function (x, y) {\n        if (this._disposed) {\n            return;\n        }\n        return this.handler.findHover(x, y);\n    };\n    ZRender.prototype.on = function (eventName, eventHandler, context) {\n        if (!this._disposed) {\n            this.handler.on(eventName, eventHandler, context);\n        }\n        return this;\n    };\n    ZRender.prototype.off = function (eventName, eventHandler) {\n        if (this._disposed) {\n            return;\n        }\n        this.handler.off(eventName, eventHandler);\n    };\n    ZRender.prototype.trigger = function (eventName, event) {\n        if (this._disposed) {\n            return;\n        }\n        this.handler.trigger(eventName, event);\n    };\n    ZRender.prototype.clear = function () {\n        if (this._disposed) {\n            return;\n        }\n        var roots = this.storage.getRoots();\n        for (var i = 0; i < roots.length; i++) {\n            if (roots[i] instanceof Group) {\n                roots[i].removeSelfFromZr(this);\n            }\n        }\n        this.storage.delAllRoots();\n        this.painter.clear();\n    };\n    ZRender.prototype.dispose = function () {\n        if (this._disposed) {\n            return;\n        }\n        this.animation.stop();\n        this.clear();\n        this.storage.dispose();\n        this.painter.dispose();\n        this.handler.dispose();\n        this.animation =\n            this.storage =\n                this.painter =\n                    this.handler = null;\n        this._disposed = true;\n        delInstance(this.id);\n    };\n    return ZRender;\n}());\nexport function init(dom, opts) {\n    var zr = new ZRender(zrUtil.guid(), dom, opts);\n    instances[zr.id] = zr;\n    return zr;\n}\nexport function dispose(zr) {\n    zr.dispose();\n}\nexport function disposeAll() {\n    for (var key in instances) {\n        if (instances.hasOwnProperty(key)) {\n            instances[key].dispose();\n        }\n    }\n    instances = {};\n}\nexport function getInstance(id) {\n    return instances[id];\n}\nexport function registerPainter(name, Ctor) {\n    painterCtors[name] = Ctor;\n}\nvar ssrDataGetter;\nexport function getElementSSRData(el) {\n    if (typeof ssrDataGetter === 'function') {\n        return ssrDataGetter(el);\n    }\n}\nexport function registerSSRDataGetter(getter) {\n    ssrDataGetter = getter;\n}\nexport var version = '6.0.0';\n;\n", "var Browser = (function () {\n    function Browser() {\n        this.firefox = false;\n        this.ie = false;\n        this.edge = false;\n        this.newEdge = false;\n        this.weChat = false;\n    }\n    return Browser;\n}());\nvar Env = (function () {\n    function Env() {\n        this.browser = new Browser();\n        this.node = false;\n        this.wxa = false;\n        this.worker = false;\n        this.svgSupported = false;\n        this.touchEventsSupported = false;\n        this.pointerEventsSupported = false;\n        this.domSupported = false;\n        this.transformSupported = false;\n        this.transform3dSupported = false;\n        this.hasGlobalWindow = typeof window !== 'undefined';\n    }\n    return Env;\n}());\nvar env = new Env();\nif (typeof wx === 'object' && typeof wx.getSystemInfoSync === 'function') {\n    env.wxa = true;\n    env.touchEventsSupported = true;\n}\nelse if (typeof document === 'undefined' && typeof self !== 'undefined') {\n    env.worker = true;\n}\nelse if (!env.hasGlobalWindow\n    || 'Deno' in window\n    || (typeof navigator !== 'undefined' && typeof navigator.userAgent === 'string'\n        && navigator.userAgent.indexOf('Node.js') > -1)) {\n    env.node = true;\n    env.svgSupported = true;\n}\nelse {\n    detect(navigator.userAgent, env);\n}\nfunction detect(ua, env) {\n    var browser = env.browser;\n    var firefox = ua.match(/Firefox\\/([\\d.]+)/);\n    var ie = ua.match(/MSIE\\s([\\d.]+)/)\n        || ua.match(/Trident\\/.+?rv:(([\\d.]+))/);\n    var edge = ua.match(/Edge?\\/([\\d.]+)/);\n    var weChat = (/micromessenger/i).test(ua);\n    if (firefox) {\n        browser.firefox = true;\n        browser.version = firefox[1];\n    }\n    if (ie) {\n        browser.ie = true;\n        browser.version = ie[1];\n    }\n    if (edge) {\n        browser.edge = true;\n        browser.version = edge[1];\n        browser.newEdge = +edge[1].split('.')[0] > 18;\n    }\n    if (weChat) {\n        browser.weChat = true;\n    }\n    env.svgSupported = typeof SVGRect !== 'undefined';\n    env.touchEventsSupported = 'ontouchstart' in window && !browser.ie && !browser.edge;\n    env.pointerEventsSupported = 'onpointerdown' in window\n        && (browser.edge || (browser.ie && +browser.version >= 11));\n    var domSupported = env.domSupported = typeof document !== 'undefined';\n    if (domSupported) {\n        var style = document.documentElement.style;\n        env.transform3dSupported = ((browser.ie && 'transition' in style)\n            || browser.edge\n            || (('WebKitCSSMatrix' in window) && ('m11' in new WebKitCSSMatrix()))\n            || 'MozPerspective' in style)\n            && !('OTransition' in style);\n        env.transformSupported = env.transform3dSupported\n            || (browser.ie && +browser.version >= 9);\n    }\n}\nexport default env;\n", "import { platformApi } from './platform.js';\nvar BUILTIN_OBJECT = reduce([\n    'Function',\n    'RegExp',\n    'Date',\n    'Error',\n    'CanvasGradient',\n    'CanvasPattern',\n    'Image',\n    'Canvas'\n], function (obj, val) {\n    obj['[object ' + val + ']'] = true;\n    return obj;\n}, {});\nvar TYPED_ARRAY = reduce([\n    'Int8',\n    'Uint8',\n    'Uint8Clamped',\n    'Int16',\n    'Uint16',\n    'Int32',\n    'Uint32',\n    'Float32',\n    'Float64'\n], function (obj, val) {\n    obj['[object ' + val + 'Array]'] = true;\n    return obj;\n}, {});\nvar objToString = Object.prototype.toString;\nvar arrayProto = Array.prototype;\nvar nativeForEach = arrayProto.forEach;\nvar nativeFilter = arrayProto.filter;\nvar nativeSlice = arrayProto.slice;\nvar nativeMap = arrayProto.map;\nvar ctorFunction = function () { }.constructor;\nvar protoFunction = ctorFunction ? ctorFunction.prototype : null;\nvar protoKey = '__proto__';\nvar idStart = 0x0907;\nexport function guid() {\n    return idStart++;\n}\nexport function logError() {\n    var args = [];\n    for (var _i = 0; _i < arguments.length; _i++) {\n        args[_i] = arguments[_i];\n    }\n    if (typeof console !== 'undefined') {\n        console.error.apply(console, args);\n    }\n}\nexport function clone(source) {\n    if (source == null || typeof source !== 'object') {\n        return source;\n    }\n    var result = source;\n    var typeStr = objToString.call(source);\n    if (typeStr === '[object Array]') {\n        if (!isPrimitive(source)) {\n            result = [];\n            for (var i = 0, len = source.length; i < len; i++) {\n                result[i] = clone(source[i]);\n            }\n        }\n    }\n    else if (TYPED_ARRAY[typeStr]) {\n        if (!isPrimitive(source)) {\n            var Ctor = source.constructor;\n            if (Ctor.from) {\n                result = Ctor.from(source);\n            }\n            else {\n                result = new Ctor(source.length);\n                for (var i = 0, len = source.length; i < len; i++) {\n                    result[i] = source[i];\n                }\n            }\n        }\n    }\n    else if (!BUILTIN_OBJECT[typeStr] && !isPrimitive(source) && !isDom(source)) {\n        result = {};\n        for (var key in source) {\n            if (source.hasOwnProperty(key) && key !== protoKey) {\n                result[key] = clone(source[key]);\n            }\n        }\n    }\n    return result;\n}\nexport function merge(target, source, overwrite) {\n    if (!isObject(source) || !isObject(target)) {\n        return overwrite ? clone(source) : target;\n    }\n    for (var key in source) {\n        if (source.hasOwnProperty(key) && key !== protoKey) {\n            var targetProp = target[key];\n            var sourceProp = source[key];\n            if (isObject(sourceProp)\n                && isObject(targetProp)\n                && !isArray(sourceProp)\n                && !isArray(targetProp)\n                && !isDom(sourceProp)\n                && !isDom(targetProp)\n                && !isBuiltInObject(sourceProp)\n                && !isBuiltInObject(targetProp)\n                && !isPrimitive(sourceProp)\n                && !isPrimitive(targetProp)) {\n                merge(targetProp, sourceProp, overwrite);\n            }\n            else if (overwrite || !(key in target)) {\n                target[key] = clone(source[key]);\n            }\n        }\n    }\n    return target;\n}\nexport function mergeAll(targetAndSources, overwrite) {\n    var result = targetAndSources[0];\n    for (var i = 1, len = targetAndSources.length; i < len; i++) {\n        result = merge(result, targetAndSources[i], overwrite);\n    }\n    return result;\n}\nexport function extend(target, source) {\n    if (Object.assign) {\n        Object.assign(target, source);\n    }\n    else {\n        for (var key in source) {\n            if (source.hasOwnProperty(key) && key !== protoKey) {\n                target[key] = source[key];\n            }\n        }\n    }\n    return target;\n}\nexport function defaults(target, source, overlay) {\n    var keysArr = keys(source);\n    for (var i = 0, len = keysArr.length; i < len; i++) {\n        var key = keysArr[i];\n        if ((overlay ? source[key] != null : target[key] == null)) {\n            target[key] = source[key];\n        }\n    }\n    return target;\n}\nexport var createCanvas = platformApi.createCanvas;\nexport function indexOf(array, value) {\n    if (array) {\n        if (array.indexOf) {\n            return array.indexOf(value);\n        }\n        for (var i = 0, len = array.length; i < len; i++) {\n            if (array[i] === value) {\n                return i;\n            }\n        }\n    }\n    return -1;\n}\nexport function inherits(clazz, baseClazz) {\n    var clazzPrototype = clazz.prototype;\n    function F() { }\n    F.prototype = baseClazz.prototype;\n    clazz.prototype = new F();\n    for (var prop in clazzPrototype) {\n        if (clazzPrototype.hasOwnProperty(prop)) {\n            clazz.prototype[prop] = clazzPrototype[prop];\n        }\n    }\n    clazz.prototype.constructor = clazz;\n    clazz.superClass = baseClazz;\n}\nexport function mixin(target, source, override) {\n    target = 'prototype' in target ? target.prototype : target;\n    source = 'prototype' in source ? source.prototype : source;\n    if (Object.getOwnPropertyNames) {\n        var keyList = Object.getOwnPropertyNames(source);\n        for (var i = 0; i < keyList.length; i++) {\n            var key = keyList[i];\n            if (key !== 'constructor') {\n                if ((override ? source[key] != null : target[key] == null)) {\n                    target[key] = source[key];\n                }\n            }\n        }\n    }\n    else {\n        defaults(target, source, override);\n    }\n}\nexport function isArrayLike(data) {\n    if (!data) {\n        return false;\n    }\n    if (typeof data === 'string') {\n        return false;\n    }\n    return typeof data.length === 'number';\n}\nexport function each(arr, cb, context) {\n    if (!(arr && cb)) {\n        return;\n    }\n    if (arr.forEach && arr.forEach === nativeForEach) {\n        arr.forEach(cb, context);\n    }\n    else if (arr.length === +arr.length) {\n        for (var i = 0, len = arr.length; i < len; i++) {\n            cb.call(context, arr[i], i, arr);\n        }\n    }\n    else {\n        for (var key in arr) {\n            if (arr.hasOwnProperty(key)) {\n                cb.call(context, arr[key], key, arr);\n            }\n        }\n    }\n}\nexport function map(arr, cb, context) {\n    if (!arr) {\n        return [];\n    }\n    if (!cb) {\n        return slice(arr);\n    }\n    if (arr.map && arr.map === nativeMap) {\n        return arr.map(cb, context);\n    }\n    else {\n        var result = [];\n        for (var i = 0, len = arr.length; i < len; i++) {\n            result.push(cb.call(context, arr[i], i, arr));\n        }\n        return result;\n    }\n}\nexport function reduce(arr, cb, memo, context) {\n    if (!(arr && cb)) {\n        return;\n    }\n    for (var i = 0, len = arr.length; i < len; i++) {\n        memo = cb.call(context, memo, arr[i], i, arr);\n    }\n    return memo;\n}\nexport function filter(arr, cb, context) {\n    if (!arr) {\n        return [];\n    }\n    if (!cb) {\n        return slice(arr);\n    }\n    if (arr.filter && arr.filter === nativeFilter) {\n        return arr.filter(cb, context);\n    }\n    else {\n        var result = [];\n        for (var i = 0, len = arr.length; i < len; i++) {\n            if (cb.call(context, arr[i], i, arr)) {\n                result.push(arr[i]);\n            }\n        }\n        return result;\n    }\n}\nexport function find(arr, cb, context) {\n    if (!(arr && cb)) {\n        return;\n    }\n    for (var i = 0, len = arr.length; i < len; i++) {\n        if (cb.call(context, arr[i], i, arr)) {\n            return arr[i];\n        }\n    }\n}\nexport function keys(obj) {\n    if (!obj) {\n        return [];\n    }\n    if (Object.keys) {\n        return Object.keys(obj);\n    }\n    var keyList = [];\n    for (var key in obj) {\n        if (obj.hasOwnProperty(key)) {\n            keyList.push(key);\n        }\n    }\n    return keyList;\n}\nfunction bindPolyfill(func, context) {\n    var args = [];\n    for (var _i = 2; _i < arguments.length; _i++) {\n        args[_i - 2] = arguments[_i];\n    }\n    return function () {\n        return func.apply(context, args.concat(nativeSlice.call(arguments)));\n    };\n}\nexport var bind = (protoFunction && isFunction(protoFunction.bind))\n    ? protoFunction.call.bind(protoFunction.bind)\n    : bindPolyfill;\nfunction curry(func) {\n    var args = [];\n    for (var _i = 1; _i < arguments.length; _i++) {\n        args[_i - 1] = arguments[_i];\n    }\n    return function () {\n        return func.apply(this, args.concat(nativeSlice.call(arguments)));\n    };\n}\nexport { curry };\nexport function isArray(value) {\n    if (Array.isArray) {\n        return Array.isArray(value);\n    }\n    return objToString.call(value) === '[object Array]';\n}\nexport function isFunction(value) {\n    return typeof value === 'function';\n}\nexport function isString(value) {\n    return typeof value === 'string';\n}\nexport function isStringSafe(value) {\n    return objToString.call(value) === '[object String]';\n}\nexport function isNumber(value) {\n    return typeof value === 'number';\n}\nexport function isObject(value) {\n    var type = typeof value;\n    return type === 'function' || (!!value && type === 'object');\n}\nexport function isBuiltInObject(value) {\n    return !!BUILTIN_OBJECT[objToString.call(value)];\n}\nexport function isTypedArray(value) {\n    return !!TYPED_ARRAY[objToString.call(value)];\n}\nexport function isDom(value) {\n    return typeof value === 'object'\n        && typeof value.nodeType === 'number'\n        && typeof value.ownerDocument === 'object';\n}\nexport function isGradientObject(value) {\n    return value.colorStops != null;\n}\nexport function isImagePatternObject(value) {\n    return value.image != null;\n}\nexport function isRegExp(value) {\n    return objToString.call(value) === '[object RegExp]';\n}\nexport function eqNaN(value) {\n    return value !== value;\n}\nexport function retrieve() {\n    var args = [];\n    for (var _i = 0; _i < arguments.length; _i++) {\n        args[_i] = arguments[_i];\n    }\n    for (var i = 0, len = args.length; i < len; i++) {\n        if (args[i] != null) {\n            return args[i];\n        }\n    }\n}\nexport function retrieve2(value0, value1) {\n    return value0 != null\n        ? value0\n        : value1;\n}\nexport function retrieve3(value0, value1, value2) {\n    return value0 != null\n        ? value0\n        : value1 != null\n            ? value1\n            : value2;\n}\nexport function slice(arr) {\n    var args = [];\n    for (var _i = 1; _i < arguments.length; _i++) {\n        args[_i - 1] = arguments[_i];\n    }\n    return nativeSlice.apply(arr, args);\n}\nexport function normalizeCssArray(val) {\n    if (typeof (val) === 'number') {\n        return [val, val, val, val];\n    }\n    var len = val.length;\n    if (len === 2) {\n        return [val[0], val[1], val[0], val[1]];\n    }\n    else if (len === 3) {\n        return [val[0], val[1], val[2], val[1]];\n    }\n    return val;\n}\nexport function assert(condition, message) {\n    if (!condition) {\n        throw new Error(message);\n    }\n}\nexport function trim(str) {\n    if (str == null) {\n        return null;\n    }\n    else if (typeof str.trim === 'function') {\n        return str.trim();\n    }\n    else {\n        return str.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '');\n    }\n}\nvar primitiveKey = '__ec_primitive__';\nexport function setAsPrimitive(obj) {\n    obj[primitiveKey] = true;\n}\nexport function isPrimitive(obj) {\n    return obj[primitiveKey];\n}\nvar MapPolyfill = (function () {\n    function MapPolyfill() {\n        this.data = {};\n    }\n    MapPolyfill.prototype[\"delete\"] = function (key) {\n        var existed = this.has(key);\n        if (existed) {\n            delete this.data[key];\n        }\n        return existed;\n    };\n    MapPolyfill.prototype.has = function (key) {\n        return this.data.hasOwnProperty(key);\n    };\n    MapPolyfill.prototype.get = function (key) {\n        return this.data[key];\n    };\n    MapPolyfill.prototype.set = function (key, value) {\n        this.data[key] = value;\n        return this;\n    };\n    MapPolyfill.prototype.keys = function () {\n        return keys(this.data);\n    };\n    MapPolyfill.prototype.forEach = function (callback) {\n        var data = this.data;\n        for (var key in data) {\n            if (data.hasOwnProperty(key)) {\n                callback(data[key], key);\n            }\n        }\n    };\n    return MapPolyfill;\n}());\nvar isNativeMapSupported = typeof Map === 'function';\nfunction maybeNativeMap() {\n    return (isNativeMapSupported ? new Map() : new MapPolyfill());\n}\nvar HashMap = (function () {\n    function HashMap(obj) {\n        var isArr = isArray(obj);\n        this.data = maybeNativeMap();\n        var thisMap = this;\n        (obj instanceof HashMap)\n            ? obj.each(visit)\n            : (obj && each(obj, visit));\n        function visit(value, key) {\n            isArr ? thisMap.set(value, key) : thisMap.set(key, value);\n        }\n    }\n    HashMap.prototype.hasKey = function (key) {\n        return this.data.has(key);\n    };\n    HashMap.prototype.get = function (key) {\n        return this.data.get(key);\n    };\n    HashMap.prototype.set = function (key, value) {\n        this.data.set(key, value);\n        return value;\n    };\n    HashMap.prototype.each = function (cb, context) {\n        this.data.forEach(function (value, key) {\n            cb.call(context, value, key);\n        });\n    };\n    HashMap.prototype.keys = function () {\n        var keys = this.data.keys();\n        return isNativeMapSupported\n            ? Array.from(keys)\n            : keys;\n    };\n    HashMap.prototype.removeKey = function (key) {\n        this.data[\"delete\"](key);\n    };\n    return HashMap;\n}());\nexport { HashMap };\nexport function createHashMap(obj) {\n    return new HashMap(obj);\n}\nexport function concatArray(a, b) {\n    var newArray = new a.constructor(a.length + b.length);\n    for (var i = 0; i < a.length; i++) {\n        newArray[i] = a[i];\n    }\n    var offset = a.length;\n    for (var i = 0; i < b.length; i++) {\n        newArray[i + offset] = b[i];\n    }\n    return newArray;\n}\nexport function createObject(proto, properties) {\n    var obj;\n    if (Object.create) {\n        obj = Object.create(proto);\n    }\n    else {\n        var StyleCtor = function () { };\n        StyleCtor.prototype = proto;\n        obj = new StyleCtor();\n    }\n    if (properties) {\n        extend(obj, properties);\n    }\n    return obj;\n}\nexport function disableUserSelect(dom) {\n    var domStyle = dom.style;\n    domStyle.webkitUserSelect = 'none';\n    domStyle.userSelect = 'none';\n    domStyle.webkitTapHighlightColor = 'rgba(0,0,0,0)';\n    domStyle['-webkit-touch-callout'] = 'none';\n}\nexport function hasOwn(own, prop) {\n    return own.hasOwnProperty(prop);\n}\nexport function noop() { }\nexport var RADIAN_TO_DEGREE = 180 / Math.PI;\nexport var EPSILON = Number.EPSILON || Math.pow(2, -52);\n", "export var DEFAULT_FONT_SIZE = 12;\nexport var DEFAULT_FONT_FAMILY = 'sans-serif';\nexport var DEFAULT_FONT = DEFAULT_FONT_SIZE + \"px \" + DEFAULT_FONT_FAMILY;\nvar OFFSET = 20;\nvar SCALE = 100;\nvar defaultWidthMapStr = \"007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\\\\\WQb\\\\0FWLg\\\\bWb\\\\WQ\\\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\\\FFF5.5N\";\nfunction getTextWidthMap(mapStr) {\n    var map = {};\n    if (typeof JSON === 'undefined') {\n        return map;\n    }\n    for (var i = 0; i < mapStr.length; i++) {\n        var char = String.fromCharCode(i + 32);\n        var size = (mapStr.charCodeAt(i) - OFFSET) / SCALE;\n        map[char] = size;\n    }\n    return map;\n}\nexport var DEFAULT_TEXT_WIDTH_MAP = getTextWidthMap(defaultWidthMapStr);\nexport var platformApi = {\n    createCanvas: function () {\n        return typeof document !== 'undefined'\n            && document.createElement('canvas');\n    },\n    measureText: (function () {\n        var _ctx;\n        var _cachedFont;\n        return function (text, font) {\n            if (!_ctx) {\n                var canvas = platformApi.createCanvas();\n                _ctx = canvas && canvas.getContext('2d');\n            }\n            if (_ctx) {\n                if (_cachedFont !== font) {\n                    _cachedFont = _ctx.font = font || DEFAULT_FONT;\n                }\n                return _ctx.measureText(text);\n            }\n            else {\n                text = text || '';\n                font = font || DEFAULT_FONT;\n                var res = /((?:\\d+)?\\.?\\d*)px/.exec(font);\n                var fontSize = res && +res[1] || DEFAULT_FONT_SIZE;\n                var width = 0;\n                if (font.indexOf('mono') >= 0) {\n                    width = fontSize * text.length;\n                }\n                else {\n                    for (var i = 0; i < text.length; i++) {\n                        var preCalcWidth = DEFAULT_TEXT_WIDTH_MAP[text[i]];\n                        width += preCalcWidth == null ? fontSize : (preCalcWidth * fontSize);\n                    }\n                }\n                return { width: width };\n            }\n        };\n    })(),\n    loadImage: function (src, onload, onerror) {\n        var image = new Image();\n        image.onload = onload;\n        image.onerror = onerror;\n        image.src = src;\n        return image;\n    }\n};\nexport function setPlatformAPI(newPlatformApis) {\n    for (var key in platformApi) {\n        if (newPlatformApis[key]) {\n            platformApi[key] = newPlatformApis[key];\n        }\n    }\n}\n", "export function create(x, y) {\n    if (x == null) {\n        x = 0;\n    }\n    if (y == null) {\n        y = 0;\n    }\n    return [x, y];\n}\nexport function copy(out, v) {\n    out[0] = v[0];\n    out[1] = v[1];\n    return out;\n}\nexport function clone(v) {\n    return [v[0], v[1]];\n}\nexport function set(out, a, b) {\n    out[0] = a;\n    out[1] = b;\n    return out;\n}\nexport function add(out, v1, v2) {\n    out[0] = v1[0] + v2[0];\n    out[1] = v1[1] + v2[1];\n    return out;\n}\nexport function scaleAndAdd(out, v1, v2, a) {\n    out[0] = v1[0] + v2[0] * a;\n    out[1] = v1[1] + v2[1] * a;\n    return out;\n}\nexport function sub(out, v1, v2) {\n    out[0] = v1[0] - v2[0];\n    out[1] = v1[1] - v2[1];\n    return out;\n}\nexport function len(v) {\n    return Math.sqrt(lenSquare(v));\n}\nexport var length = len;\nexport function lenSquare(v) {\n    return v[0] * v[0] + v[1] * v[1];\n}\nexport var lengthSquare = lenSquare;\nexport function mul(out, v1, v2) {\n    out[0] = v1[0] * v2[0];\n    out[1] = v1[1] * v2[1];\n    return out;\n}\nexport function div(out, v1, v2) {\n    out[0] = v1[0] / v2[0];\n    out[1] = v1[1] / v2[1];\n    return out;\n}\nexport function dot(v1, v2) {\n    return v1[0] * v2[0] + v1[1] * v2[1];\n}\nexport function scale(out, v, s) {\n    out[0] = v[0] * s;\n    out[1] = v[1] * s;\n    return out;\n}\nexport function normalize(out, v) {\n    var d = len(v);\n    if (d === 0) {\n        out[0] = 0;\n        out[1] = 0;\n    }\n    else {\n        out[0] = v[0] / d;\n        out[1] = v[1] / d;\n    }\n    return out;\n}\nexport function distance(v1, v2) {\n    return Math.sqrt((v1[0] - v2[0]) * (v1[0] - v2[0])\n        + (v1[1] - v2[1]) * (v1[1] - v2[1]));\n}\nexport var dist = distance;\nexport function distanceSquare(v1, v2) {\n    return (v1[0] - v2[0]) * (v1[0] - v2[0])\n        + (v1[1] - v2[1]) * (v1[1] - v2[1]);\n}\nexport var distSquare = distanceSquare;\nexport function negate(out, v) {\n    out[0] = -v[0];\n    out[1] = -v[1];\n    return out;\n}\nexport function lerp(out, v1, v2, t) {\n    out[0] = v1[0] + t * (v2[0] - v1[0]);\n    out[1] = v1[1] + t * (v2[1] - v1[1]);\n    return out;\n}\nexport function applyTransform(out, v, m) {\n    var x = v[0];\n    var y = v[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}\nexport function min(out, v1, v2) {\n    out[0] = Math.min(v1[0], v2[0]);\n    out[1] = Math.min(v1[1], v2[1]);\n    return out;\n}\nexport function max(out, v1, v2) {\n    out[0] = Math.max(v1[0], v2[0]);\n    out[1] = Math.max(v1[1], v2[1]);\n    return out;\n}\n", "var Param = (function () {\n    function Param(target, e) {\n        this.target = target;\n        this.topTarget = e && e.topTarget;\n    }\n    return Param;\n}());\nvar Draggable = (function () {\n    function Draggable(handler) {\n        this.handler = handler;\n        handler.on('mousedown', this._dragStart, this);\n        handler.on('mousemove', this._drag, this);\n        handler.on('mouseup', this._dragEnd, this);\n    }\n    Draggable.prototype._dragStart = function (e) {\n        var draggingTarget = e.target;\n        while (draggingTarget && !draggingTarget.draggable) {\n            draggingTarget = draggingTarget.parent || draggingTarget.__hostTarget;\n        }\n        if (draggingTarget) {\n            this._draggingTarget = draggingTarget;\n            draggingTarget.dragging = true;\n            this._x = e.offsetX;\n            this._y = e.offsetY;\n            this.handler.dispatchToElement(new Param(draggingTarget, e), 'dragstart', e.event);\n        }\n    };\n    Draggable.prototype._drag = function (e) {\n        var draggingTarget = this._draggingTarget;\n        if (draggingTarget) {\n            var x = e.offsetX;\n            var y = e.offsetY;\n            var dx = x - this._x;\n            var dy = y - this._y;\n            this._x = x;\n            this._y = y;\n            draggingTarget.drift(dx, dy, e);\n            this.handler.dispatchToElement(new Param(draggingTarget, e), 'drag', e.event);\n            var dropTarget = this.handler.findHover(x, y, draggingTarget).target;\n            var lastDropTarget = this._dropTarget;\n            this._dropTarget = dropTarget;\n            if (draggingTarget !== dropTarget) {\n                if (lastDropTarget && dropTarget !== lastDropTarget) {\n                    this.handler.dispatchToElement(new Param(lastDropTarget, e), 'dragleave', e.event);\n                }\n                if (dropTarget && dropTarget !== lastDropTarget) {\n                    this.handler.dispatchToElement(new Param(dropTarget, e), 'dragenter', e.event);\n                }\n            }\n        }\n    };\n    Draggable.prototype._dragEnd = function (e) {\n        var draggingTarget = this._draggingTarget;\n        if (draggingTarget) {\n            draggingTarget.dragging = false;\n        }\n        this.handler.dispatchToElement(new Param(draggingTarget, e), 'dragend', e.event);\n        if (this._dropTarget) {\n            this.handler.dispatchToElement(new Param(this._dropTarget, e), 'drop', e.event);\n        }\n        this._draggingTarget = null;\n        this._dropTarget = null;\n    };\n    return Draggable;\n}());\nexport default Draggable;\n", "var Eventful = (function () {\n    function Eventful(eventProcessors) {\n        if (eventProcessors) {\n            this._$eventProcessor = eventProcessors;\n        }\n    }\n    Eventful.prototype.on = function (event, query, handler, context) {\n        if (!this._$handlers) {\n            this._$handlers = {};\n        }\n        var _h = this._$handlers;\n        if (typeof query === 'function') {\n            context = handler;\n            handler = query;\n            query = null;\n        }\n        if (!handler || !event) {\n            return this;\n        }\n        var eventProcessor = this._$eventProcessor;\n        if (query != null && eventProcessor && eventProcessor.normalizeQuery) {\n            query = eventProcessor.normalizeQuery(query);\n        }\n        if (!_h[event]) {\n            _h[event] = [];\n        }\n        for (var i = 0; i < _h[event].length; i++) {\n            if (_h[event][i].h === handler) {\n                return this;\n            }\n        }\n        var wrap = {\n            h: handler,\n            query: query,\n            ctx: (context || this),\n            callAtLast: handler.zrEventfulCallAtLast\n        };\n        var lastIndex = _h[event].length - 1;\n        var lastWrap = _h[event][lastIndex];\n        (lastWrap && lastWrap.callAtLast)\n            ? _h[event].splice(lastIndex, 0, wrap)\n            : _h[event].push(wrap);\n        return this;\n    };\n    Eventful.prototype.isSilent = function (eventName) {\n        var _h = this._$handlers;\n        return !_h || !_h[eventName] || !_h[eventName].length;\n    };\n    Eventful.prototype.off = function (eventType, handler) {\n        var _h = this._$handlers;\n        if (!_h) {\n            return this;\n        }\n        if (!eventType) {\n            this._$handlers = {};\n            return this;\n        }\n        if (handler) {\n            if (_h[eventType]) {\n                var newList = [];\n                for (var i = 0, l = _h[eventType].length; i < l; i++) {\n                    if (_h[eventType][i].h !== handler) {\n                        newList.push(_h[eventType][i]);\n                    }\n                }\n                _h[eventType] = newList;\n            }\n            if (_h[eventType] && _h[eventType].length === 0) {\n                delete _h[eventType];\n            }\n        }\n        else {\n            delete _h[eventType];\n        }\n        return this;\n    };\n    Eventful.prototype.trigger = function (eventType) {\n        var args = [];\n        for (var _i = 1; _i < arguments.length; _i++) {\n            args[_i - 1] = arguments[_i];\n        }\n        if (!this._$handlers) {\n            return this;\n        }\n        var _h = this._$handlers[eventType];\n        var eventProcessor = this._$eventProcessor;\n        if (_h) {\n            var argLen = args.length;\n            var len = _h.length;\n            for (var i = 0; i < len; i++) {\n                var hItem = _h[i];\n                if (eventProcessor\n                    && eventProcessor.filter\n                    && hItem.query != null\n                    && !eventProcessor.filter(eventType, hItem.query)) {\n                    continue;\n                }\n                switch (argLen) {\n                    case 0:\n                        hItem.h.call(hItem.ctx);\n                        break;\n                    case 1:\n                        hItem.h.call(hItem.ctx, args[0]);\n                        break;\n                    case 2:\n                        hItem.h.call(hItem.ctx, args[0], args[1]);\n                        break;\n                    default:\n                        hItem.h.apply(hItem.ctx, args);\n                        break;\n                }\n            }\n        }\n        eventProcessor && eventProcessor.afterTrigger\n            && eventProcessor.afterTrigger(eventType);\n        return this;\n    };\n    Eventful.prototype.triggerWithContext = function (type) {\n        var args = [];\n        for (var _i = 1; _i < arguments.length; _i++) {\n            args[_i - 1] = arguments[_i];\n        }\n        if (!this._$handlers) {\n            return this;\n        }\n        var _h = this._$handlers[type];\n        var eventProcessor = this._$eventProcessor;\n        if (_h) {\n            var argLen = args.length;\n            var ctx = args[argLen - 1];\n            var len = _h.length;\n            for (var i = 0; i < len; i++) {\n                var hItem = _h[i];\n                if (eventProcessor\n                    && eventProcessor.filter\n                    && hItem.query != null\n                    && !eventProcessor.filter(type, hItem.query)) {\n                    continue;\n                }\n                switch (argLen) {\n                    case 0:\n                        hItem.h.call(ctx);\n                        break;\n                    case 1:\n                        hItem.h.call(ctx, args[0]);\n                        break;\n                    case 2:\n                        hItem.h.call(ctx, args[0], args[1]);\n                        break;\n                    default:\n                        hItem.h.apply(ctx, args.slice(1, argLen - 1));\n                        break;\n                }\n            }\n        }\n        eventProcessor && eventProcessor.afterTrigger\n            && eventProcessor.afterTrigger(type);\n        return this;\n    };\n    return Eventful;\n}());\nexport default Eventful;\n", "var LN2 = Math.log(2);\nfunction determinant(rows, rank, rowStart, rowMask, colMask, detCache) {\n    var cacheKey = rowMask + '-' + colMask;\n    var fullRank = rows.length;\n    if (detCache.hasOwnProperty(cacheKey)) {\n        return detCache[cacheKey];\n    }\n    if (rank === 1) {\n        var colStart = Math.round(Math.log(((1 << fullRank) - 1) & ~colMask) / LN2);\n        return rows[rowStart][colStart];\n    }\n    var subRowMask = rowMask | (1 << rowStart);\n    var subRowStart = rowStart + 1;\n    while (rowMask & (1 << subRowStart)) {\n        subRowStart++;\n    }\n    var sum = 0;\n    for (var j = 0, colLocalIdx = 0; j < fullRank; j++) {\n        var colTag = 1 << j;\n        if (!(colTag & colMask)) {\n            sum += (colLocalIdx % 2 ? -1 : 1) * rows[rowStart][j]\n                * determinant(rows, rank - 1, subRowStart, subRowMask, colMask | colTag, detCache);\n            colLocalIdx++;\n        }\n    }\n    detCache[cacheKey] = sum;\n    return sum;\n}\nexport function buildTransformer(src, dest) {\n    var mA = [\n        [src[0], src[1], 1, 0, 0, 0, -dest[0] * src[0], -dest[0] * src[1]],\n        [0, 0, 0, src[0], src[1], 1, -dest[1] * src[0], -dest[1] * src[1]],\n        [src[2], src[3], 1, 0, 0, 0, -dest[2] * src[2], -dest[2] * src[3]],\n        [0, 0, 0, src[2], src[3], 1, -dest[3] * src[2], -dest[3] * src[3]],\n        [src[4], src[5], 1, 0, 0, 0, -dest[4] * src[4], -dest[4] * src[5]],\n        [0, 0, 0, src[4], src[5], 1, -dest[5] * src[4], -dest[5] * src[5]],\n        [src[6], src[7], 1, 0, 0, 0, -dest[6] * src[6], -dest[6] * src[7]],\n        [0, 0, 0, src[6], src[7], 1, -dest[7] * src[6], -dest[7] * src[7]]\n    ];\n    var detCache = {};\n    var det = determinant(mA, 8, 0, 0, 0, detCache);\n    if (det === 0) {\n        return;\n    }\n    var vh = [];\n    for (var i = 0; i < 8; i++) {\n        for (var j = 0; j < 8; j++) {\n            vh[j] == null && (vh[j] = 0);\n            vh[j] += ((i + j) % 2 ? -1 : 1)\n                * determinant(mA, 7, i === 0 ? 1 : 0, 1 << i, 1 << j, detCache)\n                / det * dest[i];\n        }\n    }\n    return function (out, srcPointX, srcPointY) {\n        var pk = srcPointX * vh[6] + srcPointY * vh[7] + 1;\n        out[0] = (srcPointX * vh[0] + srcPointY * vh[1] + vh[2]) / pk;\n        out[1] = (srcPointX * vh[3] + srcPointY * vh[4] + vh[5]) / pk;\n    };\n}\n", "import env from './env.js';\nimport { buildTransformer } from './fourPointsTransform.js';\nimport { each } from './util.js';\nvar EVENT_SAVED_PROP = '___zrEVENTSAVED';\nvar _calcOut = [];\nexport function transformLocalCoord(out, elFrom, elTarget, inX, inY) {\n    return transformCoordWithViewport(_calcOut, elFrom, inX, inY, true)\n        && transformCoordWithViewport(out, elTarget, _calcOut[0], _calcOut[1]);\n}\nexport function transformLocalCoordClear(elFrom, elTarget) {\n    elFrom && dealClear(elFrom);\n    elTarget && dealClear(elTarget);\n    function dealClear(el) {\n        var saved = el[EVENT_SAVED_PROP];\n        if (saved) {\n            saved.clearMarkers && saved.clearMarkers();\n            delete el[EVENT_SAVED_PROP];\n        }\n    }\n}\nexport function transformCoordWithViewport(out, el, inX, inY, inverse) {\n    if (el.getBoundingClientRect && env.domSupported && !isCanvasEl(el)) {\n        var saved = el[EVENT_SAVED_PROP] || (el[EVENT_SAVED_PROP] = {});\n        var markers = prepareCoordMarkers(el, saved);\n        var transformer = preparePointerTransformer(markers, saved, inverse);\n        if (transformer) {\n            transformer(out, inX, inY);\n            return true;\n        }\n    }\n    return false;\n}\nfunction prepareCoordMarkers(el, saved) {\n    var markers = saved.markers;\n    if (markers) {\n        return markers;\n    }\n    markers = saved.markers = [];\n    var propLR = ['left', 'right'];\n    var propTB = ['top', 'bottom'];\n    for (var i = 0; i < 4; i++) {\n        var marker = document.createElement('div');\n        var stl = marker.style;\n        var idxLR = i % 2;\n        var idxTB = (i >> 1) % 2;\n        stl.cssText = [\n            'position: absolute',\n            'visibility: hidden',\n            'padding: 0',\n            'margin: 0',\n            'border-width: 0',\n            'user-select: none',\n            'width:0',\n            'height:0',\n            propLR[idxLR] + ':0',\n            propTB[idxTB] + ':0',\n            propLR[1 - idxLR] + ':auto',\n            propTB[1 - idxTB] + ':auto',\n            ''\n        ].join('!important;');\n        el.appendChild(marker);\n        markers.push(marker);\n    }\n    saved.clearMarkers = function () {\n        each(markers, function (marker) {\n            marker.parentNode && marker.parentNode.removeChild(marker);\n        });\n    };\n    return markers;\n}\nfunction preparePointerTransformer(markers, saved, inverse) {\n    var transformerName = inverse ? 'invTrans' : 'trans';\n    var transformer = saved[transformerName];\n    var oldSrcCoords = saved.srcCoords;\n    var srcCoords = [];\n    var destCoords = [];\n    var oldCoordTheSame = true;\n    for (var i = 0; i < 4; i++) {\n        var rect = markers[i].getBoundingClientRect();\n        var ii = 2 * i;\n        var x = rect.left;\n        var y = rect.top;\n        srcCoords.push(x, y);\n        oldCoordTheSame = oldCoordTheSame && oldSrcCoords && x === oldSrcCoords[ii] && y === oldSrcCoords[ii + 1];\n        destCoords.push(markers[i].offsetLeft, markers[i].offsetTop);\n    }\n    return (oldCoordTheSame && transformer)\n        ? transformer\n        : (saved.srcCoords = srcCoords,\n            saved[transformerName] = inverse\n                ? buildTransformer(destCoords, srcCoords)\n                : buildTransformer(srcCoords, destCoords));\n}\nexport function isCanvasEl(el) {\n    return el.nodeName.toUpperCase() === 'CANVAS';\n}\nvar replaceReg = /([&<>\"'])/g;\nvar replaceMap = {\n    '&': '&amp;',\n    '<': '&lt;',\n    '>': '&gt;',\n    '\"': '&quot;',\n    '\\'': '&#39;'\n};\nexport function encodeHTML(source) {\n    return source == null\n        ? ''\n        : (source + '').replace(replaceReg, function (str, c) {\n            return replaceMap[c];\n        });\n}\n", "import Eventful from './Eventful.js';\nimport env from './env.js';\nimport { isCanvasEl, transformCoordWithViewport } from './dom.js';\nvar MOUSE_EVENT_REG = /^(?:mouse|pointer|contextmenu|drag|drop)|click/;\nvar _calcOut = [];\nvar firefoxNotSupportOffsetXY = env.browser.firefox\n    && +env.browser.version.split('.')[0] < 39;\nexport function clientToLocal(el, e, out, calculate) {\n    out = out || {};\n    if (calculate) {\n        calculateZrXY(el, e, out);\n    }\n    else if (firefoxNotSupportOffsetXY\n        && e.layerX != null\n        && e.layerX !== e.offsetX) {\n        out.zrX = e.layerX;\n        out.zrY = e.layerY;\n    }\n    else if (e.offsetX != null) {\n        out.zrX = e.offsetX;\n        out.zrY = e.offsetY;\n    }\n    else {\n        calculateZrXY(el, e, out);\n    }\n    return out;\n}\nfunction calculateZrXY(el, e, out) {\n    if (env.domSupported && el.getBoundingClientRect) {\n        var ex = e.clientX;\n        var ey = e.clientY;\n        if (isCanvasEl(el)) {\n            var box = el.getBoundingClientRect();\n            out.zrX = ex - box.left;\n            out.zrY = ey - box.top;\n            return;\n        }\n        else {\n            if (transformCoordWithViewport(_calcOut, el, ex, ey)) {\n                out.zrX = _calcOut[0];\n                out.zrY = _calcOut[1];\n                return;\n            }\n        }\n    }\n    out.zrX = out.zrY = 0;\n}\nexport function getNativeEvent(e) {\n    return e\n        || window.event;\n}\nexport function normalizeEvent(el, e, calculate) {\n    e = getNativeEvent(e);\n    if (e.zrX != null) {\n        return e;\n    }\n    var eventType = e.type;\n    var isTouch = eventType && eventType.indexOf('touch') >= 0;\n    if (!isTouch) {\n        clientToLocal(el, e, e, calculate);\n        var wheelDelta = getWheelDeltaMayPolyfill(e);\n        e.zrDelta = wheelDelta ? wheelDelta / 120 : -(e.detail || 0) / 3;\n    }\n    else {\n        var touch = eventType !== 'touchend'\n            ? e.targetTouches[0]\n            : e.changedTouches[0];\n        touch && clientToLocal(el, touch, e, calculate);\n    }\n    var button = e.button;\n    if (e.which == null && button !== undefined && MOUSE_EVENT_REG.test(e.type)) {\n        e.which = (button & 1 ? 1 : (button & 2 ? 3 : (button & 4 ? 2 : 0)));\n    }\n    return e;\n}\nfunction getWheelDeltaMayPolyfill(e) {\n    var rawWheelDelta = e.wheelDelta;\n    if (rawWheelDelta) {\n        return rawWheelDelta;\n    }\n    var deltaX = e.deltaX;\n    var deltaY = e.deltaY;\n    if (deltaX == null || deltaY == null) {\n        return rawWheelDelta;\n    }\n    var delta = deltaY !== 0 ? Math.abs(deltaY) : Math.abs(deltaX);\n    var sign = deltaY > 0 ? -1\n        : deltaY < 0 ? 1\n            : deltaX > 0 ? -1\n                : 1;\n    return 3 * delta * sign;\n}\nexport function addEventListener(el, name, handler, opt) {\n    el.addEventListener(name, handler, opt);\n}\nexport function removeEventListener(el, name, handler, opt) {\n    el.removeEventListener(name, handler, opt);\n}\nexport var stop = function (e) {\n    e.preventDefault();\n    e.stopPropagation();\n    e.cancelBubble = true;\n};\nexport function isMiddleOrRightButtonOnMouseUpDown(e) {\n    return e.which === 2 || e.which === 3;\n}\nexport { Eventful as Dispatcher };\n", "import * as eventUtil from './event.js';\nvar GestureMgr = (function () {\n    function GestureMgr() {\n        this._track = [];\n    }\n    GestureMgr.prototype.recognize = function (event, target, root) {\n        this._doTrack(event, target, root);\n        return this._recognize(event);\n    };\n    GestureMgr.prototype.clear = function () {\n        this._track.length = 0;\n        return this;\n    };\n    GestureMgr.prototype._doTrack = function (event, target, root) {\n        var touches = event.touches;\n        if (!touches) {\n            return;\n        }\n        var trackItem = {\n            points: [],\n            touches: [],\n            target: target,\n            event: event\n        };\n        for (var i = 0, len = touches.length; i < len; i++) {\n            var touch = touches[i];\n            var pos = eventUtil.clientToLocal(root, touch, {});\n            trackItem.points.push([pos.zrX, pos.zrY]);\n            trackItem.touches.push(touch);\n        }\n        this._track.push(trackItem);\n    };\n    GestureMgr.prototype._recognize = function (event) {\n        for (var eventName in recognizers) {\n            if (recognizers.hasOwnProperty(eventName)) {\n                var gestureInfo = recognizers[eventName](this._track, event);\n                if (gestureInfo) {\n                    return gestureInfo;\n                }\n            }\n        }\n    };\n    return GestureMgr;\n}());\nexport { GestureMgr };\nfunction dist(pointPair) {\n    var dx = pointPair[1][0] - pointPair[0][0];\n    var dy = pointPair[1][1] - pointPair[0][1];\n    return Math.sqrt(dx * dx + dy * dy);\n}\nfunction center(pointPair) {\n    return [\n        (pointPair[0][0] + pointPair[1][0]) / 2,\n        (pointPair[0][1] + pointPair[1][1]) / 2\n    ];\n}\nvar recognizers = {\n    pinch: function (tracks, event) {\n        var trackLen = tracks.length;\n        if (!trackLen) {\n            return;\n        }\n        var pinchEnd = (tracks[trackLen - 1] || {}).points;\n        var pinchPre = (tracks[trackLen - 2] || {}).points || pinchEnd;\n        if (pinchPre\n            && pinchPre.length > 1\n            && pinchEnd\n            && pinchEnd.length > 1) {\n            var pinchScale = dist(pinchEnd) / dist(pinchPre);\n            !isFinite(pinchScale) && (pinchScale = 1);\n            event.pinchScale = pinchScale;\n            var pinchCenter = center(pinchEnd);\n            event.pinchX = pinchCenter[0];\n            event.pinchY = pinchCenter[1];\n            return {\n                type: 'pinch',\n                target: tracks[0].target,\n                event: event\n            };\n        }\n    }\n};\n", "export function create() {\n    return [1, 0, 0, 1, 0, 0];\n}\nexport function identity(out) {\n    out[0] = 1;\n    out[1] = 0;\n    out[2] = 0;\n    out[3] = 1;\n    out[4] = 0;\n    out[5] = 0;\n    return out;\n}\nexport function copy(out, m) {\n    out[0] = m[0];\n    out[1] = m[1];\n    out[2] = m[2];\n    out[3] = m[3];\n    out[4] = m[4];\n    out[5] = m[5];\n    return out;\n}\nexport function mul(out, m1, m2) {\n    var out0 = m1[0] * m2[0] + m1[2] * m2[1];\n    var out1 = m1[1] * m2[0] + m1[3] * m2[1];\n    var out2 = m1[0] * m2[2] + m1[2] * m2[3];\n    var out3 = m1[1] * m2[2] + m1[3] * m2[3];\n    var out4 = m1[0] * m2[4] + m1[2] * m2[5] + m1[4];\n    var out5 = m1[1] * m2[4] + m1[3] * m2[5] + m1[5];\n    out[0] = out0;\n    out[1] = out1;\n    out[2] = out2;\n    out[3] = out3;\n    out[4] = out4;\n    out[5] = out5;\n    return out;\n}\nexport function translate(out, a, v) {\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] + v[0];\n    out[5] = a[5] + v[1];\n    return out;\n}\nexport function rotate(out, a, rad, pivot) {\n    if (pivot === void 0) { pivot = [0, 0]; }\n    var aa = a[0];\n    var ac = a[2];\n    var atx = a[4];\n    var ab = a[1];\n    var ad = a[3];\n    var aty = a[5];\n    var st = Math.sin(rad);\n    var ct = Math.cos(rad);\n    out[0] = aa * ct + ab * st;\n    out[1] = -aa * st + ab * ct;\n    out[2] = ac * ct + ad * st;\n    out[3] = -ac * st + ct * ad;\n    out[4] = ct * (atx - pivot[0]) + st * (aty - pivot[1]) + pivot[0];\n    out[5] = ct * (aty - pivot[1]) - st * (atx - pivot[0]) + pivot[1];\n    return out;\n}\nexport function scale(out, a, v) {\n    var vx = v[0];\n    var vy = v[1];\n    out[0] = a[0] * vx;\n    out[1] = a[1] * vy;\n    out[2] = a[2] * vx;\n    out[3] = a[3] * vy;\n    out[4] = a[4] * vx;\n    out[5] = a[5] * vy;\n    return out;\n}\nexport function invert(out, a) {\n    var aa = a[0];\n    var ac = a[2];\n    var atx = a[4];\n    var ab = a[1];\n    var ad = a[3];\n    var aty = a[5];\n    var det = aa * ad - ab * ac;\n    if (!det) {\n        return null;\n    }\n    det = 1.0 / det;\n    out[0] = ad * det;\n    out[1] = -ab * det;\n    out[2] = -ac * det;\n    out[3] = aa * det;\n    out[4] = (ac * aty - ad * atx) * det;\n    out[5] = (ab * atx - aa * aty) * det;\n    return out;\n}\nexport function clone(a) {\n    var b = create();\n    copy(b, a);\n    return b;\n}\n", "var Point = (function () {\n    function Point(x, y) {\n        this.x = x || 0;\n        this.y = y || 0;\n    }\n    Point.prototype.copy = function (other) {\n        this.x = other.x;\n        this.y = other.y;\n        return this;\n    };\n    Point.prototype.clone = function () {\n        return new Point(this.x, this.y);\n    };\n    Point.prototype.set = function (x, y) {\n        this.x = x;\n        this.y = y;\n        return this;\n    };\n    Point.prototype.equal = function (other) {\n        return other.x === this.x && other.y === this.y;\n    };\n    Point.prototype.add = function (other) {\n        this.x += other.x;\n        this.y += other.y;\n        return this;\n    };\n    Point.prototype.scale = function (scalar) {\n        this.x *= scalar;\n        this.y *= scalar;\n    };\n    Point.prototype.scaleAndAdd = function (other, scalar) {\n        this.x += other.x * scalar;\n        this.y += other.y * scalar;\n    };\n    Point.prototype.sub = function (other) {\n        this.x -= other.x;\n        this.y -= other.y;\n        return this;\n    };\n    Point.prototype.dot = function (other) {\n        return this.x * other.x + this.y * other.y;\n    };\n    Point.prototype.len = function () {\n        return Math.sqrt(this.x * this.x + this.y * this.y);\n    };\n    Point.prototype.lenSquare = function () {\n        return this.x * this.x + this.y * this.y;\n    };\n    Point.prototype.normalize = function () {\n        var len = this.len();\n        this.x /= len;\n        this.y /= len;\n        return this;\n    };\n    Point.prototype.distance = function (other) {\n        var dx = this.x - other.x;\n        var dy = this.y - other.y;\n        return Math.sqrt(dx * dx + dy * dy);\n    };\n    Point.prototype.distanceSquare = function (other) {\n        var dx = this.x - other.x;\n        var dy = this.y - other.y;\n        return dx * dx + dy * dy;\n    };\n    Point.prototype.negate = function () {\n        this.x = -this.x;\n        this.y = -this.y;\n        return this;\n    };\n    Point.prototype.transform = function (m) {\n        if (!m) {\n            return;\n        }\n        var x = this.x;\n        var y = this.y;\n        this.x = m[0] * x + m[2] * y + m[4];\n        this.y = m[1] * x + m[3] * y + m[5];\n        return this;\n    };\n    Point.prototype.toArray = function (out) {\n        out[0] = this.x;\n        out[1] = this.y;\n        return out;\n    };\n    Point.prototype.fromArray = function (input) {\n        this.x = input[0];\n        this.y = input[1];\n    };\n    Point.set = function (p, x, y) {\n        p.x = x;\n        p.y = y;\n    };\n    Point.copy = function (p, p2) {\n        p.x = p2.x;\n        p.y = p2.y;\n    };\n    Point.len = function (p) {\n        return Math.sqrt(p.x * p.x + p.y * p.y);\n    };\n    Point.lenSquare = function (p) {\n        return p.x * p.x + p.y * p.y;\n    };\n    Point.dot = function (p0, p1) {\n        return p0.x * p1.x + p0.y * p1.y;\n    };\n    Point.add = function (out, p0, p1) {\n        out.x = p0.x + p1.x;\n        out.y = p0.y + p1.y;\n    };\n    Point.sub = function (out, p0, p1) {\n        out.x = p0.x - p1.x;\n        out.y = p0.y - p1.y;\n    };\n    Point.scale = function (out, p0, scalar) {\n        out.x = p0.x * scalar;\n        out.y = p0.y * scalar;\n    };\n    Point.scaleAndAdd = function (out, p0, p1, scalar) {\n        out.x = p0.x + p1.x * scalar;\n        out.y = p0.y + p1.y * scalar;\n    };\n    Point.lerp = function (out, p0, p1, t) {\n        var onet = 1 - t;\n        out.x = onet * p0.x + t * p1.x;\n        out.y = onet * p0.y + t * p1.y;\n    };\n    return Point;\n}());\nexport default Point;\n", "import * as matrix from './matrix.js';\nimport Point from './Point.js';\nvar mathMin = Math.min;\nvar mathMax = Math.max;\nvar mathAbs = Math.abs;\nvar XY = ['x', 'y'];\nvar WH = ['width', 'height'];\nvar lt = new Point();\nvar rb = new Point();\nvar lb = new Point();\nvar rt = new Point();\nvar _intersectCtx = createIntersectContext();\nvar _minTv = _intersectCtx.minTv;\nvar _maxTv = _intersectCtx.maxTv;\nvar _lenMinMax = [0, 0];\nvar BoundingRect = (function () {\n    function BoundingRect(x, y, width, height) {\n        BoundingRect.set(this, x, y, width, height);\n    }\n    BoundingRect.set = function (target, x, y, width, height) {\n        if (width < 0) {\n            x = x + width;\n            width = -width;\n        }\n        if (height < 0) {\n            y = y + height;\n            height = -height;\n        }\n        target.x = x;\n        target.y = y;\n        target.width = width;\n        target.height = height;\n        return target;\n    };\n    BoundingRect.prototype.union = function (other) {\n        var x = mathMin(other.x, this.x);\n        var y = mathMin(other.y, this.y);\n        if (isFinite(this.x) && isFinite(this.width)) {\n            this.width = mathMax(other.x + other.width, this.x + this.width) - x;\n        }\n        else {\n            this.width = other.width;\n        }\n        if (isFinite(this.y) && isFinite(this.height)) {\n            this.height = mathMax(other.y + other.height, this.y + this.height) - y;\n        }\n        else {\n            this.height = other.height;\n        }\n        this.x = x;\n        this.y = y;\n    };\n    BoundingRect.prototype.applyTransform = function (m) {\n        BoundingRect.applyTransform(this, this, m);\n    };\n    BoundingRect.prototype.calculateTransform = function (b) {\n        var a = this;\n        var sx = b.width / a.width;\n        var sy = b.height / a.height;\n        var m = matrix.create();\n        matrix.translate(m, m, [-a.x, -a.y]);\n        matrix.scale(m, m, [sx, sy]);\n        matrix.translate(m, m, [b.x, b.y]);\n        return m;\n    };\n    BoundingRect.prototype.intersect = function (b, mtv, opt) {\n        return BoundingRect.intersect(this, b, mtv, opt);\n    };\n    BoundingRect.intersect = function (a, b, mtv, opt) {\n        if (mtv) {\n            Point.set(mtv, 0, 0);\n        }\n        var outIntersectRect = opt && opt.outIntersectRect || null;\n        var clamp = opt && opt.clamp;\n        if (outIntersectRect) {\n            outIntersectRect.x = outIntersectRect.y = outIntersectRect.width = outIntersectRect.height = NaN;\n        }\n        if (!a || !b) {\n            return false;\n        }\n        if (!(a instanceof BoundingRect)) {\n            a = BoundingRect.set(_tmpIntersectA, a.x, a.y, a.width, a.height);\n        }\n        if (!(b instanceof BoundingRect)) {\n            b = BoundingRect.set(_tmpIntersectB, b.x, b.y, b.width, b.height);\n        }\n        var useMTV = !!mtv;\n        _intersectCtx.reset(opt, useMTV);\n        var touchThreshold = _intersectCtx.touchThreshold;\n        var ax0 = a.x + touchThreshold;\n        var ax1 = a.x + a.width - touchThreshold;\n        var ay0 = a.y + touchThreshold;\n        var ay1 = a.y + a.height - touchThreshold;\n        var bx0 = b.x + touchThreshold;\n        var bx1 = b.x + b.width - touchThreshold;\n        var by0 = b.y + touchThreshold;\n        var by1 = b.y + b.height - touchThreshold;\n        if (ax0 > ax1 || ay0 > ay1 || bx0 > bx1 || by0 > by1) {\n            return false;\n        }\n        var overlap = !(ax1 < bx0 || bx1 < ax0 || ay1 < by0 || by1 < ay0);\n        if (useMTV || outIntersectRect) {\n            _lenMinMax[0] = Infinity;\n            _lenMinMax[1] = 0;\n            intersectOneDim(ax0, ax1, bx0, bx1, 0, useMTV, outIntersectRect, clamp);\n            intersectOneDim(ay0, ay1, by0, by1, 1, useMTV, outIntersectRect, clamp);\n            if (useMTV) {\n                Point.copy(mtv, overlap\n                    ? (_intersectCtx.useDir ? _intersectCtx.dirMinTv : _minTv)\n                    : _maxTv);\n            }\n        }\n        return overlap;\n    };\n    BoundingRect.contain = function (rect, x, y) {\n        return x >= rect.x\n            && x <= (rect.x + rect.width)\n            && y >= rect.y\n            && y <= (rect.y + rect.height);\n    };\n    BoundingRect.prototype.contain = function (x, y) {\n        return BoundingRect.contain(this, x, y);\n    };\n    BoundingRect.prototype.clone = function () {\n        return new BoundingRect(this.x, this.y, this.width, this.height);\n    };\n    BoundingRect.prototype.copy = function (other) {\n        BoundingRect.copy(this, other);\n    };\n    BoundingRect.prototype.plain = function () {\n        return {\n            x: this.x,\n            y: this.y,\n            width: this.width,\n            height: this.height\n        };\n    };\n    BoundingRect.prototype.isFinite = function () {\n        return isFinite(this.x)\n            && isFinite(this.y)\n            && isFinite(this.width)\n            && isFinite(this.height);\n    };\n    BoundingRect.prototype.isZero = function () {\n        return this.width === 0 || this.height === 0;\n    };\n    BoundingRect.create = function (rect) {\n        return new BoundingRect(rect.x, rect.y, rect.width, rect.height);\n    };\n    BoundingRect.copy = function (target, source) {\n        target.x = source.x;\n        target.y = source.y;\n        target.width = source.width;\n        target.height = source.height;\n        return target;\n    };\n    BoundingRect.applyTransform = function (target, source, m) {\n        if (!m) {\n            if (target !== source) {\n                BoundingRect.copy(target, source);\n            }\n            return;\n        }\n        if (m[1] < 1e-5 && m[1] > -1e-5 && m[2] < 1e-5 && m[2] > -1e-5) {\n            var sx = m[0];\n            var sy = m[3];\n            var tx = m[4];\n            var ty = m[5];\n            target.x = source.x * sx + tx;\n            target.y = source.y * sy + ty;\n            target.width = source.width * sx;\n            target.height = source.height * sy;\n            if (target.width < 0) {\n                target.x += target.width;\n                target.width = -target.width;\n            }\n            if (target.height < 0) {\n                target.y += target.height;\n                target.height = -target.height;\n            }\n            return;\n        }\n        lt.x = lb.x = source.x;\n        lt.y = rt.y = source.y;\n        rb.x = rt.x = source.x + source.width;\n        rb.y = lb.y = source.y + source.height;\n        lt.transform(m);\n        rt.transform(m);\n        rb.transform(m);\n        lb.transform(m);\n        target.x = mathMin(lt.x, rb.x, lb.x, rt.x);\n        target.y = mathMin(lt.y, rb.y, lb.y, rt.y);\n        var maxX = mathMax(lt.x, rb.x, lb.x, rt.x);\n        var maxY = mathMax(lt.y, rb.y, lb.y, rt.y);\n        target.width = maxX - target.x;\n        target.height = maxY - target.y;\n    };\n    return BoundingRect;\n}());\nvar _tmpIntersectA = new BoundingRect(0, 0, 0, 0);\nvar _tmpIntersectB = new BoundingRect(0, 0, 0, 0);\nfunction intersectOneDim(a0, a1, b0, b1, updateDimIdx, useMTV, outIntersectRect, clamp) {\n    var d0 = mathAbs(a1 - b0);\n    var d1 = mathAbs(b1 - a0);\n    var d01min = mathMin(d0, d1);\n    var updateDim = XY[updateDimIdx];\n    var zeroDim = XY[1 - updateDimIdx];\n    var wh = WH[updateDimIdx];\n    if (a1 < b0 || b1 < a0) {\n        if (d0 < d1) {\n            if (useMTV) {\n                _maxTv[updateDim] = -d0;\n            }\n            if (clamp) {\n                outIntersectRect[updateDim] = a1;\n                outIntersectRect[wh] = 0;\n            }\n        }\n        else {\n            if (useMTV) {\n                _maxTv[updateDim] = d1;\n            }\n            if (clamp) {\n                outIntersectRect[updateDim] = a0;\n                outIntersectRect[wh] = 0;\n            }\n        }\n    }\n    else {\n        if (outIntersectRect) {\n            outIntersectRect[updateDim] = mathMax(a0, b0);\n            outIntersectRect[wh] = mathMin(a1, b1) - outIntersectRect[updateDim];\n        }\n        if (useMTV) {\n            if (d01min < _lenMinMax[0] || _intersectCtx.useDir) {\n                _lenMinMax[0] = mathMin(d01min, _lenMinMax[0]);\n                if (d0 < d1 || !_intersectCtx.bidirectional) {\n                    _minTv[updateDim] = d0;\n                    _minTv[zeroDim] = 0;\n                    if (_intersectCtx.useDir) {\n                        _intersectCtx.calcDirMTV();\n                    }\n                }\n                if (d0 >= d1 || !_intersectCtx.bidirectional) {\n                    _minTv[updateDim] = -d1;\n                    _minTv[zeroDim] = 0;\n                    if (_intersectCtx.useDir) {\n                        _intersectCtx.calcDirMTV();\n                    }\n                }\n            }\n        }\n    }\n}\nexport function createIntersectContext() {\n    var _direction = 0;\n    var _dirCheckVec = new Point();\n    var _dirTmp = new Point();\n    var _ctx = {\n        minTv: new Point(),\n        maxTv: new Point(),\n        useDir: false,\n        dirMinTv: new Point(),\n        touchThreshold: 0,\n        bidirectional: true,\n        negativeSize: false,\n        reset: function (opt, useMTV) {\n            _ctx.touchThreshold = 0;\n            if (opt && opt.touchThreshold != null) {\n                _ctx.touchThreshold = mathMax(0, opt.touchThreshold);\n            }\n            _ctx.negativeSize = false;\n            if (!useMTV) {\n                return;\n            }\n            _ctx.minTv.set(Infinity, Infinity);\n            _ctx.maxTv.set(0, 0);\n            _ctx.useDir = false;\n            if (opt && opt.direction != null) {\n                _ctx.useDir = true;\n                _ctx.dirMinTv.copy(_ctx.minTv);\n                _dirTmp.copy(_ctx.minTv);\n                _direction = opt.direction;\n                _ctx.bidirectional = opt.bidirectional == null || !!opt.bidirectional;\n                if (!_ctx.bidirectional) {\n                    _dirCheckVec.set(Math.cos(_direction), Math.sin(_direction));\n                }\n            }\n        },\n        calcDirMTV: function () {\n            var minTv = _ctx.minTv;\n            var dirMinTv = _ctx.dirMinTv;\n            var squareMag = minTv.y * minTv.y + minTv.x * minTv.x;\n            var dirSin = Math.sin(_direction);\n            var dirCos = Math.cos(_direction);\n            var dotProd = dirSin * minTv.y + dirCos * minTv.x;\n            if (nearZero(dotProd)) {\n                if (nearZero(minTv.x) && nearZero(minTv.y)) {\n                    dirMinTv.set(0, 0);\n                }\n                return;\n            }\n            _dirTmp.x = squareMag * dirCos / dotProd;\n            _dirTmp.y = squareMag * dirSin / dotProd;\n            if (nearZero(_dirTmp.x) && nearZero(_dirTmp.y)) {\n                dirMinTv.set(0, 0);\n                return;\n            }\n            if ((_ctx.bidirectional\n                || _dirCheckVec.dot(_dirTmp) > 0)\n                && _dirTmp.len() < dirMinTv.len()) {\n                dirMinTv.copy(_dirTmp);\n            }\n        }\n    };\n    function nearZero(val) {\n        return mathAbs(val) < 1e-10;\n    }\n    return _ctx;\n}\nexport default BoundingRect;\n", "import { __extends } from \"tslib\";\nimport * as util from './core/util.js';\nimport * as vec2 from './core/vector.js';\nimport Draggable from './mixin/Draggable.js';\nimport Eventful from './core/Eventful.js';\nimport * as eventTool from './core/event.js';\nimport { GestureMgr } from './core/GestureMgr.js';\nimport BoundingRect from './core/BoundingRect.js';\nvar SILENT = 'silent';\nfunction makeEventPacket(eveType, targetInfo, event) {\n    return {\n        type: eveType,\n        event: event,\n        target: targetInfo.target,\n        topTarget: targetInfo.topTarget,\n        cancelBubble: false,\n        offsetX: event.zrX,\n        offsetY: event.zrY,\n        gestureEvent: event.gestureEvent,\n        pinchX: event.pinchX,\n        pinchY: event.pinchY,\n        pinchScale: event.pinchScale,\n        wheelDelta: event.zrDelta,\n        zrByTouch: event.zrByTouch,\n        which: event.which,\n        stop: stopEvent\n    };\n}\nfunction stopEvent() {\n    eventTool.stop(this.event);\n}\nvar EmptyProxy = (function (_super) {\n    __extends(EmptyProxy, _super);\n    function EmptyProxy() {\n        var _this = _super !== null && _super.apply(this, arguments) || this;\n        _this.handler = null;\n        return _this;\n    }\n    EmptyProxy.prototype.dispose = function () { };\n    EmptyProxy.prototype.setCursor = function () { };\n    return EmptyProxy;\n}(Eventful));\nvar HoveredResult = (function () {\n    function HoveredResult(x, y) {\n        this.x = x;\n        this.y = y;\n    }\n    return HoveredResult;\n}());\nvar handlerNames = [\n    'click', 'dblclick', 'mousewheel', 'mouseout',\n    'mouseup', 'mousedown', 'mousemove', 'contextmenu'\n];\nvar tmpRect = new BoundingRect(0, 0, 0, 0);\nvar Handler = (function (_super) {\n    __extends(Handler, _super);\n    function Handler(storage, painter, proxy, painterRoot, pointerSize) {\n        var _this = _super.call(this) || this;\n        _this._hovered = new HoveredResult(0, 0);\n        _this.storage = storage;\n        _this.painter = painter;\n        _this.painterRoot = painterRoot;\n        _this._pointerSize = pointerSize;\n        proxy = proxy || new EmptyProxy();\n        _this.proxy = null;\n        _this.setHandlerProxy(proxy);\n        _this._draggingMgr = new Draggable(_this);\n        return _this;\n    }\n    Handler.prototype.setHandlerProxy = function (proxy) {\n        if (this.proxy) {\n            this.proxy.dispose();\n        }\n        if (proxy) {\n            util.each(handlerNames, function (name) {\n                proxy.on && proxy.on(name, this[name], this);\n            }, this);\n            proxy.handler = this;\n        }\n        this.proxy = proxy;\n    };\n    Handler.prototype.mousemove = function (event) {\n        var x = event.zrX;\n        var y = event.zrY;\n        var isOutside = isOutsideBoundary(this, x, y);\n        var lastHovered = this._hovered;\n        var lastHoveredTarget = lastHovered.target;\n        if (lastHoveredTarget && !lastHoveredTarget.__zr) {\n            lastHovered = this.findHover(lastHovered.x, lastHovered.y);\n            lastHoveredTarget = lastHovered.target;\n        }\n        var hovered = this._hovered = isOutside ? new HoveredResult(x, y) : this.findHover(x, y);\n        var hoveredTarget = hovered.target;\n        var proxy = this.proxy;\n        proxy.setCursor && proxy.setCursor(hoveredTarget ? hoveredTarget.cursor : 'default');\n        if (lastHoveredTarget && hoveredTarget !== lastHoveredTarget) {\n            this.dispatchToElement(lastHovered, 'mouseout', event);\n        }\n        this.dispatchToElement(hovered, 'mousemove', event);\n        if (hoveredTarget && hoveredTarget !== lastHoveredTarget) {\n            this.dispatchToElement(hovered, 'mouseover', event);\n        }\n    };\n    Handler.prototype.mouseout = function (event) {\n        var eventControl = event.zrEventControl;\n        if (eventControl !== 'only_globalout') {\n            this.dispatchToElement(this._hovered, 'mouseout', event);\n        }\n        if (eventControl !== 'no_globalout') {\n            this.trigger('globalout', { type: 'globalout', event: event });\n        }\n    };\n    Handler.prototype.resize = function () {\n        this._hovered = new HoveredResult(0, 0);\n    };\n    Handler.prototype.dispatch = function (eventName, eventArgs) {\n        var handler = this[eventName];\n        handler && handler.call(this, eventArgs);\n    };\n    Handler.prototype.dispose = function () {\n        this.proxy.dispose();\n        this.storage = null;\n        this.proxy = null;\n        this.painter = null;\n    };\n    Handler.prototype.setCursorStyle = function (cursorStyle) {\n        var proxy = this.proxy;\n        proxy.setCursor && proxy.setCursor(cursorStyle);\n    };\n    Handler.prototype.dispatchToElement = function (targetInfo, eventName, event) {\n        targetInfo = targetInfo || {};\n        var el = targetInfo.target;\n        if (el && el.silent) {\n            return;\n        }\n        var eventKey = ('on' + eventName);\n        var eventPacket = makeEventPacket(eventName, targetInfo, event);\n        while (el) {\n            el[eventKey]\n                && (eventPacket.cancelBubble = !!el[eventKey].call(el, eventPacket));\n            el.trigger(eventName, eventPacket);\n            el = el.__hostTarget ? el.__hostTarget : el.parent;\n            if (eventPacket.cancelBubble) {\n                break;\n            }\n        }\n        if (!eventPacket.cancelBubble) {\n            this.trigger(eventName, eventPacket);\n            if (this.painter && this.painter.eachOtherLayer) {\n                this.painter.eachOtherLayer(function (layer) {\n                    if (typeof (layer[eventKey]) === 'function') {\n                        layer[eventKey].call(layer, eventPacket);\n                    }\n                    if (layer.trigger) {\n                        layer.trigger(eventName, eventPacket);\n                    }\n                });\n            }\n        }\n    };\n    Handler.prototype.findHover = function (x, y, exclude) {\n        var list = this.storage.getDisplayList();\n        var out = new HoveredResult(x, y);\n        setHoverTarget(list, out, x, y, exclude);\n        if (this._pointerSize && !out.target) {\n            var candidates = [];\n            var pointerSize = this._pointerSize;\n            var targetSizeHalf = pointerSize / 2;\n            var pointerRect = new BoundingRect(x - targetSizeHalf, y - targetSizeHalf, pointerSize, pointerSize);\n            for (var i = list.length - 1; i >= 0; i--) {\n                var el = list[i];\n                if (el !== exclude\n                    && !el.ignore\n                    && !el.ignoreCoarsePointer\n                    && (!el.parent || !el.parent.ignoreCoarsePointer)) {\n                    tmpRect.copy(el.getBoundingRect());\n                    if (el.transform) {\n                        tmpRect.applyTransform(el.transform);\n                    }\n                    if (tmpRect.intersect(pointerRect)) {\n                        candidates.push(el);\n                    }\n                }\n            }\n            if (candidates.length) {\n                var rStep = 4;\n                var thetaStep = Math.PI / 12;\n                var PI2 = Math.PI * 2;\n                for (var r = 0; r < targetSizeHalf; r += rStep) {\n                    for (var theta = 0; theta < PI2; theta += thetaStep) {\n                        var x1 = x + r * Math.cos(theta);\n                        var y1 = y + r * Math.sin(theta);\n                        setHoverTarget(candidates, out, x1, y1, exclude);\n                        if (out.target) {\n                            return out;\n                        }\n                    }\n                }\n            }\n        }\n        return out;\n    };\n    Handler.prototype.processGesture = function (event, stage) {\n        if (!this._gestureMgr) {\n            this._gestureMgr = new GestureMgr();\n        }\n        var gestureMgr = this._gestureMgr;\n        stage === 'start' && gestureMgr.clear();\n        var gestureInfo = gestureMgr.recognize(event, this.findHover(event.zrX, event.zrY, null).target, this.proxy.dom);\n        stage === 'end' && gestureMgr.clear();\n        if (gestureInfo) {\n            var type = gestureInfo.type;\n            event.gestureEvent = type;\n            var res = new HoveredResult();\n            res.target = gestureInfo.target;\n            this.dispatchToElement(res, type, gestureInfo.event);\n        }\n    };\n    return Handler;\n}(Eventful));\nutil.each(['click', 'mousedown', 'mouseup', 'mousewheel', 'dblclick', 'contextmenu'], function (name) {\n    Handler.prototype[name] = function (event) {\n        var x = event.zrX;\n        var y = event.zrY;\n        var isOutside = isOutsideBoundary(this, x, y);\n        var hovered;\n        var hoveredTarget;\n        if (name !== 'mouseup' || !isOutside) {\n            hovered = this.findHover(x, y);\n            hoveredTarget = hovered.target;\n        }\n        if (name === 'mousedown') {\n            this._downEl = hoveredTarget;\n            this._downPoint = [event.zrX, event.zrY];\n            this._upEl = hoveredTarget;\n        }\n        else if (name === 'mouseup') {\n            this._upEl = hoveredTarget;\n        }\n        else if (name === 'click') {\n            if (this._downEl !== this._upEl\n                || !this._downPoint\n                || vec2.dist(this._downPoint, [event.zrX, event.zrY]) > 4) {\n                return;\n            }\n            this._downPoint = null;\n        }\n        this.dispatchToElement(hovered, name, event);\n    };\n});\nfunction isHover(displayable, x, y) {\n    if (displayable[displayable.rectHover ? 'rectContain' : 'contain'](x, y)) {\n        var el = displayable;\n        var isSilent = void 0;\n        var ignoreClip = false;\n        while (el) {\n            if (el.ignoreClip) {\n                ignoreClip = true;\n            }\n            if (!ignoreClip) {\n                var clipPath = el.getClipPath();\n                if (clipPath && !clipPath.contain(x, y)) {\n                    return false;\n                }\n            }\n            if (el.silent) {\n                isSilent = true;\n            }\n            var hostEl = el.__hostTarget;\n            el = hostEl ? (el.ignoreHostSilent ? null : hostEl) : el.parent;\n        }\n        return isSilent ? SILENT : true;\n    }\n    return false;\n}\nfunction setHoverTarget(list, out, x, y, exclude) {\n    for (var i = list.length - 1; i >= 0; i--) {\n        var el = list[i];\n        var hoverCheckResult = void 0;\n        if (el !== exclude\n            && !el.ignore\n            && (hoverCheckResult = isHover(el, x, y))) {\n            !out.topTarget && (out.topTarget = el);\n            if (hoverCheckResult !== SILENT) {\n                out.target = el;\n                break;\n            }\n        }\n    }\n}\nfunction isOutsideBoundary(handlerInstance, x, y) {\n    var painter = handlerInstance.painter;\n    return x < 0 || x > painter.getWidth() || y < 0 || y > painter.getHeight();\n}\nexport default Handler;\n", "var DEFAULT_MIN_MERGE = 32;\nvar DEFAULT_MIN_GALLOPING = 7;\nfunction minRunLength(n) {\n    var r = 0;\n    while (n >= DEFAULT_MIN_MERGE) {\n        r |= n & 1;\n        n >>= 1;\n    }\n    return n + r;\n}\nfunction makeAscendingRun(array, lo, hi, compare) {\n    var runHi = lo + 1;\n    if (runHi === hi) {\n        return 1;\n    }\n    if (compare(array[runHi++], array[lo]) < 0) {\n        while (runHi < hi && compare(array[runHi], array[runHi - 1]) < 0) {\n            runHi++;\n        }\n        reverseRun(array, lo, runHi);\n    }\n    else {\n        while (runHi < hi && compare(array[runHi], array[runHi - 1]) >= 0) {\n            runHi++;\n        }\n    }\n    return runHi - lo;\n}\nfunction reverseRun(array, lo, hi) {\n    hi--;\n    while (lo < hi) {\n        var t = array[lo];\n        array[lo++] = array[hi];\n        array[hi--] = t;\n    }\n}\nfunction binaryInsertionSort(array, lo, hi, start, compare) {\n    if (start === lo) {\n        start++;\n    }\n    for (; start < hi; start++) {\n        var pivot = array[start];\n        var left = lo;\n        var right = start;\n        var mid;\n        while (left < right) {\n            mid = left + right >>> 1;\n            if (compare(pivot, array[mid]) < 0) {\n                right = mid;\n            }\n            else {\n                left = mid + 1;\n            }\n        }\n        var n = start - left;\n        switch (n) {\n            case 3:\n                array[left + 3] = array[left + 2];\n            case 2:\n                array[left + 2] = array[left + 1];\n            case 1:\n                array[left + 1] = array[left];\n                break;\n            default:\n                while (n > 0) {\n                    array[left + n] = array[left + n - 1];\n                    n--;\n                }\n        }\n        array[left] = pivot;\n    }\n}\nfunction gallopLeft(value, array, start, length, hint, compare) {\n    var lastOffset = 0;\n    var maxOffset = 0;\n    var offset = 1;\n    if (compare(value, array[start + hint]) > 0) {\n        maxOffset = length - hint;\n        while (offset < maxOffset && compare(value, array[start + hint + offset]) > 0) {\n            lastOffset = offset;\n            offset = (offset << 1) + 1;\n            if (offset <= 0) {\n                offset = maxOffset;\n            }\n        }\n        if (offset > maxOffset) {\n            offset = maxOffset;\n        }\n        lastOffset += hint;\n        offset += hint;\n    }\n    else {\n        maxOffset = hint + 1;\n        while (offset < maxOffset && compare(value, array[start + hint - offset]) <= 0) {\n            lastOffset = offset;\n            offset = (offset << 1) + 1;\n            if (offset <= 0) {\n                offset = maxOffset;\n            }\n        }\n        if (offset > maxOffset) {\n            offset = maxOffset;\n        }\n        var tmp = lastOffset;\n        lastOffset = hint - offset;\n        offset = hint - tmp;\n    }\n    lastOffset++;\n    while (lastOffset < offset) {\n        var m = lastOffset + (offset - lastOffset >>> 1);\n        if (compare(value, array[start + m]) > 0) {\n            lastOffset = m + 1;\n        }\n        else {\n            offset = m;\n        }\n    }\n    return offset;\n}\nfunction gallopRight(value, array, start, length, hint, compare) {\n    var lastOffset = 0;\n    var maxOffset = 0;\n    var offset = 1;\n    if (compare(value, array[start + hint]) < 0) {\n        maxOffset = hint + 1;\n        while (offset < maxOffset && compare(value, array[start + hint - offset]) < 0) {\n            lastOffset = offset;\n            offset = (offset << 1) + 1;\n            if (offset <= 0) {\n                offset = maxOffset;\n            }\n        }\n        if (offset > maxOffset) {\n            offset = maxOffset;\n        }\n        var tmp = lastOffset;\n        lastOffset = hint - offset;\n        offset = hint - tmp;\n    }\n    else {\n        maxOffset = length - hint;\n        while (offset < maxOffset && compare(value, array[start + hint + offset]) >= 0) {\n            lastOffset = offset;\n            offset = (offset << 1) + 1;\n            if (offset <= 0) {\n                offset = maxOffset;\n            }\n        }\n        if (offset > maxOffset) {\n            offset = maxOffset;\n        }\n        lastOffset += hint;\n        offset += hint;\n    }\n    lastOffset++;\n    while (lastOffset < offset) {\n        var m = lastOffset + (offset - lastOffset >>> 1);\n        if (compare(value, array[start + m]) < 0) {\n            offset = m;\n        }\n        else {\n            lastOffset = m + 1;\n        }\n    }\n    return offset;\n}\nfunction TimSort(array, compare) {\n    var minGallop = DEFAULT_MIN_GALLOPING;\n    var runStart;\n    var runLength;\n    var stackSize = 0;\n    var tmp = [];\n    runStart = [];\n    runLength = [];\n    function pushRun(_runStart, _runLength) {\n        runStart[stackSize] = _runStart;\n        runLength[stackSize] = _runLength;\n        stackSize += 1;\n    }\n    function mergeRuns() {\n        while (stackSize > 1) {\n            var n = stackSize - 2;\n            if ((n >= 1 && runLength[n - 1] <= runLength[n] + runLength[n + 1])\n                || (n >= 2 && runLength[n - 2] <= runLength[n] + runLength[n - 1])) {\n                if (runLength[n - 1] < runLength[n + 1]) {\n                    n--;\n                }\n            }\n            else if (runLength[n] > runLength[n + 1]) {\n                break;\n            }\n            mergeAt(n);\n        }\n    }\n    function forceMergeRuns() {\n        while (stackSize > 1) {\n            var n = stackSize - 2;\n            if (n > 0 && runLength[n - 1] < runLength[n + 1]) {\n                n--;\n            }\n            mergeAt(n);\n        }\n    }\n    function mergeAt(i) {\n        var start1 = runStart[i];\n        var length1 = runLength[i];\n        var start2 = runStart[i + 1];\n        var length2 = runLength[i + 1];\n        runLength[i] = length1 + length2;\n        if (i === stackSize - 3) {\n            runStart[i + 1] = runStart[i + 2];\n            runLength[i + 1] = runLength[i + 2];\n        }\n        stackSize--;\n        var k = gallopRight(array[start2], array, start1, length1, 0, compare);\n        start1 += k;\n        length1 -= k;\n        if (length1 === 0) {\n            return;\n        }\n        length2 = gallopLeft(array[start1 + length1 - 1], array, start2, length2, length2 - 1, compare);\n        if (length2 === 0) {\n            return;\n        }\n        if (length1 <= length2) {\n            mergeLow(start1, length1, start2, length2);\n        }\n        else {\n            mergeHigh(start1, length1, start2, length2);\n        }\n    }\n    function mergeLow(start1, length1, start2, length2) {\n        var i = 0;\n        for (i = 0; i < length1; i++) {\n            tmp[i] = array[start1 + i];\n        }\n        var cursor1 = 0;\n        var cursor2 = start2;\n        var dest = start1;\n        array[dest++] = array[cursor2++];\n        if (--length2 === 0) {\n            for (i = 0; i < length1; i++) {\n                array[dest + i] = tmp[cursor1 + i];\n            }\n            return;\n        }\n        if (length1 === 1) {\n            for (i = 0; i < length2; i++) {\n                array[dest + i] = array[cursor2 + i];\n            }\n            array[dest + length2] = tmp[cursor1];\n            return;\n        }\n        var _minGallop = minGallop;\n        var count1;\n        var count2;\n        var exit;\n        while (1) {\n            count1 = 0;\n            count2 = 0;\n            exit = false;\n            do {\n                if (compare(array[cursor2], tmp[cursor1]) < 0) {\n                    array[dest++] = array[cursor2++];\n                    count2++;\n                    count1 = 0;\n                    if (--length2 === 0) {\n                        exit = true;\n                        break;\n                    }\n                }\n                else {\n                    array[dest++] = tmp[cursor1++];\n                    count1++;\n                    count2 = 0;\n                    if (--length1 === 1) {\n                        exit = true;\n                        break;\n                    }\n                }\n            } while ((count1 | count2) < _minGallop);\n            if (exit) {\n                break;\n            }\n            do {\n                count1 = gallopRight(array[cursor2], tmp, cursor1, length1, 0, compare);\n                if (count1 !== 0) {\n                    for (i = 0; i < count1; i++) {\n                        array[dest + i] = tmp[cursor1 + i];\n                    }\n                    dest += count1;\n                    cursor1 += count1;\n                    length1 -= count1;\n                    if (length1 <= 1) {\n                        exit = true;\n                        break;\n                    }\n                }\n                array[dest++] = array[cursor2++];\n                if (--length2 === 0) {\n                    exit = true;\n                    break;\n                }\n                count2 = gallopLeft(tmp[cursor1], array, cursor2, length2, 0, compare);\n                if (count2 !== 0) {\n                    for (i = 0; i < count2; i++) {\n                        array[dest + i] = array[cursor2 + i];\n                    }\n                    dest += count2;\n                    cursor2 += count2;\n                    length2 -= count2;\n                    if (length2 === 0) {\n                        exit = true;\n                        break;\n                    }\n                }\n                array[dest++] = tmp[cursor1++];\n                if (--length1 === 1) {\n                    exit = true;\n                    break;\n                }\n                _minGallop--;\n            } while (count1 >= DEFAULT_MIN_GALLOPING || count2 >= DEFAULT_MIN_GALLOPING);\n            if (exit) {\n                break;\n            }\n            if (_minGallop < 0) {\n                _minGallop = 0;\n            }\n            _minGallop += 2;\n        }\n        minGallop = _minGallop;\n        minGallop < 1 && (minGallop = 1);\n        if (length1 === 1) {\n            for (i = 0; i < length2; i++) {\n                array[dest + i] = array[cursor2 + i];\n            }\n            array[dest + length2] = tmp[cursor1];\n        }\n        else if (length1 === 0) {\n            throw new Error();\n        }\n        else {\n            for (i = 0; i < length1; i++) {\n                array[dest + i] = tmp[cursor1 + i];\n            }\n        }\n    }\n    function mergeHigh(start1, length1, start2, length2) {\n        var i = 0;\n        for (i = 0; i < length2; i++) {\n            tmp[i] = array[start2 + i];\n        }\n        var cursor1 = start1 + length1 - 1;\n        var cursor2 = length2 - 1;\n        var dest = start2 + length2 - 1;\n        var customCursor = 0;\n        var customDest = 0;\n        array[dest--] = array[cursor1--];\n        if (--length1 === 0) {\n            customCursor = dest - (length2 - 1);\n            for (i = 0; i < length2; i++) {\n                array[customCursor + i] = tmp[i];\n            }\n            return;\n        }\n        if (length2 === 1) {\n            dest -= length1;\n            cursor1 -= length1;\n            customDest = dest + 1;\n            customCursor = cursor1 + 1;\n            for (i = length1 - 1; i >= 0; i--) {\n                array[customDest + i] = array[customCursor + i];\n            }\n            array[dest] = tmp[cursor2];\n            return;\n        }\n        var _minGallop = minGallop;\n        while (true) {\n            var count1 = 0;\n            var count2 = 0;\n            var exit = false;\n            do {\n                if (compare(tmp[cursor2], array[cursor1]) < 0) {\n                    array[dest--] = array[cursor1--];\n                    count1++;\n                    count2 = 0;\n                    if (--length1 === 0) {\n                        exit = true;\n                        break;\n                    }\n                }\n                else {\n                    array[dest--] = tmp[cursor2--];\n                    count2++;\n                    count1 = 0;\n                    if (--length2 === 1) {\n                        exit = true;\n                        break;\n                    }\n                }\n            } while ((count1 | count2) < _minGallop);\n            if (exit) {\n                break;\n            }\n            do {\n                count1 = length1 - gallopRight(tmp[cursor2], array, start1, length1, length1 - 1, compare);\n                if (count1 !== 0) {\n                    dest -= count1;\n                    cursor1 -= count1;\n                    length1 -= count1;\n                    customDest = dest + 1;\n                    customCursor = cursor1 + 1;\n                    for (i = count1 - 1; i >= 0; i--) {\n                        array[customDest + i] = array[customCursor + i];\n                    }\n                    if (length1 === 0) {\n                        exit = true;\n                        break;\n                    }\n                }\n                array[dest--] = tmp[cursor2--];\n                if (--length2 === 1) {\n                    exit = true;\n                    break;\n                }\n                count2 = length2 - gallopLeft(array[cursor1], tmp, 0, length2, length2 - 1, compare);\n                if (count2 !== 0) {\n                    dest -= count2;\n                    cursor2 -= count2;\n                    length2 -= count2;\n                    customDest = dest + 1;\n                    customCursor = cursor2 + 1;\n                    for (i = 0; i < count2; i++) {\n                        array[customDest + i] = tmp[customCursor + i];\n                    }\n                    if (length2 <= 1) {\n                        exit = true;\n                        break;\n                    }\n                }\n                array[dest--] = array[cursor1--];\n                if (--length1 === 0) {\n                    exit = true;\n                    break;\n                }\n                _minGallop--;\n            } while (count1 >= DEFAULT_MIN_GALLOPING || count2 >= DEFAULT_MIN_GALLOPING);\n            if (exit) {\n                break;\n            }\n            if (_minGallop < 0) {\n                _minGallop = 0;\n            }\n            _minGallop += 2;\n        }\n        minGallop = _minGallop;\n        if (minGallop < 1) {\n            minGallop = 1;\n        }\n        if (length2 === 1) {\n            dest -= length1;\n            cursor1 -= length1;\n            customDest = dest + 1;\n            customCursor = cursor1 + 1;\n            for (i = length1 - 1; i >= 0; i--) {\n                array[customDest + i] = array[customCursor + i];\n            }\n            array[dest] = tmp[cursor2];\n        }\n        else if (length2 === 0) {\n            throw new Error();\n        }\n        else {\n            customCursor = dest - (length2 - 1);\n            for (i = 0; i < length2; i++) {\n                array[customCursor + i] = tmp[i];\n            }\n        }\n    }\n    return {\n        mergeRuns: mergeRuns,\n        forceMergeRuns: forceMergeRuns,\n        pushRun: pushRun\n    };\n}\nexport default function sort(array, compare, lo, hi) {\n    if (!lo) {\n        lo = 0;\n    }\n    if (!hi) {\n        hi = array.length;\n    }\n    var remaining = hi - lo;\n    if (remaining < 2) {\n        return;\n    }\n    var runLength = 0;\n    if (remaining < DEFAULT_MIN_MERGE) {\n        runLength = makeAscendingRun(array, lo, hi, compare);\n        binaryInsertionSort(array, lo, hi, lo + runLength, compare);\n        return;\n    }\n    var ts = TimSort(array, compare);\n    var minRun = minRunLength(remaining);\n    do {\n        runLength = makeAscendingRun(array, lo, hi, compare);\n        if (runLength < minRun) {\n            var force = remaining;\n            if (force > minRun) {\n                force = minRun;\n            }\n            binaryInsertionSort(array, lo, lo + force, lo + runLength, compare);\n            runLength = force;\n        }\n        ts.pushRun(lo, runLength);\n        ts.mergeRuns();\n        remaining -= runLength;\n        lo += runLength;\n    } while (remaining !== 0);\n    ts.forceMergeRuns();\n}\n", "export var REDRAW_BIT = 1;\nexport var STYLE_CHANGED_BIT = 2;\nexport var SHAPE_CHANGED_BIT = 4;\n", "import * as util from './core/util.js';\nimport timsort from './core/timsort.js';\nimport { REDRAW_BIT } from './graphic/constants.js';\nvar invalidZErrorLogged = false;\nfunction logInvalidZError() {\n    if (invalidZErrorLogged) {\n        return;\n    }\n    invalidZErrorLogged = true;\n    console.warn('z / z2 / zlevel of displayable is invalid, which may cause unexpected errors');\n}\nfunction shapeCompareFunc(a, b) {\n    if (a.zlevel === b.zlevel) {\n        if (a.z === b.z) {\n            return a.z2 - b.z2;\n        }\n        return a.z - b.z;\n    }\n    return a.zlevel - b.zlevel;\n}\nvar Storage = (function () {\n    function Storage() {\n        this._roots = [];\n        this._displayList = [];\n        this._displayListLen = 0;\n        this.displayableSortFunc = shapeCompareFunc;\n    }\n    Storage.prototype.traverse = function (cb, context) {\n        for (var i = 0; i < this._roots.length; i++) {\n            this._roots[i].traverse(cb, context);\n        }\n    };\n    Storage.prototype.getDisplayList = function (update, includeIgnore) {\n        includeIgnore = includeIgnore || false;\n        var displayList = this._displayList;\n        if (update || !displayList.length) {\n            this.updateDisplayList(includeIgnore);\n        }\n        return displayList;\n    };\n    Storage.prototype.updateDisplayList = function (includeIgnore) {\n        this._displayListLen = 0;\n        var roots = this._roots;\n        var displayList = this._displayList;\n        for (var i = 0, len = roots.length; i < len; i++) {\n            this._updateAndAddDisplayable(roots[i], null, includeIgnore);\n        }\n        displayList.length = this._displayListLen;\n        timsort(displayList, shapeCompareFunc);\n    };\n    Storage.prototype._updateAndAddDisplayable = function (el, parentClipPaths, includeIgnore) {\n        if (el.ignore && !includeIgnore) {\n            return;\n        }\n        el.beforeUpdate();\n        el.update();\n        el.afterUpdate();\n        var userSetClipPath = el.getClipPath();\n        var parentHasClipPaths = parentClipPaths && parentClipPaths.length;\n        var clipPathIdx = 0;\n        var thisClipPaths = el.__clipPaths;\n        if (!el.ignoreClip\n            && (parentHasClipPaths || userSetClipPath)) {\n            if (!thisClipPaths) {\n                thisClipPaths = el.__clipPaths = [];\n            }\n            if (parentHasClipPaths) {\n                for (var idx = 0; idx < parentClipPaths.length; idx++) {\n                    thisClipPaths[clipPathIdx++] = parentClipPaths[idx];\n                }\n            }\n            var currentClipPath = userSetClipPath;\n            var parentClipPath = el;\n            while (currentClipPath) {\n                currentClipPath.parent = parentClipPath;\n                currentClipPath.updateTransform();\n                thisClipPaths[clipPathIdx++] = currentClipPath;\n                parentClipPath = currentClipPath;\n                currentClipPath = currentClipPath.getClipPath();\n            }\n        }\n        if (thisClipPaths) {\n            thisClipPaths.length = clipPathIdx;\n        }\n        if (el.childrenRef) {\n            var children = el.childrenRef();\n            for (var i = 0; i < children.length; i++) {\n                var child = children[i];\n                if (el.__dirty) {\n                    child.__dirty |= REDRAW_BIT;\n                }\n                this._updateAndAddDisplayable(child, thisClipPaths, includeIgnore);\n            }\n            el.__dirty = 0;\n        }\n        else {\n            var disp = el;\n            if (isNaN(disp.z)) {\n                logInvalidZError();\n                disp.z = 0;\n            }\n            if (isNaN(disp.z2)) {\n                logInvalidZError();\n                disp.z2 = 0;\n            }\n            if (isNaN(disp.zlevel)) {\n                logInvalidZError();\n                disp.zlevel = 0;\n            }\n            this._displayList[this._displayListLen++] = disp;\n        }\n        var decalEl = el.getDecalElement && el.getDecalElement();\n        if (decalEl) {\n            this._updateAndAddDisplayable(decalEl, thisClipPaths, includeIgnore);\n        }\n        var textGuide = el.getTextGuideLine();\n        if (textGuide) {\n            this._updateAndAddDisplayable(textGuide, thisClipPaths, includeIgnore);\n        }\n        var textEl = el.getTextContent();\n        if (textEl) {\n            this._updateAndAddDisplayable(textEl, thisClipPaths, includeIgnore);\n        }\n    };\n    Storage.prototype.addRoot = function (el) {\n        if (el.__zr && el.__zr.storage === this) {\n            return;\n        }\n        this._roots.push(el);\n    };\n    Storage.prototype.delRoot = function (el) {\n        if (el instanceof Array) {\n            for (var i = 0, l = el.length; i < l; i++) {\n                this.delRoot(el[i]);\n            }\n            return;\n        }\n        var idx = util.indexOf(this._roots, el);\n        if (idx >= 0) {\n            this._roots.splice(idx, 1);\n        }\n    };\n    Storage.prototype.delAllRoots = function () {\n        this._roots = [];\n        this._displayList = [];\n        this._displayListLen = 0;\n        return;\n    };\n    Storage.prototype.getRoots = function () {\n        return this._roots;\n    };\n    Storage.prototype.dispose = function () {\n        this._displayList = null;\n        this._roots = null;\n    };\n    return Storage;\n}());\nexport default Storage;\n", "import env from '../core/env.js';\nvar requestAnimationFrame;\nrequestAnimationFrame = (env.hasGlobalWindow\n    && ((window.requestAnimationFrame && window.requestAnimationFrame.bind(window))\n        || (window.msRequestAnimationFrame && window.msRequestAnimationFrame.bind(window))\n        || window.mozRequestAnimationFrame\n        || window.webkitRequestAnimationFrame)) || function (func) {\n    return setTimeout(func, 16);\n};\nexport default requestAnimationFrame;\n", "var easingFuncs = {\n    linear: function (k) {\n        return k;\n    },\n    quadraticIn: function (k) {\n        return k * k;\n    },\n    quadraticOut: function (k) {\n        return k * (2 - k);\n    },\n    quadraticInOut: function (k) {\n        if ((k *= 2) < 1) {\n            return 0.5 * k * k;\n        }\n        return -0.5 * (--k * (k - 2) - 1);\n    },\n    cubicIn: function (k) {\n        return k * k * k;\n    },\n    cubicOut: function (k) {\n        return --k * k * k + 1;\n    },\n    cubicInOut: function (k) {\n        if ((k *= 2) < 1) {\n            return 0.5 * k * k * k;\n        }\n        return 0.5 * ((k -= 2) * k * k + 2);\n    },\n    quarticIn: function (k) {\n        return k * k * k * k;\n    },\n    quarticOut: function (k) {\n        return 1 - (--k * k * k * k);\n    },\n    quarticInOut: function (k) {\n        if ((k *= 2) < 1) {\n            return 0.5 * k * k * k * k;\n        }\n        return -0.5 * ((k -= 2) * k * k * k - 2);\n    },\n    quinticIn: function (k) {\n        return k * k * k * k * k;\n    },\n    quinticOut: function (k) {\n        return --k * k * k * k * k + 1;\n    },\n    quinticInOut: function (k) {\n        if ((k *= 2) < 1) {\n            return 0.5 * k * k * k * k * k;\n        }\n        return 0.5 * ((k -= 2) * k * k * k * k + 2);\n    },\n    sinusoidalIn: function (k) {\n        return 1 - Math.cos(k * Math.PI / 2);\n    },\n    sinusoidalOut: function (k) {\n        return Math.sin(k * Math.PI / 2);\n    },\n    sinusoidalInOut: function (k) {\n        return 0.5 * (1 - Math.cos(Math.PI * k));\n    },\n    exponentialIn: function (k) {\n        return k === 0 ? 0 : Math.pow(1024, k - 1);\n    },\n    exponentialOut: function (k) {\n        return k === 1 ? 1 : 1 - Math.pow(2, -10 * k);\n    },\n    exponentialInOut: function (k) {\n        if (k === 0) {\n            return 0;\n        }\n        if (k === 1) {\n            return 1;\n        }\n        if ((k *= 2) < 1) {\n            return 0.5 * Math.pow(1024, k - 1);\n        }\n        return 0.5 * (-Math.pow(2, -10 * (k - 1)) + 2);\n    },\n    circularIn: function (k) {\n        return 1 - Math.sqrt(1 - k * k);\n    },\n    circularOut: function (k) {\n        return Math.sqrt(1 - (--k * k));\n    },\n    circularInOut: function (k) {\n        if ((k *= 2) < 1) {\n            return -0.5 * (Math.sqrt(1 - k * k) - 1);\n        }\n        return 0.5 * (Math.sqrt(1 - (k -= 2) * k) + 1);\n    },\n    elasticIn: function (k) {\n        var s;\n        var a = 0.1;\n        var p = 0.4;\n        if (k === 0) {\n            return 0;\n        }\n        if (k === 1) {\n            return 1;\n        }\n        if (!a || a < 1) {\n            a = 1;\n            s = p / 4;\n        }\n        else {\n            s = p * Math.asin(1 / a) / (2 * Math.PI);\n        }\n        return -(a * Math.pow(2, 10 * (k -= 1))\n            * Math.sin((k - s) * (2 * Math.PI) / p));\n    },\n    elasticOut: function (k) {\n        var s;\n        var a = 0.1;\n        var p = 0.4;\n        if (k === 0) {\n            return 0;\n        }\n        if (k === 1) {\n            return 1;\n        }\n        if (!a || a < 1) {\n            a = 1;\n            s = p / 4;\n        }\n        else {\n            s = p * Math.asin(1 / a) / (2 * Math.PI);\n        }\n        return (a * Math.pow(2, -10 * k)\n            * Math.sin((k - s) * (2 * Math.PI) / p) + 1);\n    },\n    elasticInOut: function (k) {\n        var s;\n        var a = 0.1;\n        var p = 0.4;\n        if (k === 0) {\n            return 0;\n        }\n        if (k === 1) {\n            return 1;\n        }\n        if (!a || a < 1) {\n            a = 1;\n            s = p / 4;\n        }\n        else {\n            s = p * Math.asin(1 / a) / (2 * Math.PI);\n        }\n        if ((k *= 2) < 1) {\n            return -0.5 * (a * Math.pow(2, 10 * (k -= 1))\n                * Math.sin((k - s) * (2 * Math.PI) / p));\n        }\n        return a * Math.pow(2, -10 * (k -= 1))\n            * Math.sin((k - s) * (2 * Math.PI) / p) * 0.5 + 1;\n    },\n    backIn: function (k) {\n        var s = 1.70158;\n        return k * k * ((s + 1) * k - s);\n    },\n    backOut: function (k) {\n        var s = 1.70158;\n        return --k * k * ((s + 1) * k + s) + 1;\n    },\n    backInOut: function (k) {\n        var s = 1.70158 * 1.525;\n        if ((k *= 2) < 1) {\n            return 0.5 * (k * k * ((s + 1) * k - s));\n        }\n        return 0.5 * ((k -= 2) * k * ((s + 1) * k + s) + 2);\n    },\n    bounceIn: function (k) {\n        return 1 - easingFuncs.bounceOut(1 - k);\n    },\n    bounceOut: function (k) {\n        if (k < (1 / 2.75)) {\n            return 7.5625 * k * k;\n        }\n        else if (k < (2 / 2.75)) {\n            return 7.5625 * (k -= (1.5 / 2.75)) * k + 0.75;\n        }\n        else if (k < (2.5 / 2.75)) {\n            return 7.5625 * (k -= (2.25 / 2.75)) * k + 0.9375;\n        }\n        else {\n            return 7.5625 * (k -= (2.625 / 2.75)) * k + 0.984375;\n        }\n    },\n    bounceInOut: function (k) {\n        if (k < 0.5) {\n            return easingFuncs.bounceIn(k * 2) * 0.5;\n        }\n        return easingFuncs.bounceOut(k * 2 - 1) * 0.5 + 0.5;\n    }\n};\nexport default easingFuncs;\n", "import { create as v2Create, distSquare as v2DistSquare } from './vector.js';\nvar mathPow = Math.pow;\nvar mathSqrt = Math.sqrt;\nvar EPSILON = 1e-8;\nvar EPSILON_NUMERIC = 1e-4;\nvar THREE_SQRT = mathSqrt(3);\nvar ONE_THIRD = 1 / 3;\nvar _v0 = v2Create();\nvar _v1 = v2Create();\nvar _v2 = v2Create();\nfunction isAroundZero(val) {\n    return val > -EPSILON && val < EPSILON;\n}\nfunction isNotAroundZero(val) {\n    return val > EPSILON || val < -EPSILON;\n}\nexport function cubicAt(p0, p1, p2, p3, t) {\n    var onet = 1 - t;\n    return onet * onet * (onet * p0 + 3 * t * p1)\n        + t * t * (t * p3 + 3 * onet * p2);\n}\nexport function cubicDerivativeAt(p0, p1, p2, p3, t) {\n    var onet = 1 - t;\n    return 3 * (((p1 - p0) * onet + 2 * (p2 - p1) * t) * onet\n        + (p3 - p2) * t * t);\n}\nexport function cubicRootAt(p0, p1, p2, p3, val, roots) {\n    var a = p3 + 3 * (p1 - p2) - p0;\n    var b = 3 * (p2 - p1 * 2 + p0);\n    var c = 3 * (p1 - p0);\n    var d = p0 - val;\n    var A = b * b - 3 * a * c;\n    var B = b * c - 9 * a * d;\n    var C = c * c - 3 * b * d;\n    var n = 0;\n    if (isAroundZero(A) && isAroundZero(B)) {\n        if (isAroundZero(b)) {\n            roots[0] = 0;\n        }\n        else {\n            var t1 = -c / b;\n            if (t1 >= 0 && t1 <= 1) {\n                roots[n++] = t1;\n            }\n        }\n    }\n    else {\n        var disc = B * B - 4 * A * C;\n        if (isAroundZero(disc)) {\n            var K = B / A;\n            var t1 = -b / a + K;\n            var t2 = -K / 2;\n            if (t1 >= 0 && t1 <= 1) {\n                roots[n++] = t1;\n            }\n            if (t2 >= 0 && t2 <= 1) {\n                roots[n++] = t2;\n            }\n        }\n        else if (disc > 0) {\n            var discSqrt = mathSqrt(disc);\n            var Y1 = A * b + 1.5 * a * (-B + discSqrt);\n            var Y2 = A * b + 1.5 * a * (-B - discSqrt);\n            if (Y1 < 0) {\n                Y1 = -mathPow(-Y1, ONE_THIRD);\n            }\n            else {\n                Y1 = mathPow(Y1, ONE_THIRD);\n            }\n            if (Y2 < 0) {\n                Y2 = -mathPow(-Y2, ONE_THIRD);\n            }\n            else {\n                Y2 = mathPow(Y2, ONE_THIRD);\n            }\n            var t1 = (-b - (Y1 + Y2)) / (3 * a);\n            if (t1 >= 0 && t1 <= 1) {\n                roots[n++] = t1;\n            }\n        }\n        else {\n            var T = (2 * A * b - 3 * a * B) / (2 * mathSqrt(A * A * A));\n            var theta = Math.acos(T) / 3;\n            var ASqrt = mathSqrt(A);\n            var tmp = Math.cos(theta);\n            var t1 = (-b - 2 * ASqrt * tmp) / (3 * a);\n            var t2 = (-b + ASqrt * (tmp + THREE_SQRT * Math.sin(theta))) / (3 * a);\n            var t3 = (-b + ASqrt * (tmp - THREE_SQRT * Math.sin(theta))) / (3 * a);\n            if (t1 >= 0 && t1 <= 1) {\n                roots[n++] = t1;\n            }\n            if (t2 >= 0 && t2 <= 1) {\n                roots[n++] = t2;\n            }\n            if (t3 >= 0 && t3 <= 1) {\n                roots[n++] = t3;\n            }\n        }\n    }\n    return n;\n}\nexport function cubicExtrema(p0, p1, p2, p3, extrema) {\n    var b = 6 * p2 - 12 * p1 + 6 * p0;\n    var a = 9 * p1 + 3 * p3 - 3 * p0 - 9 * p2;\n    var c = 3 * p1 - 3 * p0;\n    var n = 0;\n    if (isAroundZero(a)) {\n        if (isNotAroundZero(b)) {\n            var t1 = -c / b;\n            if (t1 >= 0 && t1 <= 1) {\n                extrema[n++] = t1;\n            }\n        }\n    }\n    else {\n        var disc = b * b - 4 * a * c;\n        if (isAroundZero(disc)) {\n            extrema[0] = -b / (2 * a);\n        }\n        else if (disc > 0) {\n            var discSqrt = mathSqrt(disc);\n            var t1 = (-b + discSqrt) / (2 * a);\n            var t2 = (-b - discSqrt) / (2 * a);\n            if (t1 >= 0 && t1 <= 1) {\n                extrema[n++] = t1;\n            }\n            if (t2 >= 0 && t2 <= 1) {\n                extrema[n++] = t2;\n            }\n        }\n    }\n    return n;\n}\nexport function cubicSubdivide(p0, p1, p2, p3, t, out) {\n    var p01 = (p1 - p0) * t + p0;\n    var p12 = (p2 - p1) * t + p1;\n    var p23 = (p3 - p2) * t + p2;\n    var p012 = (p12 - p01) * t + p01;\n    var p123 = (p23 - p12) * t + p12;\n    var p0123 = (p123 - p012) * t + p012;\n    out[0] = p0;\n    out[1] = p01;\n    out[2] = p012;\n    out[3] = p0123;\n    out[4] = p0123;\n    out[5] = p123;\n    out[6] = p23;\n    out[7] = p3;\n}\nexport function cubicProjectPoint(x0, y0, x1, y1, x2, y2, x3, y3, x, y, out) {\n    var t;\n    var interval = 0.005;\n    var d = Infinity;\n    var prev;\n    var next;\n    var d1;\n    var d2;\n    _v0[0] = x;\n    _v0[1] = y;\n    for (var _t = 0; _t < 1; _t += 0.05) {\n        _v1[0] = cubicAt(x0, x1, x2, x3, _t);\n        _v1[1] = cubicAt(y0, y1, y2, y3, _t);\n        d1 = v2DistSquare(_v0, _v1);\n        if (d1 < d) {\n            t = _t;\n            d = d1;\n        }\n    }\n    d = Infinity;\n    for (var i = 0; i < 32; i++) {\n        if (interval < EPSILON_NUMERIC) {\n            break;\n        }\n        prev = t - interval;\n        next = t + interval;\n        _v1[0] = cubicAt(x0, x1, x2, x3, prev);\n        _v1[1] = cubicAt(y0, y1, y2, y3, prev);\n        d1 = v2DistSquare(_v1, _v0);\n        if (prev >= 0 && d1 < d) {\n            t = prev;\n            d = d1;\n        }\n        else {\n            _v2[0] = cubicAt(x0, x1, x2, x3, next);\n            _v2[1] = cubicAt(y0, y1, y2, y3, next);\n            d2 = v2DistSquare(_v2, _v0);\n            if (next <= 1 && d2 < d) {\n                t = next;\n                d = d2;\n            }\n            else {\n                interval *= 0.5;\n            }\n        }\n    }\n    if (out) {\n        out[0] = cubicAt(x0, x1, x2, x3, t);\n        out[1] = cubicAt(y0, y1, y2, y3, t);\n    }\n    return mathSqrt(d);\n}\nexport function cubicLength(x0, y0, x1, y1, x2, y2, x3, y3, iteration) {\n    var px = x0;\n    var py = y0;\n    var d = 0;\n    var step = 1 / iteration;\n    for (var i = 1; i <= iteration; i++) {\n        var t = i * step;\n        var x = cubicAt(x0, x1, x2, x3, t);\n        var y = cubicAt(y0, y1, y2, y3, t);\n        var dx = x - px;\n        var dy = y - py;\n        d += Math.sqrt(dx * dx + dy * dy);\n        px = x;\n        py = y;\n    }\n    return d;\n}\nexport function quadraticAt(p0, p1, p2, t) {\n    var onet = 1 - t;\n    return onet * (onet * p0 + 2 * t * p1) + t * t * p2;\n}\nexport function quadraticDerivativeAt(p0, p1, p2, t) {\n    return 2 * ((1 - t) * (p1 - p0) + t * (p2 - p1));\n}\nexport function quadraticRootAt(p0, p1, p2, val, roots) {\n    var a = p0 - 2 * p1 + p2;\n    var b = 2 * (p1 - p0);\n    var c = p0 - val;\n    var n = 0;\n    if (isAroundZero(a)) {\n        if (isNotAroundZero(b)) {\n            var t1 = -c / b;\n            if (t1 >= 0 && t1 <= 1) {\n                roots[n++] = t1;\n            }\n        }\n    }\n    else {\n        var disc = b * b - 4 * a * c;\n        if (isAroundZero(disc)) {\n            var t1 = -b / (2 * a);\n            if (t1 >= 0 && t1 <= 1) {\n                roots[n++] = t1;\n            }\n        }\n        else if (disc > 0) {\n            var discSqrt = mathSqrt(disc);\n            var t1 = (-b + discSqrt) / (2 * a);\n            var t2 = (-b - discSqrt) / (2 * a);\n            if (t1 >= 0 && t1 <= 1) {\n                roots[n++] = t1;\n            }\n            if (t2 >= 0 && t2 <= 1) {\n                roots[n++] = t2;\n            }\n        }\n    }\n    return n;\n}\nexport function quadraticExtremum(p0, p1, p2) {\n    var divider = p0 + p2 - 2 * p1;\n    if (divider === 0) {\n        return 0.5;\n    }\n    else {\n        return (p0 - p1) / divider;\n    }\n}\nexport function quadraticSubdivide(p0, p1, p2, t, out) {\n    var p01 = (p1 - p0) * t + p0;\n    var p12 = (p2 - p1) * t + p1;\n    var p012 = (p12 - p01) * t + p01;\n    out[0] = p0;\n    out[1] = p01;\n    out[2] = p012;\n    out[3] = p012;\n    out[4] = p12;\n    out[5] = p2;\n}\nexport function quadraticProjectPoint(x0, y0, x1, y1, x2, y2, x, y, out) {\n    var t;\n    var interval = 0.005;\n    var d = Infinity;\n    _v0[0] = x;\n    _v0[1] = y;\n    for (var _t = 0; _t < 1; _t += 0.05) {\n        _v1[0] = quadraticAt(x0, x1, x2, _t);\n        _v1[1] = quadraticAt(y0, y1, y2, _t);\n        var d1 = v2DistSquare(_v0, _v1);\n        if (d1 < d) {\n            t = _t;\n            d = d1;\n        }\n    }\n    d = Infinity;\n    for (var i = 0; i < 32; i++) {\n        if (interval < EPSILON_NUMERIC) {\n            break;\n        }\n        var prev = t - interval;\n        var next = t + interval;\n        _v1[0] = quadraticAt(x0, x1, x2, prev);\n        _v1[1] = quadraticAt(y0, y1, y2, prev);\n        var d1 = v2DistSquare(_v1, _v0);\n        if (prev >= 0 && d1 < d) {\n            t = prev;\n            d = d1;\n        }\n        else {\n            _v2[0] = quadraticAt(x0, x1, x2, next);\n            _v2[1] = quadraticAt(y0, y1, y2, next);\n            var d2 = v2DistSquare(_v2, _v0);\n            if (next <= 1 && d2 < d) {\n                t = next;\n                d = d2;\n            }\n            else {\n                interval *= 0.5;\n            }\n        }\n    }\n    if (out) {\n        out[0] = quadraticAt(x0, x1, x2, t);\n        out[1] = quadraticAt(y0, y1, y2, t);\n    }\n    return mathSqrt(d);\n}\nexport function quadraticLength(x0, y0, x1, y1, x2, y2, iteration) {\n    var px = x0;\n    var py = y0;\n    var d = 0;\n    var step = 1 / iteration;\n    for (var i = 1; i <= iteration; i++) {\n        var t = i * step;\n        var x = quadraticAt(x0, x1, x2, t);\n        var y = quadraticAt(y0, y1, y2, t);\n        var dx = x - px;\n        var dy = y - py;\n        d += Math.sqrt(dx * dx + dy * dy);\n        px = x;\n        py = y;\n    }\n    return d;\n}\n", "import { cubicAt, cubicRootAt } from '../core/curve.js';\nimport { trim } from '../core/util.js';\nvar regexp = /cubic-bezier\\(([0-9,\\.e ]+)\\)/;\nexport function createCubicEasingFunc(cubicEasingStr) {\n    var cubic = cubicEasingStr && regexp.exec(cubicEasingStr);\n    if (cubic) {\n        var points = cubic[1].split(',');\n        var a_1 = +trim(points[0]);\n        var b_1 = +trim(points[1]);\n        var c_1 = +trim(points[2]);\n        var d_1 = +trim(points[3]);\n        if (isNaN(a_1 + b_1 + c_1 + d_1)) {\n            return;\n        }\n        var roots_1 = [];\n        return function (p) {\n            return p <= 0\n                ? 0 : p >= 1\n                ? 1\n                : cubicRootAt(0, a_1, c_1, 1, p, roots_1) && cubicAt(0, b_1, d_1, 1, roots_1[0]);\n        };\n    }\n}\n", "import easingFuncs from './easing.js';\nimport { isFunction, noop } from '../core/util.js';\nimport { createCubicEasingFunc } from './cubicEasing.js';\nvar Clip = (function () {\n    function Clip(opts) {\n        this._inited = false;\n        this._startTime = 0;\n        this._pausedTime = 0;\n        this._paused = false;\n        this._life = opts.life || 1000;\n        this._delay = opts.delay || 0;\n        this.loop = opts.loop || false;\n        this.onframe = opts.onframe || noop;\n        this.ondestroy = opts.ondestroy || noop;\n        this.onrestart = opts.onrestart || noop;\n        opts.easing && this.setEasing(opts.easing);\n    }\n    Clip.prototype.step = function (globalTime, deltaTime) {\n        if (!this._inited) {\n            this._startTime = globalTime + this._delay;\n            this._inited = true;\n        }\n        if (this._paused) {\n            this._pausedTime += deltaTime;\n            return;\n        }\n        var life = this._life;\n        var elapsedTime = globalTime - this._startTime - this._pausedTime;\n        var percent = elapsedTime / life;\n        if (percent < 0) {\n            percent = 0;\n        }\n        percent = Math.min(percent, 1);\n        var easingFunc = this.easingFunc;\n        var schedule = easingFunc ? easingFunc(percent) : percent;\n        this.onframe(schedule);\n        if (percent === 1) {\n            if (this.loop) {\n                var remainder = elapsedTime % life;\n                this._startTime = globalTime - remainder;\n                this._pausedTime = 0;\n                this.onrestart();\n            }\n            else {\n                return true;\n            }\n        }\n        return false;\n    };\n    Clip.prototype.pause = function () {\n        this._paused = true;\n    };\n    Clip.prototype.resume = function () {\n        this._paused = false;\n    };\n    Clip.prototype.setEasing = function (easing) {\n        this.easing = easing;\n        this.easingFunc = isFunction(easing)\n            ? easing\n            : easingFuncs[easing] || createCubicEasingFunc(easing);\n    };\n    return Clip;\n}());\nexport default Clip;\n", "import LRU from '../core/LRU.js';\nimport { extend, isFunction, isGradientObject, isString, map } from '../core/util.js';\nvar kCSSColorTable = {\n    'transparent': [0, 0, 0, 0], 'aliceblue': [240, 248, 255, 1],\n    'antiquewhite': [250, 235, 215, 1], 'aqua': [0, 255, 255, 1],\n    'aquamarine': [127, 255, 212, 1], 'azure': [240, 255, 255, 1],\n    'beige': [245, 245, 220, 1], 'bisque': [255, 228, 196, 1],\n    'black': [0, 0, 0, 1], 'blanchedalmond': [255, 235, 205, 1],\n    'blue': [0, 0, 255, 1], 'blueviolet': [138, 43, 226, 1],\n    'brown': [165, 42, 42, 1], 'burlywood': [222, 184, 135, 1],\n    'cadetblue': [95, 158, 160, 1], 'chartreuse': [127, 255, 0, 1],\n    'chocolate': [210, 105, 30, 1], 'coral': [255, 127, 80, 1],\n    'cornflowerblue': [100, 149, 237, 1], 'cornsilk': [255, 248, 220, 1],\n    'crimson': [220, 20, 60, 1], 'cyan': [0, 255, 255, 1],\n    'darkblue': [0, 0, 139, 1], 'darkcyan': [0, 139, 139, 1],\n    'darkgoldenrod': [184, 134, 11, 1], 'darkgray': [169, 169, 169, 1],\n    'darkgreen': [0, 100, 0, 1], 'darkgrey': [169, 169, 169, 1],\n    'darkkhaki': [189, 183, 107, 1], 'darkmagenta': [139, 0, 139, 1],\n    'darkolivegreen': [85, 107, 47, 1], 'darkorange': [255, 140, 0, 1],\n    'darkorchid': [153, 50, 204, 1], 'darkred': [139, 0, 0, 1],\n    'darksalmon': [233, 150, 122, 1], 'darkseagreen': [143, 188, 143, 1],\n    'darkslateblue': [72, 61, 139, 1], 'darkslategray': [47, 79, 79, 1],\n    'darkslategrey': [47, 79, 79, 1], 'darkturquoise': [0, 206, 209, 1],\n    'darkviolet': [148, 0, 211, 1], 'deeppink': [255, 20, 147, 1],\n    'deepskyblue': [0, 191, 255, 1], 'dimgray': [105, 105, 105, 1],\n    'dimgrey': [105, 105, 105, 1], 'dodgerblue': [30, 144, 255, 1],\n    'firebrick': [178, 34, 34, 1], 'floralwhite': [255, 250, 240, 1],\n    'forestgreen': [34, 139, 34, 1], 'fuchsia': [255, 0, 255, 1],\n    'gainsboro': [220, 220, 220, 1], 'ghostwhite': [248, 248, 255, 1],\n    'gold': [255, 215, 0, 1], 'goldenrod': [218, 165, 32, 1],\n    'gray': [128, 128, 128, 1], 'green': [0, 128, 0, 1],\n    'greenyellow': [173, 255, 47, 1], 'grey': [128, 128, 128, 1],\n    'honeydew': [240, 255, 240, 1], 'hotpink': [255, 105, 180, 1],\n    'indianred': [205, 92, 92, 1], 'indigo': [75, 0, 130, 1],\n    'ivory': [255, 255, 240, 1], 'khaki': [240, 230, 140, 1],\n    'lavender': [230, 230, 250, 1], 'lavenderblush': [255, 240, 245, 1],\n    'lawngreen': [124, 252, 0, 1], 'lemonchiffon': [255, 250, 205, 1],\n    'lightblue': [173, 216, 230, 1], 'lightcoral': [240, 128, 128, 1],\n    'lightcyan': [224, 255, 255, 1], 'lightgoldenrodyellow': [250, 250, 210, 1],\n    'lightgray': [211, 211, 211, 1], 'lightgreen': [144, 238, 144, 1],\n    'lightgrey': [211, 211, 211, 1], 'lightpink': [255, 182, 193, 1],\n    'lightsalmon': [255, 160, 122, 1], 'lightseagreen': [32, 178, 170, 1],\n    'lightskyblue': [135, 206, 250, 1], 'lightslategray': [119, 136, 153, 1],\n    'lightslategrey': [119, 136, 153, 1], 'lightsteelblue': [176, 196, 222, 1],\n    'lightyellow': [255, 255, 224, 1], 'lime': [0, 255, 0, 1],\n    'limegreen': [50, 205, 50, 1], 'linen': [250, 240, 230, 1],\n    'magenta': [255, 0, 255, 1], 'maroon': [128, 0, 0, 1],\n    'mediumaquamarine': [102, 205, 170, 1], 'mediumblue': [0, 0, 205, 1],\n    'mediumorchid': [186, 85, 211, 1], 'mediumpurple': [147, 112, 219, 1],\n    'mediumseagreen': [60, 179, 113, 1], 'mediumslateblue': [123, 104, 238, 1],\n    'mediumspringgreen': [0, 250, 154, 1], 'mediumturquoise': [72, 209, 204, 1],\n    'mediumvioletred': [199, 21, 133, 1], 'midnightblue': [25, 25, 112, 1],\n    'mintcream': [245, 255, 250, 1], 'mistyrose': [255, 228, 225, 1],\n    'moccasin': [255, 228, 181, 1], 'navajowhite': [255, 222, 173, 1],\n    'navy': [0, 0, 128, 1], 'oldlace': [253, 245, 230, 1],\n    'olive': [128, 128, 0, 1], 'olivedrab': [107, 142, 35, 1],\n    'orange': [255, 165, 0, 1], 'orangered': [255, 69, 0, 1],\n    'orchid': [218, 112, 214, 1], 'palegoldenrod': [238, 232, 170, 1],\n    'palegreen': [152, 251, 152, 1], 'paleturquoise': [175, 238, 238, 1],\n    'palevioletred': [219, 112, 147, 1], 'papayawhip': [255, 239, 213, 1],\n    'peachpuff': [255, 218, 185, 1], 'peru': [205, 133, 63, 1],\n    'pink': [255, 192, 203, 1], 'plum': [221, 160, 221, 1],\n    'powderblue': [176, 224, 230, 1], 'purple': [128, 0, 128, 1],\n    'red': [255, 0, 0, 1], 'rosybrown': [188, 143, 143, 1],\n    'royalblue': [65, 105, 225, 1], 'saddlebrown': [139, 69, 19, 1],\n    'salmon': [250, 128, 114, 1], 'sandybrown': [244, 164, 96, 1],\n    'seagreen': [46, 139, 87, 1], 'seashell': [255, 245, 238, 1],\n    'sienna': [160, 82, 45, 1], 'silver': [192, 192, 192, 1],\n    'skyblue': [135, 206, 235, 1], 'slateblue': [106, 90, 205, 1],\n    'slategray': [112, 128, 144, 1], 'slategrey': [112, 128, 144, 1],\n    'snow': [255, 250, 250, 1], 'springgreen': [0, 255, 127, 1],\n    'steelblue': [70, 130, 180, 1], 'tan': [210, 180, 140, 1],\n    'teal': [0, 128, 128, 1], 'thistle': [216, 191, 216, 1],\n    'tomato': [255, 99, 71, 1], 'turquoise': [64, 224, 208, 1],\n    'violet': [238, 130, 238, 1], 'wheat': [245, 222, 179, 1],\n    'white': [255, 255, 255, 1], 'whitesmoke': [245, 245, 245, 1],\n    'yellow': [255, 255, 0, 1], 'yellowgreen': [154, 205, 50, 1]\n};\nfunction clampCssByte(i) {\n    i = Math.round(i);\n    return i < 0 ? 0 : i > 255 ? 255 : i;\n}\nfunction clampCssAngle(i) {\n    i = Math.round(i);\n    return i < 0 ? 0 : i > 360 ? 360 : i;\n}\nfunction clampCssFloat(f) {\n    return f < 0 ? 0 : f > 1 ? 1 : f;\n}\nexport function parseCssInt(val) {\n    var str = val;\n    if (str.length && str.charAt(str.length - 1) === '%') {\n        return clampCssByte(parseFloat(str) / 100 * 255);\n    }\n    return clampCssByte(parseInt(str, 10));\n}\nexport function parseCssFloat(val) {\n    var str = val;\n    if (str.length && str.charAt(str.length - 1) === '%') {\n        return clampCssFloat(parseFloat(str) / 100);\n    }\n    return clampCssFloat(parseFloat(str));\n}\nfunction cssHueToRgb(m1, m2, h) {\n    if (h < 0) {\n        h += 1;\n    }\n    else if (h > 1) {\n        h -= 1;\n    }\n    if (h * 6 < 1) {\n        return m1 + (m2 - m1) * h * 6;\n    }\n    if (h * 2 < 1) {\n        return m2;\n    }\n    if (h * 3 < 2) {\n        return m1 + (m2 - m1) * (2 / 3 - h) * 6;\n    }\n    return m1;\n}\nfunction lerpNumber(a, b, p) {\n    return a + (b - a) * p;\n}\nfunction setRgba(out, r, g, b, a) {\n    out[0] = r;\n    out[1] = g;\n    out[2] = b;\n    out[3] = a;\n    return out;\n}\nfunction copyRgba(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}\nvar colorCache = new LRU(20);\nvar lastRemovedArr = null;\nfunction putToCache(colorStr, rgbaArr) {\n    if (lastRemovedArr) {\n        copyRgba(lastRemovedArr, rgbaArr);\n    }\n    lastRemovedArr = colorCache.put(colorStr, lastRemovedArr || (rgbaArr.slice()));\n}\nexport function parse(colorStr, rgbaArr) {\n    if (!colorStr) {\n        return;\n    }\n    rgbaArr = rgbaArr || [];\n    var cached = colorCache.get(colorStr);\n    if (cached) {\n        return copyRgba(rgbaArr, cached);\n    }\n    colorStr = colorStr + '';\n    var str = colorStr.replace(/ /g, '').toLowerCase();\n    if (str in kCSSColorTable) {\n        copyRgba(rgbaArr, kCSSColorTable[str]);\n        putToCache(colorStr, rgbaArr);\n        return rgbaArr;\n    }\n    var strLen = str.length;\n    if (str.charAt(0) === '#') {\n        if (strLen === 4 || strLen === 5) {\n            var iv = parseInt(str.slice(1, 4), 16);\n            if (!(iv >= 0 && iv <= 0xfff)) {\n                setRgba(rgbaArr, 0, 0, 0, 1);\n                return;\n            }\n            setRgba(rgbaArr, ((iv & 0xf00) >> 4) | ((iv & 0xf00) >> 8), (iv & 0xf0) | ((iv & 0xf0) >> 4), (iv & 0xf) | ((iv & 0xf) << 4), strLen === 5 ? parseInt(str.slice(4), 16) / 0xf : 1);\n            putToCache(colorStr, rgbaArr);\n            return rgbaArr;\n        }\n        else if (strLen === 7 || strLen === 9) {\n            var iv = parseInt(str.slice(1, 7), 16);\n            if (!(iv >= 0 && iv <= 0xffffff)) {\n                setRgba(rgbaArr, 0, 0, 0, 1);\n                return;\n            }\n            setRgba(rgbaArr, (iv & 0xff0000) >> 16, (iv & 0xff00) >> 8, iv & 0xff, strLen === 9 ? parseInt(str.slice(7), 16) / 0xff : 1);\n            putToCache(colorStr, rgbaArr);\n            return rgbaArr;\n        }\n        return;\n    }\n    var op = str.indexOf('(');\n    var ep = str.indexOf(')');\n    if (op !== -1 && ep + 1 === strLen) {\n        var fname = str.substr(0, op);\n        var params = str.substr(op + 1, ep - (op + 1)).split(',');\n        var alpha = 1;\n        switch (fname) {\n            case 'rgba':\n                if (params.length !== 4) {\n                    return params.length === 3\n                        ? setRgba(rgbaArr, +params[0], +params[1], +params[2], 1)\n                        : setRgba(rgbaArr, 0, 0, 0, 1);\n                }\n                alpha = parseCssFloat(params.pop());\n            case 'rgb':\n                if (params.length >= 3) {\n                    setRgba(rgbaArr, parseCssInt(params[0]), parseCssInt(params[1]), parseCssInt(params[2]), params.length === 3 ? alpha : parseCssFloat(params[3]));\n                    putToCache(colorStr, rgbaArr);\n                    return rgbaArr;\n                }\n                else {\n                    setRgba(rgbaArr, 0, 0, 0, 1);\n                    return;\n                }\n            case 'hsla':\n                if (params.length !== 4) {\n                    setRgba(rgbaArr, 0, 0, 0, 1);\n                    return;\n                }\n                params[3] = parseCssFloat(params[3]);\n                hsla2rgba(params, rgbaArr);\n                putToCache(colorStr, rgbaArr);\n                return rgbaArr;\n            case 'hsl':\n                if (params.length !== 3) {\n                    setRgba(rgbaArr, 0, 0, 0, 1);\n                    return;\n                }\n                hsla2rgba(params, rgbaArr);\n                putToCache(colorStr, rgbaArr);\n                return rgbaArr;\n            default:\n                return;\n        }\n    }\n    setRgba(rgbaArr, 0, 0, 0, 1);\n    return;\n}\nfunction hsla2rgba(hsla, rgba) {\n    var h = (((parseFloat(hsla[0]) % 360) + 360) % 360) / 360;\n    var s = parseCssFloat(hsla[1]);\n    var l = parseCssFloat(hsla[2]);\n    var m2 = l <= 0.5 ? l * (s + 1) : l + s - l * s;\n    var m1 = l * 2 - m2;\n    rgba = rgba || [];\n    setRgba(rgba, clampCssByte(cssHueToRgb(m1, m2, h + 1 / 3) * 255), clampCssByte(cssHueToRgb(m1, m2, h) * 255), clampCssByte(cssHueToRgb(m1, m2, h - 1 / 3) * 255), 1);\n    if (hsla.length === 4) {\n        rgba[3] = hsla[3];\n    }\n    return rgba;\n}\nfunction rgba2hsla(rgba) {\n    if (!rgba) {\n        return;\n    }\n    var R = rgba[0] / 255;\n    var G = rgba[1] / 255;\n    var B = rgba[2] / 255;\n    var vMin = Math.min(R, G, B);\n    var vMax = Math.max(R, G, B);\n    var delta = vMax - vMin;\n    var L = (vMax + vMin) / 2;\n    var H;\n    var S;\n    if (delta === 0) {\n        H = 0;\n        S = 0;\n    }\n    else {\n        if (L < 0.5) {\n            S = delta / (vMax + vMin);\n        }\n        else {\n            S = delta / (2 - vMax - vMin);\n        }\n        var deltaR = (((vMax - R) / 6) + (delta / 2)) / delta;\n        var deltaG = (((vMax - G) / 6) + (delta / 2)) / delta;\n        var deltaB = (((vMax - B) / 6) + (delta / 2)) / delta;\n        if (R === vMax) {\n            H = deltaB - deltaG;\n        }\n        else if (G === vMax) {\n            H = (1 / 3) + deltaR - deltaB;\n        }\n        else if (B === vMax) {\n            H = (2 / 3) + deltaG - deltaR;\n        }\n        if (H < 0) {\n            H += 1;\n        }\n        if (H > 1) {\n            H -= 1;\n        }\n    }\n    var hsla = [H * 360, S, L];\n    if (rgba[3] != null) {\n        hsla.push(rgba[3]);\n    }\n    return hsla;\n}\nexport function lift(color, level) {\n    var colorArr = parse(color);\n    if (colorArr) {\n        for (var i = 0; i < 3; i++) {\n            if (level < 0) {\n                colorArr[i] = colorArr[i] * (1 - level) | 0;\n            }\n            else {\n                colorArr[i] = ((255 - colorArr[i]) * level + colorArr[i]) | 0;\n            }\n            if (colorArr[i] > 255) {\n                colorArr[i] = 255;\n            }\n            else if (colorArr[i] < 0) {\n                colorArr[i] = 0;\n            }\n        }\n        return stringify(colorArr, colorArr.length === 4 ? 'rgba' : 'rgb');\n    }\n}\nexport function toHex(color) {\n    var colorArr = parse(color);\n    if (colorArr) {\n        return ((1 << 24) + (colorArr[0] << 16) + (colorArr[1] << 8) + (+colorArr[2])).toString(16).slice(1);\n    }\n}\nexport function fastLerp(normalizedValue, colors, out) {\n    if (!(colors && colors.length)\n        || !(normalizedValue >= 0 && normalizedValue <= 1)) {\n        return;\n    }\n    out = out || [];\n    var value = normalizedValue * (colors.length - 1);\n    var leftIndex = Math.floor(value);\n    var rightIndex = Math.ceil(value);\n    var leftColor = colors[leftIndex];\n    var rightColor = colors[rightIndex];\n    var dv = value - leftIndex;\n    out[0] = clampCssByte(lerpNumber(leftColor[0], rightColor[0], dv));\n    out[1] = clampCssByte(lerpNumber(leftColor[1], rightColor[1], dv));\n    out[2] = clampCssByte(lerpNumber(leftColor[2], rightColor[2], dv));\n    out[3] = clampCssFloat(lerpNumber(leftColor[3], rightColor[3], dv));\n    return out;\n}\nexport var fastMapToColor = fastLerp;\nexport function lerp(normalizedValue, colors, fullOutput) {\n    if (!(colors && colors.length)\n        || !(normalizedValue >= 0 && normalizedValue <= 1)) {\n        return;\n    }\n    var value = normalizedValue * (colors.length - 1);\n    var leftIndex = Math.floor(value);\n    var rightIndex = Math.ceil(value);\n    var leftColor = parse(colors[leftIndex]);\n    var rightColor = parse(colors[rightIndex]);\n    var dv = value - leftIndex;\n    var color = stringify([\n        clampCssByte(lerpNumber(leftColor[0], rightColor[0], dv)),\n        clampCssByte(lerpNumber(leftColor[1], rightColor[1], dv)),\n        clampCssByte(lerpNumber(leftColor[2], rightColor[2], dv)),\n        clampCssFloat(lerpNumber(leftColor[3], rightColor[3], dv))\n    ], 'rgba');\n    return fullOutput\n        ? {\n            color: color,\n            leftIndex: leftIndex,\n            rightIndex: rightIndex,\n            value: value\n        }\n        : color;\n}\nexport var mapToColor = lerp;\nexport function modifyHSL(color, h, s, l) {\n    var colorArr = parse(color);\n    if (color) {\n        colorArr = rgba2hsla(colorArr);\n        h != null && (colorArr[0] = clampCssAngle(isFunction(h) ? h(colorArr[0]) : h));\n        s != null && (colorArr[1] = parseCssFloat(isFunction(s) ? s(colorArr[1]) : s));\n        l != null && (colorArr[2] = parseCssFloat(isFunction(l) ? l(colorArr[2]) : l));\n        return stringify(hsla2rgba(colorArr), 'rgba');\n    }\n}\nexport function modifyAlpha(color, alpha) {\n    var colorArr = parse(color);\n    if (colorArr && alpha != null) {\n        colorArr[3] = clampCssFloat(alpha);\n        return stringify(colorArr, 'rgba');\n    }\n}\nexport function stringify(arrColor, type) {\n    if (!arrColor || !arrColor.length) {\n        return;\n    }\n    var colorStr = arrColor[0] + ',' + arrColor[1] + ',' + arrColor[2];\n    if (type === 'rgba' || type === 'hsva' || type === 'hsla') {\n        colorStr += ',' + arrColor[3];\n    }\n    return type + '(' + colorStr + ')';\n}\nexport function lum(color, backgroundLum) {\n    var arr = parse(color);\n    return arr\n        ? (0.299 * arr[0] + 0.587 * arr[1] + 0.114 * arr[2]) * arr[3] / 255\n            + (1 - arr[3]) * backgroundLum\n        : 0;\n}\nexport function random() {\n    return stringify([\n        Math.round(Math.random() * 255),\n        Math.round(Math.random() * 255),\n        Math.round(Math.random() * 255)\n    ], 'rgb');\n}\nvar liftedColorCache = new LRU(100);\nexport function liftColor(color) {\n    if (isString(color)) {\n        var liftedColor = liftedColorCache.get(color);\n        if (!liftedColor) {\n            liftedColor = lift(color, -0.1);\n            liftedColorCache.put(color, liftedColor);\n        }\n        return liftedColor;\n    }\n    else if (isGradientObject(color)) {\n        var ret = extend({}, color);\n        ret.colorStops = map(color.colorStops, function (stop) { return ({\n            offset: stop.offset,\n            color: lift(stop.color, -0.1)\n        }); });\n        return ret;\n    }\n    return color;\n}\n", "var Entry = (function () {\n    function Entry(val) {\n        this.value = val;\n    }\n    return Entry;\n}());\nexport { Entry };\nvar LinkedList = (function () {\n    function LinkedList() {\n        this._len = 0;\n    }\n    LinkedList.prototype.insert = function (val) {\n        var entry = new Entry(val);\n        this.insertEntry(entry);\n        return entry;\n    };\n    LinkedList.prototype.insertEntry = function (entry) {\n        if (!this.head) {\n            this.head = this.tail = entry;\n        }\n        else {\n            this.tail.next = entry;\n            entry.prev = this.tail;\n            entry.next = null;\n            this.tail = entry;\n        }\n        this._len++;\n    };\n    LinkedList.prototype.remove = function (entry) {\n        var prev = entry.prev;\n        var next = entry.next;\n        if (prev) {\n            prev.next = next;\n        }\n        else {\n            this.head = next;\n        }\n        if (next) {\n            next.prev = prev;\n        }\n        else {\n            this.tail = prev;\n        }\n        entry.next = entry.prev = null;\n        this._len--;\n    };\n    LinkedList.prototype.len = function () {\n        return this._len;\n    };\n    LinkedList.prototype.clear = function () {\n        this.head = this.tail = null;\n        this._len = 0;\n    };\n    return LinkedList;\n}());\nexport { LinkedList };\nvar LRU = (function () {\n    function LRU(maxSize) {\n        this._list = new LinkedList();\n        this._maxSize = 10;\n        this._map = {};\n        this._maxSize = maxSize;\n    }\n    LRU.prototype.put = function (key, value) {\n        var list = this._list;\n        var map = this._map;\n        var removed = null;\n        if (map[key] == null) {\n            var len = list.len();\n            var entry = this._lastRemovedEntry;\n            if (len >= this._maxSize && len > 0) {\n                var leastUsedEntry = list.head;\n                list.remove(leastUsedEntry);\n                delete map[leastUsedEntry.key];\n                removed = leastUsedEntry.value;\n                this._lastRemovedEntry = leastUsedEntry;\n            }\n            if (entry) {\n                entry.value = value;\n            }\n            else {\n                entry = new Entry(value);\n            }\n            entry.key = key;\n            list.insertEntry(entry);\n            map[key] = entry;\n        }\n        return removed;\n    };\n    LRU.prototype.get = function (key) {\n        var entry = this._map[key];\n        var list = this._list;\n        if (entry != null) {\n            if (entry !== list.tail) {\n                list.remove(entry);\n                list.insertEntry(entry);\n            }\n            return entry.value;\n        }\n    };\n    LRU.prototype.clear = function () {\n        this._list.clear();\n        this._map = {};\n    };\n    LRU.prototype.len = function () {\n        return this._list.len();\n    };\n    return LRU;\n}());\nexport default LRU;\n", "import { RADIAN_TO_DEGREE, retrieve2, logError, isFunction } from '../core/util.js';\nimport { parse } from '../tool/color.js';\nimport env from '../core/env.js';\nvar mathRound = Math.round;\nexport function normalizeColor(color) {\n    var opacity;\n    if (!color || color === 'transparent') {\n        color = 'none';\n    }\n    else if (typeof color === 'string' && color.indexOf('rgba') > -1) {\n        var arr = parse(color);\n        if (arr) {\n            color = 'rgb(' + arr[0] + ',' + arr[1] + ',' + arr[2] + ')';\n            opacity = arr[3];\n        }\n    }\n    return {\n        color: color,\n        opacity: opacity == null ? 1 : opacity\n    };\n}\nvar EPSILON = 1e-4;\nexport function isAroundZero(transform) {\n    return transform < EPSILON && transform > -EPSILON;\n}\nexport function round3(transform) {\n    return mathRound(transform * 1e3) / 1e3;\n}\nexport function round4(transform) {\n    return mathRound(transform * 1e4) / 1e4;\n}\nexport function round1(transform) {\n    return mathRound(transform * 10) / 10;\n}\nexport function getMatrixStr(m) {\n    return 'matrix('\n        + round3(m[0]) + ','\n        + round3(m[1]) + ','\n        + round3(m[2]) + ','\n        + round3(m[3]) + ','\n        + round4(m[4]) + ','\n        + round4(m[5])\n        + ')';\n}\nexport var TEXT_ALIGN_TO_ANCHOR = {\n    left: 'start',\n    right: 'end',\n    center: 'middle',\n    middle: 'middle'\n};\nexport function adjustTextY(y, lineHeight, textBaseline) {\n    if (textBaseline === 'top') {\n        y += lineHeight / 2;\n    }\n    else if (textBaseline === 'bottom') {\n        y -= lineHeight / 2;\n    }\n    return y;\n}\nexport function hasShadow(style) {\n    return style\n        && (style.shadowBlur || style.shadowOffsetX || style.shadowOffsetY);\n}\nexport function getShadowKey(displayable) {\n    var style = displayable.style;\n    var globalScale = displayable.getGlobalScale();\n    return [\n        style.shadowColor,\n        (style.shadowBlur || 0).toFixed(2),\n        (style.shadowOffsetX || 0).toFixed(2),\n        (style.shadowOffsetY || 0).toFixed(2),\n        globalScale[0],\n        globalScale[1]\n    ].join(',');\n}\nexport function getClipPathsKey(clipPaths) {\n    var key = [];\n    if (clipPaths) {\n        for (var i = 0; i < clipPaths.length; i++) {\n            var clipPath = clipPaths[i];\n            key.push(clipPath.id);\n        }\n    }\n    return key.join(',');\n}\nexport function isImagePattern(val) {\n    return val && (!!val.image);\n}\nexport function isSVGPattern(val) {\n    return val && (!!val.svgElement);\n}\nexport function isPattern(val) {\n    return isImagePattern(val) || isSVGPattern(val);\n}\nexport function isLinearGradient(val) {\n    return val.type === 'linear';\n}\nexport function isRadialGradient(val) {\n    return val.type === 'radial';\n}\nexport function isGradient(val) {\n    return val && (val.type === 'linear'\n        || val.type === 'radial');\n}\nexport function getIdURL(id) {\n    return \"url(#\" + id + \")\";\n}\nexport function getPathPrecision(el) {\n    var scale = el.getGlobalScale();\n    var size = Math.max(scale[0], scale[1]);\n    return Math.max(Math.ceil(Math.log(size) / Math.log(10)), 1);\n}\nexport function getSRTTransformString(transform) {\n    var x = transform.x || 0;\n    var y = transform.y || 0;\n    var rotation = (transform.rotation || 0) * RADIAN_TO_DEGREE;\n    var scaleX = retrieve2(transform.scaleX, 1);\n    var scaleY = retrieve2(transform.scaleY, 1);\n    var skewX = transform.skewX || 0;\n    var skewY = transform.skewY || 0;\n    var res = [];\n    if (x || y) {\n        res.push(\"translate(\" + x + \"px,\" + y + \"px)\");\n    }\n    if (rotation) {\n        res.push(\"rotate(\" + rotation + \")\");\n    }\n    if (scaleX !== 1 || scaleY !== 1) {\n        res.push(\"scale(\" + scaleX + \",\" + scaleY + \")\");\n    }\n    if (skewX || skewY) {\n        res.push(\"skew(\" + mathRound(skewX * RADIAN_TO_DEGREE) + \"deg, \" + mathRound(skewY * RADIAN_TO_DEGREE) + \"deg)\");\n    }\n    return res.join(' ');\n}\nexport var encodeBase64 = (function () {\n    if (env.hasGlobalWindow && isFunction(window.btoa)) {\n        return function (str) {\n            return window.btoa(unescape(encodeURIComponent(str)));\n        };\n    }\n    if (typeof Buffer !== 'undefined') {\n        return function (str) {\n            return Buffer.from(str).toString('base64');\n        };\n    }\n    return function (str) {\n        if (process.env.NODE_ENV !== 'production') {\n            logError('Base64 isn\\'t natively supported in the current environment.');\n        }\n        return null;\n    };\n})();\n", "import Clip from './Clip.js';\nimport * as color from '../tool/color.js';\nimport { eqNaN, extend, isArrayLike, isFunction, isGradientObject, isNumber, isString, keys, logError, map } from '../core/util.js';\nimport easingFuncs from './easing.js';\nimport { createCubicEasingFunc } from './cubicEasing.js';\nimport { isLinearGradient, isRadialGradient } from '../svg/helper.js';\n;\nvar arraySlice = Array.prototype.slice;\nfunction interpolateNumber(p0, p1, percent) {\n    return (p1 - p0) * percent + p0;\n}\nfunction interpolate1DArray(out, p0, p1, percent) {\n    var len = p0.length;\n    for (var i = 0; i < len; i++) {\n        out[i] = interpolateNumber(p0[i], p1[i], percent);\n    }\n    return out;\n}\nfunction interpolate2DArray(out, p0, p1, percent) {\n    var len = p0.length;\n    var len2 = len && p0[0].length;\n    for (var i = 0; i < len; i++) {\n        if (!out[i]) {\n            out[i] = [];\n        }\n        for (var j = 0; j < len2; j++) {\n            out[i][j] = interpolateNumber(p0[i][j], p1[i][j], percent);\n        }\n    }\n    return out;\n}\nfunction add1DArray(out, p0, p1, sign) {\n    var len = p0.length;\n    for (var i = 0; i < len; i++) {\n        out[i] = p0[i] + p1[i] * sign;\n    }\n    return out;\n}\nfunction add2DArray(out, p0, p1, sign) {\n    var len = p0.length;\n    var len2 = len && p0[0].length;\n    for (var i = 0; i < len; i++) {\n        if (!out[i]) {\n            out[i] = [];\n        }\n        for (var j = 0; j < len2; j++) {\n            out[i][j] = p0[i][j] + p1[i][j] * sign;\n        }\n    }\n    return out;\n}\nfunction fillColorStops(val0, val1) {\n    var len0 = val0.length;\n    var len1 = val1.length;\n    var shorterArr = len0 > len1 ? val1 : val0;\n    var shorterLen = Math.min(len0, len1);\n    var last = shorterArr[shorterLen - 1] || { color: [0, 0, 0, 0], offset: 0 };\n    for (var i = shorterLen; i < Math.max(len0, len1); i++) {\n        shorterArr.push({\n            offset: last.offset,\n            color: last.color.slice()\n        });\n    }\n}\nfunction fillArray(val0, val1, arrDim) {\n    var arr0 = val0;\n    var arr1 = val1;\n    if (!arr0.push || !arr1.push) {\n        return;\n    }\n    var arr0Len = arr0.length;\n    var arr1Len = arr1.length;\n    if (arr0Len !== arr1Len) {\n        var isPreviousLarger = arr0Len > arr1Len;\n        if (isPreviousLarger) {\n            arr0.length = arr1Len;\n        }\n        else {\n            for (var i = arr0Len; i < arr1Len; i++) {\n                arr0.push(arrDim === 1 ? arr1[i] : arraySlice.call(arr1[i]));\n            }\n        }\n    }\n    var len2 = arr0[0] && arr0[0].length;\n    for (var i = 0; i < arr0.length; i++) {\n        if (arrDim === 1) {\n            if (isNaN(arr0[i])) {\n                arr0[i] = arr1[i];\n            }\n        }\n        else {\n            for (var j = 0; j < len2; j++) {\n                if (isNaN(arr0[i][j])) {\n                    arr0[i][j] = arr1[i][j];\n                }\n            }\n        }\n    }\n}\nexport function cloneValue(value) {\n    if (isArrayLike(value)) {\n        var len = value.length;\n        if (isArrayLike(value[0])) {\n            var ret = [];\n            for (var i = 0; i < len; i++) {\n                ret.push(arraySlice.call(value[i]));\n            }\n            return ret;\n        }\n        return arraySlice.call(value);\n    }\n    return value;\n}\nfunction rgba2String(rgba) {\n    rgba[0] = Math.floor(rgba[0]) || 0;\n    rgba[1] = Math.floor(rgba[1]) || 0;\n    rgba[2] = Math.floor(rgba[2]) || 0;\n    rgba[3] = rgba[3] == null ? 1 : rgba[3];\n    return 'rgba(' + rgba.join(',') + ')';\n}\nfunction guessArrayDim(value) {\n    return isArrayLike(value && value[0]) ? 2 : 1;\n}\nvar VALUE_TYPE_NUMBER = 0;\nvar VALUE_TYPE_1D_ARRAY = 1;\nvar VALUE_TYPE_2D_ARRAY = 2;\nvar VALUE_TYPE_COLOR = 3;\nvar VALUE_TYPE_LINEAR_GRADIENT = 4;\nvar VALUE_TYPE_RADIAL_GRADIENT = 5;\nvar VALUE_TYPE_UNKOWN = 6;\nfunction isGradientValueType(valType) {\n    return valType === VALUE_TYPE_LINEAR_GRADIENT || valType === VALUE_TYPE_RADIAL_GRADIENT;\n}\nfunction isArrayValueType(valType) {\n    return valType === VALUE_TYPE_1D_ARRAY || valType === VALUE_TYPE_2D_ARRAY;\n}\nvar tmpRgba = [0, 0, 0, 0];\nvar Track = (function () {\n    function Track(propName) {\n        this.keyframes = [];\n        this.discrete = false;\n        this._invalid = false;\n        this._needsSort = false;\n        this._lastFr = 0;\n        this._lastFrP = 0;\n        this.propName = propName;\n    }\n    Track.prototype.isFinished = function () {\n        return this._finished;\n    };\n    Track.prototype.setFinished = function () {\n        this._finished = true;\n        if (this._additiveTrack) {\n            this._additiveTrack.setFinished();\n        }\n    };\n    Track.prototype.needsAnimate = function () {\n        return this.keyframes.length >= 1;\n    };\n    Track.prototype.getAdditiveTrack = function () {\n        return this._additiveTrack;\n    };\n    Track.prototype.addKeyframe = function (time, rawValue, easing) {\n        this._needsSort = true;\n        var keyframes = this.keyframes;\n        var len = keyframes.length;\n        var discrete = false;\n        var valType = VALUE_TYPE_UNKOWN;\n        var value = rawValue;\n        if (isArrayLike(rawValue)) {\n            var arrayDim = guessArrayDim(rawValue);\n            valType = arrayDim;\n            if (arrayDim === 1 && !isNumber(rawValue[0])\n                || arrayDim === 2 && !isNumber(rawValue[0][0])) {\n                discrete = true;\n            }\n        }\n        else {\n            if (isNumber(rawValue) && !eqNaN(rawValue)) {\n                valType = VALUE_TYPE_NUMBER;\n            }\n            else if (isString(rawValue)) {\n                if (!isNaN(+rawValue)) {\n                    valType = VALUE_TYPE_NUMBER;\n                }\n                else {\n                    var colorArray = color.parse(rawValue);\n                    if (colorArray) {\n                        value = colorArray;\n                        valType = VALUE_TYPE_COLOR;\n                    }\n                }\n            }\n            else if (isGradientObject(rawValue)) {\n                var parsedGradient = extend({}, value);\n                parsedGradient.colorStops = map(rawValue.colorStops, function (colorStop) { return ({\n                    offset: colorStop.offset,\n                    color: color.parse(colorStop.color)\n                }); });\n                if (isLinearGradient(rawValue)) {\n                    valType = VALUE_TYPE_LINEAR_GRADIENT;\n                }\n                else if (isRadialGradient(rawValue)) {\n                    valType = VALUE_TYPE_RADIAL_GRADIENT;\n                }\n                value = parsedGradient;\n            }\n        }\n        if (len === 0) {\n            this.valType = valType;\n        }\n        else if (valType !== this.valType || valType === VALUE_TYPE_UNKOWN) {\n            discrete = true;\n        }\n        this.discrete = this.discrete || discrete;\n        var kf = {\n            time: time,\n            value: value,\n            rawValue: rawValue,\n            percent: 0\n        };\n        if (easing) {\n            kf.easing = easing;\n            kf.easingFunc = isFunction(easing)\n                ? easing\n                : easingFuncs[easing] || createCubicEasingFunc(easing);\n        }\n        keyframes.push(kf);\n        return kf;\n    };\n    Track.prototype.prepare = function (maxTime, additiveTrack) {\n        var kfs = this.keyframes;\n        if (this._needsSort) {\n            kfs.sort(function (a, b) {\n                return a.time - b.time;\n            });\n        }\n        var valType = this.valType;\n        var kfsLen = kfs.length;\n        var lastKf = kfs[kfsLen - 1];\n        var isDiscrete = this.discrete;\n        var isArr = isArrayValueType(valType);\n        var isGradient = isGradientValueType(valType);\n        for (var i = 0; i < kfsLen; i++) {\n            var kf = kfs[i];\n            var value = kf.value;\n            var lastValue = lastKf.value;\n            kf.percent = kf.time / maxTime;\n            if (!isDiscrete) {\n                if (isArr && i !== kfsLen - 1) {\n                    fillArray(value, lastValue, valType);\n                }\n                else if (isGradient) {\n                    fillColorStops(value.colorStops, lastValue.colorStops);\n                }\n            }\n        }\n        if (!isDiscrete\n            && valType !== VALUE_TYPE_RADIAL_GRADIENT\n            && additiveTrack\n            && this.needsAnimate()\n            && additiveTrack.needsAnimate()\n            && valType === additiveTrack.valType\n            && !additiveTrack._finished) {\n            this._additiveTrack = additiveTrack;\n            var startValue = kfs[0].value;\n            for (var i = 0; i < kfsLen; i++) {\n                if (valType === VALUE_TYPE_NUMBER) {\n                    kfs[i].additiveValue = kfs[i].value - startValue;\n                }\n                else if (valType === VALUE_TYPE_COLOR) {\n                    kfs[i].additiveValue =\n                        add1DArray([], kfs[i].value, startValue, -1);\n                }\n                else if (isArrayValueType(valType)) {\n                    kfs[i].additiveValue = valType === VALUE_TYPE_1D_ARRAY\n                        ? add1DArray([], kfs[i].value, startValue, -1)\n                        : add2DArray([], kfs[i].value, startValue, -1);\n                }\n            }\n        }\n    };\n    Track.prototype.step = function (target, percent) {\n        if (this._finished) {\n            return;\n        }\n        if (this._additiveTrack && this._additiveTrack._finished) {\n            this._additiveTrack = null;\n        }\n        var isAdditive = this._additiveTrack != null;\n        var valueKey = isAdditive ? 'additiveValue' : 'value';\n        var valType = this.valType;\n        var keyframes = this.keyframes;\n        var kfsNum = keyframes.length;\n        var propName = this.propName;\n        var isValueColor = valType === VALUE_TYPE_COLOR;\n        var frameIdx;\n        var lastFrame = this._lastFr;\n        var mathMin = Math.min;\n        var frame;\n        var nextFrame;\n        if (kfsNum === 1) {\n            frame = nextFrame = keyframes[0];\n        }\n        else {\n            if (percent < 0) {\n                frameIdx = 0;\n            }\n            else if (percent < this._lastFrP) {\n                var start = mathMin(lastFrame + 1, kfsNum - 1);\n                for (frameIdx = start; frameIdx >= 0; frameIdx--) {\n                    if (keyframes[frameIdx].percent <= percent) {\n                        break;\n                    }\n                }\n                frameIdx = mathMin(frameIdx, kfsNum - 2);\n            }\n            else {\n                for (frameIdx = lastFrame; frameIdx < kfsNum; frameIdx++) {\n                    if (keyframes[frameIdx].percent > percent) {\n                        break;\n                    }\n                }\n                frameIdx = mathMin(frameIdx - 1, kfsNum - 2);\n            }\n            nextFrame = keyframes[frameIdx + 1];\n            frame = keyframes[frameIdx];\n        }\n        if (!(frame && nextFrame)) {\n            return;\n        }\n        this._lastFr = frameIdx;\n        this._lastFrP = percent;\n        var interval = (nextFrame.percent - frame.percent);\n        var w = interval === 0 ? 1 : mathMin((percent - frame.percent) / interval, 1);\n        if (nextFrame.easingFunc) {\n            w = nextFrame.easingFunc(w);\n        }\n        var targetArr = isAdditive ? this._additiveValue\n            : (isValueColor ? tmpRgba : target[propName]);\n        if ((isArrayValueType(valType) || isValueColor) && !targetArr) {\n            targetArr = this._additiveValue = [];\n        }\n        if (this.discrete) {\n            target[propName] = w < 1 ? frame.rawValue : nextFrame.rawValue;\n        }\n        else if (isArrayValueType(valType)) {\n            valType === VALUE_TYPE_1D_ARRAY\n                ? interpolate1DArray(targetArr, frame[valueKey], nextFrame[valueKey], w)\n                : interpolate2DArray(targetArr, frame[valueKey], nextFrame[valueKey], w);\n        }\n        else if (isGradientValueType(valType)) {\n            var val = frame[valueKey];\n            var nextVal_1 = nextFrame[valueKey];\n            var isLinearGradient_1 = valType === VALUE_TYPE_LINEAR_GRADIENT;\n            target[propName] = {\n                type: isLinearGradient_1 ? 'linear' : 'radial',\n                x: interpolateNumber(val.x, nextVal_1.x, w),\n                y: interpolateNumber(val.y, nextVal_1.y, w),\n                colorStops: map(val.colorStops, function (colorStop, idx) {\n                    var nextColorStop = nextVal_1.colorStops[idx];\n                    return {\n                        offset: interpolateNumber(colorStop.offset, nextColorStop.offset, w),\n                        color: rgba2String(interpolate1DArray([], colorStop.color, nextColorStop.color, w))\n                    };\n                }),\n                global: nextVal_1.global\n            };\n            if (isLinearGradient_1) {\n                target[propName].x2 = interpolateNumber(val.x2, nextVal_1.x2, w);\n                target[propName].y2 = interpolateNumber(val.y2, nextVal_1.y2, w);\n            }\n            else {\n                target[propName].r = interpolateNumber(val.r, nextVal_1.r, w);\n            }\n        }\n        else if (isValueColor) {\n            interpolate1DArray(targetArr, frame[valueKey], nextFrame[valueKey], w);\n            if (!isAdditive) {\n                target[propName] = rgba2String(targetArr);\n            }\n        }\n        else {\n            var value = interpolateNumber(frame[valueKey], nextFrame[valueKey], w);\n            if (isAdditive) {\n                this._additiveValue = value;\n            }\n            else {\n                target[propName] = value;\n            }\n        }\n        if (isAdditive) {\n            this._addToTarget(target);\n        }\n    };\n    Track.prototype._addToTarget = function (target) {\n        var valType = this.valType;\n        var propName = this.propName;\n        var additiveValue = this._additiveValue;\n        if (valType === VALUE_TYPE_NUMBER) {\n            target[propName] = target[propName] + additiveValue;\n        }\n        else if (valType === VALUE_TYPE_COLOR) {\n            color.parse(target[propName], tmpRgba);\n            add1DArray(tmpRgba, tmpRgba, additiveValue, 1);\n            target[propName] = rgba2String(tmpRgba);\n        }\n        else if (valType === VALUE_TYPE_1D_ARRAY) {\n            add1DArray(target[propName], target[propName], additiveValue, 1);\n        }\n        else if (valType === VALUE_TYPE_2D_ARRAY) {\n            add2DArray(target[propName], target[propName], additiveValue, 1);\n        }\n    };\n    return Track;\n}());\nvar Animator = (function () {\n    function Animator(target, loop, allowDiscreteAnimation, additiveTo) {\n        this._tracks = {};\n        this._trackKeys = [];\n        this._maxTime = 0;\n        this._started = 0;\n        this._clip = null;\n        this._target = target;\n        this._loop = loop;\n        if (loop && additiveTo) {\n            logError('Can\\' use additive animation on looped animation.');\n            return;\n        }\n        this._additiveAnimators = additiveTo;\n        this._allowDiscrete = allowDiscreteAnimation;\n    }\n    Animator.prototype.getMaxTime = function () {\n        return this._maxTime;\n    };\n    Animator.prototype.getDelay = function () {\n        return this._delay;\n    };\n    Animator.prototype.getLoop = function () {\n        return this._loop;\n    };\n    Animator.prototype.getTarget = function () {\n        return this._target;\n    };\n    Animator.prototype.changeTarget = function (target) {\n        this._target = target;\n    };\n    Animator.prototype.when = function (time, props, easing) {\n        return this.whenWithKeys(time, props, keys(props), easing);\n    };\n    Animator.prototype.whenWithKeys = function (time, props, propNames, easing) {\n        var tracks = this._tracks;\n        for (var i = 0; i < propNames.length; i++) {\n            var propName = propNames[i];\n            var track = tracks[propName];\n            if (!track) {\n                track = tracks[propName] = new Track(propName);\n                var initialValue = void 0;\n                var additiveTrack = this._getAdditiveTrack(propName);\n                if (additiveTrack) {\n                    var addtiveTrackKfs = additiveTrack.keyframes;\n                    var lastFinalKf = addtiveTrackKfs[addtiveTrackKfs.length - 1];\n                    initialValue = lastFinalKf && lastFinalKf.value;\n                    if (additiveTrack.valType === VALUE_TYPE_COLOR && initialValue) {\n                        initialValue = rgba2String(initialValue);\n                    }\n                }\n                else {\n                    initialValue = this._target[propName];\n                }\n                if (initialValue == null) {\n                    continue;\n                }\n                if (time > 0) {\n                    track.addKeyframe(0, cloneValue(initialValue), easing);\n                }\n                this._trackKeys.push(propName);\n            }\n            track.addKeyframe(time, cloneValue(props[propName]), easing);\n        }\n        this._maxTime = Math.max(this._maxTime, time);\n        return this;\n    };\n    Animator.prototype.pause = function () {\n        this._clip.pause();\n        this._paused = true;\n    };\n    Animator.prototype.resume = function () {\n        this._clip.resume();\n        this._paused = false;\n    };\n    Animator.prototype.isPaused = function () {\n        return !!this._paused;\n    };\n    Animator.prototype.duration = function (duration) {\n        this._maxTime = duration;\n        this._force = true;\n        return this;\n    };\n    Animator.prototype._doneCallback = function () {\n        this._setTracksFinished();\n        this._clip = null;\n        var doneList = this._doneCbs;\n        if (doneList) {\n            var len = doneList.length;\n            for (var i = 0; i < len; i++) {\n                doneList[i].call(this);\n            }\n        }\n    };\n    Animator.prototype._abortedCallback = function () {\n        this._setTracksFinished();\n        var animation = this.animation;\n        var abortedList = this._abortedCbs;\n        if (animation) {\n            animation.removeClip(this._clip);\n        }\n        this._clip = null;\n        if (abortedList) {\n            for (var i = 0; i < abortedList.length; i++) {\n                abortedList[i].call(this);\n            }\n        }\n    };\n    Animator.prototype._setTracksFinished = function () {\n        var tracks = this._tracks;\n        var tracksKeys = this._trackKeys;\n        for (var i = 0; i < tracksKeys.length; i++) {\n            tracks[tracksKeys[i]].setFinished();\n        }\n    };\n    Animator.prototype._getAdditiveTrack = function (trackName) {\n        var additiveTrack;\n        var additiveAnimators = this._additiveAnimators;\n        if (additiveAnimators) {\n            for (var i = 0; i < additiveAnimators.length; i++) {\n                var track = additiveAnimators[i].getTrack(trackName);\n                if (track) {\n                    additiveTrack = track;\n                }\n            }\n        }\n        return additiveTrack;\n    };\n    Animator.prototype.start = function (easing) {\n        if (this._started > 0) {\n            return;\n        }\n        this._started = 1;\n        var self = this;\n        var tracks = [];\n        var maxTime = this._maxTime || 0;\n        for (var i = 0; i < this._trackKeys.length; i++) {\n            var propName = this._trackKeys[i];\n            var track = this._tracks[propName];\n            var additiveTrack = this._getAdditiveTrack(propName);\n            var kfs = track.keyframes;\n            var kfsNum = kfs.length;\n            track.prepare(maxTime, additiveTrack);\n            if (track.needsAnimate()) {\n                if (!this._allowDiscrete && track.discrete) {\n                    var lastKf = kfs[kfsNum - 1];\n                    if (lastKf) {\n                        self._target[track.propName] = lastKf.rawValue;\n                    }\n                    track.setFinished();\n                }\n                else {\n                    tracks.push(track);\n                }\n            }\n        }\n        if (tracks.length || this._force) {\n            var clip = new Clip({\n                life: maxTime,\n                loop: this._loop,\n                delay: this._delay || 0,\n                onframe: function (percent) {\n                    self._started = 2;\n                    var additiveAnimators = self._additiveAnimators;\n                    if (additiveAnimators) {\n                        var stillHasAdditiveAnimator = false;\n                        for (var i = 0; i < additiveAnimators.length; i++) {\n                            if (additiveAnimators[i]._clip) {\n                                stillHasAdditiveAnimator = true;\n                                break;\n                            }\n                        }\n                        if (!stillHasAdditiveAnimator) {\n                            self._additiveAnimators = null;\n                        }\n                    }\n                    for (var i = 0; i < tracks.length; i++) {\n                        tracks[i].step(self._target, percent);\n                    }\n                    var onframeList = self._onframeCbs;\n                    if (onframeList) {\n                        for (var i = 0; i < onframeList.length; i++) {\n                            onframeList[i](self._target, percent);\n                        }\n                    }\n                },\n                ondestroy: function () {\n                    self._doneCallback();\n                }\n            });\n            this._clip = clip;\n            if (this.animation) {\n                this.animation.addClip(clip);\n            }\n            if (easing) {\n                clip.setEasing(easing);\n            }\n        }\n        else {\n            this._doneCallback();\n        }\n        return this;\n    };\n    Animator.prototype.stop = function (forwardToLast) {\n        if (!this._clip) {\n            return;\n        }\n        var clip = this._clip;\n        if (forwardToLast) {\n            clip.onframe(1);\n        }\n        this._abortedCallback();\n    };\n    Animator.prototype.delay = function (time) {\n        this._delay = time;\n        return this;\n    };\n    Animator.prototype.during = function (cb) {\n        if (cb) {\n            if (!this._onframeCbs) {\n                this._onframeCbs = [];\n            }\n            this._onframeCbs.push(cb);\n        }\n        return this;\n    };\n    Animator.prototype.done = function (cb) {\n        if (cb) {\n            if (!this._doneCbs) {\n                this._doneCbs = [];\n            }\n            this._doneCbs.push(cb);\n        }\n        return this;\n    };\n    Animator.prototype.aborted = function (cb) {\n        if (cb) {\n            if (!this._abortedCbs) {\n                this._abortedCbs = [];\n            }\n            this._abortedCbs.push(cb);\n        }\n        return this;\n    };\n    Animator.prototype.getClip = function () {\n        return this._clip;\n    };\n    Animator.prototype.getTrack = function (propName) {\n        return this._tracks[propName];\n    };\n    Animator.prototype.getTracks = function () {\n        var _this = this;\n        return map(this._trackKeys, function (key) { return _this._tracks[key]; });\n    };\n    Animator.prototype.stopTracks = function (propNames, forwardToLast) {\n        if (!propNames.length || !this._clip) {\n            return true;\n        }\n        var tracks = this._tracks;\n        var tracksKeys = this._trackKeys;\n        for (var i = 0; i < propNames.length; i++) {\n            var track = tracks[propNames[i]];\n            if (track && !track.isFinished()) {\n                if (forwardToLast) {\n                    track.step(this._target, 1);\n                }\n                else if (this._started === 1) {\n                    track.step(this._target, 0);\n                }\n                track.setFinished();\n            }\n        }\n        var allAborted = true;\n        for (var i = 0; i < tracksKeys.length; i++) {\n            if (!tracks[tracksKeys[i]].isFinished()) {\n                allAborted = false;\n                break;\n            }\n        }\n        if (allAborted) {\n            this._abortedCallback();\n        }\n        return allAborted;\n    };\n    Animator.prototype.saveTo = function (target, trackKeys, firstOrLast) {\n        if (!target) {\n            return;\n        }\n        trackKeys = trackKeys || this._trackKeys;\n        for (var i = 0; i < trackKeys.length; i++) {\n            var propName = trackKeys[i];\n            var track = this._tracks[propName];\n            if (!track || track.isFinished()) {\n                continue;\n            }\n            var kfs = track.keyframes;\n            var kf = kfs[firstOrLast ? 0 : kfs.length - 1];\n            if (kf) {\n                target[propName] = cloneValue(kf.rawValue);\n            }\n        }\n    };\n    Animator.prototype.__changeFinalValue = function (finalProps, trackKeys) {\n        trackKeys = trackKeys || keys(finalProps);\n        for (var i = 0; i < trackKeys.length; i++) {\n            var propName = trackKeys[i];\n            var track = this._tracks[propName];\n            if (!track) {\n                continue;\n            }\n            var kfs = track.keyframes;\n            if (kfs.length > 1) {\n                var lastKf = kfs.pop();\n                track.addKeyframe(lastKf.time, finalProps[propName]);\n                track.prepare(this._maxTime, track.getAdditiveTrack());\n            }\n        }\n    };\n    return Animator;\n}());\nexport default Animator;\n", "import { __extends } from \"tslib\";\nimport Eventful from '../core/Eventful.js';\nimport requestAnimationFrame from './requestAnimationFrame.js';\nimport Animator from './Animator.js';\nexport function getTime() {\n    return new Date().getTime();\n}\nvar Animation = (function (_super) {\n    __extends(Animation, _super);\n    function Animation(opts) {\n        var _this = _super.call(this) || this;\n        _this._running = false;\n        _this._time = 0;\n        _this._pausedTime = 0;\n        _this._pauseStart = 0;\n        _this._paused = false;\n        opts = opts || {};\n        _this.stage = opts.stage || {};\n        return _this;\n    }\n    Animation.prototype.addClip = function (clip) {\n        if (clip.animation) {\n            this.removeClip(clip);\n        }\n        if (!this._head) {\n            this._head = this._tail = clip;\n        }\n        else {\n            this._tail.next = clip;\n            clip.prev = this._tail;\n            clip.next = null;\n            this._tail = clip;\n        }\n        clip.animation = this;\n    };\n    Animation.prototype.addAnimator = function (animator) {\n        animator.animation = this;\n        var clip = animator.getClip();\n        if (clip) {\n            this.addClip(clip);\n        }\n    };\n    Animation.prototype.removeClip = function (clip) {\n        if (!clip.animation) {\n            return;\n        }\n        var prev = clip.prev;\n        var next = clip.next;\n        if (prev) {\n            prev.next = next;\n        }\n        else {\n            this._head = next;\n        }\n        if (next) {\n            next.prev = prev;\n        }\n        else {\n            this._tail = prev;\n        }\n        clip.next = clip.prev = clip.animation = null;\n    };\n    Animation.prototype.removeAnimator = function (animator) {\n        var clip = animator.getClip();\n        if (clip) {\n            this.removeClip(clip);\n        }\n        animator.animation = null;\n    };\n    Animation.prototype.update = function (notTriggerFrameAndStageUpdate) {\n        var time = getTime() - this._pausedTime;\n        var delta = time - this._time;\n        var clip = this._head;\n        while (clip) {\n            var nextClip = clip.next;\n            var finished = clip.step(time, delta);\n            if (finished) {\n                clip.ondestroy();\n                this.removeClip(clip);\n                clip = nextClip;\n            }\n            else {\n                clip = nextClip;\n            }\n        }\n        this._time = time;\n        if (!notTriggerFrameAndStageUpdate) {\n            this.trigger('frame', delta);\n            this.stage.update && this.stage.update();\n        }\n    };\n    Animation.prototype._startLoop = function () {\n        var self = this;\n        this._running = true;\n        function step() {\n            if (self._running) {\n                requestAnimationFrame(step);\n                !self._paused && self.update();\n            }\n        }\n        requestAnimationFrame(step);\n    };\n    Animation.prototype.start = function () {\n        if (this._running) {\n            return;\n        }\n        this._time = getTime();\n        this._pausedTime = 0;\n        this._startLoop();\n    };\n    Animation.prototype.stop = function () {\n        this._running = false;\n    };\n    Animation.prototype.pause = function () {\n        if (!this._paused) {\n            this._pauseStart = getTime();\n            this._paused = true;\n        }\n    };\n    Animation.prototype.resume = function () {\n        if (this._paused) {\n            this._pausedTime += getTime() - this._pauseStart;\n            this._paused = false;\n        }\n    };\n    Animation.prototype.clear = function () {\n        var clip = this._head;\n        while (clip) {\n            var nextClip = clip.next;\n            clip.prev = clip.next = clip.animation = null;\n            clip = nextClip;\n        }\n        this._head = this._tail = null;\n    };\n    Animation.prototype.isFinished = function () {\n        return this._head == null;\n    };\n    Animation.prototype.animate = function (target, options) {\n        options = options || {};\n        this.start();\n        var animator = new Animator(target, options.loop);\n        this.addAnimator(animator);\n        return animator;\n    };\n    return Animation;\n}(Eventful));\nexport default Animation;\n", "import { __extends } from \"tslib\";\nimport { addEventListener, removeEventListener, normalizeEvent, getNativeEvent } from '../core/event.js';\nimport * as zrUtil from '../core/util.js';\nimport Eventful from '../core/Eventful.js';\nimport env from '../core/env.js';\nvar TOUCH_CLICK_DELAY = 300;\nvar globalEventSupported = env.domSupported;\nvar localNativeListenerNames = (function () {\n    var mouseHandlerNames = [\n        'click', 'dblclick', 'mousewheel', 'wheel', 'mouseout',\n        'mouseup', 'mousedown', 'mousemove', 'contextmenu'\n    ];\n    var touchHandlerNames = [\n        'touchstart', 'touchend', 'touchmove'\n    ];\n    var pointerEventNameMap = {\n        pointerdown: 1, pointerup: 1, pointermove: 1, pointerout: 1\n    };\n    var pointerHandlerNames = zrUtil.map(mouseHandlerNames, function (name) {\n        var nm = name.replace('mouse', 'pointer');\n        return pointerEventNameMap.hasOwnProperty(nm) ? nm : name;\n    });\n    return {\n        mouse: mouseHandlerNames,\n        touch: touchHandlerNames,\n        pointer: pointerHandlerNames\n    };\n})();\nvar globalNativeListenerNames = {\n    mouse: ['mousemove', 'mouseup'],\n    pointer: ['pointermove', 'pointerup']\n};\nvar wheelEventSupported = false;\nfunction isPointerFromTouch(event) {\n    var pointerType = event.pointerType;\n    return pointerType === 'pen' || pointerType === 'touch';\n}\nfunction setTouchTimer(scope) {\n    scope.touching = true;\n    if (scope.touchTimer != null) {\n        clearTimeout(scope.touchTimer);\n        scope.touchTimer = null;\n    }\n    scope.touchTimer = setTimeout(function () {\n        scope.touching = false;\n        scope.touchTimer = null;\n    }, 700);\n}\nfunction markTouch(event) {\n    event && (event.zrByTouch = true);\n}\nfunction normalizeGlobalEvent(instance, event) {\n    return normalizeEvent(instance.dom, new FakeGlobalEvent(instance, event), true);\n}\nfunction isLocalEl(instance, el) {\n    var elTmp = el;\n    var isLocal = false;\n    while (elTmp && elTmp.nodeType !== 9\n        && !(isLocal = elTmp.domBelongToZr\n            || (elTmp !== el && elTmp === instance.painterRoot))) {\n        elTmp = elTmp.parentNode;\n    }\n    return isLocal;\n}\nvar FakeGlobalEvent = (function () {\n    function FakeGlobalEvent(instance, event) {\n        this.stopPropagation = zrUtil.noop;\n        this.stopImmediatePropagation = zrUtil.noop;\n        this.preventDefault = zrUtil.noop;\n        this.type = event.type;\n        this.target = this.currentTarget = instance.dom;\n        this.pointerType = event.pointerType;\n        this.clientX = event.clientX;\n        this.clientY = event.clientY;\n    }\n    return FakeGlobalEvent;\n}());\nvar localDOMHandlers = {\n    mousedown: function (event) {\n        event = normalizeEvent(this.dom, event);\n        this.__mayPointerCapture = [event.zrX, event.zrY];\n        this.trigger('mousedown', event);\n    },\n    mousemove: function (event) {\n        event = normalizeEvent(this.dom, event);\n        var downPoint = this.__mayPointerCapture;\n        if (downPoint && (event.zrX !== downPoint[0] || event.zrY !== downPoint[1])) {\n            this.__togglePointerCapture(true);\n        }\n        this.trigger('mousemove', event);\n    },\n    mouseup: function (event) {\n        event = normalizeEvent(this.dom, event);\n        this.__togglePointerCapture(false);\n        this.trigger('mouseup', event);\n    },\n    mouseout: function (event) {\n        event = normalizeEvent(this.dom, event);\n        var element = event.toElement || event.relatedTarget;\n        if (!isLocalEl(this, element)) {\n            if (this.__pointerCapturing) {\n                event.zrEventControl = 'no_globalout';\n            }\n            this.trigger('mouseout', event);\n        }\n    },\n    wheel: function (event) {\n        wheelEventSupported = true;\n        event = normalizeEvent(this.dom, event);\n        this.trigger('mousewheel', event);\n    },\n    mousewheel: function (event) {\n        if (wheelEventSupported) {\n            return;\n        }\n        event = normalizeEvent(this.dom, event);\n        this.trigger('mousewheel', event);\n    },\n    touchstart: function (event) {\n        event = normalizeEvent(this.dom, event);\n        markTouch(event);\n        this.__lastTouchMoment = new Date();\n        this.handler.processGesture(event, 'start');\n        localDOMHandlers.mousemove.call(this, event);\n        localDOMHandlers.mousedown.call(this, event);\n    },\n    touchmove: function (event) {\n        event = normalizeEvent(this.dom, event);\n        markTouch(event);\n        this.handler.processGesture(event, 'change');\n        localDOMHandlers.mousemove.call(this, event);\n    },\n    touchend: function (event) {\n        event = normalizeEvent(this.dom, event);\n        markTouch(event);\n        this.handler.processGesture(event, 'end');\n        localDOMHandlers.mouseup.call(this, event);\n        if (+new Date() - (+this.__lastTouchMoment) < TOUCH_CLICK_DELAY) {\n            localDOMHandlers.click.call(this, event);\n        }\n    },\n    pointerdown: function (event) {\n        localDOMHandlers.mousedown.call(this, event);\n    },\n    pointermove: function (event) {\n        if (!isPointerFromTouch(event)) {\n            localDOMHandlers.mousemove.call(this, event);\n        }\n    },\n    pointerup: function (event) {\n        localDOMHandlers.mouseup.call(this, event);\n    },\n    pointerout: function (event) {\n        if (!isPointerFromTouch(event)) {\n            localDOMHandlers.mouseout.call(this, event);\n        }\n    }\n};\nzrUtil.each(['click', 'dblclick', 'contextmenu'], function (name) {\n    localDOMHandlers[name] = function (event) {\n        event = normalizeEvent(this.dom, event);\n        this.trigger(name, event);\n    };\n});\nvar globalDOMHandlers = {\n    pointermove: function (event) {\n        if (!isPointerFromTouch(event)) {\n            globalDOMHandlers.mousemove.call(this, event);\n        }\n    },\n    pointerup: function (event) {\n        globalDOMHandlers.mouseup.call(this, event);\n    },\n    mousemove: function (event) {\n        this.trigger('mousemove', event);\n    },\n    mouseup: function (event) {\n        var pointerCaptureReleasing = this.__pointerCapturing;\n        this.__togglePointerCapture(false);\n        this.trigger('mouseup', event);\n        if (pointerCaptureReleasing) {\n            event.zrEventControl = 'only_globalout';\n            this.trigger('mouseout', event);\n        }\n    }\n};\nfunction mountLocalDOMEventListeners(instance, scope) {\n    var domHandlers = scope.domHandlers;\n    if (env.pointerEventsSupported) {\n        zrUtil.each(localNativeListenerNames.pointer, function (nativeEventName) {\n            mountSingleDOMEventListener(scope, nativeEventName, function (event) {\n                domHandlers[nativeEventName].call(instance, event);\n            });\n        });\n    }\n    else {\n        if (env.touchEventsSupported) {\n            zrUtil.each(localNativeListenerNames.touch, function (nativeEventName) {\n                mountSingleDOMEventListener(scope, nativeEventName, function (event) {\n                    domHandlers[nativeEventName].call(instance, event);\n                    setTouchTimer(scope);\n                });\n            });\n        }\n        zrUtil.each(localNativeListenerNames.mouse, function (nativeEventName) {\n            mountSingleDOMEventListener(scope, nativeEventName, function (event) {\n                event = getNativeEvent(event);\n                if (!scope.touching) {\n                    domHandlers[nativeEventName].call(instance, event);\n                }\n            });\n        });\n    }\n}\nfunction mountGlobalDOMEventListeners(instance, scope) {\n    if (env.pointerEventsSupported) {\n        zrUtil.each(globalNativeListenerNames.pointer, mount);\n    }\n    else if (!env.touchEventsSupported) {\n        zrUtil.each(globalNativeListenerNames.mouse, mount);\n    }\n    function mount(nativeEventName) {\n        function nativeEventListener(event) {\n            event = getNativeEvent(event);\n            if (!isLocalEl(instance, event.target)) {\n                event = normalizeGlobalEvent(instance, event);\n                scope.domHandlers[nativeEventName].call(instance, event);\n            }\n        }\n        mountSingleDOMEventListener(scope, nativeEventName, nativeEventListener, { capture: true });\n    }\n}\nfunction mountSingleDOMEventListener(scope, nativeEventName, listener, opt) {\n    scope.mounted[nativeEventName] = listener;\n    scope.listenerOpts[nativeEventName] = opt;\n    addEventListener(scope.domTarget, nativeEventName, listener, opt);\n}\nfunction unmountDOMEventListeners(scope) {\n    var mounted = scope.mounted;\n    for (var nativeEventName in mounted) {\n        if (mounted.hasOwnProperty(nativeEventName)) {\n            removeEventListener(scope.domTarget, nativeEventName, mounted[nativeEventName], scope.listenerOpts[nativeEventName]);\n        }\n    }\n    scope.mounted = {};\n}\nvar DOMHandlerScope = (function () {\n    function DOMHandlerScope(domTarget, domHandlers) {\n        this.mounted = {};\n        this.listenerOpts = {};\n        this.touching = false;\n        this.domTarget = domTarget;\n        this.domHandlers = domHandlers;\n    }\n    return DOMHandlerScope;\n}());\nvar HandlerDomProxy = (function (_super) {\n    __extends(HandlerDomProxy, _super);\n    function HandlerDomProxy(dom, painterRoot) {\n        var _this = _super.call(this) || this;\n        _this.__pointerCapturing = false;\n        _this.dom = dom;\n        _this.painterRoot = painterRoot;\n        _this._localHandlerScope = new DOMHandlerScope(dom, localDOMHandlers);\n        if (globalEventSupported) {\n            _this._globalHandlerScope = new DOMHandlerScope(document, globalDOMHandlers);\n        }\n        mountLocalDOMEventListeners(_this, _this._localHandlerScope);\n        return _this;\n    }\n    HandlerDomProxy.prototype.dispose = function () {\n        unmountDOMEventListeners(this._localHandlerScope);\n        if (globalEventSupported) {\n            unmountDOMEventListeners(this._globalHandlerScope);\n        }\n    };\n    HandlerDomProxy.prototype.setCursor = function (cursorStyle) {\n        this.dom.style && (this.dom.style.cursor = cursorStyle || 'default');\n    };\n    HandlerDomProxy.prototype.__togglePointerCapture = function (isPointerCapturing) {\n        this.__mayPointerCapture = null;\n        if (globalEventSupported\n            && ((+this.__pointerCapturing) ^ (+isPointerCapturing))) {\n            this.__pointerCapturing = isPointerCapturing;\n            var globalHandlerScope = this._globalHandlerScope;\n            isPointerCapturing\n                ? mountGlobalDOMEventListeners(this, globalHandlerScope)\n                : unmountDOMEventListeners(globalHandlerScope);\n        }\n    };\n    return HandlerDomProxy;\n}(Eventful));\nexport default HandlerDomProxy;\n", "import env from './core/env.js';\nvar dpr = 1;\nif (env.hasGlobalWindow) {\n    dpr = Math.max(window.devicePixelRatio\n        || (window.screen && window.screen.deviceXDPI / window.screen.logicalXDPI)\n        || 1, 1);\n}\nexport var debugMode = 0;\nexport var devicePixelRatio = dpr;\nexport var DARK_MODE_THRESHOLD = 0.4;\nexport var DARK_LABEL_COLOR = '#333';\nexport var LIGHT_LABEL_COLOR = '#ccc';\nexport var LIGHTER_LABEL_COLOR = '#eee';\n", "import * as matrix from './matrix.js';\nimport * as vector from './vector.js';\nvar mIdentity = matrix.identity;\nvar EPSILON = 5e-5;\nfunction isNotAroundZero(val) {\n    return val > EPSILON || val < -EPSILON;\n}\nvar scaleTmp = [];\nvar tmpTransform = [];\nvar originTransform = matrix.create();\nvar abs = Math.abs;\nvar Transformable = (function () {\n    function Transformable() {\n    }\n    Transformable.prototype.getLocalTransform = function (m) {\n        return Transformable.getLocalTransform(this, m);\n    };\n    Transformable.prototype.setPosition = function (arr) {\n        this.x = arr[0];\n        this.y = arr[1];\n    };\n    Transformable.prototype.setScale = function (arr) {\n        this.scaleX = arr[0];\n        this.scaleY = arr[1];\n    };\n    Transformable.prototype.setSkew = function (arr) {\n        this.skewX = arr[0];\n        this.skewY = arr[1];\n    };\n    Transformable.prototype.setOrigin = function (arr) {\n        this.originX = arr[0];\n        this.originY = arr[1];\n    };\n    Transformable.prototype.needLocalTransform = function () {\n        return isNotAroundZero(this.rotation)\n            || isNotAroundZero(this.x)\n            || isNotAroundZero(this.y)\n            || isNotAroundZero(this.scaleX - 1)\n            || isNotAroundZero(this.scaleY - 1)\n            || isNotAroundZero(this.skewX)\n            || isNotAroundZero(this.skewY);\n    };\n    Transformable.prototype.updateTransform = function () {\n        var parentTransform = this.parent && this.parent.transform;\n        var needLocalTransform = this.needLocalTransform();\n        var m = this.transform;\n        if (!(needLocalTransform || parentTransform)) {\n            if (m) {\n                mIdentity(m);\n                this.invTransform = null;\n            }\n            return;\n        }\n        m = m || matrix.create();\n        if (needLocalTransform) {\n            this.getLocalTransform(m);\n        }\n        else {\n            mIdentity(m);\n        }\n        if (parentTransform) {\n            if (needLocalTransform) {\n                matrix.mul(m, parentTransform, m);\n            }\n            else {\n                matrix.copy(m, parentTransform);\n            }\n        }\n        this.transform = m;\n        this._resolveGlobalScaleRatio(m);\n    };\n    Transformable.prototype._resolveGlobalScaleRatio = function (m) {\n        var globalScaleRatio = this.globalScaleRatio;\n        if (globalScaleRatio != null && globalScaleRatio !== 1) {\n            this.getGlobalScale(scaleTmp);\n            var relX = scaleTmp[0] < 0 ? -1 : 1;\n            var relY = scaleTmp[1] < 0 ? -1 : 1;\n            var sx = ((scaleTmp[0] - relX) * globalScaleRatio + relX) / scaleTmp[0] || 0;\n            var sy = ((scaleTmp[1] - relY) * globalScaleRatio + relY) / scaleTmp[1] || 0;\n            m[0] *= sx;\n            m[1] *= sx;\n            m[2] *= sy;\n            m[3] *= sy;\n        }\n        this.invTransform = this.invTransform || matrix.create();\n        matrix.invert(this.invTransform, m);\n    };\n    Transformable.prototype.getComputedTransform = function () {\n        var transformNode = this;\n        var ancestors = [];\n        while (transformNode) {\n            ancestors.push(transformNode);\n            transformNode = transformNode.parent;\n        }\n        while (transformNode = ancestors.pop()) {\n            transformNode.updateTransform();\n        }\n        return this.transform;\n    };\n    Transformable.prototype.setLocalTransform = function (m) {\n        if (!m) {\n            return;\n        }\n        var sx = m[0] * m[0] + m[1] * m[1];\n        var sy = m[2] * m[2] + m[3] * m[3];\n        var rotation = Math.atan2(m[1], m[0]);\n        var shearX = Math.PI / 2 + rotation - Math.atan2(m[3], m[2]);\n        sy = Math.sqrt(sy) * Math.cos(shearX);\n        sx = Math.sqrt(sx);\n        this.skewX = shearX;\n        this.skewY = 0;\n        this.rotation = -rotation;\n        this.x = +m[4];\n        this.y = +m[5];\n        this.scaleX = sx;\n        this.scaleY = sy;\n        this.originX = 0;\n        this.originY = 0;\n    };\n    Transformable.prototype.decomposeTransform = function () {\n        if (!this.transform) {\n            return;\n        }\n        var parent = this.parent;\n        var m = this.transform;\n        if (parent && parent.transform) {\n            parent.invTransform = parent.invTransform || matrix.create();\n            matrix.mul(tmpTransform, parent.invTransform, m);\n            m = tmpTransform;\n        }\n        var ox = this.originX;\n        var oy = this.originY;\n        if (ox || oy) {\n            originTransform[4] = ox;\n            originTransform[5] = oy;\n            matrix.mul(tmpTransform, m, originTransform);\n            tmpTransform[4] -= ox;\n            tmpTransform[5] -= oy;\n            m = tmpTransform;\n        }\n        this.setLocalTransform(m);\n    };\n    Transformable.prototype.getGlobalScale = function (out) {\n        var m = this.transform;\n        out = out || [];\n        if (!m) {\n            out[0] = 1;\n            out[1] = 1;\n            return out;\n        }\n        out[0] = Math.sqrt(m[0] * m[0] + m[1] * m[1]);\n        out[1] = Math.sqrt(m[2] * m[2] + m[3] * m[3]);\n        if (m[0] < 0) {\n            out[0] = -out[0];\n        }\n        if (m[3] < 0) {\n            out[1] = -out[1];\n        }\n        return out;\n    };\n    Transformable.prototype.transformCoordToLocal = function (x, y) {\n        var v2 = [x, y];\n        var invTransform = this.invTransform;\n        if (invTransform) {\n            vector.applyTransform(v2, v2, invTransform);\n        }\n        return v2;\n    };\n    Transformable.prototype.transformCoordToGlobal = function (x, y) {\n        var v2 = [x, y];\n        var transform = this.transform;\n        if (transform) {\n            vector.applyTransform(v2, v2, transform);\n        }\n        return v2;\n    };\n    Transformable.prototype.getLineScale = function () {\n        var m = this.transform;\n        return m && abs(m[0] - 1) > 1e-10 && abs(m[3] - 1) > 1e-10\n            ? Math.sqrt(abs(m[0] * m[3] - m[2] * m[1]))\n            : 1;\n    };\n    Transformable.prototype.copyTransform = function (source) {\n        copyTransform(this, source);\n    };\n    Transformable.getLocalTransform = function (target, m) {\n        m = m || [];\n        var ox = target.originX || 0;\n        var oy = target.originY || 0;\n        var sx = target.scaleX;\n        var sy = target.scaleY;\n        var ax = target.anchorX;\n        var ay = target.anchorY;\n        var rotation = target.rotation || 0;\n        var x = target.x;\n        var y = target.y;\n        var skewX = target.skewX ? Math.tan(target.skewX) : 0;\n        var skewY = target.skewY ? Math.tan(-target.skewY) : 0;\n        if (ox || oy || ax || ay) {\n            var dx = ox + ax;\n            var dy = oy + ay;\n            m[4] = -dx * sx - skewX * dy * sy;\n            m[5] = -dy * sy - skewY * dx * sx;\n        }\n        else {\n            m[4] = m[5] = 0;\n        }\n        m[0] = sx;\n        m[3] = sy;\n        m[1] = skewY * sx;\n        m[2] = skewX * sy;\n        rotation && matrix.rotate(m, m, rotation);\n        m[4] += ox + x;\n        m[5] += oy + y;\n        return m;\n    };\n    Transformable.initDefaultProps = (function () {\n        var proto = Transformable.prototype;\n        proto.scaleX =\n            proto.scaleY =\n                proto.globalScaleRatio = 1;\n        proto.x =\n            proto.y =\n                proto.originX =\n                    proto.originY =\n                        proto.skewX =\n                            proto.skewY =\n                                proto.rotation =\n                                    proto.anchorX =\n                                        proto.anchorY = 0;\n    })();\n    return Transformable;\n}());\n;\nexport var TRANSFORMABLE_PROPS = [\n    'x', 'y', 'originX', 'originY', 'anchorX', 'anchorY', 'rotation', 'scaleX', 'scaleY', 'skewX', 'skewY'\n];\nexport function copyTransform(target, source) {\n    for (var i = 0; i < TRANSFORMABLE_PROPS.length; i++) {\n        var propName = TRANSFORMABLE_PROPS[i];\n        target[propName] = source[propName];\n    }\n}\nexport default Transformable;\n", "import BoundingRect from '../core/BoundingRect.js';\nimport LRU from '../core/LRU.js';\nimport { DEFAULT_FONT, platformApi } from '../core/platform.js';\nexport function getWidth(text, font) {\n    return measureWidth(ensureFontMeasureInfo(font), text);\n}\nexport function ensureFontMeasureInfo(font) {\n    if (!_fontMeasureInfoCache) {\n        _fontMeasureInfoCache = new LRU(100);\n    }\n    font = font || DEFAULT_FONT;\n    var measureInfo = _fontMeasureInfoCache.get(font);\n    if (!measureInfo) {\n        measureInfo = {\n            font: font,\n            strWidthCache: new LRU(500),\n            asciiWidthMap: null,\n            asciiWidthMapTried: false,\n            stWideCharWidth: platformApi.measureText('\u56FD', font).width,\n            asciiCharWidth: platformApi.measureText('a', font).width\n        };\n        _fontMeasureInfoCache.put(font, measureInfo);\n    }\n    return measureInfo;\n}\nvar _fontMeasureInfoCache;\nfunction tryCreateASCIIWidthMap(font) {\n    if (_getASCIIWidthMapLongCount >= GET_ASCII_WIDTH_LONG_COUNT_MAX) {\n        return;\n    }\n    font = font || DEFAULT_FONT;\n    var asciiWidthMap = [];\n    var start = +(new Date());\n    for (var code = 0; code <= 127; code++) {\n        asciiWidthMap[code] = platformApi.measureText(String.fromCharCode(code), font).width;\n    }\n    var cost = +(new Date()) - start;\n    if (cost > 16) {\n        _getASCIIWidthMapLongCount = GET_ASCII_WIDTH_LONG_COUNT_MAX;\n    }\n    else if (cost > 2) {\n        _getASCIIWidthMapLongCount++;\n    }\n    return asciiWidthMap;\n}\nvar _getASCIIWidthMapLongCount = 0;\nvar GET_ASCII_WIDTH_LONG_COUNT_MAX = 5;\nexport function measureCharWidth(fontMeasureInfo, charCode) {\n    if (!fontMeasureInfo.asciiWidthMapTried) {\n        fontMeasureInfo.asciiWidthMap = tryCreateASCIIWidthMap(fontMeasureInfo.font);\n        fontMeasureInfo.asciiWidthMapTried = true;\n    }\n    return (0 <= charCode && charCode <= 127)\n        ? (fontMeasureInfo.asciiWidthMap != null\n            ? fontMeasureInfo.asciiWidthMap[charCode]\n            : fontMeasureInfo.asciiCharWidth)\n        : fontMeasureInfo.stWideCharWidth;\n}\nexport function measureWidth(fontMeasureInfo, text) {\n    var strWidthCache = fontMeasureInfo.strWidthCache;\n    var width = strWidthCache.get(text);\n    if (width == null) {\n        width = platformApi.measureText(text, fontMeasureInfo.font).width;\n        strWidthCache.put(text, width);\n    }\n    return width;\n}\nexport function innerGetBoundingRect(text, font, textAlign, textBaseline) {\n    var width = measureWidth(ensureFontMeasureInfo(font), text);\n    var height = getLineHeight(font);\n    var x = adjustTextX(0, width, textAlign);\n    var y = adjustTextY(0, height, textBaseline);\n    var rect = new BoundingRect(x, y, width, height);\n    return rect;\n}\nexport function getBoundingRect(text, font, textAlign, textBaseline) {\n    var textLines = ((text || '') + '').split('\\n');\n    var len = textLines.length;\n    if (len === 1) {\n        return innerGetBoundingRect(textLines[0], font, textAlign, textBaseline);\n    }\n    else {\n        var uniondRect = new BoundingRect(0, 0, 0, 0);\n        for (var i = 0; i < textLines.length; i++) {\n            var rect = innerGetBoundingRect(textLines[i], font, textAlign, textBaseline);\n            i === 0 ? uniondRect.copy(rect) : uniondRect.union(rect);\n        }\n        return uniondRect;\n    }\n}\nexport function adjustTextX(x, width, textAlign, inverse) {\n    if (textAlign === 'right') {\n        !inverse ? (x -= width) : (x += width);\n    }\n    else if (textAlign === 'center') {\n        !inverse ? (x -= width / 2) : (x += width / 2);\n    }\n    return x;\n}\nexport function adjustTextY(y, height, verticalAlign, inverse) {\n    if (verticalAlign === 'middle') {\n        !inverse ? (y -= height / 2) : (y += height / 2);\n    }\n    else if (verticalAlign === 'bottom') {\n        !inverse ? (y -= height) : (y += height);\n    }\n    return y;\n}\nexport function getLineHeight(font) {\n    return ensureFontMeasureInfo(font).stWideCharWidth;\n}\nexport function measureText(text, font) {\n    return platformApi.measureText(text, font);\n}\nexport function parsePercent(value, maxValue) {\n    if (typeof value === 'string') {\n        if (value.lastIndexOf('%') >= 0) {\n            return parseFloat(value) / 100 * maxValue;\n        }\n        return parseFloat(value);\n    }\n    return value;\n}\nexport function calculateTextPosition(out, opts, rect) {\n    var textPosition = opts.position || 'inside';\n    var distance = opts.distance != null ? opts.distance : 5;\n    var height = rect.height;\n    var width = rect.width;\n    var halfHeight = height / 2;\n    var x = rect.x;\n    var y = rect.y;\n    var textAlign = 'left';\n    var textVerticalAlign = 'top';\n    if (textPosition instanceof Array) {\n        x += parsePercent(textPosition[0], rect.width);\n        y += parsePercent(textPosition[1], rect.height);\n        textAlign = null;\n        textVerticalAlign = null;\n    }\n    else {\n        switch (textPosition) {\n            case 'left':\n                x -= distance;\n                y += halfHeight;\n                textAlign = 'right';\n                textVerticalAlign = 'middle';\n                break;\n            case 'right':\n                x += distance + width;\n                y += halfHeight;\n                textVerticalAlign = 'middle';\n                break;\n            case 'top':\n                x += width / 2;\n                y -= distance;\n                textAlign = 'center';\n                textVerticalAlign = 'bottom';\n                break;\n            case 'bottom':\n                x += width / 2;\n                y += height + distance;\n                textAlign = 'center';\n                break;\n            case 'inside':\n                x += width / 2;\n                y += halfHeight;\n                textAlign = 'center';\n                textVerticalAlign = 'middle';\n                break;\n            case 'insideLeft':\n                x += distance;\n                y += halfHeight;\n                textVerticalAlign = 'middle';\n                break;\n            case 'insideRight':\n                x += width - distance;\n                y += halfHeight;\n                textAlign = 'right';\n                textVerticalAlign = 'middle';\n                break;\n            case 'insideTop':\n                x += width / 2;\n                y += distance;\n                textAlign = 'center';\n                break;\n            case 'insideBottom':\n                x += width / 2;\n                y += height - distance;\n                textAlign = 'center';\n                textVerticalAlign = 'bottom';\n                break;\n            case 'insideTopLeft':\n                x += distance;\n                y += distance;\n                break;\n            case 'insideTopRight':\n                x += width - distance;\n                y += distance;\n                textAlign = 'right';\n                break;\n            case 'insideBottomLeft':\n                x += distance;\n                y += height - distance;\n                textVerticalAlign = 'bottom';\n                break;\n            case 'insideBottomRight':\n                x += width - distance;\n                y += height - distance;\n                textAlign = 'right';\n                textVerticalAlign = 'bottom';\n                break;\n        }\n    }\n    out = out || {};\n    out.x = x;\n    out.y = y;\n    out.align = textAlign;\n    out.verticalAlign = textVerticalAlign;\n    return out;\n}\n", "import Transformable, { TRANSFORMABLE_PROPS } from './core/Transformable.js';\nimport Animator, { cloneValue } from './animation/Animator.js';\nimport BoundingRect from './core/BoundingRect.js';\nimport Eventful from './core/Eventful.js';\nimport { calculateTextPosition, parsePercent } from './contain/text.js';\nimport { guid, isObject, keys, extend, indexOf, logError, mixin, isArrayLike, isTypedArray, isGradientObject, filter, reduce } from './core/util.js';\nimport { LIGHT_LABEL_COLOR, DARK_LABEL_COLOR } from './config.js';\nimport { parse, stringify } from './tool/color.js';\nimport { REDRAW_BIT } from './graphic/constants.js';\nimport { invert } from './core/matrix.js';\nexport var PRESERVED_NORMAL_STATE = '__zr_normal__';\nvar PRIMARY_STATES_KEYS = TRANSFORMABLE_PROPS.concat(['ignore']);\nvar DEFAULT_ANIMATABLE_MAP = reduce(TRANSFORMABLE_PROPS, function (obj, key) {\n    obj[key] = true;\n    return obj;\n}, { ignore: false });\nvar tmpTextPosCalcRes = {};\nvar tmpBoundingRect = new BoundingRect(0, 0, 0, 0);\nvar tmpInnerTextTrans = [];\nvar Element = (function () {\n    function Element(props) {\n        this.id = guid();\n        this.animators = [];\n        this.currentStates = [];\n        this.states = {};\n        this._init(props);\n    }\n    Element.prototype._init = function (props) {\n        this.attr(props);\n    };\n    Element.prototype.drift = function (dx, dy, e) {\n        switch (this.draggable) {\n            case 'horizontal':\n                dy = 0;\n                break;\n            case 'vertical':\n                dx = 0;\n                break;\n        }\n        var m = this.transform;\n        if (!m) {\n            m = this.transform = [1, 0, 0, 1, 0, 0];\n        }\n        m[4] += dx;\n        m[5] += dy;\n        this.decomposeTransform();\n        this.markRedraw();\n    };\n    Element.prototype.beforeUpdate = function () { };\n    Element.prototype.afterUpdate = function () { };\n    Element.prototype.update = function () {\n        this.updateTransform();\n        if (this.__dirty) {\n            this.updateInnerText();\n        }\n    };\n    Element.prototype.updateInnerText = function (forceUpdate) {\n        var textEl = this._textContent;\n        if (textEl && (!textEl.ignore || forceUpdate)) {\n            if (!this.textConfig) {\n                this.textConfig = {};\n            }\n            var textConfig = this.textConfig;\n            var isLocal = textConfig.local;\n            var innerTransformable = textEl.innerTransformable;\n            var textAlign = void 0;\n            var textVerticalAlign = void 0;\n            var textStyleChanged = false;\n            innerTransformable.parent = isLocal ? this : null;\n            var innerOrigin = false;\n            innerTransformable.copyTransform(textEl);\n            var hasPosition = textConfig.position != null;\n            var autoOverflowArea = textConfig.autoOverflowArea;\n            var layoutRect = void 0;\n            if (autoOverflowArea || hasPosition) {\n                layoutRect = tmpBoundingRect;\n                if (textConfig.layoutRect) {\n                    layoutRect.copy(textConfig.layoutRect);\n                }\n                else {\n                    layoutRect.copy(this.getBoundingRect());\n                }\n                if (!isLocal) {\n                    layoutRect.applyTransform(this.transform);\n                }\n            }\n            if (hasPosition) {\n                if (this.calculateTextPosition) {\n                    this.calculateTextPosition(tmpTextPosCalcRes, textConfig, layoutRect);\n                }\n                else {\n                    calculateTextPosition(tmpTextPosCalcRes, textConfig, layoutRect);\n                }\n                innerTransformable.x = tmpTextPosCalcRes.x;\n                innerTransformable.y = tmpTextPosCalcRes.y;\n                textAlign = tmpTextPosCalcRes.align;\n                textVerticalAlign = tmpTextPosCalcRes.verticalAlign;\n                var textOrigin = textConfig.origin;\n                if (textOrigin && textConfig.rotation != null) {\n                    var relOriginX = void 0;\n                    var relOriginY = void 0;\n                    if (textOrigin === 'center') {\n                        relOriginX = layoutRect.width * 0.5;\n                        relOriginY = layoutRect.height * 0.5;\n                    }\n                    else {\n                        relOriginX = parsePercent(textOrigin[0], layoutRect.width);\n                        relOriginY = parsePercent(textOrigin[1], layoutRect.height);\n                    }\n                    innerOrigin = true;\n                    innerTransformable.originX = -innerTransformable.x + relOriginX + (isLocal ? 0 : layoutRect.x);\n                    innerTransformable.originY = -innerTransformable.y + relOriginY + (isLocal ? 0 : layoutRect.y);\n                }\n            }\n            if (textConfig.rotation != null) {\n                innerTransformable.rotation = textConfig.rotation;\n            }\n            var textOffset = textConfig.offset;\n            if (textOffset) {\n                innerTransformable.x += textOffset[0];\n                innerTransformable.y += textOffset[1];\n                if (!innerOrigin) {\n                    innerTransformable.originX = -textOffset[0];\n                    innerTransformable.originY = -textOffset[1];\n                }\n            }\n            var innerTextDefaultStyle = this._innerTextDefaultStyle || (this._innerTextDefaultStyle = {});\n            if (autoOverflowArea) {\n                var overflowRect = innerTextDefaultStyle.overflowRect =\n                    innerTextDefaultStyle.overflowRect || new BoundingRect(0, 0, 0, 0);\n                innerTransformable.getLocalTransform(tmpInnerTextTrans);\n                invert(tmpInnerTextTrans, tmpInnerTextTrans);\n                BoundingRect.copy(overflowRect, layoutRect);\n                overflowRect.applyTransform(tmpInnerTextTrans);\n            }\n            else {\n                innerTextDefaultStyle.overflowRect = null;\n            }\n            var isInside = textConfig.inside == null\n                ? (typeof textConfig.position === 'string' && textConfig.position.indexOf('inside') >= 0)\n                : textConfig.inside;\n            var textFill = void 0;\n            var textStroke = void 0;\n            var autoStroke = void 0;\n            if (isInside && this.canBeInsideText()) {\n                textFill = textConfig.insideFill;\n                textStroke = textConfig.insideStroke;\n                if (textFill == null || textFill === 'auto') {\n                    textFill = this.getInsideTextFill();\n                }\n                if (textStroke == null || textStroke === 'auto') {\n                    textStroke = this.getInsideTextStroke(textFill);\n                    autoStroke = true;\n                }\n            }\n            else {\n                textFill = textConfig.outsideFill;\n                textStroke = textConfig.outsideStroke;\n                if (textFill == null || textFill === 'auto') {\n                    textFill = this.getOutsideFill();\n                }\n                if (textStroke == null || textStroke === 'auto') {\n                    textStroke = this.getOutsideStroke(textFill);\n                    autoStroke = true;\n                }\n            }\n            textFill = textFill || '#000';\n            if (textFill !== innerTextDefaultStyle.fill\n                || textStroke !== innerTextDefaultStyle.stroke\n                || autoStroke !== innerTextDefaultStyle.autoStroke\n                || textAlign !== innerTextDefaultStyle.align\n                || textVerticalAlign !== innerTextDefaultStyle.verticalAlign) {\n                textStyleChanged = true;\n                innerTextDefaultStyle.fill = textFill;\n                innerTextDefaultStyle.stroke = textStroke;\n                innerTextDefaultStyle.autoStroke = autoStroke;\n                innerTextDefaultStyle.align = textAlign;\n                innerTextDefaultStyle.verticalAlign = textVerticalAlign;\n                textEl.setDefaultTextStyle(innerTextDefaultStyle);\n            }\n            textEl.__dirty |= REDRAW_BIT;\n            if (textStyleChanged) {\n                textEl.dirtyStyle(true);\n            }\n        }\n    };\n    Element.prototype.canBeInsideText = function () {\n        return true;\n    };\n    Element.prototype.getInsideTextFill = function () {\n        return '#fff';\n    };\n    Element.prototype.getInsideTextStroke = function (textFill) {\n        return '#000';\n    };\n    Element.prototype.getOutsideFill = function () {\n        return this.__zr && this.__zr.isDarkMode() ? LIGHT_LABEL_COLOR : DARK_LABEL_COLOR;\n    };\n    Element.prototype.getOutsideStroke = function (textFill) {\n        var backgroundColor = this.__zr && this.__zr.getBackgroundColor();\n        var colorArr = typeof backgroundColor === 'string' && parse(backgroundColor);\n        if (!colorArr) {\n            colorArr = [255, 255, 255, 1];\n        }\n        var alpha = colorArr[3];\n        var isDark = this.__zr.isDarkMode();\n        for (var i = 0; i < 3; i++) {\n            colorArr[i] = colorArr[i] * alpha + (isDark ? 0 : 255) * (1 - alpha);\n        }\n        colorArr[3] = 1;\n        return stringify(colorArr, 'rgba');\n    };\n    Element.prototype.traverse = function (cb, context) { };\n    Element.prototype.attrKV = function (key, value) {\n        if (key === 'textConfig') {\n            this.setTextConfig(value);\n        }\n        else if (key === 'textContent') {\n            this.setTextContent(value);\n        }\n        else if (key === 'clipPath') {\n            this.setClipPath(value);\n        }\n        else if (key === 'extra') {\n            this.extra = this.extra || {};\n            extend(this.extra, value);\n        }\n        else {\n            this[key] = value;\n        }\n    };\n    Element.prototype.hide = function () {\n        this.ignore = true;\n        this.markRedraw();\n    };\n    Element.prototype.show = function () {\n        this.ignore = false;\n        this.markRedraw();\n    };\n    Element.prototype.attr = function (keyOrObj, value) {\n        if (typeof keyOrObj === 'string') {\n            this.attrKV(keyOrObj, value);\n        }\n        else if (isObject(keyOrObj)) {\n            var obj = keyOrObj;\n            var keysArr = keys(obj);\n            for (var i = 0; i < keysArr.length; i++) {\n                var key = keysArr[i];\n                this.attrKV(key, keyOrObj[key]);\n            }\n        }\n        this.markRedraw();\n        return this;\n    };\n    Element.prototype.saveCurrentToNormalState = function (toState) {\n        this._innerSaveToNormal(toState);\n        var normalState = this._normalState;\n        for (var i = 0; i < this.animators.length; i++) {\n            var animator = this.animators[i];\n            var fromStateTransition = animator.__fromStateTransition;\n            if (animator.getLoop() || fromStateTransition && fromStateTransition !== PRESERVED_NORMAL_STATE) {\n                continue;\n            }\n            var targetName = animator.targetName;\n            var target = targetName\n                ? normalState[targetName] : normalState;\n            animator.saveTo(target);\n        }\n    };\n    Element.prototype._innerSaveToNormal = function (toState) {\n        var normalState = this._normalState;\n        if (!normalState) {\n            normalState = this._normalState = {};\n        }\n        if (toState.textConfig && !normalState.textConfig) {\n            normalState.textConfig = this.textConfig;\n        }\n        this._savePrimaryToNormal(toState, normalState, PRIMARY_STATES_KEYS);\n    };\n    Element.prototype._savePrimaryToNormal = function (toState, normalState, primaryKeys) {\n        for (var i = 0; i < primaryKeys.length; i++) {\n            var key = primaryKeys[i];\n            if (toState[key] != null && !(key in normalState)) {\n                normalState[key] = this[key];\n            }\n        }\n    };\n    Element.prototype.hasState = function () {\n        return this.currentStates.length > 0;\n    };\n    Element.prototype.getState = function (name) {\n        return this.states[name];\n    };\n    Element.prototype.ensureState = function (name) {\n        var states = this.states;\n        if (!states[name]) {\n            states[name] = {};\n        }\n        return states[name];\n    };\n    Element.prototype.clearStates = function (noAnimation) {\n        this.useState(PRESERVED_NORMAL_STATE, false, noAnimation);\n    };\n    Element.prototype.useState = function (stateName, keepCurrentStates, noAnimation, forceUseHoverLayer) {\n        var toNormalState = stateName === PRESERVED_NORMAL_STATE;\n        var hasStates = this.hasState();\n        if (!hasStates && toNormalState) {\n            return;\n        }\n        var currentStates = this.currentStates;\n        var animationCfg = this.stateTransition;\n        if (indexOf(currentStates, stateName) >= 0 && (keepCurrentStates || currentStates.length === 1)) {\n            return;\n        }\n        var state;\n        if (this.stateProxy && !toNormalState) {\n            state = this.stateProxy(stateName);\n        }\n        if (!state) {\n            state = (this.states && this.states[stateName]);\n        }\n        if (!state && !toNormalState) {\n            logError(\"State \" + stateName + \" not exists.\");\n            return;\n        }\n        if (!toNormalState) {\n            this.saveCurrentToNormalState(state);\n        }\n        var useHoverLayer = !!((state && state.hoverLayer) || forceUseHoverLayer);\n        if (useHoverLayer) {\n            this._toggleHoverLayerFlag(true);\n        }\n        this._applyStateObj(stateName, state, this._normalState, keepCurrentStates, !noAnimation && !this.__inHover && animationCfg && animationCfg.duration > 0, animationCfg);\n        var textContent = this._textContent;\n        var textGuide = this._textGuide;\n        if (textContent) {\n            textContent.useState(stateName, keepCurrentStates, noAnimation, useHoverLayer);\n        }\n        if (textGuide) {\n            textGuide.useState(stateName, keepCurrentStates, noAnimation, useHoverLayer);\n        }\n        if (toNormalState) {\n            this.currentStates = [];\n            this._normalState = {};\n        }\n        else {\n            if (!keepCurrentStates) {\n                this.currentStates = [stateName];\n            }\n            else {\n                this.currentStates.push(stateName);\n            }\n        }\n        this._updateAnimationTargets();\n        this.markRedraw();\n        if (!useHoverLayer && this.__inHover) {\n            this._toggleHoverLayerFlag(false);\n            this.__dirty &= ~REDRAW_BIT;\n        }\n        return state;\n    };\n    Element.prototype.useStates = function (states, noAnimation, forceUseHoverLayer) {\n        if (!states.length) {\n            this.clearStates();\n        }\n        else {\n            var stateObjects = [];\n            var currentStates = this.currentStates;\n            var len = states.length;\n            var notChange = len === currentStates.length;\n            if (notChange) {\n                for (var i = 0; i < len; i++) {\n                    if (states[i] !== currentStates[i]) {\n                        notChange = false;\n                        break;\n                    }\n                }\n            }\n            if (notChange) {\n                return;\n            }\n            for (var i = 0; i < len; i++) {\n                var stateName = states[i];\n                var stateObj = void 0;\n                if (this.stateProxy) {\n                    stateObj = this.stateProxy(stateName, states);\n                }\n                if (!stateObj) {\n                    stateObj = this.states[stateName];\n                }\n                if (stateObj) {\n                    stateObjects.push(stateObj);\n                }\n            }\n            var lastStateObj = stateObjects[len - 1];\n            var useHoverLayer = !!((lastStateObj && lastStateObj.hoverLayer) || forceUseHoverLayer);\n            if (useHoverLayer) {\n                this._toggleHoverLayerFlag(true);\n            }\n            var mergedState = this._mergeStates(stateObjects);\n            var animationCfg = this.stateTransition;\n            this.saveCurrentToNormalState(mergedState);\n            this._applyStateObj(states.join(','), mergedState, this._normalState, false, !noAnimation && !this.__inHover && animationCfg && animationCfg.duration > 0, animationCfg);\n            var textContent = this._textContent;\n            var textGuide = this._textGuide;\n            if (textContent) {\n                textContent.useStates(states, noAnimation, useHoverLayer);\n            }\n            if (textGuide) {\n                textGuide.useStates(states, noAnimation, useHoverLayer);\n            }\n            this._updateAnimationTargets();\n            this.currentStates = states.slice();\n            this.markRedraw();\n            if (!useHoverLayer && this.__inHover) {\n                this._toggleHoverLayerFlag(false);\n                this.__dirty &= ~REDRAW_BIT;\n            }\n        }\n    };\n    Element.prototype.isSilent = function () {\n        var el = this;\n        while (el) {\n            if (el.silent) {\n                return true;\n            }\n            var hostEl = el.__hostTarget;\n            el = hostEl ? (el.ignoreHostSilent ? null : hostEl) : el.parent;\n        }\n        return false;\n    };\n    Element.prototype._updateAnimationTargets = function () {\n        for (var i = 0; i < this.animators.length; i++) {\n            var animator = this.animators[i];\n            if (animator.targetName) {\n                animator.changeTarget(this[animator.targetName]);\n            }\n        }\n    };\n    Element.prototype.removeState = function (state) {\n        var idx = indexOf(this.currentStates, state);\n        if (idx >= 0) {\n            var currentStates = this.currentStates.slice();\n            currentStates.splice(idx, 1);\n            this.useStates(currentStates);\n        }\n    };\n    Element.prototype.replaceState = function (oldState, newState, forceAdd) {\n        var currentStates = this.currentStates.slice();\n        var idx = indexOf(currentStates, oldState);\n        var newStateExists = indexOf(currentStates, newState) >= 0;\n        if (idx >= 0) {\n            if (!newStateExists) {\n                currentStates[idx] = newState;\n            }\n            else {\n                currentStates.splice(idx, 1);\n            }\n        }\n        else if (forceAdd && !newStateExists) {\n            currentStates.push(newState);\n        }\n        this.useStates(currentStates);\n    };\n    Element.prototype.toggleState = function (state, enable) {\n        if (enable) {\n            this.useState(state, true);\n        }\n        else {\n            this.removeState(state);\n        }\n    };\n    Element.prototype._mergeStates = function (states) {\n        var mergedState = {};\n        var mergedTextConfig;\n        for (var i = 0; i < states.length; i++) {\n            var state = states[i];\n            extend(mergedState, state);\n            if (state.textConfig) {\n                mergedTextConfig = mergedTextConfig || {};\n                extend(mergedTextConfig, state.textConfig);\n            }\n        }\n        if (mergedTextConfig) {\n            mergedState.textConfig = mergedTextConfig;\n        }\n        return mergedState;\n    };\n    Element.prototype._applyStateObj = function (stateName, state, normalState, keepCurrentStates, transition, animationCfg) {\n        var needsRestoreToNormal = !(state && keepCurrentStates);\n        if (state && state.textConfig) {\n            this.textConfig = extend({}, keepCurrentStates ? this.textConfig : normalState.textConfig);\n            extend(this.textConfig, state.textConfig);\n        }\n        else if (needsRestoreToNormal) {\n            if (normalState.textConfig) {\n                this.textConfig = normalState.textConfig;\n            }\n        }\n        var transitionTarget = {};\n        var hasTransition = false;\n        for (var i = 0; i < PRIMARY_STATES_KEYS.length; i++) {\n            var key = PRIMARY_STATES_KEYS[i];\n            var propNeedsTransition = transition && DEFAULT_ANIMATABLE_MAP[key];\n            if (state && state[key] != null) {\n                if (propNeedsTransition) {\n                    hasTransition = true;\n                    transitionTarget[key] = state[key];\n                }\n                else {\n                    this[key] = state[key];\n                }\n            }\n            else if (needsRestoreToNormal) {\n                if (normalState[key] != null) {\n                    if (propNeedsTransition) {\n                        hasTransition = true;\n                        transitionTarget[key] = normalState[key];\n                    }\n                    else {\n                        this[key] = normalState[key];\n                    }\n                }\n            }\n        }\n        if (!transition) {\n            for (var i = 0; i < this.animators.length; i++) {\n                var animator = this.animators[i];\n                var targetName = animator.targetName;\n                if (!animator.getLoop()) {\n                    animator.__changeFinalValue(targetName\n                        ? (state || normalState)[targetName]\n                        : (state || normalState));\n                }\n            }\n        }\n        if (hasTransition) {\n            this._transitionState(stateName, transitionTarget, animationCfg);\n        }\n    };\n    Element.prototype._attachComponent = function (componentEl) {\n        if (componentEl.__zr && !componentEl.__hostTarget) {\n            if (process.env.NODE_ENV !== 'production') {\n                throw new Error('Text element has been added to zrender.');\n            }\n            return;\n        }\n        if (componentEl === this) {\n            if (process.env.NODE_ENV !== 'production') {\n                throw new Error('Recursive component attachment.');\n            }\n            return;\n        }\n        var zr = this.__zr;\n        if (zr) {\n            componentEl.addSelfToZr(zr);\n        }\n        componentEl.__zr = zr;\n        componentEl.__hostTarget = this;\n    };\n    Element.prototype._detachComponent = function (componentEl) {\n        if (componentEl.__zr) {\n            componentEl.removeSelfFromZr(componentEl.__zr);\n        }\n        componentEl.__zr = null;\n        componentEl.__hostTarget = null;\n    };\n    Element.prototype.getClipPath = function () {\n        return this._clipPath;\n    };\n    Element.prototype.setClipPath = function (clipPath) {\n        if (this._clipPath && this._clipPath !== clipPath) {\n            this.removeClipPath();\n        }\n        this._attachComponent(clipPath);\n        this._clipPath = clipPath;\n        this.markRedraw();\n    };\n    Element.prototype.removeClipPath = function () {\n        var clipPath = this._clipPath;\n        if (clipPath) {\n            this._detachComponent(clipPath);\n            this._clipPath = null;\n            this.markRedraw();\n        }\n    };\n    Element.prototype.getTextContent = function () {\n        return this._textContent;\n    };\n    Element.prototype.setTextContent = function (textEl) {\n        var previousTextContent = this._textContent;\n        if (previousTextContent === textEl) {\n            return;\n        }\n        if (previousTextContent && previousTextContent !== textEl) {\n            this.removeTextContent();\n        }\n        if (process.env.NODE_ENV !== 'production') {\n            if (textEl.__zr && !textEl.__hostTarget) {\n                throw new Error('Text element has been added to zrender.');\n            }\n        }\n        textEl.innerTransformable = new Transformable();\n        this._attachComponent(textEl);\n        this._textContent = textEl;\n        this.markRedraw();\n    };\n    Element.prototype.setTextConfig = function (cfg) {\n        if (!this.textConfig) {\n            this.textConfig = {};\n        }\n        extend(this.textConfig, cfg);\n        this.markRedraw();\n    };\n    Element.prototype.removeTextConfig = function () {\n        this.textConfig = null;\n        this.markRedraw();\n    };\n    Element.prototype.removeTextContent = function () {\n        var textEl = this._textContent;\n        if (textEl) {\n            textEl.innerTransformable = null;\n            this._detachComponent(textEl);\n            this._textContent = null;\n            this._innerTextDefaultStyle = null;\n            this.markRedraw();\n        }\n    };\n    Element.prototype.getTextGuideLine = function () {\n        return this._textGuide;\n    };\n    Element.prototype.setTextGuideLine = function (guideLine) {\n        if (this._textGuide && this._textGuide !== guideLine) {\n            this.removeTextGuideLine();\n        }\n        this._attachComponent(guideLine);\n        this._textGuide = guideLine;\n        this.markRedraw();\n    };\n    Element.prototype.removeTextGuideLine = function () {\n        var textGuide = this._textGuide;\n        if (textGuide) {\n            this._detachComponent(textGuide);\n            this._textGuide = null;\n            this.markRedraw();\n        }\n    };\n    Element.prototype.markRedraw = function () {\n        this.__dirty |= REDRAW_BIT;\n        var zr = this.__zr;\n        if (zr) {\n            if (this.__inHover) {\n                zr.refreshHover();\n            }\n            else {\n                zr.refresh();\n            }\n        }\n        if (this.__hostTarget) {\n            this.__hostTarget.markRedraw();\n        }\n    };\n    Element.prototype.dirty = function () {\n        this.markRedraw();\n    };\n    Element.prototype._toggleHoverLayerFlag = function (inHover) {\n        this.__inHover = inHover;\n        var textContent = this._textContent;\n        var textGuide = this._textGuide;\n        if (textContent) {\n            textContent.__inHover = inHover;\n        }\n        if (textGuide) {\n            textGuide.__inHover = inHover;\n        }\n    };\n    Element.prototype.addSelfToZr = function (zr) {\n        if (this.__zr === zr) {\n            return;\n        }\n        this.__zr = zr;\n        var animators = this.animators;\n        if (animators) {\n            for (var i = 0; i < animators.length; i++) {\n                zr.animation.addAnimator(animators[i]);\n            }\n        }\n        if (this._clipPath) {\n            this._clipPath.addSelfToZr(zr);\n        }\n        if (this._textContent) {\n            this._textContent.addSelfToZr(zr);\n        }\n        if (this._textGuide) {\n            this._textGuide.addSelfToZr(zr);\n        }\n    };\n    Element.prototype.removeSelfFromZr = function (zr) {\n        if (!this.__zr) {\n            return;\n        }\n        this.__zr = null;\n        var animators = this.animators;\n        if (animators) {\n            for (var i = 0; i < animators.length; i++) {\n                zr.animation.removeAnimator(animators[i]);\n            }\n        }\n        if (this._clipPath) {\n            this._clipPath.removeSelfFromZr(zr);\n        }\n        if (this._textContent) {\n            this._textContent.removeSelfFromZr(zr);\n        }\n        if (this._textGuide) {\n            this._textGuide.removeSelfFromZr(zr);\n        }\n    };\n    Element.prototype.animate = function (key, loop, allowDiscreteAnimation) {\n        var target = key ? this[key] : this;\n        if (process.env.NODE_ENV !== 'production') {\n            if (!target) {\n                logError('Property \"'\n                    + key\n                    + '\" is not existed in element '\n                    + this.id);\n                return;\n            }\n        }\n        var animator = new Animator(target, loop, allowDiscreteAnimation);\n        key && (animator.targetName = key);\n        this.addAnimator(animator, key);\n        return animator;\n    };\n    Element.prototype.addAnimator = function (animator, key) {\n        var zr = this.__zr;\n        var el = this;\n        animator.during(function () {\n            el.updateDuringAnimation(key);\n        }).done(function () {\n            var animators = el.animators;\n            var idx = indexOf(animators, animator);\n            if (idx >= 0) {\n                animators.splice(idx, 1);\n            }\n        });\n        this.animators.push(animator);\n        if (zr) {\n            zr.animation.addAnimator(animator);\n        }\n        zr && zr.wakeUp();\n    };\n    Element.prototype.updateDuringAnimation = function (key) {\n        this.markRedraw();\n    };\n    Element.prototype.stopAnimation = function (scope, forwardToLast) {\n        var animators = this.animators;\n        var len = animators.length;\n        var leftAnimators = [];\n        for (var i = 0; i < len; i++) {\n            var animator = animators[i];\n            if (!scope || scope === animator.scope) {\n                animator.stop(forwardToLast);\n            }\n            else {\n                leftAnimators.push(animator);\n            }\n        }\n        this.animators = leftAnimators;\n        return this;\n    };\n    Element.prototype.animateTo = function (target, cfg, animationProps) {\n        animateTo(this, target, cfg, animationProps);\n    };\n    Element.prototype.animateFrom = function (target, cfg, animationProps) {\n        animateTo(this, target, cfg, animationProps, true);\n    };\n    Element.prototype._transitionState = function (stateName, target, cfg, animationProps) {\n        var animators = animateTo(this, target, cfg, animationProps);\n        for (var i = 0; i < animators.length; i++) {\n            animators[i].__fromStateTransition = stateName;\n        }\n    };\n    Element.prototype.getBoundingRect = function () {\n        return null;\n    };\n    Element.prototype.getPaintRect = function () {\n        return null;\n    };\n    Element.initDefaultProps = (function () {\n        var elProto = Element.prototype;\n        elProto.type = 'element';\n        elProto.name = '';\n        elProto.ignore =\n            elProto.silent =\n                elProto.ignoreHostSilent =\n                    elProto.isGroup =\n                        elProto.draggable =\n                            elProto.dragging =\n                                elProto.ignoreClip =\n                                    elProto.__inHover = false;\n        elProto.__dirty = REDRAW_BIT;\n        var logs = {};\n        function logDeprecatedError(key, xKey, yKey) {\n            if (!logs[key + xKey + yKey]) {\n                console.warn(\"DEPRECATED: '\" + key + \"' has been deprecated. use '\" + xKey + \"', '\" + yKey + \"' instead\");\n                logs[key + xKey + yKey] = true;\n            }\n        }\n        function createLegacyProperty(key, privateKey, xKey, yKey) {\n            Object.defineProperty(elProto, key, {\n                get: function () {\n                    if (process.env.NODE_ENV !== 'production') {\n                        logDeprecatedError(key, xKey, yKey);\n                    }\n                    if (!this[privateKey]) {\n                        var pos = this[privateKey] = [];\n                        enhanceArray(this, pos);\n                    }\n                    return this[privateKey];\n                },\n                set: function (pos) {\n                    if (process.env.NODE_ENV !== 'production') {\n                        logDeprecatedError(key, xKey, yKey);\n                    }\n                    this[xKey] = pos[0];\n                    this[yKey] = pos[1];\n                    this[privateKey] = pos;\n                    enhanceArray(this, pos);\n                }\n            });\n            function enhanceArray(self, pos) {\n                Object.defineProperty(pos, 0, {\n                    get: function () {\n                        return self[xKey];\n                    },\n                    set: function (val) {\n                        self[xKey] = val;\n                    }\n                });\n                Object.defineProperty(pos, 1, {\n                    get: function () {\n                        return self[yKey];\n                    },\n                    set: function (val) {\n                        self[yKey] = val;\n                    }\n                });\n            }\n        }\n        if (Object.defineProperty) {\n            createLegacyProperty('position', '_legacyPos', 'x', 'y');\n            createLegacyProperty('scale', '_legacyScale', 'scaleX', 'scaleY');\n            createLegacyProperty('origin', '_legacyOrigin', 'originX', 'originY');\n        }\n    })();\n    return Element;\n}());\nmixin(Element, Eventful);\nmixin(Element, Transformable);\nfunction animateTo(animatable, target, cfg, animationProps, reverse) {\n    cfg = cfg || {};\n    var animators = [];\n    animateToShallow(animatable, '', animatable, target, cfg, animationProps, animators, reverse);\n    var finishCount = animators.length;\n    var doneHappened = false;\n    var cfgDone = cfg.done;\n    var cfgAborted = cfg.aborted;\n    var doneCb = function () {\n        doneHappened = true;\n        finishCount--;\n        if (finishCount <= 0) {\n            doneHappened\n                ? (cfgDone && cfgDone())\n                : (cfgAborted && cfgAborted());\n        }\n    };\n    var abortedCb = function () {\n        finishCount--;\n        if (finishCount <= 0) {\n            doneHappened\n                ? (cfgDone && cfgDone())\n                : (cfgAborted && cfgAborted());\n        }\n    };\n    if (!finishCount) {\n        cfgDone && cfgDone();\n    }\n    if (animators.length > 0 && cfg.during) {\n        animators[0].during(function (target, percent) {\n            cfg.during(percent);\n        });\n    }\n    for (var i = 0; i < animators.length; i++) {\n        var animator = animators[i];\n        if (doneCb) {\n            animator.done(doneCb);\n        }\n        if (abortedCb) {\n            animator.aborted(abortedCb);\n        }\n        if (cfg.force) {\n            animator.duration(cfg.duration);\n        }\n        animator.start(cfg.easing);\n    }\n    return animators;\n}\nfunction copyArrShallow(source, target, len) {\n    for (var i = 0; i < len; i++) {\n        source[i] = target[i];\n    }\n}\nfunction is2DArray(value) {\n    return isArrayLike(value[0]);\n}\nfunction copyValue(target, source, key) {\n    if (isArrayLike(source[key])) {\n        if (!isArrayLike(target[key])) {\n            target[key] = [];\n        }\n        if (isTypedArray(source[key])) {\n            var len = source[key].length;\n            if (target[key].length !== len) {\n                target[key] = new (source[key].constructor)(len);\n                copyArrShallow(target[key], source[key], len);\n            }\n        }\n        else {\n            var sourceArr = source[key];\n            var targetArr = target[key];\n            var len0 = sourceArr.length;\n            if (is2DArray(sourceArr)) {\n                var len1 = sourceArr[0].length;\n                for (var i = 0; i < len0; i++) {\n                    if (!targetArr[i]) {\n                        targetArr[i] = Array.prototype.slice.call(sourceArr[i]);\n                    }\n                    else {\n                        copyArrShallow(targetArr[i], sourceArr[i], len1);\n                    }\n                }\n            }\n            else {\n                copyArrShallow(targetArr, sourceArr, len0);\n            }\n            targetArr.length = sourceArr.length;\n        }\n    }\n    else {\n        target[key] = source[key];\n    }\n}\nfunction isValueSame(val1, val2) {\n    return val1 === val2\n        || isArrayLike(val1) && isArrayLike(val2) && is1DArraySame(val1, val2);\n}\nfunction is1DArraySame(arr0, arr1) {\n    var len = arr0.length;\n    if (len !== arr1.length) {\n        return false;\n    }\n    for (var i = 0; i < len; i++) {\n        if (arr0[i] !== arr1[i]) {\n            return false;\n        }\n    }\n    return true;\n}\nfunction animateToShallow(animatable, topKey, animateObj, target, cfg, animationProps, animators, reverse) {\n    var targetKeys = keys(target);\n    var duration = cfg.duration;\n    var delay = cfg.delay;\n    var additive = cfg.additive;\n    var setToFinal = cfg.setToFinal;\n    var animateAll = !isObject(animationProps);\n    var existsAnimators = animatable.animators;\n    var animationKeys = [];\n    for (var k = 0; k < targetKeys.length; k++) {\n        var innerKey = targetKeys[k];\n        var targetVal = target[innerKey];\n        if (targetVal != null && animateObj[innerKey] != null\n            && (animateAll || animationProps[innerKey])) {\n            if (isObject(targetVal)\n                && !isArrayLike(targetVal)\n                && !isGradientObject(targetVal)) {\n                if (topKey) {\n                    if (!reverse) {\n                        animateObj[innerKey] = targetVal;\n                        animatable.updateDuringAnimation(topKey);\n                    }\n                    continue;\n                }\n                animateToShallow(animatable, innerKey, animateObj[innerKey], targetVal, cfg, animationProps && animationProps[innerKey], animators, reverse);\n            }\n            else {\n                animationKeys.push(innerKey);\n            }\n        }\n        else if (!reverse) {\n            animateObj[innerKey] = targetVal;\n            animatable.updateDuringAnimation(topKey);\n            animationKeys.push(innerKey);\n        }\n    }\n    var keyLen = animationKeys.length;\n    if (!additive && keyLen) {\n        for (var i = 0; i < existsAnimators.length; i++) {\n            var animator = existsAnimators[i];\n            if (animator.targetName === topKey) {\n                var allAborted = animator.stopTracks(animationKeys);\n                if (allAborted) {\n                    var idx = indexOf(existsAnimators, animator);\n                    existsAnimators.splice(idx, 1);\n                }\n            }\n        }\n    }\n    if (!cfg.force) {\n        animationKeys = filter(animationKeys, function (key) { return !isValueSame(target[key], animateObj[key]); });\n        keyLen = animationKeys.length;\n    }\n    if (keyLen > 0\n        || (cfg.force && !animators.length)) {\n        var revertedSource = void 0;\n        var reversedTarget = void 0;\n        var sourceClone = void 0;\n        if (reverse) {\n            reversedTarget = {};\n            if (setToFinal) {\n                revertedSource = {};\n            }\n            for (var i = 0; i < keyLen; i++) {\n                var innerKey = animationKeys[i];\n                reversedTarget[innerKey] = animateObj[innerKey];\n                if (setToFinal) {\n                    revertedSource[innerKey] = target[innerKey];\n                }\n                else {\n                    animateObj[innerKey] = target[innerKey];\n                }\n            }\n        }\n        else if (setToFinal) {\n            sourceClone = {};\n            for (var i = 0; i < keyLen; i++) {\n                var innerKey = animationKeys[i];\n                sourceClone[innerKey] = cloneValue(animateObj[innerKey]);\n                copyValue(animateObj, target, innerKey);\n            }\n        }\n        var animator = new Animator(animateObj, false, false, additive ? filter(existsAnimators, function (animator) { return animator.targetName === topKey; }) : null);\n        animator.targetName = topKey;\n        if (cfg.scope) {\n            animator.scope = cfg.scope;\n        }\n        if (setToFinal && revertedSource) {\n            animator.whenWithKeys(0, revertedSource, animationKeys);\n        }\n        if (sourceClone) {\n            animator.whenWithKeys(0, sourceClone, animationKeys);\n        }\n        animator.whenWithKeys(duration == null ? 500 : duration, reverse ? reversedTarget : target, animationKeys).delay(delay || 0);\n        animatable.addAnimator(animator, topKey);\n        animators.push(animator);\n    }\n}\nexport default Element;\n", "import { __extends } from \"tslib\";\nimport * as zrUtil from '../core/util.js';\nimport Element from '../Element.js';\nimport BoundingRect from '../core/BoundingRect.js';\nvar Group = (function (_super) {\n    __extends(Group, _super);\n    function Group(opts) {\n        var _this = _super.call(this) || this;\n        _this.isGroup = true;\n        _this._children = [];\n        _this.attr(opts);\n        return _this;\n    }\n    Group.prototype.childrenRef = function () {\n        return this._children;\n    };\n    Group.prototype.children = function () {\n        return this._children.slice();\n    };\n    Group.prototype.childAt = function (idx) {\n        return this._children[idx];\n    };\n    Group.prototype.childOfName = function (name) {\n        var children = this._children;\n        for (var i = 0; i < children.length; i++) {\n            if (children[i].name === name) {\n                return children[i];\n            }\n        }\n    };\n    Group.prototype.childCount = function () {\n        return this._children.length;\n    };\n    Group.prototype.add = function (child) {\n        if (child) {\n            if (child !== this && child.parent !== this) {\n                this._children.push(child);\n                this._doAdd(child);\n            }\n            if (process.env.NODE_ENV !== 'production') {\n                if (child.__hostTarget) {\n                    throw 'This elemenet has been used as an attachment';\n                }\n            }\n        }\n        return this;\n    };\n    Group.prototype.addBefore = function (child, nextSibling) {\n        if (child && child !== this && child.parent !== this\n            && nextSibling && nextSibling.parent === this) {\n            var children = this._children;\n            var idx = children.indexOf(nextSibling);\n            if (idx >= 0) {\n                children.splice(idx, 0, child);\n                this._doAdd(child);\n            }\n        }\n        return this;\n    };\n    Group.prototype.replace = function (oldChild, newChild) {\n        var idx = zrUtil.indexOf(this._children, oldChild);\n        if (idx >= 0) {\n            this.replaceAt(newChild, idx);\n        }\n        return this;\n    };\n    Group.prototype.replaceAt = function (child, index) {\n        var children = this._children;\n        var old = children[index];\n        if (child && child !== this && child.parent !== this && child !== old) {\n            children[index] = child;\n            old.parent = null;\n            var zr = this.__zr;\n            if (zr) {\n                old.removeSelfFromZr(zr);\n            }\n            this._doAdd(child);\n        }\n        return this;\n    };\n    Group.prototype._doAdd = function (child) {\n        if (child.parent) {\n            child.parent.remove(child);\n        }\n        child.parent = this;\n        var zr = this.__zr;\n        if (zr && zr !== child.__zr) {\n            child.addSelfToZr(zr);\n        }\n        zr && zr.refresh();\n    };\n    Group.prototype.remove = function (child) {\n        var zr = this.__zr;\n        var children = this._children;\n        var idx = zrUtil.indexOf(children, child);\n        if (idx < 0) {\n            return this;\n        }\n        children.splice(idx, 1);\n        child.parent = null;\n        if (zr) {\n            child.removeSelfFromZr(zr);\n        }\n        zr && zr.refresh();\n        return this;\n    };\n    Group.prototype.removeAll = function () {\n        var children = this._children;\n        var zr = this.__zr;\n        for (var i = 0; i < children.length; i++) {\n            var child = children[i];\n            if (zr) {\n                child.removeSelfFromZr(zr);\n            }\n            child.parent = null;\n        }\n        children.length = 0;\n        return this;\n    };\n    Group.prototype.eachChild = function (cb, context) {\n        var children = this._children;\n        for (var i = 0; i < children.length; i++) {\n            var child = children[i];\n            cb.call(context, child, i);\n        }\n        return this;\n    };\n    Group.prototype.traverse = function (cb, context) {\n        for (var i = 0; i < this._children.length; i++) {\n            var child = this._children[i];\n            var stopped = cb.call(context, child);\n            if (child.isGroup && !stopped) {\n                child.traverse(cb, context);\n            }\n        }\n        return this;\n    };\n    Group.prototype.addSelfToZr = function (zr) {\n        _super.prototype.addSelfToZr.call(this, zr);\n        for (var i = 0; i < this._children.length; i++) {\n            var child = this._children[i];\n            child.addSelfToZr(zr);\n        }\n    };\n    Group.prototype.removeSelfFromZr = function (zr) {\n        _super.prototype.removeSelfFromZr.call(this, zr);\n        for (var i = 0; i < this._children.length; i++) {\n            var child = this._children[i];\n            child.removeSelfFromZr(zr);\n        }\n    };\n    Group.prototype.getBoundingRect = function (includeChildren) {\n        var tmpRect = new BoundingRect(0, 0, 0, 0);\n        var children = includeChildren || this._children;\n        var tmpMat = [];\n        var rect = null;\n        for (var i = 0; i < children.length; i++) {\n            var child = children[i];\n            if (child.ignore || child.invisible) {\n                continue;\n            }\n            var childRect = child.getBoundingRect();\n            var transform = child.getLocalTransform(tmpMat);\n            if (transform) {\n                BoundingRect.applyTransform(tmpRect, childRect, transform);\n                rect = rect || tmpRect.clone();\n                rect.union(tmpRect);\n            }\n            else {\n                rect = rect || childRect.clone();\n                rect.union(childRect);\n            }\n        }\n        return rect || tmpRect;\n    };\n    return Group;\n}(Element));\nGroup.prototype.type = 'group';\nexport default Group;\n", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n/*\n* A third-party license is embedded for some of the code in this file:\n* The method \"quantile\" was copied from \"d3.js\".\n* (See more details in the comment of the method below.)\n* The use of the source code of this file is also subject to the terms\n* and consitions of the license of \"d3.js\" (BSD-3Clause, see\n* </licenses/LICENSE-d3>).\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nvar RADIAN_EPSILON = 1e-4;\n// Although chrome already enlarge this number to 100 for `toFixed`, but\n// we sill follow the spec for compatibility.\nvar ROUND_SUPPORTED_PRECISION_MAX = 20;\nfunction _trim(str) {\n  return str.replace(/^\\s+|\\s+$/g, '');\n}\nexport var mathMin = Math.min;\nexport var mathMax = Math.max;\nexport var mathAbs = Math.abs;\n/**\n * Linear mapping a value from domain to range\n * @param  val\n * @param  domain Domain extent domain[0] can be bigger than domain[1]\n * @param  range  Range extent range[0] can be bigger than range[1]\n * @param  clamp Default to be false\n */\nexport function linearMap(val, domain, range, clamp) {\n  var d0 = domain[0];\n  var d1 = domain[1];\n  var r0 = range[0];\n  var r1 = range[1];\n  var subDomain = d1 - d0;\n  var subRange = r1 - r0;\n  if (subDomain === 0) {\n    return subRange === 0 ? r0 : (r0 + r1) / 2;\n  }\n  // Avoid accuracy problem in edge, such as\n  // 146.39 - 62.83 === 83.55999999999999.\n  // See echarts/test/ut/spec/util/number.js#linearMap#accuracyError\n  // It is a little verbose for efficiency considering this method\n  // is a hotspot.\n  if (clamp) {\n    if (subDomain > 0) {\n      if (val <= d0) {\n        return r0;\n      } else if (val >= d1) {\n        return r1;\n      }\n    } else {\n      if (val >= d0) {\n        return r0;\n      } else if (val <= d1) {\n        return r1;\n      }\n    }\n  } else {\n    if (val === d0) {\n      return r0;\n    }\n    if (val === d1) {\n      return r1;\n    }\n  }\n  return (val - d0) / subDomain * subRange + r0;\n}\n/**\n * Preserve the name `parsePercent` for backward compatibility,\n * and it's effectively published as `echarts.number.parsePercent`.\n */\nexport var parsePercent = parsePositionOption;\n/**\n * @see {parsePositionSizeOption} and also accept a string preset.\n * @see {PositionSizeOption}\n */\nexport function parsePositionOption(option, percentBase, percentOffset) {\n  switch (option) {\n    case 'center':\n    case 'middle':\n      option = '50%';\n      break;\n    case 'left':\n    case 'top':\n      option = '0%';\n      break;\n    case 'right':\n    case 'bottom':\n      option = '100%';\n      break;\n  }\n  return parsePositionSizeOption(option, percentBase, percentOffset);\n}\n/**\n * Accept number, or numeric stirng (`'123'`), or percentage ('100%'), as x/y/width/height pixel number.\n * If null/undefined or invalid, return NaN.\n * (But allow JS type coercion (`+option`) due to backward compatibility)\n * @see {PositionSizeOption}\n */\nexport function parsePositionSizeOption(option, percentBase, percentOffset) {\n  if (zrUtil.isString(option)) {\n    if (_trim(option).match(/%$/)) {\n      return parseFloat(option) / 100 * percentBase + (percentOffset || 0);\n    }\n    return parseFloat(option);\n  }\n  // Allow flexible input due to backward compatibility.\n  return option == null ? NaN : +option;\n}\nexport function round(x, precision, returnStr) {\n  if (precision == null) {\n    // FIXME: the default precision should not be provided, since there is no universally adaptable\n    //  precision. The caller need to input a precision according to the scenarios.\n    precision = 10;\n  }\n  // Avoid range error\n  precision = Math.min(Math.max(0, precision), ROUND_SUPPORTED_PRECISION_MAX);\n  // PENDING: 1.005.toFixed(2) is '1.00' rather than '1.01'\n  x = (+x).toFixed(precision);\n  return returnStr ? x : +x;\n}\n/**\n * Inplacd asc sort arr.\n * The input arr will be modified.\n */\nexport function asc(arr) {\n  arr.sort(function (a, b) {\n    return a - b;\n  });\n  return arr;\n}\n/**\n * Get precision.\n */\nexport function getPrecision(val) {\n  val = +val;\n  if (isNaN(val)) {\n    return 0;\n  }\n  // It is much faster than methods converting number to string as follows\n  //      let tmp = val.toString();\n  //      return tmp.length - 1 - tmp.indexOf('.');\n  // especially when precision is low\n  // Notice:\n  // (1) If the loop count is over about 20, it is slower than `getPrecisionSafe`.\n  //     (see https://jsbench.me/2vkpcekkvw/1)\n  // (2) If the val is less than for example 1e-15, the result may be incorrect.\n  //     (see test/ut/spec/util/number.test.ts `getPrecision_equal_random`)\n  if (val > 1e-14) {\n    var e = 1;\n    for (var i = 0; i < 15; i++, e *= 10) {\n      if (Math.round(val * e) / e === val) {\n        return i;\n      }\n    }\n  }\n  return getPrecisionSafe(val);\n}\n/**\n * Get precision with slow but safe method\n */\nexport function getPrecisionSafe(val) {\n  // toLowerCase for: '3.4E-12'\n  var str = val.toString().toLowerCase();\n  // Consider scientific notation: '3.4e-12' '3.4e+12'\n  var eIndex = str.indexOf('e');\n  var exp = eIndex > 0 ? +str.slice(eIndex + 1) : 0;\n  var significandPartLen = eIndex > 0 ? eIndex : str.length;\n  var dotIndex = str.indexOf('.');\n  var decimalPartLen = dotIndex < 0 ? 0 : significandPartLen - 1 - dotIndex;\n  return Math.max(0, decimalPartLen - exp);\n}\n/**\n * Minimal dicernible data precisioin according to a single pixel.\n */\nexport function getPixelPrecision(dataExtent, pixelExtent) {\n  var log = Math.log;\n  var LN10 = Math.LN10;\n  var dataQuantity = Math.floor(log(dataExtent[1] - dataExtent[0]) / LN10);\n  var sizeQuantity = Math.round(log(mathAbs(pixelExtent[1] - pixelExtent[0])) / LN10);\n  // toFixed() digits argument must be between 0 and 20.\n  var precision = Math.min(Math.max(-dataQuantity + sizeQuantity, 0), 20);\n  return !isFinite(precision) ? 20 : precision;\n}\n/**\n * Get a data of given precision, assuring the sum of percentages\n * in valueList is 1.\n * The largest remainder method is used.\n * https://en.wikipedia.org/wiki/Largest_remainder_method\n *\n * @param valueList a list of all data\n * @param idx index of the data to be processed in valueList\n * @param precision integer number showing digits of precision\n * @return percent ranging from 0 to 100\n */\nexport function getPercentWithPrecision(valueList, idx, precision) {\n  if (!valueList[idx]) {\n    return 0;\n  }\n  var seats = getPercentSeats(valueList, precision);\n  return seats[idx] || 0;\n}\n/**\n * Get a data of given precision, assuring the sum of percentages\n * in valueList is 1.\n * The largest remainder method is used.\n * https://en.wikipedia.org/wiki/Largest_remainder_method\n *\n * @param valueList a list of all data\n * @param precision integer number showing digits of precision\n * @return {Array<number>}\n */\nexport function getPercentSeats(valueList, precision) {\n  var sum = zrUtil.reduce(valueList, function (acc, val) {\n    return acc + (isNaN(val) ? 0 : val);\n  }, 0);\n  if (sum === 0) {\n    return [];\n  }\n  var digits = Math.pow(10, precision);\n  var votesPerQuota = zrUtil.map(valueList, function (val) {\n    return (isNaN(val) ? 0 : val) / sum * digits * 100;\n  });\n  var targetSeats = digits * 100;\n  var seats = zrUtil.map(votesPerQuota, function (votes) {\n    // Assign automatic seats.\n    return Math.floor(votes);\n  });\n  var currentSum = zrUtil.reduce(seats, function (acc, val) {\n    return acc + val;\n  }, 0);\n  var remainder = zrUtil.map(votesPerQuota, function (votes, idx) {\n    return votes - seats[idx];\n  });\n  // Has remainding votes.\n  while (currentSum < targetSeats) {\n    // Find next largest remainder.\n    var max = Number.NEGATIVE_INFINITY;\n    var maxId = null;\n    for (var i = 0, len = remainder.length; i < len; ++i) {\n      if (remainder[i] > max) {\n        max = remainder[i];\n        maxId = i;\n      }\n    }\n    // Add a vote to max remainder.\n    ++seats[maxId];\n    remainder[maxId] = 0;\n    ++currentSum;\n  }\n  return zrUtil.map(seats, function (seat) {\n    return seat / digits;\n  });\n}\n/**\n * Solve the floating point adding problem like 0.1 + 0.2 === 0.30000000000000004\n * See <http://0.30000000000000004.com/>\n */\nexport function addSafe(val0, val1) {\n  var maxPrecision = Math.max(getPrecision(val0), getPrecision(val1));\n  // const multiplier = Math.pow(10, maxPrecision);\n  // return (Math.round(val0 * multiplier) + Math.round(val1 * multiplier)) / multiplier;\n  var sum = val0 + val1;\n  // // PENDING: support more?\n  return maxPrecision > ROUND_SUPPORTED_PRECISION_MAX ? sum : round(sum, maxPrecision);\n}\n// Number.MAX_SAFE_INTEGER, ie do not support.\nexport var MAX_SAFE_INTEGER = 9007199254740991;\n/**\n * To 0 - 2 * PI, considering negative radian.\n */\nexport function remRadian(radian) {\n  var pi2 = Math.PI * 2;\n  return (radian % pi2 + pi2) % pi2;\n}\n/**\n * @param {type} radian\n * @return {boolean}\n */\nexport function isRadianAroundZero(val) {\n  return val > -RADIAN_EPSILON && val < RADIAN_EPSILON;\n}\n// eslint-disable-next-line\nvar TIME_REG = /^(?:(\\d{4})(?:[-\\/](\\d{1,2})(?:[-\\/](\\d{1,2})(?:[T ](\\d{1,2})(?::(\\d{1,2})(?::(\\d{1,2})(?:[.,](\\d+))?)?)?(Z|[\\+\\-]\\d\\d:?\\d\\d)?)?)?)?)?$/; // jshint ignore:line\n/**\n * @param value valid type: number | string | Date, otherwise return `new Date(NaN)`\n *   These values can be accepted:\n *   + An instance of Date, represent a time in its own time zone.\n *   + Or string in a subset of ISO 8601, only including:\n *     + only year, month, date: '2012-03', '2012-03-01', '2012-03-01 05', '2012-03-01 05:06',\n *     + separated with T or space: '2012-03-01T12:22:33.123', '2012-03-01 12:22:33.123',\n *     + time zone: '2012-03-01T12:22:33Z', '2012-03-01T12:22:33+8000', '2012-03-01T12:22:33-05:00',\n *     all of which will be treated as local time if time zone is not specified\n *     (see <https://momentjs.com/>).\n *   + Or other string format, including (all of which will be treated as local time):\n *     '2012', '2012-3-1', '2012/3/1', '2012/03/01',\n *     '2009/6/12 2:00', '2009/6/12 2:05:08', '2009/6/12 2:05:08.123'\n *   + a timestamp, which represent a time in UTC.\n * @return date Never be null/undefined. If invalid, return `new Date(NaN)`.\n */\nexport function parseDate(value) {\n  if (value instanceof Date) {\n    return value;\n  } else if (zrUtil.isString(value)) {\n    // Different browsers parse date in different way, so we parse it manually.\n    // Some other issues:\n    // new Date('1970-01-01') is UTC,\n    // new Date('1970/01/01') and new Date('1970-1-01') is local.\n    // See issue #3623\n    var match = TIME_REG.exec(value);\n    if (!match) {\n      // return Invalid Date.\n      return new Date(NaN);\n    }\n    // Use local time when no timezone offset is specified.\n    if (!match[8]) {\n      // match[n] can only be string or undefined.\n      // But take care of '12' + 1 => '121'.\n      return new Date(+match[1], +(match[2] || 1) - 1, +match[3] || 1, +match[4] || 0, +(match[5] || 0), +match[6] || 0, match[7] ? +match[7].substring(0, 3) : 0);\n    }\n    // Timezoneoffset of Javascript Date has considered DST (Daylight Saving Time,\n    // https://tc39.github.io/ecma262/#sec-daylight-saving-time-adjustment).\n    // For example, system timezone is set as \"Time Zone: America/Toronto\",\n    // then these code will get different result:\n    // `new Date(1478411999999).getTimezoneOffset();  // get 240`\n    // `new Date(1478412000000).getTimezoneOffset();  // get 300`\n    // So we should not use `new Date`, but use `Date.UTC`.\n    else {\n      var hour = +match[4] || 0;\n      if (match[8].toUpperCase() !== 'Z') {\n        hour -= +match[8].slice(0, 3);\n      }\n      return new Date(Date.UTC(+match[1], +(match[2] || 1) - 1, +match[3] || 1, hour, +(match[5] || 0), +match[6] || 0, match[7] ? +match[7].substring(0, 3) : 0));\n    }\n  } else if (value == null) {\n    return new Date(NaN);\n  }\n  return new Date(Math.round(value));\n}\n/**\n * Quantity of a number. e.g. 0.1, 1, 10, 100\n *\n * @param val\n * @return\n */\nexport function quantity(val) {\n  return Math.pow(10, quantityExponent(val));\n}\n/**\n * Exponent of the quantity of a number\n * e.g., 1234 equals to 1.234*10^3, so quantityExponent(1234) is 3\n *\n * @param val non-negative value\n * @return\n */\nexport function quantityExponent(val) {\n  if (val === 0) {\n    return 0;\n  }\n  var exp = Math.floor(Math.log(val) / Math.LN10);\n  /**\n   * exp is expected to be the rounded-down result of the base-10 log of val.\n   * But due to the precision loss with Math.log(val), we need to restore it\n   * using 10^exp to make sure we can get val back from exp. #11249\n   */\n  if (val / Math.pow(10, exp) >= 10) {\n    exp++;\n  }\n  return exp;\n}\n/**\n * find a \u201Cnice\u201D number approximately equal to x. Round the number if round = true,\n * take ceiling if round = false. The primary observation is that the \u201Cnicest\u201D\n * numbers in decimal are 1, 2, and 5, and all power-of-ten multiples of these numbers.\n *\n * See \"Nice Numbers for Graph Labels\" of Graphic Gems.\n *\n * @param  val Non-negative value.\n * @param  round\n * @return Niced number\n */\nexport function nice(val, round) {\n  var exponent = quantityExponent(val);\n  var exp10 = Math.pow(10, exponent);\n  var f = val / exp10; // 1 <= f < 10\n  var nf;\n  if (round) {\n    if (f < 1.5) {\n      nf = 1;\n    } else if (f < 2.5) {\n      nf = 2;\n    } else if (f < 4) {\n      nf = 3;\n    } else if (f < 7) {\n      nf = 5;\n    } else {\n      nf = 10;\n    }\n  } else {\n    if (f < 1) {\n      nf = 1;\n    } else if (f < 2) {\n      nf = 2;\n    } else if (f < 3) {\n      nf = 3;\n    } else if (f < 5) {\n      nf = 5;\n    } else {\n      nf = 10;\n    }\n  }\n  val = nf * exp10;\n  // Fix 3 * 0.1 === 0.30000000000000004 issue (see IEEE 754).\n  // 20 is the uppper bound of toFixed.\n  return exponent >= -20 ? +val.toFixed(exponent < 0 ? -exponent : 0) : val;\n}\n/**\n * This code was copied from \"d3.js\"\n * <https://github.com/d3/d3/blob/9cc9a875e636a1dcf36cc1e07bdf77e1ad6e2c74/src/arrays/quantile.js>.\n * See the license statement at the head of this file.\n * @param ascArr\n */\nexport function quantile(ascArr, p) {\n  var H = (ascArr.length - 1) * p + 1;\n  var h = Math.floor(H);\n  var v = +ascArr[h - 1];\n  var e = H - h;\n  return e ? v + e * (ascArr[h] - v) : v;\n}\n/**\n * Order intervals asc, and split them when overlap.\n * expect(numberUtil.reformIntervals([\n *     {interval: [18, 62], close: [1, 1]},\n *     {interval: [-Infinity, -70], close: [0, 0]},\n *     {interval: [-70, -26], close: [1, 1]},\n *     {interval: [-26, 18], close: [1, 1]},\n *     {interval: [62, 150], close: [1, 1]},\n *     {interval: [106, 150], close: [1, 1]},\n *     {interval: [150, Infinity], close: [0, 0]}\n * ])).toEqual([\n *     {interval: [-Infinity, -70], close: [0, 0]},\n *     {interval: [-70, -26], close: [1, 1]},\n *     {interval: [-26, 18], close: [0, 1]},\n *     {interval: [18, 62], close: [0, 1]},\n *     {interval: [62, 150], close: [0, 1]},\n *     {interval: [150, Infinity], close: [0, 0]}\n * ]);\n * @param list, where `close` mean open or close\n *        of the interval, and Infinity can be used.\n * @return The origin list, which has been reformed.\n */\nexport function reformIntervals(list) {\n  list.sort(function (a, b) {\n    return littleThan(a, b, 0) ? -1 : 1;\n  });\n  var curr = -Infinity;\n  var currClose = 1;\n  for (var i = 0; i < list.length;) {\n    var interval = list[i].interval;\n    var close_1 = list[i].close;\n    for (var lg = 0; lg < 2; lg++) {\n      if (interval[lg] <= curr) {\n        interval[lg] = curr;\n        close_1[lg] = !lg ? 1 - currClose : 1;\n      }\n      curr = interval[lg];\n      currClose = close_1[lg];\n    }\n    if (interval[0] === interval[1] && close_1[0] * close_1[1] !== 1) {\n      list.splice(i, 1);\n    } else {\n      i++;\n    }\n  }\n  return list;\n  function littleThan(a, b, lg) {\n    return a.interval[lg] < b.interval[lg] || a.interval[lg] === b.interval[lg] && (a.close[lg] - b.close[lg] === (!lg ? 1 : -1) || !lg && littleThan(a, b, 1));\n  }\n}\n/**\n * [Numeric is defined as]:\n *     `parseFloat(val) == val`\n * For example:\n * numeric:\n *     typeof number except NaN, '-123', '123', '2e3', '-2e3', '011', 'Infinity', Infinity,\n *     and they rounded by white-spaces or line-terminal like ' -123 \\n ' (see es spec)\n * not-numeric:\n *     null, undefined, [], {}, true, false, 'NaN', NaN, '123ab',\n *     empty string, string with only white-spaces or line-terminal (see es spec),\n *     0x12, '0x12', '-0x12', 012, '012', '-012',\n *     non-string, ...\n *\n * @test See full test cases in `test/ut/spec/util/number.js`.\n * @return Must be a typeof number. If not numeric, return NaN.\n */\nexport function numericToNumber(val) {\n  var valFloat = parseFloat(val);\n  return valFloat == val // eslint-disable-line eqeqeq\n  && (valFloat !== 0 || !zrUtil.isString(val) || val.indexOf('x') <= 0) // For case ' 0x0 '.\n  ? valFloat : NaN;\n}\n/**\n * Definition of \"numeric\": see `numericToNumber`.\n */\nexport function isNumeric(val) {\n  return !isNaN(numericToNumber(val));\n}\n/**\n * Use random base to prevent users hard code depending on\n * this auto generated marker id.\n * @return An positive integer.\n */\nexport function getRandomIdBase() {\n  return Math.round(Math.random() * 9);\n}\n/**\n * Get the greatest common divisor.\n *\n * @param {number} a one number\n * @param {number} b the other number\n */\nexport function getGreatestCommonDividor(a, b) {\n  if (b === 0) {\n    return a;\n  }\n  return getGreatestCommonDividor(b, a % b);\n}\n/**\n * Get the least common multiple.\n *\n * @param {number} a one number\n * @param {number} b the other number\n */\nexport function getLeastCommonMultiple(a, b) {\n  if (a == null) {\n    return b;\n  }\n  if (b == null) {\n    return a;\n  }\n  return a * b / getGreatestCommonDividor(a, b);\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { map, isString, isFunction, eqNaN, isRegExp } from 'zrender/lib/core/util.js';\nvar ECHARTS_PREFIX = '[ECharts] ';\nvar storedLogs = {};\nvar hasConsole = typeof console !== 'undefined'\n// eslint-disable-next-line\n&& console.warn && console.log;\nfunction outputLog(type, str, onlyOnce) {\n  if (hasConsole) {\n    if (onlyOnce) {\n      if (storedLogs[str]) {\n        return;\n      }\n      storedLogs[str] = true;\n    }\n    // eslint-disable-next-line\n    console[type](ECHARTS_PREFIX + str);\n  }\n}\nexport function log(str, onlyOnce) {\n  outputLog('log', str, onlyOnce);\n}\nexport function warn(str, onlyOnce) {\n  outputLog('warn', str, onlyOnce);\n}\nexport function error(str, onlyOnce) {\n  outputLog('error', str, onlyOnce);\n}\nexport function deprecateLog(str) {\n  if (process.env.NODE_ENV !== 'production') {\n    // Not display duplicate message.\n    outputLog('warn', 'DEPRECATED: ' + str, true);\n  }\n}\nexport function deprecateReplaceLog(oldOpt, newOpt, scope) {\n  if (process.env.NODE_ENV !== 'production') {\n    deprecateLog((scope ? \"[\" + scope + \"]\" : '') + (oldOpt + \" is deprecated; use \" + newOpt + \" instead.\"));\n  }\n}\n/**\n * If in __DEV__ environment, get console printable message for users hint.\n * Parameters are separated by ' '.\n * @usage\n * makePrintable('This is an error on', someVar, someObj);\n *\n * @param hintInfo anything about the current execution context to hint users.\n * @throws Error\n */\nexport function makePrintable() {\n  var hintInfo = [];\n  for (var _i = 0; _i < arguments.length; _i++) {\n    hintInfo[_i] = arguments[_i];\n  }\n  var msg = '';\n  if (process.env.NODE_ENV !== 'production') {\n    // Fuzzy stringify for print.\n    // This code only exist in dev environment.\n    var makePrintableStringIfPossible_1 = function (val) {\n      return val === void 0 ? 'undefined' : val === Infinity ? 'Infinity' : val === -Infinity ? '-Infinity' : eqNaN(val) ? 'NaN' : val instanceof Date ? 'Date(' + val.toISOString() + ')' : isFunction(val) ? 'function () { ... }' : isRegExp(val) ? val + '' : null;\n    };\n    msg = map(hintInfo, function (arg) {\n      if (isString(arg)) {\n        // Print without quotation mark for some statement.\n        return arg;\n      } else {\n        var printableStr = makePrintableStringIfPossible_1(arg);\n        if (printableStr != null) {\n          return printableStr;\n        } else if (typeof JSON !== 'undefined' && JSON.stringify) {\n          try {\n            return JSON.stringify(arg, function (n, val) {\n              var printableStr = makePrintableStringIfPossible_1(val);\n              return printableStr == null ? val : printableStr;\n            });\n            // In most cases the info object is small, so do not line break.\n          } catch (err) {\n            return '?';\n          }\n        } else {\n          return '?';\n        }\n      }\n    }).join(' ');\n  }\n  return msg;\n}\n/**\n * @throws Error\n */\nexport function throwError(msg) {\n  throw new Error(msg);\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { each, isObject, isArray, createHashMap, map, assert, isString, indexOf, isStringSafe, isNumber } from 'zrender/lib/core/util.js';\nimport env from 'zrender/lib/core/env.js';\nimport { isNumeric, getRandomIdBase, getPrecision, round } from './number.js';\nimport { error, warn } from './log.js';\nfunction interpolateNumber(p0, p1, percent) {\n  return (p1 - p0) * percent + p0;\n}\n/**\n * Make the name displayable. But we should\n * make sure it is not duplicated with user\n * specified name, so use '\\0';\n */\nvar DUMMY_COMPONENT_NAME_PREFIX = 'series\\0';\nvar INTERNAL_COMPONENT_ID_PREFIX = '\\0_ec_\\0';\n/**\n * If value is not array, then translate it to array.\n * @param  {*} value\n * @return {Array} [value] or value\n */\nexport function normalizeToArray(value) {\n  return value instanceof Array ? value : value == null ? [] : [value];\n}\n/**\n * Sync default option between normal and emphasis like `position` and `show`\n * In case some one will write code like\n *     label: {\n *          show: false,\n *          position: 'outside',\n *          fontSize: 18\n *     },\n *     emphasis: {\n *          label: { show: true }\n *     }\n */\nexport function defaultEmphasis(opt, key, subOpts) {\n  // Caution: performance sensitive.\n  if (opt) {\n    opt[key] = opt[key] || {};\n    opt.emphasis = opt.emphasis || {};\n    opt.emphasis[key] = opt.emphasis[key] || {};\n    // Default emphasis option from normal\n    for (var i = 0, len = subOpts.length; i < len; i++) {\n      var subOptName = subOpts[i];\n      if (!opt.emphasis[key].hasOwnProperty(subOptName) && opt[key].hasOwnProperty(subOptName)) {\n        opt.emphasis[key][subOptName] = opt[key][subOptName];\n      }\n    }\n  }\n}\nexport var TEXT_STYLE_OPTIONS = ['fontStyle', 'fontWeight', 'fontSize', 'fontFamily', 'rich', 'tag', 'color', 'textBorderColor', 'textBorderWidth', 'width', 'height', 'lineHeight', 'align', 'verticalAlign', 'baseline', 'shadowColor', 'shadowBlur', 'shadowOffsetX', 'shadowOffsetY', 'textShadowColor', 'textShadowBlur', 'textShadowOffsetX', 'textShadowOffsetY', 'backgroundColor', 'borderColor', 'borderWidth', 'borderRadius', 'padding'];\n// modelUtil.LABEL_OPTIONS = modelUtil.TEXT_STYLE_OPTIONS.concat([\n//     'position', 'offset', 'rotate', 'origin', 'show', 'distance', 'formatter',\n//     'fontStyle', 'fontWeight', 'fontSize', 'fontFamily',\n//     // FIXME: deprecated, check and remove it.\n//     'textStyle'\n// ]);\n/**\n * The method does not ensure performance.\n * data could be [12, 2323, {value: 223}, [1221, 23], {value: [2, 23]}]\n * This helper method retrieves value from data.\n */\nexport function getDataItemValue(dataItem) {\n  return isObject(dataItem) && !isArray(dataItem) && !(dataItem instanceof Date) ? dataItem.value : dataItem;\n}\n/**\n * data could be [12, 2323, {value: 223}, [1221, 23], {value: [2, 23]}]\n * This helper method determine if dataItem has extra option besides value\n */\nexport function isDataItemOption(dataItem) {\n  return isObject(dataItem) && !(dataItem instanceof Array);\n  // // markLine data can be array\n  // && !(dataItem[0] && isObject(dataItem[0]) && !(dataItem[0] instanceof Array));\n}\n;\n/**\n * Mapping to existings for merge.\n *\n * Mode \"normalMege\":\n *     The mapping result (merge result) will keep the order of the existing\n *     component, rather than the order of new option. Because we should ensure\n *     some specified index reference (like xAxisIndex) keep work.\n *     And in most cases, \"merge option\" is used to update partial option but not\n *     be expected to change the order.\n *\n * Mode \"replaceMege\":\n *     (1) Only the id mapped components will be merged.\n *     (2) Other existing components (except internal components) will be removed.\n *     (3) Other new options will be used to create new component.\n *     (4) The index of the existing components will not be modified.\n *     That means their might be \"hole\" after the removal.\n *     The new components are created first at those available index.\n *\n * Mode \"replaceAll\":\n *     This mode try to support that reproduce an echarts instance from another\n *     echarts instance (via `getOption`) in some simple cases.\n *     In this scenario, the `result` index are exactly the consistent with the `newCmptOptions`,\n *     which ensures the component index referring (like `xAxisIndex: ?`) corrent. That is,\n *     the \"hole\" in `newCmptOptions` will also be kept.\n *     On the contrary, other modes try best to eliminate holes.\n *     PENDING: This is an experimental mode yet.\n *\n * @return See the comment of <MappingResult>.\n */\nexport function mappingToExists(existings, newCmptOptions, mode) {\n  var isNormalMergeMode = mode === 'normalMerge';\n  var isReplaceMergeMode = mode === 'replaceMerge';\n  var isReplaceAllMode = mode === 'replaceAll';\n  existings = existings || [];\n  newCmptOptions = (newCmptOptions || []).slice();\n  var existingIdIdxMap = createHashMap();\n  // Validate id and name on user input option.\n  each(newCmptOptions, function (cmptOption, index) {\n    if (!isObject(cmptOption)) {\n      newCmptOptions[index] = null;\n      return;\n    }\n    if (process.env.NODE_ENV !== 'production') {\n      // There is some legacy case that name is set as `false`.\n      // But should work normally rather than throw error.\n      if (cmptOption.id != null && !isValidIdOrName(cmptOption.id)) {\n        warnInvalidateIdOrName(cmptOption.id);\n      }\n      if (cmptOption.name != null && !isValidIdOrName(cmptOption.name)) {\n        warnInvalidateIdOrName(cmptOption.name);\n      }\n    }\n  });\n  var result = prepareResult(existings, existingIdIdxMap, mode);\n  if (isNormalMergeMode || isReplaceMergeMode) {\n    mappingById(result, existings, existingIdIdxMap, newCmptOptions);\n  }\n  if (isNormalMergeMode) {\n    mappingByName(result, newCmptOptions);\n  }\n  if (isNormalMergeMode || isReplaceMergeMode) {\n    mappingByIndex(result, newCmptOptions, isReplaceMergeMode);\n  } else if (isReplaceAllMode) {\n    mappingInReplaceAllMode(result, newCmptOptions);\n  }\n  makeIdAndName(result);\n  // The array `result` MUST NOT contain elided items, otherwise the\n  // forEach will omit those items and result in incorrect result.\n  return result;\n}\nfunction prepareResult(existings, existingIdIdxMap, mode) {\n  var result = [];\n  if (mode === 'replaceAll') {\n    return result;\n  }\n  // Do not use native `map` to in case that the array `existings`\n  // contains elided items, which will be omitted.\n  for (var index = 0; index < existings.length; index++) {\n    var existing = existings[index];\n    // Because of replaceMerge, `existing` may be null/undefined.\n    if (existing && existing.id != null) {\n      existingIdIdxMap.set(existing.id, index);\n    }\n    // For non-internal-componnets:\n    //     Mode \"normalMerge\": all existings kept.\n    //     Mode \"replaceMerge\": all existing removed unless mapped by id.\n    // For internal-components:\n    //     go with \"replaceMerge\" approach in both mode.\n    result.push({\n      existing: mode === 'replaceMerge' || isComponentIdInternal(existing) ? null : existing,\n      newOption: null,\n      keyInfo: null,\n      brandNew: null\n    });\n  }\n  return result;\n}\nfunction mappingById(result, existings, existingIdIdxMap, newCmptOptions) {\n  // Mapping by id if specified.\n  each(newCmptOptions, function (cmptOption, index) {\n    if (!cmptOption || cmptOption.id == null) {\n      return;\n    }\n    var optionId = makeComparableKey(cmptOption.id);\n    var existingIdx = existingIdIdxMap.get(optionId);\n    if (existingIdx != null) {\n      var resultItem = result[existingIdx];\n      assert(!resultItem.newOption, 'Duplicated option on id \"' + optionId + '\".');\n      resultItem.newOption = cmptOption;\n      // In both mode, if id matched, new option will be merged to\n      // the existings rather than creating new component model.\n      resultItem.existing = existings[existingIdx];\n      newCmptOptions[index] = null;\n    }\n  });\n}\nfunction mappingByName(result, newCmptOptions) {\n  // Mapping by name if specified.\n  each(newCmptOptions, function (cmptOption, index) {\n    if (!cmptOption || cmptOption.name == null) {\n      return;\n    }\n    for (var i = 0; i < result.length; i++) {\n      var existing = result[i].existing;\n      if (!result[i].newOption // Consider name: two map to one.\n      // Can not match when both ids existing but different.\n      && existing && (existing.id == null || cmptOption.id == null) && !isComponentIdInternal(cmptOption) && !isComponentIdInternal(existing) && keyExistAndEqual('name', existing, cmptOption)) {\n        result[i].newOption = cmptOption;\n        newCmptOptions[index] = null;\n        return;\n      }\n    }\n  });\n}\nfunction mappingByIndex(result, newCmptOptions, brandNew) {\n  each(newCmptOptions, function (cmptOption) {\n    if (!cmptOption) {\n      return;\n    }\n    // Find the first place that not mapped by id and not internal component (consider the \"hole\").\n    var resultItem;\n    var nextIdx = 0;\n    while (\n    // Be `!resultItem` only when `nextIdx >= result.length`.\n    (resultItem = result[nextIdx]\n    // (1) Existing models that already have id should be able to mapped to. Because\n    // after mapping performed, model will always be assigned with an id if user not given.\n    // After that all models have id.\n    // (2) If new option has id, it can only set to a hole or append to the last. It should\n    // not be merged to the existings with different id. Because id should not be overwritten.\n    // (3) Name can be overwritten, because axis use name as 'show label text'.\n    ) && (resultItem.newOption || isComponentIdInternal(resultItem.existing) ||\n    // In mode \"replaceMerge\", here no not-mapped-non-internal-existing.\n    resultItem.existing && cmptOption.id != null && !keyExistAndEqual('id', cmptOption, resultItem.existing))) {\n      nextIdx++;\n    }\n    if (resultItem) {\n      resultItem.newOption = cmptOption;\n      resultItem.brandNew = brandNew;\n    } else {\n      result.push({\n        newOption: cmptOption,\n        brandNew: brandNew,\n        existing: null,\n        keyInfo: null\n      });\n    }\n    nextIdx++;\n  });\n}\nfunction mappingInReplaceAllMode(result, newCmptOptions) {\n  each(newCmptOptions, function (cmptOption) {\n    // The feature \"reproduce\" requires \"hole\" will also reproduced\n    // in case that component index referring are broken.\n    result.push({\n      newOption: cmptOption,\n      brandNew: true,\n      existing: null,\n      keyInfo: null\n    });\n  });\n}\n/**\n * Make id and name for mapping result (result of mappingToExists)\n * into `keyInfo` field.\n */\nfunction makeIdAndName(mapResult) {\n  // We use this id to hash component models and view instances\n  // in echarts. id can be specified by user, or auto generated.\n  // The id generation rule ensures new view instance are able\n  // to mapped to old instance when setOption are called in\n  // no-merge mode. So we generate model id by name and plus\n  // type in view id.\n  // name can be duplicated among components, which is convenient\n  // to specify multi components (like series) by one name.\n  // Ensure that each id is distinct.\n  var idMap = createHashMap();\n  each(mapResult, function (item) {\n    var existing = item.existing;\n    existing && idMap.set(existing.id, item);\n  });\n  each(mapResult, function (item) {\n    var opt = item.newOption;\n    // Force ensure id not duplicated.\n    assert(!opt || opt.id == null || !idMap.get(opt.id) || idMap.get(opt.id) === item, 'id duplicates: ' + (opt && opt.id));\n    opt && opt.id != null && idMap.set(opt.id, item);\n    !item.keyInfo && (item.keyInfo = {});\n  });\n  // Make name and id.\n  each(mapResult, function (item, index) {\n    var existing = item.existing;\n    var opt = item.newOption;\n    var keyInfo = item.keyInfo;\n    if (!isObject(opt)) {\n      return;\n    }\n    // Name can be overwritten. Consider case: axis.name = '20km'.\n    // But id generated by name will not be changed, which affect\n    // only in that case: setOption with 'not merge mode' and view\n    // instance will be recreated, which can be accepted.\n    keyInfo.name = opt.name != null ? makeComparableKey(opt.name) : existing ? existing.name\n    // Avoid that different series has the same name,\n    // because name may be used like in color pallet.\n    : DUMMY_COMPONENT_NAME_PREFIX + index;\n    if (existing) {\n      keyInfo.id = makeComparableKey(existing.id);\n    } else if (opt.id != null) {\n      keyInfo.id = makeComparableKey(opt.id);\n    } else {\n      // Consider this situatoin:\n      //  optionA: [{name: 'a'}, {name: 'a'}, {..}]\n      //  optionB [{..}, {name: 'a'}, {name: 'a'}]\n      // Series with the same name between optionA and optionB\n      // should be mapped.\n      var idNum = 0;\n      do {\n        keyInfo.id = '\\0' + keyInfo.name + '\\0' + idNum++;\n      } while (idMap.get(keyInfo.id));\n    }\n    idMap.set(keyInfo.id, item);\n  });\n}\nfunction keyExistAndEqual(attr, obj1, obj2) {\n  var key1 = convertOptionIdName(obj1[attr], null);\n  var key2 = convertOptionIdName(obj2[attr], null);\n  // See `MappingExistingItem`. `id` and `name` trade string equals to number.\n  return key1 != null && key2 != null && key1 === key2;\n}\n/**\n * @return return null if not exist.\n */\nfunction makeComparableKey(val) {\n  if (process.env.NODE_ENV !== 'production') {\n    if (val == null) {\n      throw new Error();\n    }\n  }\n  return convertOptionIdName(val, '');\n}\nexport function convertOptionIdName(idOrName, defaultValue) {\n  if (idOrName == null) {\n    return defaultValue;\n  }\n  return isString(idOrName) ? idOrName : isNumber(idOrName) || isStringSafe(idOrName) ? idOrName + '' : defaultValue;\n}\nfunction warnInvalidateIdOrName(idOrName) {\n  if (process.env.NODE_ENV !== 'production') {\n    warn('`' + idOrName + '` is invalid id or name. Must be a string or number.');\n  }\n}\nfunction isValidIdOrName(idOrName) {\n  return isStringSafe(idOrName) || isNumeric(idOrName);\n}\nexport function isNameSpecified(componentModel) {\n  var name = componentModel.name;\n  // Is specified when `indexOf` get -1 or > 0.\n  return !!(name && name.indexOf(DUMMY_COMPONENT_NAME_PREFIX));\n}\n/**\n * @public\n * @param {Object} cmptOption\n * @return {boolean}\n */\nexport function isComponentIdInternal(cmptOption) {\n  return cmptOption && cmptOption.id != null && makeComparableKey(cmptOption.id).indexOf(INTERNAL_COMPONENT_ID_PREFIX) === 0;\n}\nexport function makeInternalComponentId(idSuffix) {\n  return INTERNAL_COMPONENT_ID_PREFIX + idSuffix;\n}\nexport function setComponentTypeToKeyInfo(mappingResult, mainType, componentModelCtor) {\n  // Set mainType and complete subType.\n  each(mappingResult, function (item) {\n    var newOption = item.newOption;\n    if (isObject(newOption)) {\n      item.keyInfo.mainType = mainType;\n      item.keyInfo.subType = determineSubType(mainType, newOption, item.existing, componentModelCtor);\n    }\n  });\n}\nfunction determineSubType(mainType, newCmptOption, existComponent, componentModelCtor) {\n  var subType = newCmptOption.type ? newCmptOption.type : existComponent ? existComponent.subType\n  // Use determineSubType only when there is no existComponent.\n  : componentModelCtor.determineSubType(mainType, newCmptOption);\n  // tooltip, markline, markpoint may always has no subType\n  return subType;\n}\n/**\n * A helper for removing duplicate items between batchA and batchB,\n * and in themselves, and categorize by series.\n *\n * @param batchA Like: [{seriesId: 2, dataIndex: [32, 4, 5]}, ...]\n * @param batchB Like: [{seriesId: 2, dataIndex: [32, 4, 5]}, ...]\n * @return result: [resultBatchA, resultBatchB]\n */\nexport function compressBatches(batchA, batchB) {\n  var mapA = {};\n  var mapB = {};\n  makeMap(batchA || [], mapA);\n  makeMap(batchB || [], mapB, mapA);\n  return [mapToArray(mapA), mapToArray(mapB)];\n  function makeMap(sourceBatch, map, otherMap) {\n    for (var i = 0, len = sourceBatch.length; i < len; i++) {\n      var seriesId = convertOptionIdName(sourceBatch[i].seriesId, null);\n      if (seriesId == null) {\n        return;\n      }\n      var dataIndices = normalizeToArray(sourceBatch[i].dataIndex);\n      var otherDataIndices = otherMap && otherMap[seriesId];\n      for (var j = 0, lenj = dataIndices.length; j < lenj; j++) {\n        var dataIndex = dataIndices[j];\n        if (otherDataIndices && otherDataIndices[dataIndex]) {\n          otherDataIndices[dataIndex] = null;\n        } else {\n          (map[seriesId] || (map[seriesId] = {}))[dataIndex] = 1;\n        }\n      }\n    }\n  }\n  function mapToArray(map, isData) {\n    var result = [];\n    for (var i in map) {\n      if (map.hasOwnProperty(i) && map[i] != null) {\n        if (isData) {\n          result.push(+i);\n        } else {\n          var dataIndices = mapToArray(map[i], true);\n          dataIndices.length && result.push({\n            seriesId: i,\n            dataIndex: dataIndices\n          });\n        }\n      }\n    }\n    return result;\n  }\n}\n/**\n * @param payload Contains dataIndex (means rawIndex) / dataIndexInside / name\n *                         each of which can be Array or primary type.\n * @return dataIndex If not found, return undefined/null.\n */\nexport function queryDataIndex(data, payload) {\n  if (payload.dataIndexInside != null) {\n    return payload.dataIndexInside;\n  } else if (payload.dataIndex != null) {\n    return isArray(payload.dataIndex) ? map(payload.dataIndex, function (value) {\n      return data.indexOfRawIndex(value);\n    }) : data.indexOfRawIndex(payload.dataIndex);\n  } else if (payload.name != null) {\n    return isArray(payload.name) ? map(payload.name, function (value) {\n      return data.indexOfName(value);\n    }) : data.indexOfName(payload.name);\n  }\n}\n/**\n * Enable property storage to any host object.\n * Notice: Serialization is not supported.\n *\n * For example:\n * let inner = zrUitl.makeInner();\n *\n * function some1(hostObj) {\n *      inner(hostObj).someProperty = 1212;\n *      ...\n * }\n * function some2() {\n *      let fields = inner(this);\n *      fields.someProperty1 = 1212;\n *      fields.someProperty2 = 'xx';\n *      ...\n * }\n *\n * @return {Function}\n */\nexport function makeInner() {\n  var key = '__ec_inner_' + innerUniqueIndex++;\n  return function (hostObj) {\n    return hostObj[key] || (hostObj[key] = {});\n  };\n}\nvar innerUniqueIndex = getRandomIdBase();\n/**\n * The same behavior as `component.getReferringComponents`.\n */\nexport function parseFinder(ecModel, finderInput, opt) {\n  var _a = preParseFinder(finderInput, opt),\n    mainTypeSpecified = _a.mainTypeSpecified,\n    queryOptionMap = _a.queryOptionMap,\n    others = _a.others;\n  var result = others;\n  var defaultMainType = opt ? opt.defaultMainType : null;\n  if (!mainTypeSpecified && defaultMainType) {\n    queryOptionMap.set(defaultMainType, {});\n  }\n  queryOptionMap.each(function (queryOption, mainType) {\n    var queryResult = queryReferringComponents(ecModel, mainType, queryOption, {\n      useDefault: defaultMainType === mainType,\n      enableAll: opt && opt.enableAll != null ? opt.enableAll : true,\n      enableNone: opt && opt.enableNone != null ? opt.enableNone : true\n    });\n    result[mainType + 'Models'] = queryResult.models;\n    result[mainType + 'Model'] = queryResult.models[0];\n  });\n  return result;\n}\nexport function preParseFinder(finderInput, opt) {\n  var finder;\n  if (isString(finderInput)) {\n    var obj = {};\n    obj[finderInput + 'Index'] = 0;\n    finder = obj;\n  } else {\n    finder = finderInput;\n  }\n  var queryOptionMap = createHashMap();\n  var others = {};\n  var mainTypeSpecified = false;\n  each(finder, function (value, key) {\n    // Exclude 'dataIndex' and other illegal keys.\n    if (key === 'dataIndex' || key === 'dataIndexInside') {\n      others[key] = value;\n      return;\n    }\n    var parsedKey = key.match(/^(\\w+)(Index|Id|Name)$/) || [];\n    var mainType = parsedKey[1];\n    var queryType = (parsedKey[2] || '').toLowerCase();\n    if (!mainType || !queryType || opt && opt.includeMainTypes && indexOf(opt.includeMainTypes, mainType) < 0) {\n      return;\n    }\n    mainTypeSpecified = mainTypeSpecified || !!mainType;\n    var queryOption = queryOptionMap.get(mainType) || queryOptionMap.set(mainType, {});\n    queryOption[queryType] = value;\n  });\n  return {\n    mainTypeSpecified: mainTypeSpecified,\n    queryOptionMap: queryOptionMap,\n    others: others\n  };\n}\nexport var SINGLE_REFERRING = {\n  useDefault: true,\n  enableAll: false,\n  enableNone: false\n};\nexport var MULTIPLE_REFERRING = {\n  useDefault: false,\n  enableAll: true,\n  enableNone: true\n};\nexport function queryReferringComponents(ecModel, mainType, userOption, opt) {\n  opt = opt || SINGLE_REFERRING;\n  var indexOption = userOption.index;\n  var idOption = userOption.id;\n  var nameOption = userOption.name;\n  var result = {\n    models: null,\n    specified: indexOption != null || idOption != null || nameOption != null\n  };\n  if (!result.specified) {\n    // Use the first as default if `useDefault`.\n    var firstCmpt = void 0;\n    result.models = opt.useDefault && (firstCmpt = ecModel.getComponent(mainType)) ? [firstCmpt] : [];\n    return result;\n  }\n  if (indexOption === 'none' || indexOption === false) {\n    if (opt.enableNone) {\n      result.models = [];\n      return result;\n    } else {\n      // Do not throw; consider if some component previously does not use this method,\n      // and start to use it, need to be fault-tolerant for backward compatibility.\n      if (process.env.NODE_ENV !== 'production') {\n        error('`\"none\"` or `false` is not a valid value on index option.');\n      }\n      indexOption = -1; // Can not query by index but may still query by id/name if specified.\n    }\n  }\n  // `queryComponents` will return all components if\n  // both all of index/id/name are null/undefined.\n  if (indexOption === 'all') {\n    if (opt.enableAll) {\n      indexOption = idOption = nameOption = null;\n    } else {\n      if (process.env.NODE_ENV !== 'production') {\n        error('`\"all\"` is not a valid value on index option.');\n      }\n      indexOption = -1;\n    }\n  }\n  result.models = ecModel.queryComponents({\n    mainType: mainType,\n    index: indexOption,\n    id: idOption,\n    name: nameOption\n  });\n  return result;\n}\nexport function setAttribute(dom, key, value) {\n  dom.setAttribute ? dom.setAttribute(key, value) : dom[key] = value;\n}\nexport function getAttribute(dom, key) {\n  return dom.getAttribute ? dom.getAttribute(key) : dom[key];\n}\nexport function getTooltipRenderMode(renderModeOption) {\n  if (renderModeOption === 'auto') {\n    // Using html when `document` exists, use richText otherwise\n    return env.domSupported ? 'html' : 'richText';\n  } else {\n    return renderModeOption || 'html';\n  }\n}\n/**\n * Group a list by key.\n */\nexport function groupData(array, getKey // return key\n) {\n  var buckets = createHashMap();\n  var keys = [];\n  each(array, function (item) {\n    var key = getKey(item);\n    (buckets.get(key) || (keys.push(key), buckets.set(key, []))).push(item);\n  });\n  return {\n    keys: keys,\n    buckets: buckets\n  };\n}\n/**\n * Interpolate raw values of a series with percent\n *\n * @param data         data\n * @param labelModel   label model of the text element\n * @param sourceValue  start value. May be null/undefined when init.\n * @param targetValue  end value\n * @param percent      0~1 percentage; 0 uses start value while 1 uses end value\n * @return             interpolated values\n *                     If `sourceValue` and `targetValue` are `number`, return `number`.\n *                     If `sourceValue` and `targetValue` are `string`, return `string`.\n *                     If `sourceValue` and `targetValue` are `(string | number)[]`, return `(string | number)[]`.\n *                     Other cases do not supported.\n */\nexport function interpolateRawValues(data, precision, sourceValue, targetValue, percent) {\n  var isAutoPrecision = precision == null || precision === 'auto';\n  if (targetValue == null) {\n    return targetValue;\n  }\n  if (isNumber(targetValue)) {\n    var value = interpolateNumber(sourceValue || 0, targetValue, percent);\n    return round(value, isAutoPrecision ? Math.max(getPrecision(sourceValue || 0), getPrecision(targetValue)) : precision);\n  } else if (isString(targetValue)) {\n    return percent < 1 ? sourceValue : targetValue;\n  } else {\n    var interpolated = [];\n    var leftArr = sourceValue;\n    var rightArr = targetValue;\n    var length_1 = Math.max(leftArr ? leftArr.length : 0, rightArr.length);\n    for (var i = 0; i < length_1; ++i) {\n      var info = data.getDimensionInfo(i);\n      // Don't interpolate ordinal dims\n      if (info && info.type === 'ordinal') {\n        // In init, there is no `sourceValue`, but should better not to get undefined result.\n        interpolated[i] = (percent < 1 && leftArr ? leftArr : rightArr)[i];\n      } else {\n        var leftVal = leftArr && leftArr[i] ? leftArr[i] : 0;\n        var rightVal = rightArr[i];\n        var value = interpolateNumber(leftVal, rightVal, percent);\n        interpolated[i] = round(value, isAutoPrecision ? Math.max(getPrecision(leftVal), getPrecision(rightVal)) : precision);\n      }\n    }\n    return interpolated;\n  }\n}\n/**\n * Use an iterator to avoid exposing the internal list or duplicating it\n * for the outside traveller, and no extra heap allocation.\n * @usage\n *  for (const it = resetIterator(); it.next();) {\n *      const item = it.item;\n *      const key = it.key;\n *      const itIdx = it.itIdx;\n *      // ...\n *  }\n * @usage\n *  const it = resetIterator();\n *  while (it.next()) { ... }\n * @usage\n *  for (resetIterator(it); it.next();) { ... }\n */\nvar ListIterator = /** @class */function () {\n  function ListIterator() {}\n  /**\n   * The loop condition is `idx < end` if `step > 0`;\n   * The loop condition is `idx >= end` if `step < 0`.\n   *\n   * @param end By default `list.length` if `step > 0`; `0` if `step < 0`.\n   * @param step By default `1`.\n   */\n  ListIterator.prototype.reset = function (list, start, end, step) {\n    this._list = list;\n    this._step = step = step || 1;\n    this._idx = start;\n    this._end = end != null ? end : step > 0 ? list.length : 0;\n    this.item = null;\n    this.key = NaN;\n    return this;\n  };\n  ListIterator.prototype.next = function () {\n    if (this._step > 0 ? this._idx < this._end : this._idx >= this._end) {\n      this.item = this._list[this._idx];\n      this.key = this._idx = this._idx + this._step;\n      return true;\n    }\n    return false;\n  };\n  return ListIterator;\n}();\nexport { ListIterator };\nexport function clearTmpModel(model) {\n  // Clear to avoid memory leak.\n  model.option = model.parentModel = model.ecModel = null;\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nvar TYPE_DELIMITER = '.';\nvar IS_CONTAINER = '___EC__COMPONENT__CONTAINER___';\nvar IS_EXTENDED_CLASS = '___EC__EXTENDED_CLASS___';\n/**\n * Notice, parseClassType('') should returns {main: '', sub: ''}\n * @public\n */\nexport function parseClassType(componentType) {\n  var ret = {\n    main: '',\n    sub: ''\n  };\n  if (componentType) {\n    var typeArr = componentType.split(TYPE_DELIMITER);\n    ret.main = typeArr[0] || '';\n    ret.sub = typeArr[1] || '';\n  }\n  return ret;\n}\n/**\n * @public\n */\nfunction checkClassType(componentType) {\n  zrUtil.assert(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(componentType), 'componentType \"' + componentType + '\" illegal');\n}\nexport function isExtendedClass(clz) {\n  return !!(clz && clz[IS_EXTENDED_CLASS]);\n}\n/**\n * Implements `ExtendableConstructor` for `rootClz`.\n *\n * @usage\n * ```ts\n * class Xxx {}\n * type XxxConstructor = typeof Xxx & ExtendableConstructor\n * enableClassExtend(Xxx as XxxConstructor);\n * ```\n */\nexport function enableClassExtend(rootClz, mandatoryMethods) {\n  rootClz.$constructor = rootClz; // FIXME: not necessary?\n  rootClz.extend = function (proto) {\n    if (process.env.NODE_ENV !== 'production') {\n      zrUtil.each(mandatoryMethods, function (method) {\n        if (!proto[method]) {\n          console.warn('Method `' + method + '` should be implemented' + (proto.type ? ' in ' + proto.type : '') + '.');\n        }\n      });\n    }\n    var superClass = this;\n    var ExtendedClass;\n    if (isESClass(superClass)) {\n      ExtendedClass = /** @class */function (_super) {\n        __extends(class_1, _super);\n        function class_1() {\n          return _super.apply(this, arguments) || this;\n        }\n        return class_1;\n      }(superClass);\n    } else {\n      // For backward compat, we both support ts class inheritance and this\n      // \"extend\" approach.\n      // The constructor should keep the same behavior as ts class inheritance:\n      // If this constructor/$constructor is not declared, auto invoke the super\n      // constructor.\n      // If this constructor/$constructor is declared, it is responsible for\n      // calling the super constructor.\n      ExtendedClass = function () {\n        (proto.$constructor || superClass).apply(this, arguments);\n      };\n      zrUtil.inherits(ExtendedClass, this);\n    }\n    zrUtil.extend(ExtendedClass.prototype, proto);\n    ExtendedClass[IS_EXTENDED_CLASS] = true;\n    ExtendedClass.extend = this.extend;\n    ExtendedClass.superCall = superCall;\n    ExtendedClass.superApply = superApply;\n    ExtendedClass.superClass = superClass;\n    return ExtendedClass;\n  };\n}\nfunction isESClass(fn) {\n  return zrUtil.isFunction(fn) && /^class\\s/.test(Function.prototype.toString.call(fn));\n}\n/**\n * A work around to both support ts extend and this extend mechanism.\n * on sub-class.\n * @usage\n * ```ts\n * class Component { ... }\n * classUtil.enableClassExtend(Component);\n * classUtil.enableClassManagement(Component, {registerWhenExtend: true});\n *\n * class Series extends Component { ... }\n * // Without calling `markExtend`, `registerWhenExtend` will not work.\n * Component.markExtend(Series);\n * ```\n */\nexport function mountExtend(SubClz, SupperClz) {\n  SubClz.extend = SupperClz.extend;\n}\n// A random offset.\nvar classBase = Math.round(Math.random() * 10);\n/**\n * Implements `CheckableConstructor` for `target`.\n * Can not use instanceof, consider different scope by\n * cross domain or es module import in ec extensions.\n * Mount a method \"isInstance()\" to Clz.\n *\n * @usage\n * ```ts\n * class Xxx {}\n * type XxxConstructor = typeof Xxx & CheckableConstructor;\n * enableClassCheck(Xxx as XxxConstructor)\n * ```\n */\nexport function enableClassCheck(target) {\n  var classAttr = ['__\\0is_clz', classBase++].join('_');\n  target.prototype[classAttr] = true;\n  if (process.env.NODE_ENV !== 'production') {\n    zrUtil.assert(!target.isInstance, 'The method \"is\" can not be defined.');\n  }\n  target.isInstance = function (obj) {\n    return !!(obj && obj[classAttr]);\n  };\n}\n// superCall should have class info, which can not be fetched from 'this'.\n// Consider this case:\n// class A has method f,\n// class B inherits class A, overrides method f, f call superApply('f'),\n// class C inherits class B, does not override method f,\n// then when method of class C is called, dead loop occurred.\nfunction superCall(context, methodName) {\n  var args = [];\n  for (var _i = 2; _i < arguments.length; _i++) {\n    args[_i - 2] = arguments[_i];\n  }\n  return this.superClass.prototype[methodName].apply(context, args);\n}\nfunction superApply(context, methodName, args) {\n  return this.superClass.prototype[methodName].apply(context, args);\n}\n/**\n * Implements `ClassManager` for `target`\n *\n * @usage\n * ```ts\n * class Xxx {}\n * type XxxConstructor = typeof Xxx & ClassManager\n * enableClassManagement(Xxx as XxxConstructor);\n * ```\n */\nexport function enableClassManagement(target) {\n  /**\n   * Component model classes\n   * key: componentType,\n   * value:\n   *     componentClass, when componentType is 'a'\n   *     or Object.<subKey, componentClass>, when componentType is 'a.b'\n   */\n  var storage = {};\n  target.registerClass = function (clz) {\n    // `type` should not be a \"instance member\".\n    // If using TS class, should better declared as `static type = 'series.pie'`.\n    // otherwise users have to mount `type` on prototype manually.\n    // For backward compat and enable instance visit type via `this.type`,\n    // we still support fetch `type` from prototype.\n    var componentFullType = clz.type || clz.prototype.type;\n    if (componentFullType) {\n      checkClassType(componentFullType);\n      // If only static type declared, we assign it to prototype mandatorily.\n      clz.prototype.type = componentFullType;\n      var componentTypeInfo = parseClassType(componentFullType);\n      if (!componentTypeInfo.sub) {\n        if (process.env.NODE_ENV !== 'production') {\n          if (storage[componentTypeInfo.main]) {\n            console.warn(componentTypeInfo.main + ' exists.');\n          }\n        }\n        storage[componentTypeInfo.main] = clz;\n      } else if (componentTypeInfo.sub !== IS_CONTAINER) {\n        var container = makeContainer(componentTypeInfo);\n        container[componentTypeInfo.sub] = clz;\n      }\n    }\n    return clz;\n  };\n  target.getClass = function (mainType, subType, throwWhenNotFound) {\n    var clz = storage[mainType];\n    if (clz && clz[IS_CONTAINER]) {\n      clz = subType ? clz[subType] : null;\n    }\n    if (throwWhenNotFound && !clz) {\n      throw new Error(!subType ? mainType + '.' + 'type should be specified.' : 'Component ' + mainType + '.' + (subType || '') + ' is used but not imported.');\n    }\n    return clz;\n  };\n  target.getClassesByMainType = function (componentType) {\n    var componentTypeInfo = parseClassType(componentType);\n    var result = [];\n    var obj = storage[componentTypeInfo.main];\n    if (obj && obj[IS_CONTAINER]) {\n      zrUtil.each(obj, function (o, type) {\n        type !== IS_CONTAINER && result.push(o);\n      });\n    } else {\n      result.push(obj);\n    }\n    return result;\n  };\n  target.hasClass = function (componentType) {\n    // Just consider componentType.main.\n    var componentTypeInfo = parseClassType(componentType);\n    return !!storage[componentTypeInfo.main];\n  };\n  /**\n   * @return Like ['aa', 'bb'], but can not be ['aa.xx']\n   */\n  target.getAllClassMainTypes = function () {\n    var types = [];\n    zrUtil.each(storage, function (obj, type) {\n      types.push(type);\n    });\n    return types;\n  };\n  /**\n   * If a main type is container and has sub types\n   */\n  target.hasSubTypes = function (componentType) {\n    var componentTypeInfo = parseClassType(componentType);\n    var obj = storage[componentTypeInfo.main];\n    return obj && obj[IS_CONTAINER];\n  };\n  function makeContainer(componentTypeInfo) {\n    var container = storage[componentTypeInfo.main];\n    if (!container || !container[IS_CONTAINER]) {\n      container = storage[componentTypeInfo.main] = {};\n      container[IS_CONTAINER] = true;\n    }\n    return container;\n  }\n}\n// /**\n//  * @param {string|Array.<string>} properties\n//  */\n// export function setReadOnly(obj, properties) {\n// FIXME It seems broken in IE8 simulation of IE11\n// if (!zrUtil.isArray(properties)) {\n//     properties = properties != null ? [properties] : [];\n// }\n// zrUtil.each(properties, function (prop) {\n//     let value = obj[prop];\n//     Object.defineProperty\n//         && Object.defineProperty(obj, prop, {\n//             value: value, writable: false\n//         });\n//     zrUtil.isArray(obj[prop])\n//         && Object.freeze\n//         && Object.freeze(obj[prop]);\n// });\n// }", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n// TODO Parse shadow style\n// TODO Only shallow path support\nimport * as zrUtil from 'zrender/lib/core/util.js';\nexport default function makeStyleMapper(properties, ignoreParent) {\n  // Normalize\n  for (var i = 0; i < properties.length; i++) {\n    if (!properties[i][1]) {\n      properties[i][1] = properties[i][0];\n    }\n  }\n  ignoreParent = ignoreParent || false;\n  return function (model, excludes, includes) {\n    var style = {};\n    for (var i = 0; i < properties.length; i++) {\n      var propName = properties[i][1];\n      if (excludes && zrUtil.indexOf(excludes, propName) >= 0 || includes && zrUtil.indexOf(includes, propName) < 0) {\n        continue;\n      }\n      var val = model.getShallow(propName, ignoreParent);\n      if (val != null) {\n        style[properties[i][0]] = val;\n      }\n    }\n    // TODO Text or image?\n    return style;\n  };\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport makeStyleMapper from './makeStyleMapper.js';\nexport var AREA_STYLE_KEY_MAP = [['fill', 'color'], ['shadowBlur'], ['shadowOffsetX'], ['shadowOffsetY'], ['opacity'], ['shadowColor']\n// Option decal is in `DecalObject` but style.decal is in `PatternObject`.\n// So do not transfer decal directly.\n];\nvar getAreaStyle = makeStyleMapper(AREA_STYLE_KEY_MAP);\nvar AreaStyleMixin = /** @class */function () {\n  function AreaStyleMixin() {}\n  AreaStyleMixin.prototype.getAreaStyle = function (excludes, includes) {\n    return getAreaStyle(this, excludes, includes);\n  };\n  return AreaStyleMixin;\n}();\n;\nexport { AreaStyleMixin };", "import LRU from '../../core/LRU.js';\nimport { platformApi } from '../../core/platform.js';\nvar globalImageCache = new LRU(50);\nexport function findExistImage(newImageOrSrc) {\n    if (typeof newImageOrSrc === 'string') {\n        var cachedImgObj = globalImageCache.get(newImageOrSrc);\n        return cachedImgObj && cachedImgObj.image;\n    }\n    else {\n        return newImageOrSrc;\n    }\n}\nexport function createOrUpdateImage(newImageOrSrc, image, hostEl, onload, cbPayload) {\n    if (!newImageOrSrc) {\n        return image;\n    }\n    else if (typeof newImageOrSrc === 'string') {\n        if ((image && image.__zrImageSrc === newImageOrSrc) || !hostEl) {\n            return image;\n        }\n        var cachedImgObj = globalImageCache.get(newImageOrSrc);\n        var pendingWrap = { hostEl: hostEl, cb: onload, cbPayload: cbPayload };\n        if (cachedImgObj) {\n            image = cachedImgObj.image;\n            !isImageReady(image) && cachedImgObj.pending.push(pendingWrap);\n        }\n        else {\n            image = platformApi.loadImage(newImageOrSrc, imageOnLoad, imageOnLoad);\n            image.__zrImageSrc = newImageOrSrc;\n            globalImageCache.put(newImageOrSrc, image.__cachedImgObj = {\n                image: image,\n                pending: [pendingWrap]\n            });\n        }\n        return image;\n    }\n    else {\n        return newImageOrSrc;\n    }\n}\nfunction imageOnLoad() {\n    var cachedImgObj = this.__cachedImgObj;\n    this.onload = this.onerror = this.__cachedImgObj = null;\n    for (var i = 0; i < cachedImgObj.pending.length; i++) {\n        var pendingWrap = cachedImgObj.pending[i];\n        var cb = pendingWrap.cb;\n        cb && cb(this, pendingWrap.cbPayload);\n        pendingWrap.hostEl.dirty();\n    }\n    cachedImgObj.pending.length = 0;\n}\nexport function isImageReady(image) {\n    return image && image.width && image.height;\n}\n", "import * as imageHelper from '../helper/image.js';\nimport { extend, retrieve2, retrieve3, reduce, } from '../../core/util.js';\nimport { adjustTextX, adjustTextY, ensureFontMeasureInfo, getLineHeight, measureCharWidth, measureWidth, parsePercent, } from '../../contain/text.js';\nimport BoundingRect from '../../core/BoundingRect.js';\nvar STYLE_REG = /\\{([a-zA-Z0-9_]+)\\|([^}]*)\\}/g;\nexport function truncateText(text, containerWidth, font, ellipsis, options) {\n    var out = {};\n    truncateText2(out, text, containerWidth, font, ellipsis, options);\n    return out.text;\n}\nfunction truncateText2(out, text, containerWidth, font, ellipsis, options) {\n    if (!containerWidth) {\n        out.text = '';\n        out.isTruncated = false;\n        return;\n    }\n    var textLines = (text + '').split('\\n');\n    options = prepareTruncateOptions(containerWidth, font, ellipsis, options);\n    var isTruncated = false;\n    var truncateOut = {};\n    for (var i = 0, len = textLines.length; i < len; i++) {\n        truncateSingleLine(truncateOut, textLines[i], options);\n        textLines[i] = truncateOut.textLine;\n        isTruncated = isTruncated || truncateOut.isTruncated;\n    }\n    out.text = textLines.join('\\n');\n    out.isTruncated = isTruncated;\n}\nfunction prepareTruncateOptions(containerWidth, font, ellipsis, options) {\n    options = options || {};\n    var preparedOpts = extend({}, options);\n    ellipsis = retrieve2(ellipsis, '...');\n    preparedOpts.maxIterations = retrieve2(options.maxIterations, 2);\n    var minChar = preparedOpts.minChar = retrieve2(options.minChar, 0);\n    var fontMeasureInfo = preparedOpts.fontMeasureInfo = ensureFontMeasureInfo(font);\n    var ascCharWidth = fontMeasureInfo.asciiCharWidth;\n    preparedOpts.placeholder = retrieve2(options.placeholder, '');\n    var contentWidth = containerWidth = Math.max(0, containerWidth - 1);\n    for (var i = 0; i < minChar && contentWidth >= ascCharWidth; i++) {\n        contentWidth -= ascCharWidth;\n    }\n    var ellipsisWidth = measureWidth(fontMeasureInfo, ellipsis);\n    if (ellipsisWidth > contentWidth) {\n        ellipsis = '';\n        ellipsisWidth = 0;\n    }\n    contentWidth = containerWidth - ellipsisWidth;\n    preparedOpts.ellipsis = ellipsis;\n    preparedOpts.ellipsisWidth = ellipsisWidth;\n    preparedOpts.contentWidth = contentWidth;\n    preparedOpts.containerWidth = containerWidth;\n    return preparedOpts;\n}\nfunction truncateSingleLine(out, textLine, options) {\n    var containerWidth = options.containerWidth;\n    var contentWidth = options.contentWidth;\n    var fontMeasureInfo = options.fontMeasureInfo;\n    if (!containerWidth) {\n        out.textLine = '';\n        out.isTruncated = false;\n        return;\n    }\n    var lineWidth = measureWidth(fontMeasureInfo, textLine);\n    if (lineWidth <= containerWidth) {\n        out.textLine = textLine;\n        out.isTruncated = false;\n        return;\n    }\n    for (var j = 0;; j++) {\n        if (lineWidth <= contentWidth || j >= options.maxIterations) {\n            textLine += options.ellipsis;\n            break;\n        }\n        var subLength = j === 0\n            ? estimateLength(textLine, contentWidth, fontMeasureInfo)\n            : lineWidth > 0\n                ? Math.floor(textLine.length * contentWidth / lineWidth)\n                : 0;\n        textLine = textLine.substr(0, subLength);\n        lineWidth = measureWidth(fontMeasureInfo, textLine);\n    }\n    if (textLine === '') {\n        textLine = options.placeholder;\n    }\n    out.textLine = textLine;\n    out.isTruncated = true;\n}\nfunction estimateLength(text, contentWidth, fontMeasureInfo) {\n    var width = 0;\n    var i = 0;\n    for (var len = text.length; i < len && width < contentWidth; i++) {\n        width += measureCharWidth(fontMeasureInfo, text.charCodeAt(i));\n    }\n    return i;\n}\nexport function parsePlainText(rawText, style, defaultOuterWidth, defaultOuterHeight) {\n    var text = formatText(rawText);\n    var overflow = style.overflow;\n    var padding = style.padding;\n    var paddingH = padding ? padding[1] + padding[3] : 0;\n    var paddingV = padding ? padding[0] + padding[2] : 0;\n    var font = style.font;\n    var truncate = overflow === 'truncate';\n    var calculatedLineHeight = getLineHeight(font);\n    var lineHeight = retrieve2(style.lineHeight, calculatedLineHeight);\n    var truncateLineOverflow = style.lineOverflow === 'truncate';\n    var isTruncated = false;\n    var width = style.width;\n    if (width == null && defaultOuterWidth != null) {\n        width = defaultOuterWidth - paddingH;\n    }\n    var height = style.height;\n    if (height == null && defaultOuterHeight != null) {\n        height = defaultOuterHeight - paddingV;\n    }\n    var lines;\n    if (width != null && (overflow === 'break' || overflow === 'breakAll')) {\n        lines = text ? wrapText(text, style.font, width, overflow === 'breakAll', 0).lines : [];\n    }\n    else {\n        lines = text ? text.split('\\n') : [];\n    }\n    var contentHeight = lines.length * lineHeight;\n    if (height == null) {\n        height = contentHeight;\n    }\n    if (contentHeight > height && truncateLineOverflow) {\n        var lineCount = Math.floor(height / lineHeight);\n        isTruncated = isTruncated || (lines.length > lineCount);\n        lines = lines.slice(0, lineCount);\n        contentHeight = lines.length * lineHeight;\n    }\n    if (text && truncate && width != null) {\n        var options = prepareTruncateOptions(width, font, style.ellipsis, {\n            minChar: style.truncateMinChar,\n            placeholder: style.placeholder\n        });\n        var singleOut = {};\n        for (var i = 0; i < lines.length; i++) {\n            truncateSingleLine(singleOut, lines[i], options);\n            lines[i] = singleOut.textLine;\n            isTruncated = isTruncated || singleOut.isTruncated;\n        }\n    }\n    var outerHeight = height;\n    var contentWidth = 0;\n    var fontMeasureInfo = ensureFontMeasureInfo(font);\n    for (var i = 0; i < lines.length; i++) {\n        contentWidth = Math.max(measureWidth(fontMeasureInfo, lines[i]), contentWidth);\n    }\n    if (width == null) {\n        width = contentWidth;\n    }\n    var outerWidth = width;\n    outerHeight += paddingV;\n    outerWidth += paddingH;\n    return {\n        lines: lines,\n        height: height,\n        outerWidth: outerWidth,\n        outerHeight: outerHeight,\n        lineHeight: lineHeight,\n        calculatedLineHeight: calculatedLineHeight,\n        contentWidth: contentWidth,\n        contentHeight: contentHeight,\n        width: width,\n        isTruncated: isTruncated\n    };\n}\nvar RichTextToken = (function () {\n    function RichTextToken() {\n    }\n    return RichTextToken;\n}());\nvar RichTextLine = (function () {\n    function RichTextLine(tokens) {\n        this.tokens = [];\n        if (tokens) {\n            this.tokens = tokens;\n        }\n    }\n    return RichTextLine;\n}());\nvar RichTextContentBlock = (function () {\n    function RichTextContentBlock() {\n        this.width = 0;\n        this.height = 0;\n        this.contentWidth = 0;\n        this.contentHeight = 0;\n        this.outerWidth = 0;\n        this.outerHeight = 0;\n        this.lines = [];\n        this.isTruncated = false;\n    }\n    return RichTextContentBlock;\n}());\nexport { RichTextContentBlock };\nexport function parseRichText(rawText, style, defaultOuterWidth, defaultOuterHeight, topTextAlign) {\n    var contentBlock = new RichTextContentBlock();\n    var text = formatText(rawText);\n    if (!text) {\n        return contentBlock;\n    }\n    var stlPadding = style.padding;\n    var stlPaddingH = stlPadding ? stlPadding[1] + stlPadding[3] : 0;\n    var stlPaddingV = stlPadding ? stlPadding[0] + stlPadding[2] : 0;\n    var topWidth = style.width;\n    if (topWidth == null && defaultOuterWidth != null) {\n        topWidth = defaultOuterWidth - stlPaddingH;\n    }\n    var topHeight = style.height;\n    if (topHeight == null && defaultOuterHeight != null) {\n        topHeight = defaultOuterHeight - stlPaddingV;\n    }\n    var overflow = style.overflow;\n    var wrapInfo = (overflow === 'break' || overflow === 'breakAll') && topWidth != null\n        ? { width: topWidth, accumWidth: 0, breakAll: overflow === 'breakAll' }\n        : null;\n    var lastIndex = STYLE_REG.lastIndex = 0;\n    var result;\n    while ((result = STYLE_REG.exec(text)) != null) {\n        var matchedIndex = result.index;\n        if (matchedIndex > lastIndex) {\n            pushTokens(contentBlock, text.substring(lastIndex, matchedIndex), style, wrapInfo);\n        }\n        pushTokens(contentBlock, result[2], style, wrapInfo, result[1]);\n        lastIndex = STYLE_REG.lastIndex;\n    }\n    if (lastIndex < text.length) {\n        pushTokens(contentBlock, text.substring(lastIndex, text.length), style, wrapInfo);\n    }\n    var pendingList = [];\n    var calculatedHeight = 0;\n    var calculatedWidth = 0;\n    var truncate = overflow === 'truncate';\n    var truncateLine = style.lineOverflow === 'truncate';\n    var tmpTruncateOut = {};\n    function finishLine(line, lineWidth, lineHeight) {\n        line.width = lineWidth;\n        line.lineHeight = lineHeight;\n        calculatedHeight += lineHeight;\n        calculatedWidth = Math.max(calculatedWidth, lineWidth);\n    }\n    outer: for (var i = 0; i < contentBlock.lines.length; i++) {\n        var line = contentBlock.lines[i];\n        var lineHeight = 0;\n        var lineWidth = 0;\n        for (var j = 0; j < line.tokens.length; j++) {\n            var token = line.tokens[j];\n            var tokenStyle = token.styleName && style.rich[token.styleName] || {};\n            var textPadding = token.textPadding = tokenStyle.padding;\n            var paddingH = textPadding ? textPadding[1] + textPadding[3] : 0;\n            var font = token.font = tokenStyle.font || style.font;\n            token.contentHeight = getLineHeight(font);\n            var tokenHeight = retrieve2(tokenStyle.height, token.contentHeight);\n            token.innerHeight = tokenHeight;\n            textPadding && (tokenHeight += textPadding[0] + textPadding[2]);\n            token.height = tokenHeight;\n            token.lineHeight = retrieve3(tokenStyle.lineHeight, style.lineHeight, tokenHeight);\n            token.align = tokenStyle && tokenStyle.align || topTextAlign;\n            token.verticalAlign = tokenStyle && tokenStyle.verticalAlign || 'middle';\n            if (truncateLine && topHeight != null && calculatedHeight + token.lineHeight > topHeight) {\n                var originalLength = contentBlock.lines.length;\n                if (j > 0) {\n                    line.tokens = line.tokens.slice(0, j);\n                    finishLine(line, lineWidth, lineHeight);\n                    contentBlock.lines = contentBlock.lines.slice(0, i + 1);\n                }\n                else {\n                    contentBlock.lines = contentBlock.lines.slice(0, i);\n                }\n                contentBlock.isTruncated = contentBlock.isTruncated || (contentBlock.lines.length < originalLength);\n                break outer;\n            }\n            var styleTokenWidth = tokenStyle.width;\n            var tokenWidthNotSpecified = styleTokenWidth == null || styleTokenWidth === 'auto';\n            if (typeof styleTokenWidth === 'string' && styleTokenWidth.charAt(styleTokenWidth.length - 1) === '%') {\n                token.percentWidth = styleTokenWidth;\n                pendingList.push(token);\n                token.contentWidth = measureWidth(ensureFontMeasureInfo(font), token.text);\n            }\n            else {\n                if (tokenWidthNotSpecified) {\n                    var textBackgroundColor = tokenStyle.backgroundColor;\n                    var bgImg = textBackgroundColor && textBackgroundColor.image;\n                    if (bgImg) {\n                        bgImg = imageHelper.findExistImage(bgImg);\n                        if (imageHelper.isImageReady(bgImg)) {\n                            token.width = Math.max(token.width, bgImg.width * tokenHeight / bgImg.height);\n                        }\n                    }\n                }\n                var remainTruncWidth = truncate && topWidth != null\n                    ? topWidth - lineWidth : null;\n                if (remainTruncWidth != null && remainTruncWidth < token.width) {\n                    if (!tokenWidthNotSpecified || remainTruncWidth < paddingH) {\n                        token.text = '';\n                        token.width = token.contentWidth = 0;\n                    }\n                    else {\n                        truncateText2(tmpTruncateOut, token.text, remainTruncWidth - paddingH, font, style.ellipsis, { minChar: style.truncateMinChar });\n                        token.text = tmpTruncateOut.text;\n                        contentBlock.isTruncated = contentBlock.isTruncated || tmpTruncateOut.isTruncated;\n                        token.width = token.contentWidth = measureWidth(ensureFontMeasureInfo(font), token.text);\n                    }\n                }\n                else {\n                    token.contentWidth = measureWidth(ensureFontMeasureInfo(font), token.text);\n                }\n            }\n            token.width += paddingH;\n            lineWidth += token.width;\n            tokenStyle && (lineHeight = Math.max(lineHeight, token.lineHeight));\n        }\n        finishLine(line, lineWidth, lineHeight);\n    }\n    contentBlock.outerWidth = contentBlock.width = retrieve2(topWidth, calculatedWidth);\n    contentBlock.outerHeight = contentBlock.height = retrieve2(topHeight, calculatedHeight);\n    contentBlock.contentHeight = calculatedHeight;\n    contentBlock.contentWidth = calculatedWidth;\n    contentBlock.outerWidth += stlPaddingH;\n    contentBlock.outerHeight += stlPaddingV;\n    for (var i = 0; i < pendingList.length; i++) {\n        var token = pendingList[i];\n        var percentWidth = token.percentWidth;\n        token.width = parseInt(percentWidth, 10) / 100 * contentBlock.width;\n    }\n    return contentBlock;\n}\nfunction pushTokens(block, str, style, wrapInfo, styleName) {\n    var isEmptyStr = str === '';\n    var tokenStyle = styleName && style.rich[styleName] || {};\n    var lines = block.lines;\n    var font = tokenStyle.font || style.font;\n    var newLine = false;\n    var strLines;\n    var linesWidths;\n    if (wrapInfo) {\n        var tokenPadding = tokenStyle.padding;\n        var tokenPaddingH = tokenPadding ? tokenPadding[1] + tokenPadding[3] : 0;\n        if (tokenStyle.width != null && tokenStyle.width !== 'auto') {\n            var outerWidth_1 = parsePercent(tokenStyle.width, wrapInfo.width) + tokenPaddingH;\n            if (lines.length > 0) {\n                if (outerWidth_1 + wrapInfo.accumWidth > wrapInfo.width) {\n                    strLines = str.split('\\n');\n                    newLine = true;\n                }\n            }\n            wrapInfo.accumWidth = outerWidth_1;\n        }\n        else {\n            var res = wrapText(str, font, wrapInfo.width, wrapInfo.breakAll, wrapInfo.accumWidth);\n            wrapInfo.accumWidth = res.accumWidth + tokenPaddingH;\n            linesWidths = res.linesWidths;\n            strLines = res.lines;\n        }\n    }\n    if (!strLines) {\n        strLines = str.split('\\n');\n    }\n    var fontMeasureInfo = ensureFontMeasureInfo(font);\n    for (var i = 0; i < strLines.length; i++) {\n        var text = strLines[i];\n        var token = new RichTextToken();\n        token.styleName = styleName;\n        token.text = text;\n        token.isLineHolder = !text && !isEmptyStr;\n        if (typeof tokenStyle.width === 'number') {\n            token.width = tokenStyle.width;\n        }\n        else {\n            token.width = linesWidths\n                ? linesWidths[i]\n                : measureWidth(fontMeasureInfo, text);\n        }\n        if (!i && !newLine) {\n            var tokens = (lines[lines.length - 1] || (lines[0] = new RichTextLine())).tokens;\n            var tokensLen = tokens.length;\n            (tokensLen === 1 && tokens[0].isLineHolder)\n                ? (tokens[0] = token)\n                : ((text || !tokensLen || isEmptyStr) && tokens.push(token));\n        }\n        else {\n            lines.push(new RichTextLine([token]));\n        }\n    }\n}\nfunction isAlphabeticLetter(ch) {\n    var code = ch.charCodeAt(0);\n    return code >= 0x20 && code <= 0x24F\n        || code >= 0x370 && code <= 0x10FF\n        || code >= 0x1200 && code <= 0x13FF\n        || code >= 0x1E00 && code <= 0x206F;\n}\nvar breakCharMap = reduce(',&?/;] '.split(''), function (obj, ch) {\n    obj[ch] = true;\n    return obj;\n}, {});\nfunction isWordBreakChar(ch) {\n    if (isAlphabeticLetter(ch)) {\n        if (breakCharMap[ch]) {\n            return true;\n        }\n        return false;\n    }\n    return true;\n}\nfunction wrapText(text, font, lineWidth, isBreakAll, lastAccumWidth) {\n    var lines = [];\n    var linesWidths = [];\n    var line = '';\n    var currentWord = '';\n    var currentWordWidth = 0;\n    var accumWidth = 0;\n    var fontMeasureInfo = ensureFontMeasureInfo(font);\n    for (var i = 0; i < text.length; i++) {\n        var ch = text.charAt(i);\n        if (ch === '\\n') {\n            if (currentWord) {\n                line += currentWord;\n                accumWidth += currentWordWidth;\n            }\n            lines.push(line);\n            linesWidths.push(accumWidth);\n            line = '';\n            currentWord = '';\n            currentWordWidth = 0;\n            accumWidth = 0;\n            continue;\n        }\n        var chWidth = measureCharWidth(fontMeasureInfo, ch.charCodeAt(0));\n        var inWord = isBreakAll ? false : !isWordBreakChar(ch);\n        if (!lines.length\n            ? lastAccumWidth + accumWidth + chWidth > lineWidth\n            : accumWidth + chWidth > lineWidth) {\n            if (!accumWidth) {\n                if (inWord) {\n                    lines.push(currentWord);\n                    linesWidths.push(currentWordWidth);\n                    currentWord = ch;\n                    currentWordWidth = chWidth;\n                }\n                else {\n                    lines.push(ch);\n                    linesWidths.push(chWidth);\n                }\n            }\n            else if (line || currentWord) {\n                if (inWord) {\n                    if (!line) {\n                        line = currentWord;\n                        currentWord = '';\n                        currentWordWidth = 0;\n                        accumWidth = currentWordWidth;\n                    }\n                    lines.push(line);\n                    linesWidths.push(accumWidth - currentWordWidth);\n                    currentWord += ch;\n                    currentWordWidth += chWidth;\n                    line = '';\n                    accumWidth = currentWordWidth;\n                }\n                else {\n                    if (currentWord) {\n                        line += currentWord;\n                        currentWord = '';\n                        currentWordWidth = 0;\n                    }\n                    lines.push(line);\n                    linesWidths.push(accumWidth);\n                    line = ch;\n                    accumWidth = chWidth;\n                }\n            }\n            continue;\n        }\n        accumWidth += chWidth;\n        if (inWord) {\n            currentWord += ch;\n            currentWordWidth += chWidth;\n        }\n        else {\n            if (currentWord) {\n                line += currentWord;\n                currentWord = '';\n                currentWordWidth = 0;\n            }\n            line += ch;\n        }\n    }\n    if (currentWord) {\n        line += currentWord;\n    }\n    if (line) {\n        lines.push(line);\n        linesWidths.push(accumWidth);\n    }\n    if (lines.length === 1) {\n        accumWidth += lastAccumWidth;\n    }\n    return {\n        accumWidth: accumWidth,\n        lines: lines,\n        linesWidths: linesWidths\n    };\n}\nexport function calcInnerTextOverflowArea(out, overflowRect, baseX, baseY, textAlign, textVerticalAlign) {\n    out.baseX = baseX;\n    out.baseY = baseY;\n    out.outerWidth = out.outerHeight = null;\n    if (!overflowRect) {\n        return;\n    }\n    var textWidth = overflowRect.width * 2;\n    var textHeight = overflowRect.height * 2;\n    BoundingRect.set(tmpCITCTextRect, adjustTextX(baseX, textWidth, textAlign), adjustTextY(baseY, textHeight, textVerticalAlign), textWidth, textHeight);\n    BoundingRect.intersect(overflowRect, tmpCITCTextRect, null, tmpCITCIntersectRectOpt);\n    var outIntersectRect = tmpCITCIntersectRectOpt.outIntersectRect;\n    out.outerWidth = outIntersectRect.width;\n    out.outerHeight = outIntersectRect.height;\n    out.baseX = adjustTextX(outIntersectRect.x, outIntersectRect.width, textAlign, true);\n    out.baseY = adjustTextY(outIntersectRect.y, outIntersectRect.height, textVerticalAlign, true);\n}\nvar tmpCITCTextRect = new BoundingRect(0, 0, 0, 0);\nvar tmpCITCIntersectRectOpt = { outIntersectRect: {}, clamp: true };\nfunction formatText(text) {\n    return text != null ? (text += '') : (text = '');\n}\nexport function tSpanCreateBoundingRect(style) {\n    var text = formatText(style.text);\n    var font = style.font;\n    var contentWidth = measureWidth(ensureFontMeasureInfo(font), text);\n    var contentHeight = getLineHeight(font);\n    return tSpanCreateBoundingRect2(style, contentWidth, contentHeight, null);\n}\nexport function tSpanCreateBoundingRect2(style, contentWidth, contentHeight, forceLineWidth) {\n    var rect = new BoundingRect(adjustTextX(style.x || 0, contentWidth, style.textAlign), adjustTextY(style.y || 0, contentHeight, style.textBaseline), contentWidth, contentHeight);\n    var lineWidth = forceLineWidth != null\n        ? forceLineWidth\n        : (tSpanHasStroke(style) ? style.lineWidth : 0);\n    if (lineWidth > 0) {\n        rect.x -= lineWidth / 2;\n        rect.y -= lineWidth / 2;\n        rect.width += lineWidth;\n        rect.height += lineWidth;\n    }\n    return rect;\n}\nexport function tSpanHasStroke(style) {\n    var stroke = style.stroke;\n    return stroke != null && stroke !== 'none' && style.lineWidth > 0;\n}\n", "import { __extends } from \"tslib\";\nimport Element from '../Element.js';\nimport BoundingRect from '../core/BoundingRect.js';\nimport { keys, extend, createObject } from '../core/util.js';\nimport { REDRAW_BIT, STYLE_CHANGED_BIT } from './constants.js';\nvar STYLE_MAGIC_KEY = '__zr_style_' + Math.round((Math.random() * 10));\nexport var DEFAULT_COMMON_STYLE = {\n    shadowBlur: 0,\n    shadowOffsetX: 0,\n    shadowOffsetY: 0,\n    shadowColor: '#000',\n    opacity: 1,\n    blend: 'source-over'\n};\nexport var DEFAULT_COMMON_ANIMATION_PROPS = {\n    style: {\n        shadowBlur: true,\n        shadowOffsetX: true,\n        shadowOffsetY: true,\n        shadowColor: true,\n        opacity: true\n    }\n};\nDEFAULT_COMMON_STYLE[STYLE_MAGIC_KEY] = true;\nvar PRIMARY_STATES_KEYS = ['z', 'z2', 'invisible'];\nvar PRIMARY_STATES_KEYS_IN_HOVER_LAYER = ['invisible'];\nvar Displayable = (function (_super) {\n    __extends(Displayable, _super);\n    function Displayable(props) {\n        return _super.call(this, props) || this;\n    }\n    Displayable.prototype._init = function (props) {\n        var keysArr = keys(props);\n        for (var i = 0; i < keysArr.length; i++) {\n            var key = keysArr[i];\n            if (key === 'style') {\n                this.useStyle(props[key]);\n            }\n            else {\n                _super.prototype.attrKV.call(this, key, props[key]);\n            }\n        }\n        if (!this.style) {\n            this.useStyle({});\n        }\n    };\n    Displayable.prototype.beforeBrush = function () { };\n    Displayable.prototype.afterBrush = function () { };\n    Displayable.prototype.innerBeforeBrush = function () { };\n    Displayable.prototype.innerAfterBrush = function () { };\n    Displayable.prototype.shouldBePainted = function (viewWidth, viewHeight, considerClipPath, considerAncestors) {\n        var m = this.transform;\n        if (this.ignore\n            || this.invisible\n            || this.style.opacity === 0\n            || (this.culling\n                && isDisplayableCulled(this, viewWidth, viewHeight))\n            || (m && !m[0] && !m[3])) {\n            return false;\n        }\n        if (considerClipPath && this.__clipPaths && this.__clipPaths.length) {\n            for (var i = 0; i < this.__clipPaths.length; ++i) {\n                if (this.__clipPaths[i].isZeroArea()) {\n                    return false;\n                }\n            }\n        }\n        if (considerAncestors && this.parent) {\n            var parent_1 = this.parent;\n            while (parent_1) {\n                if (parent_1.ignore) {\n                    return false;\n                }\n                parent_1 = parent_1.parent;\n            }\n        }\n        return true;\n    };\n    Displayable.prototype.contain = function (x, y) {\n        return this.rectContain(x, y);\n    };\n    Displayable.prototype.traverse = function (cb, context) {\n        cb.call(context, this);\n    };\n    Displayable.prototype.rectContain = function (x, y) {\n        var coord = this.transformCoordToLocal(x, y);\n        var rect = this.getBoundingRect();\n        return rect.contain(coord[0], coord[1]);\n    };\n    Displayable.prototype.getPaintRect = function () {\n        var rect = this._paintRect;\n        if (!this._paintRect || this.__dirty) {\n            var transform = this.transform;\n            var elRect = this.getBoundingRect();\n            var style = this.style;\n            var shadowSize = style.shadowBlur || 0;\n            var shadowOffsetX = style.shadowOffsetX || 0;\n            var shadowOffsetY = style.shadowOffsetY || 0;\n            rect = this._paintRect || (this._paintRect = new BoundingRect(0, 0, 0, 0));\n            if (transform) {\n                BoundingRect.applyTransform(rect, elRect, transform);\n            }\n            else {\n                rect.copy(elRect);\n            }\n            if (shadowSize || shadowOffsetX || shadowOffsetY) {\n                rect.width += shadowSize * 2 + Math.abs(shadowOffsetX);\n                rect.height += shadowSize * 2 + Math.abs(shadowOffsetY);\n                rect.x = Math.min(rect.x, rect.x + shadowOffsetX - shadowSize);\n                rect.y = Math.min(rect.y, rect.y + shadowOffsetY - shadowSize);\n            }\n            var tolerance = this.dirtyRectTolerance;\n            if (!rect.isZero()) {\n                rect.x = Math.floor(rect.x - tolerance);\n                rect.y = Math.floor(rect.y - tolerance);\n                rect.width = Math.ceil(rect.width + 1 + tolerance * 2);\n                rect.height = Math.ceil(rect.height + 1 + tolerance * 2);\n            }\n        }\n        return rect;\n    };\n    Displayable.prototype.setPrevPaintRect = function (paintRect) {\n        if (paintRect) {\n            this._prevPaintRect = this._prevPaintRect || new BoundingRect(0, 0, 0, 0);\n            this._prevPaintRect.copy(paintRect);\n        }\n        else {\n            this._prevPaintRect = null;\n        }\n    };\n    Displayable.prototype.getPrevPaintRect = function () {\n        return this._prevPaintRect;\n    };\n    Displayable.prototype.animateStyle = function (loop) {\n        return this.animate('style', loop);\n    };\n    Displayable.prototype.updateDuringAnimation = function (targetKey) {\n        if (targetKey === 'style') {\n            this.dirtyStyle();\n        }\n        else {\n            this.markRedraw();\n        }\n    };\n    Displayable.prototype.attrKV = function (key, value) {\n        if (key !== 'style') {\n            _super.prototype.attrKV.call(this, key, value);\n        }\n        else {\n            if (!this.style) {\n                this.useStyle(value);\n            }\n            else {\n                this.setStyle(value);\n            }\n        }\n    };\n    Displayable.prototype.setStyle = function (keyOrObj, value) {\n        if (typeof keyOrObj === 'string') {\n            this.style[keyOrObj] = value;\n        }\n        else {\n            extend(this.style, keyOrObj);\n        }\n        this.dirtyStyle();\n        return this;\n    };\n    Displayable.prototype.dirtyStyle = function (notRedraw) {\n        if (!notRedraw) {\n            this.markRedraw();\n        }\n        this.__dirty |= STYLE_CHANGED_BIT;\n        if (this._rect) {\n            this._rect = null;\n        }\n    };\n    Displayable.prototype.dirty = function () {\n        this.dirtyStyle();\n    };\n    Displayable.prototype.styleChanged = function () {\n        return !!(this.__dirty & STYLE_CHANGED_BIT);\n    };\n    Displayable.prototype.styleUpdated = function () {\n        this.__dirty &= ~STYLE_CHANGED_BIT;\n    };\n    Displayable.prototype.createStyle = function (obj) {\n        return createObject(DEFAULT_COMMON_STYLE, obj);\n    };\n    Displayable.prototype.useStyle = function (obj) {\n        if (!obj[STYLE_MAGIC_KEY]) {\n            obj = this.createStyle(obj);\n        }\n        if (this.__inHover) {\n            this.__hoverStyle = obj;\n        }\n        else {\n            this.style = obj;\n        }\n        this.dirtyStyle();\n    };\n    Displayable.prototype.isStyleObject = function (obj) {\n        return obj[STYLE_MAGIC_KEY];\n    };\n    Displayable.prototype._innerSaveToNormal = function (toState) {\n        _super.prototype._innerSaveToNormal.call(this, toState);\n        var normalState = this._normalState;\n        if (toState.style && !normalState.style) {\n            normalState.style = this._mergeStyle(this.createStyle(), this.style);\n        }\n        this._savePrimaryToNormal(toState, normalState, PRIMARY_STATES_KEYS);\n    };\n    Displayable.prototype._applyStateObj = function (stateName, state, normalState, keepCurrentStates, transition, animationCfg) {\n        _super.prototype._applyStateObj.call(this, stateName, state, normalState, keepCurrentStates, transition, animationCfg);\n        var needsRestoreToNormal = !(state && keepCurrentStates);\n        var targetStyle;\n        if (state && state.style) {\n            if (transition) {\n                if (keepCurrentStates) {\n                    targetStyle = state.style;\n                }\n                else {\n                    targetStyle = this._mergeStyle(this.createStyle(), normalState.style);\n                    this._mergeStyle(targetStyle, state.style);\n                }\n            }\n            else {\n                targetStyle = this._mergeStyle(this.createStyle(), keepCurrentStates ? this.style : normalState.style);\n                this._mergeStyle(targetStyle, state.style);\n            }\n        }\n        else if (needsRestoreToNormal) {\n            targetStyle = normalState.style;\n        }\n        if (targetStyle) {\n            if (transition) {\n                var sourceStyle = this.style;\n                this.style = this.createStyle(needsRestoreToNormal ? {} : sourceStyle);\n                if (needsRestoreToNormal) {\n                    var changedKeys = keys(sourceStyle);\n                    for (var i = 0; i < changedKeys.length; i++) {\n                        var key = changedKeys[i];\n                        if (key in targetStyle) {\n                            targetStyle[key] = targetStyle[key];\n                            this.style[key] = sourceStyle[key];\n                        }\n                    }\n                }\n                var targetKeys = keys(targetStyle);\n                for (var i = 0; i < targetKeys.length; i++) {\n                    var key = targetKeys[i];\n                    this.style[key] = this.style[key];\n                }\n                this._transitionState(stateName, {\n                    style: targetStyle\n                }, animationCfg, this.getAnimationStyleProps());\n            }\n            else {\n                this.useStyle(targetStyle);\n            }\n        }\n        var statesKeys = this.__inHover ? PRIMARY_STATES_KEYS_IN_HOVER_LAYER : PRIMARY_STATES_KEYS;\n        for (var i = 0; i < statesKeys.length; i++) {\n            var key = statesKeys[i];\n            if (state && state[key] != null) {\n                this[key] = state[key];\n            }\n            else if (needsRestoreToNormal) {\n                if (normalState[key] != null) {\n                    this[key] = normalState[key];\n                }\n            }\n        }\n    };\n    Displayable.prototype._mergeStates = function (states) {\n        var mergedState = _super.prototype._mergeStates.call(this, states);\n        var mergedStyle;\n        for (var i = 0; i < states.length; i++) {\n            var state = states[i];\n            if (state.style) {\n                mergedStyle = mergedStyle || {};\n                this._mergeStyle(mergedStyle, state.style);\n            }\n        }\n        if (mergedStyle) {\n            mergedState.style = mergedStyle;\n        }\n        return mergedState;\n    };\n    Displayable.prototype._mergeStyle = function (targetStyle, sourceStyle) {\n        extend(targetStyle, sourceStyle);\n        return targetStyle;\n    };\n    Displayable.prototype.getAnimationStyleProps = function () {\n        return DEFAULT_COMMON_ANIMATION_PROPS;\n    };\n    Displayable.initDefaultProps = (function () {\n        var dispProto = Displayable.prototype;\n        dispProto.type = 'displayable';\n        dispProto.invisible = false;\n        dispProto.z = 0;\n        dispProto.z2 = 0;\n        dispProto.zlevel = 0;\n        dispProto.culling = false;\n        dispProto.cursor = 'pointer';\n        dispProto.rectHover = false;\n        dispProto.incremental = false;\n        dispProto._rect = null;\n        dispProto.dirtyRectTolerance = 0;\n        dispProto.__dirty = REDRAW_BIT | STYLE_CHANGED_BIT;\n    })();\n    return Displayable;\n}(Element));\nvar tmpRect = new BoundingRect(0, 0, 0, 0);\nvar viewRect = new BoundingRect(0, 0, 0, 0);\nfunction isDisplayableCulled(el, width, height) {\n    tmpRect.copy(el.getBoundingRect());\n    if (el.transform) {\n        tmpRect.applyTransform(el.transform);\n    }\n    viewRect.width = width;\n    viewRect.height = height;\n    return !tmpRect.intersect(viewRect);\n}\nexport default Displayable;\n", "import * as vec2 from './vector.js';\nimport * as curve from './curve.js';\nvar mathMin = Math.min;\nvar mathMax = Math.max;\nvar mathSin = Math.sin;\nvar mathCos = Math.cos;\nvar PI2 = Math.PI * 2;\nvar start = vec2.create();\nvar end = vec2.create();\nvar extremity = vec2.create();\nexport function fromPoints(points, min, max) {\n    if (points.length === 0) {\n        return;\n    }\n    var p = points[0];\n    var left = p[0];\n    var right = p[0];\n    var top = p[1];\n    var bottom = p[1];\n    for (var i = 1; i < points.length; i++) {\n        p = points[i];\n        left = mathMin(left, p[0]);\n        right = mathMax(right, p[0]);\n        top = mathMin(top, p[1]);\n        bottom = mathMax(bottom, p[1]);\n    }\n    min[0] = left;\n    min[1] = top;\n    max[0] = right;\n    max[1] = bottom;\n}\nexport function fromLine(x0, y0, x1, y1, min, max) {\n    min[0] = mathMin(x0, x1);\n    min[1] = mathMin(y0, y1);\n    max[0] = mathMax(x0, x1);\n    max[1] = mathMax(y0, y1);\n}\nvar xDim = [];\nvar yDim = [];\nexport function fromCubic(x0, y0, x1, y1, x2, y2, x3, y3, min, max) {\n    var cubicExtrema = curve.cubicExtrema;\n    var cubicAt = curve.cubicAt;\n    var n = cubicExtrema(x0, x1, x2, x3, xDim);\n    min[0] = Infinity;\n    min[1] = Infinity;\n    max[0] = -Infinity;\n    max[1] = -Infinity;\n    for (var i = 0; i < n; i++) {\n        var x = cubicAt(x0, x1, x2, x3, xDim[i]);\n        min[0] = mathMin(x, min[0]);\n        max[0] = mathMax(x, max[0]);\n    }\n    n = cubicExtrema(y0, y1, y2, y3, yDim);\n    for (var i = 0; i < n; i++) {\n        var y = cubicAt(y0, y1, y2, y3, yDim[i]);\n        min[1] = mathMin(y, min[1]);\n        max[1] = mathMax(y, max[1]);\n    }\n    min[0] = mathMin(x0, min[0]);\n    max[0] = mathMax(x0, max[0]);\n    min[0] = mathMin(x3, min[0]);\n    max[0] = mathMax(x3, max[0]);\n    min[1] = mathMin(y0, min[1]);\n    max[1] = mathMax(y0, max[1]);\n    min[1] = mathMin(y3, min[1]);\n    max[1] = mathMax(y3, max[1]);\n}\nexport function fromQuadratic(x0, y0, x1, y1, x2, y2, min, max) {\n    var quadraticExtremum = curve.quadraticExtremum;\n    var quadraticAt = curve.quadraticAt;\n    var tx = mathMax(mathMin(quadraticExtremum(x0, x1, x2), 1), 0);\n    var ty = mathMax(mathMin(quadraticExtremum(y0, y1, y2), 1), 0);\n    var x = quadraticAt(x0, x1, x2, tx);\n    var y = quadraticAt(y0, y1, y2, ty);\n    min[0] = mathMin(x0, x2, x);\n    min[1] = mathMin(y0, y2, y);\n    max[0] = mathMax(x0, x2, x);\n    max[1] = mathMax(y0, y2, y);\n}\nexport function fromArc(x, y, rx, ry, startAngle, endAngle, anticlockwise, min, max) {\n    var vec2Min = vec2.min;\n    var vec2Max = vec2.max;\n    var diff = Math.abs(startAngle - endAngle);\n    if (diff % PI2 < 1e-4 && diff > 1e-4) {\n        min[0] = x - rx;\n        min[1] = y - ry;\n        max[0] = x + rx;\n        max[1] = y + ry;\n        return;\n    }\n    start[0] = mathCos(startAngle) * rx + x;\n    start[1] = mathSin(startAngle) * ry + y;\n    end[0] = mathCos(endAngle) * rx + x;\n    end[1] = mathSin(endAngle) * ry + y;\n    vec2Min(min, start, end);\n    vec2Max(max, start, end);\n    startAngle = startAngle % (PI2);\n    if (startAngle < 0) {\n        startAngle = startAngle + PI2;\n    }\n    endAngle = endAngle % (PI2);\n    if (endAngle < 0) {\n        endAngle = endAngle + PI2;\n    }\n    if (startAngle > endAngle && !anticlockwise) {\n        endAngle += PI2;\n    }\n    else if (startAngle < endAngle && anticlockwise) {\n        startAngle += PI2;\n    }\n    if (anticlockwise) {\n        var tmp = endAngle;\n        endAngle = startAngle;\n        startAngle = tmp;\n    }\n    for (var angle = 0; angle < endAngle; angle += Math.PI / 2) {\n        if (angle > startAngle) {\n            extremity[0] = mathCos(angle) * rx + x;\n            extremity[1] = mathSin(angle) * ry + y;\n            vec2Min(min, extremity, min);\n            vec2Max(max, extremity, max);\n        }\n    }\n}\n", "import * as vec2 from './vector.js';\nimport BoundingRect from './BoundingRect.js';\nimport { devicePixelRatio as dpr } from '../config.js';\nimport { fromLine, fromCubic, fromQuadratic, fromArc } from './bbox.js';\nimport { cubicLength, cubicSubdivide, quadraticLength, quadraticSubdivide } from './curve.js';\nvar CMD = {\n    M: 1,\n    L: 2,\n    C: 3,\n    Q: 4,\n    A: 5,\n    Z: 6,\n    R: 7\n};\nvar tmpOutX = [];\nvar tmpOutY = [];\nvar min = [];\nvar max = [];\nvar min2 = [];\nvar max2 = [];\nvar mathMin = Math.min;\nvar mathMax = Math.max;\nvar mathCos = Math.cos;\nvar mathSin = Math.sin;\nvar mathAbs = Math.abs;\nvar PI = Math.PI;\nvar PI2 = PI * 2;\nvar hasTypedArray = typeof Float32Array !== 'undefined';\nvar tmpAngles = [];\nfunction modPI2(radian) {\n    var n = Math.round(radian / PI * 1e8) / 1e8;\n    return (n % 2) * PI;\n}\nexport function normalizeArcAngles(angles, anticlockwise) {\n    var newStartAngle = modPI2(angles[0]);\n    if (newStartAngle < 0) {\n        newStartAngle += PI2;\n    }\n    var delta = newStartAngle - angles[0];\n    var newEndAngle = angles[1];\n    newEndAngle += delta;\n    if (!anticlockwise && newEndAngle - newStartAngle >= PI2) {\n        newEndAngle = newStartAngle + PI2;\n    }\n    else if (anticlockwise && newStartAngle - newEndAngle >= PI2) {\n        newEndAngle = newStartAngle - PI2;\n    }\n    else if (!anticlockwise && newStartAngle > newEndAngle) {\n        newEndAngle = newStartAngle + (PI2 - modPI2(newStartAngle - newEndAngle));\n    }\n    else if (anticlockwise && newStartAngle < newEndAngle) {\n        newEndAngle = newStartAngle - (PI2 - modPI2(newEndAngle - newStartAngle));\n    }\n    angles[0] = newStartAngle;\n    angles[1] = newEndAngle;\n}\nvar PathProxy = (function () {\n    function PathProxy(notSaveData) {\n        this.dpr = 1;\n        this._xi = 0;\n        this._yi = 0;\n        this._x0 = 0;\n        this._y0 = 0;\n        this._len = 0;\n        if (notSaveData) {\n            this._saveData = false;\n        }\n        if (this._saveData) {\n            this.data = [];\n        }\n    }\n    PathProxy.prototype.increaseVersion = function () {\n        this._version++;\n    };\n    PathProxy.prototype.getVersion = function () {\n        return this._version;\n    };\n    PathProxy.prototype.setScale = function (sx, sy, segmentIgnoreThreshold) {\n        segmentIgnoreThreshold = segmentIgnoreThreshold || 0;\n        if (segmentIgnoreThreshold > 0) {\n            this._ux = mathAbs(segmentIgnoreThreshold / dpr / sx) || 0;\n            this._uy = mathAbs(segmentIgnoreThreshold / dpr / sy) || 0;\n        }\n    };\n    PathProxy.prototype.setDPR = function (dpr) {\n        this.dpr = dpr;\n    };\n    PathProxy.prototype.setContext = function (ctx) {\n        this._ctx = ctx;\n    };\n    PathProxy.prototype.getContext = function () {\n        return this._ctx;\n    };\n    PathProxy.prototype.beginPath = function () {\n        this._ctx && this._ctx.beginPath();\n        this.reset();\n        return this;\n    };\n    PathProxy.prototype.reset = function () {\n        if (this._saveData) {\n            this._len = 0;\n        }\n        if (this._pathSegLen) {\n            this._pathSegLen = null;\n            this._pathLen = 0;\n        }\n        this._version++;\n    };\n    PathProxy.prototype.moveTo = function (x, y) {\n        this._drawPendingPt();\n        this.addData(CMD.M, x, y);\n        this._ctx && this._ctx.moveTo(x, y);\n        this._x0 = x;\n        this._y0 = y;\n        this._xi = x;\n        this._yi = y;\n        return this;\n    };\n    PathProxy.prototype.lineTo = function (x, y) {\n        var dx = mathAbs(x - this._xi);\n        var dy = mathAbs(y - this._yi);\n        var exceedUnit = dx > this._ux || dy > this._uy;\n        this.addData(CMD.L, x, y);\n        if (this._ctx && exceedUnit) {\n            this._ctx.lineTo(x, y);\n        }\n        if (exceedUnit) {\n            this._xi = x;\n            this._yi = y;\n            this._pendingPtDist = 0;\n        }\n        else {\n            var d2 = dx * dx + dy * dy;\n            if (d2 > this._pendingPtDist) {\n                this._pendingPtX = x;\n                this._pendingPtY = y;\n                this._pendingPtDist = d2;\n            }\n        }\n        return this;\n    };\n    PathProxy.prototype.bezierCurveTo = function (x1, y1, x2, y2, x3, y3) {\n        this._drawPendingPt();\n        this.addData(CMD.C, x1, y1, x2, y2, x3, y3);\n        if (this._ctx) {\n            this._ctx.bezierCurveTo(x1, y1, x2, y2, x3, y3);\n        }\n        this._xi = x3;\n        this._yi = y3;\n        return this;\n    };\n    PathProxy.prototype.quadraticCurveTo = function (x1, y1, x2, y2) {\n        this._drawPendingPt();\n        this.addData(CMD.Q, x1, y1, x2, y2);\n        if (this._ctx) {\n            this._ctx.quadraticCurveTo(x1, y1, x2, y2);\n        }\n        this._xi = x2;\n        this._yi = y2;\n        return this;\n    };\n    PathProxy.prototype.arc = function (cx, cy, r, startAngle, endAngle, anticlockwise) {\n        this._drawPendingPt();\n        tmpAngles[0] = startAngle;\n        tmpAngles[1] = endAngle;\n        normalizeArcAngles(tmpAngles, anticlockwise);\n        startAngle = tmpAngles[0];\n        endAngle = tmpAngles[1];\n        var delta = endAngle - startAngle;\n        this.addData(CMD.A, cx, cy, r, r, startAngle, delta, 0, anticlockwise ? 0 : 1);\n        this._ctx && this._ctx.arc(cx, cy, r, startAngle, endAngle, anticlockwise);\n        this._xi = mathCos(endAngle) * r + cx;\n        this._yi = mathSin(endAngle) * r + cy;\n        return this;\n    };\n    PathProxy.prototype.arcTo = function (x1, y1, x2, y2, radius) {\n        this._drawPendingPt();\n        if (this._ctx) {\n            this._ctx.arcTo(x1, y1, x2, y2, radius);\n        }\n        return this;\n    };\n    PathProxy.prototype.rect = function (x, y, w, h) {\n        this._drawPendingPt();\n        this._ctx && this._ctx.rect(x, y, w, h);\n        this.addData(CMD.R, x, y, w, h);\n        return this;\n    };\n    PathProxy.prototype.closePath = function () {\n        this._drawPendingPt();\n        this.addData(CMD.Z);\n        var ctx = this._ctx;\n        var x0 = this._x0;\n        var y0 = this._y0;\n        if (ctx) {\n            ctx.closePath();\n        }\n        this._xi = x0;\n        this._yi = y0;\n        return this;\n    };\n    PathProxy.prototype.fill = function (ctx) {\n        ctx && ctx.fill();\n        this.toStatic();\n    };\n    PathProxy.prototype.stroke = function (ctx) {\n        ctx && ctx.stroke();\n        this.toStatic();\n    };\n    PathProxy.prototype.len = function () {\n        return this._len;\n    };\n    PathProxy.prototype.setData = function (data) {\n        if (!this._saveData) {\n            return;\n        }\n        var len = data.length;\n        if (!(this.data && this.data.length === len) && hasTypedArray) {\n            this.data = new Float32Array(len);\n        }\n        for (var i = 0; i < len; i++) {\n            this.data[i] = data[i];\n        }\n        this._len = len;\n    };\n    PathProxy.prototype.appendPath = function (path) {\n        if (!this._saveData) {\n            return;\n        }\n        if (!(path instanceof Array)) {\n            path = [path];\n        }\n        var len = path.length;\n        var appendSize = 0;\n        var offset = this._len;\n        for (var i = 0; i < len; i++) {\n            appendSize += path[i].len();\n        }\n        var oldData = this.data;\n        if (hasTypedArray && (oldData instanceof Float32Array || !oldData)) {\n            this.data = new Float32Array(offset + appendSize);\n            if (offset > 0 && oldData) {\n                for (var k = 0; k < offset; k++) {\n                    this.data[k] = oldData[k];\n                }\n            }\n        }\n        for (var i = 0; i < len; i++) {\n            var appendPathData = path[i].data;\n            for (var k = 0; k < appendPathData.length; k++) {\n                this.data[offset++] = appendPathData[k];\n            }\n        }\n        this._len = offset;\n    };\n    PathProxy.prototype.addData = function (cmd, a, b, c, d, e, f, g, h) {\n        if (!this._saveData) {\n            return;\n        }\n        var data = this.data;\n        if (this._len + arguments.length > data.length) {\n            this._expandData();\n            data = this.data;\n        }\n        for (var i = 0; i < arguments.length; i++) {\n            data[this._len++] = arguments[i];\n        }\n    };\n    PathProxy.prototype._drawPendingPt = function () {\n        if (this._pendingPtDist > 0) {\n            this._ctx && this._ctx.lineTo(this._pendingPtX, this._pendingPtY);\n            this._pendingPtDist = 0;\n        }\n    };\n    PathProxy.prototype._expandData = function () {\n        if (!(this.data instanceof Array)) {\n            var newData = [];\n            for (var i = 0; i < this._len; i++) {\n                newData[i] = this.data[i];\n            }\n            this.data = newData;\n        }\n    };\n    PathProxy.prototype.toStatic = function () {\n        if (!this._saveData) {\n            return;\n        }\n        this._drawPendingPt();\n        var data = this.data;\n        if (data instanceof Array) {\n            data.length = this._len;\n            if (hasTypedArray && this._len > 11) {\n                this.data = new Float32Array(data);\n            }\n        }\n    };\n    PathProxy.prototype.getBoundingRect = function () {\n        min[0] = min[1] = min2[0] = min2[1] = Number.MAX_VALUE;\n        max[0] = max[1] = max2[0] = max2[1] = -Number.MAX_VALUE;\n        var data = this.data;\n        var xi = 0;\n        var yi = 0;\n        var x0 = 0;\n        var y0 = 0;\n        var i;\n        for (i = 0; i < this._len;) {\n            var cmd = data[i++];\n            var isFirst = i === 1;\n            if (isFirst) {\n                xi = data[i];\n                yi = data[i + 1];\n                x0 = xi;\n                y0 = yi;\n            }\n            switch (cmd) {\n                case CMD.M:\n                    xi = x0 = data[i++];\n                    yi = y0 = data[i++];\n                    min2[0] = x0;\n                    min2[1] = y0;\n                    max2[0] = x0;\n                    max2[1] = y0;\n                    break;\n                case CMD.L:\n                    fromLine(xi, yi, data[i], data[i + 1], min2, max2);\n                    xi = data[i++];\n                    yi = data[i++];\n                    break;\n                case CMD.C:\n                    fromCubic(xi, yi, data[i++], data[i++], data[i++], data[i++], data[i], data[i + 1], min2, max2);\n                    xi = data[i++];\n                    yi = data[i++];\n                    break;\n                case CMD.Q:\n                    fromQuadratic(xi, yi, data[i++], data[i++], data[i], data[i + 1], min2, max2);\n                    xi = data[i++];\n                    yi = data[i++];\n                    break;\n                case CMD.A:\n                    var cx = data[i++];\n                    var cy = data[i++];\n                    var rx = data[i++];\n                    var ry = data[i++];\n                    var startAngle = data[i++];\n                    var endAngle = data[i++] + startAngle;\n                    i += 1;\n                    var anticlockwise = !data[i++];\n                    if (isFirst) {\n                        x0 = mathCos(startAngle) * rx + cx;\n                        y0 = mathSin(startAngle) * ry + cy;\n                    }\n                    fromArc(cx, cy, rx, ry, startAngle, endAngle, anticlockwise, min2, max2);\n                    xi = mathCos(endAngle) * rx + cx;\n                    yi = mathSin(endAngle) * ry + cy;\n                    break;\n                case CMD.R:\n                    x0 = xi = data[i++];\n                    y0 = yi = data[i++];\n                    var width = data[i++];\n                    var height = data[i++];\n                    fromLine(x0, y0, x0 + width, y0 + height, min2, max2);\n                    break;\n                case CMD.Z:\n                    xi = x0;\n                    yi = y0;\n                    break;\n            }\n            vec2.min(min, min, min2);\n            vec2.max(max, max, max2);\n        }\n        if (i === 0) {\n            min[0] = min[1] = max[0] = max[1] = 0;\n        }\n        return new BoundingRect(min[0], min[1], max[0] - min[0], max[1] - min[1]);\n    };\n    PathProxy.prototype._calculateLength = function () {\n        var data = this.data;\n        var len = this._len;\n        var ux = this._ux;\n        var uy = this._uy;\n        var xi = 0;\n        var yi = 0;\n        var x0 = 0;\n        var y0 = 0;\n        if (!this._pathSegLen) {\n            this._pathSegLen = [];\n        }\n        var pathSegLen = this._pathSegLen;\n        var pathTotalLen = 0;\n        var segCount = 0;\n        for (var i = 0; i < len;) {\n            var cmd = data[i++];\n            var isFirst = i === 1;\n            if (isFirst) {\n                xi = data[i];\n                yi = data[i + 1];\n                x0 = xi;\n                y0 = yi;\n            }\n            var l = -1;\n            switch (cmd) {\n                case CMD.M:\n                    xi = x0 = data[i++];\n                    yi = y0 = data[i++];\n                    break;\n                case CMD.L: {\n                    var x2 = data[i++];\n                    var y2 = data[i++];\n                    var dx = x2 - xi;\n                    var dy = y2 - yi;\n                    if (mathAbs(dx) > ux || mathAbs(dy) > uy || i === len - 1) {\n                        l = Math.sqrt(dx * dx + dy * dy);\n                        xi = x2;\n                        yi = y2;\n                    }\n                    break;\n                }\n                case CMD.C: {\n                    var x1 = data[i++];\n                    var y1 = data[i++];\n                    var x2 = data[i++];\n                    var y2 = data[i++];\n                    var x3 = data[i++];\n                    var y3 = data[i++];\n                    l = cubicLength(xi, yi, x1, y1, x2, y2, x3, y3, 10);\n                    xi = x3;\n                    yi = y3;\n                    break;\n                }\n                case CMD.Q: {\n                    var x1 = data[i++];\n                    var y1 = data[i++];\n                    var x2 = data[i++];\n                    var y2 = data[i++];\n                    l = quadraticLength(xi, yi, x1, y1, x2, y2, 10);\n                    xi = x2;\n                    yi = y2;\n                    break;\n                }\n                case CMD.A:\n                    var cx = data[i++];\n                    var cy = data[i++];\n                    var rx = data[i++];\n                    var ry = data[i++];\n                    var startAngle = data[i++];\n                    var delta = data[i++];\n                    var endAngle = delta + startAngle;\n                    i += 1;\n                    if (isFirst) {\n                        x0 = mathCos(startAngle) * rx + cx;\n                        y0 = mathSin(startAngle) * ry + cy;\n                    }\n                    l = mathMax(rx, ry) * mathMin(PI2, Math.abs(delta));\n                    xi = mathCos(endAngle) * rx + cx;\n                    yi = mathSin(endAngle) * ry + cy;\n                    break;\n                case CMD.R: {\n                    x0 = xi = data[i++];\n                    y0 = yi = data[i++];\n                    var width = data[i++];\n                    var height = data[i++];\n                    l = width * 2 + height * 2;\n                    break;\n                }\n                case CMD.Z: {\n                    var dx = x0 - xi;\n                    var dy = y0 - yi;\n                    l = Math.sqrt(dx * dx + dy * dy);\n                    xi = x0;\n                    yi = y0;\n                    break;\n                }\n            }\n            if (l >= 0) {\n                pathSegLen[segCount++] = l;\n                pathTotalLen += l;\n            }\n        }\n        this._pathLen = pathTotalLen;\n        return pathTotalLen;\n    };\n    PathProxy.prototype.rebuildPath = function (ctx, percent) {\n        var d = this.data;\n        var ux = this._ux;\n        var uy = this._uy;\n        var len = this._len;\n        var x0;\n        var y0;\n        var xi;\n        var yi;\n        var x;\n        var y;\n        var drawPart = percent < 1;\n        var pathSegLen;\n        var pathTotalLen;\n        var accumLength = 0;\n        var segCount = 0;\n        var displayedLength;\n        var pendingPtDist = 0;\n        var pendingPtX;\n        var pendingPtY;\n        if (drawPart) {\n            if (!this._pathSegLen) {\n                this._calculateLength();\n            }\n            pathSegLen = this._pathSegLen;\n            pathTotalLen = this._pathLen;\n            displayedLength = percent * pathTotalLen;\n            if (!displayedLength) {\n                return;\n            }\n        }\n        lo: for (var i = 0; i < len;) {\n            var cmd = d[i++];\n            var isFirst = i === 1;\n            if (isFirst) {\n                xi = d[i];\n                yi = d[i + 1];\n                x0 = xi;\n                y0 = yi;\n            }\n            if (cmd !== CMD.L && pendingPtDist > 0) {\n                ctx.lineTo(pendingPtX, pendingPtY);\n                pendingPtDist = 0;\n            }\n            switch (cmd) {\n                case CMD.M:\n                    x0 = xi = d[i++];\n                    y0 = yi = d[i++];\n                    ctx.moveTo(xi, yi);\n                    break;\n                case CMD.L: {\n                    x = d[i++];\n                    y = d[i++];\n                    var dx = mathAbs(x - xi);\n                    var dy = mathAbs(y - yi);\n                    if (dx > ux || dy > uy) {\n                        if (drawPart) {\n                            var l = pathSegLen[segCount++];\n                            if (accumLength + l > displayedLength) {\n                                var t = (displayedLength - accumLength) / l;\n                                ctx.lineTo(xi * (1 - t) + x * t, yi * (1 - t) + y * t);\n                                break lo;\n                            }\n                            accumLength += l;\n                        }\n                        ctx.lineTo(x, y);\n                        xi = x;\n                        yi = y;\n                        pendingPtDist = 0;\n                    }\n                    else {\n                        var d2 = dx * dx + dy * dy;\n                        if (d2 > pendingPtDist) {\n                            pendingPtX = x;\n                            pendingPtY = y;\n                            pendingPtDist = d2;\n                        }\n                    }\n                    break;\n                }\n                case CMD.C: {\n                    var x1 = d[i++];\n                    var y1 = d[i++];\n                    var x2 = d[i++];\n                    var y2 = d[i++];\n                    var x3 = d[i++];\n                    var y3 = d[i++];\n                    if (drawPart) {\n                        var l = pathSegLen[segCount++];\n                        if (accumLength + l > displayedLength) {\n                            var t = (displayedLength - accumLength) / l;\n                            cubicSubdivide(xi, x1, x2, x3, t, tmpOutX);\n                            cubicSubdivide(yi, y1, y2, y3, t, tmpOutY);\n                            ctx.bezierCurveTo(tmpOutX[1], tmpOutY[1], tmpOutX[2], tmpOutY[2], tmpOutX[3], tmpOutY[3]);\n                            break lo;\n                        }\n                        accumLength += l;\n                    }\n                    ctx.bezierCurveTo(x1, y1, x2, y2, x3, y3);\n                    xi = x3;\n                    yi = y3;\n                    break;\n                }\n                case CMD.Q: {\n                    var x1 = d[i++];\n                    var y1 = d[i++];\n                    var x2 = d[i++];\n                    var y2 = d[i++];\n                    if (drawPart) {\n                        var l = pathSegLen[segCount++];\n                        if (accumLength + l > displayedLength) {\n                            var t = (displayedLength - accumLength) / l;\n                            quadraticSubdivide(xi, x1, x2, t, tmpOutX);\n                            quadraticSubdivide(yi, y1, y2, t, tmpOutY);\n                            ctx.quadraticCurveTo(tmpOutX[1], tmpOutY[1], tmpOutX[2], tmpOutY[2]);\n                            break lo;\n                        }\n                        accumLength += l;\n                    }\n                    ctx.quadraticCurveTo(x1, y1, x2, y2);\n                    xi = x2;\n                    yi = y2;\n                    break;\n                }\n                case CMD.A:\n                    var cx = d[i++];\n                    var cy = d[i++];\n                    var rx = d[i++];\n                    var ry = d[i++];\n                    var startAngle = d[i++];\n                    var delta = d[i++];\n                    var psi = d[i++];\n                    var anticlockwise = !d[i++];\n                    var r = (rx > ry) ? rx : ry;\n                    var isEllipse = mathAbs(rx - ry) > 1e-3;\n                    var endAngle = startAngle + delta;\n                    var breakBuild = false;\n                    if (drawPart) {\n                        var l = pathSegLen[segCount++];\n                        if (accumLength + l > displayedLength) {\n                            endAngle = startAngle + delta * (displayedLength - accumLength) / l;\n                            breakBuild = true;\n                        }\n                        accumLength += l;\n                    }\n                    if (isEllipse && ctx.ellipse) {\n                        ctx.ellipse(cx, cy, rx, ry, psi, startAngle, endAngle, anticlockwise);\n                    }\n                    else {\n                        ctx.arc(cx, cy, r, startAngle, endAngle, anticlockwise);\n                    }\n                    if (breakBuild) {\n                        break lo;\n                    }\n                    if (isFirst) {\n                        x0 = mathCos(startAngle) * rx + cx;\n                        y0 = mathSin(startAngle) * ry + cy;\n                    }\n                    xi = mathCos(endAngle) * rx + cx;\n                    yi = mathSin(endAngle) * ry + cy;\n                    break;\n                case CMD.R:\n                    x0 = xi = d[i];\n                    y0 = yi = d[i + 1];\n                    x = d[i++];\n                    y = d[i++];\n                    var width = d[i++];\n                    var height = d[i++];\n                    if (drawPart) {\n                        var l = pathSegLen[segCount++];\n                        if (accumLength + l > displayedLength) {\n                            var d_1 = displayedLength - accumLength;\n                            ctx.moveTo(x, y);\n                            ctx.lineTo(x + mathMin(d_1, width), y);\n                            d_1 -= width;\n                            if (d_1 > 0) {\n                                ctx.lineTo(x + width, y + mathMin(d_1, height));\n                            }\n                            d_1 -= height;\n                            if (d_1 > 0) {\n                                ctx.lineTo(x + mathMax(width - d_1, 0), y + height);\n                            }\n                            d_1 -= width;\n                            if (d_1 > 0) {\n                                ctx.lineTo(x, y + mathMax(height - d_1, 0));\n                            }\n                            break lo;\n                        }\n                        accumLength += l;\n                    }\n                    ctx.rect(x, y, width, height);\n                    break;\n                case CMD.Z:\n                    if (drawPart) {\n                        var l = pathSegLen[segCount++];\n                        if (accumLength + l > displayedLength) {\n                            var t = (displayedLength - accumLength) / l;\n                            ctx.lineTo(xi * (1 - t) + x0 * t, yi * (1 - t) + y0 * t);\n                            break lo;\n                        }\n                        accumLength += l;\n                    }\n                    ctx.closePath();\n                    xi = x0;\n                    yi = y0;\n            }\n        }\n    };\n    PathProxy.prototype.clone = function () {\n        var newProxy = new PathProxy();\n        var data = this.data;\n        newProxy.data = data.slice ? data.slice()\n            : Array.prototype.slice.call(data);\n        newProxy._len = this._len;\n        return newProxy;\n    };\n    PathProxy.prototype.canSave = function () {\n        return !!this._saveData;\n    };\n    PathProxy.CMD = CMD;\n    PathProxy.initDefaultProps = (function () {\n        var proto = PathProxy.prototype;\n        proto._saveData = true;\n        proto._ux = 0;\n        proto._uy = 0;\n        proto._pendingPtDist = 0;\n        proto._version = 0;\n    })();\n    return PathProxy;\n}());\nexport default PathProxy;\n", "export function containStroke(x0, y0, x1, y1, lineWidth, x, y) {\n    if (lineWidth === 0) {\n        return false;\n    }\n    var _l = lineWidth;\n    var _a = 0;\n    var _b = x0;\n    if ((y > y0 + _l && y > y1 + _l)\n        || (y < y0 - _l && y < y1 - _l)\n        || (x > x0 + _l && x > x1 + _l)\n        || (x < x0 - _l && x < x1 - _l)) {\n        return false;\n    }\n    if (x0 !== x1) {\n        _a = (y0 - y1) / (x0 - x1);\n        _b = (x0 * y1 - x1 * y0) / (x0 - x1);\n    }\n    else {\n        return Math.abs(x - x0) <= _l / 2;\n    }\n    var tmp = _a * x - y + _b;\n    var _s = tmp * tmp / (_a * _a + 1);\n    return _s <= _l / 2 * _l / 2;\n}\n", "import * as curve from '../core/curve.js';\nexport function containStroke(x0, y0, x1, y1, x2, y2, x3, y3, lineWidth, x, y) {\n    if (lineWidth === 0) {\n        return false;\n    }\n    var _l = lineWidth;\n    if ((y > y0 + _l && y > y1 + _l && y > y2 + _l && y > y3 + _l)\n        || (y < y0 - _l && y < y1 - _l && y < y2 - _l && y < y3 - _l)\n        || (x > x0 + _l && x > x1 + _l && x > x2 + _l && x > x3 + _l)\n        || (x < x0 - _l && x < x1 - _l && x < x2 - _l && x < x3 - _l)) {\n        return false;\n    }\n    var d = curve.cubicProjectPoint(x0, y0, x1, y1, x2, y2, x3, y3, x, y, null);\n    return d <= _l / 2;\n}\n", "import { quadraticProjectPoint } from '../core/curve.js';\nexport function containStroke(x0, y0, x1, y1, x2, y2, lineWidth, x, y) {\n    if (lineWidth === 0) {\n        return false;\n    }\n    var _l = lineWidth;\n    if ((y > y0 + _l && y > y1 + _l && y > y2 + _l)\n        || (y < y0 - _l && y < y1 - _l && y < y2 - _l)\n        || (x > x0 + _l && x > x1 + _l && x > x2 + _l)\n        || (x < x0 - _l && x < x1 - _l && x < x2 - _l)) {\n        return false;\n    }\n    var d = quadraticProjectPoint(x0, y0, x1, y1, x2, y2, x, y, null);\n    return d <= _l / 2;\n}\n", "var PI2 = Math.PI * 2;\nexport function normalizeRadian(angle) {\n    angle %= PI2;\n    if (angle < 0) {\n        angle += PI2;\n    }\n    return angle;\n}\n", "import { normalizeRadian } from './util.js';\nvar PI2 = Math.PI * 2;\nexport function containStroke(cx, cy, r, startAngle, endAngle, anticlockwise, lineWidth, x, y) {\n    if (lineWidth === 0) {\n        return false;\n    }\n    var _l = lineWidth;\n    x -= cx;\n    y -= cy;\n    var d = Math.sqrt(x * x + y * y);\n    if ((d - _l > r) || (d + _l < r)) {\n        return false;\n    }\n    if (Math.abs(startAngle - endAngle) % PI2 < 1e-4) {\n        return true;\n    }\n    if (anticlockwise) {\n        var tmp = startAngle;\n        startAngle = normalizeRadian(endAngle);\n        endAngle = normalizeRadian(tmp);\n    }\n    else {\n        startAngle = normalizeRadian(startAngle);\n        endAngle = normalizeRadian(endAngle);\n    }\n    if (startAngle > endAngle) {\n        endAngle += PI2;\n    }\n    var angle = Math.atan2(y, x);\n    if (angle < 0) {\n        angle += PI2;\n    }\n    return (angle >= startAngle && angle <= endAngle)\n        || (angle + PI2 >= startAngle && angle + PI2 <= endAngle);\n}\n", "export default function windingLine(x0, y0, x1, y1, x, y) {\n    if ((y > y0 && y > y1) || (y < y0 && y < y1)) {\n        return 0;\n    }\n    if (y1 === y0) {\n        return 0;\n    }\n    var t = (y - y0) / (y1 - y0);\n    var dir = y1 < y0 ? 1 : -1;\n    if (t === 1 || t === 0) {\n        dir = y1 < y0 ? 0.5 : -0.5;\n    }\n    var x_ = t * (x1 - x0) + x0;\n    return x_ === x ? Infinity : x_ > x ? dir : 0;\n}\n", "import PathProxy from '../core/PathProxy.js';\nimport * as line from './line.js';\nimport * as cubic from './cubic.js';\nimport * as quadratic from './quadratic.js';\nimport * as arc from './arc.js';\nimport * as curve from '../core/curve.js';\nimport windingLine from './windingLine.js';\nvar CMD = PathProxy.CMD;\nvar PI2 = Math.PI * 2;\nvar EPSILON = 1e-4;\nfunction isAroundEqual(a, b) {\n    return Math.abs(a - b) < EPSILON;\n}\nvar roots = [-1, -1, -1];\nvar extrema = [-1, -1];\nfunction swapExtrema() {\n    var tmp = extrema[0];\n    extrema[0] = extrema[1];\n    extrema[1] = tmp;\n}\nfunction windingCubic(x0, y0, x1, y1, x2, y2, x3, y3, x, y) {\n    if ((y > y0 && y > y1 && y > y2 && y > y3)\n        || (y < y0 && y < y1 && y < y2 && y < y3)) {\n        return 0;\n    }\n    var nRoots = curve.cubicRootAt(y0, y1, y2, y3, y, roots);\n    if (nRoots === 0) {\n        return 0;\n    }\n    else {\n        var w = 0;\n        var nExtrema = -1;\n        var y0_ = void 0;\n        var y1_ = void 0;\n        for (var i = 0; i < nRoots; i++) {\n            var t = roots[i];\n            var unit = (t === 0 || t === 1) ? 0.5 : 1;\n            var x_ = curve.cubicAt(x0, x1, x2, x3, t);\n            if (x_ < x) {\n                continue;\n            }\n            if (nExtrema < 0) {\n                nExtrema = curve.cubicExtrema(y0, y1, y2, y3, extrema);\n                if (extrema[1] < extrema[0] && nExtrema > 1) {\n                    swapExtrema();\n                }\n                y0_ = curve.cubicAt(y0, y1, y2, y3, extrema[0]);\n                if (nExtrema > 1) {\n                    y1_ = curve.cubicAt(y0, y1, y2, y3, extrema[1]);\n                }\n            }\n            if (nExtrema === 2) {\n                if (t < extrema[0]) {\n                    w += y0_ < y0 ? unit : -unit;\n                }\n                else if (t < extrema[1]) {\n                    w += y1_ < y0_ ? unit : -unit;\n                }\n                else {\n                    w += y3 < y1_ ? unit : -unit;\n                }\n            }\n            else {\n                if (t < extrema[0]) {\n                    w += y0_ < y0 ? unit : -unit;\n                }\n                else {\n                    w += y3 < y0_ ? unit : -unit;\n                }\n            }\n        }\n        return w;\n    }\n}\nfunction windingQuadratic(x0, y0, x1, y1, x2, y2, x, y) {\n    if ((y > y0 && y > y1 && y > y2)\n        || (y < y0 && y < y1 && y < y2)) {\n        return 0;\n    }\n    var nRoots = curve.quadraticRootAt(y0, y1, y2, y, roots);\n    if (nRoots === 0) {\n        return 0;\n    }\n    else {\n        var t = curve.quadraticExtremum(y0, y1, y2);\n        if (t >= 0 && t <= 1) {\n            var w = 0;\n            var y_ = curve.quadraticAt(y0, y1, y2, t);\n            for (var i = 0; i < nRoots; i++) {\n                var unit = (roots[i] === 0 || roots[i] === 1) ? 0.5 : 1;\n                var x_ = curve.quadraticAt(x0, x1, x2, roots[i]);\n                if (x_ < x) {\n                    continue;\n                }\n                if (roots[i] < t) {\n                    w += y_ < y0 ? unit : -unit;\n                }\n                else {\n                    w += y2 < y_ ? unit : -unit;\n                }\n            }\n            return w;\n        }\n        else {\n            var unit = (roots[0] === 0 || roots[0] === 1) ? 0.5 : 1;\n            var x_ = curve.quadraticAt(x0, x1, x2, roots[0]);\n            if (x_ < x) {\n                return 0;\n            }\n            return y2 < y0 ? unit : -unit;\n        }\n    }\n}\nfunction windingArc(cx, cy, r, startAngle, endAngle, anticlockwise, x, y) {\n    y -= cy;\n    if (y > r || y < -r) {\n        return 0;\n    }\n    var tmp = Math.sqrt(r * r - y * y);\n    roots[0] = -tmp;\n    roots[1] = tmp;\n    var dTheta = Math.abs(startAngle - endAngle);\n    if (dTheta < 1e-4) {\n        return 0;\n    }\n    if (dTheta >= PI2 - 1e-4) {\n        startAngle = 0;\n        endAngle = PI2;\n        var dir = anticlockwise ? 1 : -1;\n        if (x >= roots[0] + cx && x <= roots[1] + cx) {\n            return dir;\n        }\n        else {\n            return 0;\n        }\n    }\n    if (startAngle > endAngle) {\n        var tmp_1 = startAngle;\n        startAngle = endAngle;\n        endAngle = tmp_1;\n    }\n    if (startAngle < 0) {\n        startAngle += PI2;\n        endAngle += PI2;\n    }\n    var w = 0;\n    for (var i = 0; i < 2; i++) {\n        var x_ = roots[i];\n        if (x_ + cx > x) {\n            var angle = Math.atan2(y, x_);\n            var dir = anticlockwise ? 1 : -1;\n            if (angle < 0) {\n                angle = PI2 + angle;\n            }\n            if ((angle >= startAngle && angle <= endAngle)\n                || (angle + PI2 >= startAngle && angle + PI2 <= endAngle)) {\n                if (angle > Math.PI / 2 && angle < Math.PI * 1.5) {\n                    dir = -dir;\n                }\n                w += dir;\n            }\n        }\n    }\n    return w;\n}\nfunction containPath(path, lineWidth, isStroke, x, y) {\n    var data = path.data;\n    var len = path.len();\n    var w = 0;\n    var xi = 0;\n    var yi = 0;\n    var x0 = 0;\n    var y0 = 0;\n    var x1;\n    var y1;\n    for (var i = 0; i < len;) {\n        var cmd = data[i++];\n        var isFirst = i === 1;\n        if (cmd === CMD.M && i > 1) {\n            if (!isStroke) {\n                w += windingLine(xi, yi, x0, y0, x, y);\n            }\n        }\n        if (isFirst) {\n            xi = data[i];\n            yi = data[i + 1];\n            x0 = xi;\n            y0 = yi;\n        }\n        switch (cmd) {\n            case CMD.M:\n                x0 = data[i++];\n                y0 = data[i++];\n                xi = x0;\n                yi = y0;\n                break;\n            case CMD.L:\n                if (isStroke) {\n                    if (line.containStroke(xi, yi, data[i], data[i + 1], lineWidth, x, y)) {\n                        return true;\n                    }\n                }\n                else {\n                    w += windingLine(xi, yi, data[i], data[i + 1], x, y) || 0;\n                }\n                xi = data[i++];\n                yi = data[i++];\n                break;\n            case CMD.C:\n                if (isStroke) {\n                    if (cubic.containStroke(xi, yi, data[i++], data[i++], data[i++], data[i++], data[i], data[i + 1], lineWidth, x, y)) {\n                        return true;\n                    }\n                }\n                else {\n                    w += windingCubic(xi, yi, data[i++], data[i++], data[i++], data[i++], data[i], data[i + 1], x, y) || 0;\n                }\n                xi = data[i++];\n                yi = data[i++];\n                break;\n            case CMD.Q:\n                if (isStroke) {\n                    if (quadratic.containStroke(xi, yi, data[i++], data[i++], data[i], data[i + 1], lineWidth, x, y)) {\n                        return true;\n                    }\n                }\n                else {\n                    w += windingQuadratic(xi, yi, data[i++], data[i++], data[i], data[i + 1], x, y) || 0;\n                }\n                xi = data[i++];\n                yi = data[i++];\n                break;\n            case CMD.A:\n                var cx = data[i++];\n                var cy = data[i++];\n                var rx = data[i++];\n                var ry = data[i++];\n                var theta = data[i++];\n                var dTheta = data[i++];\n                i += 1;\n                var anticlockwise = !!(1 - data[i++]);\n                x1 = Math.cos(theta) * rx + cx;\n                y1 = Math.sin(theta) * ry + cy;\n                if (!isFirst) {\n                    w += windingLine(xi, yi, x1, y1, x, y);\n                }\n                else {\n                    x0 = x1;\n                    y0 = y1;\n                }\n                var _x = (x - cx) * ry / rx + cx;\n                if (isStroke) {\n                    if (arc.containStroke(cx, cy, ry, theta, theta + dTheta, anticlockwise, lineWidth, _x, y)) {\n                        return true;\n                    }\n                }\n                else {\n                    w += windingArc(cx, cy, ry, theta, theta + dTheta, anticlockwise, _x, y);\n                }\n                xi = Math.cos(theta + dTheta) * rx + cx;\n                yi = Math.sin(theta + dTheta) * ry + cy;\n                break;\n            case CMD.R:\n                x0 = xi = data[i++];\n                y0 = yi = data[i++];\n                var width = data[i++];\n                var height = data[i++];\n                x1 = x0 + width;\n                y1 = y0 + height;\n                if (isStroke) {\n                    if (line.containStroke(x0, y0, x1, y0, lineWidth, x, y)\n                        || line.containStroke(x1, y0, x1, y1, lineWidth, x, y)\n                        || line.containStroke(x1, y1, x0, y1, lineWidth, x, y)\n                        || line.containStroke(x0, y1, x0, y0, lineWidth, x, y)) {\n                        return true;\n                    }\n                }\n                else {\n                    w += windingLine(x1, y0, x1, y1, x, y);\n                    w += windingLine(x0, y1, x0, y0, x, y);\n                }\n                break;\n            case CMD.Z:\n                if (isStroke) {\n                    if (line.containStroke(xi, yi, x0, y0, lineWidth, x, y)) {\n                        return true;\n                    }\n                }\n                else {\n                    w += windingLine(xi, yi, x0, y0, x, y);\n                }\n                xi = x0;\n                yi = y0;\n                break;\n        }\n    }\n    if (!isStroke && !isAroundEqual(yi, y0)) {\n        w += windingLine(xi, yi, x0, y0, x, y) || 0;\n    }\n    return w !== 0;\n}\nexport function contain(pathProxy, x, y) {\n    return containPath(pathProxy, 0, false, x, y);\n}\nexport function containStroke(pathProxy, lineWidth, x, y) {\n    return containPath(pathProxy, lineWidth, true, x, y);\n}\n", "import { __extends } from \"tslib\";\nimport Displayable, { DEFAULT_COMMON_STYLE, DEFAULT_COMMON_ANIMATION_PROPS } from './Displayable.js';\nimport PathProxy from '../core/PathProxy.js';\nimport * as pathContain from '../contain/path.js';\nimport { defaults, keys, extend, clone, isString, createObject } from '../core/util.js';\nimport { lum } from '../tool/color.js';\nimport { DARK_LABEL_COLOR, LIGHT_LABEL_COLOR, DARK_MODE_THRESHOLD, LIGHTER_LABEL_COLOR } from '../config.js';\nimport { REDRAW_BIT, SHAPE_CHANGED_BIT, STYLE_CHANGED_BIT } from './constants.js';\nimport { TRANSFORMABLE_PROPS } from '../core/Transformable.js';\nexport var DEFAULT_PATH_STYLE = defaults({\n    fill: '#000',\n    stroke: null,\n    strokePercent: 1,\n    fillOpacity: 1,\n    strokeOpacity: 1,\n    lineDashOffset: 0,\n    lineWidth: 1,\n    lineCap: 'butt',\n    miterLimit: 10,\n    strokeNoScale: false,\n    strokeFirst: false\n}, DEFAULT_COMMON_STYLE);\nexport var DEFAULT_PATH_ANIMATION_PROPS = {\n    style: defaults({\n        fill: true,\n        stroke: true,\n        strokePercent: true,\n        fillOpacity: true,\n        strokeOpacity: true,\n        lineDashOffset: true,\n        lineWidth: true,\n        miterLimit: true\n    }, DEFAULT_COMMON_ANIMATION_PROPS.style)\n};\nvar pathCopyParams = TRANSFORMABLE_PROPS.concat(['invisible',\n    'culling', 'z', 'z2', 'zlevel', 'parent'\n]);\nvar Path = (function (_super) {\n    __extends(Path, _super);\n    function Path(opts) {\n        return _super.call(this, opts) || this;\n    }\n    Path.prototype.update = function () {\n        var _this = this;\n        _super.prototype.update.call(this);\n        var style = this.style;\n        if (style.decal) {\n            var decalEl = this._decalEl = this._decalEl || new Path();\n            if (decalEl.buildPath === Path.prototype.buildPath) {\n                decalEl.buildPath = function (ctx) {\n                    _this.buildPath(ctx, _this.shape);\n                };\n            }\n            decalEl.silent = true;\n            var decalElStyle = decalEl.style;\n            for (var key in style) {\n                if (decalElStyle[key] !== style[key]) {\n                    decalElStyle[key] = style[key];\n                }\n            }\n            decalElStyle.fill = style.fill ? style.decal : null;\n            decalElStyle.decal = null;\n            decalElStyle.shadowColor = null;\n            style.strokeFirst && (decalElStyle.stroke = null);\n            for (var i = 0; i < pathCopyParams.length; ++i) {\n                decalEl[pathCopyParams[i]] = this[pathCopyParams[i]];\n            }\n            decalEl.__dirty |= REDRAW_BIT;\n        }\n        else if (this._decalEl) {\n            this._decalEl = null;\n        }\n    };\n    Path.prototype.getDecalElement = function () {\n        return this._decalEl;\n    };\n    Path.prototype._init = function (props) {\n        var keysArr = keys(props);\n        this.shape = this.getDefaultShape();\n        var defaultStyle = this.getDefaultStyle();\n        if (defaultStyle) {\n            this.useStyle(defaultStyle);\n        }\n        for (var i = 0; i < keysArr.length; i++) {\n            var key = keysArr[i];\n            var value = props[key];\n            if (key === 'style') {\n                if (!this.style) {\n                    this.useStyle(value);\n                }\n                else {\n                    extend(this.style, value);\n                }\n            }\n            else if (key === 'shape') {\n                extend(this.shape, value);\n            }\n            else {\n                _super.prototype.attrKV.call(this, key, value);\n            }\n        }\n        if (!this.style) {\n            this.useStyle({});\n        }\n    };\n    Path.prototype.getDefaultStyle = function () {\n        return null;\n    };\n    Path.prototype.getDefaultShape = function () {\n        return {};\n    };\n    Path.prototype.canBeInsideText = function () {\n        return this.hasFill();\n    };\n    Path.prototype.getInsideTextFill = function () {\n        var pathFill = this.style.fill;\n        if (pathFill !== 'none') {\n            if (isString(pathFill)) {\n                var fillLum = lum(pathFill, 0);\n                if (fillLum > 0.5) {\n                    return DARK_LABEL_COLOR;\n                }\n                else if (fillLum > 0.2) {\n                    return LIGHTER_LABEL_COLOR;\n                }\n                return LIGHT_LABEL_COLOR;\n            }\n            else if (pathFill) {\n                return LIGHT_LABEL_COLOR;\n            }\n        }\n        return DARK_LABEL_COLOR;\n    };\n    Path.prototype.getInsideTextStroke = function (textFill) {\n        var pathFill = this.style.fill;\n        if (isString(pathFill)) {\n            var zr = this.__zr;\n            var isDarkMode = !!(zr && zr.isDarkMode());\n            var isDarkLabel = lum(textFill, 0) < DARK_MODE_THRESHOLD;\n            if (isDarkMode === isDarkLabel) {\n                return pathFill;\n            }\n        }\n    };\n    Path.prototype.buildPath = function (ctx, shapeCfg, inBatch) { };\n    Path.prototype.pathUpdated = function () {\n        this.__dirty &= ~SHAPE_CHANGED_BIT;\n    };\n    Path.prototype.getUpdatedPathProxy = function (inBatch) {\n        !this.path && this.createPathProxy();\n        this.path.beginPath();\n        this.buildPath(this.path, this.shape, inBatch);\n        return this.path;\n    };\n    Path.prototype.createPathProxy = function () {\n        this.path = new PathProxy(false);\n    };\n    Path.prototype.hasStroke = function () {\n        var style = this.style;\n        var stroke = style.stroke;\n        return !(stroke == null || stroke === 'none' || !(style.lineWidth > 0));\n    };\n    Path.prototype.hasFill = function () {\n        var style = this.style;\n        var fill = style.fill;\n        return fill != null && fill !== 'none';\n    };\n    Path.prototype.getBoundingRect = function () {\n        var rect = this._rect;\n        var style = this.style;\n        var needsUpdateRect = !rect;\n        if (needsUpdateRect) {\n            var firstInvoke = false;\n            if (!this.path) {\n                firstInvoke = true;\n                this.createPathProxy();\n            }\n            var path = this.path;\n            if (firstInvoke || (this.__dirty & SHAPE_CHANGED_BIT)) {\n                path.beginPath();\n                this.buildPath(path, this.shape, false);\n                this.pathUpdated();\n            }\n            rect = path.getBoundingRect();\n        }\n        this._rect = rect;\n        if (this.hasStroke() && this.path && this.path.len() > 0) {\n            var rectStroke = this._rectStroke || (this._rectStroke = rect.clone());\n            if (this.__dirty || needsUpdateRect) {\n                rectStroke.copy(rect);\n                var lineScale = style.strokeNoScale ? this.getLineScale() : 1;\n                var w = style.lineWidth;\n                if (!this.hasFill()) {\n                    var strokeContainThreshold = this.strokeContainThreshold;\n                    w = Math.max(w, strokeContainThreshold == null ? 4 : strokeContainThreshold);\n                }\n                if (lineScale > 1e-10) {\n                    rectStroke.width += w / lineScale;\n                    rectStroke.height += w / lineScale;\n                    rectStroke.x -= w / lineScale / 2;\n                    rectStroke.y -= w / lineScale / 2;\n                }\n            }\n            return rectStroke;\n        }\n        return rect;\n    };\n    Path.prototype.contain = function (x, y) {\n        var localPos = this.transformCoordToLocal(x, y);\n        var rect = this.getBoundingRect();\n        var style = this.style;\n        x = localPos[0];\n        y = localPos[1];\n        if (rect.contain(x, y)) {\n            var pathProxy = this.path;\n            if (this.hasStroke()) {\n                var lineWidth = style.lineWidth;\n                var lineScale = style.strokeNoScale ? this.getLineScale() : 1;\n                if (lineScale > 1e-10) {\n                    if (!this.hasFill()) {\n                        lineWidth = Math.max(lineWidth, this.strokeContainThreshold);\n                    }\n                    if (pathContain.containStroke(pathProxy, lineWidth / lineScale, x, y)) {\n                        return true;\n                    }\n                }\n            }\n            if (this.hasFill()) {\n                return pathContain.contain(pathProxy, x, y);\n            }\n        }\n        return false;\n    };\n    Path.prototype.dirtyShape = function () {\n        this.__dirty |= SHAPE_CHANGED_BIT;\n        if (this._rect) {\n            this._rect = null;\n        }\n        if (this._decalEl) {\n            this._decalEl.dirtyShape();\n        }\n        this.markRedraw();\n    };\n    Path.prototype.dirty = function () {\n        this.dirtyStyle();\n        this.dirtyShape();\n    };\n    Path.prototype.animateShape = function (loop) {\n        return this.animate('shape', loop);\n    };\n    Path.prototype.updateDuringAnimation = function (targetKey) {\n        if (targetKey === 'style') {\n            this.dirtyStyle();\n        }\n        else if (targetKey === 'shape') {\n            this.dirtyShape();\n        }\n        else {\n            this.markRedraw();\n        }\n    };\n    Path.prototype.attrKV = function (key, value) {\n        if (key === 'shape') {\n            this.setShape(value);\n        }\n        else {\n            _super.prototype.attrKV.call(this, key, value);\n        }\n    };\n    Path.prototype.setShape = function (keyOrObj, value) {\n        var shape = this.shape;\n        if (!shape) {\n            shape = this.shape = {};\n        }\n        if (typeof keyOrObj === 'string') {\n            shape[keyOrObj] = value;\n        }\n        else {\n            extend(shape, keyOrObj);\n        }\n        this.dirtyShape();\n        return this;\n    };\n    Path.prototype.shapeChanged = function () {\n        return !!(this.__dirty & SHAPE_CHANGED_BIT);\n    };\n    Path.prototype.createStyle = function (obj) {\n        return createObject(DEFAULT_PATH_STYLE, obj);\n    };\n    Path.prototype._innerSaveToNormal = function (toState) {\n        _super.prototype._innerSaveToNormal.call(this, toState);\n        var normalState = this._normalState;\n        if (toState.shape && !normalState.shape) {\n            normalState.shape = extend({}, this.shape);\n        }\n    };\n    Path.prototype._applyStateObj = function (stateName, state, normalState, keepCurrentStates, transition, animationCfg) {\n        _super.prototype._applyStateObj.call(this, stateName, state, normalState, keepCurrentStates, transition, animationCfg);\n        var needsRestoreToNormal = !(state && keepCurrentStates);\n        var targetShape;\n        if (state && state.shape) {\n            if (transition) {\n                if (keepCurrentStates) {\n                    targetShape = state.shape;\n                }\n                else {\n                    targetShape = extend({}, normalState.shape);\n                    extend(targetShape, state.shape);\n                }\n            }\n            else {\n                targetShape = extend({}, keepCurrentStates ? this.shape : normalState.shape);\n                extend(targetShape, state.shape);\n            }\n        }\n        else if (needsRestoreToNormal) {\n            targetShape = normalState.shape;\n        }\n        if (targetShape) {\n            if (transition) {\n                this.shape = extend({}, this.shape);\n                var targetShapePrimaryProps = {};\n                var shapeKeys = keys(targetShape);\n                for (var i = 0; i < shapeKeys.length; i++) {\n                    var key = shapeKeys[i];\n                    if (typeof targetShape[key] === 'object') {\n                        this.shape[key] = targetShape[key];\n                    }\n                    else {\n                        targetShapePrimaryProps[key] = targetShape[key];\n                    }\n                }\n                this._transitionState(stateName, {\n                    shape: targetShapePrimaryProps\n                }, animationCfg);\n            }\n            else {\n                this.shape = targetShape;\n                this.dirtyShape();\n            }\n        }\n    };\n    Path.prototype._mergeStates = function (states) {\n        var mergedState = _super.prototype._mergeStates.call(this, states);\n        var mergedShape;\n        for (var i = 0; i < states.length; i++) {\n            var state = states[i];\n            if (state.shape) {\n                mergedShape = mergedShape || {};\n                this._mergeStyle(mergedShape, state.shape);\n            }\n        }\n        if (mergedShape) {\n            mergedState.shape = mergedShape;\n        }\n        return mergedState;\n    };\n    Path.prototype.getAnimationStyleProps = function () {\n        return DEFAULT_PATH_ANIMATION_PROPS;\n    };\n    Path.prototype.isZeroArea = function () {\n        return false;\n    };\n    Path.extend = function (defaultProps) {\n        var Sub = (function (_super) {\n            __extends(Sub, _super);\n            function Sub(opts) {\n                var _this = _super.call(this, opts) || this;\n                defaultProps.init && defaultProps.init.call(_this, opts);\n                return _this;\n            }\n            Sub.prototype.getDefaultStyle = function () {\n                return clone(defaultProps.style);\n            };\n            Sub.prototype.getDefaultShape = function () {\n                return clone(defaultProps.shape);\n            };\n            return Sub;\n        }(Path));\n        for (var key in defaultProps) {\n            if (typeof defaultProps[key] === 'function') {\n                Sub.prototype[key] = defaultProps[key];\n            }\n        }\n        return Sub;\n    };\n    Path.initDefaultProps = (function () {\n        var pathProto = Path.prototype;\n        pathProto.type = 'path';\n        pathProto.strokeContainThreshold = 5;\n        pathProto.segmentIgnoreThreshold = 0;\n        pathProto.subPixelOptimize = false;\n        pathProto.autoBatch = false;\n        pathProto.__dirty = REDRAW_BIT | STYLE_CHANGED_BIT | SHAPE_CHANGED_BIT;\n    })();\n    return Path;\n}(Displayable));\nexport default Path;\n", "import { __extends } from \"tslib\";\nimport Displayable from './Displayable.js';\nimport { DEFAULT_PATH_STYLE } from './Path.js';\nimport { createObject, defaults } from '../core/util.js';\nimport { DEFAULT_FONT } from '../core/platform.js';\nimport { tSpanCreateBoundingRect, tSpanHasStroke } from './helper/parseText.js';\nexport var DEFAULT_TSPAN_STYLE = defaults({\n    strokeFirst: true,\n    font: DEFAULT_FONT,\n    x: 0,\n    y: 0,\n    textAlign: 'left',\n    textBaseline: 'top',\n    miterLimit: 2\n}, DEFAULT_PATH_STYLE);\nvar TSpan = (function (_super) {\n    __extends(TSpan, _super);\n    function TSpan() {\n        return _super !== null && _super.apply(this, arguments) || this;\n    }\n    TSpan.prototype.hasStroke = function () {\n        return tSpanHasStroke(this.style);\n    };\n    TSpan.prototype.hasFill = function () {\n        var style = this.style;\n        var fill = style.fill;\n        return fill != null && fill !== 'none';\n    };\n    TSpan.prototype.createStyle = function (obj) {\n        return createObject(DEFAULT_TSPAN_STYLE, obj);\n    };\n    TSpan.prototype.setBoundingRect = function (rect) {\n        this._rect = rect;\n    };\n    TSpan.prototype.getBoundingRect = function () {\n        if (!this._rect) {\n            this._rect = tSpanCreateBoundingRect(this.style);\n        }\n        return this._rect;\n    };\n    TSpan.initDefaultProps = (function () {\n        var tspanProto = TSpan.prototype;\n        tspanProto.dirtyRectTolerance = 10;\n    })();\n    return TSpan;\n}(Displayable));\nTSpan.prototype.type = 'tspan';\nexport default TSpan;\n", "import { __extends } from \"tslib\";\nimport Displayable, { DEFAULT_COMMON_STYLE, DEFAULT_COMMON_ANIMATION_PROPS } from './Displayable.js';\nimport BoundingRect from '../core/BoundingRect.js';\nimport { defaults, createObject } from '../core/util.js';\nexport var DEFAULT_IMAGE_STYLE = defaults({\n    x: 0,\n    y: 0\n}, DEFAULT_COMMON_STYLE);\nexport var DEFAULT_IMAGE_ANIMATION_PROPS = {\n    style: defaults({\n        x: true,\n        y: true,\n        width: true,\n        height: true,\n        sx: true,\n        sy: true,\n        sWidth: true,\n        sHeight: true\n    }, DEFAULT_COMMON_ANIMATION_PROPS.style)\n};\nfunction isImageLike(source) {\n    return !!(source\n        && typeof source !== 'string'\n        && source.width && source.height);\n}\nvar ZRImage = (function (_super) {\n    __extends(ZRImage, _super);\n    function ZRImage() {\n        return _super !== null && _super.apply(this, arguments) || this;\n    }\n    ZRImage.prototype.createStyle = function (obj) {\n        return createObject(DEFAULT_IMAGE_STYLE, obj);\n    };\n    ZRImage.prototype._getSize = function (dim) {\n        var style = this.style;\n        var size = style[dim];\n        if (size != null) {\n            return size;\n        }\n        var imageSource = isImageLike(style.image)\n            ? style.image : this.__image;\n        if (!imageSource) {\n            return 0;\n        }\n        var otherDim = dim === 'width' ? 'height' : 'width';\n        var otherDimSize = style[otherDim];\n        if (otherDimSize == null) {\n            return imageSource[dim];\n        }\n        else {\n            return imageSource[dim] / imageSource[otherDim] * otherDimSize;\n        }\n    };\n    ZRImage.prototype.getWidth = function () {\n        return this._getSize('width');\n    };\n    ZRImage.prototype.getHeight = function () {\n        return this._getSize('height');\n    };\n    ZRImage.prototype.getAnimationStyleProps = function () {\n        return DEFAULT_IMAGE_ANIMATION_PROPS;\n    };\n    ZRImage.prototype.getBoundingRect = function () {\n        var style = this.style;\n        if (!this._rect) {\n            this._rect = new BoundingRect(style.x || 0, style.y || 0, this.getWidth(), this.getHeight());\n        }\n        return this._rect;\n    };\n    return ZRImage;\n}(Displayable));\nZRImage.prototype.type = 'image';\nexport default ZRImage;\n", "export function buildPath(ctx, shape) {\n    var x = shape.x;\n    var y = shape.y;\n    var width = shape.width;\n    var height = shape.height;\n    var r = shape.r;\n    var r1;\n    var r2;\n    var r3;\n    var r4;\n    if (width < 0) {\n        x = x + width;\n        width = -width;\n    }\n    if (height < 0) {\n        y = y + height;\n        height = -height;\n    }\n    if (typeof r === 'number') {\n        r1 = r2 = r3 = r4 = r;\n    }\n    else if (r instanceof Array) {\n        if (r.length === 1) {\n            r1 = r2 = r3 = r4 = r[0];\n        }\n        else if (r.length === 2) {\n            r1 = r3 = r[0];\n            r2 = r4 = r[1];\n        }\n        else if (r.length === 3) {\n            r1 = r[0];\n            r2 = r4 = r[1];\n            r3 = r[2];\n        }\n        else {\n            r1 = r[0];\n            r2 = r[1];\n            r3 = r[2];\n            r4 = r[3];\n        }\n    }\n    else {\n        r1 = r2 = r3 = r4 = 0;\n    }\n    var total;\n    if (r1 + r2 > width) {\n        total = r1 + r2;\n        r1 *= width / total;\n        r2 *= width / total;\n    }\n    if (r3 + r4 > width) {\n        total = r3 + r4;\n        r3 *= width / total;\n        r4 *= width / total;\n    }\n    if (r2 + r3 > height) {\n        total = r2 + r3;\n        r2 *= height / total;\n        r3 *= height / total;\n    }\n    if (r1 + r4 > height) {\n        total = r1 + r4;\n        r1 *= height / total;\n        r4 *= height / total;\n    }\n    ctx.moveTo(x + r1, y);\n    ctx.lineTo(x + width - r2, y);\n    r2 !== 0 && ctx.arc(x + width - r2, y + r2, r2, -Math.PI / 2, 0);\n    ctx.lineTo(x + width, y + height - r3);\n    r3 !== 0 && ctx.arc(x + width - r3, y + height - r3, r3, 0, Math.PI / 2);\n    ctx.lineTo(x + r4, y + height);\n    r4 !== 0 && ctx.arc(x + r4, y + height - r4, r4, Math.PI / 2, Math.PI);\n    ctx.lineTo(x, y + r1);\n    r1 !== 0 && ctx.arc(x + r1, y + r1, r1, Math.PI, Math.PI * 1.5);\n}\n", "var round = Math.round;\nexport function subPixelOptimizeLine(outputShape, inputShape, style) {\n    if (!inputShape) {\n        return;\n    }\n    var x1 = inputShape.x1;\n    var x2 = inputShape.x2;\n    var y1 = inputShape.y1;\n    var y2 = inputShape.y2;\n    outputShape.x1 = x1;\n    outputShape.x2 = x2;\n    outputShape.y1 = y1;\n    outputShape.y2 = y2;\n    var lineWidth = style && style.lineWidth;\n    if (!lineWidth) {\n        return outputShape;\n    }\n    if (round(x1 * 2) === round(x2 * 2)) {\n        outputShape.x1 = outputShape.x2 = subPixelOptimize(x1, lineWidth, true);\n    }\n    if (round(y1 * 2) === round(y2 * 2)) {\n        outputShape.y1 = outputShape.y2 = subPixelOptimize(y1, lineWidth, true);\n    }\n    return outputShape;\n}\nexport function subPixelOptimizeRect(outputShape, inputShape, style) {\n    if (!inputShape) {\n        return;\n    }\n    var originX = inputShape.x;\n    var originY = inputShape.y;\n    var originWidth = inputShape.width;\n    var originHeight = inputShape.height;\n    outputShape.x = originX;\n    outputShape.y = originY;\n    outputShape.width = originWidth;\n    outputShape.height = originHeight;\n    var lineWidth = style && style.lineWidth;\n    if (!lineWidth) {\n        return outputShape;\n    }\n    outputShape.x = subPixelOptimize(originX, lineWidth, true);\n    outputShape.y = subPixelOptimize(originY, lineWidth, true);\n    outputShape.width = Math.max(subPixelOptimize(originX + originWidth, lineWidth, false) - outputShape.x, originWidth === 0 ? 0 : 1);\n    outputShape.height = Math.max(subPixelOptimize(originY + originHeight, lineWidth, false) - outputShape.y, originHeight === 0 ? 0 : 1);\n    return outputShape;\n}\nexport function subPixelOptimize(position, lineWidth, positiveOrNegative) {\n    if (!lineWidth) {\n        return position;\n    }\n    var doubledPosition = round(position * 2);\n    return (doubledPosition + round(lineWidth)) % 2 === 0\n        ? doubledPosition / 2\n        : (doubledPosition + (positiveOrNegative ? 1 : -1)) / 2;\n}\n", "import { __extends } from \"tslib\";\nimport Path from '../Path.js';\nimport * as roundRectHelper from '../helper/roundRect.js';\nimport { subPixelOptimizeRect } from '../helper/subPixelOptimize.js';\nvar RectShape = (function () {\n    function RectShape() {\n        this.x = 0;\n        this.y = 0;\n        this.width = 0;\n        this.height = 0;\n    }\n    return RectShape;\n}());\nexport { RectShape };\nvar subPixelOptimizeOutputShape = {};\nvar Rect = (function (_super) {\n    __extends(Rect, _super);\n    function Rect(opts) {\n        return _super.call(this, opts) || this;\n    }\n    Rect.prototype.getDefaultShape = function () {\n        return new RectShape();\n    };\n    Rect.prototype.buildPath = function (ctx, shape) {\n        var x;\n        var y;\n        var width;\n        var height;\n        if (this.subPixelOptimize) {\n            var optimizedShape = subPixelOptimizeRect(subPixelOptimizeOutputShape, shape, this.style);\n            x = optimizedShape.x;\n            y = optimizedShape.y;\n            width = optimizedShape.width;\n            height = optimizedShape.height;\n            optimizedShape.r = shape.r;\n            shape = optimizedShape;\n        }\n        else {\n            x = shape.x;\n            y = shape.y;\n            width = shape.width;\n            height = shape.height;\n        }\n        if (!shape.r) {\n            ctx.rect(x, y, width, height);\n        }\n        else {\n            roundRectHelper.buildPath(ctx, shape);\n        }\n    };\n    Rect.prototype.isZeroArea = function () {\n        return !this.shape.width || !this.shape.height;\n    };\n    return Rect;\n}(Path));\nRect.prototype.type = 'rect';\nexport default Rect;\n", "import { __extends } from \"tslib\";\nimport { parseRichText, parsePlainText, calcInnerTextOverflowArea, tSpanCreateBoundingRect2, } from './helper/parseText.js';\nimport TSpan from './TSpan.js';\nimport { retrieve2, each, normalizeCssArray, trim, retrieve3, extend, keys, defaults } from '../core/util.js';\nimport { adjustTextX, adjustTextY } from '../contain/text.js';\nimport ZRImage from './Image.js';\nimport Rect from './shape/Rect.js';\nimport BoundingRect from '../core/BoundingRect.js';\nimport Displayable, { DEFAULT_COMMON_ANIMATION_PROPS } from './Displayable.js';\nimport { DEFAULT_FONT, DEFAULT_FONT_SIZE } from '../core/platform.js';\nvar DEFAULT_RICH_TEXT_COLOR = {\n    fill: '#000'\n};\nvar DEFAULT_STROKE_LINE_WIDTH = 2;\nvar tmpCITOverflowAreaOut = {};\nexport var DEFAULT_TEXT_ANIMATION_PROPS = {\n    style: defaults({\n        fill: true,\n        stroke: true,\n        fillOpacity: true,\n        strokeOpacity: true,\n        lineWidth: true,\n        fontSize: true,\n        lineHeight: true,\n        width: true,\n        height: true,\n        textShadowColor: true,\n        textShadowBlur: true,\n        textShadowOffsetX: true,\n        textShadowOffsetY: true,\n        backgroundColor: true,\n        padding: true,\n        borderColor: true,\n        borderWidth: true,\n        borderRadius: true\n    }, DEFAULT_COMMON_ANIMATION_PROPS.style)\n};\nvar ZRText = (function (_super) {\n    __extends(ZRText, _super);\n    function ZRText(opts) {\n        var _this = _super.call(this) || this;\n        _this.type = 'text';\n        _this._children = [];\n        _this._defaultStyle = DEFAULT_RICH_TEXT_COLOR;\n        _this.attr(opts);\n        return _this;\n    }\n    ZRText.prototype.childrenRef = function () {\n        return this._children;\n    };\n    ZRText.prototype.update = function () {\n        _super.prototype.update.call(this);\n        if (this.styleChanged()) {\n            this._updateSubTexts();\n        }\n        for (var i = 0; i < this._children.length; i++) {\n            var child = this._children[i];\n            child.zlevel = this.zlevel;\n            child.z = this.z;\n            child.z2 = this.z2;\n            child.culling = this.culling;\n            child.cursor = this.cursor;\n            child.invisible = this.invisible;\n        }\n    };\n    ZRText.prototype.updateTransform = function () {\n        var innerTransformable = this.innerTransformable;\n        if (innerTransformable) {\n            innerTransformable.updateTransform();\n            if (innerTransformable.transform) {\n                this.transform = innerTransformable.transform;\n            }\n        }\n        else {\n            _super.prototype.updateTransform.call(this);\n        }\n    };\n    ZRText.prototype.getLocalTransform = function (m) {\n        var innerTransformable = this.innerTransformable;\n        return innerTransformable\n            ? innerTransformable.getLocalTransform(m)\n            : _super.prototype.getLocalTransform.call(this, m);\n    };\n    ZRText.prototype.getComputedTransform = function () {\n        if (this.__hostTarget) {\n            this.__hostTarget.getComputedTransform();\n            this.__hostTarget.updateInnerText(true);\n        }\n        return _super.prototype.getComputedTransform.call(this);\n    };\n    ZRText.prototype._updateSubTexts = function () {\n        this._childCursor = 0;\n        normalizeTextStyle(this.style);\n        this.style.rich\n            ? this._updateRichTexts()\n            : this._updatePlainTexts();\n        this._children.length = this._childCursor;\n        this.styleUpdated();\n    };\n    ZRText.prototype.addSelfToZr = function (zr) {\n        _super.prototype.addSelfToZr.call(this, zr);\n        for (var i = 0; i < this._children.length; i++) {\n            this._children[i].__zr = zr;\n        }\n    };\n    ZRText.prototype.removeSelfFromZr = function (zr) {\n        _super.prototype.removeSelfFromZr.call(this, zr);\n        for (var i = 0; i < this._children.length; i++) {\n            this._children[i].__zr = null;\n        }\n    };\n    ZRText.prototype.getBoundingRect = function () {\n        if (this.styleChanged()) {\n            this._updateSubTexts();\n        }\n        if (!this._rect) {\n            var tmpRect = new BoundingRect(0, 0, 0, 0);\n            var children = this._children;\n            var tmpMat = [];\n            var rect = null;\n            for (var i = 0; i < children.length; i++) {\n                var child = children[i];\n                var childRect = child.getBoundingRect();\n                var transform = child.getLocalTransform(tmpMat);\n                if (transform) {\n                    tmpRect.copy(childRect);\n                    tmpRect.applyTransform(transform);\n                    rect = rect || tmpRect.clone();\n                    rect.union(tmpRect);\n                }\n                else {\n                    rect = rect || childRect.clone();\n                    rect.union(childRect);\n                }\n            }\n            this._rect = rect || tmpRect;\n        }\n        return this._rect;\n    };\n    ZRText.prototype.setDefaultTextStyle = function (defaultTextStyle) {\n        this._defaultStyle = defaultTextStyle || DEFAULT_RICH_TEXT_COLOR;\n    };\n    ZRText.prototype.setTextContent = function (textContent) {\n        if (process.env.NODE_ENV !== 'production') {\n            throw new Error('Can\\'t attach text on another text');\n        }\n    };\n    ZRText.prototype._mergeStyle = function (targetStyle, sourceStyle) {\n        if (!sourceStyle) {\n            return targetStyle;\n        }\n        var sourceRich = sourceStyle.rich;\n        var targetRich = targetStyle.rich || (sourceRich && {});\n        extend(targetStyle, sourceStyle);\n        if (sourceRich && targetRich) {\n            this._mergeRich(targetRich, sourceRich);\n            targetStyle.rich = targetRich;\n        }\n        else if (targetRich) {\n            targetStyle.rich = targetRich;\n        }\n        return targetStyle;\n    };\n    ZRText.prototype._mergeRich = function (targetRich, sourceRich) {\n        var richNames = keys(sourceRich);\n        for (var i = 0; i < richNames.length; i++) {\n            var richName = richNames[i];\n            targetRich[richName] = targetRich[richName] || {};\n            extend(targetRich[richName], sourceRich[richName]);\n        }\n    };\n    ZRText.prototype.getAnimationStyleProps = function () {\n        return DEFAULT_TEXT_ANIMATION_PROPS;\n    };\n    ZRText.prototype._getOrCreateChild = function (Ctor) {\n        var child = this._children[this._childCursor];\n        if (!child || !(child instanceof Ctor)) {\n            child = new Ctor();\n        }\n        this._children[this._childCursor++] = child;\n        child.__zr = this.__zr;\n        child.parent = this;\n        return child;\n    };\n    ZRText.prototype._updatePlainTexts = function () {\n        var style = this.style;\n        var textFont = style.font || DEFAULT_FONT;\n        var textPadding = style.padding;\n        var defaultStyle = this._defaultStyle;\n        var baseX = style.x || 0;\n        var baseY = style.y || 0;\n        var textAlign = style.align || defaultStyle.align || 'left';\n        var verticalAlign = style.verticalAlign || defaultStyle.verticalAlign || 'top';\n        calcInnerTextOverflowArea(tmpCITOverflowAreaOut, defaultStyle.overflowRect, baseX, baseY, textAlign, verticalAlign);\n        baseX = tmpCITOverflowAreaOut.baseX;\n        baseY = tmpCITOverflowAreaOut.baseY;\n        var text = getStyleText(style);\n        var contentBlock = parsePlainText(text, style, tmpCITOverflowAreaOut.outerWidth, tmpCITOverflowAreaOut.outerHeight);\n        var needDrawBg = needDrawBackground(style);\n        var bgColorDrawn = !!(style.backgroundColor);\n        var outerHeight = contentBlock.outerHeight;\n        var outerWidth = contentBlock.outerWidth;\n        var textLines = contentBlock.lines;\n        var lineHeight = contentBlock.lineHeight;\n        this.isTruncated = !!contentBlock.isTruncated;\n        var textX = baseX;\n        var textY = adjustTextY(baseY, contentBlock.contentHeight, verticalAlign);\n        if (needDrawBg || textPadding) {\n            var boxX = adjustTextX(baseX, outerWidth, textAlign);\n            var boxY = adjustTextY(baseY, outerHeight, verticalAlign);\n            needDrawBg && this._renderBackground(style, style, boxX, boxY, outerWidth, outerHeight);\n        }\n        textY += lineHeight / 2;\n        if (textPadding) {\n            textX = getTextXForPadding(baseX, textAlign, textPadding);\n            if (verticalAlign === 'top') {\n                textY += textPadding[0];\n            }\n            else if (verticalAlign === 'bottom') {\n                textY -= textPadding[2];\n            }\n        }\n        var defaultLineWidth = 0;\n        var usingDefaultStroke = false;\n        var useDefaultFill = false;\n        var textFill = getFill('fill' in style\n            ? style.fill\n            : (useDefaultFill = true, defaultStyle.fill));\n        var textStroke = getStroke('stroke' in style\n            ? style.stroke\n            : (!bgColorDrawn\n                && (!defaultStyle.autoStroke || useDefaultFill))\n                ? (defaultLineWidth = DEFAULT_STROKE_LINE_WIDTH, usingDefaultStroke = true, defaultStyle.stroke)\n                : null);\n        var hasShadow = style.textShadowBlur > 0;\n        for (var i = 0; i < textLines.length; i++) {\n            var el = this._getOrCreateChild(TSpan);\n            var subElStyle = el.createStyle();\n            el.useStyle(subElStyle);\n            subElStyle.text = textLines[i];\n            subElStyle.x = textX;\n            subElStyle.y = textY;\n            if (textAlign) {\n                subElStyle.textAlign = textAlign;\n            }\n            subElStyle.textBaseline = 'middle';\n            subElStyle.opacity = style.opacity;\n            subElStyle.strokeFirst = true;\n            if (hasShadow) {\n                subElStyle.shadowBlur = style.textShadowBlur || 0;\n                subElStyle.shadowColor = style.textShadowColor || 'transparent';\n                subElStyle.shadowOffsetX = style.textShadowOffsetX || 0;\n                subElStyle.shadowOffsetY = style.textShadowOffsetY || 0;\n            }\n            subElStyle.stroke = textStroke;\n            subElStyle.fill = textFill;\n            if (textStroke) {\n                subElStyle.lineWidth = style.lineWidth || defaultLineWidth;\n                subElStyle.lineDash = style.lineDash;\n                subElStyle.lineDashOffset = style.lineDashOffset || 0;\n            }\n            subElStyle.font = textFont;\n            setSeparateFont(subElStyle, style);\n            textY += lineHeight;\n            el.setBoundingRect(tSpanCreateBoundingRect2(subElStyle, contentBlock.contentWidth, contentBlock.calculatedLineHeight, usingDefaultStroke ? 0 : null));\n        }\n    };\n    ZRText.prototype._updateRichTexts = function () {\n        var style = this.style;\n        var defaultStyle = this._defaultStyle;\n        var textAlign = style.align || defaultStyle.align;\n        var verticalAlign = style.verticalAlign || defaultStyle.verticalAlign;\n        var baseX = style.x || 0;\n        var baseY = style.y || 0;\n        calcInnerTextOverflowArea(tmpCITOverflowAreaOut, defaultStyle.overflowRect, baseX, baseY, textAlign, verticalAlign);\n        baseX = tmpCITOverflowAreaOut.baseX;\n        baseY = tmpCITOverflowAreaOut.baseY;\n        var text = getStyleText(style);\n        var contentBlock = parseRichText(text, style, tmpCITOverflowAreaOut.outerWidth, tmpCITOverflowAreaOut.outerHeight, textAlign);\n        var contentWidth = contentBlock.width;\n        var outerWidth = contentBlock.outerWidth;\n        var outerHeight = contentBlock.outerHeight;\n        var textPadding = style.padding;\n        this.isTruncated = !!contentBlock.isTruncated;\n        var boxX = adjustTextX(baseX, outerWidth, textAlign);\n        var boxY = adjustTextY(baseY, outerHeight, verticalAlign);\n        var xLeft = boxX;\n        var lineTop = boxY;\n        if (textPadding) {\n            xLeft += textPadding[3];\n            lineTop += textPadding[0];\n        }\n        var xRight = xLeft + contentWidth;\n        if (needDrawBackground(style)) {\n            this._renderBackground(style, style, boxX, boxY, outerWidth, outerHeight);\n        }\n        var bgColorDrawn = !!(style.backgroundColor);\n        for (var i = 0; i < contentBlock.lines.length; i++) {\n            var line = contentBlock.lines[i];\n            var tokens = line.tokens;\n            var tokenCount = tokens.length;\n            var lineHeight = line.lineHeight;\n            var remainedWidth = line.width;\n            var leftIndex = 0;\n            var lineXLeft = xLeft;\n            var lineXRight = xRight;\n            var rightIndex = tokenCount - 1;\n            var token = void 0;\n            while (leftIndex < tokenCount\n                && (token = tokens[leftIndex], !token.align || token.align === 'left')) {\n                this._placeToken(token, style, lineHeight, lineTop, lineXLeft, 'left', bgColorDrawn);\n                remainedWidth -= token.width;\n                lineXLeft += token.width;\n                leftIndex++;\n            }\n            while (rightIndex >= 0\n                && (token = tokens[rightIndex], token.align === 'right')) {\n                this._placeToken(token, style, lineHeight, lineTop, lineXRight, 'right', bgColorDrawn);\n                remainedWidth -= token.width;\n                lineXRight -= token.width;\n                rightIndex--;\n            }\n            lineXLeft += (contentWidth - (lineXLeft - xLeft) - (xRight - lineXRight) - remainedWidth) / 2;\n            while (leftIndex <= rightIndex) {\n                token = tokens[leftIndex];\n                this._placeToken(token, style, lineHeight, lineTop, lineXLeft + token.width / 2, 'center', bgColorDrawn);\n                lineXLeft += token.width;\n                leftIndex++;\n            }\n            lineTop += lineHeight;\n        }\n    };\n    ZRText.prototype._placeToken = function (token, style, lineHeight, lineTop, x, textAlign, parentBgColorDrawn) {\n        var tokenStyle = style.rich[token.styleName] || {};\n        tokenStyle.text = token.text;\n        var verticalAlign = token.verticalAlign;\n        var y = lineTop + lineHeight / 2;\n        if (verticalAlign === 'top') {\n            y = lineTop + token.height / 2;\n        }\n        else if (verticalAlign === 'bottom') {\n            y = lineTop + lineHeight - token.height / 2;\n        }\n        var needDrawBg = !token.isLineHolder && needDrawBackground(tokenStyle);\n        needDrawBg && this._renderBackground(tokenStyle, style, textAlign === 'right'\n            ? x - token.width\n            : textAlign === 'center'\n                ? x - token.width / 2\n                : x, y - token.height / 2, token.width, token.height);\n        var bgColorDrawn = !!tokenStyle.backgroundColor;\n        var textPadding = token.textPadding;\n        if (textPadding) {\n            x = getTextXForPadding(x, textAlign, textPadding);\n            y -= token.height / 2 - textPadding[0] - token.innerHeight / 2;\n        }\n        var el = this._getOrCreateChild(TSpan);\n        var subElStyle = el.createStyle();\n        el.useStyle(subElStyle);\n        var defaultStyle = this._defaultStyle;\n        var useDefaultFill = false;\n        var defaultLineWidth = 0;\n        var usingDefaultStroke = false;\n        var textFill = getFill('fill' in tokenStyle ? tokenStyle.fill\n            : 'fill' in style ? style.fill\n                : (useDefaultFill = true, defaultStyle.fill));\n        var textStroke = getStroke('stroke' in tokenStyle ? tokenStyle.stroke\n            : 'stroke' in style ? style.stroke\n                : (!bgColorDrawn\n                    && !parentBgColorDrawn\n                    && (!defaultStyle.autoStroke || useDefaultFill)) ? (defaultLineWidth = DEFAULT_STROKE_LINE_WIDTH, usingDefaultStroke = true, defaultStyle.stroke)\n                    : null);\n        var hasShadow = tokenStyle.textShadowBlur > 0\n            || style.textShadowBlur > 0;\n        subElStyle.text = token.text;\n        subElStyle.x = x;\n        subElStyle.y = y;\n        if (hasShadow) {\n            subElStyle.shadowBlur = tokenStyle.textShadowBlur || style.textShadowBlur || 0;\n            subElStyle.shadowColor = tokenStyle.textShadowColor || style.textShadowColor || 'transparent';\n            subElStyle.shadowOffsetX = tokenStyle.textShadowOffsetX || style.textShadowOffsetX || 0;\n            subElStyle.shadowOffsetY = tokenStyle.textShadowOffsetY || style.textShadowOffsetY || 0;\n        }\n        subElStyle.textAlign = textAlign;\n        subElStyle.textBaseline = 'middle';\n        subElStyle.font = token.font || DEFAULT_FONT;\n        subElStyle.opacity = retrieve3(tokenStyle.opacity, style.opacity, 1);\n        setSeparateFont(subElStyle, tokenStyle);\n        if (textStroke) {\n            subElStyle.lineWidth = retrieve3(tokenStyle.lineWidth, style.lineWidth, defaultLineWidth);\n            subElStyle.lineDash = retrieve2(tokenStyle.lineDash, style.lineDash);\n            subElStyle.lineDashOffset = style.lineDashOffset || 0;\n            subElStyle.stroke = textStroke;\n        }\n        if (textFill) {\n            subElStyle.fill = textFill;\n        }\n        el.setBoundingRect(tSpanCreateBoundingRect2(subElStyle, token.contentWidth, token.contentHeight, usingDefaultStroke ? 0 : null));\n    };\n    ZRText.prototype._renderBackground = function (style, topStyle, x, y, width, height) {\n        var textBackgroundColor = style.backgroundColor;\n        var textBorderWidth = style.borderWidth;\n        var textBorderColor = style.borderColor;\n        var isImageBg = textBackgroundColor && textBackgroundColor.image;\n        var isPlainOrGradientBg = textBackgroundColor && !isImageBg;\n        var textBorderRadius = style.borderRadius;\n        var self = this;\n        var rectEl;\n        var imgEl;\n        if (isPlainOrGradientBg || style.lineHeight || (textBorderWidth && textBorderColor)) {\n            rectEl = this._getOrCreateChild(Rect);\n            rectEl.useStyle(rectEl.createStyle());\n            rectEl.style.fill = null;\n            var rectShape = rectEl.shape;\n            rectShape.x = x;\n            rectShape.y = y;\n            rectShape.width = width;\n            rectShape.height = height;\n            rectShape.r = textBorderRadius;\n            rectEl.dirtyShape();\n        }\n        if (isPlainOrGradientBg) {\n            var rectStyle = rectEl.style;\n            rectStyle.fill = textBackgroundColor || null;\n            rectStyle.fillOpacity = retrieve2(style.fillOpacity, 1);\n        }\n        else if (isImageBg) {\n            imgEl = this._getOrCreateChild(ZRImage);\n            imgEl.onload = function () {\n                self.dirtyStyle();\n            };\n            var imgStyle = imgEl.style;\n            imgStyle.image = textBackgroundColor.image;\n            imgStyle.x = x;\n            imgStyle.y = y;\n            imgStyle.width = width;\n            imgStyle.height = height;\n        }\n        if (textBorderWidth && textBorderColor) {\n            var rectStyle = rectEl.style;\n            rectStyle.lineWidth = textBorderWidth;\n            rectStyle.stroke = textBorderColor;\n            rectStyle.strokeOpacity = retrieve2(style.strokeOpacity, 1);\n            rectStyle.lineDash = style.borderDash;\n            rectStyle.lineDashOffset = style.borderDashOffset || 0;\n            rectEl.strokeContainThreshold = 0;\n            if (rectEl.hasFill() && rectEl.hasStroke()) {\n                rectStyle.strokeFirst = true;\n                rectStyle.lineWidth *= 2;\n            }\n        }\n        var commonStyle = (rectEl || imgEl).style;\n        commonStyle.shadowBlur = style.shadowBlur || 0;\n        commonStyle.shadowColor = style.shadowColor || 'transparent';\n        commonStyle.shadowOffsetX = style.shadowOffsetX || 0;\n        commonStyle.shadowOffsetY = style.shadowOffsetY || 0;\n        commonStyle.opacity = retrieve3(style.opacity, topStyle.opacity, 1);\n    };\n    ZRText.makeFont = function (style) {\n        var font = '';\n        if (hasSeparateFont(style)) {\n            font = [\n                style.fontStyle,\n                style.fontWeight,\n                parseFontSize(style.fontSize),\n                style.fontFamily || 'sans-serif'\n            ].join(' ');\n        }\n        return font && trim(font) || style.textFont || style.font;\n    };\n    return ZRText;\n}(Displayable));\nvar VALID_TEXT_ALIGN = { left: true, right: 1, center: 1 };\nvar VALID_TEXT_VERTICAL_ALIGN = { top: 1, bottom: 1, middle: 1 };\nvar FONT_PARTS = ['fontStyle', 'fontWeight', 'fontSize', 'fontFamily'];\nexport function parseFontSize(fontSize) {\n    if (typeof fontSize === 'string'\n        && (fontSize.indexOf('px') !== -1\n            || fontSize.indexOf('rem') !== -1\n            || fontSize.indexOf('em') !== -1)) {\n        return fontSize;\n    }\n    else if (!isNaN(+fontSize)) {\n        return fontSize + 'px';\n    }\n    else {\n        return DEFAULT_FONT_SIZE + 'px';\n    }\n}\nfunction setSeparateFont(targetStyle, sourceStyle) {\n    for (var i = 0; i < FONT_PARTS.length; i++) {\n        var fontProp = FONT_PARTS[i];\n        var val = sourceStyle[fontProp];\n        if (val != null) {\n            targetStyle[fontProp] = val;\n        }\n    }\n}\nexport function hasSeparateFont(style) {\n    return style.fontSize != null || style.fontFamily || style.fontWeight;\n}\nexport function normalizeTextStyle(style) {\n    normalizeStyle(style);\n    each(style.rich, normalizeStyle);\n    return style;\n}\nfunction normalizeStyle(style) {\n    if (style) {\n        style.font = ZRText.makeFont(style);\n        var textAlign = style.align;\n        textAlign === 'middle' && (textAlign = 'center');\n        style.align = (textAlign == null || VALID_TEXT_ALIGN[textAlign]) ? textAlign : 'left';\n        var verticalAlign = style.verticalAlign;\n        verticalAlign === 'center' && (verticalAlign = 'middle');\n        style.verticalAlign = (verticalAlign == null || VALID_TEXT_VERTICAL_ALIGN[verticalAlign]) ? verticalAlign : 'top';\n        var textPadding = style.padding;\n        if (textPadding) {\n            style.padding = normalizeCssArray(style.padding);\n        }\n    }\n}\nfunction getStroke(stroke, lineWidth) {\n    return (stroke == null || lineWidth <= 0 || stroke === 'transparent' || stroke === 'none')\n        ? null\n        : (stroke.image || stroke.colorStops)\n            ? '#000'\n            : stroke;\n}\nfunction getFill(fill) {\n    return (fill == null || fill === 'none')\n        ? null\n        : (fill.image || fill.colorStops)\n            ? '#000'\n            : fill;\n}\nfunction getTextXForPadding(x, textAlign, textPadding) {\n    return textAlign === 'right'\n        ? (x - textPadding[1])\n        : textAlign === 'center'\n            ? (x + textPadding[3] / 2 - textPadding[1] / 2)\n            : (x + textPadding[3]);\n}\nfunction getStyleText(style) {\n    var text = style.text;\n    text != null && (text += '');\n    return text;\n}\nfunction needDrawBackground(style) {\n    return !!(style.backgroundColor\n        || style.lineHeight\n        || (style.borderWidth && style.borderColor));\n}\nexport default ZRText;\n", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { makeInner } from './model.js';\nexport var getECData = makeInner();\nexport var setCommonECData = function (seriesIndex, dataType, dataIdx, el) {\n  if (el) {\n    var ecData = getECData(el);\n    // Add data index and series index for indexing the data by element\n    // Useful in tooltip\n    ecData.dataIndex = dataIdx;\n    ecData.dataType = dataType;\n    ecData.seriesIndex = seriesIndex;\n    ecData.ssrType = 'chart';\n    // TODO: not store dataIndex on children.\n    if (el.type === 'group') {\n      el.traverse(function (child) {\n        var childECData = getECData(child);\n        childECData.seriesIndex = seriesIndex;\n        childECData.dataIndex = dataIdx;\n        childECData.dataType = dataType;\n        childECData.ssrType = 'chart';\n      });\n    }\n  }\n};", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { extend, indexOf, isArrayLike, isObject, keys, isArray, each } from 'zrender/lib/core/util.js';\nimport { getECData } from './innerStore.js';\nimport { liftColor } from 'zrender/lib/tool/color.js';\nimport { queryDataIndex, makeInner } from './model.js';\nimport Path from 'zrender/lib/graphic/Path.js';\nimport { error } from './log.js';\n// Reserve 0 as default.\nvar _highlightNextDigit = 1;\nvar _highlightKeyMap = {};\nvar getSavedStates = makeInner();\nvar getComponentStates = makeInner();\nexport var HOVER_STATE_NORMAL = 0;\nexport var HOVER_STATE_BLUR = 1;\nexport var HOVER_STATE_EMPHASIS = 2;\nexport var SPECIAL_STATES = ['emphasis', 'blur', 'select'];\nexport var DISPLAY_STATES = ['normal', 'emphasis', 'blur', 'select'];\nexport var Z2_EMPHASIS_LIFT = 10;\nexport var Z2_SELECT_LIFT = 9;\nexport var HIGHLIGHT_ACTION_TYPE = 'highlight';\nexport var DOWNPLAY_ACTION_TYPE = 'downplay';\nexport var SELECT_ACTION_TYPE = 'select';\nexport var UNSELECT_ACTION_TYPE = 'unselect';\nexport var TOGGLE_SELECT_ACTION_TYPE = 'toggleSelect';\nexport var SELECT_CHANGED_EVENT_TYPE = 'selectchanged';\nfunction hasFillOrStroke(fillOrStroke) {\n  return fillOrStroke != null && fillOrStroke !== 'none';\n}\nfunction doChangeHoverState(el, stateName, hoverStateEnum) {\n  if (el.onHoverStateChange && (el.hoverState || 0) !== hoverStateEnum) {\n    el.onHoverStateChange(stateName);\n  }\n  el.hoverState = hoverStateEnum;\n}\nfunction singleEnterEmphasis(el) {\n  // Only mark the flag.\n  // States will be applied in the echarts.ts in next frame.\n  doChangeHoverState(el, 'emphasis', HOVER_STATE_EMPHASIS);\n}\nfunction singleLeaveEmphasis(el) {\n  // Only mark the flag.\n  // States will be applied in the echarts.ts in next frame.\n  if (el.hoverState === HOVER_STATE_EMPHASIS) {\n    doChangeHoverState(el, 'normal', HOVER_STATE_NORMAL);\n  }\n}\nfunction singleEnterBlur(el) {\n  doChangeHoverState(el, 'blur', HOVER_STATE_BLUR);\n}\nfunction singleLeaveBlur(el) {\n  if (el.hoverState === HOVER_STATE_BLUR) {\n    doChangeHoverState(el, 'normal', HOVER_STATE_NORMAL);\n  }\n}\nfunction singleEnterSelect(el) {\n  el.selected = true;\n}\nfunction singleLeaveSelect(el) {\n  el.selected = false;\n}\nfunction updateElementState(el, updater, commonParam) {\n  updater(el, commonParam);\n}\nfunction traverseUpdateState(el, updater, commonParam) {\n  updateElementState(el, updater, commonParam);\n  el.isGroup && el.traverse(function (child) {\n    updateElementState(child, updater, commonParam);\n  });\n}\nexport function setStatesFlag(el, stateName) {\n  switch (stateName) {\n    case 'emphasis':\n      el.hoverState = HOVER_STATE_EMPHASIS;\n      break;\n    case 'normal':\n      el.hoverState = HOVER_STATE_NORMAL;\n      break;\n    case 'blur':\n      el.hoverState = HOVER_STATE_BLUR;\n      break;\n    case 'select':\n      el.selected = true;\n  }\n}\n/**\n * If we reuse elements when rerender.\n * DON'T forget to clearStates before we update the style and shape.\n * Or we may update on the wrong state instead of normal state.\n */\nexport function clearStates(el) {\n  if (el.isGroup) {\n    el.traverse(function (child) {\n      child.clearStates();\n    });\n  } else {\n    el.clearStates();\n  }\n}\nfunction getFromStateStyle(el, props, toStateName, defaultValue) {\n  var style = el.style;\n  var fromState = {};\n  for (var i = 0; i < props.length; i++) {\n    var propName = props[i];\n    var val = style[propName];\n    fromState[propName] = val == null ? defaultValue && defaultValue[propName] : val;\n  }\n  for (var i = 0; i < el.animators.length; i++) {\n    var animator = el.animators[i];\n    if (animator.__fromStateTransition\n    // Don't consider the animation to emphasis state.\n    && animator.__fromStateTransition.indexOf(toStateName) < 0 && animator.targetName === 'style') {\n      animator.saveTo(fromState, props);\n    }\n  }\n  return fromState;\n}\nfunction createEmphasisDefaultState(el, stateName, targetStates, state) {\n  var hasSelect = targetStates && indexOf(targetStates, 'select') >= 0;\n  var cloned = false;\n  if (el instanceof Path) {\n    var store = getSavedStates(el);\n    var fromFill = hasSelect ? store.selectFill || store.normalFill : store.normalFill;\n    var fromStroke = hasSelect ? store.selectStroke || store.normalStroke : store.normalStroke;\n    if (hasFillOrStroke(fromFill) || hasFillOrStroke(fromStroke)) {\n      state = state || {};\n      var emphasisStyle = state.style || {};\n      // inherit case\n      if (emphasisStyle.fill === 'inherit') {\n        cloned = true;\n        state = extend({}, state);\n        emphasisStyle = extend({}, emphasisStyle);\n        emphasisStyle.fill = fromFill;\n      }\n      // Apply default color lift\n      else if (!hasFillOrStroke(emphasisStyle.fill) && hasFillOrStroke(fromFill)) {\n        cloned = true;\n        // Not modify the original value.\n        state = extend({}, state);\n        emphasisStyle = extend({}, emphasisStyle);\n        // Already being applied 'emphasis'. DON'T lift color multiple times.\n        emphasisStyle.fill = liftColor(fromFill);\n      }\n      // Not highlight stroke if fill has been highlighted.\n      else if (!hasFillOrStroke(emphasisStyle.stroke) && hasFillOrStroke(fromStroke)) {\n        if (!cloned) {\n          state = extend({}, state);\n          emphasisStyle = extend({}, emphasisStyle);\n        }\n        emphasisStyle.stroke = liftColor(fromStroke);\n      }\n      state.style = emphasisStyle;\n    }\n  }\n  if (state) {\n    // TODO Share with textContent?\n    if (state.z2 == null) {\n      if (!cloned) {\n        state = extend({}, state);\n      }\n      var z2EmphasisLift = el.z2EmphasisLift;\n      state.z2 = el.z2 + (z2EmphasisLift != null ? z2EmphasisLift : Z2_EMPHASIS_LIFT);\n    }\n  }\n  return state;\n}\nfunction createSelectDefaultState(el, stateName, state) {\n  // const hasSelect = indexOf(el.currentStates, stateName) >= 0;\n  if (state) {\n    // TODO Share with textContent?\n    if (state.z2 == null) {\n      state = extend({}, state);\n      var z2SelectLift = el.z2SelectLift;\n      state.z2 = el.z2 + (z2SelectLift != null ? z2SelectLift : Z2_SELECT_LIFT);\n    }\n  }\n  return state;\n}\nfunction createBlurDefaultState(el, stateName, state) {\n  var hasBlur = indexOf(el.currentStates, stateName) >= 0;\n  var currentOpacity = el.style.opacity;\n  var fromState = !hasBlur ? getFromStateStyle(el, ['opacity'], stateName, {\n    opacity: 1\n  }) : null;\n  state = state || {};\n  var blurStyle = state.style || {};\n  if (blurStyle.opacity == null) {\n    // clone state\n    state = extend({}, state);\n    blurStyle = extend({\n      // Already being applied 'emphasis'. DON'T mul opacity multiple times.\n      opacity: hasBlur ? currentOpacity : fromState.opacity * 0.1\n    }, blurStyle);\n    state.style = blurStyle;\n  }\n  return state;\n}\nfunction elementStateProxy(stateName, targetStates) {\n  var state = this.states[stateName];\n  if (this.style) {\n    if (stateName === 'emphasis') {\n      return createEmphasisDefaultState(this, stateName, targetStates, state);\n    } else if (stateName === 'blur') {\n      return createBlurDefaultState(this, stateName, state);\n    } else if (stateName === 'select') {\n      return createSelectDefaultState(this, stateName, state);\n    }\n  }\n  return state;\n}\n/**\n * Set hover style (namely \"emphasis style\") of element.\n * @param el Should not be `zrender/graphic/Group`.\n * @param focus 'self' | 'selfInSeries' | 'series'\n */\nexport function setDefaultStateProxy(el) {\n  el.stateProxy = elementStateProxy;\n  var textContent = el.getTextContent();\n  var textGuide = el.getTextGuideLine();\n  if (textContent) {\n    textContent.stateProxy = elementStateProxy;\n  }\n  if (textGuide) {\n    textGuide.stateProxy = elementStateProxy;\n  }\n}\nexport function enterEmphasisWhenMouseOver(el, e) {\n  !shouldSilent(el, e)\n  // \"emphasis\" event highlight has higher priority than mouse highlight.\n  && !el.__highByOuter && traverseUpdateState(el, singleEnterEmphasis);\n}\nexport function leaveEmphasisWhenMouseOut(el, e) {\n  !shouldSilent(el, e)\n  // \"emphasis\" event highlight has higher priority than mouse highlight.\n  && !el.__highByOuter && traverseUpdateState(el, singleLeaveEmphasis);\n}\nexport function enterEmphasis(el, highlightDigit) {\n  el.__highByOuter |= 1 << (highlightDigit || 0);\n  traverseUpdateState(el, singleEnterEmphasis);\n}\nexport function leaveEmphasis(el, highlightDigit) {\n  !(el.__highByOuter &= ~(1 << (highlightDigit || 0))) && traverseUpdateState(el, singleLeaveEmphasis);\n}\nexport function enterBlur(el) {\n  traverseUpdateState(el, singleEnterBlur);\n}\nexport function leaveBlur(el) {\n  traverseUpdateState(el, singleLeaveBlur);\n}\nexport function enterSelect(el) {\n  traverseUpdateState(el, singleEnterSelect);\n}\nexport function leaveSelect(el) {\n  traverseUpdateState(el, singleLeaveSelect);\n}\nfunction shouldSilent(el, e) {\n  return el.__highDownSilentOnTouch && e.zrByTouch;\n}\nexport function allLeaveBlur(api) {\n  var model = api.getModel();\n  var leaveBlurredSeries = [];\n  var allComponentViews = [];\n  model.eachComponent(function (componentType, componentModel) {\n    var componentStates = getComponentStates(componentModel);\n    var isSeries = componentType === 'series';\n    var view = isSeries ? api.getViewOfSeriesModel(componentModel) : api.getViewOfComponentModel(componentModel);\n    !isSeries && allComponentViews.push(view);\n    if (componentStates.isBlured) {\n      // Leave blur anyway\n      view.group.traverse(function (child) {\n        singleLeaveBlur(child);\n      });\n      isSeries && leaveBlurredSeries.push(componentModel);\n    }\n    componentStates.isBlured = false;\n  });\n  each(allComponentViews, function (view) {\n    if (view && view.toggleBlurSeries) {\n      view.toggleBlurSeries(leaveBlurredSeries, false, model);\n    }\n  });\n}\nexport function blurSeries(targetSeriesIndex, focus, blurScope, api) {\n  var ecModel = api.getModel();\n  blurScope = blurScope || 'coordinateSystem';\n  function leaveBlurOfIndices(data, dataIndices) {\n    for (var i = 0; i < dataIndices.length; i++) {\n      var itemEl = data.getItemGraphicEl(dataIndices[i]);\n      itemEl && leaveBlur(itemEl);\n    }\n  }\n  if (targetSeriesIndex == null) {\n    return;\n  }\n  if (!focus || focus === 'none') {\n    return;\n  }\n  var targetSeriesModel = ecModel.getSeriesByIndex(targetSeriesIndex);\n  var targetCoordSys = targetSeriesModel.coordinateSystem;\n  if (targetCoordSys && targetCoordSys.master) {\n    targetCoordSys = targetCoordSys.master;\n  }\n  var blurredSeries = [];\n  ecModel.eachSeries(function (seriesModel) {\n    var sameSeries = targetSeriesModel === seriesModel;\n    var coordSys = seriesModel.coordinateSystem;\n    if (coordSys && coordSys.master) {\n      coordSys = coordSys.master;\n    }\n    var sameCoordSys = coordSys && targetCoordSys ? coordSys === targetCoordSys : sameSeries; // If there is no coordinate system. use sameSeries instead.\n    if (!(\n    // Not blur other series if blurScope series\n    blurScope === 'series' && !sameSeries\n    // Not blur other coordinate system if blurScope is coordinateSystem\n    || blurScope === 'coordinateSystem' && !sameCoordSys\n    // Not blur self series if focus is series.\n    || focus === 'series' && sameSeries\n    // TODO blurScope: coordinate system\n    )) {\n      var view = api.getViewOfSeriesModel(seriesModel);\n      view.group.traverse(function (child) {\n        // For the elements that have been triggered by other components,\n        // and are still required to be highlighted,\n        // because the current is directly forced to blur the element,\n        // it will cause the focus self to be unable to highlight, so skip the blur of this element.\n        if (child.__highByOuter && sameSeries && focus === 'self') {\n          return;\n        }\n        singleEnterBlur(child);\n      });\n      if (isArrayLike(focus)) {\n        leaveBlurOfIndices(seriesModel.getData(), focus);\n      } else if (isObject(focus)) {\n        var dataTypes = keys(focus);\n        for (var d = 0; d < dataTypes.length; d++) {\n          leaveBlurOfIndices(seriesModel.getData(dataTypes[d]), focus[dataTypes[d]]);\n        }\n      }\n      blurredSeries.push(seriesModel);\n      getComponentStates(seriesModel).isBlured = true;\n    }\n  });\n  ecModel.eachComponent(function (componentType, componentModel) {\n    if (componentType === 'series') {\n      return;\n    }\n    var view = api.getViewOfComponentModel(componentModel);\n    if (view && view.toggleBlurSeries) {\n      view.toggleBlurSeries(blurredSeries, true, ecModel);\n    }\n  });\n}\nexport function blurComponent(componentMainType, componentIndex, api) {\n  if (componentMainType == null || componentIndex == null) {\n    return;\n  }\n  var componentModel = api.getModel().getComponent(componentMainType, componentIndex);\n  if (!componentModel) {\n    return;\n  }\n  getComponentStates(componentModel).isBlured = true;\n  var view = api.getViewOfComponentModel(componentModel);\n  if (!view || !view.focusBlurEnabled) {\n    return;\n  }\n  view.group.traverse(function (child) {\n    singleEnterBlur(child);\n  });\n}\nexport function blurSeriesFromHighlightPayload(seriesModel, payload, api) {\n  var seriesIndex = seriesModel.seriesIndex;\n  var data = seriesModel.getData(payload.dataType);\n  if (!data) {\n    if (process.env.NODE_ENV !== 'production') {\n      error(\"Unknown dataType \" + payload.dataType);\n    }\n    return;\n  }\n  var dataIndex = queryDataIndex(data, payload);\n  // Pick the first one if there is multiple/none exists.\n  dataIndex = (isArray(dataIndex) ? dataIndex[0] : dataIndex) || 0;\n  var el = data.getItemGraphicEl(dataIndex);\n  if (!el) {\n    var count = data.count();\n    var current = 0;\n    // If data on dataIndex is NaN.\n    while (!el && current < count) {\n      el = data.getItemGraphicEl(current++);\n    }\n  }\n  if (el) {\n    var ecData = getECData(el);\n    blurSeries(seriesIndex, ecData.focus, ecData.blurScope, api);\n  } else {\n    // If there is no element put on the data. Try getting it from raw option\n    // TODO Should put it on seriesModel?\n    var focus_1 = seriesModel.get(['emphasis', 'focus']);\n    var blurScope = seriesModel.get(['emphasis', 'blurScope']);\n    if (focus_1 != null) {\n      blurSeries(seriesIndex, focus_1, blurScope, api);\n    }\n  }\n}\nexport function findComponentHighDownDispatchers(componentMainType, componentIndex, name, api) {\n  var ret = {\n    focusSelf: false,\n    dispatchers: null\n  };\n  if (componentMainType == null || componentMainType === 'series' || componentIndex == null || name == null) {\n    return ret;\n  }\n  var componentModel = api.getModel().getComponent(componentMainType, componentIndex);\n  if (!componentModel) {\n    return ret;\n  }\n  var view = api.getViewOfComponentModel(componentModel);\n  if (!view || !view.findHighDownDispatchers) {\n    return ret;\n  }\n  var dispatchers = view.findHighDownDispatchers(name);\n  // At presnet, the component (like Geo) only blur inside itself.\n  // So we do not use `blurScope` in component.\n  var focusSelf;\n  for (var i = 0; i < dispatchers.length; i++) {\n    if (process.env.NODE_ENV !== 'production' && !isHighDownDispatcher(dispatchers[i])) {\n      error('param should be highDownDispatcher');\n    }\n    if (getECData(dispatchers[i]).focus === 'self') {\n      focusSelf = true;\n      break;\n    }\n  }\n  return {\n    focusSelf: focusSelf,\n    dispatchers: dispatchers\n  };\n}\nexport function handleGlobalMouseOverForHighDown(dispatcher, e, api) {\n  if (process.env.NODE_ENV !== 'production' && !isHighDownDispatcher(dispatcher)) {\n    error('param should be highDownDispatcher');\n  }\n  var ecData = getECData(dispatcher);\n  var _a = findComponentHighDownDispatchers(ecData.componentMainType, ecData.componentIndex, ecData.componentHighDownName, api),\n    dispatchers = _a.dispatchers,\n    focusSelf = _a.focusSelf;\n  // If `findHighDownDispatchers` is supported on the component,\n  // highlight/downplay elements with the same name.\n  if (dispatchers) {\n    if (focusSelf) {\n      blurComponent(ecData.componentMainType, ecData.componentIndex, api);\n    }\n    each(dispatchers, function (dispatcher) {\n      return enterEmphasisWhenMouseOver(dispatcher, e);\n    });\n  } else {\n    // Try blur all in the related series. Then emphasis the hoverred.\n    // TODO. progressive mode.\n    blurSeries(ecData.seriesIndex, ecData.focus, ecData.blurScope, api);\n    if (ecData.focus === 'self') {\n      blurComponent(ecData.componentMainType, ecData.componentIndex, api);\n    }\n    // Other than series, component that not support `findHighDownDispatcher` will\n    // also use it. But in this case, highlight/downplay are only supported in\n    // mouse hover but not in dispatchAction.\n    enterEmphasisWhenMouseOver(dispatcher, e);\n  }\n}\nexport function handleGlobalMouseOutForHighDown(dispatcher, e, api) {\n  if (process.env.NODE_ENV !== 'production' && !isHighDownDispatcher(dispatcher)) {\n    error('param should be highDownDispatcher');\n  }\n  allLeaveBlur(api);\n  var ecData = getECData(dispatcher);\n  var dispatchers = findComponentHighDownDispatchers(ecData.componentMainType, ecData.componentIndex, ecData.componentHighDownName, api).dispatchers;\n  if (dispatchers) {\n    each(dispatchers, function (dispatcher) {\n      return leaveEmphasisWhenMouseOut(dispatcher, e);\n    });\n  } else {\n    leaveEmphasisWhenMouseOut(dispatcher, e);\n  }\n}\nexport function toggleSelectionFromPayload(seriesModel, payload, api) {\n  if (!isSelectChangePayload(payload)) {\n    return;\n  }\n  var dataType = payload.dataType;\n  var data = seriesModel.getData(dataType);\n  var dataIndex = queryDataIndex(data, payload);\n  if (!isArray(dataIndex)) {\n    dataIndex = [dataIndex];\n  }\n  seriesModel[payload.type === TOGGLE_SELECT_ACTION_TYPE ? 'toggleSelect' : payload.type === SELECT_ACTION_TYPE ? 'select' : 'unselect'](dataIndex, dataType);\n}\nexport function updateSeriesElementSelection(seriesModel) {\n  var allData = seriesModel.getAllData();\n  each(allData, function (_a) {\n    var data = _a.data,\n      type = _a.type;\n    data.eachItemGraphicEl(function (el, idx) {\n      seriesModel.isSelected(idx, type) ? enterSelect(el) : leaveSelect(el);\n    });\n  });\n}\nexport function getAllSelectedIndices(ecModel) {\n  var ret = [];\n  ecModel.eachSeries(function (seriesModel) {\n    var allData = seriesModel.getAllData();\n    each(allData, function (_a) {\n      var data = _a.data,\n        type = _a.type;\n      var dataIndices = seriesModel.getSelectedDataIndices();\n      if (dataIndices.length > 0) {\n        var item = {\n          dataIndex: dataIndices,\n          seriesIndex: seriesModel.seriesIndex\n        };\n        if (type != null) {\n          item.dataType = type;\n        }\n        ret.push(item);\n      }\n    });\n  });\n  return ret;\n}\n/**\n * Enable the function that mouseover will trigger the emphasis state.\n *\n * NOTE:\n * This function should be used on the element with dataIndex, seriesIndex.\n *\n */\nexport function enableHoverEmphasis(el, focus, blurScope) {\n  setAsHighDownDispatcher(el, true);\n  traverseUpdateState(el, setDefaultStateProxy);\n  enableHoverFocus(el, focus, blurScope);\n}\nexport function disableHoverEmphasis(el) {\n  setAsHighDownDispatcher(el, false);\n}\nexport function toggleHoverEmphasis(el, focus, blurScope, isDisabled) {\n  isDisabled ? disableHoverEmphasis(el) : enableHoverEmphasis(el, focus, blurScope);\n}\nexport function enableHoverFocus(el, focus, blurScope) {\n  var ecData = getECData(el);\n  if (focus != null) {\n    // TODO dataIndex may be set after this function. This check is not useful.\n    // if (ecData.dataIndex == null) {\n    //     if (__DEV__) {\n    //         console.warn('focus can only been set on element with dataIndex');\n    //     }\n    // }\n    // else {\n    ecData.focus = focus;\n    ecData.blurScope = blurScope;\n    // }\n  } else if (ecData.focus) {\n    ecData.focus = null;\n  }\n}\nvar OTHER_STATES = ['emphasis', 'blur', 'select'];\nvar defaultStyleGetterMap = {\n  itemStyle: 'getItemStyle',\n  lineStyle: 'getLineStyle',\n  areaStyle: 'getAreaStyle'\n};\n/**\n * Set emphasis/blur/selected states of element.\n */\nexport function setStatesStylesFromModel(el, itemModel, styleType,\n// default itemStyle\ngetter) {\n  styleType = styleType || 'itemStyle';\n  for (var i = 0; i < OTHER_STATES.length; i++) {\n    var stateName = OTHER_STATES[i];\n    var model = itemModel.getModel([stateName, styleType]);\n    var state = el.ensureState(stateName);\n    // Let it throw error if getterType is not found.\n    state.style = getter ? getter(model) : model[defaultStyleGetterMap[styleType]]();\n  }\n}\n/**\n *\n * Set element as highlight / downplay dispatcher.\n * It will be checked when element received mouseover event or from highlight action.\n * It's in change of all highlight/downplay behavior of it's children.\n *\n * @param el\n * @param el.highDownSilentOnTouch\n *        In touch device, mouseover event will be trigger on touchstart event\n *        (see module:zrender/dom/HandlerProxy). By this mechanism, we can\n *        conveniently use hoverStyle when tap on touch screen without additional\n *        code for compatibility.\n *        But if the chart/component has select feature, which usually also use\n *        hoverStyle, there might be conflict between 'select-highlight' and\n *        'hover-highlight' especially when roam is enabled (see geo for example).\n *        In this case, `highDownSilentOnTouch` should be used to disable\n *        hover-highlight on touch device.\n * @param asDispatcher If `false`, do not set as \"highDownDispatcher\".\n */\nexport function setAsHighDownDispatcher(el, asDispatcher) {\n  var disable = asDispatcher === false;\n  var extendedEl = el;\n  // Make `highDownSilentOnTouch` and `onStateChange` only work after\n  // `setAsHighDownDispatcher` called. Avoid it is modified by user unexpectedly.\n  if (el.highDownSilentOnTouch) {\n    extendedEl.__highDownSilentOnTouch = el.highDownSilentOnTouch;\n  }\n  // Simple optimize, since this method might be\n  // called for each elements of a group in some cases.\n  if (!disable || extendedEl.__highDownDispatcher) {\n    // Emphasis, normal can be triggered manually by API or other components like hover link.\n    // el[method]('emphasis', onElementEmphasisEvent)[method]('normal', onElementNormalEvent);\n    // Also keep previous record.\n    extendedEl.__highByOuter = extendedEl.__highByOuter || 0;\n    extendedEl.__highDownDispatcher = !disable;\n  }\n}\nexport function isHighDownDispatcher(el) {\n  return !!(el && el.__highDownDispatcher);\n}\n/**\n * Enable component highlight/downplay features:\n * + hover link (within the same name)\n * + focus blur in component\n */\nexport function enableComponentHighDownFeatures(el, componentModel, componentHighDownName) {\n  var ecData = getECData(el);\n  ecData.componentMainType = componentModel.mainType;\n  ecData.componentIndex = componentModel.componentIndex;\n  ecData.componentHighDownName = componentHighDownName;\n}\n/**\n * Support highlight/downplay record on each elements.\n * For the case: hover highlight/downplay (legend, visualMap, ...) and\n * user triggered highlight/downplay should not conflict.\n * Only all of the highlightDigit cleared, return to normal.\n * @param {string} highlightKey\n * @return {number} highlightDigit\n */\nexport function getHighlightDigit(highlightKey) {\n  var highlightDigit = _highlightKeyMap[highlightKey];\n  if (highlightDigit == null && _highlightNextDigit <= 32) {\n    highlightDigit = _highlightKeyMap[highlightKey] = _highlightNextDigit++;\n  }\n  return highlightDigit;\n}\nexport function isSelectChangePayload(payload) {\n  var payloadType = payload.type;\n  return payloadType === SELECT_ACTION_TYPE || payloadType === UNSELECT_ACTION_TYPE || payloadType === TOGGLE_SELECT_ACTION_TYPE;\n}\nexport function isHighDownPayload(payload) {\n  var payloadType = payload.type;\n  return payloadType === HIGHLIGHT_ACTION_TYPE || payloadType === DOWNPLAY_ACTION_TYPE;\n}\nexport function savePathStates(el) {\n  var store = getSavedStates(el);\n  store.normalFill = el.style.fill;\n  store.normalStroke = el.style.stroke;\n  var selectState = el.states.select || {};\n  store.selectFill = selectState.style && selectState.style.fill || null;\n  store.selectStroke = selectState.style && selectState.style.stroke || null;\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as pathTool from 'zrender/lib/tool/path.js';\nimport * as matrix from 'zrender/lib/core/matrix.js';\nimport * as vector from 'zrender/lib/core/vector.js';\nimport Path from 'zrender/lib/graphic/Path.js';\nimport Transformable from 'zrender/lib/core/Transformable.js';\nimport ZRImage from 'zrender/lib/graphic/Image.js';\nimport Group from 'zrender/lib/graphic/Group.js';\nimport ZRText from 'zrender/lib/graphic/Text.js';\nimport Circle from 'zrender/lib/graphic/shape/Circle.js';\nimport Ellipse from 'zrender/lib/graphic/shape/Ellipse.js';\nimport Sector from 'zrender/lib/graphic/shape/Sector.js';\nimport Ring from 'zrender/lib/graphic/shape/Ring.js';\nimport Polygon from 'zrender/lib/graphic/shape/Polygon.js';\nimport Polyline from 'zrender/lib/graphic/shape/Polyline.js';\nimport Rect from 'zrender/lib/graphic/shape/Rect.js';\nimport Line from 'zrender/lib/graphic/shape/Line.js';\nimport BezierCurve from 'zrender/lib/graphic/shape/BezierCurve.js';\nimport Arc from 'zrender/lib/graphic/shape/Arc.js';\nimport CompoundPath from 'zrender/lib/graphic/CompoundPath.js';\nimport LinearGradient from 'zrender/lib/graphic/LinearGradient.js';\nimport RadialGradient from 'zrender/lib/graphic/RadialGradient.js';\nimport BoundingRect from 'zrender/lib/core/BoundingRect.js';\nimport OrientedBoundingRect from 'zrender/lib/core/OrientedBoundingRect.js';\nimport Point from 'zrender/lib/core/Point.js';\nimport IncrementalDisplayable from 'zrender/lib/graphic/IncrementalDisplayable.js';\nimport * as subPixelOptimizeUtil from 'zrender/lib/graphic/helper/subPixelOptimize.js';\nimport { extend, isArrayLike, map, defaults, isString, keys, each, hasOwn, isArray, isNumber, clone, assert } from 'zrender/lib/core/util.js';\nimport { getECData } from './innerStore.js';\nimport { updateProps, initProps, removeElement, removeElementWithFadeOut, isElementRemoved } from '../animation/basicTransition.js';\nimport { mathMin, mathMax, mathAbs } from './number.js';\n/**\n * @deprecated export for compatitable reason\n */\nexport { updateProps, initProps, removeElement, removeElementWithFadeOut, isElementRemoved };\nvar _customShapeMap = {};\nexport var XY = ['x', 'y'];\nexport var WH = ['width', 'height'];\n/**\n * Extend shape with parameters\n */\nexport function extendShape(opts) {\n  return Path.extend(opts);\n}\nvar extendPathFromString = pathTool.extendFromString;\n/**\n * Extend path\n */\nexport function extendPath(pathData, opts) {\n  return extendPathFromString(pathData, opts);\n}\n/**\n * Register a user defined shape.\n * The shape class can be fetched by `getShapeClass`\n * This method will overwrite the registered shapes, including\n * the registered built-in shapes, if using the same `name`.\n * The shape can be used in `custom series` and\n * `graphic component` by declaring `{type: name}`.\n *\n * @param name\n * @param ShapeClass Can be generated by `extendShape`.\n */\nexport function registerShape(name, ShapeClass) {\n  _customShapeMap[name] = ShapeClass;\n}\n/**\n * Find shape class registered by `registerShape`. Usually used in\n * fetching user defined shape.\n *\n * [Caution]:\n * (1) This method **MUST NOT be used inside echarts !!!**, unless it is prepared\n * to use user registered shapes.\n * Because the built-in shape (see `getBuiltInShape`) will be registered by\n * `registerShape` by default. That enables users to get both built-in\n * shapes as well as the shapes belonging to themsleves. But users can overwrite\n * the built-in shapes by using names like 'circle', 'rect' via calling\n * `registerShape`. So the echarts inner featrues should not fetch shapes from here\n * in case that it is overwritten by users, except that some features, like\n * `custom series`, `graphic component`, do it deliberately.\n *\n * (2) In the features like `custom series`, `graphic component`, the user input\n * `{tpye: 'xxx'}` does not only specify shapes but also specify other graphic\n * elements like `'group'`, `'text'`, `'image'` or event `'path'`. Those names\n * are reserved names, that is, if some user registers a shape named `'image'`,\n * the shape will not be used. If we intending to add some more reserved names\n * in feature, that might bring break changes (disable some existing user shape\n * names). But that case probably rarely happens. So we don't make more mechanism\n * to resolve this issue here.\n *\n * @param name\n * @return The shape class. If not found, return nothing.\n */\nexport function getShapeClass(name) {\n  if (_customShapeMap.hasOwnProperty(name)) {\n    return _customShapeMap[name];\n  }\n}\n/**\n * Create a path element from path data string\n * @param pathData\n * @param opts\n * @param rect\n * @param layout 'center' or 'cover' default to be cover\n */\nexport function makePath(pathData, opts, rect, layout) {\n  var path = pathTool.createFromString(pathData, opts);\n  if (rect) {\n    if (layout === 'center') {\n      rect = centerGraphic(rect, path.getBoundingRect());\n    }\n    resizePath(path, rect);\n  }\n  return path;\n}\n/**\n * Create a image element from image url\n * @param imageUrl image url\n * @param opts options\n * @param rect constrain rect\n * @param layout 'center' or 'cover'. Default to be 'cover'\n */\nexport function makeImage(imageUrl, rect, layout) {\n  var zrImg = new ZRImage({\n    style: {\n      image: imageUrl,\n      x: rect.x,\n      y: rect.y,\n      width: rect.width,\n      height: rect.height\n    },\n    onload: function (img) {\n      if (layout === 'center') {\n        var boundingRect = {\n          width: img.width,\n          height: img.height\n        };\n        zrImg.setStyle(centerGraphic(rect, boundingRect));\n      }\n    }\n  });\n  return zrImg;\n}\n/**\n * Get position of centered element in bounding box.\n *\n * @param  rect         element local bounding box\n * @param  boundingRect constraint bounding box\n * @return element position containing x, y, width, and height\n */\nfunction centerGraphic(rect, boundingRect) {\n  // Set rect to center, keep width / height ratio.\n  var aspect = boundingRect.width / boundingRect.height;\n  var width = rect.height * aspect;\n  var height;\n  if (width <= rect.width) {\n    height = rect.height;\n  } else {\n    width = rect.width;\n    height = width / aspect;\n  }\n  var cx = rect.x + rect.width / 2;\n  var cy = rect.y + rect.height / 2;\n  return {\n    x: cx - width / 2,\n    y: cy - height / 2,\n    width: width,\n    height: height\n  };\n}\nexport var mergePath = pathTool.mergePath;\n/**\n * Resize a path to fit the rect\n * @param path\n * @param rect\n */\nexport function resizePath(path, rect) {\n  if (!path.applyTransform) {\n    return;\n  }\n  var pathRect = path.getBoundingRect();\n  var m = pathRect.calculateTransform(rect);\n  path.applyTransform(m);\n}\n/**\n * Sub pixel optimize line for canvas\n */\nexport function subPixelOptimizeLine(shape, lineWidth) {\n  subPixelOptimizeUtil.subPixelOptimizeLine(shape, shape, {\n    lineWidth: lineWidth\n  });\n  return shape;\n}\n/**\n * Sub pixel optimize rect for canvas\n */\nexport function subPixelOptimizeRect(shape, style) {\n  subPixelOptimizeUtil.subPixelOptimizeRect(shape, shape, style);\n  return shape;\n}\n/**\n * Sub pixel optimize for canvas\n *\n * @param position Coordinate, such as x, y\n * @param lineWidth Should be nonnegative integer.\n * @param positiveOrNegative Default false (negative).\n * @return Optimized position.\n */\nexport var subPixelOptimize = subPixelOptimizeUtil.subPixelOptimize;\n/**\n * Get transform matrix of target (param target),\n * in coordinate of its ancestor (param ancestor)\n *\n * @param target\n * @param [ancestor]\n */\nexport function getTransform(target, ancestor) {\n  var mat = matrix.identity([]);\n  while (target && target !== ancestor) {\n    matrix.mul(mat, target.getLocalTransform(), mat);\n    target = target.parent;\n  }\n  return mat;\n}\n/**\n * Apply transform to an vertex.\n * @param target [x, y]\n * @param transform Can be:\n *      + Transform matrix: like [1, 0, 0, 1, 0, 0]\n *      + {position, rotation, scale}, the same as `zrender/Transformable`.\n * @param invert Whether use invert matrix.\n * @return [x, y]\n */\nexport function applyTransform(target, transform, invert) {\n  if (transform && !isArrayLike(transform)) {\n    transform = Transformable.getLocalTransform(transform);\n  }\n  if (invert) {\n    transform = matrix.invert([], transform);\n  }\n  return vector.applyTransform([], target, transform);\n}\n/**\n * @param direction 'left' 'right' 'top' 'bottom'\n * @param transform Transform matrix: like [1, 0, 0, 1, 0, 0]\n * @param invert Whether use invert matrix.\n * @return Transformed direction. 'left' 'right' 'top' 'bottom'\n */\nexport function transformDirection(direction, transform, invert) {\n  // Pick a base, ensure that transform result will not be (0, 0).\n  var hBase = transform[4] === 0 || transform[5] === 0 || transform[0] === 0 ? 1 : mathAbs(2 * transform[4] / transform[0]);\n  var vBase = transform[4] === 0 || transform[5] === 0 || transform[2] === 0 ? 1 : mathAbs(2 * transform[4] / transform[2]);\n  var vertex = [direction === 'left' ? -hBase : direction === 'right' ? hBase : 0, direction === 'top' ? -vBase : direction === 'bottom' ? vBase : 0];\n  vertex = applyTransform(vertex, transform, invert);\n  return mathAbs(vertex[0]) > mathAbs(vertex[1]) ? vertex[0] > 0 ? 'right' : 'left' : vertex[1] > 0 ? 'bottom' : 'top';\n}\nfunction isNotGroup(el) {\n  return !el.isGroup;\n}\nfunction isPath(el) {\n  return el.shape != null;\n}\n/**\n * Apply group transition animation from g1 to g2.\n * If no animatableModel, no animation.\n */\nexport function groupTransition(g1, g2, animatableModel) {\n  if (!g1 || !g2) {\n    return;\n  }\n  function getElMap(g) {\n    var elMap = {};\n    g.traverse(function (el) {\n      if (isNotGroup(el) && el.anid) {\n        elMap[el.anid] = el;\n      }\n    });\n    return elMap;\n  }\n  function getAnimatableProps(el) {\n    var obj = {\n      x: el.x,\n      y: el.y,\n      rotation: el.rotation\n    };\n    if (isPath(el)) {\n      obj.shape = clone(el.shape);\n    }\n    return obj;\n  }\n  var elMap1 = getElMap(g1);\n  g2.traverse(function (el) {\n    if (isNotGroup(el) && el.anid) {\n      var oldEl = elMap1[el.anid];\n      if (oldEl) {\n        var newProp = getAnimatableProps(el);\n        el.attr(getAnimatableProps(oldEl));\n        updateProps(el, newProp, animatableModel, getECData(el).dataIndex);\n      }\n    }\n  });\n}\nexport function clipPointsByRect(points, rect) {\n  // FIXME: This way might be incorrect when graphic clipped by a corner\n  // and when element has a border.\n  return map(points, function (point) {\n    var x = point[0];\n    x = mathMax(x, rect.x);\n    x = mathMin(x, rect.x + rect.width);\n    var y = point[1];\n    y = mathMax(y, rect.y);\n    y = mathMin(y, rect.y + rect.height);\n    return [x, y];\n  });\n}\n/**\n * Return a new clipped rect. If rect size are negative, return undefined.\n */\nexport function clipRectByRect(targetRect, rect) {\n  var x = mathMax(targetRect.x, rect.x);\n  var x2 = mathMin(targetRect.x + targetRect.width, rect.x + rect.width);\n  var y = mathMax(targetRect.y, rect.y);\n  var y2 = mathMin(targetRect.y + targetRect.height, rect.y + rect.height);\n  // If the total rect is cliped, nothing, including the border,\n  // should be painted. So return undefined.\n  if (x2 >= x && y2 >= y) {\n    return {\n      x: x,\n      y: y,\n      width: x2 - x,\n      height: y2 - y\n    };\n  }\n}\nexport function createIcon(iconStr,\n// Support 'image://' or 'path://' or direct svg path.\nopt, rect) {\n  var innerOpts = extend({\n    rectHover: true\n  }, opt);\n  var style = innerOpts.style = {\n    strokeNoScale: true\n  };\n  rect = rect || {\n    x: -1,\n    y: -1,\n    width: 2,\n    height: 2\n  };\n  if (iconStr) {\n    return iconStr.indexOf('image://') === 0 ? (style.image = iconStr.slice(8), defaults(style, rect), new ZRImage(innerOpts)) : makePath(iconStr.replace('path://', ''), innerOpts, rect, 'center');\n  }\n}\n/**\n * Return `true` if the given line (line `a`) and the given polygon\n * are intersect.\n * Note that we do not count colinear as intersect here because no\n * requirement for that. We could do that if required in future.\n */\nexport function linePolygonIntersect(a1x, a1y, a2x, a2y, points) {\n  for (var i = 0, p2 = points[points.length - 1]; i < points.length; i++) {\n    var p = points[i];\n    if (lineLineIntersect(a1x, a1y, a2x, a2y, p[0], p[1], p2[0], p2[1])) {\n      return true;\n    }\n    p2 = p;\n  }\n}\n/**\n * Return `true` if the given two lines (line `a` and line `b`)\n * are intersect.\n * Note that we do not count colinear as intersect here because no\n * requirement for that. We could do that if required in future.\n */\nexport function lineLineIntersect(a1x, a1y, a2x, a2y, b1x, b1y, b2x, b2y) {\n  // let `vec_m` to be `vec_a2 - vec_a1` and `vec_n` to be `vec_b2 - vec_b1`.\n  var mx = a2x - a1x;\n  var my = a2y - a1y;\n  var nx = b2x - b1x;\n  var ny = b2y - b1y;\n  // `vec_m` and `vec_n` are parallel iff\n  //     existing `k` such that `vec_m = k \u00B7 vec_n`, equivalent to `vec_m X vec_n = 0`.\n  var nmCrossProduct = crossProduct2d(nx, ny, mx, my);\n  if (nearZero(nmCrossProduct)) {\n    return false;\n  }\n  // `vec_m` and `vec_n` are intersect iff\n  //     existing `p` and `q` in [0, 1] such that `vec_a1 + p * vec_m = vec_b1 + q * vec_n`,\n  //     such that `q = ((vec_a1 - vec_b1) X vec_m) / (vec_n X vec_m)`\n  //           and `p = ((vec_a1 - vec_b1) X vec_n) / (vec_n X vec_m)`.\n  var b1a1x = a1x - b1x;\n  var b1a1y = a1y - b1y;\n  var q = crossProduct2d(b1a1x, b1a1y, mx, my) / nmCrossProduct;\n  if (q < 0 || q > 1) {\n    return false;\n  }\n  var p = crossProduct2d(b1a1x, b1a1y, nx, ny) / nmCrossProduct;\n  if (p < 0 || p > 1) {\n    return false;\n  }\n  return true;\n}\n/**\n * Cross product of 2-dimension vector.\n */\nfunction crossProduct2d(x1, y1, x2, y2) {\n  return x1 * y2 - x2 * y1;\n}\nfunction nearZero(val) {\n  return val <= 1e-6 && val >= -1e-6;\n}\n/**\n * NOTE:\n *  A negative-width/height rect (due to negative margins) is not supported;\n *  it will be clampped to zero width/height.\n *  Although negative-width/height rects can be defined reasonably following the\n *  similar sense in CSS, but they are rarely used, hard to understand and complicated.\n *\n * @param rect Assume its width/height >= 0 if existing.\n *  x/y/width/height is allowed to be NaN,\n *  for the case that only x/width or y/height is intended to be computed.\n * @param delta\n *  If be `number[]`, should be `[top, right, bottom, left]`,\n *      which can be used in padding or margin case.\n *      @see `normalizeCssArray` in `util/format.ts`\n *  If be `number`, it means [delta, delta, delta, delta],\n *      which can be used in lineWidth (borderWith) case,\n *      [NOTICE]: commonly pass lineWidth / 2, following the convention that border is\n *      half inside half outside of the rect.\n * @param shrinkOrExpand\n *  `true` - shrink if `delta[i]` is positive, commmonly used in `padding` case.\n *  `false` - expand if `delta[i]` is positive, commmonly used in `margin` case. (default)\n * @param noNegative\n *  `true` - negative `delta[i]` will be clampped to 0.\n *  `false` - No clamp to `delta`. (default).\n * @return The input `rect`.\n */\nexport function expandOrShrinkRect(rect, delta, shrinkOrExpand, noNegative, minSize // by default [0, 0].\n) {\n  if (delta == null) {\n    return rect;\n  } else if (isNumber(delta)) {\n    _tmpExpandRectDelta[0] = _tmpExpandRectDelta[1] = _tmpExpandRectDelta[2] = _tmpExpandRectDelta[3] = delta;\n  } else {\n    if (process.env.NODE_ENV !== 'production') {\n      assert(delta.length === 4);\n    }\n    _tmpExpandRectDelta[0] = delta[0];\n    _tmpExpandRectDelta[1] = delta[1];\n    _tmpExpandRectDelta[2] = delta[2];\n    _tmpExpandRectDelta[3] = delta[3];\n  }\n  if (noNegative) {\n    _tmpExpandRectDelta[0] = mathMax(0, _tmpExpandRectDelta[0]);\n    _tmpExpandRectDelta[1] = mathMax(0, _tmpExpandRectDelta[1]);\n    _tmpExpandRectDelta[2] = mathMax(0, _tmpExpandRectDelta[2]);\n    _tmpExpandRectDelta[3] = mathMax(0, _tmpExpandRectDelta[3]);\n  }\n  if (shrinkOrExpand) {\n    _tmpExpandRectDelta[0] = -_tmpExpandRectDelta[0];\n    _tmpExpandRectDelta[1] = -_tmpExpandRectDelta[1];\n    _tmpExpandRectDelta[2] = -_tmpExpandRectDelta[2];\n    _tmpExpandRectDelta[3] = -_tmpExpandRectDelta[3];\n  }\n  expandRectOnOneDimension(rect, _tmpExpandRectDelta, 'x', 'width', 3, 1, minSize && minSize[0] || 0);\n  expandRectOnOneDimension(rect, _tmpExpandRectDelta, 'y', 'height', 0, 2, minSize && minSize[1] || 0);\n  return rect;\n}\nvar _tmpExpandRectDelta = [0, 0, 0, 0];\nfunction expandRectOnOneDimension(rect, delta, xy, wh, ltIdx, rbIdx, minSize) {\n  var deltaSum = delta[rbIdx] + delta[ltIdx];\n  var oldSize = rect[wh];\n  rect[wh] += deltaSum;\n  minSize = mathMax(0, mathMin(minSize, oldSize));\n  if (rect[wh] < minSize) {\n    rect[wh] = minSize;\n    // Try to make the position of the zero rect reasonable in most visual cases.\n    rect[xy] += delta[ltIdx] >= 0 ? -delta[ltIdx] : delta[rbIdx] >= 0 ? oldSize + delta[rbIdx] : mathAbs(deltaSum) > 1e-8 ? (oldSize - minSize) * delta[ltIdx] / deltaSum : 0;\n  } else {\n    rect[xy] -= delta[ltIdx];\n  }\n}\nexport function setTooltipConfig(opt) {\n  var itemTooltipOption = opt.itemTooltipOption;\n  var componentModel = opt.componentModel;\n  var itemName = opt.itemName;\n  var itemTooltipOptionObj = isString(itemTooltipOption) ? {\n    formatter: itemTooltipOption\n  } : itemTooltipOption;\n  var mainType = componentModel.mainType;\n  var componentIndex = componentModel.componentIndex;\n  var formatterParams = {\n    componentType: mainType,\n    name: itemName,\n    $vars: ['name']\n  };\n  formatterParams[mainType + 'Index'] = componentIndex;\n  var formatterParamsExtra = opt.formatterParamsExtra;\n  if (formatterParamsExtra) {\n    each(keys(formatterParamsExtra), function (key) {\n      if (!hasOwn(formatterParams, key)) {\n        formatterParams[key] = formatterParamsExtra[key];\n        formatterParams.$vars.push(key);\n      }\n    });\n  }\n  var ecData = getECData(opt.el);\n  ecData.componentMainType = mainType;\n  ecData.componentIndex = componentIndex;\n  ecData.tooltipConfig = {\n    name: itemName,\n    option: defaults({\n      content: itemName,\n      encodeHTMLContent: true,\n      formatterParams: formatterParams\n    }, itemTooltipOptionObj)\n  };\n}\nfunction traverseElement(el, cb) {\n  var stopped;\n  // TODO\n  // Polyfill for fixing zrender group traverse don't visit it's root issue.\n  if (el.isGroup) {\n    stopped = cb(el);\n  }\n  if (!stopped) {\n    el.traverse(cb);\n  }\n}\nexport function traverseElements(els, cb) {\n  if (els) {\n    if (isArray(els)) {\n      for (var i = 0; i < els.length; i++) {\n        traverseElement(els[i], cb);\n      }\n    } else {\n      traverseElement(els, cb);\n    }\n  }\n}\n/**\n * After a boundingRect applying a `transform`, whether to be still parallel screen X and Y.\n */\nexport function isBoundingRectAxisAligned(transform) {\n  return !transform || mathAbs(transform[1]) < AXIS_ALIGN_EPSILON && mathAbs(transform[2]) < AXIS_ALIGN_EPSILON || mathAbs(transform[0]) < AXIS_ALIGN_EPSILON && mathAbs(transform[3]) < AXIS_ALIGN_EPSILON;\n}\nvar AXIS_ALIGN_EPSILON = 1e-5;\n/**\n * Create or copy to the existing bounding rect to avoid modifying `source`.\n *\n * @usage\n *  out.rect = ensureCopyRect(out.rect, sourceRect);\n */\nexport function ensureCopyRect(target, source) {\n  return target ? BoundingRect.copy(target, source) : source.clone();\n}\n/**\n * Create or copy to the existing transform to avoid modifying `source`.\n *\n * [CAUTION]: transform is `NullUndefined` if no transform, following convention of zrender,\n *  and enable to bypass some unnecessary calculation, since in most cases there is no transform.\n *\n * @usage\n *  out.transform = ensureCopyTransform(out.transform, sourceTransform);\n */\nexport function ensureCopyTransform(target, source) {\n  return source ? matrix.copy(target || matrix.create(), source) : undefined;\n}\nexport function retrieveZInfo(model) {\n  return {\n    z: model.get('z') || 0,\n    zlevel: model.get('zlevel') || 0\n  };\n}\n/**\n * Assume all of the elements has the same `z` and `zlevel`.\n */\nexport function calcZ2Range(el) {\n  var max = -Infinity;\n  var min = Infinity;\n  traverseElement(el, function (el) {\n    visitEl(el);\n    visitEl(el.getTextContent());\n    visitEl(el.getTextGuideLine());\n  });\n  function visitEl(el) {\n    if (!el || el.isGroup) {\n      return;\n    }\n    var currentStates = el.currentStates;\n    if (currentStates.length) {\n      for (var idx = 0; idx < currentStates.length; idx++) {\n        calcZ2(el.states[currentStates[idx]]);\n      }\n    }\n    calcZ2(el);\n  }\n  function calcZ2(entity) {\n    if (entity) {\n      var z2 = entity.z2;\n      // Consider z2 may be NullUndefined\n      if (z2 > max) {\n        max = z2;\n      }\n      if (z2 < min) {\n        min = z2;\n      }\n    }\n  }\n  if (min > max) {\n    min = max = 0;\n  }\n  return {\n    min: min,\n    max: max\n  };\n}\nexport function traverseUpdateZ(el, z, zlevel) {\n  doUpdateZ(el, z, zlevel, -Infinity);\n}\nfunction doUpdateZ(el, z, zlevel,\n// FIXME: Ideally all the labels should be above all the glyphs by default,\n//  e.g. in graph, edge labels should be above node elements.\n//  Currently impl does not guarantee that.\nmaxZ2) {\n  // `ignoreModelZ` is used to intentionally lift elements to cover other elements,\n  // where maxZ2 (for label.z2) should also not be counted for its parents.\n  if (el.ignoreModelZ) {\n    return maxZ2;\n  }\n  // Group may also have textContent\n  var label = el.getTextContent();\n  var labelLine = el.getTextGuideLine();\n  var isGroup = el.isGroup;\n  if (isGroup) {\n    // set z & zlevel of children elements of Group\n    var children = el.childrenRef();\n    for (var i = 0; i < children.length; i++) {\n      maxZ2 = mathMax(doUpdateZ(children[i], z, zlevel, maxZ2), maxZ2);\n    }\n  } else {\n    // not Group\n    el.z = z;\n    el.zlevel = zlevel;\n    maxZ2 = mathMax(el.z2 || 0, maxZ2);\n  }\n  // always set z and zlevel if label/labelLine exists\n  if (label) {\n    label.z = z;\n    label.zlevel = zlevel;\n    // lift z2 of text content\n    // TODO if el.emphasis.z2 is spcefied, what about textContent.\n    isFinite(maxZ2) && (label.z2 = maxZ2 + 2);\n  }\n  if (labelLine) {\n    var textGuideLineConfig = el.textGuideLineConfig;\n    labelLine.z = z;\n    labelLine.zlevel = zlevel;\n    isFinite(maxZ2) && (labelLine.z2 = maxZ2 + (textGuideLineConfig && textGuideLineConfig.showAbove ? 1 : -1));\n  }\n  return maxZ2;\n}\n// Register built-in shapes. These shapes might be overwritten\n// by users, although we do not recommend that.\nregisterShape('circle', Circle);\nregisterShape('ellipse', Ellipse);\nregisterShape('sector', Sector);\nregisterShape('ring', Ring);\nregisterShape('polygon', Polygon);\nregisterShape('polyline', Polyline);\nregisterShape('rect', Rect);\nregisterShape('line', Line);\nregisterShape('bezierCurve', BezierCurve);\nregisterShape('arc', Arc);\nexport { Group, ZRImage as Image, ZRText as Text, Circle, Ellipse, Sector, Ring, Polygon, Polyline, Rect, Line, BezierCurve, Arc, IncrementalDisplayable, CompoundPath, LinearGradient, RadialGradient, BoundingRect, OrientedBoundingRect, Point, Path };", "import PathProxy from '../core/PathProxy.js';\nimport { applyTransform as v2ApplyTransform } from '../core/vector.js';\nvar CMD = PathProxy.CMD;\nvar points = [[], [], []];\nvar mathSqrt = Math.sqrt;\nvar mathAtan2 = Math.atan2;\nexport default function transformPath(path, m) {\n    if (!m) {\n        return;\n    }\n    var data = path.data;\n    var len = path.len();\n    var cmd;\n    var nPoint;\n    var i;\n    var j;\n    var k;\n    var p;\n    var M = CMD.M;\n    var C = CMD.C;\n    var L = CMD.L;\n    var R = CMD.R;\n    var A = CMD.A;\n    var Q = CMD.Q;\n    for (i = 0, j = 0; i < len;) {\n        cmd = data[i++];\n        j = i;\n        nPoint = 0;\n        switch (cmd) {\n            case M:\n                nPoint = 1;\n                break;\n            case L:\n                nPoint = 1;\n                break;\n            case C:\n                nPoint = 3;\n                break;\n            case Q:\n                nPoint = 2;\n                break;\n            case A:\n                var x = m[4];\n                var y = m[5];\n                var sx = mathSqrt(m[0] * m[0] + m[1] * m[1]);\n                var sy = mathSqrt(m[2] * m[2] + m[3] * m[3]);\n                var angle = mathAtan2(-m[1] / sy, m[0] / sx);\n                data[i] *= sx;\n                data[i++] += x;\n                data[i] *= sy;\n                data[i++] += y;\n                data[i++] *= sx;\n                data[i++] *= sy;\n                data[i++] += angle;\n                data[i++] += angle;\n                i += 2;\n                j = i;\n                break;\n            case R:\n                p[0] = data[i++];\n                p[1] = data[i++];\n                v2ApplyTransform(p, p, m);\n                data[j++] = p[0];\n                data[j++] = p[1];\n                p[0] += data[i++];\n                p[1] += data[i++];\n                v2ApplyTransform(p, p, m);\n                data[j++] = p[0];\n                data[j++] = p[1];\n        }\n        for (k = 0; k < nPoint; k++) {\n            var p_1 = points[k];\n            p_1[0] = data[i++];\n            p_1[1] = data[i++];\n            v2ApplyTransform(p_1, p_1, m);\n            data[j++] = p_1[0];\n            data[j++] = p_1[1];\n        }\n    }\n    path.increaseVersion();\n}\n", "import { __extends } from \"tslib\";\nimport Path from '../graphic/Path.js';\nimport PathProxy from '../core/PathProxy.js';\nimport transformPath from './transformPath.js';\nimport { extend } from '../core/util.js';\nvar mathSqrt = Math.sqrt;\nvar mathSin = Math.sin;\nvar mathCos = Math.cos;\nvar PI = Math.PI;\nfunction vMag(v) {\n    return Math.sqrt(v[0] * v[0] + v[1] * v[1]);\n}\n;\nfunction vRatio(u, v) {\n    return (u[0] * v[0] + u[1] * v[1]) / (vMag(u) * vMag(v));\n}\n;\nfunction vAngle(u, v) {\n    return (u[0] * v[1] < u[1] * v[0] ? -1 : 1)\n        * Math.acos(vRatio(u, v));\n}\n;\nfunction processArc(x1, y1, x2, y2, fa, fs, rx, ry, psiDeg, cmd, path) {\n    var psi = psiDeg * (PI / 180.0);\n    var xp = mathCos(psi) * (x1 - x2) / 2.0\n        + mathSin(psi) * (y1 - y2) / 2.0;\n    var yp = -1 * mathSin(psi) * (x1 - x2) / 2.0\n        + mathCos(psi) * (y1 - y2) / 2.0;\n    var lambda = (xp * xp) / (rx * rx) + (yp * yp) / (ry * ry);\n    if (lambda > 1) {\n        rx *= mathSqrt(lambda);\n        ry *= mathSqrt(lambda);\n    }\n    var f = (fa === fs ? -1 : 1)\n        * mathSqrt((((rx * rx) * (ry * ry))\n            - ((rx * rx) * (yp * yp))\n            - ((ry * ry) * (xp * xp))) / ((rx * rx) * (yp * yp)\n            + (ry * ry) * (xp * xp))) || 0;\n    var cxp = f * rx * yp / ry;\n    var cyp = f * -ry * xp / rx;\n    var cx = (x1 + x2) / 2.0\n        + mathCos(psi) * cxp\n        - mathSin(psi) * cyp;\n    var cy = (y1 + y2) / 2.0\n        + mathSin(psi) * cxp\n        + mathCos(psi) * cyp;\n    var theta = vAngle([1, 0], [(xp - cxp) / rx, (yp - cyp) / ry]);\n    var u = [(xp - cxp) / rx, (yp - cyp) / ry];\n    var v = [(-1 * xp - cxp) / rx, (-1 * yp - cyp) / ry];\n    var dTheta = vAngle(u, v);\n    if (vRatio(u, v) <= -1) {\n        dTheta = PI;\n    }\n    if (vRatio(u, v) >= 1) {\n        dTheta = 0;\n    }\n    if (dTheta < 0) {\n        var n = Math.round(dTheta / PI * 1e6) / 1e6;\n        dTheta = PI * 2 + (n % 2) * PI;\n    }\n    path.addData(cmd, cx, cy, rx, ry, theta, dTheta, psi, fs);\n}\nvar commandReg = /([mlvhzcqtsa])([^mlvhzcqtsa]*)/ig;\nvar numberReg = /-?([0-9]*\\.)?[0-9]+([eE]-?[0-9]+)?/g;\nfunction createPathProxyFromString(data) {\n    var path = new PathProxy();\n    if (!data) {\n        return path;\n    }\n    var cpx = 0;\n    var cpy = 0;\n    var subpathX = cpx;\n    var subpathY = cpy;\n    var prevCmd;\n    var CMD = PathProxy.CMD;\n    var cmdList = data.match(commandReg);\n    if (!cmdList) {\n        return path;\n    }\n    for (var l = 0; l < cmdList.length; l++) {\n        var cmdText = cmdList[l];\n        var cmdStr = cmdText.charAt(0);\n        var cmd = void 0;\n        var p = cmdText.match(numberReg) || [];\n        var pLen = p.length;\n        for (var i = 0; i < pLen; i++) {\n            p[i] = parseFloat(p[i]);\n        }\n        var off = 0;\n        while (off < pLen) {\n            var ctlPtx = void 0;\n            var ctlPty = void 0;\n            var rx = void 0;\n            var ry = void 0;\n            var psi = void 0;\n            var fa = void 0;\n            var fs = void 0;\n            var x1 = cpx;\n            var y1 = cpy;\n            var len = void 0;\n            var pathData = void 0;\n            switch (cmdStr) {\n                case 'l':\n                    cpx += p[off++];\n                    cpy += p[off++];\n                    cmd = CMD.L;\n                    path.addData(cmd, cpx, cpy);\n                    break;\n                case 'L':\n                    cpx = p[off++];\n                    cpy = p[off++];\n                    cmd = CMD.L;\n                    path.addData(cmd, cpx, cpy);\n                    break;\n                case 'm':\n                    cpx += p[off++];\n                    cpy += p[off++];\n                    cmd = CMD.M;\n                    path.addData(cmd, cpx, cpy);\n                    subpathX = cpx;\n                    subpathY = cpy;\n                    cmdStr = 'l';\n                    break;\n                case 'M':\n                    cpx = p[off++];\n                    cpy = p[off++];\n                    cmd = CMD.M;\n                    path.addData(cmd, cpx, cpy);\n                    subpathX = cpx;\n                    subpathY = cpy;\n                    cmdStr = 'L';\n                    break;\n                case 'h':\n                    cpx += p[off++];\n                    cmd = CMD.L;\n                    path.addData(cmd, cpx, cpy);\n                    break;\n                case 'H':\n                    cpx = p[off++];\n                    cmd = CMD.L;\n                    path.addData(cmd, cpx, cpy);\n                    break;\n                case 'v':\n                    cpy += p[off++];\n                    cmd = CMD.L;\n                    path.addData(cmd, cpx, cpy);\n                    break;\n                case 'V':\n                    cpy = p[off++];\n                    cmd = CMD.L;\n                    path.addData(cmd, cpx, cpy);\n                    break;\n                case 'C':\n                    cmd = CMD.C;\n                    path.addData(cmd, p[off++], p[off++], p[off++], p[off++], p[off++], p[off++]);\n                    cpx = p[off - 2];\n                    cpy = p[off - 1];\n                    break;\n                case 'c':\n                    cmd = CMD.C;\n                    path.addData(cmd, p[off++] + cpx, p[off++] + cpy, p[off++] + cpx, p[off++] + cpy, p[off++] + cpx, p[off++] + cpy);\n                    cpx += p[off - 2];\n                    cpy += p[off - 1];\n                    break;\n                case 'S':\n                    ctlPtx = cpx;\n                    ctlPty = cpy;\n                    len = path.len();\n                    pathData = path.data;\n                    if (prevCmd === CMD.C) {\n                        ctlPtx += cpx - pathData[len - 4];\n                        ctlPty += cpy - pathData[len - 3];\n                    }\n                    cmd = CMD.C;\n                    x1 = p[off++];\n                    y1 = p[off++];\n                    cpx = p[off++];\n                    cpy = p[off++];\n                    path.addData(cmd, ctlPtx, ctlPty, x1, y1, cpx, cpy);\n                    break;\n                case 's':\n                    ctlPtx = cpx;\n                    ctlPty = cpy;\n                    len = path.len();\n                    pathData = path.data;\n                    if (prevCmd === CMD.C) {\n                        ctlPtx += cpx - pathData[len - 4];\n                        ctlPty += cpy - pathData[len - 3];\n                    }\n                    cmd = CMD.C;\n                    x1 = cpx + p[off++];\n                    y1 = cpy + p[off++];\n                    cpx += p[off++];\n                    cpy += p[off++];\n                    path.addData(cmd, ctlPtx, ctlPty, x1, y1, cpx, cpy);\n                    break;\n                case 'Q':\n                    x1 = p[off++];\n                    y1 = p[off++];\n                    cpx = p[off++];\n                    cpy = p[off++];\n                    cmd = CMD.Q;\n                    path.addData(cmd, x1, y1, cpx, cpy);\n                    break;\n                case 'q':\n                    x1 = p[off++] + cpx;\n                    y1 = p[off++] + cpy;\n                    cpx += p[off++];\n                    cpy += p[off++];\n                    cmd = CMD.Q;\n                    path.addData(cmd, x1, y1, cpx, cpy);\n                    break;\n                case 'T':\n                    ctlPtx = cpx;\n                    ctlPty = cpy;\n                    len = path.len();\n                    pathData = path.data;\n                    if (prevCmd === CMD.Q) {\n                        ctlPtx += cpx - pathData[len - 4];\n                        ctlPty += cpy - pathData[len - 3];\n                    }\n                    cpx = p[off++];\n                    cpy = p[off++];\n                    cmd = CMD.Q;\n                    path.addData(cmd, ctlPtx, ctlPty, cpx, cpy);\n                    break;\n                case 't':\n                    ctlPtx = cpx;\n                    ctlPty = cpy;\n                    len = path.len();\n                    pathData = path.data;\n                    if (prevCmd === CMD.Q) {\n                        ctlPtx += cpx - pathData[len - 4];\n                        ctlPty += cpy - pathData[len - 3];\n                    }\n                    cpx += p[off++];\n                    cpy += p[off++];\n                    cmd = CMD.Q;\n                    path.addData(cmd, ctlPtx, ctlPty, cpx, cpy);\n                    break;\n                case 'A':\n                    rx = p[off++];\n                    ry = p[off++];\n                    psi = p[off++];\n                    fa = p[off++];\n                    fs = p[off++];\n                    x1 = cpx, y1 = cpy;\n                    cpx = p[off++];\n                    cpy = p[off++];\n                    cmd = CMD.A;\n                    processArc(x1, y1, cpx, cpy, fa, fs, rx, ry, psi, cmd, path);\n                    break;\n                case 'a':\n                    rx = p[off++];\n                    ry = p[off++];\n                    psi = p[off++];\n                    fa = p[off++];\n                    fs = p[off++];\n                    x1 = cpx, y1 = cpy;\n                    cpx += p[off++];\n                    cpy += p[off++];\n                    cmd = CMD.A;\n                    processArc(x1, y1, cpx, cpy, fa, fs, rx, ry, psi, cmd, path);\n                    break;\n            }\n        }\n        if (cmdStr === 'z' || cmdStr === 'Z') {\n            cmd = CMD.Z;\n            path.addData(cmd);\n            cpx = subpathX;\n            cpy = subpathY;\n        }\n        prevCmd = cmd;\n    }\n    path.toStatic();\n    return path;\n}\nvar SVGPath = (function (_super) {\n    __extends(SVGPath, _super);\n    function SVGPath() {\n        return _super !== null && _super.apply(this, arguments) || this;\n    }\n    SVGPath.prototype.applyTransform = function (m) { };\n    return SVGPath;\n}(Path));\nfunction isPathProxy(path) {\n    return path.setData != null;\n}\nfunction createPathOptions(str, opts) {\n    var pathProxy = createPathProxyFromString(str);\n    var innerOpts = extend({}, opts);\n    innerOpts.buildPath = function (path) {\n        var beProxy = isPathProxy(path);\n        if (beProxy && path.canSave()) {\n            path.appendPath(pathProxy);\n            var ctx = path.getContext();\n            if (ctx) {\n                path.rebuildPath(ctx, 1);\n            }\n        }\n        else {\n            var ctx = beProxy ? path.getContext() : path;\n            if (ctx) {\n                pathProxy.rebuildPath(ctx, 1);\n            }\n        }\n    };\n    innerOpts.applyTransform = function (m) {\n        transformPath(pathProxy, m);\n        this.dirtyShape();\n    };\n    return innerOpts;\n}\nexport function createFromString(str, opts) {\n    return new SVGPath(createPathOptions(str, opts));\n}\nexport function extendFromString(str, defaultOpts) {\n    var innerOpts = createPathOptions(str, defaultOpts);\n    var Sub = (function (_super) {\n        __extends(Sub, _super);\n        function Sub(opts) {\n            var _this = _super.call(this, opts) || this;\n            _this.applyTransform = innerOpts.applyTransform;\n            _this.buildPath = innerOpts.buildPath;\n            return _this;\n        }\n        return Sub;\n    }(SVGPath));\n    return Sub;\n}\nexport function mergePath(pathEls, opts) {\n    var pathList = [];\n    var len = pathEls.length;\n    for (var i = 0; i < len; i++) {\n        var pathEl = pathEls[i];\n        pathList.push(pathEl.getUpdatedPathProxy(true));\n    }\n    var pathBundle = new Path(opts);\n    pathBundle.createPathProxy();\n    pathBundle.buildPath = function (path) {\n        if (isPathProxy(path)) {\n            path.appendPath(pathList);\n            var ctx = path.getContext();\n            if (ctx) {\n                path.rebuildPath(ctx, 1);\n            }\n        }\n    };\n    return pathBundle;\n}\nexport function clonePath(sourcePath, opts) {\n    opts = opts || {};\n    var path = new Path();\n    if (sourcePath.shape) {\n        path.setShape(sourcePath.shape);\n    }\n    path.setStyle(sourcePath.style);\n    if (opts.bakeTransform) {\n        transformPath(path.path, sourcePath.getComputedTransform());\n    }\n    else {\n        if (opts.toLocal) {\n            path.setLocalTransform(sourcePath.getComputedTransform());\n        }\n        else {\n            path.copyTransform(sourcePath);\n        }\n    }\n    path.buildPath = sourcePath.buildPath;\n    path.applyTransform = path.applyTransform;\n    path.z = sourcePath.z;\n    path.z2 = sourcePath.z2;\n    path.zlevel = sourcePath.zlevel;\n    return path;\n}\n", "import { __extends } from \"tslib\";\nimport Path from '../Path.js';\nvar CircleShape = (function () {\n    function CircleShape() {\n        this.cx = 0;\n        this.cy = 0;\n        this.r = 0;\n    }\n    return CircleShape;\n}());\nexport { CircleShape };\nvar Circle = (function (_super) {\n    __extends(Circle, _super);\n    function Circle(opts) {\n        return _super.call(this, opts) || this;\n    }\n    Circle.prototype.getDefaultShape = function () {\n        return new CircleShape();\n    };\n    Circle.prototype.buildPath = function (ctx, shape) {\n        ctx.moveTo(shape.cx + shape.r, shape.cy);\n        ctx.arc(shape.cx, shape.cy, shape.r, 0, Math.PI * 2);\n    };\n    return Circle;\n}(Path));\n;\nCircle.prototype.type = 'circle';\nexport default Circle;\n", "import { __extends } from \"tslib\";\nimport Path from '../Path.js';\nvar EllipseShape = (function () {\n    function EllipseShape() {\n        this.cx = 0;\n        this.cy = 0;\n        this.rx = 0;\n        this.ry = 0;\n    }\n    return EllipseShape;\n}());\nexport { EllipseShape };\nvar Ellipse = (function (_super) {\n    __extends(Ellipse, _super);\n    function Ellipse(opts) {\n        return _super.call(this, opts) || this;\n    }\n    Ellipse.prototype.getDefaultShape = function () {\n        return new EllipseShape();\n    };\n    Ellipse.prototype.buildPath = function (ctx, shape) {\n        var k = 0.5522848;\n        var x = shape.cx;\n        var y = shape.cy;\n        var a = shape.rx;\n        var b = shape.ry;\n        var ox = a * k;\n        var oy = b * k;\n        ctx.moveTo(x - a, y);\n        ctx.bezierCurveTo(x - a, y - oy, x - ox, y - b, x, y - b);\n        ctx.bezierCurveTo(x + ox, y - b, x + a, y - oy, x + a, y);\n        ctx.bezierCurveTo(x + a, y + oy, x + ox, y + b, x, y + b);\n        ctx.bezierCurveTo(x - ox, y + b, x - a, y + oy, x - a, y);\n        ctx.closePath();\n    };\n    return Ellipse;\n}(Path));\nEllipse.prototype.type = 'ellipse';\nexport default Ellipse;\n", "import { isArray } from '../../core/util.js';\nvar PI = Math.PI;\nvar PI2 = PI * 2;\nvar mathSin = Math.sin;\nvar mathCos = Math.cos;\nvar mathACos = Math.acos;\nvar mathATan2 = Math.atan2;\nvar mathAbs = Math.abs;\nvar mathSqrt = Math.sqrt;\nvar mathMax = Math.max;\nvar mathMin = Math.min;\nvar e = 1e-4;\nfunction intersect(x0, y0, x1, y1, x2, y2, x3, y3) {\n    var dx10 = x1 - x0;\n    var dy10 = y1 - y0;\n    var dx32 = x3 - x2;\n    var dy32 = y3 - y2;\n    var t = dy32 * dx10 - dx32 * dy10;\n    if (t * t < e) {\n        return;\n    }\n    t = (dx32 * (y0 - y2) - dy32 * (x0 - x2)) / t;\n    return [x0 + t * dx10, y0 + t * dy10];\n}\nfunction computeCornerTangents(x0, y0, x1, y1, radius, cr, clockwise) {\n    var x01 = x0 - x1;\n    var y01 = y0 - y1;\n    var lo = (clockwise ? cr : -cr) / mathSqrt(x01 * x01 + y01 * y01);\n    var ox = lo * y01;\n    var oy = -lo * x01;\n    var x11 = x0 + ox;\n    var y11 = y0 + oy;\n    var x10 = x1 + ox;\n    var y10 = y1 + oy;\n    var x00 = (x11 + x10) / 2;\n    var y00 = (y11 + y10) / 2;\n    var dx = x10 - x11;\n    var dy = y10 - y11;\n    var d2 = dx * dx + dy * dy;\n    var r = radius - cr;\n    var s = x11 * y10 - x10 * y11;\n    var d = (dy < 0 ? -1 : 1) * mathSqrt(mathMax(0, r * r * d2 - s * s));\n    var cx0 = (s * dy - dx * d) / d2;\n    var cy0 = (-s * dx - dy * d) / d2;\n    var cx1 = (s * dy + dx * d) / d2;\n    var cy1 = (-s * dx + dy * d) / d2;\n    var dx0 = cx0 - x00;\n    var dy0 = cy0 - y00;\n    var dx1 = cx1 - x00;\n    var dy1 = cy1 - y00;\n    if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) {\n        cx0 = cx1;\n        cy0 = cy1;\n    }\n    return {\n        cx: cx0,\n        cy: cy0,\n        x0: -ox,\n        y0: -oy,\n        x1: cx0 * (radius / r - 1),\n        y1: cy0 * (radius / r - 1)\n    };\n}\nfunction normalizeCornerRadius(cr) {\n    var arr;\n    if (isArray(cr)) {\n        var len = cr.length;\n        if (!len) {\n            return cr;\n        }\n        if (len === 1) {\n            arr = [cr[0], cr[0], 0, 0];\n        }\n        else if (len === 2) {\n            arr = [cr[0], cr[0], cr[1], cr[1]];\n        }\n        else if (len === 3) {\n            arr = cr.concat(cr[2]);\n        }\n        else {\n            arr = cr;\n        }\n    }\n    else {\n        arr = [cr, cr, cr, cr];\n    }\n    return arr;\n}\nexport function buildPath(ctx, shape) {\n    var _a;\n    var radius = mathMax(shape.r, 0);\n    var innerRadius = mathMax(shape.r0 || 0, 0);\n    var hasRadius = radius > 0;\n    var hasInnerRadius = innerRadius > 0;\n    if (!hasRadius && !hasInnerRadius) {\n        return;\n    }\n    if (!hasRadius) {\n        radius = innerRadius;\n        innerRadius = 0;\n    }\n    if (innerRadius > radius) {\n        var tmp = radius;\n        radius = innerRadius;\n        innerRadius = tmp;\n    }\n    var startAngle = shape.startAngle, endAngle = shape.endAngle;\n    if (isNaN(startAngle) || isNaN(endAngle)) {\n        return;\n    }\n    var cx = shape.cx, cy = shape.cy;\n    var clockwise = !!shape.clockwise;\n    var arc = mathAbs(endAngle - startAngle);\n    var mod = arc > PI2 && arc % PI2;\n    mod > e && (arc = mod);\n    if (!(radius > e)) {\n        ctx.moveTo(cx, cy);\n    }\n    else if (arc > PI2 - e) {\n        ctx.moveTo(cx + radius * mathCos(startAngle), cy + radius * mathSin(startAngle));\n        ctx.arc(cx, cy, radius, startAngle, endAngle, !clockwise);\n        if (innerRadius > e) {\n            ctx.moveTo(cx + innerRadius * mathCos(endAngle), cy + innerRadius * mathSin(endAngle));\n            ctx.arc(cx, cy, innerRadius, endAngle, startAngle, clockwise);\n        }\n    }\n    else {\n        var icrStart = void 0;\n        var icrEnd = void 0;\n        var ocrStart = void 0;\n        var ocrEnd = void 0;\n        var ocrs = void 0;\n        var ocre = void 0;\n        var icrs = void 0;\n        var icre = void 0;\n        var ocrMax = void 0;\n        var icrMax = void 0;\n        var limitedOcrMax = void 0;\n        var limitedIcrMax = void 0;\n        var xre = void 0;\n        var yre = void 0;\n        var xirs = void 0;\n        var yirs = void 0;\n        var xrs = radius * mathCos(startAngle);\n        var yrs = radius * mathSin(startAngle);\n        var xire = innerRadius * mathCos(endAngle);\n        var yire = innerRadius * mathSin(endAngle);\n        var hasArc = arc > e;\n        if (hasArc) {\n            var cornerRadius = shape.cornerRadius;\n            if (cornerRadius) {\n                _a = normalizeCornerRadius(cornerRadius), icrStart = _a[0], icrEnd = _a[1], ocrStart = _a[2], ocrEnd = _a[3];\n            }\n            var halfRd = mathAbs(radius - innerRadius) / 2;\n            ocrs = mathMin(halfRd, ocrStart);\n            ocre = mathMin(halfRd, ocrEnd);\n            icrs = mathMin(halfRd, icrStart);\n            icre = mathMin(halfRd, icrEnd);\n            limitedOcrMax = ocrMax = mathMax(ocrs, ocre);\n            limitedIcrMax = icrMax = mathMax(icrs, icre);\n            if (ocrMax > e || icrMax > e) {\n                xre = radius * mathCos(endAngle);\n                yre = radius * mathSin(endAngle);\n                xirs = innerRadius * mathCos(startAngle);\n                yirs = innerRadius * mathSin(startAngle);\n                if (arc < PI) {\n                    var it_1 = intersect(xrs, yrs, xirs, yirs, xre, yre, xire, yire);\n                    if (it_1) {\n                        var x0 = xrs - it_1[0];\n                        var y0 = yrs - it_1[1];\n                        var x1 = xre - it_1[0];\n                        var y1 = yre - it_1[1];\n                        var a = 1 / mathSin(mathACos((x0 * x1 + y0 * y1) / (mathSqrt(x0 * x0 + y0 * y0) * mathSqrt(x1 * x1 + y1 * y1))) / 2);\n                        var b = mathSqrt(it_1[0] * it_1[0] + it_1[1] * it_1[1]);\n                        limitedOcrMax = mathMin(ocrMax, (radius - b) / (a + 1));\n                        limitedIcrMax = mathMin(icrMax, (innerRadius - b) / (a - 1));\n                    }\n                }\n            }\n        }\n        if (!hasArc) {\n            ctx.moveTo(cx + xrs, cy + yrs);\n        }\n        else if (limitedOcrMax > e) {\n            var crStart = mathMin(ocrStart, limitedOcrMax);\n            var crEnd = mathMin(ocrEnd, limitedOcrMax);\n            var ct0 = computeCornerTangents(xirs, yirs, xrs, yrs, radius, crStart, clockwise);\n            var ct1 = computeCornerTangents(xre, yre, xire, yire, radius, crEnd, clockwise);\n            ctx.moveTo(cx + ct0.cx + ct0.x0, cy + ct0.cy + ct0.y0);\n            if (limitedOcrMax < ocrMax && crStart === crEnd) {\n                ctx.arc(cx + ct0.cx, cy + ct0.cy, limitedOcrMax, mathATan2(ct0.y0, ct0.x0), mathATan2(ct1.y0, ct1.x0), !clockwise);\n            }\n            else {\n                crStart > 0 && ctx.arc(cx + ct0.cx, cy + ct0.cy, crStart, mathATan2(ct0.y0, ct0.x0), mathATan2(ct0.y1, ct0.x1), !clockwise);\n                ctx.arc(cx, cy, radius, mathATan2(ct0.cy + ct0.y1, ct0.cx + ct0.x1), mathATan2(ct1.cy + ct1.y1, ct1.cx + ct1.x1), !clockwise);\n                crEnd > 0 && ctx.arc(cx + ct1.cx, cy + ct1.cy, crEnd, mathATan2(ct1.y1, ct1.x1), mathATan2(ct1.y0, ct1.x0), !clockwise);\n            }\n        }\n        else {\n            ctx.moveTo(cx + xrs, cy + yrs);\n            ctx.arc(cx, cy, radius, startAngle, endAngle, !clockwise);\n        }\n        if (!(innerRadius > e) || !hasArc) {\n            ctx.lineTo(cx + xire, cy + yire);\n        }\n        else if (limitedIcrMax > e) {\n            var crStart = mathMin(icrStart, limitedIcrMax);\n            var crEnd = mathMin(icrEnd, limitedIcrMax);\n            var ct0 = computeCornerTangents(xire, yire, xre, yre, innerRadius, -crEnd, clockwise);\n            var ct1 = computeCornerTangents(xrs, yrs, xirs, yirs, innerRadius, -crStart, clockwise);\n            ctx.lineTo(cx + ct0.cx + ct0.x0, cy + ct0.cy + ct0.y0);\n            if (limitedIcrMax < icrMax && crStart === crEnd) {\n                ctx.arc(cx + ct0.cx, cy + ct0.cy, limitedIcrMax, mathATan2(ct0.y0, ct0.x0), mathATan2(ct1.y0, ct1.x0), !clockwise);\n            }\n            else {\n                crEnd > 0 && ctx.arc(cx + ct0.cx, cy + ct0.cy, crEnd, mathATan2(ct0.y0, ct0.x0), mathATan2(ct0.y1, ct0.x1), !clockwise);\n                ctx.arc(cx, cy, innerRadius, mathATan2(ct0.cy + ct0.y1, ct0.cx + ct0.x1), mathATan2(ct1.cy + ct1.y1, ct1.cx + ct1.x1), clockwise);\n                crStart > 0 && ctx.arc(cx + ct1.cx, cy + ct1.cy, crStart, mathATan2(ct1.y1, ct1.x1), mathATan2(ct1.y0, ct1.x0), !clockwise);\n            }\n        }\n        else {\n            ctx.lineTo(cx + xire, cy + yire);\n            ctx.arc(cx, cy, innerRadius, endAngle, startAngle, clockwise);\n        }\n    }\n    ctx.closePath();\n}\n", "import { __extends } from \"tslib\";\nimport Path from '../Path.js';\nimport * as roundSectorHelper from '../helper/roundSector.js';\nvar SectorShape = (function () {\n    function SectorShape() {\n        this.cx = 0;\n        this.cy = 0;\n        this.r0 = 0;\n        this.r = 0;\n        this.startAngle = 0;\n        this.endAngle = Math.PI * 2;\n        this.clockwise = true;\n        this.cornerRadius = 0;\n    }\n    return SectorShape;\n}());\nexport { SectorShape };\nvar Sector = (function (_super) {\n    __extends(Sector, _super);\n    function Sector(opts) {\n        return _super.call(this, opts) || this;\n    }\n    Sector.prototype.getDefaultShape = function () {\n        return new SectorShape();\n    };\n    Sector.prototype.buildPath = function (ctx, shape) {\n        roundSectorHelper.buildPath(ctx, shape);\n    };\n    Sector.prototype.isZeroArea = function () {\n        return this.shape.startAngle === this.shape.endAngle\n            || this.shape.r === this.shape.r0;\n    };\n    return Sector;\n}(Path));\nSector.prototype.type = 'sector';\nexport default Sector;\n", "import { __extends } from \"tslib\";\nimport Path from '../Path.js';\nvar RingShape = (function () {\n    function RingShape() {\n        this.cx = 0;\n        this.cy = 0;\n        this.r = 0;\n        this.r0 = 0;\n    }\n    return RingShape;\n}());\nexport { RingShape };\nvar Ring = (function (_super) {\n    __extends(Ring, _super);\n    function Ring(opts) {\n        return _super.call(this, opts) || this;\n    }\n    Ring.prototype.getDefaultShape = function () {\n        return new RingShape();\n    };\n    Ring.prototype.buildPath = function (ctx, shape) {\n        var x = shape.cx;\n        var y = shape.cy;\n        var PI2 = Math.PI * 2;\n        ctx.moveTo(x + shape.r, y);\n        ctx.arc(x, y, shape.r, 0, PI2, false);\n        ctx.moveTo(x + shape.r0, y);\n        ctx.arc(x, y, shape.r0, 0, PI2, true);\n    };\n    return Ring;\n}(Path));\nRing.prototype.type = 'ring';\nexport default Ring;\n", "import { min as v2Min, max as v2Max, scale as v2Scale, distance as v2Distance, add as v2Add, clone as v2Clone, sub as v2Sub } from '../../core/vector.js';\nexport default function smoothBezier(points, smooth, isLoop, constraint) {\n    var cps = [];\n    var v = [];\n    var v1 = [];\n    var v2 = [];\n    var prevPoint;\n    var nextPoint;\n    var min;\n    var max;\n    if (constraint) {\n        min = [Infinity, Infinity];\n        max = [-Infinity, -Infinity];\n        for (var i = 0, len = points.length; i < len; i++) {\n            v2Min(min, min, points[i]);\n            v2Max(max, max, points[i]);\n        }\n        v2Min(min, min, constraint[0]);\n        v2Max(max, max, constraint[1]);\n    }\n    for (var i = 0, len = points.length; i < len; i++) {\n        var point = points[i];\n        if (isLoop) {\n            prevPoint = points[i ? i - 1 : len - 1];\n            nextPoint = points[(i + 1) % len];\n        }\n        else {\n            if (i === 0 || i === len - 1) {\n                cps.push(v2Clone(points[i]));\n                continue;\n            }\n            else {\n                prevPoint = points[i - 1];\n                nextPoint = points[i + 1];\n            }\n        }\n        v2Sub(v, nextPoint, prevPoint);\n        v2Scale(v, v, smooth);\n        var d0 = v2Distance(point, prevPoint);\n        var d1 = v2Distance(point, nextPoint);\n        var sum = d0 + d1;\n        if (sum !== 0) {\n            d0 /= sum;\n            d1 /= sum;\n        }\n        v2Scale(v1, v, -d0);\n        v2Scale(v2, v, d1);\n        var cp0 = v2Add([], point, v1);\n        var cp1 = v2Add([], point, v2);\n        if (constraint) {\n            v2Max(cp0, cp0, min);\n            v2Min(cp0, cp0, max);\n            v2Max(cp1, cp1, min);\n            v2Min(cp1, cp1, max);\n        }\n        cps.push(cp0);\n        cps.push(cp1);\n    }\n    if (isLoop) {\n        cps.push(cps.shift());\n    }\n    return cps;\n}\n", "import smoothBezier from './smoothBezier.js';\nexport function buildPath(ctx, shape, closePath) {\n    var smooth = shape.smooth;\n    var points = shape.points;\n    if (points && points.length >= 2) {\n        if (smooth) {\n            var controlPoints = smoothBezier(points, smooth, closePath, shape.smoothConstraint);\n            ctx.moveTo(points[0][0], points[0][1]);\n            var len = points.length;\n            for (var i = 0; i < (closePath ? len : len - 1); i++) {\n                var cp1 = controlPoints[i * 2];\n                var cp2 = controlPoints[i * 2 + 1];\n                var p = points[(i + 1) % len];\n                ctx.bezierCurveTo(cp1[0], cp1[1], cp2[0], cp2[1], p[0], p[1]);\n            }\n        }\n        else {\n            ctx.moveTo(points[0][0], points[0][1]);\n            for (var i = 1, l = points.length; i < l; i++) {\n                ctx.lineTo(points[i][0], points[i][1]);\n            }\n        }\n        closePath && ctx.closePath();\n    }\n}\n", "import { __extends } from \"tslib\";\nimport Path from '../Path.js';\nimport * as polyHelper from '../helper/poly.js';\nvar PolygonShape = (function () {\n    function PolygonShape() {\n        this.points = null;\n        this.smooth = 0;\n        this.smoothConstraint = null;\n    }\n    return PolygonShape;\n}());\nexport { PolygonShape };\nvar Polygon = (function (_super) {\n    __extends(Polygon, _super);\n    function Polygon(opts) {\n        return _super.call(this, opts) || this;\n    }\n    Polygon.prototype.getDefaultShape = function () {\n        return new PolygonShape();\n    };\n    Polygon.prototype.buildPath = function (ctx, shape) {\n        polyHelper.buildPath(ctx, shape, true);\n    };\n    return Polygon;\n}(Path));\n;\nPolygon.prototype.type = 'polygon';\nexport default Polygon;\n", "import { __extends } from \"tslib\";\nimport Path from '../Path.js';\nimport * as polyHelper from '../helper/poly.js';\nvar PolylineShape = (function () {\n    function PolylineShape() {\n        this.points = null;\n        this.percent = 1;\n        this.smooth = 0;\n        this.smoothConstraint = null;\n    }\n    return PolylineShape;\n}());\nexport { PolylineShape };\nvar Polyline = (function (_super) {\n    __extends(Polyline, _super);\n    function Polyline(opts) {\n        return _super.call(this, opts) || this;\n    }\n    Polyline.prototype.getDefaultStyle = function () {\n        return {\n            stroke: '#000',\n            fill: null\n        };\n    };\n    Polyline.prototype.getDefaultShape = function () {\n        return new PolylineShape();\n    };\n    Polyline.prototype.buildPath = function (ctx, shape) {\n        polyHelper.buildPath(ctx, shape, false);\n    };\n    return Polyline;\n}(Path));\nPolyline.prototype.type = 'polyline';\nexport default Polyline;\n", "import { __extends } from \"tslib\";\nimport Path from '../Path.js';\nimport { subPixelOptimizeLine } from '../helper/subPixelOptimize.js';\nvar subPixelOptimizeOutputShape = {};\nvar LineShape = (function () {\n    function LineShape() {\n        this.x1 = 0;\n        this.y1 = 0;\n        this.x2 = 0;\n        this.y2 = 0;\n        this.percent = 1;\n    }\n    return LineShape;\n}());\nexport { LineShape };\nvar Line = (function (_super) {\n    __extends(Line, _super);\n    function Line(opts) {\n        return _super.call(this, opts) || this;\n    }\n    Line.prototype.getDefaultStyle = function () {\n        return {\n            stroke: '#000',\n            fill: null\n        };\n    };\n    Line.prototype.getDefaultShape = function () {\n        return new LineShape();\n    };\n    Line.prototype.buildPath = function (ctx, shape) {\n        var x1;\n        var y1;\n        var x2;\n        var y2;\n        if (this.subPixelOptimize) {\n            var optimizedShape = subPixelOptimizeLine(subPixelOptimizeOutputShape, shape, this.style);\n            x1 = optimizedShape.x1;\n            y1 = optimizedShape.y1;\n            x2 = optimizedShape.x2;\n            y2 = optimizedShape.y2;\n        }\n        else {\n            x1 = shape.x1;\n            y1 = shape.y1;\n            x2 = shape.x2;\n            y2 = shape.y2;\n        }\n        var percent = shape.percent;\n        if (percent === 0) {\n            return;\n        }\n        ctx.moveTo(x1, y1);\n        if (percent < 1) {\n            x2 = x1 * (1 - percent) + x2 * percent;\n            y2 = y1 * (1 - percent) + y2 * percent;\n        }\n        ctx.lineTo(x2, y2);\n    };\n    Line.prototype.pointAt = function (p) {\n        var shape = this.shape;\n        return [\n            shape.x1 * (1 - p) + shape.x2 * p,\n            shape.y1 * (1 - p) + shape.y2 * p\n        ];\n    };\n    return Line;\n}(Path));\nLine.prototype.type = 'line';\nexport default Line;\n", "import { __extends } from \"tslib\";\nimport Path from '../Path.js';\nimport * as vec2 from '../../core/vector.js';\nimport { quadraticSubdivide, cubicSubdivide, quadraticAt, cubicAt, quadraticDerivativeAt, cubicDerivativeAt } from '../../core/curve.js';\nvar out = [];\nvar BezierCurveShape = (function () {\n    function BezierCurveShape() {\n        this.x1 = 0;\n        this.y1 = 0;\n        this.x2 = 0;\n        this.y2 = 0;\n        this.cpx1 = 0;\n        this.cpy1 = 0;\n        this.percent = 1;\n    }\n    return BezierCurveShape;\n}());\nexport { BezierCurveShape };\nfunction someVectorAt(shape, t, isTangent) {\n    var cpx2 = shape.cpx2;\n    var cpy2 = shape.cpy2;\n    if (cpx2 != null || cpy2 != null) {\n        return [\n            (isTangent ? cubicDerivativeAt : cubicAt)(shape.x1, shape.cpx1, shape.cpx2, shape.x2, t),\n            (isTangent ? cubicDerivativeAt : cubicAt)(shape.y1, shape.cpy1, shape.cpy2, shape.y2, t)\n        ];\n    }\n    else {\n        return [\n            (isTangent ? quadraticDerivativeAt : quadraticAt)(shape.x1, shape.cpx1, shape.x2, t),\n            (isTangent ? quadraticDerivativeAt : quadraticAt)(shape.y1, shape.cpy1, shape.y2, t)\n        ];\n    }\n}\nvar BezierCurve = (function (_super) {\n    __extends(BezierCurve, _super);\n    function BezierCurve(opts) {\n        return _super.call(this, opts) || this;\n    }\n    BezierCurve.prototype.getDefaultStyle = function () {\n        return {\n            stroke: '#000',\n            fill: null\n        };\n    };\n    BezierCurve.prototype.getDefaultShape = function () {\n        return new BezierCurveShape();\n    };\n    BezierCurve.prototype.buildPath = function (ctx, shape) {\n        var x1 = shape.x1;\n        var y1 = shape.y1;\n        var x2 = shape.x2;\n        var y2 = shape.y2;\n        var cpx1 = shape.cpx1;\n        var cpy1 = shape.cpy1;\n        var cpx2 = shape.cpx2;\n        var cpy2 = shape.cpy2;\n        var percent = shape.percent;\n        if (percent === 0) {\n            return;\n        }\n        ctx.moveTo(x1, y1);\n        if (cpx2 == null || cpy2 == null) {\n            if (percent < 1) {\n                quadraticSubdivide(x1, cpx1, x2, percent, out);\n                cpx1 = out[1];\n                x2 = out[2];\n                quadraticSubdivide(y1, cpy1, y2, percent, out);\n                cpy1 = out[1];\n                y2 = out[2];\n            }\n            ctx.quadraticCurveTo(cpx1, cpy1, x2, y2);\n        }\n        else {\n            if (percent < 1) {\n                cubicSubdivide(x1, cpx1, cpx2, x2, percent, out);\n                cpx1 = out[1];\n                cpx2 = out[2];\n                x2 = out[3];\n                cubicSubdivide(y1, cpy1, cpy2, y2, percent, out);\n                cpy1 = out[1];\n                cpy2 = out[2];\n                y2 = out[3];\n            }\n            ctx.bezierCurveTo(cpx1, cpy1, cpx2, cpy2, x2, y2);\n        }\n    };\n    BezierCurve.prototype.pointAt = function (t) {\n        return someVectorAt(this.shape, t, false);\n    };\n    BezierCurve.prototype.tangentAt = function (t) {\n        var p = someVectorAt(this.shape, t, true);\n        return vec2.normalize(p, p);\n    };\n    return BezierCurve;\n}(Path));\n;\nBezierCurve.prototype.type = 'bezier-curve';\nexport default BezierCurve;\n", "import { __extends } from \"tslib\";\nimport Path from '../Path.js';\nvar ArcShape = (function () {\n    function ArcShape() {\n        this.cx = 0;\n        this.cy = 0;\n        this.r = 0;\n        this.startAngle = 0;\n        this.endAngle = Math.PI * 2;\n        this.clockwise = true;\n    }\n    return ArcShape;\n}());\nexport { ArcShape };\nvar Arc = (function (_super) {\n    __extends(Arc, _super);\n    function Arc(opts) {\n        return _super.call(this, opts) || this;\n    }\n    Arc.prototype.getDefaultStyle = function () {\n        return {\n            stroke: '#000',\n            fill: null\n        };\n    };\n    Arc.prototype.getDefaultShape = function () {\n        return new ArcShape();\n    };\n    Arc.prototype.buildPath = function (ctx, shape) {\n        var x = shape.cx;\n        var y = shape.cy;\n        var r = Math.max(shape.r, 0);\n        var startAngle = shape.startAngle;\n        var endAngle = shape.endAngle;\n        var clockwise = shape.clockwise;\n        var unitX = Math.cos(startAngle);\n        var unitY = Math.sin(startAngle);\n        ctx.moveTo(unitX * r + x, unitY * r + y);\n        ctx.arc(x, y, r, startAngle, endAngle, !clockwise);\n    };\n    return Arc;\n}(Path));\nArc.prototype.type = 'arc';\nexport default Arc;\n", "import { __extends } from \"tslib\";\nimport Path from './Path.js';\nvar CompoundPath = (function (_super) {\n    __extends(CompoundPath, _super);\n    function CompoundPath() {\n        var _this = _super !== null && _super.apply(this, arguments) || this;\n        _this.type = 'compound';\n        return _this;\n    }\n    CompoundPath.prototype._updatePathDirty = function () {\n        var paths = this.shape.paths;\n        var dirtyPath = this.shapeChanged();\n        for (var i = 0; i < paths.length; i++) {\n            dirtyPath = dirtyPath || paths[i].shapeChanged();\n        }\n        if (dirtyPath) {\n            this.dirtyShape();\n        }\n    };\n    CompoundPath.prototype.beforeBrush = function () {\n        this._updatePathDirty();\n        var paths = this.shape.paths || [];\n        var scale = this.getGlobalScale();\n        for (var i = 0; i < paths.length; i++) {\n            if (!paths[i].path) {\n                paths[i].createPathProxy();\n            }\n            paths[i].path.setScale(scale[0], scale[1], paths[i].segmentIgnoreThreshold);\n        }\n    };\n    CompoundPath.prototype.buildPath = function (ctx, shape) {\n        var paths = shape.paths || [];\n        for (var i = 0; i < paths.length; i++) {\n            paths[i].buildPath(ctx, paths[i].shape, true);\n        }\n    };\n    CompoundPath.prototype.afterBrush = function () {\n        var paths = this.shape.paths || [];\n        for (var i = 0; i < paths.length; i++) {\n            paths[i].pathUpdated();\n        }\n    };\n    CompoundPath.prototype.getBoundingRect = function () {\n        this._updatePathDirty.call(this);\n        return Path.prototype.getBoundingRect.call(this);\n    };\n    return CompoundPath;\n}(Path));\nexport default CompoundPath;\n", "var Gradient = (function () {\n    function Gradient(colorStops) {\n        this.colorStops = colorStops || [];\n    }\n    Gradient.prototype.addColorStop = function (offset, color) {\n        this.colorStops.push({\n            offset: offset,\n            color: color\n        });\n    };\n    return Gradient;\n}());\nexport default Gradient;\n", "import { __extends } from \"tslib\";\nimport Gradient from './Gradient.js';\nvar LinearGradient = (function (_super) {\n    __extends(LinearGradient, _super);\n    function LinearGradient(x, y, x2, y2, colorStops, globalCoord) {\n        var _this = _super.call(this, colorStops) || this;\n        _this.x = x == null ? 0 : x;\n        _this.y = y == null ? 0 : y;\n        _this.x2 = x2 == null ? 1 : x2;\n        _this.y2 = y2 == null ? 0 : y2;\n        _this.type = 'linear';\n        _this.global = globalCoord || false;\n        return _this;\n    }\n    return LinearGradient;\n}(Gradient));\nexport default LinearGradient;\n;\n", "import { __extends } from \"tslib\";\nimport Gradient from './Gradient.js';\nvar RadialGradient = (function (_super) {\n    __extends(RadialGradient, _super);\n    function RadialGradient(x, y, r, colorStops, globalCoord) {\n        var _this = _super.call(this, colorStops) || this;\n        _this.x = x == null ? 0.5 : x;\n        _this.y = y == null ? 0.5 : y;\n        _this.r = r == null ? 0.5 : r;\n        _this.type = 'radial';\n        _this.global = globalCoord || false;\n        return _this;\n    }\n    return RadialGradient;\n}(Gradient));\nexport default RadialGradient;\n", "import Point from './Point.js';\nimport { createIntersectContext } from './BoundingRect.js';\nvar mathMin = Math.min;\nvar mathMax = Math.max;\nvar mathAbs = Math.abs;\nvar _extent = [0, 0];\nvar _extent2 = [0, 0];\nvar _intersectCtx = createIntersectContext();\nvar _minTv = _intersectCtx.minTv;\nvar _maxTv = _intersectCtx.maxTv;\nvar OrientedBoundingRect = (function () {\n    function OrientedBoundingRect(rect, transform) {\n        this._corners = [];\n        this._axes = [];\n        this._origin = [0, 0];\n        for (var i = 0; i < 4; i++) {\n            this._corners[i] = new Point();\n        }\n        for (var i = 0; i < 2; i++) {\n            this._axes[i] = new Point();\n        }\n        if (rect) {\n            this.fromBoundingRect(rect, transform);\n        }\n    }\n    OrientedBoundingRect.prototype.fromBoundingRect = function (rect, transform) {\n        var corners = this._corners;\n        var axes = this._axes;\n        var x = rect.x;\n        var y = rect.y;\n        var x2 = x + rect.width;\n        var y2 = y + rect.height;\n        corners[0].set(x, y);\n        corners[1].set(x2, y);\n        corners[2].set(x2, y2);\n        corners[3].set(x, y2);\n        if (transform) {\n            for (var i = 0; i < 4; i++) {\n                corners[i].transform(transform);\n            }\n        }\n        Point.sub(axes[0], corners[1], corners[0]);\n        Point.sub(axes[1], corners[3], corners[0]);\n        axes[0].normalize();\n        axes[1].normalize();\n        for (var i = 0; i < 2; i++) {\n            this._origin[i] = axes[i].dot(corners[0]);\n        }\n    };\n    OrientedBoundingRect.prototype.intersect = function (other, mtv, opt) {\n        var overlapped = true;\n        var noMtv = !mtv;\n        if (mtv) {\n            Point.set(mtv, 0, 0);\n        }\n        _intersectCtx.reset(opt, !noMtv);\n        if (!this._intersectCheckOneSide(this, other, noMtv, 1)) {\n            overlapped = false;\n            if (noMtv) {\n                return overlapped;\n            }\n        }\n        if (!this._intersectCheckOneSide(other, this, noMtv, -1)) {\n            overlapped = false;\n            if (noMtv) {\n                return overlapped;\n            }\n        }\n        if (!noMtv && !_intersectCtx.negativeSize) {\n            Point.copy(mtv, overlapped\n                ? (_intersectCtx.useDir ? _intersectCtx.dirMinTv : _minTv)\n                : _maxTv);\n        }\n        return overlapped;\n    };\n    OrientedBoundingRect.prototype._intersectCheckOneSide = function (self, other, noMtv, inverse) {\n        var overlapped = true;\n        for (var i = 0; i < 2; i++) {\n            var axis = self._axes[i];\n            self._getProjMinMaxOnAxis(i, self._corners, _extent);\n            self._getProjMinMaxOnAxis(i, other._corners, _extent2);\n            if (_intersectCtx.negativeSize || _extent[1] < _extent2[0] || _extent[0] > _extent2[1]) {\n                overlapped = false;\n                if (_intersectCtx.negativeSize || noMtv) {\n                    return overlapped;\n                }\n                var dist0 = mathAbs(_extent2[0] - _extent[1]);\n                var dist1 = mathAbs(_extent[0] - _extent2[1]);\n                if (mathMin(dist0, dist1) > _maxTv.len()) {\n                    if (dist0 < dist1) {\n                        Point.scale(_maxTv, axis, -dist0 * inverse);\n                    }\n                    else {\n                        Point.scale(_maxTv, axis, dist1 * inverse);\n                    }\n                }\n            }\n            else if (!noMtv) {\n                var dist0 = mathAbs(_extent2[0] - _extent[1]);\n                var dist1 = mathAbs(_extent[0] - _extent2[1]);\n                if (_intersectCtx.useDir || mathMin(dist0, dist1) < _minTv.len()) {\n                    if (dist0 < dist1 || !_intersectCtx.bidirectional) {\n                        Point.scale(_minTv, axis, dist0 * inverse);\n                        if (_intersectCtx.useDir) {\n                            _intersectCtx.calcDirMTV();\n                        }\n                    }\n                    if (dist0 >= dist1 || !_intersectCtx.bidirectional) {\n                        Point.scale(_minTv, axis, -dist1 * inverse);\n                        if (_intersectCtx.useDir) {\n                            _intersectCtx.calcDirMTV();\n                        }\n                    }\n                }\n            }\n        }\n        return overlapped;\n    };\n    OrientedBoundingRect.prototype._getProjMinMaxOnAxis = function (dim, corners, out) {\n        var axis = this._axes[dim];\n        var origin = this._origin;\n        var proj = corners[0].dot(axis) + origin[dim];\n        var min = proj;\n        var max = proj;\n        for (var i = 1; i < corners.length; i++) {\n            var proj_1 = corners[i].dot(axis) + origin[dim];\n            min = mathMin(proj_1, min);\n            max = mathMax(proj_1, max);\n        }\n        out[0] = min + _intersectCtx.touchThreshold;\n        out[1] = max - _intersectCtx.touchThreshold;\n        _intersectCtx.negativeSize = out[1] < out[0];\n    };\n    return OrientedBoundingRect;\n}());\nexport default OrientedBoundingRect;\n", "import { __extends } from \"tslib\";\nimport Displayble from './Displayable.js';\nimport BoundingRect from '../core/BoundingRect.js';\nvar m = [];\nvar IncrementalDisplayable = (function (_super) {\n    __extends(IncrementalDisplayable, _super);\n    function IncrementalDisplayable() {\n        var _this = _super !== null && _super.apply(this, arguments) || this;\n        _this.notClear = true;\n        _this.incremental = true;\n        _this._displayables = [];\n        _this._temporaryDisplayables = [];\n        _this._cursor = 0;\n        return _this;\n    }\n    IncrementalDisplayable.prototype.traverse = function (cb, context) {\n        cb.call(context, this);\n    };\n    IncrementalDisplayable.prototype.useStyle = function () {\n        this.style = {};\n    };\n    IncrementalDisplayable.prototype.getCursor = function () {\n        return this._cursor;\n    };\n    IncrementalDisplayable.prototype.innerAfterBrush = function () {\n        this._cursor = this._displayables.length;\n    };\n    IncrementalDisplayable.prototype.clearDisplaybles = function () {\n        this._displayables = [];\n        this._temporaryDisplayables = [];\n        this._cursor = 0;\n        this.markRedraw();\n        this.notClear = false;\n    };\n    IncrementalDisplayable.prototype.clearTemporalDisplayables = function () {\n        this._temporaryDisplayables = [];\n    };\n    IncrementalDisplayable.prototype.addDisplayable = function (displayable, notPersistent) {\n        if (notPersistent) {\n            this._temporaryDisplayables.push(displayable);\n        }\n        else {\n            this._displayables.push(displayable);\n        }\n        this.markRedraw();\n    };\n    IncrementalDisplayable.prototype.addDisplayables = function (displayables, notPersistent) {\n        notPersistent = notPersistent || false;\n        for (var i = 0; i < displayables.length; i++) {\n            this.addDisplayable(displayables[i], notPersistent);\n        }\n    };\n    IncrementalDisplayable.prototype.getDisplayables = function () {\n        return this._displayables;\n    };\n    IncrementalDisplayable.prototype.getTemporalDisplayables = function () {\n        return this._temporaryDisplayables;\n    };\n    IncrementalDisplayable.prototype.eachPendingDisplayable = function (cb) {\n        for (var i = this._cursor; i < this._displayables.length; i++) {\n            cb && cb(this._displayables[i]);\n        }\n        for (var i = 0; i < this._temporaryDisplayables.length; i++) {\n            cb && cb(this._temporaryDisplayables[i]);\n        }\n    };\n    IncrementalDisplayable.prototype.update = function () {\n        this.updateTransform();\n        for (var i = this._cursor; i < this._displayables.length; i++) {\n            var displayable = this._displayables[i];\n            displayable.parent = this;\n            displayable.update();\n            displayable.parent = null;\n        }\n        for (var i = 0; i < this._temporaryDisplayables.length; i++) {\n            var displayable = this._temporaryDisplayables[i];\n            displayable.parent = this;\n            displayable.update();\n            displayable.parent = null;\n        }\n    };\n    IncrementalDisplayable.prototype.getBoundingRect = function () {\n        if (!this._rect) {\n            var rect = new BoundingRect(Infinity, Infinity, -Infinity, -Infinity);\n            for (var i = 0; i < this._displayables.length; i++) {\n                var displayable = this._displayables[i];\n                var childRect = displayable.getBoundingRect().clone();\n                if (displayable.needLocalTransform()) {\n                    childRect.applyTransform(displayable.getLocalTransform(m));\n                }\n                rect.union(childRect);\n            }\n            this._rect = rect;\n        }\n        return this._rect;\n    };\n    IncrementalDisplayable.prototype.contain = function (x, y) {\n        var localPos = this.transformCoordToLocal(x, y);\n        var rect = this.getBoundingRect();\n        if (rect.contain(localPos[0], localPos[1])) {\n            for (var i = 0; i < this._displayables.length; i++) {\n                var displayable = this._displayables[i];\n                if (displayable.contain(x, y)) {\n                    return true;\n                }\n            }\n        }\n        return false;\n    };\n    return IncrementalDisplayable;\n}(Displayble));\nexport default IncrementalDisplayable;\n", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { isFunction, isObject, retrieve2 } from 'zrender/lib/core/util.js';\nimport { makeInner } from '../util/model.js';\n// Stored properties for further transition.\nexport var transitionStore = makeInner();\n/**\n * Return null if animation is disabled.\n */\nexport function getAnimationConfig(animationType, animatableModel, dataIndex,\n// Extra opts can override the option in animatable model.\nextraOpts,\n// TODO It's only for pictorial bar now.\nextraDelayParams) {\n  var animationPayload;\n  // Check if there is global animation configuration from dataZoom/resize can override the config in option.\n  // If animation is enabled. Will use this animation config in payload.\n  // If animation is disabled. Just ignore it.\n  if (animatableModel && animatableModel.ecModel) {\n    var updatePayload = animatableModel.ecModel.getUpdatePayload();\n    animationPayload = updatePayload && updatePayload.animation;\n  }\n  var animationEnabled = animatableModel && animatableModel.isAnimationEnabled();\n  var isUpdate = animationType === 'update';\n  if (animationEnabled) {\n    var duration = void 0;\n    var easing = void 0;\n    var delay = void 0;\n    if (extraOpts) {\n      duration = retrieve2(extraOpts.duration, 200);\n      easing = retrieve2(extraOpts.easing, 'cubicOut');\n      delay = 0;\n    } else {\n      duration = animatableModel.getShallow(isUpdate ? 'animationDurationUpdate' : 'animationDuration');\n      easing = animatableModel.getShallow(isUpdate ? 'animationEasingUpdate' : 'animationEasing');\n      delay = animatableModel.getShallow(isUpdate ? 'animationDelayUpdate' : 'animationDelay');\n    }\n    // animation from payload has highest priority.\n    if (animationPayload) {\n      animationPayload.duration != null && (duration = animationPayload.duration);\n      animationPayload.easing != null && (easing = animationPayload.easing);\n      animationPayload.delay != null && (delay = animationPayload.delay);\n    }\n    if (isFunction(delay)) {\n      delay = delay(dataIndex, extraDelayParams);\n    }\n    if (isFunction(duration)) {\n      duration = duration(dataIndex);\n    }\n    var config = {\n      duration: duration || 0,\n      delay: delay,\n      easing: easing\n    };\n    return config;\n  } else {\n    return null;\n  }\n}\nfunction animateOrSetProps(animationType, el, props, animatableModel, dataIndex, cb, during) {\n  var isFrom = false;\n  var removeOpt;\n  if (isFunction(dataIndex)) {\n    during = cb;\n    cb = dataIndex;\n    dataIndex = null;\n  } else if (isObject(dataIndex)) {\n    cb = dataIndex.cb;\n    during = dataIndex.during;\n    isFrom = dataIndex.isFrom;\n    removeOpt = dataIndex.removeOpt;\n    dataIndex = dataIndex.dataIndex;\n  }\n  var isRemove = animationType === 'leave';\n  if (!isRemove) {\n    // Must stop the remove animation.\n    el.stopAnimation('leave');\n  }\n  var animationConfig = getAnimationConfig(animationType, animatableModel, dataIndex, isRemove ? removeOpt || {} : null, animatableModel && animatableModel.getAnimationDelayParams ? animatableModel.getAnimationDelayParams(el, dataIndex) : null);\n  if (animationConfig && animationConfig.duration > 0) {\n    var duration = animationConfig.duration;\n    var animationDelay = animationConfig.delay;\n    var animationEasing = animationConfig.easing;\n    var animateConfig = {\n      duration: duration,\n      delay: animationDelay || 0,\n      easing: animationEasing,\n      done: cb,\n      force: !!cb || !!during,\n      // Set to final state in update/init animation.\n      // So the post processing based on the path shape can be done correctly.\n      setToFinal: !isRemove,\n      scope: animationType,\n      during: during\n    };\n    isFrom ? el.animateFrom(props, animateConfig) : el.animateTo(props, animateConfig);\n  } else {\n    el.stopAnimation();\n    // If `isFrom`, the props is the \"from\" props.\n    !isFrom && el.attr(props);\n    // Call during at least once.\n    during && during(1);\n    cb && cb();\n  }\n}\n/**\n * Update graphic element properties with or without animation according to the\n * configuration in series.\n *\n * Caution: this method will stop previous animation.\n * So do not use this method to one element twice before\n * animation starts, unless you know what you are doing.\n * @example\n *     graphic.updateProps(el, {\n *         position: [100, 100]\n *     }, seriesModel, dataIndex, function () { console.log('Animation done!'); });\n *     // Or\n *     graphic.updateProps(el, {\n *         position: [100, 100]\n *     }, seriesModel, function () { console.log('Animation done!'); });\n */\nfunction updateProps(el, props,\n// TODO: TYPE AnimatableModel\nanimatableModel, dataIndex, cb, during) {\n  animateOrSetProps('update', el, props, animatableModel, dataIndex, cb, during);\n}\nexport { updateProps };\n/**\n * Init graphic element properties with or without animation according to the\n * configuration in series.\n *\n * Caution: this method will stop previous animation.\n * So do not use this method to one element twice before\n * animation starts, unless you know what you are doing.\n */\nexport function initProps(el, props, animatableModel, dataIndex, cb, during) {\n  animateOrSetProps('enter', el, props, animatableModel, dataIndex, cb, during);\n}\n/**\n * If element is removed.\n * It can determine if element is having remove animation.\n */\nexport function isElementRemoved(el) {\n  if (!el.__zr) {\n    return true;\n  }\n  for (var i = 0; i < el.animators.length; i++) {\n    var animator = el.animators[i];\n    if (animator.scope === 'leave') {\n      return true;\n    }\n  }\n  return false;\n}\n/**\n * Remove graphic element\n */\nexport function removeElement(el, props, animatableModel, dataIndex, cb, during) {\n  // Don't do remove animation twice.\n  if (isElementRemoved(el)) {\n    return;\n  }\n  animateOrSetProps('leave', el, props, animatableModel, dataIndex, cb, during);\n}\nfunction fadeOutDisplayable(el, animatableModel, dataIndex, done) {\n  el.removeTextContent();\n  el.removeTextGuideLine();\n  removeElement(el, {\n    style: {\n      opacity: 0\n    }\n  }, animatableModel, dataIndex, done);\n}\nexport function removeElementWithFadeOut(el, animatableModel, dataIndex) {\n  function doRemove() {\n    el.parent && el.parent.remove(el);\n  }\n  // Hide label and labelLine first\n  // TODO Also use fade out animation?\n  if (!el.isGroup) {\n    fadeOutDisplayable(el, animatableModel, dataIndex, doRemove);\n  } else {\n    el.traverse(function (disp) {\n      if (!disp.isGroup) {\n        // Can invoke doRemove multiple times.\n        fadeOutDisplayable(disp, animatableModel, dataIndex, doRemove);\n      }\n    });\n  }\n}\n/**\n * Save old style for style transition in universalTransition module.\n * It's used when element will be reused in each render.\n * For chart like map, heatmap, which will always create new element.\n * We don't need to save this because universalTransition can get old style from the old element\n */\nexport function saveOldStyle(el) {\n  transitionStore(el).oldStyle = el.style;\n}\nexport function getOldStyle(el) {\n  return transitionStore(el).oldStyle;\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport ZRText from 'zrender/lib/graphic/Text.js';\nimport { isFunction, retrieve2, extend, keys, trim, retrieve3, isNumber, normalizeCssArray } from 'zrender/lib/core/util.js';\nimport { SPECIAL_STATES, DISPLAY_STATES } from '../util/states.js';\nimport { deprecateReplaceLog } from '../util/log.js';\nimport { makeInner, interpolateRawValues } from '../util/model.js';\nimport { initProps, updateProps } from '../util/graphic.js';\nvar EMPTY_OBJ = {};\nexport function setLabelText(label, labelTexts) {\n  for (var i = 0; i < SPECIAL_STATES.length; i++) {\n    var stateName = SPECIAL_STATES[i];\n    var text = labelTexts[stateName];\n    var state = label.ensureState(stateName);\n    state.style = state.style || {};\n    state.style.text = text;\n  }\n  var oldStates = label.currentStates.slice();\n  label.clearStates(true);\n  label.setStyle({\n    text: labelTexts.normal\n  });\n  label.useStates(oldStates, true);\n}\nfunction getLabelText(opt, stateModels, interpolatedValue) {\n  var labelFetcher = opt.labelFetcher;\n  var labelDataIndex = opt.labelDataIndex;\n  var labelDimIndex = opt.labelDimIndex;\n  var normalModel = stateModels.normal;\n  var baseText;\n  if (labelFetcher) {\n    baseText = labelFetcher.getFormattedLabel(labelDataIndex, 'normal', null, labelDimIndex, normalModel && normalModel.get('formatter'), interpolatedValue != null ? {\n      interpolatedValue: interpolatedValue\n    } : null);\n  }\n  if (baseText == null) {\n    baseText = isFunction(opt.defaultText) ? opt.defaultText(labelDataIndex, opt, interpolatedValue) : opt.defaultText;\n  }\n  var statesText = {\n    normal: baseText\n  };\n  for (var i = 0; i < SPECIAL_STATES.length; i++) {\n    var stateName = SPECIAL_STATES[i];\n    var stateModel = stateModels[stateName];\n    statesText[stateName] = retrieve2(labelFetcher ? labelFetcher.getFormattedLabel(labelDataIndex, stateName, null, labelDimIndex, stateModel && stateModel.get('formatter')) : null, baseText);\n  }\n  return statesText;\n}\nfunction setLabelStyle(targetEl, labelStatesModels, opt, stateSpecified\n// TODO specified position?\n) {\n  opt = opt || EMPTY_OBJ;\n  var isSetOnText = targetEl instanceof ZRText;\n  var needsCreateText = false;\n  for (var i = 0; i < DISPLAY_STATES.length; i++) {\n    var stateModel = labelStatesModels[DISPLAY_STATES[i]];\n    if (stateModel && stateModel.getShallow('show')) {\n      needsCreateText = true;\n      break;\n    }\n  }\n  var textContent = isSetOnText ? targetEl : targetEl.getTextContent();\n  if (needsCreateText) {\n    if (!isSetOnText) {\n      // Reuse the previous\n      if (!textContent) {\n        textContent = new ZRText();\n        targetEl.setTextContent(textContent);\n      }\n      // Use same state proxy\n      if (targetEl.stateProxy) {\n        textContent.stateProxy = targetEl.stateProxy;\n      }\n    }\n    var labelStatesTexts = getLabelText(opt, labelStatesModels);\n    var normalModel = labelStatesModels.normal;\n    var showNormal = !!normalModel.getShallow('show');\n    var normalStyle = createTextStyle(normalModel, stateSpecified && stateSpecified.normal, opt, false, !isSetOnText);\n    normalStyle.text = labelStatesTexts.normal;\n    if (!isSetOnText) {\n      // Always create new\n      targetEl.setTextConfig(createTextConfig(normalModel, opt, false));\n    }\n    for (var i = 0; i < SPECIAL_STATES.length; i++) {\n      var stateName = SPECIAL_STATES[i];\n      var stateModel = labelStatesModels[stateName];\n      if (stateModel) {\n        var stateObj = textContent.ensureState(stateName);\n        var stateShow = !!retrieve2(stateModel.getShallow('show'), showNormal);\n        if (stateShow !== showNormal) {\n          stateObj.ignore = !stateShow;\n        }\n        stateObj.style = createTextStyle(stateModel, stateSpecified && stateSpecified[stateName], opt, true, !isSetOnText);\n        stateObj.style.text = labelStatesTexts[stateName];\n        if (!isSetOnText) {\n          var targetElEmphasisState = targetEl.ensureState(stateName);\n          targetElEmphasisState.textConfig = createTextConfig(stateModel, opt, true);\n        }\n      }\n    }\n    // PENDING: if there is many requirements that emphasis position\n    // need to be different from normal position, we might consider\n    // auto silent is those cases.\n    textContent.silent = !!normalModel.getShallow('silent');\n    // Keep x and y\n    if (textContent.style.x != null) {\n      normalStyle.x = textContent.style.x;\n    }\n    if (textContent.style.y != null) {\n      normalStyle.y = textContent.style.y;\n    }\n    textContent.ignore = !showNormal;\n    // Always create new style.\n    textContent.useStyle(normalStyle);\n    textContent.dirty();\n    if (opt.enableTextSetter) {\n      labelInner(textContent).setLabelText = function (interpolatedValue) {\n        var labelStatesTexts = getLabelText(opt, labelStatesModels, interpolatedValue);\n        setLabelText(textContent, labelStatesTexts);\n      };\n    }\n  } else if (textContent) {\n    // Not display rich text.\n    textContent.ignore = true;\n  }\n  targetEl.dirty();\n}\nexport { setLabelStyle };\nexport function getLabelStatesModels(itemModel, labelName) {\n  labelName = labelName || 'label';\n  var statesModels = {\n    normal: itemModel.getModel(labelName)\n  };\n  for (var i = 0; i < SPECIAL_STATES.length; i++) {\n    var stateName = SPECIAL_STATES[i];\n    statesModels[stateName] = itemModel.getModel([stateName, labelName]);\n  }\n  return statesModels;\n}\n/**\n * Set basic textStyle properties.\n */\nexport function createTextStyle(textStyleModel, specifiedTextStyle,\n// Fixed style in the code. Can't be set by model.\nopt, isNotNormal, isAttached // If text is attached on an element. If so, auto color will handling in zrender.\n) {\n  var textStyle = {};\n  setTextStyleCommon(textStyle, textStyleModel, opt, isNotNormal, isAttached);\n  specifiedTextStyle && extend(textStyle, specifiedTextStyle);\n  // textStyle.host && textStyle.host.dirty && textStyle.host.dirty(false);\n  return textStyle;\n}\nexport function createTextConfig(textStyleModel, opt, isNotNormal) {\n  opt = opt || {};\n  var textConfig = {};\n  var labelPosition;\n  var labelRotate = textStyleModel.getShallow('rotate');\n  var labelDistance = retrieve2(textStyleModel.getShallow('distance'), isNotNormal ? null : 5);\n  var labelOffset = textStyleModel.getShallow('offset');\n  labelPosition = textStyleModel.getShallow('position') || (isNotNormal ? null : 'inside');\n  // 'outside' is not a valid zr textPostion value, but used\n  // in bar series, and magic type should be considered.\n  labelPosition === 'outside' && (labelPosition = opt.defaultOutsidePosition || 'top');\n  if (labelPosition != null) {\n    textConfig.position = labelPosition;\n  }\n  if (labelOffset != null) {\n    textConfig.offset = labelOffset;\n  }\n  if (labelRotate != null) {\n    labelRotate *= Math.PI / 180;\n    textConfig.rotation = labelRotate;\n  }\n  if (labelDistance != null) {\n    textConfig.distance = labelDistance;\n  }\n  // fill and auto is determined by the color of path fill if it's not specified by developers.\n  textConfig.outsideFill = textStyleModel.get('color') === 'inherit' ? opt.inheritColor || null : 'auto';\n  if (opt.autoOverflowArea != null) {\n    textConfig.autoOverflowArea = opt.autoOverflowArea;\n  }\n  if (opt.layoutRect != null) {\n    textConfig.layoutRect = opt.layoutRect;\n  }\n  return textConfig;\n}\n/**\n * The uniform entry of set text style, that is, retrieve style definitions\n * from `model` and set to `textStyle` object.\n *\n * Never in merge mode, but in overwrite mode, that is, all of the text style\n * properties will be set. (Consider the states of normal and emphasis and\n * default value can be adopted, merge would make the logic too complicated\n * to manage.)\n */\nfunction setTextStyleCommon(textStyle, textStyleModel, opt, isNotNormal, isAttached) {\n  // Consider there will be abnormal when merge hover style to normal style if given default value.\n  opt = opt || EMPTY_OBJ;\n  var ecModel = textStyleModel.ecModel;\n  var globalTextStyle = ecModel && ecModel.option.textStyle;\n  // Consider case:\n  // {\n  //     data: [{\n  //         value: 12,\n  //         label: {\n  //             rich: {\n  //                 // no 'a' here but using parent 'a'.\n  //             }\n  //         }\n  //     }],\n  //     rich: {\n  //         a: { ... }\n  //     }\n  // }\n  var richItemNames = getRichItemNames(textStyleModel);\n  var richResult;\n  if (richItemNames) {\n    richResult = {};\n    var richInheritPlainLabelOptionName = 'richInheritPlainLabel';\n    var richInheritPlainLabel = retrieve2(textStyleModel.get(richInheritPlainLabelOptionName), ecModel ? ecModel.get(richInheritPlainLabelOptionName) : undefined);\n    for (var name_1 in richItemNames) {\n      if (richItemNames.hasOwnProperty(name_1)) {\n        // Cascade is supported in rich.\n        var richTextStyle = textStyleModel.getModel(['rich', name_1]);\n        // In rich, never `disableBox`.\n        // consider `label: {formatter: '{a|xx}', color: 'blue', rich: {a: {}}}`,\n        // the default color `'blue'` will not be adopted if no color declared in `rich`.\n        // That might confuses users. So probably we should put `textStyleModel` as the\n        // root ancestor of the `richTextStyle`. But that would be a break change.\n        // Since v6, the rich style inherits plain label by default\n        // but this behavior can be disabled by setting `richInheritPlainLabel` to `false`.\n        setTokenTextStyle(richResult[name_1] = {}, richTextStyle, globalTextStyle, textStyleModel, richInheritPlainLabel, opt, isNotNormal, isAttached, false, true);\n      }\n    }\n  }\n  if (richResult) {\n    textStyle.rich = richResult;\n  }\n  var overflow = textStyleModel.get('overflow');\n  if (overflow) {\n    textStyle.overflow = overflow;\n  }\n  var lineOverflow = textStyleModel.get('lineOverflow');\n  if (lineOverflow) {\n    textStyle.lineOverflow = lineOverflow;\n  }\n  var labelTextStyle = textStyle;\n  // `minMargin` has a higher precedence than `textMargin`, because `textMargin` is allowed\n  // to be set in `defaultOption`.\n  var minMargin = textStyleModel.get('minMargin');\n  if (minMargin != null) {\n    // `minMargin` only support number value.\n    minMargin = !isNumber(minMargin) ? 0 : minMargin / 2;\n    labelTextStyle.margin = [minMargin, minMargin, minMargin, minMargin];\n    labelTextStyle.__marginType = LabelMarginType.minMargin;\n  } else {\n    var textMargin = textStyleModel.get('textMargin');\n    if (textMargin != null) {\n      labelTextStyle.margin = normalizeCssArray(textMargin);\n      labelTextStyle.__marginType = LabelMarginType.textMargin;\n    }\n  }\n  setTokenTextStyle(textStyle, textStyleModel, globalTextStyle, null, null, opt, isNotNormal, isAttached, true, false);\n}\n// Consider case:\n// {\n//     data: [{\n//         value: 12,\n//         label: {\n//             rich: {\n//                 // no 'a' here but using parent 'a'.\n//             }\n//         }\n//     }],\n//     rich: {\n//         a: { ... }\n//     }\n// }\n// TODO TextStyleModel\nfunction getRichItemNames(textStyleModel) {\n  // Use object to remove duplicated names.\n  var richItemNameMap;\n  while (textStyleModel && textStyleModel !== textStyleModel.ecModel) {\n    var rich = (textStyleModel.option || EMPTY_OBJ).rich;\n    if (rich) {\n      richItemNameMap = richItemNameMap || {};\n      var richKeys = keys(rich);\n      for (var i = 0; i < richKeys.length; i++) {\n        var richKey = richKeys[i];\n        richItemNameMap[richKey] = 1;\n      }\n    }\n    textStyleModel = textStyleModel.parentModel;\n  }\n  return richItemNameMap;\n}\nvar TEXT_PROPS_WITH_GLOBAL = ['fontStyle', 'fontWeight', 'fontSize', 'fontFamily', 'textShadowColor', 'textShadowBlur', 'textShadowOffsetX', 'textShadowOffsetY'];\nvar TEXT_PROPS_SELF = ['align', 'lineHeight', 'width', 'height', 'tag', 'verticalAlign', 'ellipsis'];\nvar TEXT_PROPS_BOX = ['padding', 'borderWidth', 'borderRadius', 'borderDashOffset', 'backgroundColor', 'borderColor', 'shadowColor', 'shadowBlur', 'shadowOffsetX', 'shadowOffsetY'];\nfunction setTokenTextStyle(textStyle,\n// FIXME: check/refactor for ellipsis handling of rich text.\ntextStyleModel, globalTextStyle, plainTextModel, richInheritPlainLabel, opt, isNotNormal, isAttached, isBlock, inRich) {\n  // In merge mode, default value should not be given.\n  globalTextStyle = !isNotNormal && globalTextStyle || EMPTY_OBJ;\n  var inheritColor = opt && opt.inheritColor;\n  var fillColor = textStyleModel.getShallow('color');\n  var strokeColor = textStyleModel.getShallow('textBorderColor');\n  var opacity = retrieve2(textStyleModel.getShallow('opacity'), globalTextStyle.opacity);\n  if (fillColor === 'inherit' || fillColor === 'auto') {\n    if (process.env.NODE_ENV !== 'production') {\n      if (fillColor === 'auto') {\n        deprecateReplaceLog('color: \\'auto\\'', 'color: \\'inherit\\'');\n      }\n    }\n    if (inheritColor) {\n      fillColor = inheritColor;\n    } else {\n      fillColor = null;\n    }\n  }\n  if (strokeColor === 'inherit' || strokeColor === 'auto') {\n    if (process.env.NODE_ENV !== 'production') {\n      if (strokeColor === 'auto') {\n        deprecateReplaceLog('color: \\'auto\\'', 'color: \\'inherit\\'');\n      }\n    }\n    if (inheritColor) {\n      strokeColor = inheritColor;\n    } else {\n      strokeColor = null;\n    }\n  }\n  if (!isAttached) {\n    // Only use default global textStyle.color if text is individual.\n    // Otherwise it will use the strategy of attached text color because text may be on a path.\n    fillColor = fillColor || globalTextStyle.color;\n    strokeColor = strokeColor || globalTextStyle.textBorderColor;\n  }\n  if (fillColor != null) {\n    // Might not be a string, e.g, it's a function in axisLabel case; but assume that it will\n    // be erased by a correct value outside.\n    textStyle.fill = fillColor;\n  }\n  if (strokeColor != null) {\n    textStyle.stroke = strokeColor;\n  }\n  var textBorderWidth = retrieve2(textStyleModel.getShallow('textBorderWidth'), globalTextStyle.textBorderWidth);\n  if (textBorderWidth != null) {\n    textStyle.lineWidth = textBorderWidth;\n  }\n  var textBorderType = retrieve2(textStyleModel.getShallow('textBorderType'), globalTextStyle.textBorderType);\n  if (textBorderType != null) {\n    textStyle.lineDash = textBorderType;\n  }\n  var textBorderDashOffset = retrieve2(textStyleModel.getShallow('textBorderDashOffset'), globalTextStyle.textBorderDashOffset);\n  if (textBorderDashOffset != null) {\n    textStyle.lineDashOffset = textBorderDashOffset;\n  }\n  if (!isNotNormal && opacity == null && !inRich) {\n    opacity = opt && opt.defaultOpacity;\n  }\n  if (opacity != null) {\n    textStyle.opacity = opacity;\n  }\n  // TODO\n  if (!isNotNormal && !isAttached) {\n    // Set default finally.\n    if (textStyle.fill == null && opt.inheritColor) {\n      textStyle.fill = opt.inheritColor;\n    }\n  }\n  // Do not use `getFont` here, because merge should be supported, where\n  // part of these properties may be changed in emphasis style, and the\n  // others should remain their original value got from normal style.\n  for (var i = 0; i < TEXT_PROPS_WITH_GLOBAL.length; i++) {\n    var key = TEXT_PROPS_WITH_GLOBAL[i];\n    // props width, height, padding, margin, tag, backgroundColor, borderColor,\n    // borderWidth, borderRadius, shadowColor, shadowBlur, shadowOffsetX, shadowOffsetY\n    // may inappropriate to inherit from plainTextStyle.\n    // And if some props is specified in default options, users may have to reset them one by one.\n    // Therefore, we only allow these props to inherit from plainTextStyle.\n    // `richInheritPlainLabel` is switch for backward compatibility\n    var val = richInheritPlainLabel !== false && plainTextModel ? retrieve3(textStyleModel.getShallow(key), plainTextModel.getShallow(key), globalTextStyle[key]) : retrieve2(textStyleModel.getShallow(key), globalTextStyle[key]);\n    if (val != null) {\n      textStyle[key] = val;\n    }\n  }\n  for (var i = 0; i < TEXT_PROPS_SELF.length; i++) {\n    var key = TEXT_PROPS_SELF[i];\n    var val = textStyleModel.getShallow(key);\n    if (val != null) {\n      textStyle[key] = val;\n    }\n  }\n  if (textStyle.verticalAlign == null) {\n    var baseline = textStyleModel.getShallow('baseline');\n    if (baseline != null) {\n      textStyle.verticalAlign = baseline;\n    }\n  }\n  if (!isBlock || !opt.disableBox) {\n    for (var i = 0; i < TEXT_PROPS_BOX.length; i++) {\n      var key = TEXT_PROPS_BOX[i];\n      var val = textStyleModel.getShallow(key);\n      if (val != null) {\n        textStyle[key] = val;\n      }\n    }\n    var borderType = textStyleModel.getShallow('borderType');\n    if (borderType != null) {\n      textStyle.borderDash = borderType;\n    }\n    if ((textStyle.backgroundColor === 'auto' || textStyle.backgroundColor === 'inherit') && inheritColor) {\n      if (process.env.NODE_ENV !== 'production') {\n        if (textStyle.backgroundColor === 'auto') {\n          deprecateReplaceLog('backgroundColor: \\'auto\\'', 'backgroundColor: \\'inherit\\'');\n        }\n      }\n      textStyle.backgroundColor = inheritColor;\n    }\n    if ((textStyle.borderColor === 'auto' || textStyle.borderColor === 'inherit') && inheritColor) {\n      if (process.env.NODE_ENV !== 'production') {\n        if (textStyle.borderColor === 'auto') {\n          deprecateReplaceLog('borderColor: \\'auto\\'', 'borderColor: \\'inherit\\'');\n        }\n      }\n      textStyle.borderColor = inheritColor;\n    }\n  }\n}\nexport function getFont(opt, ecModel) {\n  var gTextStyleModel = ecModel && ecModel.getModel('textStyle');\n  return trim([\n  // FIXME in node-canvas fontWeight is before fontStyle\n  opt.fontStyle || gTextStyleModel && gTextStyleModel.getShallow('fontStyle') || '', opt.fontWeight || gTextStyleModel && gTextStyleModel.getShallow('fontWeight') || '', (opt.fontSize || gTextStyleModel && gTextStyleModel.getShallow('fontSize') || 12) + 'px', opt.fontFamily || gTextStyleModel && gTextStyleModel.getShallow('fontFamily') || 'sans-serif'].join(' '));\n}\nexport var labelInner = makeInner();\nexport function setLabelValueAnimation(label, labelStatesModels, value, getDefaultText) {\n  if (!label) {\n    return;\n  }\n  var obj = labelInner(label);\n  obj.prevValue = obj.value;\n  obj.value = value;\n  var normalLabelModel = labelStatesModels.normal;\n  obj.valueAnimation = normalLabelModel.get('valueAnimation');\n  if (obj.valueAnimation) {\n    obj.precision = normalLabelModel.get('precision');\n    obj.defaultInterpolatedText = getDefaultText;\n    obj.statesModels = labelStatesModels;\n  }\n}\nexport function animateLabelValue(textEl, dataIndex, data, animatableModel, labelFetcher) {\n  var labelInnerStore = labelInner(textEl);\n  if (!labelInnerStore.valueAnimation || labelInnerStore.prevValue === labelInnerStore.value) {\n    // Value not changed, no new label animation\n    return;\n  }\n  var defaultInterpolatedText = labelInnerStore.defaultInterpolatedText;\n  // Consider the case that being animating, do not use the `obj.value`,\n  // Otherwise it will jump to the `obj.value` when this new animation started.\n  var currValue = retrieve2(labelInnerStore.interpolatedValue, labelInnerStore.prevValue);\n  var targetValue = labelInnerStore.value;\n  function during(percent) {\n    var interpolated = interpolateRawValues(data, labelInnerStore.precision, currValue, targetValue, percent);\n    labelInnerStore.interpolatedValue = percent === 1 ? null : interpolated;\n    var labelText = getLabelText({\n      labelDataIndex: dataIndex,\n      labelFetcher: labelFetcher,\n      defaultText: defaultInterpolatedText ? defaultInterpolatedText(interpolated) : interpolated + ''\n    }, labelInnerStore.statesModels, interpolated);\n    setLabelText(textEl, labelText);\n  }\n  textEl.percent = 0;\n  (labelInnerStore.prevValue == null ? initProps : updateProps)(textEl, {\n    // percent is used to prevent animation from being aborted #15916\n    percent: 1\n  }, animatableModel, dataIndex, null, during);\n}\n/**\n * PENDING: Temporary impl. unify them?\n * @see {LabelCommonOption['textMargin']}\n * @see {LabelCommonOption['minMargin']}\n */\nexport var LabelMarginType = {\n  minMargin: 1,\n  textMargin: 2\n};", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { getFont } from '../../label/labelStyle.js';\nimport ZRText from 'zrender/lib/graphic/Text.js';\nvar PATH_COLOR = ['textStyle', 'color'];\nvar textStyleParams = ['fontStyle', 'fontWeight', 'fontSize', 'fontFamily', 'padding', 'lineHeight', 'rich', 'width', 'height', 'overflow'];\n// TODO Performance improvement?\nvar tmpText = new ZRText();\nvar TextStyleMixin = /** @class */function () {\n  function TextStyleMixin() {}\n  /**\n   * Get color property or get color from option.textStyle.color\n   */\n  // TODO Callback\n  TextStyleMixin.prototype.getTextColor = function (isEmphasis) {\n    var ecModel = this.ecModel;\n    return this.getShallow('color') || (!isEmphasis && ecModel ? ecModel.get(PATH_COLOR) : null);\n  };\n  /**\n   * Create font string from fontStyle, fontWeight, fontSize, fontFamily\n   * @return {string}\n   */\n  TextStyleMixin.prototype.getFont = function () {\n    return getFont({\n      fontStyle: this.getShallow('fontStyle'),\n      fontWeight: this.getShallow('fontWeight'),\n      fontSize: this.getShallow('fontSize'),\n      fontFamily: this.getShallow('fontFamily')\n    }, this.ecModel);\n  };\n  TextStyleMixin.prototype.getTextRect = function (text) {\n    var style = {\n      text: text,\n      verticalAlign: this.getShallow('verticalAlign') || this.getShallow('baseline')\n    };\n    for (var i = 0; i < textStyleParams.length; i++) {\n      style[textStyleParams[i]] = this.getShallow(textStyleParams[i]);\n    }\n    tmpText.useStyle(style);\n    tmpText.update();\n    return tmpText.getBoundingRect();\n  };\n  return TextStyleMixin;\n}();\n;\nexport default TextStyleMixin;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport makeStyleMapper from './makeStyleMapper.js';\nexport var LINE_STYLE_KEY_MAP = [['lineWidth', 'width'], ['stroke', 'color'], ['opacity'], ['shadowBlur'], ['shadowOffsetX'], ['shadowOffsetY'], ['shadowColor'], ['lineDash', 'type'], ['lineDashOffset', 'dashOffset'], ['lineCap', 'cap'], ['lineJoin', 'join'], ['miterLimit']\n// Option decal is in `DecalObject` but style.decal is in `PatternObject`.\n// So do not transfer decal directly.\n];\nvar getLineStyle = makeStyleMapper(LINE_STYLE_KEY_MAP);\nvar LineStyleMixin = /** @class */function () {\n  function LineStyleMixin() {}\n  LineStyleMixin.prototype.getLineStyle = function (excludes) {\n    return getLineStyle(this, excludes);\n  };\n  return LineStyleMixin;\n}();\n;\nexport { LineStyleMixin };", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport makeStyleMapper from './makeStyleMapper.js';\nexport var ITEM_STYLE_KEY_MAP = [['fill', 'color'], ['stroke', 'borderColor'], ['lineWidth', 'borderWidth'], ['opacity'], ['shadowBlur'], ['shadowOffsetX'], ['shadowOffsetY'], ['shadowColor'], ['lineDash', 'borderType'], ['lineDashOffset', 'borderDashOffset'], ['lineCap', 'borderCap'], ['lineJoin', 'borderJoin'], ['miterLimit', 'borderMiterLimit']\n// Option decal is in `DecalObject` but style.decal is in `PatternObject`.\n// So do not transfer decal directly.\n];\nvar getItemStyle = makeStyleMapper(ITEM_STYLE_KEY_MAP);\nvar ItemStyleMixin = /** @class */function () {\n  function ItemStyleMixin() {}\n  ItemStyleMixin.prototype.getItemStyle = function (excludes, includes) {\n    return getItemStyle(this, excludes, includes);\n  };\n  return ItemStyleMixin;\n}();\nexport { ItemStyleMixin };", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport env from 'zrender/lib/core/env.js';\nimport { enableClassExtend, enableClassCheck } from '../util/clazz.js';\nimport { AreaStyleMixin } from './mixin/areaStyle.js';\nimport TextStyleMixin from './mixin/textStyle.js';\nimport { LineStyleMixin } from './mixin/lineStyle.js';\nimport { ItemStyleMixin } from './mixin/itemStyle.js';\nimport { mixin, clone, merge } from 'zrender/lib/core/util.js';\nvar Model = /** @class */function () {\n  function Model(option, parentModel, ecModel) {\n    this.parentModel = parentModel;\n    this.ecModel = ecModel;\n    this.option = option;\n    // Simple optimization\n    // if (this.init) {\n    //     if (arguments.length <= 4) {\n    //         this.init(option, parentModel, ecModel, extraOpt);\n    //     }\n    //     else {\n    //         this.init.apply(this, arguments);\n    //     }\n    // }\n  }\n  Model.prototype.init = function (option, parentModel, ecModel) {\n    var rest = [];\n    for (var _i = 3; _i < arguments.length; _i++) {\n      rest[_i - 3] = arguments[_i];\n    }\n  };\n  /**\n   * Merge the input option to me.\n   */\n  Model.prototype.mergeOption = function (option, ecModel) {\n    merge(this.option, option, true);\n  };\n  // `path` can be 'a.b.c', so the return value type have to be `ModelOption`\n  // TODO: TYPE strict key check?\n  // get(path: string | string[], ignoreParent?: boolean): ModelOption;\n  Model.prototype.get = function (path, ignoreParent) {\n    if (path == null) {\n      return this.option;\n    }\n    return this._doGet(this.parsePath(path), !ignoreParent && this.parentModel);\n  };\n  Model.prototype.getShallow = function (key, ignoreParent) {\n    var option = this.option;\n    var val = option == null ? option : option[key];\n    if (val == null && !ignoreParent) {\n      var parentModel = this.parentModel;\n      if (parentModel) {\n        // FIXME:TS do not know how to make it works\n        val = parentModel.getShallow(key);\n      }\n    }\n    return val;\n  };\n  // `path` can be 'a.b.c', so the return value type have to be `Model<ModelOption>`\n  // getModel(path: string | string[], parentModel?: Model): Model;\n  // TODO 'a.b.c' is deprecated\n  Model.prototype.getModel = function (path, parentModel) {\n    var hasPath = path != null;\n    var pathFinal = hasPath ? this.parsePath(path) : null;\n    var obj = hasPath ? this._doGet(pathFinal) : this.option;\n    parentModel = parentModel || this.parentModel && this.parentModel.getModel(this.resolveParentPath(pathFinal));\n    return new Model(obj, parentModel, this.ecModel);\n  };\n  /**\n   * If model has option\n   */\n  Model.prototype.isEmpty = function () {\n    return this.option == null;\n  };\n  Model.prototype.restoreData = function () {};\n  // Pending\n  Model.prototype.clone = function () {\n    var Ctor = this.constructor;\n    return new Ctor(clone(this.option));\n  };\n  // setReadOnly(properties): void {\n  // clazzUtil.setReadOnly(this, properties);\n  // }\n  // If path is null/undefined, return null/undefined.\n  Model.prototype.parsePath = function (path) {\n    if (typeof path === 'string') {\n      return path.split('.');\n    }\n    return path;\n  };\n  // Resolve path for parent. Perhaps useful when parent use a different property.\n  // Default to be a identity resolver.\n  // Can be modified to a different resolver.\n  Model.prototype.resolveParentPath = function (path) {\n    return path;\n  };\n  // FIXME:TS check whether put this method here\n  Model.prototype.isAnimationEnabled = function () {\n    if (!env.node && this.option) {\n      if (this.option.animation != null) {\n        return !!this.option.animation;\n      } else if (this.parentModel) {\n        return this.parentModel.isAnimationEnabled();\n      }\n    }\n  };\n  Model.prototype._doGet = function (pathArr, parentModel) {\n    var obj = this.option;\n    if (!pathArr) {\n      return obj;\n    }\n    for (var i = 0; i < pathArr.length; i++) {\n      // Ignore empty\n      if (!pathArr[i]) {\n        continue;\n      }\n      // obj could be number/string/... (like 0)\n      obj = obj && typeof obj === 'object' ? obj[pathArr[i]] : null;\n      if (obj == null) {\n        break;\n      }\n    }\n    if (obj == null && parentModel) {\n      obj = parentModel._doGet(this.resolveParentPath(pathArr), parentModel.parentModel);\n    }\n    return obj;\n  };\n  return Model;\n}();\n;\n// Enable Model.extend.\nenableClassExtend(Model);\nenableClassCheck(Model);\nmixin(Model, LineStyleMixin);\nmixin(Model, ItemStyleMixin);\nmixin(Model, AreaStyleMixin);\nmixin(Model, TextStyleMixin);\nexport default Model;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { parseClassType } from './clazz.js';\nimport { makePrintable } from './log.js';\n// A random offset\nvar base = Math.round(Math.random() * 10);\n/**\n * @public\n * @param {string} type\n * @return {string}\n */\nexport function getUID(type) {\n  // Considering the case of crossing js context,\n  // use Math.random to make id as unique as possible.\n  return [type || '', base++].join('_');\n}\n/**\n * Implements `SubTypeDefaulterManager` for `target`.\n */\nexport function enableSubTypeDefaulter(target) {\n  var subTypeDefaulters = {};\n  target.registerSubTypeDefaulter = function (componentType, defaulter) {\n    var componentTypeInfo = parseClassType(componentType);\n    subTypeDefaulters[componentTypeInfo.main] = defaulter;\n  };\n  target.determineSubType = function (componentType, option) {\n    var type = option.type;\n    if (!type) {\n      var componentTypeMain = parseClassType(componentType).main;\n      if (target.hasSubTypes(componentType) && subTypeDefaulters[componentTypeMain]) {\n        type = subTypeDefaulters[componentTypeMain](option);\n      }\n    }\n    return type;\n  };\n}\n/**\n * Implements `TopologicalTravelable<any>` for `entity`.\n *\n * Topological travel on Activity Network (Activity On Vertices).\n * Dependencies is defined in Model.prototype.dependencies, like ['xAxis', 'yAxis'].\n * If 'xAxis' or 'yAxis' is absent in componentTypeList, just ignore it in topology.\n * If there is circular dependencey, Error will be thrown.\n */\nexport function enableTopologicalTravel(entity, dependencyGetter) {\n  /**\n   * @param targetNameList Target Component type list.\n   *                       Can be ['aa', 'bb', 'aa.xx']\n   * @param fullNameList By which we can build dependency graph.\n   * @param callback Params: componentType, dependencies.\n   * @param context Scope of callback.\n   */\n  entity.topologicalTravel = function (targetNameList, fullNameList, callback, context) {\n    if (!targetNameList.length) {\n      return;\n    }\n    var result = makeDepndencyGraph(fullNameList);\n    var graph = result.graph;\n    var noEntryList = result.noEntryList;\n    var targetNameSet = {};\n    zrUtil.each(targetNameList, function (name) {\n      targetNameSet[name] = true;\n    });\n    while (noEntryList.length) {\n      var currComponentType = noEntryList.pop();\n      var currVertex = graph[currComponentType];\n      var isInTargetNameSet = !!targetNameSet[currComponentType];\n      if (isInTargetNameSet) {\n        callback.call(context, currComponentType, currVertex.originalDeps.slice());\n        delete targetNameSet[currComponentType];\n      }\n      zrUtil.each(currVertex.successor, isInTargetNameSet ? removeEdgeAndAdd : removeEdge);\n    }\n    zrUtil.each(targetNameSet, function () {\n      var errMsg = '';\n      if (process.env.NODE_ENV !== 'production') {\n        errMsg = makePrintable('Circular dependency may exists: ', targetNameSet, targetNameList, fullNameList);\n      }\n      throw new Error(errMsg);\n    });\n    function removeEdge(succComponentType) {\n      graph[succComponentType].entryCount--;\n      if (graph[succComponentType].entryCount === 0) {\n        noEntryList.push(succComponentType);\n      }\n    }\n    // Consider this case: legend depends on series, and we call\n    // chart.setOption({series: [...]}), where only series is in option.\n    // If we do not have 'removeEdgeAndAdd', legendModel.mergeOption will\n    // not be called, but only sereis.mergeOption is called. Thus legend\n    // have no chance to update its local record about series (like which\n    // name of series is available in legend).\n    function removeEdgeAndAdd(succComponentType) {\n      targetNameSet[succComponentType] = true;\n      removeEdge(succComponentType);\n    }\n  };\n  function makeDepndencyGraph(fullNameList) {\n    var graph = {};\n    var noEntryList = [];\n    zrUtil.each(fullNameList, function (name) {\n      var thisItem = createDependencyGraphItem(graph, name);\n      var originalDeps = thisItem.originalDeps = dependencyGetter(name);\n      var availableDeps = getAvailableDependencies(originalDeps, fullNameList);\n      thisItem.entryCount = availableDeps.length;\n      if (thisItem.entryCount === 0) {\n        noEntryList.push(name);\n      }\n      zrUtil.each(availableDeps, function (dependentName) {\n        if (zrUtil.indexOf(thisItem.predecessor, dependentName) < 0) {\n          thisItem.predecessor.push(dependentName);\n        }\n        var thatItem = createDependencyGraphItem(graph, dependentName);\n        if (zrUtil.indexOf(thatItem.successor, dependentName) < 0) {\n          thatItem.successor.push(name);\n        }\n      });\n    });\n    return {\n      graph: graph,\n      noEntryList: noEntryList\n    };\n  }\n  function createDependencyGraphItem(graph, name) {\n    if (!graph[name]) {\n      graph[name] = {\n        predecessor: [],\n        successor: []\n      };\n    }\n    return graph[name];\n  }\n  function getAvailableDependencies(originalDeps, fullNameList) {\n    var availableDeps = [];\n    zrUtil.each(originalDeps, function (dep) {\n      zrUtil.indexOf(fullNameList, dep) >= 0 && availableDeps.push(dep);\n    });\n    return availableDeps;\n  }\n}\nexport function inheritDefaultOption(superOption, subOption) {\n  // See also `model/Component.ts#getDefaultOption`\n  return zrUtil.merge(zrUtil.merge({}, superOption, true), subOption, true);\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership.  The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License.  You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n/**\n * Language: English.\n */\nexport default {\n  time: {\n    month: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],\n    monthAbbr: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],\n    dayOfWeek: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],\n    dayOfWeekAbbr: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']\n  },\n  legend: {\n    selector: {\n      all: 'All',\n      inverse: 'Inv'\n    }\n  },\n  toolbox: {\n    brush: {\n      title: {\n        rect: 'Box Select',\n        polygon: 'Lasso Select',\n        lineX: 'Horizontally Select',\n        lineY: 'Vertically Select',\n        keep: 'Keep Selections',\n        clear: 'Clear Selections'\n      }\n    },\n    dataView: {\n      title: 'Data View',\n      lang: ['Data View', 'Close', 'Refresh']\n    },\n    dataZoom: {\n      title: {\n        zoom: 'Zoom',\n        back: 'Zoom Reset'\n      }\n    },\n    magicType: {\n      title: {\n        line: 'Switch to Line Chart',\n        bar: 'Switch to Bar Chart',\n        stack: 'Stack',\n        tiled: 'Tile'\n      }\n    },\n    restore: {\n      title: 'Restore'\n    },\n    saveAsImage: {\n      title: 'Save as Image',\n      lang: ['Right Click to Save Image']\n    }\n  },\n  series: {\n    typeNames: {\n      pie: 'Pie chart',\n      bar: 'Bar chart',\n      line: 'Line chart',\n      scatter: 'Scatter plot',\n      effectScatter: 'Ripple scatter plot',\n      radar: 'Radar chart',\n      tree: 'Tree',\n      treemap: 'Treemap',\n      boxplot: 'Boxplot',\n      candlestick: 'Candlestick',\n      k: 'K line chart',\n      heatmap: 'Heat map',\n      map: 'Map',\n      parallel: 'Parallel coordinate map',\n      lines: 'Line graph',\n      graph: 'Relationship graph',\n      sankey: 'Sankey diagram',\n      funnel: 'Funnel chart',\n      gauge: 'Gauge',\n      pictorialBar: 'Pictorial bar',\n      themeRiver: 'Theme River Map',\n      sunburst: 'Sunburst',\n      custom: 'Custom chart',\n      chart: 'Chart'\n    }\n  },\n  aria: {\n    general: {\n      withTitle: 'This is a chart about \"{title}\"',\n      withoutTitle: 'This is a chart'\n    },\n    series: {\n      single: {\n        prefix: '',\n        withName: ' with type {seriesType} named {seriesName}.',\n        withoutName: ' with type {seriesType}.'\n      },\n      multiple: {\n        prefix: '. It consists of {seriesCount} series count.',\n        withName: ' The {seriesId} series is a {seriesType} representing {seriesName}.',\n        withoutName: ' The {seriesId} series is a {seriesType}.',\n        separator: {\n          middle: '',\n          end: ''\n        }\n      }\n    },\n    data: {\n      allData: 'The data is as follows: ',\n      partialData: 'The first {displayCnt} items are: ',\n      withName: 'the data for {name} is {value}',\n      withoutName: '{value}',\n      separator: {\n        middle: ', ',\n        end: '. '\n      }\n    }\n  }\n};", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership.  The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License.  You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\nexport default {\n  time: {\n    month: ['\u4E00\u6708', '\u4E8C\u6708', '\u4E09\u6708', '\u56DB\u6708', '\u4E94\u6708', '\u516D\u6708', '\u4E03\u6708', '\u516B\u6708', '\u4E5D\u6708', '\u5341\u6708', '\u5341\u4E00\u6708', '\u5341\u4E8C\u6708'],\n    monthAbbr: ['1\u6708', '2\u6708', '3\u6708', '4\u6708', '5\u6708', '6\u6708', '7\u6708', '8\u6708', '9\u6708', '10\u6708', '11\u6708', '12\u6708'],\n    dayOfWeek: ['\u661F\u671F\u65E5', '\u661F\u671F\u4E00', '\u661F\u671F\u4E8C', '\u661F\u671F\u4E09', '\u661F\u671F\u56DB', '\u661F\u671F\u4E94', '\u661F\u671F\u516D'],\n    dayOfWeekAbbr: ['\u65E5', '\u4E00', '\u4E8C', '\u4E09', '\u56DB', '\u4E94', '\u516D']\n  },\n  legend: {\n    selector: {\n      all: '\u5168\u9009',\n      inverse: '\u53CD\u9009'\n    }\n  },\n  toolbox: {\n    brush: {\n      title: {\n        rect: '\u77E9\u5F62\u9009\u62E9',\n        polygon: '\u5708\u9009',\n        lineX: '\u6A2A\u5411\u9009\u62E9',\n        lineY: '\u7EB5\u5411\u9009\u62E9',\n        keep: '\u4FDD\u6301\u9009\u62E9',\n        clear: '\u6E05\u9664\u9009\u62E9'\n      }\n    },\n    dataView: {\n      title: '\u6570\u636E\u89C6\u56FE',\n      lang: ['\u6570\u636E\u89C6\u56FE', '\u5173\u95ED', '\u5237\u65B0']\n    },\n    dataZoom: {\n      title: {\n        zoom: '\u533A\u57DF\u7F29\u653E',\n        back: '\u533A\u57DF\u7F29\u653E\u8FD8\u539F'\n      }\n    },\n    magicType: {\n      title: {\n        line: '\u5207\u6362\u4E3A\u6298\u7EBF\u56FE',\n        bar: '\u5207\u6362\u4E3A\u67F1\u72B6\u56FE',\n        stack: '\u5207\u6362\u4E3A\u5806\u53E0',\n        tiled: '\u5207\u6362\u4E3A\u5E73\u94FA'\n      }\n    },\n    restore: {\n      title: '\u8FD8\u539F'\n    },\n    saveAsImage: {\n      title: '\u4FDD\u5B58\u4E3A\u56FE\u7247',\n      lang: ['\u53F3\u952E\u53E6\u5B58\u4E3A\u56FE\u7247']\n    }\n  },\n  series: {\n    typeNames: {\n      pie: '\u997C\u56FE',\n      bar: '\u67F1\u72B6\u56FE',\n      line: '\u6298\u7EBF\u56FE',\n      scatter: '\u6563\u70B9\u56FE',\n      effectScatter: '\u6D9F\u6F2A\u6563\u70B9\u56FE',\n      radar: '\u96F7\u8FBE\u56FE',\n      tree: '\u6811\u56FE',\n      treemap: '\u77E9\u5F62\u6811\u56FE',\n      boxplot: '\u7BB1\u578B\u56FE',\n      candlestick: 'K\u7EBF\u56FE',\n      k: 'K\u7EBF\u56FE',\n      heatmap: '\u70ED\u529B\u56FE',\n      map: '\u5730\u56FE',\n      parallel: '\u5E73\u884C\u5750\u6807\u56FE',\n      lines: '\u7EBF\u56FE',\n      graph: '\u5173\u7CFB\u56FE',\n      sankey: '\u6851\u57FA\u56FE',\n      funnel: '\u6F0F\u6597\u56FE',\n      gauge: '\u4EEA\u8868\u76D8\u56FE',\n      pictorialBar: '\u8C61\u5F62\u67F1\u56FE',\n      themeRiver: '\u4E3B\u9898\u6CB3\u6D41\u56FE',\n      sunburst: '\u65ED\u65E5\u56FE',\n      custom: '\u81EA\u5B9A\u4E49\u56FE\u8868',\n      chart: '\u56FE\u8868'\n    }\n  },\n  aria: {\n    general: {\n      withTitle: '\u8FD9\u662F\u4E00\u4E2A\u5173\u4E8E\u201C{title}\u201D\u7684\u56FE\u8868\u3002',\n      withoutTitle: '\u8FD9\u662F\u4E00\u4E2A\u56FE\u8868\uFF0C'\n    },\n    series: {\n      single: {\n        prefix: '',\n        withName: '\u56FE\u8868\u7C7B\u578B\u662F{seriesType}\uFF0C\u8868\u793A{seriesName}\u3002',\n        withoutName: '\u56FE\u8868\u7C7B\u578B\u662F{seriesType}\u3002'\n      },\n      multiple: {\n        prefix: '\u5B83\u7531{seriesCount}\u4E2A\u56FE\u8868\u7CFB\u5217\u7EC4\u6210\u3002',\n        withName: '\u7B2C{seriesId}\u4E2A\u7CFB\u5217\u662F\u4E00\u4E2A\u8868\u793A{seriesName}\u7684{seriesType}\uFF0C',\n        withoutName: '\u7B2C{seriesId}\u4E2A\u7CFB\u5217\u662F\u4E00\u4E2A{seriesType}\uFF0C',\n        separator: {\n          middle: '\uFF1B',\n          end: '\u3002'\n        }\n      }\n    },\n    data: {\n      allData: '\u5176\u6570\u636E\u662F\u2014\u2014',\n      partialData: '\u5176\u4E2D\uFF0C\u524D{displayCnt}\u9879\u662F\u2014\u2014',\n      withName: '{name}\u7684\u6570\u636E\u662F{value}',\n      withoutName: '{value}',\n      separator: {\n        middle: '\uFF0C',\n        end: ''\n      }\n    }\n  }\n};", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport Model from '../model/Model.js';\nimport env from 'zrender/lib/core/env.js';\n// default import ZH and EN lang\nimport langEN from '../i18n/langEN.js';\nimport langZH from '../i18n/langZH.js';\nimport { isString, clone, merge } from 'zrender/lib/core/util.js';\nvar LOCALE_ZH = 'ZH';\nvar LOCALE_EN = 'EN';\nvar DEFAULT_LOCALE = LOCALE_EN;\nvar localeStorage = {};\nvar localeModels = {};\nexport var SYSTEM_LANG = !env.domSupported ? DEFAULT_LOCALE : function () {\n  var langStr = (/* eslint-disable-next-line */\n  document.documentElement.lang || navigator.language || navigator.browserLanguage || DEFAULT_LOCALE).toUpperCase();\n  return langStr.indexOf(LOCALE_ZH) > -1 ? LOCALE_ZH : DEFAULT_LOCALE;\n}();\nexport function registerLocale(locale, localeObj) {\n  locale = locale.toUpperCase();\n  localeModels[locale] = new Model(localeObj);\n  localeStorage[locale] = localeObj;\n}\n// export function getLocale(locale: string) {\n//     return localeStorage[locale];\n// }\nexport function createLocaleObject(locale) {\n  if (isString(locale)) {\n    var localeObj = localeStorage[locale.toUpperCase()] || {};\n    if (locale === LOCALE_ZH || locale === LOCALE_EN) {\n      return clone(localeObj);\n    } else {\n      return merge(clone(localeObj), clone(localeStorage[DEFAULT_LOCALE]), false);\n    }\n  } else {\n    return merge(clone(locale), clone(localeStorage[DEFAULT_LOCALE]), false);\n  }\n}\nexport function getLocaleModel(lang) {\n  return localeModels[lang];\n}\nexport function getDefaultLocaleModel() {\n  return localeModels[DEFAULT_LOCALE];\n}\n// Default locale\nregisterLocale(LOCALE_EN, langEN);\nregisterLocale(LOCALE_ZH, langZH);", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n;\nvar _impl = null;\nexport function registerScaleBreakHelperImpl(impl) {\n  if (!_impl) {\n    _impl = impl;\n  }\n}\nexport function getScaleBreakHelper() {\n  return _impl;\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as numberUtil from './number.js';\nimport { getDefaultLocaleModel, getLocaleModel, SYSTEM_LANG } from '../core/locale.js';\nimport Model from '../model/Model.js';\nimport { getScaleBreakHelper } from '../scale/break.js';\nexport var ONE_SECOND = 1000;\nexport var ONE_MINUTE = ONE_SECOND * 60;\nexport var ONE_HOUR = ONE_MINUTE * 60;\nexport var ONE_DAY = ONE_HOUR * 24;\nexport var ONE_YEAR = ONE_DAY * 365;\nvar primaryTimeUnitFormatterMatchers = {\n  year: /({yyyy}|{yy})/,\n  month: /({MMMM}|{MMM}|{MM}|{M})/,\n  day: /({dd}|{d})/,\n  hour: /({HH}|{H}|{hh}|{h})/,\n  minute: /({mm}|{m})/,\n  second: /({ss}|{s})/,\n  millisecond: /({SSS}|{S})/\n};\nvar defaultFormatterSeed = {\n  year: '{yyyy}',\n  month: '{MMM}',\n  day: '{d}',\n  hour: '{HH}:{mm}',\n  minute: '{HH}:{mm}',\n  second: '{HH}:{mm}:{ss}',\n  millisecond: '{HH}:{mm}:{ss} {SSS}'\n};\nvar defaultFullFormatter = '{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}';\nvar fullDayFormatter = '{yyyy}-{MM}-{dd}';\nexport var fullLeveledFormatter = {\n  year: '{yyyy}',\n  month: '{yyyy}-{MM}',\n  day: fullDayFormatter,\n  hour: fullDayFormatter + ' ' + defaultFormatterSeed.hour,\n  minute: fullDayFormatter + ' ' + defaultFormatterSeed.minute,\n  second: fullDayFormatter + ' ' + defaultFormatterSeed.second,\n  millisecond: defaultFullFormatter\n};\n// Order must be ensured from big to small.\nexport var primaryTimeUnits = ['year', 'month', 'day', 'hour', 'minute', 'second', 'millisecond'];\nexport var timeUnits = ['year', 'half-year', 'quarter', 'month', 'week', 'half-week', 'day', 'half-day', 'quarter-day', 'hour', 'minute', 'second', 'millisecond'];\nexport function parseTimeAxisLabelFormatter(formatter) {\n  // Keep the logic the same with function `leveledFormat`.\n  return !zrUtil.isString(formatter) && !zrUtil.isFunction(formatter) ? parseTimeAxisLabelFormatterDictionary(formatter) : formatter;\n}\n/**\n * The final generated dictionary is like:\n *  generated_dict = {\n *      year: {\n *          year: ['{yyyy}', ...<higher_levels_if_any>]\n *      },\n *      month: {\n *          year: ['{yyyy} {MMM}', ...<higher_levels_if_any>],\n *          month: ['{MMM}', ...<higher_levels_if_any>]\n *      },\n *      day: {\n *          year: ['{yyyy} {MMM} {d}', ...<higher_levels_if_any>],\n *          month: ['{MMM} {d}', ...<higher_levels_if_any>],\n *          day: ['{d}', ...<higher_levels_if_any>]\n *      },\n *      ...\n *  }\n *\n * In echarts option, users can specify the entire dictionary or typically just:\n *  {formatter: {\n *      year: '{yyyy}', // Or an array of leveled templates: `['{yyyy}', '{bold1|{yyyy}}', ...]`,\n *                      // corresponding to `[level0, level1, level2, ...]`.\n *      month: '{MMM}',\n *      day: '{d}',\n *      hour: '{HH}:{mm}',\n *      second: '{HH}:{mm}',\n *      ...\n *  }}\n *  If any time unit is not specified in echarts option, the default template is used,\n *  such as `['{yyyy}', {primary|{yyyy}']`.\n *\n * The `tick.level` is only used to read string from each array, meaning the style type.\n *\n * Let `lowerUnit = getUnitFromValue(tick.value)`.\n * The non-break axis ticks only use `generated_dict[lowerUnit][lowerUnit][level]`.\n * The break axis ticks may use `generated_dict[lowerUnit][upperUnit][level]`, because:\n *  Consider the case: the non-break ticks are `16th, 23th, Feb, 7th, ...`, where `Feb` is in the break\n *  range and pruned by breaks, and the break ends might be in lower time unit than day. e.g., break start\n *  is `Jan 25th 18:00`(in unit `hour`) and break end is `Feb 6th 18:30` (in unit `minute`). Thus the break\n *  label prefers `Jan 25th 18:00` and `Feb 6th 18:30` rather than only `18:00` and `18:30`, otherwise it\n *  causes misleading.\n *  In this case, the tick of the break start and end will both be:\n *      `{level: 1, lowerTimeUnit: 'minute', upperTimeUnit: 'month'}`\n *  And get the final template by `generated_dict[lowerTimeUnit][upperTimeUnit][level]`.\n *  Note that the time unit can not be calculated directly by a single tick value, since the two breaks have\n *  to be at the same time unit to avoid awkward appearance. i.e., `Jan 25th 18:00` is in the time unit \"hour\"\n *  but we need it to be \"minute\", following `Feb 6th 18:30`.\n */\nfunction parseTimeAxisLabelFormatterDictionary(dictOption) {\n  dictOption = dictOption || {};\n  var dict = {};\n  // Currently if any template is specified by user, it may contain rich text tag,\n  // such as `'{my_bold|{YYYY}}'`, thus we do add highlight style to it.\n  // (Note that nested tag (`'{some|{some2|xxx}}'`) in rich text is not supported yet.)\n  var canAddHighlight = true;\n  zrUtil.each(primaryTimeUnits, function (lowestUnit) {\n    canAddHighlight && (canAddHighlight = dictOption[lowestUnit] == null);\n  });\n  zrUtil.each(primaryTimeUnits, function (lowestUnit, lowestUnitIdx) {\n    var upperDictOption = dictOption[lowestUnit];\n    dict[lowestUnit] = {};\n    var lowerTpl = null;\n    for (var upperUnitIdx = lowestUnitIdx; upperUnitIdx >= 0; upperUnitIdx--) {\n      var upperUnit = primaryTimeUnits[upperUnitIdx];\n      var upperDictItemOption = zrUtil.isObject(upperDictOption) && !zrUtil.isArray(upperDictOption) ? upperDictOption[upperUnit] : upperDictOption;\n      var tplArr = void 0;\n      if (zrUtil.isArray(upperDictItemOption)) {\n        tplArr = upperDictItemOption.slice();\n        lowerTpl = tplArr[0] || '';\n      } else if (zrUtil.isString(upperDictItemOption)) {\n        lowerTpl = upperDictItemOption;\n        tplArr = [lowerTpl];\n      } else {\n        if (lowerTpl == null) {\n          lowerTpl = defaultFormatterSeed[lowestUnit];\n        }\n        // Generate the dict by the rule as follows:\n        // If the user specify (or by default):\n        //  {formatter: {\n        //      year: '{yyyy}',\n        //      month: '{MMM}',\n        //      day: '{d}',\n        //      ...\n        //  }}\n        // Concat them to make the final dictionary:\n        //  {formatter: {\n        //      year: {year: ['{yyyy}']},\n        //      month: {year: ['{yyyy} {MMM}'], month: ['{MMM}']},\n        //      day: {year: ['{yyyy} {MMM} {d}'], month: ['{MMM} {d}'], day: ['{d}']}\n        //      ...\n        //  }}\n        // And then add `{primary|...}` to each array if from default template.\n        // This strategy is convinient for user configurating and works for most cases.\n        // If bad cases encountered, users can specify the entire dictionary themselves\n        // instead of going through this logic.\n        else if (!primaryTimeUnitFormatterMatchers[upperUnit].test(lowerTpl)) {\n          lowerTpl = dict[upperUnit][upperUnit][0] + \" \" + lowerTpl;\n        }\n        tplArr = [lowerTpl];\n        if (canAddHighlight) {\n          tplArr[1] = \"{primary|\" + lowerTpl + \"}\";\n        }\n      }\n      dict[lowestUnit][upperUnit] = tplArr;\n    }\n  });\n  return dict;\n}\nexport function pad(str, len) {\n  str += '';\n  return '0000'.substr(0, len - str.length) + str;\n}\nexport function getPrimaryTimeUnit(timeUnit) {\n  switch (timeUnit) {\n    case 'half-year':\n    case 'quarter':\n      return 'month';\n    case 'week':\n    case 'half-week':\n      return 'day';\n    case 'half-day':\n    case 'quarter-day':\n      return 'hour';\n    default:\n      // year, minutes, second, milliseconds\n      return timeUnit;\n  }\n}\nexport function isPrimaryTimeUnit(timeUnit) {\n  return timeUnit === getPrimaryTimeUnit(timeUnit);\n}\nexport function getDefaultFormatPrecisionOfInterval(timeUnit) {\n  switch (timeUnit) {\n    case 'year':\n    case 'month':\n      return 'day';\n    case 'millisecond':\n      return 'millisecond';\n    default:\n      // Also for day, hour, minute, second\n      return 'second';\n  }\n}\nexport function format(\n// Note: The result based on `isUTC` are totally different, which can not be just simply\n// substituted by the result without `isUTC`. So we make the param `isUTC` mandatory.\ntime, template, isUTC, lang) {\n  var date = numberUtil.parseDate(time);\n  var y = date[fullYearGetterName(isUTC)]();\n  var M = date[monthGetterName(isUTC)]() + 1;\n  var q = Math.floor((M - 1) / 3) + 1;\n  var d = date[dateGetterName(isUTC)]();\n  var e = date['get' + (isUTC ? 'UTC' : '') + 'Day']();\n  var H = date[hoursGetterName(isUTC)]();\n  var h = (H - 1) % 12 + 1;\n  var m = date[minutesGetterName(isUTC)]();\n  var s = date[secondsGetterName(isUTC)]();\n  var S = date[millisecondsGetterName(isUTC)]();\n  var a = H >= 12 ? 'pm' : 'am';\n  var A = a.toUpperCase();\n  var localeModel = lang instanceof Model ? lang : getLocaleModel(lang || SYSTEM_LANG) || getDefaultLocaleModel();\n  var timeModel = localeModel.getModel('time');\n  var month = timeModel.get('month');\n  var monthAbbr = timeModel.get('monthAbbr');\n  var dayOfWeek = timeModel.get('dayOfWeek');\n  var dayOfWeekAbbr = timeModel.get('dayOfWeekAbbr');\n  return (template || '').replace(/{a}/g, a + '').replace(/{A}/g, A + '').replace(/{yyyy}/g, y + '').replace(/{yy}/g, pad(y % 100 + '', 2)).replace(/{Q}/g, q + '').replace(/{MMMM}/g, month[M - 1]).replace(/{MMM}/g, monthAbbr[M - 1]).replace(/{MM}/g, pad(M, 2)).replace(/{M}/g, M + '').replace(/{dd}/g, pad(d, 2)).replace(/{d}/g, d + '').replace(/{eeee}/g, dayOfWeek[e]).replace(/{ee}/g, dayOfWeekAbbr[e]).replace(/{e}/g, e + '').replace(/{HH}/g, pad(H, 2)).replace(/{H}/g, H + '').replace(/{hh}/g, pad(h + '', 2)).replace(/{h}/g, h + '').replace(/{mm}/g, pad(m, 2)).replace(/{m}/g, m + '').replace(/{ss}/g, pad(s, 2)).replace(/{s}/g, s + '').replace(/{SSS}/g, pad(S, 3)).replace(/{S}/g, S + '');\n}\nexport function leveledFormat(tick, idx, formatter, lang, isUTC) {\n  var template = null;\n  if (zrUtil.isString(formatter)) {\n    // Single formatter for all units at all levels\n    template = formatter;\n  } else if (zrUtil.isFunction(formatter)) {\n    var extra = {\n      time: tick.time,\n      level: tick.time.level\n    };\n    var scaleBreakHelper = getScaleBreakHelper();\n    if (scaleBreakHelper) {\n      scaleBreakHelper.makeAxisLabelFormatterParamBreak(extra, tick[\"break\"]);\n    }\n    template = formatter(tick.value, idx, extra);\n  } else {\n    var tickTime = tick.time;\n    if (tickTime) {\n      var leveledTplArr = formatter[tickTime.lowerTimeUnit][tickTime.upperTimeUnit];\n      template = leveledTplArr[Math.min(tickTime.level, leveledTplArr.length - 1)] || '';\n    } else {\n      // tick may be from customTicks or timeline therefore no tick.time.\n      var unit = getUnitFromValue(tick.value, isUTC);\n      template = formatter[unit][unit][0];\n    }\n  }\n  return format(new Date(tick.value), template, isUTC, lang);\n}\nexport function getUnitFromValue(value, isUTC) {\n  var date = numberUtil.parseDate(value);\n  var M = date[monthGetterName(isUTC)]() + 1;\n  var d = date[dateGetterName(isUTC)]();\n  var h = date[hoursGetterName(isUTC)]();\n  var m = date[minutesGetterName(isUTC)]();\n  var s = date[secondsGetterName(isUTC)]();\n  var S = date[millisecondsGetterName(isUTC)]();\n  var isSecond = S === 0;\n  var isMinute = isSecond && s === 0;\n  var isHour = isMinute && m === 0;\n  var isDay = isHour && h === 0;\n  var isMonth = isDay && d === 1;\n  var isYear = isMonth && M === 1;\n  if (isYear) {\n    return 'year';\n  } else if (isMonth) {\n    return 'month';\n  } else if (isDay) {\n    return 'day';\n  } else if (isHour) {\n    return 'hour';\n  } else if (isMinute) {\n    return 'minute';\n  } else if (isSecond) {\n    return 'second';\n  } else {\n    return 'millisecond';\n  }\n}\n// export function getUnitValue(\n//     value: number | Date,\n//     unit: TimeUnit,\n//     isUTC: boolean\n// ) : number {\n//     const date = zrUtil.isNumber(value)\n//         ? numberUtil.parseDate(value)\n//         : value;\n//     unit = unit || getUnitFromValue(value, isUTC);\n//     switch (unit) {\n//         case 'year':\n//             return date[fullYearGetterName(isUTC)]();\n//         case 'half-year':\n//             return date[monthGetterName(isUTC)]() >= 6 ? 1 : 0;\n//         case 'quarter':\n//             return Math.floor((date[monthGetterName(isUTC)]() + 1) / 4);\n//         case 'month':\n//             return date[monthGetterName(isUTC)]();\n//         case 'day':\n//             return date[dateGetterName(isUTC)]();\n//         case 'half-day':\n//             return date[hoursGetterName(isUTC)]() / 24;\n//         case 'hour':\n//             return date[hoursGetterName(isUTC)]();\n//         case 'minute':\n//             return date[minutesGetterName(isUTC)]();\n//         case 'second':\n//             return date[secondsGetterName(isUTC)]();\n//         case 'millisecond':\n//             return date[millisecondsGetterName(isUTC)]();\n//     }\n// }\n/**\n * e.g.,\n * If timeUnit is 'year', return the Jan 1st 00:00:00 000 of that year.\n * If timeUnit is 'day', return the 00:00:00 000 of that day.\n *\n * @return The input date.\n */\nexport function roundTime(date, timeUnit, isUTC) {\n  switch (timeUnit) {\n    case 'year':\n      date[monthSetterName(isUTC)](0);\n    case 'month':\n      date[dateSetterName(isUTC)](1);\n    case 'day':\n      date[hoursSetterName(isUTC)](0);\n    case 'hour':\n      date[minutesSetterName(isUTC)](0);\n    case 'minute':\n      date[secondsSetterName(isUTC)](0);\n    case 'second':\n      date[millisecondsSetterName(isUTC)](0);\n  }\n  return date;\n}\nexport function fullYearGetterName(isUTC) {\n  return isUTC ? 'getUTCFullYear' : 'getFullYear';\n}\nexport function monthGetterName(isUTC) {\n  return isUTC ? 'getUTCMonth' : 'getMonth';\n}\nexport function dateGetterName(isUTC) {\n  return isUTC ? 'getUTCDate' : 'getDate';\n}\nexport function hoursGetterName(isUTC) {\n  return isUTC ? 'getUTCHours' : 'getHours';\n}\nexport function minutesGetterName(isUTC) {\n  return isUTC ? 'getUTCMinutes' : 'getMinutes';\n}\nexport function secondsGetterName(isUTC) {\n  return isUTC ? 'getUTCSeconds' : 'getSeconds';\n}\nexport function millisecondsGetterName(isUTC) {\n  return isUTC ? 'getUTCMilliseconds' : 'getMilliseconds';\n}\nexport function fullYearSetterName(isUTC) {\n  return isUTC ? 'setUTCFullYear' : 'setFullYear';\n}\nexport function monthSetterName(isUTC) {\n  return isUTC ? 'setUTCMonth' : 'setMonth';\n}\nexport function dateSetterName(isUTC) {\n  return isUTC ? 'setUTCDate' : 'setDate';\n}\nexport function hoursSetterName(isUTC) {\n  return isUTC ? 'setUTCHours' : 'setHours';\n}\nexport function minutesSetterName(isUTC) {\n  return isUTC ? 'setUTCMinutes' : 'setMinutes';\n}\nexport function secondsSetterName(isUTC) {\n  return isUTC ? 'setUTCSeconds' : 'setSeconds';\n}\nexport function millisecondsSetterName(isUTC) {\n  return isUTC ? 'setUTCMilliseconds' : 'setMilliseconds';\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { Text } from '../util/graphic.js';\nexport function getTextRect(text, font, align, verticalAlign, padding, rich, truncate, lineHeight) {\n  var textEl = new Text({\n    style: {\n      text: text,\n      font: font,\n      align: align,\n      verticalAlign: verticalAlign,\n      padding: padding,\n      rich: rich,\n      overflow: truncate ? 'truncate' : null,\n      lineHeight: lineHeight\n    }\n  });\n  return textEl.getBoundingRect();\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { encodeHTML } from 'zrender/lib/core/dom.js';\nimport { parseDate, isNumeric, numericToNumber } from './number.js';\nimport { format as timeFormat, pad } from './time.js';\nimport { deprecateReplaceLog } from './log.js';\n/**\n * Add a comma each three digit.\n */\nexport function addCommas(x) {\n  if (!isNumeric(x)) {\n    return zrUtil.isString(x) ? x : '-';\n  }\n  var parts = (x + '').split('.');\n  return parts[0].replace(/(\\d{1,3})(?=(?:\\d{3})+(?!\\d))/g, '$1,') + (parts.length > 1 ? '.' + parts[1] : '');\n}\nexport function toCamelCase(str, upperCaseFirst) {\n  str = (str || '').toLowerCase().replace(/-(.)/g, function (match, group1) {\n    return group1.toUpperCase();\n  });\n  if (upperCaseFirst && str) {\n    str = str.charAt(0).toUpperCase() + str.slice(1);\n  }\n  return str;\n}\nexport var normalizeCssArray = zrUtil.normalizeCssArray;\nexport { encodeHTML };\n/**\n * Make value user readable for tooltip and label.\n * \"User readable\":\n *     Try to not print programmer-specific text like NaN, Infinity, null, undefined.\n *     Avoid to display an empty string, which users can not recognize there is\n *     a value and it might look like a bug.\n */\nexport function makeValueReadable(value, valueType, useUTC) {\n  var USER_READABLE_DEFUALT_TIME_PATTERN = '{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}';\n  function stringToUserReadable(str) {\n    return str && zrUtil.trim(str) ? str : '-';\n  }\n  function isNumberUserReadable(num) {\n    return !!(num != null && !isNaN(num) && isFinite(num));\n  }\n  var isTypeTime = valueType === 'time';\n  var isValueDate = value instanceof Date;\n  if (isTypeTime || isValueDate) {\n    var date = isTypeTime ? parseDate(value) : value;\n    if (!isNaN(+date)) {\n      return timeFormat(date, USER_READABLE_DEFUALT_TIME_PATTERN, useUTC);\n    } else if (isValueDate) {\n      return '-';\n    }\n    // In other cases, continue to try to display the value in the following code.\n  }\n  if (valueType === 'ordinal') {\n    return zrUtil.isStringSafe(value) ? stringToUserReadable(value) : zrUtil.isNumber(value) ? isNumberUserReadable(value) ? value + '' : '-' : '-';\n  }\n  // By default.\n  var numericResult = numericToNumber(value);\n  return isNumberUserReadable(numericResult) ? addCommas(numericResult) : zrUtil.isStringSafe(value) ? stringToUserReadable(value) : typeof value === 'boolean' ? value + '' : '-';\n}\nvar TPL_VAR_ALIAS = ['a', 'b', 'c', 'd', 'e', 'f', 'g'];\nvar wrapVar = function (varName, seriesIdx) {\n  return '{' + varName + (seriesIdx == null ? '' : seriesIdx) + '}';\n};\n/**\n * Template formatter\n * @param {Array.<Object>|Object} paramsList\n */\nexport function formatTpl(tpl, paramsList, encode) {\n  if (!zrUtil.isArray(paramsList)) {\n    paramsList = [paramsList];\n  }\n  var seriesLen = paramsList.length;\n  if (!seriesLen) {\n    return '';\n  }\n  var $vars = paramsList[0].$vars || [];\n  for (var i = 0; i < $vars.length; i++) {\n    var alias = TPL_VAR_ALIAS[i];\n    tpl = tpl.replace(wrapVar(alias), wrapVar(alias, 0));\n  }\n  for (var seriesIdx = 0; seriesIdx < seriesLen; seriesIdx++) {\n    for (var k = 0; k < $vars.length; k++) {\n      var val = paramsList[seriesIdx][$vars[k]];\n      tpl = tpl.replace(wrapVar(TPL_VAR_ALIAS[k], seriesIdx), encode ? encodeHTML(val) : val);\n    }\n  }\n  return tpl;\n}\n/**\n * simple Template formatter\n */\nexport function formatTplSimple(tpl, param, encode) {\n  zrUtil.each(param, function (value, key) {\n    tpl = tpl.replace('{' + key + '}', encode ? encodeHTML(value) : value);\n  });\n  return tpl;\n}\nexport function getTooltipMarker(inOpt, extraCssText) {\n  var opt = zrUtil.isString(inOpt) ? {\n    color: inOpt,\n    extraCssText: extraCssText\n  } : inOpt || {};\n  var color = opt.color;\n  var type = opt.type;\n  extraCssText = opt.extraCssText;\n  var renderMode = opt.renderMode || 'html';\n  if (!color) {\n    return '';\n  }\n  if (renderMode === 'html') {\n    return type === 'subItem' ? '<span style=\"display:inline-block;vertical-align:middle;margin-right:8px;margin-left:3px;' + 'border-radius:4px;width:4px;height:4px;background-color:'\n    // Only support string\n    + encodeHTML(color) + ';' + (extraCssText || '') + '\"></span>' : '<span style=\"display:inline-block;margin-right:4px;' + 'border-radius:10px;width:10px;height:10px;background-color:' + encodeHTML(color) + ';' + (extraCssText || '') + '\"></span>';\n  } else {\n    // Should better not to auto generate style name by auto-increment number here.\n    // Because this util is usually called in tooltip formatter, which is probably\n    // called repeatedly when mouse move and the auto-increment number increases fast.\n    // Users can make their own style name by theirselves, make it unique and readable.\n    var markerId = opt.markerId || 'markerX';\n    return {\n      renderMode: renderMode,\n      content: '{' + markerId + '|}  ',\n      style: type === 'subItem' ? {\n        width: 4,\n        height: 4,\n        borderRadius: 2,\n        backgroundColor: color\n      } : {\n        width: 10,\n        height: 10,\n        borderRadius: 5,\n        backgroundColor: color\n      }\n    };\n  }\n}\n/**\n * @deprecated Use `time/format` instead.\n * ISO Date format\n * @param {string} tpl\n * @param {number} value\n * @param {boolean} [isUTC=false] Default in local time.\n *           see `module:echarts/scale/Time`\n *           and `module:echarts/util/number#parseDate`.\n * @inner\n */\nexport function formatTime(tpl, value, isUTC) {\n  if (process.env.NODE_ENV !== 'production') {\n    deprecateReplaceLog('echarts.format.formatTime', 'echarts.time.format');\n  }\n  if (tpl === 'week' || tpl === 'month' || tpl === 'quarter' || tpl === 'half-year' || tpl === 'year') {\n    tpl = 'MM-dd\\nyyyy';\n  }\n  var date = parseDate(value);\n  var getUTC = isUTC ? 'getUTC' : 'get';\n  var y = date[getUTC + 'FullYear']();\n  var M = date[getUTC + 'Month']() + 1;\n  var d = date[getUTC + 'Date']();\n  var h = date[getUTC + 'Hours']();\n  var m = date[getUTC + 'Minutes']();\n  var s = date[getUTC + 'Seconds']();\n  var S = date[getUTC + 'Milliseconds']();\n  tpl = tpl.replace('MM', pad(M, 2)).replace('M', M).replace('yyyy', y).replace('yy', pad(y % 100 + '', 2)).replace('dd', pad(d, 2)).replace('d', d).replace('hh', pad(h, 2)).replace('h', h).replace('mm', pad(m, 2)).replace('m', m).replace('ss', pad(s, 2)).replace('s', s).replace('SSS', pad(S, 3));\n  return tpl;\n}\n/**\n * Capital first\n * @param {string} str\n * @return {string}\n */\nexport function capitalFirst(str) {\n  return str ? str.charAt(0).toUpperCase() + str.substr(1) : str;\n}\n/**\n * @return Never be null/undefined.\n */\nexport function convertToColorString(color, defaultColor) {\n  defaultColor = defaultColor || 'transparent';\n  return zrUtil.isString(color) ? color : zrUtil.isObject(color) ? color.colorStops && (color.colorStops[0] || {}).color || defaultColor : defaultColor;\n}\nexport { truncateText } from 'zrender/lib/graphic/helper/parseText.js';\n/**\n * open new tab\n * @param link url\n * @param target blank or self\n */\nexport function windowOpen(link, target) {\n  /* global window */\n  if (target === '_blank' || target === 'blank') {\n    var blank = window.open();\n    blank.opener = null;\n    blank.location.href = link;\n  } else {\n    window.open(link, target);\n  }\n}\nexport { getTextRect } from '../legacy/getTextRect.js';", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { SINGLE_REFERRING } from '../util/model.js';\nimport { error } from '../util/log.js';\n/**\n * FIXME:\n * `nonSeriesBoxCoordSysCreators` and `_nonSeriesBoxMasterList` are hardcoded implementations.\n * Regarding \"coord sys layout based on another coord sys\", currently we only exprimentally support one level\n * dpendency, such as, \"grid(cartesian)s can be laid out based on matrix/calendar coord sys.\"\n * But a comprehensive implementation may need to support:\n *  - Recursive dependencies. e.g., a matrix coord sys lays out based on another matrix coord sys.\n *    That requires in the implementation `create` and `update` of coord sys are called by a dependency graph.\n *    (@see enableTopologicalTravel in `util/component.ts`)\n */\nvar nonSeriesBoxCoordSysCreators = {};\nvar normalCoordSysCreators = {};\nvar CoordinateSystemManager = /** @class */function () {\n  function CoordinateSystemManager() {\n    this._normalMasterList = [];\n    this._nonSeriesBoxMasterList = [];\n  }\n  /**\n   * Typically,\n   *  - in `create`, a coord sys lays out based on a given rect;\n   *  - in `update`, update the pixel and data extent of there axes (if any) based on processed `series.data`.\n   * After that, a coord sys can serve (typically by `dataToPoint`/`dataToLayout`/`pointToData`).\n   * If the coordinate system do not lay out based on `series.data`, `update` is not needed.\n   */\n  CoordinateSystemManager.prototype.create = function (ecModel, api) {\n    this._nonSeriesBoxMasterList = dealCreate(nonSeriesBoxCoordSysCreators, true);\n    this._normalMasterList = dealCreate(normalCoordSysCreators, false);\n    function dealCreate(creatorMap, canBeNonSeriesBox) {\n      var coordinateSystems = [];\n      zrUtil.each(creatorMap, function (creator, type) {\n        var list = creator.create(ecModel, api);\n        coordinateSystems = coordinateSystems.concat(list || []);\n        if (process.env.NODE_ENV !== 'production') {\n          if (canBeNonSeriesBox) {\n            // Disallow `update` is a brutal way to ensure `_nonSeriesBoxMasterList`s are ready to\n            // serve after `create`. But if `update` has to be involved in `_nonSeriesBoxMasterList`\n            // for some future case, more complicated mechanisms need to be introduced.\n            zrUtil.each(list, function (master) {\n              return zrUtil.assert(!master.update);\n            });\n          }\n        }\n      });\n      return coordinateSystems;\n    }\n  };\n  /**\n   * @see CoordinateSystem['create']\n   */\n  CoordinateSystemManager.prototype.update = function (ecModel, api) {\n    zrUtil.each(this._normalMasterList, function (coordSys) {\n      coordSys.update && coordSys.update(ecModel, api);\n    });\n  };\n  CoordinateSystemManager.prototype.getCoordinateSystems = function () {\n    return this._normalMasterList.concat(this._nonSeriesBoxMasterList);\n  };\n  CoordinateSystemManager.register = function (type, creator) {\n    if (type === 'matrix' || type === 'calendar') {\n      // FIXME: hardcode, @see nonSeriesBoxCoordSysCreators\n      nonSeriesBoxCoordSysCreators[type] = creator;\n      return;\n    }\n    normalCoordSysCreators[type] = creator;\n  };\n  CoordinateSystemManager.get = function (type) {\n    return normalCoordSysCreators[type] || nonSeriesBoxCoordSysCreators[type];\n  };\n  return CoordinateSystemManager;\n}();\nfunction canBeNonSeriesBoxCoordSys(coordSysType) {\n  return !!nonSeriesBoxCoordSysCreators[coordSysType];\n}\nexport var BoxCoordinateSystemCoordFrom = {\n  // By default fetch coord from `model.get('coord')`.\n  coord: 1,\n  // Some model/series, such as pie, is allowed to also get coord from `model.get('center')`,\n  // if cannot get from `model.get('coord')`. But historically pie use `center` option, but\n  // geo use `layoutCenter` option to specify layout center; they are not able to be unified.\n  // Therefor it is not recommended.\n  coord2: 2\n};\n/**\n * @see_also `createBoxLayoutReference`\n * @see_also `injectCoordSysByOption`\n */\nexport function registerLayOutOnCoordSysUsage(opt) {\n  if (process.env.NODE_ENV !== 'production') {\n    zrUtil.assert(!coordSysUseMap.get(opt.fullType));\n  }\n  coordSysUseMap.set(opt.fullType, {\n    getCoord2: undefined\n  }).getCoord2 = opt.getCoord2;\n}\nvar coordSysUseMap = zrUtil.createHashMap();\n/**\n * @return Be an object, but never be NullUndefined.\n */\nexport function getCoordForBoxCoordSys(model) {\n  var coord = model.getShallow('coord', true);\n  var from = BoxCoordinateSystemCoordFrom.coord;\n  if (coord == null) {\n    var store = coordSysUseMap.get(model.type);\n    if (store && store.getCoord2) {\n      from = BoxCoordinateSystemCoordFrom.coord2;\n      coord = store.getCoord2(model);\n    }\n  }\n  return {\n    coord: coord,\n    from: from\n  };\n}\n/**\n * - \"dataCoordSys\": each data item is laid out based on a coord sys.\n * - \"boxCoordSys\": the overall bounding rect or anchor point is calculated based on a coord sys.\n *   e.g.,\n *      grid rect (cartesian rect) is calculate based on matrix/calendar coord sys;\n *      pie center is calculated based on calendar/cartesian;\n *\n * The default value (if not declared in option `coordinateSystemUsage`):\n *  For series, use `dataCoordSys`, since this is the most case and backward compatible.\n *  For non-series components, use `boxCoordSys`, since `dataCoordSys` is not applicable.\n */\nexport var CoordinateSystemUsageKind = {\n  none: 0,\n  dataCoordSys: 1,\n  boxCoordSys: 2\n};\nexport function decideCoordSysUsageKind(\n// Component or series\nmodel, printError) {\n  // For backward compat, still not use `true` in model.get.\n  var coordSysType = model.getShallow('coordinateSystem');\n  var coordSysUsageOption = model.getShallow('coordinateSystemUsage', true);\n  var isDeclaredExplicitly = coordSysUsageOption != null;\n  var kind = CoordinateSystemUsageKind.none;\n  if (coordSysType) {\n    var isSeries = model.mainType === 'series';\n    if (coordSysUsageOption == null) {\n      coordSysUsageOption = isSeries ? 'data' : 'box';\n    }\n    if (coordSysUsageOption === 'data') {\n      kind = CoordinateSystemUsageKind.dataCoordSys;\n      if (!isSeries) {\n        if (process.env.NODE_ENV !== 'production') {\n          if (isDeclaredExplicitly && printError) {\n            error('coordinateSystemUsage \"data\" is not supported in non-series components.');\n          }\n        }\n        kind = CoordinateSystemUsageKind.none;\n      }\n    } else if (coordSysUsageOption === 'box') {\n      kind = CoordinateSystemUsageKind.boxCoordSys;\n      if (!isSeries && !canBeNonSeriesBoxCoordSys(coordSysType)) {\n        if (process.env.NODE_ENV !== 'production') {\n          if (isDeclaredExplicitly && printError) {\n            error(\"coordinateSystem \\\"\" + coordSysType + \"\\\" cannot be used\" + (\" as coordinateSystemUsage \\\"box\\\" for \\\"\" + model.type + \"\\\" yet.\"));\n          }\n        }\n        kind = CoordinateSystemUsageKind.none;\n      }\n    }\n  }\n  return {\n    coordSysType: coordSysType,\n    kind: kind\n  };\n}\n/**\n * These cases are considered:\n *  (A) Most series can use only \"dataCoordSys\", but \"boxCoordSys\" is not applicable:\n *    - e.g., series.heatmap, series.line, series.bar, series.scatter, ...\n *  (B) Some series and most components can use only \"boxCoordSys\", but \"dataCoordSys\" is not applicable:\n *    - e.g., series.pie, series.funnel, ...\n *    - e.g., grid, polar, geo, title, ...\n *  (C) Several series can use both \"boxCoordSys\" and \"dataCoordSys\", even at the same time:\n *    - e.g., series.graph, series.map\n *      - If graph or map series use a \"boxCoordSys\", it creates a internal \"dataCoordSys\" to lay out its data.\n *      - Graph series can use matrix coord sys as either the \"dataCoordSys\" (each item layout on one cell)\n *        or \"boxCoordSys\" (the entire series are layout within one cell).\n *    - To achieve this effect,\n *      `series.coordinateSystemUsage: 'box'` needs to be specified explicitly.\n *\n * Check these echarts option settings:\n *  - If `series: {type: 'bar'}`:\n *      dataCoordSys: \"cartesian2d\", boxCoordSys: \"none\".\n *      (since `coordinateSystem: 'cartesian2d'` is the default option in bar.)\n *  - If `grid: {coordinateSystem: 'matrix'}`\n *      dataCoordSys: \"none\", boxCoordSys: \"matrix\".\n *  - If `series: {type: 'pie', coordinateSystem: 'matrix'}`:\n *      dataCoordSys: \"none\", boxCoordSys: \"matrix\".\n *      (since `coordinateSystemUsage: 'box'` is the default option in pie.)\n *  - If `series: {type: 'graph', coordinateSystem: 'matrix'}`:\n *      dataCoordSys: \"matrix\", boxCoordSys: \"none\"\n *  - If `series: {type: 'graph', coordinateSystem: 'matrix', coordinateSystemUsage: 'box'}`:\n *      dataCoordSys: \"an internal view\", boxCoordSys: \"the internal view is laid out on a matrix\"\n *  - If `series: {type: 'map'}`:\n *      dataCoordSys: \"a internal geo\", boxCoordSys: \"none\"\n *  - If `series: {type: 'map', coordinateSystem: 'geo', geoIndex: 0}`:\n *      dataCoordSys: \"a geo\", boxCoordSys: \"none\"\n *  - If `series: {type: 'map', coordinateSystem: 'matrix'}`:\n *      not_applicable\n *  - If `series: {type: 'map', coordinateSystem: 'matrix', coordinateSystemUsage: 'box'}`:\n *      dataCoordSys: \"an internal geo\", boxCoordSys: \"the internal geo is laid out on a matrix\"\n *\n * @usage\n * For case (A) & (B),\n *  call `injectCoordSysByOption({coordSysType: 'aaa', ...})` once for each series/components.\n * For case (C),\n *  call `injectCoordSysByOption({coordSysType: 'aaa', ...})` once for each series/components,\n *  and then call `injectCoordSysByOption({coordSysType: 'bbb', ..., isDefaultDataCoordSys: true})`\n *  once for each series/components.\n *\n * @return Whether injected.\n */\nexport function injectCoordSysByOption(opt) {\n  var targetModel = opt.targetModel,\n    coordSysType = opt.coordSysType,\n    coordSysProvider = opt.coordSysProvider,\n    isDefaultDataCoordSys = opt.isDefaultDataCoordSys,\n    allowNotFound = opt.allowNotFound;\n  if (process.env.NODE_ENV !== 'production') {\n    zrUtil.assert(!!coordSysType);\n  }\n  var _a = decideCoordSysUsageKind(targetModel, true),\n    kind = _a.kind,\n    declaredType = _a.coordSysType;\n  if (isDefaultDataCoordSys && kind !== CoordinateSystemUsageKind.dataCoordSys) {\n    // If both dataCoordSys and boxCoordSys declared in one model.\n    // There is the only case in series-graph, and no other cases yet.\n    kind = CoordinateSystemUsageKind.dataCoordSys;\n    declaredType = coordSysType;\n  }\n  if (kind === CoordinateSystemUsageKind.none || declaredType !== coordSysType) {\n    return false;\n  }\n  var coordSys = coordSysProvider(coordSysType, targetModel);\n  if (!coordSys) {\n    if (process.env.NODE_ENV !== 'production') {\n      if (!allowNotFound) {\n        error(coordSysType + \" cannot be found for\" + (\" \" + targetModel.type + \" (index: \" + targetModel.componentIndex + \").\"));\n      }\n    }\n    return false;\n  }\n  if (kind === CoordinateSystemUsageKind.dataCoordSys) {\n    if (process.env.NODE_ENV !== 'production') {\n      zrUtil.assert(targetModel.mainType === 'series');\n    }\n    targetModel.coordinateSystem = coordSys;\n  } else {\n    // kind === 'boxCoordSys'\n    targetModel.boxCoordinateSystem = coordSys;\n  }\n  return true;\n}\nexport var simpleCoordSysInjectionProvider = function (coordSysType, injectTargetModel) {\n  var coordSysModel = injectTargetModel.getReferringComponents(coordSysType, SINGLE_REFERRING).models[0];\n  return coordSysModel && coordSysModel.coordinateSystem;\n};\nexport default CoordinateSystemManager;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n// Layout helpers for each component positioning\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport BoundingRect from 'zrender/lib/core/BoundingRect.js';\nimport { parsePercent } from './number.js';\nimport * as formatUtil from './format.js';\nimport { error } from './log.js';\nimport { BoxCoordinateSystemCoordFrom, getCoordForBoxCoordSys } from '../core/CoordinateSystem.js';\nvar each = zrUtil.each;\n/**\n * @public\n */\nexport var LOCATION_PARAMS = ['left', 'right', 'top', 'bottom', 'width', 'height'];\n/**\n * @public\n */\nexport var HV_NAMES = [['width', 'left', 'right'], ['height', 'top', 'bottom']];\nfunction boxLayout(orient, group, gap, maxWidth, maxHeight) {\n  var x = 0;\n  var y = 0;\n  if (maxWidth == null) {\n    maxWidth = Infinity;\n  }\n  if (maxHeight == null) {\n    maxHeight = Infinity;\n  }\n  var currentLineMaxSize = 0;\n  group.eachChild(function (child, idx) {\n    var rect = child.getBoundingRect();\n    var nextChild = group.childAt(idx + 1);\n    var nextChildRect = nextChild && nextChild.getBoundingRect();\n    var nextX;\n    var nextY;\n    if (orient === 'horizontal') {\n      var moveX = rect.width + (nextChildRect ? -nextChildRect.x + rect.x : 0);\n      nextX = x + moveX;\n      // Wrap when width exceeds maxWidth or meet a `newline` group\n      // FIXME compare before adding gap?\n      if (nextX > maxWidth || child.newline) {\n        x = 0;\n        nextX = moveX;\n        y += currentLineMaxSize + gap;\n        currentLineMaxSize = rect.height;\n      } else {\n        // FIXME: consider rect.y is not `0`?\n        currentLineMaxSize = Math.max(currentLineMaxSize, rect.height);\n      }\n    } else {\n      var moveY = rect.height + (nextChildRect ? -nextChildRect.y + rect.y : 0);\n      nextY = y + moveY;\n      // Wrap when width exceeds maxHeight or meet a `newline` group\n      if (nextY > maxHeight || child.newline) {\n        x += currentLineMaxSize + gap;\n        y = 0;\n        nextY = moveY;\n        currentLineMaxSize = rect.width;\n      } else {\n        currentLineMaxSize = Math.max(currentLineMaxSize, rect.width);\n      }\n    }\n    if (child.newline) {\n      return;\n    }\n    child.x = x;\n    child.y = y;\n    child.markRedraw();\n    orient === 'horizontal' ? x = nextX + gap : y = nextY + gap;\n  });\n}\n/**\n * VBox or HBox layouting\n * @param {string} orient\n * @param {module:zrender/graphic/Group} group\n * @param {number} gap\n * @param {number} [width=Infinity]\n * @param {number} [height=Infinity]\n */\nexport var box = boxLayout;\n/**\n * VBox layouting\n * @param {module:zrender/graphic/Group} group\n * @param {number} gap\n * @param {number} [width=Infinity]\n * @param {number} [height=Infinity]\n */\nexport var vbox = zrUtil.curry(boxLayout, 'vertical');\n/**\n * HBox layouting\n * @param {module:zrender/graphic/Group} group\n * @param {number} gap\n * @param {number} [width=Infinity]\n * @param {number} [height=Infinity]\n */\nexport var hbox = zrUtil.curry(boxLayout, 'horizontal');\nexport function getBoxLayoutParams(boxLayoutModel, ignoreParent) {\n  return {\n    left: boxLayoutModel.getShallow('left', ignoreParent),\n    top: boxLayoutModel.getShallow('top', ignoreParent),\n    right: boxLayoutModel.getShallow('right', ignoreParent),\n    bottom: boxLayoutModel.getShallow('bottom', ignoreParent),\n    width: boxLayoutModel.getShallow('width', ignoreParent),\n    height: boxLayoutModel.getShallow('height', ignoreParent)\n  };\n}\nfunction getViewRectAndCenterForCircleLayout(seriesModel, api) {\n  var layoutRef = createBoxLayoutReference(seriesModel, api, {\n    enableLayoutOnlyByCenter: true\n  });\n  var boxLayoutParams = seriesModel.getBoxLayoutParams();\n  var viewRect;\n  var center;\n  if (layoutRef.type === BoxLayoutReferenceType.point) {\n    center = layoutRef.refPoint;\n    // `viewRect` is required in `pie/labelLayout.ts`.\n    viewRect = getLayoutRect(boxLayoutParams, {\n      width: api.getWidth(),\n      height: api.getHeight()\n    });\n  } else {\n    // layoutRef.type === layout.BoxLayoutReferenceType.rect\n    var centerOption = seriesModel.get('center');\n    var centerOptionArr = zrUtil.isArray(centerOption) ? centerOption : [centerOption, centerOption];\n    viewRect = getLayoutRect(boxLayoutParams, layoutRef.refContainer);\n    center = layoutRef.boxCoordFrom === BoxCoordinateSystemCoordFrom.coord2 ? layoutRef.refPoint // option `series.center` has been used as coord.\n    : [parsePercent(centerOptionArr[0], viewRect.width) + viewRect.x, parsePercent(centerOptionArr[1], viewRect.height) + viewRect.y];\n  }\n  return {\n    viewRect: viewRect,\n    center: center\n  };\n}\nexport function getCircleLayout(seriesModel, api) {\n  // center can be string or number when coordinateSystem is specified\n  var _a = getViewRectAndCenterForCircleLayout(seriesModel, api),\n    viewRect = _a.viewRect,\n    center = _a.center;\n  var radius = seriesModel.get('radius');\n  if (!zrUtil.isArray(radius)) {\n    radius = [0, radius];\n  }\n  var width = parsePercent(viewRect.width, api.getWidth());\n  var height = parsePercent(viewRect.height, api.getHeight());\n  var size = Math.min(width, height);\n  var r0 = parsePercent(radius[0], size / 2);\n  var r = parsePercent(radius[1], size / 2);\n  return {\n    cx: center[0],\n    cy: center[1],\n    r0: r0,\n    r: r,\n    viewRect: viewRect\n  };\n}\n/**\n * Parse position info.\n */\nexport function getLayoutRect(positionInfo, containerRect,\n// This is the space from the `containerRect` to the returned bounding rect.\n// Commonly used in option `legend.padding`, `timeline.padding`, `title.padding`,\n//  `visualMap.padding`, ...\n// [NOTICE]:\n//  It's named `margin`, because it's the space that outside the bounding rect. But from\n//  the perspective of the the caller, it's commonly used as the `padding` of a component,\n//  because conventionally background color covers this space.\n// [BEHAVIOR]:\n//  - If width/height is specified, `margin` does not effect them.\n//  - Otherwise, they are calculated based on the rect that `containerRect` shrinked by `margin`.\n//  - left/right/top/bottom are based on the rect that `containerRect` shrinked by `margin`.\nmargin) {\n  margin = formatUtil.normalizeCssArray(margin || 0);\n  var containerWidth = containerRect.width;\n  var containerHeight = containerRect.height;\n  var left = parsePercent(positionInfo.left, containerWidth);\n  var top = parsePercent(positionInfo.top, containerHeight);\n  var right = parsePercent(positionInfo.right, containerWidth);\n  var bottom = parsePercent(positionInfo.bottom, containerHeight);\n  var width = parsePercent(positionInfo.width, containerWidth);\n  var height = parsePercent(positionInfo.height, containerHeight);\n  var verticalMargin = margin[2] + margin[0];\n  var horizontalMargin = margin[1] + margin[3];\n  var aspect = positionInfo.aspect;\n  // If width is not specified, calculate width from left and right\n  if (isNaN(width)) {\n    width = containerWidth - right - horizontalMargin - left;\n  }\n  if (isNaN(height)) {\n    height = containerHeight - bottom - verticalMargin - top;\n  }\n  if (aspect != null) {\n    // If width and height are not given\n    // 1. Graph should not exceeds the container\n    // 2. Aspect must be keeped\n    // 3. Graph should take the space as more as possible\n    // FIXME\n    // Margin is not considered, because there is no case that both\n    // using margin and aspect so far.\n    if (isNaN(width) && isNaN(height)) {\n      // PENDING: if only `left` or `right` is defined, perhaps it's more preferable to\n      // calculate size based on `containerWidth - left` or `containerWidth - left` here,\n      // but for backward compatibility we do not change it.\n      if (aspect > containerWidth / containerHeight) {\n        width = containerWidth * 0.8;\n      } else {\n        height = containerHeight * 0.8;\n      }\n    }\n    // Calculate width or height with given aspect\n    if (isNaN(width)) {\n      width = aspect * height;\n    }\n    if (isNaN(height)) {\n      height = width / aspect;\n    }\n  }\n  // If left is not specified, calculate left from right and width\n  if (isNaN(left)) {\n    left = containerWidth - right - width - horizontalMargin;\n  }\n  if (isNaN(top)) {\n    top = containerHeight - bottom - height - verticalMargin;\n  }\n  // Align left and top\n  switch (positionInfo.left || positionInfo.right) {\n    case 'center':\n      left = containerWidth / 2 - width / 2 - margin[3];\n      break;\n    case 'right':\n      left = containerWidth - width - horizontalMargin;\n      break;\n  }\n  switch (positionInfo.top || positionInfo.bottom) {\n    case 'middle':\n    case 'center':\n      top = containerHeight / 2 - height / 2 - margin[0];\n      break;\n    case 'bottom':\n      top = containerHeight - height - verticalMargin;\n      break;\n  }\n  // If something is wrong and left, top, width, height are calculated as NaN\n  left = left || 0;\n  top = top || 0;\n  if (isNaN(width)) {\n    // Width may be NaN if only one value is given except width\n    width = containerWidth - horizontalMargin - left - (right || 0);\n  }\n  if (isNaN(height)) {\n    // Height may be NaN if only one value is given except height\n    height = containerHeight - verticalMargin - top - (bottom || 0);\n  }\n  var rect = new BoundingRect((containerRect.x || 0) + left + margin[3], (containerRect.y || 0) + top + margin[0], width, height);\n  rect.margin = margin;\n  return rect;\n}\n/**\n * PENDING:\n *  when preserveAspect: 'cover' and aspect is near Infinity\n *  or when preserveAspect: 'contain' and aspect is near 0,\n *  the result width or height is near Inifity. It's logically correct,\n *  Therefore currently we do not handle it, until bad cases arise.\n */\nexport function applyPreserveAspect(component, layoutRect,\n// That is, `width / height`.\n// Assume `aspect` is positive.\naspect) {\n  var preserveAspect = component.getShallow('preserveAspect', true);\n  if (!preserveAspect) {\n    return layoutRect;\n  }\n  var actualAspect = layoutRect.width / layoutRect.height;\n  if (Math.abs(Math.atan(aspect) - Math.atan(actualAspect)) < 1e-9) {\n    return layoutRect;\n  }\n  var preserveAspectAlign = component.getShallow('preserveAspectAlign', true);\n  var preserveAspectVerticalAlign = component.getShallow('preserveAspectVerticalAlign', true);\n  var layoutOptInner = {\n    width: layoutRect.width,\n    height: layoutRect.height\n  };\n  var isCover = preserveAspect === 'cover';\n  if (actualAspect > aspect && !isCover || actualAspect < aspect && isCover) {\n    layoutOptInner.width = layoutRect.height * aspect;\n    preserveAspectAlign === 'left' ? layoutOptInner.left = 0 : preserveAspectAlign === 'right' ? layoutOptInner.right = 0 : layoutOptInner.left = 'center';\n  } else {\n    layoutOptInner.height = layoutRect.width / aspect;\n    preserveAspectVerticalAlign === 'top' ? layoutOptInner.top = 0 : preserveAspectVerticalAlign === 'bottom' ? layoutOptInner.bottom = 0 : layoutOptInner.top = 'middle';\n  }\n  return getLayoutRect(layoutOptInner, layoutRect);\n}\nexport var BoxLayoutReferenceType = {\n  rect: 1,\n  point: 2\n};\n/**\n * Uniformly calculate layout reference (rect or center) based on either:\n *  - viewport:\n *      - Get `refContainer` as `{x: 0, y: 0, width: api.getWidth(), height: api.getHeight()}`\n *  - coordinate system, which can serve in several ways:\n *      - Use `dataToPoint` to get the `refPoint`, such as, in cartesian2d coord sys.\n *      - Use `dataToLayout` to get the `refContainer`, such as, in matrix coord sys.\n */\nexport function createBoxLayoutReference(model, api, opt) {\n  var refContainer;\n  var refPoint;\n  var layoutRefType;\n  var boxCoordSys = model.boxCoordinateSystem;\n  var boxCoordFrom;\n  if (boxCoordSys) {\n    var _a = getCoordForBoxCoordSys(model),\n      coord = _a.coord,\n      from = _a.from;\n    // Do not use `clamp` in `dataToLayout` and `dataToPoint`, because:\n    //  1. Should support overflow (such as, by dataZoom), where NaN should be in the result.\n    //  2. Be consistent with the way used in `series.data`\n    if (boxCoordSys.dataToLayout) {\n      layoutRefType = BoxLayoutReferenceType.rect;\n      boxCoordFrom = from;\n      var result = boxCoordSys.dataToLayout(coord);\n      refContainer = result.contentRect || result.rect;\n    } else if (opt && opt.enableLayoutOnlyByCenter && boxCoordSys.dataToPoint) {\n      layoutRefType = BoxLayoutReferenceType.point;\n      boxCoordFrom = from;\n      refPoint = boxCoordSys.dataToPoint(coord);\n    } else {\n      if (process.env.NODE_ENV !== 'production') {\n        error(model.type + \"[\" + model.componentIndex + \"]\" + (\" layout based on \" + boxCoordSys.type + \" is not supported.\"));\n      }\n    }\n  }\n  if (layoutRefType == null) {\n    layoutRefType = BoxLayoutReferenceType.rect;\n  }\n  if (layoutRefType === BoxLayoutReferenceType.rect) {\n    if (!refContainer) {\n      refContainer = {\n        x: 0,\n        y: 0,\n        width: api.getWidth(),\n        height: api.getHeight()\n      };\n    }\n    refPoint = [refContainer.x + refContainer.width / 2, refContainer.y + refContainer.height / 2];\n  }\n  return {\n    type: layoutRefType,\n    refContainer: refContainer,\n    refPoint: refPoint,\n    boxCoordFrom: boxCoordFrom\n  };\n}\n/**\n * Position a zr element in viewport\n *  Group position is specified by either\n *  {left, top}, {right, bottom}\n *  If all properties exists, right and bottom will be igonred.\n *\n * Logic:\n *     1. Scale (against origin point in parent coord)\n *     2. Rotate (against origin point in parent coord)\n *     3. Translate (with el.position by this method)\n * So this method only fixes the last step 'Translate', which does not affect\n * scaling and rotating.\n *\n * If be called repeatedly with the same input el, the same result will be gotten.\n *\n * Return true if the layout happened.\n *\n * @param el Should have `getBoundingRect` method.\n * @param positionInfo\n * @param positionInfo.left\n * @param positionInfo.top\n * @param positionInfo.right\n * @param positionInfo.bottom\n * @param positionInfo.width Only for opt.boundingModel: 'raw'\n * @param positionInfo.height Only for opt.boundingModel: 'raw'\n * @param containerRect\n * @param margin\n * @param opt\n * @param opt.hv Only horizontal or only vertical. Default to be [1, 1]\n * @param opt.boundingMode\n *        Specify how to calculate boundingRect when locating.\n *        'all': Position the boundingRect that is transformed and uioned\n *               both itself and its descendants.\n *               This mode simplies confine the elements in the bounding\n *               of their container (e.g., using 'right: 0').\n *        'raw': Position the boundingRect that is not transformed and only itself.\n *               This mode is useful when you want a element can overflow its\n *               container. (Consider a rotated circle needs to be located in a corner.)\n *               In this mode positionInfo.width/height can only be number.\n */\nexport function positionElement(el, positionInfo, containerRect, margin, opt, out) {\n  var h = !opt || !opt.hv || opt.hv[0];\n  var v = !opt || !opt.hv || opt.hv[1];\n  var boundingMode = opt && opt.boundingMode || 'all';\n  out = out || el;\n  out.x = el.x;\n  out.y = el.y;\n  if (!h && !v) {\n    return false;\n  }\n  var rect;\n  if (boundingMode === 'raw') {\n    rect = el.type === 'group' ? new BoundingRect(0, 0, +positionInfo.width || 0, +positionInfo.height || 0) : el.getBoundingRect();\n  } else {\n    rect = el.getBoundingRect();\n    if (el.needLocalTransform()) {\n      var transform = el.getLocalTransform();\n      // Notice: raw rect may be inner object of el,\n      // which should not be modified.\n      rect = rect.clone();\n      rect.applyTransform(transform);\n    }\n  }\n  // The real width and height can not be specified but calculated by the given el.\n  var layoutRect = getLayoutRect(zrUtil.defaults({\n    width: rect.width,\n    height: rect.height\n  }, positionInfo), containerRect, margin);\n  // Because 'tranlate' is the last step in transform\n  // (see zrender/core/Transformable#getLocalTransform),\n  // we can just only modify el.position to get final result.\n  var dx = h ? layoutRect.x - rect.x : 0;\n  var dy = v ? layoutRect.y - rect.y : 0;\n  if (boundingMode === 'raw') {\n    out.x = dx;\n    out.y = dy;\n  } else {\n    out.x += dx;\n    out.y += dy;\n  }\n  if (out === el) {\n    el.markRedraw();\n  }\n  return true;\n}\n/**\n * @param option Contains some of the properties in HV_NAMES.\n * @param hvIdx 0: horizontal; 1: vertical.\n */\nexport function sizeCalculable(option, hvIdx) {\n  return option[HV_NAMES[hvIdx][0]] != null || option[HV_NAMES[hvIdx][1]] != null && option[HV_NAMES[hvIdx][2]] != null;\n}\nexport function fetchLayoutMode(ins) {\n  var layoutMode = ins.layoutMode || ins.constructor.layoutMode;\n  return zrUtil.isObject(layoutMode) ? layoutMode : layoutMode ? {\n    type: layoutMode\n  } : null;\n}\n/**\n * Consider Case:\n * When default option has {left: 0, width: 100}, and we set {right: 0}\n * through setOption or media query, using normal zrUtil.merge will cause\n * {right: 0} does not take effect.\n *\n * @example\n * ComponentModel.extend({\n *     init: function () {\n *         ...\n *         let inputPositionParams = layout.getLayoutParams(option);\n *         this.mergeOption(inputPositionParams);\n *     },\n *     mergeOption: function (newOption) {\n *         newOption && zrUtil.merge(thisOption, newOption, true);\n *         layout.mergeLayoutParam(thisOption, newOption);\n *     }\n * });\n *\n * @param targetOption\n * @param newOption\n * @param opt\n */\nexport function mergeLayoutParam(targetOption, newOption, opt) {\n  var ignoreSize = opt && opt.ignoreSize;\n  !zrUtil.isArray(ignoreSize) && (ignoreSize = [ignoreSize, ignoreSize]);\n  var hResult = merge(HV_NAMES[0], 0);\n  var vResult = merge(HV_NAMES[1], 1);\n  copy(HV_NAMES[0], targetOption, hResult);\n  copy(HV_NAMES[1], targetOption, vResult);\n  function merge(names, hvIdx) {\n    var newParams = {};\n    var newValueCount = 0;\n    var merged = {};\n    var mergedValueCount = 0;\n    var enoughParamNumber = 2;\n    each(names, function (name) {\n      merged[name] = targetOption[name];\n    });\n    each(names, function (name) {\n      // Consider case: newOption.width is null, which is\n      // set by user for removing width setting.\n      zrUtil.hasOwn(newOption, name) && (newParams[name] = merged[name] = newOption[name]);\n      hasValue(newParams, name) && newValueCount++;\n      hasValue(merged, name) && mergedValueCount++;\n    });\n    if (ignoreSize[hvIdx]) {\n      // Only one of left/right is premitted to exist.\n      if (hasValue(newOption, names[1])) {\n        merged[names[2]] = null;\n      } else if (hasValue(newOption, names[2])) {\n        merged[names[1]] = null;\n      }\n      return merged;\n    }\n    // Case: newOption: {width: ..., right: ...},\n    // or targetOption: {right: ...} and newOption: {width: ...},\n    // There is no conflict when merged only has params count\n    // little than enoughParamNumber.\n    if (mergedValueCount === enoughParamNumber || !newValueCount) {\n      return merged;\n    }\n    // Case: newOption: {width: ..., right: ...},\n    // Than we can make sure user only want those two, and ignore\n    // all origin params in targetOption.\n    else if (newValueCount >= enoughParamNumber) {\n      return newParams;\n    } else {\n      // Chose another param from targetOption by priority.\n      for (var i = 0; i < names.length; i++) {\n        var name_1 = names[i];\n        if (!zrUtil.hasOwn(newParams, name_1) && zrUtil.hasOwn(targetOption, name_1)) {\n          newParams[name_1] = targetOption[name_1];\n          break;\n        }\n      }\n      return newParams;\n    }\n  }\n  function hasValue(obj, name) {\n    return obj[name] != null && obj[name] !== 'auto';\n  }\n  function copy(names, target, source) {\n    each(names, function (name) {\n      target[name] = source[name];\n    });\n  }\n}\n/**\n * Retrieve 'left', 'right', 'top', 'bottom', 'width', 'height' from object.\n */\nexport function getLayoutParams(source) {\n  return copyLayoutParams({}, source);\n}\n/**\n * Retrieve 'left', 'right', 'top', 'bottom', 'width', 'height' from object.\n * @param {Object} source\n * @return {Object} Result contains those props.\n */\nexport function copyLayoutParams(target, source) {\n  source && target && each(LOCATION_PARAMS, function (name) {\n    zrUtil.hasOwn(source, name) && (target[name] = source[name]);\n  });\n  return target;\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport Model from './Model.js';\nimport * as componentUtil from '../util/component.js';\nimport { enableClassManagement, parseClassType, isExtendedClass, mountExtend } from '../util/clazz.js';\nimport { makeInner, queryReferringComponents } from '../util/model.js';\nimport * as layout from '../util/layout.js';\nvar inner = makeInner();\nvar ComponentModel = /** @class */function (_super) {\n  __extends(ComponentModel, _super);\n  function ComponentModel(option, parentModel, ecModel) {\n    var _this = _super.call(this, option, parentModel, ecModel) || this;\n    _this.uid = componentUtil.getUID('ec_cpt_model');\n    return _this;\n  }\n  ComponentModel.prototype.init = function (option, parentModel, ecModel) {\n    this.mergeDefaultAndTheme(option, ecModel);\n  };\n  ComponentModel.prototype.mergeDefaultAndTheme = function (option, ecModel) {\n    var layoutMode = layout.fetchLayoutMode(this);\n    var inputPositionParams = layoutMode ? layout.getLayoutParams(option) : {};\n    var themeModel = ecModel.getTheme();\n    zrUtil.merge(option, themeModel.get(this.mainType));\n    zrUtil.merge(option, this.getDefaultOption());\n    if (layoutMode) {\n      layout.mergeLayoutParam(option, inputPositionParams, layoutMode);\n    }\n  };\n  ComponentModel.prototype.mergeOption = function (option, ecModel) {\n    zrUtil.merge(this.option, option, true);\n    var layoutMode = layout.fetchLayoutMode(this);\n    if (layoutMode) {\n      layout.mergeLayoutParam(this.option, option, layoutMode);\n    }\n  };\n  /**\n   * Called immediately after `init` or `mergeOption` of this instance called.\n   */\n  ComponentModel.prototype.optionUpdated = function (newCptOption, isInit) {};\n  /**\n   * [How to declare defaultOption]:\n   *\n   * (A) If using class declaration in typescript (since echarts 5):\n   * ```ts\n   * import {ComponentOption} from '../model/option.js';\n   * export interface XxxOption extends ComponentOption {\n   *     aaa: number\n   * }\n   * export class XxxModel extends Component {\n   *     static type = 'xxx';\n   *     static defaultOption: XxxOption = {\n   *         aaa: 123\n   *     }\n   * }\n   * Component.registerClass(XxxModel);\n   * ```\n   * ```ts\n   * import {inheritDefaultOption} from '../util/component.js';\n   * import {XxxModel, XxxOption} from './XxxModel.js';\n   * export interface XxxSubOption extends XxxOption {\n   *     bbb: number\n   * }\n   * class XxxSubModel extends XxxModel {\n   *     static defaultOption: XxxSubOption = inheritDefaultOption(XxxModel.defaultOption, {\n   *         bbb: 456\n   *     })\n   *     fn() {\n   *         let opt = this.getDefaultOption();\n   *         // opt is {aaa: 123, bbb: 456}\n   *     }\n   * }\n   * ```\n   *\n   * (B) If using class extend (previous approach in echarts 3 & 4):\n   * ```js\n   * let XxxComponent = Component.extend({\n   *     defaultOption: {\n   *         xx: 123\n   *     }\n   * })\n   * ```\n   * ```js\n   * let XxxSubComponent = XxxComponent.extend({\n   *     defaultOption: {\n   *         yy: 456\n   *     },\n   *     fn: function () {\n   *         let opt = this.getDefaultOption();\n   *         // opt is {xx: 123, yy: 456}\n   *     }\n   * })\n   * ```\n   */\n  ComponentModel.prototype.getDefaultOption = function () {\n    var ctor = this.constructor;\n    if (!isExtendedClass(ctor)) {\n      // When using ES class declaration, defaultOption must be declared as static.\n      // And manually inherit the defaultOption from its parent class if needed, such as,\n      //  ```ts\n      //  static defaultOption = inheritDefaultOption(ParentModel.defaultOption, {...});\n      //  ```\n      return ctor.defaultOption;\n    }\n    // FIXME: remove this approach?\n    // Legacy: auto merge defaultOption from ancestor classes if using ParentClass.extend(subProto)\n    var fields = inner(this);\n    if (!fields.defaultOption) {\n      var optList = [];\n      var clz = ctor;\n      while (clz) {\n        var opt = clz.prototype.defaultOption;\n        opt && optList.push(opt);\n        clz = clz.superClass;\n      }\n      var defaultOption = {};\n      for (var i = optList.length - 1; i >= 0; i--) {\n        defaultOption = zrUtil.merge(defaultOption, optList[i], true);\n      }\n      fields.defaultOption = defaultOption;\n    }\n    return fields.defaultOption;\n  };\n  /**\n   * Notice: always force to input param `useDefault` in case that forget to consider it.\n   * The same behavior as `modelUtil.parseFinder`.\n   *\n   * @param useDefault In many cases like series refer axis and axis refer grid,\n   *        If axis index / axis id not specified, use the first target as default.\n   *        In other cases like dataZoom refer axis, if not specified, measn no refer.\n   */\n  ComponentModel.prototype.getReferringComponents = function (mainType, opt) {\n    var indexKey = mainType + 'Index';\n    var idKey = mainType + 'Id';\n    return queryReferringComponents(this.ecModel, mainType, {\n      index: this.get(indexKey, true),\n      id: this.get(idKey, true)\n    }, opt);\n  };\n  ComponentModel.prototype.getBoxLayoutParams = function () {\n    // Consider itself having box layout configs.\n    // For backward compatibility, by default do not `ignoreParent`.\n    return layout.getBoxLayoutParams(this, false);\n  };\n  /**\n   * Get key for zlevel.\n   * If developers don't configure zlevel. We will assign zlevel to series based on the key.\n   * For example, lines with trail effect and progressive series will in an individual zlevel.\n   */\n  ComponentModel.prototype.getZLevelKey = function () {\n    return '';\n  };\n  ComponentModel.prototype.setZLevel = function (zlevel) {\n    this.option.zlevel = zlevel;\n  };\n  ComponentModel.protoInitialize = function () {\n    var proto = ComponentModel.prototype;\n    proto.type = 'component';\n    proto.id = '';\n    proto.name = '';\n    proto.mainType = '';\n    proto.subType = '';\n    proto.componentIndex = 0;\n  }();\n  return ComponentModel;\n}(Model);\nmountExtend(ComponentModel, Model);\nenableClassManagement(ComponentModel);\ncomponentUtil.enableSubTypeDefaulter(ComponentModel);\ncomponentUtil.enableTopologicalTravel(ComponentModel, getDependencies);\nfunction getDependencies(componentType) {\n  var deps = [];\n  zrUtil.each(ComponentModel.getClassesByMainType(componentType), function (clz) {\n    deps = deps.concat(clz.dependencies || clz.prototype.dependencies || []);\n  });\n  // Ensure main type.\n  deps = zrUtil.map(deps, function (type) {\n    return parseClassType(type).main;\n  });\n  // Hack dataset for convenience.\n  if (componentType !== 'dataset' && zrUtil.indexOf(deps, 'dataset') <= 0) {\n    deps.unshift('dataset');\n  }\n  return deps;\n}\nexport default ComponentModel;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { extend } from 'zrender/lib/core/util.js';\nimport { modifyHSL } from 'zrender/lib/tool/color.js';\nvar tokens = {\n  color: {},\n  darkColor: {},\n  size: {}\n};\nvar color = tokens.color = {\n  theme: ['#5070dd', '#b6d634', '#505372', '#ff994d', '#0ca8df', '#ffd10a', '#fb628b', '#785db0', '#3fbe95'],\n  neutral00: '#fff',\n  neutral05: '#f4f7fd',\n  neutral10: '#e8ebf0',\n  neutral15: '#dbdee4',\n  neutral20: '#cfd2d7',\n  neutral25: '#c3c5cb',\n  neutral30: '#b7b9be',\n  neutral35: '#aaacb2',\n  neutral40: '#9ea0a5',\n  neutral45: '#929399',\n  neutral50: '#86878c',\n  neutral55: '#797b7f',\n  neutral60: '#6d6e73',\n  neutral65: '#616266',\n  neutral70: '#54555a',\n  neutral75: '#48494d',\n  neutral80: '#3c3c41',\n  neutral85: '#303034',\n  neutral90: '#232328',\n  neutral95: '#17171b',\n  neutral99: '#000',\n  accent05: '#eff1f9',\n  accent10: '#e0e4f2',\n  accent15: '#d0d6ec',\n  accent20: '#c0c9e6',\n  accent25: '#b1bbdf',\n  accent30: '#a1aed9',\n  accent35: '#91a0d3',\n  accent40: '#8292cc',\n  accent45: '#7285c6',\n  accent50: '#6578ba',\n  accent55: '#5c6da9',\n  accent60: '#536298',\n  accent65: '#4a5787',\n  accent70: '#404c76',\n  accent75: '#374165',\n  accent80: '#2e3654',\n  accent85: '#252b43',\n  accent90: '#1b2032',\n  accent95: '#121521',\n  transparent: 'rgba(0,0,0,0)',\n  highlight: 'rgba(255,231,130,0.8)'\n};\nextend(color, {\n  primary: color.neutral80,\n  secondary: color.neutral70,\n  tertiary: color.neutral60,\n  quaternary: color.neutral50,\n  disabled: color.neutral20,\n  border: color.neutral30,\n  borderTint: color.neutral20,\n  borderShade: color.neutral40,\n  background: color.neutral05,\n  backgroundTint: 'rgba(234,237,245,0.5)',\n  backgroundTransparent: 'rgba(255,255,255,0)',\n  backgroundShade: color.neutral10,\n  shadow: 'rgba(0,0,0,0.2)',\n  shadowTint: 'rgba(129,130,136,0.2)',\n  axisLine: color.neutral70,\n  axisLineTint: color.neutral40,\n  axisTick: color.neutral70,\n  axisTickMinor: color.neutral60,\n  axisLabel: color.neutral70,\n  axisSplitLine: color.neutral15,\n  axisMinorSplitLine: color.neutral05\n});\nfor (var key in color) {\n  if (color.hasOwnProperty(key)) {\n    var hex = color[key];\n    if (key === 'theme') {\n      // Don't modify theme colors.\n      tokens.darkColor.theme = color.theme.slice();\n    } else if (key === 'highlight') {\n      tokens.darkColor.highlight = 'rgba(255,231,130,0.4)';\n    } else if (key.indexOf('accent') === 0) {\n      // Desaturate and lighten accent colors.\n      tokens.darkColor[key] = modifyHSL(hex, null, function (s) {\n        return s * 0.5;\n      }, function (l) {\n        return Math.min(1, 1.3 - l);\n      });\n    } else {\n      tokens.darkColor[key] = modifyHSL(hex, null, function (s) {\n        return s * 0.9;\n      }, function (l) {\n        return 1 - Math.pow(l, 1.5);\n      });\n    }\n  }\n}\ntokens.size = {\n  xxs: 2,\n  xs: 5,\n  s: 10,\n  m: 15,\n  l: 20,\n  xl: 30,\n  xxl: 40,\n  xxxl: 50\n};\nexport default tokens;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { modifyHSL } from 'zrender/lib/tool/color.js';\nimport tokens from '../visual/tokens.js';\nvar platform = '';\n// Navigator not exists in node\nif (typeof navigator !== 'undefined') {\n  /* global navigator */\n  platform = navigator.platform || '';\n}\nvar decalColor = 'rgba(0, 0, 0, 0.2)';\nvar themeColor = tokens.color.theme[0];\nvar lightThemeColor = modifyHSL(themeColor, null, null, 0.9);\nexport default {\n  darkMode: 'auto',\n  // backgroundColor: 'rgba(0,0,0,0)',\n  colorBy: 'series',\n  color: tokens.color.theme,\n  gradientColor: [lightThemeColor, themeColor],\n  aria: {\n    decal: {\n      decals: [{\n        color: decalColor,\n        dashArrayX: [1, 0],\n        dashArrayY: [2, 5],\n        symbolSize: 1,\n        rotation: Math.PI / 6\n      }, {\n        color: decalColor,\n        symbol: 'circle',\n        dashArrayX: [[8, 8], [0, 8, 8, 0]],\n        dashArrayY: [6, 0],\n        symbolSize: 0.8\n      }, {\n        color: decalColor,\n        dashArrayX: [1, 0],\n        dashArrayY: [4, 3],\n        rotation: -Math.PI / 4\n      }, {\n        color: decalColor,\n        dashArrayX: [[6, 6], [0, 6, 6, 0]],\n        dashArrayY: [6, 0]\n      }, {\n        color: decalColor,\n        dashArrayX: [[1, 0], [1, 6]],\n        dashArrayY: [1, 0, 6, 0],\n        rotation: Math.PI / 4\n      }, {\n        color: decalColor,\n        symbol: 'triangle',\n        dashArrayX: [[9, 9], [0, 9, 9, 0]],\n        dashArrayY: [7, 2],\n        symbolSize: 0.75\n      }]\n    }\n  },\n  // If xAxis and yAxis declared, grid is created by default.\n  // grid: {},\n  textStyle: {\n    // color: '#000',\n    // decoration: 'none',\n    // PENDING\n    fontFamily: platform.match(/^Win/) ? 'Microsoft YaHei' : 'sans-serif',\n    // fontFamily: 'Arial, Verdana, sans-serif',\n    fontSize: 12,\n    fontStyle: 'normal',\n    fontWeight: 'normal'\n  },\n  // http://blogs.adobe.com/webplatform/2014/02/24/using-blend-modes-in-html-canvas/\n  // https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/globalCompositeOperation\n  // Default is source-over\n  blendMode: null,\n  stateAnimation: {\n    duration: 300,\n    easing: 'cubicOut'\n  },\n  animation: 'auto',\n  animationDuration: 1000,\n  animationDurationUpdate: 500,\n  animationEasing: 'cubicInOut',\n  animationEasingUpdate: 'cubicInOut',\n  animationThreshold: 2000,\n  // Configuration for progressive/incremental rendering\n  progressiveThreshold: 3000,\n  progressive: 400,\n  // Threshold of if use single hover layer to optimize.\n  // It is recommended that `hoverLayerThreshold` is equivalent to or less than\n  // `progressiveThreshold`, otherwise hover will cause restart of progressive,\n  // which is unexpected.\n  // see example <echarts/test/heatmap-large.html>.\n  hoverLayerThreshold: 3000,\n  // See: module:echarts/scale/Time\n  useUTC: false\n};", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { createHashMap } from 'zrender/lib/core/util.js';\n;\n;\n;\nexport var VISUAL_DIMENSIONS = createHashMap(['tooltip', 'label', 'itemName', 'itemId', 'itemGroupId', 'itemChildGroupId', 'seriesName']);\nexport var SOURCE_FORMAT_ORIGINAL = 'original';\nexport var SOURCE_FORMAT_ARRAY_ROWS = 'arrayRows';\nexport var SOURCE_FORMAT_OBJECT_ROWS = 'objectRows';\nexport var SOURCE_FORMAT_KEYED_COLUMNS = 'keyedColumns';\nexport var SOURCE_FORMAT_TYPED_ARRAY = 'typedArray';\nexport var SOURCE_FORMAT_UNKNOWN = 'unknown';\nexport var SERIES_LAYOUT_BY_COLUMN = 'column';\nexport var SERIES_LAYOUT_BY_ROW = 'row';\n;\n;\n;\n;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { makeInner, getDataItemValue, queryReferringComponents, SINGLE_REFERRING } from '../../util/model.js';\nimport { createHashMap, each, isArray, isString, isObject, isTypedArray } from 'zrender/lib/core/util.js';\nimport { SOURCE_FORMAT_ORIGINAL, SOURCE_FORMAT_ARRAY_ROWS, SOURCE_FORMAT_OBJECT_ROWS, SERIES_LAYOUT_BY_ROW, SOURCE_FORMAT_KEYED_COLUMNS } from '../../util/types.js';\n// The result of `guessOrdinal`.\nexport var BE_ORDINAL = {\n  Must: 1,\n  Might: 2,\n  Not: 3 // Other cases\n};\nvar innerGlobalModel = makeInner();\n/**\n * MUST be called before mergeOption of all series.\n */\nexport function resetSourceDefaulter(ecModel) {\n  // `datasetMap` is used to make default encode.\n  innerGlobalModel(ecModel).datasetMap = createHashMap();\n}\n/**\n * [The strategy of the arrengment of data dimensions for dataset]:\n * \"value way\": all axes are non-category axes. So series one by one take\n *     several (the number is coordSysDims.length) dimensions from dataset.\n *     The result of data arrengment of data dimensions like:\n *     | ser0_x | ser0_y | ser1_x | ser1_y | ser2_x | ser2_y |\n * \"category way\": at least one axis is category axis. So the the first data\n *     dimension is always mapped to the first category axis and shared by\n *     all of the series. The other data dimensions are taken by series like\n *     \"value way\" does.\n *     The result of data arrengment of data dimensions like:\n *     | ser_shared_x | ser0_y | ser1_y | ser2_y |\n *\n * @return encode Never be `null/undefined`.\n */\nexport function makeSeriesEncodeForAxisCoordSys(coordDimensions, seriesModel, source) {\n  var encode = {};\n  var datasetModel = querySeriesUpstreamDatasetModel(seriesModel);\n  // Currently only make default when using dataset, util more reqirements occur.\n  if (!datasetModel || !coordDimensions) {\n    return encode;\n  }\n  var encodeItemName = [];\n  var encodeSeriesName = [];\n  var ecModel = seriesModel.ecModel;\n  var datasetMap = innerGlobalModel(ecModel).datasetMap;\n  var key = datasetModel.uid + '_' + source.seriesLayoutBy;\n  var baseCategoryDimIndex;\n  var categoryWayValueDimStart;\n  coordDimensions = coordDimensions.slice();\n  each(coordDimensions, function (coordDimInfoLoose, coordDimIdx) {\n    var coordDimInfo = isObject(coordDimInfoLoose) ? coordDimInfoLoose : coordDimensions[coordDimIdx] = {\n      name: coordDimInfoLoose\n    };\n    if (coordDimInfo.type === 'ordinal' && baseCategoryDimIndex == null) {\n      baseCategoryDimIndex = coordDimIdx;\n      categoryWayValueDimStart = getDataDimCountOnCoordDim(coordDimInfo);\n    }\n    encode[coordDimInfo.name] = [];\n  });\n  var datasetRecord = datasetMap.get(key) || datasetMap.set(key, {\n    categoryWayDim: categoryWayValueDimStart,\n    valueWayDim: 0\n  });\n  // TODO\n  // Auto detect first time axis and do arrangement.\n  each(coordDimensions, function (coordDimInfo, coordDimIdx) {\n    var coordDimName = coordDimInfo.name;\n    var count = getDataDimCountOnCoordDim(coordDimInfo);\n    // In value way.\n    if (baseCategoryDimIndex == null) {\n      var start = datasetRecord.valueWayDim;\n      pushDim(encode[coordDimName], start, count);\n      pushDim(encodeSeriesName, start, count);\n      datasetRecord.valueWayDim += count;\n      // ??? TODO give a better default series name rule?\n      // especially when encode x y specified.\n      // consider: when multiple series share one dimension\n      // category axis, series name should better use\n      // the other dimension name. On the other hand, use\n      // both dimensions name.\n    }\n    // In category way, the first category axis.\n    else if (baseCategoryDimIndex === coordDimIdx) {\n      pushDim(encode[coordDimName], 0, count);\n      pushDim(encodeItemName, 0, count);\n    }\n    // In category way, the other axis.\n    else {\n      var start = datasetRecord.categoryWayDim;\n      pushDim(encode[coordDimName], start, count);\n      pushDim(encodeSeriesName, start, count);\n      datasetRecord.categoryWayDim += count;\n    }\n  });\n  function pushDim(dimIdxArr, idxFrom, idxCount) {\n    for (var i = 0; i < idxCount; i++) {\n      dimIdxArr.push(idxFrom + i);\n    }\n  }\n  function getDataDimCountOnCoordDim(coordDimInfo) {\n    var dimsDef = coordDimInfo.dimsDef;\n    return dimsDef ? dimsDef.length : 1;\n  }\n  encodeItemName.length && (encode.itemName = encodeItemName);\n  encodeSeriesName.length && (encode.seriesName = encodeSeriesName);\n  return encode;\n}\n/**\n * Work for data like [{name: ..., value: ...}, ...].\n *\n * @return encode Never be `null/undefined`.\n */\nexport function makeSeriesEncodeForNameBased(seriesModel, source, dimCount) {\n  var encode = {};\n  var datasetModel = querySeriesUpstreamDatasetModel(seriesModel);\n  // Currently only make default when using dataset, util more reqirements occur.\n  if (!datasetModel) {\n    return encode;\n  }\n  var sourceFormat = source.sourceFormat;\n  var dimensionsDefine = source.dimensionsDefine;\n  var potentialNameDimIndex;\n  if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS || sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS) {\n    each(dimensionsDefine, function (dim, idx) {\n      if ((isObject(dim) ? dim.name : dim) === 'name') {\n        potentialNameDimIndex = idx;\n      }\n    });\n  }\n  var idxResult = function () {\n    var idxRes0 = {};\n    var idxRes1 = {};\n    var guessRecords = [];\n    // 5 is an experience value.\n    for (var i = 0, len = Math.min(5, dimCount); i < len; i++) {\n      var guessResult = doGuessOrdinal(source.data, sourceFormat, source.seriesLayoutBy, dimensionsDefine, source.startIndex, i);\n      guessRecords.push(guessResult);\n      var isPureNumber = guessResult === BE_ORDINAL.Not;\n      // [Strategy of idxRes0]: find the first BE_ORDINAL.Not as the value dim,\n      // and then find a name dim with the priority:\n      // \"BE_ORDINAL.Might|BE_ORDINAL.Must\" > \"other dim\" > \"the value dim itself\".\n      if (isPureNumber && idxRes0.v == null && i !== potentialNameDimIndex) {\n        idxRes0.v = i;\n      }\n      if (idxRes0.n == null || idxRes0.n === idxRes0.v || !isPureNumber && guessRecords[idxRes0.n] === BE_ORDINAL.Not) {\n        idxRes0.n = i;\n      }\n      if (fulfilled(idxRes0) && guessRecords[idxRes0.n] !== BE_ORDINAL.Not) {\n        return idxRes0;\n      }\n      // [Strategy of idxRes1]: if idxRes0 not satisfied (that is, no BE_ORDINAL.Not),\n      // find the first BE_ORDINAL.Might as the value dim,\n      // and then find a name dim with the priority:\n      // \"other dim\" > \"the value dim itself\".\n      // That is for backward compat: number-like (e.g., `'3'`, `'55'`) can be\n      // treated as number.\n      if (!isPureNumber) {\n        if (guessResult === BE_ORDINAL.Might && idxRes1.v == null && i !== potentialNameDimIndex) {\n          idxRes1.v = i;\n        }\n        if (idxRes1.n == null || idxRes1.n === idxRes1.v) {\n          idxRes1.n = i;\n        }\n      }\n    }\n    function fulfilled(idxResult) {\n      return idxResult.v != null && idxResult.n != null;\n    }\n    return fulfilled(idxRes0) ? idxRes0 : fulfilled(idxRes1) ? idxRes1 : null;\n  }();\n  if (idxResult) {\n    encode.value = [idxResult.v];\n    // `potentialNameDimIndex` has highest priority.\n    var nameDimIndex = potentialNameDimIndex != null ? potentialNameDimIndex : idxResult.n;\n    // By default, label uses itemName in charts.\n    // So we don't set encodeLabel here.\n    encode.itemName = [nameDimIndex];\n    encode.seriesName = [nameDimIndex];\n  }\n  return encode;\n}\n/**\n * @return If return null/undefined, indicate that should not use datasetModel.\n */\nexport function querySeriesUpstreamDatasetModel(seriesModel) {\n  // Caution: consider the scenario:\n  // A dataset is declared and a series is not expected to use the dataset,\n  // and at the beginning `setOption({series: { noData })` (just prepare other\n  // option but no data), then `setOption({series: {data: [...]}); In this case,\n  // the user should set an empty array to avoid that dataset is used by default.\n  var thisData = seriesModel.get('data', true);\n  if (!thisData) {\n    return queryReferringComponents(seriesModel.ecModel, 'dataset', {\n      index: seriesModel.get('datasetIndex', true),\n      id: seriesModel.get('datasetId', true)\n    }, SINGLE_REFERRING).models[0];\n  }\n}\n/**\n * @return Always return an array event empty.\n */\nexport function queryDatasetUpstreamDatasetModels(datasetModel) {\n  // Only these attributes declared, we by default reference to `datasetIndex: 0`.\n  // Otherwise, no reference.\n  if (!datasetModel.get('transform', true) && !datasetModel.get('fromTransformResult', true)) {\n    return [];\n  }\n  return queryReferringComponents(datasetModel.ecModel, 'dataset', {\n    index: datasetModel.get('fromDatasetIndex', true),\n    id: datasetModel.get('fromDatasetId', true)\n  }, SINGLE_REFERRING).models;\n}\n/**\n * The rule should not be complex, otherwise user might not\n * be able to known where the data is wrong.\n * The code is ugly, but how to make it neat?\n */\nexport function guessOrdinal(source, dimIndex) {\n  return doGuessOrdinal(source.data, source.sourceFormat, source.seriesLayoutBy, source.dimensionsDefine, source.startIndex, dimIndex);\n}\n// dimIndex may be overflow source data.\n// return {BE_ORDINAL}\nfunction doGuessOrdinal(data, sourceFormat, seriesLayoutBy, dimensionsDefine, startIndex, dimIndex) {\n  var result;\n  // Experience value.\n  var maxLoop = 5;\n  if (isTypedArray(data)) {\n    return BE_ORDINAL.Not;\n  }\n  // When sourceType is 'objectRows' or 'keyedColumns', dimensionsDefine\n  // always exists in source.\n  var dimName;\n  var dimType;\n  if (dimensionsDefine) {\n    var dimDefItem = dimensionsDefine[dimIndex];\n    if (isObject(dimDefItem)) {\n      dimName = dimDefItem.name;\n      dimType = dimDefItem.type;\n    } else if (isString(dimDefItem)) {\n      dimName = dimDefItem;\n    }\n  }\n  if (dimType != null) {\n    return dimType === 'ordinal' ? BE_ORDINAL.Must : BE_ORDINAL.Not;\n  }\n  if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS) {\n    var dataArrayRows = data;\n    if (seriesLayoutBy === SERIES_LAYOUT_BY_ROW) {\n      var sample = dataArrayRows[dimIndex];\n      for (var i = 0; i < (sample || []).length && i < maxLoop; i++) {\n        if ((result = detectValue(sample[startIndex + i])) != null) {\n          return result;\n        }\n      }\n    } else {\n      for (var i = 0; i < dataArrayRows.length && i < maxLoop; i++) {\n        var row = dataArrayRows[startIndex + i];\n        if (row && (result = detectValue(row[dimIndex])) != null) {\n          return result;\n        }\n      }\n    }\n  } else if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS) {\n    var dataObjectRows = data;\n    if (!dimName) {\n      return BE_ORDINAL.Not;\n    }\n    for (var i = 0; i < dataObjectRows.length && i < maxLoop; i++) {\n      var item = dataObjectRows[i];\n      if (item && (result = detectValue(item[dimName])) != null) {\n        return result;\n      }\n    }\n  } else if (sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS) {\n    var dataKeyedColumns = data;\n    if (!dimName) {\n      return BE_ORDINAL.Not;\n    }\n    var sample = dataKeyedColumns[dimName];\n    if (!sample || isTypedArray(sample)) {\n      return BE_ORDINAL.Not;\n    }\n    for (var i = 0; i < sample.length && i < maxLoop; i++) {\n      if ((result = detectValue(sample[i])) != null) {\n        return result;\n      }\n    }\n  } else if (sourceFormat === SOURCE_FORMAT_ORIGINAL) {\n    var dataOriginal = data;\n    for (var i = 0; i < dataOriginal.length && i < maxLoop; i++) {\n      var item = dataOriginal[i];\n      var val = getDataItemValue(item);\n      if (!isArray(val)) {\n        return BE_ORDINAL.Not;\n      }\n      if ((result = detectValue(val[dimIndex])) != null) {\n        return result;\n      }\n    }\n  }\n  function detectValue(val) {\n    var beStr = isString(val);\n    // Consider usage convenience, '1', '2' will be treated as \"number\".\n    // `Number('')` (or any whitespace) is `0`.\n    if (val != null && Number.isFinite(Number(val)) && val !== '') {\n      return beStr ? BE_ORDINAL.Might : BE_ORDINAL.Not;\n    } else if (beStr && val !== '-') {\n      return BE_ORDINAL.Must;\n    }\n  }\n  return BE_ORDINAL.Not;\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { createHashMap, assert } from 'zrender/lib/core/util.js';\nimport { isComponentIdInternal } from '../util/model.js';\nvar internalOptionCreatorMap = createHashMap();\nexport function registerInternalOptionCreator(mainType, creator) {\n  assert(internalOptionCreatorMap.get(mainType) == null && creator);\n  internalOptionCreatorMap.set(mainType, creator);\n}\nexport function concatInternalOptions(ecModel, mainType, newCmptOptionList) {\n  var internalOptionCreator = internalOptionCreatorMap.get(mainType);\n  if (!internalOptionCreator) {\n    return newCmptOptionList;\n  }\n  var internalOptions = internalOptionCreator(ecModel);\n  if (!internalOptions) {\n    return newCmptOptionList;\n  }\n  if (process.env.NODE_ENV !== 'production') {\n    for (var i = 0; i < internalOptions.length; i++) {\n      assert(isComponentIdInternal(internalOptions[i]));\n    }\n  }\n  return newCmptOptionList.concat(internalOptions);\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { makeInner, normalizeToArray } from '../../util/model.js';\nvar innerColor = makeInner();\nvar innerDecal = makeInner();\nvar PaletteMixin = /** @class */function () {\n  function PaletteMixin() {}\n  PaletteMixin.prototype.getColorFromPalette = function (name, scope, requestNum) {\n    var defaultPalette = normalizeToArray(this.get('color', true));\n    var layeredPalette = this.get('colorLayer', true);\n    return getFromPalette(this, innerColor, defaultPalette, layeredPalette, name, scope, requestNum);\n  };\n  PaletteMixin.prototype.clearColorPalette = function () {\n    clearPalette(this, innerColor);\n  };\n  return PaletteMixin;\n}();\nexport function getDecalFromPalette(ecModel, name, scope, requestNum) {\n  var defaultDecals = normalizeToArray(ecModel.get(['aria', 'decal', 'decals']));\n  return getFromPalette(ecModel, innerDecal, defaultDecals, null, name, scope, requestNum);\n}\nfunction getNearestPalette(palettes, requestColorNum) {\n  var paletteNum = palettes.length;\n  // TODO palettes must be in order\n  for (var i = 0; i < paletteNum; i++) {\n    if (palettes[i].length > requestColorNum) {\n      return palettes[i];\n    }\n  }\n  return palettes[paletteNum - 1];\n}\n/**\n * @param name MUST NOT be null/undefined. Otherwise call this function\n *             twise with the same parameters will get different result.\n * @param scope default this.\n * @return Can be null/undefined\n */\nfunction getFromPalette(that, inner, defaultPalette, layeredPalette, name, scope, requestNum) {\n  scope = scope || that;\n  var scopeFields = inner(scope);\n  var paletteIdx = scopeFields.paletteIdx || 0;\n  var paletteNameMap = scopeFields.paletteNameMap = scopeFields.paletteNameMap || {};\n  // Use `hasOwnProperty` to avoid conflict with Object.prototype.\n  if (paletteNameMap.hasOwnProperty(name)) {\n    return paletteNameMap[name];\n  }\n  var palette = requestNum == null || !layeredPalette ? defaultPalette : getNearestPalette(layeredPalette, requestNum);\n  // In case can't find in layered color palette.\n  palette = palette || defaultPalette;\n  if (!palette || !palette.length) {\n    return;\n  }\n  var pickedPaletteItem = palette[paletteIdx];\n  if (name) {\n    paletteNameMap[name] = pickedPaletteItem;\n  }\n  scopeFields.paletteIdx = (paletteIdx + 1) % palette.length;\n  return pickedPaletteItem;\n}\nfunction clearPalette(that, inner) {\n  inner(that).paletteIdx = 0;\n  inner(that).paletteNameMap = {};\n}\nexport { PaletteMixin };", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\n/**\n * Caution: If the mechanism should be changed some day, these cases\n * should be considered:\n *\n * (1) In `merge option` mode, if using the same option to call `setOption`\n * many times, the result should be the same (try our best to ensure that).\n * (2) In `merge option` mode, if a component has no id/name specified, it\n * will be merged by index, and the result sequence of the components is\n * consistent to the original sequence.\n * (3) In `replaceMerge` mode, keep the result sequence of the components is\n * consistent to the original sequence, even though there might result in \"hole\".\n * (4) `reset` feature (in toolbox). Find detailed info in comments about\n * `mergeOption` in module:echarts/model/OptionManager.\n */\nimport { each, filter, isArray, isObject, isString, createHashMap, assert, clone, merge, extend, mixin, isFunction } from 'zrender/lib/core/util.js';\nimport * as modelUtil from '../util/model.js';\nimport Model from './Model.js';\nimport ComponentModel from './Component.js';\nimport globalDefault from './globalDefault.js';\nimport { resetSourceDefaulter } from '../data/helper/sourceHelper.js';\nimport { concatInternalOptions } from './internalComponentCreator.js';\nimport { PaletteMixin } from './mixin/palette.js';\nimport { error, warn } from '../util/log.js';\n// -----------------------\n// Internal method names:\n// -----------------------\nvar reCreateSeriesIndices;\nvar assertSeriesInitialized;\nvar initBase;\nvar OPTION_INNER_KEY = '\\0_ec_inner';\nvar OPTION_INNER_VALUE = 1;\nvar BUITIN_COMPONENTS_MAP = {\n  grid: 'GridComponent',\n  polar: 'PolarComponent',\n  geo: 'GeoComponent',\n  singleAxis: 'SingleAxisComponent',\n  parallel: 'ParallelComponent',\n  calendar: 'CalendarComponent',\n  matrix: 'MatrixComponent',\n  graphic: 'GraphicComponent',\n  toolbox: 'ToolboxComponent',\n  tooltip: 'TooltipComponent',\n  axisPointer: 'AxisPointerComponent',\n  brush: 'BrushComponent',\n  title: 'TitleComponent',\n  timeline: 'TimelineComponent',\n  markPoint: 'MarkPointComponent',\n  markLine: 'MarkLineComponent',\n  markArea: 'MarkAreaComponent',\n  legend: 'LegendComponent',\n  dataZoom: 'DataZoomComponent',\n  visualMap: 'VisualMapComponent',\n  // aria: 'AriaComponent',\n  // dataset: 'DatasetComponent',\n  // Dependencies\n  xAxis: 'GridComponent',\n  yAxis: 'GridComponent',\n  angleAxis: 'PolarComponent',\n  radiusAxis: 'PolarComponent'\n};\nvar BUILTIN_CHARTS_MAP = {\n  line: 'LineChart',\n  bar: 'BarChart',\n  pie: 'PieChart',\n  scatter: 'ScatterChart',\n  radar: 'RadarChart',\n  map: 'MapChart',\n  tree: 'TreeChart',\n  treemap: 'TreemapChart',\n  graph: 'GraphChart',\n  chord: 'ChordChart',\n  gauge: 'GaugeChart',\n  funnel: 'FunnelChart',\n  parallel: 'ParallelChart',\n  sankey: 'SankeyChart',\n  boxplot: 'BoxplotChart',\n  candlestick: 'CandlestickChart',\n  effectScatter: 'EffectScatterChart',\n  lines: 'LinesChart',\n  heatmap: 'HeatmapChart',\n  pictorialBar: 'PictorialBarChart',\n  themeRiver: 'ThemeRiverChart',\n  sunburst: 'SunburstChart',\n  custom: 'CustomChart'\n};\nvar componetsMissingLogPrinted = {};\nfunction checkMissingComponents(option) {\n  each(option, function (componentOption, mainType) {\n    if (!ComponentModel.hasClass(mainType)) {\n      var componentImportName = BUITIN_COMPONENTS_MAP[mainType];\n      if (componentImportName && !componetsMissingLogPrinted[componentImportName]) {\n        error(\"Component \" + mainType + \" is used but not imported.\\nimport { \" + componentImportName + \" } from 'echarts/components';\\necharts.use([\" + componentImportName + \"]);\");\n        componetsMissingLogPrinted[componentImportName] = true;\n      }\n    }\n  });\n}\nvar GlobalModel = /** @class */function (_super) {\n  __extends(GlobalModel, _super);\n  function GlobalModel() {\n    return _super !== null && _super.apply(this, arguments) || this;\n  }\n  GlobalModel.prototype.init = function (option, parentModel, ecModel, theme, locale, optionManager) {\n    theme = theme || {};\n    this.option = null; // Mark as not initialized.\n    this._theme = new Model(theme);\n    this._locale = new Model(locale);\n    this._optionManager = optionManager;\n  };\n  GlobalModel.prototype.setOption = function (option, opts, optionPreprocessorFuncs) {\n    if (process.env.NODE_ENV !== 'production') {\n      assert(option != null, 'option is null/undefined');\n      assert(option[OPTION_INNER_KEY] !== OPTION_INNER_VALUE, 'please use chart.getOption()');\n    }\n    var innerOpt = normalizeSetOptionInput(opts);\n    this._optionManager.setOption(option, optionPreprocessorFuncs, innerOpt);\n    this._resetOption(null, innerOpt);\n  };\n  /**\n   * @param type null/undefined: reset all.\n   *        'recreate': force recreate all.\n   *        'timeline': only reset timeline option\n   *        'media': only reset media query option\n   * @return Whether option changed.\n   */\n  GlobalModel.prototype.resetOption = function (type, opt) {\n    return this._resetOption(type, normalizeSetOptionInput(opt));\n  };\n  GlobalModel.prototype._resetOption = function (type, opt) {\n    var optionChanged = false;\n    var optionManager = this._optionManager;\n    if (!type || type === 'recreate') {\n      var baseOption = optionManager.mountOption(type === 'recreate');\n      if (process.env.NODE_ENV !== 'production') {\n        checkMissingComponents(baseOption);\n      }\n      if (!this.option || type === 'recreate') {\n        initBase(this, baseOption);\n      } else {\n        this.restoreData();\n        this._mergeOption(baseOption, opt);\n      }\n      optionChanged = true;\n    }\n    if (type === 'timeline' || type === 'media') {\n      this.restoreData();\n    }\n    // By design, if `setOption(option2)` at the second time, and `option2` is a `ECUnitOption`,\n    // it should better not have the same props with `MediaUnit['option']`.\n    // Because either `option2` or `MediaUnit['option']` will be always merged to \"current option\"\n    // rather than original \"baseOption\". If they both override a prop, the result might be\n    // unexpected when media state changed after `setOption` called.\n    // If we really need to modify a props in each `MediaUnit['option']`, use the full version\n    // (`{baseOption, media}`) in `setOption`.\n    // For `timeline`, the case is the same.\n    if (!type || type === 'recreate' || type === 'timeline') {\n      var timelineOption = optionManager.getTimelineOption(this);\n      if (timelineOption) {\n        optionChanged = true;\n        this._mergeOption(timelineOption, opt);\n      }\n    }\n    if (!type || type === 'recreate' || type === 'media') {\n      var mediaOptions = optionManager.getMediaOption(this);\n      if (mediaOptions.length) {\n        each(mediaOptions, function (mediaOption) {\n          optionChanged = true;\n          this._mergeOption(mediaOption, opt);\n        }, this);\n      }\n    }\n    return optionChanged;\n  };\n  GlobalModel.prototype.mergeOption = function (option) {\n    this._mergeOption(option, null);\n  };\n  GlobalModel.prototype._mergeOption = function (newOption, opt) {\n    var option = this.option;\n    var componentsMap = this._componentsMap;\n    var componentsCount = this._componentsCount;\n    var newCmptTypes = [];\n    var newCmptTypeMap = createHashMap();\n    var replaceMergeMainTypeMap = opt && opt.replaceMergeMainTypeMap;\n    resetSourceDefaulter(this);\n    // If no component class, merge directly.\n    // For example: color, animaiton options, etc.\n    each(newOption, function (componentOption, mainType) {\n      if (componentOption == null) {\n        return;\n      }\n      if (!ComponentModel.hasClass(mainType)) {\n        // globalSettingTask.dirty();\n        option[mainType] = option[mainType] == null ? clone(componentOption) : merge(option[mainType], componentOption, true);\n      } else if (mainType) {\n        newCmptTypes.push(mainType);\n        newCmptTypeMap.set(mainType, true);\n      }\n    });\n    if (replaceMergeMainTypeMap) {\n      // If there is a mainType `xxx` in `replaceMerge` but not declared in option,\n      // we trade it as it is declared in option as `{xxx: []}`. Because:\n      // (1) for normal merge, `{xxx: null/undefined}` are the same meaning as `{xxx: []}`.\n      // (2) some preprocessor may convert some of `{xxx: null/undefined}` to `{xxx: []}`.\n      replaceMergeMainTypeMap.each(function (val, mainTypeInReplaceMerge) {\n        if (ComponentModel.hasClass(mainTypeInReplaceMerge) && !newCmptTypeMap.get(mainTypeInReplaceMerge)) {\n          newCmptTypes.push(mainTypeInReplaceMerge);\n          newCmptTypeMap.set(mainTypeInReplaceMerge, true);\n        }\n      });\n    }\n    ComponentModel.topologicalTravel(newCmptTypes, ComponentModel.getAllClassMainTypes(), visitComponent, this);\n    function visitComponent(mainType) {\n      var newCmptOptionList = concatInternalOptions(this, mainType, modelUtil.normalizeToArray(newOption[mainType]));\n      var oldCmptList = componentsMap.get(mainType);\n      var mergeMode =\n      // `!oldCmptList` means init. See the comment in `mappingToExists`\n      !oldCmptList ? 'replaceAll' : replaceMergeMainTypeMap && replaceMergeMainTypeMap.get(mainType) ? 'replaceMerge' : 'normalMerge';\n      var mappingResult = modelUtil.mappingToExists(oldCmptList, newCmptOptionList, mergeMode);\n      // Set mainType and complete subType.\n      modelUtil.setComponentTypeToKeyInfo(mappingResult, mainType, ComponentModel);\n      // Empty it before the travel, in order to prevent `this._componentsMap`\n      // from being used in the `init`/`mergeOption`/`optionUpdated` of some\n      // components, which is probably incorrect logic.\n      option[mainType] = null;\n      componentsMap.set(mainType, null);\n      componentsCount.set(mainType, 0);\n      var optionsByMainType = [];\n      var cmptsByMainType = [];\n      var cmptsCountByMainType = 0;\n      var tooltipExists;\n      var tooltipWarningLogged;\n      each(mappingResult, function (resultItem, index) {\n        var componentModel = resultItem.existing;\n        var newCmptOption = resultItem.newOption;\n        if (!newCmptOption) {\n          if (componentModel) {\n            // Consider where is no new option and should be merged using {},\n            // see removeEdgeAndAdd in topologicalTravel and\n            // ComponentModel.getAllClassMainTypes.\n            componentModel.mergeOption({}, this);\n            componentModel.optionUpdated({}, false);\n          }\n          // If no both `resultItem.exist` and `resultItem.option`,\n          // either it is in `replaceMerge` and not matched by any id,\n          // or it has been removed in previous `replaceMerge` and left a \"hole\" in this component index.\n        } else {\n          var isSeriesType = mainType === 'series';\n          var ComponentModelClass = ComponentModel.getClass(mainType, resultItem.keyInfo.subType, !isSeriesType // Give a more detailed warn later if series don't exists\n          );\n          if (!ComponentModelClass) {\n            if (process.env.NODE_ENV !== 'production') {\n              var subType = resultItem.keyInfo.subType;\n              var seriesImportName = BUILTIN_CHARTS_MAP[subType];\n              if (!componetsMissingLogPrinted[subType]) {\n                componetsMissingLogPrinted[subType] = true;\n                if (seriesImportName) {\n                  error(\"Series \" + subType + \" is used but not imported.\\nimport { \" + seriesImportName + \" } from 'echarts/charts';\\necharts.use([\" + seriesImportName + \"]);\");\n                } else {\n                  error(\"Unknown series \" + subType);\n                }\n              }\n            }\n            return;\n          }\n          // TODO Before multiple tooltips get supported, we do this check to avoid unexpected exception.\n          if (mainType === 'tooltip') {\n            if (tooltipExists) {\n              if (process.env.NODE_ENV !== 'production') {\n                if (!tooltipWarningLogged) {\n                  warn('Currently only one tooltip component is allowed.');\n                  tooltipWarningLogged = true;\n                }\n              }\n              return;\n            }\n            tooltipExists = true;\n          }\n          if (componentModel && componentModel.constructor === ComponentModelClass) {\n            componentModel.name = resultItem.keyInfo.name;\n            // componentModel.settingTask && componentModel.settingTask.dirty();\n            componentModel.mergeOption(newCmptOption, this);\n            componentModel.optionUpdated(newCmptOption, false);\n          } else {\n            // PENDING Global as parent ?\n            var extraOpt = extend({\n              componentIndex: index\n            }, resultItem.keyInfo);\n            componentModel = new ComponentModelClass(newCmptOption, this, this, extraOpt);\n            // Assign `keyInfo`\n            extend(componentModel, extraOpt);\n            if (resultItem.brandNew) {\n              componentModel.__requireNewView = true;\n            }\n            componentModel.init(newCmptOption, this, this);\n            // Call optionUpdated after init.\n            // newCmptOption has been used as componentModel.option\n            // and may be merged with theme and default, so pass null\n            // to avoid confusion.\n            componentModel.optionUpdated(null, true);\n          }\n        }\n        if (componentModel) {\n          optionsByMainType.push(componentModel.option);\n          cmptsByMainType.push(componentModel);\n          cmptsCountByMainType++;\n        } else {\n          // Always do assign to avoid elided item in array.\n          optionsByMainType.push(void 0);\n          cmptsByMainType.push(void 0);\n        }\n      }, this);\n      option[mainType] = optionsByMainType;\n      componentsMap.set(mainType, cmptsByMainType);\n      componentsCount.set(mainType, cmptsCountByMainType);\n      // Backup series for filtering.\n      if (mainType === 'series') {\n        reCreateSeriesIndices(this);\n      }\n    }\n    // If no series declared, ensure `_seriesIndices` initialized.\n    if (!this._seriesIndices) {\n      reCreateSeriesIndices(this);\n    }\n  };\n  /**\n   * Get option for output (cloned option and inner info removed)\n   */\n  GlobalModel.prototype.getOption = function () {\n    var option = clone(this.option);\n    each(option, function (optInMainType, mainType) {\n      if (ComponentModel.hasClass(mainType)) {\n        var opts = modelUtil.normalizeToArray(optInMainType);\n        // Inner cmpts need to be removed.\n        // Inner cmpts might not be at last since ec5.0, but still\n        // compatible for users: if inner cmpt at last, splice the returned array.\n        var realLen = opts.length;\n        var metNonInner = false;\n        for (var i = realLen - 1; i >= 0; i--) {\n          // Remove options with inner id.\n          if (opts[i] && !modelUtil.isComponentIdInternal(opts[i])) {\n            metNonInner = true;\n          } else {\n            opts[i] = null;\n            !metNonInner && realLen--;\n          }\n        }\n        opts.length = realLen;\n        option[mainType] = opts;\n      }\n    });\n    delete option[OPTION_INNER_KEY];\n    return option;\n  };\n  GlobalModel.prototype.setTheme = function (theme) {\n    this._theme = new Model(theme);\n    this._resetOption('recreate', null);\n  };\n  GlobalModel.prototype.getTheme = function () {\n    return this._theme;\n  };\n  GlobalModel.prototype.getLocaleModel = function () {\n    return this._locale;\n  };\n  GlobalModel.prototype.setUpdatePayload = function (payload) {\n    this._payload = payload;\n  };\n  GlobalModel.prototype.getUpdatePayload = function () {\n    return this._payload;\n  };\n  /**\n   * @param idx If not specified, return the first one.\n   */\n  GlobalModel.prototype.getComponent = function (mainType, idx) {\n    var list = this._componentsMap.get(mainType);\n    if (list) {\n      var cmpt = list[idx || 0];\n      if (cmpt) {\n        return cmpt;\n      } else if (idx == null) {\n        for (var i = 0; i < list.length; i++) {\n          if (list[i]) {\n            return list[i];\n          }\n        }\n      }\n    }\n  };\n  /**\n   * @return Never be null/undefined.\n   */\n  GlobalModel.prototype.queryComponents = function (condition) {\n    var mainType = condition.mainType;\n    if (!mainType) {\n      return [];\n    }\n    var index = condition.index;\n    var id = condition.id;\n    var name = condition.name;\n    var cmpts = this._componentsMap.get(mainType);\n    if (!cmpts || !cmpts.length) {\n      return [];\n    }\n    var result;\n    if (index != null) {\n      result = [];\n      each(modelUtil.normalizeToArray(index), function (idx) {\n        cmpts[idx] && result.push(cmpts[idx]);\n      });\n    } else if (id != null) {\n      result = queryByIdOrName('id', id, cmpts);\n    } else if (name != null) {\n      result = queryByIdOrName('name', name, cmpts);\n    } else {\n      // Return all non-empty components in that mainType\n      result = filter(cmpts, function (cmpt) {\n        return !!cmpt;\n      });\n    }\n    return filterBySubType(result, condition);\n  };\n  /**\n   * The interface is different from queryComponents,\n   * which is convenient for inner usage.\n   *\n   * @usage\n   * let result = findComponents(\n   *     {mainType: 'dataZoom', query: {dataZoomId: 'abc'}}\n   * );\n   * let result = findComponents(\n   *     {mainType: 'series', subType: 'pie', query: {seriesName: 'uio'}}\n   * );\n   * let result = findComponents(\n   *     {mainType: 'series',\n   *     filter: function (model, index) {...}}\n   * );\n   * // result like [component0, componnet1, ...]\n   */\n  GlobalModel.prototype.findComponents = function (condition) {\n    var query = condition.query;\n    var mainType = condition.mainType;\n    var queryCond = getQueryCond(query);\n    var result = queryCond ? this.queryComponents(queryCond)\n    // Retrieve all non-empty components.\n    : filter(this._componentsMap.get(mainType), function (cmpt) {\n      return !!cmpt;\n    });\n    return doFilter(filterBySubType(result, condition));\n    function getQueryCond(q) {\n      var indexAttr = mainType + 'Index';\n      var idAttr = mainType + 'Id';\n      var nameAttr = mainType + 'Name';\n      return q && (q[indexAttr] != null || q[idAttr] != null || q[nameAttr] != null) ? {\n        mainType: mainType,\n        // subType will be filtered finally.\n        index: q[indexAttr],\n        id: q[idAttr],\n        name: q[nameAttr]\n      } : null;\n    }\n    function doFilter(res) {\n      return condition.filter ? filter(res, condition.filter) : res;\n    }\n  };\n  GlobalModel.prototype.eachComponent = function (mainType, cb, context) {\n    var componentsMap = this._componentsMap;\n    if (isFunction(mainType)) {\n      var ctxForAll_1 = cb;\n      var cbForAll_1 = mainType;\n      componentsMap.each(function (cmpts, componentType) {\n        for (var i = 0; cmpts && i < cmpts.length; i++) {\n          var cmpt = cmpts[i];\n          cmpt && cbForAll_1.call(ctxForAll_1, componentType, cmpt, cmpt.componentIndex);\n        }\n      });\n    } else {\n      var cmpts = isString(mainType) ? componentsMap.get(mainType) : isObject(mainType) ? this.findComponents(mainType) : null;\n      for (var i = 0; cmpts && i < cmpts.length; i++) {\n        var cmpt = cmpts[i];\n        cmpt && cb.call(context, cmpt, cmpt.componentIndex);\n      }\n    }\n  };\n  /**\n   * Get series list before filtered by name.\n   */\n  GlobalModel.prototype.getSeriesByName = function (name) {\n    var nameStr = modelUtil.convertOptionIdName(name, null);\n    return filter(this._componentsMap.get('series'), function (oneSeries) {\n      return !!oneSeries && nameStr != null && oneSeries.name === nameStr;\n    });\n  };\n  /**\n   * Get series list before filtered by index.\n   */\n  GlobalModel.prototype.getSeriesByIndex = function (seriesIndex) {\n    return this._componentsMap.get('series')[seriesIndex];\n  };\n  /**\n   * Get series list before filtered by type.\n   * FIXME: rename to getRawSeriesByType?\n   */\n  GlobalModel.prototype.getSeriesByType = function (subType) {\n    return filter(this._componentsMap.get('series'), function (oneSeries) {\n      return !!oneSeries && oneSeries.subType === subType;\n    });\n  };\n  /**\n   * Get all series before filtered.\n   */\n  GlobalModel.prototype.getSeries = function () {\n    return filter(this._componentsMap.get('series'), function (oneSeries) {\n      return !!oneSeries;\n    });\n  };\n  /**\n   * Count series before filtered.\n   */\n  GlobalModel.prototype.getSeriesCount = function () {\n    return this._componentsCount.get('series');\n  };\n  /**\n   * After filtering, series may be different\n   * from raw series.\n   */\n  GlobalModel.prototype.eachSeries = function (cb, context) {\n    assertSeriesInitialized(this);\n    each(this._seriesIndices, function (rawSeriesIndex) {\n      var series = this._componentsMap.get('series')[rawSeriesIndex];\n      cb.call(context, series, rawSeriesIndex);\n    }, this);\n  };\n  /**\n   * Iterate raw series before filtered.\n   *\n   * @param {Function} cb\n   * @param {*} context\n   */\n  GlobalModel.prototype.eachRawSeries = function (cb, context) {\n    each(this._componentsMap.get('series'), function (series) {\n      series && cb.call(context, series, series.componentIndex);\n    });\n  };\n  /**\n   * After filtering, series may be different.\n   * from raw series.\n   */\n  GlobalModel.prototype.eachSeriesByType = function (subType, cb, context) {\n    assertSeriesInitialized(this);\n    each(this._seriesIndices, function (rawSeriesIndex) {\n      var series = this._componentsMap.get('series')[rawSeriesIndex];\n      if (series.subType === subType) {\n        cb.call(context, series, rawSeriesIndex);\n      }\n    }, this);\n  };\n  /**\n   * Iterate raw series before filtered of given type.\n   */\n  GlobalModel.prototype.eachRawSeriesByType = function (subType, cb, context) {\n    return each(this.getSeriesByType(subType), cb, context);\n  };\n  GlobalModel.prototype.isSeriesFiltered = function (seriesModel) {\n    assertSeriesInitialized(this);\n    return this._seriesIndicesMap.get(seriesModel.componentIndex) == null;\n  };\n  GlobalModel.prototype.getCurrentSeriesIndices = function () {\n    return (this._seriesIndices || []).slice();\n  };\n  GlobalModel.prototype.filterSeries = function (cb, context) {\n    assertSeriesInitialized(this);\n    var newSeriesIndices = [];\n    each(this._seriesIndices, function (seriesRawIdx) {\n      var series = this._componentsMap.get('series')[seriesRawIdx];\n      cb.call(context, series, seriesRawIdx) && newSeriesIndices.push(seriesRawIdx);\n    }, this);\n    this._seriesIndices = newSeriesIndices;\n    this._seriesIndicesMap = createHashMap(newSeriesIndices);\n  };\n  GlobalModel.prototype.restoreData = function (payload) {\n    reCreateSeriesIndices(this);\n    var componentsMap = this._componentsMap;\n    var componentTypes = [];\n    componentsMap.each(function (components, componentType) {\n      if (ComponentModel.hasClass(componentType)) {\n        componentTypes.push(componentType);\n      }\n    });\n    ComponentModel.topologicalTravel(componentTypes, ComponentModel.getAllClassMainTypes(), function (componentType) {\n      each(componentsMap.get(componentType), function (component) {\n        if (component && (componentType !== 'series' || !isNotTargetSeries(component, payload))) {\n          component.restoreData();\n        }\n      });\n    });\n  };\n  GlobalModel.internalField = function () {\n    reCreateSeriesIndices = function (ecModel) {\n      var seriesIndices = ecModel._seriesIndices = [];\n      each(ecModel._componentsMap.get('series'), function (series) {\n        // series may have been removed by `replaceMerge`.\n        series && seriesIndices.push(series.componentIndex);\n      });\n      ecModel._seriesIndicesMap = createHashMap(seriesIndices);\n    };\n    assertSeriesInitialized = function (ecModel) {\n      // Components that use _seriesIndices should depends on series component,\n      // which make sure that their initialization is after series.\n      if (process.env.NODE_ENV !== 'production') {\n        if (!ecModel._seriesIndices) {\n          throw new Error('Option should contains series.');\n        }\n      }\n    };\n    initBase = function (ecModel, baseOption) {\n      // Using OPTION_INNER_KEY to mark that this option cannot be used outside,\n      // i.e. `chart.setOption(chart.getModel().option);` is forbidden.\n      ecModel.option = {};\n      ecModel.option[OPTION_INNER_KEY] = OPTION_INNER_VALUE;\n      // Init with series: [], in case of calling findSeries method\n      // before series initialized.\n      ecModel._componentsMap = createHashMap({\n        series: []\n      });\n      ecModel._componentsCount = createHashMap();\n      // If user spefied `option.aria`, aria will be enable. This detection should be\n      // performed before theme and globalDefault merge.\n      var airaOption = baseOption.aria;\n      if (isObject(airaOption) && airaOption.enabled == null) {\n        airaOption.enabled = true;\n      }\n      mergeTheme(baseOption, ecModel._theme.option);\n      // TODO Needs clone when merging to the unexisted property\n      merge(baseOption, globalDefault, false);\n      ecModel._mergeOption(baseOption, null);\n    };\n  }();\n  return GlobalModel;\n}(Model);\nfunction isNotTargetSeries(seriesModel, payload) {\n  if (payload) {\n    var index = payload.seriesIndex;\n    var id = payload.seriesId;\n    var name_1 = payload.seriesName;\n    return index != null && seriesModel.componentIndex !== index || id != null && seriesModel.id !== id || name_1 != null && seriesModel.name !== name_1;\n  }\n}\nfunction mergeTheme(option, theme) {\n  // PENDING\n  // NOT use `colorLayer` in theme if option has `color`\n  var notMergeColorLayer = option.color && !option.colorLayer;\n  each(theme, function (themeItem, name) {\n    if (name === 'colorLayer' && notMergeColorLayer || name === 'color' && option.color) {\n      return;\n    }\n    // If it is component model mainType, the model handles that merge later.\n    // otherwise, merge them here.\n    if (!ComponentModel.hasClass(name)) {\n      if (typeof themeItem === 'object') {\n        option[name] = !option[name] ? clone(themeItem) : merge(option[name], themeItem, false);\n      } else {\n        if (option[name] == null) {\n          option[name] = themeItem;\n        }\n      }\n    }\n  });\n}\nfunction queryByIdOrName(attr, idOrName, cmpts) {\n  // Here is a break from echarts4: string and number are\n  // treated as equal.\n  if (isArray(idOrName)) {\n    var keyMap_1 = createHashMap();\n    each(idOrName, function (idOrNameItem) {\n      if (idOrNameItem != null) {\n        var idName = modelUtil.convertOptionIdName(idOrNameItem, null);\n        idName != null && keyMap_1.set(idOrNameItem, true);\n      }\n    });\n    return filter(cmpts, function (cmpt) {\n      return cmpt && keyMap_1.get(cmpt[attr]);\n    });\n  } else {\n    var idName_1 = modelUtil.convertOptionIdName(idOrName, null);\n    return filter(cmpts, function (cmpt) {\n      return cmpt && idName_1 != null && cmpt[attr] === idName_1;\n    });\n  }\n}\nfunction filterBySubType(components, condition) {\n  // Using hasOwnProperty for restrict. Consider\n  // subType is undefined in user payload.\n  return condition.hasOwnProperty('subType') ? filter(components, function (cmpt) {\n    return cmpt && cmpt.subType === condition.subType;\n  }) : components;\n}\nfunction normalizeSetOptionInput(opts) {\n  var replaceMergeMainTypeMap = createHashMap();\n  opts && each(modelUtil.normalizeToArray(opts.replaceMerge), function (mainType) {\n    if (process.env.NODE_ENV !== 'production') {\n      assert(ComponentModel.hasClass(mainType), '\"' + mainType + '\" is not valid component main type in \"replaceMerge\"');\n    }\n    replaceMergeMainTypeMap.set(mainType, true);\n  });\n  return {\n    replaceMergeMainTypeMap: replaceMergeMainTypeMap\n  };\n}\nmixin(GlobalModel, PaletteMixin);\nexport default GlobalModel;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nvar availableMethods = ['getDom', 'getZr', 'getWidth', 'getHeight', 'getDevicePixelRatio', 'dispatchAction', 'isSSR', 'isDisposed', 'on', 'off', 'getDataURL', 'getConnectedDataURL',\n// 'getModel',\n'getOption',\n// 'getViewOfComponentModel',\n// 'getViewOfSeriesModel',\n'getId', 'updateLabelLayout'];\nvar ExtensionAPI = /** @class */function () {\n  function ExtensionAPI(ecInstance) {\n    zrUtil.each(availableMethods, function (methodName) {\n      this[methodName] = zrUtil.bind(ecInstance[methodName], ecInstance);\n    }, this);\n  }\n  return ExtensionAPI;\n}();\nexport default ExtensionAPI;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { normalizeToArray\n// , MappingExistingItem, setComponentTypeToKeyInfo, mappingToExists\n} from '../util/model.js';\nimport { each, clone, map, isTypedArray, setAsPrimitive, isArray, isObject\n// , HashMap , createHashMap, extend, merge,\n} from 'zrender/lib/core/util.js';\nimport { error } from '../util/log.js';\nvar QUERY_REG = /^(min|max)?(.+)$/;\n// Key: mainType\n// type FakeComponentsMap = HashMap<(MappingExistingItem & { subType: string })[]>;\n/**\n * TERM EXPLANATIONS:\n * See `ECOption` and `ECUnitOption` in `src/util/types.ts`.\n */\nvar OptionManager = /** @class */function () {\n  // timeline.notMerge is not supported in ec3. Firstly there is rearly\n  // case that notMerge is needed. Secondly supporting 'notMerge' requires\n  // rawOption cloned and backuped when timeline changed, which does no\n  // good to performance. What's more, that both timeline and setOption\n  // method supply 'notMerge' brings complex and some problems.\n  // Consider this case:\n  // (step1) chart.setOption({timeline: {notMerge: false}, ...}, false);\n  // (step2) chart.setOption({timeline: {notMerge: true}, ...}, false);\n  function OptionManager(api) {\n    this._timelineOptions = [];\n    this._mediaList = [];\n    /**\n     * -1, means default.\n     * empty means no media.\n     */\n    this._currentMediaIndices = [];\n    this._api = api;\n  }\n  OptionManager.prototype.setOption = function (rawOption, optionPreprocessorFuncs, opt) {\n    if (rawOption) {\n      // That set dat primitive is dangerous if user reuse the data when setOption again.\n      each(normalizeToArray(rawOption.series), function (series) {\n        series && series.data && isTypedArray(series.data) && setAsPrimitive(series.data);\n      });\n      each(normalizeToArray(rawOption.dataset), function (dataset) {\n        dataset && dataset.source && isTypedArray(dataset.source) && setAsPrimitive(dataset.source);\n      });\n    }\n    // Caution: some series modify option data, if do not clone,\n    // it should ensure that the repeat modify correctly\n    // (create a new object when modify itself).\n    rawOption = clone(rawOption);\n    // FIXME\n    // If some property is set in timeline options or media option but\n    // not set in baseOption, a warning should be given.\n    var optionBackup = this._optionBackup;\n    var newParsedOption = parseRawOption(rawOption, optionPreprocessorFuncs, !optionBackup);\n    this._newBaseOption = newParsedOption.baseOption;\n    // For setOption at second time (using merge mode);\n    if (optionBackup) {\n      // FIXME\n      // the restore merge solution is essentially incorrect.\n      // the mapping can not be 100% consistent with ecModel, which probably brings\n      // potential bug!\n      // The first merge is delayed, because in most cases, users do not call `setOption` twice.\n      // let fakeCmptsMap = this._fakeCmptsMap;\n      // if (!fakeCmptsMap) {\n      //     fakeCmptsMap = this._fakeCmptsMap = createHashMap();\n      //     mergeToBackupOption(fakeCmptsMap, null, optionBackup.baseOption, null);\n      // }\n      // mergeToBackupOption(\n      //     fakeCmptsMap, optionBackup.baseOption, newParsedOption.baseOption, opt\n      // );\n      // For simplicity, timeline options and media options do not support merge,\n      // that is, if you `setOption` twice and both has timeline options, the latter\n      // timeline options will not be merged to the former, but just substitute them.\n      if (newParsedOption.timelineOptions.length) {\n        optionBackup.timelineOptions = newParsedOption.timelineOptions;\n      }\n      if (newParsedOption.mediaList.length) {\n        optionBackup.mediaList = newParsedOption.mediaList;\n      }\n      if (newParsedOption.mediaDefault) {\n        optionBackup.mediaDefault = newParsedOption.mediaDefault;\n      }\n    } else {\n      this._optionBackup = newParsedOption;\n    }\n  };\n  OptionManager.prototype.mountOption = function (isRecreate) {\n    var optionBackup = this._optionBackup;\n    this._timelineOptions = optionBackup.timelineOptions;\n    this._mediaList = optionBackup.mediaList;\n    this._mediaDefault = optionBackup.mediaDefault;\n    this._currentMediaIndices = [];\n    return clone(isRecreate\n    // this._optionBackup.baseOption, which is created at the first `setOption`\n    // called, and is merged into every new option by inner method `mergeToBackupOption`\n    // each time `setOption` called, can be only used in `isRecreate`, because\n    // its reliability is under suspicion. In other cases option merge is\n    // performed by `model.mergeOption`.\n    ? optionBackup.baseOption : this._newBaseOption);\n  };\n  OptionManager.prototype.getTimelineOption = function (ecModel) {\n    var option;\n    var timelineOptions = this._timelineOptions;\n    if (timelineOptions.length) {\n      // getTimelineOption can only be called after ecModel inited,\n      // so we can get currentIndex from timelineModel.\n      var timelineModel = ecModel.getComponent('timeline');\n      if (timelineModel) {\n        option = clone(\n        // FIXME:TS as TimelineModel or quivlant interface\n        timelineOptions[timelineModel.getCurrentIndex()]);\n      }\n    }\n    return option;\n  };\n  OptionManager.prototype.getMediaOption = function (ecModel) {\n    var ecWidth = this._api.getWidth();\n    var ecHeight = this._api.getHeight();\n    var mediaList = this._mediaList;\n    var mediaDefault = this._mediaDefault;\n    var indices = [];\n    var result = [];\n    // No media defined.\n    if (!mediaList.length && !mediaDefault) {\n      return result;\n    }\n    // Multi media may be applied, the latter defined media has higher priority.\n    for (var i = 0, len = mediaList.length; i < len; i++) {\n      if (applyMediaQuery(mediaList[i].query, ecWidth, ecHeight)) {\n        indices.push(i);\n      }\n    }\n    // FIXME\n    // Whether mediaDefault should force users to provide? Otherwise\n    // the change by media query can not be recorvered.\n    if (!indices.length && mediaDefault) {\n      indices = [-1];\n    }\n    if (indices.length && !indicesEquals(indices, this._currentMediaIndices)) {\n      result = map(indices, function (index) {\n        return clone(index === -1 ? mediaDefault.option : mediaList[index].option);\n      });\n    }\n    // Otherwise return nothing.\n    this._currentMediaIndices = indices;\n    return result;\n  };\n  return OptionManager;\n}();\n/**\n * [RAW_OPTION_PATTERNS]\n * (Note: \"series: []\" represents all other props in `ECUnitOption`)\n *\n * (1) No prop \"baseOption\" declared:\n * Root option is used as \"baseOption\" (except prop \"options\" and \"media\").\n * ```js\n * option = {\n *     series: [],\n *     timeline: {},\n *     options: [],\n * };\n * option = {\n *     series: [],\n *     media: {},\n * };\n * option = {\n *     series: [],\n *     timeline: {},\n *     options: [],\n *     media: {},\n * }\n * ```\n *\n * (2) Prop \"baseOption\" declared:\n * If \"baseOption\" declared, `ECUnitOption` props can only be declared\n * inside \"baseOption\" except prop \"timeline\" (compat ec2).\n * ```js\n * option = {\n *     baseOption: {\n *         timeline: {},\n *         series: [],\n *     },\n *     options: []\n * };\n * option = {\n *     baseOption: {\n *         series: [],\n *     },\n *     media: []\n * };\n * option = {\n *     baseOption: {\n *         timeline: {},\n *         series: [],\n *     },\n *     options: []\n *     media: []\n * };\n * option = {\n *     // ec3 compat ec2: allow (only) `timeline` declared\n *     // outside baseOption. Keep this setting for compat.\n *     timeline: {},\n *     baseOption: {\n *         series: [],\n *     },\n *     options: [],\n *     media: []\n * };\n * ```\n */\nfunction parseRawOption(\n// `rawOption` May be modified\nrawOption, optionPreprocessorFuncs, isNew) {\n  var mediaList = [];\n  var mediaDefault;\n  var baseOption;\n  var declaredBaseOption = rawOption.baseOption;\n  // Compatible with ec2, [RAW_OPTION_PATTERNS] above.\n  var timelineOnRoot = rawOption.timeline;\n  var timelineOptionsOnRoot = rawOption.options;\n  var mediaOnRoot = rawOption.media;\n  var hasMedia = !!rawOption.media;\n  var hasTimeline = !!(timelineOptionsOnRoot || timelineOnRoot || declaredBaseOption && declaredBaseOption.timeline);\n  if (declaredBaseOption) {\n    baseOption = declaredBaseOption;\n    // For merge option.\n    if (!baseOption.timeline) {\n      baseOption.timeline = timelineOnRoot;\n    }\n  }\n  // For convenience, enable to use the root option as the `baseOption`:\n  // `{ ...normalOptionProps, media: [{ ... }, { ... }] }`\n  else {\n    if (hasTimeline || hasMedia) {\n      rawOption.options = rawOption.media = null;\n    }\n    baseOption = rawOption;\n  }\n  if (hasMedia) {\n    if (isArray(mediaOnRoot)) {\n      each(mediaOnRoot, function (singleMedia) {\n        if (process.env.NODE_ENV !== 'production') {\n          // Real case of wrong config.\n          if (singleMedia && !singleMedia.option && isObject(singleMedia.query) && isObject(singleMedia.query.option)) {\n            error('Illegal media option. Must be like { media: [ { query: {}, option: {} } ] }');\n          }\n        }\n        if (singleMedia && singleMedia.option) {\n          if (singleMedia.query) {\n            mediaList.push(singleMedia);\n          } else if (!mediaDefault) {\n            // Use the first media default.\n            mediaDefault = singleMedia;\n          }\n        }\n      });\n    } else {\n      if (process.env.NODE_ENV !== 'production') {\n        // Real case of wrong config.\n        error('Illegal media option. Must be an array. Like { media: [ {...}, {...} ] }');\n      }\n    }\n  }\n  doPreprocess(baseOption);\n  each(timelineOptionsOnRoot, function (option) {\n    return doPreprocess(option);\n  });\n  each(mediaList, function (media) {\n    return doPreprocess(media.option);\n  });\n  function doPreprocess(option) {\n    each(optionPreprocessorFuncs, function (preProcess) {\n      preProcess(option, isNew);\n    });\n  }\n  return {\n    baseOption: baseOption,\n    timelineOptions: timelineOptionsOnRoot || [],\n    mediaDefault: mediaDefault,\n    mediaList: mediaList\n  };\n}\n/**\n * @see <http://www.w3.org/TR/css3-mediaqueries/#media1>\n * Support: width, height, aspectRatio\n * Can use max or min as prefix.\n */\nfunction applyMediaQuery(query, ecWidth, ecHeight) {\n  var realMap = {\n    width: ecWidth,\n    height: ecHeight,\n    aspectratio: ecWidth / ecHeight // lower case for convenience.\n  };\n  var applicable = true;\n  each(query, function (value, attr) {\n    var matched = attr.match(QUERY_REG);\n    if (!matched || !matched[1] || !matched[2]) {\n      return;\n    }\n    var operator = matched[1];\n    var realAttr = matched[2].toLowerCase();\n    if (!compare(realMap[realAttr], value, operator)) {\n      applicable = false;\n    }\n  });\n  return applicable;\n}\nfunction compare(real, expect, operator) {\n  if (operator === 'min') {\n    return real >= expect;\n  } else if (operator === 'max') {\n    return real <= expect;\n  } else {\n    // Equals\n    return real === expect;\n  }\n}\nfunction indicesEquals(indices1, indices2) {\n  // indices is always order by asc and has only finite number.\n  return indices1.join(',') === indices2.join(',');\n}\n/**\n * Consider case:\n * `chart.setOption(opt1);`\n * Then user do some interaction like dataZoom, dataView changing.\n * `chart.setOption(opt2);`\n * Then user press 'reset button' in toolbox.\n *\n * After doing that all of the interaction effects should be reset, the\n * chart should be the same as the result of invoke\n * `chart.setOption(opt1); chart.setOption(opt2);`.\n *\n * Although it is not able ensure that\n * `chart.setOption(opt1); chart.setOption(opt2);` is equivalents to\n * `chart.setOption(merge(opt1, opt2));` exactly,\n * this might be the only simple way to implement that feature.\n *\n * MEMO: We've considered some other approaches:\n * 1. Each model handles its self restoration but not uniform treatment.\n *     (Too complex in logic and error-prone)\n * 2. Use a shadow ecModel. (Performance expensive)\n *\n * FIXME: A possible solution:\n * Add a extra level of model for each component model. The inheritance chain would be:\n * ecModel <- componentModel <- componentActionModel <- dataItemModel\n * And all of the actions can only modify the `componentActionModel` rather than\n * `componentModel`. `setOption` will only modify the `ecModel` and `componentModel`.\n * When \"resotre\" action triggered, model from `componentActionModel` will be discarded\n * instead of recreating the \"ecModel\" from the \"_optionBackup\".\n */\n// function mergeToBackupOption(\n//     fakeCmptsMap: FakeComponentsMap,\n//     // `tarOption` Can be null/undefined, means init\n//     tarOption: ECUnitOption,\n//     newOption: ECUnitOption,\n//     // Can be null/undefined\n//     opt: InnerSetOptionOpts\n// ): void {\n//     newOption = newOption || {} as ECUnitOption;\n//     const notInit = !!tarOption;\n//     each(newOption, function (newOptsInMainType, mainType) {\n//         if (newOptsInMainType == null) {\n//             return;\n//         }\n//         if (!ComponentModel.hasClass(mainType)) {\n//             if (tarOption) {\n//                 tarOption[mainType] = merge(tarOption[mainType], newOptsInMainType, true);\n//             }\n//         }\n//         else {\n//             const oldTarOptsInMainType = notInit ? normalizeToArray(tarOption[mainType]) : null;\n//             const oldFakeCmptsInMainType = fakeCmptsMap.get(mainType) || [];\n//             const resultTarOptsInMainType = notInit ? (tarOption[mainType] = [] as ComponentOption[]) : null;\n//             const resultFakeCmptsInMainType = fakeCmptsMap.set(mainType, []);\n//             const mappingResult = mappingToExists(\n//                 oldFakeCmptsInMainType,\n//                 normalizeToArray(newOptsInMainType),\n//                 (opt && opt.replaceMergeMainTypeMap.get(mainType)) ? 'replaceMerge' : 'normalMerge'\n//             );\n//             setComponentTypeToKeyInfo(mappingResult, mainType, ComponentModel as ComponentModelConstructor);\n//             each(mappingResult, function (resultItem, index) {\n//                 // The same logic as `Global.ts#_mergeOption`.\n//                 let fakeCmpt = resultItem.existing;\n//                 const newOption = resultItem.newOption;\n//                 const keyInfo = resultItem.keyInfo;\n//                 let fakeCmptOpt;\n//                 if (!newOption) {\n//                     fakeCmptOpt = oldTarOptsInMainType[index];\n//                 }\n//                 else {\n//                     if (fakeCmpt && fakeCmpt.subType === keyInfo.subType) {\n//                         fakeCmpt.name = keyInfo.name;\n//                         if (notInit) {\n//                             fakeCmptOpt = merge(oldTarOptsInMainType[index], newOption, true);\n//                         }\n//                     }\n//                     else {\n//                         fakeCmpt = extend({}, keyInfo);\n//                         if (notInit) {\n//                             fakeCmptOpt = clone(newOption);\n//                         }\n//                     }\n//                 }\n//                 if (fakeCmpt) {\n//                     notInit && resultTarOptsInMainType.push(fakeCmptOpt);\n//                     resultFakeCmptsInMainType.push(fakeCmpt);\n//                 }\n//                 else {\n//                     notInit && resultTarOptsInMainType.push(void 0);\n//                     resultFakeCmptsInMainType.push(void 0);\n//                 }\n//             });\n//         }\n//     });\n// }\nexport default OptionManager;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as modelUtil from '../../util/model.js';\nimport { deprecateLog, deprecateReplaceLog } from '../../util/log.js';\nvar each = zrUtil.each;\nvar isObject = zrUtil.isObject;\nvar POSSIBLE_STYLES = ['areaStyle', 'lineStyle', 'nodeStyle', 'linkStyle', 'chordStyle', 'label', 'labelLine'];\nfunction compatEC2ItemStyle(opt) {\n  var itemStyleOpt = opt && opt.itemStyle;\n  if (!itemStyleOpt) {\n    return;\n  }\n  for (var i = 0, len = POSSIBLE_STYLES.length; i < len; i++) {\n    var styleName = POSSIBLE_STYLES[i];\n    var normalItemStyleOpt = itemStyleOpt.normal;\n    var emphasisItemStyleOpt = itemStyleOpt.emphasis;\n    if (normalItemStyleOpt && normalItemStyleOpt[styleName]) {\n      if (process.env.NODE_ENV !== 'production') {\n        deprecateReplaceLog(\"itemStyle.normal.\" + styleName, styleName);\n      }\n      opt[styleName] = opt[styleName] || {};\n      if (!opt[styleName].normal) {\n        opt[styleName].normal = normalItemStyleOpt[styleName];\n      } else {\n        zrUtil.merge(opt[styleName].normal, normalItemStyleOpt[styleName]);\n      }\n      normalItemStyleOpt[styleName] = null;\n    }\n    if (emphasisItemStyleOpt && emphasisItemStyleOpt[styleName]) {\n      if (process.env.NODE_ENV !== 'production') {\n        deprecateReplaceLog(\"itemStyle.emphasis.\" + styleName, \"emphasis.\" + styleName);\n      }\n      opt[styleName] = opt[styleName] || {};\n      if (!opt[styleName].emphasis) {\n        opt[styleName].emphasis = emphasisItemStyleOpt[styleName];\n      } else {\n        zrUtil.merge(opt[styleName].emphasis, emphasisItemStyleOpt[styleName]);\n      }\n      emphasisItemStyleOpt[styleName] = null;\n    }\n  }\n}\nfunction convertNormalEmphasis(opt, optType, useExtend) {\n  if (opt && opt[optType] && (opt[optType].normal || opt[optType].emphasis)) {\n    var normalOpt = opt[optType].normal;\n    var emphasisOpt = opt[optType].emphasis;\n    if (normalOpt) {\n      if (process.env.NODE_ENV !== 'production') {\n        // eslint-disable-next-line max-len\n        deprecateLog(\"'normal' hierarchy in \" + optType + \" has been removed since 4.0. All style properties are configured in \" + optType + \" directly now.\");\n      }\n      // Timeline controlStyle has other properties besides normal and emphasis\n      if (useExtend) {\n        opt[optType].normal = opt[optType].emphasis = null;\n        zrUtil.defaults(opt[optType], normalOpt);\n      } else {\n        opt[optType] = normalOpt;\n      }\n    }\n    if (emphasisOpt) {\n      if (process.env.NODE_ENV !== 'production') {\n        deprecateLog(optType + \".emphasis has been changed to emphasis.\" + optType + \" since 4.0\");\n      }\n      opt.emphasis = opt.emphasis || {};\n      opt.emphasis[optType] = emphasisOpt;\n      // Also compat the case user mix the style and focus together in ec3 style\n      // for example: { itemStyle: { normal: {}, emphasis: {focus, shadowBlur} } }\n      if (emphasisOpt.focus) {\n        opt.emphasis.focus = emphasisOpt.focus;\n      }\n      if (emphasisOpt.blurScope) {\n        opt.emphasis.blurScope = emphasisOpt.blurScope;\n      }\n    }\n  }\n}\nfunction removeEC3NormalStatus(opt) {\n  convertNormalEmphasis(opt, 'itemStyle');\n  convertNormalEmphasis(opt, 'lineStyle');\n  convertNormalEmphasis(opt, 'areaStyle');\n  convertNormalEmphasis(opt, 'label');\n  convertNormalEmphasis(opt, 'labelLine');\n  // treemap\n  convertNormalEmphasis(opt, 'upperLabel');\n  // graph\n  convertNormalEmphasis(opt, 'edgeLabel');\n}\nfunction compatTextStyle(opt, propName) {\n  // Check whether is not object (string\\null\\undefined ...)\n  var labelOptSingle = isObject(opt) && opt[propName];\n  var textStyle = isObject(labelOptSingle) && labelOptSingle.textStyle;\n  if (textStyle) {\n    if (process.env.NODE_ENV !== 'production') {\n      // eslint-disable-next-line max-len\n      deprecateLog(\"textStyle hierarchy in \" + propName + \" has been removed since 4.0. All textStyle properties are configured in \" + propName + \" directly now.\");\n    }\n    for (var i = 0, len = modelUtil.TEXT_STYLE_OPTIONS.length; i < len; i++) {\n      var textPropName = modelUtil.TEXT_STYLE_OPTIONS[i];\n      if (textStyle.hasOwnProperty(textPropName)) {\n        labelOptSingle[textPropName] = textStyle[textPropName];\n      }\n    }\n  }\n}\nfunction compatEC3CommonStyles(opt) {\n  if (opt) {\n    removeEC3NormalStatus(opt);\n    compatTextStyle(opt, 'label');\n    opt.emphasis && compatTextStyle(opt.emphasis, 'label');\n  }\n}\nfunction processSeries(seriesOpt) {\n  if (!isObject(seriesOpt)) {\n    return;\n  }\n  compatEC2ItemStyle(seriesOpt);\n  removeEC3NormalStatus(seriesOpt);\n  compatTextStyle(seriesOpt, 'label');\n  // treemap\n  compatTextStyle(seriesOpt, 'upperLabel');\n  // graph\n  compatTextStyle(seriesOpt, 'edgeLabel');\n  if (seriesOpt.emphasis) {\n    compatTextStyle(seriesOpt.emphasis, 'label');\n    // treemap\n    compatTextStyle(seriesOpt.emphasis, 'upperLabel');\n    // graph\n    compatTextStyle(seriesOpt.emphasis, 'edgeLabel');\n  }\n  var markPoint = seriesOpt.markPoint;\n  if (markPoint) {\n    compatEC2ItemStyle(markPoint);\n    compatEC3CommonStyles(markPoint);\n  }\n  var markLine = seriesOpt.markLine;\n  if (markLine) {\n    compatEC2ItemStyle(markLine);\n    compatEC3CommonStyles(markLine);\n  }\n  var markArea = seriesOpt.markArea;\n  if (markArea) {\n    compatEC3CommonStyles(markArea);\n  }\n  var data = seriesOpt.data;\n  // Break with ec3: if `setOption` again, there may be no `type` in option,\n  // then the backward compat based on option type will not be performed.\n  if (seriesOpt.type === 'graph') {\n    data = data || seriesOpt.nodes;\n    var edgeData = seriesOpt.links || seriesOpt.edges;\n    if (edgeData && !zrUtil.isTypedArray(edgeData)) {\n      for (var i = 0; i < edgeData.length; i++) {\n        compatEC3CommonStyles(edgeData[i]);\n      }\n    }\n    zrUtil.each(seriesOpt.categories, function (opt) {\n      removeEC3NormalStatus(opt);\n    });\n  }\n  if (data && !zrUtil.isTypedArray(data)) {\n    for (var i = 0; i < data.length; i++) {\n      compatEC3CommonStyles(data[i]);\n    }\n  }\n  // mark point data\n  markPoint = seriesOpt.markPoint;\n  if (markPoint && markPoint.data) {\n    var mpData = markPoint.data;\n    for (var i = 0; i < mpData.length; i++) {\n      compatEC3CommonStyles(mpData[i]);\n    }\n  }\n  // mark line data\n  markLine = seriesOpt.markLine;\n  if (markLine && markLine.data) {\n    var mlData = markLine.data;\n    for (var i = 0; i < mlData.length; i++) {\n      if (zrUtil.isArray(mlData[i])) {\n        compatEC3CommonStyles(mlData[i][0]);\n        compatEC3CommonStyles(mlData[i][1]);\n      } else {\n        compatEC3CommonStyles(mlData[i]);\n      }\n    }\n  }\n  // Series\n  if (seriesOpt.type === 'gauge') {\n    compatTextStyle(seriesOpt, 'axisLabel');\n    compatTextStyle(seriesOpt, 'title');\n    compatTextStyle(seriesOpt, 'detail');\n  } else if (seriesOpt.type === 'treemap') {\n    convertNormalEmphasis(seriesOpt.breadcrumb, 'itemStyle');\n    zrUtil.each(seriesOpt.levels, function (opt) {\n      removeEC3NormalStatus(opt);\n    });\n  } else if (seriesOpt.type === 'tree') {\n    removeEC3NormalStatus(seriesOpt.leaves);\n  }\n  // sunburst starts from ec4, so it does not need to compat levels.\n}\nfunction toArr(o) {\n  return zrUtil.isArray(o) ? o : o ? [o] : [];\n}\nfunction toObj(o) {\n  return (zrUtil.isArray(o) ? o[0] : o) || {};\n}\nexport default function globalCompatStyle(option, isTheme) {\n  each(toArr(option.series), function (seriesOpt) {\n    isObject(seriesOpt) && processSeries(seriesOpt);\n  });\n  var axes = ['xAxis', 'yAxis', 'radiusAxis', 'angleAxis', 'singleAxis', 'parallelAxis', 'radar'];\n  isTheme && axes.push('valueAxis', 'categoryAxis', 'logAxis', 'timeAxis');\n  each(axes, function (axisName) {\n    each(toArr(option[axisName]), function (axisOpt) {\n      if (axisOpt) {\n        compatTextStyle(axisOpt, 'axisLabel');\n        compatTextStyle(axisOpt.axisPointer, 'label');\n      }\n    });\n  });\n  each(toArr(option.parallel), function (parallelOpt) {\n    var parallelAxisDefault = parallelOpt && parallelOpt.parallelAxisDefault;\n    compatTextStyle(parallelAxisDefault, 'axisLabel');\n    compatTextStyle(parallelAxisDefault && parallelAxisDefault.axisPointer, 'label');\n  });\n  each(toArr(option.calendar), function (calendarOpt) {\n    convertNormalEmphasis(calendarOpt, 'itemStyle');\n    compatTextStyle(calendarOpt, 'dayLabel');\n    compatTextStyle(calendarOpt, 'monthLabel');\n    compatTextStyle(calendarOpt, 'yearLabel');\n  });\n  // radar.name.textStyle\n  each(toArr(option.radar), function (radarOpt) {\n    compatTextStyle(radarOpt, 'name');\n    // Use axisName instead of name because component has name property\n    if (radarOpt.name && radarOpt.axisName == null) {\n      radarOpt.axisName = radarOpt.name;\n      delete radarOpt.name;\n      if (process.env.NODE_ENV !== 'production') {\n        deprecateLog('name property in radar component has been changed to axisName');\n      }\n    }\n    if (radarOpt.nameGap != null && radarOpt.axisNameGap == null) {\n      radarOpt.axisNameGap = radarOpt.nameGap;\n      delete radarOpt.nameGap;\n      if (process.env.NODE_ENV !== 'production') {\n        deprecateLog('nameGap property in radar component has been changed to axisNameGap');\n      }\n    }\n    if (process.env.NODE_ENV !== 'production') {\n      each(radarOpt.indicator, function (indicatorOpt) {\n        if (indicatorOpt.text) {\n          deprecateReplaceLog('text', 'name', 'radar.indicator');\n        }\n      });\n    }\n  });\n  each(toArr(option.geo), function (geoOpt) {\n    if (isObject(geoOpt)) {\n      compatEC3CommonStyles(geoOpt);\n      each(toArr(geoOpt.regions), function (regionObj) {\n        compatEC3CommonStyles(regionObj);\n      });\n    }\n  });\n  each(toArr(option.timeline), function (timelineOpt) {\n    compatEC3CommonStyles(timelineOpt);\n    convertNormalEmphasis(timelineOpt, 'label');\n    convertNormalEmphasis(timelineOpt, 'itemStyle');\n    convertNormalEmphasis(timelineOpt, 'controlStyle', true);\n    var data = timelineOpt.data;\n    zrUtil.isArray(data) && zrUtil.each(data, function (item) {\n      if (zrUtil.isObject(item)) {\n        convertNormalEmphasis(item, 'label');\n        convertNormalEmphasis(item, 'itemStyle');\n      }\n    });\n  });\n  each(toArr(option.toolbox), function (toolboxOpt) {\n    convertNormalEmphasis(toolboxOpt, 'iconStyle');\n    each(toolboxOpt.feature, function (featureOpt) {\n      convertNormalEmphasis(featureOpt, 'iconStyle');\n    });\n  });\n  compatTextStyle(toObj(option.axisPointer), 'label');\n  compatTextStyle(toObj(option.tooltip).axisPointer, 'label');\n  // Clean logs\n  // storedLogs = {};\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { each, isArray, isObject, isTypedArray, defaults } from 'zrender/lib/core/util.js';\nimport compatStyle from './helper/compatStyle.js';\nimport { normalizeToArray } from '../util/model.js';\nimport { deprecateLog, deprecateReplaceLog } from '../util/log.js';\nfunction get(opt, path) {\n  var pathArr = path.split(',');\n  var obj = opt;\n  for (var i = 0; i < pathArr.length; i++) {\n    obj = obj && obj[pathArr[i]];\n    if (obj == null) {\n      break;\n    }\n  }\n  return obj;\n}\nfunction set(opt, path, val, overwrite) {\n  var pathArr = path.split(',');\n  var obj = opt;\n  var key;\n  var i = 0;\n  for (; i < pathArr.length - 1; i++) {\n    key = pathArr[i];\n    if (obj[key] == null) {\n      obj[key] = {};\n    }\n    obj = obj[key];\n  }\n  if (overwrite || obj[pathArr[i]] == null) {\n    obj[pathArr[i]] = val;\n  }\n}\nfunction compatLayoutProperties(option) {\n  option && each(LAYOUT_PROPERTIES, function (prop) {\n    if (prop[0] in option && !(prop[1] in option)) {\n      option[prop[1]] = option[prop[0]];\n    }\n  });\n}\nvar LAYOUT_PROPERTIES = [['x', 'left'], ['y', 'top'], ['x2', 'right'], ['y2', 'bottom']];\nvar COMPATITABLE_COMPONENTS = ['grid', 'geo', 'parallel', 'legend', 'toolbox', 'title', 'visualMap', 'dataZoom', 'timeline'];\nvar BAR_ITEM_STYLE_MAP = [['borderRadius', 'barBorderRadius'], ['borderColor', 'barBorderColor'], ['borderWidth', 'barBorderWidth']];\nfunction compatBarItemStyle(option) {\n  var itemStyle = option && option.itemStyle;\n  if (itemStyle) {\n    for (var i = 0; i < BAR_ITEM_STYLE_MAP.length; i++) {\n      var oldName = BAR_ITEM_STYLE_MAP[i][1];\n      var newName = BAR_ITEM_STYLE_MAP[i][0];\n      if (itemStyle[oldName] != null) {\n        itemStyle[newName] = itemStyle[oldName];\n        if (process.env.NODE_ENV !== 'production') {\n          deprecateReplaceLog(oldName, newName);\n        }\n      }\n    }\n  }\n}\nfunction compatPieLabel(option) {\n  if (!option) {\n    return;\n  }\n  if (option.alignTo === 'edge' && option.margin != null && option.edgeDistance == null) {\n    if (process.env.NODE_ENV !== 'production') {\n      deprecateReplaceLog('label.margin', 'label.edgeDistance', 'pie');\n    }\n    option.edgeDistance = option.margin;\n  }\n}\nfunction compatSunburstState(option) {\n  if (!option) {\n    return;\n  }\n  if (option.downplay && !option.blur) {\n    option.blur = option.downplay;\n    if (process.env.NODE_ENV !== 'production') {\n      deprecateReplaceLog('downplay', 'blur', 'sunburst');\n    }\n  }\n}\nfunction compatGraphFocus(option) {\n  if (!option) {\n    return;\n  }\n  if (option.focusNodeAdjacency != null) {\n    option.emphasis = option.emphasis || {};\n    if (option.emphasis.focus == null) {\n      if (process.env.NODE_ENV !== 'production') {\n        deprecateReplaceLog('focusNodeAdjacency', 'emphasis: { focus: \\'adjacency\\'}', 'graph/sankey');\n      }\n      option.emphasis.focus = 'adjacency';\n    }\n  }\n}\nfunction traverseTree(data, cb) {\n  if (data) {\n    for (var i = 0; i < data.length; i++) {\n      cb(data[i]);\n      data[i] && traverseTree(data[i].children, cb);\n    }\n  }\n}\nexport default function globalBackwardCompat(option, isTheme) {\n  compatStyle(option, isTheme);\n  // Make sure series array for model initialization.\n  option.series = normalizeToArray(option.series);\n  each(option.series, function (seriesOpt) {\n    if (!isObject(seriesOpt)) {\n      return;\n    }\n    var seriesType = seriesOpt.type;\n    if (seriesType === 'line') {\n      if (seriesOpt.clipOverflow != null) {\n        seriesOpt.clip = seriesOpt.clipOverflow;\n        if (process.env.NODE_ENV !== 'production') {\n          deprecateReplaceLog('clipOverflow', 'clip', 'line');\n        }\n      }\n    } else if (seriesType === 'pie' || seriesType === 'gauge') {\n      if (seriesOpt.clockWise != null) {\n        seriesOpt.clockwise = seriesOpt.clockWise;\n        if (process.env.NODE_ENV !== 'production') {\n          deprecateReplaceLog('clockWise', 'clockwise');\n        }\n      }\n      compatPieLabel(seriesOpt.label);\n      var data = seriesOpt.data;\n      if (data && !isTypedArray(data)) {\n        for (var i = 0; i < data.length; i++) {\n          compatPieLabel(data[i]);\n        }\n      }\n      if (seriesOpt.hoverOffset != null) {\n        seriesOpt.emphasis = seriesOpt.emphasis || {};\n        if (seriesOpt.emphasis.scaleSize = null) {\n          if (process.env.NODE_ENV !== 'production') {\n            deprecateReplaceLog('hoverOffset', 'emphasis.scaleSize');\n          }\n          seriesOpt.emphasis.scaleSize = seriesOpt.hoverOffset;\n        }\n      }\n    } else if (seriesType === 'gauge') {\n      var pointerColor = get(seriesOpt, 'pointer.color');\n      pointerColor != null && set(seriesOpt, 'itemStyle.color', pointerColor);\n    } else if (seriesType === 'bar') {\n      compatBarItemStyle(seriesOpt);\n      compatBarItemStyle(seriesOpt.backgroundStyle);\n      compatBarItemStyle(seriesOpt.emphasis);\n      var data = seriesOpt.data;\n      if (data && !isTypedArray(data)) {\n        for (var i = 0; i < data.length; i++) {\n          if (typeof data[i] === 'object') {\n            compatBarItemStyle(data[i]);\n            compatBarItemStyle(data[i] && data[i].emphasis);\n          }\n        }\n      }\n    } else if (seriesType === 'sunburst') {\n      var highlightPolicy = seriesOpt.highlightPolicy;\n      if (highlightPolicy) {\n        seriesOpt.emphasis = seriesOpt.emphasis || {};\n        if (!seriesOpt.emphasis.focus) {\n          seriesOpt.emphasis.focus = highlightPolicy;\n          if (process.env.NODE_ENV !== 'production') {\n            deprecateReplaceLog('highlightPolicy', 'emphasis.focus', 'sunburst');\n          }\n        }\n      }\n      compatSunburstState(seriesOpt);\n      traverseTree(seriesOpt.data, compatSunburstState);\n    } else if (seriesType === 'graph' || seriesType === 'sankey') {\n      compatGraphFocus(seriesOpt);\n      // TODO nodes, edges?\n    } else if (seriesType === 'map') {\n      if (seriesOpt.mapType && !seriesOpt.map) {\n        if (process.env.NODE_ENV !== 'production') {\n          deprecateReplaceLog('mapType', 'map', 'map');\n        }\n        seriesOpt.map = seriesOpt.mapType;\n      }\n      if (seriesOpt.mapLocation) {\n        if (process.env.NODE_ENV !== 'production') {\n          deprecateLog('`mapLocation` is not used anymore.');\n        }\n        defaults(seriesOpt, seriesOpt.mapLocation);\n      }\n    }\n    if (seriesOpt.hoverAnimation != null) {\n      seriesOpt.emphasis = seriesOpt.emphasis || {};\n      if (seriesOpt.emphasis && seriesOpt.emphasis.scale == null) {\n        if (process.env.NODE_ENV !== 'production') {\n          deprecateReplaceLog('hoverAnimation', 'emphasis.scale');\n        }\n        seriesOpt.emphasis.scale = seriesOpt.hoverAnimation;\n      }\n    }\n    compatLayoutProperties(seriesOpt);\n  });\n  // dataRange has changed to visualMap\n  if (option.dataRange) {\n    option.visualMap = option.dataRange;\n  }\n  each(COMPATITABLE_COMPONENTS, function (componentName) {\n    var options = option[componentName];\n    if (options) {\n      if (!isArray(options)) {\n        options = [options];\n      }\n      each(options, function (option) {\n        compatLayoutProperties(option);\n      });\n    }\n  });\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { createHashMap, each } from 'zrender/lib/core/util.js';\nimport { addSafe } from '../util/number.js';\n// (1) [Caution]: the logic is correct based on the premises:\n//     data processing stage is blocked in stream.\n//     See <module:echarts/stream/Scheduler#performDataProcessorTasks>\n// (2) Only register once when import repeatedly.\n//     Should be executed after series is filtered and before stack calculation.\nexport default function dataStack(ecModel) {\n  var stackInfoMap = createHashMap();\n  ecModel.eachSeries(function (seriesModel) {\n    var stack = seriesModel.get('stack');\n    // Compatible: when `stack` is set as '', do not stack.\n    if (stack) {\n      var stackInfoList = stackInfoMap.get(stack) || stackInfoMap.set(stack, []);\n      var data = seriesModel.getData();\n      var stackInfo = {\n        // Used for calculate axis extent automatically.\n        // TODO: Type getCalculationInfo return more specific type?\n        stackResultDimension: data.getCalculationInfo('stackResultDimension'),\n        stackedOverDimension: data.getCalculationInfo('stackedOverDimension'),\n        stackedDimension: data.getCalculationInfo('stackedDimension'),\n        stackedByDimension: data.getCalculationInfo('stackedByDimension'),\n        isStackedByIndex: data.getCalculationInfo('isStackedByIndex'),\n        data: data,\n        seriesModel: seriesModel\n      };\n      // If stacked on axis that do not support data stack.\n      if (!stackInfo.stackedDimension || !(stackInfo.isStackedByIndex || stackInfo.stackedByDimension)) {\n        return;\n      }\n      stackInfoList.push(stackInfo);\n    }\n  });\n  // Process each stack group\n  stackInfoMap.each(function (stackInfoList) {\n    if (stackInfoList.length === 0) {\n      return;\n    }\n    // Check if stack order needs to be reversed\n    var firstSeries = stackInfoList[0].seriesModel;\n    var stackOrder = firstSeries.get('stackOrder') || 'seriesAsc';\n    if (stackOrder === 'seriesDesc') {\n      stackInfoList.reverse();\n    }\n    // Set stackedOnSeries for each series in the final order\n    each(stackInfoList, function (stackInfo, index) {\n      stackInfo.data.setCalculationInfo('stackedOnSeries', index > 0 ? stackInfoList[index - 1].seriesModel : null);\n    });\n    // Calculate stack values\n    calculateStack(stackInfoList);\n  });\n}\nfunction calculateStack(stackInfoList) {\n  each(stackInfoList, function (targetStackInfo, idxInStack) {\n    var resultVal = [];\n    var resultNaN = [NaN, NaN];\n    var dims = [targetStackInfo.stackResultDimension, targetStackInfo.stackedOverDimension];\n    var targetData = targetStackInfo.data;\n    var isStackedByIndex = targetStackInfo.isStackedByIndex;\n    var stackStrategy = targetStackInfo.seriesModel.get('stackStrategy') || 'samesign';\n    // Should not write on raw data, because stack series model list changes\n    // depending on legend selection.\n    targetData.modify(dims, function (v0, v1, dataIndex) {\n      var sum = targetData.get(targetStackInfo.stackedDimension, dataIndex);\n      // Consider `connectNulls` of line area, if value is NaN, stackedOver\n      // should also be NaN, to draw a appropriate belt area.\n      if (isNaN(sum)) {\n        return resultNaN;\n      }\n      var byValue;\n      var stackedDataRawIndex;\n      if (isStackedByIndex) {\n        stackedDataRawIndex = targetData.getRawIndex(dataIndex);\n      } else {\n        byValue = targetData.get(targetStackInfo.stackedByDimension, dataIndex);\n      }\n      // If stackOver is NaN, chart view will render point on value start.\n      var stackedOver = NaN;\n      for (var j = idxInStack - 1; j >= 0; j--) {\n        var stackInfo = stackInfoList[j];\n        // Has been optimized by inverted indices on `stackedByDimension`.\n        if (!isStackedByIndex) {\n          stackedDataRawIndex = stackInfo.data.rawIndexOf(stackInfo.stackedByDimension, byValue);\n        }\n        if (stackedDataRawIndex >= 0) {\n          var val = stackInfo.data.getByRawIndex(stackInfo.stackResultDimension, stackedDataRawIndex);\n          // Considering positive stack, negative stack and empty data\n          if (stackStrategy === 'all' // single stack group\n          || stackStrategy === 'positive' && val > 0 || stackStrategy === 'negative' && val < 0 || stackStrategy === 'samesign' && sum >= 0 && val > 0 // All positive stack\n          || stackStrategy === 'samesign' && sum <= 0 && val < 0 // All negative stack\n          ) {\n            // The sum has to be very small to be affected by the\n            // floating arithmetic problem. An incorrect result will probably\n            // cause axis min/max to be filtered incorrectly.\n            sum = addSafe(sum, val);\n            stackedOver = val;\n            break;\n          }\n        }\n      }\n      resultVal[0] = sum;\n      resultVal[1] = stackedOver;\n      return resultVal;\n    });\n  });\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { isTypedArray, clone, createHashMap, isArray, isObject, isArrayLike, hasOwn, assert, each, map, isNumber, isString, keys } from 'zrender/lib/core/util.js';\nimport { SOURCE_FORMAT_ORIGINAL, SERIES_LAYOUT_BY_COLUMN, SOURCE_FORMAT_UNKNOWN, SOURCE_FORMAT_KEYED_COLUMNS, SOURCE_FORMAT_TYPED_ARRAY, SOURCE_FORMAT_ARRAY_ROWS, SOURCE_FORMAT_OBJECT_ROWS, SERIES_LAYOUT_BY_ROW } from '../util/types.js';\nimport { getDataItemValue } from '../util/model.js';\nimport { BE_ORDINAL, guessOrdinal } from './helper/sourceHelper.js';\n;\n// @inner\nvar SourceImpl = /** @class */function () {\n  function SourceImpl(fields) {\n    this.data = fields.data || (fields.sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS ? {} : []);\n    this.sourceFormat = fields.sourceFormat || SOURCE_FORMAT_UNKNOWN;\n    // Visit config\n    this.seriesLayoutBy = fields.seriesLayoutBy || SERIES_LAYOUT_BY_COLUMN;\n    this.startIndex = fields.startIndex || 0;\n    this.dimensionsDetectedCount = fields.dimensionsDetectedCount;\n    this.metaRawOption = fields.metaRawOption;\n    var dimensionsDefine = this.dimensionsDefine = fields.dimensionsDefine;\n    if (dimensionsDefine) {\n      for (var i = 0; i < dimensionsDefine.length; i++) {\n        var dim = dimensionsDefine[i];\n        if (dim.type == null) {\n          if (guessOrdinal(this, i) === BE_ORDINAL.Must) {\n            dim.type = 'ordinal';\n          }\n        }\n      }\n    }\n  }\n  return SourceImpl;\n}();\nexport function isSourceInstance(val) {\n  return val instanceof SourceImpl;\n}\n/**\n * Create a source from option.\n * NOTE: Created source is immutable. Don't change any properties in it.\n */\nexport function createSource(sourceData, thisMetaRawOption,\n// can be null. If not provided, auto detect it from `sourceData`.\nsourceFormat) {\n  sourceFormat = sourceFormat || detectSourceFormat(sourceData);\n  var seriesLayoutBy = thisMetaRawOption.seriesLayoutBy;\n  var determined = determineSourceDimensions(sourceData, sourceFormat, seriesLayoutBy, thisMetaRawOption.sourceHeader, thisMetaRawOption.dimensions);\n  var source = new SourceImpl({\n    data: sourceData,\n    sourceFormat: sourceFormat,\n    seriesLayoutBy: seriesLayoutBy,\n    dimensionsDefine: determined.dimensionsDefine,\n    startIndex: determined.startIndex,\n    dimensionsDetectedCount: determined.dimensionsDetectedCount,\n    metaRawOption: clone(thisMetaRawOption)\n  });\n  return source;\n}\n/**\n * Wrap original series data for some compatibility cases.\n */\nexport function createSourceFromSeriesDataOption(data) {\n  return new SourceImpl({\n    data: data,\n    sourceFormat: isTypedArray(data) ? SOURCE_FORMAT_TYPED_ARRAY : SOURCE_FORMAT_ORIGINAL\n  });\n}\n/**\n * Clone source but excludes source data.\n */\nexport function cloneSourceShallow(source) {\n  return new SourceImpl({\n    data: source.data,\n    sourceFormat: source.sourceFormat,\n    seriesLayoutBy: source.seriesLayoutBy,\n    dimensionsDefine: clone(source.dimensionsDefine),\n    startIndex: source.startIndex,\n    dimensionsDetectedCount: source.dimensionsDetectedCount\n  });\n}\n/**\n * Note: An empty array will be detected as `SOURCE_FORMAT_ARRAY_ROWS`.\n */\nexport function detectSourceFormat(data) {\n  var sourceFormat = SOURCE_FORMAT_UNKNOWN;\n  if (isTypedArray(data)) {\n    sourceFormat = SOURCE_FORMAT_TYPED_ARRAY;\n  } else if (isArray(data)) {\n    // FIXME Whether tolerate null in top level array?\n    if (data.length === 0) {\n      sourceFormat = SOURCE_FORMAT_ARRAY_ROWS;\n    }\n    for (var i = 0, len = data.length; i < len; i++) {\n      var item = data[i];\n      if (item == null) {\n        continue;\n      } else if (isArray(item) || isTypedArray(item)) {\n        sourceFormat = SOURCE_FORMAT_ARRAY_ROWS;\n        break;\n      } else if (isObject(item)) {\n        sourceFormat = SOURCE_FORMAT_OBJECT_ROWS;\n        break;\n      }\n    }\n  } else if (isObject(data)) {\n    for (var key in data) {\n      if (hasOwn(data, key) && isArrayLike(data[key])) {\n        sourceFormat = SOURCE_FORMAT_KEYED_COLUMNS;\n        break;\n      }\n    }\n  }\n  return sourceFormat;\n}\n/**\n * Determine the source definitions from data standalone dimensions definitions\n * are not specified.\n */\nfunction determineSourceDimensions(data, sourceFormat, seriesLayoutBy, sourceHeader,\n// standalone raw dimensions definition, like:\n// {\n//     dimensions: ['aa', 'bb', { name: 'cc', type: 'time' }]\n// }\n// in `dataset` or `series`\ndimensionsDefine) {\n  var dimensionsDetectedCount;\n  var startIndex;\n  // PENDING: Could data be null/undefined here?\n  // currently, if `dataset.source` not specified, error thrown.\n  // if `series.data` not specified, nothing rendered without error thrown.\n  // Should test these cases.\n  if (!data) {\n    return {\n      dimensionsDefine: normalizeDimensionsOption(dimensionsDefine),\n      startIndex: startIndex,\n      dimensionsDetectedCount: dimensionsDetectedCount\n    };\n  }\n  if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS) {\n    var dataArrayRows = data;\n    // Rule: Most of the first line are string: it is header.\n    // Caution: consider a line with 5 string and 1 number,\n    // it still can not be sure it is a head, because the\n    // 5 string may be 5 values of category columns.\n    if (sourceHeader === 'auto' || sourceHeader == null) {\n      arrayRowsTravelFirst(function (val) {\n        // '-' is regarded as null/undefined.\n        if (val != null && val !== '-') {\n          if (isString(val)) {\n            startIndex == null && (startIndex = 1);\n          } else {\n            startIndex = 0;\n          }\n        }\n        // 10 is an experience number, avoid long loop.\n      }, seriesLayoutBy, dataArrayRows, 10);\n    } else {\n      startIndex = isNumber(sourceHeader) ? sourceHeader : sourceHeader ? 1 : 0;\n    }\n    if (!dimensionsDefine && startIndex === 1) {\n      dimensionsDefine = [];\n      arrayRowsTravelFirst(function (val, index) {\n        dimensionsDefine[index] = val != null ? val + '' : '';\n      }, seriesLayoutBy, dataArrayRows, Infinity);\n    }\n    dimensionsDetectedCount = dimensionsDefine ? dimensionsDefine.length : seriesLayoutBy === SERIES_LAYOUT_BY_ROW ? dataArrayRows.length : dataArrayRows[0] ? dataArrayRows[0].length : null;\n  } else if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS) {\n    if (!dimensionsDefine) {\n      dimensionsDefine = objectRowsCollectDimensions(data);\n    }\n  } else if (sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS) {\n    if (!dimensionsDefine) {\n      dimensionsDefine = [];\n      each(data, function (colArr, key) {\n        dimensionsDefine.push(key);\n      });\n    }\n  } else if (sourceFormat === SOURCE_FORMAT_ORIGINAL) {\n    var value0 = getDataItemValue(data[0]);\n    dimensionsDetectedCount = isArray(value0) && value0.length || 1;\n  } else if (sourceFormat === SOURCE_FORMAT_TYPED_ARRAY) {\n    if (process.env.NODE_ENV !== 'production') {\n      assert(!!dimensionsDefine, 'dimensions must be given if data is TypedArray.');\n    }\n  }\n  return {\n    startIndex: startIndex,\n    dimensionsDefine: normalizeDimensionsOption(dimensionsDefine),\n    dimensionsDetectedCount: dimensionsDetectedCount\n  };\n}\nfunction objectRowsCollectDimensions(data) {\n  var firstIndex = 0;\n  var obj;\n  while (firstIndex < data.length && !(obj = data[firstIndex++])) {} // jshint ignore: line\n  if (obj) {\n    return keys(obj);\n  }\n}\n// Consider dimensions defined like ['A', 'price', 'B', 'price', 'C', 'price'],\n// which is reasonable. But dimension name is duplicated.\n// Returns undefined or an array contains only object without null/undefined or string.\nfunction normalizeDimensionsOption(dimensionsDefine) {\n  if (!dimensionsDefine) {\n    // The meaning of null/undefined is different from empty array.\n    return;\n  }\n  var nameMap = createHashMap();\n  return map(dimensionsDefine, function (rawItem, index) {\n    rawItem = isObject(rawItem) ? rawItem : {\n      name: rawItem\n    };\n    // Other fields will be discarded.\n    var item = {\n      name: rawItem.name,\n      displayName: rawItem.displayName,\n      type: rawItem.type\n    };\n    // User can set null in dimensions.\n    // We don't auto specify name, otherwise a given name may\n    // cause it to be referred unexpectedly.\n    if (item.name == null) {\n      return item;\n    }\n    // Also consider number form like 2012.\n    item.name += '';\n    // User may also specify displayName.\n    // displayName will always exists except user not\n    // specified or dim name is not specified or detected.\n    // (A auto generated dim name will not be used as\n    // displayName).\n    if (item.displayName == null) {\n      item.displayName = item.name;\n    }\n    var exist = nameMap.get(item.name);\n    if (!exist) {\n      nameMap.set(item.name, {\n        count: 1\n      });\n    } else {\n      item.name += '-' + exist.count++;\n    }\n    return item;\n  });\n}\nfunction arrayRowsTravelFirst(cb, seriesLayoutBy, data, maxLoop) {\n  if (seriesLayoutBy === SERIES_LAYOUT_BY_ROW) {\n    for (var i = 0; i < data.length && i < maxLoop; i++) {\n      cb(data[i] ? data[i][0] : null, i);\n    }\n  } else {\n    var value0 = data[0] || [];\n    for (var i = 0; i < value0.length && i < maxLoop; i++) {\n      cb(value0[i], i);\n    }\n  }\n}\nexport function shouldRetrieveDataByName(source) {\n  var sourceFormat = source.sourceFormat;\n  return sourceFormat === SOURCE_FORMAT_OBJECT_ROWS || sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS;\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nvar _a, _b, _c, _d;\n// TODO\n// ??? refactor? check the outer usage of data provider.\n// merge with defaultDimValueGetter?\nimport { isTypedArray, extend, assert, each, isObject, bind, isArray } from 'zrender/lib/core/util.js';\nimport { getDataItemValue } from '../../util/model.js';\nimport { createSourceFromSeriesDataOption, isSourceInstance } from '../Source.js';\nimport { SOURCE_FORMAT_ORIGINAL, SOURCE_FORMAT_OBJECT_ROWS, SOURCE_FORMAT_KEYED_COLUMNS, SOURCE_FORMAT_TYPED_ARRAY, SOURCE_FORMAT_ARRAY_ROWS, SERIES_LAYOUT_BY_COLUMN, SERIES_LAYOUT_BY_ROW } from '../../util/types.js';\nimport { error } from '../../util/log.js';\nvar providerMethods;\nvar mountMethods;\n/**\n * If normal array used, mutable chunk size is supported.\n * If typed array used, chunk size must be fixed.\n */\nvar DefaultDataProvider = /** @class */function () {\n  function DefaultDataProvider(sourceParam, dimSize) {\n    // let source: Source;\n    var source = !isSourceInstance(sourceParam) ? createSourceFromSeriesDataOption(sourceParam) : sourceParam;\n    // declare source is Source;\n    this._source = source;\n    var data = this._data = source.data;\n    var sourceFormat = source.sourceFormat;\n    var seriesLayoutBy = source.seriesLayoutBy;\n    // Typed array. TODO IE10+?\n    if (sourceFormat === SOURCE_FORMAT_TYPED_ARRAY) {\n      if (process.env.NODE_ENV !== 'production') {\n        if (dimSize == null) {\n          throw new Error('Typed array data must specify dimension size');\n        }\n      }\n      this._offset = 0;\n      this._dimSize = dimSize;\n      this._data = data;\n    }\n    if (process.env.NODE_ENV !== 'production') {\n      var validator = rawSourceDataValidatorMap[getMethodMapKey(sourceFormat, seriesLayoutBy)];\n      validator && validator(data, source.dimensionsDefine);\n    }\n    mountMethods(this, data, source);\n  }\n  DefaultDataProvider.prototype.getSource = function () {\n    return this._source;\n  };\n  DefaultDataProvider.prototype.count = function () {\n    return 0;\n  };\n  DefaultDataProvider.prototype.getItem = function (idx, out) {\n    return;\n  };\n  DefaultDataProvider.prototype.appendData = function (newData) {};\n  DefaultDataProvider.prototype.clean = function () {};\n  DefaultDataProvider.protoInitialize = function () {\n    // PENDING: To avoid potential incompat (e.g., prototype\n    // is visited somewhere), still init them on prototype.\n    var proto = DefaultDataProvider.prototype;\n    proto.pure = false;\n    proto.persistent = true;\n  }();\n  DefaultDataProvider.internalField = function () {\n    var _a;\n    mountMethods = function (provider, data, source) {\n      var sourceFormat = source.sourceFormat;\n      var seriesLayoutBy = source.seriesLayoutBy;\n      var startIndex = source.startIndex;\n      var dimsDef = source.dimensionsDefine;\n      var methods = providerMethods[getMethodMapKey(sourceFormat, seriesLayoutBy)];\n      if (process.env.NODE_ENV !== 'production') {\n        assert(methods, 'Invalide sourceFormat: ' + sourceFormat);\n      }\n      extend(provider, methods);\n      if (sourceFormat === SOURCE_FORMAT_TYPED_ARRAY) {\n        provider.getItem = getItemForTypedArray;\n        provider.count = countForTypedArray;\n        provider.fillStorage = fillStorageForTypedArray;\n      } else {\n        var rawItemGetter = getRawSourceItemGetter(sourceFormat, seriesLayoutBy);\n        provider.getItem = bind(rawItemGetter, null, data, startIndex, dimsDef);\n        var rawCounter = getRawSourceDataCounter(sourceFormat, seriesLayoutBy);\n        provider.count = bind(rawCounter, null, data, startIndex, dimsDef);\n      }\n    };\n    var getItemForTypedArray = function (idx, out) {\n      idx = idx - this._offset;\n      out = out || [];\n      var data = this._data;\n      var dimSize = this._dimSize;\n      var offset = dimSize * idx;\n      for (var i = 0; i < dimSize; i++) {\n        out[i] = data[offset + i];\n      }\n      return out;\n    };\n    var fillStorageForTypedArray = function (start, end, storage, extent) {\n      var data = this._data;\n      var dimSize = this._dimSize;\n      for (var dim = 0; dim < dimSize; dim++) {\n        var dimExtent = extent[dim];\n        var min = dimExtent[0] == null ? Infinity : dimExtent[0];\n        var max = dimExtent[1] == null ? -Infinity : dimExtent[1];\n        var count = end - start;\n        var arr = storage[dim];\n        for (var i = 0; i < count; i++) {\n          // appendData with TypedArray will always do replace in provider.\n          var val = data[i * dimSize + dim];\n          arr[start + i] = val;\n          val < min && (min = val);\n          val > max && (max = val);\n        }\n        dimExtent[0] = min;\n        dimExtent[1] = max;\n      }\n    };\n    var countForTypedArray = function () {\n      return this._data ? this._data.length / this._dimSize : 0;\n    };\n    providerMethods = (_a = {}, _a[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_COLUMN] = {\n      pure: true,\n      appendData: appendDataSimply\n    }, _a[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_ROW] = {\n      pure: true,\n      appendData: function () {\n        throw new Error('Do not support appendData when set seriesLayoutBy: \"row\".');\n      }\n    }, _a[SOURCE_FORMAT_OBJECT_ROWS] = {\n      pure: true,\n      appendData: appendDataSimply\n    }, _a[SOURCE_FORMAT_KEYED_COLUMNS] = {\n      pure: true,\n      appendData: function (newData) {\n        var data = this._data;\n        each(newData, function (newCol, key) {\n          var oldCol = data[key] || (data[key] = []);\n          for (var i = 0; i < (newCol || []).length; i++) {\n            oldCol.push(newCol[i]);\n          }\n        });\n      }\n    }, _a[SOURCE_FORMAT_ORIGINAL] = {\n      appendData: appendDataSimply\n    }, _a[SOURCE_FORMAT_TYPED_ARRAY] = {\n      persistent: false,\n      pure: true,\n      appendData: function (newData) {\n        if (process.env.NODE_ENV !== 'production') {\n          assert(isTypedArray(newData), 'Added data must be TypedArray if data in initialization is TypedArray');\n        }\n        this._data = newData;\n      },\n      // Clean self if data is already used.\n      clean: function () {\n        // PENDING\n        this._offset += this.count();\n        this._data = null;\n      }\n    }, _a);\n    function appendDataSimply(newData) {\n      for (var i = 0; i < newData.length; i++) {\n        this._data.push(newData[i]);\n      }\n    }\n  }();\n  return DefaultDataProvider;\n}();\nexport { DefaultDataProvider };\nvar validateSimply = function (rawData) {\n  if (!isArray(rawData)) {\n    error('series.data or dataset.source must be an array.');\n  }\n};\n/**\n * Only run in dev mode - hint users for debug.\n */\nvar rawSourceDataValidatorMap = (_a = {}, _a[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_COLUMN] = validateSimply, _a[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_ROW] = validateSimply, _a[SOURCE_FORMAT_OBJECT_ROWS] = validateSimply, _a[SOURCE_FORMAT_KEYED_COLUMNS] = function (rawData, dimsDef) {\n  for (var i = 0; i < dimsDef.length; i++) {\n    var dimName = dimsDef[i].name;\n    if (dimName == null) {\n      error('dimension name must not be null/undefined.');\n    }\n  }\n}, _a[SOURCE_FORMAT_ORIGINAL] = validateSimply, _a);\nvar getItemSimply = function (rawData, startIndex, dimsDef, idx) {\n  return rawData[idx];\n};\nvar rawSourceItemGetterMap = (_b = {}, _b[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_COLUMN] = function (rawData, startIndex, dimsDef, idx) {\n  return rawData[idx + startIndex];\n}, _b[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_ROW] = function (rawData, startIndex, dimsDef, idx, out) {\n  idx += startIndex;\n  var item = out || [];\n  var data = rawData;\n  for (var i = 0; i < data.length; i++) {\n    var row = data[i];\n    item[i] = row ? row[idx] : null;\n  }\n  return item;\n}, _b[SOURCE_FORMAT_OBJECT_ROWS] = getItemSimply, _b[SOURCE_FORMAT_KEYED_COLUMNS] = function (rawData, startIndex, dimsDef, idx, out) {\n  var item = out || [];\n  for (var i = 0; i < dimsDef.length; i++) {\n    var dimName = dimsDef[i].name;\n    var col = dimName != null ? rawData[dimName] : null;\n    item[i] = col ? col[idx] : null;\n  }\n  return item;\n}, _b[SOURCE_FORMAT_ORIGINAL] = getItemSimply, _b);\nexport function getRawSourceItemGetter(sourceFormat, seriesLayoutBy) {\n  var method = rawSourceItemGetterMap[getMethodMapKey(sourceFormat, seriesLayoutBy)];\n  if (process.env.NODE_ENV !== 'production') {\n    assert(method, 'Do not support get item on \"' + sourceFormat + '\", \"' + seriesLayoutBy + '\".');\n  }\n  return method;\n}\nvar countSimply = function (rawData, startIndex, dimsDef) {\n  return rawData.length;\n};\nvar rawSourceDataCounterMap = (_c = {}, _c[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_COLUMN] = function (rawData, startIndex, dimsDef) {\n  return Math.max(0, rawData.length - startIndex);\n}, _c[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_ROW] = function (rawData, startIndex, dimsDef) {\n  var row = rawData[0];\n  return row ? Math.max(0, row.length - startIndex) : 0;\n}, _c[SOURCE_FORMAT_OBJECT_ROWS] = countSimply, _c[SOURCE_FORMAT_KEYED_COLUMNS] = function (rawData, startIndex, dimsDef) {\n  var dimName = dimsDef[0].name;\n  var col = dimName != null ? rawData[dimName] : null;\n  return col ? col.length : 0;\n}, _c[SOURCE_FORMAT_ORIGINAL] = countSimply, _c);\nexport function getRawSourceDataCounter(sourceFormat, seriesLayoutBy) {\n  var method = rawSourceDataCounterMap[getMethodMapKey(sourceFormat, seriesLayoutBy)];\n  if (process.env.NODE_ENV !== 'production') {\n    assert(method, 'Do not support count on \"' + sourceFormat + '\", \"' + seriesLayoutBy + '\".');\n  }\n  return method;\n}\nvar getRawValueSimply = function (dataItem, dimIndex, property) {\n  return dataItem[dimIndex];\n};\nvar rawSourceValueGetterMap = (_d = {}, _d[SOURCE_FORMAT_ARRAY_ROWS] = getRawValueSimply, _d[SOURCE_FORMAT_OBJECT_ROWS] = function (dataItem, dimIndex, property) {\n  return dataItem[property];\n}, _d[SOURCE_FORMAT_KEYED_COLUMNS] = getRawValueSimply, _d[SOURCE_FORMAT_ORIGINAL] = function (dataItem, dimIndex, property) {\n  // FIXME: In some case (markpoint in geo (geo-map.html)),\n  // dataItem is {coord: [...]}\n  var value = getDataItemValue(dataItem);\n  return !(value instanceof Array) ? value : value[dimIndex];\n}, _d[SOURCE_FORMAT_TYPED_ARRAY] = getRawValueSimply, _d);\nexport function getRawSourceValueGetter(sourceFormat) {\n  var method = rawSourceValueGetterMap[sourceFormat];\n  if (process.env.NODE_ENV !== 'production') {\n    assert(method, 'Do not support get value on \"' + sourceFormat + '\".');\n  }\n  return method;\n}\nfunction getMethodMapKey(sourceFormat, seriesLayoutBy) {\n  return sourceFormat === SOURCE_FORMAT_ARRAY_ROWS ? sourceFormat + '_' + seriesLayoutBy : sourceFormat;\n}\n// ??? FIXME can these logic be more neat: getRawValue, getRawDataItem,\n// Consider persistent.\n// Caution: why use raw value to display on label or tooltip?\n// A reason is to avoid format. For example time value we do not know\n// how to format is expected. More over, if stack is used, calculated\n// value may be 0.91000000001, which have brings trouble to display.\n// TODO: consider how to treat null/undefined/NaN when display?\nexport function retrieveRawValue(data, dataIndex,\n// If dimIndex is null/undefined, return OptionDataItem.\n// Otherwise, return OptionDataValue.\ndim) {\n  if (!data) {\n    return;\n  }\n  // Consider data may be not persistent.\n  var dataItem = data.getRawDataItem(dataIndex);\n  if (dataItem == null) {\n    return;\n  }\n  var store = data.getStore();\n  var sourceFormat = store.getSource().sourceFormat;\n  if (dim != null) {\n    var dimIndex = data.getDimensionIndex(dim);\n    var property = store.getDimensionProperty(dimIndex);\n    return getRawSourceValueGetter(sourceFormat)(dataItem, dimIndex, property);\n  } else {\n    var result = dataItem;\n    if (sourceFormat === SOURCE_FORMAT_ORIGINAL) {\n      result = getDataItemValue(dataItem);\n    }\n    return result;\n  }\n}\n/**\n * Compatible with some cases (in pie, map) like:\n * data: [{name: 'xx', value: 5, selected: true}, ...]\n * where only sourceFormat is 'original' and 'objectRows' supported.\n *\n * // TODO\n * Supported detail options in data item when using 'arrayRows'.\n *\n * @param data\n * @param dataIndex\n * @param attr like 'selected'\n */\nexport function retrieveRawAttr(data, dataIndex, attr) {\n  if (!data) {\n    return;\n  }\n  var sourceFormat = data.getStore().getSource().sourceFormat;\n  if (sourceFormat !== SOURCE_FORMAT_ORIGINAL && sourceFormat !== SOURCE_FORMAT_OBJECT_ROWS) {\n    return;\n  }\n  var dataItem = data.getRawDataItem(dataIndex);\n  if (sourceFormat === SOURCE_FORMAT_ORIGINAL && !isObject(dataItem)) {\n    dataItem = null;\n  }\n  if (dataItem) {\n    return dataItem[attr];\n  }\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { retrieveRawValue } from '../../data/helper/dataProvider.js';\nimport { formatTpl } from '../../util/format.js';\nimport { error, makePrintable } from '../../util/log.js';\nvar DIMENSION_LABEL_REG = /\\{@(.+?)\\}/g;\nvar DataFormatMixin = /** @class */function () {\n  function DataFormatMixin() {}\n  /**\n   * Get params for formatter\n   */\n  DataFormatMixin.prototype.getDataParams = function (dataIndex, dataType) {\n    var data = this.getData(dataType);\n    var rawValue = this.getRawValue(dataIndex, dataType);\n    var rawDataIndex = data.getRawIndex(dataIndex);\n    var name = data.getName(dataIndex);\n    var itemOpt = data.getRawDataItem(dataIndex);\n    var style = data.getItemVisual(dataIndex, 'style');\n    var color = style && style[data.getItemVisual(dataIndex, 'drawType') || 'fill'];\n    var borderColor = style && style.stroke;\n    var mainType = this.mainType;\n    var isSeries = mainType === 'series';\n    var userOutput = data.userOutput && data.userOutput.get();\n    return {\n      componentType: mainType,\n      componentSubType: this.subType,\n      componentIndex: this.componentIndex,\n      seriesType: isSeries ? this.subType : null,\n      seriesIndex: this.seriesIndex,\n      seriesId: isSeries ? this.id : null,\n      seriesName: isSeries ? this.name : null,\n      name: name,\n      dataIndex: rawDataIndex,\n      data: itemOpt,\n      dataType: dataType,\n      value: rawValue,\n      color: color,\n      borderColor: borderColor,\n      dimensionNames: userOutput ? userOutput.fullDimensions : null,\n      encode: userOutput ? userOutput.encode : null,\n      // Param name list for mapping `a`, `b`, `c`, `d`, `e`\n      $vars: ['seriesName', 'name', 'value']\n    };\n  };\n  /**\n   * Format label\n   * @param dataIndex\n   * @param status 'normal' by default\n   * @param dataType\n   * @param labelDimIndex Only used in some chart that\n   *        use formatter in different dimensions, like radar.\n   * @param formatter Formatter given outside.\n   * @return return null/undefined if no formatter\n   */\n  DataFormatMixin.prototype.getFormattedLabel = function (dataIndex, status, dataType, labelDimIndex, formatter, extendParams) {\n    status = status || 'normal';\n    var data = this.getData(dataType);\n    var params = this.getDataParams(dataIndex, dataType);\n    if (extendParams) {\n      params.value = extendParams.interpolatedValue;\n    }\n    if (labelDimIndex != null && zrUtil.isArray(params.value)) {\n      params.value = params.value[labelDimIndex];\n    }\n    if (!formatter) {\n      var itemModel = data.getItemModel(dataIndex);\n      // @ts-ignore\n      formatter = itemModel.get(status === 'normal' ? ['label', 'formatter'] : [status, 'label', 'formatter']);\n    }\n    if (zrUtil.isFunction(formatter)) {\n      params.status = status;\n      params.dimensionIndex = labelDimIndex;\n      return formatter(params);\n    } else if (zrUtil.isString(formatter)) {\n      var str = formatTpl(formatter, params);\n      // Support 'aaa{@[3]}bbb{@product}ccc'.\n      // Do not support '}' in dim name util have to.\n      return str.replace(DIMENSION_LABEL_REG, function (origin, dimStr) {\n        var len = dimStr.length;\n        var dimLoose = dimStr;\n        if (dimLoose.charAt(0) === '[' && dimLoose.charAt(len - 1) === ']') {\n          dimLoose = +dimLoose.slice(1, len - 1); // Also support: '[]' => 0\n          if (process.env.NODE_ENV !== 'production') {\n            if (isNaN(dimLoose)) {\n              error(\"Invalide label formatter: @\" + dimStr + \", only support @[0], @[1], @[2], ...\");\n            }\n          }\n        }\n        var val = retrieveRawValue(data, dataIndex, dimLoose);\n        if (extendParams && zrUtil.isArray(extendParams.interpolatedValue)) {\n          var dimIndex = data.getDimensionIndex(dimLoose);\n          if (dimIndex >= 0) {\n            val = extendParams.interpolatedValue[dimIndex];\n          }\n        }\n        return val != null ? val + '' : '';\n      });\n    }\n  };\n  /**\n   * Get raw value in option\n   */\n  DataFormatMixin.prototype.getRawValue = function (idx, dataType) {\n    return retrieveRawValue(this.getData(dataType), idx);\n  };\n  /**\n   * Should be implemented.\n   * @param {number} dataIndex\n   * @param {boolean} [multipleSeries=false]\n   * @param {string} [dataType]\n   */\n  DataFormatMixin.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\n    // Empty function\n    return;\n  };\n  return DataFormatMixin;\n}();\nexport { DataFormatMixin };\n;\n// PENDING: previously we accept this type when calling `formatTooltip`,\n// but guess little chance has been used outside. Do we need to backward\n// compat it?\n// type TooltipFormatResultLegacyObject = {\n//     // `html` means the markup language text, either in 'html' or 'richText'.\n//     // The name `html` is not appropriate because in 'richText' it is not a HTML\n//     // string. But still support it for backward compatibility.\n//     html: string;\n//     markers: Dictionary<ColorString>;\n// };\n/**\n * For backward compat, normalize the return from `formatTooltip`.\n */\nexport function normalizeTooltipFormatResult(result) {\n  var markupText;\n  // let markers: Dictionary<ColorString>;\n  var markupFragment;\n  if (zrUtil.isObject(result)) {\n    if (result.type) {\n      markupFragment = result;\n    } else {\n      if (process.env.NODE_ENV !== 'production') {\n        console.warn('The return type of `formatTooltip` is not supported: ' + makePrintable(result));\n      }\n    }\n    // else {\n    //     markupText = (result as TooltipFormatResultLegacyObject).html;\n    //     markers = (result as TooltipFormatResultLegacyObject).markers;\n    //     if (markersExisting) {\n    //         markers = zrUtil.merge(markersExisting, markers);\n    //     }\n    // }\n  } else {\n    markupText = result;\n  }\n  return {\n    text: markupText,\n    // markers: markers || markersExisting,\n    frag: markupFragment\n  };\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { assert, isArray } from 'zrender/lib/core/util.js';\n;\n/**\n * @param {Object} define\n * @return See the return of `createTask`.\n */\nexport function createTask(define) {\n  return new Task(define);\n}\nvar Task = /** @class */function () {\n  function Task(define) {\n    define = define || {};\n    this._reset = define.reset;\n    this._plan = define.plan;\n    this._count = define.count;\n    this._onDirty = define.onDirty;\n    this._dirty = true;\n  }\n  /**\n   * @param step Specified step.\n   * @param skip Skip customer perform call.\n   * @param modBy Sampling window size.\n   * @param modDataCount Sampling count.\n   * @return whether unfinished.\n   */\n  Task.prototype.perform = function (performArgs) {\n    var upTask = this._upstream;\n    var skip = performArgs && performArgs.skip;\n    // TODO some refactor.\n    // Pull data. Must pull data each time, because context.data\n    // may be updated by Series.setData.\n    if (this._dirty && upTask) {\n      var context = this.context;\n      context.data = context.outputData = upTask.context.outputData;\n    }\n    if (this.__pipeline) {\n      this.__pipeline.currentTask = this;\n    }\n    var planResult;\n    if (this._plan && !skip) {\n      planResult = this._plan(this.context);\n    }\n    // Support sharding by mod, which changes the render sequence and makes the rendered graphic\n    // elements uniformed distributed when progress, especially when moving or zooming.\n    var lastModBy = normalizeModBy(this._modBy);\n    var lastModDataCount = this._modDataCount || 0;\n    var modBy = normalizeModBy(performArgs && performArgs.modBy);\n    var modDataCount = performArgs && performArgs.modDataCount || 0;\n    if (lastModBy !== modBy || lastModDataCount !== modDataCount) {\n      planResult = 'reset';\n    }\n    function normalizeModBy(val) {\n      !(val >= 1) && (val = 1); // jshint ignore:line\n      return val;\n    }\n    var forceFirstProgress;\n    if (this._dirty || planResult === 'reset') {\n      this._dirty = false;\n      forceFirstProgress = this._doReset(skip);\n    }\n    this._modBy = modBy;\n    this._modDataCount = modDataCount;\n    var step = performArgs && performArgs.step;\n    if (upTask) {\n      if (process.env.NODE_ENV !== 'production') {\n        assert(upTask._outputDueEnd != null);\n      }\n      this._dueEnd = upTask._outputDueEnd;\n    }\n    // DataTask or overallTask\n    else {\n      if (process.env.NODE_ENV !== 'production') {\n        assert(!this._progress || this._count);\n      }\n      this._dueEnd = this._count ? this._count(this.context) : Infinity;\n    }\n    // Note: Stubs, that its host overall task let it has progress, has progress.\n    // If no progress, pass index from upstream to downstream each time plan called.\n    if (this._progress) {\n      var start = this._dueIndex;\n      var end = Math.min(step != null ? this._dueIndex + step : Infinity, this._dueEnd);\n      if (!skip && (forceFirstProgress || start < end)) {\n        var progress = this._progress;\n        if (isArray(progress)) {\n          for (var i = 0; i < progress.length; i++) {\n            this._doProgress(progress[i], start, end, modBy, modDataCount);\n          }\n        } else {\n          this._doProgress(progress, start, end, modBy, modDataCount);\n        }\n      }\n      this._dueIndex = end;\n      // If no `outputDueEnd`, assume that output data and\n      // input data is the same, so use `dueIndex` as `outputDueEnd`.\n      var outputDueEnd = this._settedOutputEnd != null ? this._settedOutputEnd : end;\n      if (process.env.NODE_ENV !== 'production') {\n        // ??? Can not rollback.\n        assert(outputDueEnd >= this._outputDueEnd);\n      }\n      this._outputDueEnd = outputDueEnd;\n    } else {\n      // (1) Some overall task has no progress.\n      // (2) Stubs, that its host overall task do not let it has progress, has no progress.\n      // This should always be performed so it can be passed to downstream.\n      this._dueIndex = this._outputDueEnd = this._settedOutputEnd != null ? this._settedOutputEnd : this._dueEnd;\n    }\n    return this.unfinished();\n  };\n  Task.prototype.dirty = function () {\n    this._dirty = true;\n    this._onDirty && this._onDirty(this.context);\n  };\n  Task.prototype._doProgress = function (progress, start, end, modBy, modDataCount) {\n    iterator.reset(start, end, modBy, modDataCount);\n    this._callingProgress = progress;\n    this._callingProgress({\n      start: start,\n      end: end,\n      count: end - start,\n      next: iterator.next\n    }, this.context);\n  };\n  Task.prototype._doReset = function (skip) {\n    this._dueIndex = this._outputDueEnd = this._dueEnd = 0;\n    this._settedOutputEnd = null;\n    var progress;\n    var forceFirstProgress;\n    if (!skip && this._reset) {\n      progress = this._reset(this.context);\n      if (progress && progress.progress) {\n        forceFirstProgress = progress.forceFirstProgress;\n        progress = progress.progress;\n      }\n      // To simplify no progress checking, array must has item.\n      if (isArray(progress) && !progress.length) {\n        progress = null;\n      }\n    }\n    this._progress = progress;\n    this._modBy = this._modDataCount = null;\n    var downstream = this._downstream;\n    downstream && downstream.dirty();\n    return forceFirstProgress;\n  };\n  Task.prototype.unfinished = function () {\n    return this._progress && this._dueIndex < this._dueEnd;\n  };\n  /**\n   * @param downTask The downstream task.\n   * @return The downstream task.\n   */\n  Task.prototype.pipe = function (downTask) {\n    if (process.env.NODE_ENV !== 'production') {\n      assert(downTask && !downTask._disposed && downTask !== this);\n    }\n    // If already downstream, do not dirty downTask.\n    if (this._downstream !== downTask || this._dirty) {\n      this._downstream = downTask;\n      downTask._upstream = this;\n      downTask.dirty();\n    }\n  };\n  Task.prototype.dispose = function () {\n    if (this._disposed) {\n      return;\n    }\n    this._upstream && (this._upstream._downstream = null);\n    this._downstream && (this._downstream._upstream = null);\n    this._dirty = false;\n    this._disposed = true;\n  };\n  Task.prototype.getUpstream = function () {\n    return this._upstream;\n  };\n  Task.prototype.getDownstream = function () {\n    return this._downstream;\n  };\n  Task.prototype.setOutputEnd = function (end) {\n    // This only happens in dataTask, dataZoom, map, currently.\n    // where dataZoom do not set end each time, but only set\n    // when reset. So we should record the set end, in case\n    // that the stub of dataZoom perform again and earse the\n    // set end by upstream.\n    this._outputDueEnd = this._settedOutputEnd = end;\n  };\n  return Task;\n}();\nexport { Task };\nvar iterator = function () {\n  var end;\n  var current;\n  var modBy;\n  var modDataCount;\n  var winCount;\n  var it = {\n    reset: function (s, e, sStep, sCount) {\n      current = s;\n      end = e;\n      modBy = sStep;\n      modDataCount = sCount;\n      winCount = Math.ceil(modDataCount / modBy);\n      it.next = modBy > 1 && modDataCount > 0 ? modNext : sequentialNext;\n    }\n  };\n  return it;\n  function sequentialNext() {\n    return current < end ? current++ : null;\n  }\n  function modNext() {\n    var dataIndex = current % winCount * modBy + Math.ceil(current / winCount);\n    var result = current >= end ? null : dataIndex < modDataCount ? dataIndex\n    // If modDataCount is smaller than data.count() (consider `appendData` case),\n    // Use normal linear rendering mode.\n    : current;\n    current++;\n    return result;\n  }\n}();\n// -----------------------------------------------------------------------------\n// For stream debug (Should be commented out after used!)\n// @usage: printTask(this, 'begin');\n// @usage: printTask(this, null, {someExtraProp});\n// @usage: Use `__idxInPipeline` as conditional breakpiont.\n//\n// window.printTask = function (task: any, prefix: string, extra: { [key: string]: unknown }): void {\n//     window.ecTaskUID == null && (window.ecTaskUID = 0);\n//     task.uidDebug == null && (task.uidDebug = `task_${window.ecTaskUID++}`);\n//     task.agent && task.agent.uidDebug == null && (task.agent.uidDebug = `task_${window.ecTaskUID++}`);\n//     let props = [];\n//     if (task.__pipeline) {\n//         let val = `${task.__idxInPipeline}/${task.__pipeline.tail.__idxInPipeline} ${task.agent ? '(stub)' : ''}`;\n//         props.push({text: '__idxInPipeline/total', value: val});\n//     } else {\n//         let stubCount = 0;\n//         task.agentStubMap.each(() => stubCount++);\n//         props.push({text: 'idx', value: `overall (stubs: ${stubCount})`});\n//     }\n//     props.push({text: 'uid', value: task.uidDebug});\n//     if (task.__pipeline) {\n//         props.push({text: 'pipelineId', value: task.__pipeline.id});\n//         task.agent && props.push(\n//             {text: 'stubFor', value: task.agent.uidDebug}\n//         );\n//     }\n//     props.push(\n//         {text: 'dirty', value: task._dirty},\n//         {text: 'dueIndex', value: task._dueIndex},\n//         {text: 'dueEnd', value: task._dueEnd},\n//         {text: 'outputDueEnd', value: task._outputDueEnd}\n//     );\n//     if (extra) {\n//         Object.keys(extra).forEach(key => {\n//             props.push({text: key, value: extra[key]});\n//         });\n//     }\n//     let args = ['color: blue'];\n//     let msg = `%c[${prefix || 'T'}] %c` + props.map(item => (\n//         args.push('color: green', 'color: red'),\n//         `${item.text}: %c${item.value}`\n//     )).join('%c, ');\n//     console.log.apply(console, [msg].concat(args));\n//     // console.log(this);\n// };\n// window.printPipeline = function (task: any, prefix: string) {\n//     const pipeline = task.__pipeline;\n//     let currTask = pipeline.head;\n//     while (currTask) {\n//         window.printTask(currTask, prefix);\n//         currTask = currTask._downstream;\n//     }\n// };\n// window.showChain = function (chainHeadTask) {\n//     var chain = [];\n//     var task = chainHeadTask;\n//     while (task) {\n//         chain.push({\n//             task: task,\n//             up: task._upstream,\n//             down: task._downstream,\n//             idxInPipeline: task.__idxInPipeline\n//         });\n//         task = task._downstream;\n//     }\n//     return chain;\n// };\n// window.findTaskInChain = function (task, chainHeadTask) {\n//     let chain = window.showChain(chainHeadTask);\n//     let result = [];\n//     for (let i = 0; i < chain.length; i++) {\n//         let chainItem = chain[i];\n//         if (chainItem.task === task) {\n//             result.push(i);\n//         }\n//     }\n//     return result;\n// };\n// window.printChainAEachInChainB = function (chainHeadTaskA, chainHeadTaskB) {\n//     let chainA = window.showChain(chainHeadTaskA);\n//     for (let i = 0; i < chainA.length; i++) {\n//         console.log('chainAIdx:', i, 'inChainB:', window.findTaskInChain(chainA[i].task, chainHeadTaskB));\n//     }\n// };", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { parseDate, numericToNumber } from '../../util/number.js';\nimport { createHashMap, trim, hasOwn, isString, isNumber } from 'zrender/lib/core/util.js';\nimport { throwError } from '../../util/log.js';\n/**\n * Convert raw the value in to inner value in List.\n *\n * [Performance sensitive]\n *\n * [Caution]: this is the key logic of user value parser.\n * For backward compatibility, do not modify it until you have to!\n */\nexport function parseDataValue(value,\n// For high performance, do not omit the second param.\nopt) {\n  // Performance sensitive.\n  var dimType = opt && opt.type;\n  if (dimType === 'ordinal') {\n    // If given value is a category string\n    return value;\n  }\n  if (dimType === 'time'\n  // spead up when using timestamp\n  && !isNumber(value) && value != null && value !== '-') {\n    value = +parseDate(value);\n  }\n  // dimType defaults 'number'.\n  // If dimType is not ordinal and value is null or undefined or NaN or '-',\n  // parse to NaN.\n  // number-like string (like ' 123 ') can be converted to a number.\n  // where null/undefined or other string will be converted to NaN.\n  return value == null || value === '' ? NaN\n  // If string (like '-'), using '+' parse to NaN\n  // If object, also parse to NaN\n  : Number(value);\n}\n;\nvar valueParserMap = createHashMap({\n  'number': function (val) {\n    // Do not use `numericToNumber` here. We have `numericToNumber` by default.\n    // Here the number parser can have loose rule:\n    // enable to cut suffix: \"120px\" => 120, \"14%\" => 14.\n    return parseFloat(val);\n  },\n  'time': function (val) {\n    // return timestamp.\n    return +parseDate(val);\n  },\n  'trim': function (val) {\n    return isString(val) ? trim(val) : val;\n  }\n});\nexport function getRawValueParser(type) {\n  return valueParserMap.get(type);\n}\nvar ORDER_COMPARISON_OP_MAP = {\n  lt: function (lval, rval) {\n    return lval < rval;\n  },\n  lte: function (lval, rval) {\n    return lval <= rval;\n  },\n  gt: function (lval, rval) {\n    return lval > rval;\n  },\n  gte: function (lval, rval) {\n    return lval >= rval;\n  }\n};\nvar FilterOrderComparator = /** @class */function () {\n  function FilterOrderComparator(op, rval) {\n    if (!isNumber(rval)) {\n      var errMsg = '';\n      if (process.env.NODE_ENV !== 'production') {\n        errMsg = 'rvalue of \"<\", \">\", \"<=\", \">=\" can only be number in filter.';\n      }\n      throwError(errMsg);\n    }\n    this._opFn = ORDER_COMPARISON_OP_MAP[op];\n    this._rvalFloat = numericToNumber(rval);\n  }\n  // Performance sensitive.\n  FilterOrderComparator.prototype.evaluate = function (lval) {\n    // Most cases is 'number', and typeof maybe 10 times faseter than parseFloat.\n    return isNumber(lval) ? this._opFn(lval, this._rvalFloat) : this._opFn(numericToNumber(lval), this._rvalFloat);\n  };\n  return FilterOrderComparator;\n}();\nvar SortOrderComparator = /** @class */function () {\n  /**\n   * @param order by default: 'asc'\n   * @param incomparable by default: Always on the tail.\n   *        That is, if 'asc' => 'max', if 'desc' => 'min'\n   *        See the definition of \"incomparable\" in [SORT_COMPARISON_RULE].\n   */\n  function SortOrderComparator(order, incomparable) {\n    var isDesc = order === 'desc';\n    this._resultLT = isDesc ? 1 : -1;\n    if (incomparable == null) {\n      incomparable = isDesc ? 'min' : 'max';\n    }\n    this._incomparable = incomparable === 'min' ? -Infinity : Infinity;\n  }\n  // See [SORT_COMPARISON_RULE].\n  // Performance sensitive.\n  SortOrderComparator.prototype.evaluate = function (lval, rval) {\n    // Most cases is 'number', and typeof maybe 10 times faseter than parseFloat.\n    var lvalFloat = isNumber(lval) ? lval : numericToNumber(lval);\n    var rvalFloat = isNumber(rval) ? rval : numericToNumber(rval);\n    var lvalNotNumeric = isNaN(lvalFloat);\n    var rvalNotNumeric = isNaN(rvalFloat);\n    if (lvalNotNumeric) {\n      lvalFloat = this._incomparable;\n    }\n    if (rvalNotNumeric) {\n      rvalFloat = this._incomparable;\n    }\n    if (lvalNotNumeric && rvalNotNumeric) {\n      var lvalIsStr = isString(lval);\n      var rvalIsStr = isString(rval);\n      if (lvalIsStr) {\n        lvalFloat = rvalIsStr ? lval : 0;\n      }\n      if (rvalIsStr) {\n        rvalFloat = lvalIsStr ? rval : 0;\n      }\n    }\n    return lvalFloat < rvalFloat ? this._resultLT : lvalFloat > rvalFloat ? -this._resultLT : 0;\n  };\n  return SortOrderComparator;\n}();\nexport { SortOrderComparator };\nvar FilterEqualityComparator = /** @class */function () {\n  function FilterEqualityComparator(isEq, rval) {\n    this._rval = rval;\n    this._isEQ = isEq;\n    this._rvalTypeof = typeof rval;\n    this._rvalFloat = numericToNumber(rval);\n  }\n  // Performance sensitive.\n  FilterEqualityComparator.prototype.evaluate = function (lval) {\n    var eqResult = lval === this._rval;\n    if (!eqResult) {\n      var lvalTypeof = typeof lval;\n      if (lvalTypeof !== this._rvalTypeof && (lvalTypeof === 'number' || this._rvalTypeof === 'number')) {\n        eqResult = numericToNumber(lval) === this._rvalFloat;\n      }\n    }\n    return this._isEQ ? eqResult : !eqResult;\n  };\n  return FilterEqualityComparator;\n}();\n/**\n * [FILTER_COMPARISON_RULE]\n * `lt`|`lte`|`gt`|`gte`:\n * + rval must be a number. And lval will be converted to number (`numericToNumber`) to compare.\n * `eq`:\n * + If same type, compare with `===`.\n * + If there is one number, convert to number (`numericToNumber`) to compare.\n * + Else return `false`.\n * `ne`:\n * + Not `eq`.\n *\n *\n * [SORT_COMPARISON_RULE]\n * All the values are grouped into three categories:\n * + \"numeric\" (number and numeric string)\n * + \"non-numeric-string\" (string that excluding numeric string)\n * + \"others\"\n * \"numeric\" vs \"numeric\": values are ordered by number order.\n * \"non-numeric-string\" vs \"non-numeric-string\": values are ordered by ES spec (#sec-abstract-relational-comparison).\n * \"others\" vs \"others\": do not change order (always return 0).\n * \"numeric\" vs \"non-numeric-string\": \"non-numeric-string\" is treated as \"incomparable\".\n * \"number\" vs \"others\": \"others\" is treated as \"incomparable\".\n * \"non-numeric-string\" vs \"others\": \"others\" is treated as \"incomparable\".\n * \"incomparable\" will be seen as -Infinity or Infinity (depends on the settings).\n * MEMO:\n *   Non-numeric string sort makes sense when we need to put the items with the same tag together.\n *   But if we support string sort, we still need to avoid the misleading like `'2' > '12'`,\n *   So we treat \"numeric-string\" sorted by number order rather than string comparison.\n *\n *\n * [CHECK_LIST_OF_THE_RULE_DESIGN]\n * + Do not support string comparison until required. And also need to\n *   avoid the misleading of \"2\" > \"12\".\n * + Should avoid the misleading case:\n *   `\" 22 \" gte \"22\"` is `true` but `\" 22 \" eq \"22\"` is `false`.\n * + JS bad case should be avoided: null <= 0, [] <= 0, ' ' <= 0, ...\n * + Only \"numeric\" can be converted to comparable number, otherwise converted to NaN.\n *   See `util/number.ts#numericToNumber`.\n *\n * @return If `op` is not `RelationalOperator`, return null;\n */\nexport function createFilterComparator(op, rval) {\n  return op === 'eq' || op === 'ne' ? new FilterEqualityComparator(op === 'eq', rval) : hasOwn(ORDER_COMPARISON_OP_MAP, op) ? new FilterOrderComparator(op, rval) : null;\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { SERIES_LAYOUT_BY_COLUMN, SOURCE_FORMAT_OBJECT_ROWS, SOURCE_FORMAT_ARRAY_ROWS } from '../../util/types.js';\nimport { normalizeToArray } from '../../util/model.js';\nimport { createHashMap, bind, each, hasOwn, map, clone, isObject, extend, isNumber } from 'zrender/lib/core/util.js';\nimport { getRawSourceItemGetter, getRawSourceDataCounter, getRawSourceValueGetter } from './dataProvider.js';\nimport { parseDataValue } from './dataValueHelper.js';\nimport { log, makePrintable, throwError } from '../../util/log.js';\nimport { createSource, detectSourceFormat } from '../Source.js';\n/**\n * TODO: disable writable.\n * This structure will be exposed to users.\n */\nvar ExternalSource = /** @class */function () {\n  function ExternalSource() {}\n  ExternalSource.prototype.getRawData = function () {\n    // Only built-in transform available.\n    throw new Error('not supported');\n  };\n  ExternalSource.prototype.getRawDataItem = function (dataIndex) {\n    // Only built-in transform available.\n    throw new Error('not supported');\n  };\n  ExternalSource.prototype.cloneRawData = function () {\n    return;\n  };\n  /**\n   * @return If dimension not found, return null/undefined.\n   */\n  ExternalSource.prototype.getDimensionInfo = function (dim) {\n    return;\n  };\n  /**\n   * dimensions defined if and only if either:\n   * (a) dataset.dimensions are declared.\n   * (b) dataset data include dimensions definitions in data (detected or via specified `sourceHeader`).\n   * If dimensions are defined, `dimensionInfoAll` is corresponding to\n   * the defined dimensions.\n   * Otherwise, `dimensionInfoAll` is determined by data columns.\n   * @return Always return an array (even empty array).\n   */\n  ExternalSource.prototype.cloneAllDimensionInfo = function () {\n    return;\n  };\n  ExternalSource.prototype.count = function () {\n    return;\n  };\n  /**\n   * Only support by dimension index.\n   * No need to support by dimension name in transform function,\n   * because transform function is not case-specific, no need to use name literally.\n   */\n  ExternalSource.prototype.retrieveValue = function (dataIndex, dimIndex) {\n    return;\n  };\n  ExternalSource.prototype.retrieveValueFromItem = function (dataItem, dimIndex) {\n    return;\n  };\n  ExternalSource.prototype.convertValue = function (rawVal, dimInfo) {\n    return parseDataValue(rawVal, dimInfo);\n  };\n  return ExternalSource;\n}();\nexport { ExternalSource };\nfunction createExternalSource(internalSource, externalTransform) {\n  var extSource = new ExternalSource();\n  var data = internalSource.data;\n  var sourceFormat = extSource.sourceFormat = internalSource.sourceFormat;\n  var sourceHeaderCount = internalSource.startIndex;\n  var errMsg = '';\n  if (internalSource.seriesLayoutBy !== SERIES_LAYOUT_BY_COLUMN) {\n    // For the logic simplicity in transformer, only 'culumn' is\n    // supported in data transform. Otherwise, the `dimensionsDefine`\n    // might be detected by 'row', which probably confuses users.\n    if (process.env.NODE_ENV !== 'production') {\n      errMsg = '`seriesLayoutBy` of upstream dataset can only be \"column\" in data transform.';\n    }\n    throwError(errMsg);\n  }\n  // [MEMO]\n  // Create a new dimensions structure for exposing.\n  // Do not expose all dimension info to users directly.\n  // Because the dimension is probably auto detected from data and not might reliable.\n  // Should not lead the transformers to think that is reliable and return it.\n  // See [DIMENSION_INHERIT_RULE] in `sourceManager.ts`.\n  var dimensions = [];\n  var dimsByName = {};\n  var dimsDef = internalSource.dimensionsDefine;\n  if (dimsDef) {\n    each(dimsDef, function (dimDef, idx) {\n      var name = dimDef.name;\n      var dimDefExt = {\n        index: idx,\n        name: name,\n        displayName: dimDef.displayName\n      };\n      dimensions.push(dimDefExt);\n      // Users probably do not specify dimension name. For simplicity, data transform\n      // does not generate dimension name.\n      if (name != null) {\n        // Dimension name should not be duplicated.\n        // For simplicity, data transform forbids name duplication, do not generate\n        // new name like module `completeDimensions.ts` did, but just tell users.\n        var errMsg_1 = '';\n        if (hasOwn(dimsByName, name)) {\n          if (process.env.NODE_ENV !== 'production') {\n            errMsg_1 = 'dimension name \"' + name + '\" duplicated.';\n          }\n          throwError(errMsg_1);\n        }\n        dimsByName[name] = dimDefExt;\n      }\n    });\n  }\n  // If dimension definitions are not defined and can not be detected.\n  // e.g., pure data `[[11, 22], ...]`.\n  else {\n    for (var i = 0; i < internalSource.dimensionsDetectedCount || 0; i++) {\n      // Do not generete name or anything others. The consequence process in\n      // `transform` or `series` probably have there own name generation strategry.\n      dimensions.push({\n        index: i\n      });\n    }\n  }\n  // Implement public methods:\n  var rawItemGetter = getRawSourceItemGetter(sourceFormat, SERIES_LAYOUT_BY_COLUMN);\n  if (externalTransform.__isBuiltIn) {\n    extSource.getRawDataItem = function (dataIndex) {\n      return rawItemGetter(data, sourceHeaderCount, dimensions, dataIndex);\n    };\n    extSource.getRawData = bind(getRawData, null, internalSource);\n  }\n  extSource.cloneRawData = bind(cloneRawData, null, internalSource);\n  var rawCounter = getRawSourceDataCounter(sourceFormat, SERIES_LAYOUT_BY_COLUMN);\n  extSource.count = bind(rawCounter, null, data, sourceHeaderCount, dimensions);\n  var rawValueGetter = getRawSourceValueGetter(sourceFormat);\n  extSource.retrieveValue = function (dataIndex, dimIndex) {\n    var rawItem = rawItemGetter(data, sourceHeaderCount, dimensions, dataIndex);\n    return retrieveValueFromItem(rawItem, dimIndex);\n  };\n  var retrieveValueFromItem = extSource.retrieveValueFromItem = function (dataItem, dimIndex) {\n    if (dataItem == null) {\n      return;\n    }\n    var dimDef = dimensions[dimIndex];\n    // When `dimIndex` is `null`, `rawValueGetter` return the whole item.\n    if (dimDef) {\n      return rawValueGetter(dataItem, dimIndex, dimDef.name);\n    }\n  };\n  extSource.getDimensionInfo = bind(getDimensionInfo, null, dimensions, dimsByName);\n  extSource.cloneAllDimensionInfo = bind(cloneAllDimensionInfo, null, dimensions);\n  return extSource;\n}\nfunction getRawData(upstream) {\n  var sourceFormat = upstream.sourceFormat;\n  if (!isSupportedSourceFormat(sourceFormat)) {\n    var errMsg = '';\n    if (process.env.NODE_ENV !== 'production') {\n      errMsg = '`getRawData` is not supported in source format ' + sourceFormat;\n    }\n    throwError(errMsg);\n  }\n  return upstream.data;\n}\nfunction cloneRawData(upstream) {\n  var sourceFormat = upstream.sourceFormat;\n  var data = upstream.data;\n  if (!isSupportedSourceFormat(sourceFormat)) {\n    var errMsg = '';\n    if (process.env.NODE_ENV !== 'production') {\n      errMsg = '`cloneRawData` is not supported in source format ' + sourceFormat;\n    }\n    throwError(errMsg);\n  }\n  if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS) {\n    var result = [];\n    for (var i = 0, len = data.length; i < len; i++) {\n      // Not strictly clone for performance\n      result.push(data[i].slice());\n    }\n    return result;\n  } else if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS) {\n    var result = [];\n    for (var i = 0, len = data.length; i < len; i++) {\n      // Not strictly clone for performance\n      result.push(extend({}, data[i]));\n    }\n    return result;\n  }\n}\nfunction getDimensionInfo(dimensions, dimsByName, dim) {\n  if (dim == null) {\n    return;\n  }\n  // Keep the same logic as `List::getDimension` did.\n  if (isNumber(dim)\n  // If being a number-like string but not being defined a dimension name.\n  || !isNaN(dim) && !hasOwn(dimsByName, dim)) {\n    return dimensions[dim];\n  } else if (hasOwn(dimsByName, dim)) {\n    return dimsByName[dim];\n  }\n}\nfunction cloneAllDimensionInfo(dimensions) {\n  return clone(dimensions);\n}\nvar externalTransformMap = createHashMap();\nexport function registerExternalTransform(externalTransform) {\n  externalTransform = clone(externalTransform);\n  var type = externalTransform.type;\n  var errMsg = '';\n  if (!type) {\n    if (process.env.NODE_ENV !== 'production') {\n      errMsg = 'Must have a `type` when `registerTransform`.';\n    }\n    throwError(errMsg);\n  }\n  var typeParsed = type.split(':');\n  if (typeParsed.length !== 2) {\n    if (process.env.NODE_ENV !== 'production') {\n      errMsg = 'Name must include namespace like \"ns:regression\".';\n    }\n    throwError(errMsg);\n  }\n  // Namespace 'echarts:xxx' is official namespace, where the transforms should\n  // be called directly via 'xxx' rather than 'echarts:xxx'.\n  var isBuiltIn = false;\n  if (typeParsed[0] === 'echarts') {\n    type = typeParsed[1];\n    isBuiltIn = true;\n  }\n  externalTransform.__isBuiltIn = isBuiltIn;\n  externalTransformMap.set(type, externalTransform);\n}\nexport function applyDataTransform(rawTransOption, sourceList, infoForPrint) {\n  var pipedTransOption = normalizeToArray(rawTransOption);\n  var pipeLen = pipedTransOption.length;\n  var errMsg = '';\n  if (!pipeLen) {\n    if (process.env.NODE_ENV !== 'production') {\n      errMsg = 'If `transform` declared, it should at least contain one transform.';\n    }\n    throwError(errMsg);\n  }\n  for (var i = 0, len = pipeLen; i < len; i++) {\n    var transOption = pipedTransOption[i];\n    sourceList = applySingleDataTransform(transOption, sourceList, infoForPrint, pipeLen === 1 ? null : i);\n    // piped transform only support single input, except the fist one.\n    // piped transform only support single output, except the last one.\n    if (i !== len - 1) {\n      sourceList.length = Math.max(sourceList.length, 1);\n    }\n  }\n  return sourceList;\n}\nfunction applySingleDataTransform(transOption, upSourceList, infoForPrint,\n// If `pipeIndex` is null/undefined, no piped transform.\npipeIndex) {\n  var errMsg = '';\n  if (!upSourceList.length) {\n    if (process.env.NODE_ENV !== 'production') {\n      errMsg = 'Must have at least one upstream dataset.';\n    }\n    throwError(errMsg);\n  }\n  if (!isObject(transOption)) {\n    if (process.env.NODE_ENV !== 'production') {\n      errMsg = 'transform declaration must be an object rather than ' + typeof transOption + '.';\n    }\n    throwError(errMsg);\n  }\n  var transType = transOption.type;\n  var externalTransform = externalTransformMap.get(transType);\n  if (!externalTransform) {\n    if (process.env.NODE_ENV !== 'production') {\n      errMsg = 'Can not find transform on type \"' + transType + '\".';\n    }\n    throwError(errMsg);\n  }\n  // Prepare source\n  var extUpSourceList = map(upSourceList, function (upSource) {\n    return createExternalSource(upSource, externalTransform);\n  });\n  var resultList = normalizeToArray(externalTransform.transform({\n    upstream: extUpSourceList[0],\n    upstreamList: extUpSourceList,\n    config: clone(transOption.config)\n  }));\n  if (process.env.NODE_ENV !== 'production') {\n    if (transOption.print) {\n      var printStrArr = map(resultList, function (extSource) {\n        var pipeIndexStr = pipeIndex != null ? ' === pipe index: ' + pipeIndex : '';\n        return ['=== dataset index: ' + infoForPrint.datasetIndex + pipeIndexStr + ' ===', '- transform result data:', makePrintable(extSource.data), '- transform result dimensions:', makePrintable(extSource.dimensions)].join('\\n');\n      }).join('\\n');\n      log(printStrArr);\n    }\n  }\n  return map(resultList, function (result, resultIndex) {\n    var errMsg = '';\n    if (!isObject(result)) {\n      if (process.env.NODE_ENV !== 'production') {\n        errMsg = 'A transform should not return some empty results.';\n      }\n      throwError(errMsg);\n    }\n    if (!result.data) {\n      if (process.env.NODE_ENV !== 'production') {\n        errMsg = 'Transform result data should be not be null or undefined';\n      }\n      throwError(errMsg);\n    }\n    var sourceFormat = detectSourceFormat(result.data);\n    if (!isSupportedSourceFormat(sourceFormat)) {\n      if (process.env.NODE_ENV !== 'production') {\n        errMsg = 'Transform result data should be array rows or object rows.';\n      }\n      throwError(errMsg);\n    }\n    var resultMetaRawOption;\n    var firstUpSource = upSourceList[0];\n    /**\n     * Intuitively, the end users known the content of the original `dataset.source`,\n     * calucating the transform result in mind.\n     * Suppose the original `dataset.source` is:\n     * ```js\n     * [\n     *     ['product', '2012', '2013', '2014', '2015'],\n     *     ['AAA', 41.1, 30.4, 65.1, 53.3],\n     *     ['BBB', 86.5, 92.1, 85.7, 83.1],\n     *     ['CCC', 24.1, 67.2, 79.5, 86.4]\n     * ]\n     * ```\n     * The dimension info have to be detected from the source data.\n     * Some of the transformers (like filter, sort) will follow the dimension info\n     * of upstream, while others use new dimensions (like aggregate).\n     * Transformer can output a field `dimensions` to define the its own output dimensions.\n     * We also allow transformers to ignore the output `dimensions` field, and\n     * inherit the upstream dimensions definition. It can reduce the burden of handling\n     * dimensions in transformers.\n     *\n     * See also [DIMENSION_INHERIT_RULE] in `sourceManager.ts`.\n     */\n    if (firstUpSource && resultIndex === 0\n    // If transformer returns `dimensions`, it means that the transformer has different\n    // dimensions definitions. We do not inherit anything from upstream.\n    && !result.dimensions) {\n      var startIndex = firstUpSource.startIndex;\n      // We copy the header of upstream to the result, because:\n      // (1) The returned data always does not contain header line and can not be used\n      // as dimension-detection. In this case we can not use \"detected dimensions\" of\n      // upstream directly, because it might be detected based on different `seriesLayoutBy`.\n      // (2) We should support that the series read the upstream source in `seriesLayoutBy: 'row'`.\n      // So the original detected header should be add to the result, otherwise they can not be read.\n      if (startIndex) {\n        result.data = firstUpSource.data.slice(0, startIndex).concat(result.data);\n      }\n      resultMetaRawOption = {\n        seriesLayoutBy: SERIES_LAYOUT_BY_COLUMN,\n        sourceHeader: startIndex,\n        dimensions: firstUpSource.metaRawOption.dimensions\n      };\n    } else {\n      resultMetaRawOption = {\n        seriesLayoutBy: SERIES_LAYOUT_BY_COLUMN,\n        sourceHeader: 0,\n        dimensions: result.dimensions\n      };\n    }\n    return createSource(result.data, resultMetaRawOption, null);\n  });\n}\nfunction isSupportedSourceFormat(sourceFormat) {\n  return sourceFormat === SOURCE_FORMAT_ARRAY_ROWS || sourceFormat === SOURCE_FORMAT_OBJECT_ROWS;\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { assert, clone, createHashMap, isFunction, keys, map, reduce } from 'zrender/lib/core/util.js';\nimport { parseDataValue } from './helper/dataValueHelper.js';\nimport { shouldRetrieveDataByName } from './Source.js';\nvar UNDEFINED = 'undefined';\n/* global Float64Array, Int32Array, Uint32Array, Uint16Array */\n// Caution: MUST not use `new CtorUint32Array(arr, 0, len)`, because the Ctor of array is\n// different from the Ctor of typed array.\nexport var CtorUint32Array = typeof Uint32Array === UNDEFINED ? Array : Uint32Array;\nexport var CtorUint16Array = typeof Uint16Array === UNDEFINED ? Array : Uint16Array;\nexport var CtorInt32Array = typeof Int32Array === UNDEFINED ? Array : Int32Array;\nexport var CtorFloat64Array = typeof Float64Array === UNDEFINED ? Array : Float64Array;\n/**\n * Multi dimensional data store\n */\nvar dataCtors = {\n  'float': CtorFloat64Array,\n  'int': CtorInt32Array,\n  // Ordinal data type can be string or int\n  'ordinal': Array,\n  'number': Array,\n  'time': CtorFloat64Array\n};\nvar defaultDimValueGetters;\nfunction getIndicesCtor(rawCount) {\n  // The possible max value in this._indicies is always this._rawCount despite of filtering.\n  return rawCount > 65535 ? CtorUint32Array : CtorUint16Array;\n}\n;\nfunction getInitialExtent() {\n  return [Infinity, -Infinity];\n}\n;\nfunction cloneChunk(originalChunk) {\n  var Ctor = originalChunk.constructor;\n  // Only shallow clone is enough when Array.\n  return Ctor === Array ? originalChunk.slice() : new Ctor(originalChunk);\n}\nfunction prepareStore(store, dimIdx, dimType, end, append) {\n  var DataCtor = dataCtors[dimType || 'float'];\n  if (append) {\n    var oldStore = store[dimIdx];\n    var oldLen = oldStore && oldStore.length;\n    if (!(oldLen === end)) {\n      var newStore = new DataCtor(end);\n      // The cost of the copy is probably inconsiderable\n      // within the initial chunkSize.\n      for (var j = 0; j < oldLen; j++) {\n        newStore[j] = oldStore[j];\n      }\n      store[dimIdx] = newStore;\n    }\n  } else {\n    store[dimIdx] = new DataCtor(end);\n  }\n}\n;\n/**\n * Basically, DataStore API keep immutable.\n */\nvar DataStore = /** @class */function () {\n  function DataStore() {\n    this._chunks = [];\n    // It will not be calculated until needed.\n    this._rawExtent = [];\n    this._extent = [];\n    this._count = 0;\n    this._rawCount = 0;\n    this._calcDimNameToIdx = createHashMap();\n  }\n  /**\n   * Initialize from data\n   */\n  DataStore.prototype.initData = function (provider, inputDimensions, dimValueGetter) {\n    if (process.env.NODE_ENV !== 'production') {\n      assert(isFunction(provider.getItem) && isFunction(provider.count), 'Invalid data provider.');\n    }\n    this._provider = provider;\n    // Clear\n    this._chunks = [];\n    this._indices = null;\n    this.getRawIndex = this._getRawIdxIdentity;\n    var source = provider.getSource();\n    var defaultGetter = this.defaultDimValueGetter = defaultDimValueGetters[source.sourceFormat];\n    // Default dim value getter\n    this._dimValueGetter = dimValueGetter || defaultGetter;\n    // Reset raw extent.\n    this._rawExtent = [];\n    var willRetrieveDataByName = shouldRetrieveDataByName(source);\n    this._dimensions = map(inputDimensions, function (dim) {\n      if (process.env.NODE_ENV !== 'production') {\n        if (willRetrieveDataByName) {\n          assert(dim.property != null);\n        }\n      }\n      return {\n        // Only pick these two props. Not leak other properties like orderMeta.\n        type: dim.type,\n        property: dim.property\n      };\n    });\n    this._initDataFromProvider(0, provider.count());\n  };\n  DataStore.prototype.getProvider = function () {\n    return this._provider;\n  };\n  /**\n   * Caution: even when a `source` instance owned by a series, the created data store\n   * may still be shared by different sereis (the source hash does not use all `source`\n   * props, see `sourceManager`). In this case, the `source` props that are not used in\n   * hash (like `source.dimensionDefine`) probably only belongs to a certain series and\n   * thus should not be fetch here.\n   */\n  DataStore.prototype.getSource = function () {\n    return this._provider.getSource();\n  };\n  /**\n   * @caution Only used in dataStack.\n   */\n  DataStore.prototype.ensureCalculationDimension = function (dimName, type) {\n    var calcDimNameToIdx = this._calcDimNameToIdx;\n    var dimensions = this._dimensions;\n    var calcDimIdx = calcDimNameToIdx.get(dimName);\n    if (calcDimIdx != null) {\n      if (dimensions[calcDimIdx].type === type) {\n        return calcDimIdx;\n      }\n    } else {\n      calcDimIdx = dimensions.length;\n    }\n    dimensions[calcDimIdx] = {\n      type: type\n    };\n    calcDimNameToIdx.set(dimName, calcDimIdx);\n    this._chunks[calcDimIdx] = new dataCtors[type || 'float'](this._rawCount);\n    this._rawExtent[calcDimIdx] = getInitialExtent();\n    return calcDimIdx;\n  };\n  DataStore.prototype.collectOrdinalMeta = function (dimIdx, ordinalMeta) {\n    var chunk = this._chunks[dimIdx];\n    var dim = this._dimensions[dimIdx];\n    var rawExtents = this._rawExtent;\n    var offset = dim.ordinalOffset || 0;\n    var len = chunk.length;\n    if (offset === 0) {\n      // We need to reset the rawExtent if collect is from start.\n      // Because this dimension may be guessed as number and calcuating a wrong extent.\n      rawExtents[dimIdx] = getInitialExtent();\n    }\n    var dimRawExtent = rawExtents[dimIdx];\n    // Parse from previous data offset. len may be changed after appendData\n    for (var i = offset; i < len; i++) {\n      var val = chunk[i] = ordinalMeta.parseAndCollect(chunk[i]);\n      if (!isNaN(val)) {\n        dimRawExtent[0] = Math.min(val, dimRawExtent[0]);\n        dimRawExtent[1] = Math.max(val, dimRawExtent[1]);\n      }\n    }\n    dim.ordinalMeta = ordinalMeta;\n    dim.ordinalOffset = len;\n    dim.type = 'ordinal'; // Force to be ordinal\n  };\n  DataStore.prototype.getOrdinalMeta = function (dimIdx) {\n    var dimInfo = this._dimensions[dimIdx];\n    var ordinalMeta = dimInfo.ordinalMeta;\n    return ordinalMeta;\n  };\n  DataStore.prototype.getDimensionProperty = function (dimIndex) {\n    var item = this._dimensions[dimIndex];\n    return item && item.property;\n  };\n  /**\n   * Caution: Can be only called on raw data (before `this._indices` created).\n   */\n  DataStore.prototype.appendData = function (data) {\n    if (process.env.NODE_ENV !== 'production') {\n      assert(!this._indices, 'appendData can only be called on raw data.');\n    }\n    var provider = this._provider;\n    var start = this.count();\n    provider.appendData(data);\n    var end = provider.count();\n    if (!provider.persistent) {\n      end += start;\n    }\n    if (start < end) {\n      this._initDataFromProvider(start, end, true);\n    }\n    return [start, end];\n  };\n  DataStore.prototype.appendValues = function (values, minFillLen) {\n    var chunks = this._chunks;\n    var dimensions = this._dimensions;\n    var dimLen = dimensions.length;\n    var rawExtent = this._rawExtent;\n    var start = this.count();\n    var end = start + Math.max(values.length, minFillLen || 0);\n    for (var i = 0; i < dimLen; i++) {\n      var dim = dimensions[i];\n      prepareStore(chunks, i, dim.type, end, true);\n    }\n    var emptyDataItem = [];\n    for (var idx = start; idx < end; idx++) {\n      var sourceIdx = idx - start;\n      // Store the data by dimensions\n      for (var dimIdx = 0; dimIdx < dimLen; dimIdx++) {\n        var dim = dimensions[dimIdx];\n        var val = defaultDimValueGetters.arrayRows.call(this, values[sourceIdx] || emptyDataItem, dim.property, sourceIdx, dimIdx);\n        chunks[dimIdx][idx] = val;\n        var dimRawExtent = rawExtent[dimIdx];\n        val < dimRawExtent[0] && (dimRawExtent[0] = val);\n        val > dimRawExtent[1] && (dimRawExtent[1] = val);\n      }\n    }\n    this._rawCount = this._count = end;\n    return {\n      start: start,\n      end: end\n    };\n  };\n  DataStore.prototype._initDataFromProvider = function (start, end, append) {\n    var provider = this._provider;\n    var chunks = this._chunks;\n    var dimensions = this._dimensions;\n    var dimLen = dimensions.length;\n    var rawExtent = this._rawExtent;\n    var dimNames = map(dimensions, function (dim) {\n      return dim.property;\n    });\n    for (var i = 0; i < dimLen; i++) {\n      var dim = dimensions[i];\n      if (!rawExtent[i]) {\n        rawExtent[i] = getInitialExtent();\n      }\n      prepareStore(chunks, i, dim.type, end, append);\n    }\n    if (provider.fillStorage) {\n      provider.fillStorage(start, end, chunks, rawExtent);\n    } else {\n      var dataItem = [];\n      for (var idx = start; idx < end; idx++) {\n        // NOTICE: Try not to write things into dataItem\n        dataItem = provider.getItem(idx, dataItem);\n        // Each data item is value\n        // [1, 2]\n        // 2\n        // Bar chart, line chart which uses category axis\n        // only gives the 'y' value. 'x' value is the indices of category\n        // Use a tempValue to normalize the value to be a (x, y) value\n        // Store the data by dimensions\n        for (var dimIdx = 0; dimIdx < dimLen; dimIdx++) {\n          var dimStorage = chunks[dimIdx];\n          // PENDING NULL is empty or zero\n          var val = this._dimValueGetter(dataItem, dimNames[dimIdx], idx, dimIdx);\n          dimStorage[idx] = val;\n          var dimRawExtent = rawExtent[dimIdx];\n          val < dimRawExtent[0] && (dimRawExtent[0] = val);\n          val > dimRawExtent[1] && (dimRawExtent[1] = val);\n        }\n      }\n    }\n    if (!provider.persistent && provider.clean) {\n      // Clean unused data if data source is typed array.\n      provider.clean();\n    }\n    this._rawCount = this._count = end;\n    // Reset data extent\n    this._extent = [];\n  };\n  DataStore.prototype.count = function () {\n    return this._count;\n  };\n  /**\n   * Get value. Return NaN if idx is out of range.\n   */\n  DataStore.prototype.get = function (dim, idx) {\n    if (!(idx >= 0 && idx < this._count)) {\n      return NaN;\n    }\n    var dimStore = this._chunks[dim];\n    return dimStore ? dimStore[this.getRawIndex(idx)] : NaN;\n  };\n  DataStore.prototype.getValues = function (dimensions, idx) {\n    var values = [];\n    var dimArr = [];\n    if (idx == null) {\n      idx = dimensions;\n      // TODO get all from store?\n      dimensions = [];\n      // All dimensions\n      for (var i = 0; i < this._dimensions.length; i++) {\n        dimArr.push(i);\n      }\n    } else {\n      dimArr = dimensions;\n    }\n    for (var i = 0, len = dimArr.length; i < len; i++) {\n      values.push(this.get(dimArr[i], idx));\n    }\n    return values;\n  };\n  /**\n   * @param dim concrete dim\n   */\n  DataStore.prototype.getByRawIndex = function (dim, rawIdx) {\n    if (!(rawIdx >= 0 && rawIdx < this._rawCount)) {\n      return NaN;\n    }\n    var dimStore = this._chunks[dim];\n    return dimStore ? dimStore[rawIdx] : NaN;\n  };\n  /**\n   * Get sum of data in one dimension\n   */\n  DataStore.prototype.getSum = function (dim) {\n    var dimData = this._chunks[dim];\n    var sum = 0;\n    if (dimData) {\n      for (var i = 0, len = this.count(); i < len; i++) {\n        var value = this.get(dim, i);\n        if (!isNaN(value)) {\n          sum += value;\n        }\n      }\n    }\n    return sum;\n  };\n  /**\n   * Get median of data in one dimension\n   */\n  DataStore.prototype.getMedian = function (dim) {\n    var dimDataArray = [];\n    // map all data of one dimension\n    this.each([dim], function (val) {\n      if (!isNaN(val)) {\n        dimDataArray.push(val);\n      }\n    });\n    // TODO\n    // Use quick select?\n    var sortedDimDataArray = dimDataArray.sort(function (a, b) {\n      return a - b;\n    });\n    var len = this.count();\n    // calculate median\n    return len === 0 ? 0 : len % 2 === 1 ? sortedDimDataArray[(len - 1) / 2] : (sortedDimDataArray[len / 2] + sortedDimDataArray[len / 2 - 1]) / 2;\n  };\n  /**\n   * Retrieve the index with given raw data index.\n   */\n  DataStore.prototype.indexOfRawIndex = function (rawIndex) {\n    if (rawIndex >= this._rawCount || rawIndex < 0) {\n      return -1;\n    }\n    if (!this._indices) {\n      return rawIndex;\n    }\n    // Indices are ascending\n    var indices = this._indices;\n    // If rawIndex === dataIndex\n    var rawDataIndex = indices[rawIndex];\n    if (rawDataIndex != null && rawDataIndex < this._count && rawDataIndex === rawIndex) {\n      return rawIndex;\n    }\n    var left = 0;\n    var right = this._count - 1;\n    while (left <= right) {\n      var mid = (left + right) / 2 | 0;\n      if (indices[mid] < rawIndex) {\n        left = mid + 1;\n      } else if (indices[mid] > rawIndex) {\n        right = mid - 1;\n      } else {\n        return mid;\n      }\n    }\n    return -1;\n  };\n  DataStore.prototype.getIndices = function () {\n    var newIndices;\n    var indices = this._indices;\n    if (indices) {\n      var Ctor = indices.constructor;\n      var thisCount = this._count;\n      // `new Array(a, b, c)` is different from `new Uint32Array(a, b, c)`.\n      if (Ctor === Array) {\n        newIndices = new Ctor(thisCount);\n        for (var i = 0; i < thisCount; i++) {\n          newIndices[i] = indices[i];\n        }\n      } else {\n        newIndices = new Ctor(indices.buffer, 0, thisCount);\n      }\n    } else {\n      var Ctor = getIndicesCtor(this._rawCount);\n      newIndices = new Ctor(this.count());\n      for (var i = 0; i < newIndices.length; i++) {\n        newIndices[i] = i;\n      }\n    }\n    return newIndices;\n  };\n  /**\n   * Data filter.\n   */\n  DataStore.prototype.filter = function (dims, cb) {\n    if (!this._count) {\n      return this;\n    }\n    var newStore = this.clone();\n    var count = newStore.count();\n    var Ctor = getIndicesCtor(newStore._rawCount);\n    var newIndices = new Ctor(count);\n    var value = [];\n    var dimSize = dims.length;\n    var offset = 0;\n    var dim0 = dims[0];\n    var chunks = newStore._chunks;\n    for (var i = 0; i < count; i++) {\n      var keep = void 0;\n      var rawIdx = newStore.getRawIndex(i);\n      // Simple optimization\n      if (dimSize === 0) {\n        keep = cb(i);\n      } else if (dimSize === 1) {\n        var val = chunks[dim0][rawIdx];\n        keep = cb(val, i);\n      } else {\n        var k = 0;\n        for (; k < dimSize; k++) {\n          value[k] = chunks[dims[k]][rawIdx];\n        }\n        value[k] = i;\n        keep = cb.apply(null, value);\n      }\n      if (keep) {\n        newIndices[offset++] = rawIdx;\n      }\n    }\n    // Set indices after filtered.\n    if (offset < count) {\n      newStore._indices = newIndices;\n    }\n    newStore._count = offset;\n    // Reset data extent\n    newStore._extent = [];\n    newStore._updateGetRawIdx();\n    return newStore;\n  };\n  /**\n   * Select data in range. (For optimization of filter)\n   * (Manually inline code, support 5 million data filtering in data zoom.)\n   */\n  DataStore.prototype.selectRange = function (range) {\n    var newStore = this.clone();\n    var len = newStore._count;\n    if (!len) {\n      return this;\n    }\n    var dims = keys(range);\n    var dimSize = dims.length;\n    if (!dimSize) {\n      return this;\n    }\n    var originalCount = newStore.count();\n    var Ctor = getIndicesCtor(newStore._rawCount);\n    var newIndices = new Ctor(originalCount);\n    var offset = 0;\n    var dim0 = dims[0];\n    var min = range[dim0][0];\n    var max = range[dim0][1];\n    var storeArr = newStore._chunks;\n    var quickFinished = false;\n    if (!newStore._indices) {\n      // Extreme optimization for common case. About 2x faster in chrome.\n      var idx = 0;\n      if (dimSize === 1) {\n        var dimStorage = storeArr[dims[0]];\n        for (var i = 0; i < len; i++) {\n          var val = dimStorage[i];\n          // NaN will not be filtered. Consider the case, in line chart, empty\n          // value indicates the line should be broken. But for the case like\n          // scatter plot, a data item with empty value will not be rendered,\n          // but the axis extent may be effected if some other dim of the data\n          // item has value. Fortunately it is not a significant negative effect.\n          if (val >= min && val <= max || isNaN(val)) {\n            newIndices[offset++] = idx;\n          }\n          idx++;\n        }\n        quickFinished = true;\n      } else if (dimSize === 2) {\n        var dimStorage = storeArr[dims[0]];\n        var dimStorage2 = storeArr[dims[1]];\n        var min2 = range[dims[1]][0];\n        var max2 = range[dims[1]][1];\n        for (var i = 0; i < len; i++) {\n          var val = dimStorage[i];\n          var val2 = dimStorage2[i];\n          // Do not filter NaN, see comment above.\n          if ((val >= min && val <= max || isNaN(val)) && (val2 >= min2 && val2 <= max2 || isNaN(val2))) {\n            newIndices[offset++] = idx;\n          }\n          idx++;\n        }\n        quickFinished = true;\n      }\n    }\n    if (!quickFinished) {\n      if (dimSize === 1) {\n        for (var i = 0; i < originalCount; i++) {\n          var rawIndex = newStore.getRawIndex(i);\n          var val = storeArr[dims[0]][rawIndex];\n          // Do not filter NaN, see comment above.\n          if (val >= min && val <= max || isNaN(val)) {\n            newIndices[offset++] = rawIndex;\n          }\n        }\n      } else {\n        for (var i = 0; i < originalCount; i++) {\n          var keep = true;\n          var rawIndex = newStore.getRawIndex(i);\n          for (var k = 0; k < dimSize; k++) {\n            var dimk = dims[k];\n            var val = storeArr[dimk][rawIndex];\n            // Do not filter NaN, see comment above.\n            if (val < range[dimk][0] || val > range[dimk][1]) {\n              keep = false;\n            }\n          }\n          if (keep) {\n            newIndices[offset++] = newStore.getRawIndex(i);\n          }\n        }\n      }\n    }\n    // Set indices after filtered.\n    if (offset < originalCount) {\n      newStore._indices = newIndices;\n    }\n    newStore._count = offset;\n    // Reset data extent\n    newStore._extent = [];\n    newStore._updateGetRawIdx();\n    return newStore;\n  };\n  // /**\n  //  * Data mapping to a plain array\n  //  */\n  // mapArray(dims: DimensionIndex[], cb: MapArrayCb): any[] {\n  //     const result: any[] = [];\n  //     this.each(dims, function () {\n  //         result.push(cb && (cb as MapArrayCb).apply(null, arguments));\n  //     });\n  //     return result;\n  // }\n  /**\n   * Data mapping to a new List with given dimensions\n   */\n  DataStore.prototype.map = function (dims, cb) {\n    // TODO only clone picked chunks.\n    var target = this.clone(dims);\n    this._updateDims(target, dims, cb);\n    return target;\n  };\n  /**\n   * @caution Danger!! Only used in dataStack.\n   */\n  DataStore.prototype.modify = function (dims, cb) {\n    this._updateDims(this, dims, cb);\n  };\n  DataStore.prototype._updateDims = function (target, dims, cb) {\n    var targetChunks = target._chunks;\n    var tmpRetValue = [];\n    var dimSize = dims.length;\n    var dataCount = target.count();\n    var values = [];\n    var rawExtent = target._rawExtent;\n    for (var i = 0; i < dims.length; i++) {\n      rawExtent[dims[i]] = getInitialExtent();\n    }\n    for (var dataIndex = 0; dataIndex < dataCount; dataIndex++) {\n      var rawIndex = target.getRawIndex(dataIndex);\n      for (var k = 0; k < dimSize; k++) {\n        values[k] = targetChunks[dims[k]][rawIndex];\n      }\n      values[dimSize] = dataIndex;\n      var retValue = cb && cb.apply(null, values);\n      if (retValue != null) {\n        // a number or string (in oridinal dimension)?\n        if (typeof retValue !== 'object') {\n          tmpRetValue[0] = retValue;\n          retValue = tmpRetValue;\n        }\n        for (var i = 0; i < retValue.length; i++) {\n          var dim = dims[i];\n          var val = retValue[i];\n          var rawExtentOnDim = rawExtent[dim];\n          var dimStore = targetChunks[dim];\n          if (dimStore) {\n            dimStore[rawIndex] = val;\n          }\n          if (val < rawExtentOnDim[0]) {\n            rawExtentOnDim[0] = val;\n          }\n          if (val > rawExtentOnDim[1]) {\n            rawExtentOnDim[1] = val;\n          }\n        }\n      }\n    }\n  };\n  /**\n   * Large data down sampling using largest-triangle-three-buckets\n   * @param {string} valueDimension\n   * @param {number} targetCount\n   */\n  DataStore.prototype.lttbDownSample = function (valueDimension, rate) {\n    var target = this.clone([valueDimension], true);\n    var targetStorage = target._chunks;\n    var dimStore = targetStorage[valueDimension];\n    var len = this.count();\n    var sampledIndex = 0;\n    var frameSize = Math.floor(1 / rate);\n    var currentRawIndex = this.getRawIndex(0);\n    var maxArea;\n    var area;\n    var nextRawIndex;\n    var newIndices = new (getIndicesCtor(this._rawCount))(Math.min((Math.ceil(len / frameSize) + 2) * 2, len));\n    // First frame use the first data.\n    newIndices[sampledIndex++] = currentRawIndex;\n    for (var i = 1; i < len - 1; i += frameSize) {\n      var nextFrameStart = Math.min(i + frameSize, len - 1);\n      var nextFrameEnd = Math.min(i + frameSize * 2, len);\n      var avgX = (nextFrameEnd + nextFrameStart) / 2;\n      var avgY = 0;\n      for (var idx = nextFrameStart; idx < nextFrameEnd; idx++) {\n        var rawIndex = this.getRawIndex(idx);\n        var y = dimStore[rawIndex];\n        if (isNaN(y)) {\n          continue;\n        }\n        avgY += y;\n      }\n      avgY /= nextFrameEnd - nextFrameStart;\n      var frameStart = i;\n      var frameEnd = Math.min(i + frameSize, len);\n      var pointAX = i - 1;\n      var pointAY = dimStore[currentRawIndex];\n      maxArea = -1;\n      nextRawIndex = frameStart;\n      var firstNaNIndex = -1;\n      var countNaN = 0;\n      // Find a point from current frame that construct a triangle with largest area with previous selected point\n      // And the average of next frame.\n      for (var idx = frameStart; idx < frameEnd; idx++) {\n        var rawIndex = this.getRawIndex(idx);\n        var y = dimStore[rawIndex];\n        if (isNaN(y)) {\n          countNaN++;\n          if (firstNaNIndex < 0) {\n            firstNaNIndex = rawIndex;\n          }\n          continue;\n        }\n        // Calculate triangle area over three buckets\n        area = Math.abs((pointAX - avgX) * (y - pointAY) - (pointAX - idx) * (avgY - pointAY));\n        if (area > maxArea) {\n          maxArea = area;\n          nextRawIndex = rawIndex; // Next a is this b\n        }\n      }\n      if (countNaN > 0 && countNaN < frameEnd - frameStart) {\n        // Append first NaN point in every bucket.\n        // It is necessary to ensure the correct order of indices.\n        newIndices[sampledIndex++] = Math.min(firstNaNIndex, nextRawIndex);\n        nextRawIndex = Math.max(firstNaNIndex, nextRawIndex);\n      }\n      newIndices[sampledIndex++] = nextRawIndex;\n      currentRawIndex = nextRawIndex; // This a is the next a (chosen b)\n    }\n    // First frame use the last data.\n    newIndices[sampledIndex++] = this.getRawIndex(len - 1);\n    target._count = sampledIndex;\n    target._indices = newIndices;\n    target.getRawIndex = this._getRawIdx;\n    return target;\n  };\n  /**\n   * Large data down sampling using min-max\n   * @param {string} valueDimension\n   * @param {number} rate\n   */\n  DataStore.prototype.minmaxDownSample = function (valueDimension, rate) {\n    var target = this.clone([valueDimension], true);\n    var targetStorage = target._chunks;\n    var frameSize = Math.floor(1 / rate);\n    var dimStore = targetStorage[valueDimension];\n    var len = this.count();\n    // Each frame results in 2 data points, one for min and one for max\n    var newIndices = new (getIndicesCtor(this._rawCount))(Math.ceil(len / frameSize) * 2);\n    var offset = 0;\n    for (var i = 0; i < len; i += frameSize) {\n      var minIndex = i;\n      var minValue = dimStore[this.getRawIndex(minIndex)];\n      var maxIndex = i;\n      var maxValue = dimStore[this.getRawIndex(maxIndex)];\n      var thisFrameSize = frameSize;\n      // Handle final smaller frame\n      if (i + frameSize > len) {\n        thisFrameSize = len - i;\n      }\n      // Determine min and max within the current frame\n      for (var k = 0; k < thisFrameSize; k++) {\n        var rawIndex = this.getRawIndex(i + k);\n        var value = dimStore[rawIndex];\n        if (value < minValue) {\n          minValue = value;\n          minIndex = i + k;\n        }\n        if (value > maxValue) {\n          maxValue = value;\n          maxIndex = i + k;\n        }\n      }\n      var rawMinIndex = this.getRawIndex(minIndex);\n      var rawMaxIndex = this.getRawIndex(maxIndex);\n      // Set the order of the min and max values, based on their ordering in the frame\n      if (minIndex < maxIndex) {\n        newIndices[offset++] = rawMinIndex;\n        newIndices[offset++] = rawMaxIndex;\n      } else {\n        newIndices[offset++] = rawMaxIndex;\n        newIndices[offset++] = rawMinIndex;\n      }\n    }\n    target._count = offset;\n    target._indices = newIndices;\n    target._updateGetRawIdx();\n    return target;\n  };\n  /**\n   * Large data down sampling on given dimension\n   * @param sampleIndex Sample index for name and id\n   */\n  DataStore.prototype.downSample = function (dimension, rate, sampleValue, sampleIndex) {\n    var target = this.clone([dimension], true);\n    var targetStorage = target._chunks;\n    var frameValues = [];\n    var frameSize = Math.floor(1 / rate);\n    var dimStore = targetStorage[dimension];\n    var len = this.count();\n    var rawExtentOnDim = target._rawExtent[dimension] = getInitialExtent();\n    var newIndices = new (getIndicesCtor(this._rawCount))(Math.ceil(len / frameSize));\n    var offset = 0;\n    for (var i = 0; i < len; i += frameSize) {\n      // Last frame\n      if (frameSize > len - i) {\n        frameSize = len - i;\n        frameValues.length = frameSize;\n      }\n      for (var k = 0; k < frameSize; k++) {\n        var dataIdx = this.getRawIndex(i + k);\n        frameValues[k] = dimStore[dataIdx];\n      }\n      var value = sampleValue(frameValues);\n      var sampleFrameIdx = this.getRawIndex(Math.min(i + sampleIndex(frameValues, value) || 0, len - 1));\n      // Only write value on the filtered data\n      dimStore[sampleFrameIdx] = value;\n      if (value < rawExtentOnDim[0]) {\n        rawExtentOnDim[0] = value;\n      }\n      if (value > rawExtentOnDim[1]) {\n        rawExtentOnDim[1] = value;\n      }\n      newIndices[offset++] = sampleFrameIdx;\n    }\n    target._count = offset;\n    target._indices = newIndices;\n    target._updateGetRawIdx();\n    return target;\n  };\n  /**\n   * Data iteration\n   * @param ctx default this\n   * @example\n   *  list.each('x', function (x, idx) {});\n   *  list.each(['x', 'y'], function (x, y, idx) {});\n   *  list.each(function (idx) {})\n   */\n  DataStore.prototype.each = function (dims, cb) {\n    if (!this._count) {\n      return;\n    }\n    var dimSize = dims.length;\n    var chunks = this._chunks;\n    for (var i = 0, len = this.count(); i < len; i++) {\n      var rawIdx = this.getRawIndex(i);\n      // Simple optimization\n      switch (dimSize) {\n        case 0:\n          cb(i);\n          break;\n        case 1:\n          cb(chunks[dims[0]][rawIdx], i);\n          break;\n        case 2:\n          cb(chunks[dims[0]][rawIdx], chunks[dims[1]][rawIdx], i);\n          break;\n        default:\n          var k = 0;\n          var value = [];\n          for (; k < dimSize; k++) {\n            value[k] = chunks[dims[k]][rawIdx];\n          }\n          // Index\n          value[k] = i;\n          cb.apply(null, value);\n      }\n    }\n  };\n  /**\n   * Get extent of data in one dimension\n   */\n  DataStore.prototype.getDataExtent = function (dim) {\n    // Make sure use concrete dim as cache name.\n    var dimData = this._chunks[dim];\n    var initialExtent = getInitialExtent();\n    if (!dimData) {\n      return initialExtent;\n    }\n    // Make more strict checkings to ensure hitting cache.\n    var currEnd = this.count();\n    // Consider the most cases when using data zoom, `getDataExtent`\n    // happened before filtering. We cache raw extent, which is not\n    // necessary to be cleared and recalculated when restore data.\n    var useRaw = !this._indices;\n    var dimExtent;\n    if (useRaw) {\n      return this._rawExtent[dim].slice();\n    }\n    dimExtent = this._extent[dim];\n    if (dimExtent) {\n      return dimExtent.slice();\n    }\n    dimExtent = initialExtent;\n    var min = dimExtent[0];\n    var max = dimExtent[1];\n    for (var i = 0; i < currEnd; i++) {\n      var rawIdx = this.getRawIndex(i);\n      var value = dimData[rawIdx];\n      value < min && (min = value);\n      value > max && (max = value);\n    }\n    dimExtent = [min, max];\n    this._extent[dim] = dimExtent;\n    return dimExtent;\n  };\n  /**\n   * Get raw data item\n   */\n  DataStore.prototype.getRawDataItem = function (idx) {\n    var rawIdx = this.getRawIndex(idx);\n    if (!this._provider.persistent) {\n      var val = [];\n      var chunks = this._chunks;\n      for (var i = 0; i < chunks.length; i++) {\n        val.push(chunks[i][rawIdx]);\n      }\n      return val;\n    } else {\n      return this._provider.getItem(rawIdx);\n    }\n  };\n  /**\n   * Clone shallow.\n   *\n   * @param clonedDims Determine which dims to clone. Will share the data if not specified.\n   */\n  DataStore.prototype.clone = function (clonedDims, ignoreIndices) {\n    var target = new DataStore();\n    var chunks = this._chunks;\n    var clonedDimsMap = clonedDims && reduce(clonedDims, function (obj, dimIdx) {\n      obj[dimIdx] = true;\n      return obj;\n    }, {});\n    if (clonedDimsMap) {\n      for (var i = 0; i < chunks.length; i++) {\n        // Not clone if dim is not picked.\n        target._chunks[i] = !clonedDimsMap[i] ? chunks[i] : cloneChunk(chunks[i]);\n      }\n    } else {\n      target._chunks = chunks;\n    }\n    this._copyCommonProps(target);\n    if (!ignoreIndices) {\n      target._indices = this._cloneIndices();\n    }\n    target._updateGetRawIdx();\n    return target;\n  };\n  DataStore.prototype._copyCommonProps = function (target) {\n    target._count = this._count;\n    target._rawCount = this._rawCount;\n    target._provider = this._provider;\n    target._dimensions = this._dimensions;\n    target._extent = clone(this._extent);\n    target._rawExtent = clone(this._rawExtent);\n  };\n  DataStore.prototype._cloneIndices = function () {\n    if (this._indices) {\n      var Ctor = this._indices.constructor;\n      var indices = void 0;\n      if (Ctor === Array) {\n        var thisCount = this._indices.length;\n        indices = new Ctor(thisCount);\n        for (var i = 0; i < thisCount; i++) {\n          indices[i] = this._indices[i];\n        }\n      } else {\n        indices = new Ctor(this._indices);\n      }\n      return indices;\n    }\n    return null;\n  };\n  DataStore.prototype._getRawIdxIdentity = function (idx) {\n    return idx;\n  };\n  DataStore.prototype._getRawIdx = function (idx) {\n    if (idx < this._count && idx >= 0) {\n      return this._indices[idx];\n    }\n    return -1;\n  };\n  DataStore.prototype._updateGetRawIdx = function () {\n    this.getRawIndex = this._indices ? this._getRawIdx : this._getRawIdxIdentity;\n  };\n  DataStore.internalField = function () {\n    function getDimValueSimply(dataItem, property, dataIndex, dimIndex) {\n      return parseDataValue(dataItem[dimIndex], this._dimensions[dimIndex]);\n    }\n    defaultDimValueGetters = {\n      arrayRows: getDimValueSimply,\n      objectRows: function (dataItem, property, dataIndex, dimIndex) {\n        return parseDataValue(dataItem[property], this._dimensions[dimIndex]);\n      },\n      keyedColumns: getDimValueSimply,\n      original: function (dataItem, property, dataIndex, dimIndex) {\n        // Performance sensitive, do not use modelUtil.getDataItemValue.\n        // If dataItem is an plain object with no value field, the let `value`\n        // will be assigned with the object, but it will be tread correctly\n        // in the `convertValue`.\n        var value = dataItem && (dataItem.value == null ? dataItem : dataItem.value);\n        return parseDataValue(value instanceof Array ? value[dimIndex]\n        // If value is a single number or something else not array.\n        : value, this._dimensions[dimIndex]);\n      },\n      typedArray: function (dataItem, property, dataIndex, dimIndex) {\n        return dataItem[dimIndex];\n      }\n    };\n  }();\n  return DataStore;\n}();\nexport default DataStore;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { setAsPrimitive, map, isTypedArray, assert, each, retrieve2 } from 'zrender/lib/core/util.js';\nimport { createSource, cloneSourceShallow } from '../Source.js';\nimport { SOURCE_FORMAT_TYPED_ARRAY, SOURCE_FORMAT_ORIGINAL } from '../../util/types.js';\nimport { querySeriesUpstreamDatasetModel, queryDatasetUpstreamDatasetModels } from './sourceHelper.js';\nimport { applyDataTransform } from './transform.js';\nimport DataStore from '../DataStore.js';\nimport { DefaultDataProvider } from './dataProvider.js';\n/**\n * [REQUIREMENT_MEMO]:\n * (0) `metaRawOption` means `dimensions`/`sourceHeader`/`seriesLayoutBy` in raw option.\n * (1) Keep support the feature: `metaRawOption` can be specified both on `series` and\n * `root-dataset`. Them on `series` has higher priority.\n * (2) Do not support to set `metaRawOption` on a `non-root-dataset`, because it might\n * confuse users: whether those props indicate how to visit the upstream source or visit\n * the transform result source, and some transforms has nothing to do with these props,\n * and some transforms might have multiple upstream.\n * (3) Transforms should specify `metaRawOption` in each output, just like they can be\n * declared in `root-dataset`.\n * (4) At present only support visit source in `SERIES_LAYOUT_BY_COLUMN` in transforms.\n * That is for reducing complexity in transforms.\n * PENDING: Whether to provide transposition transform?\n *\n * [IMPLEMENTAION_MEMO]:\n * \"sourceVisitConfig\" are calculated from `metaRawOption` and `data`.\n * They will not be calculated until `source` is about to be visited (to prevent from\n * duplicate calcuation). `source` is visited only in series and input to transforms.\n *\n * [DIMENSION_INHERIT_RULE]:\n * By default the dimensions are inherited from ancestors, unless a transform return\n * a new dimensions definition.\n * Consider the case:\n * ```js\n * dataset: [{\n *     source: [ ['Product', 'Sales', 'Prise'], ['Cookies', 321, 44.21], ...]\n * }, {\n *     transform: { type: 'filter', ... }\n * }]\n * dataset: [{\n *     dimension: ['Product', 'Sales', 'Prise'],\n *     source: [ ['Cookies', 321, 44.21], ...]\n * }, {\n *     transform: { type: 'filter', ... }\n * }]\n * ```\n * The two types of option should have the same behavior after transform.\n *\n *\n * [SCENARIO]:\n * (1) Provide source data directly:\n * ```js\n * series: {\n *     encode: {...},\n *     dimensions: [...]\n *     seriesLayoutBy: 'row',\n *     data: [[...]]\n * }\n * ```\n * (2) Series refer to dataset.\n * ```js\n * series: [{\n *     encode: {...}\n *     // Ignore datasetIndex means `datasetIndex: 0`\n *     // and the dimensions defination in dataset is used\n * }, {\n *     encode: {...},\n *     seriesLayoutBy: 'column',\n *     datasetIndex: 1\n * }]\n * ```\n * (3) dataset transform\n * ```js\n * dataset: [{\n *     source: [...]\n * }, {\n *     source: [...]\n * }, {\n *     // By default from 0.\n *     transform: { type: 'filter', config: {...} }\n * }, {\n *     // Piped.\n *     transform: [\n *         { type: 'filter', config: {...} },\n *         { type: 'sort', config: {...} }\n *     ]\n * }, {\n *     id: 'regressionData',\n *     fromDatasetIndex: 1,\n *     // Third-party transform\n *     transform: { type: 'ecStat:regression', config: {...} }\n * }, {\n *     // retrieve the extra result.\n *     id: 'regressionFormula',\n *     fromDatasetId: 'regressionData',\n *     fromTransformResult: 1\n * }]\n * ```\n */\nvar SourceManager = /** @class */function () {\n  function SourceManager(sourceHost) {\n    // Cached source. Do not repeat calculating if not dirty.\n    this._sourceList = [];\n    this._storeList = [];\n    // version sign of each upstream source manager.\n    this._upstreamSignList = [];\n    this._versionSignBase = 0;\n    this._dirty = true;\n    this._sourceHost = sourceHost;\n  }\n  /**\n   * Mark dirty.\n   */\n  SourceManager.prototype.dirty = function () {\n    this._setLocalSource([], []);\n    this._storeList = [];\n    this._dirty = true;\n  };\n  SourceManager.prototype._setLocalSource = function (sourceList, upstreamSignList) {\n    this._sourceList = sourceList;\n    this._upstreamSignList = upstreamSignList;\n    this._versionSignBase++;\n    if (this._versionSignBase > 9e10) {\n      this._versionSignBase = 0;\n    }\n  };\n  /**\n   * For detecting whether the upstream source is dirty, so that\n   * the local cached source (in `_sourceList`) should be discarded.\n   */\n  SourceManager.prototype._getVersionSign = function () {\n    return this._sourceHost.uid + '_' + this._versionSignBase;\n  };\n  /**\n   * Always return a source instance. Otherwise throw error.\n   */\n  SourceManager.prototype.prepareSource = function () {\n    // For the case that call `setOption` multiple time but no data changed,\n    // cache the result source to prevent from repeating transform.\n    if (this._isDirty()) {\n      this._createSource();\n      this._dirty = false;\n    }\n  };\n  SourceManager.prototype._createSource = function () {\n    this._setLocalSource([], []);\n    var sourceHost = this._sourceHost;\n    var upSourceMgrList = this._getUpstreamSourceManagers();\n    var hasUpstream = !!upSourceMgrList.length;\n    var resultSourceList;\n    var upstreamSignList;\n    if (isSeries(sourceHost)) {\n      var seriesModel = sourceHost;\n      var data = void 0;\n      var sourceFormat = void 0;\n      var upSource = void 0;\n      // Has upstream dataset\n      if (hasUpstream) {\n        var upSourceMgr = upSourceMgrList[0];\n        upSourceMgr.prepareSource();\n        upSource = upSourceMgr.getSource();\n        data = upSource.data;\n        sourceFormat = upSource.sourceFormat;\n        upstreamSignList = [upSourceMgr._getVersionSign()];\n      }\n      // Series data is from own.\n      else {\n        data = seriesModel.get('data', true);\n        sourceFormat = isTypedArray(data) ? SOURCE_FORMAT_TYPED_ARRAY : SOURCE_FORMAT_ORIGINAL;\n        upstreamSignList = [];\n      }\n      // See [REQUIREMENT_MEMO], merge settings on series and parent dataset if it is root.\n      var newMetaRawOption = this._getSourceMetaRawOption() || {};\n      var upMetaRawOption = upSource && upSource.metaRawOption || {};\n      var seriesLayoutBy = retrieve2(newMetaRawOption.seriesLayoutBy, upMetaRawOption.seriesLayoutBy) || null;\n      var sourceHeader = retrieve2(newMetaRawOption.sourceHeader, upMetaRawOption.sourceHeader);\n      // Note here we should not use `upSource.dimensionsDefine`. Consider the case:\n      // `upSource.dimensionsDefine` is detected by `seriesLayoutBy: 'column'`,\n      // but series need `seriesLayoutBy: 'row'`.\n      var dimensions = retrieve2(newMetaRawOption.dimensions, upMetaRawOption.dimensions);\n      // We share source with dataset as much as possible\n      // to avoid extra memory cost of high dimensional data.\n      var needsCreateSource = seriesLayoutBy !== upMetaRawOption.seriesLayoutBy || !!sourceHeader !== !!upMetaRawOption.sourceHeader || dimensions;\n      resultSourceList = needsCreateSource ? [createSource(data, {\n        seriesLayoutBy: seriesLayoutBy,\n        sourceHeader: sourceHeader,\n        dimensions: dimensions\n      }, sourceFormat)] : [];\n    } else {\n      var datasetModel = sourceHost;\n      // Has upstream dataset.\n      if (hasUpstream) {\n        var result = this._applyTransform(upSourceMgrList);\n        resultSourceList = result.sourceList;\n        upstreamSignList = result.upstreamSignList;\n      }\n      // Is root dataset.\n      else {\n        var sourceData = datasetModel.get('source', true);\n        resultSourceList = [createSource(sourceData, this._getSourceMetaRawOption(), null)];\n        upstreamSignList = [];\n      }\n    }\n    if (process.env.NODE_ENV !== 'production') {\n      assert(resultSourceList && upstreamSignList);\n    }\n    this._setLocalSource(resultSourceList, upstreamSignList);\n  };\n  SourceManager.prototype._applyTransform = function (upMgrList) {\n    var datasetModel = this._sourceHost;\n    var transformOption = datasetModel.get('transform', true);\n    var fromTransformResult = datasetModel.get('fromTransformResult', true);\n    if (process.env.NODE_ENV !== 'production') {\n      assert(fromTransformResult != null || transformOption != null);\n    }\n    if (fromTransformResult != null) {\n      var errMsg = '';\n      if (upMgrList.length !== 1) {\n        if (process.env.NODE_ENV !== 'production') {\n          errMsg = 'When using `fromTransformResult`, there should be only one upstream dataset';\n        }\n        doThrow(errMsg);\n      }\n    }\n    var sourceList;\n    var upSourceList = [];\n    var upstreamSignList = [];\n    each(upMgrList, function (upMgr) {\n      upMgr.prepareSource();\n      var upSource = upMgr.getSource(fromTransformResult || 0);\n      var errMsg = '';\n      if (fromTransformResult != null && !upSource) {\n        if (process.env.NODE_ENV !== 'production') {\n          errMsg = 'Can not retrieve result by `fromTransformResult`: ' + fromTransformResult;\n        }\n        doThrow(errMsg);\n      }\n      upSourceList.push(upSource);\n      upstreamSignList.push(upMgr._getVersionSign());\n    });\n    if (transformOption) {\n      sourceList = applyDataTransform(transformOption, upSourceList, {\n        datasetIndex: datasetModel.componentIndex\n      });\n    } else if (fromTransformResult != null) {\n      sourceList = [cloneSourceShallow(upSourceList[0])];\n    }\n    return {\n      sourceList: sourceList,\n      upstreamSignList: upstreamSignList\n    };\n  };\n  SourceManager.prototype._isDirty = function () {\n    if (this._dirty) {\n      return true;\n    }\n    // All sourceList is from the some upstream.\n    var upSourceMgrList = this._getUpstreamSourceManagers();\n    for (var i = 0; i < upSourceMgrList.length; i++) {\n      var upSrcMgr = upSourceMgrList[i];\n      if (\n      // Consider the case that there is ancestor diry, call it recursively.\n      // The performance is probably not an issue because usually the chain is not long.\n      upSrcMgr._isDirty() || this._upstreamSignList[i] !== upSrcMgr._getVersionSign()) {\n        return true;\n      }\n    }\n  };\n  /**\n   * @param sourceIndex By default 0, means \"main source\".\n   *                    In most cases there is only one source.\n   */\n  SourceManager.prototype.getSource = function (sourceIndex) {\n    sourceIndex = sourceIndex || 0;\n    var source = this._sourceList[sourceIndex];\n    if (!source) {\n      // Series may share source instance with dataset.\n      var upSourceMgrList = this._getUpstreamSourceManagers();\n      return upSourceMgrList[0] && upSourceMgrList[0].getSource(sourceIndex);\n    }\n    return source;\n  };\n  /**\n   *\n   * Get a data store which can be shared across series.\n   * Only available for series.\n   *\n   * @param seriesDimRequest Dimensions that are generated in series.\n   *        Should have been sorted by `storeDimIndex` asc.\n   */\n  SourceManager.prototype.getSharedDataStore = function (seriesDimRequest) {\n    if (process.env.NODE_ENV !== 'production') {\n      assert(isSeries(this._sourceHost), 'Can only call getDataStore on series source manager.');\n    }\n    var schema = seriesDimRequest.makeStoreSchema();\n    return this._innerGetDataStore(schema.dimensions, seriesDimRequest.source, schema.hash);\n  };\n  SourceManager.prototype._innerGetDataStore = function (storeDims, seriesSource, sourceReadKey) {\n    // TODO Can use other sourceIndex?\n    var sourceIndex = 0;\n    var storeList = this._storeList;\n    var cachedStoreMap = storeList[sourceIndex];\n    if (!cachedStoreMap) {\n      cachedStoreMap = storeList[sourceIndex] = {};\n    }\n    var cachedStore = cachedStoreMap[sourceReadKey];\n    if (!cachedStore) {\n      var upSourceMgr = this._getUpstreamSourceManagers()[0];\n      if (isSeries(this._sourceHost) && upSourceMgr) {\n        cachedStore = upSourceMgr._innerGetDataStore(storeDims, seriesSource, sourceReadKey);\n      } else {\n        cachedStore = new DataStore();\n        // Always create store from source of series.\n        cachedStore.initData(new DefaultDataProvider(seriesSource, storeDims.length), storeDims);\n      }\n      cachedStoreMap[sourceReadKey] = cachedStore;\n    }\n    return cachedStore;\n  };\n  /**\n   * PENDING: Is it fast enough?\n   * If no upstream, return empty array.\n   */\n  SourceManager.prototype._getUpstreamSourceManagers = function () {\n    // Always get the relationship from the raw option.\n    // Do not cache the link of the dependency graph, so that\n    // there is no need to update them when change happens.\n    var sourceHost = this._sourceHost;\n    if (isSeries(sourceHost)) {\n      var datasetModel = querySeriesUpstreamDatasetModel(sourceHost);\n      return !datasetModel ? [] : [datasetModel.getSourceManager()];\n    } else {\n      return map(queryDatasetUpstreamDatasetModels(sourceHost), function (datasetModel) {\n        return datasetModel.getSourceManager();\n      });\n    }\n  };\n  SourceManager.prototype._getSourceMetaRawOption = function () {\n    var sourceHost = this._sourceHost;\n    var seriesLayoutBy;\n    var sourceHeader;\n    var dimensions;\n    if (isSeries(sourceHost)) {\n      seriesLayoutBy = sourceHost.get('seriesLayoutBy', true);\n      sourceHeader = sourceHost.get('sourceHeader', true);\n      dimensions = sourceHost.get('dimensions', true);\n    }\n    // See [REQUIREMENT_MEMO], `non-root-dataset` do not support them.\n    else if (!this._getUpstreamSourceManagers().length) {\n      var model = sourceHost;\n      seriesLayoutBy = model.get('seriesLayoutBy', true);\n      sourceHeader = model.get('sourceHeader', true);\n      dimensions = model.get('dimensions', true);\n    }\n    return {\n      seriesLayoutBy: seriesLayoutBy,\n      sourceHeader: sourceHeader,\n      dimensions: dimensions\n    };\n  };\n  return SourceManager;\n}();\nexport { SourceManager };\n// Call this method after `super.init` and `super.mergeOption` to\n// disable the transform merge, but do not disable transform clone from rawOption.\nexport function disableTransformOptionMerge(datasetModel) {\n  var transformOption = datasetModel.option.transform;\n  transformOption && setAsPrimitive(datasetModel.option.transform);\n}\nfunction isSeries(sourceHost) {\n  // Avoid circular dependency with Series.ts\n  return sourceHost.mainType === 'series';\n}\nfunction doThrow(errMsg) {\n  throw new Error(errMsg);\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { getTooltipMarker, encodeHTML, makeValueReadable, convertToColorString } from '../../util/format.js';\nimport { isString, each, hasOwn, isArray, map, assert, extend } from 'zrender/lib/core/util.js';\nimport { SortOrderComparator } from '../../data/helper/dataValueHelper.js';\nimport { getRandomIdBase } from '../../util/number.js';\nimport tokens from '../../visual/tokens.js';\nvar TOOLTIP_LINE_HEIGHT_CSS = 'line-height:1';\nfunction getTooltipLineHeight(textStyle) {\n  var lineHeight = textStyle.lineHeight;\n  if (lineHeight == null) {\n    return TOOLTIP_LINE_HEIGHT_CSS;\n  } else {\n    return \"line-height:\" + encodeHTML(lineHeight + '') + \"px\";\n  }\n}\n// TODO: more textStyle option\nfunction getTooltipTextStyle(textStyle, renderMode) {\n  var nameFontColor = textStyle.color || tokens.color.tertiary;\n  var nameFontSize = textStyle.fontSize || 12;\n  var nameFontWeight = textStyle.fontWeight || '400';\n  var valueFontColor = textStyle.color || tokens.color.secondary;\n  var valueFontSize = textStyle.fontSize || 14;\n  var valueFontWeight = textStyle.fontWeight || '900';\n  if (renderMode === 'html') {\n    // `textStyle` is probably from user input, should be encoded to reduce security risk.\n    return {\n      // eslint-disable-next-line max-len\n      nameStyle: \"font-size:\" + encodeHTML(nameFontSize + '') + \"px;color:\" + encodeHTML(nameFontColor) + \";font-weight:\" + encodeHTML(nameFontWeight + ''),\n      // eslint-disable-next-line max-len\n      valueStyle: \"font-size:\" + encodeHTML(valueFontSize + '') + \"px;color:\" + encodeHTML(valueFontColor) + \";font-weight:\" + encodeHTML(valueFontWeight + '')\n    };\n  } else {\n    return {\n      nameStyle: {\n        fontSize: nameFontSize,\n        fill: nameFontColor,\n        fontWeight: nameFontWeight\n      },\n      valueStyle: {\n        fontSize: valueFontSize,\n        fill: valueFontColor,\n        fontWeight: valueFontWeight\n      }\n    };\n  }\n}\n// See `TooltipMarkupLayoutIntent['innerGapLevel']`.\n// (value from UI design)\nvar HTML_GAPS = [0, 10, 20, 30];\nvar RICH_TEXT_GAPS = ['', '\\n', '\\n\\n', '\\n\\n\\n'];\n// eslint-disable-next-line max-len\nexport function createTooltipMarkup(type, option) {\n  option.type = type;\n  return option;\n}\nfunction isSectionFragment(frag) {\n  return frag.type === 'section';\n}\nfunction getBuilder(frag) {\n  return isSectionFragment(frag) ? buildSection : buildNameValue;\n}\nfunction getBlockGapLevel(frag) {\n  if (isSectionFragment(frag)) {\n    var gapLevel_1 = 0;\n    var subBlockLen = frag.blocks.length;\n    var hasInnerGap_1 = subBlockLen > 1 || subBlockLen > 0 && !frag.noHeader;\n    each(frag.blocks, function (subBlock) {\n      var subGapLevel = getBlockGapLevel(subBlock);\n      // If the some of the sub-blocks have some gaps (like 10px) inside, this block\n      // should use a larger gap (like 20px) to distinguish those sub-blocks.\n      if (subGapLevel >= gapLevel_1) {\n        gapLevel_1 = subGapLevel + +(hasInnerGap_1 && (\n        // 0 always can not be readable gap level.\n        !subGapLevel\n        // If no header, always keep the sub gap level. Otherwise\n        // look weird in case `multipleSeries`.\n        || isSectionFragment(subBlock) && !subBlock.noHeader));\n      }\n    });\n    return gapLevel_1;\n  }\n  return 0;\n}\nfunction buildSection(ctx, fragment, topMarginForOuterGap, toolTipTextStyle) {\n  var noHeader = fragment.noHeader;\n  var gaps = getGap(getBlockGapLevel(fragment));\n  var subMarkupTextList = [];\n  var subBlocks = fragment.blocks || [];\n  assert(!subBlocks || isArray(subBlocks));\n  subBlocks = subBlocks || [];\n  var orderMode = ctx.orderMode;\n  if (fragment.sortBlocks && orderMode) {\n    subBlocks = subBlocks.slice();\n    var orderMap = {\n      valueAsc: 'asc',\n      valueDesc: 'desc'\n    };\n    if (hasOwn(orderMap, orderMode)) {\n      var comparator_1 = new SortOrderComparator(orderMap[orderMode], null);\n      subBlocks.sort(function (a, b) {\n        return comparator_1.evaluate(a.sortParam, b.sortParam);\n      });\n    }\n    // FIXME 'seriesDesc' necessary?\n    else if (orderMode === 'seriesDesc') {\n      subBlocks.reverse();\n    }\n  }\n  each(subBlocks, function (subBlock, idx) {\n    var valueFormatter = fragment.valueFormatter;\n    var subMarkupText = getBuilder(subBlock)(\n    // Inherit valueFormatter\n    valueFormatter ? extend(extend({}, ctx), {\n      valueFormatter: valueFormatter\n    }) : ctx, subBlock, idx > 0 ? gaps.html : 0, toolTipTextStyle);\n    subMarkupText != null && subMarkupTextList.push(subMarkupText);\n  });\n  var subMarkupText = ctx.renderMode === 'richText' ? subMarkupTextList.join(gaps.richText) : wrapBlockHTML(toolTipTextStyle, subMarkupTextList.join(''), noHeader ? topMarginForOuterGap : gaps.html);\n  if (noHeader) {\n    return subMarkupText;\n  }\n  var displayableHeader = makeValueReadable(fragment.header, 'ordinal', ctx.useUTC);\n  var nameStyle = getTooltipTextStyle(toolTipTextStyle, ctx.renderMode).nameStyle;\n  var tooltipLineHeight = getTooltipLineHeight(toolTipTextStyle);\n  if (ctx.renderMode === 'richText') {\n    return wrapInlineNameRichText(ctx, displayableHeader, nameStyle) + gaps.richText + subMarkupText;\n  } else {\n    return wrapBlockHTML(toolTipTextStyle, \"<div style=\\\"\" + nameStyle + \";\" + tooltipLineHeight + \";\\\">\" + encodeHTML(displayableHeader) + '</div>' + subMarkupText, topMarginForOuterGap);\n  }\n}\nfunction buildNameValue(ctx, fragment, topMarginForOuterGap, toolTipTextStyle) {\n  var renderMode = ctx.renderMode;\n  var noName = fragment.noName;\n  var noValue = fragment.noValue;\n  var noMarker = !fragment.markerType;\n  var name = fragment.name;\n  var useUTC = ctx.useUTC;\n  var valueFormatter = fragment.valueFormatter || ctx.valueFormatter || function (value) {\n    value = isArray(value) ? value : [value];\n    return map(value, function (val, idx) {\n      return makeValueReadable(val, isArray(valueTypeOption) ? valueTypeOption[idx] : valueTypeOption, useUTC);\n    });\n  };\n  if (noName && noValue) {\n    return;\n  }\n  var markerStr = noMarker ? '' : ctx.markupStyleCreator.makeTooltipMarker(fragment.markerType, fragment.markerColor || tokens.color.secondary, renderMode);\n  var readableName = noName ? '' : makeValueReadable(name, 'ordinal', useUTC);\n  var valueTypeOption = fragment.valueType;\n  var readableValueList = noValue ? [] : valueFormatter(fragment.value, fragment.dataIndex);\n  var valueAlignRight = !noMarker || !noName;\n  // It little weird if only value next to marker but far from marker.\n  var valueCloseToMarker = !noMarker && noName;\n  var _a = getTooltipTextStyle(toolTipTextStyle, renderMode),\n    nameStyle = _a.nameStyle,\n    valueStyle = _a.valueStyle;\n  return renderMode === 'richText' ? (noMarker ? '' : markerStr) + (noName ? '' : wrapInlineNameRichText(ctx, readableName, nameStyle))\n  // Value has commas inside, so use ' ' as delimiter for multiple values.\n  + (noValue ? '' : wrapInlineValueRichText(ctx, readableValueList, valueAlignRight, valueCloseToMarker, valueStyle)) : wrapBlockHTML(toolTipTextStyle, (noMarker ? '' : markerStr) + (noName ? '' : wrapInlineNameHTML(readableName, !noMarker, nameStyle)) + (noValue ? '' : wrapInlineValueHTML(readableValueList, valueAlignRight, valueCloseToMarker, valueStyle)), topMarginForOuterGap);\n}\n/**\n * @return markupText. null/undefined means no content.\n */\nexport function buildTooltipMarkup(fragment, markupStyleCreator, renderMode, orderMode, useUTC, toolTipTextStyle) {\n  if (!fragment) {\n    return;\n  }\n  var builder = getBuilder(fragment);\n  var ctx = {\n    useUTC: useUTC,\n    renderMode: renderMode,\n    orderMode: orderMode,\n    markupStyleCreator: markupStyleCreator,\n    valueFormatter: fragment.valueFormatter\n  };\n  return builder(ctx, fragment, 0, toolTipTextStyle);\n}\nfunction getGap(gapLevel) {\n  return {\n    html: HTML_GAPS[gapLevel],\n    richText: RICH_TEXT_GAPS[gapLevel]\n  };\n}\nfunction wrapBlockHTML(textStyle, encodedContent, topGap) {\n  var clearfix = '<div style=\"clear:both\"></div>';\n  var marginCSS = \"margin: \" + topGap + \"px 0 0\";\n  var tooltipLineHeight = getTooltipLineHeight(textStyle);\n  return \"<div style=\\\"\" + marginCSS + \";\" + tooltipLineHeight + \";\\\">\" + encodedContent + clearfix + '</div>';\n}\nfunction wrapInlineNameHTML(name, leftHasMarker, style) {\n  var marginCss = leftHasMarker ? 'margin-left:2px' : '';\n  return \"<span style=\\\"\" + style + \";\" + marginCss + \"\\\">\" + encodeHTML(name) + '</span>';\n}\nfunction wrapInlineValueHTML(valueList, alignRight, valueCloseToMarker, style) {\n  // Do not too close to marker, considering there are multiple values separated by spaces.\n  var paddingStr = valueCloseToMarker ? '10px' : '20px';\n  var alignCSS = alignRight ? \"float:right;margin-left:\" + paddingStr : '';\n  valueList = isArray(valueList) ? valueList : [valueList];\n  return \"<span style=\\\"\" + alignCSS + \";\" + style + \"\\\">\"\n  // Value has commas inside, so use '  ' as delimiter for multiple values.\n  + map(valueList, function (value) {\n    return encodeHTML(value);\n  }).join('&nbsp;&nbsp;') + '</span>';\n}\nfunction wrapInlineNameRichText(ctx, name, style) {\n  return ctx.markupStyleCreator.wrapRichTextStyle(name, style);\n}\nfunction wrapInlineValueRichText(ctx, values, alignRight, valueCloseToMarker, style) {\n  var styles = [style];\n  var paddingLeft = valueCloseToMarker ? 10 : 20;\n  alignRight && styles.push({\n    padding: [0, 0, 0, paddingLeft],\n    align: 'right'\n  });\n  // Value has commas inside, so use '  ' as delimiter for multiple values.\n  return ctx.markupStyleCreator.wrapRichTextStyle(isArray(values) ? values.join('  ') : values, styles);\n}\nexport function retrieveVisualColorForTooltipMarker(series, dataIndex) {\n  var style = series.getData().getItemVisual(dataIndex, 'style');\n  var color = style[series.visualDrawType];\n  return convertToColorString(color);\n}\nexport function getPaddingFromTooltipModel(model, renderMode) {\n  var padding = model.get('padding');\n  return padding != null ? padding\n  // We give slightly different to look pretty.\n  : renderMode === 'richText' ? [8, 10] : 10;\n}\n/**\n * The major feature is generate styles for `renderMode: 'richText'`.\n * But it also serves `renderMode: 'html'` to provide\n * \"renderMode-independent\" API.\n */\nvar TooltipMarkupStyleCreator = /** @class */function () {\n  function TooltipMarkupStyleCreator() {\n    this.richTextStyles = {};\n    // Notice that \"generate a style name\" usually happens repeatedly when mouse is moving and\n    // a tooltip is displayed. So we put the `_nextStyleNameId` as a member of each creator\n    // rather than static shared by all creators (which will cause it increase to fast).\n    this._nextStyleNameId = getRandomIdBase();\n  }\n  TooltipMarkupStyleCreator.prototype._generateStyleName = function () {\n    return '__EC_aUTo_' + this._nextStyleNameId++;\n  };\n  TooltipMarkupStyleCreator.prototype.makeTooltipMarker = function (markerType, colorStr, renderMode) {\n    var markerId = renderMode === 'richText' ? this._generateStyleName() : null;\n    var marker = getTooltipMarker({\n      color: colorStr,\n      type: markerType,\n      renderMode: renderMode,\n      markerId: markerId\n    });\n    if (isString(marker)) {\n      return marker;\n    } else {\n      if (process.env.NODE_ENV !== 'production') {\n        assert(markerId);\n      }\n      this.richTextStyles[markerId] = marker.style;\n      return marker.content;\n    }\n  };\n  /**\n   * @usage\n   * ```ts\n   * const styledText = markupStyleCreator.wrapRichTextStyle([\n   *     // The styles will be auto merged.\n   *     {\n   *         fontSize: 12,\n   *         color: 'blue'\n   *     },\n   *     {\n   *         padding: 20\n   *     }\n   * ]);\n   * ```\n   */\n  TooltipMarkupStyleCreator.prototype.wrapRichTextStyle = function (text, styles) {\n    var finalStl = {};\n    if (isArray(styles)) {\n      each(styles, function (stl) {\n        return extend(finalStl, stl);\n      });\n    } else {\n      extend(finalStl, styles);\n    }\n    var styleName = this._generateStyleName();\n    this.richTextStyles[styleName] = finalStl;\n    return \"{\" + styleName + \"|\" + text + \"}\";\n  };\n  return TooltipMarkupStyleCreator;\n}();\nexport { TooltipMarkupStyleCreator };", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { trim, isArray, each, reduce } from 'zrender/lib/core/util.js';\nimport { retrieveVisualColorForTooltipMarker, createTooltipMarkup } from './tooltipMarkup.js';\nimport { retrieveRawValue } from '../../data/helper/dataProvider.js';\nimport { isNameSpecified } from '../../util/model.js';\nexport function defaultSeriesFormatTooltip(opt) {\n  var series = opt.series;\n  var dataIndex = opt.dataIndex;\n  var multipleSeries = opt.multipleSeries;\n  var data = series.getData();\n  var tooltipDims = data.mapDimensionsAll('defaultedTooltip');\n  var tooltipDimLen = tooltipDims.length;\n  var value = series.getRawValue(dataIndex);\n  var isValueArr = isArray(value);\n  var markerColor = retrieveVisualColorForTooltipMarker(series, dataIndex);\n  // Complicated rule for pretty tooltip.\n  var inlineValue;\n  var inlineValueType;\n  var subBlocks;\n  var sortParam;\n  if (tooltipDimLen > 1 || isValueArr && !tooltipDimLen) {\n    var formatArrResult = formatTooltipArrayValue(value, series, dataIndex, tooltipDims, markerColor);\n    inlineValue = formatArrResult.inlineValues;\n    inlineValueType = formatArrResult.inlineValueTypes;\n    subBlocks = formatArrResult.blocks;\n    // Only support tooltip sort by the first inline value. It's enough in most cases.\n    sortParam = formatArrResult.inlineValues[0];\n  } else if (tooltipDimLen) {\n    var dimInfo = data.getDimensionInfo(tooltipDims[0]);\n    sortParam = inlineValue = retrieveRawValue(data, dataIndex, tooltipDims[0]);\n    inlineValueType = dimInfo.type;\n  } else {\n    sortParam = inlineValue = isValueArr ? value[0] : value;\n  }\n  // Do not show generated series name. It might not be readable.\n  var seriesNameSpecified = isNameSpecified(series);\n  var seriesName = seriesNameSpecified && series.name || '';\n  var itemName = data.getName(dataIndex);\n  var inlineName = multipleSeries ? seriesName : itemName;\n  return createTooltipMarkup('section', {\n    header: seriesName,\n    // When series name is not specified, do not show a header line with only '-'.\n    // This case always happens in tooltip.trigger: 'item'.\n    noHeader: multipleSeries || !seriesNameSpecified,\n    sortParam: sortParam,\n    blocks: [createTooltipMarkup('nameValue', {\n      markerType: 'item',\n      markerColor: markerColor,\n      // Do not mix display seriesName and itemName in one tooltip,\n      // which might confuses users.\n      name: inlineName,\n      // name dimension might be auto assigned, where the name might\n      // be not readable. So we check trim here.\n      noName: !trim(inlineName),\n      value: inlineValue,\n      valueType: inlineValueType,\n      dataIndex: dataIndex\n    })].concat(subBlocks || [])\n  });\n}\nfunction formatTooltipArrayValue(value, series, dataIndex, tooltipDims, colorStr) {\n  // check: category-no-encode-has-axis-data in dataset.html\n  var data = series.getData();\n  var isValueMultipleLine = reduce(value, function (isValueMultipleLine, val, idx) {\n    var dimItem = data.getDimensionInfo(idx);\n    return isValueMultipleLine = isValueMultipleLine || dimItem && dimItem.tooltip !== false && dimItem.displayName != null;\n  }, false);\n  var inlineValues = [];\n  var inlineValueTypes = [];\n  var blocks = [];\n  tooltipDims.length ? each(tooltipDims, function (dim) {\n    setEachItem(retrieveRawValue(data, dataIndex, dim), dim);\n  })\n  // By default, all dims is used on tooltip.\n  : each(value, setEachItem);\n  function setEachItem(val, dim) {\n    var dimInfo = data.getDimensionInfo(dim);\n    // If `dimInfo.tooltip` is not set, show tooltip.\n    if (!dimInfo || dimInfo.otherDims.tooltip === false) {\n      return;\n    }\n    if (isValueMultipleLine) {\n      blocks.push(createTooltipMarkup('nameValue', {\n        markerType: 'subItem',\n        markerColor: colorStr,\n        name: dimInfo.displayName,\n        value: val,\n        valueType: dimInfo.type\n      }));\n    } else {\n      inlineValues.push(val);\n      inlineValueTypes.push(dimInfo.type);\n    }\n  }\n  return {\n    inlineValues: inlineValues,\n    inlineValueTypes: inlineValueTypes,\n    blocks: blocks\n  };\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport env from 'zrender/lib/core/env.js';\nimport * as modelUtil from '../util/model.js';\nimport ComponentModel from './Component.js';\nimport { PaletteMixin } from './mixin/palette.js';\nimport { DataFormatMixin } from '../model/mixin/dataFormat.js';\nimport { getLayoutParams, mergeLayoutParam, fetchLayoutMode } from '../util/layout.js';\nimport { createTask } from '../core/task.js';\nimport { mountExtend } from '../util/clazz.js';\nimport { SourceManager } from '../data/helper/sourceManager.js';\nimport { defaultSeriesFormatTooltip } from '../component/tooltip/seriesFormatTooltip.js';\nvar inner = modelUtil.makeInner();\nfunction getSelectionKey(data, dataIndex) {\n  return data.getName(dataIndex) || data.getId(dataIndex);\n}\nexport var SERIES_UNIVERSAL_TRANSITION_PROP = '__universalTransitionEnabled';\nvar SeriesModel = /** @class */function (_super) {\n  __extends(SeriesModel, _super);\n  function SeriesModel() {\n    // [Caution]: Because this class or desecendants can be used as `XXX.extend(subProto)`,\n    // the class members must not be initialized in constructor or declaration place.\n    // Otherwise there is bad case:\n    //   class A {xxx = 1;}\n    //   enableClassExtend(A);\n    //   class B extends A {}\n    //   var C = B.extend({xxx: 5});\n    //   var c = new C();\n    //   console.log(c.xxx); // expect 5 but always 1.\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    // ---------------------------------------\n    // Props about data selection\n    // ---------------------------------------\n    _this._selectedDataIndicesMap = {};\n    return _this;\n  }\n  SeriesModel.prototype.init = function (option, parentModel, ecModel) {\n    this.seriesIndex = this.componentIndex;\n    this.dataTask = createTask({\n      count: dataTaskCount,\n      reset: dataTaskReset\n    });\n    this.dataTask.context = {\n      model: this\n    };\n    this.mergeDefaultAndTheme(option, ecModel);\n    var sourceManager = inner(this).sourceManager = new SourceManager(this);\n    sourceManager.prepareSource();\n    var data = this.getInitialData(option, ecModel);\n    wrapData(data, this);\n    this.dataTask.context.data = data;\n    if (process.env.NODE_ENV !== 'production') {\n      zrUtil.assert(data, 'getInitialData returned invalid data.');\n    }\n    inner(this).dataBeforeProcessed = data;\n    // If we reverse the order (make data firstly, and then make\n    // dataBeforeProcessed by cloneShallow), cloneShallow will\n    // cause data.graph.data !== data when using\n    // module:echarts/data/Graph or module:echarts/data/Tree.\n    // See module:echarts/data/helper/linkSeriesData\n    // Theoretically, it is unreasonable to call `seriesModel.getData()` in the model\n    // init or merge stage, because the data can be restored. So we do not `restoreData`\n    // and `setData` here, which forbids calling `seriesModel.getData()` in this stage.\n    // Call `seriesModel.getRawData()` instead.\n    // this.restoreData();\n    autoSeriesName(this);\n    this._initSelectedMapFromData(data);\n  };\n  /**\n   * Util for merge default and theme to option\n   */\n  SeriesModel.prototype.mergeDefaultAndTheme = function (option, ecModel) {\n    var layoutMode = fetchLayoutMode(this);\n    var inputPositionParams = layoutMode ? getLayoutParams(option) : {};\n    // Backward compat: using subType on theme.\n    // But if name duplicate between series subType\n    // (for example: parallel) add component mainType,\n    // add suffix 'Series'.\n    var themeSubType = this.subType;\n    if (ComponentModel.hasClass(themeSubType)) {\n      themeSubType += 'Series';\n    }\n    zrUtil.merge(option, ecModel.getTheme().get(this.subType));\n    zrUtil.merge(option, this.getDefaultOption());\n    // Default label emphasis `show`\n    modelUtil.defaultEmphasis(option, 'label', ['show']);\n    this.fillDataTextStyle(option.data);\n    if (layoutMode) {\n      mergeLayoutParam(option, inputPositionParams, layoutMode);\n    }\n  };\n  SeriesModel.prototype.mergeOption = function (newSeriesOption, ecModel) {\n    // this.settingTask.dirty();\n    newSeriesOption = zrUtil.merge(this.option, newSeriesOption, true);\n    this.fillDataTextStyle(newSeriesOption.data);\n    var layoutMode = fetchLayoutMode(this);\n    if (layoutMode) {\n      mergeLayoutParam(this.option, newSeriesOption, layoutMode);\n    }\n    var sourceManager = inner(this).sourceManager;\n    sourceManager.dirty();\n    sourceManager.prepareSource();\n    var data = this.getInitialData(newSeriesOption, ecModel);\n    wrapData(data, this);\n    this.dataTask.dirty();\n    this.dataTask.context.data = data;\n    inner(this).dataBeforeProcessed = data;\n    autoSeriesName(this);\n    this._initSelectedMapFromData(data);\n  };\n  SeriesModel.prototype.fillDataTextStyle = function (data) {\n    // Default data label emphasis `show`\n    // FIXME Tree structure data ?\n    // FIXME Performance ?\n    if (data && !zrUtil.isTypedArray(data)) {\n      var props = ['show'];\n      for (var i = 0; i < data.length; i++) {\n        if (data[i] && data[i].label) {\n          modelUtil.defaultEmphasis(data[i], 'label', props);\n        }\n      }\n    }\n  };\n  /**\n   * Init a data structure from data related option in series\n   * Must be overridden.\n   */\n  SeriesModel.prototype.getInitialData = function (option, ecModel) {\n    return;\n  };\n  /**\n   * Append data to list\n   */\n  SeriesModel.prototype.appendData = function (params) {\n    // FIXME ???\n    // (1) If data from dataset, forbidden append.\n    // (2) support append data of dataset.\n    var data = this.getRawData();\n    data.appendData(params.data);\n  };\n  /**\n   * Consider some method like `filter`, `map` need make new data,\n   * We should make sure that `seriesModel.getData()` get correct\n   * data in the stream procedure. So we fetch data from upstream\n   * each time `task.perform` called.\n   */\n  SeriesModel.prototype.getData = function (dataType) {\n    var task = getCurrentTask(this);\n    if (task) {\n      var data = task.context.data;\n      return dataType == null || !data.getLinkedData ? data : data.getLinkedData(dataType);\n    } else {\n      // When series is not alive (that may happen when click toolbox\n      // restore or setOption with not merge mode), series data may\n      // be still need to judge animation or something when graphic\n      // elements want to know whether fade out.\n      return inner(this).data;\n    }\n  };\n  SeriesModel.prototype.getAllData = function () {\n    var mainData = this.getData();\n    return mainData && mainData.getLinkedDataAll ? mainData.getLinkedDataAll() : [{\n      data: mainData\n    }];\n  };\n  SeriesModel.prototype.setData = function (data) {\n    var task = getCurrentTask(this);\n    if (task) {\n      var context = task.context;\n      // Consider case: filter, data sample.\n      // FIXME:TS never used, so comment it\n      // if (context.data !== data && task.modifyOutputEnd) {\n      //     task.setOutputEnd(data.count());\n      // }\n      context.outputData = data;\n      // Caution: setData should update context.data,\n      // Because getData may be called multiply in a\n      // single stage and expect to get the data just\n      // set. (For example, AxisProxy, x y both call\n      // getData and setDate sequentially).\n      // So the context.data should be fetched from\n      // upstream each time when a stage starts to be\n      // performed.\n      if (task !== this.dataTask) {\n        context.data = data;\n      }\n    }\n    inner(this).data = data;\n  };\n  SeriesModel.prototype.getEncode = function () {\n    var encode = this.get('encode', true);\n    if (encode) {\n      return zrUtil.createHashMap(encode);\n    }\n  };\n  SeriesModel.prototype.getSourceManager = function () {\n    return inner(this).sourceManager;\n  };\n  SeriesModel.prototype.getSource = function () {\n    return this.getSourceManager().getSource();\n  };\n  /**\n   * Get data before processed\n   */\n  SeriesModel.prototype.getRawData = function () {\n    return inner(this).dataBeforeProcessed;\n  };\n  SeriesModel.prototype.getColorBy = function () {\n    var colorBy = this.get('colorBy');\n    return colorBy || 'series';\n  };\n  SeriesModel.prototype.isColorBySeries = function () {\n    return this.getColorBy() === 'series';\n  };\n  /**\n   * Get base axis if has coordinate system and has axis.\n   * By default use coordSys.getBaseAxis();\n   * Can be overridden for some chart.\n   * @return {type} description\n   */\n  SeriesModel.prototype.getBaseAxis = function () {\n    var coordSys = this.coordinateSystem;\n    // @ts-ignore\n    return coordSys && coordSys.getBaseAxis && coordSys.getBaseAxis();\n  };\n  /**\n   * Retrieve the index of nearest value in the view coordinate.\n   * Data position is compared with each axis's dataToCoord.\n   *\n   * @param axisDim axis dimension\n   * @param dim data dimension\n   * @param value\n   * @param [maxDistance=Infinity] The maximum distance in view coordinate space\n   * @return If and only if multiple indices has\n   *         the same value, they are put to the result.\n   */\n  SeriesModel.prototype.indicesOfNearest = function (axisDim, dim, value, maxDistance) {\n    var data = this.getData();\n    var coordSys = this.coordinateSystem;\n    var axis = coordSys && coordSys.getAxis(axisDim);\n    if (!coordSys || !axis) {\n      return [];\n    }\n    var targetCoord = axis.dataToCoord(value);\n    if (maxDistance == null) {\n      maxDistance = Infinity;\n    }\n    var nearestIndices = [];\n    var minDist = Infinity;\n    var minDiff = -1;\n    var nearestIndicesLen = 0;\n    data.each(dim, function (dimValue, idx) {\n      var dataCoord = axis.dataToCoord(dimValue);\n      var diff = targetCoord - dataCoord;\n      var dist = Math.abs(diff);\n      if (dist <= maxDistance) {\n        // When the `value` is at the middle of `this.get(dim, i)` and `this.get(dim, i+1)`,\n        // we'd better not push both of them to `nearestIndices`, otherwise it is easy to\n        // get more than one item in `nearestIndices` (more specifically, in `tooltip`).\n        // So we choose the one that `diff >= 0` in this case.\n        // But if `this.get(dim, i)` and `this.get(dim, j)` get the same value, both of them\n        // should be push to `nearestIndices`.\n        if (dist < minDist || dist === minDist && diff >= 0 && minDiff < 0) {\n          minDist = dist;\n          minDiff = diff;\n          nearestIndicesLen = 0;\n        }\n        if (diff === minDiff) {\n          nearestIndices[nearestIndicesLen++] = idx;\n        }\n      }\n    });\n    nearestIndices.length = nearestIndicesLen;\n    return nearestIndices;\n  };\n  /**\n   * Default tooltip formatter\n   *\n   * @param dataIndex\n   * @param multipleSeries\n   * @param dataType\n   * @param renderMode valid values: 'html'(by default) and 'richText'.\n   *        'html' is used for rendering tooltip in extra DOM form, and the result\n   *        string is used as DOM HTML content.\n   *        'richText' is used for rendering tooltip in rich text form, for those where\n   *        DOM operation is not supported.\n   * @return formatted tooltip with `html` and `markers`\n   *        Notice: The override method can also return string\n   */\n  SeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\n    return defaultSeriesFormatTooltip({\n      series: this,\n      dataIndex: dataIndex,\n      multipleSeries: multipleSeries\n    });\n  };\n  SeriesModel.prototype.isAnimationEnabled = function () {\n    var ecModel = this.ecModel;\n    // Disable animation if using echarts in node but not give ssr flag.\n    // In ssr mode, renderToString will generate svg with css animation.\n    if (env.node && !(ecModel && ecModel.ssr)) {\n      return false;\n    }\n    var animationEnabled = this.getShallow('animation');\n    if (animationEnabled) {\n      if (this.getData().count() > this.getShallow('animationThreshold')) {\n        animationEnabled = false;\n      }\n    }\n    return !!animationEnabled;\n  };\n  SeriesModel.prototype.restoreData = function () {\n    this.dataTask.dirty();\n  };\n  SeriesModel.prototype.getColorFromPalette = function (name, scope, requestColorNum) {\n    var ecModel = this.ecModel;\n    // PENDING\n    var color = PaletteMixin.prototype.getColorFromPalette.call(this, name, scope, requestColorNum);\n    if (!color) {\n      color = ecModel.getColorFromPalette(name, scope, requestColorNum);\n    }\n    return color;\n  };\n  /**\n   * Use `data.mapDimensionsAll(coordDim)` instead.\n   * @deprecated\n   */\n  SeriesModel.prototype.coordDimToDataDim = function (coordDim) {\n    return this.getRawData().mapDimensionsAll(coordDim);\n  };\n  /**\n   * Get progressive rendering count each step\n   */\n  SeriesModel.prototype.getProgressive = function () {\n    return this.get('progressive');\n  };\n  /**\n   * Get progressive rendering count each step\n   */\n  SeriesModel.prototype.getProgressiveThreshold = function () {\n    return this.get('progressiveThreshold');\n  };\n  // PENGING If selectedMode is null ?\n  SeriesModel.prototype.select = function (innerDataIndices, dataType) {\n    this._innerSelect(this.getData(dataType), innerDataIndices);\n  };\n  SeriesModel.prototype.unselect = function (innerDataIndices, dataType) {\n    var selectedMap = this.option.selectedMap;\n    if (!selectedMap) {\n      return;\n    }\n    var selectedMode = this.option.selectedMode;\n    var data = this.getData(dataType);\n    if (selectedMode === 'series' || selectedMap === 'all') {\n      this.option.selectedMap = {};\n      this._selectedDataIndicesMap = {};\n      return;\n    }\n    for (var i = 0; i < innerDataIndices.length; i++) {\n      var dataIndex = innerDataIndices[i];\n      var nameOrId = getSelectionKey(data, dataIndex);\n      selectedMap[nameOrId] = false;\n      this._selectedDataIndicesMap[nameOrId] = -1;\n    }\n  };\n  SeriesModel.prototype.toggleSelect = function (innerDataIndices, dataType) {\n    var tmpArr = [];\n    for (var i = 0; i < innerDataIndices.length; i++) {\n      tmpArr[0] = innerDataIndices[i];\n      this.isSelected(innerDataIndices[i], dataType) ? this.unselect(tmpArr, dataType) : this.select(tmpArr, dataType);\n    }\n  };\n  SeriesModel.prototype.getSelectedDataIndices = function () {\n    if (this.option.selectedMap === 'all') {\n      return [].slice.call(this.getData().getIndices());\n    }\n    var selectedDataIndicesMap = this._selectedDataIndicesMap;\n    var nameOrIds = zrUtil.keys(selectedDataIndicesMap);\n    var dataIndices = [];\n    for (var i = 0; i < nameOrIds.length; i++) {\n      var dataIndex = selectedDataIndicesMap[nameOrIds[i]];\n      if (dataIndex >= 0) {\n        dataIndices.push(dataIndex);\n      }\n    }\n    return dataIndices;\n  };\n  SeriesModel.prototype.isSelected = function (dataIndex, dataType) {\n    var selectedMap = this.option.selectedMap;\n    if (!selectedMap) {\n      return false;\n    }\n    var data = this.getData(dataType);\n    return (selectedMap === 'all' || selectedMap[getSelectionKey(data, dataIndex)]) && !data.getItemModel(dataIndex).get(['select', 'disabled']);\n  };\n  SeriesModel.prototype.isUniversalTransitionEnabled = function () {\n    if (this[SERIES_UNIVERSAL_TRANSITION_PROP]) {\n      return true;\n    }\n    var universalTransitionOpt = this.option.universalTransition;\n    // Quick reject\n    if (!universalTransitionOpt) {\n      return false;\n    }\n    if (universalTransitionOpt === true) {\n      return true;\n    }\n    // Can be simply 'universalTransition: true'\n    return universalTransitionOpt && universalTransitionOpt.enabled;\n  };\n  SeriesModel.prototype._innerSelect = function (data, innerDataIndices) {\n    var _a, _b;\n    var option = this.option;\n    var selectedMode = option.selectedMode;\n    var len = innerDataIndices.length;\n    if (!selectedMode || !len) {\n      return;\n    }\n    if (selectedMode === 'series') {\n      option.selectedMap = 'all';\n    } else if (selectedMode === 'multiple') {\n      if (!zrUtil.isObject(option.selectedMap)) {\n        option.selectedMap = {};\n      }\n      var selectedMap = option.selectedMap;\n      for (var i = 0; i < len; i++) {\n        var dataIndex = innerDataIndices[i];\n        // TODO different types of data share same object.\n        var nameOrId = getSelectionKey(data, dataIndex);\n        selectedMap[nameOrId] = true;\n        this._selectedDataIndicesMap[nameOrId] = data.getRawIndex(dataIndex);\n      }\n    } else if (selectedMode === 'single' || selectedMode === true) {\n      var lastDataIndex = innerDataIndices[len - 1];\n      var nameOrId = getSelectionKey(data, lastDataIndex);\n      option.selectedMap = (_a = {}, _a[nameOrId] = true, _a);\n      this._selectedDataIndicesMap = (_b = {}, _b[nameOrId] = data.getRawIndex(lastDataIndex), _b);\n    }\n  };\n  SeriesModel.prototype._initSelectedMapFromData = function (data) {\n    // Ignore select info in data if selectedMap exists.\n    // NOTE It's only for legacy usage. edge data is not supported.\n    if (this.option.selectedMap) {\n      return;\n    }\n    var dataIndices = [];\n    if (data.hasItemOption) {\n      data.each(function (idx) {\n        var rawItem = data.getRawDataItem(idx);\n        if (rawItem && rawItem.selected) {\n          dataIndices.push(idx);\n        }\n      });\n    }\n    if (dataIndices.length > 0) {\n      this._innerSelect(data, dataIndices);\n    }\n  };\n  // /**\n  //  * @see {module:echarts/stream/Scheduler}\n  //  */\n  // abstract pipeTask: null\n  SeriesModel.registerClass = function (clz) {\n    return ComponentModel.registerClass(clz);\n  };\n  SeriesModel.protoInitialize = function () {\n    var proto = SeriesModel.prototype;\n    proto.type = 'series.__base__';\n    proto.seriesIndex = 0;\n    proto.ignoreStyleOnData = false;\n    proto.hasSymbolVisual = false;\n    proto.defaultSymbol = 'circle';\n    // Make sure the values can be accessed!\n    proto.visualStyleAccessPath = 'itemStyle';\n    proto.visualDrawType = 'fill';\n  }();\n  return SeriesModel;\n}(ComponentModel);\nzrUtil.mixin(SeriesModel, DataFormatMixin);\nzrUtil.mixin(SeriesModel, PaletteMixin);\nmountExtend(SeriesModel, ComponentModel);\n/**\n * MUST be called after `prepareSource` called\n * Here we need to make auto series, especially for auto legend. But we\n * do not modify series.name in option to avoid side effects.\n */\nfunction autoSeriesName(seriesModel) {\n  // User specified name has higher priority, otherwise it may cause\n  // series can not be queried unexpectedly.\n  var name = seriesModel.name;\n  if (!modelUtil.isNameSpecified(seriesModel)) {\n    seriesModel.name = getSeriesAutoName(seriesModel) || name;\n  }\n}\nfunction getSeriesAutoName(seriesModel) {\n  var data = seriesModel.getRawData();\n  var dataDims = data.mapDimensionsAll('seriesName');\n  var nameArr = [];\n  zrUtil.each(dataDims, function (dataDim) {\n    var dimInfo = data.getDimensionInfo(dataDim);\n    dimInfo.displayName && nameArr.push(dimInfo.displayName);\n  });\n  return nameArr.join(' ');\n}\nfunction dataTaskCount(context) {\n  return context.model.getRawData().count();\n}\nfunction dataTaskReset(context) {\n  var seriesModel = context.model;\n  seriesModel.setData(seriesModel.getRawData().cloneShallow());\n  return dataTaskProgress;\n}\nfunction dataTaskProgress(param, context) {\n  // Avoid repeat cloneShallow when data just created in reset.\n  if (context.outputData && param.end > context.outputData.count()) {\n    context.model.getRawData().cloneShallow(context.outputData);\n  }\n}\n// TODO refactor\nfunction wrapData(data, seriesModel) {\n  zrUtil.each(zrUtil.concatArray(data.CHANGABLE_METHODS, data.DOWNSAMPLE_METHODS), function (methodName) {\n    data.wrapMethod(methodName, zrUtil.curry(onDataChange, seriesModel));\n  });\n}\nfunction onDataChange(seriesModel, newList) {\n  var task = getCurrentTask(seriesModel);\n  if (task) {\n    // Consider case: filter, selectRange\n    task.setOutputEnd((newList || this).count());\n  }\n  return newList;\n}\nfunction getCurrentTask(seriesModel) {\n  var scheduler = (seriesModel.ecModel || {}).scheduler;\n  var pipeline = scheduler && scheduler.getPipeline(seriesModel.uid);\n  if (pipeline) {\n    // When pipline finished, the currrentTask keep the last\n    // task (renderTask).\n    var task = pipeline.currentTask;\n    if (task) {\n      var agentStubMap = task.agentStubMap;\n      if (agentStubMap) {\n        task = agentStubMap.get(seriesModel.uid);\n      }\n    }\n    return task;\n  }\n}\nexport default SeriesModel;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport Group from 'zrender/lib/graphic/Group.js';\nimport * as componentUtil from '../util/component.js';\nimport * as clazzUtil from '../util/clazz.js';\nvar ComponentView = /** @class */function () {\n  function ComponentView() {\n    this.group = new Group();\n    this.uid = componentUtil.getUID('viewComponent');\n  }\n  ComponentView.prototype.init = function (ecModel, api) {};\n  ComponentView.prototype.render = function (model, ecModel, api, payload) {};\n  ComponentView.prototype.dispose = function (ecModel, api) {};\n  ComponentView.prototype.updateView = function (model, ecModel, api, payload) {\n    // Do nothing;\n  };\n  ComponentView.prototype.updateLayout = function (model, ecModel, api, payload) {\n    // Do nothing;\n  };\n  ComponentView.prototype.updateVisual = function (model, ecModel, api, payload) {\n    // Do nothing;\n  };\n  /**\n   * Hook for toggle blur target series.\n   * Can be used in marker for blur or leave blur the markers\n   */\n  ComponentView.prototype.toggleBlurSeries = function (seriesModels, isBlur, ecModel) {\n    // Do nothing;\n  };\n  /**\n   * Traverse the new rendered elements.\n   *\n   * It will traverse the new added element in progressive rendering.\n   * And traverse all in normal rendering.\n   */\n  ComponentView.prototype.eachRendered = function (cb) {\n    var group = this.group;\n    if (group) {\n      group.traverse(cb);\n    }\n  };\n  return ComponentView;\n}();\n;\nclazzUtil.enableClassExtend(ComponentView);\nclazzUtil.enableClassManagement(ComponentView);\nexport default ComponentView;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { makeInner } from '../../util/model.js';\n/**\n * @return {string} If large mode changed, return string 'reset';\n */\nexport default function createRenderPlanner() {\n  var inner = makeInner();\n  return function (seriesModel) {\n    var fields = inner(seriesModel);\n    var pipelineContext = seriesModel.pipelineContext;\n    var originalLarge = !!fields.large;\n    var originalProgressive = !!fields.progressiveRender;\n    // FIXME: if the planner works on a filtered series, `pipelineContext` does not\n    // exists. See #11611 . Probably we need to modify this structure, see the comment\n    // on `performRawSeries` in `Schedular.js`.\n    var large = fields.large = !!(pipelineContext && pipelineContext.large);\n    var progressive = fields.progressiveRender = !!(pipelineContext && pipelineContext.progressiveRender);\n    return !!(originalLarge !== large || originalProgressive !== progressive) && 'reset';\n  };\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { each } from 'zrender/lib/core/util.js';\nimport Group from 'zrender/lib/graphic/Group.js';\nimport * as componentUtil from '../util/component.js';\nimport * as clazzUtil from '../util/clazz.js';\nimport * as modelUtil from '../util/model.js';\nimport { enterEmphasis, leaveEmphasis, getHighlightDigit, isHighDownDispatcher } from '../util/states.js';\nimport { createTask } from '../core/task.js';\nimport createRenderPlanner from '../chart/helper/createRenderPlanner.js';\nimport { traverseElements } from '../util/graphic.js';\nimport { error } from '../util/log.js';\nvar inner = modelUtil.makeInner();\nvar renderPlanner = createRenderPlanner();\nvar ChartView = /** @class */function () {\n  function ChartView() {\n    this.group = new Group();\n    this.uid = componentUtil.getUID('viewChart');\n    this.renderTask = createTask({\n      plan: renderTaskPlan,\n      reset: renderTaskReset\n    });\n    this.renderTask.context = {\n      view: this\n    };\n  }\n  ChartView.prototype.init = function (ecModel, api) {};\n  ChartView.prototype.render = function (seriesModel, ecModel, api, payload) {\n    if (process.env.NODE_ENV !== 'production') {\n      throw new Error('render method must been implemented');\n    }\n  };\n  /**\n   * Highlight series or specified data item.\n   */\n  ChartView.prototype.highlight = function (seriesModel, ecModel, api, payload) {\n    var data = seriesModel.getData(payload && payload.dataType);\n    if (!data) {\n      if (process.env.NODE_ENV !== 'production') {\n        error(\"Unknown dataType \" + payload.dataType);\n      }\n      return;\n    }\n    toggleHighlight(data, payload, 'emphasis');\n  };\n  /**\n   * Downplay series or specified data item.\n   */\n  ChartView.prototype.downplay = function (seriesModel, ecModel, api, payload) {\n    var data = seriesModel.getData(payload && payload.dataType);\n    if (!data) {\n      if (process.env.NODE_ENV !== 'production') {\n        error(\"Unknown dataType \" + payload.dataType);\n      }\n      return;\n    }\n    toggleHighlight(data, payload, 'normal');\n  };\n  /**\n   * Remove self.\n   */\n  ChartView.prototype.remove = function (ecModel, api) {\n    this.group.removeAll();\n  };\n  /**\n   * Dispose self.\n   */\n  ChartView.prototype.dispose = function (ecModel, api) {};\n  ChartView.prototype.updateView = function (seriesModel, ecModel, api, payload) {\n    this.render(seriesModel, ecModel, api, payload);\n  };\n  // FIXME never used?\n  ChartView.prototype.updateLayout = function (seriesModel, ecModel, api, payload) {\n    this.render(seriesModel, ecModel, api, payload);\n  };\n  // FIXME never used?\n  ChartView.prototype.updateVisual = function (seriesModel, ecModel, api, payload) {\n    this.render(seriesModel, ecModel, api, payload);\n  };\n  /**\n   * Traverse the new rendered elements.\n   *\n   * It will traverse the new added element in progressive rendering.\n   * And traverse all in normal rendering.\n   */\n  ChartView.prototype.eachRendered = function (cb) {\n    traverseElements(this.group, cb);\n  };\n  ChartView.markUpdateMethod = function (payload, methodName) {\n    inner(payload).updateMethod = methodName;\n  };\n  ChartView.protoInitialize = function () {\n    var proto = ChartView.prototype;\n    proto.type = 'chart';\n  }();\n  return ChartView;\n}();\n;\n/**\n * Set state of single element\n */\nfunction elSetState(el, state, highlightDigit) {\n  if (el && isHighDownDispatcher(el)) {\n    (state === 'emphasis' ? enterEmphasis : leaveEmphasis)(el, highlightDigit);\n  }\n}\nfunction toggleHighlight(data, payload, state) {\n  var dataIndex = modelUtil.queryDataIndex(data, payload);\n  var highlightDigit = payload && payload.highlightKey != null ? getHighlightDigit(payload.highlightKey) : null;\n  if (dataIndex != null) {\n    each(modelUtil.normalizeToArray(dataIndex), function (dataIdx) {\n      elSetState(data.getItemGraphicEl(dataIdx), state, highlightDigit);\n    });\n  } else {\n    data.eachItemGraphicEl(function (el) {\n      elSetState(el, state, highlightDigit);\n    });\n  }\n}\nclazzUtil.enableClassExtend(ChartView, ['dispose']);\nclazzUtil.enableClassManagement(ChartView);\nfunction renderTaskPlan(context) {\n  return renderPlanner(context.model);\n}\nfunction renderTaskReset(context) {\n  var seriesModel = context.model;\n  var ecModel = context.ecModel;\n  var api = context.api;\n  var payload = context.payload;\n  // FIXME: remove updateView updateVisual\n  var progressiveRender = seriesModel.pipelineContext.progressiveRender;\n  var view = context.view;\n  var updateMethod = payload && inner(payload).updateMethod;\n  var methodName = progressiveRender ? 'incrementalPrepareRender' : updateMethod && view[updateMethod] ? updateMethod\n  // `appendData` is also supported when data amount\n  // is less than progressive threshold.\n  : 'render';\n  if (methodName !== 'render') {\n    view[methodName](seriesModel, ecModel, api, payload);\n  }\n  return progressMethodMap[methodName];\n}\nvar progressMethodMap = {\n  incrementalPrepareRender: {\n    progress: function (params, context) {\n      context.view.incrementalRender(params, context.model, context.ecModel, context.api, context.payload);\n    }\n  },\n  render: {\n    // Put view.render in `progress` to support appendData. But in this case\n    // view.render should not be called in reset, otherwise it will be called\n    // twise. Use `forceFirstProgress` to make sure that view.render is called\n    // in any cases.\n    forceFirstProgress: true,\n    progress: function (params, context) {\n      context.view.render(context.model, context.ecModel, context.api, context.payload);\n    }\n  }\n};\nexport default ChartView;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nvar ORIGIN_METHOD = '\\0__throttleOriginMethod';\nvar RATE = '\\0__throttleRate';\nvar THROTTLE_TYPE = '\\0__throttleType';\n;\n/**\n * @public\n * @param {(Function)} fn\n * @param {number} [delay=0] Unit: ms.\n * @param {boolean} [debounce=false]\n *        true: If call interval less than `delay`, only the last call works.\n *        false: If call interval less than `delay, call works on fixed rate.\n * @return {(Function)} throttled fn.\n */\nexport function throttle(fn, delay, debounce) {\n  var currCall;\n  var lastCall = 0;\n  var lastExec = 0;\n  var timer = null;\n  var diff;\n  var scope;\n  var args;\n  var debounceNextCall;\n  delay = delay || 0;\n  function exec() {\n    lastExec = new Date().getTime();\n    timer = null;\n    fn.apply(scope, args || []);\n  }\n  var cb = function () {\n    var cbArgs = [];\n    for (var _i = 0; _i < arguments.length; _i++) {\n      cbArgs[_i] = arguments[_i];\n    }\n    currCall = new Date().getTime();\n    scope = this;\n    args = cbArgs;\n    var thisDelay = debounceNextCall || delay;\n    var thisDebounce = debounceNextCall || debounce;\n    debounceNextCall = null;\n    diff = currCall - (thisDebounce ? lastCall : lastExec) - thisDelay;\n    clearTimeout(timer);\n    // Here we should make sure that: the `exec` SHOULD NOT be called later\n    // than a new call of `cb`, that is, preserving the command order. Consider\n    // calculating \"scale rate\" when roaming as an example. When a call of `cb`\n    // happens, either the `exec` is called dierectly, or the call is delayed.\n    // But the delayed call should never be later than next call of `cb`. Under\n    // this assurance, we can simply update view state each time `dispatchAction`\n    // triggered by user roaming, but not need to add extra code to avoid the\n    // state being \"rolled-back\".\n    if (thisDebounce) {\n      timer = setTimeout(exec, thisDelay);\n    } else {\n      if (diff >= 0) {\n        exec();\n      } else {\n        timer = setTimeout(exec, -diff);\n      }\n    }\n    lastCall = currCall;\n  };\n  /**\n   * Clear throttle.\n   * @public\n   */\n  cb.clear = function () {\n    if (timer) {\n      clearTimeout(timer);\n      timer = null;\n    }\n  };\n  /**\n   * Enable debounce once.\n   */\n  cb.debounceNextCall = function (debounceDelay) {\n    debounceNextCall = debounceDelay;\n  };\n  return cb;\n}\n/**\n * Create throttle method or update throttle rate.\n *\n * @example\n * ComponentView.prototype.render = function () {\n *     ...\n *     throttle.createOrUpdate(\n *         this,\n *         '_dispatchAction',\n *         this.model.get('throttle'),\n *         'fixRate'\n *     );\n * };\n * ComponentView.prototype.remove = function () {\n *     throttle.clear(this, '_dispatchAction');\n * };\n * ComponentView.prototype.dispose = function () {\n *     throttle.clear(this, '_dispatchAction');\n * };\n *\n */\nexport function createOrUpdate(obj, fnAttr, rate, throttleType) {\n  var fn = obj[fnAttr];\n  if (!fn) {\n    return;\n  }\n  var originFn = fn[ORIGIN_METHOD] || fn;\n  var lastThrottleType = fn[THROTTLE_TYPE];\n  var lastRate = fn[RATE];\n  if (lastRate !== rate || lastThrottleType !== throttleType) {\n    if (rate == null || !throttleType) {\n      return obj[fnAttr] = originFn;\n    }\n    fn = obj[fnAttr] = throttle(originFn, rate, throttleType === 'debounce');\n    fn[ORIGIN_METHOD] = originFn;\n    fn[THROTTLE_TYPE] = throttleType;\n    fn[RATE] = rate;\n  }\n  return fn;\n}\n/**\n * Clear throttle. Example see throttle.createOrUpdate.\n */\nexport function clear(obj, fnAttr) {\n  var fn = obj[fnAttr];\n  if (fn && fn[ORIGIN_METHOD]) {\n    // Clear throttle\n    fn.clear && fn.clear();\n    obj[fnAttr] = fn[ORIGIN_METHOD];\n  }\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { isFunction, extend, createHashMap } from 'zrender/lib/core/util.js';\nimport makeStyleMapper from '../model/mixin/makeStyleMapper.js';\nimport { ITEM_STYLE_KEY_MAP } from '../model/mixin/itemStyle.js';\nimport { LINE_STYLE_KEY_MAP } from '../model/mixin/lineStyle.js';\nimport Model from '../model/Model.js';\nimport { makeInner } from '../util/model.js';\nvar inner = makeInner();\nvar defaultStyleMappers = {\n  itemStyle: makeStyleMapper(ITEM_STYLE_KEY_MAP, true),\n  lineStyle: makeStyleMapper(LINE_STYLE_KEY_MAP, true)\n};\nvar defaultColorKey = {\n  lineStyle: 'stroke',\n  itemStyle: 'fill'\n};\nfunction getStyleMapper(seriesModel, stylePath) {\n  var styleMapper = seriesModel.visualStyleMapper || defaultStyleMappers[stylePath];\n  if (!styleMapper) {\n    console.warn(\"Unknown style type '\" + stylePath + \"'.\");\n    return defaultStyleMappers.itemStyle;\n  }\n  return styleMapper;\n}\nfunction getDefaultColorKey(seriesModel, stylePath) {\n  // return defaultColorKey[stylePath] ||\n  var colorKey = seriesModel.visualDrawType || defaultColorKey[stylePath];\n  if (!colorKey) {\n    console.warn(\"Unknown style type '\" + stylePath + \"'.\");\n    return 'fill';\n  }\n  return colorKey;\n}\nvar seriesStyleTask = {\n  createOnAllSeries: true,\n  performRawSeries: true,\n  reset: function (seriesModel, ecModel) {\n    var data = seriesModel.getData();\n    var stylePath = seriesModel.visualStyleAccessPath || 'itemStyle';\n    // Set in itemStyle\n    var styleModel = seriesModel.getModel(stylePath);\n    var getStyle = getStyleMapper(seriesModel, stylePath);\n    var globalStyle = getStyle(styleModel);\n    var decalOption = styleModel.getShallow('decal');\n    if (decalOption) {\n      data.setVisual('decal', decalOption);\n      decalOption.dirty = true;\n    }\n    // TODO\n    var colorKey = getDefaultColorKey(seriesModel, stylePath);\n    var color = globalStyle[colorKey];\n    // TODO style callback\n    var colorCallback = isFunction(color) ? color : null;\n    var hasAutoColor = globalStyle.fill === 'auto' || globalStyle.stroke === 'auto';\n    // Get from color palette by default.\n    if (!globalStyle[colorKey] || colorCallback || hasAutoColor) {\n      // Note: If some series has color specified (e.g., by itemStyle.color), we DO NOT\n      // make it effect palette. Because some scenarios users need to make some series\n      // transparent or as background, which should better not effect the palette.\n      var colorPalette = seriesModel.getColorFromPalette(\n      // TODO series count changed.\n      seriesModel.name, null, ecModel.getSeriesCount());\n      if (!globalStyle[colorKey]) {\n        globalStyle[colorKey] = colorPalette;\n        data.setVisual('colorFromPalette', true);\n      }\n      globalStyle.fill = globalStyle.fill === 'auto' || isFunction(globalStyle.fill) ? colorPalette : globalStyle.fill;\n      globalStyle.stroke = globalStyle.stroke === 'auto' || isFunction(globalStyle.stroke) ? colorPalette : globalStyle.stroke;\n    }\n    data.setVisual('style', globalStyle);\n    data.setVisual('drawType', colorKey);\n    // Only visible series has each data be visual encoded\n    if (!ecModel.isSeriesFiltered(seriesModel) && colorCallback) {\n      data.setVisual('colorFromPalette', false);\n      return {\n        dataEach: function (data, idx) {\n          var dataParams = seriesModel.getDataParams(idx);\n          var itemStyle = extend({}, globalStyle);\n          itemStyle[colorKey] = colorCallback(dataParams);\n          data.setItemVisual(idx, 'style', itemStyle);\n        }\n      };\n    }\n  }\n};\nvar sharedModel = new Model();\nvar dataStyleTask = {\n  createOnAllSeries: true,\n  performRawSeries: true,\n  reset: function (seriesModel, ecModel) {\n    if (seriesModel.ignoreStyleOnData || ecModel.isSeriesFiltered(seriesModel)) {\n      return;\n    }\n    var data = seriesModel.getData();\n    var stylePath = seriesModel.visualStyleAccessPath || 'itemStyle';\n    // Set in itemStyle\n    var getStyle = getStyleMapper(seriesModel, stylePath);\n    var colorKey = data.getVisual('drawType');\n    return {\n      dataEach: data.hasItemOption ? function (data, idx) {\n        // Not use getItemModel for performance considuration\n        var rawItem = data.getRawDataItem(idx);\n        if (rawItem && rawItem[stylePath]) {\n          sharedModel.option = rawItem[stylePath];\n          var style = getStyle(sharedModel);\n          var existsStyle = data.ensureUniqueItemVisual(idx, 'style');\n          extend(existsStyle, style);\n          if (sharedModel.option.decal) {\n            data.setItemVisual(idx, 'decal', sharedModel.option.decal);\n            sharedModel.option.decal.dirty = true;\n          }\n          if (colorKey in style) {\n            data.setItemVisual(idx, 'colorFromPalette', false);\n          }\n        }\n      } : null\n    };\n  }\n};\n// Pick color from palette for the data which has not been set with color yet.\n// Note: do not support stream rendering. No such cases yet.\nvar dataColorPaletteTask = {\n  performRawSeries: true,\n  overallReset: function (ecModel) {\n    // Each type of series uses one scope.\n    // Pie and funnel are using different scopes.\n    var paletteScopeGroupByType = createHashMap();\n    ecModel.eachSeries(function (seriesModel) {\n      var colorBy = seriesModel.getColorBy();\n      if (seriesModel.isColorBySeries()) {\n        return;\n      }\n      var key = seriesModel.type + '-' + colorBy;\n      var colorScope = paletteScopeGroupByType.get(key);\n      if (!colorScope) {\n        colorScope = {};\n        paletteScopeGroupByType.set(key, colorScope);\n      }\n      inner(seriesModel).scope = colorScope;\n    });\n    ecModel.eachSeries(function (seriesModel) {\n      if (seriesModel.isColorBySeries() || ecModel.isSeriesFiltered(seriesModel)) {\n        return;\n      }\n      var dataAll = seriesModel.getRawData();\n      var idxMap = {};\n      var data = seriesModel.getData();\n      var colorScope = inner(seriesModel).scope;\n      var stylePath = seriesModel.visualStyleAccessPath || 'itemStyle';\n      var colorKey = getDefaultColorKey(seriesModel, stylePath);\n      data.each(function (idx) {\n        var rawIdx = data.getRawIndex(idx);\n        idxMap[rawIdx] = idx;\n      });\n      // Iterate on data before filtered. To make sure color from palette can be\n      // Consistent when toggling legend.\n      dataAll.each(function (rawIdx) {\n        var idx = idxMap[rawIdx];\n        var fromPalette = data.getItemVisual(idx, 'colorFromPalette');\n        // Get color from palette for each data only when the color is inherited from series color, which is\n        // also picked from color palette. So following situation is not in the case:\n        // 1. series.itemStyle.color is set\n        // 2. color is encoded by visualMap\n        if (fromPalette) {\n          var itemStyle = data.ensureUniqueItemVisual(idx, 'style');\n          var name_1 = dataAll.getName(rawIdx) || rawIdx + '';\n          var dataCount = dataAll.count();\n          itemStyle[colorKey] = seriesModel.getColorFromPalette(name_1, colorScope, dataCount);\n        }\n      });\n    });\n  }\n};\nexport { seriesStyleTask, dataStyleTask, dataColorPaletteTask };", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as graphic from '../util/graphic.js';\nimport tokens from '../visual/tokens.js';\nvar PI = Math.PI;\n/**\n * @param {module:echarts/ExtensionAPI} api\n * @param {Object} [opts]\n * @param {string} [opts.text]\n * @param {string} [opts.color]\n * @param {string} [opts.textColor]\n * @return {module:zrender/Element}\n */\nexport default function defaultLoading(api, opts) {\n  opts = opts || {};\n  zrUtil.defaults(opts, {\n    text: 'loading',\n    textColor: tokens.color.primary,\n    fontSize: 12,\n    fontWeight: 'normal',\n    fontStyle: 'normal',\n    fontFamily: 'sans-serif',\n    maskColor: 'rgba(255,255,255,0.8)',\n    showSpinner: true,\n    color: tokens.color.theme[0],\n    spinnerRadius: 10,\n    lineWidth: 5,\n    zlevel: 0\n  });\n  var group = new graphic.Group();\n  var mask = new graphic.Rect({\n    style: {\n      fill: opts.maskColor\n    },\n    zlevel: opts.zlevel,\n    z: 10000\n  });\n  group.add(mask);\n  var textContent = new graphic.Text({\n    style: {\n      text: opts.text,\n      fill: opts.textColor,\n      fontSize: opts.fontSize,\n      fontWeight: opts.fontWeight,\n      fontStyle: opts.fontStyle,\n      fontFamily: opts.fontFamily\n    },\n    zlevel: opts.zlevel,\n    z: 10001\n  });\n  var labelRect = new graphic.Rect({\n    style: {\n      fill: 'none'\n    },\n    textContent: textContent,\n    textConfig: {\n      position: 'right',\n      distance: 10\n    },\n    zlevel: opts.zlevel,\n    z: 10001\n  });\n  group.add(labelRect);\n  var arc;\n  if (opts.showSpinner) {\n    arc = new graphic.Arc({\n      shape: {\n        startAngle: -PI / 2,\n        endAngle: -PI / 2 + 0.1,\n        r: opts.spinnerRadius\n      },\n      style: {\n        stroke: opts.color,\n        lineCap: 'round',\n        lineWidth: opts.lineWidth\n      },\n      zlevel: opts.zlevel,\n      z: 10001\n    });\n    arc.animateShape(true).when(1000, {\n      endAngle: PI * 3 / 2\n    }).start('circularInOut');\n    arc.animateShape(true).when(1000, {\n      startAngle: PI * 3 / 2\n    }).delay(300).start('circularInOut');\n    group.add(arc);\n  }\n  // Inject resize\n  group.resize = function () {\n    var textWidth = textContent.getBoundingRect().width;\n    var r = opts.showSpinner ? opts.spinnerRadius : 0;\n    // cx = (containerWidth - arcDiameter - textDistance - textWidth) / 2\n    // textDistance needs to be calculated when both animation and text exist\n    var cx = (api.getWidth() - r * 2 - (opts.showSpinner && textWidth ? 10 : 0) - textWidth) / 2 - (opts.showSpinner && textWidth ? 0 : 5 + textWidth / 2)\n    // only show the text\n    + (opts.showSpinner ? 0 : textWidth / 2)\n    // only show the spinner\n    + (textWidth ? 0 : r);\n    var cy = api.getHeight() / 2;\n    opts.showSpinner && arc.setShape({\n      cx: cx,\n      cy: cy\n    });\n    labelRect.setShape({\n      x: cx - r,\n      y: cy - r,\n      width: r * 2,\n      height: r * 2\n    });\n    mask.setShape({\n      x: 0,\n      y: 0,\n      width: api.getWidth(),\n      height: api.getHeight()\n    });\n  };\n  group.resize();\n  return group;\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { each, map, isFunction, createHashMap, noop, assert } from 'zrender/lib/core/util.js';\nimport { createTask } from './task.js';\nimport { getUID } from '../util/component.js';\nimport GlobalModel from '../model/Global.js';\nimport ExtensionAPI from './ExtensionAPI.js';\nimport { normalizeToArray } from '../util/model.js';\n;\nvar Scheduler = /** @class */function () {\n  function Scheduler(ecInstance, api, dataProcessorHandlers, visualHandlers) {\n    // key: handlerUID\n    this._stageTaskMap = createHashMap();\n    this.ecInstance = ecInstance;\n    this.api = api;\n    // Fix current processors in case that in some rear cases that\n    // processors might be registered after echarts instance created.\n    // Register processors incrementally for a echarts instance is\n    // not supported by this stream architecture.\n    dataProcessorHandlers = this._dataProcessorHandlers = dataProcessorHandlers.slice();\n    visualHandlers = this._visualHandlers = visualHandlers.slice();\n    this._allHandlers = dataProcessorHandlers.concat(visualHandlers);\n  }\n  Scheduler.prototype.restoreData = function (ecModel, payload) {\n    // TODO: Only restore needed series and components, but not all components.\n    // Currently `restoreData` of all of the series and component will be called.\n    // But some independent components like `title`, `legend`, `graphic`, `toolbox`,\n    // `tooltip`, `axisPointer`, etc, do not need series refresh when `setOption`,\n    // and some components like coordinate system, axes, dataZoom, visualMap only\n    // need their target series refresh.\n    // (1) If we are implementing this feature some day, we should consider these cases:\n    // if a data processor depends on a component (e.g., dataZoomProcessor depends\n    // on the settings of `dataZoom`), it should be re-performed if the component\n    // is modified by `setOption`.\n    // (2) If a processor depends on sevral series, speicified by its `getTargetSeries`,\n    // it should be re-performed when the result array of `getTargetSeries` changed.\n    // We use `dependencies` to cover these issues.\n    // (3) How to update target series when coordinate system related components modified.\n    // TODO: simply the dirty mechanism? Check whether only the case here can set tasks dirty,\n    // and this case all of the tasks will be set as dirty.\n    ecModel.restoreData(payload);\n    // Theoretically an overall task not only depends on each of its target series, but also\n    // depends on all of the series.\n    // The overall task is not in pipeline, and `ecModel.restoreData` only set pipeline tasks\n    // dirty. If `getTargetSeries` of an overall task returns nothing, we should also ensure\n    // that the overall task is set as dirty and to be performed, otherwise it probably cause\n    // state chaos. So we have to set dirty of all of the overall tasks manually, otherwise it\n    // probably cause state chaos (consider `dataZoomProcessor`).\n    this._stageTaskMap.each(function (taskRecord) {\n      var overallTask = taskRecord.overallTask;\n      overallTask && overallTask.dirty();\n    });\n  };\n  // If seriesModel provided, incremental threshold is check by series data.\n  Scheduler.prototype.getPerformArgs = function (task, isBlock) {\n    // For overall task\n    if (!task.__pipeline) {\n      return;\n    }\n    var pipeline = this._pipelineMap.get(task.__pipeline.id);\n    var pCtx = pipeline.context;\n    var incremental = !isBlock && pipeline.progressiveEnabled && (!pCtx || pCtx.progressiveRender) && task.__idxInPipeline > pipeline.blockIndex;\n    var step = incremental ? pipeline.step : null;\n    var modDataCount = pCtx && pCtx.modDataCount;\n    var modBy = modDataCount != null ? Math.ceil(modDataCount / step) : null;\n    return {\n      step: step,\n      modBy: modBy,\n      modDataCount: modDataCount\n    };\n  };\n  Scheduler.prototype.getPipeline = function (pipelineId) {\n    return this._pipelineMap.get(pipelineId);\n  };\n  /**\n   * Current, progressive rendering starts from visual and layout.\n   * Always detect render mode in the same stage, avoiding that incorrect\n   * detection caused by data filtering.\n   * Caution:\n   * `updateStreamModes` use `seriesModel.getData()`.\n   */\n  Scheduler.prototype.updateStreamModes = function (seriesModel, view) {\n    var pipeline = this._pipelineMap.get(seriesModel.uid);\n    var data = seriesModel.getData();\n    var dataLen = data.count();\n    // `progressiveRender` means that can render progressively in each\n    // animation frame. Note that some types of series do not provide\n    // `view.incrementalPrepareRender` but support `chart.appendData`. We\n    // use the term `incremental` but not `progressive` to describe the\n    // case that `chart.appendData`.\n    var progressiveRender = pipeline.progressiveEnabled && view.incrementalPrepareRender && dataLen >= pipeline.threshold;\n    var large = seriesModel.get('large') && dataLen >= seriesModel.get('largeThreshold');\n    // TODO: modDataCount should not updated if `appendData`, otherwise cause whole repaint.\n    // see `test/candlestick-large3.html`\n    var modDataCount = seriesModel.get('progressiveChunkMode') === 'mod' ? dataLen : null;\n    seriesModel.pipelineContext = pipeline.context = {\n      progressiveRender: progressiveRender,\n      modDataCount: modDataCount,\n      large: large\n    };\n  };\n  Scheduler.prototype.restorePipelines = function (ecModel) {\n    var scheduler = this;\n    var pipelineMap = scheduler._pipelineMap = createHashMap();\n    ecModel.eachSeries(function (seriesModel) {\n      var progressive = seriesModel.getProgressive();\n      var pipelineId = seriesModel.uid;\n      pipelineMap.set(pipelineId, {\n        id: pipelineId,\n        head: null,\n        tail: null,\n        threshold: seriesModel.getProgressiveThreshold(),\n        progressiveEnabled: progressive && !(seriesModel.preventIncremental && seriesModel.preventIncremental()),\n        blockIndex: -1,\n        step: Math.round(progressive || 700),\n        count: 0\n      });\n      scheduler._pipe(seriesModel, seriesModel.dataTask);\n    });\n  };\n  Scheduler.prototype.prepareStageTasks = function () {\n    var stageTaskMap = this._stageTaskMap;\n    var ecModel = this.api.getModel();\n    var api = this.api;\n    each(this._allHandlers, function (handler) {\n      var record = stageTaskMap.get(handler.uid) || stageTaskMap.set(handler.uid, {});\n      var errMsg = '';\n      if (process.env.NODE_ENV !== 'production') {\n        // Currently do not need to support to sepecify them both.\n        errMsg = '\"reset\" and \"overallReset\" must not be both specified.';\n      }\n      assert(!(handler.reset && handler.overallReset), errMsg);\n      handler.reset && this._createSeriesStageTask(handler, record, ecModel, api);\n      handler.overallReset && this._createOverallStageTask(handler, record, ecModel, api);\n    }, this);\n  };\n  Scheduler.prototype.prepareView = function (view, model, ecModel, api) {\n    var renderTask = view.renderTask;\n    var context = renderTask.context;\n    context.model = model;\n    context.ecModel = ecModel;\n    context.api = api;\n    renderTask.__block = !view.incrementalPrepareRender;\n    this._pipe(model, renderTask);\n  };\n  Scheduler.prototype.performDataProcessorTasks = function (ecModel, payload) {\n    // If we do not use `block` here, it should be considered when to update modes.\n    this._performStageTasks(this._dataProcessorHandlers, ecModel, payload, {\n      block: true\n    });\n  };\n  Scheduler.prototype.performVisualTasks = function (ecModel, payload, opt) {\n    this._performStageTasks(this._visualHandlers, ecModel, payload, opt);\n  };\n  Scheduler.prototype._performStageTasks = function (stageHandlers, ecModel, payload, opt) {\n    opt = opt || {};\n    var unfinished = false;\n    var scheduler = this;\n    each(stageHandlers, function (stageHandler, idx) {\n      if (opt.visualType && opt.visualType !== stageHandler.visualType) {\n        return;\n      }\n      var stageHandlerRecord = scheduler._stageTaskMap.get(stageHandler.uid);\n      var seriesTaskMap = stageHandlerRecord.seriesTaskMap;\n      var overallTask = stageHandlerRecord.overallTask;\n      if (overallTask) {\n        var overallNeedDirty_1;\n        var agentStubMap = overallTask.agentStubMap;\n        agentStubMap.each(function (stub) {\n          if (needSetDirty(opt, stub)) {\n            stub.dirty();\n            overallNeedDirty_1 = true;\n          }\n        });\n        overallNeedDirty_1 && overallTask.dirty();\n        scheduler.updatePayload(overallTask, payload);\n        var performArgs_1 = scheduler.getPerformArgs(overallTask, opt.block);\n        // Execute stubs firstly, which may set the overall task dirty,\n        // then execute the overall task. And stub will call seriesModel.setData,\n        // which ensures that in the overallTask seriesModel.getData() will not\n        // return incorrect data.\n        agentStubMap.each(function (stub) {\n          stub.perform(performArgs_1);\n        });\n        if (overallTask.perform(performArgs_1)) {\n          unfinished = true;\n        }\n      } else if (seriesTaskMap) {\n        seriesTaskMap.each(function (task, pipelineId) {\n          if (needSetDirty(opt, task)) {\n            task.dirty();\n          }\n          var performArgs = scheduler.getPerformArgs(task, opt.block);\n          // FIXME\n          // if intending to declare `performRawSeries` in handlers, only\n          // stream-independent (specifically, data item independent) operations can be\n          // performed. Because if a series is filtered, most of the tasks will not\n          // be performed. A stream-dependent operation probably cause wrong biz logic.\n          // Perhaps we should not provide a separate callback for this case instead\n          // of providing the config `performRawSeries`. The stream-dependent operations\n          // and stream-independent operations should better not be mixed.\n          performArgs.skip = !stageHandler.performRawSeries && ecModel.isSeriesFiltered(task.context.model);\n          scheduler.updatePayload(task, payload);\n          if (task.perform(performArgs)) {\n            unfinished = true;\n          }\n        });\n      }\n    });\n    function needSetDirty(opt, task) {\n      return opt.setDirty && (!opt.dirtyMap || opt.dirtyMap.get(task.__pipeline.id));\n    }\n    this.unfinished = unfinished || this.unfinished;\n  };\n  Scheduler.prototype.performSeriesTasks = function (ecModel) {\n    var unfinished;\n    ecModel.eachSeries(function (seriesModel) {\n      // Progress to the end for dataInit and dataRestore.\n      unfinished = seriesModel.dataTask.perform() || unfinished;\n    });\n    this.unfinished = unfinished || this.unfinished;\n  };\n  Scheduler.prototype.plan = function () {\n    // Travel pipelines, check block.\n    this._pipelineMap.each(function (pipeline) {\n      var task = pipeline.tail;\n      do {\n        if (task.__block) {\n          pipeline.blockIndex = task.__idxInPipeline;\n          break;\n        }\n        task = task.getUpstream();\n      } while (task);\n    });\n  };\n  Scheduler.prototype.updatePayload = function (task, payload) {\n    payload !== 'remain' && (task.context.payload = payload);\n  };\n  Scheduler.prototype._createSeriesStageTask = function (stageHandler, stageHandlerRecord, ecModel, api) {\n    var scheduler = this;\n    var oldSeriesTaskMap = stageHandlerRecord.seriesTaskMap;\n    // The count of stages are totally about only several dozen, so\n    // do not need to reuse the map.\n    var newSeriesTaskMap = stageHandlerRecord.seriesTaskMap = createHashMap();\n    var seriesType = stageHandler.seriesType;\n    var getTargetSeries = stageHandler.getTargetSeries;\n    // If a stageHandler should cover all series, `createOnAllSeries` should be declared mandatorily,\n    // to avoid some typo or abuse. Otherwise if an extension do not specify a `seriesType`,\n    // it works but it may cause other irrelevant charts blocked.\n    if (stageHandler.createOnAllSeries) {\n      ecModel.eachRawSeries(create);\n    } else if (seriesType) {\n      ecModel.eachRawSeriesByType(seriesType, create);\n    } else if (getTargetSeries) {\n      getTargetSeries(ecModel, api).each(create);\n    }\n    function create(seriesModel) {\n      var pipelineId = seriesModel.uid;\n      // Init tasks for each seriesModel only once.\n      // Reuse original task instance.\n      var task = newSeriesTaskMap.set(pipelineId, oldSeriesTaskMap && oldSeriesTaskMap.get(pipelineId) || createTask({\n        plan: seriesTaskPlan,\n        reset: seriesTaskReset,\n        count: seriesTaskCount\n      }));\n      task.context = {\n        model: seriesModel,\n        ecModel: ecModel,\n        api: api,\n        // PENDING: `useClearVisual` not used?\n        useClearVisual: stageHandler.isVisual && !stageHandler.isLayout,\n        plan: stageHandler.plan,\n        reset: stageHandler.reset,\n        scheduler: scheduler\n      };\n      scheduler._pipe(seriesModel, task);\n    }\n  };\n  Scheduler.prototype._createOverallStageTask = function (stageHandler, stageHandlerRecord, ecModel, api) {\n    var scheduler = this;\n    var overallTask = stageHandlerRecord.overallTask = stageHandlerRecord.overallTask\n    // For overall task, the function only be called on reset stage.\n    || createTask({\n      reset: overallTaskReset\n    });\n    overallTask.context = {\n      ecModel: ecModel,\n      api: api,\n      overallReset: stageHandler.overallReset,\n      scheduler: scheduler\n    };\n    var oldAgentStubMap = overallTask.agentStubMap;\n    // The count of stages are totally about only several dozen, so\n    // do not need to reuse the map.\n    var newAgentStubMap = overallTask.agentStubMap = createHashMap();\n    var seriesType = stageHandler.seriesType;\n    var getTargetSeries = stageHandler.getTargetSeries;\n    var overallProgress = true;\n    var shouldOverallTaskDirty = false;\n    // FIXME:TS never used, so comment it\n    // let modifyOutputEnd = stageHandler.modifyOutputEnd;\n    // An overall task with seriesType detected or has `getTargetSeries`, we add\n    // stub in each pipelines, it will set the overall task dirty when the pipeline\n    // progress. Moreover, to avoid call the overall task each frame (too frequent),\n    // we set the pipeline block.\n    var errMsg = '';\n    if (process.env.NODE_ENV !== 'production') {\n      errMsg = '\"createOnAllSeries\" is not supported for \"overallReset\", ' + 'because it will block all streams.';\n    }\n    assert(!stageHandler.createOnAllSeries, errMsg);\n    if (seriesType) {\n      ecModel.eachRawSeriesByType(seriesType, createStub);\n    } else if (getTargetSeries) {\n      getTargetSeries(ecModel, api).each(createStub);\n    }\n    // Otherwise, (usually it is legacy case), the overall task will only be\n    // executed when upstream is dirty. Otherwise the progressive rendering of all\n    // pipelines will be disabled unexpectedly. But it still needs stubs to receive\n    // dirty info from upstream.\n    else {\n      overallProgress = false;\n      each(ecModel.getSeries(), createStub);\n    }\n    function createStub(seriesModel) {\n      var pipelineId = seriesModel.uid;\n      var stub = newAgentStubMap.set(pipelineId, oldAgentStubMap && oldAgentStubMap.get(pipelineId) || (\n      // When the result of `getTargetSeries` changed, the overallTask\n      // should be set as dirty and re-performed.\n      shouldOverallTaskDirty = true, createTask({\n        reset: stubReset,\n        onDirty: stubOnDirty\n      })));\n      stub.context = {\n        model: seriesModel,\n        overallProgress: overallProgress\n        // FIXME:TS never used, so comment it\n        // modifyOutputEnd: modifyOutputEnd\n      };\n      stub.agent = overallTask;\n      stub.__block = overallProgress;\n      scheduler._pipe(seriesModel, stub);\n    }\n    if (shouldOverallTaskDirty) {\n      overallTask.dirty();\n    }\n  };\n  Scheduler.prototype._pipe = function (seriesModel, task) {\n    var pipelineId = seriesModel.uid;\n    var pipeline = this._pipelineMap.get(pipelineId);\n    !pipeline.head && (pipeline.head = task);\n    pipeline.tail && pipeline.tail.pipe(task);\n    pipeline.tail = task;\n    task.__idxInPipeline = pipeline.count++;\n    task.__pipeline = pipeline;\n  };\n  Scheduler.wrapStageHandler = function (stageHandler, visualType) {\n    if (isFunction(stageHandler)) {\n      stageHandler = {\n        overallReset: stageHandler,\n        seriesType: detectSeriseType(stageHandler)\n      };\n    }\n    stageHandler.uid = getUID('stageHandler');\n    visualType && (stageHandler.visualType = visualType);\n    return stageHandler;\n  };\n  ;\n  return Scheduler;\n}();\nfunction overallTaskReset(context) {\n  context.overallReset(context.ecModel, context.api, context.payload);\n}\nfunction stubReset(context) {\n  return context.overallProgress && stubProgress;\n}\nfunction stubProgress() {\n  this.agent.dirty();\n  this.getDownstream().dirty();\n}\nfunction stubOnDirty() {\n  this.agent && this.agent.dirty();\n}\nfunction seriesTaskPlan(context) {\n  return context.plan ? context.plan(context.model, context.ecModel, context.api, context.payload) : null;\n}\nfunction seriesTaskReset(context) {\n  if (context.useClearVisual) {\n    context.data.clearAllVisual();\n  }\n  var resetDefines = context.resetDefines = normalizeToArray(context.reset(context.model, context.ecModel, context.api, context.payload));\n  return resetDefines.length > 1 ? map(resetDefines, function (v, idx) {\n    return makeSeriesTaskProgress(idx);\n  }) : singleSeriesTaskProgress;\n}\nvar singleSeriesTaskProgress = makeSeriesTaskProgress(0);\nfunction makeSeriesTaskProgress(resetDefineIdx) {\n  return function (params, context) {\n    var data = context.data;\n    var resetDefine = context.resetDefines[resetDefineIdx];\n    if (resetDefine && resetDefine.dataEach) {\n      for (var i = params.start; i < params.end; i++) {\n        resetDefine.dataEach(data, i);\n      }\n    } else if (resetDefine && resetDefine.progress) {\n      resetDefine.progress(params, data);\n    }\n  };\n}\nfunction seriesTaskCount(context) {\n  return context.data.count();\n}\n/**\n * Only some legacy stage handlers (usually in echarts extensions) are pure function.\n * To ensure that they can work normally, they should work in block mode, that is,\n * they should not be started util the previous tasks finished. So they cause the\n * progressive rendering disabled. We try to detect the series type, to narrow down\n * the block range to only the series type they concern, but not all series.\n */\nfunction detectSeriseType(legacyFunc) {\n  seriesType = null;\n  try {\n    // Assume there is no async when calling `eachSeriesByType`.\n    legacyFunc(ecModelMock, apiMock);\n  } catch (e) {}\n  return seriesType;\n}\nvar ecModelMock = {};\nvar apiMock = {};\nvar seriesType;\nmockMethods(ecModelMock, GlobalModel);\nmockMethods(apiMock, ExtensionAPI);\necModelMock.eachSeriesByType = ecModelMock.eachRawSeriesByType = function (type) {\n  seriesType = type;\n};\necModelMock.eachComponent = function (cond) {\n  if (cond.mainType === 'series' && cond.subType) {\n    seriesType = cond.subType;\n  }\n};\nfunction mockMethods(target, Clz) {\n  /* eslint-disable */\n  for (var name_1 in Clz.prototype) {\n    // Do not use hasOwnProperty\n    target[name_1] = noop;\n  }\n  /* eslint-enable */\n}\nexport default Scheduler;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport tokens from '../visual/tokens.js';\nvar color = tokens.darkColor;\nvar backgroundColor = color.background;\nvar axisCommon = function () {\n  return {\n    axisLine: {\n      lineStyle: {\n        color: color.axisLine\n      }\n    },\n    splitLine: {\n      lineStyle: {\n        color: color.axisSplitLine\n      }\n    },\n    splitArea: {\n      areaStyle: {\n        color: [color.backgroundTint, color.backgroundTransparent]\n      }\n    },\n    minorSplitLine: {\n      lineStyle: {\n        color: color.axisMinorSplitLine\n      }\n    },\n    axisLabel: {\n      color: color.axisLabel\n    },\n    axisName: {}\n  };\n};\nvar matrixAxis = {\n  label: {\n    color: color.secondary\n  },\n  itemStyle: {\n    borderColor: color.borderTint\n  },\n  dividerLineStyle: {\n    color: color.border\n  }\n};\nvar theme = {\n  darkMode: true,\n  color: color.theme,\n  backgroundColor: backgroundColor,\n  axisPointer: {\n    lineStyle: {\n      color: color.border\n    },\n    crossStyle: {\n      color: color.borderShade\n    },\n    label: {\n      color: color.tertiary\n    }\n  },\n  legend: {\n    textStyle: {\n      color: color.secondary\n    },\n    pageTextStyle: {\n      color: color.tertiary\n    }\n  },\n  textStyle: {\n    color: color.secondary\n  },\n  title: {\n    textStyle: {\n      color: color.primary\n    },\n    subtextStyle: {\n      color: color.quaternary\n    }\n  },\n  toolbox: {\n    iconStyle: {\n      borderColor: color.accent50\n    }\n  },\n  tooltip: {\n    backgroundColor: color.neutral20,\n    defaultBorderColor: color.border,\n    textStyle: {\n      color: color.tertiary\n    }\n  },\n  dataZoom: {\n    borderColor: color.accent10,\n    textStyle: {\n      color: color.tertiary\n    },\n    brushStyle: {\n      color: color.backgroundTint\n    },\n    handleStyle: {\n      color: color.neutral00,\n      borderColor: color.accent20\n    },\n    moveHandleStyle: {\n      color: color.accent40\n    },\n    emphasis: {\n      handleStyle: {\n        borderColor: color.accent50\n      }\n    },\n    dataBackground: {\n      lineStyle: {\n        color: color.accent30\n      },\n      areaStyle: {\n        color: color.accent20\n      }\n    },\n    selectedDataBackground: {\n      lineStyle: {\n        color: color.accent50\n      },\n      areaStyle: {\n        color: color.accent30\n      }\n    }\n  },\n  visualMap: {\n    textStyle: {\n      color: color.secondary\n    },\n    handleStyle: {\n      borderColor: color.neutral30\n    }\n  },\n  timeline: {\n    lineStyle: {\n      color: color.accent10\n    },\n    label: {\n      color: color.tertiary\n    },\n    controlStyle: {\n      color: color.accent30,\n      borderColor: color.accent30\n    }\n  },\n  calendar: {\n    itemStyle: {\n      color: color.neutral00,\n      borderColor: color.neutral20\n    },\n    dayLabel: {\n      color: color.tertiary\n    },\n    monthLabel: {\n      color: color.secondary\n    },\n    yearLabel: {\n      color: color.secondary\n    }\n  },\n  matrix: {\n    x: matrixAxis,\n    y: matrixAxis,\n    backgroundColor: {\n      borderColor: color.axisLine\n    },\n    body: {\n      itemStyle: {\n        borderColor: color.borderTint\n      }\n    }\n  },\n  timeAxis: axisCommon(),\n  logAxis: axisCommon(),\n  valueAxis: axisCommon(),\n  categoryAxis: axisCommon(),\n  line: {\n    symbol: 'circle'\n  },\n  graph: {\n    color: color.theme\n  },\n  gauge: {\n    title: {\n      color: color.secondary\n    },\n    axisLine: {\n      lineStyle: {\n        color: [[1, color.neutral05]]\n      }\n    },\n    axisLabel: {\n      color: color.axisLabel\n    },\n    detail: {\n      color: color.primary\n    }\n  },\n  candlestick: {\n    itemStyle: {\n      color: '#f64e56',\n      color0: '#54ea92',\n      borderColor: '#f64e56',\n      borderColor0: '#54ea92'\n      // borderColor: '#ca2824',\n      // borderColor0: '#09a443'\n    }\n  },\n  funnel: {\n    itemStyle: {\n      borderColor: color.background\n    }\n  },\n  radar: function () {\n    var radar = axisCommon();\n    radar.axisName = {\n      color: color.axisLabel\n    };\n    radar.axisLine.lineStyle.color = color.neutral20;\n    return radar;\n  }(),\n  treemap: {\n    breadcrumb: {\n      itemStyle: {\n        color: color.neutral20,\n        textStyle: {\n          color: color.secondary\n        }\n      },\n      emphasis: {\n        itemStyle: {\n          color: color.neutral30\n        }\n      }\n    }\n  },\n  sunburst: {\n    itemStyle: {\n      borderColor: color.background\n    }\n  },\n  map: {\n    itemStyle: {\n      borderColor: color.border,\n      areaColor: color.neutral10\n    },\n    label: {\n      color: color.tertiary\n    },\n    emphasis: {\n      label: {\n        color: color.primary\n      },\n      itemStyle: {\n        areaColor: color.highlight\n      }\n    },\n    select: {\n      label: {\n        color: color.primary\n      },\n      itemStyle: {\n        areaColor: color.highlight\n      }\n    }\n  },\n  geo: {\n    itemStyle: {\n      borderColor: color.border,\n      areaColor: color.neutral10\n    },\n    emphasis: {\n      label: {\n        color: color.primary\n      },\n      itemStyle: {\n        areaColor: color.highlight\n      }\n    },\n    select: {\n      label: {\n        color: color.primary\n      },\n      itemStyle: {\n        color: color.highlight\n      }\n    }\n  }\n};\ntheme.categoryAxis.splitLine.show = false;\nexport default theme;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { parseClassType } from './clazz.js';\n/**\n * Usage of query:\n * `chart.on('click', query, handler);`\n * The `query` can be:\n * + The component type query string, only `mainType` or `mainType.subType`,\n *   like: 'xAxis', 'series', 'xAxis.category' or 'series.line'.\n * + The component query object, like:\n *   `{seriesIndex: 2}`, `{seriesName: 'xx'}`, `{seriesId: 'some'}`,\n *   `{xAxisIndex: 2}`, `{xAxisName: 'xx'}`, `{xAxisId: 'some'}`.\n * + The data query object, like:\n *   `{dataIndex: 123}`, `{dataType: 'link'}`, `{name: 'some'}`.\n * + The other query object (cmponent customized query), like:\n *   `{element: 'some'}` (only available in custom series).\n *\n * Caveat: If a prop in the `query` object is `null/undefined`, it is the\n * same as there is no such prop in the `query` object.\n */\nvar ECEventProcessor = /** @class */function () {\n  function ECEventProcessor() {}\n  ECEventProcessor.prototype.normalizeQuery = function (query) {\n    var cptQuery = {};\n    var dataQuery = {};\n    var otherQuery = {};\n    // `query` is `mainType` or `mainType.subType` of component.\n    if (zrUtil.isString(query)) {\n      var condCptType = parseClassType(query);\n      // `.main` and `.sub` may be ''.\n      cptQuery.mainType = condCptType.main || null;\n      cptQuery.subType = condCptType.sub || null;\n    }\n    // `query` is an object, convert to {mainType, index, name, id}.\n    else {\n      // `xxxIndex`, `xxxName`, `xxxId`, `name`, `dataIndex`, `dataType` is reserved,\n      // can not be used in `compomentModel.filterForExposedEvent`.\n      var suffixes_1 = ['Index', 'Name', 'Id'];\n      var dataKeys_1 = {\n        name: 1,\n        dataIndex: 1,\n        dataType: 1\n      };\n      zrUtil.each(query, function (val, key) {\n        var reserved = false;\n        for (var i = 0; i < suffixes_1.length; i++) {\n          var propSuffix = suffixes_1[i];\n          var suffixPos = key.lastIndexOf(propSuffix);\n          if (suffixPos > 0 && suffixPos === key.length - propSuffix.length) {\n            var mainType = key.slice(0, suffixPos);\n            // Consider `dataIndex`.\n            if (mainType !== 'data') {\n              cptQuery.mainType = mainType;\n              cptQuery[propSuffix.toLowerCase()] = val;\n              reserved = true;\n            }\n          }\n        }\n        if (dataKeys_1.hasOwnProperty(key)) {\n          dataQuery[key] = val;\n          reserved = true;\n        }\n        if (!reserved) {\n          otherQuery[key] = val;\n        }\n      });\n    }\n    return {\n      cptQuery: cptQuery,\n      dataQuery: dataQuery,\n      otherQuery: otherQuery\n    };\n  };\n  ECEventProcessor.prototype.filter = function (eventType, query) {\n    // They should be assigned before each trigger call.\n    var eventInfo = this.eventInfo;\n    if (!eventInfo) {\n      return true;\n    }\n    var targetEl = eventInfo.targetEl;\n    var packedEvent = eventInfo.packedEvent;\n    var model = eventInfo.model;\n    var view = eventInfo.view;\n    // For event like 'globalout'.\n    if (!model || !view) {\n      return true;\n    }\n    var cptQuery = query.cptQuery;\n    var dataQuery = query.dataQuery;\n    return check(cptQuery, model, 'mainType') && check(cptQuery, model, 'subType') && check(cptQuery, model, 'index', 'componentIndex') && check(cptQuery, model, 'name') && check(cptQuery, model, 'id') && check(dataQuery, packedEvent, 'name') && check(dataQuery, packedEvent, 'dataIndex') && check(dataQuery, packedEvent, 'dataType') && (!view.filterForExposedEvent || view.filterForExposedEvent(eventType, query.otherQuery, targetEl, packedEvent));\n    function check(query, host, prop, propOnHost) {\n      return query[prop] == null || host[propOnHost || prop] === query[prop];\n    }\n  };\n  ECEventProcessor.prototype.afterTrigger = function () {\n    // Make sure the eventInfo won't be used in next trigger.\n    this.eventInfo = null;\n  };\n  return ECEventProcessor;\n}();\nexport { ECEventProcessor };\n;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { extend, isFunction, keys } from 'zrender/lib/core/util.js';\nvar SYMBOL_PROPS_WITH_CB = ['symbol', 'symbolSize', 'symbolRotate', 'symbolOffset'];\nvar SYMBOL_PROPS = SYMBOL_PROPS_WITH_CB.concat(['symbolKeepAspect']);\n// Encoding visual for all series include which is filtered for legend drawing\nvar seriesSymbolTask = {\n  createOnAllSeries: true,\n  // For legend.\n  performRawSeries: true,\n  reset: function (seriesModel, ecModel) {\n    var data = seriesModel.getData();\n    if (seriesModel.legendIcon) {\n      data.setVisual('legendIcon', seriesModel.legendIcon);\n    }\n    if (!seriesModel.hasSymbolVisual) {\n      return;\n    }\n    var symbolOptions = {};\n    var symbolOptionsCb = {};\n    var hasCallback = false;\n    for (var i = 0; i < SYMBOL_PROPS_WITH_CB.length; i++) {\n      var symbolPropName = SYMBOL_PROPS_WITH_CB[i];\n      var val = seriesModel.get(symbolPropName);\n      if (isFunction(val)) {\n        hasCallback = true;\n        symbolOptionsCb[symbolPropName] = val;\n      } else {\n        symbolOptions[symbolPropName] = val;\n      }\n    }\n    symbolOptions.symbol = symbolOptions.symbol || seriesModel.defaultSymbol;\n    data.setVisual(extend({\n      legendIcon: seriesModel.legendIcon || symbolOptions.symbol,\n      symbolKeepAspect: seriesModel.get('symbolKeepAspect')\n    }, symbolOptions));\n    // Only visible series has each data be visual encoded\n    if (ecModel.isSeriesFiltered(seriesModel)) {\n      return;\n    }\n    var symbolPropsCb = keys(symbolOptionsCb);\n    function dataEach(data, idx) {\n      var rawValue = seriesModel.getRawValue(idx);\n      var params = seriesModel.getDataParams(idx);\n      for (var i = 0; i < symbolPropsCb.length; i++) {\n        var symbolPropName = symbolPropsCb[i];\n        data.setItemVisual(idx, symbolPropName, symbolOptionsCb[symbolPropName](rawValue, params));\n      }\n    }\n    return {\n      dataEach: hasCallback ? dataEach : null\n    };\n  }\n};\nvar dataSymbolTask = {\n  createOnAllSeries: true,\n  // For legend.\n  performRawSeries: true,\n  reset: function (seriesModel, ecModel) {\n    if (!seriesModel.hasSymbolVisual) {\n      return;\n    }\n    // Only visible series has each data be visual encoded\n    if (ecModel.isSeriesFiltered(seriesModel)) {\n      return;\n    }\n    var data = seriesModel.getData();\n    function dataEach(data, idx) {\n      var itemModel = data.getItemModel(idx);\n      for (var i = 0; i < SYMBOL_PROPS.length; i++) {\n        var symbolPropName = SYMBOL_PROPS[i];\n        var val = itemModel.getShallow(symbolPropName, true);\n        if (val != null) {\n          data.setItemVisual(idx, symbolPropName, val);\n        }\n      }\n    }\n    return {\n      dataEach: data.hasItemOption ? dataEach : null\n    };\n  }\n};\nexport { seriesSymbolTask, dataSymbolTask };", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nexport function getItemVisualFromData(data, dataIndex, key) {\n  switch (key) {\n    case 'color':\n      var style = data.getItemVisual(dataIndex, 'style');\n      return style[data.getVisual('drawType')];\n    case 'opacity':\n      return data.getItemVisual(dataIndex, 'style').opacity;\n    case 'symbol':\n    case 'symbolSize':\n    case 'liftZ':\n      return data.getItemVisual(dataIndex, key);\n    default:\n      if (process.env.NODE_ENV !== 'production') {\n        console.warn(\"Unknown visual type \" + key);\n      }\n  }\n}\nexport function getVisualFromData(data, key) {\n  switch (key) {\n    case 'color':\n      var style = data.getVisual('style');\n      return style[data.getVisual('drawType')];\n    case 'opacity':\n      return data.getVisual('style').opacity;\n    case 'symbol':\n    case 'symbolSize':\n    case 'liftZ':\n      return data.getVisual(key);\n    default:\n      if (process.env.NODE_ENV !== 'production') {\n        console.warn(\"Unknown visual type \" + key);\n      }\n  }\n}\nexport function setItemVisualFromData(data, dataIndex, key, value) {\n  switch (key) {\n    case 'color':\n      // Make sure not sharing style object.\n      var style = data.ensureUniqueItemVisual(dataIndex, 'style');\n      style[data.getVisual('drawType')] = value;\n      // Mark the color has been changed, not from palette anymore\n      data.setItemVisual(dataIndex, 'colorFromPalette', false);\n      break;\n    case 'opacity':\n      data.ensureUniqueItemVisual(dataIndex, 'style').opacity = value;\n      break;\n    case 'symbol':\n    case 'symbolSize':\n    case 'liftZ':\n      data.setItemVisual(dataIndex, key, value);\n      break;\n    default:\n      if (process.env.NODE_ENV !== 'production') {\n        console.warn(\"Unknown visual type \" + key);\n      }\n  }\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { extend, each, isArray, isString } from 'zrender/lib/core/util.js';\nimport { deprecateReplaceLog, deprecateLog } from '../util/log.js';\nimport { queryDataIndex } from '../util/model.js';\n// Legacy data selection action.\n// Includes: pieSelect, pieUnSelect, pieToggleSelect, mapSelect, mapUnSelect, mapToggleSelect\nexport function createLegacyDataSelectAction(seriesType, ecRegisterAction) {\n  function getSeriesIndices(ecModel, payload) {\n    var seriesIndices = [];\n    ecModel.eachComponent({\n      mainType: 'series',\n      subType: seriesType,\n      query: payload\n    }, function (seriesModel) {\n      seriesIndices.push(seriesModel.seriesIndex);\n    });\n    return seriesIndices;\n  }\n  each([[seriesType + 'ToggleSelect', 'toggleSelect'], [seriesType + 'Select', 'select'], [seriesType + 'UnSelect', 'unselect']], function (eventsMap) {\n    ecRegisterAction(eventsMap[0], function (payload, ecModel, api) {\n      payload = extend({}, payload);\n      if (process.env.NODE_ENV !== 'production') {\n        deprecateReplaceLog(payload.type, eventsMap[1]);\n      }\n      api.dispatchAction(extend(payload, {\n        type: eventsMap[1],\n        seriesIndex: getSeriesIndices(ecModel, payload)\n      }));\n    });\n  });\n}\nfunction handleSeriesLegacySelectEvents(type, eventPostfix, ecIns, ecModel, payload) {\n  var legacyEventName = type + eventPostfix;\n  if (!ecIns.isSilent(legacyEventName)) {\n    if (process.env.NODE_ENV !== 'production') {\n      deprecateLog(\"event \" + legacyEventName + \" is deprecated.\");\n    }\n    ecModel.eachComponent({\n      mainType: 'series',\n      subType: 'pie'\n    }, function (seriesModel) {\n      var seriesIndex = seriesModel.seriesIndex;\n      var selectedMap = seriesModel.option.selectedMap;\n      var selected = payload.selected;\n      for (var i = 0; i < selected.length; i++) {\n        if (selected[i].seriesIndex === seriesIndex) {\n          var data = seriesModel.getData();\n          var dataIndex = queryDataIndex(data, payload.fromActionPayload);\n          ecIns.trigger(legacyEventName, {\n            type: legacyEventName,\n            seriesId: seriesModel.id,\n            name: isArray(dataIndex) ? data.getName(dataIndex[0]) : data.getName(dataIndex),\n            selected: isString(selectedMap) ? selectedMap : extend({}, selectedMap)\n          });\n        }\n      }\n    });\n  }\n}\nexport function handleLegacySelectEvents(messageCenter, ecIns, api) {\n  messageCenter.on('selectchanged', function (params) {\n    var ecModel = api.getModel();\n    if (params.isFromClick) {\n      handleSeriesLegacySelectEvents('map', 'selectchanged', ecIns, ecModel, params);\n      handleSeriesLegacySelectEvents('pie', 'selectchanged', ecIns, ecModel, params);\n    } else if (params.fromAction === 'select') {\n      handleSeriesLegacySelectEvents('map', 'selected', ecIns, ecModel, params);\n      handleSeriesLegacySelectEvents('pie', 'selected', ecIns, ecModel, params);\n    } else if (params.fromAction === 'unselect') {\n      handleSeriesLegacySelectEvents('map', 'unselected', ecIns, ecModel, params);\n      handleSeriesLegacySelectEvents('pie', 'unselected', ecIns, ecModel, params);\n    }\n  });\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nexport function findEventDispatcher(target, det, returnFirstMatch) {\n  var found;\n  while (target) {\n    if (det(target)) {\n      found = target;\n      if (returnFirstMatch) {\n        break;\n      }\n    }\n    target = target.__hostTarget || target.parent;\n  }\n  return found;\n}", "var wmUniqueIndex = Math.round(Math.random() * 9);\nvar supportDefineProperty = typeof Object.defineProperty === 'function';\nvar WeakMap = (function () {\n    function WeakMap() {\n        this._id = '__ec_inner_' + wmUniqueIndex++;\n    }\n    WeakMap.prototype.get = function (key) {\n        return this._guard(key)[this._id];\n    };\n    WeakMap.prototype.set = function (key, value) {\n        var target = this._guard(key);\n        if (supportDefineProperty) {\n            Object.defineProperty(target, this._id, {\n                value: value,\n                enumerable: false,\n                configurable: true\n            });\n        }\n        else {\n            target[this._id] = value;\n        }\n        return this;\n    };\n    WeakMap.prototype[\"delete\"] = function (key) {\n        if (this.has(key)) {\n            delete this._guard(key)[this._id];\n            return true;\n        }\n        return false;\n    };\n    WeakMap.prototype.has = function (key) {\n        return !!this._guard(key)[this._id];\n    };\n    WeakMap.prototype._guard = function (key) {\n        if (key !== Object(key)) {\n            throw TypeError('Value of WeakMap is not a non-null object.');\n        }\n        return key;\n    };\n    return WeakMap;\n}());\nexport default WeakMap;\n", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n// Symbol factory\nimport { each, isArray, retrieve2 } from 'zrender/lib/core/util.js';\nimport * as graphic from './graphic.js';\nimport BoundingRect from 'zrender/lib/core/BoundingRect.js';\nimport { calculateTextPosition } from 'zrender/lib/contain/text.js';\nimport { parsePercent } from './number.js';\nimport tokens from '../visual/tokens.js';\n/**\n * Triangle shape\n * @inner\n */\nvar Triangle = graphic.Path.extend({\n  type: 'triangle',\n  shape: {\n    cx: 0,\n    cy: 0,\n    width: 0,\n    height: 0\n  },\n  buildPath: function (path, shape) {\n    var cx = shape.cx;\n    var cy = shape.cy;\n    var width = shape.width / 2;\n    var height = shape.height / 2;\n    path.moveTo(cx, cy - height);\n    path.lineTo(cx + width, cy + height);\n    path.lineTo(cx - width, cy + height);\n    path.closePath();\n  }\n});\n/**\n * Diamond shape\n * @inner\n */\nvar Diamond = graphic.Path.extend({\n  type: 'diamond',\n  shape: {\n    cx: 0,\n    cy: 0,\n    width: 0,\n    height: 0\n  },\n  buildPath: function (path, shape) {\n    var cx = shape.cx;\n    var cy = shape.cy;\n    var width = shape.width / 2;\n    var height = shape.height / 2;\n    path.moveTo(cx, cy - height);\n    path.lineTo(cx + width, cy);\n    path.lineTo(cx, cy + height);\n    path.lineTo(cx - width, cy);\n    path.closePath();\n  }\n});\n/**\n * Pin shape\n * @inner\n */\nvar Pin = graphic.Path.extend({\n  type: 'pin',\n  shape: {\n    // x, y on the cusp\n    x: 0,\n    y: 0,\n    width: 0,\n    height: 0\n  },\n  buildPath: function (path, shape) {\n    var x = shape.x;\n    var y = shape.y;\n    var w = shape.width / 5 * 3;\n    // Height must be larger than width\n    var h = Math.max(w, shape.height);\n    var r = w / 2;\n    // Dist on y with tangent point and circle center\n    var dy = r * r / (h - r);\n    var cy = y - h + r + dy;\n    var angle = Math.asin(dy / r);\n    // Dist on x with tangent point and circle center\n    var dx = Math.cos(angle) * r;\n    var tanX = Math.sin(angle);\n    var tanY = Math.cos(angle);\n    var cpLen = r * 0.6;\n    var cpLen2 = r * 0.7;\n    path.moveTo(x - dx, cy + dy);\n    path.arc(x, cy, r, Math.PI - angle, Math.PI * 2 + angle);\n    path.bezierCurveTo(x + dx - tanX * cpLen, cy + dy + tanY * cpLen, x, y - cpLen2, x, y);\n    path.bezierCurveTo(x, y - cpLen2, x - dx + tanX * cpLen, cy + dy + tanY * cpLen, x - dx, cy + dy);\n    path.closePath();\n  }\n});\n/**\n * Arrow shape\n * @inner\n */\nvar Arrow = graphic.Path.extend({\n  type: 'arrow',\n  shape: {\n    x: 0,\n    y: 0,\n    width: 0,\n    height: 0\n  },\n  buildPath: function (ctx, shape) {\n    var height = shape.height;\n    var width = shape.width;\n    var x = shape.x;\n    var y = shape.y;\n    var dx = width / 3 * 2;\n    ctx.moveTo(x, y);\n    ctx.lineTo(x + dx, y + height);\n    ctx.lineTo(x, y + height / 4 * 3);\n    ctx.lineTo(x - dx, y + height);\n    ctx.lineTo(x, y);\n    ctx.closePath();\n  }\n});\n/**\n * Map of path constructors\n */\n// TODO Use function to build symbol path.\nvar symbolCtors = {\n  line: graphic.Line,\n  rect: graphic.Rect,\n  roundRect: graphic.Rect,\n  square: graphic.Rect,\n  circle: graphic.Circle,\n  diamond: Diamond,\n  pin: Pin,\n  arrow: Arrow,\n  triangle: Triangle\n};\nvar symbolShapeMakers = {\n  line: function (x, y, w, h, shape) {\n    shape.x1 = x;\n    shape.y1 = y + h / 2;\n    shape.x2 = x + w;\n    shape.y2 = y + h / 2;\n  },\n  rect: function (x, y, w, h, shape) {\n    shape.x = x;\n    shape.y = y;\n    shape.width = w;\n    shape.height = h;\n  },\n  roundRect: function (x, y, w, h, shape) {\n    shape.x = x;\n    shape.y = y;\n    shape.width = w;\n    shape.height = h;\n    shape.r = Math.min(w, h) / 4;\n  },\n  square: function (x, y, w, h, shape) {\n    var size = Math.min(w, h);\n    shape.x = x;\n    shape.y = y;\n    shape.width = size;\n    shape.height = size;\n  },\n  circle: function (x, y, w, h, shape) {\n    // Put circle in the center of square\n    shape.cx = x + w / 2;\n    shape.cy = y + h / 2;\n    shape.r = Math.min(w, h) / 2;\n  },\n  diamond: function (x, y, w, h, shape) {\n    shape.cx = x + w / 2;\n    shape.cy = y + h / 2;\n    shape.width = w;\n    shape.height = h;\n  },\n  pin: function (x, y, w, h, shape) {\n    shape.x = x + w / 2;\n    shape.y = y + h / 2;\n    shape.width = w;\n    shape.height = h;\n  },\n  arrow: function (x, y, w, h, shape) {\n    shape.x = x + w / 2;\n    shape.y = y + h / 2;\n    shape.width = w;\n    shape.height = h;\n  },\n  triangle: function (x, y, w, h, shape) {\n    shape.cx = x + w / 2;\n    shape.cy = y + h / 2;\n    shape.width = w;\n    shape.height = h;\n  }\n};\nexport var symbolBuildProxies = {};\neach(symbolCtors, function (Ctor, name) {\n  symbolBuildProxies[name] = new Ctor();\n});\nvar SymbolClz = graphic.Path.extend({\n  type: 'symbol',\n  shape: {\n    symbolType: '',\n    x: 0,\n    y: 0,\n    width: 0,\n    height: 0\n  },\n  calculateTextPosition: function (out, config, rect) {\n    var res = calculateTextPosition(out, config, rect);\n    var shape = this.shape;\n    if (shape && shape.symbolType === 'pin' && config.position === 'inside') {\n      res.y = rect.y + rect.height * 0.4;\n    }\n    return res;\n  },\n  buildPath: function (ctx, shape, inBundle) {\n    var symbolType = shape.symbolType;\n    if (symbolType !== 'none') {\n      var proxySymbol = symbolBuildProxies[symbolType];\n      if (!proxySymbol) {\n        // Default rect\n        symbolType = 'rect';\n        proxySymbol = symbolBuildProxies[symbolType];\n      }\n      symbolShapeMakers[symbolType](shape.x, shape.y, shape.width, shape.height, proxySymbol.shape);\n      proxySymbol.buildPath(ctx, proxySymbol.shape, inBundle);\n    }\n  }\n});\n// Provide setColor helper method to avoid determine if set the fill or stroke outside\nfunction symbolPathSetColor(color, innerColor) {\n  if (this.type !== 'image') {\n    var symbolStyle = this.style;\n    if (this.__isEmptyBrush) {\n      symbolStyle.stroke = color;\n      symbolStyle.fill = innerColor || tokens.color.neutral00;\n      // TODO Same width with lineStyle in LineView\n      symbolStyle.lineWidth = 2;\n    } else if (this.shape.symbolType === 'line') {\n      symbolStyle.stroke = color;\n    } else {\n      symbolStyle.fill = color;\n    }\n    this.markRedraw();\n  }\n}\n/**\n * Create a symbol element with given symbol configuration: shape, x, y, width, height, color\n */\nexport function createSymbol(symbolType, x, y, w, h, color,\n// whether to keep the ratio of w/h,\nkeepAspect) {\n  // TODO Support image object, DynamicImage.\n  var isEmpty = symbolType.indexOf('empty') === 0;\n  if (isEmpty) {\n    symbolType = symbolType.substr(5, 1).toLowerCase() + symbolType.substr(6);\n  }\n  var symbolPath;\n  if (symbolType.indexOf('image://') === 0) {\n    symbolPath = graphic.makeImage(symbolType.slice(8), new BoundingRect(x, y, w, h), keepAspect ? 'center' : 'cover');\n  } else if (symbolType.indexOf('path://') === 0) {\n    symbolPath = graphic.makePath(symbolType.slice(7), {}, new BoundingRect(x, y, w, h), keepAspect ? 'center' : 'cover');\n  } else {\n    symbolPath = new SymbolClz({\n      shape: {\n        symbolType: symbolType,\n        x: x,\n        y: y,\n        width: w,\n        height: h\n      }\n    });\n  }\n  symbolPath.__isEmptyBrush = isEmpty;\n  // TODO Should deprecate setColor\n  symbolPath.setColor = symbolPathSetColor;\n  if (color) {\n    symbolPath.setColor(color);\n  }\n  return symbolPath;\n}\nexport function normalizeSymbolSize(symbolSize) {\n  if (!isArray(symbolSize)) {\n    symbolSize = [+symbolSize, +symbolSize];\n  }\n  return [symbolSize[0] || 0, symbolSize[1] || 0];\n}\nexport function normalizeSymbolOffset(symbolOffset, symbolSize) {\n  if (symbolOffset == null) {\n    return;\n  }\n  if (!isArray(symbolOffset)) {\n    symbolOffset = [symbolOffset, symbolOffset];\n  }\n  return [parsePercent(symbolOffset[0], symbolSize[0]) || 0, parsePercent(retrieve2(symbolOffset[1], symbolOffset[0]), symbolSize[1]) || 0];\n}", "function isSafeNum(num) {\n    return isFinite(num);\n}\nexport function createLinearGradient(ctx, obj, rect) {\n    var x = obj.x == null ? 0 : obj.x;\n    var x2 = obj.x2 == null ? 1 : obj.x2;\n    var y = obj.y == null ? 0 : obj.y;\n    var y2 = obj.y2 == null ? 0 : obj.y2;\n    if (!obj.global) {\n        x = x * rect.width + rect.x;\n        x2 = x2 * rect.width + rect.x;\n        y = y * rect.height + rect.y;\n        y2 = y2 * rect.height + rect.y;\n    }\n    x = isSafeNum(x) ? x : 0;\n    x2 = isSafeNum(x2) ? x2 : 1;\n    y = isSafeNum(y) ? y : 0;\n    y2 = isSafeNum(y2) ? y2 : 0;\n    var canvasGradient = ctx.createLinearGradient(x, y, x2, y2);\n    return canvasGradient;\n}\nexport function createRadialGradient(ctx, obj, rect) {\n    var width = rect.width;\n    var height = rect.height;\n    var min = Math.min(width, height);\n    var x = obj.x == null ? 0.5 : obj.x;\n    var y = obj.y == null ? 0.5 : obj.y;\n    var r = obj.r == null ? 0.5 : obj.r;\n    if (!obj.global) {\n        x = x * width + rect.x;\n        y = y * height + rect.y;\n        r = r * min;\n    }\n    x = isSafeNum(x) ? x : 0.5;\n    y = isSafeNum(y) ? y : 0.5;\n    r = r >= 0 && isSafeNum(r) ? r : 0.5;\n    var canvasGradient = ctx.createRadialGradient(x, y, 0, x, y, r);\n    return canvasGradient;\n}\nexport function getCanvasGradient(ctx, obj, rect) {\n    var canvasGradient = obj.type === 'radial'\n        ? createRadialGradient(ctx, obj, rect)\n        : createLinearGradient(ctx, obj, rect);\n    var colorStops = obj.colorStops;\n    for (var i = 0; i < colorStops.length; i++) {\n        canvasGradient.addColorStop(colorStops[i].offset, colorStops[i].color);\n    }\n    return canvasGradient;\n}\nexport function isClipPathChanged(clipPaths, prevClipPaths) {\n    if (clipPaths === prevClipPaths || (!clipPaths && !prevClipPaths)) {\n        return false;\n    }\n    if (!clipPaths || !prevClipPaths || (clipPaths.length !== prevClipPaths.length)) {\n        return true;\n    }\n    for (var i = 0; i < clipPaths.length; i++) {\n        if (clipPaths[i] !== prevClipPaths[i]) {\n            return true;\n        }\n    }\n    return false;\n}\nfunction parseInt10(val) {\n    return parseInt(val, 10);\n}\nexport function getSize(root, whIdx, opts) {\n    var wh = ['width', 'height'][whIdx];\n    var cwh = ['clientWidth', 'clientHeight'][whIdx];\n    var plt = ['paddingLeft', 'paddingTop'][whIdx];\n    var prb = ['paddingRight', 'paddingBottom'][whIdx];\n    if (opts[wh] != null && opts[wh] !== 'auto') {\n        return parseFloat(opts[wh]);\n    }\n    var stl = document.defaultView.getComputedStyle(root);\n    return ((root[cwh] || parseInt10(stl[wh]) || parseInt10(root.style[wh]))\n        - (parseInt10(stl[plt]) || 0)\n        - (parseInt10(stl[prb]) || 0)) | 0;\n}\n", "import { isArray, isNumber, map } from '../core/util.js';\nexport function normalizeLineDash(lineType, lineWidth) {\n    if (!lineType || lineType === 'solid' || !(lineWidth > 0)) {\n        return null;\n    }\n    return lineType === 'dashed'\n        ? [4 * lineWidth, 2 * lineWidth]\n        : lineType === 'dotted'\n            ? [lineWidth]\n            : isNumber(lineType)\n                ? [lineType] : isArray(lineType) ? lineType : null;\n}\nexport function getLineDash(el) {\n    var style = el.style;\n    var lineDash = style.lineDash && style.lineWidth > 0 && normalizeLineDash(style.lineDash, style.lineWidth);\n    var lineDashOffset = style.lineDashOffset;\n    if (lineDash) {\n        var lineScale_1 = (style.strokeNoScale && el.getLineScale) ? el.getLineScale() : 1;\n        if (lineScale_1 && lineScale_1 !== 1) {\n            lineDash = map(lineDash, function (rawVal) {\n                return rawVal / lineScale_1;\n            });\n            lineDashOffset /= lineScale_1;\n        }\n    }\n    return [lineDash, lineDashOffset];\n}\n", "import { DEFAULT_COMMON_STYLE } from '../graphic/Displayable.js';\nimport PathProxy from '../core/PathProxy.js';\nimport { createOrUpdateImage, isImageReady } from '../graphic/helper/image.js';\nimport { getCanvasGradient, isClipPathChanged } from './helper.js';\nimport Path from '../graphic/Path.js';\nimport ZRImage from '../graphic/Image.js';\nimport TSpan from '../graphic/TSpan.js';\nimport { RADIAN_TO_DEGREE } from '../core/util.js';\nimport { getLineDash } from './dashStyle.js';\nimport { REDRAW_BIT, SHAPE_CHANGED_BIT } from '../graphic/constants.js';\nimport { DEFAULT_FONT } from '../core/platform.js';\nvar pathProxyForDraw = new PathProxy(true);\nfunction styleHasStroke(style) {\n    var stroke = style.stroke;\n    return !(stroke == null || stroke === 'none' || !(style.lineWidth > 0));\n}\nfunction isValidStrokeFillStyle(strokeOrFill) {\n    return typeof strokeOrFill === 'string' && strokeOrFill !== 'none';\n}\nfunction styleHasFill(style) {\n    var fill = style.fill;\n    return fill != null && fill !== 'none';\n}\nfunction doFillPath(ctx, style) {\n    if (style.fillOpacity != null && style.fillOpacity !== 1) {\n        var originalGlobalAlpha = ctx.globalAlpha;\n        ctx.globalAlpha = style.fillOpacity * style.opacity;\n        ctx.fill();\n        ctx.globalAlpha = originalGlobalAlpha;\n    }\n    else {\n        ctx.fill();\n    }\n}\nfunction doStrokePath(ctx, style) {\n    if (style.strokeOpacity != null && style.strokeOpacity !== 1) {\n        var originalGlobalAlpha = ctx.globalAlpha;\n        ctx.globalAlpha = style.strokeOpacity * style.opacity;\n        ctx.stroke();\n        ctx.globalAlpha = originalGlobalAlpha;\n    }\n    else {\n        ctx.stroke();\n    }\n}\nexport function createCanvasPattern(ctx, pattern, el) {\n    var image = createOrUpdateImage(pattern.image, pattern.__image, el);\n    if (isImageReady(image)) {\n        var canvasPattern = ctx.createPattern(image, pattern.repeat || 'repeat');\n        if (typeof DOMMatrix === 'function'\n            && canvasPattern\n            && canvasPattern.setTransform) {\n            var matrix = new DOMMatrix();\n            matrix.translateSelf((pattern.x || 0), (pattern.y || 0));\n            matrix.rotateSelf(0, 0, (pattern.rotation || 0) * RADIAN_TO_DEGREE);\n            matrix.scaleSelf((pattern.scaleX || 1), (pattern.scaleY || 1));\n            canvasPattern.setTransform(matrix);\n        }\n        return canvasPattern;\n    }\n}\nfunction brushPath(ctx, el, style, inBatch) {\n    var _a;\n    var hasStroke = styleHasStroke(style);\n    var hasFill = styleHasFill(style);\n    var strokePercent = style.strokePercent;\n    var strokePart = strokePercent < 1;\n    var firstDraw = !el.path;\n    if ((!el.silent || strokePart) && firstDraw) {\n        el.createPathProxy();\n    }\n    var path = el.path || pathProxyForDraw;\n    var dirtyFlag = el.__dirty;\n    if (!inBatch) {\n        var fill = style.fill;\n        var stroke = style.stroke;\n        var hasFillGradient = hasFill && !!fill.colorStops;\n        var hasStrokeGradient = hasStroke && !!stroke.colorStops;\n        var hasFillPattern = hasFill && !!fill.image;\n        var hasStrokePattern = hasStroke && !!stroke.image;\n        var fillGradient = void 0;\n        var strokeGradient = void 0;\n        var fillPattern = void 0;\n        var strokePattern = void 0;\n        var rect = void 0;\n        if (hasFillGradient || hasStrokeGradient) {\n            rect = el.getBoundingRect();\n        }\n        if (hasFillGradient) {\n            fillGradient = dirtyFlag\n                ? getCanvasGradient(ctx, fill, rect)\n                : el.__canvasFillGradient;\n            el.__canvasFillGradient = fillGradient;\n        }\n        if (hasStrokeGradient) {\n            strokeGradient = dirtyFlag\n                ? getCanvasGradient(ctx, stroke, rect)\n                : el.__canvasStrokeGradient;\n            el.__canvasStrokeGradient = strokeGradient;\n        }\n        if (hasFillPattern) {\n            fillPattern = (dirtyFlag || !el.__canvasFillPattern)\n                ? createCanvasPattern(ctx, fill, el)\n                : el.__canvasFillPattern;\n            el.__canvasFillPattern = fillPattern;\n        }\n        if (hasStrokePattern) {\n            strokePattern = (dirtyFlag || !el.__canvasStrokePattern)\n                ? createCanvasPattern(ctx, stroke, el)\n                : el.__canvasStrokePattern;\n            el.__canvasStrokePattern = strokePattern;\n        }\n        if (hasFillGradient) {\n            ctx.fillStyle = fillGradient;\n        }\n        else if (hasFillPattern) {\n            if (fillPattern) {\n                ctx.fillStyle = fillPattern;\n            }\n            else {\n                hasFill = false;\n            }\n        }\n        if (hasStrokeGradient) {\n            ctx.strokeStyle = strokeGradient;\n        }\n        else if (hasStrokePattern) {\n            if (strokePattern) {\n                ctx.strokeStyle = strokePattern;\n            }\n            else {\n                hasStroke = false;\n            }\n        }\n    }\n    var scale = el.getGlobalScale();\n    path.setScale(scale[0], scale[1], el.segmentIgnoreThreshold);\n    var lineDash;\n    var lineDashOffset;\n    if (ctx.setLineDash && style.lineDash) {\n        _a = getLineDash(el), lineDash = _a[0], lineDashOffset = _a[1];\n    }\n    var needsRebuild = true;\n    if (firstDraw || (dirtyFlag & SHAPE_CHANGED_BIT)) {\n        path.setDPR(ctx.dpr);\n        if (strokePart) {\n            path.setContext(null);\n        }\n        else {\n            path.setContext(ctx);\n            needsRebuild = false;\n        }\n        path.reset();\n        el.buildPath(path, el.shape, inBatch);\n        path.toStatic();\n        el.pathUpdated();\n    }\n    if (needsRebuild) {\n        path.rebuildPath(ctx, strokePart ? strokePercent : 1);\n    }\n    if (lineDash) {\n        ctx.setLineDash(lineDash);\n        ctx.lineDashOffset = lineDashOffset;\n    }\n    if (!inBatch) {\n        if (style.strokeFirst) {\n            if (hasStroke) {\n                doStrokePath(ctx, style);\n            }\n            if (hasFill) {\n                doFillPath(ctx, style);\n            }\n        }\n        else {\n            if (hasFill) {\n                doFillPath(ctx, style);\n            }\n            if (hasStroke) {\n                doStrokePath(ctx, style);\n            }\n        }\n    }\n    if (lineDash) {\n        ctx.setLineDash([]);\n    }\n}\nfunction brushImage(ctx, el, style) {\n    var image = el.__image = createOrUpdateImage(style.image, el.__image, el, el.onload);\n    if (!image || !isImageReady(image)) {\n        return;\n    }\n    var x = style.x || 0;\n    var y = style.y || 0;\n    var width = el.getWidth();\n    var height = el.getHeight();\n    var aspect = image.width / image.height;\n    if (width == null && height != null) {\n        width = height * aspect;\n    }\n    else if (height == null && width != null) {\n        height = width / aspect;\n    }\n    else if (width == null && height == null) {\n        width = image.width;\n        height = image.height;\n    }\n    if (style.sWidth && style.sHeight) {\n        var sx = style.sx || 0;\n        var sy = style.sy || 0;\n        ctx.drawImage(image, sx, sy, style.sWidth, style.sHeight, x, y, width, height);\n    }\n    else if (style.sx && style.sy) {\n        var sx = style.sx;\n        var sy = style.sy;\n        var sWidth = width - sx;\n        var sHeight = height - sy;\n        ctx.drawImage(image, sx, sy, sWidth, sHeight, x, y, width, height);\n    }\n    else {\n        ctx.drawImage(image, x, y, width, height);\n    }\n}\nfunction brushText(ctx, el, style) {\n    var _a;\n    var text = style.text;\n    text != null && (text += '');\n    if (text) {\n        ctx.font = style.font || DEFAULT_FONT;\n        ctx.textAlign = style.textAlign;\n        ctx.textBaseline = style.textBaseline;\n        var lineDash = void 0;\n        var lineDashOffset = void 0;\n        if (ctx.setLineDash && style.lineDash) {\n            _a = getLineDash(el), lineDash = _a[0], lineDashOffset = _a[1];\n        }\n        if (lineDash) {\n            ctx.setLineDash(lineDash);\n            ctx.lineDashOffset = lineDashOffset;\n        }\n        if (style.strokeFirst) {\n            if (styleHasStroke(style)) {\n                ctx.strokeText(text, style.x, style.y);\n            }\n            if (styleHasFill(style)) {\n                ctx.fillText(text, style.x, style.y);\n            }\n        }\n        else {\n            if (styleHasFill(style)) {\n                ctx.fillText(text, style.x, style.y);\n            }\n            if (styleHasStroke(style)) {\n                ctx.strokeText(text, style.x, style.y);\n            }\n        }\n        if (lineDash) {\n            ctx.setLineDash([]);\n        }\n    }\n}\nvar SHADOW_NUMBER_PROPS = ['shadowBlur', 'shadowOffsetX', 'shadowOffsetY'];\nvar STROKE_PROPS = [\n    ['lineCap', 'butt'], ['lineJoin', 'miter'], ['miterLimit', 10]\n];\nfunction bindCommonProps(ctx, style, prevStyle, forceSetAll, scope) {\n    var styleChanged = false;\n    if (!forceSetAll) {\n        prevStyle = prevStyle || {};\n        if (style === prevStyle) {\n            return false;\n        }\n    }\n    if (forceSetAll || style.opacity !== prevStyle.opacity) {\n        flushPathDrawn(ctx, scope);\n        styleChanged = true;\n        var opacity = Math.max(Math.min(style.opacity, 1), 0);\n        ctx.globalAlpha = isNaN(opacity) ? DEFAULT_COMMON_STYLE.opacity : opacity;\n    }\n    if (forceSetAll || style.blend !== prevStyle.blend) {\n        if (!styleChanged) {\n            flushPathDrawn(ctx, scope);\n            styleChanged = true;\n        }\n        ctx.globalCompositeOperation = style.blend || DEFAULT_COMMON_STYLE.blend;\n    }\n    for (var i = 0; i < SHADOW_NUMBER_PROPS.length; i++) {\n        var propName = SHADOW_NUMBER_PROPS[i];\n        if (forceSetAll || style[propName] !== prevStyle[propName]) {\n            if (!styleChanged) {\n                flushPathDrawn(ctx, scope);\n                styleChanged = true;\n            }\n            ctx[propName] = ctx.dpr * (style[propName] || 0);\n        }\n    }\n    if (forceSetAll || style.shadowColor !== prevStyle.shadowColor) {\n        if (!styleChanged) {\n            flushPathDrawn(ctx, scope);\n            styleChanged = true;\n        }\n        ctx.shadowColor = style.shadowColor || DEFAULT_COMMON_STYLE.shadowColor;\n    }\n    return styleChanged;\n}\nfunction bindPathAndTextCommonStyle(ctx, el, prevEl, forceSetAll, scope) {\n    var style = getStyle(el, scope.inHover);\n    var prevStyle = forceSetAll\n        ? null\n        : (prevEl && getStyle(prevEl, scope.inHover) || {});\n    if (style === prevStyle) {\n        return false;\n    }\n    var styleChanged = bindCommonProps(ctx, style, prevStyle, forceSetAll, scope);\n    if (forceSetAll || style.fill !== prevStyle.fill) {\n        if (!styleChanged) {\n            flushPathDrawn(ctx, scope);\n            styleChanged = true;\n        }\n        isValidStrokeFillStyle(style.fill) && (ctx.fillStyle = style.fill);\n    }\n    if (forceSetAll || style.stroke !== prevStyle.stroke) {\n        if (!styleChanged) {\n            flushPathDrawn(ctx, scope);\n            styleChanged = true;\n        }\n        isValidStrokeFillStyle(style.stroke) && (ctx.strokeStyle = style.stroke);\n    }\n    if (forceSetAll || style.opacity !== prevStyle.opacity) {\n        if (!styleChanged) {\n            flushPathDrawn(ctx, scope);\n            styleChanged = true;\n        }\n        ctx.globalAlpha = style.opacity == null ? 1 : style.opacity;\n    }\n    if (el.hasStroke()) {\n        var lineWidth = style.lineWidth;\n        var newLineWidth = lineWidth / ((style.strokeNoScale && el.getLineScale) ? el.getLineScale() : 1);\n        if (ctx.lineWidth !== newLineWidth) {\n            if (!styleChanged) {\n                flushPathDrawn(ctx, scope);\n                styleChanged = true;\n            }\n            ctx.lineWidth = newLineWidth;\n        }\n    }\n    for (var i = 0; i < STROKE_PROPS.length; i++) {\n        var prop = STROKE_PROPS[i];\n        var propName = prop[0];\n        if (forceSetAll || style[propName] !== prevStyle[propName]) {\n            if (!styleChanged) {\n                flushPathDrawn(ctx, scope);\n                styleChanged = true;\n            }\n            ctx[propName] = style[propName] || prop[1];\n        }\n    }\n    return styleChanged;\n}\nfunction bindImageStyle(ctx, el, prevEl, forceSetAll, scope) {\n    return bindCommonProps(ctx, getStyle(el, scope.inHover), prevEl && getStyle(prevEl, scope.inHover), forceSetAll, scope);\n}\nfunction setContextTransform(ctx, el) {\n    var m = el.transform;\n    var dpr = ctx.dpr || 1;\n    if (m) {\n        ctx.setTransform(dpr * m[0], dpr * m[1], dpr * m[2], dpr * m[3], dpr * m[4], dpr * m[5]);\n    }\n    else {\n        ctx.setTransform(dpr, 0, 0, dpr, 0, 0);\n    }\n}\nfunction updateClipStatus(clipPaths, ctx, scope) {\n    var allClipped = false;\n    for (var i = 0; i < clipPaths.length; i++) {\n        var clipPath = clipPaths[i];\n        allClipped = allClipped || clipPath.isZeroArea();\n        setContextTransform(ctx, clipPath);\n        ctx.beginPath();\n        clipPath.buildPath(ctx, clipPath.shape);\n        ctx.clip();\n    }\n    scope.allClipped = allClipped;\n}\nfunction isTransformChanged(m0, m1) {\n    if (m0 && m1) {\n        return m0[0] !== m1[0]\n            || m0[1] !== m1[1]\n            || m0[2] !== m1[2]\n            || m0[3] !== m1[3]\n            || m0[4] !== m1[4]\n            || m0[5] !== m1[5];\n    }\n    else if (!m0 && !m1) {\n        return false;\n    }\n    return true;\n}\nvar DRAW_TYPE_PATH = 1;\nvar DRAW_TYPE_IMAGE = 2;\nvar DRAW_TYPE_TEXT = 3;\nvar DRAW_TYPE_INCREMENTAL = 4;\nfunction canPathBatch(style) {\n    var hasFill = styleHasFill(style);\n    var hasStroke = styleHasStroke(style);\n    return !(style.lineDash\n        || !(+hasFill ^ +hasStroke)\n        || (hasFill && typeof style.fill !== 'string')\n        || (hasStroke && typeof style.stroke !== 'string')\n        || style.strokePercent < 1\n        || style.strokeOpacity < 1\n        || style.fillOpacity < 1);\n}\nfunction flushPathDrawn(ctx, scope) {\n    scope.batchFill && ctx.fill();\n    scope.batchStroke && ctx.stroke();\n    scope.batchFill = '';\n    scope.batchStroke = '';\n}\nfunction getStyle(el, inHover) {\n    return inHover ? (el.__hoverStyle || el.style) : el.style;\n}\nexport function brushSingle(ctx, el) {\n    brush(ctx, el, { inHover: false, viewWidth: 0, viewHeight: 0 }, true);\n}\nexport function brush(ctx, el, scope, isLast) {\n    var m = el.transform;\n    if (!el.shouldBePainted(scope.viewWidth, scope.viewHeight, false, false)) {\n        el.__dirty &= ~REDRAW_BIT;\n        el.__isRendered = false;\n        return;\n    }\n    var clipPaths = el.__clipPaths;\n    var prevElClipPaths = scope.prevElClipPaths;\n    var forceSetTransform = false;\n    var forceSetStyle = false;\n    if (!prevElClipPaths || isClipPathChanged(clipPaths, prevElClipPaths)) {\n        if (prevElClipPaths && prevElClipPaths.length) {\n            flushPathDrawn(ctx, scope);\n            ctx.restore();\n            forceSetStyle = forceSetTransform = true;\n            scope.prevElClipPaths = null;\n            scope.allClipped = false;\n            scope.prevEl = null;\n        }\n        if (clipPaths && clipPaths.length) {\n            flushPathDrawn(ctx, scope);\n            ctx.save();\n            updateClipStatus(clipPaths, ctx, scope);\n            forceSetTransform = true;\n        }\n        scope.prevElClipPaths = clipPaths;\n    }\n    if (scope.allClipped) {\n        el.__isRendered = false;\n        return;\n    }\n    el.beforeBrush && el.beforeBrush();\n    el.innerBeforeBrush();\n    var prevEl = scope.prevEl;\n    if (!prevEl) {\n        forceSetStyle = forceSetTransform = true;\n    }\n    var canBatchPath = el instanceof Path\n        && el.autoBatch\n        && canPathBatch(el.style);\n    if (forceSetTransform || isTransformChanged(m, prevEl.transform)) {\n        flushPathDrawn(ctx, scope);\n        setContextTransform(ctx, el);\n    }\n    else if (!canBatchPath) {\n        flushPathDrawn(ctx, scope);\n    }\n    var style = getStyle(el, scope.inHover);\n    if (el instanceof Path) {\n        if (scope.lastDrawType !== DRAW_TYPE_PATH) {\n            forceSetStyle = true;\n            scope.lastDrawType = DRAW_TYPE_PATH;\n        }\n        bindPathAndTextCommonStyle(ctx, el, prevEl, forceSetStyle, scope);\n        if (!canBatchPath || (!scope.batchFill && !scope.batchStroke)) {\n            ctx.beginPath();\n        }\n        brushPath(ctx, el, style, canBatchPath);\n        if (canBatchPath) {\n            scope.batchFill = style.fill || '';\n            scope.batchStroke = style.stroke || '';\n        }\n    }\n    else {\n        if (el instanceof TSpan) {\n            if (scope.lastDrawType !== DRAW_TYPE_TEXT) {\n                forceSetStyle = true;\n                scope.lastDrawType = DRAW_TYPE_TEXT;\n            }\n            bindPathAndTextCommonStyle(ctx, el, prevEl, forceSetStyle, scope);\n            brushText(ctx, el, style);\n        }\n        else if (el instanceof ZRImage) {\n            if (scope.lastDrawType !== DRAW_TYPE_IMAGE) {\n                forceSetStyle = true;\n                scope.lastDrawType = DRAW_TYPE_IMAGE;\n            }\n            bindImageStyle(ctx, el, prevEl, forceSetStyle, scope);\n            brushImage(ctx, el, style);\n        }\n        else if (el.getTemporalDisplayables) {\n            if (scope.lastDrawType !== DRAW_TYPE_INCREMENTAL) {\n                forceSetStyle = true;\n                scope.lastDrawType = DRAW_TYPE_INCREMENTAL;\n            }\n            brushIncremental(ctx, el, scope);\n        }\n    }\n    if (canBatchPath && isLast) {\n        flushPathDrawn(ctx, scope);\n    }\n    el.innerAfterBrush();\n    el.afterBrush && el.afterBrush();\n    scope.prevEl = el;\n    el.__dirty = 0;\n    el.__isRendered = true;\n}\nfunction brushIncremental(ctx, el, scope) {\n    var displayables = el.getDisplayables();\n    var temporalDisplayables = el.getTemporalDisplayables();\n    ctx.save();\n    var innerScope = {\n        prevElClipPaths: null,\n        prevEl: null,\n        allClipped: false,\n        viewWidth: scope.viewWidth,\n        viewHeight: scope.viewHeight,\n        inHover: scope.inHover\n    };\n    var i;\n    var len;\n    for (i = el.getCursor(), len = displayables.length; i < len; i++) {\n        var displayable = displayables[i];\n        displayable.beforeBrush && displayable.beforeBrush();\n        displayable.innerBeforeBrush();\n        brush(ctx, displayable, innerScope, i === len - 1);\n        displayable.innerAfterBrush();\n        displayable.afterBrush && displayable.afterBrush();\n        innerScope.prevEl = displayable;\n    }\n    for (var i_1 = 0, len_1 = temporalDisplayables.length; i_1 < len_1; i_1++) {\n        var displayable = temporalDisplayables[i_1];\n        displayable.beforeBrush && displayable.beforeBrush();\n        displayable.innerBeforeBrush();\n        brush(ctx, displayable, innerScope, i_1 === len_1 - 1);\n        displayable.innerAfterBrush();\n        displayable.afterBrush && displayable.afterBrush();\n        innerScope.prevEl = displayable;\n    }\n    el.clearTemporalDisplayables();\n    el.notClear = true;\n    ctx.restore();\n}\n", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport WeakMap from 'zrender/lib/core/WeakMap.js';\nimport LRU from 'zrender/lib/core/LRU.js';\nimport { defaults, map, isArray, isString, isNumber } from 'zrender/lib/core/util.js';\nimport { getLeastCommonMultiple } from './number.js';\nimport { createSymbol } from './symbol.js';\nimport { brushSingle } from 'zrender/lib/canvas/graphic.js';\nimport { platformApi } from 'zrender/lib/core/platform.js';\nvar decalMap = new WeakMap();\nvar decalCache = new LRU(100);\nvar decalKeys = ['symbol', 'symbolSize', 'symbolKeepAspect', 'color', 'backgroundColor', 'dashArrayX', 'dashArrayY', 'maxTileWidth', 'maxTileHeight'];\n/**\n * Create or update pattern image from decal options\n *\n * @param {InnerDecalObject | 'none'} decalObject decal options, 'none' if no decal\n * @return {Pattern} pattern with generated image, null if no decal\n */\nexport function createOrUpdatePatternFromDecal(decalObject, api) {\n  if (decalObject === 'none') {\n    return null;\n  }\n  var dpr = api.getDevicePixelRatio();\n  var zr = api.getZr();\n  var isSVG = zr.painter.type === 'svg';\n  if (decalObject.dirty) {\n    decalMap[\"delete\"](decalObject);\n  }\n  var oldPattern = decalMap.get(decalObject);\n  if (oldPattern) {\n    return oldPattern;\n  }\n  var decalOpt = defaults(decalObject, {\n    symbol: 'rect',\n    symbolSize: 1,\n    symbolKeepAspect: true,\n    color: 'rgba(0, 0, 0, 0.2)',\n    backgroundColor: null,\n    dashArrayX: 5,\n    dashArrayY: 5,\n    rotation: 0,\n    maxTileWidth: 512,\n    maxTileHeight: 512\n  });\n  if (decalOpt.backgroundColor === 'none') {\n    decalOpt.backgroundColor = null;\n  }\n  var pattern = {\n    repeat: 'repeat'\n  };\n  setPatternnSource(pattern);\n  pattern.rotation = decalOpt.rotation;\n  pattern.scaleX = pattern.scaleY = isSVG ? 1 : 1 / dpr;\n  decalMap.set(decalObject, pattern);\n  decalObject.dirty = false;\n  return pattern;\n  function setPatternnSource(pattern) {\n    var keys = [dpr];\n    var isValidKey = true;\n    for (var i = 0; i < decalKeys.length; ++i) {\n      var value = decalOpt[decalKeys[i]];\n      if (value != null && !isArray(value) && !isString(value) && !isNumber(value) && typeof value !== 'boolean') {\n        isValidKey = false;\n        break;\n      }\n      keys.push(value);\n    }\n    var cacheKey;\n    if (isValidKey) {\n      cacheKey = keys.join(',') + (isSVG ? '-svg' : '');\n      var cache = decalCache.get(cacheKey);\n      if (cache) {\n        isSVG ? pattern.svgElement = cache : pattern.image = cache;\n      }\n    }\n    var dashArrayX = normalizeDashArrayX(decalOpt.dashArrayX);\n    var dashArrayY = normalizeDashArrayY(decalOpt.dashArrayY);\n    var symbolArray = normalizeSymbolArray(decalOpt.symbol);\n    var lineBlockLengthsX = getLineBlockLengthX(dashArrayX);\n    var lineBlockLengthY = getLineBlockLengthY(dashArrayY);\n    var canvas = !isSVG && platformApi.createCanvas();\n    var svgRoot = isSVG && {\n      tag: 'g',\n      attrs: {},\n      key: 'dcl',\n      children: []\n    };\n    var pSize = getPatternSize();\n    var ctx;\n    if (canvas) {\n      canvas.width = pSize.width * dpr;\n      canvas.height = pSize.height * dpr;\n      ctx = canvas.getContext('2d');\n    }\n    brushDecal();\n    if (isValidKey) {\n      decalCache.put(cacheKey, canvas || svgRoot);\n    }\n    pattern.image = canvas;\n    pattern.svgElement = svgRoot;\n    pattern.svgWidth = pSize.width;\n    pattern.svgHeight = pSize.height;\n    /**\n     * Get minimum length that can make a repeatable pattern.\n     *\n     * @return {Object} pattern width and height\n     */\n    function getPatternSize() {\n      /**\n       * For example, if dash is [[3, 2], [2, 1]] for X, it looks like\n       * |---  ---  ---  ---  --- ...\n       * |-- -- -- -- -- -- -- -- ...\n       * |---  ---  ---  ---  --- ...\n       * |-- -- -- -- -- -- -- -- ...\n       * So the minimum length of X is 15,\n       * which is the least common multiple of `3 + 2` and `2 + 1`\n       * |---  ---  ---  |---  --- ...\n       * |-- -- -- -- -- |-- -- -- ...\n       */\n      var width = 1;\n      for (var i = 0, xlen = lineBlockLengthsX.length; i < xlen; ++i) {\n        width = getLeastCommonMultiple(width, lineBlockLengthsX[i]);\n      }\n      var symbolRepeats = 1;\n      for (var i = 0, xlen = symbolArray.length; i < xlen; ++i) {\n        symbolRepeats = getLeastCommonMultiple(symbolRepeats, symbolArray[i].length);\n      }\n      width *= symbolRepeats;\n      var height = lineBlockLengthY * lineBlockLengthsX.length * symbolArray.length;\n      if (process.env.NODE_ENV !== 'production') {\n        var warn = function (attrName) {\n          /* eslint-disable-next-line */\n          console.warn(\"Calculated decal size is greater than \" + attrName + \" due to decal option settings so \" + attrName + \" is used for the decal size. Please consider changing the decal option to make a smaller decal or set \" + attrName + \" to be larger to avoid incontinuity.\");\n        };\n        if (width > decalOpt.maxTileWidth) {\n          warn('maxTileWidth');\n        }\n        if (height > decalOpt.maxTileHeight) {\n          warn('maxTileHeight');\n        }\n      }\n      return {\n        width: Math.max(1, Math.min(width, decalOpt.maxTileWidth)),\n        height: Math.max(1, Math.min(height, decalOpt.maxTileHeight))\n      };\n    }\n    function brushDecal() {\n      if (ctx) {\n        ctx.clearRect(0, 0, canvas.width, canvas.height);\n        if (decalOpt.backgroundColor) {\n          ctx.fillStyle = decalOpt.backgroundColor;\n          ctx.fillRect(0, 0, canvas.width, canvas.height);\n        }\n      }\n      var ySum = 0;\n      for (var i = 0; i < dashArrayY.length; ++i) {\n        ySum += dashArrayY[i];\n      }\n      if (ySum <= 0) {\n        // dashArrayY is 0, draw nothing\n        return;\n      }\n      var y = -lineBlockLengthY;\n      var yId = 0;\n      var yIdTotal = 0;\n      var xId0 = 0;\n      while (y < pSize.height) {\n        if (yId % 2 === 0) {\n          var symbolYId = yIdTotal / 2 % symbolArray.length;\n          var x = 0;\n          var xId1 = 0;\n          var xId1Total = 0;\n          while (x < pSize.width * 2) {\n            var xSum = 0;\n            for (var i = 0; i < dashArrayX[xId0].length; ++i) {\n              xSum += dashArrayX[xId0][i];\n            }\n            if (xSum <= 0) {\n              // Skip empty line\n              break;\n            }\n            // E.g., [15, 5, 20, 5] draws only for 15 and 20\n            if (xId1 % 2 === 0) {\n              var size = (1 - decalOpt.symbolSize) * 0.5;\n              var left = x + dashArrayX[xId0][xId1] * size;\n              var top_1 = y + dashArrayY[yId] * size;\n              var width = dashArrayX[xId0][xId1] * decalOpt.symbolSize;\n              var height = dashArrayY[yId] * decalOpt.symbolSize;\n              var symbolXId = xId1Total / 2 % symbolArray[symbolYId].length;\n              brushSymbol(left, top_1, width, height, symbolArray[symbolYId][symbolXId]);\n            }\n            x += dashArrayX[xId0][xId1];\n            ++xId1Total;\n            ++xId1;\n            if (xId1 === dashArrayX[xId0].length) {\n              xId1 = 0;\n            }\n          }\n          ++xId0;\n          if (xId0 === dashArrayX.length) {\n            xId0 = 0;\n          }\n        }\n        y += dashArrayY[yId];\n        ++yIdTotal;\n        ++yId;\n        if (yId === dashArrayY.length) {\n          yId = 0;\n        }\n      }\n      function brushSymbol(x, y, width, height, symbolType) {\n        var scale = isSVG ? 1 : dpr;\n        var symbol = createSymbol(symbolType, x * scale, y * scale, width * scale, height * scale, decalOpt.color, decalOpt.symbolKeepAspect);\n        if (isSVG) {\n          var symbolVNode = zr.painter.renderOneToVNode(symbol);\n          if (symbolVNode) {\n            svgRoot.children.push(symbolVNode);\n          }\n        } else {\n          // Paint to canvas for all other renderers.\n          brushSingle(ctx, symbol);\n        }\n      }\n    }\n  }\n}\n/**\n * Convert symbol array into normalized array\n *\n * @param {string | (string | string[])[]} symbol symbol input\n * @return {string[][]} normolized symbol array\n */\nfunction normalizeSymbolArray(symbol) {\n  if (!symbol || symbol.length === 0) {\n    return [['rect']];\n  }\n  if (isString(symbol)) {\n    return [[symbol]];\n  }\n  var isAllString = true;\n  for (var i = 0; i < symbol.length; ++i) {\n    if (!isString(symbol[i])) {\n      isAllString = false;\n      break;\n    }\n  }\n  if (isAllString) {\n    return normalizeSymbolArray([symbol]);\n  }\n  var result = [];\n  for (var i = 0; i < symbol.length; ++i) {\n    if (isString(symbol[i])) {\n      result.push([symbol[i]]);\n    } else {\n      result.push(symbol[i]);\n    }\n  }\n  return result;\n}\n/**\n * Convert dash input into dashArray\n *\n * @param {DecalDashArrayX} dash dash input\n * @return {number[][]} normolized dash array\n */\nfunction normalizeDashArrayX(dash) {\n  if (!dash || dash.length === 0) {\n    return [[0, 0]];\n  }\n  if (isNumber(dash)) {\n    var dashValue = Math.ceil(dash);\n    return [[dashValue, dashValue]];\n  }\n  /**\n   * [20, 5] should be normalized into [[20, 5]],\n   * while [20, [5, 10]] should be normalized into [[20, 20], [5, 10]]\n   */\n  var isAllNumber = true;\n  for (var i = 0; i < dash.length; ++i) {\n    if (!isNumber(dash[i])) {\n      isAllNumber = false;\n      break;\n    }\n  }\n  if (isAllNumber) {\n    return normalizeDashArrayX([dash]);\n  }\n  var result = [];\n  for (var i = 0; i < dash.length; ++i) {\n    if (isNumber(dash[i])) {\n      var dashValue = Math.ceil(dash[i]);\n      result.push([dashValue, dashValue]);\n    } else {\n      var dashValue = map(dash[i], function (n) {\n        return Math.ceil(n);\n      });\n      if (dashValue.length % 2 === 1) {\n        // [4, 2, 1] means |----  -    -- |----  -    -- |\n        // so normalize it to be [4, 2, 1, 4, 2, 1]\n        result.push(dashValue.concat(dashValue));\n      } else {\n        result.push(dashValue);\n      }\n    }\n  }\n  return result;\n}\n/**\n * Convert dash input into dashArray\n *\n * @param {DecalDashArrayY} dash dash input\n * @return {number[]} normolized dash array\n */\nfunction normalizeDashArrayY(dash) {\n  if (!dash || typeof dash === 'object' && dash.length === 0) {\n    return [0, 0];\n  }\n  if (isNumber(dash)) {\n    var dashValue_1 = Math.ceil(dash);\n    return [dashValue_1, dashValue_1];\n  }\n  var dashValue = map(dash, function (n) {\n    return Math.ceil(n);\n  });\n  return dash.length % 2 ? dashValue.concat(dashValue) : dashValue;\n}\n/**\n * Get block length of each line. A block is the length of dash line and space.\n * For example, a line with [4, 1] has a dash line of 4 and a space of 1 after\n * that, so the block length of this line is 5.\n *\n * @param {number[][]} dash dash array of X or Y\n * @return {number[]} block length of each line\n */\nfunction getLineBlockLengthX(dash) {\n  return map(dash, function (line) {\n    return getLineBlockLengthY(line);\n  });\n}\nfunction getLineBlockLengthY(dash) {\n  var blockLength = 0;\n  for (var i = 0; i < dash.length; ++i) {\n    blockLength += dash[i];\n  }\n  if (dash.length % 2 === 1) {\n    // [4, 2, 1] means |----  -    -- |----  -    -- |\n    // So total length is (4 + 2 + 1) * 2\n    return blockLength * 2;\n  }\n  return blockLength;\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { createOrUpdatePatternFromDecal } from '../util/decal.js';\nexport default function decalVisual(ecModel, api) {\n  ecModel.eachRawSeries(function (seriesModel) {\n    if (ecModel.isSeriesFiltered(seriesModel)) {\n      return;\n    }\n    var data = seriesModel.getData();\n    if (data.hasItemVisual()) {\n      data.each(function (idx) {\n        var decal = data.getItemVisual(idx, 'decal');\n        if (decal) {\n          var itemStyle = data.ensureUniqueItemVisual(idx, 'style');\n          itemStyle.decal = createOrUpdatePatternFromDecal(decal, api);\n        }\n      });\n    }\n    var decal = data.getVisual('decal');\n    if (decal) {\n      var style = data.getVisual('style');\n      style.decal = createOrUpdatePatternFromDecal(decal, api);\n    }\n  });\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport Eventful from 'zrender/lib/core/Eventful.js';\n;\nvar lifecycle = new Eventful();\nexport default lifecycle;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { error } from '../util/log.js';\n// Implementation of exported APIs. For example registerMap, getMap.\n// The implementations will be registered when installing the component.\n// Avoid these code being bundled to the core module.\nvar implsStore = {};\n// TODO Type\nexport function registerImpl(name, impl) {\n  if (process.env.NODE_ENV !== 'production') {\n    if (implsStore[name]) {\n      error(\"Already has an implementation of \" + name + \".\");\n    }\n  }\n  implsStore[name] = impl;\n}\nexport function getImpl(name) {\n  if (process.env.NODE_ENV !== 'production') {\n    if (!implsStore[name]) {\n      error(\"Implementation of \" + name + \" doesn't exists.\");\n    }\n  }\n  return implsStore[name];\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nvar customRenderers = {};\nexport function registerCustomSeries(type, renderItem) {\n  customRenderers[type] = renderItem;\n}\nexport function getCustomSeries(type) {\n  return customRenderers[type];\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\nimport { __extends } from \"tslib\";\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrender from 'zrender/lib/zrender.js';\nimport { assert, each, isFunction, isObject, indexOf, bind, clone, setAsPrimitive, extend, createHashMap, map, defaults, isDom, isArray, noop, isString, retrieve2 } from 'zrender/lib/core/util.js';\nimport env from 'zrender/lib/core/env.js';\nimport timsort from 'zrender/lib/core/timsort.js';\nimport Eventful from 'zrender/lib/core/Eventful.js';\nimport GlobalModel from '../model/Global.js';\nimport ExtensionAPI from './ExtensionAPI.js';\nimport CoordinateSystemManager from './CoordinateSystem.js';\nimport OptionManager from '../model/OptionManager.js';\nimport backwardCompat from '../preprocessor/backwardCompat.js';\nimport dataStack from '../processor/dataStack.js';\nimport SeriesModel from '../model/Series.js';\nimport ComponentView from '../view/Component.js';\nimport ChartView from '../view/Chart.js';\nimport * as graphic from '../util/graphic.js';\nimport { getECData } from '../util/innerStore.js';\nimport { isHighDownDispatcher, HOVER_STATE_EMPHASIS, HOVER_STATE_BLUR, blurSeriesFromHighlightPayload, toggleSelectionFromPayload, updateSeriesElementSelection, getAllSelectedIndices, isSelectChangePayload, isHighDownPayload, HIGHLIGHT_ACTION_TYPE, DOWNPLAY_ACTION_TYPE, SELECT_ACTION_TYPE, UNSELECT_ACTION_TYPE, TOGGLE_SELECT_ACTION_TYPE, savePathStates, enterEmphasis, leaveEmphasis, leaveBlur, enterSelect, leaveSelect, enterBlur, allLeaveBlur, findComponentHighDownDispatchers, blurComponent, handleGlobalMouseOverForHighDown, handleGlobalMouseOutForHighDown, SELECT_CHANGED_EVENT_TYPE } from '../util/states.js';\nimport * as modelUtil from '../util/model.js';\nimport { throttle } from '../util/throttle.js';\nimport { seriesStyleTask, dataStyleTask, dataColorPaletteTask } from '../visual/style.js';\nimport loadingDefault from '../loading/default.js';\nimport Scheduler from './Scheduler.js';\nimport darkTheme from '../theme/dark.js';\nimport { parseClassType } from '../util/clazz.js';\nimport { ECEventProcessor } from '../util/ECEventProcessor.js';\nimport { seriesSymbolTask, dataSymbolTask } from '../visual/symbol.js';\nimport { getVisualFromData, getItemVisualFromData } from '../visual/helper.js';\nimport { deprecateLog, deprecateReplaceLog, error, warn } from '../util/log.js';\nimport { handleLegacySelectEvents } from '../legacy/dataSelectAction.js';\nimport { registerExternalTransform } from '../data/helper/transform.js';\nimport { createLocaleObject, SYSTEM_LANG } from './locale.js';\nimport { findEventDispatcher } from '../util/event.js';\nimport decal from '../visual/decal.js';\nimport lifecycle from './lifecycle.js';\nimport { platformApi, setPlatformAPI } from 'zrender/lib/core/platform.js';\nimport { getImpl } from './impl.js';\nimport { registerCustomSeries as registerCustom } from '../chart/custom/customSeriesRegister.js';\nexport var version = '6.0.0';\nexport var dependencies = {\n  zrender: '6.0.0'\n};\nvar TEST_FRAME_REMAIN_TIME = 1;\nvar PRIORITY_PROCESSOR_SERIES_FILTER = 800;\n// Some data processors depends on the stack result dimension (to calculate data extent).\n// So data stack stage should be in front of data processing stage.\nvar PRIORITY_PROCESSOR_DATASTACK = 900;\n// \"Data filter\" will block the stream, so it should be\n// put at the beginning of data processing.\nvar PRIORITY_PROCESSOR_FILTER = 1000;\nvar PRIORITY_PROCESSOR_DEFAULT = 2000;\nvar PRIORITY_PROCESSOR_STATISTIC = 5000;\nvar PRIORITY_VISUAL_LAYOUT = 1000;\nvar PRIORITY_VISUAL_PROGRESSIVE_LAYOUT = 1100;\nvar PRIORITY_VISUAL_GLOBAL = 2000;\nvar PRIORITY_VISUAL_CHART = 3000;\nvar PRIORITY_VISUAL_COMPONENT = 4000;\n// Visual property in data. Greater than `PRIORITY_VISUAL_COMPONENT` to enable to\n// overwrite the viusal result of component (like `visualMap`)\n// using data item specific setting (like itemStyle.xxx on data item)\nvar PRIORITY_VISUAL_CHART_DATA_CUSTOM = 4500;\n// Greater than `PRIORITY_VISUAL_CHART_DATA_CUSTOM` to enable to layout based on\n// visual result like `symbolSize`.\nvar PRIORITY_VISUAL_POST_CHART_LAYOUT = 4600;\nvar PRIORITY_VISUAL_BRUSH = 5000;\nvar PRIORITY_VISUAL_ARIA = 6000;\nvar PRIORITY_VISUAL_DECAL = 7000;\nexport var PRIORITY = {\n  PROCESSOR: {\n    FILTER: PRIORITY_PROCESSOR_FILTER,\n    SERIES_FILTER: PRIORITY_PROCESSOR_SERIES_FILTER,\n    STATISTIC: PRIORITY_PROCESSOR_STATISTIC\n  },\n  VISUAL: {\n    LAYOUT: PRIORITY_VISUAL_LAYOUT,\n    PROGRESSIVE_LAYOUT: PRIORITY_VISUAL_PROGRESSIVE_LAYOUT,\n    GLOBAL: PRIORITY_VISUAL_GLOBAL,\n    CHART: PRIORITY_VISUAL_CHART,\n    POST_CHART_LAYOUT: PRIORITY_VISUAL_POST_CHART_LAYOUT,\n    COMPONENT: PRIORITY_VISUAL_COMPONENT,\n    BRUSH: PRIORITY_VISUAL_BRUSH,\n    CHART_ITEM: PRIORITY_VISUAL_CHART_DATA_CUSTOM,\n    ARIA: PRIORITY_VISUAL_ARIA,\n    DECAL: PRIORITY_VISUAL_DECAL\n  }\n};\n// Main process have three entries: `setOption`, `dispatchAction` and `resize`,\n// where they must not be invoked nestedly, except the only case: invoke\n// dispatchAction with updateMethod \"none\" in main process.\n// This flag is used to carry out this rule.\n// All events will be triggered out side main process (i.e. when !this[IN_MAIN_PROCESS]).\nvar IN_MAIN_PROCESS_KEY = '__flagInMainProcess';\n// Useful for detecting outdated rendering results in scenarios that these issues are involved:\n//  - Use shortcut (such as, updateTransform, or no update) to start a main process.\n//  - Asynchronously update rendered view (e.g., graph force layout).\n//  - Multiple ChartView/ComponentView render to one group cooperatively.\nvar MAIN_PROCESS_VERSION_KEY = '__mainProcessVersion';\nvar PENDING_UPDATE = '__pendingUpdate';\nvar STATUS_NEEDS_UPDATE_KEY = '__needsUpdateStatus';\nvar ACTION_REG = /^[a-zA-Z0-9_]+$/;\nvar CONNECT_STATUS_KEY = '__connectUpdateStatus';\nvar CONNECT_STATUS_PENDING = 0;\nvar CONNECT_STATUS_UPDATING = 1;\nvar CONNECT_STATUS_UPDATED = 2;\n;\n;\nfunction createRegisterEventWithLowercaseECharts(method) {\n  return function () {\n    var args = [];\n    for (var _i = 0; _i < arguments.length; _i++) {\n      args[_i] = arguments[_i];\n    }\n    if (this.isDisposed()) {\n      disposedWarning(this.id);\n      return;\n    }\n    return toLowercaseNameAndCallEventful(this, method, args);\n  };\n}\nfunction createRegisterEventWithLowercaseMessageCenter(method) {\n  return function () {\n    var args = [];\n    for (var _i = 0; _i < arguments.length; _i++) {\n      args[_i] = arguments[_i];\n    }\n    return toLowercaseNameAndCallEventful(this, method, args);\n  };\n}\nfunction toLowercaseNameAndCallEventful(host, method, args) {\n  // `args[0]` is event name. Event name is all lowercase.\n  args[0] = args[0] && args[0].toLowerCase();\n  return Eventful.prototype[method].apply(host, args);\n}\nvar MessageCenter = /** @class */function (_super) {\n  __extends(MessageCenter, _super);\n  function MessageCenter() {\n    return _super !== null && _super.apply(this, arguments) || this;\n  }\n  return MessageCenter;\n}(Eventful);\nvar messageCenterProto = MessageCenter.prototype;\nmessageCenterProto.on = createRegisterEventWithLowercaseMessageCenter('on');\nmessageCenterProto.off = createRegisterEventWithLowercaseMessageCenter('off');\n// ---------------------------------------\n// Internal method names for class ECharts\n// ---------------------------------------\nvar prepare;\nvar prepareView;\nvar updateDirectly;\nvar updateMethods;\nvar doConvertPixel;\nvar updateStreamModes;\nvar doDispatchAction;\nvar flushPendingActions;\nvar triggerUpdatedEvent;\nvar bindRenderedEvent;\nvar bindMouseEvent;\nvar render;\nvar renderComponents;\nvar renderSeries;\nvar createExtensionAPI;\nvar enableConnect;\nvar markStatusToUpdate;\nvar applyChangedStates;\nvar updateMainProcessVersion;\nvar ECharts = /** @class */function (_super) {\n  __extends(ECharts, _super);\n  function ECharts(dom,\n  // Theme name or themeOption.\n  theme, opts) {\n    var _this = _super.call(this, new ECEventProcessor()) || this;\n    _this._chartsViews = [];\n    _this._chartsMap = {};\n    _this._componentsViews = [];\n    _this._componentsMap = {};\n    // Can't dispatch action during rendering procedure\n    _this._pendingActions = [];\n    opts = opts || {};\n    _this._dom = dom;\n    var defaultRenderer = 'canvas';\n    var defaultCoarsePointer = 'auto';\n    var defaultUseDirtyRect = false;\n    _this[MAIN_PROCESS_VERSION_KEY] = 1;\n    if (process.env.NODE_ENV !== 'production') {\n      var root = /* eslint-disable-next-line */\n      env.hasGlobalWindow ? window : global;\n      if (root) {\n        defaultRenderer = retrieve2(root.__ECHARTS__DEFAULT__RENDERER__, defaultRenderer);\n        defaultCoarsePointer = retrieve2(root.__ECHARTS__DEFAULT__COARSE_POINTER, defaultCoarsePointer);\n        defaultUseDirtyRect = retrieve2(root.__ECHARTS__DEFAULT__USE_DIRTY_RECT__, defaultUseDirtyRect);\n      }\n    }\n    if (opts.ssr) {\n      zrender.registerSSRDataGetter(function (el) {\n        var ecData = getECData(el);\n        var dataIndex = ecData.dataIndex;\n        if (dataIndex == null) {\n          return;\n        }\n        var hashMap = createHashMap();\n        hashMap.set('series_index', ecData.seriesIndex);\n        hashMap.set('data_index', dataIndex);\n        ecData.ssrType && hashMap.set('ssr_type', ecData.ssrType);\n        return hashMap;\n      });\n    }\n    var zr = _this._zr = zrender.init(dom, {\n      renderer: opts.renderer || defaultRenderer,\n      devicePixelRatio: opts.devicePixelRatio,\n      width: opts.width,\n      height: opts.height,\n      ssr: opts.ssr,\n      useDirtyRect: retrieve2(opts.useDirtyRect, defaultUseDirtyRect),\n      useCoarsePointer: retrieve2(opts.useCoarsePointer, defaultCoarsePointer),\n      pointerSize: opts.pointerSize\n    });\n    _this._ssr = opts.ssr;\n    // Expect 60 fps.\n    _this._throttledZrFlush = throttle(bind(zr.flush, zr), 17);\n    _this._updateTheme(theme);\n    _this._locale = createLocaleObject(opts.locale || SYSTEM_LANG);\n    _this._coordSysMgr = new CoordinateSystemManager();\n    var api = _this._api = createExtensionAPI(_this);\n    // Sort on demand\n    function prioritySortFunc(a, b) {\n      return a.__prio - b.__prio;\n    }\n    timsort(visualFuncs, prioritySortFunc);\n    timsort(dataProcessorFuncs, prioritySortFunc);\n    _this._scheduler = new Scheduler(_this, api, dataProcessorFuncs, visualFuncs);\n    _this._messageCenter = new MessageCenter();\n    // Init mouse events\n    _this._initEvents();\n    // In case some people write `window.onresize = chart.resize`\n    _this.resize = bind(_this.resize, _this);\n    zr.animation.on('frame', _this._onframe, _this);\n    bindRenderedEvent(zr, _this);\n    bindMouseEvent(zr, _this);\n    // ECharts instance can be used as value.\n    setAsPrimitive(_this);\n    return _this;\n  }\n  ECharts.prototype._onframe = function () {\n    if (this._disposed) {\n      return;\n    }\n    applyChangedStates(this);\n    var scheduler = this._scheduler;\n    // Lazy update\n    if (this[PENDING_UPDATE]) {\n      var silent = this[PENDING_UPDATE].silent;\n      this[IN_MAIN_PROCESS_KEY] = true;\n      updateMainProcessVersion(this);\n      try {\n        prepare(this);\n        updateMethods.update.call(this, null, this[PENDING_UPDATE].updateParams);\n      } catch (e) {\n        this[IN_MAIN_PROCESS_KEY] = false;\n        this[PENDING_UPDATE] = null;\n        throw e;\n      }\n      // At present, in each frame, zrender performs:\n      //   (1) animation step forward.\n      //   (2) trigger('frame') (where this `_onframe` is called)\n      //   (3) zrender flush (render).\n      // If we do nothing here, since we use `setToFinal: true`, the step (3) above\n      // will render the final state of the elements before the real animation started.\n      this._zr.flush();\n      this[IN_MAIN_PROCESS_KEY] = false;\n      this[PENDING_UPDATE] = null;\n      flushPendingActions.call(this, silent);\n      triggerUpdatedEvent.call(this, silent);\n    }\n    // Avoid do both lazy update and progress in one frame.\n    else if (scheduler.unfinished) {\n      // Stream progress.\n      var remainTime = TEST_FRAME_REMAIN_TIME;\n      var ecModel = this._model;\n      var api = this._api;\n      scheduler.unfinished = false;\n      do {\n        var startTime = +new Date();\n        scheduler.performSeriesTasks(ecModel);\n        // Currently dataProcessorFuncs do not check threshold.\n        scheduler.performDataProcessorTasks(ecModel);\n        updateStreamModes(this, ecModel);\n        // Do not update coordinate system here. Because that coord system update in\n        // each frame is not a good user experience. So we follow the rule that\n        // the extent of the coordinate system is determined in the first frame (the\n        // frame is executed immediately after task reset.\n        // this._coordSysMgr.update(ecModel, api);\n        // console.log('--- ec frame visual ---', remainTime);\n        scheduler.performVisualTasks(ecModel);\n        renderSeries(this, this._model, api, 'remain', {});\n        remainTime -= +new Date() - startTime;\n      } while (remainTime > 0 && scheduler.unfinished);\n      // Call flush explicitly for trigger finished event.\n      if (!scheduler.unfinished) {\n        this._zr.flush();\n      }\n      // Else, zr flushing be ensue within the same frame,\n      // because zr flushing is after onframe event.\n    }\n  };\n  ECharts.prototype.getDom = function () {\n    return this._dom;\n  };\n  ECharts.prototype.getId = function () {\n    return this.id;\n  };\n  ECharts.prototype.getZr = function () {\n    return this._zr;\n  };\n  ECharts.prototype.isSSR = function () {\n    return this._ssr;\n  };\n  /* eslint-disable-next-line */\n  ECharts.prototype.setOption = function (option, notMerge, lazyUpdate) {\n    if (this[IN_MAIN_PROCESS_KEY]) {\n      if (process.env.NODE_ENV !== 'production') {\n        error('`setOption` should not be called during main process.');\n      }\n      return;\n    }\n    if (this._disposed) {\n      disposedWarning(this.id);\n      return;\n    }\n    var silent;\n    var replaceMerge;\n    var transitionOpt;\n    if (isObject(notMerge)) {\n      lazyUpdate = notMerge.lazyUpdate;\n      silent = notMerge.silent;\n      replaceMerge = notMerge.replaceMerge;\n      transitionOpt = notMerge.transition;\n      notMerge = notMerge.notMerge;\n    }\n    this[IN_MAIN_PROCESS_KEY] = true;\n    updateMainProcessVersion(this);\n    if (!this._model || notMerge) {\n      var optionManager = new OptionManager(this._api);\n      var theme = this._theme;\n      var ecModel = this._model = new GlobalModel();\n      ecModel.scheduler = this._scheduler;\n      ecModel.ssr = this._ssr;\n      ecModel.init(null, null, null, theme, this._locale, optionManager);\n    }\n    this._model.setOption(option, {\n      replaceMerge: replaceMerge\n    }, optionPreprocessorFuncs);\n    var updateParams = {\n      seriesTransition: transitionOpt,\n      optionChanged: true\n    };\n    if (lazyUpdate) {\n      this[PENDING_UPDATE] = {\n        silent: silent,\n        updateParams: updateParams\n      };\n      this[IN_MAIN_PROCESS_KEY] = false;\n      // `setOption(option, {lazyMode: true})` may be called when zrender has been slept.\n      // It should wake it up to make sure zrender start to render at the next frame.\n      this.getZr().wakeUp();\n    } else {\n      try {\n        prepare(this);\n        updateMethods.update.call(this, null, updateParams);\n      } catch (e) {\n        this[PENDING_UPDATE] = null;\n        this[IN_MAIN_PROCESS_KEY] = false;\n        throw e;\n      }\n      // Ensure zr refresh sychronously, and then pixel in canvas can be\n      // fetched after `setOption`.\n      if (!this._ssr) {\n        // not use flush when using ssr mode.\n        this._zr.flush();\n      }\n      this[PENDING_UPDATE] = null;\n      this[IN_MAIN_PROCESS_KEY] = false;\n      flushPendingActions.call(this, silent);\n      triggerUpdatedEvent.call(this, silent);\n    }\n  };\n  /**\n   * Update theme with name or theme option and repaint the chart.\n   * @param theme Theme name or theme option.\n   * @param opts Optional settings\n   */\n  ECharts.prototype.setTheme = function (theme, opts) {\n    if (this[IN_MAIN_PROCESS_KEY]) {\n      if (process.env.NODE_ENV !== 'production') {\n        error('`setTheme` should not be called during main process.');\n      }\n      return;\n    }\n    if (this._disposed) {\n      disposedWarning(this.id);\n      return;\n    }\n    var ecModel = this._model;\n    if (!ecModel) {\n      return;\n    }\n    var silent = opts && opts.silent;\n    var updateParams = null;\n    if (this[PENDING_UPDATE]) {\n      if (silent == null) {\n        silent = this[PENDING_UPDATE].silent;\n      }\n      updateParams = this[PENDING_UPDATE].updateParams;\n      this[PENDING_UPDATE] = null;\n    }\n    this[IN_MAIN_PROCESS_KEY] = true;\n    updateMainProcessVersion(this);\n    try {\n      this._updateTheme(theme);\n      ecModel.setTheme(this._theme);\n      prepare(this);\n      updateMethods.update.call(this, {\n        type: 'setTheme'\n      }, updateParams);\n    } catch (e) {\n      this[IN_MAIN_PROCESS_KEY] = false;\n      throw e;\n    }\n    this[IN_MAIN_PROCESS_KEY] = false;\n    flushPendingActions.call(this, silent);\n    triggerUpdatedEvent.call(this, silent);\n  };\n  ECharts.prototype._updateTheme = function (theme) {\n    if (isString(theme)) {\n      theme = themeStorage[theme];\n    }\n    if (theme) {\n      theme = clone(theme);\n      theme && backwardCompat(theme, true);\n      this._theme = theme;\n    }\n  };\n  // We don't want developers to use getModel directly.\n  ECharts.prototype.getModel = function () {\n    return this._model;\n  };\n  ECharts.prototype.getOption = function () {\n    return this._model && this._model.getOption();\n  };\n  ECharts.prototype.getWidth = function () {\n    return this._zr.getWidth();\n  };\n  ECharts.prototype.getHeight = function () {\n    return this._zr.getHeight();\n  };\n  ECharts.prototype.getDevicePixelRatio = function () {\n    return this._zr.painter.dpr\n    /* eslint-disable-next-line */ || env.hasGlobalWindow && window.devicePixelRatio || 1;\n  };\n  /**\n   * Get canvas which has all thing rendered\n   * @deprecated Use renderToCanvas instead.\n   */\n  ECharts.prototype.getRenderedCanvas = function (opts) {\n    if (process.env.NODE_ENV !== 'production') {\n      deprecateReplaceLog('getRenderedCanvas', 'renderToCanvas');\n    }\n    return this.renderToCanvas(opts);\n  };\n  ECharts.prototype.renderToCanvas = function (opts) {\n    opts = opts || {};\n    var painter = this._zr.painter;\n    if (process.env.NODE_ENV !== 'production') {\n      if (painter.type !== 'canvas') {\n        throw new Error('renderToCanvas can only be used in the canvas renderer.');\n      }\n    }\n    return painter.getRenderedCanvas({\n      backgroundColor: opts.backgroundColor || this._model.get('backgroundColor'),\n      pixelRatio: opts.pixelRatio || this.getDevicePixelRatio()\n    });\n  };\n  ECharts.prototype.renderToSVGString = function (opts) {\n    opts = opts || {};\n    var painter = this._zr.painter;\n    if (process.env.NODE_ENV !== 'production') {\n      if (painter.type !== 'svg') {\n        throw new Error('renderToSVGString can only be used in the svg renderer.');\n      }\n    }\n    return painter.renderToString({\n      useViewBox: opts.useViewBox\n    });\n  };\n  /**\n   * Get svg data url\n   */\n  ECharts.prototype.getSvgDataURL = function () {\n    var zr = this._zr;\n    var list = zr.storage.getDisplayList();\n    // Stop animations\n    each(list, function (el) {\n      el.stopAnimation(null, true);\n    });\n    return zr.painter.toDataURL();\n  };\n  ECharts.prototype.getDataURL = function (opts) {\n    if (this._disposed) {\n      disposedWarning(this.id);\n      return;\n    }\n    opts = opts || {};\n    var excludeComponents = opts.excludeComponents;\n    var ecModel = this._model;\n    var excludesComponentViews = [];\n    var self = this;\n    each(excludeComponents, function (componentType) {\n      ecModel.eachComponent({\n        mainType: componentType\n      }, function (component) {\n        var view = self._componentsMap[component.__viewId];\n        if (!view.group.ignore) {\n          excludesComponentViews.push(view);\n          view.group.ignore = true;\n        }\n      });\n    });\n    var url = this._zr.painter.getType() === 'svg' ? this.getSvgDataURL() : this.renderToCanvas(opts).toDataURL('image/' + (opts && opts.type || 'png'));\n    each(excludesComponentViews, function (view) {\n      view.group.ignore = false;\n    });\n    return url;\n  };\n  ECharts.prototype.getConnectedDataURL = function (opts) {\n    if (this._disposed) {\n      disposedWarning(this.id);\n      return;\n    }\n    var isSvg = opts.type === 'svg';\n    var groupId = this.group;\n    var mathMin = Math.min;\n    var mathMax = Math.max;\n    var MAX_NUMBER = Infinity;\n    if (connectedGroups[groupId]) {\n      var left_1 = MAX_NUMBER;\n      var top_1 = MAX_NUMBER;\n      var right_1 = -MAX_NUMBER;\n      var bottom_1 = -MAX_NUMBER;\n      var canvasList_1 = [];\n      var dpr_1 = opts && opts.pixelRatio || this.getDevicePixelRatio();\n      each(instances, function (chart, id) {\n        if (chart.group === groupId) {\n          var canvas = isSvg ? chart.getZr().painter.getSvgDom().innerHTML : chart.renderToCanvas(clone(opts));\n          var boundingRect = chart.getDom().getBoundingClientRect();\n          left_1 = mathMin(boundingRect.left, left_1);\n          top_1 = mathMin(boundingRect.top, top_1);\n          right_1 = mathMax(boundingRect.right, right_1);\n          bottom_1 = mathMax(boundingRect.bottom, bottom_1);\n          canvasList_1.push({\n            dom: canvas,\n            left: boundingRect.left,\n            top: boundingRect.top\n          });\n        }\n      });\n      left_1 *= dpr_1;\n      top_1 *= dpr_1;\n      right_1 *= dpr_1;\n      bottom_1 *= dpr_1;\n      var width = right_1 - left_1;\n      var height = bottom_1 - top_1;\n      var targetCanvas = platformApi.createCanvas();\n      var zr_1 = zrender.init(targetCanvas, {\n        renderer: isSvg ? 'svg' : 'canvas'\n      });\n      zr_1.resize({\n        width: width,\n        height: height\n      });\n      if (isSvg) {\n        var content_1 = '';\n        each(canvasList_1, function (item) {\n          var x = item.left - left_1;\n          var y = item.top - top_1;\n          content_1 += '<g transform=\"translate(' + x + ',' + y + ')\">' + item.dom + '</g>';\n        });\n        zr_1.painter.getSvgRoot().innerHTML = content_1;\n        if (opts.connectedBackgroundColor) {\n          zr_1.painter.setBackgroundColor(opts.connectedBackgroundColor);\n        }\n        zr_1.refreshImmediately();\n        return zr_1.painter.toDataURL();\n      } else {\n        // Background between the charts\n        if (opts.connectedBackgroundColor) {\n          zr_1.add(new graphic.Rect({\n            shape: {\n              x: 0,\n              y: 0,\n              width: width,\n              height: height\n            },\n            style: {\n              fill: opts.connectedBackgroundColor\n            }\n          }));\n        }\n        each(canvasList_1, function (item) {\n          var img = new graphic.Image({\n            style: {\n              x: item.left * dpr_1 - left_1,\n              y: item.top * dpr_1 - top_1,\n              image: item.dom\n            }\n          });\n          zr_1.add(img);\n        });\n        zr_1.refreshImmediately();\n        return targetCanvas.toDataURL('image/' + (opts && opts.type || 'png'));\n      }\n    } else {\n      return this.getDataURL(opts);\n    }\n  };\n  ECharts.prototype.convertToPixel = function (finder, value, opt) {\n    return doConvertPixel(this, 'convertToPixel', finder, value, opt);\n  };\n  /**\n   * Convert from logical coordinate system to pixel coordinate system.\n   * See CoordinateSystem#convertToPixel.\n   *\n   * @see CoordinateSystem['dataToLayout'] for parameters and return.\n   * @see CoordinateSystemDataCoord\n   */\n  ECharts.prototype.convertToLayout = function (finder, value, opt) {\n    return doConvertPixel(this, 'convertToLayout', finder, value, opt);\n  };\n  // The above are signatures from before v6, thus they should be preserved for backward compat.\n  ECharts.prototype.convertFromPixel = function (finder, value, opt) {\n    return doConvertPixel(this, 'convertFromPixel', finder, value, opt);\n  };\n  /**\n   * Is the specified coordinate systems or components contain the given pixel point.\n   * @param {Array|number} value\n   * @return {boolean} result\n   */\n  ECharts.prototype.containPixel = function (finder, value) {\n    if (this._disposed) {\n      disposedWarning(this.id);\n      return;\n    }\n    var ecModel = this._model;\n    var result;\n    var findResult = modelUtil.parseFinder(ecModel, finder);\n    each(findResult, function (models, key) {\n      key.indexOf('Models') >= 0 && each(models, function (model) {\n        var coordSys = model.coordinateSystem;\n        if (coordSys && coordSys.containPoint) {\n          result = result || !!coordSys.containPoint(value);\n        } else if (key === 'seriesModels') {\n          var view = this._chartsMap[model.__viewId];\n          if (view && view.containPoint) {\n            result = result || view.containPoint(value, model);\n          } else {\n            if (process.env.NODE_ENV !== 'production') {\n              warn(key + ': ' + (view ? 'The found component do not support containPoint.' : 'No view mapping to the found component.'));\n            }\n          }\n        } else {\n          if (process.env.NODE_ENV !== 'production') {\n            warn(key + ': containPoint is not supported');\n          }\n        }\n      }, this);\n    }, this);\n    return !!result;\n  };\n  /**\n   * Get visual from series or data.\n   * @param finder\n   *        If string, e.g., 'series', means {seriesIndex: 0}.\n   *        If Object, could contain some of these properties below:\n   *        {\n   *            seriesIndex / seriesId / seriesName,\n   *            dataIndex / dataIndexInside\n   *        }\n   *        If dataIndex is not specified, series visual will be fetched,\n   *        but not data item visual.\n   *        If all of seriesIndex, seriesId, seriesName are not specified,\n   *        visual will be fetched from first series.\n   * @param visualType 'color', 'symbol', 'symbolSize'\n   */\n  ECharts.prototype.getVisual = function (finder, visualType) {\n    var ecModel = this._model;\n    var parsedFinder = modelUtil.parseFinder(ecModel, finder, {\n      defaultMainType: 'series'\n    });\n    var seriesModel = parsedFinder.seriesModel;\n    if (process.env.NODE_ENV !== 'production') {\n      if (!seriesModel) {\n        warn('There is no specified series model');\n      }\n    }\n    var data = seriesModel.getData();\n    var dataIndexInside = parsedFinder.hasOwnProperty('dataIndexInside') ? parsedFinder.dataIndexInside : parsedFinder.hasOwnProperty('dataIndex') ? data.indexOfRawIndex(parsedFinder.dataIndex) : null;\n    return dataIndexInside != null ? getItemVisualFromData(data, dataIndexInside, visualType) : getVisualFromData(data, visualType);\n  };\n  /**\n   * Get view of corresponding component model\n   */\n  ECharts.prototype.getViewOfComponentModel = function (componentModel) {\n    return this._componentsMap[componentModel.__viewId];\n  };\n  /**\n   * Get view of corresponding series model\n   */\n  ECharts.prototype.getViewOfSeriesModel = function (seriesModel) {\n    return this._chartsMap[seriesModel.__viewId];\n  };\n  ECharts.prototype._initEvents = function () {\n    var _this = this;\n    each(MOUSE_EVENT_NAMES, function (eveName) {\n      var handler = function (e) {\n        var ecModel = _this.getModel();\n        var el = e.target;\n        var params;\n        var isGlobalOut = eveName === 'globalout';\n        // no e.target when 'globalout'.\n        if (isGlobalOut) {\n          params = {};\n        } else {\n          el && findEventDispatcher(el, function (parent) {\n            var ecData = getECData(parent);\n            if (ecData && ecData.dataIndex != null) {\n              var dataModel = ecData.dataModel || ecModel.getSeriesByIndex(ecData.seriesIndex);\n              params = dataModel && dataModel.getDataParams(ecData.dataIndex, ecData.dataType, el) || {};\n              return true;\n            }\n            // If element has custom eventData of components\n            else if (ecData.eventData) {\n              params = extend({}, ecData.eventData);\n              return true;\n            }\n          }, true);\n        }\n        // Contract: if params prepared in mouse event,\n        // these properties must be specified:\n        // {\n        //    componentType: string (component main type)\n        //    componentIndex: number\n        // }\n        // Otherwise event query can not work.\n        if (params) {\n          var componentType = params.componentType;\n          var componentIndex = params.componentIndex;\n          // Special handling for historic reason: when trigger by\n          // markLine/markPoint/markArea, the componentType is\n          // 'markLine'/'markPoint'/'markArea', but we should better\n          // enable them to be queried by seriesIndex, since their\n          // option is set in each series.\n          if (componentType === 'markLine' || componentType === 'markPoint' || componentType === 'markArea') {\n            componentType = 'series';\n            componentIndex = params.seriesIndex;\n          }\n          var model = componentType && componentIndex != null && ecModel.getComponent(componentType, componentIndex);\n          var view = model && _this[model.mainType === 'series' ? '_chartsMap' : '_componentsMap'][model.__viewId];\n          if (process.env.NODE_ENV !== 'production') {\n            // `event.componentType` and `event[componentTpype + 'Index']` must not\n            // be missed, otherwise there is no way to distinguish source component.\n            // See `dataFormat.getDataParams`.\n            if (!isGlobalOut && !(model && view)) {\n              warn('model or view can not be found by params');\n            }\n          }\n          params.event = e;\n          params.type = eveName;\n          _this._$eventProcessor.eventInfo = {\n            targetEl: el,\n            packedEvent: params,\n            model: model,\n            view: view\n          };\n          _this.trigger(eveName, params);\n        }\n      };\n      // Consider that some component (like tooltip, brush, ...)\n      // register zr event handler, but user event handler might\n      // do anything, such as call `setOption` or `dispatchAction`,\n      // which probably update any of the content and probably\n      // cause problem if it is called previous other inner handlers.\n      handler.zrEventfulCallAtLast = true;\n      _this._zr.on(eveName, handler, _this);\n    });\n    var messageCenter = this._messageCenter;\n    each(publicEventTypeMap, function (_, eventType) {\n      messageCenter.on(eventType, function (event) {\n        _this.trigger(eventType, event);\n      });\n    });\n    handleLegacySelectEvents(messageCenter, this, this._api);\n  };\n  ECharts.prototype.isDisposed = function () {\n    return this._disposed;\n  };\n  ECharts.prototype.clear = function () {\n    if (this._disposed) {\n      disposedWarning(this.id);\n      return;\n    }\n    this.setOption({\n      series: []\n    }, true);\n  };\n  ECharts.prototype.dispose = function () {\n    if (this._disposed) {\n      disposedWarning(this.id);\n      return;\n    }\n    this._disposed = true;\n    var dom = this.getDom();\n    if (dom) {\n      modelUtil.setAttribute(this.getDom(), DOM_ATTRIBUTE_KEY, '');\n    }\n    var chart = this;\n    var api = chart._api;\n    var ecModel = chart._model;\n    each(chart._componentsViews, function (component) {\n      component.dispose(ecModel, api);\n    });\n    each(chart._chartsViews, function (chart) {\n      chart.dispose(ecModel, api);\n    });\n    // Dispose after all views disposed\n    chart._zr.dispose();\n    // Set properties to null.\n    // To reduce the memory cost in case the top code still holds this instance unexpectedly.\n    chart._dom = chart._model = chart._chartsMap = chart._componentsMap = chart._chartsViews = chart._componentsViews = chart._scheduler = chart._api = chart._zr = chart._throttledZrFlush = chart._theme = chart._coordSysMgr = chart._messageCenter = null;\n    delete instances[chart.id];\n  };\n  /**\n   * Resize the chart\n   */\n  ECharts.prototype.resize = function (opts) {\n    if (this[IN_MAIN_PROCESS_KEY]) {\n      if (process.env.NODE_ENV !== 'production') {\n        error('`resize` should not be called during main process.');\n      }\n      return;\n    }\n    if (this._disposed) {\n      disposedWarning(this.id);\n      return;\n    }\n    this._zr.resize(opts);\n    var ecModel = this._model;\n    // Resize loading effect\n    this._loadingFX && this._loadingFX.resize();\n    if (!ecModel) {\n      return;\n    }\n    var needPrepare = ecModel.resetOption('media');\n    var silent = opts && opts.silent;\n    // There is some real cases that:\n    // chart.setOption(option, { lazyUpdate: true });\n    // chart.resize();\n    if (this[PENDING_UPDATE]) {\n      if (silent == null) {\n        silent = this[PENDING_UPDATE].silent;\n      }\n      needPrepare = true;\n      this[PENDING_UPDATE] = null;\n    }\n    this[IN_MAIN_PROCESS_KEY] = true;\n    updateMainProcessVersion(this);\n    try {\n      needPrepare && prepare(this);\n      updateMethods.update.call(this, {\n        type: 'resize',\n        animation: extend({\n          // Disable animation\n          duration: 0\n        }, opts && opts.animation)\n      });\n    } catch (e) {\n      this[IN_MAIN_PROCESS_KEY] = false;\n      throw e;\n    }\n    this[IN_MAIN_PROCESS_KEY] = false;\n    flushPendingActions.call(this, silent);\n    triggerUpdatedEvent.call(this, silent);\n  };\n  ECharts.prototype.showLoading = function (name, cfg) {\n    if (this._disposed) {\n      disposedWarning(this.id);\n      return;\n    }\n    if (isObject(name)) {\n      cfg = name;\n      name = '';\n    }\n    name = name || 'default';\n    this.hideLoading();\n    if (!loadingEffects[name]) {\n      if (process.env.NODE_ENV !== 'production') {\n        warn('Loading effects ' + name + ' not exists.');\n      }\n      return;\n    }\n    var el = loadingEffects[name](this._api, cfg);\n    var zr = this._zr;\n    this._loadingFX = el;\n    zr.add(el);\n  };\n  /**\n   * Hide loading effect\n   */\n  ECharts.prototype.hideLoading = function () {\n    if (this._disposed) {\n      disposedWarning(this.id);\n      return;\n    }\n    this._loadingFX && this._zr.remove(this._loadingFX);\n    this._loadingFX = null;\n  };\n  ECharts.prototype.makeActionFromEvent = function (eventObj) {\n    var payload = extend({}, eventObj);\n    payload.type = connectionEventRevertMap[eventObj.type];\n    return payload;\n  };\n  /**\n   * @param opt If pass boolean, means opt.silent\n   * @param opt.silent Default `false`. Whether trigger events.\n   * @param opt.flush Default `undefined`.\n   *        true: Flush immediately, and then pixel in canvas can be fetched\n   *            immediately. Caution: it might affect performance.\n   *        false: Not flush.\n   *        undefined: Auto decide whether perform flush.\n   */\n  ECharts.prototype.dispatchAction = function (payload, opt) {\n    if (this._disposed) {\n      disposedWarning(this.id);\n      return;\n    }\n    if (!isObject(opt)) {\n      opt = {\n        silent: !!opt\n      };\n    }\n    if (!actions[payload.type]) {\n      return;\n    }\n    // Avoid dispatch action before setOption. Especially in `connect`.\n    if (!this._model) {\n      return;\n    }\n    // May dispatchAction in rendering procedure\n    if (this[IN_MAIN_PROCESS_KEY]) {\n      this._pendingActions.push(payload);\n      return;\n    }\n    var silent = opt.silent;\n    doDispatchAction.call(this, payload, silent);\n    var flush = opt.flush;\n    if (flush) {\n      this._zr.flush();\n    } else if (flush !== false && env.browser.weChat) {\n      // In WeChat embedded browser, `requestAnimationFrame` and `setInterval`\n      // hang when sliding page (on touch event), which cause that zr does not\n      // refresh until user interaction finished, which is not expected.\n      // But `dispatchAction` may be called too frequently when pan on touch\n      // screen, which impacts performance if do not throttle them.\n      this._throttledZrFlush();\n    }\n    flushPendingActions.call(this, silent);\n    triggerUpdatedEvent.call(this, silent);\n  };\n  ECharts.prototype.updateLabelLayout = function () {\n    lifecycle.trigger('series:layoutlabels', this._model, this._api, {\n      // Not adding series labels.\n      // TODO\n      updatedSeries: []\n    });\n  };\n  ECharts.prototype.appendData = function (params) {\n    if (this._disposed) {\n      disposedWarning(this.id);\n      return;\n    }\n    var seriesIndex = params.seriesIndex;\n    var ecModel = this.getModel();\n    var seriesModel = ecModel.getSeriesByIndex(seriesIndex);\n    if (process.env.NODE_ENV !== 'production') {\n      assert(params.data && seriesModel);\n    }\n    seriesModel.appendData(params);\n    // Note: `appendData` does not support that update extent of coordinate\n    // system, util some scenario require that. In the expected usage of\n    // `appendData`, the initial extent of coordinate system should better\n    // be fixed by axis `min`/`max` setting or initial data, otherwise if\n    // the extent changed while `appendData`, the location of the painted\n    // graphic elements have to be changed, which make the usage of\n    // `appendData` meaningless.\n    this._scheduler.unfinished = true;\n    this.getZr().wakeUp();\n  };\n  // A work around for no `internal` modifier in ts yet but\n  // need to strictly hide private methods to JS users.\n  ECharts.internalField = function () {\n    prepare = function (ecIns) {\n      var scheduler = ecIns._scheduler;\n      scheduler.restorePipelines(ecIns._model);\n      scheduler.prepareStageTasks();\n      prepareView(ecIns, true);\n      prepareView(ecIns, false);\n      scheduler.plan();\n    };\n    /**\n     * Prepare view instances of charts and components\n     */\n    prepareView = function (ecIns, isComponent) {\n      var ecModel = ecIns._model;\n      var scheduler = ecIns._scheduler;\n      var viewList = isComponent ? ecIns._componentsViews : ecIns._chartsViews;\n      var viewMap = isComponent ? ecIns._componentsMap : ecIns._chartsMap;\n      var zr = ecIns._zr;\n      var api = ecIns._api;\n      for (var i = 0; i < viewList.length; i++) {\n        viewList[i].__alive = false;\n      }\n      isComponent ? ecModel.eachComponent(function (componentType, model) {\n        componentType !== 'series' && doPrepare(model);\n      }) : ecModel.eachSeries(doPrepare);\n      function doPrepare(model) {\n        // By default view will be reused if possible for the case that `setOption` with \"notMerge\"\n        // mode and need to enable transition animation. (Usually, when they have the same id, or\n        // especially no id but have the same type & name & index. See the `model.id` generation\n        // rule in `makeIdAndName` and `viewId` generation rule here).\n        // But in `replaceMerge` mode, this feature should be able to disabled when it is clear that\n        // the new model has nothing to do with the old model.\n        var requireNewView = model.__requireNewView;\n        // This command should not work twice.\n        model.__requireNewView = false;\n        // Consider: id same and type changed.\n        var viewId = '_ec_' + model.id + '_' + model.type;\n        var view = !requireNewView && viewMap[viewId];\n        if (!view) {\n          var classType = parseClassType(model.type);\n          var Clazz = isComponent ? ComponentView.getClass(classType.main, classType.sub) :\n          // FIXME:TS\n          // (ChartView as ChartViewConstructor).getClass('series', classType.sub)\n          // For backward compat, still support a chart type declared as only subType\n          // like \"liquidfill\", but recommend \"series.liquidfill\"\n          // But need a base class to make a type series.\n          ChartView.getClass(classType.sub);\n          if (process.env.NODE_ENV !== 'production') {\n            assert(Clazz, classType.sub + ' does not exist.');\n          }\n          view = new Clazz();\n          view.init(ecModel, api);\n          viewMap[viewId] = view;\n          viewList.push(view);\n          zr.add(view.group);\n        }\n        model.__viewId = view.__id = viewId;\n        view.__alive = true;\n        view.__model = model;\n        view.group.__ecComponentInfo = {\n          mainType: model.mainType,\n          index: model.componentIndex\n        };\n        !isComponent && scheduler.prepareView(view, model, ecModel, api);\n      }\n      for (var i = 0; i < viewList.length;) {\n        var view = viewList[i];\n        if (!view.__alive) {\n          !isComponent && view.renderTask.dispose();\n          zr.remove(view.group);\n          view.dispose(ecModel, api);\n          viewList.splice(i, 1);\n          if (viewMap[view.__id] === view) {\n            delete viewMap[view.__id];\n          }\n          view.__id = view.group.__ecComponentInfo = null;\n        } else {\n          i++;\n        }\n      }\n    };\n    updateDirectly = function (ecIns, method, payload, mainType, subType) {\n      var ecModel = ecIns._model;\n      ecModel.setUpdatePayload(payload);\n      // broadcast\n      if (!mainType) {\n        // FIXME\n        // Chart will not be update directly here, except set dirty.\n        // But there is no such scenario now.\n        each([].concat(ecIns._componentsViews).concat(ecIns._chartsViews), callView);\n        return;\n      }\n      var query = {};\n      query[mainType + 'Id'] = payload[mainType + 'Id'];\n      query[mainType + 'Index'] = payload[mainType + 'Index'];\n      query[mainType + 'Name'] = payload[mainType + 'Name'];\n      var condition = {\n        mainType: mainType,\n        query: query\n      };\n      subType && (condition.subType = subType); // subType may be '' by parseClassType;\n      var excludeSeriesId = payload.excludeSeriesId;\n      var excludeSeriesIdMap;\n      if (excludeSeriesId != null) {\n        excludeSeriesIdMap = createHashMap();\n        each(modelUtil.normalizeToArray(excludeSeriesId), function (id) {\n          var modelId = modelUtil.convertOptionIdName(id, null);\n          if (modelId != null) {\n            excludeSeriesIdMap.set(modelId, true);\n          }\n        });\n      }\n      // If dispatchAction before setOption, do nothing.\n      ecModel && ecModel.eachComponent(condition, function (model) {\n        var isExcluded = excludeSeriesIdMap && excludeSeriesIdMap.get(model.id) != null;\n        if (isExcluded) {\n          return;\n        }\n        ;\n        if (isHighDownPayload(payload)) {\n          if (model instanceof SeriesModel) {\n            if (payload.type === HIGHLIGHT_ACTION_TYPE && !payload.notBlur && !model.get(['emphasis', 'disabled'])) {\n              blurSeriesFromHighlightPayload(model, payload, ecIns._api);\n            }\n          } else {\n            var _a = findComponentHighDownDispatchers(model.mainType, model.componentIndex, payload.name, ecIns._api),\n              focusSelf = _a.focusSelf,\n              dispatchers = _a.dispatchers;\n            if (payload.type === HIGHLIGHT_ACTION_TYPE && focusSelf && !payload.notBlur) {\n              blurComponent(model.mainType, model.componentIndex, ecIns._api);\n            }\n            // PENDING:\n            // Whether to put this \"enter emphasis\" code in `ComponentView`,\n            // which will be the same as `ChartView` but might be not necessary\n            // and will be far from this logic.\n            if (dispatchers) {\n              each(dispatchers, function (dispatcher) {\n                payload.type === HIGHLIGHT_ACTION_TYPE ? enterEmphasis(dispatcher) : leaveEmphasis(dispatcher);\n              });\n            }\n          }\n        } else if (isSelectChangePayload(payload)) {\n          // TODO geo\n          if (model instanceof SeriesModel) {\n            toggleSelectionFromPayload(model, payload, ecIns._api);\n            updateSeriesElementSelection(model);\n            markStatusToUpdate(ecIns);\n          }\n        }\n      }, ecIns);\n      ecModel && ecModel.eachComponent(condition, function (model) {\n        var isExcluded = excludeSeriesIdMap && excludeSeriesIdMap.get(model.id) != null;\n        if (isExcluded) {\n          return;\n        }\n        ;\n        callView(ecIns[mainType === 'series' ? '_chartsMap' : '_componentsMap'][model.__viewId]);\n      }, ecIns);\n      function callView(view) {\n        view && view.__alive && view[method] && view[method](view.__model, ecModel, ecIns._api, payload);\n      }\n    };\n    updateMethods = {\n      prepareAndUpdate: function (payload) {\n        prepare(this);\n        updateMethods.update.call(this, payload, payload && {\n          // Needs to mark option changed if newOption is given.\n          // It's from MagicType.\n          // TODO If use a separate flag optionChanged in payload?\n          optionChanged: payload.newOption != null\n        });\n      },\n      update: function (payload, updateParams) {\n        var ecModel = this._model;\n        var api = this._api;\n        var zr = this._zr;\n        var coordSysMgr = this._coordSysMgr;\n        var scheduler = this._scheduler;\n        // update before setOption\n        if (!ecModel) {\n          return;\n        }\n        ecModel.setUpdatePayload(payload);\n        scheduler.restoreData(ecModel, payload);\n        scheduler.performSeriesTasks(ecModel);\n        // TODO\n        // Save total ecModel here for undo/redo (after restoring data and before processing data).\n        // Undo (restoration of total ecModel) can be carried out in 'action' or outside API call.\n        // Create new coordinate system each update\n        // In LineView may save the old coordinate system and use it to get the original point.\n        coordSysMgr.create(ecModel, api);\n        scheduler.performDataProcessorTasks(ecModel, payload);\n        // Current stream render is not supported in data process. So we can update\n        // stream modes after data processing, where the filtered data is used to\n        // determine whether to use progressive rendering.\n        updateStreamModes(this, ecModel);\n        // We update stream modes before coordinate system updated, then the modes info\n        // can be fetched when coord sys updating (consider the barGrid extent fix). But\n        // the drawback is the full coord info can not be fetched. Fortunately this full\n        // coord is not required in stream mode updater currently.\n        coordSysMgr.update(ecModel, api);\n        clearColorPalette(ecModel);\n        scheduler.performVisualTasks(ecModel, payload);\n        // Set background and dark mode before rendering, because they affect auto-color-determination\n        // in zrender Text, and consequently affect the bounding rect if stroke is added.\n        var backgroundColor = ecModel.get('backgroundColor') || 'transparent';\n        zr.setBackgroundColor(backgroundColor);\n        // Force set dark mode.\n        var darkMode = ecModel.get('darkMode');\n        if (darkMode != null && darkMode !== 'auto') {\n          zr.setDarkMode(darkMode);\n        }\n        render(this, ecModel, api, payload, updateParams);\n        lifecycle.trigger('afterupdate', ecModel, api);\n      },\n      updateTransform: function (payload) {\n        var _this = this;\n        var ecModel = this._model;\n        var api = this._api;\n        // update before setOption\n        if (!ecModel) {\n          return;\n        }\n        ecModel.setUpdatePayload(payload);\n        // ChartView.markUpdateMethod(payload, 'updateTransform');\n        var componentDirtyList = [];\n        ecModel.eachComponent(function (componentType, componentModel) {\n          if (componentType === 'series') {\n            return;\n          }\n          var componentView = _this.getViewOfComponentModel(componentModel);\n          if (componentView && componentView.__alive) {\n            if (componentView.updateTransform) {\n              var result = componentView.updateTransform(componentModel, ecModel, api, payload);\n              result && result.update && componentDirtyList.push(componentView);\n            } else {\n              componentDirtyList.push(componentView);\n            }\n          }\n        });\n        var seriesDirtyMap = createHashMap();\n        ecModel.eachSeries(function (seriesModel) {\n          var chartView = _this._chartsMap[seriesModel.__viewId];\n          if (chartView.updateTransform) {\n            var result = chartView.updateTransform(seriesModel, ecModel, api, payload);\n            result && result.update && seriesDirtyMap.set(seriesModel.uid, 1);\n          } else {\n            seriesDirtyMap.set(seriesModel.uid, 1);\n          }\n        });\n        clearColorPalette(ecModel);\n        // Keep pipe to the exist pipeline because it depends on the render task of the full pipeline.\n        // this._scheduler.performVisualTasks(ecModel, payload, 'layout', true);\n        this._scheduler.performVisualTasks(ecModel, payload, {\n          setDirty: true,\n          dirtyMap: seriesDirtyMap\n        });\n        // Currently, not call render of components. Geo render cost a lot.\n        // renderComponents(ecIns, ecModel, api, payload, componentDirtyList);\n        renderSeries(this, ecModel, api, payload, {}, seriesDirtyMap);\n        lifecycle.trigger('afterupdate', ecModel, api);\n      },\n      updateView: function (payload) {\n        var ecModel = this._model;\n        // update before setOption\n        if (!ecModel) {\n          return;\n        }\n        ecModel.setUpdatePayload(payload);\n        ChartView.markUpdateMethod(payload, 'updateView');\n        clearColorPalette(ecModel);\n        // Keep pipe to the exist pipeline because it depends on the render task of the full pipeline.\n        this._scheduler.performVisualTasks(ecModel, payload, {\n          setDirty: true\n        });\n        render(this, ecModel, this._api, payload, {});\n        lifecycle.trigger('afterupdate', ecModel, this._api);\n      },\n      updateVisual: function (payload) {\n        // updateMethods.update.call(this, payload);\n        var _this = this;\n        var ecModel = this._model;\n        // update before setOption\n        if (!ecModel) {\n          return;\n        }\n        ecModel.setUpdatePayload(payload);\n        // clear all visual\n        ecModel.eachSeries(function (seriesModel) {\n          seriesModel.getData().clearAllVisual();\n        });\n        // Perform visual\n        ChartView.markUpdateMethod(payload, 'updateVisual');\n        clearColorPalette(ecModel);\n        // Keep pipe to the exist pipeline because it depends on the render task of the full pipeline.\n        this._scheduler.performVisualTasks(ecModel, payload, {\n          visualType: 'visual',\n          setDirty: true\n        });\n        ecModel.eachComponent(function (componentType, componentModel) {\n          if (componentType !== 'series') {\n            var componentView = _this.getViewOfComponentModel(componentModel);\n            componentView && componentView.__alive && componentView.updateVisual(componentModel, ecModel, _this._api, payload);\n          }\n        });\n        ecModel.eachSeries(function (seriesModel) {\n          var chartView = _this._chartsMap[seriesModel.__viewId];\n          chartView.updateVisual(seriesModel, ecModel, _this._api, payload);\n        });\n        lifecycle.trigger('afterupdate', ecModel, this._api);\n      },\n      updateLayout: function (payload) {\n        updateMethods.update.call(this, payload);\n      }\n    };\n    function doConvertPixelImpl(ecIns, methodName, finder, value, opt) {\n      if (ecIns._disposed) {\n        disposedWarning(ecIns.id);\n        return;\n      }\n      var ecModel = ecIns._model;\n      var coordSysList = ecIns._coordSysMgr.getCoordinateSystems();\n      var result;\n      var parsedFinder = modelUtil.parseFinder(ecModel, finder);\n      for (var i = 0; i < coordSysList.length; i++) {\n        var coordSys = coordSysList[i];\n        if (coordSys[methodName] && (result = coordSys[methodName](ecModel, parsedFinder, value, opt)) != null) {\n          return result;\n        }\n      }\n      if (process.env.NODE_ENV !== 'production') {\n        warn('No coordinate system that supports ' + methodName + ' found by the given finder.');\n      }\n    }\n    ;\n    doConvertPixel = doConvertPixelImpl;\n    updateStreamModes = function (ecIns, ecModel) {\n      var chartsMap = ecIns._chartsMap;\n      var scheduler = ecIns._scheduler;\n      ecModel.eachSeries(function (seriesModel) {\n        scheduler.updateStreamModes(seriesModel, chartsMap[seriesModel.__viewId]);\n      });\n    };\n    doDispatchAction = function (payload, silent) {\n      var _this = this;\n      var ecModel = this.getModel();\n      var payloadType = payload.type;\n      var escapeConnect = payload.escapeConnect;\n      var actionInfo = actions[payloadType];\n      var cptTypeTmp = (actionInfo.update || 'update').split(':');\n      var updateMethod = cptTypeTmp.pop();\n      var cptType = cptTypeTmp[0] != null && parseClassType(cptTypeTmp[0]);\n      this[IN_MAIN_PROCESS_KEY] = true;\n      updateMainProcessVersion(this);\n      var payloads = [payload];\n      var batched = false;\n      // Batch action\n      if (payload.batch) {\n        batched = true;\n        payloads = map(payload.batch, function (item) {\n          item = defaults(extend({}, item), payload);\n          item.batch = null;\n          return item;\n        });\n      }\n      var eventObjBatch = [];\n      var eventObj;\n      var actionResultBatch = [];\n      var nonRefinedEventType = actionInfo.nonRefinedEventType;\n      var isSelectChange = isSelectChangePayload(payload);\n      var isHighDown = isHighDownPayload(payload);\n      // Only leave blur once if there are multiple batches.\n      if (isHighDown) {\n        allLeaveBlur(this._api);\n      }\n      each(payloads, function (batchItem) {\n        // Action can specify the event by return it.\n        var actionResult = actionInfo.action(batchItem, ecModel, _this._api);\n        if (actionInfo.refineEvent) {\n          actionResultBatch.push(actionResult);\n        } else {\n          eventObj = actionResult;\n        }\n        eventObj = eventObj || extend({}, batchItem);\n        eventObj.type = nonRefinedEventType;\n        eventObjBatch.push(eventObj);\n        // light update does not perform data process, layout and visual.\n        if (isHighDown) {\n          var _a = modelUtil.preParseFinder(payload),\n            queryOptionMap = _a.queryOptionMap,\n            mainTypeSpecified = _a.mainTypeSpecified;\n          var componentMainType = mainTypeSpecified ? queryOptionMap.keys()[0] : 'series';\n          updateDirectly(_this, updateMethod, batchItem, componentMainType);\n          markStatusToUpdate(_this);\n        } else if (isSelectChange) {\n          // At present `dispatchAction({ type: 'select', ... })` is not supported on components.\n          // geo still use 'geoselect'.\n          updateDirectly(_this, updateMethod, batchItem, 'series');\n          markStatusToUpdate(_this);\n        } else if (cptType) {\n          updateDirectly(_this, updateMethod, batchItem, cptType.main, cptType.sub);\n        }\n      });\n      if (updateMethod !== 'none' && !isHighDown && !isSelectChange && !cptType) {\n        try {\n          // Still dirty\n          if (this[PENDING_UPDATE]) {\n            prepare(this);\n            updateMethods.update.call(this, payload);\n            this[PENDING_UPDATE] = null;\n          } else {\n            updateMethods[updateMethod].call(this, payload);\n          }\n        } catch (e) {\n          this[IN_MAIN_PROCESS_KEY] = false;\n          throw e;\n        }\n      }\n      // Follow the rule of action batch\n      if (batched) {\n        eventObj = {\n          type: nonRefinedEventType,\n          escapeConnect: escapeConnect,\n          batch: eventObjBatch\n        };\n      } else {\n        eventObj = eventObjBatch[0];\n      }\n      this[IN_MAIN_PROCESS_KEY] = false;\n      if (!silent) {\n        var refinedEvent = void 0;\n        if (actionInfo.refineEvent) {\n          var eventContent = actionInfo.refineEvent(actionResultBatch, payload, ecModel, this._api).eventContent;\n          assert(isObject(eventContent));\n          refinedEvent = defaults({\n            type: actionInfo.refinedEventType\n          }, eventContent);\n          refinedEvent.fromAction = payload.type;\n          refinedEvent.fromActionPayload = payload;\n          refinedEvent.escapeConnect = true;\n        }\n        var messageCenter = this._messageCenter;\n        // - If `refineEvent` created a `refinedEvent`, `eventObj` (replicated from the original payload)\n        //  is still needed to be triggered for the feature `connect`. But it will not be triggered to\n        //  users in this case.\n        // - If no `refineEvent` used, `eventObj` will be triggered for both `connect` and users.\n        messageCenter.trigger(eventObj.type, eventObj);\n        if (refinedEvent) {\n          messageCenter.trigger(refinedEvent.type, refinedEvent);\n        }\n      }\n    };\n    flushPendingActions = function (silent) {\n      var pendingActions = this._pendingActions;\n      while (pendingActions.length) {\n        var payload = pendingActions.shift();\n        doDispatchAction.call(this, payload, silent);\n      }\n    };\n    triggerUpdatedEvent = function (silent) {\n      !silent && this.trigger('updated');\n    };\n    /**\n     * Event `rendered` is triggered when zr\n     * rendered. It is useful for realtime\n     * snapshot (reflect animation).\n     *\n     * Event `finished` is triggered when:\n     * (1) zrender rendering finished.\n     * (2) initial animation finished.\n     * (3) progressive rendering finished.\n     * (4) no pending action.\n     * (5) no delayed setOption needs to be processed.\n     */\n    bindRenderedEvent = function (zr, ecIns) {\n      zr.on('rendered', function (params) {\n        ecIns.trigger('rendered', params);\n        // The `finished` event should not be triggered repeatedly,\n        // so it should only be triggered when rendering indeed happens\n        // in zrender. (Consider the case that dipatchAction is keep\n        // triggering when mouse move).\n        if (\n        // Although zr is dirty if initial animation is not finished\n        // and this checking is called on frame, we also check\n        // animation finished for robustness.\n        zr.animation.isFinished() && !ecIns[PENDING_UPDATE] && !ecIns._scheduler.unfinished && !ecIns._pendingActions.length) {\n          ecIns.trigger('finished');\n        }\n      });\n    };\n    bindMouseEvent = function (zr, ecIns) {\n      zr.on('mouseover', function (e) {\n        var el = e.target;\n        var dispatcher = findEventDispatcher(el, isHighDownDispatcher);\n        if (dispatcher) {\n          handleGlobalMouseOverForHighDown(dispatcher, e, ecIns._api);\n          markStatusToUpdate(ecIns);\n        }\n      }).on('mouseout', function (e) {\n        var el = e.target;\n        var dispatcher = findEventDispatcher(el, isHighDownDispatcher);\n        if (dispatcher) {\n          handleGlobalMouseOutForHighDown(dispatcher, e, ecIns._api);\n          markStatusToUpdate(ecIns);\n        }\n      }).on('click', function (e) {\n        var el = e.target;\n        var dispatcher = findEventDispatcher(el, function (target) {\n          return getECData(target).dataIndex != null;\n        }, true);\n        if (dispatcher) {\n          var actionType = dispatcher.selected ? 'unselect' : 'select';\n          var ecData = getECData(dispatcher);\n          ecIns._api.dispatchAction({\n            type: actionType,\n            dataType: ecData.dataType,\n            dataIndexInside: ecData.dataIndex,\n            seriesIndex: ecData.seriesIndex,\n            isFromClick: true\n          });\n        }\n      });\n    };\n    function clearColorPalette(ecModel) {\n      ecModel.clearColorPalette();\n      ecModel.eachSeries(function (seriesModel) {\n        seriesModel.clearColorPalette();\n      });\n    }\n    ;\n    // Allocate zlevels for series and components\n    function allocateZlevels(ecModel) {\n      ;\n      var componentZLevels = [];\n      var seriesZLevels = [];\n      var hasSeparateZLevel = false;\n      ecModel.eachComponent(function (componentType, componentModel) {\n        var zlevel = componentModel.get('zlevel') || 0;\n        var z = componentModel.get('z') || 0;\n        var zlevelKey = componentModel.getZLevelKey();\n        hasSeparateZLevel = hasSeparateZLevel || !!zlevelKey;\n        (componentType === 'series' ? seriesZLevels : componentZLevels).push({\n          zlevel: zlevel,\n          z: z,\n          idx: componentModel.componentIndex,\n          type: componentType,\n          key: zlevelKey\n        });\n      });\n      if (hasSeparateZLevel) {\n        // Series after component\n        var zLevels = componentZLevels.concat(seriesZLevels);\n        var lastSeriesZLevel_1;\n        var lastSeriesKey_1;\n        timsort(zLevels, function (a, b) {\n          if (a.zlevel === b.zlevel) {\n            return a.z - b.z;\n          }\n          return a.zlevel - b.zlevel;\n        });\n        each(zLevels, function (item) {\n          var componentModel = ecModel.getComponent(item.type, item.idx);\n          var zlevel = item.zlevel;\n          var key = item.key;\n          if (lastSeriesZLevel_1 != null) {\n            zlevel = Math.max(lastSeriesZLevel_1, zlevel);\n          }\n          if (key) {\n            if (zlevel === lastSeriesZLevel_1 && key !== lastSeriesKey_1) {\n              zlevel++;\n            }\n            lastSeriesKey_1 = key;\n          } else if (lastSeriesKey_1) {\n            if (zlevel === lastSeriesZLevel_1) {\n              zlevel++;\n            }\n            lastSeriesKey_1 = '';\n          }\n          lastSeriesZLevel_1 = zlevel;\n          componentModel.setZLevel(zlevel);\n        });\n      }\n    }\n    render = function (ecIns, ecModel, api, payload, updateParams) {\n      allocateZlevels(ecModel);\n      renderComponents(ecIns, ecModel, api, payload, updateParams);\n      each(ecIns._chartsViews, function (chart) {\n        chart.__alive = false;\n      });\n      renderSeries(ecIns, ecModel, api, payload, updateParams);\n      // Remove groups of unrendered charts\n      each(ecIns._chartsViews, function (chart) {\n        if (!chart.__alive) {\n          chart.remove(ecModel, api);\n        }\n      });\n    };\n    renderComponents = function (ecIns, ecModel, api, payload, updateParams, dirtyList) {\n      each(dirtyList || ecIns._componentsViews, function (componentView) {\n        var componentModel = componentView.__model;\n        clearStates(componentModel, componentView);\n        componentView.render(componentModel, ecModel, api, payload);\n        updateZ(componentModel, componentView);\n        updateStates(componentModel, componentView);\n      });\n    };\n    /**\n     * Render each chart and component\n     */\n    renderSeries = function (ecIns, ecModel, api, payload, updateParams, dirtyMap) {\n      // Render all charts\n      var scheduler = ecIns._scheduler;\n      updateParams = extend(updateParams || {}, {\n        updatedSeries: ecModel.getSeries()\n      });\n      // TODO progressive?\n      lifecycle.trigger('series:beforeupdate', ecModel, api, updateParams);\n      var unfinished = false;\n      ecModel.eachSeries(function (seriesModel) {\n        var chartView = ecIns._chartsMap[seriesModel.__viewId];\n        chartView.__alive = true;\n        var renderTask = chartView.renderTask;\n        scheduler.updatePayload(renderTask, payload);\n        // TODO states on marker.\n        clearStates(seriesModel, chartView);\n        if (dirtyMap && dirtyMap.get(seriesModel.uid)) {\n          renderTask.dirty();\n        }\n        if (renderTask.perform(scheduler.getPerformArgs(renderTask))) {\n          unfinished = true;\n        }\n        chartView.group.silent = !!seriesModel.get('silent');\n        // Should not call markRedraw on group, because it will disable zrender\n        // incremental render (always render from the __startIndex each frame)\n        // chartView.group.markRedraw();\n        updateBlend(seriesModel, chartView);\n        updateSeriesElementSelection(seriesModel);\n      });\n      scheduler.unfinished = unfinished || scheduler.unfinished;\n      lifecycle.trigger('series:layoutlabels', ecModel, api, updateParams);\n      // transition after label is layouted.\n      lifecycle.trigger('series:transition', ecModel, api, updateParams);\n      ecModel.eachSeries(function (seriesModel) {\n        var chartView = ecIns._chartsMap[seriesModel.__viewId];\n        // Update Z after labels updated. Before applying states.\n        updateZ(seriesModel, chartView);\n        // NOTE: Update states after label is updated.\n        // label should be in normal status when layouting.\n        updateStates(seriesModel, chartView);\n      });\n      // If use hover layer\n      updateHoverLayerStatus(ecIns, ecModel);\n      lifecycle.trigger('series:afterupdate', ecModel, api, updateParams);\n    };\n    markStatusToUpdate = function (ecIns) {\n      ecIns[STATUS_NEEDS_UPDATE_KEY] = true;\n      // Wake up zrender if it's sleep. Let it update states in the next frame.\n      ecIns.getZr().wakeUp();\n    };\n    updateMainProcessVersion = function (ecIns) {\n      ecIns[MAIN_PROCESS_VERSION_KEY] = (ecIns[MAIN_PROCESS_VERSION_KEY] + 1) % 1000;\n    };\n    applyChangedStates = function (ecIns) {\n      if (!ecIns[STATUS_NEEDS_UPDATE_KEY]) {\n        return;\n      }\n      ecIns.getZr().storage.traverse(function (el) {\n        // Not applied on removed elements, it may still in fading.\n        if (graphic.isElementRemoved(el)) {\n          return;\n        }\n        applyElementStates(el);\n      });\n      ecIns[STATUS_NEEDS_UPDATE_KEY] = false;\n    };\n    function applyElementStates(el) {\n      var newStates = [];\n      var oldStates = el.currentStates;\n      // Keep other states.\n      for (var i = 0; i < oldStates.length; i++) {\n        var stateName = oldStates[i];\n        if (!(stateName === 'emphasis' || stateName === 'blur' || stateName === 'select')) {\n          newStates.push(stateName);\n        }\n      }\n      // Only use states when it's exists.\n      if (el.selected && el.states.select) {\n        newStates.push('select');\n      }\n      if (el.hoverState === HOVER_STATE_EMPHASIS && el.states.emphasis) {\n        newStates.push('emphasis');\n      } else if (el.hoverState === HOVER_STATE_BLUR && el.states.blur) {\n        newStates.push('blur');\n      }\n      el.useStates(newStates);\n    }\n    function updateHoverLayerStatus(ecIns, ecModel) {\n      var zr = ecIns._zr;\n      var storage = zr.storage;\n      var elCount = 0;\n      storage.traverse(function (el) {\n        if (!el.isGroup) {\n          elCount++;\n        }\n      });\n      if (elCount > ecModel.get('hoverLayerThreshold') && !env.node && !env.worker) {\n        ecModel.eachSeries(function (seriesModel) {\n          if (seriesModel.preventUsingHoverLayer) {\n            return;\n          }\n          var chartView = ecIns._chartsMap[seriesModel.__viewId];\n          if (chartView.__alive) {\n            chartView.eachRendered(function (el) {\n              if (el.states.emphasis) {\n                el.states.emphasis.hoverLayer = true;\n              }\n            });\n          }\n        });\n      }\n    }\n    ;\n    /**\n     * Update chart and blend.\n     */\n    function updateBlend(seriesModel, chartView) {\n      var blendMode = seriesModel.get('blendMode') || null;\n      chartView.eachRendered(function (el) {\n        // FIXME marker and other components\n        if (!el.isGroup) {\n          // DON'T mark the element dirty. In case element is incremental and don't want to rerender.\n          el.style.blend = blendMode;\n        }\n      });\n    }\n    ;\n    function updateZ(model, view) {\n      if (model.preventAutoZ) {\n        return;\n      }\n      var zInfo = graphic.retrieveZInfo(model);\n      // Set z and zlevel\n      view.eachRendered(function (el) {\n        graphic.traverseUpdateZ(el, zInfo.z, zInfo.zlevel);\n        // Don't traverse the children because it has been traversed in _updateZ.\n        return true;\n      });\n    }\n    ;\n    // Clear states without animation.\n    // TODO States on component.\n    function clearStates(model, view) {\n      view.eachRendered(function (el) {\n        // Not applied on removed elements, it may still in fading.\n        if (graphic.isElementRemoved(el)) {\n          return;\n        }\n        var textContent = el.getTextContent();\n        var textGuide = el.getTextGuideLine();\n        if (el.stateTransition) {\n          el.stateTransition = null;\n        }\n        if (textContent && textContent.stateTransition) {\n          textContent.stateTransition = null;\n        }\n        if (textGuide && textGuide.stateTransition) {\n          textGuide.stateTransition = null;\n        }\n        // TODO If el is incremental.\n        if (el.hasState()) {\n          el.prevStates = el.currentStates;\n          el.clearStates();\n        } else if (el.prevStates) {\n          el.prevStates = null;\n        }\n      });\n    }\n    function updateStates(model, view) {\n      var stateAnimationModel = model.getModel('stateAnimation');\n      var enableAnimation = model.isAnimationEnabled();\n      var duration = stateAnimationModel.get('duration');\n      var stateTransition = duration > 0 ? {\n        duration: duration,\n        delay: stateAnimationModel.get('delay'),\n        easing: stateAnimationModel.get('easing')\n        // additive: stateAnimationModel.get('additive')\n      } : null;\n      view.eachRendered(function (el) {\n        if (el.states && el.states.emphasis) {\n          // Not applied on removed elements, it may still in fading.\n          if (graphic.isElementRemoved(el)) {\n            return;\n          }\n          if (el instanceof graphic.Path) {\n            savePathStates(el);\n          }\n          // Only updated on changed element. In case element is incremental and don't want to rerender.\n          // TODO, a more proper way?\n          if (el.__dirty) {\n            var prevStates = el.prevStates;\n            // Restore states without animation\n            if (prevStates) {\n              el.useStates(prevStates);\n            }\n          }\n          // Update state transition and enable animation again.\n          if (enableAnimation) {\n            el.stateTransition = stateTransition;\n            var textContent = el.getTextContent();\n            var textGuide = el.getTextGuideLine();\n            // TODO Is it necessary to animate label?\n            if (textContent) {\n              textContent.stateTransition = stateTransition;\n            }\n            if (textGuide) {\n              textGuide.stateTransition = stateTransition;\n            }\n          }\n          // Use highlighted and selected flag to toggle states.\n          if (el.__dirty) {\n            applyElementStates(el);\n          }\n        }\n      });\n    }\n    ;\n    createExtensionAPI = function (ecIns) {\n      return new (/** @class */function (_super) {\n        __extends(class_1, _super);\n        function class_1() {\n          return _super !== null && _super.apply(this, arguments) || this;\n        }\n        class_1.prototype.getCoordinateSystems = function () {\n          return ecIns._coordSysMgr.getCoordinateSystems();\n        };\n        class_1.prototype.getComponentByElement = function (el) {\n          while (el) {\n            var modelInfo = el.__ecComponentInfo;\n            if (modelInfo != null) {\n              return ecIns._model.getComponent(modelInfo.mainType, modelInfo.index);\n            }\n            el = el.parent;\n          }\n        };\n        class_1.prototype.enterEmphasis = function (el, highlightDigit) {\n          enterEmphasis(el, highlightDigit);\n          markStatusToUpdate(ecIns);\n        };\n        class_1.prototype.leaveEmphasis = function (el, highlightDigit) {\n          leaveEmphasis(el, highlightDigit);\n          markStatusToUpdate(ecIns);\n        };\n        class_1.prototype.enterBlur = function (el) {\n          enterBlur(el);\n          markStatusToUpdate(ecIns);\n        };\n        class_1.prototype.leaveBlur = function (el) {\n          leaveBlur(el);\n          markStatusToUpdate(ecIns);\n        };\n        class_1.prototype.enterSelect = function (el) {\n          enterSelect(el);\n          markStatusToUpdate(ecIns);\n        };\n        class_1.prototype.leaveSelect = function (el) {\n          leaveSelect(el);\n          markStatusToUpdate(ecIns);\n        };\n        class_1.prototype.getModel = function () {\n          return ecIns.getModel();\n        };\n        class_1.prototype.getViewOfComponentModel = function (componentModel) {\n          return ecIns.getViewOfComponentModel(componentModel);\n        };\n        class_1.prototype.getViewOfSeriesModel = function (seriesModel) {\n          return ecIns.getViewOfSeriesModel(seriesModel);\n        };\n        class_1.prototype.getMainProcessVersion = function () {\n          return ecIns[MAIN_PROCESS_VERSION_KEY];\n        };\n        return class_1;\n      }(ExtensionAPI))(ecIns);\n    };\n    enableConnect = function (chart) {\n      function updateConnectedChartsStatus(charts, status) {\n        for (var i = 0; i < charts.length; i++) {\n          var otherChart = charts[i];\n          otherChart[CONNECT_STATUS_KEY] = status;\n        }\n      }\n      each(connectionEventRevertMap, function (_, eventType) {\n        chart._messageCenter.on(eventType, function (event) {\n          if (connectedGroups[chart.group] && chart[CONNECT_STATUS_KEY] !== CONNECT_STATUS_PENDING) {\n            if (event && event.escapeConnect) {\n              return;\n            }\n            var action_1 = chart.makeActionFromEvent(event);\n            var otherCharts_1 = [];\n            each(instances, function (otherChart) {\n              if (otherChart !== chart && otherChart.group === chart.group) {\n                otherCharts_1.push(otherChart);\n              }\n            });\n            updateConnectedChartsStatus(otherCharts_1, CONNECT_STATUS_PENDING);\n            each(otherCharts_1, function (otherChart) {\n              if (otherChart[CONNECT_STATUS_KEY] !== CONNECT_STATUS_UPDATING) {\n                otherChart.dispatchAction(action_1);\n              }\n            });\n            updateConnectedChartsStatus(otherCharts_1, CONNECT_STATUS_UPDATED);\n          }\n        });\n      });\n    };\n  }();\n  return ECharts;\n}(Eventful);\nvar echartsProto = ECharts.prototype;\nechartsProto.on = createRegisterEventWithLowercaseECharts('on');\nechartsProto.off = createRegisterEventWithLowercaseECharts('off');\n/**\n * @deprecated\n */\n// @ts-ignore\nechartsProto.one = function (eventName, cb, ctx) {\n  var self = this;\n  deprecateLog('ECharts#one is deprecated.');\n  function wrapped() {\n    var args2 = [];\n    for (var _i = 0; _i < arguments.length; _i++) {\n      args2[_i] = arguments[_i];\n    }\n    cb && cb.apply && cb.apply(this, args2);\n    // @ts-ignore\n    self.off(eventName, wrapped);\n  }\n  ;\n  // @ts-ignore\n  this.on.call(this, eventName, wrapped, ctx);\n};\nvar MOUSE_EVENT_NAMES = ['click', 'dblclick', 'mouseover', 'mouseout', 'mousemove', 'mousedown', 'mouseup', 'globalout', 'contextmenu'];\nfunction disposedWarning(id) {\n  if (process.env.NODE_ENV !== 'production') {\n    warn('Instance ' + id + ' has been disposed');\n  }\n}\nvar actions = {};\n/**\n * Map event type to action type for reproducing action from event for `connect`.\n */\nvar connectionEventRevertMap = {};\n/**\n * To remove duplication.\n */\nvar publicEventTypeMap = {};\nvar dataProcessorFuncs = [];\nvar optionPreprocessorFuncs = [];\nvar visualFuncs = [];\nvar themeStorage = {};\nvar loadingEffects = {};\nvar instances = {};\nvar connectedGroups = {};\nvar idBase = +new Date() - 0;\nvar groupIdBase = +new Date() - 0;\nvar DOM_ATTRIBUTE_KEY = '_echarts_instance_';\n/**\n * @param opts.devicePixelRatio Use window.devicePixelRatio by default\n * @param opts.renderer Can choose 'canvas' or 'svg' to render the chart.\n * @param opts.width Use clientWidth of the input `dom` by default.\n *        Can be 'auto' (the same as null/undefined)\n * @param opts.height Use clientHeight of the input `dom` by default.\n *        Can be 'auto' (the same as null/undefined)\n * @param opts.locale Specify the locale.\n * @param opts.useDirtyRect Enable dirty rectangle rendering or not.\n */\nexport function init(dom, theme, opts) {\n  var isClient = !(opts && opts.ssr);\n  if (isClient) {\n    if (process.env.NODE_ENV !== 'production') {\n      if (!dom) {\n        throw new Error('Initialize failed: invalid dom.');\n      }\n    }\n    var existInstance = getInstanceByDom(dom);\n    if (existInstance) {\n      if (process.env.NODE_ENV !== 'production') {\n        warn('There is a chart instance already initialized on the dom.');\n      }\n      return existInstance;\n    }\n    if (process.env.NODE_ENV !== 'production') {\n      if (isDom(dom) && dom.nodeName.toUpperCase() !== 'CANVAS' && (!dom.clientWidth && (!opts || opts.width == null) || !dom.clientHeight && (!opts || opts.height == null))) {\n        warn('Can\\'t get DOM width or height. Please check ' + 'dom.clientWidth and dom.clientHeight. They should not be 0.' + 'For example, you may need to call this in the callback ' + 'of window.onload.');\n      }\n    }\n  }\n  var chart = new ECharts(dom, theme, opts);\n  chart.id = 'ec_' + idBase++;\n  instances[chart.id] = chart;\n  isClient && modelUtil.setAttribute(dom, DOM_ATTRIBUTE_KEY, chart.id);\n  enableConnect(chart);\n  lifecycle.trigger('afterinit', chart);\n  return chart;\n}\n/**\n * @usage\n * (A)\n * ```js\n * let chart1 = echarts.init(dom1);\n * let chart2 = echarts.init(dom2);\n * chart1.group = 'xxx';\n * chart2.group = 'xxx';\n * echarts.connect('xxx');\n * ```\n * (B)\n * ```js\n * let chart1 = echarts.init(dom1);\n * let chart2 = echarts.init(dom2);\n * echarts.connect('xxx', [chart1, chart2]);\n * ```\n */\nexport function connect(groupId) {\n  // Is array of charts\n  if (isArray(groupId)) {\n    var charts = groupId;\n    groupId = null;\n    // If any chart has group\n    each(charts, function (chart) {\n      if (chart.group != null) {\n        groupId = chart.group;\n      }\n    });\n    groupId = groupId || 'g_' + groupIdBase++;\n    each(charts, function (chart) {\n      chart.group = groupId;\n    });\n  }\n  connectedGroups[groupId] = true;\n  return groupId;\n}\nexport function disconnect(groupId) {\n  connectedGroups[groupId] = false;\n}\n/**\n * Alias and backward compatibility\n * @deprecated\n */\nexport var disConnect = disconnect;\n/**\n * Dispose a chart instance\n */\nexport function dispose(chart) {\n  if (isString(chart)) {\n    chart = instances[chart];\n  } else if (!(chart instanceof ECharts)) {\n    // Try to treat as dom\n    chart = getInstanceByDom(chart);\n  }\n  if (chart instanceof ECharts && !chart.isDisposed()) {\n    chart.dispose();\n  }\n}\nexport function getInstanceByDom(dom) {\n  return instances[modelUtil.getAttribute(dom, DOM_ATTRIBUTE_KEY)];\n}\nexport function getInstanceById(key) {\n  return instances[key];\n}\n/**\n * Register theme\n */\nexport function registerTheme(name, theme) {\n  themeStorage[name] = theme;\n}\n/**\n * Register option preprocessor\n */\nexport function registerPreprocessor(preprocessorFunc) {\n  if (indexOf(optionPreprocessorFuncs, preprocessorFunc) < 0) {\n    optionPreprocessorFuncs.push(preprocessorFunc);\n  }\n}\nexport function registerProcessor(priority, processor) {\n  normalizeRegister(dataProcessorFuncs, priority, processor, PRIORITY_PROCESSOR_DEFAULT);\n}\n/**\n * Register postIniter\n * @param {Function} postInitFunc\n */\nexport function registerPostInit(postInitFunc) {\n  registerUpdateLifecycle('afterinit', postInitFunc);\n}\n/**\n * Register postUpdater\n * @param {Function} postUpdateFunc\n */\nexport function registerPostUpdate(postUpdateFunc) {\n  registerUpdateLifecycle('afterupdate', postUpdateFunc);\n}\nexport function registerUpdateLifecycle(name, cb) {\n  lifecycle.on(name, cb);\n}\nexport function registerAction(arg0, arg1, action) {\n  var actionType;\n  var publicEventType;\n  var refineEvent;\n  var update;\n  var publishNonRefinedEvent;\n  if (isFunction(arg1)) {\n    action = arg1;\n    arg1 = '';\n  }\n  if (isObject(arg0)) {\n    actionType = arg0.type;\n    publicEventType = arg0.event;\n    update = arg0.update;\n    publishNonRefinedEvent = arg0.publishNonRefinedEvent;\n    if (!action) {\n      action = arg0.action;\n    }\n    refineEvent = arg0.refineEvent;\n  } else {\n    actionType = arg0;\n    publicEventType = arg1;\n  }\n  function createEventType(actionOrEventType) {\n    // Event type should be all lowercase\n    return actionOrEventType.toLowerCase();\n  }\n  publicEventType = createEventType(publicEventType || actionType);\n  // See comments on {ActionInfo} for the reason.\n  var nonRefinedEventType = refineEvent ? createEventType(actionType) : publicEventType;\n  // Support calling `registerAction` multiple times with the same action\n  // type; subsequent calls have no effect.\n  if (actions[actionType]) {\n    return;\n  }\n  // Validate action type and event name.\n  assert(ACTION_REG.test(actionType) && ACTION_REG.test(publicEventType));\n  if (refineEvent) {\n    // An event replicated from the action will be triggered internally for `connect` in this case.\n    assert(publicEventType !== actionType);\n  }\n  actions[actionType] = {\n    actionType: actionType,\n    refinedEventType: publicEventType,\n    nonRefinedEventType: nonRefinedEventType,\n    update: update,\n    action: action,\n    refineEvent: refineEvent\n  };\n  publicEventTypeMap[publicEventType] = 1;\n  if (refineEvent && publishNonRefinedEvent) {\n    publicEventTypeMap[nonRefinedEventType] = 1;\n  }\n  if (process.env.NODE_ENV !== 'production' && connectionEventRevertMap[nonRefinedEventType]) {\n    error(nonRefinedEventType + \" must not be shared; use \\\"refineEvent\\\" if you intend to share an event name.\");\n  }\n  connectionEventRevertMap[nonRefinedEventType] = actionType;\n}\nexport function registerCoordinateSystem(type, coordSysCreator) {\n  CoordinateSystemManager.register(type, coordSysCreator);\n}\n/**\n * Get dimensions of specified coordinate system.\n * @param {string} type\n * @return {Array.<string|Object>}\n */\nexport function getCoordinateSystemDimensions(type) {\n  var coordSysCreator = CoordinateSystemManager.get(type);\n  if (coordSysCreator) {\n    return coordSysCreator.getDimensionsInfo ? coordSysCreator.getDimensionsInfo() : coordSysCreator.dimensions.slice();\n  }\n}\nexport function registerCustomSeries(seriesType, renderItem) {\n  registerCustom(seriesType, renderItem);\n}\nexport { registerLocale } from './locale.js';\nfunction registerLayout(priority, layoutTask) {\n  normalizeRegister(visualFuncs, priority, layoutTask, PRIORITY_VISUAL_LAYOUT, 'layout');\n}\nfunction registerVisual(priority, visualTask) {\n  normalizeRegister(visualFuncs, priority, visualTask, PRIORITY_VISUAL_CHART, 'visual');\n}\nexport { registerLayout, registerVisual };\nvar registeredTasks = [];\nfunction normalizeRegister(targetList, priority, fn, defaultPriority, visualType) {\n  if (isFunction(priority) || isObject(priority)) {\n    fn = priority;\n    priority = defaultPriority;\n  }\n  if (process.env.NODE_ENV !== 'production') {\n    if (isNaN(priority) || priority == null) {\n      throw new Error('Illegal priority');\n    }\n    // Check duplicate\n    each(targetList, function (wrap) {\n      assert(wrap.__raw !== fn);\n    });\n  }\n  // Already registered\n  if (indexOf(registeredTasks, fn) >= 0) {\n    return;\n  }\n  registeredTasks.push(fn);\n  var stageHandler = Scheduler.wrapStageHandler(fn, visualType);\n  stageHandler.__prio = priority;\n  stageHandler.__raw = fn;\n  targetList.push(stageHandler);\n}\nexport function registerLoading(name, loadingFx) {\n  loadingEffects[name] = loadingFx;\n}\n/**\n * ZRender need a canvas context to do measureText.\n * But in node environment canvas may be created by node-canvas.\n * So we need to specify how to create a canvas instead of using document.createElement('canvas')\n *\n *\n * @deprecated use setPlatformAPI({ createCanvas }) instead.\n *\n * @example\n *     let Canvas = require('canvas');\n *     let echarts = require('echarts');\n *     echarts.setCanvasCreator(function () {\n *         // Small size is enough.\n *         return new Canvas(32, 32);\n *     });\n */\nexport function setCanvasCreator(creator) {\n  if (process.env.NODE_ENV !== 'production') {\n    deprecateLog('setCanvasCreator is deprecated. Use setPlatformAPI({ createCanvas }) instead.');\n  }\n  setPlatformAPI({\n    createCanvas: creator\n  });\n}\n/**\n * The parameters and usage: see `geoSourceManager.registerMap`.\n * Compatible with previous `echarts.registerMap`.\n */\nexport function registerMap(mapName, geoJson, specialAreas) {\n  var registerMap = getImpl('registerMap');\n  registerMap && registerMap(mapName, geoJson, specialAreas);\n}\nexport function getMap(mapName) {\n  var getMap = getImpl('getMap');\n  return getMap && getMap(mapName);\n}\nexport var registerTransform = registerExternalTransform;\n/**\n * Globa dispatchAction to a specified chart instance.\n */\n// export function dispatchAction(payload: { chartId: string } & Payload, opt?: Parameters<ECharts['dispatchAction']>[1]) {\n//     if (!payload || !payload.chartId) {\n//         // Must have chartId to find chart\n//         return;\n//     }\n//     const chart = instances[payload.chartId];\n//     if (chart) {\n//         chart.dispatchAction(payload, opt);\n//     }\n// }\n// Builtin global visual\nregisterVisual(PRIORITY_VISUAL_GLOBAL, seriesStyleTask);\nregisterVisual(PRIORITY_VISUAL_CHART_DATA_CUSTOM, dataStyleTask);\nregisterVisual(PRIORITY_VISUAL_CHART_DATA_CUSTOM, dataColorPaletteTask);\nregisterVisual(PRIORITY_VISUAL_GLOBAL, seriesSymbolTask);\nregisterVisual(PRIORITY_VISUAL_CHART_DATA_CUSTOM, dataSymbolTask);\nregisterVisual(PRIORITY_VISUAL_DECAL, decal);\nregisterPreprocessor(backwardCompat);\nregisterProcessor(PRIORITY_PROCESSOR_DATASTACK, dataStack);\nregisterLoading('default', loadingDefault);\n// Default actions\nregisterAction({\n  type: HIGHLIGHT_ACTION_TYPE,\n  event: HIGHLIGHT_ACTION_TYPE,\n  update: HIGHLIGHT_ACTION_TYPE\n}, noop);\nregisterAction({\n  type: DOWNPLAY_ACTION_TYPE,\n  event: DOWNPLAY_ACTION_TYPE,\n  update: DOWNPLAY_ACTION_TYPE\n}, noop);\nregisterAction({\n  type: SELECT_ACTION_TYPE,\n  event: SELECT_CHANGED_EVENT_TYPE,\n  update: SELECT_ACTION_TYPE,\n  action: noop,\n  refineEvent: makeSelectChangedEvent,\n  publishNonRefinedEvent: true\n});\nregisterAction({\n  type: UNSELECT_ACTION_TYPE,\n  event: SELECT_CHANGED_EVENT_TYPE,\n  update: UNSELECT_ACTION_TYPE,\n  action: noop,\n  refineEvent: makeSelectChangedEvent,\n  publishNonRefinedEvent: true\n});\nregisterAction({\n  type: TOGGLE_SELECT_ACTION_TYPE,\n  event: SELECT_CHANGED_EVENT_TYPE,\n  update: TOGGLE_SELECT_ACTION_TYPE,\n  action: noop,\n  refineEvent: makeSelectChangedEvent,\n  publishNonRefinedEvent: true\n});\nfunction makeSelectChangedEvent(actionResultBatch, payload, ecModel, api) {\n  return {\n    eventContent: {\n      selected: getAllSelectedIndices(ecModel),\n      isFromClick: payload.isFromClick || false\n    }\n  };\n}\n// Default theme, so that we can use `chart.setTheme('default')` to revert to\n// the default theme after changing to other themes.\nregisterTheme('default', {});\nregisterTheme('dark', darkTheme);\n// For backward compatibility, where the namespace `dataTool` will\n// be mounted on `echarts` is the extension `dataTool` is imported.\nexport var dataTool = {};", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nfunction dataIndexMapValueLength(valNumOrArrLengthMoreThan2) {\n  return valNumOrArrLengthMoreThan2 == null ? 0 : valNumOrArrLengthMoreThan2.length || 1;\n}\nfunction defaultKeyGetter(item) {\n  return item;\n}\nvar DataDiffer = /** @class */function () {\n  /**\n   * @param context Can be visited by this.context in callback.\n   */\n  function DataDiffer(oldArr, newArr, oldKeyGetter, newKeyGetter, context,\n  // By default: 'oneToOne'.\n  diffMode) {\n    this._old = oldArr;\n    this._new = newArr;\n    this._oldKeyGetter = oldKeyGetter || defaultKeyGetter;\n    this._newKeyGetter = newKeyGetter || defaultKeyGetter;\n    // Visible in callback via `this.context`;\n    this.context = context;\n    this._diffModeMultiple = diffMode === 'multiple';\n  }\n  /**\n   * Callback function when add a data\n   */\n  DataDiffer.prototype.add = function (func) {\n    this._add = func;\n    return this;\n  };\n  /**\n   * Callback function when update a data\n   */\n  DataDiffer.prototype.update = function (func) {\n    this._update = func;\n    return this;\n  };\n  /**\n   * Callback function when update a data and only work in `cbMode: 'byKey'`.\n   */\n  DataDiffer.prototype.updateManyToOne = function (func) {\n    this._updateManyToOne = func;\n    return this;\n  };\n  /**\n   * Callback function when update a data and only work in `cbMode: 'byKey'`.\n   */\n  DataDiffer.prototype.updateOneToMany = function (func) {\n    this._updateOneToMany = func;\n    return this;\n  };\n  /**\n   * Callback function when update a data and only work in `cbMode: 'byKey'`.\n   */\n  DataDiffer.prototype.updateManyToMany = function (func) {\n    this._updateManyToMany = func;\n    return this;\n  };\n  /**\n   * Callback function when remove a data\n   */\n  DataDiffer.prototype.remove = function (func) {\n    this._remove = func;\n    return this;\n  };\n  DataDiffer.prototype.execute = function () {\n    this[this._diffModeMultiple ? '_executeMultiple' : '_executeOneToOne']();\n  };\n  DataDiffer.prototype._executeOneToOne = function () {\n    var oldArr = this._old;\n    var newArr = this._new;\n    var newDataIndexMap = {};\n    var oldDataKeyArr = new Array(oldArr.length);\n    var newDataKeyArr = new Array(newArr.length);\n    this._initIndexMap(oldArr, null, oldDataKeyArr, '_oldKeyGetter');\n    this._initIndexMap(newArr, newDataIndexMap, newDataKeyArr, '_newKeyGetter');\n    for (var i = 0; i < oldArr.length; i++) {\n      var oldKey = oldDataKeyArr[i];\n      var newIdxMapVal = newDataIndexMap[oldKey];\n      var newIdxMapValLen = dataIndexMapValueLength(newIdxMapVal);\n      // idx can never be empty array here. see 'set null' logic below.\n      if (newIdxMapValLen > 1) {\n        // Consider there is duplicate key (for example, use dataItem.name as key).\n        // We should make sure every item in newArr and oldArr can be visited.\n        var newIdx = newIdxMapVal.shift();\n        if (newIdxMapVal.length === 1) {\n          newDataIndexMap[oldKey] = newIdxMapVal[0];\n        }\n        this._update && this._update(newIdx, i);\n      } else if (newIdxMapValLen === 1) {\n        newDataIndexMap[oldKey] = null;\n        this._update && this._update(newIdxMapVal, i);\n      } else {\n        this._remove && this._remove(i);\n      }\n    }\n    this._performRestAdd(newDataKeyArr, newDataIndexMap);\n  };\n  /**\n   * For example, consider the case:\n   * oldData: [o0, o1, o2, o3, o4, o5, o6, o7],\n   * newData: [n0, n1, n2, n3, n4, n5, n6, n7, n8],\n   * Where:\n   *     o0, o1, n0 has key 'a' (many to one)\n   *     o5, n4, n5, n6 has key 'b' (one to many)\n   *     o2, n1 has key 'c' (one to one)\n   *     n2, n3 has key 'd' (add)\n   *     o3, o4 has key 'e' (remove)\n   *     o6, o7, n7, n8 has key 'f' (many to many, treated as add and remove)\n   * Then:\n   *     (The order of the following directives are not ensured.)\n   *     this._updateManyToOne(n0, [o0, o1]);\n   *     this._updateOneToMany([n4, n5, n6], o5);\n   *     this._update(n1, o2);\n   *     this._remove(o3);\n   *     this._remove(o4);\n   *     this._remove(o6);\n   *     this._remove(o7);\n   *     this._add(n2);\n   *     this._add(n3);\n   *     this._add(n7);\n   *     this._add(n8);\n   */\n  DataDiffer.prototype._executeMultiple = function () {\n    var oldArr = this._old;\n    var newArr = this._new;\n    var oldDataIndexMap = {};\n    var newDataIndexMap = {};\n    var oldDataKeyArr = [];\n    var newDataKeyArr = [];\n    this._initIndexMap(oldArr, oldDataIndexMap, oldDataKeyArr, '_oldKeyGetter');\n    this._initIndexMap(newArr, newDataIndexMap, newDataKeyArr, '_newKeyGetter');\n    for (var i = 0; i < oldDataKeyArr.length; i++) {\n      var oldKey = oldDataKeyArr[i];\n      var oldIdxMapVal = oldDataIndexMap[oldKey];\n      var newIdxMapVal = newDataIndexMap[oldKey];\n      var oldIdxMapValLen = dataIndexMapValueLength(oldIdxMapVal);\n      var newIdxMapValLen = dataIndexMapValueLength(newIdxMapVal);\n      if (oldIdxMapValLen > 1 && newIdxMapValLen === 1) {\n        this._updateManyToOne && this._updateManyToOne(newIdxMapVal, oldIdxMapVal);\n        newDataIndexMap[oldKey] = null;\n      } else if (oldIdxMapValLen === 1 && newIdxMapValLen > 1) {\n        this._updateOneToMany && this._updateOneToMany(newIdxMapVal, oldIdxMapVal);\n        newDataIndexMap[oldKey] = null;\n      } else if (oldIdxMapValLen === 1 && newIdxMapValLen === 1) {\n        this._update && this._update(newIdxMapVal, oldIdxMapVal);\n        newDataIndexMap[oldKey] = null;\n      } else if (oldIdxMapValLen > 1 && newIdxMapValLen > 1) {\n        this._updateManyToMany && this._updateManyToMany(newIdxMapVal, oldIdxMapVal);\n        newDataIndexMap[oldKey] = null;\n      } else if (oldIdxMapValLen > 1) {\n        for (var i_1 = 0; i_1 < oldIdxMapValLen; i_1++) {\n          this._remove && this._remove(oldIdxMapVal[i_1]);\n        }\n      } else {\n        this._remove && this._remove(oldIdxMapVal);\n      }\n    }\n    this._performRestAdd(newDataKeyArr, newDataIndexMap);\n  };\n  DataDiffer.prototype._performRestAdd = function (newDataKeyArr, newDataIndexMap) {\n    for (var i = 0; i < newDataKeyArr.length; i++) {\n      var newKey = newDataKeyArr[i];\n      var newIdxMapVal = newDataIndexMap[newKey];\n      var idxMapValLen = dataIndexMapValueLength(newIdxMapVal);\n      if (idxMapValLen > 1) {\n        for (var j = 0; j < idxMapValLen; j++) {\n          this._add && this._add(newIdxMapVal[j]);\n        }\n      } else if (idxMapValLen === 1) {\n        this._add && this._add(newIdxMapVal);\n      }\n      // Support both `newDataKeyArr` are duplication removed or not removed.\n      newDataIndexMap[newKey] = null;\n    }\n  };\n  DataDiffer.prototype._initIndexMap = function (arr,\n  // Can be null.\n  map,\n  // In 'byKey', the output `keyArr` is duplication removed.\n  // In 'byIndex', the output `keyArr` is not duplication removed and\n  //     its indices are accurately corresponding to `arr`.\n  keyArr, keyGetterName) {\n    var cbModeMultiple = this._diffModeMultiple;\n    for (var i = 0; i < arr.length; i++) {\n      // Add prefix to avoid conflict with Object.prototype.\n      var key = '_ec_' + this[keyGetterName](arr[i], i);\n      if (!cbModeMultiple) {\n        keyArr[i] = key;\n      }\n      if (!map) {\n        continue;\n      }\n      var idxMapVal = map[key];\n      var idxMapValLen = dataIndexMapValueLength(idxMapVal);\n      if (idxMapValLen === 0) {\n        // Simple optimize: in most cases, one index has one key,\n        // do not need array.\n        map[key] = i;\n        if (cbModeMultiple) {\n          keyArr.push(key);\n        }\n      } else if (idxMapValLen === 1) {\n        map[key] = [idxMapVal, i];\n      } else {\n        idxMapVal.push(i);\n      }\n    }\n  };\n  return DataDiffer;\n}();\nexport default DataDiffer;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { each, createHashMap, assert, map } from 'zrender/lib/core/util.js';\nimport { VISUAL_DIMENSIONS } from '../../util/types.js';\nvar DimensionUserOuput = /** @class */function () {\n  function DimensionUserOuput(encode, dimRequest) {\n    this._encode = encode;\n    this._schema = dimRequest;\n  }\n  DimensionUserOuput.prototype.get = function () {\n    return {\n      // Do not generate full dimension name until fist used.\n      fullDimensions: this._getFullDimensionNames(),\n      encode: this._encode\n    };\n  };\n  /**\n   * Get all data store dimension names.\n   * Theoretically a series data store is defined both by series and used dataset (if any).\n   * If some dimensions are omitted for performance reason in `this.dimensions`,\n   * the dimension name may not be auto-generated if user does not specify a dimension name.\n   * In this case, the dimension name is `null`/`undefined`.\n   */\n  DimensionUserOuput.prototype._getFullDimensionNames = function () {\n    if (!this._cachedDimNames) {\n      this._cachedDimNames = this._schema ? this._schema.makeOutputDimensionNames() : [];\n    }\n    return this._cachedDimNames;\n  };\n  return DimensionUserOuput;\n}();\n;\nexport function summarizeDimensions(data, schema) {\n  var summary = {};\n  var encode = summary.encode = {};\n  var notExtraCoordDimMap = createHashMap();\n  var defaultedLabel = [];\n  var defaultedTooltip = [];\n  var userOutputEncode = {};\n  each(data.dimensions, function (dimName) {\n    var dimItem = data.getDimensionInfo(dimName);\n    var coordDim = dimItem.coordDim;\n    if (coordDim) {\n      if (process.env.NODE_ENV !== 'production') {\n        assert(VISUAL_DIMENSIONS.get(coordDim) == null);\n      }\n      var coordDimIndex = dimItem.coordDimIndex;\n      getOrCreateEncodeArr(encode, coordDim)[coordDimIndex] = dimName;\n      if (!dimItem.isExtraCoord) {\n        notExtraCoordDimMap.set(coordDim, 1);\n        // Use the last coord dim (and label friendly) as default label,\n        // because when dataset is used, it is hard to guess which dimension\n        // can be value dimension. If both show x, y on label is not look good,\n        // and conventionally y axis is focused more.\n        if (mayLabelDimType(dimItem.type)) {\n          defaultedLabel[0] = dimName;\n        }\n        // User output encode do not contain generated coords.\n        // And it only has index. User can use index to retrieve value from the raw item array.\n        getOrCreateEncodeArr(userOutputEncode, coordDim)[coordDimIndex] = data.getDimensionIndex(dimItem.name);\n      }\n      if (dimItem.defaultTooltip) {\n        defaultedTooltip.push(dimName);\n      }\n    }\n    VISUAL_DIMENSIONS.each(function (v, otherDim) {\n      var encodeArr = getOrCreateEncodeArr(encode, otherDim);\n      var dimIndex = dimItem.otherDims[otherDim];\n      if (dimIndex != null && dimIndex !== false) {\n        encodeArr[dimIndex] = dimItem.name;\n      }\n    });\n  });\n  var dataDimsOnCoord = [];\n  var encodeFirstDimNotExtra = {};\n  notExtraCoordDimMap.each(function (v, coordDim) {\n    var dimArr = encode[coordDim];\n    encodeFirstDimNotExtra[coordDim] = dimArr[0];\n    // Not necessary to remove duplicate, because a data\n    // dim canot on more than one coordDim.\n    dataDimsOnCoord = dataDimsOnCoord.concat(dimArr);\n  });\n  summary.dataDimsOnCoord = dataDimsOnCoord;\n  summary.dataDimIndicesOnCoord = map(dataDimsOnCoord, function (dimName) {\n    return data.getDimensionInfo(dimName).storeDimIndex;\n  });\n  summary.encodeFirstDimNotExtra = encodeFirstDimNotExtra;\n  var encodeLabel = encode.label;\n  // FIXME `encode.label` is not recommended, because formatter cannot be set\n  // in this way. Use label.formatter instead. Maybe remove this approach someday.\n  if (encodeLabel && encodeLabel.length) {\n    defaultedLabel = encodeLabel.slice();\n  }\n  var encodeTooltip = encode.tooltip;\n  if (encodeTooltip && encodeTooltip.length) {\n    defaultedTooltip = encodeTooltip.slice();\n  } else if (!defaultedTooltip.length) {\n    defaultedTooltip = defaultedLabel.slice();\n  }\n  encode.defaultedLabel = defaultedLabel;\n  encode.defaultedTooltip = defaultedTooltip;\n  summary.userOutput = new DimensionUserOuput(userOutputEncode, schema);\n  return summary;\n}\nfunction getOrCreateEncodeArr(encode, dim) {\n  if (!encode.hasOwnProperty(dim)) {\n    encode[dim] = [];\n  }\n  return encode[dim];\n}\n// FIXME:TS should be type `AxisType`\nexport function getDimensionTypeByAxis(axisType) {\n  return axisType === 'category' ? 'ordinal' : axisType === 'time' ? 'time' : 'float';\n}\nfunction mayLabelDimType(dimType) {\n  // In most cases, ordinal and time do not suitable for label.\n  // Ordinal info can be displayed on axis. Time is too long.\n  return !(dimType === 'ordinal' || dimType === 'time');\n}\n// function findTheLastDimMayLabel(data) {\n//     // Get last value dim\n//     let dimensions = data.dimensions.slice();\n//     let valueType;\n//     let valueDim;\n//     while (dimensions.length && (\n//         valueDim = dimensions.pop(),\n//         valueType = data.getDimensionInfo(valueDim).type,\n//         valueType === 'ordinal' || valueType === 'time'\n//     )) {} // jshint ignore:line\n//     return valueDim;\n// }", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nvar SeriesDimensionDefine = /** @class */function () {\n  /**\n   * @param opt All of the fields will be shallow copied.\n   */\n  function SeriesDimensionDefine(opt) {\n    /**\n     * The format of `otherDims` is:\n     * ```js\n     * {\n     *     tooltip?: number\n     *     label?: number\n     *     itemName?: number\n     *     seriesName?: number\n     * }\n     * ```\n     *\n     * A `series.encode` can specified these fields:\n     * ```js\n     * encode: {\n     *     // \"3, 1, 5\" is the index of data dimension.\n     *     tooltip: [3, 1, 5],\n     *     label: [0, 3],\n     *     ...\n     * }\n     * ```\n     * `otherDims` is the parse result of the `series.encode` above, like:\n     * ```js\n     * // Suppose the index of this data dimension is `3`.\n     * this.otherDims = {\n     *     // `3` is at the index `0` of the `encode.tooltip`\n     *     tooltip: 0,\n     *     // `3` is at the index `1` of the `encode.label`\n     *     label: 1\n     * };\n     * ```\n     *\n     * This prop should never be `null`/`undefined` after initialized.\n     */\n    this.otherDims = {};\n    if (opt != null) {\n      zrUtil.extend(this, opt);\n    }\n  }\n  return SeriesDimensionDefine;\n}();\n;\nexport default SeriesDimensionDefine;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { createHashMap, isObject, retrieve2 } from 'zrender/lib/core/util.js';\nimport { makeInner } from '../../util/model.js';\nimport { shouldRetrieveDataByName } from '../Source.js';\nvar inner = makeInner();\nvar dimTypeShort = {\n  float: 'f',\n  int: 'i',\n  ordinal: 'o',\n  number: 'n',\n  time: 't'\n};\n/**\n * Represents the dimension requirement of a series.\n *\n * NOTICE:\n * When there are too many dimensions in dataset and many series, only the used dimensions\n * (i.e., used by coord sys and declared in `series.encode`) are add to `dimensionDefineList`.\n * But users may query data by other unused dimension names.\n * In this case, users can only query data if and only if they have defined dimension names\n * via ec option, so we provide `getDimensionIndexFromSource`, which only query them from\n * `source` dimensions.\n */\nvar SeriesDataSchema = /** @class */function () {\n  function SeriesDataSchema(opt) {\n    this.dimensions = opt.dimensions;\n    this._dimOmitted = opt.dimensionOmitted;\n    this.source = opt.source;\n    this._fullDimCount = opt.fullDimensionCount;\n    this._updateDimOmitted(opt.dimensionOmitted);\n  }\n  SeriesDataSchema.prototype.isDimensionOmitted = function () {\n    return this._dimOmitted;\n  };\n  SeriesDataSchema.prototype._updateDimOmitted = function (dimensionOmitted) {\n    this._dimOmitted = dimensionOmitted;\n    if (!dimensionOmitted) {\n      return;\n    }\n    if (!this._dimNameMap) {\n      this._dimNameMap = ensureSourceDimNameMap(this.source);\n    }\n  };\n  /**\n   * @caution Can only be used when `dimensionOmitted: true`.\n   *\n   * Get index by user defined dimension name (i.e., not internal generate name).\n   * That is, get index from `dimensionsDefine`.\n   * If no `dimensionsDefine`, or no name get, return -1.\n   */\n  SeriesDataSchema.prototype.getSourceDimensionIndex = function (dimName) {\n    return retrieve2(this._dimNameMap.get(dimName), -1);\n  };\n  /**\n   * @caution Can only be used when `dimensionOmitted: true`.\n   *\n   * Notice: may return `null`/`undefined` if user not specify dimension names.\n   */\n  SeriesDataSchema.prototype.getSourceDimension = function (dimIndex) {\n    var dimensionsDefine = this.source.dimensionsDefine;\n    if (dimensionsDefine) {\n      return dimensionsDefine[dimIndex];\n    }\n  };\n  SeriesDataSchema.prototype.makeStoreSchema = function () {\n    var dimCount = this._fullDimCount;\n    var willRetrieveDataByName = shouldRetrieveDataByName(this.source);\n    var makeHashStrict = !shouldOmitUnusedDimensions(dimCount);\n    // If source don't have dimensions or series don't omit unsed dimensions.\n    // Generate from seriesDimList directly\n    var dimHash = '';\n    var dims = [];\n    for (var fullDimIdx = 0, seriesDimIdx = 0; fullDimIdx < dimCount; fullDimIdx++) {\n      var property = void 0;\n      var type = void 0;\n      var ordinalMeta = void 0;\n      var seriesDimDef = this.dimensions[seriesDimIdx];\n      // The list has been sorted by `storeDimIndex` asc.\n      if (seriesDimDef && seriesDimDef.storeDimIndex === fullDimIdx) {\n        property = willRetrieveDataByName ? seriesDimDef.name : null;\n        type = seriesDimDef.type;\n        ordinalMeta = seriesDimDef.ordinalMeta;\n        seriesDimIdx++;\n      } else {\n        var sourceDimDef = this.getSourceDimension(fullDimIdx);\n        if (sourceDimDef) {\n          property = willRetrieveDataByName ? sourceDimDef.name : null;\n          type = sourceDimDef.type;\n        }\n      }\n      dims.push({\n        property: property,\n        type: type,\n        ordinalMeta: ordinalMeta\n      });\n      // If retrieving data by index,\n      //   use <index, type, ordinalMeta> to determine whether data can be shared.\n      //   (Because in this case there might be no dimension name defined in dataset, but indices always exists).\n      //   (Indices are always 0, 1, 2, ..., so we can ignore them to shorten the hash).\n      // Otherwise if retrieving data by property name (like `data: [{aa: 123, bb: 765}, ...]`),\n      //   use <property, type, ordinalMeta> in hash.\n      if (willRetrieveDataByName && property != null\n      // For data stack, we have make sure each series has its own dim on this store.\n      // So we do not add property to hash to make sure they can share this store.\n      && (!seriesDimDef || !seriesDimDef.isCalculationCoord)) {\n        dimHash += makeHashStrict\n        // Use escape character '`' in case that property name contains '$'.\n        ? property.replace(/\\`/g, '`1').replace(/\\$/g, '`2')\n        // For better performance, when there are large dimensions, tolerant this defects that hardly meet.\n        : property;\n      }\n      dimHash += '$';\n      dimHash += dimTypeShort[type] || 'f';\n      if (ordinalMeta) {\n        dimHash += ordinalMeta.uid;\n      }\n      dimHash += '$';\n    }\n    // Source from endpoint(usually series) will be read differently\n    // when seriesLayoutBy or startIndex(which is affected by sourceHeader) are different.\n    // So we use this three props as key.\n    var source = this.source;\n    var hash = [source.seriesLayoutBy, source.startIndex, dimHash].join('$$');\n    return {\n      dimensions: dims,\n      hash: hash\n    };\n  };\n  SeriesDataSchema.prototype.makeOutputDimensionNames = function () {\n    var result = [];\n    for (var fullDimIdx = 0, seriesDimIdx = 0; fullDimIdx < this._fullDimCount; fullDimIdx++) {\n      var name_1 = void 0;\n      var seriesDimDef = this.dimensions[seriesDimIdx];\n      // The list has been sorted by `storeDimIndex` asc.\n      if (seriesDimDef && seriesDimDef.storeDimIndex === fullDimIdx) {\n        if (!seriesDimDef.isCalculationCoord) {\n          name_1 = seriesDimDef.name;\n        }\n        seriesDimIdx++;\n      } else {\n        var sourceDimDef = this.getSourceDimension(fullDimIdx);\n        if (sourceDimDef) {\n          name_1 = sourceDimDef.name;\n        }\n      }\n      result.push(name_1);\n    }\n    return result;\n  };\n  SeriesDataSchema.prototype.appendCalculationDimension = function (dimDef) {\n    this.dimensions.push(dimDef);\n    dimDef.isCalculationCoord = true;\n    this._fullDimCount++;\n    // If append dimension on a data store, consider the store\n    // might be shared by different series, series dimensions not\n    // really map to store dimensions.\n    this._updateDimOmitted(true);\n  };\n  return SeriesDataSchema;\n}();\nexport { SeriesDataSchema };\nexport function isSeriesDataSchema(schema) {\n  return schema instanceof SeriesDataSchema;\n}\nexport function createDimNameMap(dimsDef) {\n  var dataDimNameMap = createHashMap();\n  for (var i = 0; i < (dimsDef || []).length; i++) {\n    var dimDefItemRaw = dimsDef[i];\n    var userDimName = isObject(dimDefItemRaw) ? dimDefItemRaw.name : dimDefItemRaw;\n    if (userDimName != null && dataDimNameMap.get(userDimName) == null) {\n      dataDimNameMap.set(userDimName, i);\n    }\n  }\n  return dataDimNameMap;\n}\nexport function ensureSourceDimNameMap(source) {\n  var innerSource = inner(source);\n  return innerSource.dimNameMap || (innerSource.dimNameMap = createDimNameMap(source.dimensionsDefine));\n}\nexport function shouldOmitUnusedDimensions(dimCount) {\n  return dimCount > 30;\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n/* global Int32Array */\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport Model from '../model/Model.js';\nimport DataDiffer from './DataDiffer.js';\nimport { DefaultDataProvider } from './helper/dataProvider.js';\nimport { summarizeDimensions } from './helper/dimensionHelper.js';\nimport SeriesDimensionDefine from './SeriesDimensionDefine.js';\nimport { SOURCE_FORMAT_TYPED_ARRAY, SOURCE_FORMAT_ORIGINAL } from '../util/types.js';\nimport { convertOptionIdName, isDataItemOption } from '../util/model.js';\nimport { setCommonECData } from '../util/innerStore.js';\nimport { isSourceInstance } from './Source.js';\nimport DataStore from './DataStore.js';\nimport { isSeriesDataSchema } from './helper/SeriesDataSchema.js';\nvar isObject = zrUtil.isObject;\nvar map = zrUtil.map;\nvar CtorInt32Array = typeof Int32Array === 'undefined' ? Array : Int32Array;\n// Use prefix to avoid index to be the same as otherIdList[idx],\n// which will cause weird update animation.\nvar ID_PREFIX = 'e\\0\\0';\nvar INDEX_NOT_FOUND = -1;\n// type SeriesDimensionIndex = DimensionIndex;\nvar TRANSFERABLE_PROPERTIES = ['hasItemOption', '_nameList', '_idList', '_invertedIndicesMap', '_dimSummary', 'userOutput', '_rawData', '_dimValueGetter', '_nameDimIdx', '_idDimIdx', '_nameRepeatCount'];\nvar CLONE_PROPERTIES = ['_approximateExtent'];\n// -----------------------------\n// Internal method declarations:\n// -----------------------------\nvar prepareInvertedIndex;\nvar getId;\nvar getIdNameFromStore;\nvar normalizeDimensions;\nvar transferProperties;\nvar cloneListForMapAndSample;\nvar makeIdFromName;\nvar SeriesData = /** @class */function () {\n  /**\n   * @param dimensionsInput.dimensions\n   *        For example, ['someDimName', {name: 'someDimName', type: 'someDimType'}, ...].\n   *        Dimensions should be concrete names like x, y, z, lng, lat, angle, radius\n   */\n  function SeriesData(dimensionsInput, hostModel) {\n    this.type = 'list';\n    this._dimOmitted = false;\n    this._nameList = [];\n    this._idList = [];\n    // Models of data option is stored sparse for optimizing memory cost\n    // Never used yet (not used yet).\n    // private _optionModels: Model[] = [];\n    // Global visual properties after visual coding\n    this._visual = {};\n    // Global layout properties.\n    this._layout = {};\n    // Item visual properties after visual coding\n    this._itemVisuals = [];\n    // Item layout properties after layout\n    this._itemLayouts = [];\n    // Graphic elements\n    this._graphicEls = [];\n    // key: dim, value: extent\n    this._approximateExtent = {};\n    this._calculationInfo = {};\n    // Having detected that there is data item is non primitive type\n    // (in type `OptionDataItemObject`).\n    // Like `data: [ { value: xx, itemStyle: {...} }, ...]`\n    // At present it only happen in `SOURCE_FORMAT_ORIGINAL`.\n    this.hasItemOption = false;\n    // Methods that create a new list based on this list should be listed here.\n    // Notice that those method should `RETURN` the new list.\n    this.TRANSFERABLE_METHODS = ['cloneShallow', 'downSample', 'minmaxDownSample', 'lttbDownSample', 'map'];\n    // Methods that change indices of this list should be listed here.\n    this.CHANGABLE_METHODS = ['filterSelf', 'selectRange'];\n    this.DOWNSAMPLE_METHODS = ['downSample', 'minmaxDownSample', 'lttbDownSample'];\n    var dimensions;\n    var assignStoreDimIdx = false;\n    if (isSeriesDataSchema(dimensionsInput)) {\n      dimensions = dimensionsInput.dimensions;\n      this._dimOmitted = dimensionsInput.isDimensionOmitted();\n      this._schema = dimensionsInput;\n    } else {\n      assignStoreDimIdx = true;\n      dimensions = dimensionsInput;\n    }\n    dimensions = dimensions || ['x', 'y'];\n    var dimensionInfos = {};\n    var dimensionNames = [];\n    var invertedIndicesMap = {};\n    var needsHasOwn = false;\n    var emptyObj = {};\n    for (var i = 0; i < dimensions.length; i++) {\n      // Use the original dimensions[i], where other flag props may exists.\n      var dimInfoInput = dimensions[i];\n      var dimensionInfo = zrUtil.isString(dimInfoInput) ? new SeriesDimensionDefine({\n        name: dimInfoInput\n      }) : !(dimInfoInput instanceof SeriesDimensionDefine) ? new SeriesDimensionDefine(dimInfoInput) : dimInfoInput;\n      var dimensionName = dimensionInfo.name;\n      dimensionInfo.type = dimensionInfo.type || 'float';\n      if (!dimensionInfo.coordDim) {\n        dimensionInfo.coordDim = dimensionName;\n        dimensionInfo.coordDimIndex = 0;\n      }\n      var otherDims = dimensionInfo.otherDims = dimensionInfo.otherDims || {};\n      dimensionNames.push(dimensionName);\n      dimensionInfos[dimensionName] = dimensionInfo;\n      if (emptyObj[dimensionName] != null) {\n        needsHasOwn = true;\n      }\n      if (dimensionInfo.createInvertedIndices) {\n        invertedIndicesMap[dimensionName] = [];\n      }\n      var dimIdx = i;\n      if (zrUtil.isNumber(dimensionInfo.storeDimIndex)) {\n        dimIdx = dimensionInfo.storeDimIndex;\n      }\n      if (otherDims.itemName === 0) {\n        this._nameDimIdx = dimIdx;\n      }\n      if (otherDims.itemId === 0) {\n        this._idDimIdx = dimIdx;\n      }\n      if (process.env.NODE_ENV !== 'production') {\n        zrUtil.assert(assignStoreDimIdx || dimensionInfo.storeDimIndex >= 0);\n      }\n      if (assignStoreDimIdx) {\n        dimensionInfo.storeDimIndex = i;\n      }\n    }\n    this.dimensions = dimensionNames;\n    this._dimInfos = dimensionInfos;\n    this._initGetDimensionInfo(needsHasOwn);\n    this.hostModel = hostModel;\n    this._invertedIndicesMap = invertedIndicesMap;\n    if (this._dimOmitted) {\n      var dimIdxToName_1 = this._dimIdxToName = zrUtil.createHashMap();\n      zrUtil.each(dimensionNames, function (dimName) {\n        dimIdxToName_1.set(dimensionInfos[dimName].storeDimIndex, dimName);\n      });\n    }\n  }\n  /**\n   *\n   * Get concrete dimension name by dimension name or dimension index.\n   * If input a dimension name, do not validate whether the dimension name exits.\n   *\n   * @caution\n   * @param dim Must make sure the dimension is `SeriesDimensionLoose`.\n   * Because only those dimensions will have auto-generated dimension names if not\n   * have a user-specified name, and other dimensions will get a return of null/undefined.\n   *\n   * @notice Because of this reason, should better use `getDimensionIndex` instead, for examples:\n   * ```js\n   * const val = data.getStore().get(data.getDimensionIndex(dim), dataIdx);\n   * ```\n   *\n   * @return Concrete dim name.\n   */\n  SeriesData.prototype.getDimension = function (dim) {\n    var dimIdx = this._recognizeDimIndex(dim);\n    if (dimIdx == null) {\n      return dim;\n    }\n    dimIdx = dim;\n    if (!this._dimOmitted) {\n      return this.dimensions[dimIdx];\n    }\n    // Retrieve from series dimension definition because it probably contains\n    // generated dimension name (like 'x', 'y').\n    var dimName = this._dimIdxToName.get(dimIdx);\n    if (dimName != null) {\n      return dimName;\n    }\n    var sourceDimDef = this._schema.getSourceDimension(dimIdx);\n    if (sourceDimDef) {\n      return sourceDimDef.name;\n    }\n  };\n  /**\n   * Get dimension index in data store. Return -1 if not found.\n   * Can be used to index value from getRawValue.\n   */\n  SeriesData.prototype.getDimensionIndex = function (dim) {\n    var dimIdx = this._recognizeDimIndex(dim);\n    if (dimIdx != null) {\n      return dimIdx;\n    }\n    if (dim == null) {\n      return -1;\n    }\n    var dimInfo = this._getDimInfo(dim);\n    return dimInfo ? dimInfo.storeDimIndex : this._dimOmitted ? this._schema.getSourceDimensionIndex(dim) : -1;\n  };\n  /**\n   * The meanings of the input parameter `dim`:\n   *\n   * + If dim is a number (e.g., `1`), it means the index of the dimension.\n   *   For example, `getDimension(0)` will return 'x' or 'lng' or 'radius'.\n   * + If dim is a number-like string (e.g., `\"1\"`):\n   *     + If there is the same concrete dim name defined in `series.dimensions` or `dataset.dimensions`,\n   *        it means that concrete name.\n   *     + If not, it will be converted to a number, which means the index of the dimension.\n   *        (why? because of the backward compatibility. We have been tolerating number-like string in\n   *        dimension setting, although now it seems that it is not a good idea.)\n   *     For example, `visualMap[i].dimension: \"1\"` is the same meaning as `visualMap[i].dimension: 1`,\n   *     if no dimension name is defined as `\"1\"`.\n   * + If dim is a not-number-like string, it means the concrete dim name.\n   *   For example, it can be be default name `\"x\"`, `\"y\"`, `\"z\"`, `\"lng\"`, `\"lat\"`, `\"angle\"`, `\"radius\"`,\n   *   or customized in `dimensions` property of option like `\"age\"`.\n   *\n   * @return recognized `DimensionIndex`. Otherwise return null/undefined (means that dim is `DimensionName`).\n   */\n  SeriesData.prototype._recognizeDimIndex = function (dim) {\n    if (zrUtil.isNumber(dim)\n    // If being a number-like string but not being defined as a dimension name.\n    || dim != null && !isNaN(dim) && !this._getDimInfo(dim) && (!this._dimOmitted || this._schema.getSourceDimensionIndex(dim) < 0)) {\n      return +dim;\n    }\n  };\n  SeriesData.prototype._getStoreDimIndex = function (dim) {\n    var dimIdx = this.getDimensionIndex(dim);\n    if (process.env.NODE_ENV !== 'production') {\n      if (dimIdx == null) {\n        throw new Error('Unknown dimension ' + dim);\n      }\n    }\n    return dimIdx;\n  };\n  /**\n   * Get type and calculation info of particular dimension\n   * @param dim\n   *        Dimension can be concrete names like x, y, z, lng, lat, angle, radius\n   *        Or a ordinal number. For example getDimensionInfo(0) will return 'x' or 'lng' or 'radius'\n   */\n  SeriesData.prototype.getDimensionInfo = function (dim) {\n    // Do not clone, because there may be categories in dimInfo.\n    return this._getDimInfo(this.getDimension(dim));\n  };\n  SeriesData.prototype._initGetDimensionInfo = function (needsHasOwn) {\n    var dimensionInfos = this._dimInfos;\n    this._getDimInfo = needsHasOwn ? function (dimName) {\n      return dimensionInfos.hasOwnProperty(dimName) ? dimensionInfos[dimName] : undefined;\n    } : function (dimName) {\n      return dimensionInfos[dimName];\n    };\n  };\n  /**\n   * concrete dimension name list on coord.\n   */\n  SeriesData.prototype.getDimensionsOnCoord = function () {\n    return this._dimSummary.dataDimsOnCoord.slice();\n  };\n  SeriesData.prototype.mapDimension = function (coordDim, idx) {\n    var dimensionsSummary = this._dimSummary;\n    if (idx == null) {\n      return dimensionsSummary.encodeFirstDimNotExtra[coordDim];\n    }\n    var dims = dimensionsSummary.encode[coordDim];\n    return dims ? dims[idx] : null;\n  };\n  SeriesData.prototype.mapDimensionsAll = function (coordDim) {\n    var dimensionsSummary = this._dimSummary;\n    var dims = dimensionsSummary.encode[coordDim];\n    return (dims || []).slice();\n  };\n  SeriesData.prototype.getStore = function () {\n    return this._store;\n  };\n  /**\n   * Initialize from data\n   * @param data source or data or data store.\n   * @param nameList The name of a datum is used on data diff and\n   *        default label/tooltip.\n   *        A name can be specified in encode.itemName,\n   *        or dataItem.name (only for series option data),\n   *        or provided in nameList from outside.\n   */\n  SeriesData.prototype.initData = function (data, nameList, dimValueGetter) {\n    var _this = this;\n    var store;\n    if (data instanceof DataStore) {\n      store = data;\n    }\n    if (!store) {\n      var dimensions = this.dimensions;\n      var provider = isSourceInstance(data) || zrUtil.isArrayLike(data) ? new DefaultDataProvider(data, dimensions.length) : data;\n      store = new DataStore();\n      var dimensionInfos = map(dimensions, function (dimName) {\n        return {\n          type: _this._dimInfos[dimName].type,\n          property: dimName\n        };\n      });\n      store.initData(provider, dimensionInfos, dimValueGetter);\n    }\n    this._store = store;\n    // Reset\n    this._nameList = (nameList || []).slice();\n    this._idList = [];\n    this._nameRepeatCount = {};\n    this._doInit(0, store.count());\n    // Cache summary info for fast visit. See \"dimensionHelper\".\n    // Needs to be initialized after store is prepared.\n    this._dimSummary = summarizeDimensions(this, this._schema);\n    this.userOutput = this._dimSummary.userOutput;\n  };\n  /**\n   * Caution: Can be only called on raw data (before `this._indices` created).\n   */\n  SeriesData.prototype.appendData = function (data) {\n    var range = this._store.appendData(data);\n    this._doInit(range[0], range[1]);\n  };\n  /**\n   * Caution: Can be only called on raw data (before `this._indices` created).\n   * This method does not modify `rawData` (`dataProvider`), but only\n   * add values to store.\n   *\n   * The final count will be increased by `Math.max(values.length, names.length)`.\n   *\n   * @param values That is the SourceType: 'arrayRows', like\n   *        [\n   *            [12, 33, 44],\n   *            [NaN, 43, 1],\n   *            ['-', 'asdf', 0]\n   *        ]\n   *        Each item is exactly corresponding to a dimension.\n   */\n  SeriesData.prototype.appendValues = function (values, names) {\n    var _a = this._store.appendValues(values, names && names.length),\n      start = _a.start,\n      end = _a.end;\n    var shouldMakeIdFromName = this._shouldMakeIdFromName();\n    this._updateOrdinalMeta();\n    if (names) {\n      for (var idx = start; idx < end; idx++) {\n        var sourceIdx = idx - start;\n        this._nameList[idx] = names[sourceIdx];\n        if (shouldMakeIdFromName) {\n          makeIdFromName(this, idx);\n        }\n      }\n    }\n  };\n  SeriesData.prototype._updateOrdinalMeta = function () {\n    var store = this._store;\n    var dimensions = this.dimensions;\n    for (var i = 0; i < dimensions.length; i++) {\n      var dimInfo = this._dimInfos[dimensions[i]];\n      if (dimInfo.ordinalMeta) {\n        store.collectOrdinalMeta(dimInfo.storeDimIndex, dimInfo.ordinalMeta);\n      }\n    }\n  };\n  SeriesData.prototype._shouldMakeIdFromName = function () {\n    var provider = this._store.getProvider();\n    return this._idDimIdx == null && provider.getSource().sourceFormat !== SOURCE_FORMAT_TYPED_ARRAY && !provider.fillStorage;\n  };\n  SeriesData.prototype._doInit = function (start, end) {\n    if (start >= end) {\n      return;\n    }\n    var store = this._store;\n    var provider = store.getProvider();\n    this._updateOrdinalMeta();\n    var nameList = this._nameList;\n    var idList = this._idList;\n    var sourceFormat = provider.getSource().sourceFormat;\n    var isFormatOriginal = sourceFormat === SOURCE_FORMAT_ORIGINAL;\n    // Each data item is value\n    // [1, 2]\n    // 2\n    // Bar chart, line chart which uses category axis\n    // only gives the 'y' value. 'x' value is the indices of category\n    // Use a tempValue to normalize the value to be a (x, y) value\n    // If dataItem is {name: ...} or {id: ...}, it has highest priority.\n    // This kind of ids and names are always stored `_nameList` and `_idList`.\n    if (isFormatOriginal && !provider.pure) {\n      var sharedDataItem = [];\n      for (var idx = start; idx < end; idx++) {\n        // NOTICE: Try not to write things into dataItem\n        var dataItem = provider.getItem(idx, sharedDataItem);\n        if (!this.hasItemOption && isDataItemOption(dataItem)) {\n          this.hasItemOption = true;\n        }\n        if (dataItem) {\n          var itemName = dataItem.name;\n          if (nameList[idx] == null && itemName != null) {\n            nameList[idx] = convertOptionIdName(itemName, null);\n          }\n          var itemId = dataItem.id;\n          if (idList[idx] == null && itemId != null) {\n            idList[idx] = convertOptionIdName(itemId, null);\n          }\n        }\n      }\n    }\n    if (this._shouldMakeIdFromName()) {\n      for (var idx = start; idx < end; idx++) {\n        makeIdFromName(this, idx);\n      }\n    }\n    prepareInvertedIndex(this);\n  };\n  /**\n   * PENDING: In fact currently this function is only used to short-circuit\n   * the calling of `scale.unionExtentFromData` when data have been filtered by modules\n   * like \"dataZoom\". `scale.unionExtentFromData` is used to calculate data extent for series on\n   * an axis, but if a \"axis related data filter module\" is used, the extent of the axis have\n   * been fixed and no need to calling `scale.unionExtentFromData` actually.\n   * But if we add \"custom data filter\" in future, which is not \"axis related\", this method may\n   * be still needed.\n   *\n   * Optimize for the scenario that data is filtered by a given extent.\n   * Consider that if data amount is more than hundreds of thousand,\n   * extent calculation will cost more than 10ms and the cache will\n   * be erased because of the filtering.\n   */\n  SeriesData.prototype.getApproximateExtent = function (dim) {\n    return this._approximateExtent[dim] || this._store.getDataExtent(this._getStoreDimIndex(dim));\n  };\n  /**\n   * Calculate extent on a filtered data might be time consuming.\n   * Approximate extent is only used for: calculate extent of filtered data outside.\n   */\n  SeriesData.prototype.setApproximateExtent = function (extent, dim) {\n    dim = this.getDimension(dim);\n    this._approximateExtent[dim] = extent.slice();\n  };\n  SeriesData.prototype.getCalculationInfo = function (key) {\n    return this._calculationInfo[key];\n  };\n  SeriesData.prototype.setCalculationInfo = function (key, value) {\n    isObject(key) ? zrUtil.extend(this._calculationInfo, key) : this._calculationInfo[key] = value;\n  };\n  /**\n   * @return Never be null/undefined. `number` will be converted to string. Because:\n   * In most cases, name is used in display, where returning a string is more convenient.\n   * In other cases, name is used in query (see `indexOfName`), where we can keep the\n   * rule that name `2` equals to name `'2'`.\n   */\n  SeriesData.prototype.getName = function (idx) {\n    var rawIndex = this.getRawIndex(idx);\n    var name = this._nameList[rawIndex];\n    if (name == null && this._nameDimIdx != null) {\n      name = getIdNameFromStore(this, this._nameDimIdx, rawIndex);\n    }\n    if (name == null) {\n      name = '';\n    }\n    return name;\n  };\n  SeriesData.prototype._getCategory = function (dimIdx, idx) {\n    var ordinal = this._store.get(dimIdx, idx);\n    var ordinalMeta = this._store.getOrdinalMeta(dimIdx);\n    if (ordinalMeta) {\n      return ordinalMeta.categories[ordinal];\n    }\n    return ordinal;\n  };\n  /**\n   * @return Never null/undefined. `number` will be converted to string. Because:\n   * In all cases having encountered at present, id is used in making diff comparison, which\n   * are usually based on hash map. We can keep the rule that the internal id are always string\n   * (treat `2` is the same as `'2'`) to make the related logic simple.\n   */\n  SeriesData.prototype.getId = function (idx) {\n    return getId(this, this.getRawIndex(idx));\n  };\n  SeriesData.prototype.count = function () {\n    return this._store.count();\n  };\n  /**\n   * Get value. Return NaN if idx is out of range.\n   *\n   * @notice Should better to use `data.getStore().get(dimIndex, dataIdx)` instead.\n   */\n  SeriesData.prototype.get = function (dim, idx) {\n    var store = this._store;\n    var dimInfo = this._dimInfos[dim];\n    if (dimInfo) {\n      return store.get(dimInfo.storeDimIndex, idx);\n    }\n  };\n  /**\n   * @notice Should better to use `data.getStore().getByRawIndex(dimIndex, dataIdx)` instead.\n   */\n  SeriesData.prototype.getByRawIndex = function (dim, rawIdx) {\n    var store = this._store;\n    var dimInfo = this._dimInfos[dim];\n    if (dimInfo) {\n      return store.getByRawIndex(dimInfo.storeDimIndex, rawIdx);\n    }\n  };\n  SeriesData.prototype.getIndices = function () {\n    return this._store.getIndices();\n  };\n  SeriesData.prototype.getDataExtent = function (dim) {\n    return this._store.getDataExtent(this._getStoreDimIndex(dim));\n  };\n  SeriesData.prototype.getSum = function (dim) {\n    return this._store.getSum(this._getStoreDimIndex(dim));\n  };\n  SeriesData.prototype.getMedian = function (dim) {\n    return this._store.getMedian(this._getStoreDimIndex(dim));\n  };\n  SeriesData.prototype.getValues = function (dimensions, idx) {\n    var _this = this;\n    var store = this._store;\n    return zrUtil.isArray(dimensions) ? store.getValues(map(dimensions, function (dim) {\n      return _this._getStoreDimIndex(dim);\n    }), idx) : store.getValues(dimensions);\n  };\n  /**\n   * If value is NaN. Including '-'\n   * Only check the coord dimensions.\n   */\n  SeriesData.prototype.hasValue = function (idx) {\n    var dataDimIndicesOnCoord = this._dimSummary.dataDimIndicesOnCoord;\n    for (var i = 0, len = dataDimIndicesOnCoord.length; i < len; i++) {\n      // Ordinal type originally can be string or number.\n      // But when an ordinal type is used on coord, it can\n      // not be string but only number. So we can also use isNaN.\n      if (isNaN(this._store.get(dataDimIndicesOnCoord[i], idx))) {\n        return false;\n      }\n    }\n    return true;\n  };\n  /**\n   * Retrieve the index with given name\n   */\n  SeriesData.prototype.indexOfName = function (name) {\n    for (var i = 0, len = this._store.count(); i < len; i++) {\n      if (this.getName(i) === name) {\n        return i;\n      }\n    }\n    return -1;\n  };\n  SeriesData.prototype.getRawIndex = function (idx) {\n    return this._store.getRawIndex(idx);\n  };\n  SeriesData.prototype.indexOfRawIndex = function (rawIndex) {\n    return this._store.indexOfRawIndex(rawIndex);\n  };\n  /**\n   * Only support the dimension which inverted index created.\n   * Do not support other cases until required.\n   * @param dim concrete dim\n   * @param value ordinal index\n   * @return rawIndex\n   */\n  SeriesData.prototype.rawIndexOf = function (dim, value) {\n    var invertedIndices = dim && this._invertedIndicesMap[dim];\n    if (process.env.NODE_ENV !== 'production') {\n      if (!invertedIndices) {\n        throw new Error('Do not supported yet');\n      }\n    }\n    var rawIndex = invertedIndices && invertedIndices[value];\n    if (rawIndex == null || isNaN(rawIndex)) {\n      return INDEX_NOT_FOUND;\n    }\n    return rawIndex;\n  };\n  SeriesData.prototype.each = function (dims, cb, ctx) {\n    'use strict';\n\n    if (zrUtil.isFunction(dims)) {\n      ctx = cb;\n      cb = dims;\n      dims = [];\n    }\n    // ctxCompat just for compat echarts3\n    var fCtx = ctx || this;\n    var dimIndices = map(normalizeDimensions(dims), this._getStoreDimIndex, this);\n    this._store.each(dimIndices, fCtx ? zrUtil.bind(cb, fCtx) : cb);\n  };\n  SeriesData.prototype.filterSelf = function (dims, cb, ctx) {\n    'use strict';\n\n    if (zrUtil.isFunction(dims)) {\n      ctx = cb;\n      cb = dims;\n      dims = [];\n    }\n    // ctxCompat just for compat echarts3\n    var fCtx = ctx || this;\n    var dimIndices = map(normalizeDimensions(dims), this._getStoreDimIndex, this);\n    this._store = this._store.filter(dimIndices, fCtx ? zrUtil.bind(cb, fCtx) : cb);\n    return this;\n  };\n  /**\n   * Select data in range. (For optimization of filter)\n   * (Manually inline code, support 5 million data filtering in data zoom.)\n   */\n  SeriesData.prototype.selectRange = function (range) {\n    'use strict';\n\n    var _this = this;\n    var innerRange = {};\n    var dims = zrUtil.keys(range);\n    var dimIndices = [];\n    zrUtil.each(dims, function (dim) {\n      var dimIdx = _this._getStoreDimIndex(dim);\n      innerRange[dimIdx] = range[dim];\n      dimIndices.push(dimIdx);\n    });\n    this._store = this._store.selectRange(innerRange);\n    return this;\n  };\n  /* eslint-enable max-len */\n  SeriesData.prototype.mapArray = function (dims, cb, ctx) {\n    'use strict';\n\n    if (zrUtil.isFunction(dims)) {\n      ctx = cb;\n      cb = dims;\n      dims = [];\n    }\n    // ctxCompat just for compat echarts3\n    ctx = ctx || this;\n    var result = [];\n    this.each(dims, function () {\n      result.push(cb && cb.apply(this, arguments));\n    }, ctx);\n    return result;\n  };\n  SeriesData.prototype.map = function (dims, cb, ctx, ctxCompat) {\n    'use strict';\n\n    // ctxCompat just for compat echarts3\n    var fCtx = ctx || ctxCompat || this;\n    var dimIndices = map(normalizeDimensions(dims), this._getStoreDimIndex, this);\n    var list = cloneListForMapAndSample(this);\n    list._store = this._store.map(dimIndices, fCtx ? zrUtil.bind(cb, fCtx) : cb);\n    return list;\n  };\n  SeriesData.prototype.modify = function (dims, cb, ctx, ctxCompat) {\n    var _this = this;\n    // ctxCompat just for compat echarts3\n    var fCtx = ctx || ctxCompat || this;\n    if (process.env.NODE_ENV !== 'production') {\n      zrUtil.each(normalizeDimensions(dims), function (dim) {\n        var dimInfo = _this.getDimensionInfo(dim);\n        if (!dimInfo.isCalculationCoord) {\n          console.error('Danger: only stack dimension can be modified');\n        }\n      });\n    }\n    var dimIndices = map(normalizeDimensions(dims), this._getStoreDimIndex, this);\n    // If do shallow clone here, if there are too many stacked series,\n    // it still cost lots of memory, because `_store.dimensions` are not shared.\n    // We should consider there probably be shallow clone happen in each series\n    // in consequent filter/map.\n    this._store.modify(dimIndices, fCtx ? zrUtil.bind(cb, fCtx) : cb);\n  };\n  /**\n   * Large data down sampling on given dimension\n   * @param sampleIndex Sample index for name and id\n   */\n  SeriesData.prototype.downSample = function (dimension, rate, sampleValue, sampleIndex) {\n    var list = cloneListForMapAndSample(this);\n    list._store = this._store.downSample(this._getStoreDimIndex(dimension), rate, sampleValue, sampleIndex);\n    return list;\n  };\n  /**\n   * Large data down sampling using min-max\n   * @param {string} valueDimension\n   * @param {number} rate\n   */\n  SeriesData.prototype.minmaxDownSample = function (valueDimension, rate) {\n    var list = cloneListForMapAndSample(this);\n    list._store = this._store.minmaxDownSample(this._getStoreDimIndex(valueDimension), rate);\n    return list;\n  };\n  /**\n   * Large data down sampling using largest-triangle-three-buckets\n   * @param {string} valueDimension\n   * @param {number} targetCount\n   */\n  SeriesData.prototype.lttbDownSample = function (valueDimension, rate) {\n    var list = cloneListForMapAndSample(this);\n    list._store = this._store.lttbDownSample(this._getStoreDimIndex(valueDimension), rate);\n    return list;\n  };\n  SeriesData.prototype.getRawDataItem = function (idx) {\n    return this._store.getRawDataItem(idx);\n  };\n  /**\n   * Get model of one data item.\n   */\n  // TODO: Type of data item\n  SeriesData.prototype.getItemModel = function (idx) {\n    var hostModel = this.hostModel;\n    var dataItem = this.getRawDataItem(idx);\n    return new Model(dataItem, hostModel, hostModel && hostModel.ecModel);\n  };\n  /**\n   * Create a data differ\n   */\n  SeriesData.prototype.diff = function (otherList) {\n    var thisList = this;\n    return new DataDiffer(otherList ? otherList.getStore().getIndices() : [], this.getStore().getIndices(), function (idx) {\n      return getId(otherList, idx);\n    }, function (idx) {\n      return getId(thisList, idx);\n    });\n  };\n  /**\n   * Get visual property.\n   */\n  SeriesData.prototype.getVisual = function (key) {\n    var visual = this._visual;\n    return visual && visual[key];\n  };\n  SeriesData.prototype.setVisual = function (kvObj, val) {\n    this._visual = this._visual || {};\n    if (isObject(kvObj)) {\n      zrUtil.extend(this._visual, kvObj);\n    } else {\n      this._visual[kvObj] = val;\n    }\n  };\n  /**\n   * Get visual property of single data item\n   */\n  // eslint-disable-next-line\n  SeriesData.prototype.getItemVisual = function (idx, key) {\n    var itemVisual = this._itemVisuals[idx];\n    var val = itemVisual && itemVisual[key];\n    if (val == null) {\n      // Use global visual property\n      return this.getVisual(key);\n    }\n    return val;\n  };\n  /**\n   * If exists visual property of single data item\n   */\n  SeriesData.prototype.hasItemVisual = function () {\n    return this._itemVisuals.length > 0;\n  };\n  /**\n   * Make sure itemVisual property is unique\n   */\n  // TODO: use key to save visual to reduce memory.\n  SeriesData.prototype.ensureUniqueItemVisual = function (idx, key) {\n    var itemVisuals = this._itemVisuals;\n    var itemVisual = itemVisuals[idx];\n    if (!itemVisual) {\n      itemVisual = itemVisuals[idx] = {};\n    }\n    var val = itemVisual[key];\n    if (val == null) {\n      val = this.getVisual(key);\n      // TODO Performance?\n      if (zrUtil.isArray(val)) {\n        val = val.slice();\n      } else if (isObject(val)) {\n        val = zrUtil.extend({}, val);\n      }\n      itemVisual[key] = val;\n    }\n    return val;\n  };\n  // eslint-disable-next-line\n  SeriesData.prototype.setItemVisual = function (idx, key, value) {\n    var itemVisual = this._itemVisuals[idx] || {};\n    this._itemVisuals[idx] = itemVisual;\n    if (isObject(key)) {\n      zrUtil.extend(itemVisual, key);\n    } else {\n      itemVisual[key] = value;\n    }\n  };\n  /**\n   * Clear itemVisuals and list visual.\n   */\n  SeriesData.prototype.clearAllVisual = function () {\n    this._visual = {};\n    this._itemVisuals = [];\n  };\n  SeriesData.prototype.setLayout = function (key, val) {\n    isObject(key) ? zrUtil.extend(this._layout, key) : this._layout[key] = val;\n  };\n  /**\n   * Get layout property.\n   */\n  SeriesData.prototype.getLayout = function (key) {\n    return this._layout[key];\n  };\n  /**\n   * Get layout of single data item\n   */\n  SeriesData.prototype.getItemLayout = function (idx) {\n    return this._itemLayouts[idx];\n  };\n  /**\n   * Set layout of single data item\n   */\n  SeriesData.prototype.setItemLayout = function (idx, layout, merge) {\n    this._itemLayouts[idx] = merge ? zrUtil.extend(this._itemLayouts[idx] || {}, layout) : layout;\n  };\n  /**\n   * Clear all layout of single data item\n   */\n  SeriesData.prototype.clearItemLayouts = function () {\n    this._itemLayouts.length = 0;\n  };\n  /**\n   * Set graphic element relative to data. It can be set as null\n   */\n  SeriesData.prototype.setItemGraphicEl = function (idx, el) {\n    var seriesIndex = this.hostModel && this.hostModel.seriesIndex;\n    setCommonECData(seriesIndex, this.dataType, idx, el);\n    this._graphicEls[idx] = el;\n  };\n  SeriesData.prototype.getItemGraphicEl = function (idx) {\n    return this._graphicEls[idx];\n  };\n  SeriesData.prototype.eachItemGraphicEl = function (cb, context) {\n    zrUtil.each(this._graphicEls, function (el, idx) {\n      if (el) {\n        cb && cb.call(context, el, idx);\n      }\n    });\n  };\n  /**\n   * Shallow clone a new list except visual and layout properties, and graph elements.\n   * New list only change the indices.\n   */\n  SeriesData.prototype.cloneShallow = function (list) {\n    if (!list) {\n      list = new SeriesData(this._schema ? this._schema : map(this.dimensions, this._getDimInfo, this), this.hostModel);\n    }\n    transferProperties(list, this);\n    list._store = this._store;\n    return list;\n  };\n  /**\n   * Wrap some method to add more feature\n   */\n  SeriesData.prototype.wrapMethod = function (methodName, injectFunction) {\n    var originalMethod = this[methodName];\n    if (!zrUtil.isFunction(originalMethod)) {\n      return;\n    }\n    this.__wrappedMethods = this.__wrappedMethods || [];\n    this.__wrappedMethods.push(methodName);\n    this[methodName] = function () {\n      var res = originalMethod.apply(this, arguments);\n      return injectFunction.apply(this, [res].concat(zrUtil.slice(arguments)));\n    };\n  };\n  // ----------------------------------------------------------\n  // A work around for internal method visiting private member.\n  // ----------------------------------------------------------\n  SeriesData.internalField = function () {\n    prepareInvertedIndex = function (data) {\n      var invertedIndicesMap = data._invertedIndicesMap;\n      zrUtil.each(invertedIndicesMap, function (invertedIndices, dim) {\n        var dimInfo = data._dimInfos[dim];\n        // Currently, only dimensions that has ordinalMeta can create inverted indices.\n        var ordinalMeta = dimInfo.ordinalMeta;\n        var store = data._store;\n        if (ordinalMeta) {\n          invertedIndices = invertedIndicesMap[dim] = new CtorInt32Array(ordinalMeta.categories.length);\n          // The default value of TypedArray is 0. To avoid miss\n          // mapping to 0, we should set it as INDEX_NOT_FOUND.\n          for (var i = 0; i < invertedIndices.length; i++) {\n            invertedIndices[i] = INDEX_NOT_FOUND;\n          }\n          for (var i = 0; i < store.count(); i++) {\n            // Only support the case that all values are distinct.\n            invertedIndices[store.get(dimInfo.storeDimIndex, i)] = i;\n          }\n        }\n      });\n    };\n    getIdNameFromStore = function (data, dimIdx, idx) {\n      return convertOptionIdName(data._getCategory(dimIdx, idx), null);\n    };\n    /**\n     * @see the comment of `List['getId']`.\n     */\n    getId = function (data, rawIndex) {\n      var id = data._idList[rawIndex];\n      if (id == null && data._idDimIdx != null) {\n        id = getIdNameFromStore(data, data._idDimIdx, rawIndex);\n      }\n      if (id == null) {\n        id = ID_PREFIX + rawIndex;\n      }\n      return id;\n    };\n    normalizeDimensions = function (dimensions) {\n      if (!zrUtil.isArray(dimensions)) {\n        dimensions = dimensions != null ? [dimensions] : [];\n      }\n      return dimensions;\n    };\n    /**\n     * Data in excludeDimensions is copied, otherwise transferred.\n     */\n    cloneListForMapAndSample = function (original) {\n      var list = new SeriesData(original._schema ? original._schema : map(original.dimensions, original._getDimInfo, original), original.hostModel);\n      // FIXME If needs stackedOn, value may already been stacked\n      transferProperties(list, original);\n      return list;\n    };\n    transferProperties = function (target, source) {\n      zrUtil.each(TRANSFERABLE_PROPERTIES.concat(source.__wrappedMethods || []), function (propName) {\n        if (source.hasOwnProperty(propName)) {\n          target[propName] = source[propName];\n        }\n      });\n      target.__wrappedMethods = source.__wrappedMethods;\n      zrUtil.each(CLONE_PROPERTIES, function (propName) {\n        target[propName] = zrUtil.clone(source[propName]);\n      });\n      target._calculationInfo = zrUtil.extend({}, source._calculationInfo);\n    };\n    makeIdFromName = function (data, idx) {\n      var nameList = data._nameList;\n      var idList = data._idList;\n      var nameDimIdx = data._nameDimIdx;\n      var idDimIdx = data._idDimIdx;\n      var name = nameList[idx];\n      var id = idList[idx];\n      if (name == null && nameDimIdx != null) {\n        nameList[idx] = name = getIdNameFromStore(data, nameDimIdx, idx);\n      }\n      if (id == null && idDimIdx != null) {\n        idList[idx] = id = getIdNameFromStore(data, idDimIdx, idx);\n      }\n      if (id == null && name != null) {\n        var nameRepeatCount = data._nameRepeatCount;\n        var nmCnt = nameRepeatCount[name] = (nameRepeatCount[name] || 0) + 1;\n        id = name;\n        if (nmCnt > 1) {\n          id += '__ec__' + nmCnt;\n        }\n        idList[idx] = id;\n      }\n    };\n  }();\n  return SeriesData;\n}();\nexport default SeriesData;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n/**\n * This module exposes helper functions for developing extensions.\n */\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport createSeriesData from '../../chart/helper/createSeriesData.js';\n// import createGraphFromNodeEdge from './chart/helper/createGraphFromNodeEdge.js';\nimport * as axisHelper from '../../coord/axisHelper.js';\nimport { AxisModelCommonMixin } from '../../coord/axisModelCommonMixin.js';\nimport Model from '../../model/Model.js';\nimport { getLayoutRect } from '../../util/layout.js';\nimport { enableDataStack, isDimensionStacked, getStackedDimension } from '../../data/helper/dataStackHelper.js';\nimport { getECData } from '../../util/innerStore.js';\nimport { createTextStyle as innerCreateTextStyle } from '../../label/labelStyle.js';\n/**\n * Create a multi dimension List structure from seriesModel.\n */\nexport function createList(seriesModel) {\n  return createSeriesData(null, seriesModel);\n}\n// export function createGraph(seriesModel) {\n//     let nodes = seriesModel.get('data');\n//     let links = seriesModel.get('links');\n//     return createGraphFromNodeEdge(nodes, links, seriesModel);\n// }\nexport { getLayoutRect };\nexport { createDimensions } from '../../data/helper/createDimensions.js';\nexport var dataStack = {\n  isDimensionStacked: isDimensionStacked,\n  enableDataStack: enableDataStack,\n  getStackedDimension: getStackedDimension\n};\n/**\n * Create a symbol element with given symbol configuration: shape, x, y, width, height, color\n * @param {string} symbolDesc\n * @param {number} x\n * @param {number} y\n * @param {number} w\n * @param {number} h\n * @param {string} color\n */\nexport { createSymbol } from '../../util/symbol.js';\n/**\n * Create scale\n * @param {Array.<number>} dataExtent\n * @param {Object|module:echarts/Model} option If `optoin.type`\n *        is secified, it can only be `'value'` currently.\n */\nexport function createScale(dataExtent, option) {\n  var axisModel = option;\n  if (!(option instanceof Model)) {\n    axisModel = new Model(option);\n    // FIXME\n    // Currently AxisModelCommonMixin has nothing to do with the\n    // the requirements of `axisHelper.createScaleByModel`. For\n    // example the methods `getCategories` and `getOrdinalMeta`\n    // are required for `'category'` axis, and ecModel is required\n    // for `'time'` axis. But occasionally echarts-gl happened\n    // to only use `'value'` axis.\n    // zrUtil.mixin(axisModel, AxisModelCommonMixin);\n  }\n  var scale = axisHelper.createScaleByModel(axisModel);\n  scale.setExtent(dataExtent[0], dataExtent[1]);\n  axisHelper.niceScaleExtent(scale, axisModel);\n  return scale;\n}\n/**\n * Mixin common methods to axis model,\n *\n * Include methods\n * `getFormattedLabels() => Array.<string>`\n * `getCategories() => Array.<string>`\n * `getMin(origin: boolean) => number`\n * `getMax(origin: boolean) => number`\n * `getNeedCrossZero() => boolean`\n */\nexport function mixinAxisModelCommonMethods(Model) {\n  zrUtil.mixin(Model, AxisModelCommonMixin);\n}\nexport { getECData };\nexport { enableHoverEmphasis } from '../../util/states.js';\nexport function createTextStyle(textStyleModel, opts) {\n  opts = opts || {};\n  return innerCreateTextStyle(textStyleModel, null, null, opts.state !== 'normal');\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { VISUAL_DIMENSIONS } from '../../util/types.js';\nimport SeriesDimensionDefine from '../SeriesDimensionDefine.js';\nimport { createHashMap, defaults, each, extend, isObject, isString } from 'zrender/lib/core/util.js';\nimport { createSourceFromSeriesDataOption, isSourceInstance } from '../Source.js';\nimport { CtorInt32Array } from '../DataStore.js';\nimport { normalizeToArray } from '../../util/model.js';\nimport { BE_ORDINAL, guessOrdinal } from './sourceHelper.js';\nimport { createDimNameMap, ensureSourceDimNameMap, SeriesDataSchema, shouldOmitUnusedDimensions } from './SeriesDataSchema.js';\n/**\n * For outside usage compat (like echarts-gl are using it).\n */\nexport function createDimensions(source, opt) {\n  return prepareSeriesDataSchema(source, opt).dimensions;\n}\n/**\n * This method builds the relationship between:\n * + \"what the coord sys or series requires (see `coordDimensions`)\",\n * + \"what the user defines (in `encode` and `dimensions`, see `opt.dimensionsDefine` and `opt.encodeDefine`)\"\n * + \"what the data source provids (see `source`)\".\n *\n * Some guess strategy will be adapted if user does not define something.\n * If no 'value' dimension specified, the first no-named dimension will be\n * named as 'value'.\n *\n * @return The results are always sorted by `storeDimIndex` asc.\n */\nexport default function prepareSeriesDataSchema(\n// TODO: TYPE completeDimensions type\nsource, opt) {\n  if (!isSourceInstance(source)) {\n    source = createSourceFromSeriesDataOption(source);\n  }\n  opt = opt || {};\n  var sysDims = opt.coordDimensions || [];\n  var dimsDef = opt.dimensionsDefine || source.dimensionsDefine || [];\n  var coordDimNameMap = createHashMap();\n  var resultList = [];\n  var dimCount = getDimCount(source, sysDims, dimsDef, opt.dimensionsCount);\n  // Try to ignore unused dimensions if sharing a high dimension datastore\n  // 30 is an experience value.\n  var omitUnusedDimensions = opt.canOmitUnusedDimensions && shouldOmitUnusedDimensions(dimCount);\n  var isUsingSourceDimensionsDef = dimsDef === source.dimensionsDefine;\n  var dataDimNameMap = isUsingSourceDimensionsDef ? ensureSourceDimNameMap(source) : createDimNameMap(dimsDef);\n  var encodeDef = opt.encodeDefine;\n  if (!encodeDef && opt.encodeDefaulter) {\n    encodeDef = opt.encodeDefaulter(source, dimCount);\n  }\n  var encodeDefMap = createHashMap(encodeDef);\n  var indicesMap = new CtorInt32Array(dimCount);\n  for (var i = 0; i < indicesMap.length; i++) {\n    indicesMap[i] = -1;\n  }\n  function getResultItem(dimIdx) {\n    var idx = indicesMap[dimIdx];\n    if (idx < 0) {\n      var dimDefItemRaw = dimsDef[dimIdx];\n      var dimDefItem = isObject(dimDefItemRaw) ? dimDefItemRaw : {\n        name: dimDefItemRaw\n      };\n      var resultItem = new SeriesDimensionDefine();\n      var userDimName = dimDefItem.name;\n      if (userDimName != null && dataDimNameMap.get(userDimName) != null) {\n        // Only if `series.dimensions` is defined in option\n        // displayName, will be set, and dimension will be displayed vertically in\n        // tooltip by default.\n        resultItem.name = resultItem.displayName = userDimName;\n      }\n      dimDefItem.type != null && (resultItem.type = dimDefItem.type);\n      dimDefItem.displayName != null && (resultItem.displayName = dimDefItem.displayName);\n      var newIdx = resultList.length;\n      indicesMap[dimIdx] = newIdx;\n      resultItem.storeDimIndex = dimIdx;\n      resultList.push(resultItem);\n      return resultItem;\n    }\n    return resultList[idx];\n  }\n  if (!omitUnusedDimensions) {\n    for (var i = 0; i < dimCount; i++) {\n      getResultItem(i);\n    }\n  }\n  // Set `coordDim` and `coordDimIndex` by `encodeDefMap` and normalize `encodeDefMap`.\n  encodeDefMap.each(function (dataDimsRaw, coordDim) {\n    var dataDims = normalizeToArray(dataDimsRaw).slice();\n    // Note: It is allowed that `dataDims.length` is `0`, e.g., options is\n    // `{encode: {x: -1, y: 1}}`. Should not filter anything in\n    // this case.\n    if (dataDims.length === 1 && !isString(dataDims[0]) && dataDims[0] < 0) {\n      encodeDefMap.set(coordDim, false);\n      return;\n    }\n    var validDataDims = encodeDefMap.set(coordDim, []);\n    each(dataDims, function (resultDimIdxOrName, idx) {\n      // The input resultDimIdx can be dim name or index.\n      var resultDimIdx = isString(resultDimIdxOrName) ? dataDimNameMap.get(resultDimIdxOrName) : resultDimIdxOrName;\n      if (resultDimIdx != null && resultDimIdx < dimCount) {\n        validDataDims[idx] = resultDimIdx;\n        applyDim(getResultItem(resultDimIdx), coordDim, idx);\n      }\n    });\n  });\n  // Apply templates and default order from `sysDims`.\n  var availDimIdx = 0;\n  each(sysDims, function (sysDimItemRaw) {\n    var coordDim;\n    var sysDimItemDimsDef;\n    var sysDimItemOtherDims;\n    var sysDimItem;\n    if (isString(sysDimItemRaw)) {\n      coordDim = sysDimItemRaw;\n      sysDimItem = {};\n    } else {\n      sysDimItem = sysDimItemRaw;\n      coordDim = sysDimItem.name;\n      var ordinalMeta = sysDimItem.ordinalMeta;\n      sysDimItem.ordinalMeta = null;\n      sysDimItem = extend({}, sysDimItem);\n      sysDimItem.ordinalMeta = ordinalMeta;\n      // `coordDimIndex` should not be set directly.\n      sysDimItemDimsDef = sysDimItem.dimsDef;\n      sysDimItemOtherDims = sysDimItem.otherDims;\n      sysDimItem.name = sysDimItem.coordDim = sysDimItem.coordDimIndex = sysDimItem.dimsDef = sysDimItem.otherDims = null;\n    }\n    var dataDims = encodeDefMap.get(coordDim);\n    // negative resultDimIdx means no need to mapping.\n    if (dataDims === false) {\n      return;\n    }\n    dataDims = normalizeToArray(dataDims);\n    // dimensions provides default dim sequences.\n    if (!dataDims.length) {\n      for (var i = 0; i < (sysDimItemDimsDef && sysDimItemDimsDef.length || 1); i++) {\n        while (availDimIdx < dimCount && getResultItem(availDimIdx).coordDim != null) {\n          availDimIdx++;\n        }\n        availDimIdx < dimCount && dataDims.push(availDimIdx++);\n      }\n    }\n    // Apply templates.\n    each(dataDims, function (resultDimIdx, coordDimIndex) {\n      var resultItem = getResultItem(resultDimIdx);\n      // Coordinate system has a higher priority on dim type than source.\n      if (isUsingSourceDimensionsDef && sysDimItem.type != null) {\n        resultItem.type = sysDimItem.type;\n      }\n      applyDim(defaults(resultItem, sysDimItem), coordDim, coordDimIndex);\n      if (resultItem.name == null && sysDimItemDimsDef) {\n        var sysDimItemDimsDefItem = sysDimItemDimsDef[coordDimIndex];\n        !isObject(sysDimItemDimsDefItem) && (sysDimItemDimsDefItem = {\n          name: sysDimItemDimsDefItem\n        });\n        resultItem.name = resultItem.displayName = sysDimItemDimsDefItem.name;\n        resultItem.defaultTooltip = sysDimItemDimsDefItem.defaultTooltip;\n      }\n      // FIXME refactor, currently only used in case: {otherDims: {tooltip: false}}\n      sysDimItemOtherDims && defaults(resultItem.otherDims, sysDimItemOtherDims);\n    });\n  });\n  function applyDim(resultItem, coordDim, coordDimIndex) {\n    if (VISUAL_DIMENSIONS.get(coordDim) != null) {\n      resultItem.otherDims[coordDim] = coordDimIndex;\n    } else {\n      resultItem.coordDim = coordDim;\n      resultItem.coordDimIndex = coordDimIndex;\n      coordDimNameMap.set(coordDim, true);\n    }\n  }\n  // Make sure the first extra dim is 'value'.\n  var generateCoord = opt.generateCoord;\n  var generateCoordCount = opt.generateCoordCount;\n  var fromZero = generateCoordCount != null;\n  generateCoordCount = generateCoord ? generateCoordCount || 1 : 0;\n  var extra = generateCoord || 'value';\n  function ifNoNameFillWithCoordName(resultItem) {\n    if (resultItem.name == null) {\n      // Duplication will be removed in the next step.\n      resultItem.name = resultItem.coordDim;\n    }\n  }\n  // Set dim `name` and other `coordDim` and other props.\n  if (!omitUnusedDimensions) {\n    for (var resultDimIdx = 0; resultDimIdx < dimCount; resultDimIdx++) {\n      var resultItem = getResultItem(resultDimIdx);\n      var coordDim = resultItem.coordDim;\n      if (coordDim == null) {\n        // TODO no need to generate coordDim for isExtraCoord?\n        resultItem.coordDim = genCoordDimName(extra, coordDimNameMap, fromZero);\n        resultItem.coordDimIndex = 0;\n        // Series specified generateCoord is using out.\n        if (!generateCoord || generateCoordCount <= 0) {\n          resultItem.isExtraCoord = true;\n        }\n        generateCoordCount--;\n      }\n      ifNoNameFillWithCoordName(resultItem);\n      if (resultItem.type == null && (guessOrdinal(source, resultDimIdx) === BE_ORDINAL.Must\n      // Consider the case:\n      // {\n      //    dataset: {source: [\n      //        ['2001', 123],\n      //        ['2002', 456],\n      //        ...\n      //        ['The others', 987],\n      //    ]},\n      //    series: {type: 'pie'}\n      // }\n      // The first column should better be treated as a \"ordinal\" although it\n      // might not be detected as an \"ordinal\" by `guessOrdinal`.\n      || resultItem.isExtraCoord && (resultItem.otherDims.itemName != null || resultItem.otherDims.seriesName != null))) {\n        resultItem.type = 'ordinal';\n      }\n    }\n  } else {\n    each(resultList, function (resultItem) {\n      // PENDING: guessOrdinal or let user specify type: 'ordinal' manually?\n      ifNoNameFillWithCoordName(resultItem);\n    });\n    // Sort dimensions: there are some rule that use the last dim as label,\n    // and for some latter travel process easier.\n    resultList.sort(function (item0, item1) {\n      return item0.storeDimIndex - item1.storeDimIndex;\n    });\n  }\n  removeDuplication(resultList);\n  return new SeriesDataSchema({\n    source: source,\n    dimensions: resultList,\n    fullDimensionCount: dimCount,\n    dimensionOmitted: omitUnusedDimensions\n  });\n}\nfunction removeDuplication(result) {\n  var duplicationMap = createHashMap();\n  for (var i = 0; i < result.length; i++) {\n    var dim = result[i];\n    var dimOriginalName = dim.name;\n    var count = duplicationMap.get(dimOriginalName) || 0;\n    if (count > 0) {\n      // Starts from 0.\n      dim.name = dimOriginalName + (count - 1);\n    }\n    count++;\n    duplicationMap.set(dimOriginalName, count);\n  }\n}\n// ??? TODO\n// Originally detect dimCount by data[0]. Should we\n// optimize it to only by sysDims and dimensions and encode.\n// So only necessary dims will be initialized.\n// But\n// (1) custom series should be considered. where other dims\n// may be visited.\n// (2) sometimes user need to calculate bubble size or use visualMap\n// on other dimensions besides coordSys needed.\n// So, dims that is not used by system, should be shared in data store?\nfunction getDimCount(source, sysDims, dimsDef, optDimCount) {\n  // Note that the result dimCount should not small than columns count\n  // of data, otherwise `dataDimNameMap` checking will be incorrect.\n  var dimCount = Math.max(source.dimensionsDetectedCount || 1, sysDims.length, dimsDef.length, optDimCount || 0);\n  each(sysDims, function (sysDimItem) {\n    var sysDimItemDimsDef;\n    if (isObject(sysDimItem) && (sysDimItemDimsDef = sysDimItem.dimsDef)) {\n      dimCount = Math.max(dimCount, sysDimItemDimsDef.length);\n    }\n  });\n  return dimCount;\n}\nfunction genCoordDimName(name, map, fromZero) {\n  if (fromZero || map.hasKey(name)) {\n    var i = 0;\n    while (map.hasKey(name + i)) {\n      i++;\n    }\n    name += i;\n  }\n  map.set(name, true);\n  return name;\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n/**\n * Helper for model references.\n * There are many manners to refer axis/coordSys.\n */\n// TODO\n// merge relevant logic to this file?\n// check: \"modelHelper\" of tooltip and \"BrushTargetManager\".\nimport { createHashMap, retrieve, each } from 'zrender/lib/core/util.js';\nimport { SINGLE_REFERRING } from '../util/model.js';\n/**\n * @class\n * For example:\n * {\n *     coordSysName: 'cartesian2d',\n *     coordSysDims: ['x', 'y', ...],\n *     axisMap: HashMap({\n *         x: xAxisModel,\n *         y: yAxisModel\n *     }),\n *     categoryAxisMap: HashMap({\n *         x: xAxisModel,\n *         y: undefined\n *     }),\n *     // The index of the first category axis in `coordSysDims`.\n *     // `null/undefined` means no category axis exists.\n *     firstCategoryDimIndex: 1,\n *     // To replace user specified encode.\n * }\n */\nvar CoordSysInfo = /** @class */function () {\n  function CoordSysInfo(coordSysName) {\n    this.coordSysDims = [];\n    this.axisMap = createHashMap();\n    this.categoryAxisMap = createHashMap();\n    this.coordSysName = coordSysName;\n  }\n  return CoordSysInfo;\n}();\nexport function getCoordSysInfoBySeries(seriesModel) {\n  var coordSysName = seriesModel.get('coordinateSystem');\n  var result = new CoordSysInfo(coordSysName);\n  var fetch = fetchers[coordSysName];\n  if (fetch) {\n    fetch(seriesModel, result, result.axisMap, result.categoryAxisMap);\n    return result;\n  }\n}\n// TODO: refactor them to static member of each coord sys, rather than hard code here.\nvar fetchers = {\n  cartesian2d: function (seriesModel, result, axisMap, categoryAxisMap) {\n    var xAxisModel = seriesModel.getReferringComponents('xAxis', SINGLE_REFERRING).models[0];\n    var yAxisModel = seriesModel.getReferringComponents('yAxis', SINGLE_REFERRING).models[0];\n    if (process.env.NODE_ENV !== 'production') {\n      if (!xAxisModel) {\n        throw new Error('xAxis \"' + retrieve(seriesModel.get('xAxisIndex'), seriesModel.get('xAxisId'), 0) + '\" not found');\n      }\n      if (!yAxisModel) {\n        throw new Error('yAxis \"' + retrieve(seriesModel.get('xAxisIndex'), seriesModel.get('yAxisId'), 0) + '\" not found');\n      }\n    }\n    result.coordSysDims = ['x', 'y'];\n    axisMap.set('x', xAxisModel);\n    axisMap.set('y', yAxisModel);\n    if (isCategory(xAxisModel)) {\n      categoryAxisMap.set('x', xAxisModel);\n      result.firstCategoryDimIndex = 0;\n    }\n    if (isCategory(yAxisModel)) {\n      categoryAxisMap.set('y', yAxisModel);\n      result.firstCategoryDimIndex == null && (result.firstCategoryDimIndex = 1);\n    }\n  },\n  singleAxis: function (seriesModel, result, axisMap, categoryAxisMap) {\n    var singleAxisModel = seriesModel.getReferringComponents('singleAxis', SINGLE_REFERRING).models[0];\n    if (process.env.NODE_ENV !== 'production') {\n      if (!singleAxisModel) {\n        throw new Error('singleAxis should be specified.');\n      }\n    }\n    result.coordSysDims = ['single'];\n    axisMap.set('single', singleAxisModel);\n    if (isCategory(singleAxisModel)) {\n      categoryAxisMap.set('single', singleAxisModel);\n      result.firstCategoryDimIndex = 0;\n    }\n  },\n  polar: function (seriesModel, result, axisMap, categoryAxisMap) {\n    var polarModel = seriesModel.getReferringComponents('polar', SINGLE_REFERRING).models[0];\n    var radiusAxisModel = polarModel.findAxisModel('radiusAxis');\n    var angleAxisModel = polarModel.findAxisModel('angleAxis');\n    if (process.env.NODE_ENV !== 'production') {\n      if (!angleAxisModel) {\n        throw new Error('angleAxis option not found');\n      }\n      if (!radiusAxisModel) {\n        throw new Error('radiusAxis option not found');\n      }\n    }\n    result.coordSysDims = ['radius', 'angle'];\n    axisMap.set('radius', radiusAxisModel);\n    axisMap.set('angle', angleAxisModel);\n    if (isCategory(radiusAxisModel)) {\n      categoryAxisMap.set('radius', radiusAxisModel);\n      result.firstCategoryDimIndex = 0;\n    }\n    if (isCategory(angleAxisModel)) {\n      categoryAxisMap.set('angle', angleAxisModel);\n      result.firstCategoryDimIndex == null && (result.firstCategoryDimIndex = 1);\n    }\n  },\n  geo: function (seriesModel, result, axisMap, categoryAxisMap) {\n    result.coordSysDims = ['lng', 'lat'];\n  },\n  parallel: function (seriesModel, result, axisMap, categoryAxisMap) {\n    var ecModel = seriesModel.ecModel;\n    var parallelModel = ecModel.getComponent('parallel', seriesModel.get('parallelIndex'));\n    var coordSysDims = result.coordSysDims = parallelModel.dimensions.slice();\n    each(parallelModel.parallelAxisIndex, function (axisIndex, index) {\n      var axisModel = ecModel.getComponent('parallelAxis', axisIndex);\n      var axisDim = coordSysDims[index];\n      axisMap.set(axisDim, axisModel);\n      if (isCategory(axisModel)) {\n        categoryAxisMap.set(axisDim, axisModel);\n        if (result.firstCategoryDimIndex == null) {\n          result.firstCategoryDimIndex = index;\n        }\n      }\n    });\n  },\n  matrix: function (seriesModel, result, axisMap, categoryAxisMap) {\n    var matrixModel = seriesModel.getReferringComponents('matrix', SINGLE_REFERRING).models[0];\n    if (process.env.NODE_ENV !== 'production') {\n      if (!matrixModel) {\n        throw new Error('matrix coordinate system should be specified.');\n      }\n    }\n    result.coordSysDims = ['x', 'y'];\n    var xModel = matrixModel.getDimensionModel('x');\n    var yModel = matrixModel.getDimensionModel('y');\n    axisMap.set('x', xModel);\n    axisMap.set('y', yModel);\n    categoryAxisMap.set('x', xModel);\n    categoryAxisMap.set('y', yModel);\n  }\n};\nfunction isCategory(axisModel) {\n  return axisModel.get('type') === 'category';\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { each, isString } from 'zrender/lib/core/util.js';\nimport { isSeriesDataSchema } from './SeriesDataSchema.js';\n/**\n * Note that it is too complicated to support 3d stack by value\n * (have to create two-dimension inverted index), so in 3d case\n * we just support that stacked by index.\n *\n * @param seriesModel\n * @param dimensionsInput The same as the input of <module:echarts/data/SeriesData>.\n *        The input will be modified.\n * @param opt\n * @param opt.stackedCoordDimension Specify a coord dimension if needed.\n * @param opt.byIndex=false\n * @return calculationInfo\n * {\n *     stackedDimension: string\n *     stackedByDimension: string\n *     isStackedByIndex: boolean\n *     stackedOverDimension: string\n *     stackResultDimension: string\n * }\n */\nexport function enableDataStack(seriesModel, dimensionsInput, opt) {\n  opt = opt || {};\n  var byIndex = opt.byIndex;\n  var stackedCoordDimension = opt.stackedCoordDimension;\n  var dimensionDefineList;\n  var schema;\n  var store;\n  if (isLegacyDimensionsInput(dimensionsInput)) {\n    dimensionDefineList = dimensionsInput;\n  } else {\n    schema = dimensionsInput.schema;\n    dimensionDefineList = schema.dimensions;\n    store = dimensionsInput.store;\n  }\n  // Compatibal: when `stack` is set as '', do not stack.\n  var mayStack = !!(seriesModel && seriesModel.get('stack'));\n  var stackedByDimInfo;\n  var stackedDimInfo;\n  var stackResultDimension;\n  var stackedOverDimension;\n  each(dimensionDefineList, function (dimensionInfo, index) {\n    if (isString(dimensionInfo)) {\n      dimensionDefineList[index] = dimensionInfo = {\n        name: dimensionInfo\n      };\n    }\n    if (mayStack && !dimensionInfo.isExtraCoord) {\n      // Find the first ordinal dimension as the stackedByDimInfo.\n      if (!byIndex && !stackedByDimInfo && dimensionInfo.ordinalMeta) {\n        stackedByDimInfo = dimensionInfo;\n      }\n      // Find the first stackable dimension as the stackedDimInfo.\n      if (!stackedDimInfo && dimensionInfo.type !== 'ordinal' && dimensionInfo.type !== 'time' && (!stackedCoordDimension || stackedCoordDimension === dimensionInfo.coordDim)) {\n        stackedDimInfo = dimensionInfo;\n      }\n    }\n  });\n  if (stackedDimInfo && !byIndex && !stackedByDimInfo) {\n    // Compatible with previous design, value axis (time axis) only stack by index.\n    // It may make sense if the user provides elaborately constructed data.\n    byIndex = true;\n  }\n  // Add stack dimension, they can be both calculated by coordinate system in `unionExtent`.\n  // That put stack logic in List is for using conveniently in echarts extensions, but it\n  // might not be a good way.\n  if (stackedDimInfo) {\n    // Use a weird name that not duplicated with other names.\n    // Also need to use seriesModel.id as postfix because different\n    // series may share same data store. The stack dimension needs to be distinguished.\n    stackResultDimension = '__\\0ecstackresult_' + seriesModel.id;\n    stackedOverDimension = '__\\0ecstackedover_' + seriesModel.id;\n    // Create inverted index to fast query index by value.\n    if (stackedByDimInfo) {\n      stackedByDimInfo.createInvertedIndices = true;\n    }\n    var stackedDimCoordDim_1 = stackedDimInfo.coordDim;\n    var stackedDimType = stackedDimInfo.type;\n    var stackedDimCoordIndex_1 = 0;\n    each(dimensionDefineList, function (dimensionInfo) {\n      if (dimensionInfo.coordDim === stackedDimCoordDim_1) {\n        stackedDimCoordIndex_1++;\n      }\n    });\n    var stackedOverDimensionDefine = {\n      name: stackResultDimension,\n      coordDim: stackedDimCoordDim_1,\n      coordDimIndex: stackedDimCoordIndex_1,\n      type: stackedDimType,\n      isExtraCoord: true,\n      isCalculationCoord: true,\n      storeDimIndex: dimensionDefineList.length\n    };\n    var stackResultDimensionDefine = {\n      name: stackedOverDimension,\n      // This dimension contains stack base (generally, 0), so do not set it as\n      // `stackedDimCoordDim` to avoid extent calculation, consider log scale.\n      coordDim: stackedOverDimension,\n      coordDimIndex: stackedDimCoordIndex_1 + 1,\n      type: stackedDimType,\n      isExtraCoord: true,\n      isCalculationCoord: true,\n      storeDimIndex: dimensionDefineList.length + 1\n    };\n    if (schema) {\n      if (store) {\n        stackedOverDimensionDefine.storeDimIndex = store.ensureCalculationDimension(stackedOverDimension, stackedDimType);\n        stackResultDimensionDefine.storeDimIndex = store.ensureCalculationDimension(stackResultDimension, stackedDimType);\n      }\n      schema.appendCalculationDimension(stackedOverDimensionDefine);\n      schema.appendCalculationDimension(stackResultDimensionDefine);\n    } else {\n      dimensionDefineList.push(stackedOverDimensionDefine);\n      dimensionDefineList.push(stackResultDimensionDefine);\n    }\n  }\n  return {\n    stackedDimension: stackedDimInfo && stackedDimInfo.name,\n    stackedByDimension: stackedByDimInfo && stackedByDimInfo.name,\n    isStackedByIndex: byIndex,\n    stackedOverDimension: stackedOverDimension,\n    stackResultDimension: stackResultDimension\n  };\n}\nfunction isLegacyDimensionsInput(dimensionsInput) {\n  return !isSeriesDataSchema(dimensionsInput.schema);\n}\nexport function isDimensionStacked(data, stackedDim) {\n  // Each single series only maps to one pair of axis. So we do not need to\n  // check stackByDim, whatever stacked by a dimension or stacked by index.\n  return !!stackedDim && stackedDim === data.getCalculationInfo('stackedDimension');\n}\nexport function getStackedDimension(data, targetDim) {\n  return isDimensionStacked(data, targetDim) ? data.getCalculationInfo('stackResultDimension') : targetDim;\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport SeriesData from '../../data/SeriesData.js';\nimport prepareSeriesDataSchema from '../../data/helper/createDimensions.js';\nimport { getDimensionTypeByAxis } from '../../data/helper/dimensionHelper.js';\nimport { getDataItemValue } from '../../util/model.js';\nimport CoordinateSystem from '../../core/CoordinateSystem.js';\nimport { getCoordSysInfoBySeries } from '../../model/referHelper.js';\nimport { createSourceFromSeriesDataOption } from '../../data/Source.js';\nimport { enableDataStack } from '../../data/helper/dataStackHelper.js';\nimport { makeSeriesEncodeForAxisCoordSys } from '../../data/helper/sourceHelper.js';\nimport { SOURCE_FORMAT_ORIGINAL } from '../../util/types.js';\nfunction getCoordSysDimDefs(seriesModel, coordSysInfo) {\n  var coordSysName = seriesModel.get('coordinateSystem');\n  var registeredCoordSys = CoordinateSystem.get(coordSysName);\n  var coordSysDimDefs;\n  if (coordSysInfo && coordSysInfo.coordSysDims) {\n    coordSysDimDefs = zrUtil.map(coordSysInfo.coordSysDims, function (dim) {\n      var dimInfo = {\n        name: dim\n      };\n      var axisModel = coordSysInfo.axisMap.get(dim);\n      if (axisModel) {\n        var axisType = axisModel.get('type');\n        dimInfo.type = getDimensionTypeByAxis(axisType);\n      }\n      return dimInfo;\n    });\n  }\n  if (!coordSysDimDefs) {\n    // Get dimensions from registered coordinate system\n    coordSysDimDefs = registeredCoordSys && (registeredCoordSys.getDimensionsInfo ? registeredCoordSys.getDimensionsInfo() : registeredCoordSys.dimensions.slice()) || ['x', 'y'];\n  }\n  return coordSysDimDefs;\n}\nfunction injectOrdinalMeta(dimInfoList, createInvertedIndices, coordSysInfo) {\n  var firstCategoryDimIndex;\n  var hasNameEncode;\n  coordSysInfo && zrUtil.each(dimInfoList, function (dimInfo, dimIndex) {\n    var coordDim = dimInfo.coordDim;\n    var categoryAxisModel = coordSysInfo.categoryAxisMap.get(coordDim);\n    if (categoryAxisModel) {\n      if (firstCategoryDimIndex == null) {\n        firstCategoryDimIndex = dimIndex;\n      }\n      dimInfo.ordinalMeta = categoryAxisModel.getOrdinalMeta();\n      if (createInvertedIndices) {\n        dimInfo.createInvertedIndices = true;\n      }\n    }\n    if (dimInfo.otherDims.itemName != null) {\n      hasNameEncode = true;\n    }\n  });\n  if (!hasNameEncode && firstCategoryDimIndex != null) {\n    dimInfoList[firstCategoryDimIndex].otherDims.itemName = 0;\n  }\n  return firstCategoryDimIndex;\n}\n/**\n * Caution: there are side effects to `sourceManager` in this method.\n * Should better only be called in `Series['getInitialData']`.\n */\nfunction createSeriesData(sourceRaw, seriesModel, opt) {\n  opt = opt || {};\n  var sourceManager = seriesModel.getSourceManager();\n  var source;\n  var isOriginalSource = false;\n  if (sourceRaw) {\n    isOriginalSource = true;\n    source = createSourceFromSeriesDataOption(sourceRaw);\n  } else {\n    source = sourceManager.getSource();\n    // Is series.data. not dataset.\n    isOriginalSource = source.sourceFormat === SOURCE_FORMAT_ORIGINAL;\n  }\n  var coordSysInfo = getCoordSysInfoBySeries(seriesModel);\n  var coordSysDimDefs = getCoordSysDimDefs(seriesModel, coordSysInfo);\n  var useEncodeDefaulter = opt.useEncodeDefaulter;\n  var encodeDefaulter = zrUtil.isFunction(useEncodeDefaulter) ? useEncodeDefaulter : useEncodeDefaulter ? zrUtil.curry(makeSeriesEncodeForAxisCoordSys, coordSysDimDefs, seriesModel) : null;\n  var createDimensionOptions = {\n    coordDimensions: coordSysDimDefs,\n    generateCoord: opt.generateCoord,\n    encodeDefine: seriesModel.getEncode(),\n    encodeDefaulter: encodeDefaulter,\n    canOmitUnusedDimensions: !isOriginalSource\n  };\n  var schema = prepareSeriesDataSchema(source, createDimensionOptions);\n  var firstCategoryDimIndex = injectOrdinalMeta(schema.dimensions, opt.createInvertedIndices, coordSysInfo);\n  var store = !isOriginalSource ? sourceManager.getSharedDataStore(schema) : null;\n  var stackCalculationInfo = enableDataStack(seriesModel, {\n    schema: schema,\n    store: store\n  });\n  var data = new SeriesData(schema, seriesModel);\n  data.setCalculationInfo(stackCalculationInfo);\n  var dimValueGetter = firstCategoryDimIndex != null && isNeedCompleteOrdinalData(source)\n  /**\n   * This serves this case:\n   *  var echarts_option = {\n   *      xAxis: { data: ['a', 'b', 'c'] },\n   *      yAxis: {}\n   *      series: { data: [555, 666, 777] }\n   *  };\n   * The `series.data` is completed to:\n   *  [[0, 555], [1, 666], [2, 777]]\n   */ ? function (itemOpt, dimName, dataIndex, dimIndex) {\n    // Use dataIndex as ordinal value in categoryAxis\n    return dimIndex === firstCategoryDimIndex ? dataIndex : this.defaultDimValueGetter(itemOpt, dimName, dataIndex, dimIndex);\n  } : null;\n  data.hasItemOption = false;\n  data.initData(\n  // Try to reuse the data store in sourceManager if using dataset.\n  isOriginalSource ? source : store, null, dimValueGetter);\n  return data;\n}\nfunction isNeedCompleteOrdinalData(source) {\n  if (source.sourceFormat === SOURCE_FORMAT_ORIGINAL) {\n    var sampleItem = firstDataNotNull(source.data || []);\n    return !zrUtil.isArray(getDataItemValue(sampleItem));\n  }\n}\nfunction firstDataNotNull(arr) {\n  var i = 0;\n  while (i < arr.length && arr[i] == null) {\n    i++;\n  }\n  return arr[i];\n}\nexport default createSeriesData;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { getPrecision, round, nice, quantityExponent } from '../util/number.js';\nimport { bind } from 'zrender/lib/core/util.js';\nexport function isValueNice(val) {\n  var exp10 = Math.pow(10, quantityExponent(Math.abs(val)));\n  var f = Math.abs(val / exp10);\n  return f === 0 || f === 1 || f === 2 || f === 3 || f === 5;\n}\nexport function isIntervalOrLogScale(scale) {\n  return scale.type === 'interval' || scale.type === 'log';\n}\n/**\n * @param extent Both extent[0] and extent[1] should be valid number.\n *               Should be extent[0] < extent[1].\n * @param splitNumber splitNumber should be >= 1.\n */\nexport function intervalScaleNiceTicks(extent, spanWithBreaks, splitNumber, minInterval, maxInterval) {\n  var result = {};\n  var interval = result.interval = nice(spanWithBreaks / splitNumber, true);\n  if (minInterval != null && interval < minInterval) {\n    interval = result.interval = minInterval;\n  }\n  if (maxInterval != null && interval > maxInterval) {\n    interval = result.interval = maxInterval;\n  }\n  // Tow more digital for tick.\n  var precision = result.intervalPrecision = getIntervalPrecision(interval);\n  // Niced extent inside original extent\n  var niceTickExtent = result.niceTickExtent = [round(Math.ceil(extent[0] / interval) * interval, precision), round(Math.floor(extent[1] / interval) * interval, precision)];\n  fixExtent(niceTickExtent, extent);\n  return result;\n}\nexport function increaseInterval(interval) {\n  var exp10 = Math.pow(10, quantityExponent(interval));\n  // Increase interval\n  var f = interval / exp10;\n  if (!f) {\n    f = 1;\n  } else if (f === 2) {\n    f = 3;\n  } else if (f === 3) {\n    f = 5;\n  } else {\n    // f is 1 or 5\n    f *= 2;\n  }\n  return round(f * exp10);\n}\n/**\n * @return interval precision\n */\nexport function getIntervalPrecision(interval) {\n  // Tow more digital for tick.\n  return getPrecision(interval) + 2;\n}\nfunction clamp(niceTickExtent, idx, extent) {\n  niceTickExtent[idx] = Math.max(Math.min(niceTickExtent[idx], extent[1]), extent[0]);\n}\n// In some cases (e.g., splitNumber is 1), niceTickExtent may be out of extent.\nexport function fixExtent(niceTickExtent, extent) {\n  !isFinite(niceTickExtent[0]) && (niceTickExtent[0] = extent[0]);\n  !isFinite(niceTickExtent[1]) && (niceTickExtent[1] = extent[1]);\n  clamp(niceTickExtent, 0, extent);\n  clamp(niceTickExtent, 1, extent);\n  if (niceTickExtent[0] > niceTickExtent[1]) {\n    niceTickExtent[0] = niceTickExtent[1];\n  }\n}\nexport function contain(val, extent) {\n  return val >= extent[0] && val <= extent[1];\n}\nvar ScaleCalculator = /** @class */function () {\n  function ScaleCalculator() {\n    this.normalize = normalize;\n    this.scale = scale;\n  }\n  ScaleCalculator.prototype.updateMethods = function (brkCtx) {\n    if (brkCtx.hasBreaks()) {\n      this.normalize = bind(brkCtx.normalize, brkCtx);\n      this.scale = bind(brkCtx.scale, brkCtx);\n    } else {\n      this.normalize = normalize;\n      this.scale = scale;\n    }\n  };\n  return ScaleCalculator;\n}();\nexport { ScaleCalculator };\nfunction normalize(val, extent) {\n  if (extent[1] === extent[0]) {\n    return 0.5;\n  }\n  return (val - extent[0]) / (extent[1] - extent[0]);\n}\nfunction scale(val, extent) {\n  return val * (extent[1] - extent[0]) + extent[0];\n}\nexport function logTransform(base, extent, noClampNegative) {\n  var loggedBase = Math.log(base);\n  return [\n  // log(negative) is NaN, so safe guard here.\n  // PENDING: But even getting a -Infinity still does not make sense in extent.\n  //  Just keep it as is, getting a NaN to make some previous cases works by coincidence.\n  Math.log(noClampNegative ? extent[0] : Math.max(0, extent[0])) / loggedBase, Math.log(noClampNegative ? extent[1] : Math.max(0, extent[1])) / loggedBase];\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as clazzUtil from '../util/clazz.js';\nimport { ScaleCalculator } from './helper.js';\nimport { bind } from 'zrender/lib/core/util.js';\nimport { getScaleBreakHelper } from './break.js';\nvar Scale = /** @class */function () {\n  function Scale(setting) {\n    this._calculator = new ScaleCalculator();\n    this._setting = setting || {};\n    this._extent = [Infinity, -Infinity];\n    var scaleBreakHelper = getScaleBreakHelper();\n    if (scaleBreakHelper) {\n      this._brkCtx = scaleBreakHelper.createScaleBreakContext();\n      this._brkCtx.update(this._extent);\n    }\n  }\n  Scale.prototype.getSetting = function (name) {\n    return this._setting[name];\n  };\n  /**\n   * [CAVEAT]: It should not be overridden!\n   */\n  Scale.prototype._innerUnionExtent = function (other) {\n    var extent = this._extent;\n    // Considered that number could be NaN and should not write into the extent.\n    this._innerSetExtent(other[0] < extent[0] ? other[0] : extent[0], other[1] > extent[1] ? other[1] : extent[1]);\n  };\n  /**\n   * Set extent from data\n   */\n  Scale.prototype.unionExtentFromData = function (data, dim) {\n    this._innerUnionExtent(data.getApproximateExtent(dim));\n  };\n  /**\n   * Get a new slice of extent.\n   * Extent is always in increase order.\n   */\n  Scale.prototype.getExtent = function () {\n    return this._extent.slice();\n  };\n  Scale.prototype.setExtent = function (start, end) {\n    this._innerSetExtent(start, end);\n  };\n  /**\n   * [CAVEAT]: It should not be overridden!\n   */\n  Scale.prototype._innerSetExtent = function (start, end) {\n    var thisExtent = this._extent;\n    if (!isNaN(start)) {\n      thisExtent[0] = start;\n    }\n    if (!isNaN(end)) {\n      thisExtent[1] = end;\n    }\n    this._brkCtx && this._brkCtx.update(thisExtent);\n  };\n  /**\n   * Prerequisite: Scale#parse is ready.\n   */\n  Scale.prototype.setBreaksFromOption = function (breakOptionList) {\n    var scaleBreakHelper = getScaleBreakHelper();\n    if (scaleBreakHelper) {\n      this._innerSetBreak(scaleBreakHelper.parseAxisBreakOption(breakOptionList, bind(this.parse, this)));\n    }\n  };\n  /**\n   * [CAVEAT]: It should not be overridden!\n   */\n  Scale.prototype._innerSetBreak = function (parsed) {\n    if (this._brkCtx) {\n      this._brkCtx.setBreaks(parsed);\n      this._calculator.updateMethods(this._brkCtx);\n      this._brkCtx.update(this._extent);\n    }\n  };\n  /**\n   * [CAVEAT]: It should not be overridden!\n   */\n  Scale.prototype._innerGetBreaks = function () {\n    return this._brkCtx ? this._brkCtx.breaks : [];\n  };\n  /**\n   * Do not expose the internal `_breaks` unless necessary.\n   */\n  Scale.prototype.hasBreaks = function () {\n    return this._brkCtx ? this._brkCtx.hasBreaks() : false;\n  };\n  Scale.prototype._getExtentSpanWithBreaks = function () {\n    return this._brkCtx && this._brkCtx.hasBreaks() ? this._brkCtx.getExtentSpan() : this._extent[1] - this._extent[0];\n  };\n  /**\n   * If value is in extent range\n   */\n  Scale.prototype.isInExtentRange = function (value) {\n    return this._extent[0] <= value && this._extent[1] >= value;\n  };\n  /**\n   * When axis extent depends on data and no data exists,\n   * axis ticks should not be drawn, which is named 'blank'.\n   */\n  Scale.prototype.isBlank = function () {\n    return this._isBlank;\n  };\n  /**\n   * When axis extent depends on data and no data exists,\n   * axis ticks should not be drawn, which is named 'blank'.\n   */\n  Scale.prototype.setBlank = function (isBlank) {\n    this._isBlank = isBlank;\n  };\n  return Scale;\n}();\nclazzUtil.enableClassManagement(Scale);\nexport default Scale;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { createHashMap, isObject, map, isString } from 'zrender/lib/core/util.js';\nvar uidBase = 0;\nvar OrdinalMeta = /** @class */function () {\n  /**\n   * PENDING - Regarding forcibly converting to string:\n   *  In the early days, the underlying hash map impl used JS plain object and converted the key to\n   *  string; later in https://github.com/ecomfe/zrender/pull/966 it was changed to a JS Map (in supported\n   *  platforms), which does not require string keys. But consider any input that `scale/Ordinal['parse']`\n   *  is involved, a number input represents an `OrdinalNumber` (i.e., an index), and affect the query\n   *  behavior:\n   *    - If forcbily converting to string:\n   *      pros: users can use numeric string (such as, '123') to query the raw data (123), tho it's probably\n   *      still confusing.\n   *      cons: NaN/null/undefined in data will be equals to 'NaN'/'null'/'undefined', if simply using\n   *      `val + ''` to convert them, like currently `getName` does.\n   *    - Otherwise:\n   *      pros: see NaN/null/undefined case above.\n   *      cons: users cannot query the raw data (123) any more.\n   *  There are two inconsistent behaviors in the current impl:\n   *    - Force conversion is applied on the case `xAxis{data: ['aaa', 'bbb', ...]}`,\n   *      but no conversion applied to the case `xAxis{data: [{value: 'aaa'}, ...]}` and\n   *      the case `dataset: {source: [['aaa', 123], ['bbb', 234], ...]}`.\n   *    - behaves differently according to whether JS Map is supported (the polyfill is simply using JS\n   *      plain object) (tho it seems rare platform that do not support it).\n   *  Since there's no sufficient good solution to offset cost of the breaking change, we preserve the\n   *  current behavior, until real issues is reported.\n   */\n  function OrdinalMeta(opt) {\n    this.categories = opt.categories || [];\n    this._needCollect = opt.needCollect;\n    this._deduplication = opt.deduplication;\n    this.uid = ++uidBase;\n    this._onCollect = opt.onCollect;\n  }\n  OrdinalMeta.createByAxisModel = function (axisModel) {\n    var option = axisModel.option;\n    var data = option.data;\n    var categories = data && map(data, getName);\n    return new OrdinalMeta({\n      categories: categories,\n      needCollect: !categories,\n      // deduplication is default in axis.\n      deduplication: option.dedplication !== false\n    });\n  };\n  ;\n  OrdinalMeta.prototype.getOrdinal = function (category) {\n    return this._getOrCreateMap().get(category);\n  };\n  /**\n   * @return The ordinal. If not found, return NaN.\n   */\n  OrdinalMeta.prototype.parseAndCollect = function (category) {\n    var index;\n    var needCollect = this._needCollect;\n    // The value of category dim can be the index of the given category set.\n    // This feature is only supported when !needCollect, because we should\n    // consider a common case: a value is 2017, which is a number but is\n    // expected to be tread as a category. This case usually happen in dataset,\n    // where it happent to be no need of the index feature.\n    if (!isString(category) && !needCollect) {\n      return category;\n    }\n    // Optimize for the scenario:\n    // category is ['2012-01-01', '2012-01-02', ...], where the input\n    // data has been ensured not duplicate and is large data.\n    // Notice, if a dataset dimension provide categroies, usually echarts\n    // should remove duplication except user tell echarts dont do that\n    // (set axis.deduplication = false), because echarts do not know whether\n    // the values in the category dimension has duplication (consider the\n    // parallel-aqi example)\n    if (needCollect && !this._deduplication) {\n      index = this.categories.length;\n      this.categories[index] = category;\n      this._onCollect && this._onCollect(category, index);\n      return index;\n    }\n    var map = this._getOrCreateMap();\n    index = map.get(category);\n    if (index == null) {\n      if (needCollect) {\n        index = this.categories.length;\n        this.categories[index] = category;\n        map.set(category, index);\n        this._onCollect && this._onCollect(category, index);\n      } else {\n        index = NaN;\n      }\n    }\n    return index;\n  };\n  // Consider big data, do not create map until needed.\n  OrdinalMeta.prototype._getOrCreateMap = function () {\n    return this._map || (this._map = createHashMap(this.categories));\n  };\n  return OrdinalMeta;\n}();\nfunction getName(obj) {\n  if (isObject(obj) && obj.value != null) {\n    return obj.value;\n  } else {\n    return obj + '';\n  }\n}\nexport default OrdinalMeta;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\n/**\n * Linear continuous scale\n * http://en.wikipedia.org/wiki/Level_of_measurement\n */\n// FIXME only one data\nimport Scale from './Scale.js';\nimport OrdinalMeta from '../data/OrdinalMeta.js';\nimport * as scaleHelper from './helper.js';\nimport { isArray, map, isObject, isString } from 'zrender/lib/core/util.js';\nvar OrdinalScale = /** @class */function (_super) {\n  __extends(OrdinalScale, _super);\n  function OrdinalScale(setting) {\n    var _this = _super.call(this, setting) || this;\n    _this.type = 'ordinal';\n    var ordinalMeta = _this.getSetting('ordinalMeta');\n    // Caution: Should not use instanceof, consider ec-extensions using\n    // import approach to get OrdinalMeta class.\n    if (!ordinalMeta) {\n      ordinalMeta = new OrdinalMeta({});\n    }\n    if (isArray(ordinalMeta)) {\n      ordinalMeta = new OrdinalMeta({\n        categories: map(ordinalMeta, function (item) {\n          return isObject(item) ? item.value : item;\n        })\n      });\n    }\n    _this._ordinalMeta = ordinalMeta;\n    _this._extent = _this.getSetting('extent') || [0, ordinalMeta.categories.length - 1];\n    return _this;\n  }\n  OrdinalScale.prototype.parse = function (val) {\n    // Caution: Math.round(null) will return `0` rather than `NaN`\n    if (val == null) {\n      return NaN;\n    }\n    return isString(val) ? this._ordinalMeta.getOrdinal(val)\n    // val might be float.\n    : Math.round(val);\n  };\n  OrdinalScale.prototype.contain = function (val) {\n    return scaleHelper.contain(val, this._extent) && val >= 0 && val < this._ordinalMeta.categories.length;\n  };\n  /**\n   * Normalize given rank or name to linear [0, 1]\n   * @param val raw ordinal number.\n   * @return normalized value in [0, 1].\n   */\n  OrdinalScale.prototype.normalize = function (val) {\n    val = this._getTickNumber(val);\n    return this._calculator.normalize(val, this._extent);\n  };\n  /**\n   * @param val normalized value in [0, 1].\n   * @return raw ordinal number.\n   */\n  OrdinalScale.prototype.scale = function (val) {\n    val = Math.round(this._calculator.scale(val, this._extent));\n    return this.getRawOrdinalNumber(val);\n  };\n  OrdinalScale.prototype.getTicks = function () {\n    var ticks = [];\n    var extent = this._extent;\n    var rank = extent[0];\n    while (rank <= extent[1]) {\n      ticks.push({\n        value: rank\n      });\n      rank++;\n    }\n    return ticks;\n  };\n  OrdinalScale.prototype.getMinorTicks = function (splitNumber) {\n    // Not support.\n    return;\n  };\n  /**\n   * @see `Ordinal['_ordinalNumbersByTick']`\n   */\n  OrdinalScale.prototype.setSortInfo = function (info) {\n    if (info == null) {\n      this._ordinalNumbersByTick = this._ticksByOrdinalNumber = null;\n      return;\n    }\n    var infoOrdinalNumbers = info.ordinalNumbers;\n    var ordinalsByTick = this._ordinalNumbersByTick = [];\n    var ticksByOrdinal = this._ticksByOrdinalNumber = [];\n    // Unnecessary support negative tick in `realtimeSort`.\n    var tickNum = 0;\n    var allCategoryLen = this._ordinalMeta.categories.length;\n    for (var len = Math.min(allCategoryLen, infoOrdinalNumbers.length); tickNum < len; ++tickNum) {\n      var ordinalNumber = infoOrdinalNumbers[tickNum];\n      ordinalsByTick[tickNum] = ordinalNumber;\n      ticksByOrdinal[ordinalNumber] = tickNum;\n    }\n    // Handle that `series.data` only covers part of the `axis.category.data`.\n    var unusedOrdinal = 0;\n    for (; tickNum < allCategoryLen; ++tickNum) {\n      while (ticksByOrdinal[unusedOrdinal] != null) {\n        unusedOrdinal++;\n      }\n      ;\n      ordinalsByTick.push(unusedOrdinal);\n      ticksByOrdinal[unusedOrdinal] = tickNum;\n    }\n  };\n  OrdinalScale.prototype._getTickNumber = function (ordinal) {\n    var ticksByOrdinalNumber = this._ticksByOrdinalNumber;\n    // also support ordinal out of range of `ordinalMeta.categories.length`,\n    // where ordinal numbers are used as tick value directly.\n    return ticksByOrdinalNumber && ordinal >= 0 && ordinal < ticksByOrdinalNumber.length ? ticksByOrdinalNumber[ordinal] : ordinal;\n  };\n  /**\n   * @usage\n   * ```js\n   * const ordinalNumber = ordinalScale.getRawOrdinalNumber(tickVal);\n   *\n   * // case0\n   * const rawOrdinalValue = axisModel.getCategories()[ordinalNumber];\n   * // case1\n   * const rawOrdinalValue = this._ordinalMeta.categories[ordinalNumber];\n   * // case2\n   * const coord = axis.dataToCoord(ordinalNumber);\n   * ```\n   *\n   * @param {OrdinalNumber} tickNumber index of display\n   */\n  OrdinalScale.prototype.getRawOrdinalNumber = function (tickNumber) {\n    var ordinalNumbersByTick = this._ordinalNumbersByTick;\n    // tickNumber may be out of range, e.g., when axis max is larger than `ordinalMeta.categories.length`.,\n    // where ordinal numbers are used as tick value directly.\n    return ordinalNumbersByTick && tickNumber >= 0 && tickNumber < ordinalNumbersByTick.length ? ordinalNumbersByTick[tickNumber] : tickNumber;\n  };\n  /**\n   * Get item on tick\n   */\n  OrdinalScale.prototype.getLabel = function (tick) {\n    if (!this.isBlank()) {\n      var ordinalNumber = this.getRawOrdinalNumber(tick.value);\n      var cateogry = this._ordinalMeta.categories[ordinalNumber];\n      // Note that if no data, ordinalMeta.categories is an empty array.\n      // Return empty if it's not exist.\n      return cateogry == null ? '' : cateogry + '';\n    }\n  };\n  OrdinalScale.prototype.count = function () {\n    return this._extent[1] - this._extent[0] + 1;\n  };\n  /**\n   * @override\n   * If value is in extent range\n   */\n  OrdinalScale.prototype.isInExtentRange = function (value) {\n    value = this._getTickNumber(value);\n    return this._extent[0] <= value && this._extent[1] >= value;\n  };\n  OrdinalScale.prototype.getOrdinalMeta = function () {\n    return this._ordinalMeta;\n  };\n  OrdinalScale.prototype.calcNiceTicks = function () {};\n  OrdinalScale.prototype.calcNiceExtent = function () {};\n  OrdinalScale.type = 'ordinal';\n  return OrdinalScale;\n}(Scale);\nScale.registerClass(OrdinalScale);\nexport default OrdinalScale;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as numberUtil from '../util/number.js';\nimport * as formatUtil from '../util/format.js';\nimport Scale from './Scale.js';\nimport * as helper from './helper.js';\nimport { getScaleBreakHelper } from './break.js';\nvar roundNumber = numberUtil.round;\nvar IntervalScale = /** @class */function (_super) {\n  __extends(IntervalScale, _super);\n  function IntervalScale() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = 'interval';\n    // Step is calculated in adjustExtent.\n    _this._interval = 0;\n    _this._intervalPrecision = 2;\n    return _this;\n  }\n  IntervalScale.prototype.parse = function (val) {\n    // `Scale#parse` (and its overrids) are typically applied at the axis values input\n    // in echarts option. e.g., `axis.min/max`, `dataZoom.min/max`, etc.\n    // but `series.data` is not included, which uses `dataValueHelper.ts`#`parseDataValue`.\n    // `Scale#parse` originally introduced in fb8c813215098b9d2458966229bb95c510883d5e\n    // at 2016 for dataZoom start/end settings (See `parseAxisModelMinMax`).\n    //\n    // Historically `scale/Interval.ts` returns the input value directly. But numeric\n    // values (such as a number-like string '123') effectively passed through here and\n    // were involved in calculations, which was error-prone and inconsistent with the\n    // declared TS return type. Previously such issues are fixed separately in different\n    // places case by case (such as #2475).\n    //\n    // Now, we perform actual parse to ensure its `number` type here. The parsing rule\n    // follows the series data parsing rule (`dataValueHelper.ts`#`parseDataValue`)\n    // and maintains compatibility as much as possible (thus a more strict parsing\n    // `number.ts`#`numericToNumber` is not used here.)\n    //\n    // FIXME: `ScaleDataValue` also need to be modified to include numeric string type,\n    //  since it effectively does.\n    return val == null || val === '' ? NaN\n    // If string (like '-'), using '+' parse to NaN\n    // If object, also parse to NaN\n    : Number(val);\n  };\n  IntervalScale.prototype.contain = function (val) {\n    return helper.contain(val, this._extent);\n  };\n  IntervalScale.prototype.normalize = function (val) {\n    return this._calculator.normalize(val, this._extent);\n  };\n  IntervalScale.prototype.scale = function (val) {\n    return this._calculator.scale(val, this._extent);\n  };\n  IntervalScale.prototype.getInterval = function () {\n    return this._interval;\n  };\n  IntervalScale.prototype.setInterval = function (interval) {\n    this._interval = interval;\n    // Dropped auto calculated niceExtent and use user-set extent.\n    // We assume user wants to set both interval, min, max to get a better result.\n    this._niceExtent = this._extent.slice();\n    this._intervalPrecision = helper.getIntervalPrecision(interval);\n  };\n  /**\n   * @override\n   */\n  IntervalScale.prototype.getTicks = function (opt) {\n    opt = opt || {};\n    var interval = this._interval;\n    var extent = this._extent;\n    var niceTickExtent = this._niceExtent;\n    var intervalPrecision = this._intervalPrecision;\n    var scaleBreakHelper = getScaleBreakHelper();\n    var ticks = [];\n    // If interval is 0, return [];\n    if (!interval) {\n      return ticks;\n    }\n    if (opt.breakTicks === 'only_break' && scaleBreakHelper) {\n      scaleBreakHelper.addBreaksToTicks(ticks, this._brkCtx.breaks, this._extent);\n      return ticks;\n    }\n    // Consider this case: using dataZoom toolbox, zoom and zoom.\n    var safeLimit = 10000;\n    if (extent[0] < niceTickExtent[0]) {\n      if (opt.expandToNicedExtent) {\n        ticks.push({\n          value: roundNumber(niceTickExtent[0] - interval, intervalPrecision)\n        });\n      } else {\n        ticks.push({\n          value: extent[0]\n        });\n      }\n    }\n    var estimateNiceMultiple = function (tickVal, targetTick) {\n      return Math.round((targetTick - tickVal) / interval);\n    };\n    var tick = niceTickExtent[0];\n    while (tick <= niceTickExtent[1]) {\n      ticks.push({\n        value: tick\n      });\n      // Avoid rounding error\n      tick = roundNumber(tick + interval, intervalPrecision);\n      if (this._brkCtx) {\n        var moreMultiple = this._brkCtx.calcNiceTickMultiple(tick, estimateNiceMultiple);\n        if (moreMultiple >= 0) {\n          tick = roundNumber(tick + moreMultiple * interval, intervalPrecision);\n        }\n      }\n      if (ticks.length > 0 && tick === ticks[ticks.length - 1].value) {\n        // Consider out of safe float point, e.g.,\n        // -3711126.9907707 + 2e-10 === -3711126.9907707\n        break;\n      }\n      if (ticks.length > safeLimit) {\n        return [];\n      }\n    }\n    // Consider this case: the last item of ticks is smaller\n    // than niceTickExtent[1] and niceTickExtent[1] === extent[1].\n    var lastNiceTick = ticks.length ? ticks[ticks.length - 1].value : niceTickExtent[1];\n    if (extent[1] > lastNiceTick) {\n      if (opt.expandToNicedExtent) {\n        ticks.push({\n          value: roundNumber(lastNiceTick + interval, intervalPrecision)\n        });\n      } else {\n        ticks.push({\n          value: extent[1]\n        });\n      }\n    }\n    if (scaleBreakHelper) {\n      scaleBreakHelper.pruneTicksByBreak(opt.pruneByBreak, ticks, this._brkCtx.breaks, function (item) {\n        return item.value;\n      }, this._interval, this._extent);\n    }\n    if (opt.breakTicks !== 'none' && scaleBreakHelper) {\n      scaleBreakHelper.addBreaksToTicks(ticks, this._brkCtx.breaks, this._extent);\n    }\n    return ticks;\n  };\n  IntervalScale.prototype.getMinorTicks = function (splitNumber) {\n    var ticks = this.getTicks({\n      expandToNicedExtent: true\n    });\n    // NOTE: In log-scale, do not support minor ticks when breaks exist.\n    //  because currently log-scale minor ticks is calculated based on raw values\n    //  rather than log-transformed value, due to an odd effect when breaks exist.\n    var minorTicks = [];\n    var extent = this.getExtent();\n    for (var i = 1; i < ticks.length; i++) {\n      var nextTick = ticks[i];\n      var prevTick = ticks[i - 1];\n      if (prevTick[\"break\"] || nextTick[\"break\"]) {\n        // Do not build minor ticks to the adjacent ticks to breaks ticks,\n        // since the interval might be irregular.\n        continue;\n      }\n      var count = 0;\n      var minorTicksGroup = [];\n      var interval = nextTick.value - prevTick.value;\n      var minorInterval = interval / splitNumber;\n      var minorIntervalPrecision = helper.getIntervalPrecision(minorInterval);\n      while (count < splitNumber - 1) {\n        var minorTick = roundNumber(prevTick.value + (count + 1) * minorInterval, minorIntervalPrecision);\n        // For the first and last interval. The count may be less than splitNumber.\n        if (minorTick > extent[0] && minorTick < extent[1]) {\n          minorTicksGroup.push(minorTick);\n        }\n        count++;\n      }\n      var scaleBreakHelper = getScaleBreakHelper();\n      scaleBreakHelper && scaleBreakHelper.pruneTicksByBreak('auto', minorTicksGroup, this._getNonTransBreaks(), function (value) {\n        return value;\n      }, this._interval, extent);\n      minorTicks.push(minorTicksGroup);\n    }\n    return minorTicks;\n  };\n  IntervalScale.prototype._getNonTransBreaks = function () {\n    return this._brkCtx ? this._brkCtx.breaks : [];\n  };\n  /**\n   * @param opt.precision If 'auto', use nice presision.\n   * @param opt.pad returns 1.50 but not 1.5 if precision is 2.\n   */\n  IntervalScale.prototype.getLabel = function (data, opt) {\n    if (data == null) {\n      return '';\n    }\n    var precision = opt && opt.precision;\n    if (precision == null) {\n      precision = numberUtil.getPrecision(data.value) || 0;\n    } else if (precision === 'auto') {\n      // Should be more precise then tick.\n      precision = this._intervalPrecision;\n    }\n    // (1) If `precision` is set, 12.005 should be display as '12.00500'.\n    // (2) Use roundNumber (toFixed) to avoid scientific notation like '3.5e-7'.\n    var dataNum = roundNumber(data.value, precision, true);\n    return formatUtil.addCommas(dataNum);\n  };\n  /**\n   * FIXME: refactor - disallow override, use composition instead.\n   *\n   * The override of `calcNiceTicks` should ensure these members are provided:\n   *  this._intervalPrecision\n   *  this._interval\n   *\n   * @param splitNumber By default `5`.\n   */\n  IntervalScale.prototype.calcNiceTicks = function (splitNumber, minInterval, maxInterval) {\n    splitNumber = splitNumber || 5;\n    var extent = this._extent.slice();\n    var span = this._getExtentSpanWithBreaks();\n    if (!isFinite(span)) {\n      return;\n    }\n    // User may set axis min 0 and data are all negative\n    // FIXME If it needs to reverse ?\n    if (span < 0) {\n      span = -span;\n      extent.reverse();\n      this._innerSetExtent(extent[0], extent[1]);\n      extent = this._extent.slice();\n    }\n    var result = helper.intervalScaleNiceTicks(extent, span, splitNumber, minInterval, maxInterval);\n    this._intervalPrecision = result.intervalPrecision;\n    this._interval = result.interval;\n    this._niceExtent = result.niceTickExtent;\n  };\n  IntervalScale.prototype.calcNiceExtent = function (opt) {\n    var extent = this._extent.slice();\n    // If extent start and end are same, expand them\n    if (extent[0] === extent[1]) {\n      if (extent[0] !== 0) {\n        // Expand extent\n        // Note that extents can be both negative. See #13154\n        var expandSize = Math.abs(extent[0]);\n        // In the fowllowing case\n        //      Axis has been fixed max 100\n        //      Plus data are all 100 and axis extent are [100, 100].\n        // Extend to the both side will cause expanded max is larger than fixed max.\n        // So only expand to the smaller side.\n        if (!opt.fixMax) {\n          extent[1] += expandSize / 2;\n          extent[0] -= expandSize / 2;\n        } else {\n          extent[0] -= expandSize / 2;\n        }\n      } else {\n        extent[1] = 1;\n      }\n    }\n    var span = extent[1] - extent[0];\n    // If there are no data and extent are [Infinity, -Infinity]\n    if (!isFinite(span)) {\n      extent[0] = 0;\n      extent[1] = 1;\n    }\n    this._innerSetExtent(extent[0], extent[1]);\n    extent = this._extent.slice();\n    this.calcNiceTicks(opt.splitNumber, opt.minInterval, opt.maxInterval);\n    var interval = this._interval;\n    var intervalPrecition = this._intervalPrecision;\n    if (!opt.fixMin) {\n      extent[0] = roundNumber(Math.floor(extent[0] / interval) * interval, intervalPrecition);\n    }\n    if (!opt.fixMax) {\n      extent[1] = roundNumber(Math.ceil(extent[1] / interval) * interval, intervalPrecition);\n    }\n    this._innerSetExtent(extent[0], extent[1]);\n  };\n  IntervalScale.prototype.setNiceExtent = function (min, max) {\n    this._niceExtent = [min, max];\n  };\n  IntervalScale.type = 'interval';\n  return IntervalScale;\n}(Scale);\nScale.registerClass(IntervalScale);\nexport default IntervalScale;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { isArray } from 'zrender/lib/core/util.js';\n/* global Float32Array */\nvar supportFloat32Array = typeof Float32Array !== 'undefined';\nvar Float32ArrayCtor = !supportFloat32Array ? Array : Float32Array;\nexport function createFloat32Array(arg) {\n  if (isArray(arg)) {\n    // Return self directly if don't support TypedArray.\n    return supportFloat32Array ? new Float32Array(arg) : arg;\n  }\n  // Else is number\n  return new Float32ArrayCtor(arg);\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { each, defaults, keys } from 'zrender/lib/core/util.js';\nimport { parsePercent } from '../util/number.js';\nimport { isDimensionStacked } from '../data/helper/dataStackHelper.js';\nimport createRenderPlanner from '../chart/helper/createRenderPlanner.js';\nimport { createFloat32Array } from '../util/vendor.js';\nvar STACK_PREFIX = '__ec_stack_';\nfunction getSeriesStackId(seriesModel) {\n  return seriesModel.get('stack') || STACK_PREFIX + seriesModel.seriesIndex;\n}\nfunction getAxisKey(axis) {\n  return axis.dim + axis.index;\n}\n/**\n * @return {Object} {width, offset, offsetCenter} If axis.type is not 'category', return undefined.\n */\nexport function getLayoutOnAxis(opt) {\n  var params = [];\n  var baseAxis = opt.axis;\n  var axisKey = 'axis0';\n  if (baseAxis.type !== 'category') {\n    return;\n  }\n  var bandWidth = baseAxis.getBandWidth();\n  for (var i = 0; i < opt.count || 0; i++) {\n    params.push(defaults({\n      bandWidth: bandWidth,\n      axisKey: axisKey,\n      stackId: STACK_PREFIX + i\n    }, opt));\n  }\n  var widthAndOffsets = doCalBarWidthAndOffset(params);\n  var result = [];\n  for (var i = 0; i < opt.count; i++) {\n    var item = widthAndOffsets[axisKey][STACK_PREFIX + i];\n    item.offsetCenter = item.offset + item.width / 2;\n    result.push(item);\n  }\n  return result;\n}\nexport function prepareLayoutBarSeries(seriesType, ecModel) {\n  var seriesModels = [];\n  ecModel.eachSeriesByType(seriesType, function (seriesModel) {\n    // Check series coordinate, do layout for cartesian2d only\n    if (isOnCartesian(seriesModel)) {\n      seriesModels.push(seriesModel);\n    }\n  });\n  return seriesModels;\n}\n/**\n * Map from (baseAxis.dim + '_' + baseAxis.index) to min gap of two adjacent\n * values.\n * This works for time axes, value axes, and log axes.\n * For a single time axis, return value is in the form like\n * {'x_0': [1000000]}.\n * The value of 1000000 is in milliseconds.\n */\nfunction getValueAxesMinGaps(barSeries) {\n  /**\n   * Map from axis.index to values.\n   * For a single time axis, axisValues is in the form like\n   * {'x_0': [1495555200000, 1495641600000, 1495728000000]}.\n   * Items in axisValues[x], e.g. 1495555200000, are time values of all\n   * series.\n   */\n  var axisValues = {};\n  each(barSeries, function (seriesModel) {\n    var cartesian = seriesModel.coordinateSystem;\n    var baseAxis = cartesian.getBaseAxis();\n    if (baseAxis.type !== 'time' && baseAxis.type !== 'value') {\n      return;\n    }\n    var data = seriesModel.getData();\n    var key = baseAxis.dim + '_' + baseAxis.index;\n    var dimIdx = data.getDimensionIndex(data.mapDimension(baseAxis.dim));\n    var store = data.getStore();\n    for (var i = 0, cnt = store.count(); i < cnt; ++i) {\n      var value = store.get(dimIdx, i);\n      if (!axisValues[key]) {\n        // No previous data for the axis\n        axisValues[key] = [value];\n      } else {\n        // No value in previous series\n        axisValues[key].push(value);\n      }\n      // Ignore duplicated time values in the same axis\n    }\n  });\n  var axisMinGaps = {};\n  for (var key in axisValues) {\n    if (axisValues.hasOwnProperty(key)) {\n      var valuesInAxis = axisValues[key];\n      if (valuesInAxis) {\n        // Sort axis values into ascending order to calculate gaps\n        valuesInAxis.sort(function (a, b) {\n          return a - b;\n        });\n        var min = null;\n        for (var j = 1; j < valuesInAxis.length; ++j) {\n          var delta = valuesInAxis[j] - valuesInAxis[j - 1];\n          if (delta > 0) {\n            // Ignore 0 delta because they are of the same axis value\n            min = min === null ? delta : Math.min(min, delta);\n          }\n        }\n        // Set to null if only have one data\n        axisMinGaps[key] = min;\n      }\n    }\n  }\n  return axisMinGaps;\n}\nexport function makeColumnLayout(barSeries) {\n  var axisMinGaps = getValueAxesMinGaps(barSeries);\n  var seriesInfoList = [];\n  each(barSeries, function (seriesModel) {\n    var cartesian = seriesModel.coordinateSystem;\n    var baseAxis = cartesian.getBaseAxis();\n    var axisExtent = baseAxis.getExtent();\n    var bandWidth;\n    if (baseAxis.type === 'category') {\n      bandWidth = baseAxis.getBandWidth();\n    } else if (baseAxis.type === 'value' || baseAxis.type === 'time') {\n      var key = baseAxis.dim + '_' + baseAxis.index;\n      var minGap = axisMinGaps[key];\n      var extentSpan = Math.abs(axisExtent[1] - axisExtent[0]);\n      var scale = baseAxis.scale.getExtent();\n      var scaleSpan = Math.abs(scale[1] - scale[0]);\n      bandWidth = minGap ? extentSpan / scaleSpan * minGap : extentSpan; // When there is only one data value\n    } else {\n      var data = seriesModel.getData();\n      bandWidth = Math.abs(axisExtent[1] - axisExtent[0]) / data.count();\n    }\n    var barWidth = parsePercent(seriesModel.get('barWidth'), bandWidth);\n    var barMaxWidth = parsePercent(seriesModel.get('barMaxWidth'), bandWidth);\n    var barMinWidth = parsePercent(\n    // barMinWidth by default is 0.5 / 1 in cartesian. Because in value axis,\n    // the auto-calculated bar width might be less than 0.5 / 1.\n    seriesModel.get('barMinWidth') || (isInLargeMode(seriesModel) ? 0.5 : 1), bandWidth);\n    var barGap = seriesModel.get('barGap');\n    var barCategoryGap = seriesModel.get('barCategoryGap');\n    var defaultBarGap = seriesModel.get('defaultBarGap');\n    seriesInfoList.push({\n      bandWidth: bandWidth,\n      barWidth: barWidth,\n      barMaxWidth: barMaxWidth,\n      barMinWidth: barMinWidth,\n      barGap: barGap,\n      barCategoryGap: barCategoryGap,\n      defaultBarGap: defaultBarGap,\n      axisKey: getAxisKey(baseAxis),\n      stackId: getSeriesStackId(seriesModel)\n    });\n  });\n  return doCalBarWidthAndOffset(seriesInfoList);\n}\nfunction doCalBarWidthAndOffset(seriesInfoList) {\n  // Columns info on each category axis. Key is cartesian name\n  var columnsMap = {};\n  each(seriesInfoList, function (seriesInfo, idx) {\n    var axisKey = seriesInfo.axisKey;\n    var bandWidth = seriesInfo.bandWidth;\n    var columnsOnAxis = columnsMap[axisKey] || {\n      bandWidth: bandWidth,\n      remainedWidth: bandWidth,\n      autoWidthCount: 0,\n      categoryGap: null,\n      gap: seriesInfo.defaultBarGap || 0,\n      stacks: {}\n    };\n    var stacks = columnsOnAxis.stacks;\n    columnsMap[axisKey] = columnsOnAxis;\n    var stackId = seriesInfo.stackId;\n    if (!stacks[stackId]) {\n      columnsOnAxis.autoWidthCount++;\n    }\n    stacks[stackId] = stacks[stackId] || {\n      width: 0,\n      maxWidth: 0\n    };\n    // Caution: In a single coordinate system, these barGrid attributes\n    // will be shared by series. Consider that they have default values,\n    // only the attributes set on the last series will work.\n    // Do not change this fact unless there will be a break change.\n    var barWidth = seriesInfo.barWidth;\n    if (barWidth && !stacks[stackId].width) {\n      // See #6312, do not restrict width.\n      stacks[stackId].width = barWidth;\n      barWidth = Math.min(columnsOnAxis.remainedWidth, barWidth);\n      columnsOnAxis.remainedWidth -= barWidth;\n    }\n    var barMaxWidth = seriesInfo.barMaxWidth;\n    barMaxWidth && (stacks[stackId].maxWidth = barMaxWidth);\n    var barMinWidth = seriesInfo.barMinWidth;\n    barMinWidth && (stacks[stackId].minWidth = barMinWidth);\n    var barGap = seriesInfo.barGap;\n    barGap != null && (columnsOnAxis.gap = barGap);\n    var barCategoryGap = seriesInfo.barCategoryGap;\n    barCategoryGap != null && (columnsOnAxis.categoryGap = barCategoryGap);\n  });\n  var result = {};\n  each(columnsMap, function (columnsOnAxis, coordSysName) {\n    result[coordSysName] = {};\n    var stacks = columnsOnAxis.stacks;\n    var bandWidth = columnsOnAxis.bandWidth;\n    var categoryGapPercent = columnsOnAxis.categoryGap;\n    if (categoryGapPercent == null) {\n      var columnCount = keys(stacks).length;\n      // More columns in one group\n      // the spaces between group is smaller. Or the column will be too thin.\n      categoryGapPercent = Math.max(35 - columnCount * 4, 15) + '%';\n    }\n    var categoryGap = parsePercent(categoryGapPercent, bandWidth);\n    var barGapPercent = parsePercent(columnsOnAxis.gap, 1);\n    var remainedWidth = columnsOnAxis.remainedWidth;\n    var autoWidthCount = columnsOnAxis.autoWidthCount;\n    var autoWidth = (remainedWidth - categoryGap) / (autoWidthCount + (autoWidthCount - 1) * barGapPercent);\n    autoWidth = Math.max(autoWidth, 0);\n    // Find if any auto calculated bar exceeded maxBarWidth\n    each(stacks, function (column) {\n      var maxWidth = column.maxWidth;\n      var minWidth = column.minWidth;\n      if (!column.width) {\n        var finalWidth = autoWidth;\n        if (maxWidth && maxWidth < finalWidth) {\n          finalWidth = Math.min(maxWidth, remainedWidth);\n        }\n        // `minWidth` has higher priority. `minWidth` decide that whether the\n        // bar is able to be visible. So `minWidth` should not be restricted\n        // by `maxWidth` or `remainedWidth` (which is from `bandWidth`). In\n        // the extreme cases for `value` axis, bars are allowed to overlap\n        // with each other if `minWidth` specified.\n        if (minWidth && minWidth > finalWidth) {\n          finalWidth = minWidth;\n        }\n        if (finalWidth !== autoWidth) {\n          column.width = finalWidth;\n          remainedWidth -= finalWidth + barGapPercent * finalWidth;\n          autoWidthCount--;\n        }\n      } else {\n        // `barMinWidth/barMaxWidth` has higher priority than `barWidth`, as\n        // CSS does. Because barWidth can be a percent value, where\n        // `barMaxWidth` can be used to restrict the final width.\n        var finalWidth = column.width;\n        if (maxWidth) {\n          finalWidth = Math.min(finalWidth, maxWidth);\n        }\n        // `minWidth` has higher priority, as described above\n        if (minWidth) {\n          finalWidth = Math.max(finalWidth, minWidth);\n        }\n        column.width = finalWidth;\n        remainedWidth -= finalWidth + barGapPercent * finalWidth;\n        autoWidthCount--;\n      }\n    });\n    // Recalculate width again\n    autoWidth = (remainedWidth - categoryGap) / (autoWidthCount + (autoWidthCount - 1) * barGapPercent);\n    autoWidth = Math.max(autoWidth, 0);\n    var widthSum = 0;\n    var lastColumn;\n    each(stacks, function (column, idx) {\n      if (!column.width) {\n        column.width = autoWidth;\n      }\n      lastColumn = column;\n      widthSum += column.width * (1 + barGapPercent);\n    });\n    if (lastColumn) {\n      widthSum -= lastColumn.width * barGapPercent;\n    }\n    var offset = -widthSum / 2;\n    each(stacks, function (column, stackId) {\n      result[coordSysName][stackId] = result[coordSysName][stackId] || {\n        bandWidth: bandWidth,\n        offset: offset,\n        width: column.width\n      };\n      offset += column.width * (1 + barGapPercent);\n    });\n  });\n  return result;\n}\nfunction retrieveColumnLayout(barWidthAndOffset, axis, seriesModel) {\n  if (barWidthAndOffset && axis) {\n    var result = barWidthAndOffset[getAxisKey(axis)];\n    if (result != null && seriesModel != null) {\n      return result[getSeriesStackId(seriesModel)];\n    }\n    return result;\n  }\n}\nexport { retrieveColumnLayout };\nexport function layout(seriesType, ecModel) {\n  var seriesModels = prepareLayoutBarSeries(seriesType, ecModel);\n  var barWidthAndOffset = makeColumnLayout(seriesModels);\n  each(seriesModels, function (seriesModel) {\n    var data = seriesModel.getData();\n    var cartesian = seriesModel.coordinateSystem;\n    var baseAxis = cartesian.getBaseAxis();\n    var stackId = getSeriesStackId(seriesModel);\n    var columnLayoutInfo = barWidthAndOffset[getAxisKey(baseAxis)][stackId];\n    var columnOffset = columnLayoutInfo.offset;\n    var columnWidth = columnLayoutInfo.width;\n    data.setLayout({\n      bandWidth: columnLayoutInfo.bandWidth,\n      offset: columnOffset,\n      size: columnWidth\n    });\n  });\n}\n// TODO: Do not support stack in large mode yet.\nexport function createProgressiveLayout(seriesType) {\n  return {\n    seriesType: seriesType,\n    plan: createRenderPlanner(),\n    reset: function (seriesModel) {\n      if (!isOnCartesian(seriesModel)) {\n        return;\n      }\n      var data = seriesModel.getData();\n      var cartesian = seriesModel.coordinateSystem;\n      var baseAxis = cartesian.getBaseAxis();\n      var valueAxis = cartesian.getOtherAxis(baseAxis);\n      var valueDimIdx = data.getDimensionIndex(data.mapDimension(valueAxis.dim));\n      var baseDimIdx = data.getDimensionIndex(data.mapDimension(baseAxis.dim));\n      var drawBackground = seriesModel.get('showBackground', true);\n      var valueDim = data.mapDimension(valueAxis.dim);\n      var stackResultDim = data.getCalculationInfo('stackResultDimension');\n      var stacked = isDimensionStacked(data, valueDim) && !!data.getCalculationInfo('stackedOnSeries');\n      var isValueAxisH = valueAxis.isHorizontal();\n      var valueAxisStart = getValueAxisStart(baseAxis, valueAxis);\n      var isLarge = isInLargeMode(seriesModel);\n      var barMinHeight = seriesModel.get('barMinHeight') || 0;\n      var stackedDimIdx = stackResultDim && data.getDimensionIndex(stackResultDim);\n      // Layout info.\n      var columnWidth = data.getLayout('size');\n      var columnOffset = data.getLayout('offset');\n      return {\n        progress: function (params, data) {\n          var count = params.count;\n          var largePoints = isLarge && createFloat32Array(count * 3);\n          var largeBackgroundPoints = isLarge && drawBackground && createFloat32Array(count * 3);\n          var largeDataIndices = isLarge && createFloat32Array(count);\n          var coordLayout = cartesian.master.getRect();\n          var bgSize = isValueAxisH ? coordLayout.width : coordLayout.height;\n          var dataIndex;\n          var store = data.getStore();\n          var idxOffset = 0;\n          while ((dataIndex = params.next()) != null) {\n            var value = store.get(stacked ? stackedDimIdx : valueDimIdx, dataIndex);\n            var baseValue = store.get(baseDimIdx, dataIndex);\n            var baseCoord = valueAxisStart;\n            var stackStartValue = void 0;\n            // Because of the barMinHeight, we can not use the value in\n            // stackResultDimension directly.\n            if (stacked) {\n              stackStartValue = +value - store.get(valueDimIdx, dataIndex);\n            }\n            var x = void 0;\n            var y = void 0;\n            var width = void 0;\n            var height = void 0;\n            if (isValueAxisH) {\n              var coord = cartesian.dataToPoint([value, baseValue]);\n              if (stacked) {\n                var startCoord = cartesian.dataToPoint([stackStartValue, baseValue]);\n                baseCoord = startCoord[0];\n              }\n              x = baseCoord;\n              y = coord[1] + columnOffset;\n              width = coord[0] - baseCoord;\n              height = columnWidth;\n              if (Math.abs(width) < barMinHeight) {\n                width = (width < 0 ? -1 : 1) * barMinHeight;\n              }\n            } else {\n              var coord = cartesian.dataToPoint([baseValue, value]);\n              if (stacked) {\n                var startCoord = cartesian.dataToPoint([baseValue, stackStartValue]);\n                baseCoord = startCoord[1];\n              }\n              x = coord[0] + columnOffset;\n              y = baseCoord;\n              width = columnWidth;\n              height = coord[1] - baseCoord;\n              if (Math.abs(height) < barMinHeight) {\n                // Include zero to has a positive bar\n                height = (height <= 0 ? -1 : 1) * barMinHeight;\n              }\n            }\n            if (!isLarge) {\n              data.setItemLayout(dataIndex, {\n                x: x,\n                y: y,\n                width: width,\n                height: height\n              });\n            } else {\n              largePoints[idxOffset] = x;\n              largePoints[idxOffset + 1] = y;\n              largePoints[idxOffset + 2] = isValueAxisH ? width : height;\n              if (largeBackgroundPoints) {\n                largeBackgroundPoints[idxOffset] = isValueAxisH ? coordLayout.x : x;\n                largeBackgroundPoints[idxOffset + 1] = isValueAxisH ? y : coordLayout.y;\n                largeBackgroundPoints[idxOffset + 2] = bgSize;\n              }\n              largeDataIndices[dataIndex] = dataIndex;\n            }\n            idxOffset += 3;\n          }\n          if (isLarge) {\n            data.setLayout({\n              largePoints: largePoints,\n              largeDataIndices: largeDataIndices,\n              largeBackgroundPoints: largeBackgroundPoints,\n              valueAxisHorizontal: isValueAxisH\n            });\n          }\n        }\n      };\n    }\n  };\n}\nfunction isOnCartesian(seriesModel) {\n  return seriesModel.coordinateSystem && seriesModel.coordinateSystem.type === 'cartesian2d';\n}\nfunction isInLargeMode(seriesModel) {\n  return seriesModel.pipelineContext && seriesModel.pipelineContext.large;\n}\n// See cases in `test/bar-start.html` and `#7412`, `#8747`.\nfunction getValueAxisStart(baseAxis, valueAxis) {\n  var startValue = valueAxis.model.get('startValue');\n  if (!startValue) {\n    startValue = 0;\n  }\n  return valueAxis.toGlobalCoord(valueAxis.dataToCoord(valueAxis.type === 'log' ? startValue > 0 ? startValue : 1 : startValue));\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\n/*\n* A third-party license is embedded for some of the code in this file:\n* The \"scaleLevels\" was originally copied from \"d3.js\" with some\n* modifications made for this project.\n* (See more details in the comment on the definition of \"scaleLevels\" below.)\n* The use of the source code of this file is also subject to the terms\n* and consitions of the license of \"d3.js\" (BSD-3Clause, see\n* </licenses/LICENSE-d3>).\n*/\n// [About UTC and local time zone]:\n// In most cases, `number.parseDate` will treat input data string as local time\n// (except time zone is specified in time string). And `format.formateTime` returns\n// local time by default. option.useUTC is false by default. This design has\n// considered these common cases:\n// (1) Time that is persistent in server is in UTC, but it is needed to be displayed\n// in local time by default.\n// (2) By default, the input data string (e.g., '2011-01-02') should be displayed\n// as its original time, without any time difference.\nimport * as numberUtil from '../util/number.js';\nimport { ONE_SECOND, ONE_MINUTE, ONE_HOUR, ONE_DAY, ONE_YEAR, format, leveledFormat, timeUnits, fullLeveledFormatter, getPrimaryTimeUnit, isPrimaryTimeUnit, getDefaultFormatPrecisionOfInterval, fullYearGetterName, monthSetterName, fullYearSetterName, dateSetterName, hoursGetterName, hoursSetterName, minutesSetterName, secondsSetterName, millisecondsSetterName, monthGetterName, dateGetterName, minutesGetterName, secondsGetterName, millisecondsGetterName, getUnitFromValue, primaryTimeUnits, roundTime } from '../util/time.js';\nimport * as scaleHelper from './helper.js';\nimport IntervalScale from './Interval.js';\nimport Scale from './Scale.js';\nimport { warn } from '../util/log.js';\nimport { each, filter, indexOf, isNumber, map } from 'zrender/lib/core/util.js';\nimport { getScaleBreakHelper } from './break.js';\n// FIXME \u516C\u7528\uFF1F\nvar bisect = function (a, x, lo, hi) {\n  while (lo < hi) {\n    var mid = lo + hi >>> 1;\n    if (a[mid][1] < x) {\n      lo = mid + 1;\n    } else {\n      hi = mid;\n    }\n  }\n  return lo;\n};\nvar TimeScale = /** @class */function (_super) {\n  __extends(TimeScale, _super);\n  function TimeScale(settings) {\n    var _this = _super.call(this, settings) || this;\n    _this.type = 'time';\n    return _this;\n  }\n  /**\n   * Get label is mainly for other components like dataZoom, tooltip.\n   */\n  TimeScale.prototype.getLabel = function (tick) {\n    var useUTC = this.getSetting('useUTC');\n    return format(tick.value, fullLeveledFormatter[getDefaultFormatPrecisionOfInterval(getPrimaryTimeUnit(this._minLevelUnit))] || fullLeveledFormatter.second, useUTC, this.getSetting('locale'));\n  };\n  TimeScale.prototype.getFormattedLabel = function (tick, idx, labelFormatter) {\n    var isUTC = this.getSetting('useUTC');\n    var lang = this.getSetting('locale');\n    return leveledFormat(tick, idx, labelFormatter, lang, isUTC);\n  };\n  /**\n   * @override\n   */\n  TimeScale.prototype.getTicks = function (opt) {\n    opt = opt || {};\n    var interval = this._interval;\n    var extent = this._extent;\n    var scaleBreakHelper = getScaleBreakHelper();\n    var ticks = [];\n    // If interval is 0, return [];\n    if (!interval) {\n      return ticks;\n    }\n    var useUTC = this.getSetting('useUTC');\n    if (scaleBreakHelper && opt.breakTicks === 'only_break') {\n      getScaleBreakHelper().addBreaksToTicks(ticks, this._brkCtx.breaks, this._extent);\n      return ticks;\n    }\n    var extent0Unit = getUnitFromValue(extent[1], useUTC);\n    ticks.push({\n      value: extent[0],\n      time: {\n        level: 0,\n        upperTimeUnit: extent0Unit,\n        lowerTimeUnit: extent0Unit\n      }\n    });\n    var innerTicks = getIntervalTicks(this._minLevelUnit, this._approxInterval, useUTC, extent, this._getExtentSpanWithBreaks(), this._brkCtx);\n    ticks = ticks.concat(innerTicks);\n    var extent1Unit = getUnitFromValue(extent[1], useUTC);\n    ticks.push({\n      value: extent[1],\n      time: {\n        level: 0,\n        upperTimeUnit: extent1Unit,\n        lowerTimeUnit: extent1Unit\n      }\n    });\n    var isUTC = this.getSetting('useUTC');\n    var upperUnitIndex = primaryTimeUnits.length - 1;\n    var maxLevel = 0;\n    each(ticks, function (tick) {\n      upperUnitIndex = Math.min(upperUnitIndex, indexOf(primaryTimeUnits, tick.time.upperTimeUnit));\n      maxLevel = Math.max(maxLevel, tick.time.level);\n    });\n    if (scaleBreakHelper) {\n      getScaleBreakHelper().pruneTicksByBreak(opt.pruneByBreak, ticks, this._brkCtx.breaks, function (item) {\n        return item.value;\n      }, this._approxInterval, this._extent);\n    }\n    if (scaleBreakHelper && opt.breakTicks !== 'none') {\n      getScaleBreakHelper().addBreaksToTicks(ticks, this._brkCtx.breaks, this._extent, function (trimmedBrk) {\n        // @see `parseTimeAxisLabelFormatterDictionary`.\n        var lowerBrkUnitIndex = Math.max(indexOf(primaryTimeUnits, getUnitFromValue(trimmedBrk.vmin, isUTC)), indexOf(primaryTimeUnits, getUnitFromValue(trimmedBrk.vmax, isUTC)));\n        var upperBrkUnitIndex = 0;\n        for (var unitIdx = 0; unitIdx < primaryTimeUnits.length; unitIdx++) {\n          if (!isPrimaryUnitValueAndGreaterSame(primaryTimeUnits[unitIdx], trimmedBrk.vmin, trimmedBrk.vmax, isUTC)) {\n            upperBrkUnitIndex = unitIdx;\n            break;\n          }\n        }\n        var upperIdx = Math.min(upperBrkUnitIndex, upperUnitIndex);\n        var lowerIdx = Math.max(upperIdx, lowerBrkUnitIndex);\n        return {\n          level: maxLevel,\n          lowerTimeUnit: primaryTimeUnits[lowerIdx],\n          upperTimeUnit: primaryTimeUnits[upperIdx]\n        };\n      });\n    }\n    return ticks;\n  };\n  TimeScale.prototype.calcNiceExtent = function (opt) {\n    var extent = this.getExtent();\n    // If extent start and end are same, expand them\n    if (extent[0] === extent[1]) {\n      // Expand extent\n      extent[0] -= ONE_DAY;\n      extent[1] += ONE_DAY;\n    }\n    // If there are no data and extent are [Infinity, -Infinity]\n    if (extent[1] === -Infinity && extent[0] === Infinity) {\n      var d = new Date();\n      extent[1] = +new Date(d.getFullYear(), d.getMonth(), d.getDate());\n      extent[0] = extent[1] - ONE_DAY;\n    }\n    this._innerSetExtent(extent[0], extent[1]);\n    this.calcNiceTicks(opt.splitNumber, opt.minInterval, opt.maxInterval);\n  };\n  TimeScale.prototype.calcNiceTicks = function (approxTickNum, minInterval, maxInterval) {\n    approxTickNum = approxTickNum || 10;\n    var span = this._getExtentSpanWithBreaks();\n    this._approxInterval = span / approxTickNum;\n    if (minInterval != null && this._approxInterval < minInterval) {\n      this._approxInterval = minInterval;\n    }\n    if (maxInterval != null && this._approxInterval > maxInterval) {\n      this._approxInterval = maxInterval;\n    }\n    var scaleIntervalsLen = scaleIntervals.length;\n    var idx = Math.min(bisect(scaleIntervals, this._approxInterval, 0, scaleIntervalsLen), scaleIntervalsLen - 1);\n    // Interval that can be used to calculate ticks\n    this._interval = scaleIntervals[idx][1];\n    this._intervalPrecision = scaleHelper.getIntervalPrecision(this._interval);\n    // Min level used when picking ticks from top down.\n    // We check one more level to avoid the ticks are to sparse in some case.\n    this._minLevelUnit = scaleIntervals[Math.max(idx - 1, 0)][0];\n  };\n  TimeScale.prototype.parse = function (val) {\n    // val might be float.\n    return isNumber(val) ? val : +numberUtil.parseDate(val);\n  };\n  TimeScale.prototype.contain = function (val) {\n    return scaleHelper.contain(val, this._extent);\n  };\n  TimeScale.prototype.normalize = function (val) {\n    return this._calculator.normalize(val, this._extent);\n  };\n  TimeScale.prototype.scale = function (val) {\n    return this._calculator.scale(val, this._extent);\n  };\n  TimeScale.type = 'time';\n  return TimeScale;\n}(IntervalScale);\n/**\n * This implementation was originally copied from \"d3.js\"\n * <https://github.com/d3/d3/blob/b516d77fb8566b576088e73410437494717ada26/src/time/scale.js>\n * with some modifications made for this program.\n * See the license statement at the head of this file.\n */\nvar scaleIntervals = [\n// Format                           interval\n['second', ONE_SECOND], ['minute', ONE_MINUTE], ['hour', ONE_HOUR], ['quarter-day', ONE_HOUR * 6], ['half-day', ONE_HOUR * 12], ['day', ONE_DAY * 1.2], ['half-week', ONE_DAY * 3.5], ['week', ONE_DAY * 7], ['month', ONE_DAY * 31], ['quarter', ONE_DAY * 95], ['half-year', ONE_YEAR / 2], ['year', ONE_YEAR] // 1Y\n];\nfunction isPrimaryUnitValueAndGreaterSame(unit, valueA, valueB, isUTC) {\n  return roundTime(new Date(valueA), unit, isUTC).getTime() === roundTime(new Date(valueB), unit, isUTC).getTime();\n}\n// function isUnitValueSame(\n//     unit: PrimaryTimeUnit,\n//     valueA: number,\n//     valueB: number,\n//     isUTC: boolean\n// ): boolean {\n//     const dateA = numberUtil.parseDate(valueA) as any;\n//     const dateB = numberUtil.parseDate(valueB) as any;\n//     const isSame = (unit: PrimaryTimeUnit) => {\n//         return getUnitValue(dateA, unit, isUTC)\n//             === getUnitValue(dateB, unit, isUTC);\n//     };\n//     const isSameYear = () => isSame('year');\n//     // const isSameHalfYear = () => isSameYear() && isSame('half-year');\n//     // const isSameQuater = () => isSameYear() && isSame('quarter');\n//     const isSameMonth = () => isSameYear() && isSame('month');\n//     const isSameDay = () => isSameMonth() && isSame('day');\n//     // const isSameHalfDay = () => isSameDay() && isSame('half-day');\n//     const isSameHour = () => isSameDay() && isSame('hour');\n//     const isSameMinute = () => isSameHour() && isSame('minute');\n//     const isSameSecond = () => isSameMinute() && isSame('second');\n//     const isSameMilliSecond = () => isSameSecond() && isSame('millisecond');\n//     switch (unit) {\n//         case 'year':\n//             return isSameYear();\n//         case 'month':\n//             return isSameMonth();\n//         case 'day':\n//             return isSameDay();\n//         case 'hour':\n//             return isSameHour();\n//         case 'minute':\n//             return isSameMinute();\n//         case 'second':\n//             return isSameSecond();\n//         case 'millisecond':\n//             return isSameMilliSecond();\n//     }\n// }\n// const primaryUnitGetters = {\n//     year: fullYearGetterName(),\n//     month: monthGetterName(),\n//     day: dateGetterName(),\n//     hour: hoursGetterName(),\n//     minute: minutesGetterName(),\n//     second: secondsGetterName(),\n//     millisecond: millisecondsGetterName()\n// };\n// const primaryUnitUTCGetters = {\n//     year: fullYearGetterName(true),\n//     month: monthGetterName(true),\n//     day: dateGetterName(true),\n//     hour: hoursGetterName(true),\n//     minute: minutesGetterName(true),\n//     second: secondsGetterName(true),\n//     millisecond: millisecondsGetterName(true)\n// };\n// function moveTick(date: Date, unitName: TimeUnit, step: number, isUTC: boolean) {\n//     step = step || 1;\n//     switch (getPrimaryTimeUnit(unitName)) {\n//         case 'year':\n//             date[fullYearSetterName(isUTC)](date[fullYearGetterName(isUTC)]() + step);\n//             break;\n//         case 'month':\n//             date[monthSetterName(isUTC)](date[monthGetterName(isUTC)]() + step);\n//             break;\n//         case 'day':\n//             date[dateSetterName(isUTC)](date[dateGetterName(isUTC)]() + step);\n//             break;\n//         case 'hour':\n//             date[hoursSetterName(isUTC)](date[hoursGetterName(isUTC)]() + step);\n//             break;\n//         case 'minute':\n//             date[minutesSetterName(isUTC)](date[minutesGetterName(isUTC)]() + step);\n//             break;\n//         case 'second':\n//             date[secondsSetterName(isUTC)](date[secondsGetterName(isUTC)]() + step);\n//             break;\n//         case 'millisecond':\n//             date[millisecondsSetterName(isUTC)](date[millisecondsGetterName(isUTC)]() + step);\n//             break;\n//     }\n//     return date.getTime();\n// }\n// const DATE_INTERVALS = [[8, 7.5], [4, 3.5], [2, 1.5]];\n// const MONTH_INTERVALS = [[6, 5.5], [3, 2.5], [2, 1.5]];\n// const MINUTES_SECONDS_INTERVALS = [[30, 30], [20, 20], [15, 15], [10, 10], [5, 5], [2, 2]];\nfunction getDateInterval(approxInterval, daysInMonth) {\n  approxInterval /= ONE_DAY;\n  return approxInterval > 16 ? 16\n  // Math.floor(daysInMonth / 2) + 1  // In this case we only want one tick between two months.\n  : approxInterval > 7.5 ? 7 // TODO week 7 or day 8?\n  : approxInterval > 3.5 ? 4 : approxInterval > 1.5 ? 2 : 1;\n}\nfunction getMonthInterval(approxInterval) {\n  var APPROX_ONE_MONTH = 30 * ONE_DAY;\n  approxInterval /= APPROX_ONE_MONTH;\n  return approxInterval > 6 ? 6 : approxInterval > 3 ? 3 : approxInterval > 2 ? 2 : 1;\n}\nfunction getHourInterval(approxInterval) {\n  approxInterval /= ONE_HOUR;\n  return approxInterval > 12 ? 12 : approxInterval > 6 ? 6 : approxInterval > 3.5 ? 4 : approxInterval > 2 ? 2 : 1;\n}\nfunction getMinutesAndSecondsInterval(approxInterval, isMinutes) {\n  approxInterval /= isMinutes ? ONE_MINUTE : ONE_SECOND;\n  return approxInterval > 30 ? 30 : approxInterval > 20 ? 20 : approxInterval > 15 ? 15 : approxInterval > 10 ? 10 : approxInterval > 5 ? 5 : approxInterval > 2 ? 2 : 1;\n}\nfunction getMillisecondsInterval(approxInterval) {\n  return numberUtil.nice(approxInterval, true);\n}\n// e.g., if the input unit is 'day', start calculate ticks from the first day of\n// that month to make ticks \"nice\".\nfunction getFirstTimestampOfUnit(timestamp, unitName, isUTC) {\n  var upperUnitIdx = Math.max(0, indexOf(primaryTimeUnits, unitName) - 1);\n  return roundTime(new Date(timestamp), primaryTimeUnits[upperUnitIdx], isUTC).getTime();\n}\nfunction createEstimateNiceMultiple(setMethodName, dateMethodInterval) {\n  var tmpDate = new Date(0);\n  tmpDate[setMethodName](1);\n  var tmpTime = tmpDate.getTime();\n  tmpDate[setMethodName](1 + dateMethodInterval);\n  var approxTimeInterval = tmpDate.getTime() - tmpTime;\n  return function (tickVal, targetValue) {\n    // Only in month that accurate result can not get by division of\n    // timestamp interval, but no need accurate here.\n    return Math.max(0, Math.round((targetValue - tickVal) / approxTimeInterval));\n  };\n}\nfunction getIntervalTicks(bottomUnitName, approxInterval, isUTC, extent, extentSpanWithBreaks, brkCtx) {\n  var safeLimit = 10000;\n  var unitNames = timeUnits;\n  var iter = 0;\n  function addTicksInSpan(interval, minTimestamp, maxTimestamp, getMethodName, setMethodName, isDate, out) {\n    var estimateNiceMultiple = createEstimateNiceMultiple(setMethodName, interval);\n    var dateTime = minTimestamp;\n    var date = new Date(dateTime);\n    // if (isDate) {\n    //     d -= 1; // Starts with 0;   PENDING\n    // }\n    while (dateTime < maxTimestamp && dateTime <= extent[1]) {\n      out.push({\n        value: dateTime\n      });\n      if (iter++ > safeLimit) {\n        if (process.env.NODE_ENV !== 'production') {\n          warn('Exceed safe limit in time scale.');\n        }\n        break;\n      }\n      date[setMethodName](date[getMethodName]() + interval);\n      dateTime = date.getTime();\n      if (brkCtx) {\n        var moreMultiple = brkCtx.calcNiceTickMultiple(dateTime, estimateNiceMultiple);\n        if (moreMultiple > 0) {\n          date[setMethodName](date[getMethodName]() + moreMultiple * interval);\n          dateTime = date.getTime();\n        }\n      }\n    }\n    // This extra tick is for calcuating ticks of next level. Will not been added to the final result\n    out.push({\n      value: dateTime,\n      notAdd: true\n    });\n  }\n  function addLevelTicks(unitName, lastLevelTicks, levelTicks) {\n    var newAddedTicks = [];\n    var isFirstLevel = !lastLevelTicks.length;\n    if (isPrimaryUnitValueAndGreaterSame(getPrimaryTimeUnit(unitName), extent[0], extent[1], isUTC)) {\n      return;\n    }\n    if (isFirstLevel) {\n      lastLevelTicks = [{\n        value: getFirstTimestampOfUnit(extent[0], unitName, isUTC)\n      }, {\n        value: extent[1]\n      }];\n    }\n    for (var i = 0; i < lastLevelTicks.length - 1; i++) {\n      var startTick = lastLevelTicks[i].value;\n      var endTick = lastLevelTicks[i + 1].value;\n      if (startTick === endTick) {\n        continue;\n      }\n      var interval = void 0;\n      var getterName = void 0;\n      var setterName = void 0;\n      var isDate = false;\n      switch (unitName) {\n        case 'year':\n          interval = Math.max(1, Math.round(approxInterval / ONE_DAY / 365));\n          getterName = fullYearGetterName(isUTC);\n          setterName = fullYearSetterName(isUTC);\n          break;\n        case 'half-year':\n        case 'quarter':\n        case 'month':\n          interval = getMonthInterval(approxInterval);\n          getterName = monthGetterName(isUTC);\n          setterName = monthSetterName(isUTC);\n          break;\n        case 'week': // PENDING If week is added. Ignore day.\n        case 'half-week':\n        case 'day':\n          interval = getDateInterval(approxInterval, 31); // Use 32 days and let interval been 16\n          getterName = dateGetterName(isUTC);\n          setterName = dateSetterName(isUTC);\n          isDate = true;\n          break;\n        case 'half-day':\n        case 'quarter-day':\n        case 'hour':\n          interval = getHourInterval(approxInterval);\n          getterName = hoursGetterName(isUTC);\n          setterName = hoursSetterName(isUTC);\n          break;\n        case 'minute':\n          interval = getMinutesAndSecondsInterval(approxInterval, true);\n          getterName = minutesGetterName(isUTC);\n          setterName = minutesSetterName(isUTC);\n          break;\n        case 'second':\n          interval = getMinutesAndSecondsInterval(approxInterval, false);\n          getterName = secondsGetterName(isUTC);\n          setterName = secondsSetterName(isUTC);\n          break;\n        case 'millisecond':\n          interval = getMillisecondsInterval(approxInterval);\n          getterName = millisecondsGetterName(isUTC);\n          setterName = millisecondsSetterName(isUTC);\n          break;\n      }\n      // Notice: This expansion by `getFirstTimestampOfUnit` may cause too many ticks and\n      // iteration. e.g., when three levels of ticks is displayed, which can be caused by\n      // data zoom and axis breaks. Thus trim them here.\n      if (endTick >= extent[0] && startTick <= extent[1]) {\n        addTicksInSpan(interval, startTick, endTick, getterName, setterName, isDate, newAddedTicks);\n      }\n      if (unitName === 'year' && levelTicks.length > 1 && i === 0) {\n        // Add nearest years to the left extent.\n        levelTicks.unshift({\n          value: levelTicks[0].value - interval\n        });\n      }\n    }\n    for (var i = 0; i < newAddedTicks.length; i++) {\n      levelTicks.push(newAddedTicks[i]);\n    }\n  }\n  var levelsTicks = [];\n  var currentLevelTicks = [];\n  var tickCount = 0;\n  var lastLevelTickCount = 0;\n  for (var i = 0; i < unitNames.length; ++i) {\n    var primaryTimeUnit = getPrimaryTimeUnit(unitNames[i]);\n    if (!isPrimaryTimeUnit(unitNames[i])) {\n      // TODO\n      continue;\n    }\n    addLevelTicks(unitNames[i], levelsTicks[levelsTicks.length - 1] || [], currentLevelTicks);\n    var nextPrimaryTimeUnit = unitNames[i + 1] ? getPrimaryTimeUnit(unitNames[i + 1]) : null;\n    if (primaryTimeUnit !== nextPrimaryTimeUnit) {\n      if (currentLevelTicks.length) {\n        lastLevelTickCount = tickCount;\n        // Remove the duplicate so the tick count can be precisely.\n        currentLevelTicks.sort(function (a, b) {\n          return a.value - b.value;\n        });\n        var levelTicksRemoveDuplicated = [];\n        for (var i_1 = 0; i_1 < currentLevelTicks.length; ++i_1) {\n          var tickValue = currentLevelTicks[i_1].value;\n          if (i_1 === 0 || currentLevelTicks[i_1 - 1].value !== tickValue) {\n            levelTicksRemoveDuplicated.push(currentLevelTicks[i_1]);\n            if (tickValue >= extent[0] && tickValue <= extent[1]) {\n              tickCount++;\n            }\n          }\n        }\n        var targetTickNum = extentSpanWithBreaks / approxInterval;\n        // Added too much in this level and not too less in last level\n        if (tickCount > targetTickNum * 1.5 && lastLevelTickCount > targetTickNum / 1.5) {\n          break;\n        }\n        // Only treat primary time unit as one level.\n        levelsTicks.push(levelTicksRemoveDuplicated);\n        if (tickCount > targetTickNum || bottomUnitName === unitNames[i]) {\n          break;\n        }\n      }\n      // Reset if next unitName is primary\n      currentLevelTicks = [];\n    }\n  }\n  var levelsTicksInExtent = filter(map(levelsTicks, function (levelTicks) {\n    return filter(levelTicks, function (tick) {\n      return tick.value >= extent[0] && tick.value <= extent[1] && !tick.notAdd;\n    });\n  }), function (levelTicks) {\n    return levelTicks.length > 0;\n  });\n  var ticks = [];\n  var maxLevel = levelsTicksInExtent.length - 1;\n  for (var i = 0; i < levelsTicksInExtent.length; ++i) {\n    var levelTicks = levelsTicksInExtent[i];\n    for (var k = 0; k < levelTicks.length; ++k) {\n      var unit = getUnitFromValue(levelTicks[k].value, isUTC);\n      ticks.push({\n        value: levelTicks[k].value,\n        time: {\n          level: maxLevel - i,\n          upperTimeUnit: unit,\n          lowerTimeUnit: unit\n        }\n      });\n    }\n  }\n  ticks.sort(function (a, b) {\n    return a.value - b.value;\n  });\n  // Remove duplicates\n  var result = [];\n  for (var i = 0; i < ticks.length; ++i) {\n    if (i === 0 || ticks[i].value !== ticks[i - 1].value) {\n      result.push(ticks[i]);\n    }\n  }\n  return result;\n}\nScale.registerClass(TimeScale);\nexport default TimeScale;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport Scale from './Scale.js';\nimport * as numberUtil from '../util/number.js';\n// Use some method of IntervalScale\nimport IntervalScale from './Interval.js';\nimport { getIntervalPrecision, logTransform } from './helper.js';\nimport { getScaleBreakHelper } from './break.js';\nvar fixRound = numberUtil.round;\nvar mathFloor = Math.floor;\nvar mathCeil = Math.ceil;\nvar mathPow = Math.pow;\nvar mathLog = Math.log;\nvar LogScale = /** @class */function (_super) {\n  __extends(LogScale, _super);\n  function LogScale() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = 'log';\n    _this.base = 10;\n    _this._originalScale = new IntervalScale();\n    return _this;\n  }\n  /**\n   * @param Whether expand the ticks to niced extent.\n   */\n  LogScale.prototype.getTicks = function (opt) {\n    opt = opt || {};\n    var extent = this._extent.slice();\n    var originalExtent = this._originalScale.getExtent();\n    var ticks = _super.prototype.getTicks.call(this, opt);\n    var base = this.base;\n    var originalBreaks = this._originalScale._innerGetBreaks();\n    var scaleBreakHelper = getScaleBreakHelper();\n    return zrUtil.map(ticks, function (tick) {\n      var val = tick.value;\n      var roundingCriterion = null;\n      var powVal = mathPow(base, val);\n      // Fix #4158\n      if (val === extent[0] && this._fixMin) {\n        roundingCriterion = originalExtent[0];\n      } else if (val === extent[1] && this._fixMax) {\n        roundingCriterion = originalExtent[1];\n      }\n      var vBreak;\n      if (scaleBreakHelper) {\n        var transformed = scaleBreakHelper.getTicksLogTransformBreak(tick, base, originalBreaks, fixRoundingError);\n        vBreak = transformed.vBreak;\n        if (roundingCriterion == null) {\n          roundingCriterion = transformed.brkRoundingCriterion;\n        }\n      }\n      if (roundingCriterion != null) {\n        powVal = fixRoundingError(powVal, roundingCriterion);\n      }\n      return {\n        value: powVal,\n        \"break\": vBreak\n      };\n    }, this);\n  };\n  LogScale.prototype._getNonTransBreaks = function () {\n    return this._originalScale._innerGetBreaks();\n  };\n  LogScale.prototype.setExtent = function (start, end) {\n    this._originalScale.setExtent(start, end);\n    var loggedExtent = logTransform(this.base, [start, end]);\n    _super.prototype.setExtent.call(this, loggedExtent[0], loggedExtent[1]);\n  };\n  /**\n   * @return {number} end\n   */\n  LogScale.prototype.getExtent = function () {\n    var base = this.base;\n    var extent = _super.prototype.getExtent.call(this);\n    extent[0] = mathPow(base, extent[0]);\n    extent[1] = mathPow(base, extent[1]);\n    // Fix #4158\n    var originalExtent = this._originalScale.getExtent();\n    this._fixMin && (extent[0] = fixRoundingError(extent[0], originalExtent[0]));\n    this._fixMax && (extent[1] = fixRoundingError(extent[1], originalExtent[1]));\n    return extent;\n  };\n  LogScale.prototype.unionExtentFromData = function (data, dim) {\n    this._originalScale.unionExtentFromData(data, dim);\n    var loggedOther = logTransform(this.base, data.getApproximateExtent(dim), true);\n    this._innerUnionExtent(loggedOther);\n  };\n  /**\n   * Update interval and extent of intervals for nice ticks\n   * @param approxTickNum default 10 Given approx tick number\n   */\n  LogScale.prototype.calcNiceTicks = function (approxTickNum) {\n    approxTickNum = approxTickNum || 10;\n    var extent = this._extent.slice();\n    var span = this._getExtentSpanWithBreaks();\n    if (!isFinite(span) || span <= 0) {\n      return;\n    }\n    var interval = numberUtil.quantity(span);\n    var err = approxTickNum / span * interval;\n    // Filter ticks to get closer to the desired count.\n    if (err <= 0.5) {\n      interval *= 10;\n    }\n    // Interval should be integer\n    while (!isNaN(interval) && Math.abs(interval) < 1 && Math.abs(interval) > 0) {\n      interval *= 10;\n    }\n    var niceExtent = [fixRound(mathCeil(extent[0] / interval) * interval), fixRound(mathFloor(extent[1] / interval) * interval)];\n    this._interval = interval;\n    this._intervalPrecision = getIntervalPrecision(interval);\n    this._niceExtent = niceExtent;\n  };\n  LogScale.prototype.calcNiceExtent = function (opt) {\n    _super.prototype.calcNiceExtent.call(this, opt);\n    this._fixMin = opt.fixMin;\n    this._fixMax = opt.fixMax;\n  };\n  LogScale.prototype.contain = function (val) {\n    val = mathLog(val) / mathLog(this.base);\n    return _super.prototype.contain.call(this, val);\n  };\n  LogScale.prototype.normalize = function (val) {\n    val = mathLog(val) / mathLog(this.base);\n    return _super.prototype.normalize.call(this, val);\n  };\n  LogScale.prototype.scale = function (val) {\n    val = _super.prototype.scale.call(this, val);\n    return mathPow(this.base, val);\n  };\n  LogScale.prototype.setBreaksFromOption = function (breakOptionList) {\n    var scaleBreakHelper = getScaleBreakHelper();\n    if (!scaleBreakHelper) {\n      return;\n    }\n    var _a = scaleBreakHelper.logarithmicParseBreaksFromOption(breakOptionList, this.base, zrUtil.bind(this.parse, this)),\n      parsedOriginal = _a.parsedOriginal,\n      parsedLogged = _a.parsedLogged;\n    this._originalScale._innerSetBreak(parsedOriginal);\n    this._innerSetBreak(parsedLogged);\n  };\n  LogScale.type = 'log';\n  return LogScale;\n}(IntervalScale);\nfunction fixRoundingError(val, originalVal) {\n  return fixRound(val, numberUtil.getPrecision(originalVal));\n}\nScale.registerClass(LogScale);\nexport default LogScale;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { assert, isArray, eqNaN, isFunction } from 'zrender/lib/core/util.js';\nimport { parsePercent } from 'zrender/lib/contain/text.js';\nvar ScaleRawExtentInfo = /** @class */function () {\n  function ScaleRawExtentInfo(scale, model,\n  // Usually: data extent from all series on this axis.\n  originalExtent) {\n    this._prepareParams(scale, model, originalExtent);\n  }\n  /**\n   * Parameters depending on outside (like model, user callback)\n   * are prepared and fixed here.\n   */\n  ScaleRawExtentInfo.prototype._prepareParams = function (scale, model,\n  // Usually: data extent from all series on this axis.\n  dataExtent) {\n    if (dataExtent[1] < dataExtent[0]) {\n      dataExtent = [NaN, NaN];\n    }\n    this._dataMin = dataExtent[0];\n    this._dataMax = dataExtent[1];\n    var isOrdinal = this._isOrdinal = scale.type === 'ordinal';\n    this._needCrossZero = scale.type === 'interval' && model.getNeedCrossZero && model.getNeedCrossZero();\n    var axisMinValue = model.get('min', true);\n    if (axisMinValue == null) {\n      axisMinValue = model.get('startValue', true);\n    }\n    var modelMinRaw = this._modelMinRaw = axisMinValue;\n    if (isFunction(modelMinRaw)) {\n      // This callback always provides users the full data extent (before data is filtered).\n      this._modelMinNum = parseAxisModelMinMax(scale, modelMinRaw({\n        min: dataExtent[0],\n        max: dataExtent[1]\n      }));\n    } else if (modelMinRaw !== 'dataMin') {\n      this._modelMinNum = parseAxisModelMinMax(scale, modelMinRaw);\n    }\n    var modelMaxRaw = this._modelMaxRaw = model.get('max', true);\n    if (isFunction(modelMaxRaw)) {\n      // This callback always provides users the full data extent (before data is filtered).\n      this._modelMaxNum = parseAxisModelMinMax(scale, modelMaxRaw({\n        min: dataExtent[0],\n        max: dataExtent[1]\n      }));\n    } else if (modelMaxRaw !== 'dataMax') {\n      this._modelMaxNum = parseAxisModelMinMax(scale, modelMaxRaw);\n    }\n    if (isOrdinal) {\n      // FIXME: there is a flaw here: if there is no \"block\" data processor like `dataZoom`,\n      // and progressive rendering is using, here the category result might just only contain\n      // the processed chunk rather than the entire result.\n      this._axisDataLen = model.getCategories().length;\n    } else {\n      var boundaryGap = model.get('boundaryGap');\n      var boundaryGapArr = isArray(boundaryGap) ? boundaryGap : [boundaryGap || 0, boundaryGap || 0];\n      if (typeof boundaryGapArr[0] === 'boolean' || typeof boundaryGapArr[1] === 'boolean') {\n        if (process.env.NODE_ENV !== 'production') {\n          console.warn('Boolean type for boundaryGap is only ' + 'allowed for ordinal axis. Please use string in ' + 'percentage instead, e.g., \"20%\". Currently, ' + 'boundaryGap is set to be 0.');\n        }\n        this._boundaryGapInner = [0, 0];\n      } else {\n        this._boundaryGapInner = [parsePercent(boundaryGapArr[0], 1), parsePercent(boundaryGapArr[1], 1)];\n      }\n    }\n  };\n  /**\n   * Calculate extent by prepared parameters.\n   * This method has no external dependency and can be called duplicatedly,\n   * getting the same result.\n   * If parameters changed, should call this method to recalcuate.\n   */\n  ScaleRawExtentInfo.prototype.calculate = function () {\n    // Notice: When min/max is not set (that is, when there are null/undefined,\n    // which is the most common case), these cases should be ensured:\n    // (1) For 'ordinal', show all axis.data.\n    // (2) For others:\n    //      + `boundaryGap` is applied (if min/max set, boundaryGap is\n    //      disabled).\n    //      + If `needCrossZero`, min/max should be zero, otherwise, min/max should\n    //      be the result that originalExtent enlarged by boundaryGap.\n    // (3) If no data, it should be ensured that `scale.setBlank` is set.\n    var isOrdinal = this._isOrdinal;\n    var dataMin = this._dataMin;\n    var dataMax = this._dataMax;\n    var axisDataLen = this._axisDataLen;\n    var boundaryGapInner = this._boundaryGapInner;\n    var span = !isOrdinal ? dataMax - dataMin || Math.abs(dataMin) : null;\n    // Currently if a `'value'` axis model min is specified as 'dataMin'/'dataMax',\n    // `boundaryGap` will not be used. It's the different from specifying as `null`/`undefined`.\n    var min = this._modelMinRaw === 'dataMin' ? dataMin : this._modelMinNum;\n    var max = this._modelMaxRaw === 'dataMax' ? dataMax : this._modelMaxNum;\n    // If `_modelMinNum`/`_modelMaxNum` is `null`/`undefined`, should not be fixed.\n    var minFixed = min != null;\n    var maxFixed = max != null;\n    if (min == null) {\n      min = isOrdinal ? axisDataLen ? 0 : NaN : dataMin - boundaryGapInner[0] * span;\n    }\n    if (max == null) {\n      max = isOrdinal ? axisDataLen ? axisDataLen - 1 : NaN : dataMax + boundaryGapInner[1] * span;\n    }\n    (min == null || !isFinite(min)) && (min = NaN);\n    (max == null || !isFinite(max)) && (max = NaN);\n    var isBlank = eqNaN(min) || eqNaN(max) || isOrdinal && !axisDataLen;\n    // If data extent modified, need to recalculated to ensure cross zero.\n    if (this._needCrossZero) {\n      // Axis is over zero and min is not set\n      if (min > 0 && max > 0 && !minFixed) {\n        min = 0;\n        // minFixed = true;\n      }\n      // Axis is under zero and max is not set\n      if (min < 0 && max < 0 && !maxFixed) {\n        max = 0;\n        // maxFixed = true;\n      }\n      // PENDING:\n      // When `needCrossZero` and all data is positive/negative, should it be ensured\n      // that the results processed by boundaryGap are positive/negative?\n      // If so, here `minFixed`/`maxFixed` need to be set.\n    }\n    var determinedMin = this._determinedMin;\n    var determinedMax = this._determinedMax;\n    if (determinedMin != null) {\n      min = determinedMin;\n      minFixed = true;\n    }\n    if (determinedMax != null) {\n      max = determinedMax;\n      maxFixed = true;\n    }\n    // Ensure min/max be finite number or NaN here. (not to be null/undefined)\n    // `NaN` means min/max axis is blank.\n    return {\n      min: min,\n      max: max,\n      minFixed: minFixed,\n      maxFixed: maxFixed,\n      isBlank: isBlank\n    };\n  };\n  ScaleRawExtentInfo.prototype.modifyDataMinMax = function (minMaxName, val) {\n    if (process.env.NODE_ENV !== 'production') {\n      assert(!this.frozen);\n    }\n    this[DATA_MIN_MAX_ATTR[minMaxName]] = val;\n  };\n  ScaleRawExtentInfo.prototype.setDeterminedMinMax = function (minMaxName, val) {\n    var attr = DETERMINED_MIN_MAX_ATTR[minMaxName];\n    if (process.env.NODE_ENV !== 'production') {\n      assert(!this.frozen\n      // Earse them usually means logic flaw.\n      && this[attr] == null);\n    }\n    this[attr] = val;\n  };\n  ScaleRawExtentInfo.prototype.freeze = function () {\n    // @ts-ignore\n    this.frozen = true;\n  };\n  return ScaleRawExtentInfo;\n}();\nexport { ScaleRawExtentInfo };\nvar DETERMINED_MIN_MAX_ATTR = {\n  min: '_determinedMin',\n  max: '_determinedMax'\n};\nvar DATA_MIN_MAX_ATTR = {\n  min: '_dataMin',\n  max: '_dataMax'\n};\n/**\n * Get scale min max and related info only depends on model settings.\n * This method can be called after coordinate system created.\n * For example, in data processing stage.\n *\n * Scale extent info probably be required multiple times during a workflow.\n * For example:\n * (1) `dataZoom` depends it to get the axis extent in \"100%\" state.\n * (2) `processor/extentCalculator` depends it to make sure whether axis extent is specified.\n * (3) `coordSys.update` use it to finally decide the scale extent.\n * But the callback of `min`/`max` should not be called multiple times.\n * The code below should not be implemented repeatedly either.\n * So we cache the result in the scale instance, which will be recreated at the beginning\n * of the workflow (because `scale` instance will be recreated each round of the workflow).\n */\nexport function ensureScaleRawExtentInfo(scale, model,\n// Usually: data extent from all series on this axis.\noriginalExtent) {\n  // Do not permit to recreate.\n  var rawExtentInfo = scale.rawExtentInfo;\n  if (rawExtentInfo) {\n    return rawExtentInfo;\n  }\n  rawExtentInfo = new ScaleRawExtentInfo(scale, model, originalExtent);\n  // @ts-ignore\n  scale.rawExtentInfo = rawExtentInfo;\n  return rawExtentInfo;\n}\nexport function parseAxisModelMinMax(scale, minMax) {\n  return minMax == null ? null : eqNaN(minMax) ? NaN : scale.parse(minMax);\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport OrdinalScale from '../scale/Ordinal.js';\nimport IntervalScale from '../scale/Interval.js';\nimport Scale from '../scale/Scale.js';\nimport { prepareLayoutBarSeries, makeColumnLayout, retrieveColumnLayout } from '../layout/barGrid.js';\nimport TimeScale from '../scale/Time.js';\nimport LogScale from '../scale/Log.js';\nimport { getStackedDimension } from '../data/helper/dataStackHelper.js';\nimport { ensureScaleRawExtentInfo } from './scaleRawExtentInfo.js';\nimport { parseTimeAxisLabelFormatter } from '../util/time.js';\nimport { getScaleBreakHelper } from '../scale/break.js';\nimport { error } from '../util/log.js';\n/**\n * Get axis scale extent before niced.\n * Item of returned array can only be number (including Infinity and NaN).\n *\n * Caution:\n * Precondition of calling this method:\n * The scale extent has been initialized using series data extent via\n * `scale.setExtent` or `scale.unionExtentFromData`;\n */\nexport function getScaleExtent(scale, model) {\n  var scaleType = scale.type;\n  var rawExtentResult = ensureScaleRawExtentInfo(scale, model, scale.getExtent()).calculate();\n  scale.setBlank(rawExtentResult.isBlank);\n  var min = rawExtentResult.min;\n  var max = rawExtentResult.max;\n  // If bars are placed on a base axis of type time or interval account for axis boundary overflow and current axis\n  // is base axis\n  // FIXME\n  // (1) Consider support value axis, where below zero and axis `onZero` should be handled properly.\n  // (2) Refactor the logic with `barGrid`. Is it not need to `makeBarWidthAndOffsetInfo` twice with different extent?\n  //     Should not depend on series type `bar`?\n  // (3) Fix that might overlap when using dataZoom.\n  // (4) Consider other chart types using `barGrid`?\n  // See #6728, #4862, `test/bar-overflow-time-plot.html`\n  var ecModel = model.ecModel;\n  if (ecModel && scaleType === 'time' /* || scaleType === 'interval' */) {\n    var barSeriesModels = prepareLayoutBarSeries('bar', ecModel);\n    var isBaseAxisAndHasBarSeries_1 = false;\n    zrUtil.each(barSeriesModels, function (seriesModel) {\n      isBaseAxisAndHasBarSeries_1 = isBaseAxisAndHasBarSeries_1 || seriesModel.getBaseAxis() === model.axis;\n    });\n    if (isBaseAxisAndHasBarSeries_1) {\n      // Calculate placement of bars on axis. TODO should be decoupled\n      // with barLayout\n      var barWidthAndOffset = makeColumnLayout(barSeriesModels);\n      // Adjust axis min and max to account for overflow\n      var adjustedScale = adjustScaleForOverflow(min, max, model, barWidthAndOffset);\n      min = adjustedScale.min;\n      max = adjustedScale.max;\n    }\n  }\n  return {\n    extent: [min, max],\n    // \"fix\" means \"fixed\", the value should not be\n    // changed in the subsequent steps.\n    fixMin: rawExtentResult.minFixed,\n    fixMax: rawExtentResult.maxFixed\n  };\n}\nfunction adjustScaleForOverflow(min, max, model,\n// Only support cartesian coord yet.\nbarWidthAndOffset) {\n  // Get Axis Length\n  var axisExtent = model.axis.getExtent();\n  var axisLength = Math.abs(axisExtent[1] - axisExtent[0]);\n  // Get bars on current base axis and calculate min and max overflow\n  var barsOnCurrentAxis = retrieveColumnLayout(barWidthAndOffset, model.axis);\n  if (barsOnCurrentAxis === undefined) {\n    return {\n      min: min,\n      max: max\n    };\n  }\n  var minOverflow = Infinity;\n  zrUtil.each(barsOnCurrentAxis, function (item) {\n    minOverflow = Math.min(item.offset, minOverflow);\n  });\n  var maxOverflow = -Infinity;\n  zrUtil.each(barsOnCurrentAxis, function (item) {\n    maxOverflow = Math.max(item.offset + item.width, maxOverflow);\n  });\n  minOverflow = Math.abs(minOverflow);\n  maxOverflow = Math.abs(maxOverflow);\n  var totalOverFlow = minOverflow + maxOverflow;\n  // Calculate required buffer based on old range and overflow\n  var oldRange = max - min;\n  var oldRangePercentOfNew = 1 - (minOverflow + maxOverflow) / axisLength;\n  var overflowBuffer = oldRange / oldRangePercentOfNew - oldRange;\n  max += overflowBuffer * (maxOverflow / totalOverFlow);\n  min -= overflowBuffer * (minOverflow / totalOverFlow);\n  return {\n    min: min,\n    max: max\n  };\n}\n// Precondition of calling this method:\n// The scale extent has been initialized using series data extent via\n// `scale.setExtent` or `scale.unionExtentFromData`;\nexport function niceScaleExtent(scale, inModel) {\n  var model = inModel;\n  var extentInfo = getScaleExtent(scale, model);\n  var extent = extentInfo.extent;\n  var splitNumber = model.get('splitNumber');\n  if (scale instanceof LogScale) {\n    scale.base = model.get('logBase');\n  }\n  var scaleType = scale.type;\n  var interval = model.get('interval');\n  var isIntervalOrTime = scaleType === 'interval' || scaleType === 'time';\n  scale.setBreaksFromOption(retrieveAxisBreaksOption(model));\n  scale.setExtent(extent[0], extent[1]);\n  scale.calcNiceExtent({\n    splitNumber: splitNumber,\n    fixMin: extentInfo.fixMin,\n    fixMax: extentInfo.fixMax,\n    minInterval: isIntervalOrTime ? model.get('minInterval') : null,\n    maxInterval: isIntervalOrTime ? model.get('maxInterval') : null\n  });\n  // If some one specified the min, max. And the default calculated interval\n  // is not good enough. He can specify the interval. It is often appeared\n  // in angle axis with angle 0 - 360. Interval calculated in interval scale is hard\n  // to be 60.\n  // FIXME\n  if (interval != null) {\n    scale.setInterval && scale.setInterval(interval);\n  }\n}\n/**\n * @param axisType Default retrieve from model.type\n */\nexport function createScaleByModel(model, axisType) {\n  axisType = axisType || model.get('type');\n  if (axisType) {\n    switch (axisType) {\n      // Buildin scale\n      case 'category':\n        return new OrdinalScale({\n          ordinalMeta: model.getOrdinalMeta ? model.getOrdinalMeta() : model.getCategories(),\n          extent: [Infinity, -Infinity]\n        });\n      case 'time':\n        return new TimeScale({\n          locale: model.ecModel.getLocaleModel(),\n          useUTC: model.ecModel.get('useUTC')\n        });\n      default:\n        // case 'value'/'interval', 'log', or others.\n        return new (Scale.getClass(axisType) || IntervalScale)();\n    }\n  }\n}\n/**\n * Check if the axis cross 0\n */\nexport function ifAxisCrossZero(axis) {\n  var dataExtent = axis.scale.getExtent();\n  var min = dataExtent[0];\n  var max = dataExtent[1];\n  return !(min > 0 && max > 0 || min < 0 && max < 0);\n}\n/**\n * @param axis\n * @return Label formatter function.\n *         param: {number} tickValue,\n *         param: {number} idx, the index in all ticks.\n *                         If category axis, this param is not required.\n *         return: {string} label string.\n */\nexport function makeLabelFormatter(axis) {\n  var labelFormatter = axis.getLabelModel().get('formatter');\n  if (axis.type === 'time') {\n    var parsed_1 = parseTimeAxisLabelFormatter(labelFormatter);\n    return function (tick, idx) {\n      return axis.scale.getFormattedLabel(tick, idx, parsed_1);\n    };\n  } else if (zrUtil.isString(labelFormatter)) {\n    return function (tick) {\n      // For category axis, get raw value; for numeric axis,\n      // get formatted label like '1,333,444'.\n      var label = axis.scale.getLabel(tick);\n      var text = labelFormatter.replace('{value}', label != null ? label : '');\n      return text;\n    };\n  } else if (zrUtil.isFunction(labelFormatter)) {\n    if (axis.type === 'category') {\n      return function (tick, idx) {\n        // The original intention of `idx` is \"the index of the tick in all ticks\".\n        // But the previous implementation of category axis do not consider the\n        // `axisLabel.interval`, which cause that, for example, the `interval` is\n        // `1`, then the ticks \"name5\", \"name7\", \"name9\" are displayed, where the\n        // corresponding `idx` are `0`, `2`, `4`, but not `0`, `1`, `2`. So we keep\n        // the definition here for back compatibility.\n        return labelFormatter(getAxisRawValue(axis, tick), tick.value - axis.scale.getExtent()[0], null // Using `null` just for backward compat.\n        );\n      };\n    }\n    var scaleBreakHelper_1 = getScaleBreakHelper();\n    return function (tick, idx) {\n      // Using `null` just for backward compat. It's been found that in the `test/axis-customTicks.html`,\n      // there is a formatter `function (value, index, revers = true) { ... }`. Although the third param\n      // `revers` is incorrect and always `null`, changing it might introduce a breaking change.\n      var extra = null;\n      if (scaleBreakHelper_1) {\n        extra = scaleBreakHelper_1.makeAxisLabelFormatterParamBreak(extra, tick[\"break\"]);\n      }\n      return labelFormatter(getAxisRawValue(axis, tick), idx, extra);\n    };\n  } else {\n    return function (tick) {\n      return axis.scale.getLabel(tick);\n    };\n  }\n}\nexport function getAxisRawValue(axis, tick) {\n  // In category axis with data zoom, tick is not the original\n  // index of axis.data. So tick should not be exposed to user\n  // in category axis.\n  return axis.type === 'category' ? axis.scale.getLabel(tick) : tick.value;\n}\n/**\n * @param model axisLabelModel or axisTickModel\n * @return {number|String} Can be null|'auto'|number|function\n */\nexport function getOptionCategoryInterval(model) {\n  var interval = model.get('interval');\n  return interval == null ? 'auto' : interval;\n}\n/**\n * Set `categoryInterval` as 0 implicitly indicates that\n * show all labels regardless of overlap.\n * @param {Object} axis axisModel.axis\n */\nexport function shouldShowAllLabels(axis) {\n  return axis.type === 'category' && getOptionCategoryInterval(axis.getLabelModel()) === 0;\n}\nexport function getDataDimensionsOnAxis(data, axisDim) {\n  // Remove duplicated dat dimensions caused by `getStackedDimension`.\n  var dataDimMap = {};\n  // Currently `mapDimensionsAll` will contain stack result dimension ('__\\0ecstackresult').\n  // PENDING: is it reasonable? Do we need to remove the original dim from \"coord dim\" since\n  // there has been stacked result dim?\n  zrUtil.each(data.mapDimensionsAll(axisDim), function (dataDim) {\n    // For example, the extent of the original dimension\n    // is [0.1, 0.5], the extent of the `stackResultDimension`\n    // is [7, 9], the final extent should NOT include [0.1, 0.5],\n    // because there is no graphic corresponding to [0.1, 0.5].\n    // See the case in `test/area-stack.html` `main1`, where area line\n    // stack needs `yAxis` not start from 0.\n    dataDimMap[getStackedDimension(data, dataDim)] = true;\n  });\n  return zrUtil.keys(dataDimMap);\n}\nexport function unionAxisExtentFromData(dataExtent, data, axisDim) {\n  if (data) {\n    zrUtil.each(getDataDimensionsOnAxis(data, axisDim), function (dim) {\n      var seriesExtent = data.getApproximateExtent(dim);\n      seriesExtent[0] < dataExtent[0] && (dataExtent[0] = seriesExtent[0]);\n      seriesExtent[1] > dataExtent[1] && (dataExtent[1] = seriesExtent[1]);\n    });\n  }\n}\nexport function isNameLocationCenter(nameLocation) {\n  return nameLocation === 'middle' || nameLocation === 'center';\n}\nexport function shouldAxisShow(axisModel) {\n  return axisModel.getShallow('show');\n}\nexport function retrieveAxisBreaksOption(model) {\n  var option = model.get('breaks', true);\n  if (option != null) {\n    if (!getScaleBreakHelper()) {\n      if (process.env.NODE_ENV !== 'production') {\n        error('Must `import {AxisBreak} from \"echarts/features.js\"; use(AxisBreak);` first if using breaks option.');\n      }\n      return undefined;\n    }\n    if (!isSupportAxisBreak(model.axis)) {\n      if (process.env.NODE_ENV !== 'production') {\n        error(\"Axis '\" + model.axis.dim + \"'-'\" + model.axis.type + \"' does not support break.\");\n      }\n      return undefined;\n    }\n    return option;\n  }\n}\nfunction isSupportAxisBreak(axis) {\n  // The polar radius axis can also support break feasibly. Do not do it until the requirements are met.\n  return (axis.dim === 'x' || axis.dim === 'y' || axis.dim === 'z' || axis.dim === 'single') && axis.type !== 'category';\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nvar AxisModelCommonMixin = /** @class */function () {\n  function AxisModelCommonMixin() {}\n  AxisModelCommonMixin.prototype.getNeedCrossZero = function () {\n    var option = this.option;\n    return !option.scale;\n  };\n  /**\n   * Should be implemented by each axis model if necessary.\n   * @return coordinate system model\n   */\n  AxisModelCommonMixin.prototype.getCoordSysModel = function () {\n    return;\n  };\n  return AxisModelCommonMixin;\n}();\nexport { AxisModelCommonMixin };", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { registerPreprocessor, registerProcessor, registerPostInit, registerPostUpdate, registerAction, registerCoordinateSystem, registerLayout, registerVisual, registerTransform, registerLoading, registerMap, registerUpdateLifecycle, PRIORITY } from './core/echarts.js';\nimport ComponentView from './view/Component.js';\nimport ChartView from './view/Chart.js';\nimport ComponentModel from './model/Component.js';\nimport SeriesModel from './model/Series.js';\nimport { isFunction, indexOf, isArray, each } from 'zrender/lib/core/util.js';\nimport { registerImpl } from './core/impl.js';\nimport { registerPainter } from 'zrender/lib/zrender.js';\nimport { registerCustomSeries } from './chart/custom/customSeriesRegister.js';\nvar extensions = [];\nvar extensionRegisters = {\n  registerPreprocessor: registerPreprocessor,\n  registerProcessor: registerProcessor,\n  registerPostInit: registerPostInit,\n  registerPostUpdate: registerPostUpdate,\n  registerUpdateLifecycle: registerUpdateLifecycle,\n  registerAction: registerAction,\n  registerCoordinateSystem: registerCoordinateSystem,\n  registerLayout: registerLayout,\n  registerVisual: registerVisual,\n  registerTransform: registerTransform,\n  registerLoading: registerLoading,\n  registerMap: registerMap,\n  registerImpl: registerImpl,\n  PRIORITY: PRIORITY,\n  ComponentModel: ComponentModel,\n  ComponentView: ComponentView,\n  SeriesModel: SeriesModel,\n  ChartView: ChartView,\n  // TODO Use ComponentModel and SeriesModel instead of Constructor\n  registerComponentModel: function (ComponentModelClass) {\n    ComponentModel.registerClass(ComponentModelClass);\n  },\n  registerComponentView: function (ComponentViewClass) {\n    ComponentView.registerClass(ComponentViewClass);\n  },\n  registerSeriesModel: function (SeriesModelClass) {\n    SeriesModel.registerClass(SeriesModelClass);\n  },\n  registerChartView: function (ChartViewClass) {\n    ChartView.registerClass(ChartViewClass);\n  },\n  registerCustomSeries: function (seriesType, renderItem) {\n    registerCustomSeries(seriesType, renderItem);\n  },\n  registerSubTypeDefaulter: function (componentType, defaulter) {\n    ComponentModel.registerSubTypeDefaulter(componentType, defaulter);\n  },\n  registerPainter: function (painterType, PainterCtor) {\n    registerPainter(painterType, PainterCtor);\n  }\n};\nexport function use(ext) {\n  if (isArray(ext)) {\n    // use([ChartLine, ChartBar]);\n    each(ext, function (singleExt) {\n      use(singleExt);\n    });\n    return;\n  }\n  if (indexOf(extensions, ext) >= 0) {\n    return;\n  }\n  extensions.push(ext);\n  if (isFunction(ext)) {\n    ext = {\n      install: ext\n    };\n  }\n  ext.install(extensionRegisters);\n}", "import windingLine from './windingLine.js';\nvar EPSILON = 1e-8;\nfunction isAroundEqual(a, b) {\n    return Math.abs(a - b) < EPSILON;\n}\nexport function contain(points, x, y) {\n    var w = 0;\n    var p = points[0];\n    if (!p) {\n        return false;\n    }\n    for (var i = 1; i < points.length; i++) {\n        var p2 = points[i];\n        w += windingLine(p[0], p[1], p2[0], p2[1], x, y);\n        p = p2;\n    }\n    var p0 = points[0];\n    if (!isAroundEqual(p[0], p0[0]) || !isAroundEqual(p[1], p0[1])) {\n        w += windingLine(p[0], p[1], p0[0], p0[1], x, y);\n    }\n    return w !== 0;\n}\n", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport BoundingRect from 'zrender/lib/core/BoundingRect.js';\nimport * as vec2 from 'zrender/lib/core/vector.js';\nimport * as polygonContain from 'zrender/lib/contain/polygon.js';\nimport * as matrix from 'zrender/lib/core/matrix.js';\nimport { each } from 'zrender/lib/core/util.js';\nvar TMP_TRANSFORM = [];\nfunction transformPoints(points, transform) {\n  for (var p = 0; p < points.length; p++) {\n    vec2.applyTransform(points[p], points[p], transform);\n  }\n}\nfunction updateBBoxFromPoints(points, min, max, projection) {\n  for (var i = 0; i < points.length; i++) {\n    var p = points[i];\n    if (projection) {\n      // projection may return null point.\n      p = projection.project(p);\n    }\n    if (p && isFinite(p[0]) && isFinite(p[1])) {\n      vec2.min(min, min, p);\n      vec2.max(max, max, p);\n    }\n  }\n}\nfunction centroid(points) {\n  var signedArea = 0;\n  var cx = 0;\n  var cy = 0;\n  var len = points.length;\n  var x0 = points[len - 1][0];\n  var y0 = points[len - 1][1];\n  // Polygon should been closed.\n  for (var i = 0; i < len; i++) {\n    var x1 = points[i][0];\n    var y1 = points[i][1];\n    var a = x0 * y1 - x1 * y0;\n    signedArea += a;\n    cx += (x0 + x1) * a;\n    cy += (y0 + y1) * a;\n    x0 = x1;\n    y0 = y1;\n  }\n  return signedArea ? [cx / signedArea / 3, cy / signedArea / 3, signedArea] : [points[0][0] || 0, points[0][1] || 0];\n}\nvar Region = /** @class */function () {\n  function Region(name) {\n    this.name = name;\n  }\n  Region.prototype.setCenter = function (center) {\n    this._center = center;\n  };\n  /**\n   * Get center point in data unit. That is,\n   * for GeoJSONRegion, the unit is lat/lng,\n   * for GeoSVGRegion, the unit is SVG local coord.\n   */\n  Region.prototype.getCenter = function () {\n    var center = this._center;\n    if (!center) {\n      // In most cases there are no need to calculate this center.\n      // So calculate only when called.\n      center = this._center = this.calcCenter();\n    }\n    return center;\n  };\n  return Region;\n}();\nexport { Region };\nvar GeoJSONPolygonGeometry = /** @class */function () {\n  function GeoJSONPolygonGeometry(exterior, interiors) {\n    this.type = 'polygon';\n    this.exterior = exterior;\n    this.interiors = interiors;\n  }\n  return GeoJSONPolygonGeometry;\n}();\nexport { GeoJSONPolygonGeometry };\nvar GeoJSONLineStringGeometry = /** @class */function () {\n  function GeoJSONLineStringGeometry(points) {\n    this.type = 'linestring';\n    this.points = points;\n  }\n  return GeoJSONLineStringGeometry;\n}();\nexport { GeoJSONLineStringGeometry };\nvar GeoJSONRegion = /** @class */function (_super) {\n  __extends(GeoJSONRegion, _super);\n  function GeoJSONRegion(name, geometries, cp) {\n    var _this = _super.call(this, name) || this;\n    _this.type = 'geoJSON';\n    _this.geometries = geometries;\n    _this._center = cp && [cp[0], cp[1]];\n    return _this;\n  }\n  GeoJSONRegion.prototype.calcCenter = function () {\n    var geometries = this.geometries;\n    var largestGeo;\n    var largestGeoSize = 0;\n    for (var i = 0; i < geometries.length; i++) {\n      var geo = geometries[i];\n      var exterior = geo.exterior;\n      // Simple trick to use points count instead of polygon area as region size.\n      // Ignore linestring\n      var size = exterior && exterior.length;\n      if (size > largestGeoSize) {\n        largestGeo = geo;\n        largestGeoSize = size;\n      }\n    }\n    if (largestGeo) {\n      return centroid(largestGeo.exterior);\n    }\n    // from bounding rect by default.\n    var rect = this.getBoundingRect();\n    return [rect.x + rect.width / 2, rect.y + rect.height / 2];\n  };\n  GeoJSONRegion.prototype.getBoundingRect = function (projection) {\n    var rect = this._rect;\n    // Always recalculate if using projection.\n    if (rect && !projection) {\n      return rect;\n    }\n    var min = [Infinity, Infinity];\n    var max = [-Infinity, -Infinity];\n    var geometries = this.geometries;\n    each(geometries, function (geo) {\n      if (geo.type === 'polygon') {\n        // Doesn't consider hole\n        updateBBoxFromPoints(geo.exterior, min, max, projection);\n      } else {\n        each(geo.points, function (points) {\n          updateBBoxFromPoints(points, min, max, projection);\n        });\n      }\n    });\n    // Normalie invalid bounding.\n    if (!(isFinite(min[0]) && isFinite(min[1]) && isFinite(max[0]) && isFinite(max[1]))) {\n      min[0] = min[1] = max[0] = max[1] = 0;\n    }\n    rect = new BoundingRect(min[0], min[1], max[0] - min[0], max[1] - min[1]);\n    if (!projection) {\n      this._rect = rect;\n    }\n    return rect;\n  };\n  GeoJSONRegion.prototype.contain = function (coord) {\n    var rect = this.getBoundingRect();\n    var geometries = this.geometries;\n    if (!rect.contain(coord[0], coord[1])) {\n      return false;\n    }\n    loopGeo: for (var i = 0, len = geometries.length; i < len; i++) {\n      var geo = geometries[i];\n      // Only support polygon.\n      if (geo.type !== 'polygon') {\n        continue;\n      }\n      var exterior = geo.exterior;\n      var interiors = geo.interiors;\n      if (polygonContain.contain(exterior, coord[0], coord[1])) {\n        // Not in the region if point is in the hole.\n        for (var k = 0; k < (interiors ? interiors.length : 0); k++) {\n          if (polygonContain.contain(interiors[k], coord[0], coord[1])) {\n            continue loopGeo;\n          }\n        }\n        return true;\n      }\n    }\n    return false;\n  };\n  /**\n   * Transform the raw coords to target bounding.\n   * @param x\n   * @param y\n   * @param width\n   * @param height\n   */\n  GeoJSONRegion.prototype.transformTo = function (x, y, width, height) {\n    var rect = this.getBoundingRect();\n    var aspect = rect.width / rect.height;\n    if (!width) {\n      width = aspect * height;\n    } else if (!height) {\n      height = width / aspect;\n    }\n    var target = new BoundingRect(x, y, width, height);\n    var transform = rect.calculateTransform(target);\n    var geometries = this.geometries;\n    for (var i = 0; i < geometries.length; i++) {\n      var geo = geometries[i];\n      if (geo.type === 'polygon') {\n        transformPoints(geo.exterior, transform);\n        each(geo.interiors, function (interior) {\n          transformPoints(interior, transform);\n        });\n      } else {\n        each(geo.points, function (points) {\n          transformPoints(points, transform);\n        });\n      }\n    }\n    rect = this._rect;\n    rect.copy(target);\n    // Update center\n    this._center = [rect.x + rect.width / 2, rect.y + rect.height / 2];\n  };\n  GeoJSONRegion.prototype.cloneShallow = function (name) {\n    name == null && (name = this.name);\n    var newRegion = new GeoJSONRegion(name, this.geometries, this._center);\n    newRegion._rect = this._rect;\n    newRegion.transformTo = null; // Simply avoid to be called.\n    return newRegion;\n  };\n  return GeoJSONRegion;\n}(Region);\nexport { GeoJSONRegion };\nvar GeoSVGRegion = /** @class */function (_super) {\n  __extends(GeoSVGRegion, _super);\n  function GeoSVGRegion(name, elOnlyForCalculate) {\n    var _this = _super.call(this, name) || this;\n    _this.type = 'geoSVG';\n    _this._elOnlyForCalculate = elOnlyForCalculate;\n    return _this;\n  }\n  GeoSVGRegion.prototype.calcCenter = function () {\n    var el = this._elOnlyForCalculate;\n    var rect = el.getBoundingRect();\n    var center = [rect.x + rect.width / 2, rect.y + rect.height / 2];\n    var mat = matrix.identity(TMP_TRANSFORM);\n    var target = el;\n    while (target && !target.isGeoSVGGraphicRoot) {\n      matrix.mul(mat, target.getLocalTransform(), mat);\n      target = target.parent;\n    }\n    matrix.invert(mat, mat);\n    vec2.applyTransform(center, center, mat);\n    return center;\n  };\n  return GeoSVGRegion;\n}(Region);\nexport { GeoSVGRegion };", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n/**\n * Parse and decode geo json\n */\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { GeoJSONLineStringGeometry, GeoJSONPolygonGeometry, GeoJSONRegion } from './Region.js';\nfunction decode(json) {\n  if (!json.UTF8Encoding) {\n    return json;\n  }\n  var jsonCompressed = json;\n  var encodeScale = jsonCompressed.UTF8Scale;\n  if (encodeScale == null) {\n    encodeScale = 1024;\n  }\n  var features = jsonCompressed.features;\n  zrUtil.each(features, function (feature) {\n    var geometry = feature.geometry;\n    var encodeOffsets = geometry.encodeOffsets;\n    var coordinates = geometry.coordinates;\n    // Geometry may be appeded manually in the script after json loaded.\n    // In this case this geometry is usually not encoded.\n    if (!encodeOffsets) {\n      return;\n    }\n    switch (geometry.type) {\n      case 'LineString':\n        geometry.coordinates = decodeRing(coordinates, encodeOffsets, encodeScale);\n        break;\n      case 'Polygon':\n        decodeRings(coordinates, encodeOffsets, encodeScale);\n        break;\n      case 'MultiLineString':\n        decodeRings(coordinates, encodeOffsets, encodeScale);\n        break;\n      case 'MultiPolygon':\n        zrUtil.each(coordinates, function (rings, idx) {\n          return decodeRings(rings, encodeOffsets[idx], encodeScale);\n        });\n    }\n  });\n  // Has been decoded\n  jsonCompressed.UTF8Encoding = false;\n  return jsonCompressed;\n}\nfunction decodeRings(rings, encodeOffsets, encodeScale) {\n  for (var c = 0; c < rings.length; c++) {\n    rings[c] = decodeRing(rings[c], encodeOffsets[c], encodeScale);\n  }\n}\nfunction decodeRing(coordinate, encodeOffsets, encodeScale) {\n  var result = [];\n  var prevX = encodeOffsets[0];\n  var prevY = encodeOffsets[1];\n  for (var i = 0; i < coordinate.length; i += 2) {\n    var x = coordinate.charCodeAt(i) - 64;\n    var y = coordinate.charCodeAt(i + 1) - 64;\n    // ZigZag decoding\n    x = x >> 1 ^ -(x & 1);\n    y = y >> 1 ^ -(y & 1);\n    // Delta deocding\n    x += prevX;\n    y += prevY;\n    prevX = x;\n    prevY = y;\n    // Dequantize\n    result.push([x / encodeScale, y / encodeScale]);\n  }\n  return result;\n}\nexport default function parseGeoJSON(geoJson, nameProperty) {\n  geoJson = decode(geoJson);\n  return zrUtil.map(zrUtil.filter(geoJson.features, function (featureObj) {\n    // Output of mapshaper may have geometry null\n    return featureObj.geometry && featureObj.properties && featureObj.geometry.coordinates.length > 0;\n  }), function (featureObj) {\n    var properties = featureObj.properties;\n    var geo = featureObj.geometry;\n    var geometries = [];\n    switch (geo.type) {\n      case 'Polygon':\n        var coordinates = geo.coordinates;\n        // According to the GeoJSON specification.\n        // First must be exterior, and the rest are all interior(holes).\n        geometries.push(new GeoJSONPolygonGeometry(coordinates[0], coordinates.slice(1)));\n        break;\n      case 'MultiPolygon':\n        zrUtil.each(geo.coordinates, function (item) {\n          if (item[0]) {\n            geometries.push(new GeoJSONPolygonGeometry(item[0], item.slice(1)));\n          }\n        });\n        break;\n      case 'LineString':\n        geometries.push(new GeoJSONLineStringGeometry([geo.coordinates]));\n        break;\n      case 'MultiLineString':\n        geometries.push(new GeoJSONLineStringGeometry(geo.coordinates));\n    }\n    var region = new GeoJSONRegion(properties[nameProperty || 'name'], geometries, properties.cp);\n    region.properties = properties;\n    return region;\n  });\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nexport { linearMap, round, asc, getPrecision, getPrecisionSafe, getPixelPrecision, getPercentWithPrecision, parsePercent, MAX_SAFE_INTEGER, remRadian, isRadianAroundZero, parseDate, quantity, quantityExponent, nice, quantile, reformIntervals, isNumeric, numericToNumber } from '../../util/number.js';", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nexport { parseDate as parse } from '../../util/number.js';\nexport { format, roundTime } from '../../util/time.js';", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nexport { extendShape, extendPath, makePath, makeImage, mergePath, resizePath, createIcon, updateProps, initProps, getTransform, clipPointsByRect, clipRectByRect, registerShape, getShapeClass, Group, Image, Text, Circle, Ellipse, Sector, Ring, Polygon, Polyline, Rect, Line, BezierCurve, Arc, IncrementalDisplayable, CompoundPath, LinearGradient, RadialGradient, BoundingRect } from '../../util/graphic.js';", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nexport { addCommas, toCamelCase, normalizeCssArray, encodeHTML, formatTpl, getTooltipMarker, formatTime, capitalFirst, truncateText, getTextRect } from '../../util/format.js';", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nexport { map, each, indexOf, inherits, reduce, filter, bind, curry, isArray, isString, isObject, isFunction, extend, defaults, clone, merge } from 'zrender/lib/core/util.js';", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as textContain from 'zrender/lib/contain/text.js';\nimport { makeInner } from '../util/model.js';\nimport { makeLabelFormatter, getOptionCategoryInterval, shouldShowAllLabels } from './axisHelper.js';\nvar modelInner = makeInner();\nvar axisInner = makeInner();\nexport var AxisTickLabelComputingKind = {\n  estimate: 1,\n  determine: 2\n};\nexport function createAxisLabelsComputingContext(kind) {\n  return {\n    out: {\n      noPxChangeTryDetermine: []\n    },\n    kind: kind\n  };\n}\nfunction tickValuesToNumbers(axis, values) {\n  var nums = zrUtil.map(values, function (val) {\n    return axis.scale.parse(val);\n  });\n  if (axis.type === 'time' && nums.length > 0) {\n    // Time axis needs duplicate first/last tick (see TimeScale.getTicks())\n    // The first and last tick/label don't get drawn\n    nums.sort();\n    nums.unshift(nums[0]);\n    nums.push(nums[nums.length - 1]);\n  }\n  return nums;\n}\nexport function createAxisLabels(axis, ctx) {\n  var custom = axis.getLabelModel().get('customValues');\n  if (custom) {\n    var labelFormatter_1 = makeLabelFormatter(axis);\n    var extent_1 = axis.scale.getExtent();\n    var tickNumbers = tickValuesToNumbers(axis, custom);\n    var ticks = zrUtil.filter(tickNumbers, function (val) {\n      return val >= extent_1[0] && val <= extent_1[1];\n    });\n    return {\n      labels: zrUtil.map(ticks, function (numval) {\n        var tick = {\n          value: numval\n        };\n        return {\n          formattedLabel: labelFormatter_1(tick),\n          rawLabel: axis.scale.getLabel(tick),\n          tickValue: numval,\n          time: undefined,\n          \"break\": undefined\n        };\n      })\n    };\n  }\n  // Only ordinal scale support tick interval\n  return axis.type === 'category' ? makeCategoryLabels(axis, ctx) : makeRealNumberLabels(axis);\n}\n/**\n * @param tickModel For example, can be axisTick, splitLine, splitArea.\n */\nexport function createAxisTicks(axis, tickModel, opt) {\n  var custom = axis.getTickModel().get('customValues');\n  if (custom) {\n    var extent_2 = axis.scale.getExtent();\n    var tickNumbers = tickValuesToNumbers(axis, custom);\n    return {\n      ticks: zrUtil.filter(tickNumbers, function (val) {\n        return val >= extent_2[0] && val <= extent_2[1];\n      })\n    };\n  }\n  // Only ordinal scale support tick interval\n  return axis.type === 'category' ? makeCategoryTicks(axis, tickModel) : {\n    ticks: zrUtil.map(axis.scale.getTicks(opt), function (tick) {\n      return tick.value;\n    })\n  };\n}\nfunction makeCategoryLabels(axis, ctx) {\n  var labelModel = axis.getLabelModel();\n  var result = makeCategoryLabelsActually(axis, labelModel, ctx);\n  return !labelModel.get('show') || axis.scale.isBlank() ? {\n    labels: []\n  } : result;\n}\nfunction makeCategoryLabelsActually(axis, labelModel, ctx) {\n  var labelsCache = ensureCategoryLabelCache(axis);\n  var optionLabelInterval = getOptionCategoryInterval(labelModel);\n  var isEstimate = ctx.kind === AxisTickLabelComputingKind.estimate;\n  // In AxisTickLabelComputingKind.estimate, the result likely varies during a single\n  // pass of ec main process,due to the change of axisExtent, and will not be shared with\n  // splitLine. Therefore no cache is used.\n  if (!isEstimate) {\n    // PENDING: check necessary?\n    var result_1 = axisCacheGet(labelsCache, optionLabelInterval);\n    if (result_1) {\n      return result_1;\n    }\n  }\n  var labels;\n  var numericLabelInterval;\n  if (zrUtil.isFunction(optionLabelInterval)) {\n    labels = makeLabelsByCustomizedCategoryInterval(axis, optionLabelInterval);\n  } else {\n    numericLabelInterval = optionLabelInterval === 'auto' ? makeAutoCategoryInterval(axis, ctx) : optionLabelInterval;\n    labels = makeLabelsByNumericCategoryInterval(axis, numericLabelInterval);\n  }\n  var result = {\n    labels: labels,\n    labelCategoryInterval: numericLabelInterval\n  };\n  if (!isEstimate) {\n    axisCacheSet(labelsCache, optionLabelInterval, result);\n  } else {\n    ctx.out.noPxChangeTryDetermine.push(function () {\n      axisCacheSet(labelsCache, optionLabelInterval, result);\n      return true;\n    });\n  }\n  return result;\n}\nfunction makeCategoryTicks(axis, tickModel) {\n  var ticksCache = ensureCategoryTickCache(axis);\n  var optionTickInterval = getOptionCategoryInterval(tickModel);\n  var result = axisCacheGet(ticksCache, optionTickInterval);\n  if (result) {\n    return result;\n  }\n  var ticks;\n  var tickCategoryInterval;\n  // Optimize for the case that large category data and no label displayed,\n  // we should not return all ticks.\n  if (!tickModel.get('show') || axis.scale.isBlank()) {\n    ticks = [];\n  }\n  if (zrUtil.isFunction(optionTickInterval)) {\n    ticks = makeLabelsByCustomizedCategoryInterval(axis, optionTickInterval, true);\n  }\n  // Always use label interval by default despite label show. Consider this\n  // scenario, Use multiple grid with the xAxis sync, and only one xAxis shows\n  // labels. `splitLine` and `axisTick` should be consistent in this case.\n  else if (optionTickInterval === 'auto') {\n    var labelsResult = makeCategoryLabelsActually(axis, axis.getLabelModel(), createAxisLabelsComputingContext(AxisTickLabelComputingKind.determine));\n    tickCategoryInterval = labelsResult.labelCategoryInterval;\n    ticks = zrUtil.map(labelsResult.labels, function (labelItem) {\n      return labelItem.tickValue;\n    });\n  } else {\n    tickCategoryInterval = optionTickInterval;\n    ticks = makeLabelsByNumericCategoryInterval(axis, tickCategoryInterval, true);\n  }\n  // Cache to avoid calling interval function repeatedly.\n  return axisCacheSet(ticksCache, optionTickInterval, {\n    ticks: ticks,\n    tickCategoryInterval: tickCategoryInterval\n  });\n}\nfunction makeRealNumberLabels(axis) {\n  var ticks = axis.scale.getTicks();\n  var labelFormatter = makeLabelFormatter(axis);\n  return {\n    labels: zrUtil.map(ticks, function (tick, idx) {\n      return {\n        formattedLabel: labelFormatter(tick, idx),\n        rawLabel: axis.scale.getLabel(tick),\n        tickValue: tick.value,\n        time: tick.time,\n        \"break\": tick[\"break\"]\n      };\n    })\n  };\n}\n// Large category data calculation is performance sensitive, and ticks and label probably will\n// be fetched multiple times (e.g. shared by splitLine and axisTick). So we cache the result.\n// axis is created each time during a ec process, so we do not need to clear cache.\nvar ensureCategoryTickCache = initAxisCacheMethod('axisTick');\nvar ensureCategoryLabelCache = initAxisCacheMethod('axisLabel');\n/**\n * PENDING: refactor to JS Map? Because key can be a function or more complicated object, and\n * cache size always is small, and currently no JS Map object key polyfill, we use a simple\n * array cache instead of plain object hash.\n */\nfunction initAxisCacheMethod(prop) {\n  return function ensureCache(axis) {\n    return axisInner(axis)[prop] || (axisInner(axis)[prop] = {\n      list: []\n    });\n  };\n}\nfunction axisCacheGet(cache, key) {\n  for (var i = 0; i < cache.list.length; i++) {\n    if (cache.list[i].key === key) {\n      return cache.list[i].value;\n    }\n  }\n}\nfunction axisCacheSet(cache, key, value) {\n  cache.list.push({\n    key: key,\n    value: value\n  });\n  return value;\n}\nfunction makeAutoCategoryInterval(axis, ctx) {\n  if (ctx.kind === AxisTickLabelComputingKind.estimate) {\n    // Currently axisTick is not involved in estimate kind, and the result likely varies during a\n    // single pass of ec main process, due to the change of axisExtent. Therefore no cache is used.\n    var result_2 = axis.calculateCategoryInterval(ctx);\n    ctx.out.noPxChangeTryDetermine.push(function () {\n      axisInner(axis).autoInterval = result_2;\n      return true;\n    });\n    return result_2;\n  }\n  // Both tick and label uses this result, cacah it to avoid recompute.\n  var result = axisInner(axis).autoInterval;\n  return result != null ? result : axisInner(axis).autoInterval = axis.calculateCategoryInterval(ctx);\n}\n/**\n * Calculate interval for category axis ticks and labels.\n * Use a stretegy to try to avoid overlapping.\n * To get precise result, at least one of `getRotate` and `isHorizontal`\n * should be implemented in axis.\n */\nexport function calculateCategoryInterval(axis, ctx) {\n  var kind = ctx.kind;\n  var params = fetchAutoCategoryIntervalCalculationParams(axis);\n  var labelFormatter = makeLabelFormatter(axis);\n  var rotation = (params.axisRotate - params.labelRotate) / 180 * Math.PI;\n  var ordinalScale = axis.scale;\n  var ordinalExtent = ordinalScale.getExtent();\n  // Providing this method is for optimization:\n  // avoid generating a long array by `getTicks`\n  // in large category data case.\n  var tickCount = ordinalScale.count();\n  if (ordinalExtent[1] - ordinalExtent[0] < 1) {\n    return 0;\n  }\n  var step = 1;\n  // Simple optimization. Arbitrary value.\n  var maxCount = 40;\n  if (tickCount > maxCount) {\n    step = Math.max(1, Math.floor(tickCount / maxCount));\n  }\n  var tickValue = ordinalExtent[0];\n  var unitSpan = axis.dataToCoord(tickValue + 1) - axis.dataToCoord(tickValue);\n  var unitW = Math.abs(unitSpan * Math.cos(rotation));\n  var unitH = Math.abs(unitSpan * Math.sin(rotation));\n  var maxW = 0;\n  var maxH = 0;\n  // Caution: Performance sensitive for large category data.\n  // Consider dataZoom, we should make appropriate step to avoid O(n) loop.\n  for (; tickValue <= ordinalExtent[1]; tickValue += step) {\n    var width = 0;\n    var height = 0;\n    // Not precise, do not consider align and vertical align\n    // and each distance from axis line yet.\n    var rect = textContain.getBoundingRect(labelFormatter({\n      value: tickValue\n    }), params.font, 'center', 'top');\n    // Magic number\n    width = rect.width * 1.3;\n    height = rect.height * 1.3;\n    // Min size, void long loop.\n    maxW = Math.max(maxW, width, 7);\n    maxH = Math.max(maxH, height, 7);\n  }\n  var dw = maxW / unitW;\n  var dh = maxH / unitH;\n  // 0/0 is NaN, 1/0 is Infinity.\n  isNaN(dw) && (dw = Infinity);\n  isNaN(dh) && (dh = Infinity);\n  var interval = Math.max(0, Math.floor(Math.min(dw, dh)));\n  if (kind === AxisTickLabelComputingKind.estimate) {\n    // In estimate kind, the inteval likely varies, thus do not erase the cache.\n    ctx.out.noPxChangeTryDetermine.push(zrUtil.bind(calculateCategoryIntervalTryDetermine, null, axis, interval, tickCount));\n    return interval;\n  }\n  var lastInterval = calculateCategoryIntervalDealCache(axis, interval, tickCount);\n  return lastInterval != null ? lastInterval : interval;\n}\nfunction calculateCategoryIntervalTryDetermine(axis, interval, tickCount) {\n  return calculateCategoryIntervalDealCache(axis, interval, tickCount) == null;\n}\n// Return the lastInterval if need to use it, otherwise return NullUndefined and save cache.\nfunction calculateCategoryIntervalDealCache(axis, interval, tickCount) {\n  var cache = modelInner(axis.model);\n  var axisExtent = axis.getExtent();\n  var lastAutoInterval = cache.lastAutoInterval;\n  var lastTickCount = cache.lastTickCount;\n  // Use cache to keep interval stable while moving zoom window,\n  // otherwise the calculated interval might jitter when the zoom\n  // window size is close to the interval-changing size.\n  // For example, if all of the axis labels are `a, b, c, d, e, f, g`.\n  // The jitter will cause that sometimes the displayed labels are\n  // `a, d, g` (interval: 2) sometimes `a, c, e`(interval: 1).\n  if (lastAutoInterval != null && lastTickCount != null && Math.abs(lastAutoInterval - interval) <= 1 && Math.abs(lastTickCount - tickCount) <= 1\n  // Always choose the bigger one, otherwise the critical\n  // point is not the same when zooming in or zooming out.\n  && lastAutoInterval > interval\n  // If the axis change is caused by chart resize, the cache should not\n  // be used. Otherwise some hidden labels might not be shown again.\n  && cache.axisExtent0 === axisExtent[0] && cache.axisExtent1 === axisExtent[1]) {\n    return lastAutoInterval;\n  }\n  // Only update cache if cache not used, otherwise the\n  // changing of interval is too insensitive.\n  else {\n    cache.lastTickCount = tickCount;\n    cache.lastAutoInterval = interval;\n    cache.axisExtent0 = axisExtent[0];\n    cache.axisExtent1 = axisExtent[1];\n  }\n}\nfunction fetchAutoCategoryIntervalCalculationParams(axis) {\n  var labelModel = axis.getLabelModel();\n  return {\n    axisRotate: axis.getRotate ? axis.getRotate() : axis.isHorizontal && !axis.isHorizontal() ? 90 : 0,\n    labelRotate: labelModel.get('rotate') || 0,\n    font: labelModel.getFont()\n  };\n}\nfunction makeLabelsByNumericCategoryInterval(axis, categoryInterval, onlyTick) {\n  var labelFormatter = makeLabelFormatter(axis);\n  var ordinalScale = axis.scale;\n  var ordinalExtent = ordinalScale.getExtent();\n  var labelModel = axis.getLabelModel();\n  var result = [];\n  // TODO: axisType: ordinalTime, pick the tick from each month/day/year/...\n  var step = Math.max((categoryInterval || 0) + 1, 1);\n  var startTick = ordinalExtent[0];\n  var tickCount = ordinalScale.count();\n  // Calculate start tick based on zero if possible to keep label consistent\n  // while zooming and moving while interval > 0. Otherwise the selection\n  // of displayable ticks and symbols probably keep changing.\n  // 3 is empirical value.\n  if (startTick !== 0 && step > 1 && tickCount / step > 2) {\n    startTick = Math.round(Math.ceil(startTick / step) * step);\n  }\n  // (1) Only add min max label here but leave overlap checking\n  // to render stage, which also ensure the returned list\n  // suitable for splitLine and splitArea rendering.\n  // (2) Scales except category always contain min max label so\n  // do not need to perform this process.\n  var showAllLabel = shouldShowAllLabels(axis);\n  var includeMinLabel = labelModel.get('showMinLabel') || showAllLabel;\n  var includeMaxLabel = labelModel.get('showMaxLabel') || showAllLabel;\n  if (includeMinLabel && startTick !== ordinalExtent[0]) {\n    addItem(ordinalExtent[0]);\n  }\n  // Optimize: avoid generating large array by `ordinalScale.getTicks()`.\n  var tickValue = startTick;\n  for (; tickValue <= ordinalExtent[1]; tickValue += step) {\n    addItem(tickValue);\n  }\n  if (includeMaxLabel && tickValue - step !== ordinalExtent[1]) {\n    addItem(ordinalExtent[1]);\n  }\n  function addItem(tickValue) {\n    var tickObj = {\n      value: tickValue\n    };\n    result.push(onlyTick ? tickValue : {\n      formattedLabel: labelFormatter(tickObj),\n      rawLabel: ordinalScale.getLabel(tickObj),\n      tickValue: tickValue,\n      time: undefined,\n      \"break\": undefined\n    });\n  }\n  return result;\n}\nfunction makeLabelsByCustomizedCategoryInterval(axis, categoryInterval, onlyTick) {\n  var ordinalScale = axis.scale;\n  var labelFormatter = makeLabelFormatter(axis);\n  var result = [];\n  zrUtil.each(ordinalScale.getTicks(), function (tick) {\n    var rawLabel = ordinalScale.getLabel(tick);\n    var tickValue = tick.value;\n    if (categoryInterval(tick.value, rawLabel)) {\n      result.push(onlyTick ? tickValue : {\n        formattedLabel: labelFormatter(tick),\n        rawLabel: rawLabel,\n        tickValue: tickValue,\n        time: undefined,\n        \"break\": undefined\n      });\n    }\n  });\n  return result;\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { each, map } from 'zrender/lib/core/util.js';\nimport { linearMap, getPixelPrecision, round } from '../util/number.js';\nimport { createAxisTicks, createAxisLabels, calculateCategoryInterval, AxisTickLabelComputingKind, createAxisLabelsComputingContext } from './axisTickLabelBuilder.js';\nvar NORMALIZED_EXTENT = [0, 1];\n/**\n * Base class of Axis.\n *\n * Lifetime: recreate for each main process.\n * [NOTICE]: Some caches is stored on the axis instance (see `axisTickLabelBuilder.ts`)\n *  which is based on this lifetime.\n */\nvar Axis = /** @class */function () {\n  function Axis(dim, scale, extent) {\n    this.onBand = false;\n    // Make sure that `extent[0] > extent[1]` only if `inverse: true`.\n    // `inverse` can be inferred by `extent` unless `extent[0] === extent[1]`.\n    this.inverse = false;\n    this.dim = dim;\n    this.scale = scale;\n    this._extent = extent || [0, 0];\n  }\n  /**\n   * If axis extent contain given coord\n   */\n  Axis.prototype.contain = function (coord) {\n    var extent = this._extent;\n    var min = Math.min(extent[0], extent[1]);\n    var max = Math.max(extent[0], extent[1]);\n    return coord >= min && coord <= max;\n  };\n  /**\n   * If axis extent contain given data\n   */\n  Axis.prototype.containData = function (data) {\n    return this.scale.contain(this.scale.parse(data));\n  };\n  /**\n   * Get coord extent.\n   */\n  Axis.prototype.getExtent = function () {\n    return this._extent.slice();\n  };\n  /**\n   * Get precision used for formatting\n   */\n  Axis.prototype.getPixelPrecision = function (dataExtent) {\n    return getPixelPrecision(dataExtent || this.scale.getExtent(), this._extent);\n  };\n  /**\n   * Set coord extent\n   */\n  Axis.prototype.setExtent = function (start, end) {\n    var extent = this._extent;\n    extent[0] = start;\n    extent[1] = end;\n  };\n  /**\n   * Convert data to coord. Data is the rank if it has an ordinal scale\n   */\n  Axis.prototype.dataToCoord = function (data, clamp) {\n    var extent = this._extent;\n    var scale = this.scale;\n    data = scale.normalize(scale.parse(data));\n    if (this.onBand && scale.type === 'ordinal') {\n      extent = extent.slice();\n      fixExtentWithBands(extent, scale.count());\n    }\n    return linearMap(data, NORMALIZED_EXTENT, extent, clamp);\n  };\n  /**\n   * Convert coord to data. Data is the rank if it has an ordinal scale\n   */\n  Axis.prototype.coordToData = function (coord, clamp) {\n    var extent = this._extent;\n    var scale = this.scale;\n    if (this.onBand && scale.type === 'ordinal') {\n      extent = extent.slice();\n      fixExtentWithBands(extent, scale.count());\n    }\n    var t = linearMap(coord, extent, NORMALIZED_EXTENT, clamp);\n    return this.scale.scale(t);\n  };\n  /**\n   * Convert pixel point to data in axis\n   */\n  Axis.prototype.pointToData = function (point, clamp) {\n    // Should be implemented in derived class if necessary.\n    return;\n  };\n  /**\n   * Different from `zrUtil.map(axis.getTicks(), axis.dataToCoord, axis)`,\n   * `axis.getTicksCoords` considers `onBand`, which is used by\n   * `boundaryGap:true` of category axis and splitLine and splitArea.\n   * @param opt.tickModel default: axis.model.getModel('axisTick')\n   * @param opt.clamp If `true`, the first and the last\n   *        tick must be at the axis end points. Otherwise, clip ticks\n   *        that outside the axis extent.\n   */\n  Axis.prototype.getTicksCoords = function (opt) {\n    opt = opt || {};\n    var tickModel = opt.tickModel || this.getTickModel();\n    var result = createAxisTicks(this, tickModel, {\n      breakTicks: opt.breakTicks,\n      pruneByBreak: opt.pruneByBreak\n    });\n    var ticks = result.ticks;\n    var ticksCoords = map(ticks, function (tickVal) {\n      return {\n        coord: this.dataToCoord(this.scale.type === 'ordinal' ? this.scale.getRawOrdinalNumber(tickVal) : tickVal),\n        tickValue: tickVal\n      };\n    }, this);\n    var alignWithLabel = tickModel.get('alignWithLabel');\n    fixOnBandTicksCoords(this, ticksCoords, alignWithLabel, opt.clamp);\n    return ticksCoords;\n  };\n  Axis.prototype.getMinorTicksCoords = function () {\n    if (this.scale.type === 'ordinal') {\n      // Category axis doesn't support minor ticks\n      return [];\n    }\n    var minorTickModel = this.model.getModel('minorTick');\n    var splitNumber = minorTickModel.get('splitNumber');\n    // Protection.\n    if (!(splitNumber > 0 && splitNumber < 100)) {\n      splitNumber = 5;\n    }\n    var minorTicks = this.scale.getMinorTicks(splitNumber);\n    var minorTicksCoords = map(minorTicks, function (minorTicksGroup) {\n      return map(minorTicksGroup, function (minorTick) {\n        return {\n          coord: this.dataToCoord(minorTick),\n          tickValue: minorTick\n        };\n      }, this);\n    }, this);\n    return minorTicksCoords;\n  };\n  Axis.prototype.getViewLabels = function (ctx) {\n    ctx = ctx || createAxisLabelsComputingContext(AxisTickLabelComputingKind.determine);\n    return createAxisLabels(this, ctx).labels;\n  };\n  Axis.prototype.getLabelModel = function () {\n    return this.model.getModel('axisLabel');\n  };\n  /**\n   * Notice here we only get the default tick model. For splitLine\n   * or splitArea, we should pass the splitLineModel or splitAreaModel\n   * manually when calling `getTicksCoords`.\n   * In GL, this method may be overridden to:\n   * `axisModel.getModel('axisTick', grid3DModel.getModel('axisTick'));`\n   */\n  Axis.prototype.getTickModel = function () {\n    return this.model.getModel('axisTick');\n  };\n  /**\n   * Get width of band\n   */\n  Axis.prototype.getBandWidth = function () {\n    var axisExtent = this._extent;\n    var dataExtent = this.scale.getExtent();\n    var len = dataExtent[1] - dataExtent[0] + (this.onBand ? 1 : 0);\n    // Fix #2728, avoid NaN when only one data.\n    len === 0 && (len = 1);\n    var size = Math.abs(axisExtent[1] - axisExtent[0]);\n    return Math.abs(size) / len;\n  };\n  /**\n   * Only be called in category axis.\n   * Can be overridden, consider other axes like in 3D.\n   * @return Auto interval for cateogry axis tick and label\n   */\n  Axis.prototype.calculateCategoryInterval = function (ctx) {\n    ctx = ctx || createAxisLabelsComputingContext(AxisTickLabelComputingKind.determine);\n    return calculateCategoryInterval(this, ctx);\n  };\n  return Axis;\n}();\nfunction fixExtentWithBands(extent, nTick) {\n  var size = extent[1] - extent[0];\n  var len = nTick;\n  var margin = size / len / 2;\n  extent[0] += margin;\n  extent[1] -= margin;\n}\n// If axis has labels [1, 2, 3, 4]. Bands on the axis are\n// |---1---|---2---|---3---|---4---|.\n// So the displayed ticks and splitLine/splitArea should between\n// each data item, otherwise cause misleading (e.g., split tow bars\n// of a single data item when there are two bar series).\n// Also consider if tickCategoryInterval > 0 and onBand, ticks and\n// splitLine/spliteArea should layout appropriately corresponding\n// to displayed labels. (So we should not use `getBandWidth` in this\n// case).\nfunction fixOnBandTicksCoords(axis, ticksCoords, alignWithLabel, clamp) {\n  var ticksLen = ticksCoords.length;\n  if (!axis.onBand || alignWithLabel || !ticksLen) {\n    return;\n  }\n  var axisExtent = axis.getExtent();\n  var last;\n  var diffSize;\n  if (ticksLen === 1) {\n    ticksCoords[0].coord = axisExtent[0];\n    ticksCoords[0].onBand = true;\n    last = ticksCoords[1] = {\n      coord: axisExtent[1],\n      tickValue: ticksCoords[0].tickValue,\n      onBand: true\n    };\n  } else {\n    var crossLen = ticksCoords[ticksLen - 1].tickValue - ticksCoords[0].tickValue;\n    var shift_1 = (ticksCoords[ticksLen - 1].coord - ticksCoords[0].coord) / crossLen;\n    each(ticksCoords, function (ticksItem) {\n      ticksItem.coord -= shift_1 / 2;\n      ticksItem.onBand = true;\n    });\n    var dataExtent = axis.scale.getExtent();\n    diffSize = 1 + dataExtent[1] - ticksCoords[ticksLen - 1].tickValue;\n    last = {\n      coord: ticksCoords[ticksLen - 1].coord + shift_1 * diffSize,\n      tickValue: dataExtent[1] + 1,\n      onBand: true\n    };\n    ticksCoords.push(last);\n  }\n  var inverse = axisExtent[0] > axisExtent[1];\n  // Handling clamp.\n  if (littleThan(ticksCoords[0].coord, axisExtent[0])) {\n    clamp ? ticksCoords[0].coord = axisExtent[0] : ticksCoords.shift();\n  }\n  if (clamp && littleThan(axisExtent[0], ticksCoords[0].coord)) {\n    ticksCoords.unshift({\n      coord: axisExtent[0],\n      onBand: true\n    });\n  }\n  if (littleThan(axisExtent[1], last.coord)) {\n    clamp ? last.coord = axisExtent[1] : ticksCoords.pop();\n  }\n  if (clamp && littleThan(last.coord, axisExtent[1])) {\n    ticksCoords.push({\n      coord: axisExtent[1],\n      onBand: true\n    });\n  }\n  function littleThan(a, b) {\n    // Avoid rounding error cause calculated tick coord different with extent.\n    // It may cause an extra unnecessary tick added.\n    a = round(a);\n    b = round(b);\n    return inverse ? a > b : a < b;\n  }\n}\nexport default Axis;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n// These APIs are for more advanced usages\n// For example extend charts and components, creating graphic elements, formatting.\nimport ComponentModel from '../model/Component.js';\nimport ComponentView from '../view/Component.js';\nimport SeriesModel from '../model/Series.js';\nimport ChartView from '../view/Chart.js';\nimport SeriesData from '../data/SeriesData.js';\nimport * as zrender_1 from 'zrender/lib/zrender.js';\nexport { zrender_1 as zrender };\nimport * as matrix_1 from 'zrender/lib/core/matrix.js';\nexport { matrix_1 as matrix };\nimport * as vector_1 from 'zrender/lib/core/vector.js';\nexport { vector_1 as vector };\nimport * as zrUtil_1 from 'zrender/lib/core/util.js';\nexport { zrUtil_1 as zrUtil };\nimport * as color_1 from 'zrender/lib/tool/color.js';\nexport { color_1 as color };\nexport { throttle } from '../util/throttle.js';\nimport * as helper_1 from './api/helper.js';\nexport { helper_1 as helper };\nexport { use } from '../extension.js';\nexport { setPlatformAPI } from 'zrender/lib/core/platform.js';\n// --------------------- Helper Methods ---------------------\nexport { default as parseGeoJSON } from '../coord/geo/parseGeoJson.js';\nexport { default as parseGeoJson } from '../coord/geo/parseGeoJson.js';\nimport * as number_1 from './api/number.js';\nexport { number_1 as number };\nimport * as time_1 from './api/time.js';\nexport { time_1 as time };\nimport * as graphic_1 from './api/graphic.js';\nexport { graphic_1 as graphic };\nimport * as format_1 from './api/format.js';\nexport { format_1 as format };\nimport * as util_1 from './api/util.js';\nexport { util_1 as util };\nexport { default as env } from 'zrender/lib/core/env.js';\n// --------------------- Export for Extension Usage ---------------------\n// export {SeriesData};\nexport { SeriesData as List }; // TODO: Compatitable with exists echarts-gl code\nexport { default as Model } from '../model/Model.js';\nexport { default as Axis } from '../coord/Axis.js';\nexport { ComponentModel, ComponentView, SeriesModel, ChartView };\n// Only for GL\nexport { brushSingle as innerDrawElementOnCanvas } from 'zrender/lib/canvas/graphic.js';\n// --------------------- Deprecated Extension Methods ---------------------\n// Should use `ComponentModel.extend` or `class XXXX extend ComponentModel` to create class.\n// Then use `registerComponentModel` in `install` parameter when `use` this extension. For example:\n// class Bar3DModel extends ComponentModel {}\n// export function install(registers) { registers.registerComponentModel(Bar3DModel); }\n// echarts.use(install);\nexport function extendComponentModel(proto) {\n  var Model = ComponentModel.extend(proto);\n  ComponentModel.registerClass(Model);\n  return Model;\n}\nexport function extendComponentView(proto) {\n  var View = ComponentView.extend(proto);\n  ComponentView.registerClass(View);\n  return View;\n}\nexport function extendSeriesModel(proto) {\n  var Model = SeriesModel.extend(proto);\n  SeriesModel.registerClass(Model);\n  return Model;\n}\nexport function extendChartView(proto) {\n  var View = ChartView.extend(proto);\n  ChartView.registerClass(View);\n  return View;\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { Point, Path, Polyline } from '../util/graphic.js';\nimport PathProxy from 'zrender/lib/core/PathProxy.js';\nimport { normalizeRadian } from 'zrender/lib/contain/util.js';\nimport { cubicProjectPoint, quadraticProjectPoint } from 'zrender/lib/core/curve.js';\nimport { defaults, retrieve2 } from 'zrender/lib/core/util.js';\nimport { invert } from 'zrender/lib/core/matrix.js';\nimport * as vector from 'zrender/lib/core/vector.js';\nimport { DISPLAY_STATES, SPECIAL_STATES } from '../util/states.js';\nvar PI2 = Math.PI * 2;\nvar CMD = PathProxy.CMD;\nvar DEFAULT_SEARCH_SPACE = ['top', 'right', 'bottom', 'left'];\nfunction getCandidateAnchor(pos, distance, rect, outPt, outDir) {\n  var width = rect.width;\n  var height = rect.height;\n  switch (pos) {\n    case 'top':\n      outPt.set(rect.x + width / 2, rect.y - distance);\n      outDir.set(0, -1);\n      break;\n    case 'bottom':\n      outPt.set(rect.x + width / 2, rect.y + height + distance);\n      outDir.set(0, 1);\n      break;\n    case 'left':\n      outPt.set(rect.x - distance, rect.y + height / 2);\n      outDir.set(-1, 0);\n      break;\n    case 'right':\n      outPt.set(rect.x + width + distance, rect.y + height / 2);\n      outDir.set(1, 0);\n      break;\n  }\n}\nfunction projectPointToArc(cx, cy, r, startAngle, endAngle, anticlockwise, x, y, out) {\n  x -= cx;\n  y -= cy;\n  var d = Math.sqrt(x * x + y * y);\n  x /= d;\n  y /= d;\n  // Intersect point.\n  var ox = x * r + cx;\n  var oy = y * r + cy;\n  if (Math.abs(startAngle - endAngle) % PI2 < 1e-4) {\n    // Is a circle\n    out[0] = ox;\n    out[1] = oy;\n    return d - r;\n  }\n  if (anticlockwise) {\n    var tmp = startAngle;\n    startAngle = normalizeRadian(endAngle);\n    endAngle = normalizeRadian(tmp);\n  } else {\n    startAngle = normalizeRadian(startAngle);\n    endAngle = normalizeRadian(endAngle);\n  }\n  if (startAngle > endAngle) {\n    endAngle += PI2;\n  }\n  var angle = Math.atan2(y, x);\n  if (angle < 0) {\n    angle += PI2;\n  }\n  if (angle >= startAngle && angle <= endAngle || angle + PI2 >= startAngle && angle + PI2 <= endAngle) {\n    // Project point is on the arc.\n    out[0] = ox;\n    out[1] = oy;\n    return d - r;\n  }\n  var x1 = r * Math.cos(startAngle) + cx;\n  var y1 = r * Math.sin(startAngle) + cy;\n  var x2 = r * Math.cos(endAngle) + cx;\n  var y2 = r * Math.sin(endAngle) + cy;\n  var d1 = (x1 - x) * (x1 - x) + (y1 - y) * (y1 - y);\n  var d2 = (x2 - x) * (x2 - x) + (y2 - y) * (y2 - y);\n  if (d1 < d2) {\n    out[0] = x1;\n    out[1] = y1;\n    return Math.sqrt(d1);\n  } else {\n    out[0] = x2;\n    out[1] = y2;\n    return Math.sqrt(d2);\n  }\n}\nfunction projectPointToLine(x1, y1, x2, y2, x, y, out, limitToEnds) {\n  var dx = x - x1;\n  var dy = y - y1;\n  var dx1 = x2 - x1;\n  var dy1 = y2 - y1;\n  var lineLen = Math.sqrt(dx1 * dx1 + dy1 * dy1);\n  dx1 /= lineLen;\n  dy1 /= lineLen;\n  // dot product\n  var projectedLen = dx * dx1 + dy * dy1;\n  var t = projectedLen / lineLen;\n  if (limitToEnds) {\n    t = Math.min(Math.max(t, 0), 1);\n  }\n  t *= lineLen;\n  var ox = out[0] = x1 + t * dx1;\n  var oy = out[1] = y1 + t * dy1;\n  return Math.sqrt((ox - x) * (ox - x) + (oy - y) * (oy - y));\n}\nfunction projectPointToRect(x1, y1, width, height, x, y, out) {\n  if (width < 0) {\n    x1 = x1 + width;\n    width = -width;\n  }\n  if (height < 0) {\n    y1 = y1 + height;\n    height = -height;\n  }\n  var x2 = x1 + width;\n  var y2 = y1 + height;\n  var ox = out[0] = Math.min(Math.max(x, x1), x2);\n  var oy = out[1] = Math.min(Math.max(y, y1), y2);\n  return Math.sqrt((ox - x) * (ox - x) + (oy - y) * (oy - y));\n}\nvar tmpPt = [];\nfunction nearestPointOnRect(pt, rect, out) {\n  var dist = projectPointToRect(rect.x, rect.y, rect.width, rect.height, pt.x, pt.y, tmpPt);\n  out.set(tmpPt[0], tmpPt[1]);\n  return dist;\n}\n/**\n * Calculate min distance corresponding point.\n * This method won't evaluate if point is in the path.\n */\nfunction nearestPointOnPath(pt, path, out) {\n  var xi = 0;\n  var yi = 0;\n  var x0 = 0;\n  var y0 = 0;\n  var x1;\n  var y1;\n  var minDist = Infinity;\n  var data = path.data;\n  var x = pt.x;\n  var y = pt.y;\n  for (var i = 0; i < data.length;) {\n    var cmd = data[i++];\n    if (i === 1) {\n      xi = data[i];\n      yi = data[i + 1];\n      x0 = xi;\n      y0 = yi;\n    }\n    var d = minDist;\n    switch (cmd) {\n      case CMD.M:\n        // moveTo \u547D\u4EE4\u91CD\u65B0\u521B\u5EFA\u4E00\u4E2A\u65B0\u7684 subpath, \u5E76\u4E14\u66F4\u65B0\u65B0\u7684\u8D77\u70B9\n        // \u5728 closePath \u7684\u65F6\u5019\u4F7F\u7528\n        x0 = data[i++];\n        y0 = data[i++];\n        xi = x0;\n        yi = y0;\n        break;\n      case CMD.L:\n        d = projectPointToLine(xi, yi, data[i], data[i + 1], x, y, tmpPt, true);\n        xi = data[i++];\n        yi = data[i++];\n        break;\n      case CMD.C:\n        d = cubicProjectPoint(xi, yi, data[i++], data[i++], data[i++], data[i++], data[i], data[i + 1], x, y, tmpPt);\n        xi = data[i++];\n        yi = data[i++];\n        break;\n      case CMD.Q:\n        d = quadraticProjectPoint(xi, yi, data[i++], data[i++], data[i], data[i + 1], x, y, tmpPt);\n        xi = data[i++];\n        yi = data[i++];\n        break;\n      case CMD.A:\n        // TODO Arc \u5224\u65AD\u7684\u5F00\u9500\u6BD4\u8F83\u5927\n        var cx = data[i++];\n        var cy = data[i++];\n        var rx = data[i++];\n        var ry = data[i++];\n        var theta = data[i++];\n        var dTheta = data[i++];\n        // TODO Arc \u65CB\u8F6C\n        i += 1;\n        var anticlockwise = !!(1 - data[i++]);\n        x1 = Math.cos(theta) * rx + cx;\n        y1 = Math.sin(theta) * ry + cy;\n        // \u4E0D\u662F\u76F4\u63A5\u4F7F\u7528 arc \u547D\u4EE4\n        if (i <= 1) {\n          // \u7B2C\u4E00\u4E2A\u547D\u4EE4\u8D77\u70B9\u8FD8\u672A\u5B9A\u4E49\n          x0 = x1;\n          y0 = y1;\n        }\n        // zr \u4F7F\u7528scale\u6765\u6A21\u62DF\u692D\u5706, \u8FD9\u91CC\u4E5F\u5BF9x\u505A\u4E00\u5B9A\u7684\u7F29\u653E\n        var _x = (x - cx) * ry / rx + cx;\n        d = projectPointToArc(cx, cy, ry, theta, theta + dTheta, anticlockwise, _x, y, tmpPt);\n        xi = Math.cos(theta + dTheta) * rx + cx;\n        yi = Math.sin(theta + dTheta) * ry + cy;\n        break;\n      case CMD.R:\n        x0 = xi = data[i++];\n        y0 = yi = data[i++];\n        var width = data[i++];\n        var height = data[i++];\n        d = projectPointToRect(x0, y0, width, height, x, y, tmpPt);\n        break;\n      case CMD.Z:\n        d = projectPointToLine(xi, yi, x0, y0, x, y, tmpPt, true);\n        xi = x0;\n        yi = y0;\n        break;\n    }\n    if (d < minDist) {\n      minDist = d;\n      out.set(tmpPt[0], tmpPt[1]);\n    }\n  }\n  return minDist;\n}\n// Temporal variable for intermediate usage.\nvar pt0 = new Point();\nvar pt1 = new Point();\nvar pt2 = new Point();\nvar dir = new Point();\nvar dir2 = new Point();\n/**\n * Calculate a proper guide line based on the label position and graphic element definition\n * @param label\n * @param labelRect\n * @param target\n * @param targetRect\n */\nexport function updateLabelLinePoints(target, labelLineModel) {\n  if (!target) {\n    return;\n  }\n  var labelLine = target.getTextGuideLine();\n  var label = target.getTextContent();\n  // Needs to create text guide in each charts.\n  if (!(label && labelLine)) {\n    return;\n  }\n  var labelGuideConfig = target.textGuideLineConfig || {};\n  var points = [[0, 0], [0, 0], [0, 0]];\n  var searchSpace = labelGuideConfig.candidates || DEFAULT_SEARCH_SPACE;\n  var labelRect = label.getBoundingRect().clone();\n  labelRect.applyTransform(label.getComputedTransform());\n  var minDist = Infinity;\n  var anchorPoint = labelGuideConfig.anchor;\n  var targetTransform = target.getComputedTransform();\n  var targetInversedTransform = targetTransform && invert([], targetTransform);\n  var len = labelLineModel.get('length2') || 0;\n  if (anchorPoint) {\n    pt2.copy(anchorPoint);\n  }\n  for (var i = 0; i < searchSpace.length; i++) {\n    var candidate = searchSpace[i];\n    getCandidateAnchor(candidate, 0, labelRect, pt0, dir);\n    Point.scaleAndAdd(pt1, pt0, dir, len);\n    // Transform to target coord space.\n    pt1.transform(targetInversedTransform);\n    // Note: getBoundingRect will ensure the `path` being created.\n    var boundingRect = target.getBoundingRect();\n    var dist = anchorPoint ? anchorPoint.distance(pt1) : target instanceof Path ? nearestPointOnPath(pt1, target.path, pt2) : nearestPointOnRect(pt1, boundingRect, pt2);\n    // TODO pt2 is in the path\n    if (dist < minDist) {\n      minDist = dist;\n      // Transform back to global space.\n      pt1.transform(targetTransform);\n      pt2.transform(targetTransform);\n      pt2.toArray(points[0]);\n      pt1.toArray(points[1]);\n      pt0.toArray(points[2]);\n    }\n  }\n  limitTurnAngle(points, labelLineModel.get('minTurnAngle'));\n  labelLine.setShape({\n    points: points\n  });\n}\n// Temporal variable for the limitTurnAngle function\nvar tmpArr = [];\nvar tmpProjPoint = new Point();\n/**\n * Reduce the line segment attached to the label to limit the turn angle between two segments.\n * @param linePoints\n * @param minTurnAngle Radian of minimum turn angle. 0 - 180\n */\nexport function limitTurnAngle(linePoints, minTurnAngle) {\n  if (!(minTurnAngle <= 180 && minTurnAngle > 0)) {\n    return;\n  }\n  minTurnAngle = minTurnAngle / 180 * Math.PI;\n  // The line points can be\n  //      /pt1----pt2 (label)\n  //     /\n  // pt0/\n  pt0.fromArray(linePoints[0]);\n  pt1.fromArray(linePoints[1]);\n  pt2.fromArray(linePoints[2]);\n  Point.sub(dir, pt0, pt1);\n  Point.sub(dir2, pt2, pt1);\n  var len1 = dir.len();\n  var len2 = dir2.len();\n  if (len1 < 1e-3 || len2 < 1e-3) {\n    return;\n  }\n  dir.scale(1 / len1);\n  dir2.scale(1 / len2);\n  var angleCos = dir.dot(dir2);\n  var minTurnAngleCos = Math.cos(minTurnAngle);\n  if (minTurnAngleCos < angleCos) {\n    // Smaller than minTurnAngle\n    // Calculate project point of pt0 on pt1-pt2\n    var d = projectPointToLine(pt1.x, pt1.y, pt2.x, pt2.y, pt0.x, pt0.y, tmpArr, false);\n    tmpProjPoint.fromArray(tmpArr);\n    // Calculate new projected length with limited minTurnAngle and get the new connect point\n    tmpProjPoint.scaleAndAdd(dir2, d / Math.tan(Math.PI - minTurnAngle));\n    // Limit the new calculated connect point between pt1 and pt2.\n    var t = pt2.x !== pt1.x ? (tmpProjPoint.x - pt1.x) / (pt2.x - pt1.x) : (tmpProjPoint.y - pt1.y) / (pt2.y - pt1.y);\n    if (isNaN(t)) {\n      return;\n    }\n    if (t < 0) {\n      Point.copy(tmpProjPoint, pt1);\n    } else if (t > 1) {\n      Point.copy(tmpProjPoint, pt2);\n    }\n    tmpProjPoint.toArray(linePoints[1]);\n  }\n}\n/**\n * Limit the angle of line and the surface\n * @param maxSurfaceAngle Radian of minimum turn angle. 0 - 180. 0 is same direction to normal. 180 is opposite\n */\nexport function limitSurfaceAngle(linePoints, surfaceNormal, maxSurfaceAngle) {\n  if (!(maxSurfaceAngle <= 180 && maxSurfaceAngle > 0)) {\n    return;\n  }\n  maxSurfaceAngle = maxSurfaceAngle / 180 * Math.PI;\n  pt0.fromArray(linePoints[0]);\n  pt1.fromArray(linePoints[1]);\n  pt2.fromArray(linePoints[2]);\n  Point.sub(dir, pt1, pt0);\n  Point.sub(dir2, pt2, pt1);\n  var len1 = dir.len();\n  var len2 = dir2.len();\n  if (len1 < 1e-3 || len2 < 1e-3) {\n    return;\n  }\n  dir.scale(1 / len1);\n  dir2.scale(1 / len2);\n  var angleCos = dir.dot(surfaceNormal);\n  var maxSurfaceAngleCos = Math.cos(maxSurfaceAngle);\n  if (angleCos < maxSurfaceAngleCos) {\n    // Calculate project point of pt0 on pt1-pt2\n    var d = projectPointToLine(pt1.x, pt1.y, pt2.x, pt2.y, pt0.x, pt0.y, tmpArr, false);\n    tmpProjPoint.fromArray(tmpArr);\n    var HALF_PI = Math.PI / 2;\n    var angle2 = Math.acos(dir2.dot(surfaceNormal));\n    var newAngle = HALF_PI + angle2 - maxSurfaceAngle;\n    if (newAngle >= HALF_PI) {\n      // parallel\n      Point.copy(tmpProjPoint, pt2);\n    } else {\n      // Calculate new projected length with limited minTurnAngle and get the new connect point\n      tmpProjPoint.scaleAndAdd(dir2, d / Math.tan(Math.PI / 2 - newAngle));\n      // Limit the new calculated connect point between pt1 and pt2.\n      var t = pt2.x !== pt1.x ? (tmpProjPoint.x - pt1.x) / (pt2.x - pt1.x) : (tmpProjPoint.y - pt1.y) / (pt2.y - pt1.y);\n      if (isNaN(t)) {\n        return;\n      }\n      if (t < 0) {\n        Point.copy(tmpProjPoint, pt1);\n      } else if (t > 1) {\n        Point.copy(tmpProjPoint, pt2);\n      }\n    }\n    tmpProjPoint.toArray(linePoints[1]);\n  }\n}\nfunction setLabelLineState(labelLine, ignore, stateName, stateModel) {\n  var isNormal = stateName === 'normal';\n  var stateObj = isNormal ? labelLine : labelLine.ensureState(stateName);\n  // Make sure display.\n  stateObj.ignore = ignore;\n  // Set smooth\n  var smooth = stateModel.get('smooth');\n  if (smooth && smooth === true) {\n    smooth = 0.3;\n  }\n  stateObj.shape = stateObj.shape || {};\n  if (smooth > 0) {\n    stateObj.shape.smooth = smooth;\n  }\n  var styleObj = stateModel.getModel('lineStyle').getLineStyle();\n  isNormal ? labelLine.useStyle(styleObj) : stateObj.style = styleObj;\n}\nfunction buildLabelLinePath(path, shape) {\n  var smooth = shape.smooth;\n  var points = shape.points;\n  if (!points) {\n    return;\n  }\n  path.moveTo(points[0][0], points[0][1]);\n  if (smooth > 0 && points.length >= 3) {\n    var len1 = vector.dist(points[0], points[1]);\n    var len2 = vector.dist(points[1], points[2]);\n    if (!len1 || !len2) {\n      path.lineTo(points[1][0], points[1][1]);\n      path.lineTo(points[2][0], points[2][1]);\n      return;\n    }\n    var moveLen = Math.min(len1, len2) * smooth;\n    var midPoint0 = vector.lerp([], points[1], points[0], moveLen / len1);\n    var midPoint2 = vector.lerp([], points[1], points[2], moveLen / len2);\n    var midPoint1 = vector.lerp([], midPoint0, midPoint2, 0.5);\n    path.bezierCurveTo(midPoint0[0], midPoint0[1], midPoint0[0], midPoint0[1], midPoint1[0], midPoint1[1]);\n    path.bezierCurveTo(midPoint2[0], midPoint2[1], midPoint2[0], midPoint2[1], points[2][0], points[2][1]);\n  } else {\n    for (var i = 1; i < points.length; i++) {\n      path.lineTo(points[i][0], points[i][1]);\n    }\n  }\n}\n/**\n * Create a label line if necessary and set it's style.\n */\nexport function setLabelLineStyle(targetEl, statesModels, defaultStyle) {\n  var labelLine = targetEl.getTextGuideLine();\n  var label = targetEl.getTextContent();\n  if (!label) {\n    // Not show label line if there is no label.\n    if (labelLine) {\n      targetEl.removeTextGuideLine();\n    }\n    return;\n  }\n  var normalModel = statesModels.normal;\n  var showNormal = normalModel.get('show');\n  var labelIgnoreNormal = label.ignore;\n  for (var i = 0; i < DISPLAY_STATES.length; i++) {\n    var stateName = DISPLAY_STATES[i];\n    var stateModel = statesModels[stateName];\n    var isNormal = stateName === 'normal';\n    if (stateModel) {\n      var stateShow = stateModel.get('show');\n      var isLabelIgnored = isNormal ? labelIgnoreNormal : retrieve2(label.states[stateName] && label.states[stateName].ignore, labelIgnoreNormal);\n      if (isLabelIgnored // Not show when label is not shown in this state.\n      || !retrieve2(stateShow, showNormal) // Use normal state by default if not set.\n      ) {\n        var stateObj = isNormal ? labelLine : labelLine && labelLine.states[stateName];\n        if (stateObj) {\n          stateObj.ignore = true;\n        }\n        if (!!labelLine) {\n          setLabelLineState(labelLine, true, stateName, stateModel);\n        }\n        continue;\n      }\n      // Create labelLine if not exists\n      if (!labelLine) {\n        labelLine = new Polyline();\n        targetEl.setTextGuideLine(labelLine);\n        // Reset state of normal because it's new created.\n        // NOTE: NORMAL should always been the first!\n        if (!isNormal && (labelIgnoreNormal || !showNormal)) {\n          setLabelLineState(labelLine, true, 'normal', statesModels.normal);\n        }\n        // Use same state proxy.\n        if (targetEl.stateProxy) {\n          labelLine.stateProxy = targetEl.stateProxy;\n        }\n      }\n      setLabelLineState(labelLine, false, stateName, stateModel);\n    }\n  }\n  if (labelLine) {\n    defaults(labelLine.style, defaultStyle);\n    // Not fill.\n    labelLine.style.fill = null;\n    var showAbove = normalModel.get('showAbove');\n    var labelLineConfig = targetEl.textGuideLineConfig = targetEl.textGuideLineConfig || {};\n    labelLineConfig.showAbove = showAbove || false;\n    // Custom the buildPath.\n    labelLine.buildPath = buildLabelLinePath;\n  }\n}\nexport function getLabelLineStatesModels(itemModel, labelLineName) {\n  labelLineName = labelLineName || 'labelLine';\n  var statesModels = {\n    normal: itemModel.getModel(labelLineName)\n  };\n  for (var i = 0; i < SPECIAL_STATES.length; i++) {\n    var stateName = SPECIAL_STATES[i];\n    statesModels[stateName] = itemModel.getModel([stateName, labelLineName]);\n  }\n  return statesModels;\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { OrientedBoundingRect, WH, XY, ensureCopyRect, ensureCopyTransform, expandOrShrinkRect, isBoundingRectAxisAligned } from '../util/graphic.js';\nimport { LabelMarginType } from './labelStyle.js';\nvar LABEL_LAYOUT_BASE_PROPS = ['label', 'labelLine', 'layoutOption', 'priority', 'defaultAttr', 'marginForce', 'minMarginForce', 'marginDefault', 'suggestIgnore'];\nvar LABEL_LAYOUT_DIRTY_BIT_OTHERS = 1;\nvar LABEL_LAYOUT_DIRTY_BIT_OBB = 2;\nvar LABEL_LAYOUT_DIRTY_ALL = LABEL_LAYOUT_DIRTY_BIT_OTHERS | LABEL_LAYOUT_DIRTY_BIT_OBB;\nexport function setLabelLayoutDirty(labelGeometry, dirtyOrClear, dirtyBits) {\n  dirtyBits = dirtyBits || LABEL_LAYOUT_DIRTY_ALL;\n  dirtyOrClear ? labelGeometry.dirty |= dirtyBits : labelGeometry.dirty &= ~dirtyBits;\n}\nfunction isLabelLayoutDirty(labelGeometry, dirtyBits) {\n  dirtyBits = dirtyBits || LABEL_LAYOUT_DIRTY_ALL;\n  return labelGeometry.dirty == null || !!(labelGeometry.dirty & dirtyBits);\n}\n/**\n * [CAUTION]\n *  - No auto dirty propagation mechanism yet. If the transform of the raw label or any of its ancestors is\n *    changed, must sync the changes to the props of `LabelGeometry` by:\n *    either explicitly call:\n *      `setLabelLayoutDirty(labelLayout, true); ensureLabelLayoutWithGeometry(labelLayout);`\n *    or call (if only translation is performed):\n *      `labelLayoutApplyTranslation(labelLayout);`\n *  - `label.ignore` is not necessarily falsy, and not considered in computing `LabelGeometry`,\n *    since it might be modified by some overlap resolving handling.\n *  - To duplicate or make a variation:\n *    use `newLabelLayoutWithGeometry`.\n *\n * The result can also be the input of this method.\n * @return `NullUndefined` if and only if `labelLayout` is `NullUndefined`.\n */\nexport function ensureLabelLayoutWithGeometry(labelLayout) {\n  if (!labelLayout) {\n    return;\n  }\n  if (isLabelLayoutDirty(labelLayout)) {\n    computeLabelGeometry(labelLayout, labelLayout.label, labelLayout);\n  }\n  return labelLayout;\n}\n/**\n * The props in `out` will be filled if existing, or created.\n */\nexport function computeLabelGeometry(out, label, opt) {\n  // [CAUTION] These props may be modified directly for performance consideration,\n  //  therefore, do not output the internal data structure of zrender Element.\n  var rawTransform = label.getComputedTransform();\n  out.transform = ensureCopyTransform(out.transform, rawTransform);\n  // NOTE: should call `getBoundingRect` after `getComputedTransform`, or may get an inaccurate bounding rect.\n  //  The reason is that `getComputedTransform` calls `__host.updateInnerText()` internally, which updates the label\n  //  by `textConfig` mounted on the host.\n  // PENDING: add a dirty bit for that in zrender?\n  var outLocalRect = out.localRect = ensureCopyRect(out.localRect, label.getBoundingRect());\n  var labelStyleExt = label.style;\n  var margin = labelStyleExt.margin;\n  var marginForce = opt && opt.marginForce;\n  var minMarginForce = opt && opt.minMarginForce;\n  var marginDefault = opt && opt.marginDefault;\n  var marginType = labelStyleExt.__marginType;\n  if (marginType == null && marginDefault) {\n    margin = marginDefault;\n    marginType = LabelMarginType.textMargin;\n  }\n  // `textMargin` and `minMargin` can not exist both.\n  for (var i = 0; i < 4; i++) {\n    _tmpLabelMargin[i] = marginType === LabelMarginType.minMargin && minMarginForce && minMarginForce[i] != null ? minMarginForce[i] : marginForce && marginForce[i] != null ? marginForce[i] : margin ? margin[i] : 0;\n  }\n  if (marginType === LabelMarginType.textMargin) {\n    expandOrShrinkRect(outLocalRect, _tmpLabelMargin, false, false);\n  }\n  var outGlobalRect = out.rect = ensureCopyRect(out.rect, outLocalRect);\n  if (rawTransform) {\n    outGlobalRect.applyTransform(rawTransform);\n  }\n  // Notice: label.style.margin is actually `minMargin / 2`, handled by `setTextStyleCommon`.\n  if (marginType === LabelMarginType.minMargin) {\n    expandOrShrinkRect(outGlobalRect, _tmpLabelMargin, false, false);\n  }\n  out.axisAligned = isBoundingRectAxisAligned(rawTransform);\n  (out.label = out.label || {}).ignore = label.ignore;\n  setLabelLayoutDirty(out, false);\n  setLabelLayoutDirty(out, true, LABEL_LAYOUT_DIRTY_BIT_OBB);\n  // Do not remove `obb` (if existing) for reuse, just reset the dirty bit.\n  return out;\n}\nvar _tmpLabelMargin = [0, 0, 0, 0];\n/**\n * The props in `out` will be filled if existing, or created.\n */\nexport function computeLabelGeometry2(out, rawLocalRect, rawTransform) {\n  out.transform = ensureCopyTransform(out.transform, rawTransform);\n  out.localRect = ensureCopyRect(out.localRect, rawLocalRect);\n  out.rect = ensureCopyRect(out.rect, rawLocalRect);\n  if (rawTransform) {\n    out.rect.applyTransform(rawTransform);\n  }\n  out.axisAligned = isBoundingRectAxisAligned(rawTransform);\n  out.obb = undefined; // Reset to undefined, will be created by `ensureOBB` when using.\n  (out.label = out.label || {}).ignore = false;\n  return out;\n}\n/**\n * This is a shortcut of\n *   ```js\n *   labelLayout.label.x = newX;\n *   labelLayout.label.y = newY;\n *   setLabelLayoutDirty(labelLayout, true);\n *   ensureLabelLayoutWithGeometry(labelLayout);\n *   ```\n * and provide better performance in this common case.\n */\nexport function labelLayoutApplyTranslation(labelLayout, offset) {\n  if (!labelLayout) {\n    return;\n  }\n  labelLayout.label.x += offset.x;\n  labelLayout.label.y += offset.y;\n  labelLayout.label.markRedraw();\n  var transform = labelLayout.transform;\n  if (transform) {\n    transform[4] += offset.x;\n    transform[5] += offset.y;\n  }\n  var globalRect = labelLayout.rect;\n  if (globalRect) {\n    globalRect.x += offset.x;\n    globalRect.y += offset.y;\n  }\n  var obb = labelLayout.obb;\n  if (obb) {\n    obb.fromBoundingRect(labelLayout.localRect, transform);\n  }\n}\n/**\n * To duplicate or make a variation of a label layout.\n * Copy the only relevant properties to avoid the conflict or wrongly reuse of the props of `LabelLayoutWithGeometry`.\n */\nexport function newLabelLayoutWithGeometry(newBaseWithDefaults, source) {\n  for (var i = 0; i < LABEL_LAYOUT_BASE_PROPS.length; i++) {\n    var prop = LABEL_LAYOUT_BASE_PROPS[i];\n    if (newBaseWithDefaults[prop] == null) {\n      newBaseWithDefaults[prop] = source[prop];\n    }\n  }\n  return ensureLabelLayoutWithGeometry(newBaseWithDefaults);\n}\n/**\n * Create obb if no one, can cache it.\n */\nfunction ensureOBB(labelGeometry) {\n  var obb = labelGeometry.obb;\n  if (!obb || isLabelLayoutDirty(labelGeometry, LABEL_LAYOUT_DIRTY_BIT_OBB)) {\n    labelGeometry.obb = obb = obb || new OrientedBoundingRect();\n    obb.fromBoundingRect(labelGeometry.localRect, labelGeometry.transform);\n    setLabelLayoutDirty(labelGeometry, false, LABEL_LAYOUT_DIRTY_BIT_OBB);\n  }\n  return obb;\n}\n/**\n * Adjust labels on x/y direction to avoid overlap.\n *\n * PENDING: the current implementation is based on the global bounding rect rather than the local rect,\n *  which may be not preferable in some edge cases when the label has rotation, but works for most cases,\n *  since rotation is unnecessary when there is sufficient space, while squeezing is applied regardless\n *  of overlapping when there is no enough space.\n *\n * NOTICE:\n *  - The input `list` and its content will be modified (sort, label.x/y, rect).\n *  - The caller should sync the modifications to the other parts by\n *    `setLabelLayoutDirty` and `ensureLabelLayoutWithGeometry` if needed.\n *\n * @return adjusted\n */\nexport function shiftLayoutOnXY(list, xyDimIdx,\n// 0 for x, 1 for y\nminBound,\n// for x, leftBound; for y, topBound\nmaxBound,\n// for x, rightBound; for y, bottomBound\n// If average the shifts on all labels and add them to 0\n// TODO: Not sure if should enable it.\n// Pros: The angle of lines will distribute more equally\n// Cons: In some layout. It may not what user wanted. like in pie. the label of last sector is usually changed unexpectedly.\nbalanceShift) {\n  var len = list.length;\n  var xyDim = XY[xyDimIdx];\n  var sizeDim = WH[xyDimIdx];\n  if (len < 2) {\n    return false;\n  }\n  list.sort(function (a, b) {\n    return a.rect[xyDim] - b.rect[xyDim];\n  });\n  var lastPos = 0;\n  var delta;\n  var adjusted = false;\n  // const shifts = [];\n  var totalShifts = 0;\n  for (var i = 0; i < len; i++) {\n    var item = list[i];\n    var rect = item.rect;\n    delta = rect[xyDim] - lastPos;\n    if (delta < 0) {\n      // shiftForward(i, len, -delta);\n      rect[xyDim] -= delta;\n      item.label[xyDim] -= delta;\n      adjusted = true;\n    }\n    var shift = Math.max(-delta, 0);\n    // shifts.push(shift);\n    totalShifts += shift;\n    lastPos = rect[xyDim] + rect[sizeDim];\n  }\n  if (totalShifts > 0 && balanceShift) {\n    // Shift back to make the distribution more equally.\n    shiftList(-totalShifts / len, 0, len);\n  }\n  // TODO bleedMargin?\n  var first = list[0];\n  var last = list[len - 1];\n  var minGap;\n  var maxGap;\n  updateMinMaxGap();\n  // If ends exceed two bounds, squeeze at most 80%, then take the gap of two bounds.\n  minGap < 0 && squeezeGaps(-minGap, 0.8);\n  maxGap < 0 && squeezeGaps(maxGap, 0.8);\n  updateMinMaxGap();\n  takeBoundsGap(minGap, maxGap, 1);\n  takeBoundsGap(maxGap, minGap, -1);\n  // Handle bailout when there is not enough space.\n  updateMinMaxGap();\n  if (minGap < 0) {\n    squeezeWhenBailout(-minGap);\n  }\n  if (maxGap < 0) {\n    squeezeWhenBailout(maxGap);\n  }\n  function updateMinMaxGap() {\n    minGap = first.rect[xyDim] - minBound;\n    maxGap = maxBound - last.rect[xyDim] - last.rect[sizeDim];\n  }\n  function takeBoundsGap(gapThisBound, gapOtherBound, moveDir) {\n    if (gapThisBound < 0) {\n      // Move from other gap if can.\n      var moveFromMaxGap = Math.min(gapOtherBound, -gapThisBound);\n      if (moveFromMaxGap > 0) {\n        shiftList(moveFromMaxGap * moveDir, 0, len);\n        var remained = moveFromMaxGap + gapThisBound;\n        if (remained < 0) {\n          squeezeGaps(-remained * moveDir, 1);\n        }\n      } else {\n        squeezeGaps(-gapThisBound * moveDir, 1);\n      }\n    }\n  }\n  function shiftList(delta, start, end) {\n    if (delta !== 0) {\n      adjusted = true;\n    }\n    for (var i = start; i < end; i++) {\n      var item = list[i];\n      var rect = item.rect;\n      rect[xyDim] += delta;\n      item.label[xyDim] += delta;\n    }\n  }\n  // Squeeze gaps if the labels exceed margin.\n  function squeezeGaps(delta, maxSqeezePercent) {\n    var gaps = [];\n    var totalGaps = 0;\n    for (var i = 1; i < len; i++) {\n      var prevItemRect = list[i - 1].rect;\n      var gap = Math.max(list[i].rect[xyDim] - prevItemRect[xyDim] - prevItemRect[sizeDim], 0);\n      gaps.push(gap);\n      totalGaps += gap;\n    }\n    if (!totalGaps) {\n      return;\n    }\n    var squeezePercent = Math.min(Math.abs(delta) / totalGaps, maxSqeezePercent);\n    if (delta > 0) {\n      for (var i = 0; i < len - 1; i++) {\n        // Distribute the shift delta to all gaps.\n        var movement = gaps[i] * squeezePercent;\n        // Forward\n        shiftList(movement, 0, i + 1);\n      }\n    } else {\n      // Backward\n      for (var i = len - 1; i > 0; i--) {\n        // Distribute the shift delta to all gaps.\n        var movement = gaps[i - 1] * squeezePercent;\n        shiftList(-movement, i, len);\n      }\n    }\n  }\n  /**\n   * Squeeze to allow overlap if there is no more space available.\n   * Let other overlapping strategy like hideOverlap do the job instead of keep exceeding the bounds.\n   */\n  function squeezeWhenBailout(delta) {\n    var dir = delta < 0 ? -1 : 1;\n    delta = Math.abs(delta);\n    var moveForEachLabel = Math.ceil(delta / (len - 1));\n    for (var i = 0; i < len - 1; i++) {\n      if (dir > 0) {\n        // Forward\n        shiftList(moveForEachLabel, 0, i + 1);\n      } else {\n        // Backward\n        shiftList(-moveForEachLabel, len - i - 1, len);\n      }\n      delta -= moveForEachLabel;\n      if (delta <= 0) {\n        return;\n      }\n    }\n  }\n  return adjusted;\n}\n/**\n * @see `SavedLabelAttr` in `LabelManager.ts`\n * @see `hideOverlap`\n */\nexport function restoreIgnore(labelList) {\n  for (var i = 0; i < labelList.length; i++) {\n    var labelItem = labelList[i];\n    var defaultAttr = labelItem.defaultAttr;\n    var labelLine = labelItem.labelLine;\n    labelItem.label.attr('ignore', defaultAttr.ignore);\n    labelLine && labelLine.attr('ignore', defaultAttr.labelGuideIgnore);\n  }\n}\n/**\n * [NOTICE - restore]:\n *  'series:layoutlabels' may be triggered during some shortcut passes, such as zooming in series.graph/geo\n *  (`updateLabelLayout`), where the modified `Element` props should be restorable from `defaultAttr`.\n *  @see `SavedLabelAttr` in `LabelManager.ts`\n *  `restoreIgnore` can be called to perform the restore, if needed.\n *\n * [NOTICE - state]:\n *  Regarding Element's states, this method is only designed for the normal state.\n *  PENDING: although currently this method is effectively called in other states in `updateLabelLayout` case,\n *      the bad case is not noticeable in the zooming scenario.\n */\nexport function hideOverlap(labelList) {\n  var displayedLabels = [];\n  // TODO, render overflow visible first, put in the displayedLabels.\n  labelList.sort(function (a, b) {\n    return (b.suggestIgnore ? 1 : 0) - (a.suggestIgnore ? 1 : 0) || b.priority - a.priority;\n  });\n  function hideEl(el) {\n    if (!el.ignore) {\n      // Show on emphasis.\n      var emphasisState = el.ensureState('emphasis');\n      if (emphasisState.ignore == null) {\n        emphasisState.ignore = false;\n      }\n    }\n    el.ignore = true;\n  }\n  for (var i = 0; i < labelList.length; i++) {\n    var labelItem = ensureLabelLayoutWithGeometry(labelList[i]);\n    // The current `el.ignore` is involved, since some previous overlap\n    // resolving strategies may have set `el.ignore` to true.\n    if (labelItem.label.ignore) {\n      continue;\n    }\n    var label = labelItem.label;\n    var labelLine = labelItem.labelLine;\n    // NOTICE: even when the with/height of globalRect of a label is 0, the label line should\n    // still be displayed, since we should follow the concept of \"truncation\", meaning that\n    // something exists even if it cannot be fully displayed. A visible label line is necessary\n    // to allow users to get a tooltip with label info on hover.\n    var overlapped = false;\n    for (var j = 0; j < displayedLabels.length; j++) {\n      if (labelIntersect(labelItem, displayedLabels[j], null, {\n        touchThreshold: 0.05\n      })) {\n        overlapped = true;\n        break;\n      }\n    }\n    // TODO Callback to determine if this overlap should be handled?\n    if (overlapped) {\n      hideEl(label);\n      labelLine && hideEl(labelLine);\n    } else {\n      displayedLabels.push(labelItem);\n    }\n  }\n}\n/**\n * Enable fast check for performance; use obb if inevitable.\n * If `mtv` is used, `targetLayoutInfo` can be moved based on the values filled into `mtv`.\n *\n * This method is based only on the current `Element` states (regardless of other states).\n * Typically this method (and the entire layout process) is performed in normal state.\n */\nexport function labelIntersect(baseLayoutInfo, targetLayoutInfo, mtv, intersectOpt) {\n  if (!baseLayoutInfo || !targetLayoutInfo) {\n    return false;\n  }\n  if (baseLayoutInfo.label && baseLayoutInfo.label.ignore || targetLayoutInfo.label && targetLayoutInfo.label.ignore) {\n    return false;\n  }\n  // Fast rejection.\n  if (!baseLayoutInfo.rect.intersect(targetLayoutInfo.rect, mtv, intersectOpt)) {\n    return false;\n  }\n  if (baseLayoutInfo.axisAligned && targetLayoutInfo.axisAligned) {\n    return true; // obb is the same as the normal bounding rect.\n  }\n  return ensureOBB(baseLayoutInfo).intersect(ensureOBB(targetLayoutInfo), mtv, intersectOpt);\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n// TODO: move labels out of viewport.\nimport { BoundingRect, updateProps, initProps, isElementRemoved } from '../util/graphic.js';\nimport { getECData } from '../util/innerStore.js';\nimport { parsePercent } from '../util/number.js';\nimport Transformable from 'zrender/lib/core/Transformable.js';\nimport { updateLabelLinePoints, setLabelLineStyle, getLabelLineStatesModels } from './labelGuideHelper.js';\nimport { makeInner } from '../util/model.js';\nimport { retrieve2, each, keys, isFunction, filter, indexOf } from 'zrender/lib/core/util.js';\nimport { hideOverlap, shiftLayoutOnXY, restoreIgnore, newLabelLayoutWithGeometry } from './labelLayoutHelper.js';\nimport { labelInner, animateLabelValue } from './labelStyle.js';\nimport { normalizeRadian } from 'zrender/lib/contain/util.js';\nfunction cloneArr(points) {\n  if (points) {\n    var newPoints = [];\n    for (var i = 0; i < points.length; i++) {\n      newPoints.push(points[i].slice());\n    }\n    return newPoints;\n  }\n}\nfunction prepareLayoutCallbackParams(labelItem, hostEl) {\n  var label = labelItem.label;\n  var labelLine = hostEl && hostEl.getTextGuideLine();\n  return {\n    dataIndex: labelItem.dataIndex,\n    dataType: labelItem.dataType,\n    seriesIndex: labelItem.seriesModel.seriesIndex,\n    text: labelItem.label.style.text,\n    rect: labelItem.hostRect,\n    labelRect: labelItem.rect,\n    // x: labelAttr.x,\n    // y: labelAttr.y,\n    align: label.style.align,\n    verticalAlign: label.style.verticalAlign,\n    labelLinePoints: cloneArr(labelLine && labelLine.shape.points)\n  };\n}\nvar LABEL_OPTION_TO_STYLE_KEYS = ['align', 'verticalAlign', 'width', 'height', 'fontSize'];\nvar dummyTransformable = new Transformable();\nvar labelLayoutInnerStore = makeInner();\nvar labelLineAnimationStore = makeInner();\nfunction extendWithKeys(target, source, keys) {\n  for (var i = 0; i < keys.length; i++) {\n    var key = keys[i];\n    if (source[key] != null) {\n      target[key] = source[key];\n    }\n  }\n}\nvar LABEL_LAYOUT_PROPS = ['x', 'y', 'rotation'];\nvar LabelManager = /** @class */function () {\n  function LabelManager() {\n    this._labelList = [];\n    this._chartViewList = [];\n  }\n  LabelManager.prototype.clearLabels = function () {\n    this._labelList = [];\n    this._chartViewList = [];\n  };\n  /**\n   * Add label to manager\n   */\n  LabelManager.prototype._addLabel = function (dataIndex, dataType, seriesModel, label, layoutOptionOrCb) {\n    var labelStyle = label.style;\n    var hostEl = label.__hostTarget;\n    var textConfig = hostEl.textConfig || {};\n    // TODO: If label is in other state.\n    var labelTransform = label.getComputedTransform();\n    var labelRect = label.getBoundingRect().plain();\n    BoundingRect.applyTransform(labelRect, labelRect, labelTransform);\n    if (labelTransform) {\n      dummyTransformable.setLocalTransform(labelTransform);\n    } else {\n      // Identity transform.\n      dummyTransformable.x = dummyTransformable.y = dummyTransformable.rotation = dummyTransformable.originX = dummyTransformable.originY = 0;\n      dummyTransformable.scaleX = dummyTransformable.scaleY = 1;\n    }\n    dummyTransformable.rotation = normalizeRadian(dummyTransformable.rotation);\n    var host = label.__hostTarget;\n    var hostRect;\n    if (host) {\n      hostRect = host.getBoundingRect().plain();\n      var transform = host.getComputedTransform();\n      BoundingRect.applyTransform(hostRect, hostRect, transform);\n    }\n    var labelGuide = hostRect && host.getTextGuideLine();\n    this._labelList.push({\n      label: label,\n      labelLine: labelGuide,\n      seriesModel: seriesModel,\n      dataIndex: dataIndex,\n      dataType: dataType,\n      layoutOptionOrCb: layoutOptionOrCb,\n      layoutOption: null,\n      rect: labelRect,\n      hostRect: hostRect,\n      // Label with lower priority will be hidden when overlapped\n      // Use rect size as default priority\n      priority: hostRect ? hostRect.width * hostRect.height : 0,\n      // Save default label attributes.\n      // For restore if developers want get back to default value in callback.\n      defaultAttr: {\n        ignore: label.ignore,\n        labelGuideIgnore: labelGuide && labelGuide.ignore,\n        x: dummyTransformable.x,\n        y: dummyTransformable.y,\n        scaleX: dummyTransformable.scaleX,\n        scaleY: dummyTransformable.scaleY,\n        rotation: dummyTransformable.rotation,\n        style: {\n          x: labelStyle.x,\n          y: labelStyle.y,\n          align: labelStyle.align,\n          verticalAlign: labelStyle.verticalAlign,\n          width: labelStyle.width,\n          height: labelStyle.height,\n          fontSize: labelStyle.fontSize\n        },\n        cursor: label.cursor,\n        attachedPos: textConfig.position,\n        attachedRot: textConfig.rotation\n      }\n    });\n  };\n  LabelManager.prototype.addLabelsOfSeries = function (chartView) {\n    var _this = this;\n    this._chartViewList.push(chartView);\n    var seriesModel = chartView.__model;\n    var layoutOption = seriesModel.get('labelLayout');\n    /**\n     * Ignore layouting if it's not specified anything.\n     */\n    if (!(isFunction(layoutOption) || keys(layoutOption).length)) {\n      return;\n    }\n    chartView.group.traverse(function (child) {\n      if (child.ignore) {\n        return true; // Stop traverse descendants.\n      }\n      // Only support label being hosted on graphic elements.\n      var textEl = child.getTextContent();\n      var ecData = getECData(child);\n      // Can only attach the text on the element with dataIndex\n      if (textEl && !textEl.disableLabelLayout) {\n        _this._addLabel(ecData.dataIndex, ecData.dataType, seriesModel, textEl, layoutOption);\n      }\n    });\n  };\n  LabelManager.prototype.updateLayoutConfig = function (api) {\n    var width = api.getWidth();\n    var height = api.getHeight();\n    function createDragHandler(el, labelLineModel) {\n      return function () {\n        updateLabelLinePoints(el, labelLineModel);\n      };\n    }\n    for (var i = 0; i < this._labelList.length; i++) {\n      var labelItem = this._labelList[i];\n      var label = labelItem.label;\n      var hostEl = label.__hostTarget;\n      var defaultLabelAttr = labelItem.defaultAttr;\n      var layoutOption = void 0;\n      // TODO A global layout option?\n      if (isFunction(labelItem.layoutOptionOrCb)) {\n        layoutOption = labelItem.layoutOptionOrCb(prepareLayoutCallbackParams(labelItem, hostEl));\n      } else {\n        layoutOption = labelItem.layoutOptionOrCb;\n      }\n      layoutOption = layoutOption || {};\n      labelItem.layoutOption = layoutOption;\n      var degreeToRadian = Math.PI / 180;\n      // TODO hostEl should always exists.\n      // Or label should not have parent because the x, y is all in global space.\n      if (hostEl) {\n        hostEl.setTextConfig({\n          // Force to set local false.\n          local: false,\n          // Ignore position and rotation config on the host el if x or y is changed.\n          position: layoutOption.x != null || layoutOption.y != null ? null : defaultLabelAttr.attachedPos,\n          // Ignore rotation config on the host el if rotation is changed.\n          rotation: layoutOption.rotate != null ? layoutOption.rotate * degreeToRadian : defaultLabelAttr.attachedRot,\n          offset: [layoutOption.dx || 0, layoutOption.dy || 0]\n        });\n      }\n      var needsUpdateLabelLine = false;\n      if (layoutOption.x != null) {\n        // TODO width of chart view.\n        label.x = parsePercent(layoutOption.x, width);\n        label.setStyle('x', 0); // Ignore movement in style. TODO: origin.\n        needsUpdateLabelLine = true;\n      } else {\n        label.x = defaultLabelAttr.x;\n        label.setStyle('x', defaultLabelAttr.style.x);\n      }\n      if (layoutOption.y != null) {\n        // TODO height of chart view.\n        label.y = parsePercent(layoutOption.y, height);\n        label.setStyle('y', 0); // Ignore movement in style.\n        needsUpdateLabelLine = true;\n      } else {\n        label.y = defaultLabelAttr.y;\n        label.setStyle('y', defaultLabelAttr.style.y);\n      }\n      if (layoutOption.labelLinePoints) {\n        var guideLine = hostEl.getTextGuideLine();\n        if (guideLine) {\n          guideLine.setShape({\n            points: layoutOption.labelLinePoints\n          });\n          // Not update\n          needsUpdateLabelLine = false;\n        }\n      }\n      var labelLayoutStore = labelLayoutInnerStore(label);\n      labelLayoutStore.needsUpdateLabelLine = needsUpdateLabelLine;\n      label.rotation = layoutOption.rotate != null ? layoutOption.rotate * degreeToRadian : defaultLabelAttr.rotation;\n      label.scaleX = defaultLabelAttr.scaleX;\n      label.scaleY = defaultLabelAttr.scaleY;\n      for (var k = 0; k < LABEL_OPTION_TO_STYLE_KEYS.length; k++) {\n        var key = LABEL_OPTION_TO_STYLE_KEYS[k];\n        label.setStyle(key, layoutOption[key] != null ? layoutOption[key] : defaultLabelAttr.style[key]);\n      }\n      if (layoutOption.draggable) {\n        label.draggable = true;\n        label.cursor = 'move';\n        if (hostEl) {\n          var hostModel = labelItem.seriesModel;\n          if (labelItem.dataIndex != null) {\n            var data = labelItem.seriesModel.getData(labelItem.dataType);\n            hostModel = data.getItemModel(labelItem.dataIndex);\n          }\n          label.on('drag', createDragHandler(hostEl, hostModel.getModel('labelLine')));\n        }\n      } else {\n        // TODO Other drag functions?\n        label.off('drag');\n        label.cursor = defaultLabelAttr.cursor;\n      }\n    }\n  };\n  LabelManager.prototype.layout = function (api) {\n    var width = api.getWidth();\n    var height = api.getHeight();\n    var labelList = [];\n    each(this._labelList, function (inputItem) {\n      if (!inputItem.defaultAttr.ignore) {\n        labelList.push(newLabelLayoutWithGeometry({}, inputItem));\n      }\n    });\n    var labelsNeedsAdjustOnX = filter(labelList, function (item) {\n      return item.layoutOption.moveOverlap === 'shiftX';\n    });\n    var labelsNeedsAdjustOnY = filter(labelList, function (item) {\n      return item.layoutOption.moveOverlap === 'shiftY';\n    });\n    shiftLayoutOnXY(labelsNeedsAdjustOnX, 0, 0, width);\n    shiftLayoutOnXY(labelsNeedsAdjustOnY, 1, 0, height);\n    var labelsNeedsHideOverlap = filter(labelList, function (item) {\n      return item.layoutOption.hideOverlap;\n    });\n    restoreIgnore(labelsNeedsHideOverlap);\n    hideOverlap(labelsNeedsHideOverlap);\n  };\n  /**\n   * Process all labels. Not only labels with layoutOption.\n   */\n  LabelManager.prototype.processLabelsOverall = function () {\n    var _this = this;\n    each(this._chartViewList, function (chartView) {\n      var seriesModel = chartView.__model;\n      var ignoreLabelLineUpdate = chartView.ignoreLabelLineUpdate;\n      var animationEnabled = seriesModel.isAnimationEnabled();\n      chartView.group.traverse(function (child) {\n        if (child.ignore && !child.forceLabelAnimation) {\n          return true; // Stop traverse descendants.\n        }\n        var needsUpdateLabelLine = !ignoreLabelLineUpdate;\n        var label = child.getTextContent();\n        if (!needsUpdateLabelLine && label) {\n          needsUpdateLabelLine = labelLayoutInnerStore(label).needsUpdateLabelLine;\n        }\n        if (needsUpdateLabelLine) {\n          _this._updateLabelLine(child, seriesModel);\n        }\n        if (animationEnabled) {\n          _this._animateLabels(child, seriesModel);\n        }\n      });\n    });\n  };\n  LabelManager.prototype._updateLabelLine = function (el, seriesModel) {\n    // Only support label being hosted on graphic elements.\n    var textEl = el.getTextContent();\n    // Update label line style.\n    var ecData = getECData(el);\n    var dataIndex = ecData.dataIndex;\n    // Only support labelLine on the labels represent data.\n    if (textEl && dataIndex != null) {\n      var data = seriesModel.getData(ecData.dataType);\n      var itemModel = data.getItemModel(dataIndex);\n      var defaultStyle = {};\n      var visualStyle = data.getItemVisual(dataIndex, 'style');\n      if (visualStyle) {\n        var visualType = data.getVisual('drawType');\n        // Default to be same with main color\n        defaultStyle.stroke = visualStyle[visualType];\n      }\n      var labelLineModel = itemModel.getModel('labelLine');\n      setLabelLineStyle(el, getLabelLineStatesModels(itemModel), defaultStyle);\n      updateLabelLinePoints(el, labelLineModel);\n    }\n  };\n  LabelManager.prototype._animateLabels = function (el, seriesModel) {\n    var textEl = el.getTextContent();\n    var guideLine = el.getTextGuideLine();\n    // Animate\n    if (textEl\n    // `forceLabelAnimation` has the highest priority\n    && (el.forceLabelAnimation || !textEl.ignore && !textEl.invisible && !el.disableLabelAnimation && !isElementRemoved(el))) {\n      var layoutStore = labelLayoutInnerStore(textEl);\n      var oldLayout = layoutStore.oldLayout;\n      var ecData = getECData(el);\n      var dataIndex = ecData.dataIndex;\n      var newProps = {\n        x: textEl.x,\n        y: textEl.y,\n        rotation: textEl.rotation\n      };\n      var data = seriesModel.getData(ecData.dataType);\n      if (!oldLayout) {\n        textEl.attr(newProps);\n        // Disable fade in animation if value animation is enabled.\n        if (!labelInner(textEl).valueAnimation) {\n          var oldOpacity = retrieve2(textEl.style.opacity, 1);\n          // Fade in animation\n          textEl.style.opacity = 0;\n          initProps(textEl, {\n            style: {\n              opacity: oldOpacity\n            }\n          }, seriesModel, dataIndex);\n        }\n      } else {\n        textEl.attr(oldLayout);\n        // Make sure the animation from is in the right status.\n        var prevStates = el.prevStates;\n        if (prevStates) {\n          if (indexOf(prevStates, 'select') >= 0) {\n            textEl.attr(layoutStore.oldLayoutSelect);\n          }\n          if (indexOf(prevStates, 'emphasis') >= 0) {\n            textEl.attr(layoutStore.oldLayoutEmphasis);\n          }\n        }\n        updateProps(textEl, newProps, seriesModel, dataIndex);\n      }\n      layoutStore.oldLayout = newProps;\n      if (textEl.states.select) {\n        var layoutSelect = layoutStore.oldLayoutSelect = {};\n        extendWithKeys(layoutSelect, newProps, LABEL_LAYOUT_PROPS);\n        extendWithKeys(layoutSelect, textEl.states.select, LABEL_LAYOUT_PROPS);\n      }\n      if (textEl.states.emphasis) {\n        var layoutEmphasis = layoutStore.oldLayoutEmphasis = {};\n        extendWithKeys(layoutEmphasis, newProps, LABEL_LAYOUT_PROPS);\n        extendWithKeys(layoutEmphasis, textEl.states.emphasis, LABEL_LAYOUT_PROPS);\n      }\n      animateLabelValue(textEl, dataIndex, data, seriesModel, seriesModel);\n    }\n    if (guideLine && !guideLine.ignore && !guideLine.invisible) {\n      var layoutStore = labelLineAnimationStore(guideLine);\n      var oldLayout = layoutStore.oldLayout;\n      var newLayout = {\n        points: guideLine.shape.points\n      };\n      if (!oldLayout) {\n        guideLine.setShape(newLayout);\n        guideLine.style.strokePercent = 0;\n        initProps(guideLine, {\n          style: {\n            strokePercent: 1\n          }\n        }, seriesModel);\n      } else {\n        guideLine.attr({\n          shape: oldLayout\n        });\n        updateProps(guideLine, {\n          shape: newLayout\n        }, seriesModel);\n      }\n      layoutStore.oldLayout = newLayout;\n    }\n  };\n  return LabelManager;\n}();\nexport default LabelManager;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { makeInner } from '../util/model.js';\nimport LabelManager from './LabelManager.js';\nvar getLabelManager = makeInner();\nexport function installLabelLayout(registers) {\n  registers.registerUpdateLifecycle('series:beforeupdate', function (ecModel, api, params) {\n    // TODO api provide an namespace that can save stuff per instance\n    var labelManager = getLabelManager(api).labelManager;\n    if (!labelManager) {\n      labelManager = getLabelManager(api).labelManager = new LabelManager();\n    }\n    labelManager.clearLabels();\n  });\n  registers.registerUpdateLifecycle('series:layoutlabels', function (ecModel, api, params) {\n    var labelManager = getLabelManager(api).labelManager;\n    params.updatedSeries.forEach(function (series) {\n      labelManager.addLabelsOfSeries(api.getViewOfSeriesModel(series));\n    });\n    labelManager.updateLayoutConfig(api);\n    labelManager.layout(api);\n    labelManager.processLabelsOverall();\n  });\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport createSeriesData from '../helper/createSeriesData.js';\nimport SeriesModel from '../../model/Series.js';\nimport { createSymbol } from '../../util/symbol.js';\nimport { Group } from '../../util/graphic.js';\nimport tokens from '../../visual/tokens.js';\nvar LineSeriesModel = /** @class */function (_super) {\n  __extends(LineSeriesModel, _super);\n  function LineSeriesModel() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = LineSeriesModel.type;\n    _this.hasSymbolVisual = true;\n    return _this;\n  }\n  LineSeriesModel.prototype.getInitialData = function (option) {\n    if (process.env.NODE_ENV !== 'production') {\n      var coordSys = option.coordinateSystem;\n      if (coordSys !== 'polar' && coordSys !== 'cartesian2d') {\n        throw new Error('Line not support coordinateSystem besides cartesian and polar');\n      }\n    }\n    return createSeriesData(null, this, {\n      useEncodeDefaulter: true\n    });\n  };\n  LineSeriesModel.prototype.getLegendIcon = function (opt) {\n    var group = new Group();\n    var line = createSymbol('line', 0, opt.itemHeight / 2, opt.itemWidth, 0, opt.lineStyle.stroke, false);\n    group.add(line);\n    line.setStyle(opt.lineStyle);\n    var visualType = this.getData().getVisual('symbol');\n    var visualRotate = this.getData().getVisual('symbolRotate');\n    var symbolType = visualType === 'none' ? 'circle' : visualType;\n    // Symbol size is 80% when there is a line\n    var size = opt.itemHeight * 0.8;\n    var symbol = createSymbol(symbolType, (opt.itemWidth - size) / 2, (opt.itemHeight - size) / 2, size, size, opt.itemStyle.fill);\n    group.add(symbol);\n    symbol.setStyle(opt.itemStyle);\n    var symbolRotate = opt.iconRotate === 'inherit' ? visualRotate : opt.iconRotate || 0;\n    symbol.rotation = symbolRotate * Math.PI / 180;\n    symbol.setOrigin([opt.itemWidth / 2, opt.itemHeight / 2]);\n    if (symbolType.indexOf('empty') > -1) {\n      symbol.style.stroke = symbol.style.fill;\n      symbol.style.fill = tokens.color.neutral00;\n      symbol.style.lineWidth = 2;\n    }\n    return group;\n  };\n  LineSeriesModel.type = 'series.line';\n  LineSeriesModel.dependencies = ['grid', 'polar'];\n  LineSeriesModel.defaultOption = {\n    // zlevel: 0,\n    z: 3,\n    coordinateSystem: 'cartesian2d',\n    legendHoverLink: true,\n    clip: true,\n    label: {\n      position: 'top'\n    },\n    // itemStyle: {\n    // },\n    endLabel: {\n      show: false,\n      valueAnimation: true,\n      distance: 8\n    },\n    lineStyle: {\n      width: 2,\n      type: 'solid'\n    },\n    emphasis: {\n      scale: true\n    },\n    // areaStyle: {\n    // origin of areaStyle. Valid values:\n    // `'auto'/null/undefined`: from axisLine to data\n    // `'start'`: from min to data\n    // `'end'`: from data to max\n    // origin: 'auto'\n    // },\n    // false, 'start', 'end', 'middle'\n    step: false,\n    // Disabled if step is true\n    smooth: false,\n    smoothMonotone: null,\n    symbol: 'emptyCircle',\n    symbolSize: 6,\n    symbolRotate: null,\n    showSymbol: true,\n    // `false`: follow the label interval strategy.\n    // `true`: show all symbols.\n    // `'auto'`: If possible, show all symbols, otherwise\n    //           follow the label interval strategy.\n    showAllSymbol: 'auto',\n    // Whether to connect break point.\n    connectNulls: false,\n    // Sampling for large data. Can be: 'average', 'max', 'min', 'sum', 'lttb'.\n    sampling: 'none',\n    animationEasing: 'linear',\n    // Disable progressive\n    progressive: 0,\n    hoverLayerThreshold: Infinity,\n    universalTransition: {\n      divideShape: 'clone'\n    },\n    triggerLineEvent: false\n  };\n  return LineSeriesModel;\n}(SeriesModel);\nexport default LineSeriesModel;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { retrieveRawValue } from '../../data/helper/dataProvider.js';\nimport { isArray } from 'zrender/lib/core/util.js';\n/**\n * @return label string. Not null/undefined\n */\nexport function getDefaultLabel(data, dataIndex) {\n  var labelDims = data.mapDimensionsAll('defaultedLabel');\n  var len = labelDims.length;\n  // Simple optimization (in lots of cases, label dims length is 1)\n  if (len === 1) {\n    var rawVal = retrieveRawValue(data, dataIndex, labelDims[0]);\n    return rawVal != null ? rawVal + '' : null;\n  } else if (len) {\n    var vals = [];\n    for (var i = 0; i < labelDims.length; i++) {\n      vals.push(retrieveRawValue(data, dataIndex, labelDims[i]));\n    }\n    return vals.join(' ');\n  }\n}\nexport function getDefaultInterpolatedLabel(data, interpolatedValue) {\n  var labelDims = data.mapDimensionsAll('defaultedLabel');\n  if (!isArray(interpolatedValue)) {\n    return interpolatedValue + '';\n  }\n  var vals = [];\n  for (var i = 0; i < labelDims.length; i++) {\n    var dimIndex = data.getDimensionIndex(labelDims[i]);\n    if (dimIndex >= 0) {\n      vals.push(interpolatedValue[dimIndex]);\n    }\n  }\n  return vals.join(' ');\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport { createSymbol, normalizeSymbolOffset, normalizeSymbolSize } from '../../util/symbol.js';\nimport * as graphic from '../../util/graphic.js';\nimport { getECData } from '../../util/innerStore.js';\nimport { enterEmphasis, leaveEmphasis, toggleHoverEmphasis } from '../../util/states.js';\nimport { getDefaultLabel } from './labelHelper.js';\nimport { extend, retrieve2 } from 'zrender/lib/core/util.js';\nimport { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle.js';\nimport ZRImage from 'zrender/lib/graphic/Image.js';\nimport { saveOldStyle } from '../../animation/basicTransition.js';\nvar Symbol = /** @class */function (_super) {\n  __extends(Symbol, _super);\n  function Symbol(data, idx, seriesScope, opts) {\n    var _this = _super.call(this) || this;\n    _this.updateData(data, idx, seriesScope, opts);\n    return _this;\n  }\n  Symbol.prototype._createSymbol = function (symbolType, data, idx, symbolSize, z2, keepAspect) {\n    // Remove paths created before\n    this.removeAll();\n    // let symbolPath = createSymbol(\n    //     symbolType, -0.5, -0.5, 1, 1, color\n    // );\n    // If width/height are set too small (e.g., set to 1) on ios10\n    // and macOS Sierra, a circle stroke become a rect, no matter what\n    // the scale is set. So we set width/height as 2. See #4150.\n    var symbolPath = createSymbol(symbolType, -1, -1, 2, 2, null, keepAspect);\n    symbolPath.attr({\n      z2: retrieve2(z2, 100),\n      culling: true,\n      scaleX: symbolSize[0] / 2,\n      scaleY: symbolSize[1] / 2\n    });\n    // Rewrite drift method\n    symbolPath.drift = driftSymbol;\n    this._symbolType = symbolType;\n    this.add(symbolPath);\n  };\n  /**\n   * Stop animation\n   * @param {boolean} toLastFrame\n   */\n  Symbol.prototype.stopSymbolAnimation = function (toLastFrame) {\n    this.childAt(0).stopAnimation(null, toLastFrame);\n  };\n  Symbol.prototype.getSymbolType = function () {\n    return this._symbolType;\n  };\n  /**\n   * FIXME:\n   * Caution: This method breaks the encapsulation of this module,\n   * but it indeed brings convenience. So do not use the method\n   * unless you detailedly know all the implements of `Symbol`,\n   * especially animation.\n   *\n   * Get symbol path element.\n   */\n  Symbol.prototype.getSymbolPath = function () {\n    return this.childAt(0);\n  };\n  /**\n   * Highlight symbol\n   */\n  Symbol.prototype.highlight = function () {\n    enterEmphasis(this.childAt(0));\n  };\n  /**\n   * Downplay symbol\n   */\n  Symbol.prototype.downplay = function () {\n    leaveEmphasis(this.childAt(0));\n  };\n  /**\n   * @param {number} zlevel\n   * @param {number} z\n   */\n  Symbol.prototype.setZ = function (zlevel, z) {\n    var symbolPath = this.childAt(0);\n    symbolPath.zlevel = zlevel;\n    symbolPath.z = z;\n  };\n  Symbol.prototype.setDraggable = function (draggable, hasCursorOption) {\n    var symbolPath = this.childAt(0);\n    symbolPath.draggable = draggable;\n    symbolPath.cursor = !hasCursorOption && draggable ? 'move' : symbolPath.cursor;\n  };\n  /**\n   * Update symbol properties\n   */\n  Symbol.prototype.updateData = function (data, idx, seriesScope, opts) {\n    this.silent = false;\n    var symbolType = data.getItemVisual(idx, 'symbol') || 'circle';\n    var seriesModel = data.hostModel;\n    var symbolSize = Symbol.getSymbolSize(data, idx);\n    var z2 = Symbol.getSymbolZ2(data, idx);\n    var isInit = symbolType !== this._symbolType;\n    var disableAnimation = opts && opts.disableAnimation;\n    if (isInit) {\n      var keepAspect = data.getItemVisual(idx, 'symbolKeepAspect');\n      this._createSymbol(symbolType, data, idx, symbolSize, z2, keepAspect);\n    } else {\n      var symbolPath = this.childAt(0);\n      symbolPath.silent = false;\n      var target = {\n        scaleX: symbolSize[0] / 2,\n        scaleY: symbolSize[1] / 2\n      };\n      disableAnimation ? symbolPath.attr(target) : graphic.updateProps(symbolPath, target, seriesModel, idx);\n      saveOldStyle(symbolPath);\n    }\n    this._updateCommon(data, idx, symbolSize, seriesScope, opts);\n    if (isInit) {\n      var symbolPath = this.childAt(0);\n      if (!disableAnimation) {\n        var target = {\n          scaleX: this._sizeX,\n          scaleY: this._sizeY,\n          style: {\n            // Always fadeIn. Because it has fadeOut animation when symbol is removed..\n            opacity: symbolPath.style.opacity\n          }\n        };\n        symbolPath.scaleX = symbolPath.scaleY = 0;\n        symbolPath.style.opacity = 0;\n        graphic.initProps(symbolPath, target, seriesModel, idx);\n      }\n    }\n    if (disableAnimation) {\n      // Must stop leave transition manually if don't call initProps or updateProps.\n      this.childAt(0).stopAnimation('leave');\n    }\n  };\n  Symbol.prototype._updateCommon = function (data, idx, symbolSize, seriesScope, opts) {\n    var symbolPath = this.childAt(0);\n    var seriesModel = data.hostModel;\n    var emphasisItemStyle;\n    var blurItemStyle;\n    var selectItemStyle;\n    var focus;\n    var blurScope;\n    var emphasisDisabled;\n    var labelStatesModels;\n    var hoverScale;\n    var cursorStyle;\n    if (seriesScope) {\n      emphasisItemStyle = seriesScope.emphasisItemStyle;\n      blurItemStyle = seriesScope.blurItemStyle;\n      selectItemStyle = seriesScope.selectItemStyle;\n      focus = seriesScope.focus;\n      blurScope = seriesScope.blurScope;\n      labelStatesModels = seriesScope.labelStatesModels;\n      hoverScale = seriesScope.hoverScale;\n      cursorStyle = seriesScope.cursorStyle;\n      emphasisDisabled = seriesScope.emphasisDisabled;\n    }\n    if (!seriesScope || data.hasItemOption) {\n      var itemModel = seriesScope && seriesScope.itemModel ? seriesScope.itemModel : data.getItemModel(idx);\n      var emphasisModel = itemModel.getModel('emphasis');\n      emphasisItemStyle = emphasisModel.getModel('itemStyle').getItemStyle();\n      selectItemStyle = itemModel.getModel(['select', 'itemStyle']).getItemStyle();\n      blurItemStyle = itemModel.getModel(['blur', 'itemStyle']).getItemStyle();\n      focus = emphasisModel.get('focus');\n      blurScope = emphasisModel.get('blurScope');\n      emphasisDisabled = emphasisModel.get('disabled');\n      labelStatesModels = getLabelStatesModels(itemModel);\n      hoverScale = emphasisModel.getShallow('scale');\n      cursorStyle = itemModel.getShallow('cursor');\n    }\n    var symbolRotate = data.getItemVisual(idx, 'symbolRotate');\n    symbolPath.attr('rotation', (symbolRotate || 0) * Math.PI / 180 || 0);\n    var symbolOffset = normalizeSymbolOffset(data.getItemVisual(idx, 'symbolOffset'), symbolSize);\n    if (symbolOffset) {\n      symbolPath.x = symbolOffset[0];\n      symbolPath.y = symbolOffset[1];\n    }\n    cursorStyle && symbolPath.attr('cursor', cursorStyle);\n    var symbolStyle = data.getItemVisual(idx, 'style');\n    var visualColor = symbolStyle.fill;\n    if (symbolPath instanceof ZRImage) {\n      var pathStyle = symbolPath.style;\n      symbolPath.useStyle(extend({\n        // TODO other properties like x, y ?\n        image: pathStyle.image,\n        x: pathStyle.x,\n        y: pathStyle.y,\n        width: pathStyle.width,\n        height: pathStyle.height\n      }, symbolStyle));\n    } else {\n      if (symbolPath.__isEmptyBrush) {\n        // fill and stroke will be swapped if it's empty.\n        // So we cloned a new style to avoid it affecting the original style in visual storage.\n        // TODO Better implementation. No empty logic!\n        symbolPath.useStyle(extend({}, symbolStyle));\n      } else {\n        symbolPath.useStyle(symbolStyle);\n      }\n      // Disable decal because symbol scale will been applied on the decal.\n      symbolPath.style.decal = null;\n      symbolPath.setColor(visualColor, opts && opts.symbolInnerColor);\n      symbolPath.style.strokeNoScale = true;\n    }\n    var liftZ = data.getItemVisual(idx, 'liftZ');\n    var z2Origin = this._z2;\n    if (liftZ != null) {\n      if (z2Origin == null) {\n        this._z2 = symbolPath.z2;\n        symbolPath.z2 += liftZ;\n      }\n    } else if (z2Origin != null) {\n      symbolPath.z2 = z2Origin;\n      this._z2 = null;\n    }\n    var useNameLabel = opts && opts.useNameLabel;\n    setLabelStyle(symbolPath, labelStatesModels, {\n      labelFetcher: seriesModel,\n      labelDataIndex: idx,\n      defaultText: getLabelDefaultText,\n      inheritColor: visualColor,\n      defaultOpacity: symbolStyle.opacity\n    });\n    // Do not execute util needed.\n    function getLabelDefaultText(idx) {\n      return useNameLabel ? data.getName(idx) : getDefaultLabel(data, idx);\n    }\n    this._sizeX = symbolSize[0] / 2;\n    this._sizeY = symbolSize[1] / 2;\n    var emphasisState = symbolPath.ensureState('emphasis');\n    emphasisState.style = emphasisItemStyle;\n    symbolPath.ensureState('select').style = selectItemStyle;\n    symbolPath.ensureState('blur').style = blurItemStyle;\n    // null / undefined / true means to use default strategy.\n    // 0 / false / negative number / NaN / Infinity means no scale.\n    var scaleRatio = hoverScale == null || hoverScale === true ? Math.max(1.1, 3 / this._sizeY)\n    // PENDING: restrict hoverScale > 1? It seems unreasonable to scale down\n    : isFinite(hoverScale) && hoverScale > 0 ? +hoverScale : 1;\n    // always set scale to allow resetting\n    emphasisState.scaleX = this._sizeX * scaleRatio;\n    emphasisState.scaleY = this._sizeY * scaleRatio;\n    this.setSymbolScale(1);\n    toggleHoverEmphasis(this, focus, blurScope, emphasisDisabled);\n  };\n  Symbol.prototype.setSymbolScale = function (scale) {\n    this.scaleX = this.scaleY = scale;\n  };\n  Symbol.prototype.fadeOut = function (cb, seriesModel, opt) {\n    var symbolPath = this.childAt(0);\n    var dataIndex = getECData(this).dataIndex;\n    var animationOpt = opt && opt.animation;\n    // Avoid mistaken hover when fading out\n    this.silent = symbolPath.silent = true;\n    // Not show text when animating\n    if (opt && opt.fadeLabel) {\n      var textContent = symbolPath.getTextContent();\n      if (textContent) {\n        graphic.removeElement(textContent, {\n          style: {\n            opacity: 0\n          }\n        }, seriesModel, {\n          dataIndex: dataIndex,\n          removeOpt: animationOpt,\n          cb: function () {\n            symbolPath.removeTextContent();\n          }\n        });\n      }\n    } else {\n      symbolPath.removeTextContent();\n    }\n    graphic.removeElement(symbolPath, {\n      style: {\n        opacity: 0\n      },\n      scaleX: 0,\n      scaleY: 0\n    }, seriesModel, {\n      dataIndex: dataIndex,\n      cb: cb,\n      removeOpt: animationOpt\n    });\n  };\n  Symbol.getSymbolSize = function (data, idx) {\n    return normalizeSymbolSize(data.getItemVisual(idx, 'symbolSize'));\n  };\n  Symbol.getSymbolZ2 = function (data, idx) {\n    return data.getItemVisual(idx, 'z2');\n  };\n  return Symbol;\n}(graphic.Group);\nfunction driftSymbol(dx, dy) {\n  this.parent.drift(dx, dy);\n}\nexport default Symbol;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as graphic from '../../util/graphic.js';\nimport SymbolClz from './Symbol.js';\nimport { isObject } from 'zrender/lib/core/util.js';\nimport { getLabelStatesModels } from '../../label/labelStyle.js';\nfunction symbolNeedsDraw(data, point, idx, opt) {\n  return point && !isNaN(point[0]) && !isNaN(point[1]) && !(opt.isIgnore && opt.isIgnore(idx))\n  // We do not set clipShape on group, because it will cut part of\n  // the symbol element shape. We use the same clip shape here as\n  // the line clip.\n  && !(opt.clipShape && !opt.clipShape.contain(point[0], point[1])) && data.getItemVisual(idx, 'symbol') !== 'none';\n}\nfunction normalizeUpdateOpt(opt) {\n  if (opt != null && !isObject(opt)) {\n    opt = {\n      isIgnore: opt\n    };\n  }\n  return opt || {};\n}\nfunction makeSeriesScope(data) {\n  var seriesModel = data.hostModel;\n  var emphasisModel = seriesModel.getModel('emphasis');\n  return {\n    emphasisItemStyle: emphasisModel.getModel('itemStyle').getItemStyle(),\n    blurItemStyle: seriesModel.getModel(['blur', 'itemStyle']).getItemStyle(),\n    selectItemStyle: seriesModel.getModel(['select', 'itemStyle']).getItemStyle(),\n    focus: emphasisModel.get('focus'),\n    blurScope: emphasisModel.get('blurScope'),\n    emphasisDisabled: emphasisModel.get('disabled'),\n    hoverScale: emphasisModel.get('scale'),\n    labelStatesModels: getLabelStatesModels(seriesModel),\n    cursorStyle: seriesModel.get('cursor')\n  };\n}\nvar SymbolDraw = /** @class */function () {\n  function SymbolDraw(SymbolCtor) {\n    this.group = new graphic.Group();\n    this._SymbolCtor = SymbolCtor || SymbolClz;\n  }\n  /**\n   * Update symbols draw by new data\n   */\n  SymbolDraw.prototype.updateData = function (data, opt) {\n    // Remove progressive els.\n    this._progressiveEls = null;\n    opt = normalizeUpdateOpt(opt);\n    var group = this.group;\n    var seriesModel = data.hostModel;\n    var oldData = this._data;\n    var SymbolCtor = this._SymbolCtor;\n    var disableAnimation = opt.disableAnimation;\n    var seriesScope = makeSeriesScope(data);\n    var symbolUpdateOpt = {\n      disableAnimation: disableAnimation\n    };\n    var getSymbolPoint = opt.getSymbolPoint || function (idx) {\n      return data.getItemLayout(idx);\n    };\n    // There is no oldLineData only when first rendering or switching from\n    // stream mode to normal mode, where previous elements should be removed.\n    if (!oldData) {\n      group.removeAll();\n    }\n    data.diff(oldData).add(function (newIdx) {\n      var point = getSymbolPoint(newIdx);\n      if (symbolNeedsDraw(data, point, newIdx, opt)) {\n        var symbolEl = new SymbolCtor(data, newIdx, seriesScope, symbolUpdateOpt);\n        symbolEl.setPosition(point);\n        data.setItemGraphicEl(newIdx, symbolEl);\n        group.add(symbolEl);\n      }\n    }).update(function (newIdx, oldIdx) {\n      var symbolEl = oldData.getItemGraphicEl(oldIdx);\n      var point = getSymbolPoint(newIdx);\n      if (!symbolNeedsDraw(data, point, newIdx, opt)) {\n        group.remove(symbolEl);\n        return;\n      }\n      var newSymbolType = data.getItemVisual(newIdx, 'symbol') || 'circle';\n      var oldSymbolType = symbolEl && symbolEl.getSymbolType && symbolEl.getSymbolType();\n      if (!symbolEl\n      // Create a new if symbol type changed.\n      || oldSymbolType && oldSymbolType !== newSymbolType) {\n        group.remove(symbolEl);\n        symbolEl = new SymbolCtor(data, newIdx, seriesScope, symbolUpdateOpt);\n        symbolEl.setPosition(point);\n      } else {\n        symbolEl.updateData(data, newIdx, seriesScope, symbolUpdateOpt);\n        var target = {\n          x: point[0],\n          y: point[1]\n        };\n        disableAnimation ? symbolEl.attr(target) : graphic.updateProps(symbolEl, target, seriesModel);\n      }\n      // Add back\n      group.add(symbolEl);\n      data.setItemGraphicEl(newIdx, symbolEl);\n    }).remove(function (oldIdx) {\n      var el = oldData.getItemGraphicEl(oldIdx);\n      el && el.fadeOut(function () {\n        group.remove(el);\n      }, seriesModel);\n    }).execute();\n    this._getSymbolPoint = getSymbolPoint;\n    this._data = data;\n  };\n  ;\n  SymbolDraw.prototype.updateLayout = function () {\n    var _this = this;\n    var data = this._data;\n    if (data) {\n      // Not use animation\n      data.eachItemGraphicEl(function (el, idx) {\n        var point = _this._getSymbolPoint(idx);\n        el.setPosition(point);\n        el.markRedraw();\n      });\n    }\n  };\n  ;\n  SymbolDraw.prototype.incrementalPrepareUpdate = function (data) {\n    this._seriesScope = makeSeriesScope(data);\n    this._data = null;\n    this.group.removeAll();\n  };\n  ;\n  /**\n   * Update symbols draw by new data\n   */\n  SymbolDraw.prototype.incrementalUpdate = function (taskParams, data, opt) {\n    // Clear\n    this._progressiveEls = [];\n    opt = normalizeUpdateOpt(opt);\n    function updateIncrementalAndHover(el) {\n      if (!el.isGroup) {\n        el.incremental = true;\n        el.ensureState('emphasis').hoverLayer = true;\n      }\n    }\n    for (var idx = taskParams.start; idx < taskParams.end; idx++) {\n      var point = data.getItemLayout(idx);\n      if (symbolNeedsDraw(data, point, idx, opt)) {\n        var el = new this._SymbolCtor(data, idx, this._seriesScope);\n        el.traverse(updateIncrementalAndHover);\n        el.setPosition(point);\n        this.group.add(el);\n        data.setItemGraphicEl(idx, el);\n        this._progressiveEls.push(el);\n      }\n    }\n  };\n  ;\n  SymbolDraw.prototype.eachRendered = function (cb) {\n    graphic.traverseElements(this._progressiveEls || this.group, cb);\n  };\n  SymbolDraw.prototype.remove = function (enableAnimation) {\n    var group = this.group;\n    var data = this._data;\n    // Incremental model do not have this._data.\n    if (data && enableAnimation) {\n      data.eachItemGraphicEl(function (el) {\n        el.fadeOut(function () {\n          group.remove(el);\n        }, data.hostModel);\n      });\n    } else {\n      group.removeAll();\n    }\n  };\n  ;\n  return SymbolDraw;\n}();\nexport default SymbolDraw;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { isDimensionStacked } from '../../data/helper/dataStackHelper.js';\nimport { isNumber, map } from 'zrender/lib/core/util.js';\nexport function prepareDataCoordInfo(coordSys, data, valueOrigin) {\n  var baseAxis = coordSys.getBaseAxis();\n  var valueAxis = coordSys.getOtherAxis(baseAxis);\n  var valueStart = getValueStart(valueAxis, valueOrigin);\n  var baseAxisDim = baseAxis.dim;\n  var valueAxisDim = valueAxis.dim;\n  var valueDim = data.mapDimension(valueAxisDim);\n  var baseDim = data.mapDimension(baseAxisDim);\n  var baseDataOffset = valueAxisDim === 'x' || valueAxisDim === 'radius' ? 1 : 0;\n  var dims = map(coordSys.dimensions, function (coordDim) {\n    return data.mapDimension(coordDim);\n  });\n  var stacked = false;\n  var stackResultDim = data.getCalculationInfo('stackResultDimension');\n  if (isDimensionStacked(data, dims[0] /* , dims[1] */)) {\n    // jshint ignore:line\n    stacked = true;\n    dims[0] = stackResultDim;\n  }\n  if (isDimensionStacked(data, dims[1] /* , dims[0] */)) {\n    // jshint ignore:line\n    stacked = true;\n    dims[1] = stackResultDim;\n  }\n  return {\n    dataDimsForPoint: dims,\n    valueStart: valueStart,\n    valueAxisDim: valueAxisDim,\n    baseAxisDim: baseAxisDim,\n    stacked: !!stacked,\n    valueDim: valueDim,\n    baseDim: baseDim,\n    baseDataOffset: baseDataOffset,\n    stackedOverDimension: data.getCalculationInfo('stackedOverDimension')\n  };\n}\nfunction getValueStart(valueAxis, valueOrigin) {\n  var valueStart = 0;\n  var extent = valueAxis.scale.getExtent();\n  if (valueOrigin === 'start') {\n    valueStart = extent[0];\n  } else if (valueOrigin === 'end') {\n    valueStart = extent[1];\n  }\n  // If origin is specified as a number, use it as\n  // valueStart directly\n  else if (isNumber(valueOrigin) && !isNaN(valueOrigin)) {\n    valueStart = valueOrigin;\n  }\n  // auto\n  else {\n    // Both positive\n    if (extent[0] > 0) {\n      valueStart = extent[0];\n    }\n    // Both negative\n    else if (extent[1] < 0) {\n      valueStart = extent[1];\n    }\n    // If is one positive, and one negative, onZero shall be true\n  }\n  return valueStart;\n}\nexport function getStackedOnPoint(dataCoordInfo, coordSys, data, idx) {\n  var value = NaN;\n  if (dataCoordInfo.stacked) {\n    value = data.get(data.getCalculationInfo('stackedOverDimension'), idx);\n  }\n  if (isNaN(value)) {\n    value = dataCoordInfo.valueStart;\n  }\n  var baseDataOffset = dataCoordInfo.baseDataOffset;\n  var stackedData = [];\n  stackedData[baseDataOffset] = data.get(dataCoordInfo.baseDim, idx);\n  stackedData[1 - baseDataOffset] = value;\n  return coordSys.dataToPoint(stackedData);\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { prepareDataCoordInfo, getStackedOnPoint } from './helper.js';\nimport { createFloat32Array } from '../../util/vendor.js';\nfunction diffData(oldData, newData) {\n  var diffResult = [];\n  newData.diff(oldData).add(function (idx) {\n    diffResult.push({\n      cmd: '+',\n      idx: idx\n    });\n  }).update(function (newIdx, oldIdx) {\n    diffResult.push({\n      cmd: '=',\n      idx: oldIdx,\n      idx1: newIdx\n    });\n  }).remove(function (idx) {\n    diffResult.push({\n      cmd: '-',\n      idx: idx\n    });\n  }).execute();\n  return diffResult;\n}\nexport default function lineAnimationDiff(oldData, newData, oldStackedOnPoints, newStackedOnPoints, oldCoordSys, newCoordSys, oldValueOrigin, newValueOrigin) {\n  var diff = diffData(oldData, newData);\n  // let newIdList = newData.mapArray(newData.getId);\n  // let oldIdList = oldData.mapArray(oldData.getId);\n  // convertToIntId(newIdList, oldIdList);\n  // // FIXME One data ?\n  // diff = arrayDiff(oldIdList, newIdList);\n  var currPoints = [];\n  var nextPoints = [];\n  // Points for stacking base line\n  var currStackedPoints = [];\n  var nextStackedPoints = [];\n  var status = [];\n  var sortedIndices = [];\n  var rawIndices = [];\n  var newDataOldCoordInfo = prepareDataCoordInfo(oldCoordSys, newData, oldValueOrigin);\n  // const oldDataNewCoordInfo = prepareDataCoordInfo(newCoordSys, oldData, newValueOrigin);\n  var oldPoints = oldData.getLayout('points') || [];\n  var newPoints = newData.getLayout('points') || [];\n  for (var i = 0; i < diff.length; i++) {\n    var diffItem = diff[i];\n    var pointAdded = true;\n    var oldIdx2 = void 0;\n    var newIdx2 = void 0;\n    // FIXME, animation is not so perfect when dataZoom window moves fast\n    // Which is in case remvoing or add more than one data in the tail or head\n    switch (diffItem.cmd) {\n      case '=':\n        oldIdx2 = diffItem.idx * 2;\n        newIdx2 = diffItem.idx1 * 2;\n        var currentX = oldPoints[oldIdx2];\n        var currentY = oldPoints[oldIdx2 + 1];\n        var nextX = newPoints[newIdx2];\n        var nextY = newPoints[newIdx2 + 1];\n        // If previous data is NaN, use next point directly\n        if (isNaN(currentX) || isNaN(currentY)) {\n          currentX = nextX;\n          currentY = nextY;\n        }\n        currPoints.push(currentX, currentY);\n        nextPoints.push(nextX, nextY);\n        currStackedPoints.push(oldStackedOnPoints[oldIdx2], oldStackedOnPoints[oldIdx2 + 1]);\n        nextStackedPoints.push(newStackedOnPoints[newIdx2], newStackedOnPoints[newIdx2 + 1]);\n        rawIndices.push(newData.getRawIndex(diffItem.idx1));\n        break;\n      case '+':\n        var newIdx = diffItem.idx;\n        var newDataDimsForPoint = newDataOldCoordInfo.dataDimsForPoint;\n        var oldPt = oldCoordSys.dataToPoint([newData.get(newDataDimsForPoint[0], newIdx), newData.get(newDataDimsForPoint[1], newIdx)]);\n        newIdx2 = newIdx * 2;\n        currPoints.push(oldPt[0], oldPt[1]);\n        nextPoints.push(newPoints[newIdx2], newPoints[newIdx2 + 1]);\n        var stackedOnPoint = getStackedOnPoint(newDataOldCoordInfo, oldCoordSys, newData, newIdx);\n        currStackedPoints.push(stackedOnPoint[0], stackedOnPoint[1]);\n        nextStackedPoints.push(newStackedOnPoints[newIdx2], newStackedOnPoints[newIdx2 + 1]);\n        rawIndices.push(newData.getRawIndex(newIdx));\n        break;\n      case '-':\n        pointAdded = false;\n    }\n    // Original indices\n    if (pointAdded) {\n      status.push(diffItem);\n      sortedIndices.push(sortedIndices.length);\n    }\n  }\n  // Diff result may be crossed if all items are changed\n  // Sort by data index\n  sortedIndices.sort(function (a, b) {\n    return rawIndices[a] - rawIndices[b];\n  });\n  var len = currPoints.length;\n  var sortedCurrPoints = createFloat32Array(len);\n  var sortedNextPoints = createFloat32Array(len);\n  var sortedCurrStackedPoints = createFloat32Array(len);\n  var sortedNextStackedPoints = createFloat32Array(len);\n  var sortedStatus = [];\n  for (var i = 0; i < sortedIndices.length; i++) {\n    var idx = sortedIndices[i];\n    var i2 = i * 2;\n    var idx2 = idx * 2;\n    sortedCurrPoints[i2] = currPoints[idx2];\n    sortedCurrPoints[i2 + 1] = currPoints[idx2 + 1];\n    sortedNextPoints[i2] = nextPoints[idx2];\n    sortedNextPoints[i2 + 1] = nextPoints[idx2 + 1];\n    sortedCurrStackedPoints[i2] = currStackedPoints[idx2];\n    sortedCurrStackedPoints[i2 + 1] = currStackedPoints[idx2 + 1];\n    sortedNextStackedPoints[i2] = nextStackedPoints[idx2];\n    sortedNextStackedPoints[i2 + 1] = nextStackedPoints[idx2 + 1];\n    sortedStatus[i] = status[idx];\n  }\n  return {\n    current: sortedCurrPoints,\n    next: sortedNextPoints,\n    stackedOnCurrent: sortedCurrStackedPoints,\n    stackedOnNext: sortedNextStackedPoints,\n    status: sortedStatus\n  };\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\n// Poly path support NaN point\nimport Path from 'zrender/lib/graphic/Path.js';\nimport PathProxy from 'zrender/lib/core/PathProxy.js';\nimport { cubicRootAt, cubicAt } from 'zrender/lib/core/curve.js';\nimport tokens from '../../visual/tokens.js';\nvar mathMin = Math.min;\nvar mathMax = Math.max;\nfunction isPointNull(x, y) {\n  return isNaN(x) || isNaN(y);\n}\n/**\n * Draw smoothed line in non-monotone, in may cause undesired curve in extreme\n * situations. This should be used when points are non-monotone neither in x or\n * y dimension.\n */\nfunction drawSegment(ctx, points, start, segLen, allLen, dir, smooth, smoothMonotone, connectNulls) {\n  var prevX;\n  var prevY;\n  var cpx0;\n  var cpy0;\n  var cpx1;\n  var cpy1;\n  var idx = start;\n  var k = 0;\n  for (; k < segLen; k++) {\n    var x = points[idx * 2];\n    var y = points[idx * 2 + 1];\n    if (idx >= allLen || idx < 0) {\n      break;\n    }\n    if (isPointNull(x, y)) {\n      if (connectNulls) {\n        idx += dir;\n        continue;\n      }\n      break;\n    }\n    if (idx === start) {\n      ctx[dir > 0 ? 'moveTo' : 'lineTo'](x, y);\n      cpx0 = x;\n      cpy0 = y;\n    } else {\n      var dx = x - prevX;\n      var dy = y - prevY;\n      // Ignore tiny segment.\n      if (dx * dx + dy * dy < 0.5) {\n        idx += dir;\n        continue;\n      }\n      if (smooth > 0) {\n        var nextIdx = idx + dir;\n        var nextX = points[nextIdx * 2];\n        var nextY = points[nextIdx * 2 + 1];\n        // Ignore duplicate point\n        while (nextX === x && nextY === y && k < segLen) {\n          k++;\n          nextIdx += dir;\n          idx += dir;\n          nextX = points[nextIdx * 2];\n          nextY = points[nextIdx * 2 + 1];\n          x = points[idx * 2];\n          y = points[idx * 2 + 1];\n          dx = x - prevX;\n          dy = y - prevY;\n        }\n        var tmpK = k + 1;\n        if (connectNulls) {\n          // Find next point not null\n          while (isPointNull(nextX, nextY) && tmpK < segLen) {\n            tmpK++;\n            nextIdx += dir;\n            nextX = points[nextIdx * 2];\n            nextY = points[nextIdx * 2 + 1];\n          }\n        }\n        var ratioNextSeg = 0.5;\n        var vx = 0;\n        var vy = 0;\n        var nextCpx0 = void 0;\n        var nextCpy0 = void 0;\n        // Is last point\n        if (tmpK >= segLen || isPointNull(nextX, nextY)) {\n          cpx1 = x;\n          cpy1 = y;\n        } else {\n          vx = nextX - prevX;\n          vy = nextY - prevY;\n          var dx0 = x - prevX;\n          var dx1 = nextX - x;\n          var dy0 = y - prevY;\n          var dy1 = nextY - y;\n          var lenPrevSeg = void 0;\n          var lenNextSeg = void 0;\n          if (smoothMonotone === 'x') {\n            lenPrevSeg = Math.abs(dx0);\n            lenNextSeg = Math.abs(dx1);\n            var dir_1 = vx > 0 ? 1 : -1;\n            cpx1 = x - dir_1 * lenPrevSeg * smooth;\n            cpy1 = y;\n            nextCpx0 = x + dir_1 * lenNextSeg * smooth;\n            nextCpy0 = y;\n          } else if (smoothMonotone === 'y') {\n            lenPrevSeg = Math.abs(dy0);\n            lenNextSeg = Math.abs(dy1);\n            var dir_2 = vy > 0 ? 1 : -1;\n            cpx1 = x;\n            cpy1 = y - dir_2 * lenPrevSeg * smooth;\n            nextCpx0 = x;\n            nextCpy0 = y + dir_2 * lenNextSeg * smooth;\n          } else {\n            lenPrevSeg = Math.sqrt(dx0 * dx0 + dy0 * dy0);\n            lenNextSeg = Math.sqrt(dx1 * dx1 + dy1 * dy1);\n            // Use ratio of seg length\n            ratioNextSeg = lenNextSeg / (lenNextSeg + lenPrevSeg);\n            cpx1 = x - vx * smooth * (1 - ratioNextSeg);\n            cpy1 = y - vy * smooth * (1 - ratioNextSeg);\n            // cp0 of next segment\n            nextCpx0 = x + vx * smooth * ratioNextSeg;\n            nextCpy0 = y + vy * smooth * ratioNextSeg;\n            // Smooth constraint between point and next point.\n            // Avoid exceeding extreme after smoothing.\n            nextCpx0 = mathMin(nextCpx0, mathMax(nextX, x));\n            nextCpy0 = mathMin(nextCpy0, mathMax(nextY, y));\n            nextCpx0 = mathMax(nextCpx0, mathMin(nextX, x));\n            nextCpy0 = mathMax(nextCpy0, mathMin(nextY, y));\n            // Reclaculate cp1 based on the adjusted cp0 of next seg.\n            vx = nextCpx0 - x;\n            vy = nextCpy0 - y;\n            cpx1 = x - vx * lenPrevSeg / lenNextSeg;\n            cpy1 = y - vy * lenPrevSeg / lenNextSeg;\n            // Smooth constraint between point and prev point.\n            // Avoid exceeding extreme after smoothing.\n            cpx1 = mathMin(cpx1, mathMax(prevX, x));\n            cpy1 = mathMin(cpy1, mathMax(prevY, y));\n            cpx1 = mathMax(cpx1, mathMin(prevX, x));\n            cpy1 = mathMax(cpy1, mathMin(prevY, y));\n            // Adjust next cp0 again.\n            vx = x - cpx1;\n            vy = y - cpy1;\n            nextCpx0 = x + vx * lenNextSeg / lenPrevSeg;\n            nextCpy0 = y + vy * lenNextSeg / lenPrevSeg;\n          }\n        }\n        ctx.bezierCurveTo(cpx0, cpy0, cpx1, cpy1, x, y);\n        cpx0 = nextCpx0;\n        cpy0 = nextCpy0;\n      } else {\n        ctx.lineTo(x, y);\n      }\n    }\n    prevX = x;\n    prevY = y;\n    idx += dir;\n  }\n  return k;\n}\nvar ECPolylineShape = /** @class */function () {\n  function ECPolylineShape() {\n    this.smooth = 0;\n    this.smoothConstraint = true;\n  }\n  return ECPolylineShape;\n}();\nvar ECPolyline = /** @class */function (_super) {\n  __extends(ECPolyline, _super);\n  function ECPolyline(opts) {\n    var _this = _super.call(this, opts) || this;\n    _this.type = 'ec-polyline';\n    return _this;\n  }\n  ECPolyline.prototype.getDefaultStyle = function () {\n    return {\n      stroke: tokens.color.neutral99,\n      fill: null\n    };\n  };\n  ECPolyline.prototype.getDefaultShape = function () {\n    return new ECPolylineShape();\n  };\n  ECPolyline.prototype.buildPath = function (ctx, shape) {\n    var points = shape.points;\n    var i = 0;\n    var len = points.length / 2;\n    // const result = getBoundingBox(points, shape.smoothConstraint);\n    if (shape.connectNulls) {\n      // Must remove first and last null values avoid draw error in polygon\n      for (; len > 0; len--) {\n        if (!isPointNull(points[len * 2 - 2], points[len * 2 - 1])) {\n          break;\n        }\n      }\n      for (; i < len; i++) {\n        if (!isPointNull(points[i * 2], points[i * 2 + 1])) {\n          break;\n        }\n      }\n    }\n    while (i < len) {\n      i += drawSegment(ctx, points, i, len, len, 1, shape.smooth, shape.smoothMonotone, shape.connectNulls) + 1;\n    }\n  };\n  ECPolyline.prototype.getPointOn = function (xOrY, dim) {\n    if (!this.path) {\n      this.createPathProxy();\n      this.buildPath(this.path, this.shape);\n    }\n    var path = this.path;\n    var data = path.data;\n    var CMD = PathProxy.CMD;\n    var x0;\n    var y0;\n    var isDimX = dim === 'x';\n    var roots = [];\n    for (var i = 0; i < data.length;) {\n      var cmd = data[i++];\n      var x = void 0;\n      var y = void 0;\n      var x2 = void 0;\n      var y2 = void 0;\n      var x3 = void 0;\n      var y3 = void 0;\n      var t = void 0;\n      switch (cmd) {\n        case CMD.M:\n          x0 = data[i++];\n          y0 = data[i++];\n          break;\n        case CMD.L:\n          x = data[i++];\n          y = data[i++];\n          t = isDimX ? (xOrY - x0) / (x - x0) : (xOrY - y0) / (y - y0);\n          if (t <= 1 && t >= 0) {\n            var val = isDimX ? (y - y0) * t + y0 : (x - x0) * t + x0;\n            return isDimX ? [xOrY, val] : [val, xOrY];\n          }\n          x0 = x;\n          y0 = y;\n          break;\n        case CMD.C:\n          x = data[i++];\n          y = data[i++];\n          x2 = data[i++];\n          y2 = data[i++];\n          x3 = data[i++];\n          y3 = data[i++];\n          var nRoot = isDimX ? cubicRootAt(x0, x, x2, x3, xOrY, roots) : cubicRootAt(y0, y, y2, y3, xOrY, roots);\n          if (nRoot > 0) {\n            for (var i_1 = 0; i_1 < nRoot; i_1++) {\n              var t_1 = roots[i_1];\n              if (t_1 <= 1 && t_1 >= 0) {\n                var val = isDimX ? cubicAt(y0, y, y2, y3, t_1) : cubicAt(x0, x, x2, x3, t_1);\n                return isDimX ? [xOrY, val] : [val, xOrY];\n              }\n            }\n          }\n          x0 = x3;\n          y0 = y3;\n          break;\n      }\n    }\n  };\n  return ECPolyline;\n}(Path);\nexport { ECPolyline };\nvar ECPolygonShape = /** @class */function (_super) {\n  __extends(ECPolygonShape, _super);\n  function ECPolygonShape() {\n    return _super !== null && _super.apply(this, arguments) || this;\n  }\n  return ECPolygonShape;\n}(ECPolylineShape);\nvar ECPolygon = /** @class */function (_super) {\n  __extends(ECPolygon, _super);\n  function ECPolygon(opts) {\n    var _this = _super.call(this, opts) || this;\n    _this.type = 'ec-polygon';\n    return _this;\n  }\n  ECPolygon.prototype.getDefaultShape = function () {\n    return new ECPolygonShape();\n  };\n  ECPolygon.prototype.buildPath = function (ctx, shape) {\n    var points = shape.points;\n    var stackedOnPoints = shape.stackedOnPoints;\n    var i = 0;\n    var len = points.length / 2;\n    var smoothMonotone = shape.smoothMonotone;\n    if (shape.connectNulls) {\n      // Must remove first and last null values avoid draw error in polygon\n      for (; len > 0; len--) {\n        if (!isPointNull(points[len * 2 - 2], points[len * 2 - 1])) {\n          break;\n        }\n      }\n      for (; i < len; i++) {\n        if (!isPointNull(points[i * 2], points[i * 2 + 1])) {\n          break;\n        }\n      }\n    }\n    while (i < len) {\n      var k = drawSegment(ctx, points, i, len, len, 1, shape.smooth, smoothMonotone, shape.connectNulls);\n      drawSegment(ctx, stackedOnPoints, i + k - 1, k, len, -1, shape.stackedOnSmooth, smoothMonotone, shape.connectNulls);\n      i += k + 1;\n      ctx.closePath();\n    }\n  };\n  return ECPolygon;\n}(Path);\nexport { ECPolygon };", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as graphic from '../../util/graphic.js';\nimport { round } from '../../util/number.js';\nimport { isFunction } from 'zrender/lib/core/util.js';\nfunction createGridClipPath(cartesian, hasAnimation, seriesModel, done, during) {\n  var rect = cartesian.getArea();\n  var x = rect.x;\n  var y = rect.y;\n  var width = rect.width;\n  var height = rect.height;\n  var lineWidth = seriesModel.get(['lineStyle', 'width']) || 0;\n  // Expand the clip path a bit to avoid the border is clipped and looks thinner\n  x -= lineWidth / 2;\n  y -= lineWidth / 2;\n  width += lineWidth;\n  height += lineWidth;\n  // fix: https://github.com/apache/incubator-echarts/issues/11369\n  width = Math.ceil(width);\n  if (x !== Math.floor(x)) {\n    x = Math.floor(x);\n    // if no extra 1px on `width`, it will still be clipped since `x` is floored\n    width++;\n  }\n  var clipPath = new graphic.Rect({\n    shape: {\n      x: x,\n      y: y,\n      width: width,\n      height: height\n    }\n  });\n  if (hasAnimation) {\n    var baseAxis = cartesian.getBaseAxis();\n    var isHorizontal = baseAxis.isHorizontal();\n    var isAxisInversed = baseAxis.inverse;\n    if (isHorizontal) {\n      if (isAxisInversed) {\n        clipPath.shape.x += width;\n      }\n      clipPath.shape.width = 0;\n    } else {\n      if (!isAxisInversed) {\n        clipPath.shape.y += height;\n      }\n      clipPath.shape.height = 0;\n    }\n    var duringCb = isFunction(during) ? function (percent) {\n      during(percent, clipPath);\n    } : null;\n    graphic.initProps(clipPath, {\n      shape: {\n        width: width,\n        height: height,\n        x: x,\n        y: y\n      }\n    }, seriesModel, null, done, duringCb);\n  }\n  return clipPath;\n}\nfunction createPolarClipPath(polar, hasAnimation, seriesModel) {\n  var sectorArea = polar.getArea();\n  // Avoid float number rounding error for symbol on the edge of axis extent.\n  var r0 = round(sectorArea.r0, 1);\n  var r = round(sectorArea.r, 1);\n  var clipPath = new graphic.Sector({\n    shape: {\n      cx: round(polar.cx, 1),\n      cy: round(polar.cy, 1),\n      r0: r0,\n      r: r,\n      startAngle: sectorArea.startAngle,\n      endAngle: sectorArea.endAngle,\n      clockwise: sectorArea.clockwise\n    }\n  });\n  if (hasAnimation) {\n    var isRadial = polar.getBaseAxis().dim === 'angle';\n    if (isRadial) {\n      clipPath.shape.endAngle = sectorArea.startAngle;\n    } else {\n      clipPath.shape.r = r0;\n    }\n    graphic.initProps(clipPath, {\n      shape: {\n        endAngle: sectorArea.endAngle,\n        r: r\n      }\n    }, seriesModel);\n  }\n  return clipPath;\n}\nfunction createClipPath(coordSys, hasAnimation, seriesModel, done, during) {\n  if (!coordSys) {\n    return null;\n  } else if (coordSys.type === 'polar') {\n    return createPolarClipPath(coordSys, hasAnimation, seriesModel);\n  } else if (coordSys.type === 'cartesian2d') {\n    return createGridClipPath(coordSys, hasAnimation, seriesModel, done, during);\n  }\n  return null;\n}\nexport { createGridClipPath, createPolarClipPath, createClipPath };", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nexport function isCoordinateSystemType(coordSys, type) {\n  return coordSys.type === type;\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\n// FIXME step not support polar\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport SymbolDraw from '../helper/SymbolDraw.js';\nimport SymbolClz from '../helper/Symbol.js';\nimport lineAnimationDiff from './lineAnimationDiff.js';\nimport * as graphic from '../../util/graphic.js';\nimport * as modelUtil from '../../util/model.js';\nimport { ECPolyline, ECPolygon } from './poly.js';\nimport ChartView from '../../view/Chart.js';\nimport { prepareDataCoordInfo, getStackedOnPoint } from './helper.js';\nimport { createGridClipPath, createPolarClipPath } from '../helper/createClipPathFromCoordSys.js';\nimport { isCoordinateSystemType } from '../../coord/CoordinateSystem.js';\nimport { setStatesStylesFromModel, setStatesFlag, toggleHoverEmphasis, SPECIAL_STATES } from '../../util/states.js';\nimport { setLabelStyle, getLabelStatesModels, labelInner } from '../../label/labelStyle.js';\nimport { getDefaultLabel, getDefaultInterpolatedLabel } from '../helper/labelHelper.js';\nimport { getECData } from '../../util/innerStore.js';\nimport { createFloat32Array } from '../../util/vendor.js';\nimport { convertToColorString } from '../../util/format.js';\nimport { lerp } from 'zrender/lib/tool/color.js';\nfunction isPointsSame(points1, points2) {\n  if (points1.length !== points2.length) {\n    return;\n  }\n  for (var i = 0; i < points1.length; i++) {\n    if (points1[i] !== points2[i]) {\n      return;\n    }\n  }\n  return true;\n}\nfunction bboxFromPoints(points) {\n  var minX = Infinity;\n  var minY = Infinity;\n  var maxX = -Infinity;\n  var maxY = -Infinity;\n  for (var i = 0; i < points.length;) {\n    var x = points[i++];\n    var y = points[i++];\n    if (!isNaN(x)) {\n      minX = Math.min(x, minX);\n      maxX = Math.max(x, maxX);\n    }\n    if (!isNaN(y)) {\n      minY = Math.min(y, minY);\n      maxY = Math.max(y, maxY);\n    }\n  }\n  return [[minX, minY], [maxX, maxY]];\n}\nfunction getBoundingDiff(points1, points2) {\n  var _a = bboxFromPoints(points1),\n    min1 = _a[0],\n    max1 = _a[1];\n  var _b = bboxFromPoints(points2),\n    min2 = _b[0],\n    max2 = _b[1];\n  // Get a max value from each corner of two boundings.\n  return Math.max(Math.abs(min1[0] - min2[0]), Math.abs(min1[1] - min2[1]), Math.abs(max1[0] - max2[0]), Math.abs(max1[1] - max2[1]));\n}\nfunction getSmooth(smooth) {\n  return zrUtil.isNumber(smooth) ? smooth : smooth ? 0.5 : 0;\n}\nfunction getStackedOnPoints(coordSys, data, dataCoordInfo) {\n  if (!dataCoordInfo.valueDim) {\n    return [];\n  }\n  var len = data.count();\n  var points = createFloat32Array(len * 2);\n  for (var idx = 0; idx < len; idx++) {\n    var pt = getStackedOnPoint(dataCoordInfo, coordSys, data, idx);\n    points[idx * 2] = pt[0];\n    points[idx * 2 + 1] = pt[1];\n  }\n  return points;\n}\n/**\n * Filter the null data and extend data for step considering `stepTurnAt`\n *\n * @param points data to convert, that may containing null\n * @param basePoints base data to reference, used only for areaStyle points\n * @param coordSys coordinate system\n * @param stepTurnAt 'start' | 'end' | 'middle' | true\n * @param connectNulls whether to connect nulls\n * @returns converted point positions\n */\nfunction turnPointsIntoStep(points, basePoints, coordSys, stepTurnAt, connectNulls) {\n  var baseAxis = coordSys.getBaseAxis();\n  var baseIndex = baseAxis.dim === 'x' || baseAxis.dim === 'radius' ? 0 : 1;\n  var stepPoints = [];\n  var i = 0;\n  var stepPt = [];\n  var pt = [];\n  var nextPt = [];\n  var filteredPoints = [];\n  if (connectNulls) {\n    for (i = 0; i < points.length; i += 2) {\n      /**\n       * For areaStyle of stepped lines, `stackedOnPoints` should be\n       * filtered the same as `points` so that the base axis values\n       * should stay the same as the lines above. See #20021\n       */\n      var reference = basePoints || points;\n      if (!isNaN(reference[i]) && !isNaN(reference[i + 1])) {\n        filteredPoints.push(points[i], points[i + 1]);\n      }\n    }\n    points = filteredPoints;\n  }\n  for (i = 0; i < points.length - 2; i += 2) {\n    nextPt[0] = points[i + 2];\n    nextPt[1] = points[i + 3];\n    pt[0] = points[i];\n    pt[1] = points[i + 1];\n    stepPoints.push(pt[0], pt[1]);\n    switch (stepTurnAt) {\n      case 'end':\n        stepPt[baseIndex] = nextPt[baseIndex];\n        stepPt[1 - baseIndex] = pt[1 - baseIndex];\n        stepPoints.push(stepPt[0], stepPt[1]);\n        break;\n      case 'middle':\n        var middle = (pt[baseIndex] + nextPt[baseIndex]) / 2;\n        var stepPt2 = [];\n        stepPt[baseIndex] = stepPt2[baseIndex] = middle;\n        stepPt[1 - baseIndex] = pt[1 - baseIndex];\n        stepPt2[1 - baseIndex] = nextPt[1 - baseIndex];\n        stepPoints.push(stepPt[0], stepPt[1]);\n        stepPoints.push(stepPt2[0], stepPt2[1]);\n        break;\n      default:\n        // default is start\n        stepPt[baseIndex] = pt[baseIndex];\n        stepPt[1 - baseIndex] = nextPt[1 - baseIndex];\n        stepPoints.push(stepPt[0], stepPt[1]);\n    }\n  }\n  // Last points\n  stepPoints.push(points[i++], points[i++]);\n  return stepPoints;\n}\n/**\n * Clip color stops to edge. Avoid creating too large gradients.\n * Which may lead to blurry when GPU acceleration is enabled. See #15680\n *\n * The stops has been sorted from small to large.\n */\nfunction clipColorStops(colorStops, maxSize) {\n  var newColorStops = [];\n  var len = colorStops.length;\n  // coord will always < 0 in prevOutOfRangeColorStop.\n  var prevOutOfRangeColorStop;\n  var prevInRangeColorStop;\n  function lerpStop(stop0, stop1, clippedCoord) {\n    var coord0 = stop0.coord;\n    var p = (clippedCoord - coord0) / (stop1.coord - coord0);\n    var color = lerp(p, [stop0.color, stop1.color]);\n    return {\n      coord: clippedCoord,\n      color: color\n    };\n  }\n  for (var i = 0; i < len; i++) {\n    var stop_1 = colorStops[i];\n    var coord = stop_1.coord;\n    if (coord < 0) {\n      prevOutOfRangeColorStop = stop_1;\n    } else if (coord > maxSize) {\n      if (prevInRangeColorStop) {\n        newColorStops.push(lerpStop(prevInRangeColorStop, stop_1, maxSize));\n      } else if (prevOutOfRangeColorStop) {\n        // If there are two stops and coord range is between these two stops\n        newColorStops.push(lerpStop(prevOutOfRangeColorStop, stop_1, 0), lerpStop(prevOutOfRangeColorStop, stop_1, maxSize));\n      }\n      // All following stop will be out of range. So just ignore them.\n      break;\n    } else {\n      if (prevOutOfRangeColorStop) {\n        newColorStops.push(lerpStop(prevOutOfRangeColorStop, stop_1, 0));\n        // Reset\n        prevOutOfRangeColorStop = null;\n      }\n      newColorStops.push(stop_1);\n      prevInRangeColorStop = stop_1;\n    }\n  }\n  return newColorStops;\n}\nfunction getVisualGradient(data, coordSys, api) {\n  var visualMetaList = data.getVisual('visualMeta');\n  if (!visualMetaList || !visualMetaList.length || !data.count()) {\n    // When data.count() is 0, gradient range can not be calculated.\n    return;\n  }\n  if (coordSys.type !== 'cartesian2d') {\n    if (process.env.NODE_ENV !== 'production') {\n      console.warn('Visual map on line style is only supported on cartesian2d.');\n    }\n    return;\n  }\n  var coordDim;\n  var visualMeta;\n  for (var i = visualMetaList.length - 1; i >= 0; i--) {\n    var dimInfo = data.getDimensionInfo(visualMetaList[i].dimension);\n    coordDim = dimInfo && dimInfo.coordDim;\n    // Can only be x or y\n    if (coordDim === 'x' || coordDim === 'y') {\n      visualMeta = visualMetaList[i];\n      break;\n    }\n  }\n  if (!visualMeta) {\n    if (process.env.NODE_ENV !== 'production') {\n      console.warn('Visual map on line style only support x or y dimension.');\n    }\n    return;\n  }\n  // If the area to be rendered is bigger than area defined by LinearGradient,\n  // the canvas spec prescribes that the color of the first stop and the last\n  // stop should be used. But if two stops are added at offset 0, in effect\n  // browsers use the color of the second stop to render area outside\n  // LinearGradient. So we can only infinitesimally extend area defined in\n  // LinearGradient to render `outerColors`.\n  var axis = coordSys.getAxis(coordDim);\n  // dataToCoord mapping may not be linear, but must be monotonic.\n  var colorStops = zrUtil.map(visualMeta.stops, function (stop) {\n    // offset will be calculated later.\n    return {\n      coord: axis.toGlobalCoord(axis.dataToCoord(stop.value)),\n      color: stop.color\n    };\n  });\n  var stopLen = colorStops.length;\n  var outerColors = visualMeta.outerColors.slice();\n  if (stopLen && colorStops[0].coord > colorStops[stopLen - 1].coord) {\n    colorStops.reverse();\n    outerColors.reverse();\n  }\n  var colorStopsInRange = clipColorStops(colorStops, coordDim === 'x' ? api.getWidth() : api.getHeight());\n  var inRangeStopLen = colorStopsInRange.length;\n  if (!inRangeStopLen && stopLen) {\n    // All stops are out of range. All will be the same color.\n    return colorStops[0].coord < 0 ? outerColors[1] ? outerColors[1] : colorStops[stopLen - 1].color : outerColors[0] ? outerColors[0] : colorStops[0].color;\n  }\n  var tinyExtent = 10; // Arbitrary value: 10px\n  var minCoord = colorStopsInRange[0].coord - tinyExtent;\n  var maxCoord = colorStopsInRange[inRangeStopLen - 1].coord + tinyExtent;\n  var coordSpan = maxCoord - minCoord;\n  if (coordSpan < 1e-3) {\n    return 'transparent';\n  }\n  zrUtil.each(colorStopsInRange, function (stop) {\n    stop.offset = (stop.coord - minCoord) / coordSpan;\n  });\n  colorStopsInRange.push({\n    // NOTE: inRangeStopLen may still be 0 if stoplen is zero.\n    offset: inRangeStopLen ? colorStopsInRange[inRangeStopLen - 1].offset : 0.5,\n    color: outerColors[1] || 'transparent'\n  });\n  colorStopsInRange.unshift({\n    offset: inRangeStopLen ? colorStopsInRange[0].offset : 0.5,\n    color: outerColors[0] || 'transparent'\n  });\n  var gradient = new graphic.LinearGradient(0, 0, 0, 0, colorStopsInRange, true);\n  gradient[coordDim] = minCoord;\n  gradient[coordDim + '2'] = maxCoord;\n  return gradient;\n}\nfunction getIsIgnoreFunc(seriesModel, data, coordSys) {\n  var showAllSymbol = seriesModel.get('showAllSymbol');\n  var isAuto = showAllSymbol === 'auto';\n  if (showAllSymbol && !isAuto) {\n    return;\n  }\n  var categoryAxis = coordSys.getAxesByScale('ordinal')[0];\n  if (!categoryAxis) {\n    return;\n  }\n  // Note that category label interval strategy might bring some weird effect\n  // in some scenario: users may wonder why some of the symbols are not\n  // displayed. So we show all symbols as possible as we can.\n  if (isAuto\n  // Simplify the logic, do not determine label overlap here.\n  && canShowAllSymbolForCategory(categoryAxis, data)) {\n    return;\n  }\n  // Otherwise follow the label interval strategy on category axis.\n  var categoryDataDim = data.mapDimension(categoryAxis.dim);\n  var labelMap = {};\n  zrUtil.each(categoryAxis.getViewLabels(), function (labelItem) {\n    var ordinalNumber = categoryAxis.scale.getRawOrdinalNumber(labelItem.tickValue);\n    labelMap[ordinalNumber] = 1;\n  });\n  return function (dataIndex) {\n    return !labelMap.hasOwnProperty(data.get(categoryDataDim, dataIndex));\n  };\n}\nfunction canShowAllSymbolForCategory(categoryAxis, data) {\n  // In most cases, line is monotonous on category axis, and the label size\n  // is close with each other. So we check the symbol size and some of the\n  // label size alone with the category axis to estimate whether all symbol\n  // can be shown without overlap.\n  var axisExtent = categoryAxis.getExtent();\n  var availSize = Math.abs(axisExtent[1] - axisExtent[0]) / categoryAxis.scale.count();\n  isNaN(availSize) && (availSize = 0); // 0/0 is NaN.\n  // Sampling some points, max 5.\n  var dataLen = data.count();\n  var step = Math.max(1, Math.round(dataLen / 5));\n  for (var dataIndex = 0; dataIndex < dataLen; dataIndex += step) {\n    if (SymbolClz.getSymbolSize(data, dataIndex\n    // Only for cartesian, where `isHorizontal` exists.\n    )[categoryAxis.isHorizontal() ? 1 : 0]\n    // Empirical number\n    * 1.5 > availSize) {\n      return false;\n    }\n  }\n  return true;\n}\nfunction isPointNull(x, y) {\n  return isNaN(x) || isNaN(y);\n}\nfunction getLastIndexNotNull(points) {\n  var len = points.length / 2;\n  for (; len > 0; len--) {\n    if (!isPointNull(points[len * 2 - 2], points[len * 2 - 1])) {\n      break;\n    }\n  }\n  return len - 1;\n}\nfunction getPointAtIndex(points, idx) {\n  return [points[idx * 2], points[idx * 2 + 1]];\n}\nfunction getIndexRange(points, xOrY, dim) {\n  var len = points.length / 2;\n  var dimIdx = dim === 'x' ? 0 : 1;\n  var a;\n  var b;\n  var prevIndex = 0;\n  var nextIndex = -1;\n  for (var i = 0; i < len; i++) {\n    b = points[i * 2 + dimIdx];\n    if (isNaN(b) || isNaN(points[i * 2 + 1 - dimIdx])) {\n      continue;\n    }\n    if (i === 0) {\n      a = b;\n      continue;\n    }\n    if (a <= xOrY && b >= xOrY || a >= xOrY && b <= xOrY) {\n      nextIndex = i;\n      break;\n    }\n    prevIndex = i;\n    a = b;\n  }\n  return {\n    range: [prevIndex, nextIndex],\n    t: (xOrY - a) / (b - a)\n  };\n}\nfunction anyStateShowEndLabel(seriesModel) {\n  if (seriesModel.get(['endLabel', 'show'])) {\n    return true;\n  }\n  for (var i = 0; i < SPECIAL_STATES.length; i++) {\n    if (seriesModel.get([SPECIAL_STATES[i], 'endLabel', 'show'])) {\n      return true;\n    }\n  }\n  return false;\n}\nfunction createLineClipPath(lineView, coordSys, hasAnimation, seriesModel) {\n  if (isCoordinateSystemType(coordSys, 'cartesian2d')) {\n    var endLabelModel_1 = seriesModel.getModel('endLabel');\n    var valueAnimation_1 = endLabelModel_1.get('valueAnimation');\n    var data_1 = seriesModel.getData();\n    var labelAnimationRecord_1 = {\n      lastFrameIndex: 0\n    };\n    var during = anyStateShowEndLabel(seriesModel) ? function (percent, clipRect) {\n      lineView._endLabelOnDuring(percent, clipRect, data_1, labelAnimationRecord_1, valueAnimation_1, endLabelModel_1, coordSys);\n    } : null;\n    var isHorizontal = coordSys.getBaseAxis().isHorizontal();\n    var clipPath = createGridClipPath(coordSys, hasAnimation, seriesModel, function () {\n      var endLabel = lineView._endLabel;\n      if (endLabel && hasAnimation) {\n        if (labelAnimationRecord_1.originalX != null) {\n          endLabel.attr({\n            x: labelAnimationRecord_1.originalX,\n            y: labelAnimationRecord_1.originalY\n          });\n        }\n      }\n    }, during);\n    // Expand clip shape to avoid clipping when line value exceeds axis\n    if (!seriesModel.get('clip', true)) {\n      var rectShape = clipPath.shape;\n      var expandSize = Math.max(rectShape.width, rectShape.height);\n      if (isHorizontal) {\n        rectShape.y -= expandSize;\n        rectShape.height += expandSize * 2;\n      } else {\n        rectShape.x -= expandSize;\n        rectShape.width += expandSize * 2;\n      }\n    }\n    // Set to the final frame. To make sure label layout is right.\n    if (during) {\n      during(1, clipPath);\n    }\n    return clipPath;\n  } else {\n    if (process.env.NODE_ENV !== 'production') {\n      if (seriesModel.get(['endLabel', 'show'])) {\n        console.warn('endLabel is not supported for lines in polar systems.');\n      }\n    }\n    return createPolarClipPath(coordSys, hasAnimation, seriesModel);\n  }\n}\nfunction getEndLabelStateSpecified(endLabelModel, coordSys) {\n  var baseAxis = coordSys.getBaseAxis();\n  var isHorizontal = baseAxis.isHorizontal();\n  var isBaseInversed = baseAxis.inverse;\n  var align = isHorizontal ? isBaseInversed ? 'right' : 'left' : 'center';\n  var verticalAlign = isHorizontal ? 'middle' : isBaseInversed ? 'top' : 'bottom';\n  return {\n    normal: {\n      align: endLabelModel.get('align') || align,\n      verticalAlign: endLabelModel.get('verticalAlign') || verticalAlign\n    }\n  };\n}\nvar LineView = /** @class */function (_super) {\n  __extends(LineView, _super);\n  function LineView() {\n    return _super !== null && _super.apply(this, arguments) || this;\n  }\n  LineView.prototype.init = function () {\n    var lineGroup = new graphic.Group();\n    var symbolDraw = new SymbolDraw();\n    this.group.add(symbolDraw.group);\n    this._symbolDraw = symbolDraw;\n    this._lineGroup = lineGroup;\n    this._changePolyState = zrUtil.bind(this._changePolyState, this);\n  };\n  LineView.prototype.render = function (seriesModel, ecModel, api) {\n    var coordSys = seriesModel.coordinateSystem;\n    var group = this.group;\n    var data = seriesModel.getData();\n    var lineStyleModel = seriesModel.getModel('lineStyle');\n    var areaStyleModel = seriesModel.getModel('areaStyle');\n    var points = data.getLayout('points') || [];\n    var isCoordSysPolar = coordSys.type === 'polar';\n    var prevCoordSys = this._coordSys;\n    var symbolDraw = this._symbolDraw;\n    var polyline = this._polyline;\n    var polygon = this._polygon;\n    var lineGroup = this._lineGroup;\n    var hasAnimation = !ecModel.ssr && seriesModel.get('animation');\n    var isAreaChart = !areaStyleModel.isEmpty();\n    var valueOrigin = areaStyleModel.get('origin');\n    var dataCoordInfo = prepareDataCoordInfo(coordSys, data, valueOrigin);\n    var stackedOnPoints = isAreaChart && getStackedOnPoints(coordSys, data, dataCoordInfo);\n    var showSymbol = seriesModel.get('showSymbol');\n    var connectNulls = seriesModel.get('connectNulls');\n    var isIgnoreFunc = showSymbol && !isCoordSysPolar && getIsIgnoreFunc(seriesModel, data, coordSys);\n    // Remove temporary symbols\n    var oldData = this._data;\n    oldData && oldData.eachItemGraphicEl(function (el, idx) {\n      if (el.__temp) {\n        group.remove(el);\n        oldData.setItemGraphicEl(idx, null);\n      }\n    });\n    // Remove previous created symbols if showSymbol changed to false\n    if (!showSymbol) {\n      symbolDraw.remove();\n    }\n    group.add(lineGroup);\n    // FIXME step not support polar\n    var step = !isCoordSysPolar ? seriesModel.get('step') : false;\n    var clipShapeForSymbol;\n    if (coordSys && coordSys.getArea && seriesModel.get('clip', true)) {\n      clipShapeForSymbol = coordSys.getArea();\n      // Avoid float number rounding error for symbol on the edge of axis extent.\n      // See #7913 and `test/dataZoom-clip.html`.\n      if (clipShapeForSymbol.width != null) {\n        clipShapeForSymbol.x -= 0.1;\n        clipShapeForSymbol.y -= 0.1;\n        clipShapeForSymbol.width += 0.2;\n        clipShapeForSymbol.height += 0.2;\n      } else if (clipShapeForSymbol.r0) {\n        clipShapeForSymbol.r0 -= 0.5;\n        clipShapeForSymbol.r += 0.5;\n      }\n    }\n    this._clipShapeForSymbol = clipShapeForSymbol;\n    var visualColor = getVisualGradient(data, coordSys, api) || data.getVisual('style')[data.getVisual('drawType')];\n    // Initialization animation or coordinate system changed\n    if (!(polyline && prevCoordSys.type === coordSys.type && step === this._step)) {\n      showSymbol && symbolDraw.updateData(data, {\n        isIgnore: isIgnoreFunc,\n        clipShape: clipShapeForSymbol,\n        disableAnimation: true,\n        getSymbolPoint: function (idx) {\n          return [points[idx * 2], points[idx * 2 + 1]];\n        }\n      });\n      hasAnimation && this._initSymbolLabelAnimation(data, coordSys, clipShapeForSymbol);\n      if (step) {\n        if (stackedOnPoints) {\n          stackedOnPoints = turnPointsIntoStep(stackedOnPoints, points, coordSys, step, connectNulls);\n        }\n        // TODO If stacked series is not step\n        points = turnPointsIntoStep(points, null, coordSys, step, connectNulls);\n      }\n      polyline = this._newPolyline(points);\n      if (isAreaChart) {\n        polygon = this._newPolygon(points, stackedOnPoints);\n      } // If areaStyle is removed\n      else if (polygon) {\n        lineGroup.remove(polygon);\n        polygon = this._polygon = null;\n      }\n      // NOTE: Must update _endLabel before setClipPath.\n      if (!isCoordSysPolar) {\n        this._initOrUpdateEndLabel(seriesModel, coordSys, convertToColorString(visualColor));\n      }\n      lineGroup.setClipPath(createLineClipPath(this, coordSys, true, seriesModel));\n    } else {\n      if (isAreaChart && !polygon) {\n        // If areaStyle is added\n        polygon = this._newPolygon(points, stackedOnPoints);\n      } else if (polygon && !isAreaChart) {\n        // If areaStyle is removed\n        lineGroup.remove(polygon);\n        polygon = this._polygon = null;\n      }\n      // NOTE: Must update _endLabel before setClipPath.\n      if (!isCoordSysPolar) {\n        this._initOrUpdateEndLabel(seriesModel, coordSys, convertToColorString(visualColor));\n      }\n      // Update clipPath\n      var oldClipPath = lineGroup.getClipPath();\n      if (oldClipPath) {\n        var newClipPath = createLineClipPath(this, coordSys, false, seriesModel);\n        graphic.initProps(oldClipPath, {\n          shape: newClipPath.shape\n        }, seriesModel);\n      } else {\n        lineGroup.setClipPath(createLineClipPath(this, coordSys, true, seriesModel));\n      }\n      // Always update, or it is wrong in the case turning on legend\n      // because points are not changed.\n      showSymbol && symbolDraw.updateData(data, {\n        isIgnore: isIgnoreFunc,\n        clipShape: clipShapeForSymbol,\n        disableAnimation: true,\n        getSymbolPoint: function (idx) {\n          return [points[idx * 2], points[idx * 2 + 1]];\n        }\n      });\n      // In the case data zoom triggered refreshing frequently\n      // Data may not change if line has a category axis. So it should animate nothing.\n      if (!isPointsSame(this._stackedOnPoints, stackedOnPoints) || !isPointsSame(this._points, points)) {\n        if (hasAnimation) {\n          this._doUpdateAnimation(data, stackedOnPoints, coordSys, api, step, valueOrigin, connectNulls);\n        } else {\n          // Not do it in update with animation\n          if (step) {\n            if (stackedOnPoints) {\n              stackedOnPoints = turnPointsIntoStep(stackedOnPoints, points, coordSys, step, connectNulls);\n            }\n            // TODO If stacked series is not step\n            points = turnPointsIntoStep(points, null, coordSys, step, connectNulls);\n          }\n          polyline.setShape({\n            points: points\n          });\n          polygon && polygon.setShape({\n            points: points,\n            stackedOnPoints: stackedOnPoints\n          });\n        }\n      }\n    }\n    var emphasisModel = seriesModel.getModel('emphasis');\n    var focus = emphasisModel.get('focus');\n    var blurScope = emphasisModel.get('blurScope');\n    var emphasisDisabled = emphasisModel.get('disabled');\n    polyline.useStyle(zrUtil.defaults(\n    // Use color in lineStyle first\n    lineStyleModel.getLineStyle(), {\n      fill: 'none',\n      stroke: visualColor,\n      lineJoin: 'bevel'\n    }));\n    setStatesStylesFromModel(polyline, seriesModel, 'lineStyle');\n    if (polyline.style.lineWidth > 0 && seriesModel.get(['emphasis', 'lineStyle', 'width']) === 'bolder') {\n      var emphasisLineStyle = polyline.getState('emphasis').style;\n      emphasisLineStyle.lineWidth = +polyline.style.lineWidth + 1;\n    }\n    // Needs seriesIndex for focus\n    getECData(polyline).seriesIndex = seriesModel.seriesIndex;\n    toggleHoverEmphasis(polyline, focus, blurScope, emphasisDisabled);\n    var smooth = getSmooth(seriesModel.get('smooth'));\n    var smoothMonotone = seriesModel.get('smoothMonotone');\n    polyline.setShape({\n      smooth: smooth,\n      smoothMonotone: smoothMonotone,\n      connectNulls: connectNulls\n    });\n    if (polygon) {\n      var stackedOnSeries = data.getCalculationInfo('stackedOnSeries');\n      var stackedOnSmooth = 0;\n      polygon.useStyle(zrUtil.defaults(areaStyleModel.getAreaStyle(), {\n        fill: visualColor,\n        opacity: 0.7,\n        lineJoin: 'bevel',\n        decal: data.getVisual('style').decal\n      }));\n      if (stackedOnSeries) {\n        stackedOnSmooth = getSmooth(stackedOnSeries.get('smooth'));\n      }\n      polygon.setShape({\n        smooth: smooth,\n        stackedOnSmooth: stackedOnSmooth,\n        smoothMonotone: smoothMonotone,\n        connectNulls: connectNulls\n      });\n      setStatesStylesFromModel(polygon, seriesModel, 'areaStyle');\n      // Needs seriesIndex for focus\n      getECData(polygon).seriesIndex = seriesModel.seriesIndex;\n      toggleHoverEmphasis(polygon, focus, blurScope, emphasisDisabled);\n    }\n    var changePolyState = this._changePolyState;\n    data.eachItemGraphicEl(function (el) {\n      // Switch polyline / polygon state if element changed its state.\n      el && (el.onHoverStateChange = changePolyState);\n    });\n    this._polyline.onHoverStateChange = changePolyState;\n    this._data = data;\n    // Save the coordinate system for transition animation when data changed\n    this._coordSys = coordSys;\n    this._stackedOnPoints = stackedOnPoints;\n    this._points = points;\n    this._step = step;\n    this._valueOrigin = valueOrigin;\n    if (seriesModel.get('triggerLineEvent')) {\n      this.packEventData(seriesModel, polyline);\n      polygon && this.packEventData(seriesModel, polygon);\n    }\n  };\n  LineView.prototype.packEventData = function (seriesModel, el) {\n    getECData(el).eventData = {\n      componentType: 'series',\n      componentSubType: 'line',\n      componentIndex: seriesModel.componentIndex,\n      seriesIndex: seriesModel.seriesIndex,\n      seriesName: seriesModel.name,\n      seriesType: 'line'\n    };\n  };\n  LineView.prototype.highlight = function (seriesModel, ecModel, api, payload) {\n    var data = seriesModel.getData();\n    var dataIndex = modelUtil.queryDataIndex(data, payload);\n    this._changePolyState('emphasis');\n    if (!(dataIndex instanceof Array) && dataIndex != null && dataIndex >= 0) {\n      var points = data.getLayout('points');\n      var symbol = data.getItemGraphicEl(dataIndex);\n      if (!symbol) {\n        // Create a temporary symbol if it is not exists\n        var x = points[dataIndex * 2];\n        var y = points[dataIndex * 2 + 1];\n        if (isNaN(x) || isNaN(y)) {\n          // Null data\n          return;\n        }\n        // fix #11360: shouldn't draw symbol outside clipShapeForSymbol\n        if (this._clipShapeForSymbol && !this._clipShapeForSymbol.contain(x, y)) {\n          return;\n        }\n        var zlevel = seriesModel.get('zlevel') || 0;\n        var z = seriesModel.get('z') || 0;\n        symbol = new SymbolClz(data, dataIndex);\n        symbol.x = x;\n        symbol.y = y;\n        symbol.setZ(zlevel, z);\n        // ensure label text of the temporary symbol is in front of line and area polygon\n        var symbolLabel = symbol.getSymbolPath().getTextContent();\n        if (symbolLabel) {\n          symbolLabel.zlevel = zlevel;\n          symbolLabel.z = z;\n          symbolLabel.z2 = this._polyline.z2 + 1;\n        }\n        symbol.__temp = true;\n        data.setItemGraphicEl(dataIndex, symbol);\n        // Stop scale animation\n        symbol.stopSymbolAnimation(true);\n        this.group.add(symbol);\n      }\n      symbol.highlight();\n    } else {\n      // Highlight whole series\n      ChartView.prototype.highlight.call(this, seriesModel, ecModel, api, payload);\n    }\n  };\n  LineView.prototype.downplay = function (seriesModel, ecModel, api, payload) {\n    var data = seriesModel.getData();\n    var dataIndex = modelUtil.queryDataIndex(data, payload);\n    this._changePolyState('normal');\n    if (dataIndex != null && dataIndex >= 0) {\n      var symbol = data.getItemGraphicEl(dataIndex);\n      if (symbol) {\n        if (symbol.__temp) {\n          data.setItemGraphicEl(dataIndex, null);\n          this.group.remove(symbol);\n        } else {\n          symbol.downplay();\n        }\n      }\n    } else {\n      // FIXME\n      // can not downplay completely.\n      // Downplay whole series\n      ChartView.prototype.downplay.call(this, seriesModel, ecModel, api, payload);\n    }\n  };\n  LineView.prototype._changePolyState = function (toState) {\n    var polygon = this._polygon;\n    setStatesFlag(this._polyline, toState);\n    polygon && setStatesFlag(polygon, toState);\n  };\n  LineView.prototype._newPolyline = function (points) {\n    var polyline = this._polyline;\n    // Remove previous created polyline\n    if (polyline) {\n      this._lineGroup.remove(polyline);\n    }\n    polyline = new ECPolyline({\n      shape: {\n        points: points\n      },\n      segmentIgnoreThreshold: 2,\n      z2: 10\n    });\n    this._lineGroup.add(polyline);\n    this._polyline = polyline;\n    return polyline;\n  };\n  LineView.prototype._newPolygon = function (points, stackedOnPoints) {\n    var polygon = this._polygon;\n    // Remove previous created polygon\n    if (polygon) {\n      this._lineGroup.remove(polygon);\n    }\n    polygon = new ECPolygon({\n      shape: {\n        points: points,\n        stackedOnPoints: stackedOnPoints\n      },\n      segmentIgnoreThreshold: 2\n    });\n    this._lineGroup.add(polygon);\n    this._polygon = polygon;\n    return polygon;\n  };\n  LineView.prototype._initSymbolLabelAnimation = function (data, coordSys, clipShape) {\n    var isHorizontalOrRadial;\n    var isCoordSysPolar;\n    var baseAxis = coordSys.getBaseAxis();\n    var isAxisInverse = baseAxis.inverse;\n    if (coordSys.type === 'cartesian2d') {\n      isHorizontalOrRadial = baseAxis.isHorizontal();\n      isCoordSysPolar = false;\n    } else if (coordSys.type === 'polar') {\n      isHorizontalOrRadial = baseAxis.dim === 'angle';\n      isCoordSysPolar = true;\n    }\n    var seriesModel = data.hostModel;\n    var seriesDuration = seriesModel.get('animationDuration');\n    if (zrUtil.isFunction(seriesDuration)) {\n      seriesDuration = seriesDuration(null);\n    }\n    var seriesDelay = seriesModel.get('animationDelay') || 0;\n    var seriesDelayValue = zrUtil.isFunction(seriesDelay) ? seriesDelay(null) : seriesDelay;\n    data.eachItemGraphicEl(function (symbol, idx) {\n      var el = symbol;\n      if (el) {\n        var point = [symbol.x, symbol.y];\n        var start = void 0;\n        var end = void 0;\n        var current = void 0;\n        if (clipShape) {\n          if (isCoordSysPolar) {\n            var polarClip = clipShape;\n            var coord = coordSys.pointToCoord(point);\n            if (isHorizontalOrRadial) {\n              start = polarClip.startAngle;\n              end = polarClip.endAngle;\n              current = -coord[1] / 180 * Math.PI;\n            } else {\n              start = polarClip.r0;\n              end = polarClip.r;\n              current = coord[0];\n            }\n          } else {\n            var gridClip = clipShape;\n            if (isHorizontalOrRadial) {\n              start = gridClip.x;\n              end = gridClip.x + gridClip.width;\n              current = symbol.x;\n            } else {\n              start = gridClip.y + gridClip.height;\n              end = gridClip.y;\n              current = symbol.y;\n            }\n          }\n        }\n        var ratio = end === start ? 0 : (current - start) / (end - start);\n        if (isAxisInverse) {\n          ratio = 1 - ratio;\n        }\n        var delay = zrUtil.isFunction(seriesDelay) ? seriesDelay(idx) : seriesDuration * ratio + seriesDelayValue;\n        var symbolPath = el.getSymbolPath();\n        var text = symbolPath.getTextContent();\n        el.attr({\n          scaleX: 0,\n          scaleY: 0\n        });\n        el.animateTo({\n          scaleX: 1,\n          scaleY: 1\n        }, {\n          duration: 200,\n          setToFinal: true,\n          delay: delay\n        });\n        if (text) {\n          text.animateFrom({\n            style: {\n              opacity: 0\n            }\n          }, {\n            duration: 300,\n            delay: delay\n          });\n        }\n        symbolPath.disableLabelAnimation = true;\n      }\n    });\n  };\n  LineView.prototype._initOrUpdateEndLabel = function (seriesModel, coordSys, inheritColor) {\n    var endLabelModel = seriesModel.getModel('endLabel');\n    if (anyStateShowEndLabel(seriesModel)) {\n      var data_2 = seriesModel.getData();\n      var polyline = this._polyline;\n      // series may be filtered.\n      var points = data_2.getLayout('points');\n      if (!points) {\n        polyline.removeTextContent();\n        this._endLabel = null;\n        return;\n      }\n      var endLabel = this._endLabel;\n      if (!endLabel) {\n        endLabel = this._endLabel = new graphic.Text({\n          z2: 200 // should be higher than item symbol\n        });\n        endLabel.ignoreClip = true;\n        polyline.setTextContent(this._endLabel);\n        polyline.disableLabelAnimation = true;\n      }\n      // Find last non-NaN data to display data\n      var dataIndex = getLastIndexNotNull(points);\n      if (dataIndex >= 0) {\n        setLabelStyle(polyline, getLabelStatesModels(seriesModel, 'endLabel'), {\n          inheritColor: inheritColor,\n          labelFetcher: seriesModel,\n          labelDataIndex: dataIndex,\n          defaultText: function (dataIndex, opt, interpolatedValue) {\n            return interpolatedValue != null ? getDefaultInterpolatedLabel(data_2, interpolatedValue) : getDefaultLabel(data_2, dataIndex);\n          },\n          enableTextSetter: true\n        }, getEndLabelStateSpecified(endLabelModel, coordSys));\n        polyline.textConfig.position = null;\n      }\n    } else if (this._endLabel) {\n      this._polyline.removeTextContent();\n      this._endLabel = null;\n    }\n  };\n  LineView.prototype._endLabelOnDuring = function (percent, clipRect, data, animationRecord, valueAnimation, endLabelModel, coordSys) {\n    var endLabel = this._endLabel;\n    var polyline = this._polyline;\n    if (endLabel) {\n      // NOTE: Don't remove percent < 1. percent === 1 means the first frame during render.\n      // The label is not prepared at this time.\n      if (percent < 1 && animationRecord.originalX == null) {\n        animationRecord.originalX = endLabel.x;\n        animationRecord.originalY = endLabel.y;\n      }\n      var points = data.getLayout('points');\n      var seriesModel = data.hostModel;\n      var connectNulls = seriesModel.get('connectNulls');\n      var precision = endLabelModel.get('precision');\n      var distance = endLabelModel.get('distance') || 0;\n      var baseAxis = coordSys.getBaseAxis();\n      var isHorizontal = baseAxis.isHorizontal();\n      var isBaseInversed = baseAxis.inverse;\n      var clipShape = clipRect.shape;\n      var xOrY = isBaseInversed ? isHorizontal ? clipShape.x : clipShape.y + clipShape.height : isHorizontal ? clipShape.x + clipShape.width : clipShape.y;\n      var distanceX = (isHorizontal ? distance : 0) * (isBaseInversed ? -1 : 1);\n      var distanceY = (isHorizontal ? 0 : -distance) * (isBaseInversed ? -1 : 1);\n      var dim = isHorizontal ? 'x' : 'y';\n      var dataIndexRange = getIndexRange(points, xOrY, dim);\n      var indices = dataIndexRange.range;\n      var diff = indices[1] - indices[0];\n      var value = void 0;\n      if (diff >= 1) {\n        // diff > 1 && connectNulls, which is on the null data.\n        if (diff > 1 && !connectNulls) {\n          var pt = getPointAtIndex(points, indices[0]);\n          endLabel.attr({\n            x: pt[0] + distanceX,\n            y: pt[1] + distanceY\n          });\n          valueAnimation && (value = seriesModel.getRawValue(indices[0]));\n        } else {\n          var pt = polyline.getPointOn(xOrY, dim);\n          pt && endLabel.attr({\n            x: pt[0] + distanceX,\n            y: pt[1] + distanceY\n          });\n          var startValue = seriesModel.getRawValue(indices[0]);\n          var endValue = seriesModel.getRawValue(indices[1]);\n          valueAnimation && (value = modelUtil.interpolateRawValues(data, precision, startValue, endValue, dataIndexRange.t));\n        }\n        animationRecord.lastFrameIndex = indices[0];\n      } else {\n        // If diff <= 0, which is the range is not found(Include NaN)\n        // Choose the first point or last point.\n        var idx = percent === 1 || animationRecord.lastFrameIndex > 0 ? indices[0] : 0;\n        var pt = getPointAtIndex(points, idx);\n        valueAnimation && (value = seriesModel.getRawValue(idx));\n        endLabel.attr({\n          x: pt[0] + distanceX,\n          y: pt[1] + distanceY\n        });\n      }\n      if (valueAnimation) {\n        var inner = labelInner(endLabel);\n        if (typeof inner.setLabelText === 'function') {\n          inner.setLabelText(value);\n        }\n      }\n    }\n  };\n  /**\n   * @private\n   */\n  // FIXME Two value axis\n  LineView.prototype._doUpdateAnimation = function (data, stackedOnPoints, coordSys, api, step, valueOrigin, connectNulls) {\n    var polyline = this._polyline;\n    var polygon = this._polygon;\n    var seriesModel = data.hostModel;\n    var diff = lineAnimationDiff(this._data, data, this._stackedOnPoints, stackedOnPoints, this._coordSys, coordSys, this._valueOrigin, valueOrigin);\n    var current = diff.current;\n    var stackedOnCurrent = diff.stackedOnCurrent;\n    var next = diff.next;\n    var stackedOnNext = diff.stackedOnNext;\n    if (step) {\n      // TODO If stacked series is not step\n      stackedOnCurrent = turnPointsIntoStep(diff.stackedOnCurrent, diff.current, coordSys, step, connectNulls);\n      current = turnPointsIntoStep(diff.current, null, coordSys, step, connectNulls);\n      stackedOnNext = turnPointsIntoStep(diff.stackedOnNext, diff.next, coordSys, step, connectNulls);\n      next = turnPointsIntoStep(diff.next, null, coordSys, step, connectNulls);\n    }\n    // Don't apply animation if diff is large.\n    // For better result and avoid memory explosion problems like\n    // https://github.com/apache/incubator-echarts/issues/12229\n    if (getBoundingDiff(current, next) > 3000 || polygon && getBoundingDiff(stackedOnCurrent, stackedOnNext) > 3000) {\n      polyline.stopAnimation();\n      polyline.setShape({\n        points: next\n      });\n      if (polygon) {\n        polygon.stopAnimation();\n        polygon.setShape({\n          points: next,\n          stackedOnPoints: stackedOnNext\n        });\n      }\n      return;\n    }\n    polyline.shape.__points = diff.current;\n    polyline.shape.points = current;\n    var target = {\n      shape: {\n        points: next\n      }\n    };\n    // Also animate the original points.\n    // If points reference is changed when turning into step line.\n    if (diff.current !== current) {\n      target.shape.__points = diff.next;\n    }\n    // Stop previous animation.\n    polyline.stopAnimation();\n    graphic.updateProps(polyline, target, seriesModel);\n    if (polygon) {\n      polygon.setShape({\n        // Reuse the points with polyline.\n        points: current,\n        stackedOnPoints: stackedOnCurrent\n      });\n      polygon.stopAnimation();\n      graphic.updateProps(polygon, {\n        shape: {\n          stackedOnPoints: stackedOnNext\n        }\n      }, seriesModel);\n      // If use attr directly in updateProps.\n      if (polyline.shape.points !== polygon.shape.points) {\n        polygon.shape.points = polyline.shape.points;\n      }\n    }\n    var updatedDataInfo = [];\n    var diffStatus = diff.status;\n    for (var i = 0; i < diffStatus.length; i++) {\n      var cmd = diffStatus[i].cmd;\n      if (cmd === '=') {\n        var el = data.getItemGraphicEl(diffStatus[i].idx1);\n        if (el) {\n          updatedDataInfo.push({\n            el: el,\n            ptIdx: i // Index of points\n          });\n        }\n      }\n    }\n    if (polyline.animators && polyline.animators.length) {\n      polyline.animators[0].during(function () {\n        polygon && polygon.dirtyShape();\n        var points = polyline.shape.__points;\n        for (var i = 0; i < updatedDataInfo.length; i++) {\n          var el = updatedDataInfo[i].el;\n          var offset = updatedDataInfo[i].ptIdx * 2;\n          el.x = points[offset];\n          el.y = points[offset + 1];\n          el.markRedraw();\n        }\n      });\n    }\n  };\n  LineView.prototype.remove = function (ecModel) {\n    var group = this.group;\n    var oldData = this._data;\n    this._lineGroup.removeAll();\n    this._symbolDraw.remove(true);\n    // Remove temporary created elements when highlighting\n    oldData && oldData.eachItemGraphicEl(function (el, idx) {\n      if (el.__temp) {\n        group.remove(el);\n        oldData.setItemGraphicEl(idx, null);\n      }\n    });\n    this._polyline = this._polygon = this._coordSys = this._points = this._stackedOnPoints = this._endLabel = this._data = null;\n  };\n  LineView.type = 'line';\n  return LineView;\n}(ChartView);\nexport default LineView;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { map } from 'zrender/lib/core/util.js';\nimport createRenderPlanner from '../chart/helper/createRenderPlanner.js';\nimport { isDimensionStacked } from '../data/helper/dataStackHelper.js';\nimport { createFloat32Array } from '../util/vendor.js';\nexport default function pointsLayout(seriesType, forceStoreInTypedArray) {\n  return {\n    seriesType: seriesType,\n    plan: createRenderPlanner(),\n    reset: function (seriesModel) {\n      var data = seriesModel.getData();\n      var coordSys = seriesModel.coordinateSystem;\n      var pipelineContext = seriesModel.pipelineContext;\n      var useTypedArray = forceStoreInTypedArray || pipelineContext.large;\n      if (!coordSys) {\n        return;\n      }\n      var dims = map(coordSys.dimensions, function (dim) {\n        return data.mapDimension(dim);\n      }).slice(0, 2);\n      var dimLen = dims.length;\n      var stackResultDim = data.getCalculationInfo('stackResultDimension');\n      if (isDimensionStacked(data, dims[0])) {\n        dims[0] = stackResultDim;\n      }\n      if (isDimensionStacked(data, dims[1])) {\n        dims[1] = stackResultDim;\n      }\n      var store = data.getStore();\n      var dimIdx0 = data.getDimensionIndex(dims[0]);\n      var dimIdx1 = data.getDimensionIndex(dims[1]);\n      return dimLen && {\n        progress: function (params, data) {\n          var segCount = params.end - params.start;\n          var points = useTypedArray && createFloat32Array(segCount * dimLen);\n          var tmpIn = [];\n          var tmpOut = [];\n          for (var i = params.start, offset = 0; i < params.end; i++) {\n            var point = void 0;\n            if (dimLen === 1) {\n              var x = store.get(dimIdx0, i);\n              // NOTE: Make sure the second parameter is null to use default strategy.\n              point = coordSys.dataToPoint(x, null, tmpOut);\n            } else {\n              tmpIn[0] = store.get(dimIdx0, i);\n              tmpIn[1] = store.get(dimIdx1, i);\n              // Let coordinate system to handle the NaN data.\n              point = coordSys.dataToPoint(tmpIn, null, tmpOut);\n            }\n            if (useTypedArray) {\n              points[offset++] = point[0];\n              points[offset++] = point[1];\n            } else {\n              data.setItemLayout(i, point.slice());\n            }\n          }\n          useTypedArray && data.setLayout('points', points);\n        }\n      };\n    }\n  };\n}\n;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { isFunction, isString } from 'zrender/lib/core/util.js';\nvar samplers = {\n  average: function (frame) {\n    var sum = 0;\n    var count = 0;\n    for (var i = 0; i < frame.length; i++) {\n      if (!isNaN(frame[i])) {\n        sum += frame[i];\n        count++;\n      }\n    }\n    // Return NaN if count is 0\n    return count === 0 ? NaN : sum / count;\n  },\n  sum: function (frame) {\n    var sum = 0;\n    for (var i = 0; i < frame.length; i++) {\n      // Ignore NaN\n      sum += frame[i] || 0;\n    }\n    return sum;\n  },\n  max: function (frame) {\n    var max = -Infinity;\n    for (var i = 0; i < frame.length; i++) {\n      frame[i] > max && (max = frame[i]);\n    }\n    // NaN will cause illegal axis extent.\n    return isFinite(max) ? max : NaN;\n  },\n  min: function (frame) {\n    var min = Infinity;\n    for (var i = 0; i < frame.length; i++) {\n      frame[i] < min && (min = frame[i]);\n    }\n    // NaN will cause illegal axis extent.\n    return isFinite(min) ? min : NaN;\n  },\n  // TODO\n  // Median\n  nearest: function (frame) {\n    return frame[0];\n  }\n};\nvar indexSampler = function (frame) {\n  return Math.round(frame.length / 2);\n};\nexport default function dataSample(seriesType) {\n  return {\n    seriesType: seriesType,\n    // FIXME:TS never used, so comment it\n    // modifyOutputEnd: true,\n    reset: function (seriesModel, ecModel, api) {\n      var data = seriesModel.getData();\n      var sampling = seriesModel.get('sampling');\n      var coordSys = seriesModel.coordinateSystem;\n      var count = data.count();\n      // Only cartesian2d support down sampling. Disable it when there is few data.\n      if (count > 10 && coordSys.type === 'cartesian2d' && sampling) {\n        var baseAxis = coordSys.getBaseAxis();\n        var valueAxis = coordSys.getOtherAxis(baseAxis);\n        var extent = baseAxis.getExtent();\n        var dpr = api.getDevicePixelRatio();\n        // Coordinste system has been resized\n        var size = Math.abs(extent[1] - extent[0]) * (dpr || 1);\n        var rate = Math.round(count / size);\n        if (isFinite(rate) && rate > 1) {\n          if (sampling === 'lttb') {\n            seriesModel.setData(data.lttbDownSample(data.mapDimension(valueAxis.dim), 1 / rate));\n          } else if (sampling === 'minmax') {\n            seriesModel.setData(data.minmaxDownSample(data.mapDimension(valueAxis.dim), 1 / rate));\n          }\n          var sampler = void 0;\n          if (isString(sampling)) {\n            sampler = samplers[sampling];\n          } else if (isFunction(sampling)) {\n            sampler = sampling;\n          }\n          if (sampler) {\n            // Only support sample the first dim mapped from value axis.\n            seriesModel.setData(data.downSample(data.mapDimension(valueAxis.dim), 1 / rate, sampler, indexSampler));\n          }\n        }\n      }\n    }\n  };\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport LineSeries from './LineSeries.js';\nimport LineView from './LineView.js';\n// In case developer forget to include grid component\nimport layoutPoints from '../../layout/points.js';\nimport dataSample from '../../processor/dataSample.js';\nexport function install(registers) {\n  registers.registerChartView(LineView);\n  registers.registerSeriesModel(LineSeries);\n  registers.registerLayout(layoutPoints('line', true));\n  registers.registerVisual({\n    seriesType: 'line',\n    reset: function (seriesModel) {\n      var data = seriesModel.getData();\n      // Visual coding for legend\n      var lineStyle = seriesModel.getModel('lineStyle').getLineStyle();\n      if (lineStyle && !lineStyle.stroke) {\n        // Fill in visual should be palette color if\n        // has color callback\n        lineStyle.stroke = data.getVisual('style').fill;\n      }\n      data.setVisual('legendLineStyle', lineStyle);\n    }\n  });\n  // Down sample after filter\n  registers.registerProcessor(registers.PRIORITY.PROCESSOR.STATISTIC, dataSample('line'));\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport SeriesModel from '../../model/Series.js';\nimport createSeriesData from '../helper/createSeriesData.js';\nimport { each } from 'zrender/lib/core/util.js';\nvar BaseBarSeriesModel = /** @class */function (_super) {\n  __extends(BaseBarSeriesModel, _super);\n  function BaseBarSeriesModel() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = BaseBarSeriesModel.type;\n    return _this;\n  }\n  BaseBarSeriesModel.prototype.getInitialData = function (option, ecModel) {\n    return createSeriesData(null, this, {\n      useEncodeDefaulter: true\n    });\n  };\n  BaseBarSeriesModel.prototype.getMarkerPosition = function (value, dims, startingAtTick) {\n    var coordSys = this.coordinateSystem;\n    if (coordSys && coordSys.clampData) {\n      // PENDING if clamp ?\n      var clampData_1 = coordSys.clampData(value);\n      var pt_1 = coordSys.dataToPoint(clampData_1);\n      if (startingAtTick) {\n        each(coordSys.getAxes(), function (axis, idx) {\n          // If axis type is category, use tick coords instead\n          if (axis.type === 'category' && dims != null) {\n            var tickCoords = axis.getTicksCoords();\n            var alignTicksWithLabel = axis.getTickModel().get('alignWithLabel');\n            var targetTickId = clampData_1[idx];\n            // The index of rightmost tick of markArea is 1 larger than x1/y1 index\n            var isEnd = dims[idx] === 'x1' || dims[idx] === 'y1';\n            if (isEnd && !alignTicksWithLabel) {\n              targetTickId += 1;\n            }\n            // The only contains one tick, tickCoords is\n            // like [{coord: 0, tickValue: 0}, {coord: 0}]\n            // to the length should always be larger than 1\n            if (tickCoords.length < 2) {\n              return;\n            } else if (tickCoords.length === 2) {\n              // The left value and right value of the axis are\n              // the same. coord is 0 in both items. Use the max\n              // value of the axis as the coord\n              pt_1[idx] = axis.toGlobalCoord(axis.getExtent()[isEnd ? 1 : 0]);\n              return;\n            }\n            var leftCoord = void 0;\n            var coord = void 0;\n            var stepTickValue = 1;\n            for (var i = 0; i < tickCoords.length; i++) {\n              var tickCoord = tickCoords[i].coord;\n              // The last item of tickCoords doesn't contain\n              // tickValue\n              var tickValue = i === tickCoords.length - 1 ? tickCoords[i - 1].tickValue + stepTickValue : tickCoords[i].tickValue;\n              if (tickValue === targetTickId) {\n                coord = tickCoord;\n                break;\n              } else if (tickValue < targetTickId) {\n                leftCoord = tickCoord;\n              } else if (leftCoord != null && tickValue > targetTickId) {\n                coord = (tickCoord + leftCoord) / 2;\n                break;\n              }\n              if (i === 1) {\n                // Here we assume the step of category axes is\n                // the same\n                stepTickValue = tickValue - tickCoords[0].tickValue;\n              }\n            }\n            if (coord == null) {\n              if (!leftCoord) {\n                // targetTickId is smaller than all tick ids in the\n                // visible area, use the leftmost tick coord\n                coord = tickCoords[0].coord;\n              } else if (leftCoord) {\n                // targetTickId is larger than all tick ids in the\n                // visible area, use the rightmost tick coord\n                coord = tickCoords[tickCoords.length - 1].coord;\n              }\n            }\n            pt_1[idx] = axis.toGlobalCoord(coord);\n          }\n        });\n      } else {\n        var data = this.getData();\n        var offset = data.getLayout('offset');\n        var size = data.getLayout('size');\n        var offsetIndex = coordSys.getBaseAxis().isHorizontal() ? 0 : 1;\n        pt_1[offsetIndex] += offset + size / 2;\n      }\n      return pt_1;\n    }\n    return [NaN, NaN];\n  };\n  BaseBarSeriesModel.type = 'series.__base_bar__';\n  BaseBarSeriesModel.defaultOption = {\n    // zlevel: 0,\n    z: 2,\n    coordinateSystem: 'cartesian2d',\n    legendHoverLink: true,\n    // stack: null\n    // Cartesian coordinate system\n    // xAxisIndex: 0,\n    // yAxisIndex: 0,\n    barMinHeight: 0,\n    barMinAngle: 0,\n    // cursor: null,\n    large: false,\n    largeThreshold: 400,\n    progressive: 3e3,\n    progressiveChunkMode: 'mod',\n    defaultBarGap: '10%'\n  };\n  return BaseBarSeriesModel;\n}(SeriesModel);\nSeriesModel.registerClass(BaseBarSeriesModel);\nexport default BaseBarSeriesModel;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport BaseBarSeriesModel from './BaseBarSeries.js';\nimport createSeriesData from '../helper/createSeriesData.js';\nimport { inheritDefaultOption } from '../../util/component.js';\nimport tokens from '../../visual/tokens.js';\nvar BarSeriesModel = /** @class */function (_super) {\n  __extends(BarSeriesModel, _super);\n  function BarSeriesModel() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = BarSeriesModel.type;\n    return _this;\n  }\n  BarSeriesModel.prototype.getInitialData = function () {\n    return createSeriesData(null, this, {\n      useEncodeDefaulter: true,\n      createInvertedIndices: !!this.get('realtimeSort', true) || null\n    });\n  };\n  /**\n   * @override\n   */\n  BarSeriesModel.prototype.getProgressive = function () {\n    // Do not support progressive in normal mode.\n    return this.get('large') ? this.get('progressive') : false;\n  };\n  /**\n   * @override\n   */\n  BarSeriesModel.prototype.getProgressiveThreshold = function () {\n    // Do not support progressive in normal mode.\n    var progressiveThreshold = this.get('progressiveThreshold');\n    var largeThreshold = this.get('largeThreshold');\n    if (largeThreshold > progressiveThreshold) {\n      progressiveThreshold = largeThreshold;\n    }\n    return progressiveThreshold;\n  };\n  BarSeriesModel.prototype.brushSelector = function (dataIndex, data, selectors) {\n    return selectors.rect(data.getItemLayout(dataIndex));\n  };\n  BarSeriesModel.type = 'series.bar';\n  BarSeriesModel.dependencies = ['grid', 'polar'];\n  BarSeriesModel.defaultOption = inheritDefaultOption(BaseBarSeriesModel.defaultOption, {\n    // If clipped\n    // Only available on cartesian2d\n    clip: true,\n    roundCap: false,\n    showBackground: false,\n    backgroundStyle: {\n      color: 'rgba(180, 180, 180, 0.2)',\n      borderColor: null,\n      borderWidth: 0,\n      borderType: 'solid',\n      borderRadius: 0,\n      shadowBlur: 0,\n      shadowColor: null,\n      shadowOffsetX: 0,\n      shadowOffsetY: 0,\n      opacity: 1\n    },\n    select: {\n      itemStyle: {\n        borderColor: tokens.color.primary,\n        borderWidth: 2\n      }\n    },\n    realtimeSort: false\n  });\n  return BarSeriesModel;\n}(BaseBarSeriesModel);\nexport default BarSeriesModel;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport { Path } from '../graphic.js';\n/**\n * Sausage: similar to sector, but have half circle on both sides\n */\nvar SausageShape = /** @class */function () {\n  function SausageShape() {\n    this.cx = 0;\n    this.cy = 0;\n    this.r0 = 0;\n    this.r = 0;\n    this.startAngle = 0;\n    this.endAngle = Math.PI * 2;\n    this.clockwise = true;\n  }\n  return SausageShape;\n}();\nvar SausagePath = /** @class */function (_super) {\n  __extends(SausagePath, _super);\n  function SausagePath(opts) {\n    var _this = _super.call(this, opts) || this;\n    _this.type = 'sausage';\n    return _this;\n  }\n  SausagePath.prototype.getDefaultShape = function () {\n    return new SausageShape();\n  };\n  SausagePath.prototype.buildPath = function (ctx, shape) {\n    var cx = shape.cx;\n    var cy = shape.cy;\n    var r0 = Math.max(shape.r0 || 0, 0);\n    var r = Math.max(shape.r, 0);\n    var dr = (r - r0) * 0.5;\n    var rCenter = r0 + dr;\n    var startAngle = shape.startAngle;\n    var endAngle = shape.endAngle;\n    var clockwise = shape.clockwise;\n    var PI2 = Math.PI * 2;\n    var lessThanCircle = clockwise ? endAngle - startAngle < PI2 : startAngle - endAngle < PI2;\n    if (!lessThanCircle) {\n      // Normalize angles\n      startAngle = endAngle - (clockwise ? PI2 : -PI2);\n    }\n    var unitStartX = Math.cos(startAngle);\n    var unitStartY = Math.sin(startAngle);\n    var unitEndX = Math.cos(endAngle);\n    var unitEndY = Math.sin(endAngle);\n    if (lessThanCircle) {\n      ctx.moveTo(unitStartX * r0 + cx, unitStartY * r0 + cy);\n      ctx.arc(unitStartX * rCenter + cx, unitStartY * rCenter + cy, dr, -Math.PI + startAngle, startAngle, !clockwise);\n    } else {\n      ctx.moveTo(unitStartX * r + cx, unitStartY * r + cy);\n    }\n    ctx.arc(cx, cy, r, startAngle, endAngle, !clockwise);\n    ctx.arc(unitEndX * rCenter + cx, unitEndY * rCenter + cy, dr, endAngle - Math.PI * 2, endAngle - Math.PI, !clockwise);\n    if (r0 !== 0) {\n      ctx.arc(cx, cy, r0, endAngle, startAngle, clockwise);\n    }\n    // ctx.closePath();\n  };\n  return SausagePath;\n}(Path);\nexport default SausagePath;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { calculateTextPosition } from 'zrender/lib/contain/text.js';\nimport { isArray, isNumber } from 'zrender/lib/core/util.js';\nexport function createSectorCalculateTextPosition(positionMapping, opts) {\n  opts = opts || {};\n  var isRoundCap = opts.isRoundCap;\n  return function (out, opts, boundingRect) {\n    var textPosition = opts.position;\n    if (!textPosition || textPosition instanceof Array) {\n      return calculateTextPosition(out, opts, boundingRect);\n    }\n    var mappedSectorPosition = positionMapping(textPosition);\n    var distance = opts.distance != null ? opts.distance : 5;\n    var sector = this.shape;\n    var cx = sector.cx;\n    var cy = sector.cy;\n    var r = sector.r;\n    var r0 = sector.r0;\n    var middleR = (r + r0) / 2;\n    var startAngle = sector.startAngle;\n    var endAngle = sector.endAngle;\n    var middleAngle = (startAngle + endAngle) / 2;\n    var extraDist = isRoundCap ? Math.abs(r - r0) / 2 : 0;\n    var mathCos = Math.cos;\n    var mathSin = Math.sin;\n    // base position: top-left\n    var x = cx + r * mathCos(startAngle);\n    var y = cy + r * mathSin(startAngle);\n    var textAlign = 'left';\n    var textVerticalAlign = 'top';\n    switch (mappedSectorPosition) {\n      case 'startArc':\n        x = cx + (r0 - distance) * mathCos(middleAngle);\n        y = cy + (r0 - distance) * mathSin(middleAngle);\n        textAlign = 'center';\n        textVerticalAlign = 'top';\n        break;\n      case 'insideStartArc':\n        x = cx + (r0 + distance) * mathCos(middleAngle);\n        y = cy + (r0 + distance) * mathSin(middleAngle);\n        textAlign = 'center';\n        textVerticalAlign = 'bottom';\n        break;\n      case 'startAngle':\n        x = cx + middleR * mathCos(startAngle) + adjustAngleDistanceX(startAngle, distance + extraDist, false);\n        y = cy + middleR * mathSin(startAngle) + adjustAngleDistanceY(startAngle, distance + extraDist, false);\n        textAlign = 'right';\n        textVerticalAlign = 'middle';\n        break;\n      case 'insideStartAngle':\n        x = cx + middleR * mathCos(startAngle) + adjustAngleDistanceX(startAngle, -distance + extraDist, false);\n        y = cy + middleR * mathSin(startAngle) + adjustAngleDistanceY(startAngle, -distance + extraDist, false);\n        textAlign = 'left';\n        textVerticalAlign = 'middle';\n        break;\n      case 'middle':\n        x = cx + middleR * mathCos(middleAngle);\n        y = cy + middleR * mathSin(middleAngle);\n        textAlign = 'center';\n        textVerticalAlign = 'middle';\n        break;\n      case 'endArc':\n        x = cx + (r + distance) * mathCos(middleAngle);\n        y = cy + (r + distance) * mathSin(middleAngle);\n        textAlign = 'center';\n        textVerticalAlign = 'bottom';\n        break;\n      case 'insideEndArc':\n        x = cx + (r - distance) * mathCos(middleAngle);\n        y = cy + (r - distance) * mathSin(middleAngle);\n        textAlign = 'center';\n        textVerticalAlign = 'top';\n        break;\n      case 'endAngle':\n        x = cx + middleR * mathCos(endAngle) + adjustAngleDistanceX(endAngle, distance + extraDist, true);\n        y = cy + middleR * mathSin(endAngle) + adjustAngleDistanceY(endAngle, distance + extraDist, true);\n        textAlign = 'left';\n        textVerticalAlign = 'middle';\n        break;\n      case 'insideEndAngle':\n        x = cx + middleR * mathCos(endAngle) + adjustAngleDistanceX(endAngle, -distance + extraDist, true);\n        y = cy + middleR * mathSin(endAngle) + adjustAngleDistanceY(endAngle, -distance + extraDist, true);\n        textAlign = 'right';\n        textVerticalAlign = 'middle';\n        break;\n      default:\n        return calculateTextPosition(out, opts, boundingRect);\n    }\n    out = out || {};\n    out.x = x;\n    out.y = y;\n    out.align = textAlign;\n    out.verticalAlign = textVerticalAlign;\n    return out;\n  };\n}\nexport function setSectorTextRotation(sector, textPosition, positionMapping, rotateType) {\n  if (isNumber(rotateType)) {\n    // user-set rotation\n    sector.setTextConfig({\n      rotation: rotateType\n    });\n    return;\n  } else if (isArray(textPosition)) {\n    // user-set position, use 0 as auto rotation\n    sector.setTextConfig({\n      rotation: 0\n    });\n    return;\n  }\n  var shape = sector.shape;\n  var startAngle = shape.clockwise ? shape.startAngle : shape.endAngle;\n  var endAngle = shape.clockwise ? shape.endAngle : shape.startAngle;\n  var middleAngle = (startAngle + endAngle) / 2;\n  var anchorAngle;\n  var mappedSectorPosition = positionMapping(textPosition);\n  switch (mappedSectorPosition) {\n    case 'startArc':\n    case 'insideStartArc':\n    case 'middle':\n    case 'insideEndArc':\n    case 'endArc':\n      anchorAngle = middleAngle;\n      break;\n    case 'startAngle':\n    case 'insideStartAngle':\n      anchorAngle = startAngle;\n      break;\n    case 'endAngle':\n    case 'insideEndAngle':\n      anchorAngle = endAngle;\n      break;\n    default:\n      sector.setTextConfig({\n        rotation: 0\n      });\n      return;\n  }\n  var rotate = Math.PI * 1.5 - anchorAngle;\n  /**\n   * TODO: labels with rotate > Math.PI / 2 should be rotate another\n   * half round flipped to increase readability. However, only middle\n   * position supports this for now, because in other positions, the\n   * anchor point is not at the center of the text, so the positions\n   * after rotating is not as expected.\n   */\n  if (mappedSectorPosition === 'middle' && rotate > Math.PI / 2 && rotate < Math.PI * 1.5) {\n    rotate -= Math.PI;\n  }\n  sector.setTextConfig({\n    rotation: rotate\n  });\n}\nfunction adjustAngleDistanceX(angle, distance, isEnd) {\n  return distance * Math.sin(angle) * (isEnd ? -1 : 1);\n}\nfunction adjustAngleDistanceY(angle, distance, isEnd) {\n  return distance * Math.cos(angle) * (isEnd ? 1 : -1);\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { isArray, map } from 'zrender/lib/core/util.js';\nimport { parsePercent } from 'zrender/lib/contain/text.js';\nexport function getSectorCornerRadius(model, shape, zeroIfNull) {\n  var cornerRadius = model.get('borderRadius');\n  if (cornerRadius == null) {\n    return zeroIfNull ? {\n      cornerRadius: 0\n    } : null;\n  }\n  if (!isArray(cornerRadius)) {\n    cornerRadius = [cornerRadius, cornerRadius, cornerRadius, cornerRadius];\n  }\n  var dr = Math.abs(shape.r || 0 - shape.r0 || 0);\n  return {\n    cornerRadius: map(cornerRadius, function (cr) {\n      return parsePercent(cr, dr);\n    })\n  };\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport Path from 'zrender/lib/graphic/Path.js';\nimport Group from 'zrender/lib/graphic/Group.js';\nimport { extend, each, map } from 'zrender/lib/core/util.js';\nimport { Rect, Sector, updateProps, initProps, removeElementWithFadeOut, traverseElements } from '../../util/graphic.js';\nimport { getECData } from '../../util/innerStore.js';\nimport { setStatesStylesFromModel, toggleHoverEmphasis } from '../../util/states.js';\nimport { setLabelStyle, getLabelStatesModels, setLabelValueAnimation, labelInner } from '../../label/labelStyle.js';\nimport { throttle } from '../../util/throttle.js';\nimport { createClipPath } from '../helper/createClipPathFromCoordSys.js';\nimport Sausage from '../../util/shape/sausage.js';\nimport ChartView from '../../view/Chart.js';\nimport { isCoordinateSystemType } from '../../coord/CoordinateSystem.js';\nimport { getDefaultLabel, getDefaultInterpolatedLabel } from '../helper/labelHelper.js';\nimport { warn } from '../../util/log.js';\nimport { createSectorCalculateTextPosition, setSectorTextRotation } from '../../label/sectorLabel.js';\nimport { saveOldStyle } from '../../animation/basicTransition.js';\nimport { getSectorCornerRadius } from '../helper/sectorHelper.js';\nvar mathMax = Math.max;\nvar mathMin = Math.min;\nfunction getClipArea(coord, data) {\n  var coordSysClipArea = coord.getArea && coord.getArea();\n  if (isCoordinateSystemType(coord, 'cartesian2d')) {\n    var baseAxis = coord.getBaseAxis();\n    // When boundaryGap is false or using time axis. bar may exceed the grid.\n    // We should not clip this part.\n    // See test/bar2.html\n    if (baseAxis.type !== 'category' || !baseAxis.onBand) {\n      var expandWidth = data.getLayout('bandWidth');\n      if (baseAxis.isHorizontal()) {\n        coordSysClipArea.x -= expandWidth;\n        coordSysClipArea.width += expandWidth * 2;\n      } else {\n        coordSysClipArea.y -= expandWidth;\n        coordSysClipArea.height += expandWidth * 2;\n      }\n    }\n  }\n  return coordSysClipArea;\n}\nvar BarView = /** @class */function (_super) {\n  __extends(BarView, _super);\n  function BarView() {\n    var _this = _super.call(this) || this;\n    _this.type = BarView.type;\n    _this._isFirstFrame = true;\n    return _this;\n  }\n  BarView.prototype.render = function (seriesModel, ecModel, api, payload) {\n    this._model = seriesModel;\n    this._removeOnRenderedListener(api);\n    this._updateDrawMode(seriesModel);\n    var coordinateSystemType = seriesModel.get('coordinateSystem');\n    if (coordinateSystemType === 'cartesian2d' || coordinateSystemType === 'polar') {\n      // Clear previously rendered progressive elements.\n      this._progressiveEls = null;\n      this._isLargeDraw ? this._renderLarge(seriesModel, ecModel, api) : this._renderNormal(seriesModel, ecModel, api, payload);\n    } else if (process.env.NODE_ENV !== 'production') {\n      warn('Only cartesian2d and polar supported for bar.');\n    }\n  };\n  BarView.prototype.incrementalPrepareRender = function (seriesModel) {\n    this._clear();\n    this._updateDrawMode(seriesModel);\n    // incremental also need to clip, otherwise might be overlow.\n    // But must not set clip in each frame, otherwise all of the children will be marked redraw.\n    this._updateLargeClip(seriesModel);\n  };\n  BarView.prototype.incrementalRender = function (params, seriesModel) {\n    // Reset\n    this._progressiveEls = [];\n    // Do not support progressive in normal mode.\n    this._incrementalRenderLarge(params, seriesModel);\n  };\n  BarView.prototype.eachRendered = function (cb) {\n    traverseElements(this._progressiveEls || this.group, cb);\n  };\n  BarView.prototype._updateDrawMode = function (seriesModel) {\n    var isLargeDraw = seriesModel.pipelineContext.large;\n    if (this._isLargeDraw == null || isLargeDraw !== this._isLargeDraw) {\n      this._isLargeDraw = isLargeDraw;\n      this._clear();\n    }\n  };\n  BarView.prototype._renderNormal = function (seriesModel, ecModel, api, payload) {\n    var group = this.group;\n    var data = seriesModel.getData();\n    var oldData = this._data;\n    var coord = seriesModel.coordinateSystem;\n    var baseAxis = coord.getBaseAxis();\n    var isHorizontalOrRadial;\n    if (coord.type === 'cartesian2d') {\n      isHorizontalOrRadial = baseAxis.isHorizontal();\n    } else if (coord.type === 'polar') {\n      isHorizontalOrRadial = baseAxis.dim === 'angle';\n    }\n    var animationModel = seriesModel.isAnimationEnabled() ? seriesModel : null;\n    var realtimeSortCfg = shouldRealtimeSort(seriesModel, coord);\n    if (realtimeSortCfg) {\n      this._enableRealtimeSort(realtimeSortCfg, data, api);\n    }\n    var needsClip = seriesModel.get('clip', true) || realtimeSortCfg;\n    var coordSysClipArea = getClipArea(coord, data);\n    // If there is clipPath created in large mode. Remove it.\n    group.removeClipPath();\n    // We don't use clipPath in normal mode because we needs a perfect animation\n    // And don't want the label are clipped.\n    var roundCap = seriesModel.get('roundCap', true);\n    var drawBackground = seriesModel.get('showBackground', true);\n    var backgroundModel = seriesModel.getModel('backgroundStyle');\n    var barBorderRadius = backgroundModel.get('borderRadius') || 0;\n    var bgEls = [];\n    var oldBgEls = this._backgroundEls;\n    var isInitSort = payload && payload.isInitSort;\n    var isChangeOrder = payload && payload.type === 'changeAxisOrder';\n    function createBackground(dataIndex) {\n      var bgLayout = getLayout[coord.type](data, dataIndex);\n      if (!bgLayout) {\n        return null;\n      }\n      var bgEl = createBackgroundEl(coord, isHorizontalOrRadial, bgLayout);\n      bgEl.useStyle(backgroundModel.getItemStyle());\n      // Only cartesian2d support borderRadius.\n      if (coord.type === 'cartesian2d') {\n        bgEl.setShape('r', barBorderRadius);\n      } else {\n        bgEl.setShape('cornerRadius', barBorderRadius);\n      }\n      bgEls[dataIndex] = bgEl;\n      return bgEl;\n    }\n    ;\n    data.diff(oldData).add(function (dataIndex) {\n      var itemModel = data.getItemModel(dataIndex);\n      var layout = getLayout[coord.type](data, dataIndex, itemModel);\n      if (!layout) {\n        return;\n      }\n      if (drawBackground) {\n        createBackground(dataIndex);\n      }\n      // If dataZoom in filteMode: 'empty', the baseValue can be set as NaN in \"axisProxy\".\n      if (!data.hasValue(dataIndex) || !isValidLayout[coord.type](layout)) {\n        return;\n      }\n      var isClipped = false;\n      if (needsClip) {\n        // Clip will modify the layout params.\n        // And return a boolean to determine if the shape are fully clipped.\n        isClipped = clip[coord.type](coordSysClipArea, layout);\n      }\n      var el = elementCreator[coord.type](seriesModel, data, dataIndex, layout, isHorizontalOrRadial, animationModel, baseAxis.model, false, roundCap);\n      if (realtimeSortCfg) {\n        /**\n         * Force label animation because even if the element is\n         * ignored because it's clipped, it may not be clipped after\n         * changing order. Then, if not using forceLabelAnimation,\n         * the label animation was never started, in which case,\n         * the label will be the final value and doesn't have label\n         * animation.\n         */\n        el.forceLabelAnimation = true;\n      }\n      updateStyle(el, data, dataIndex, itemModel, layout, seriesModel, isHorizontalOrRadial, coord.type === 'polar');\n      if (isInitSort) {\n        el.attr({\n          shape: layout\n        });\n      } else if (realtimeSortCfg) {\n        updateRealtimeAnimation(realtimeSortCfg, animationModel, el, layout, dataIndex, isHorizontalOrRadial, false, false);\n      } else {\n        initProps(el, {\n          shape: layout\n        }, seriesModel, dataIndex);\n      }\n      data.setItemGraphicEl(dataIndex, el);\n      group.add(el);\n      el.ignore = isClipped;\n    }).update(function (newIndex, oldIndex) {\n      var itemModel = data.getItemModel(newIndex);\n      var layout = getLayout[coord.type](data, newIndex, itemModel);\n      if (!layout) {\n        return;\n      }\n      if (drawBackground) {\n        var bgEl = void 0;\n        if (oldBgEls.length === 0) {\n          bgEl = createBackground(oldIndex);\n        } else {\n          bgEl = oldBgEls[oldIndex];\n          bgEl.useStyle(backgroundModel.getItemStyle());\n          // Only cartesian2d support borderRadius.\n          if (coord.type === 'cartesian2d') {\n            bgEl.setShape('r', barBorderRadius);\n          } else {\n            bgEl.setShape('cornerRadius', barBorderRadius);\n          }\n          bgEls[newIndex] = bgEl;\n        }\n        var bgLayout = getLayout[coord.type](data, newIndex);\n        var shape = createBackgroundShape(isHorizontalOrRadial, bgLayout, coord);\n        updateProps(bgEl, {\n          shape: shape\n        }, animationModel, newIndex);\n      }\n      var el = oldData.getItemGraphicEl(oldIndex);\n      if (!data.hasValue(newIndex) || !isValidLayout[coord.type](layout)) {\n        group.remove(el);\n        return;\n      }\n      var isClipped = false;\n      if (needsClip) {\n        isClipped = clip[coord.type](coordSysClipArea, layout);\n        if (isClipped) {\n          group.remove(el);\n        }\n      }\n      var roundCapChanged = el && (el.type === 'sector' && roundCap || el.type === 'sausage' && !roundCap);\n      if (roundCapChanged) {\n        // roundCap changed, there is no way to use animation from a `sector` to a `sausage` shape,\n        // so remove the old one and create a new shape\n        el && removeElementWithFadeOut(el, seriesModel, oldIndex);\n        el = null;\n      }\n      if (!el) {\n        el = elementCreator[coord.type](seriesModel, data, newIndex, layout, isHorizontalOrRadial, animationModel, baseAxis.model, true, roundCap);\n      } else {\n        saveOldStyle(el);\n      }\n      if (realtimeSortCfg) {\n        el.forceLabelAnimation = true;\n      }\n      if (isChangeOrder) {\n        var textEl = el.getTextContent();\n        if (textEl) {\n          var labelInnerStore = labelInner(textEl);\n          if (labelInnerStore.prevValue != null) {\n            /**\n             * Set preValue to be value so that no new label\n             * should be started, otherwise, it will take a full\n             * `animationDurationUpdate` time to finish the\n             * animation, which is not expected.\n             */\n            labelInnerStore.prevValue = labelInnerStore.value;\n          }\n        }\n      }\n      // Not change anything if only order changed.\n      // Especially not change label.\n      else {\n        updateStyle(el, data, newIndex, itemModel, layout, seriesModel, isHorizontalOrRadial, coord.type === 'polar');\n      }\n      if (isInitSort) {\n        el.attr({\n          shape: layout\n        });\n      } else if (realtimeSortCfg) {\n        updateRealtimeAnimation(realtimeSortCfg, animationModel, el, layout, newIndex, isHorizontalOrRadial, true, isChangeOrder);\n      } else {\n        updateProps(el, {\n          shape: layout\n        }, seriesModel, newIndex, null);\n      }\n      data.setItemGraphicEl(newIndex, el);\n      el.ignore = isClipped;\n      group.add(el);\n    }).remove(function (dataIndex) {\n      var el = oldData.getItemGraphicEl(dataIndex);\n      el && removeElementWithFadeOut(el, seriesModel, dataIndex);\n    }).execute();\n    var bgGroup = this._backgroundGroup || (this._backgroundGroup = new Group());\n    bgGroup.removeAll();\n    for (var i = 0; i < bgEls.length; ++i) {\n      bgGroup.add(bgEls[i]);\n    }\n    group.add(bgGroup);\n    this._backgroundEls = bgEls;\n    this._data = data;\n  };\n  BarView.prototype._renderLarge = function (seriesModel, ecModel, api) {\n    this._clear();\n    createLarge(seriesModel, this.group);\n    this._updateLargeClip(seriesModel);\n  };\n  BarView.prototype._incrementalRenderLarge = function (params, seriesModel) {\n    this._removeBackground();\n    createLarge(seriesModel, this.group, this._progressiveEls, true);\n  };\n  BarView.prototype._updateLargeClip = function (seriesModel) {\n    // Use clipPath in large mode.\n    var clipPath = seriesModel.get('clip', true) && createClipPath(seriesModel.coordinateSystem, false, seriesModel);\n    var group = this.group;\n    if (clipPath) {\n      group.setClipPath(clipPath);\n    } else {\n      group.removeClipPath();\n    }\n  };\n  BarView.prototype._enableRealtimeSort = function (realtimeSortCfg, data, api) {\n    var _this = this;\n    // If no data in the first frame, wait for data to initSort\n    if (!data.count()) {\n      return;\n    }\n    var baseAxis = realtimeSortCfg.baseAxis;\n    if (this._isFirstFrame) {\n      this._dispatchInitSort(data, realtimeSortCfg, api);\n      this._isFirstFrame = false;\n    } else {\n      var orderMapping_1 = function (idx) {\n        var el = data.getItemGraphicEl(idx);\n        var shape = el && el.shape;\n        return shape &&\n        // The result should be consistent with the initial sort by data value.\n        // Do not support the case that both positive and negative exist.\n        Math.abs(baseAxis.isHorizontal() ? shape.height : shape.width)\n        // If data is NaN, shape.xxx may be NaN, so use || 0 here in case\n        || 0;\n      };\n      this._onRendered = function () {\n        _this._updateSortWithinSameData(data, orderMapping_1, baseAxis, api);\n      };\n      api.getZr().on('rendered', this._onRendered);\n    }\n  };\n  BarView.prototype._dataSort = function (data, baseAxis, orderMapping) {\n    var info = [];\n    data.each(data.mapDimension(baseAxis.dim), function (ordinalNumber, dataIdx) {\n      var mappedValue = orderMapping(dataIdx);\n      mappedValue = mappedValue == null ? NaN : mappedValue;\n      info.push({\n        dataIndex: dataIdx,\n        mappedValue: mappedValue,\n        ordinalNumber: ordinalNumber\n      });\n    });\n    info.sort(function (a, b) {\n      // If NaN, it will be treated as min val.\n      return b.mappedValue - a.mappedValue;\n    });\n    return {\n      ordinalNumbers: map(info, function (item) {\n        return item.ordinalNumber;\n      })\n    };\n  };\n  BarView.prototype._isOrderChangedWithinSameData = function (data, orderMapping, baseAxis) {\n    var scale = baseAxis.scale;\n    var ordinalDataDim = data.mapDimension(baseAxis.dim);\n    var lastValue = Number.MAX_VALUE;\n    for (var tickNum = 0, len = scale.getOrdinalMeta().categories.length; tickNum < len; ++tickNum) {\n      var rawIdx = data.rawIndexOf(ordinalDataDim, scale.getRawOrdinalNumber(tickNum));\n      var value = rawIdx < 0\n      // If some tick have no bar, the tick will be treated as min.\n      ? Number.MIN_VALUE\n      // PENDING: if dataZoom on baseAxis exits, is it a performance issue?\n      : orderMapping(data.indexOfRawIndex(rawIdx));\n      if (value > lastValue) {\n        return true;\n      }\n      lastValue = value;\n    }\n    return false;\n  };\n  /*\n   * Consider the case when A and B changed order, whose representing\n   * bars are both out of sight, we don't wish to trigger reorder action\n   * as long as the order in the view doesn't change.\n   */\n  BarView.prototype._isOrderDifferentInView = function (orderInfo, baseAxis) {\n    var scale = baseAxis.scale;\n    var extent = scale.getExtent();\n    var tickNum = Math.max(0, extent[0]);\n    var tickMax = Math.min(extent[1], scale.getOrdinalMeta().categories.length - 1);\n    for (; tickNum <= tickMax; ++tickNum) {\n      if (orderInfo.ordinalNumbers[tickNum] !== scale.getRawOrdinalNumber(tickNum)) {\n        return true;\n      }\n    }\n  };\n  BarView.prototype._updateSortWithinSameData = function (data, orderMapping, baseAxis, api) {\n    if (!this._isOrderChangedWithinSameData(data, orderMapping, baseAxis)) {\n      return;\n    }\n    var sortInfo = this._dataSort(data, baseAxis, orderMapping);\n    if (this._isOrderDifferentInView(sortInfo, baseAxis)) {\n      this._removeOnRenderedListener(api);\n      api.dispatchAction({\n        type: 'changeAxisOrder',\n        componentType: baseAxis.dim + 'Axis',\n        axisId: baseAxis.index,\n        sortInfo: sortInfo\n      });\n    }\n  };\n  BarView.prototype._dispatchInitSort = function (data, realtimeSortCfg, api) {\n    var baseAxis = realtimeSortCfg.baseAxis;\n    var sortResult = this._dataSort(data, baseAxis, function (dataIdx) {\n      return data.get(data.mapDimension(realtimeSortCfg.otherAxis.dim), dataIdx);\n    });\n    api.dispatchAction({\n      type: 'changeAxisOrder',\n      componentType: baseAxis.dim + 'Axis',\n      isInitSort: true,\n      axisId: baseAxis.index,\n      sortInfo: sortResult\n    });\n  };\n  BarView.prototype.remove = function (ecModel, api) {\n    this._clear(this._model);\n    this._removeOnRenderedListener(api);\n  };\n  BarView.prototype.dispose = function (ecModel, api) {\n    this._removeOnRenderedListener(api);\n  };\n  BarView.prototype._removeOnRenderedListener = function (api) {\n    if (this._onRendered) {\n      api.getZr().off('rendered', this._onRendered);\n      this._onRendered = null;\n    }\n  };\n  BarView.prototype._clear = function (model) {\n    var group = this.group;\n    var data = this._data;\n    if (model && model.isAnimationEnabled() && data && !this._isLargeDraw) {\n      this._removeBackground();\n      this._backgroundEls = [];\n      data.eachItemGraphicEl(function (el) {\n        removeElementWithFadeOut(el, model, getECData(el).dataIndex);\n      });\n    } else {\n      group.removeAll();\n    }\n    this._data = null;\n    this._isFirstFrame = true;\n  };\n  BarView.prototype._removeBackground = function () {\n    this.group.remove(this._backgroundGroup);\n    this._backgroundGroup = null;\n  };\n  BarView.type = 'bar';\n  return BarView;\n}(ChartView);\nvar clip = {\n  cartesian2d: function (coordSysBoundingRect, layout) {\n    var signWidth = layout.width < 0 ? -1 : 1;\n    var signHeight = layout.height < 0 ? -1 : 1;\n    // Needs positive width and height\n    if (signWidth < 0) {\n      layout.x += layout.width;\n      layout.width = -layout.width;\n    }\n    if (signHeight < 0) {\n      layout.y += layout.height;\n      layout.height = -layout.height;\n    }\n    var coordSysX2 = coordSysBoundingRect.x + coordSysBoundingRect.width;\n    var coordSysY2 = coordSysBoundingRect.y + coordSysBoundingRect.height;\n    var x = mathMax(layout.x, coordSysBoundingRect.x);\n    var x2 = mathMin(layout.x + layout.width, coordSysX2);\n    var y = mathMax(layout.y, coordSysBoundingRect.y);\n    var y2 = mathMin(layout.y + layout.height, coordSysY2);\n    var xClipped = x2 < x;\n    var yClipped = y2 < y;\n    // When xClipped or yClipped, the element will be marked as `ignore`.\n    // But we should also place the element at the edge of the coord sys bounding rect.\n    // Because if data changed and the bar shows again, its transition animation\n    // will begin at this place.\n    layout.x = xClipped && x > coordSysX2 ? x2 : x;\n    layout.y = yClipped && y > coordSysY2 ? y2 : y;\n    layout.width = xClipped ? 0 : x2 - x;\n    layout.height = yClipped ? 0 : y2 - y;\n    // Reverse back\n    if (signWidth < 0) {\n      layout.x += layout.width;\n      layout.width = -layout.width;\n    }\n    if (signHeight < 0) {\n      layout.y += layout.height;\n      layout.height = -layout.height;\n    }\n    return xClipped || yClipped;\n  },\n  polar: function (coordSysClipArea, layout) {\n    var signR = layout.r0 <= layout.r ? 1 : -1;\n    // Make sure r is larger than r0\n    if (signR < 0) {\n      var tmp = layout.r;\n      layout.r = layout.r0;\n      layout.r0 = tmp;\n    }\n    var r = mathMin(layout.r, coordSysClipArea.r);\n    var r0 = mathMax(layout.r0, coordSysClipArea.r0);\n    layout.r = r;\n    layout.r0 = r0;\n    var clipped = r - r0 < 0;\n    // Reverse back\n    if (signR < 0) {\n      var tmp = layout.r;\n      layout.r = layout.r0;\n      layout.r0 = tmp;\n    }\n    return clipped;\n  }\n};\nvar elementCreator = {\n  cartesian2d: function (seriesModel, data, newIndex, layout, isHorizontal, animationModel, axisModel, isUpdate, roundCap) {\n    var rect = new Rect({\n      shape: extend({}, layout),\n      z2: 1\n    });\n    rect.__dataIndex = newIndex;\n    rect.name = 'item';\n    if (animationModel) {\n      var rectShape = rect.shape;\n      var animateProperty = isHorizontal ? 'height' : 'width';\n      rectShape[animateProperty] = 0;\n    }\n    return rect;\n  },\n  polar: function (seriesModel, data, newIndex, layout, isRadial, animationModel, axisModel, isUpdate, roundCap) {\n    var ShapeClass = !isRadial && roundCap ? Sausage : Sector;\n    var sector = new ShapeClass({\n      shape: layout,\n      z2: 1\n    });\n    sector.name = 'item';\n    var positionMap = createPolarPositionMapping(isRadial);\n    sector.calculateTextPosition = createSectorCalculateTextPosition(positionMap, {\n      isRoundCap: ShapeClass === Sausage\n    });\n    // Animation\n    if (animationModel) {\n      var sectorShape = sector.shape;\n      var animateProperty = isRadial ? 'r' : 'endAngle';\n      var animateTarget = {};\n      sectorShape[animateProperty] = isRadial ? layout.r0 : layout.startAngle;\n      animateTarget[animateProperty] = layout[animateProperty];\n      (isUpdate ? updateProps : initProps)(sector, {\n        shape: animateTarget\n        // __value: typeof dataValue === 'string' ? parseInt(dataValue, 10) : dataValue\n      }, animationModel);\n    }\n    return sector;\n  }\n};\nfunction shouldRealtimeSort(seriesModel, coordSys) {\n  var realtimeSortOption = seriesModel.get('realtimeSort', true);\n  var baseAxis = coordSys.getBaseAxis();\n  if (process.env.NODE_ENV !== 'production') {\n    if (realtimeSortOption) {\n      if (baseAxis.type !== 'category') {\n        warn('`realtimeSort` will not work because this bar series is not based on a category axis.');\n      }\n      if (coordSys.type !== 'cartesian2d') {\n        warn('`realtimeSort` will not work because this bar series is not on cartesian2d.');\n      }\n    }\n  }\n  if (realtimeSortOption && baseAxis.type === 'category' && coordSys.type === 'cartesian2d') {\n    return {\n      baseAxis: baseAxis,\n      otherAxis: coordSys.getOtherAxis(baseAxis)\n    };\n  }\n}\nfunction updateRealtimeAnimation(realtimeSortCfg, seriesAnimationModel, el, layout, newIndex, isHorizontal, isUpdate, isChangeOrder) {\n  var seriesTarget;\n  var axisTarget;\n  if (isHorizontal) {\n    axisTarget = {\n      x: layout.x,\n      width: layout.width\n    };\n    seriesTarget = {\n      y: layout.y,\n      height: layout.height\n    };\n  } else {\n    axisTarget = {\n      y: layout.y,\n      height: layout.height\n    };\n    seriesTarget = {\n      x: layout.x,\n      width: layout.width\n    };\n  }\n  if (!isChangeOrder) {\n    // Keep the original growth animation if only axis order changed.\n    // Not start a new animation.\n    (isUpdate ? updateProps : initProps)(el, {\n      shape: seriesTarget\n    }, seriesAnimationModel, newIndex, null);\n  }\n  var axisAnimationModel = seriesAnimationModel ? realtimeSortCfg.baseAxis.model : null;\n  (isUpdate ? updateProps : initProps)(el, {\n    shape: axisTarget\n  }, axisAnimationModel, newIndex);\n}\nfunction checkPropertiesNotValid(obj, props) {\n  for (var i = 0; i < props.length; i++) {\n    if (!isFinite(obj[props[i]])) {\n      return true;\n    }\n  }\n  return false;\n}\nvar rectPropties = ['x', 'y', 'width', 'height'];\nvar polarPropties = ['cx', 'cy', 'r', 'startAngle', 'endAngle'];\nvar isValidLayout = {\n  cartesian2d: function (layout) {\n    return !checkPropertiesNotValid(layout, rectPropties);\n  },\n  polar: function (layout) {\n    return !checkPropertiesNotValid(layout, polarPropties);\n  }\n};\nvar getLayout = {\n  // itemModel is only used to get borderWidth, which is not needed\n  // when calculating bar background layout.\n  cartesian2d: function (data, dataIndex, itemModel) {\n    var layout = data.getItemLayout(dataIndex);\n    if (!layout) {\n      return null;\n    }\n    var fixedLineWidth = itemModel ? getLineWidth(itemModel, layout) : 0;\n    // fix layout with lineWidth\n    var signX = layout.width > 0 ? 1 : -1;\n    var signY = layout.height > 0 ? 1 : -1;\n    return {\n      x: layout.x + signX * fixedLineWidth / 2,\n      y: layout.y + signY * fixedLineWidth / 2,\n      width: layout.width - signX * fixedLineWidth,\n      height: layout.height - signY * fixedLineWidth\n    };\n  },\n  polar: function (data, dataIndex, itemModel) {\n    var layout = data.getItemLayout(dataIndex);\n    return {\n      cx: layout.cx,\n      cy: layout.cy,\n      r0: layout.r0,\n      r: layout.r,\n      startAngle: layout.startAngle,\n      endAngle: layout.endAngle,\n      clockwise: layout.clockwise\n    };\n  }\n};\nfunction isZeroOnPolar(layout) {\n  return layout.startAngle != null && layout.endAngle != null && layout.startAngle === layout.endAngle;\n}\nfunction createPolarPositionMapping(isRadial) {\n  return function (isRadial) {\n    var arcOrAngle = isRadial ? 'Arc' : 'Angle';\n    return function (position) {\n      switch (position) {\n        case 'start':\n        case 'insideStart':\n        case 'end':\n        case 'insideEnd':\n          return position + arcOrAngle;\n        default:\n          return position;\n      }\n    };\n  }(isRadial);\n}\nfunction updateStyle(el, data, dataIndex, itemModel, layout, seriesModel, isHorizontalOrRadial, isPolar) {\n  var style = data.getItemVisual(dataIndex, 'style');\n  if (!isPolar) {\n    var borderRadius = itemModel.get(['itemStyle', 'borderRadius']) || 0;\n    el.setShape('r', borderRadius);\n  } else if (!seriesModel.get('roundCap')) {\n    var sectorShape = el.shape;\n    var cornerRadius = getSectorCornerRadius(itemModel.getModel('itemStyle'), sectorShape, true);\n    extend(sectorShape, cornerRadius);\n    el.setShape(sectorShape);\n  }\n  el.useStyle(style);\n  var cursorStyle = itemModel.getShallow('cursor');\n  cursorStyle && el.attr('cursor', cursorStyle);\n  var labelPositionOutside = isPolar ? isHorizontalOrRadial ? layout.r >= layout.r0 ? 'endArc' : 'startArc' : layout.endAngle >= layout.startAngle ? 'endAngle' : 'startAngle' : isHorizontalOrRadial ? layout.height >= 0 ? 'bottom' : 'top' : layout.width >= 0 ? 'right' : 'left';\n  var labelStatesModels = getLabelStatesModels(itemModel);\n  setLabelStyle(el, labelStatesModels, {\n    labelFetcher: seriesModel,\n    labelDataIndex: dataIndex,\n    defaultText: getDefaultLabel(seriesModel.getData(), dataIndex),\n    inheritColor: style.fill,\n    defaultOpacity: style.opacity,\n    defaultOutsidePosition: labelPositionOutside\n  });\n  var label = el.getTextContent();\n  if (isPolar && label) {\n    var position = itemModel.get(['label', 'position']);\n    el.textConfig.inside = position === 'middle' ? true : null;\n    setSectorTextRotation(el, position === 'outside' ? labelPositionOutside : position, createPolarPositionMapping(isHorizontalOrRadial), itemModel.get(['label', 'rotate']));\n  }\n  setLabelValueAnimation(label, labelStatesModels, seriesModel.getRawValue(dataIndex), function (value) {\n    return getDefaultInterpolatedLabel(data, value);\n  });\n  var emphasisModel = itemModel.getModel(['emphasis']);\n  toggleHoverEmphasis(el, emphasisModel.get('focus'), emphasisModel.get('blurScope'), emphasisModel.get('disabled'));\n  setStatesStylesFromModel(el, itemModel);\n  if (isZeroOnPolar(layout)) {\n    el.style.fill = 'none';\n    el.style.stroke = 'none';\n    each(el.states, function (state) {\n      if (state.style) {\n        state.style.fill = state.style.stroke = 'none';\n      }\n    });\n  }\n}\n// In case width or height are too small.\nfunction getLineWidth(itemModel, rawLayout) {\n  // Has no border.\n  var borderColor = itemModel.get(['itemStyle', 'borderColor']);\n  if (!borderColor || borderColor === 'none') {\n    return 0;\n  }\n  var lineWidth = itemModel.get(['itemStyle', 'borderWidth']) || 0;\n  // width or height may be NaN for empty data\n  var width = isNaN(rawLayout.width) ? Number.MAX_VALUE : Math.abs(rawLayout.width);\n  var height = isNaN(rawLayout.height) ? Number.MAX_VALUE : Math.abs(rawLayout.height);\n  return Math.min(lineWidth, width, height);\n}\nvar LagePathShape = /** @class */function () {\n  function LagePathShape() {}\n  return LagePathShape;\n}();\nvar LargePath = /** @class */function (_super) {\n  __extends(LargePath, _super);\n  function LargePath(opts) {\n    var _this = _super.call(this, opts) || this;\n    _this.type = 'largeBar';\n    return _this;\n  }\n  LargePath.prototype.getDefaultShape = function () {\n    return new LagePathShape();\n  };\n  LargePath.prototype.buildPath = function (ctx, shape) {\n    // Drawing lines is more efficient than drawing\n    // a whole line or drawing rects.\n    var points = shape.points;\n    var baseDimIdx = this.baseDimIdx;\n    var valueDimIdx = 1 - this.baseDimIdx;\n    var startPoint = [];\n    var size = [];\n    var barWidth = this.barWidth;\n    for (var i = 0; i < points.length; i += 3) {\n      size[baseDimIdx] = barWidth;\n      size[valueDimIdx] = points[i + 2];\n      startPoint[baseDimIdx] = points[i + baseDimIdx];\n      startPoint[valueDimIdx] = points[i + valueDimIdx];\n      ctx.rect(startPoint[0], startPoint[1], size[0], size[1]);\n    }\n  };\n  return LargePath;\n}(Path);\nfunction createLarge(seriesModel, group, progressiveEls, incremental) {\n  // TODO support polar\n  var data = seriesModel.getData();\n  var baseDimIdx = data.getLayout('valueAxisHorizontal') ? 1 : 0;\n  var largeDataIndices = data.getLayout('largeDataIndices');\n  var barWidth = data.getLayout('size');\n  var backgroundModel = seriesModel.getModel('backgroundStyle');\n  var bgPoints = data.getLayout('largeBackgroundPoints');\n  if (bgPoints) {\n    var bgEl = new LargePath({\n      shape: {\n        points: bgPoints\n      },\n      incremental: !!incremental,\n      silent: true,\n      z2: 0\n    });\n    bgEl.baseDimIdx = baseDimIdx;\n    bgEl.largeDataIndices = largeDataIndices;\n    bgEl.barWidth = barWidth;\n    bgEl.useStyle(backgroundModel.getItemStyle());\n    group.add(bgEl);\n    progressiveEls && progressiveEls.push(bgEl);\n  }\n  var el = new LargePath({\n    shape: {\n      points: data.getLayout('largePoints')\n    },\n    incremental: !!incremental,\n    ignoreCoarsePointer: true,\n    z2: 1\n  });\n  el.baseDimIdx = baseDimIdx;\n  el.largeDataIndices = largeDataIndices;\n  el.barWidth = barWidth;\n  group.add(el);\n  el.useStyle(data.getVisual('style'));\n  // Stroke is rendered first to avoid overlapping with fill\n  el.style.stroke = null;\n  // Enable tooltip and user mouse/touch event handlers.\n  getECData(el).seriesIndex = seriesModel.seriesIndex;\n  if (!seriesModel.get('silent')) {\n    el.on('mousedown', largePathUpdateDataIndex);\n    el.on('mousemove', largePathUpdateDataIndex);\n  }\n  progressiveEls && progressiveEls.push(el);\n}\n// Use throttle to avoid frequently traverse to find dataIndex.\nvar largePathUpdateDataIndex = throttle(function (event) {\n  var largePath = this;\n  var dataIndex = largePathFindDataIndex(largePath, event.offsetX, event.offsetY);\n  getECData(largePath).dataIndex = dataIndex >= 0 ? dataIndex : null;\n}, 30, false);\nfunction largePathFindDataIndex(largePath, x, y) {\n  var baseDimIdx = largePath.baseDimIdx;\n  var valueDimIdx = 1 - baseDimIdx;\n  var points = largePath.shape.points;\n  var largeDataIndices = largePath.largeDataIndices;\n  var startPoint = [];\n  var size = [];\n  var barWidth = largePath.barWidth;\n  for (var i = 0, len = points.length / 3; i < len; i++) {\n    var ii = i * 3;\n    size[baseDimIdx] = barWidth;\n    size[valueDimIdx] = points[ii + 2];\n    startPoint[baseDimIdx] = points[ii + baseDimIdx];\n    startPoint[valueDimIdx] = points[ii + valueDimIdx];\n    if (size[valueDimIdx] < 0) {\n      startPoint[valueDimIdx] += size[valueDimIdx];\n      size[valueDimIdx] = -size[valueDimIdx];\n    }\n    if (x >= startPoint[0] && x <= startPoint[0] + size[0] && y >= startPoint[1] && y <= startPoint[1] + size[1]) {\n      return largeDataIndices[i];\n    }\n  }\n  return -1;\n}\nfunction createBackgroundShape(isHorizontalOrRadial, layout, coord) {\n  if (isCoordinateSystemType(coord, 'cartesian2d')) {\n    var rectShape = layout;\n    var coordLayout = coord.getArea();\n    return {\n      x: isHorizontalOrRadial ? rectShape.x : coordLayout.x,\n      y: isHorizontalOrRadial ? coordLayout.y : rectShape.y,\n      width: isHorizontalOrRadial ? rectShape.width : coordLayout.width,\n      height: isHorizontalOrRadial ? coordLayout.height : rectShape.height\n    };\n  } else {\n    var coordLayout = coord.getArea();\n    var sectorShape = layout;\n    return {\n      cx: coordLayout.cx,\n      cy: coordLayout.cy,\n      r0: isHorizontalOrRadial ? coordLayout.r0 : sectorShape.r0,\n      r: isHorizontalOrRadial ? coordLayout.r : sectorShape.r,\n      startAngle: isHorizontalOrRadial ? sectorShape.startAngle : 0,\n      endAngle: isHorizontalOrRadial ? sectorShape.endAngle : Math.PI * 2\n    };\n  }\n}\nfunction createBackgroundEl(coord, isHorizontalOrRadial, layout) {\n  var ElementClz = coord.type === 'polar' ? Sector : Rect;\n  return new ElementClz({\n    shape: createBackgroundShape(isHorizontalOrRadial, layout, coord),\n    silent: true,\n    z2: 0\n  });\n}\nexport default BarView;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { layout, createProgressiveLayout } from '../../layout/barGrid.js';\nimport dataSample from '../../processor/dataSample.js';\nimport BarSeries from './BarSeries.js';\nimport BarView from './BarView.js';\nexport function install(registers) {\n  registers.registerChartView(BarView);\n  registers.registerSeriesModel(BarSeries);\n  registers.registerLayout(registers.PRIORITY.VISUAL.LAYOUT, zrUtil.curry(layout, 'bar'));\n  // Do layout after other overall layout, which can prepare some information.\n  registers.registerLayout(registers.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT, createProgressiveLayout('bar'));\n  // Down sample after filter\n  registers.registerProcessor(registers.PRIORITY.PROCESSOR.STATISTIC, dataSample('bar'));\n  /**\n   * @payload\n   * @property {string} [componentType=series]\n   * @property {number} [dx]\n   * @property {number} [dy]\n   * @property {number} [zoom]\n   * @property {number} [originX]\n   * @property {number} [originY]\n   */\n  registers.registerAction({\n    type: 'changeAxisOrder',\n    event: 'changeAxisOrder',\n    update: 'update'\n  }, function (payload, ecModel) {\n    var componentType = payload.componentType || 'series';\n    ecModel.eachComponent({\n      mainType: componentType,\n      query: payload\n    }, function (componentModel) {\n      if (payload.sortInfo) {\n        componentModel.axis.setCategorySortInfo(payload.sortInfo);\n      }\n    });\n  });\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { linearMap } from '../../util/number.js';\nimport { normalizeArcAngles } from 'zrender/lib/core/PathProxy.js';\nimport { makeInner } from '../../util/model.js';\nimport { getCircleLayout } from '../../util/layout.js';\nvar PI2 = Math.PI * 2;\nvar RADIAN = Math.PI / 180;\nexport default function pieLayout(seriesType, ecModel, api) {\n  ecModel.eachSeriesByType(seriesType, function (seriesModel) {\n    var data = seriesModel.getData();\n    var valueDim = data.mapDimension('value');\n    var _a = getCircleLayout(seriesModel, api),\n      cx = _a.cx,\n      cy = _a.cy,\n      r = _a.r,\n      r0 = _a.r0,\n      viewRect = _a.viewRect;\n    var startAngle = -seriesModel.get('startAngle') * RADIAN;\n    var endAngle = seriesModel.get('endAngle');\n    var padAngle = seriesModel.get('padAngle') * RADIAN;\n    endAngle = endAngle === 'auto' ? startAngle - PI2 : -endAngle * RADIAN;\n    var minAngle = seriesModel.get('minAngle') * RADIAN;\n    var minAndPadAngle = minAngle + padAngle;\n    var validDataCount = 0;\n    data.each(valueDim, function (value) {\n      !isNaN(value) && validDataCount++;\n    });\n    var sum = data.getSum(valueDim);\n    // Sum may be 0\n    var unitRadian = Math.PI / (sum || validDataCount) * 2;\n    var clockwise = seriesModel.get('clockwise');\n    var roseType = seriesModel.get('roseType');\n    var stillShowZeroSum = seriesModel.get('stillShowZeroSum');\n    // [0...max]\n    var extent = data.getDataExtent(valueDim);\n    extent[0] = 0;\n    var dir = clockwise ? 1 : -1;\n    var angles = [startAngle, endAngle];\n    var halfPadAngle = dir * padAngle / 2;\n    normalizeArcAngles(angles, !clockwise);\n    startAngle = angles[0], endAngle = angles[1];\n    var layoutData = getSeriesLayoutData(seriesModel);\n    layoutData.startAngle = startAngle;\n    layoutData.endAngle = endAngle;\n    layoutData.clockwise = clockwise;\n    layoutData.cx = cx;\n    layoutData.cy = cy;\n    layoutData.r = r;\n    layoutData.r0 = r0;\n    var angleRange = Math.abs(endAngle - startAngle);\n    // In the case some sector angle is smaller than minAngle\n    var restAngle = angleRange;\n    var valueSumLargerThanMinAngle = 0;\n    var currentAngle = startAngle;\n    // Requird by `pieLabelLayout`.\n    data.setLayout({\n      viewRect: viewRect,\n      r: r\n    });\n    data.each(valueDim, function (value, idx) {\n      var angle;\n      if (isNaN(value)) {\n        data.setItemLayout(idx, {\n          angle: NaN,\n          startAngle: NaN,\n          endAngle: NaN,\n          clockwise: clockwise,\n          cx: cx,\n          cy: cy,\n          r0: r0,\n          r: roseType ? NaN : r\n        });\n        return;\n      }\n      // FIXME \u517C\u5BB9 2.0 \u4F46\u662F roseType \u662F area \u7684\u65F6\u5019\u624D\u662F\u8FD9\u6837\uFF1F\n      if (roseType !== 'area') {\n        angle = sum === 0 && stillShowZeroSum ? unitRadian : value * unitRadian;\n      } else {\n        angle = angleRange / validDataCount;\n      }\n      if (angle < minAndPadAngle) {\n        angle = minAndPadAngle;\n        restAngle -= minAndPadAngle;\n      } else {\n        valueSumLargerThanMinAngle += value;\n      }\n      var endAngle = currentAngle + dir * angle;\n      // calculate display angle\n      var actualStartAngle = 0;\n      var actualEndAngle = 0;\n      if (padAngle > angle) {\n        actualStartAngle = currentAngle + dir * angle / 2;\n        actualEndAngle = actualStartAngle;\n      } else {\n        actualStartAngle = currentAngle + halfPadAngle;\n        actualEndAngle = endAngle - halfPadAngle;\n      }\n      data.setItemLayout(idx, {\n        angle: angle,\n        startAngle: actualStartAngle,\n        endAngle: actualEndAngle,\n        clockwise: clockwise,\n        cx: cx,\n        cy: cy,\n        r0: r0,\n        r: roseType ? linearMap(value, extent, [r0, r]) : r\n      });\n      currentAngle = endAngle;\n    });\n    // Some sector is constrained by minAngle and padAngle\n    // Rest sectors needs recalculate angle\n    if (restAngle < PI2 && validDataCount) {\n      // Average the angle if rest angle is not enough after all angles is\n      // Constrained by minAngle and padAngle\n      if (restAngle <= 1e-3) {\n        var angle_1 = angleRange / validDataCount;\n        data.each(valueDim, function (value, idx) {\n          if (!isNaN(value)) {\n            var layout = data.getItemLayout(idx);\n            layout.angle = angle_1;\n            var actualStartAngle = 0;\n            var actualEndAngle = 0;\n            if (angle_1 < padAngle) {\n              actualStartAngle = startAngle + dir * (idx + 1 / 2) * angle_1;\n              actualEndAngle = actualStartAngle;\n            } else {\n              actualStartAngle = startAngle + dir * idx * angle_1 + halfPadAngle;\n              actualEndAngle = startAngle + dir * (idx + 1) * angle_1 - halfPadAngle;\n            }\n            layout.startAngle = actualStartAngle;\n            layout.endAngle = actualEndAngle;\n          }\n        });\n      } else {\n        unitRadian = restAngle / valueSumLargerThanMinAngle;\n        currentAngle = startAngle;\n        data.each(valueDim, function (value, idx) {\n          if (!isNaN(value)) {\n            var layout = data.getItemLayout(idx);\n            var angle = layout.angle === minAndPadAngle ? minAndPadAngle : value * unitRadian;\n            var actualStartAngle = 0;\n            var actualEndAngle = 0;\n            if (angle < padAngle) {\n              actualStartAngle = currentAngle + dir * angle / 2;\n              actualEndAngle = actualStartAngle;\n            } else {\n              actualStartAngle = currentAngle + halfPadAngle;\n              actualEndAngle = currentAngle + dir * angle - halfPadAngle;\n            }\n            layout.startAngle = actualStartAngle;\n            layout.endAngle = actualEndAngle;\n            currentAngle += dir * angle;\n          }\n        });\n      }\n    }\n  });\n}\nexport var getSeriesLayoutData = makeInner();", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nexport default function dataFilter(seriesType) {\n  return {\n    seriesType: seriesType,\n    reset: function (seriesModel, ecModel) {\n      var legendModels = ecModel.findComponents({\n        mainType: 'legend'\n      });\n      if (!legendModels || !legendModels.length) {\n        return;\n      }\n      var data = seriesModel.getData();\n      data.filterSelf(function (idx) {\n        var name = data.getName(idx);\n        // If in any legend component the status is not selected.\n        for (var i = 0; i < legendModels.length; i++) {\n          // @ts-ignore FIXME: LegendModel\n          if (!legendModels[i].isSelected(name)) {\n            return false;\n          }\n        }\n        return true;\n      });\n    }\n  };\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n// FIXME emphasis label position is not same with normal label position\nimport { parsePercent } from '../../util/number.js';\nimport { Point } from '../../util/graphic.js';\nimport BoundingRect from 'zrender/lib/core/BoundingRect.js';\nimport { each, isNumber } from 'zrender/lib/core/util.js';\nimport { limitTurnAngle, limitSurfaceAngle } from '../../label/labelGuideHelper.js';\nimport { computeLabelGeometry, shiftLayoutOnXY } from '../../label/labelLayoutHelper.js';\nvar RADIAN = Math.PI / 180;\nfunction adjustSingleSide(list, cx, cy, r, dir, viewWidth, viewHeight, viewLeft, viewTop, farthestX) {\n  if (list.length < 2) {\n    return;\n  }\n  ;\n  function recalculateXOnSemiToAlignOnEllipseCurve(semi) {\n    var rB = semi.rB;\n    var rB2 = rB * rB;\n    for (var i = 0; i < semi.list.length; i++) {\n      var item = semi.list[i];\n      var dy = Math.abs(item.label.y - cy);\n      // horizontal r is always same with original r because x is not changed.\n      var rA = r + item.len;\n      var rA2 = rA * rA;\n      // Use ellipse implicit function to calculate x\n      var dx = Math.sqrt(Math.abs((1 - dy * dy / rB2) * rA2));\n      var newX = cx + (dx + item.len2) * dir;\n      var deltaX = newX - item.label.x;\n      var newTargetWidth = item.targetTextWidth - deltaX * dir;\n      // text x is changed, so need to recalculate width.\n      constrainTextWidth(item, newTargetWidth, true);\n      item.label.x = newX;\n    }\n  }\n  // Adjust X based on the shifted y. Make tight labels aligned on an ellipse curve.\n  function recalculateX(items) {\n    // Extremes of\n    var topSemi = {\n      list: [],\n      maxY: 0\n    };\n    var bottomSemi = {\n      list: [],\n      maxY: 0\n    };\n    for (var i = 0; i < items.length; i++) {\n      if (items[i].labelAlignTo !== 'none') {\n        continue;\n      }\n      var item = items[i];\n      var semi = item.label.y > cy ? bottomSemi : topSemi;\n      var dy = Math.abs(item.label.y - cy);\n      if (dy >= semi.maxY) {\n        var dx = item.label.x - cx - item.len2 * dir;\n        // horizontal r is always same with original r because x is not changed.\n        var rA = r + item.len;\n        // Canculate rB based on the topest / bottemest label.\n        var rB = Math.abs(dx) < rA ? Math.sqrt(dy * dy / (1 - dx * dx / rA / rA)) : rA;\n        semi.rB = rB;\n        semi.maxY = dy;\n      }\n      semi.list.push(item);\n    }\n    recalculateXOnSemiToAlignOnEllipseCurve(topSemi);\n    recalculateXOnSemiToAlignOnEllipseCurve(bottomSemi);\n  }\n  var len = list.length;\n  for (var i = 0; i < len; i++) {\n    if (list[i].position === 'outer' && list[i].labelAlignTo === 'labelLine') {\n      var dx = list[i].label.x - farthestX;\n      list[i].linePoints[1][0] += dx;\n      list[i].label.x = farthestX;\n    }\n  }\n  if (shiftLayoutOnXY(list, 1, viewTop, viewTop + viewHeight)) {\n    recalculateX(list);\n  }\n}\nfunction avoidOverlap(labelLayoutList, cx, cy, r, viewWidth, viewHeight, viewLeft, viewTop) {\n  var leftList = [];\n  var rightList = [];\n  var leftmostX = Number.MAX_VALUE;\n  var rightmostX = -Number.MAX_VALUE;\n  for (var i = 0; i < labelLayoutList.length; i++) {\n    var label = labelLayoutList[i].label;\n    if (isPositionCenter(labelLayoutList[i])) {\n      continue;\n    }\n    if (label.x < cx) {\n      leftmostX = Math.min(leftmostX, label.x);\n      leftList.push(labelLayoutList[i]);\n    } else {\n      rightmostX = Math.max(rightmostX, label.x);\n      rightList.push(labelLayoutList[i]);\n    }\n  }\n  for (var i = 0; i < labelLayoutList.length; i++) {\n    var layout = labelLayoutList[i];\n    if (!isPositionCenter(layout) && layout.linePoints) {\n      if (layout.labelStyleWidth != null) {\n        continue;\n      }\n      var label = layout.label;\n      var linePoints = layout.linePoints;\n      var targetTextWidth = void 0;\n      if (layout.labelAlignTo === 'edge') {\n        if (label.x < cx) {\n          targetTextWidth = linePoints[2][0] - layout.labelDistance - viewLeft - layout.edgeDistance;\n        } else {\n          targetTextWidth = viewLeft + viewWidth - layout.edgeDistance - linePoints[2][0] - layout.labelDistance;\n        }\n      } else if (layout.labelAlignTo === 'labelLine') {\n        if (label.x < cx) {\n          targetTextWidth = leftmostX - viewLeft - layout.bleedMargin;\n        } else {\n          targetTextWidth = viewLeft + viewWidth - rightmostX - layout.bleedMargin;\n        }\n      } else {\n        if (label.x < cx) {\n          targetTextWidth = label.x - viewLeft - layout.bleedMargin;\n        } else {\n          targetTextWidth = viewLeft + viewWidth - label.x - layout.bleedMargin;\n        }\n      }\n      layout.targetTextWidth = targetTextWidth;\n      constrainTextWidth(layout, targetTextWidth, false);\n    }\n  }\n  adjustSingleSide(rightList, cx, cy, r, 1, viewWidth, viewHeight, viewLeft, viewTop, rightmostX);\n  adjustSingleSide(leftList, cx, cy, r, -1, viewWidth, viewHeight, viewLeft, viewTop, leftmostX);\n  for (var i = 0; i < labelLayoutList.length; i++) {\n    var layout = labelLayoutList[i];\n    if (!isPositionCenter(layout) && layout.linePoints) {\n      var label = layout.label;\n      var linePoints = layout.linePoints;\n      var isAlignToEdge = layout.labelAlignTo === 'edge';\n      var padding = label.style.padding;\n      var paddingH = padding ? padding[1] + padding[3] : 0;\n      // textRect.width already contains paddingH if bgColor is set\n      var extraPaddingH = label.style.backgroundColor ? 0 : paddingH;\n      var realTextWidth = layout.rect.width + extraPaddingH;\n      var dist = linePoints[1][0] - linePoints[2][0];\n      if (isAlignToEdge) {\n        if (label.x < cx) {\n          linePoints[2][0] = viewLeft + layout.edgeDistance + realTextWidth + layout.labelDistance;\n        } else {\n          linePoints[2][0] = viewLeft + viewWidth - layout.edgeDistance - realTextWidth - layout.labelDistance;\n        }\n      } else {\n        if (label.x < cx) {\n          linePoints[2][0] = label.x + layout.labelDistance;\n        } else {\n          linePoints[2][0] = label.x - layout.labelDistance;\n        }\n        linePoints[1][0] = linePoints[2][0] + dist;\n      }\n      linePoints[1][1] = linePoints[2][1] = label.y;\n    }\n  }\n}\n/**\n * Set max width of each label, and then wrap each label to the max width.\n *\n * @param layout label layout\n * @param availableWidth max width for the label to display\n * @param forceRecalculate recaculate the text layout even if the current width\n * is smaller than `availableWidth`. This is useful when the text was previously\n * wrapped by calling `constrainTextWidth` but now `availableWidth` changed, in\n * which case, previous wrapping should be redo.\n */\nfunction constrainTextWidth(layout, availableWidth, forceRecalculate) {\n  if (layout.labelStyleWidth != null) {\n    // User-defined style.width has the highest priority.\n    return;\n  }\n  var label = layout.label;\n  var style = label.style;\n  var textRect = layout.rect;\n  var bgColor = style.backgroundColor;\n  var padding = style.padding;\n  var paddingH = padding ? padding[1] + padding[3] : 0;\n  var overflow = style.overflow;\n  // textRect.width already contains paddingH if bgColor is set\n  var oldOuterWidth = textRect.width + (bgColor ? 0 : paddingH);\n  if (availableWidth < oldOuterWidth || forceRecalculate) {\n    if (overflow && overflow.match('break')) {\n      // Temporarily set background to be null to calculate\n      // the bounding box without background.\n      label.setStyle('backgroundColor', null);\n      // Set constraining width\n      label.setStyle('width', availableWidth - paddingH);\n      // This is the real bounding box of the text without padding.\n      var innerRect = label.getBoundingRect();\n      label.setStyle('width', Math.ceil(innerRect.width));\n      label.setStyle('backgroundColor', bgColor);\n    } else {\n      var availableInnerWidth = availableWidth - paddingH;\n      var newWidth = availableWidth < oldOuterWidth\n      // Current text is too wide, use `availableWidth` as max width.\n      ? availableInnerWidth :\n      // Current available width is enough, but the text may have\n      // already been wrapped with a smaller available width.\n      forceRecalculate ? availableInnerWidth > layout.unconstrainedWidth\n      // Current available is larger than text width,\n      // so don't constrain width (otherwise it may have\n      // empty space in the background).\n      ? null\n      // Current available is smaller than text width, so\n      // use the current available width as constraining\n      // width.\n      : availableInnerWidth\n      // Current available width is enough, so no need to\n      // constrain.\n      : null;\n      label.setStyle('width', newWidth);\n    }\n    computeLabelGlobalRect(textRect, label);\n  }\n}\nfunction computeLabelGlobalRect(out, label) {\n  _tmpLabelGeometry.rect = out;\n  computeLabelGeometry(_tmpLabelGeometry, label, _computeLabelGeometryOpt);\n}\nvar _computeLabelGeometryOpt = {\n  minMarginForce: [null, 0, null, 0],\n  marginDefault: [1, 0, 1, 0]\n};\nvar _tmpLabelGeometry = {};\nfunction isPositionCenter(sectorShape) {\n  // Not change x for center label\n  return sectorShape.position === 'center';\n}\nexport default function pieLabelLayout(seriesModel) {\n  var data = seriesModel.getData();\n  var labelLayoutList = [];\n  var cx;\n  var cy;\n  var hasLabelRotate = false;\n  var minShowLabelRadian = (seriesModel.get('minShowLabelAngle') || 0) * RADIAN;\n  var viewRect = data.getLayout('viewRect');\n  var r = data.getLayout('r');\n  var viewWidth = viewRect.width;\n  var viewLeft = viewRect.x;\n  var viewTop = viewRect.y;\n  var viewHeight = viewRect.height;\n  function setNotShow(el) {\n    el.ignore = true;\n  }\n  function isLabelShown(label) {\n    if (!label.ignore) {\n      return true;\n    }\n    for (var key in label.states) {\n      if (label.states[key].ignore === false) {\n        return true;\n      }\n    }\n    return false;\n  }\n  data.each(function (idx) {\n    var sector = data.getItemGraphicEl(idx);\n    var sectorShape = sector.shape;\n    var label = sector.getTextContent();\n    var labelLine = sector.getTextGuideLine();\n    var itemModel = data.getItemModel(idx);\n    var labelModel = itemModel.getModel('label');\n    // Use position in normal or emphasis\n    var labelPosition = labelModel.get('position') || itemModel.get(['emphasis', 'label', 'position']);\n    var labelDistance = labelModel.get('distanceToLabelLine');\n    var labelAlignTo = labelModel.get('alignTo');\n    var edgeDistance = parsePercent(labelModel.get('edgeDistance'), viewWidth);\n    var bleedMargin = labelModel.get('bleedMargin');\n    if (bleedMargin == null) {\n      // An arbitrary strategy for small viewRect - especial pie is layout in calendar or matrix coord sys.\n      bleedMargin = Math.min(viewWidth, viewHeight) > 200 ? 10 : 2;\n    }\n    var labelLineModel = itemModel.getModel('labelLine');\n    var labelLineLen = labelLineModel.get('length');\n    labelLineLen = parsePercent(labelLineLen, viewWidth);\n    var labelLineLen2 = labelLineModel.get('length2');\n    labelLineLen2 = parsePercent(labelLineLen2, viewWidth);\n    if (Math.abs(sectorShape.endAngle - sectorShape.startAngle) < minShowLabelRadian) {\n      each(label.states, setNotShow);\n      label.ignore = true;\n      if (labelLine) {\n        each(labelLine.states, setNotShow);\n        labelLine.ignore = true;\n      }\n      return;\n    }\n    if (!isLabelShown(label)) {\n      return;\n    }\n    var midAngle = (sectorShape.startAngle + sectorShape.endAngle) / 2;\n    var nx = Math.cos(midAngle);\n    var ny = Math.sin(midAngle);\n    var textX;\n    var textY;\n    var linePoints;\n    var textAlign;\n    cx = sectorShape.cx;\n    cy = sectorShape.cy;\n    var isLabelInside = labelPosition === 'inside' || labelPosition === 'inner';\n    if (labelPosition === 'center') {\n      textX = sectorShape.cx;\n      textY = sectorShape.cy;\n      textAlign = 'center';\n    } else {\n      var x1 = (isLabelInside ? (sectorShape.r + sectorShape.r0) / 2 * nx : sectorShape.r * nx) + cx;\n      var y1 = (isLabelInside ? (sectorShape.r + sectorShape.r0) / 2 * ny : sectorShape.r * ny) + cy;\n      textX = x1 + nx * 3;\n      textY = y1 + ny * 3;\n      if (!isLabelInside) {\n        // For roseType\n        var x2 = x1 + nx * (labelLineLen + r - sectorShape.r);\n        var y2 = y1 + ny * (labelLineLen + r - sectorShape.r);\n        var x3 = x2 + (nx < 0 ? -1 : 1) * labelLineLen2;\n        var y3 = y2;\n        if (labelAlignTo === 'edge') {\n          // Adjust textX because text align of edge is opposite\n          textX = nx < 0 ? viewLeft + edgeDistance : viewLeft + viewWidth - edgeDistance;\n        } else {\n          textX = x3 + (nx < 0 ? -labelDistance : labelDistance);\n        }\n        textY = y3;\n        linePoints = [[x1, y1], [x2, y2], [x3, y3]];\n      }\n      textAlign = isLabelInside ? 'center' : labelAlignTo === 'edge' ? nx > 0 ? 'right' : 'left' : nx > 0 ? 'left' : 'right';\n    }\n    var PI = Math.PI;\n    var labelRotate = 0;\n    var rotate = labelModel.get('rotate');\n    if (isNumber(rotate)) {\n      labelRotate = rotate * (PI / 180);\n    } else if (labelPosition === 'center') {\n      labelRotate = 0;\n    } else if (rotate === 'radial' || rotate === true) {\n      var radialAngle = nx < 0 ? -midAngle + PI : -midAngle;\n      labelRotate = radialAngle;\n    } else if (rotate === 'tangential' && labelPosition !== 'outside' && labelPosition !== 'outer') {\n      var rad = Math.atan2(nx, ny);\n      if (rad < 0) {\n        rad = PI * 2 + rad;\n      }\n      var isDown = ny > 0;\n      if (isDown) {\n        rad = PI + rad;\n      }\n      labelRotate = rad - PI;\n    }\n    hasLabelRotate = !!labelRotate;\n    label.x = textX;\n    label.y = textY;\n    label.rotation = labelRotate;\n    label.setStyle({\n      verticalAlign: 'middle'\n    });\n    // Not sectorShape the inside label\n    if (!isLabelInside) {\n      var textRect = new BoundingRect(0, 0, 0, 0);\n      computeLabelGlobalRect(textRect, label);\n      labelLayoutList.push({\n        label: label,\n        labelLine: labelLine,\n        position: labelPosition,\n        len: labelLineLen,\n        len2: labelLineLen2,\n        minTurnAngle: labelLineModel.get('minTurnAngle'),\n        maxSurfaceAngle: labelLineModel.get('maxSurfaceAngle'),\n        surfaceNormal: new Point(nx, ny),\n        linePoints: linePoints,\n        textAlign: textAlign,\n        labelDistance: labelDistance,\n        labelAlignTo: labelAlignTo,\n        edgeDistance: edgeDistance,\n        bleedMargin: bleedMargin,\n        rect: textRect,\n        unconstrainedWidth: textRect.width,\n        labelStyleWidth: label.style.width\n      });\n    } else {\n      label.setStyle({\n        align: textAlign\n      });\n      var selectState = label.states.select;\n      if (selectState) {\n        selectState.x += label.x;\n        selectState.y += label.y;\n      }\n    }\n    sector.setTextConfig({\n      inside: isLabelInside\n    });\n  });\n  if (!hasLabelRotate && seriesModel.get('avoidLabelOverlap')) {\n    avoidOverlap(labelLayoutList, cx, cy, r, viewWidth, viewHeight, viewLeft, viewTop);\n  }\n  for (var i = 0; i < labelLayoutList.length; i++) {\n    var layout = labelLayoutList[i];\n    var label = layout.label;\n    var labelLine = layout.labelLine;\n    var notShowLabel = isNaN(label.x) || isNaN(label.y);\n    if (label) {\n      label.setStyle({\n        align: layout.textAlign\n      });\n      if (notShowLabel) {\n        each(label.states, setNotShow);\n        label.ignore = true;\n      }\n      var selectState = label.states.select;\n      if (selectState) {\n        selectState.x += label.x;\n        selectState.y += label.y;\n      }\n    }\n    if (labelLine) {\n      var linePoints = layout.linePoints;\n      if (notShowLabel || !linePoints) {\n        each(labelLine.states, setNotShow);\n        labelLine.ignore = true;\n      } else {\n        limitTurnAngle(linePoints, layout.minTurnAngle);\n        limitSurfaceAngle(linePoints, layout.surfaceNormal, layout.maxSurfaceAngle);\n        labelLine.setShape({\n          points: linePoints\n        });\n        // Set the anchor to the midpoint of sector\n        label.__hostTarget.textGuideLineConfig = {\n          anchor: new Point(linePoints[0][0], linePoints[0][1])\n        };\n      }\n    }\n  }\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport { clone, extend, retrieve3 } from 'zrender/lib/core/util.js';\nimport * as graphic from '../../util/graphic.js';\nimport { setStatesStylesFromModel, toggleHoverEmphasis } from '../../util/states.js';\nimport ChartView from '../../view/Chart.js';\nimport labelLayout from './labelLayout.js';\nimport { setLabelLineStyle, getLabelLineStatesModels } from '../../label/labelGuideHelper.js';\nimport { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle.js';\nimport { getSectorCornerRadius } from '../helper/sectorHelper.js';\nimport { saveOldStyle } from '../../animation/basicTransition.js';\nimport { getSeriesLayoutData } from './pieLayout.js';\n/**\n * Piece of pie including Sector, Label, LabelLine\n */\nvar PiePiece = /** @class */function (_super) {\n  __extends(PiePiece, _super);\n  function PiePiece(data, idx, startAngle) {\n    var _this = _super.call(this) || this;\n    _this.z2 = 2;\n    var text = new graphic.Text();\n    _this.setTextContent(text);\n    _this.updateData(data, idx, startAngle, true);\n    return _this;\n  }\n  PiePiece.prototype.updateData = function (data, idx, startAngle, firstCreate) {\n    var sector = this;\n    var seriesModel = data.hostModel;\n    var itemModel = data.getItemModel(idx);\n    var emphasisModel = itemModel.getModel('emphasis');\n    var layout = data.getItemLayout(idx);\n    // cornerRadius & innerCornerRadius doesn't exist in the item layout. Use `0` if null value is specified.\n    // see `setItemLayout` in `pieLayout.ts`.\n    var sectorShape = extend(getSectorCornerRadius(itemModel.getModel('itemStyle'), layout, true), layout);\n    // Ignore NaN data.\n    if (isNaN(sectorShape.startAngle)) {\n      // Use NaN shape to avoid drawing shape.\n      sector.setShape(sectorShape);\n      return;\n    }\n    if (firstCreate) {\n      sector.setShape(sectorShape);\n      var animationType = seriesModel.getShallow('animationType');\n      if (seriesModel.ecModel.ssr) {\n        // Use scale animation in SSR mode(opacity?)\n        // Because CSS SVG animation doesn't support very customized shape animation.\n        graphic.initProps(sector, {\n          scaleX: 0,\n          scaleY: 0\n        }, seriesModel, {\n          dataIndex: idx,\n          isFrom: true\n        });\n        sector.originX = sectorShape.cx;\n        sector.originY = sectorShape.cy;\n      } else if (animationType === 'scale') {\n        sector.shape.r = layout.r0;\n        graphic.initProps(sector, {\n          shape: {\n            r: layout.r\n          }\n        }, seriesModel, idx);\n      }\n      // Expansion\n      else {\n        if (startAngle != null) {\n          sector.setShape({\n            startAngle: startAngle,\n            endAngle: startAngle\n          });\n          graphic.initProps(sector, {\n            shape: {\n              startAngle: layout.startAngle,\n              endAngle: layout.endAngle\n            }\n          }, seriesModel, idx);\n        } else {\n          sector.shape.endAngle = layout.startAngle;\n          graphic.updateProps(sector, {\n            shape: {\n              endAngle: layout.endAngle\n            }\n          }, seriesModel, idx);\n        }\n      }\n    } else {\n      saveOldStyle(sector);\n      // Transition animation from the old shape\n      graphic.updateProps(sector, {\n        shape: sectorShape\n      }, seriesModel, idx);\n    }\n    sector.useStyle(data.getItemVisual(idx, 'style'));\n    setStatesStylesFromModel(sector, itemModel);\n    var midAngle = (layout.startAngle + layout.endAngle) / 2;\n    var offset = seriesModel.get('selectedOffset');\n    var dx = Math.cos(midAngle) * offset;\n    var dy = Math.sin(midAngle) * offset;\n    var cursorStyle = itemModel.getShallow('cursor');\n    cursorStyle && sector.attr('cursor', cursorStyle);\n    this._updateLabel(seriesModel, data, idx);\n    sector.ensureState('emphasis').shape = extend({\n      r: layout.r + (emphasisModel.get('scale') ? emphasisModel.get('scaleSize') || 0 : 0)\n    }, getSectorCornerRadius(emphasisModel.getModel('itemStyle'), layout));\n    extend(sector.ensureState('select'), {\n      x: dx,\n      y: dy,\n      shape: getSectorCornerRadius(itemModel.getModel(['select', 'itemStyle']), layout)\n    });\n    extend(sector.ensureState('blur'), {\n      shape: getSectorCornerRadius(itemModel.getModel(['blur', 'itemStyle']), layout)\n    });\n    var labelLine = sector.getTextGuideLine();\n    var labelText = sector.getTextContent();\n    labelLine && extend(labelLine.ensureState('select'), {\n      x: dx,\n      y: dy\n    });\n    // TODO: needs dx, dy in zrender?\n    extend(labelText.ensureState('select'), {\n      x: dx,\n      y: dy\n    });\n    toggleHoverEmphasis(this, emphasisModel.get('focus'), emphasisModel.get('blurScope'), emphasisModel.get('disabled'));\n  };\n  PiePiece.prototype._updateLabel = function (seriesModel, data, idx) {\n    var sector = this;\n    var itemModel = data.getItemModel(idx);\n    var labelLineModel = itemModel.getModel('labelLine');\n    var style = data.getItemVisual(idx, 'style');\n    var visualColor = style && style.fill;\n    var visualOpacity = style && style.opacity;\n    setLabelStyle(sector, getLabelStatesModels(itemModel), {\n      labelFetcher: data.hostModel,\n      labelDataIndex: idx,\n      inheritColor: visualColor,\n      defaultOpacity: visualOpacity,\n      defaultText: seriesModel.getFormattedLabel(idx, 'normal') || data.getName(idx)\n    });\n    var labelText = sector.getTextContent();\n    // Set textConfig on sector.\n    sector.setTextConfig({\n      // reset position, rotation\n      position: null,\n      rotation: null\n    });\n    // Make sure update style on labelText after setLabelStyle.\n    // Because setLabelStyle will replace a new style on it.\n    labelText.attr({\n      z2: 10\n    });\n    var labelPosition = itemModel.get(['label', 'position']);\n    if (labelPosition !== 'outside' && labelPosition !== 'outer') {\n      sector.removeTextGuideLine();\n    } else {\n      var polyline = this.getTextGuideLine();\n      if (!polyline) {\n        polyline = new graphic.Polyline();\n        this.setTextGuideLine(polyline);\n      }\n      // Default use item visual color\n      setLabelLineStyle(this, getLabelLineStatesModels(itemModel), {\n        stroke: visualColor,\n        opacity: retrieve3(labelLineModel.get(['lineStyle', 'opacity']), visualOpacity, 1)\n      });\n    }\n  };\n  return PiePiece;\n}(graphic.Sector);\n// Pie view\nvar PieView = /** @class */function (_super) {\n  __extends(PieView, _super);\n  function PieView() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.ignoreLabelLineUpdate = true;\n    return _this;\n  }\n  PieView.prototype.render = function (seriesModel, ecModel, api, payload) {\n    var data = seriesModel.getData();\n    var oldData = this._data;\n    var group = this.group;\n    var startAngle;\n    // First render\n    if (!oldData && data.count() > 0) {\n      var shape = data.getItemLayout(0);\n      for (var s = 1; isNaN(shape && shape.startAngle) && s < data.count(); ++s) {\n        shape = data.getItemLayout(s);\n      }\n      if (shape) {\n        startAngle = shape.startAngle;\n      }\n    }\n    // remove empty-circle if it exists\n    if (this._emptyCircleSector) {\n      group.remove(this._emptyCircleSector);\n    }\n    // when all data are filtered, show lightgray empty circle\n    if (data.count() === 0 && seriesModel.get('showEmptyCircle')) {\n      var layoutData = getSeriesLayoutData(seriesModel);\n      var sector = new graphic.Sector({\n        shape: clone(layoutData)\n      });\n      sector.useStyle(seriesModel.getModel('emptyCircleStyle').getItemStyle());\n      this._emptyCircleSector = sector;\n      group.add(sector);\n    }\n    data.diff(oldData).add(function (idx) {\n      var piePiece = new PiePiece(data, idx, startAngle);\n      data.setItemGraphicEl(idx, piePiece);\n      group.add(piePiece);\n    }).update(function (newIdx, oldIdx) {\n      var piePiece = oldData.getItemGraphicEl(oldIdx);\n      piePiece.updateData(data, newIdx, startAngle);\n      piePiece.off('click');\n      group.add(piePiece);\n      data.setItemGraphicEl(newIdx, piePiece);\n    }).remove(function (idx) {\n      var piePiece = oldData.getItemGraphicEl(idx);\n      graphic.removeElementWithFadeOut(piePiece, seriesModel, idx);\n    }).execute();\n    labelLayout(seriesModel);\n    // Always use initial animation.\n    if (seriesModel.get('animationTypeUpdate') !== 'expansion') {\n      this._data = data;\n    }\n  };\n  PieView.prototype.dispose = function () {};\n  PieView.prototype.containPoint = function (point, seriesModel) {\n    var data = seriesModel.getData();\n    var itemLayout = data.getItemLayout(0);\n    if (itemLayout) {\n      var dx = point[0] - itemLayout.cx;\n      var dy = point[1] - itemLayout.cy;\n      var radius = Math.sqrt(dx * dx + dy * dy);\n      return radius <= itemLayout.r && radius >= itemLayout.r0;\n    }\n  };\n  PieView.type = 'pie';\n  return PieView;\n}(ChartView);\nexport default PieView;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport prepareSeriesDataSchema from '../../data/helper/createDimensions.js';\nimport SeriesData from '../../data/SeriesData.js';\nimport { extend, isArray } from 'zrender/lib/core/util.js';\n/**\n * [Usage]:\n * (1)\n * createListSimply(seriesModel, ['value']);\n * (2)\n * createListSimply(seriesModel, {\n *     coordDimensions: ['value'],\n *     dimensionsCount: 5\n * });\n */\nexport default function createSeriesDataSimply(seriesModel, opt, nameList) {\n  opt = isArray(opt) && {\n    coordDimensions: opt\n  } || extend({\n    encodeDefine: seriesModel.getEncode()\n  }, opt);\n  var source = seriesModel.getSource();\n  var dimensions = prepareSeriesDataSchema(source, opt).dimensions;\n  var list = new SeriesData(dimensions, seriesModel);\n  list.initData(source, nameList);\n  return list;\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n/**\n * LegendVisualProvider is an bridge that pick encoded color from data and\n * provide to the legend component.\n */\nvar LegendVisualProvider = /** @class */function () {\n  function LegendVisualProvider(\n  // Function to get data after filtered. It stores all the encoding info\n  getDataWithEncodedVisual,\n  // Function to get raw data before filtered.\n  getRawData) {\n    this._getDataWithEncodedVisual = getDataWithEncodedVisual;\n    this._getRawData = getRawData;\n  }\n  LegendVisualProvider.prototype.getAllNames = function () {\n    var rawData = this._getRawData();\n    // We find the name from the raw data. In case it's filtered by the legend component.\n    // Normally, the name can be found in rawData, but can't be found in filtered data will display as gray.\n    return rawData.mapArray(rawData.getName);\n  };\n  LegendVisualProvider.prototype.containName = function (name) {\n    var rawData = this._getRawData();\n    return rawData.indexOfName(name) >= 0;\n  };\n  LegendVisualProvider.prototype.indexOfName = function (name) {\n    // Only get data when necessary.\n    // Because LegendVisualProvider constructor may be new in the stage that data is not prepared yet.\n    // Invoking Series#getData immediately will throw an error.\n    var dataWithEncodedVisual = this._getDataWithEncodedVisual();\n    return dataWithEncodedVisual.indexOfName(name);\n  };\n  LegendVisualProvider.prototype.getItemVisual = function (dataIndex, key) {\n    // Get encoded visual properties from final filtered data.\n    var dataWithEncodedVisual = this._getDataWithEncodedVisual();\n    return dataWithEncodedVisual.getItemVisual(dataIndex, key);\n  };\n  return LegendVisualProvider;\n}();\nexport default LegendVisualProvider;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport createSeriesDataSimply from '../helper/createSeriesDataSimply.js';\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as modelUtil from '../../util/model.js';\nimport { getPercentSeats } from '../../util/number.js';\nimport { makeSeriesEncodeForNameBased } from '../../data/helper/sourceHelper.js';\nimport LegendVisualProvider from '../../visual/LegendVisualProvider.js';\nimport SeriesModel from '../../model/Series.js';\nimport { registerLayOutOnCoordSysUsage } from '../../core/CoordinateSystem.js';\nvar innerData = modelUtil.makeInner();\nvar PieSeriesModel = /** @class */function (_super) {\n  __extends(PieSeriesModel, _super);\n  function PieSeriesModel() {\n    return _super !== null && _super.apply(this, arguments) || this;\n  }\n  /**\n   * @overwrite\n   */\n  PieSeriesModel.prototype.init = function (option) {\n    _super.prototype.init.apply(this, arguments);\n    // Enable legend selection for each data item\n    // Use a function instead of direct access because data reference may changed\n    this.legendVisualProvider = new LegendVisualProvider(zrUtil.bind(this.getData, this), zrUtil.bind(this.getRawData, this));\n    this._defaultLabelLine(option);\n  };\n  /**\n   * @overwrite\n   */\n  PieSeriesModel.prototype.mergeOption = function () {\n    _super.prototype.mergeOption.apply(this, arguments);\n  };\n  /**\n   * @overwrite\n   */\n  PieSeriesModel.prototype.getInitialData = function () {\n    return createSeriesDataSimply(this, {\n      coordDimensions: ['value'],\n      encodeDefaulter: zrUtil.curry(makeSeriesEncodeForNameBased, this)\n    });\n  };\n  /**\n   * @overwrite\n   */\n  PieSeriesModel.prototype.getDataParams = function (dataIndex) {\n    var data = this.getData();\n    // update seats when data is changed\n    var dataInner = innerData(data);\n    var seats = dataInner.seats;\n    if (!seats) {\n      var valueList_1 = [];\n      data.each(data.mapDimension('value'), function (value) {\n        valueList_1.push(value);\n      });\n      seats = dataInner.seats = getPercentSeats(valueList_1, data.hostModel.get('percentPrecision'));\n    }\n    var params = _super.prototype.getDataParams.call(this, dataIndex);\n    // seats may be empty when sum is 0\n    params.percent = seats[dataIndex] || 0;\n    params.$vars.push('percent');\n    return params;\n  };\n  PieSeriesModel.prototype._defaultLabelLine = function (option) {\n    // Extend labelLine emphasis\n    modelUtil.defaultEmphasis(option, 'labelLine', ['show']);\n    var labelLineNormalOpt = option.labelLine;\n    var labelLineEmphasisOpt = option.emphasis.labelLine;\n    // Not show label line if `label.normal.show = false`\n    labelLineNormalOpt.show = labelLineNormalOpt.show && option.label.show;\n    labelLineEmphasisOpt.show = labelLineEmphasisOpt.show && option.emphasis.label.show;\n  };\n  PieSeriesModel.type = 'series.pie';\n  PieSeriesModel.defaultOption = {\n    // zlevel: 0,\n    z: 2,\n    legendHoverLink: true,\n    colorBy: 'data',\n    // \u9ED8\u8BA4\u5168\u5C40\u5C45\u4E2D\n    center: ['50%', '50%'],\n    radius: [0, '50%'],\n    // \u9ED8\u8BA4\u987A\u65F6\u9488\n    clockwise: true,\n    startAngle: 90,\n    endAngle: 'auto',\n    padAngle: 0,\n    // \u6700\u5C0F\u89D2\u5EA6\u6539\u4E3A0\n    minAngle: 0,\n    // If the angle of a sector less than `minShowLabelAngle`,\n    // the label will not be displayed.\n    minShowLabelAngle: 0,\n    // \u9009\u4E2D\u65F6\u6247\u533A\u504F\u79FB\u91CF\n    selectedOffset: 10,\n    // \u9009\u62E9\u6A21\u5F0F\uFF0C\u9ED8\u8BA4\u5173\u95ED\uFF0C\u53EF\u9009single\uFF0Cmultiple\n    // selectedMode: false,\n    // \u5357\u4E01\u683C\u5C14\u73AB\u7470\u56FE\u6A21\u5F0F\uFF0C'radius'\uFF08\u534A\u5F84\uFF09 | 'area'\uFF08\u9762\u79EF\uFF09\n    // roseType: null,\n    percentPrecision: 2,\n    // If still show when all data zero.\n    stillShowZeroSum: true,\n    // cursor: null,\n    coordinateSystemUsage: 'box',\n    left: 0,\n    top: 0,\n    right: 0,\n    bottom: 0,\n    width: null,\n    height: null,\n    label: {\n      // color: 'inherit',\n      // If rotate around circle\n      rotate: 0,\n      show: true,\n      overflow: 'truncate',\n      // 'outer', 'inside', 'center'\n      position: 'outer',\n      // 'none', 'labelLine', 'edge'. Works only when position is 'outer'\n      alignTo: 'none',\n      // Closest distance between label and chart edge.\n      // Works only position is 'outer' and alignTo is 'edge'.\n      edgeDistance: '25%',\n      // Works only position is 'outer' and alignTo is not 'edge'.\n      // The default `bleedMargin` is auto determined according to view rect size.\n      // bleedMargin: 10,\n      // Distance between text and label line.\n      distanceToLabelLine: 5\n      // formatter: \u6807\u7B7E\u6587\u672C\u683C\u5F0F\u5668\uFF0C\u540C tooltip.formatter\uFF0C\u4E0D\u652F\u6301\u5F02\u6B65\u56DE\u8C03\n      // \u9ED8\u8BA4\u4F7F\u7528\u5168\u5C40\u6587\u672C\u6837\u5F0F\uFF0C\u8BE6\u89C1 textStyle\n      // distance: \u5F53position\u4E3Ainner\u65F6\u6709\u6548\uFF0C\u4E3Alabel\u4F4D\u7F6E\u5230\u5706\u5FC3\u7684\u8DDD\u79BB\u4E0E\u5706\u534A\u5F84(\u73AF\u72B6\u56FE\u4E3A\u5185\u5916\u534A\u5F84\u548C)\u7684\u6BD4\u4F8B\u7CFB\u6570\n    },\n    // Enabled when label.normal.position is 'outer'\n    labelLine: {\n      show: true,\n      // \u5F15\u5BFC\u7EBF\u4E24\u6BB5\u4E2D\u7684\u7B2C\u4E00\u6BB5\u957F\u5EA6\n      length: 15,\n      // \u5F15\u5BFC\u7EBF\u4E24\u6BB5\u4E2D\u7684\u7B2C\u4E8C\u6BB5\u957F\u5EA6\n      length2: 30,\n      smooth: false,\n      minTurnAngle: 90,\n      maxSurfaceAngle: 90,\n      lineStyle: {\n        // color: \u5404\u5F02,\n        width: 1,\n        type: 'solid'\n      }\n    },\n    itemStyle: {\n      borderWidth: 1,\n      borderJoin: 'round'\n    },\n    showEmptyCircle: true,\n    emptyCircleStyle: {\n      color: 'lightgray',\n      opacity: 1\n    },\n    labelLayout: {\n      // Hide the overlapped label.\n      hideOverlap: true\n    },\n    emphasis: {\n      scale: true,\n      scaleSize: 5\n    },\n    // If use strategy to avoid label overlapping\n    avoidLabelOverlap: true,\n    // Animation type. Valid values: expansion, scale\n    animationType: 'expansion',\n    animationDuration: 1000,\n    // Animation type when update. Valid values: transition, expansion\n    animationTypeUpdate: 'transition',\n    animationEasingUpdate: 'cubicInOut',\n    animationDurationUpdate: 500,\n    animationEasing: 'cubicInOut'\n  };\n  return PieSeriesModel;\n}(SeriesModel);\nregisterLayOutOnCoordSysUsage({\n  fullType: PieSeriesModel.type,\n  getCoord2: function (model) {\n    // Not able to validate `center` type here.\n    // But percentage center, such as '12%', is not allowed in this case.\n    return model.getShallow('center');\n  }\n});\nexport default PieSeriesModel;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { isNumber } from 'zrender/lib/core/util.js';\nexport default function negativeDataFilter(seriesType) {\n  return {\n    seriesType: seriesType,\n    reset: function (seriesModel, ecModel) {\n      var data = seriesModel.getData();\n      data.filterSelf(function (idx) {\n        // handle negative value condition\n        var valueDim = data.mapDimension('value');\n        var curValue = data.get(valueDim, idx);\n        if (isNumber(curValue) && !isNaN(curValue) && curValue < 0) {\n          return false;\n        }\n        return true;\n      });\n    }\n  };\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { createLegacyDataSelectAction } from '../../legacy/dataSelectAction.js';\nimport pieLayout from '../pie/pieLayout.js';\nimport dataFilter from '../../processor/dataFilter.js';\nimport { curry } from 'zrender/lib/core/util.js';\nimport PieView from './PieView.js';\nimport PieSeriesModel from './PieSeries.js';\nimport negativeDataFilter from '../../processor/negativeDataFilter.js';\nexport function install(registers) {\n  registers.registerChartView(PieView);\n  registers.registerSeriesModel(PieSeriesModel);\n  createLegacyDataSelectAction('pie', registers.registerAction);\n  registers.registerLayout(curry(pieLayout, 'pie'));\n  registers.registerProcessor(dataFilter('pie'));\n  registers.registerProcessor(negativeDataFilter('pie'));\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport createSeriesData from '../helper/createSeriesData.js';\nimport SeriesModel from '../../model/Series.js';\nimport tokens from '../../visual/tokens.js';\nvar ScatterSeriesModel = /** @class */function (_super) {\n  __extends(ScatterSeriesModel, _super);\n  function ScatterSeriesModel() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = ScatterSeriesModel.type;\n    _this.hasSymbolVisual = true;\n    return _this;\n  }\n  ScatterSeriesModel.prototype.getInitialData = function (option, ecModel) {\n    return createSeriesData(null, this, {\n      useEncodeDefaulter: true\n    });\n  };\n  ScatterSeriesModel.prototype.getProgressive = function () {\n    var progressive = this.option.progressive;\n    if (progressive == null) {\n      // PENDING\n      return this.option.large ? 5e3 : this.get('progressive');\n    }\n    return progressive;\n  };\n  ScatterSeriesModel.prototype.getProgressiveThreshold = function () {\n    var progressiveThreshold = this.option.progressiveThreshold;\n    if (progressiveThreshold == null) {\n      // PENDING\n      return this.option.large ? 1e4 : this.get('progressiveThreshold');\n    }\n    return progressiveThreshold;\n  };\n  ScatterSeriesModel.prototype.brushSelector = function (dataIndex, data, selectors) {\n    return selectors.point(data.getItemLayout(dataIndex));\n  };\n  ScatterSeriesModel.prototype.getZLevelKey = function () {\n    // Each progressive series has individual key.\n    return this.getData().count() > this.getProgressiveThreshold() ? this.id : '';\n  };\n  ScatterSeriesModel.type = 'series.scatter';\n  ScatterSeriesModel.dependencies = ['grid', 'polar', 'geo', 'singleAxis', 'calendar', 'matrix'];\n  ScatterSeriesModel.defaultOption = {\n    coordinateSystem: 'cartesian2d',\n    // zlevel: 0,\n    z: 2,\n    legendHoverLink: true,\n    symbolSize: 10,\n    // symbolRotate: null,  // \u56FE\u5F62\u65CB\u8F6C\u63A7\u5236\n    large: false,\n    // Available when large is true\n    largeThreshold: 2000,\n    // cursor: null,\n    itemStyle: {\n      opacity: 0.8\n      // color: \u5404\u5F02\n    },\n    emphasis: {\n      scale: true\n    },\n    // If clip the overflow graphics\n    // Works on cartesian / polar series\n    clip: true,\n    select: {\n      itemStyle: {\n        borderColor: tokens.color.primary\n      }\n    },\n    universalTransition: {\n      divideShape: 'clone'\n    }\n    // progressive: null\n  };\n  return ScatterSeriesModel;\n}(SeriesModel);\nexport default ScatterSeriesModel;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\n/* global Float32Array */\n// TODO Batch by color\nimport * as graphic from '../../util/graphic.js';\nimport { createSymbol } from '../../util/symbol.js';\nimport { getECData } from '../../util/innerStore.js';\nvar BOOST_SIZE_THRESHOLD = 4;\nvar LargeSymbolPathShape = /** @class */function () {\n  function LargeSymbolPathShape() {}\n  return LargeSymbolPathShape;\n}();\nvar LargeSymbolPath = /** @class */function (_super) {\n  __extends(LargeSymbolPath, _super);\n  function LargeSymbolPath(opts) {\n    var _this = _super.call(this, opts) || this;\n    _this._off = 0;\n    _this.hoverDataIdx = -1;\n    return _this;\n  }\n  LargeSymbolPath.prototype.getDefaultShape = function () {\n    return new LargeSymbolPathShape();\n  };\n  LargeSymbolPath.prototype.reset = function () {\n    this.notClear = false;\n    this._off = 0;\n  };\n  LargeSymbolPath.prototype.buildPath = function (path, shape) {\n    var points = shape.points;\n    var size = shape.size;\n    var symbolProxy = this.symbolProxy;\n    var symbolProxyShape = symbolProxy.shape;\n    var ctx = path.getContext ? path.getContext() : path;\n    var canBoost = ctx && size[0] < BOOST_SIZE_THRESHOLD;\n    var softClipShape = this.softClipShape;\n    var i;\n    // Do draw in afterBrush.\n    if (canBoost) {\n      this._ctx = ctx;\n      return;\n    }\n    this._ctx = null;\n    for (i = this._off; i < points.length;) {\n      var x = points[i++];\n      var y = points[i++];\n      if (isNaN(x) || isNaN(y)) {\n        continue;\n      }\n      if (softClipShape && !softClipShape.contain(x, y)) {\n        continue;\n      }\n      symbolProxyShape.x = x - size[0] / 2;\n      symbolProxyShape.y = y - size[1] / 2;\n      symbolProxyShape.width = size[0];\n      symbolProxyShape.height = size[1];\n      symbolProxy.buildPath(path, symbolProxyShape, true);\n    }\n    if (this.incremental) {\n      this._off = i;\n      this.notClear = true;\n    }\n  };\n  LargeSymbolPath.prototype.afterBrush = function () {\n    var shape = this.shape;\n    var points = shape.points;\n    var size = shape.size;\n    var ctx = this._ctx;\n    var softClipShape = this.softClipShape;\n    var i;\n    if (!ctx) {\n      return;\n    }\n    // PENDING If style or other canvas status changed?\n    for (i = this._off; i < points.length;) {\n      var x = points[i++];\n      var y = points[i++];\n      if (isNaN(x) || isNaN(y)) {\n        continue;\n      }\n      if (softClipShape && !softClipShape.contain(x, y)) {\n        continue;\n      }\n      // fillRect is faster than building a rect path and draw.\n      // And it support light globalCompositeOperation.\n      ctx.fillRect(x - size[0] / 2, y - size[1] / 2, size[0], size[1]);\n    }\n    if (this.incremental) {\n      this._off = i;\n      this.notClear = true;\n    }\n  };\n  LargeSymbolPath.prototype.findDataIndex = function (x, y) {\n    // TODO ???\n    // Consider transform\n    var shape = this.shape;\n    var points = shape.points;\n    var size = shape.size;\n    var w = Math.max(size[0], 4);\n    var h = Math.max(size[1], 4);\n    // Not consider transform\n    // Treat each element as a rect\n    // top down traverse\n    for (var idx = points.length / 2 - 1; idx >= 0; idx--) {\n      var i = idx * 2;\n      var x0 = points[i] - w / 2;\n      var y0 = points[i + 1] - h / 2;\n      if (x >= x0 && y >= y0 && x <= x0 + w && y <= y0 + h) {\n        return idx;\n      }\n    }\n    return -1;\n  };\n  LargeSymbolPath.prototype.contain = function (x, y) {\n    var localPos = this.transformCoordToLocal(x, y);\n    var rect = this.getBoundingRect();\n    x = localPos[0];\n    y = localPos[1];\n    if (rect.contain(x, y)) {\n      // Cache found data index.\n      var dataIdx = this.hoverDataIdx = this.findDataIndex(x, y);\n      return dataIdx >= 0;\n    }\n    this.hoverDataIdx = -1;\n    return false;\n  };\n  LargeSymbolPath.prototype.getBoundingRect = function () {\n    // Ignore stroke for large symbol draw.\n    var rect = this._rect;\n    if (!rect) {\n      var shape = this.shape;\n      var points = shape.points;\n      var size = shape.size;\n      var w = size[0];\n      var h = size[1];\n      var minX = Infinity;\n      var minY = Infinity;\n      var maxX = -Infinity;\n      var maxY = -Infinity;\n      for (var i = 0; i < points.length;) {\n        var x = points[i++];\n        var y = points[i++];\n        minX = Math.min(x, minX);\n        maxX = Math.max(x, maxX);\n        minY = Math.min(y, minY);\n        maxY = Math.max(y, maxY);\n      }\n      rect = this._rect = new graphic.BoundingRect(minX - w / 2, minY - h / 2, maxX - minX + w, maxY - minY + h);\n    }\n    return rect;\n  };\n  return LargeSymbolPath;\n}(graphic.Path);\nvar LargeSymbolDraw = /** @class */function () {\n  function LargeSymbolDraw() {\n    this.group = new graphic.Group();\n  }\n  /**\n   * Update symbols draw by new data\n   */\n  LargeSymbolDraw.prototype.updateData = function (data, opt) {\n    this._clear();\n    var symbolEl = this._create();\n    symbolEl.setShape({\n      points: data.getLayout('points')\n    });\n    this._setCommon(symbolEl, data, opt);\n  };\n  LargeSymbolDraw.prototype.updateLayout = function (data) {\n    var points = data.getLayout('points');\n    this.group.eachChild(function (child) {\n      if (child.startIndex != null) {\n        var len = (child.endIndex - child.startIndex) * 2;\n        var byteOffset = child.startIndex * 4 * 2;\n        points = new Float32Array(points.buffer, byteOffset, len);\n      }\n      child.setShape('points', points);\n      // Reset draw cursor.\n      child.reset();\n    });\n  };\n  LargeSymbolDraw.prototype.incrementalPrepareUpdate = function (data) {\n    this._clear();\n  };\n  LargeSymbolDraw.prototype.incrementalUpdate = function (taskParams, data, opt) {\n    var lastAdded = this._newAdded[0];\n    var points = data.getLayout('points');\n    var oldPoints = lastAdded && lastAdded.shape.points;\n    // Merging the exists. Each element has 1e4 points.\n    // Consider the performance balance between too much elements and too much points in one shape(may affect hover optimization)\n    if (oldPoints && oldPoints.length < 2e4) {\n      var oldLen = oldPoints.length;\n      var newPoints = new Float32Array(oldLen + points.length);\n      // Concat two array\n      newPoints.set(oldPoints);\n      newPoints.set(points, oldLen);\n      // Update endIndex\n      lastAdded.endIndex = taskParams.end;\n      lastAdded.setShape({\n        points: newPoints\n      });\n    } else {\n      // Clear\n      this._newAdded = [];\n      var symbolEl = this._create();\n      symbolEl.startIndex = taskParams.start;\n      symbolEl.endIndex = taskParams.end;\n      symbolEl.incremental = true;\n      symbolEl.setShape({\n        points: points\n      });\n      this._setCommon(symbolEl, data, opt);\n    }\n  };\n  LargeSymbolDraw.prototype.eachRendered = function (cb) {\n    this._newAdded[0] && cb(this._newAdded[0]);\n  };\n  LargeSymbolDraw.prototype._create = function () {\n    var symbolEl = new LargeSymbolPath({\n      cursor: 'default'\n    });\n    symbolEl.ignoreCoarsePointer = true;\n    this.group.add(symbolEl);\n    this._newAdded.push(symbolEl);\n    return symbolEl;\n  };\n  LargeSymbolDraw.prototype._setCommon = function (symbolEl, data, opt) {\n    var hostModel = data.hostModel;\n    opt = opt || {};\n    var size = data.getVisual('symbolSize');\n    symbolEl.setShape('size', size instanceof Array ? size : [size, size]);\n    symbolEl.softClipShape = opt.clipShape || null;\n    // Create symbolProxy to build path for each data\n    symbolEl.symbolProxy = createSymbol(data.getVisual('symbol'), 0, 0, 0, 0);\n    // Use symbolProxy setColor method\n    symbolEl.setColor = symbolEl.symbolProxy.setColor;\n    var extrudeShadow = symbolEl.shape.size[0] < BOOST_SIZE_THRESHOLD;\n    symbolEl.useStyle(\n    // Draw shadow when doing fillRect is extremely slow.\n    hostModel.getModel('itemStyle').getItemStyle(extrudeShadow ? ['color', 'shadowBlur', 'shadowColor'] : ['color']));\n    var globalStyle = data.getVisual('style');\n    var visualColor = globalStyle && globalStyle.fill;\n    if (visualColor) {\n      symbolEl.setColor(visualColor);\n    }\n    var ecData = getECData(symbolEl);\n    // Enable tooltip\n    // PENDING May have performance issue when path is extremely large\n    ecData.seriesIndex = hostModel.seriesIndex;\n    symbolEl.on('mousemove', function (e) {\n      ecData.dataIndex = null;\n      var dataIndex = symbolEl.hoverDataIdx;\n      if (dataIndex >= 0) {\n        // Provide dataIndex for tooltip\n        ecData.dataIndex = dataIndex + (symbolEl.startIndex || 0);\n      }\n    });\n  };\n  LargeSymbolDraw.prototype.remove = function () {\n    this._clear();\n  };\n  LargeSymbolDraw.prototype._clear = function () {\n    this._newAdded = [];\n    this.group.removeAll();\n  };\n  return LargeSymbolDraw;\n}();\nexport default LargeSymbolDraw;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport SymbolDraw from '../helper/SymbolDraw.js';\nimport LargeSymbolDraw from '../helper/LargeSymbolDraw.js';\nimport pointsLayout from '../../layout/points.js';\nimport ChartView from '../../view/Chart.js';\nvar ScatterView = /** @class */function (_super) {\n  __extends(ScatterView, _super);\n  function ScatterView() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = ScatterView.type;\n    return _this;\n  }\n  ScatterView.prototype.render = function (seriesModel, ecModel, api) {\n    var data = seriesModel.getData();\n    var symbolDraw = this._updateSymbolDraw(data, seriesModel);\n    symbolDraw.updateData(data, {\n      // TODO\n      // If this parameter should be a shape or a bounding volume\n      // shape will be more general.\n      // But bounding volume like bounding rect will be much faster in the contain calculation\n      clipShape: this._getClipShape(seriesModel)\n    });\n    this._finished = true;\n  };\n  ScatterView.prototype.incrementalPrepareRender = function (seriesModel, ecModel, api) {\n    var data = seriesModel.getData();\n    var symbolDraw = this._updateSymbolDraw(data, seriesModel);\n    symbolDraw.incrementalPrepareUpdate(data);\n    this._finished = false;\n  };\n  ScatterView.prototype.incrementalRender = function (taskParams, seriesModel, ecModel) {\n    this._symbolDraw.incrementalUpdate(taskParams, seriesModel.getData(), {\n      clipShape: this._getClipShape(seriesModel)\n    });\n    this._finished = taskParams.end === seriesModel.getData().count();\n  };\n  ScatterView.prototype.updateTransform = function (seriesModel, ecModel, api) {\n    var data = seriesModel.getData();\n    // Must mark group dirty and make sure the incremental layer will be cleared\n    // PENDING\n    this.group.dirty();\n    if (!this._finished || data.count() > 1e4) {\n      return {\n        update: true\n      };\n    } else {\n      var res = pointsLayout('').reset(seriesModel, ecModel, api);\n      if (res.progress) {\n        res.progress({\n          start: 0,\n          end: data.count(),\n          count: data.count()\n        }, data);\n      }\n      this._symbolDraw.updateLayout(data);\n    }\n  };\n  ScatterView.prototype.eachRendered = function (cb) {\n    this._symbolDraw && this._symbolDraw.eachRendered(cb);\n  };\n  ScatterView.prototype._getClipShape = function (seriesModel) {\n    if (!seriesModel.get('clip', true)) {\n      return;\n    }\n    var coordSys = seriesModel.coordinateSystem;\n    // PENDING make `0.1` configurable, for example, `clipTolerance`?\n    return coordSys && coordSys.getArea && coordSys.getArea(.1);\n  };\n  ScatterView.prototype._updateSymbolDraw = function (data, seriesModel) {\n    var symbolDraw = this._symbolDraw;\n    var pipelineContext = seriesModel.pipelineContext;\n    var isLargeDraw = pipelineContext.large;\n    if (!symbolDraw || isLargeDraw !== this._isLargeDraw) {\n      symbolDraw && symbolDraw.remove();\n      symbolDraw = this._symbolDraw = isLargeDraw ? new LargeSymbolDraw() : new SymbolDraw();\n      this._isLargeDraw = isLargeDraw;\n      this.group.removeAll();\n    }\n    this.group.add(symbolDraw.group);\n    return symbolDraw;\n  };\n  ScatterView.prototype.remove = function (ecModel, api) {\n    this._symbolDraw && this._symbolDraw.remove(true);\n    this._symbolDraw = null;\n  };\n  ScatterView.prototype.dispose = function () {};\n  ScatterView.type = 'scatter';\n  return ScatterView;\n}(ChartView);\nexport default ScatterView;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport ComponentModel from '../../model/Component.js';\nimport { getLayoutParams, mergeLayoutParam } from '../../util/layout.js';\nimport tokens from '../../visual/tokens.js';\n// For backward compatibility, do not use a margin. Although the labels might touch the edge of\n// the canvas, the chart canvas probably does not have an border or a different background color within a page.\nexport var OUTER_BOUNDS_DEFAULT = {\n  left: 0,\n  right: 0,\n  top: 0,\n  bottom: 0\n};\nexport var OUTER_BOUNDS_CLAMP_DEFAULT = ['25%', '25%'];\nvar GridModel = /** @class */function (_super) {\n  __extends(GridModel, _super);\n  function GridModel() {\n    return _super !== null && _super.apply(this, arguments) || this;\n  }\n  GridModel.prototype.mergeDefaultAndTheme = function (option, ecModel) {\n    var outerBoundsCp = getLayoutParams(option.outerBounds);\n    _super.prototype.mergeDefaultAndTheme.apply(this, arguments);\n    if (outerBoundsCp && option.outerBounds) {\n      mergeLayoutParam(option.outerBounds, outerBoundsCp);\n    }\n  };\n  GridModel.prototype.mergeOption = function (newOption, ecModel) {\n    _super.prototype.mergeOption.apply(this, arguments);\n    if (this.option.outerBounds && newOption.outerBounds) {\n      mergeLayoutParam(this.option.outerBounds, newOption.outerBounds);\n    }\n  };\n  GridModel.type = 'grid';\n  GridModel.dependencies = ['xAxis', 'yAxis'];\n  GridModel.layoutMode = 'box';\n  GridModel.defaultOption = {\n    show: false,\n    // zlevel: 0,\n    z: 0,\n    left: '15%',\n    top: 65,\n    right: '10%',\n    bottom: 80,\n    // If grid size contain label\n    containLabel: false,\n    outerBoundsMode: 'auto',\n    outerBounds: OUTER_BOUNDS_DEFAULT,\n    outerBoundsContain: 'all',\n    outerBoundsClampWidth: OUTER_BOUNDS_CLAMP_DEFAULT[0],\n    outerBoundsClampHeight: OUTER_BOUNDS_CLAMP_DEFAULT[1],\n    // width: {totalWidth} - left - right,\n    // height: {totalHeight} - top - bottom,\n    backgroundColor: tokens.color.transparent,\n    borderWidth: 1,\n    borderColor: tokens.color.neutral30\n  };\n  return GridModel;\n}(ComponentModel);\nexport default GridModel;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport ComponentModel from '../../model/Component.js';\nimport { AxisModelCommonMixin } from '../axisModelCommonMixin.js';\nimport { SINGLE_REFERRING } from '../../util/model.js';\nvar CartesianAxisModel = /** @class */function (_super) {\n  __extends(CartesianAxisModel, _super);\n  function CartesianAxisModel() {\n    return _super !== null && _super.apply(this, arguments) || this;\n  }\n  CartesianAxisModel.prototype.getCoordSysModel = function () {\n    return this.getReferringComponents('grid', SINGLE_REFERRING).models[0];\n  };\n  CartesianAxisModel.type = 'cartesian2dAxis';\n  return CartesianAxisModel;\n}(ComponentModel);\nexport { CartesianAxisModel };\nzrUtil.mixin(CartesianAxisModel, AxisModelCommonMixin);\nexport default CartesianAxisModel;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport tokens from '../visual/tokens.js';\nvar defaultOption = {\n  show: true,\n  // zlevel: 0,\n  z: 0,\n  // Inverse the axis.\n  inverse: false,\n  // Axis name displayed.\n  name: '',\n  // 'start' | 'middle' | 'end'\n  nameLocation: 'end',\n  // By degree. By default auto rotate by nameLocation.\n  nameRotate: null,\n  nameTruncate: {\n    maxWidth: null,\n    ellipsis: '...',\n    placeholder: '.'\n  },\n  // Use global text style by default.\n  nameTextStyle: {\n    // textMargin: never, // The default value will be specified based on `nameLocation`.\n  },\n  // The gap between axisName and axisLine.\n  nameGap: 15,\n  // Default `false` to support tooltip.\n  silent: false,\n  // Default `false` to avoid legacy user event listener fail.\n  triggerEvent: false,\n  tooltip: {\n    show: false\n  },\n  axisPointer: {},\n  axisLine: {\n    show: true,\n    onZero: true,\n    onZeroAxisIndex: null,\n    lineStyle: {\n      color: tokens.color.axisLine,\n      width: 1,\n      type: 'solid'\n    },\n    // The arrow at both ends the the axis.\n    symbol: ['none', 'none'],\n    symbolSize: [10, 15],\n    breakLine: true\n  },\n  axisTick: {\n    show: true,\n    // Whether axisTick is inside the grid or outside the grid.\n    inside: false,\n    // The length of axisTick.\n    length: 5,\n    lineStyle: {\n      width: 1\n    }\n  },\n  axisLabel: {\n    show: true,\n    // Whether axisLabel is inside the grid or outside the grid.\n    inside: false,\n    rotate: 0,\n    // true | false | null/undefined (auto)\n    showMinLabel: null,\n    // true | false | null/undefined (auto)\n    showMaxLabel: null,\n    margin: 8,\n    // formatter: null,\n    fontSize: 12,\n    color: tokens.color.axisLabel,\n    // In scenarios like axis labels, when labels text's progression direction matches the label\n    // layout direction (e.g., when all letters are in a single line), extra start/end margin is\n    // needed to prevent the text from appearing visually joined. In the other case, when lables\n    // are stacked (e.g., having rotation or horizontal labels on yAxis), the layout needs to be\n    // compact, so NO extra top/bottom margin should be applied.\n    textMargin: [0, 3]\n  },\n  splitLine: {\n    show: true,\n    showMinLine: true,\n    showMaxLine: true,\n    lineStyle: {\n      color: tokens.color.axisSplitLine,\n      width: 1,\n      type: 'solid'\n    }\n  },\n  splitArea: {\n    show: false,\n    areaStyle: {\n      color: [tokens.color.backgroundTint, tokens.color.backgroundTransparent]\n    }\n  },\n  breakArea: {\n    show: true,\n    itemStyle: {\n      color: tokens.color.neutral00,\n      // Break border color should be darker than the splitLine\n      // because it has opacity and should be more prominent\n      borderColor: tokens.color.border,\n      borderWidth: 1,\n      borderType: [3, 3],\n      opacity: 0.6\n    },\n    zigzagAmplitude: 4,\n    zigzagMinSpan: 4,\n    zigzagMaxSpan: 20,\n    zigzagZ: 100,\n    expandOnClick: true\n  },\n  breakLabelLayout: {\n    moveOverlap: 'auto'\n  }\n};\nvar categoryAxis = zrUtil.merge({\n  // The gap at both ends of the axis. For categoryAxis, boolean.\n  boundaryGap: true,\n  // Set false to faster category collection.\n  deduplication: null,\n  jitter: 0,\n  jitterOverlap: true,\n  jitterMargin: 2,\n  // splitArea: {\n  // show: false\n  // },\n  splitLine: {\n    show: false\n  },\n  axisTick: {\n    // If tick is align with label when boundaryGap is true\n    alignWithLabel: false,\n    interval: 'auto',\n    show: 'auto'\n  },\n  axisLabel: {\n    interval: 'auto'\n  }\n}, defaultOption);\nvar valueAxis = zrUtil.merge({\n  boundaryGap: [0, 0],\n  axisLine: {\n    // Not shown when other axis is categoryAxis in cartesian\n    show: 'auto'\n  },\n  axisTick: {\n    // Not shown when other axis is categoryAxis in cartesian\n    show: 'auto'\n  },\n  // TODO\n  // min/max: [30, datamin, 60] or [20, datamin] or [datamin, 60]\n  splitNumber: 5,\n  minorTick: {\n    // Minor tick, not available for cateogry axis.\n    show: false,\n    // Split number of minor ticks. The value should be in range of (0, 100)\n    splitNumber: 5,\n    // Length of minor tick\n    length: 3,\n    // Line style\n    lineStyle: {\n      // Default to be same with axisTick\n    }\n  },\n  minorSplitLine: {\n    show: false,\n    lineStyle: {\n      color: tokens.color.axisMinorSplitLine,\n      width: 1\n    }\n  }\n}, defaultOption);\nvar timeAxis = zrUtil.merge({\n  splitNumber: 6,\n  axisLabel: {\n    // To eliminate labels that are not nice\n    showMinLabel: false,\n    showMaxLabel: false,\n    rich: {\n      primary: {\n        fontWeight: 'bold'\n      }\n    }\n  },\n  splitLine: {\n    show: false\n  }\n}, valueAxis);\nvar logAxis = zrUtil.defaults({\n  logBase: 10\n}, valueAxis);\nexport default {\n  category: categoryAxis,\n  value: valueAxis,\n  time: timeAxis,\n  log: logAxis\n};", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nexport var AXIS_TYPES = {\n  value: 1,\n  category: 1,\n  time: 1,\n  log: 1\n};", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nvar _impl = null;\nexport function registerAxisBreakHelperImpl(impl) {\n  if (!_impl) {\n    _impl = impl;\n  }\n}\nexport function getAxisBreakHelper() {\n  return _impl;\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport axisDefault from './axisDefault.js';\nimport { getLayoutParams, mergeLayoutParam, fetchLayoutMode } from '../util/layout.js';\nimport OrdinalMeta from '../data/OrdinalMeta.js';\nimport { AXIS_TYPES } from './axisCommonTypes.js';\nimport { each, merge } from 'zrender/lib/core/util.js';\nimport { getAxisBreakHelper } from '../component/axis/axisBreakHelper.js';\n/**\n * Generate sub axis model class\n * @param axisName 'x' 'y' 'radius' 'angle' 'parallel' ...\n */\nexport default function axisModelCreator(registers, axisName, BaseAxisModelClass, extraDefaultOption) {\n  each(AXIS_TYPES, function (v, axisType) {\n    var defaultOption = merge(merge({}, axisDefault[axisType], true), extraDefaultOption, true);\n    var AxisModel = /** @class */function (_super) {\n      __extends(AxisModel, _super);\n      function AxisModel() {\n        var _this = _super !== null && _super.apply(this, arguments) || this;\n        _this.type = axisName + 'Axis.' + axisType;\n        return _this;\n      }\n      AxisModel.prototype.mergeDefaultAndTheme = function (option, ecModel) {\n        var layoutMode = fetchLayoutMode(this);\n        var inputPositionParams = layoutMode ? getLayoutParams(option) : {};\n        var themeModel = ecModel.getTheme();\n        merge(option, themeModel.get(axisType + 'Axis'));\n        merge(option, this.getDefaultOption());\n        option.type = getAxisType(option);\n        if (layoutMode) {\n          mergeLayoutParam(option, inputPositionParams, layoutMode);\n        }\n      };\n      AxisModel.prototype.optionUpdated = function () {\n        var thisOption = this.option;\n        if (thisOption.type === 'category') {\n          this.__ordinalMeta = OrdinalMeta.createByAxisModel(this);\n        }\n      };\n      /**\n       * Should not be called before all of 'getInitailData' finished.\n       * Because categories are collected during initializing data.\n       */\n      AxisModel.prototype.getCategories = function (rawData) {\n        var option = this.option;\n        // FIXME\n        // warning if called before all of 'getInitailData' finished.\n        if (option.type === 'category') {\n          if (rawData) {\n            return option.data;\n          }\n          return this.__ordinalMeta.categories;\n        }\n      };\n      AxisModel.prototype.getOrdinalMeta = function () {\n        return this.__ordinalMeta;\n      };\n      AxisModel.prototype.updateAxisBreaks = function (payload) {\n        var axisBreakHelper = getAxisBreakHelper();\n        return axisBreakHelper ? axisBreakHelper.updateModelAxisBreak(this, payload) : {\n          breaks: []\n        };\n      };\n      AxisModel.type = axisName + 'Axis.' + axisType;\n      AxisModel.defaultOption = defaultOption;\n      return AxisModel;\n    }(BaseAxisModelClass);\n    registers.registerComponentModel(AxisModel);\n  });\n  registers.registerSubTypeDefaulter(axisName + 'Axis', getAxisType);\n}\nfunction getAxisType(option) {\n  // Default axis with data is category axis\n  return option.type || (option.data ? 'category' : 'value');\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nvar Cartesian = /** @class */function () {\n  function Cartesian(name) {\n    this.type = 'cartesian';\n    this._dimList = [];\n    this._axes = {};\n    this.name = name || '';\n  }\n  Cartesian.prototype.getAxis = function (dim) {\n    return this._axes[dim];\n  };\n  Cartesian.prototype.getAxes = function () {\n    return zrUtil.map(this._dimList, function (dim) {\n      return this._axes[dim];\n    }, this);\n  };\n  Cartesian.prototype.getAxesByScale = function (scaleType) {\n    scaleType = scaleType.toLowerCase();\n    return zrUtil.filter(this.getAxes(), function (axis) {\n      return axis.scale.type === scaleType;\n    });\n  };\n  Cartesian.prototype.addAxis = function (axis) {\n    var dim = axis.dim;\n    this._axes[dim] = axis;\n    this._dimList.push(dim);\n  };\n  return Cartesian;\n}();\n;\nexport default Cartesian;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport BoundingRect from 'zrender/lib/core/BoundingRect.js';\nimport Cartesian from './Cartesian.js';\nimport { invert } from 'zrender/lib/core/matrix.js';\nimport { applyTransform } from 'zrender/lib/core/vector.js';\nexport var cartesian2DDimensions = ['x', 'y'];\nfunction canCalculateAffineTransform(scale) {\n  return (scale.type === 'interval' || scale.type === 'time') && !scale.hasBreaks();\n}\nvar Cartesian2D = /** @class */function (_super) {\n  __extends(Cartesian2D, _super);\n  function Cartesian2D() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = 'cartesian2d';\n    _this.dimensions = cartesian2DDimensions;\n    return _this;\n  }\n  /**\n   * Calculate an affine transform matrix if two axes are time or value.\n   * It's mainly for accelartion on the large time series data.\n   */\n  Cartesian2D.prototype.calcAffineTransform = function () {\n    this._transform = this._invTransform = null;\n    var xAxisScale = this.getAxis('x').scale;\n    var yAxisScale = this.getAxis('y').scale;\n    if (!canCalculateAffineTransform(xAxisScale) || !canCalculateAffineTransform(yAxisScale)) {\n      return;\n    }\n    var xScaleExtent = xAxisScale.getExtent();\n    var yScaleExtent = yAxisScale.getExtent();\n    var start = this.dataToPoint([xScaleExtent[0], yScaleExtent[0]]);\n    var end = this.dataToPoint([xScaleExtent[1], yScaleExtent[1]]);\n    var xScaleSpan = xScaleExtent[1] - xScaleExtent[0];\n    var yScaleSpan = yScaleExtent[1] - yScaleExtent[0];\n    if (!xScaleSpan || !yScaleSpan) {\n      return;\n    }\n    // Accelerate data to point calculation on the special large time series data.\n    var scaleX = (end[0] - start[0]) / xScaleSpan;\n    var scaleY = (end[1] - start[1]) / yScaleSpan;\n    var translateX = start[0] - xScaleExtent[0] * scaleX;\n    var translateY = start[1] - yScaleExtent[0] * scaleY;\n    var m = this._transform = [scaleX, 0, 0, scaleY, translateX, translateY];\n    this._invTransform = invert([], m);\n  };\n  /**\n   * Base axis will be used on stacking.\n   */\n  Cartesian2D.prototype.getBaseAxis = function () {\n    return this.getAxesByScale('ordinal')[0] || this.getAxesByScale('time')[0] || this.getAxis('x');\n  };\n  Cartesian2D.prototype.containPoint = function (point) {\n    var axisX = this.getAxis('x');\n    var axisY = this.getAxis('y');\n    return axisX.contain(axisX.toLocalCoord(point[0])) && axisY.contain(axisY.toLocalCoord(point[1]));\n  };\n  Cartesian2D.prototype.containData = function (data) {\n    return this.getAxis('x').containData(data[0]) && this.getAxis('y').containData(data[1]);\n  };\n  Cartesian2D.prototype.containZone = function (data1, data2) {\n    var zoneDiag1 = this.dataToPoint(data1);\n    var zoneDiag2 = this.dataToPoint(data2);\n    var area = this.getArea();\n    var zone = new BoundingRect(zoneDiag1[0], zoneDiag1[1], zoneDiag2[0] - zoneDiag1[0], zoneDiag2[1] - zoneDiag1[1]);\n    return area.intersect(zone);\n  };\n  Cartesian2D.prototype.dataToPoint = function (data, clamp, out) {\n    out = out || [];\n    var xVal = data[0];\n    var yVal = data[1];\n    // [CAVEAT]: Do not add time consuming operation within and before fast path.\n    // Fast path.\n    if (this._transform\n    // It's supported that if data is like `[Inifity, 123]`, where only Y pixel calculated.\n    && xVal != null && isFinite(xVal) && yVal != null && isFinite(yVal)) {\n      return applyTransform(out, data, this._transform);\n    }\n    var xAxis = this.getAxis('x');\n    var yAxis = this.getAxis('y');\n    out[0] = xAxis.toGlobalCoord(xAxis.dataToCoord(xVal, clamp));\n    out[1] = yAxis.toGlobalCoord(yAxis.dataToCoord(yVal, clamp));\n    return out;\n  };\n  Cartesian2D.prototype.clampData = function (data, out) {\n    var xScale = this.getAxis('x').scale;\n    var yScale = this.getAxis('y').scale;\n    var xAxisExtent = xScale.getExtent();\n    var yAxisExtent = yScale.getExtent();\n    var x = xScale.parse(data[0]);\n    var y = yScale.parse(data[1]);\n    out = out || [];\n    out[0] = Math.min(Math.max(Math.min(xAxisExtent[0], xAxisExtent[1]), x), Math.max(xAxisExtent[0], xAxisExtent[1]));\n    out[1] = Math.min(Math.max(Math.min(yAxisExtent[0], yAxisExtent[1]), y), Math.max(yAxisExtent[0], yAxisExtent[1]));\n    return out;\n  };\n  Cartesian2D.prototype.pointToData = function (point, clamp, out) {\n    out = out || [];\n    if (this._invTransform) {\n      return applyTransform(out, point, this._invTransform);\n    }\n    var xAxis = this.getAxis('x');\n    var yAxis = this.getAxis('y');\n    out[0] = xAxis.coordToData(xAxis.toLocalCoord(point[0]), clamp);\n    out[1] = yAxis.coordToData(yAxis.toLocalCoord(point[1]), clamp);\n    return out;\n  };\n  Cartesian2D.prototype.getOtherAxis = function (axis) {\n    return this.getAxis(axis.dim === 'x' ? 'y' : 'x');\n  };\n  /**\n   * Get rect area of cartesian.\n   * Area will have a contain function to determine if a point is in the coordinate system.\n   */\n  Cartesian2D.prototype.getArea = function (tolerance) {\n    tolerance = tolerance || 0;\n    var xExtent = this.getAxis('x').getGlobalExtent();\n    var yExtent = this.getAxis('y').getGlobalExtent();\n    var x = Math.min(xExtent[0], xExtent[1]) - tolerance;\n    var y = Math.min(yExtent[0], yExtent[1]) - tolerance;\n    var width = Math.max(xExtent[0], xExtent[1]) - x + tolerance;\n    var height = Math.max(yExtent[0], yExtent[1]) - y + tolerance;\n    return new BoundingRect(x, y, width, height);\n  };\n  return Cartesian2D;\n}(Cartesian);\n;\nexport default Cartesian2D;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport Axis from '../Axis.js';\nvar Axis2D = /** @class */function (_super) {\n  __extends(Axis2D, _super);\n  function Axis2D(dim, scale, coordExtent, axisType, position) {\n    var _this = _super.call(this, dim, scale, coordExtent) || this;\n    /**\n     * Index of axis, can be used as key\n     * Injected outside.\n     */\n    _this.index = 0;\n    _this.type = axisType || 'value';\n    _this.position = position || 'bottom';\n    return _this;\n  }\n  Axis2D.prototype.isHorizontal = function () {\n    var position = this.position;\n    return position === 'top' || position === 'bottom';\n  };\n  /**\n   * Each item cooresponds to this.getExtent(), which\n   * means globalExtent[0] may greater than globalExtent[1],\n   * unless `asc` is input.\n   *\n   * @param {boolean} [asc]\n   * @return {Array.<number>}\n   */\n  Axis2D.prototype.getGlobalExtent = function (asc) {\n    var ret = this.getExtent();\n    ret[0] = this.toGlobalCoord(ret[0]);\n    ret[1] = this.toGlobalCoord(ret[1]);\n    asc && ret[0] > ret[1] && ret.reverse();\n    return ret;\n  };\n  Axis2D.prototype.pointToData = function (point, clamp) {\n    return this.coordToData(this.toLocalCoord(point[this.dim === 'x' ? 0 : 1]), clamp);\n  };\n  /**\n   * Set ordinalSortInfo\n   * @param info new OrdinalSortInfo\n   */\n  Axis2D.prototype.setCategorySortInfo = function (info) {\n    if (this.type !== 'category') {\n      return false;\n    }\n    this.model.option.categorySortInfo = info;\n    this.scale.setSortInfo(info);\n  };\n  return Axis2D;\n}(Axis);\nexport default Axis2D;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { parseFinder } from '../../util/model.js';\nimport { defaults, each } from 'zrender/lib/core/util.js';\nexport var AXIS_BREAK_EXPAND_ACTION_TYPE = 'expandAxisBreak';\nexport var AXIS_BREAK_COLLAPSE_ACTION_TYPE = 'collapseAxisBreak';\nexport var AXIS_BREAK_TOGGLE_ACTION_TYPE = 'toggleAxisBreak';\nvar AXIS_BREAK_CHANGED_EVENT_TYPE = 'axisbreakchanged';\nvar expandAxisBreakActionInfo = {\n  type: AXIS_BREAK_EXPAND_ACTION_TYPE,\n  event: AXIS_BREAK_CHANGED_EVENT_TYPE,\n  update: 'update',\n  refineEvent: refineAxisBreakChangeEvent\n};\nvar collapseAxisBreakActionInfo = {\n  type: AXIS_BREAK_COLLAPSE_ACTION_TYPE,\n  event: AXIS_BREAK_CHANGED_EVENT_TYPE,\n  update: 'update',\n  refineEvent: refineAxisBreakChangeEvent\n};\nvar toggleAxisBreakActionInfo = {\n  type: AXIS_BREAK_TOGGLE_ACTION_TYPE,\n  event: AXIS_BREAK_CHANGED_EVENT_TYPE,\n  update: 'update',\n  refineEvent: refineAxisBreakChangeEvent\n};\nfunction refineAxisBreakChangeEvent(actionResultBatch, payload, ecModel, api) {\n  var breaks = [];\n  each(actionResultBatch, function (actionResult) {\n    breaks = breaks.concat(actionResult.eventBreaks);\n  });\n  return {\n    eventContent: {\n      breaks: breaks\n    }\n  };\n}\nexport function registerAction(registers) {\n  registers.registerAction(expandAxisBreakActionInfo, actionHandler);\n  registers.registerAction(collapseAxisBreakActionInfo, actionHandler);\n  registers.registerAction(toggleAxisBreakActionInfo, actionHandler);\n  function actionHandler(payload, ecModel) {\n    var eventBreaks = [];\n    var finderResult = parseFinder(ecModel, payload);\n    function dealUpdate(modelProp, indexProp) {\n      each(finderResult[modelProp], function (axisModel) {\n        var result = axisModel.updateAxisBreaks(payload);\n        each(result.breaks, function (item) {\n          var _a;\n          eventBreaks.push(defaults((_a = {}, _a[indexProp] = axisModel.componentIndex, _a), item));\n        });\n      });\n    }\n    dealUpdate('xAxisModels', 'xAxisIndex');\n    dealUpdate('yAxisModels', 'yAxisIndex');\n    dealUpdate('singleAxisModels', 'singleAxisIndex');\n    return {\n      eventBreaks: eventBreaks\n    };\n  }\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { retrieve, defaults, extend, each, isObject, isString, isNumber, isFunction, retrieve2, assert, map, retrieve3, filter } from 'zrender/lib/core/util.js';\nimport * as graphic from '../../util/graphic.js';\nimport { getECData } from '../../util/innerStore.js';\nimport { createTextStyle } from '../../label/labelStyle.js';\nimport Model from '../../model/Model.js';\nimport { isRadianAroundZero, remRadian } from '../../util/number.js';\nimport { createSymbol, normalizeSymbolOffset } from '../../util/symbol.js';\nimport * as matrixUtil from 'zrender/lib/core/matrix.js';\nimport { applyTransform as v2ApplyTransform } from 'zrender/lib/core/vector.js';\nimport { isNameLocationCenter, shouldShowAllLabels } from '../../coord/axisHelper.js';\nimport { hideOverlap, labelIntersect, computeLabelGeometry2, ensureLabelLayoutWithGeometry, labelLayoutApplyTranslation, setLabelLayoutDirty, newLabelLayoutWithGeometry } from '../../label/labelLayoutHelper.js';\nimport { makeInner } from '../../util/model.js';\nimport { getAxisBreakHelper } from './axisBreakHelper.js';\nimport { AXIS_BREAK_EXPAND_ACTION_TYPE } from './axisAction.js';\nimport { getScaleBreakHelper } from '../../scale/break.js';\nimport BoundingRect from 'zrender/lib/core/BoundingRect.js';\nimport Point from 'zrender/lib/core/Point.js';\nimport { copyTransform } from 'zrender/lib/core/Transformable.js';\nimport { AxisTickLabelComputingKind, createAxisLabelsComputingContext } from '../../coord/axisTickLabelBuilder.js';\nvar PI = Math.PI;\nvar DEFAULT_CENTER_NAME_MARGIN_LEVELS = [[1, 2, 1, 2], [5, 3, 5, 3], [8, 3, 8, 3]];\nvar DEFAULT_ENDS_NAME_MARGIN_LEVELS = [[0, 1, 0, 1], [0, 3, 0, 3], [0, 3, 0, 3]];\nexport var getLabelInner = makeInner();\nvar getTickInner = makeInner();\n/**\n * A context shared by difference axisBuilder instances.\n * For cross-axes overlap resolving.\n *\n * Lifecycle constraint: should not over a pass of ec main process.\n *  If model is changed, the context must be disposed.\n *\n * @see AxisBuilderLocalContext\n */\nvar AxisBuilderSharedContext = /** @class */function () {\n  function AxisBuilderSharedContext(resolveAxisNameOverlap) {\n    /**\n     * [CAUTION] Do not modify this data structure outside this class.\n     */\n    this.recordMap = {};\n    this.resolveAxisNameOverlap = resolveAxisNameOverlap;\n  }\n  AxisBuilderSharedContext.prototype.ensureRecord = function (axisModel) {\n    var dim = axisModel.axis.dim;\n    var idx = axisModel.componentIndex;\n    var recordMap = this.recordMap;\n    var records = recordMap[dim] || (recordMap[dim] = []);\n    return records[idx] || (records[idx] = {\n      ready: {}\n    });\n  };\n  return AxisBuilderSharedContext;\n}();\nexport { AxisBuilderSharedContext };\n;\n/**\n * [CAUTION]\n *  1. The call of this function must be after axisLabel overlap handlings\n *     (such as `hideOverlap`, `fixMinMaxLabelShow`) and after transform calculating.\n *  2. Can be called multiple times and should be idempotent.\n */\nfunction resetOverlapRecordToShared(cfg, shared, axisModel, labelLayoutList) {\n  var axis = axisModel.axis;\n  var record = shared.ensureRecord(axisModel);\n  var labelInfoList = [];\n  var stOccupiedRect;\n  var useStOccupiedRect = hasAxisName(cfg.axisName) && isNameLocationCenter(cfg.nameLocation);\n  each(labelLayoutList, function (layout) {\n    var layoutInfo = ensureLabelLayoutWithGeometry(layout);\n    if (!layoutInfo || layoutInfo.label.ignore) {\n      return;\n    }\n    labelInfoList.push(layoutInfo);\n    var transGroup = record.transGroup;\n    if (useStOccupiedRect) {\n      // Transform to \"standard axis\" for creating stOccupiedRect (the label rects union).\n      transGroup.transform ? matrixUtil.invert(_stTransTmp, transGroup.transform) : matrixUtil.identity(_stTransTmp);\n      if (layoutInfo.transform) {\n        matrixUtil.mul(_stTransTmp, _stTransTmp, layoutInfo.transform);\n      }\n      BoundingRect.copy(_stLabelRectTmp, layoutInfo.localRect);\n      _stLabelRectTmp.applyTransform(_stTransTmp);\n      stOccupiedRect ? stOccupiedRect.union(_stLabelRectTmp) : BoundingRect.copy(stOccupiedRect = new BoundingRect(0, 0, 0, 0), _stLabelRectTmp);\n    }\n  });\n  var sortByDim = Math.abs(record.dirVec.x) > 0.1 ? 'x' : 'y';\n  var sortByValue = record.transGroup[sortByDim];\n  labelInfoList.sort(function (info1, info2) {\n    return Math.abs(info1.label[sortByDim] - sortByValue) - Math.abs(info2.label[sortByDim] - sortByValue);\n  });\n  if (useStOccupiedRect && stOccupiedRect) {\n    var extent = axis.getExtent();\n    var axisLineX = Math.min(extent[0], extent[1]);\n    var axisLineWidth = Math.max(extent[0], extent[1]) - axisLineX;\n    // If `nameLocation` is 'middle', enlarge axis labels boundingRect to axisLine to avoid bad\n    //  case like that axis name is placed in the gap between axis labels and axis line.\n    // If only one label exists, the entire band should be occupied for\n    // visual consistency, so extent it to [0, canvas width].\n    stOccupiedRect.union(new BoundingRect(axisLineX, 0, axisLineWidth, 1));\n  }\n  record.stOccupiedRect = stOccupiedRect;\n  record.labelInfoList = labelInfoList;\n}\nvar _stTransTmp = matrixUtil.create();\nvar _stLabelRectTmp = new BoundingRect(0, 0, 0, 0);\n/**\n * The default resolver does not involve other axes within the same coordinate system.\n */\nexport var resolveAxisNameOverlapDefault = function (cfg, ctx, axisModel, nameLayoutInfo, nameMoveDirVec, thisRecord) {\n  if (isNameLocationCenter(cfg.nameLocation)) {\n    var stOccupiedRect = thisRecord.stOccupiedRect;\n    if (stOccupiedRect) {\n      moveIfOverlap(computeLabelGeometry2({}, stOccupiedRect, thisRecord.transGroup.transform), nameLayoutInfo, nameMoveDirVec);\n    }\n  } else {\n    moveIfOverlapByLinearLabels(thisRecord.labelInfoList, thisRecord.dirVec, nameLayoutInfo, nameMoveDirVec);\n  }\n};\n// [NOTICE] not consider ignore.\nfunction moveIfOverlap(basedLayoutInfo, movableLayoutInfo, moveDirVec) {\n  var mtv = new Point();\n  if (labelIntersect(basedLayoutInfo, movableLayoutInfo, mtv, {\n    direction: Math.atan2(moveDirVec.y, moveDirVec.x),\n    bidirectional: false,\n    touchThreshold: 0.05\n  })) {\n    labelLayoutApplyTranslation(movableLayoutInfo, mtv);\n  }\n}\nexport function moveIfOverlapByLinearLabels(baseLayoutInfoList, baseDirVec, movableLayoutInfo, moveDirVec) {\n  // Detect and move from far to close.\n  var sameDir = Point.dot(moveDirVec, baseDirVec) >= 0;\n  for (var idx = 0, len = baseLayoutInfoList.length; idx < len; idx++) {\n    var labelInfo = baseLayoutInfoList[sameDir ? idx : len - 1 - idx];\n    if (!labelInfo.label.ignore) {\n      moveIfOverlap(labelInfo, movableLayoutInfo, moveDirVec);\n    }\n  }\n}\n/**\n * @caution\n * - Ensure it is called after the data processing stage finished.\n * - It might be called before `CahrtView#render`, sush as called at `CoordinateSystem#update`,\n *  thus ensure the result the same whenever it is called.\n *\n * A builder for a straight-line axis.\n *\n * A final axis is translated and rotated from a \"standard axis\".\n * So opt.position and opt.rotation is required.\n *\n * A \"standard axis\" is the axis [0,0]-->[abs(axisExtent[1]-axisExtent[0]),0]\n * for example: [0,0]-->[50,0]\n */\nvar AxisBuilder = /** @class */function () {\n  /**\n   * [CAUTION]: axisModel.axis.extent/scale must be ready to use.\n   */\n  function AxisBuilder(axisModel, api, opt, shared) {\n    this.group = new graphic.Group();\n    this._axisModel = axisModel;\n    this._api = api;\n    this._local = {};\n    this._shared = shared || new AxisBuilderSharedContext(resolveAxisNameOverlapDefault);\n    this._resetCfgDetermined(opt);\n  }\n  /**\n   * Regarding axis label related configurations, only the change of label.x/y is supported; other\n   * changes are not necessary and not performant. To be specific, only `axis.position`\n   * (and consequently `labelOffset`) and `axis.extent` can be changed, and assume everything in\n   * `axisModel` are not changed.\n   * Axis line related configurations can be changed since this method can only be called\n   * before they are created.\n   */\n  AxisBuilder.prototype.updateCfg = function (opt) {\n    if (process.env.NODE_ENV !== 'production') {\n      var ready = this._shared.ensureRecord(this._axisModel).ready;\n      // After that, changing cfg is not supported; avoid unnecessary complexity.\n      assert(!ready.axisLine && !ready.axisTickLabelDetermine);\n      // Have to be called again if cfg changed.\n      ready.axisName = ready.axisTickLabelEstimate = false;\n    }\n    var raw = this._cfg.raw;\n    raw.position = opt.position;\n    raw.labelOffset = opt.labelOffset;\n    this._resetCfgDetermined(raw);\n  };\n  /**\n   * [CAUTION] For debug usage. Never change it outside!\n   */\n  AxisBuilder.prototype.__getRawCfg = function () {\n    return this._cfg.raw;\n  };\n  AxisBuilder.prototype._resetCfgDetermined = function (raw) {\n    var axisModel = this._axisModel;\n    // FIXME:\n    //  Currently there is no uniformed way to set default values if an option\n    //  is specified null/undefined by user (intentionally or unintentionally),\n    //  e.g. null/undefined is not a illegal value for `nameLocation`.\n    //  Try to use `getDefaultOption` to address it. But radar has no `getDefaultOption`.\n    var axisModelDefaultOption = axisModel.getDefaultOption ? axisModel.getDefaultOption() : {};\n    // Default value\n    var axisName = retrieve2(raw.axisName, axisModel.get('name'));\n    var nameMoveOverlapOption = axisModel.get('nameMoveOverlap');\n    if (nameMoveOverlapOption == null || nameMoveOverlapOption === 'auto') {\n      nameMoveOverlapOption = retrieve2(raw.defaultNameMoveOverlap, true);\n    }\n    var cfg = {\n      raw: raw,\n      position: raw.position,\n      rotation: raw.rotation,\n      nameDirection: retrieve2(raw.nameDirection, 1),\n      tickDirection: retrieve2(raw.tickDirection, 1),\n      labelDirection: retrieve2(raw.labelDirection, 1),\n      labelOffset: retrieve2(raw.labelOffset, 0),\n      silent: retrieve2(raw.silent, true),\n      axisName: axisName,\n      nameLocation: retrieve3(axisModel.get('nameLocation'), axisModelDefaultOption.nameLocation, 'end'),\n      shouldNameMoveOverlap: hasAxisName(axisName) && nameMoveOverlapOption,\n      optionHideOverlap: axisModel.get(['axisLabel', 'hideOverlap']),\n      showMinorTicks: axisModel.get(['minorTick', 'show'])\n    };\n    if (process.env.NODE_ENV !== 'production') {\n      assert(cfg.position != null);\n      assert(cfg.rotation != null);\n    }\n    this._cfg = cfg;\n    // FIXME Not use a separate text group?\n    var transformGroup = new graphic.Group({\n      x: cfg.position[0],\n      y: cfg.position[1],\n      rotation: cfg.rotation\n    });\n    transformGroup.updateTransform();\n    this._transformGroup = transformGroup;\n    var record = this._shared.ensureRecord(axisModel);\n    record.transGroup = this._transformGroup;\n    record.dirVec = new Point(Math.cos(-cfg.rotation), Math.sin(-cfg.rotation));\n  };\n  AxisBuilder.prototype.build = function (axisPartNameMap, extraParams) {\n    var _this = this;\n    if (!axisPartNameMap) {\n      axisPartNameMap = {\n        axisLine: true,\n        axisTickLabelEstimate: false,\n        axisTickLabelDetermine: true,\n        axisName: true\n      };\n    }\n    each(AXIS_BUILDER_AXIS_PART_NAMES, function (partName) {\n      if (axisPartNameMap[partName]) {\n        builders[partName](_this._cfg, _this._local, _this._shared, _this._axisModel, _this.group, _this._transformGroup, _this._api, extraParams || {});\n      }\n    });\n    return this;\n  };\n  /**\n   * Currently only get text align/verticalAlign by rotation.\n   * NO `position` is involved, otherwise it have to be performed for each `updateAxisLabelChangableProps`.\n   */\n  AxisBuilder.innerTextLayout = function (axisRotation, textRotation, direction) {\n    var rotationDiff = remRadian(textRotation - axisRotation);\n    var textAlign;\n    var textVerticalAlign;\n    if (isRadianAroundZero(rotationDiff)) {\n      // Label is parallel with axis line.\n      textVerticalAlign = direction > 0 ? 'top' : 'bottom';\n      textAlign = 'center';\n    } else if (isRadianAroundZero(rotationDiff - PI)) {\n      // Label is inverse parallel with axis line.\n      textVerticalAlign = direction > 0 ? 'bottom' : 'top';\n      textAlign = 'center';\n    } else {\n      textVerticalAlign = 'middle';\n      if (rotationDiff > 0 && rotationDiff < PI) {\n        textAlign = direction > 0 ? 'right' : 'left';\n      } else {\n        textAlign = direction > 0 ? 'left' : 'right';\n      }\n    }\n    return {\n      rotation: rotationDiff,\n      textAlign: textAlign,\n      textVerticalAlign: textVerticalAlign\n    };\n  };\n  AxisBuilder.makeAxisEventDataBase = function (axisModel) {\n    var eventData = {\n      componentType: axisModel.mainType,\n      componentIndex: axisModel.componentIndex\n    };\n    eventData[axisModel.mainType + 'Index'] = axisModel.componentIndex;\n    return eventData;\n  };\n  AxisBuilder.isLabelSilent = function (axisModel) {\n    var tooltipOpt = axisModel.get('tooltip');\n    return axisModel.get('silent')\n    // Consider mouse cursor, add these restrictions.\n    || !(axisModel.get('triggerEvent') || tooltipOpt && tooltipOpt.show);\n  };\n  return AxisBuilder;\n}();\n;\n// Sorted by dependency order.\nvar AXIS_BUILDER_AXIS_PART_NAMES = ['axisLine', 'axisTickLabelEstimate', 'axisTickLabelDetermine', 'axisName'];\nvar builders = {\n  axisLine: function (cfg, local, shared, axisModel, group, transformGroup, api) {\n    if (process.env.NODE_ENV !== 'production') {\n      var ready = shared.ensureRecord(axisModel).ready;\n      assert(!ready.axisLine);\n      ready.axisLine = true;\n    }\n    var shown = axisModel.get(['axisLine', 'show']);\n    if (shown === 'auto') {\n      shown = true;\n      if (cfg.raw.axisLineAutoShow != null) {\n        shown = !!cfg.raw.axisLineAutoShow;\n      }\n    }\n    if (!shown) {\n      return;\n    }\n    var extent = axisModel.axis.getExtent();\n    var matrix = transformGroup.transform;\n    var pt1 = [extent[0], 0];\n    var pt2 = [extent[1], 0];\n    var inverse = pt1[0] > pt2[0];\n    if (matrix) {\n      v2ApplyTransform(pt1, pt1, matrix);\n      v2ApplyTransform(pt2, pt2, matrix);\n    }\n    var lineStyle = extend({\n      lineCap: 'round'\n    }, axisModel.getModel(['axisLine', 'lineStyle']).getLineStyle());\n    var pathBaseProp = {\n      strokeContainThreshold: cfg.raw.strokeContainThreshold || 5,\n      silent: true,\n      z2: 1,\n      style: lineStyle\n    };\n    if (axisModel.get(['axisLine', 'breakLine']) && axisModel.axis.scale.hasBreaks()) {\n      getAxisBreakHelper().buildAxisBreakLine(axisModel, group, transformGroup, pathBaseProp);\n    } else {\n      var line = new graphic.Line(extend({\n        shape: {\n          x1: pt1[0],\n          y1: pt1[1],\n          x2: pt2[0],\n          y2: pt2[1]\n        }\n      }, pathBaseProp));\n      graphic.subPixelOptimizeLine(line.shape, line.style.lineWidth);\n      line.anid = 'line';\n      group.add(line);\n    }\n    var arrows = axisModel.get(['axisLine', 'symbol']);\n    if (arrows != null) {\n      var arrowSize = axisModel.get(['axisLine', 'symbolSize']);\n      if (isString(arrows)) {\n        // Use the same arrow for start and end point\n        arrows = [arrows, arrows];\n      }\n      if (isString(arrowSize) || isNumber(arrowSize)) {\n        // Use the same size for width and height\n        arrowSize = [arrowSize, arrowSize];\n      }\n      var arrowOffset = normalizeSymbolOffset(axisModel.get(['axisLine', 'symbolOffset']) || 0, arrowSize);\n      var symbolWidth_1 = arrowSize[0];\n      var symbolHeight_1 = arrowSize[1];\n      each([{\n        rotate: cfg.rotation + Math.PI / 2,\n        offset: arrowOffset[0],\n        r: 0\n      }, {\n        rotate: cfg.rotation - Math.PI / 2,\n        offset: arrowOffset[1],\n        r: Math.sqrt((pt1[0] - pt2[0]) * (pt1[0] - pt2[0]) + (pt1[1] - pt2[1]) * (pt1[1] - pt2[1]))\n      }], function (point, index) {\n        if (arrows[index] !== 'none' && arrows[index] != null) {\n          var symbol = createSymbol(arrows[index], -symbolWidth_1 / 2, -symbolHeight_1 / 2, symbolWidth_1, symbolHeight_1, lineStyle.stroke, true);\n          // Calculate arrow position with offset\n          var r = point.r + point.offset;\n          var pt = inverse ? pt2 : pt1;\n          symbol.attr({\n            rotation: point.rotate,\n            x: pt[0] + r * Math.cos(cfg.rotation),\n            y: pt[1] - r * Math.sin(cfg.rotation),\n            silent: true,\n            z2: 11\n          });\n          group.add(symbol);\n        }\n      });\n    }\n  },\n  /**\n   * [CAUTION] This method can be called multiple times, following the change due to `resetCfg` called\n   *  in size measurement. Thus this method should be idempotent, and should be performant.\n   */\n  axisTickLabelEstimate: function (cfg, local, shared, axisModel, group, transformGroup, api, extraParams) {\n    if (process.env.NODE_ENV !== 'production') {\n      var ready = shared.ensureRecord(axisModel).ready;\n      assert(!ready.axisTickLabelDetermine);\n      ready.axisTickLabelEstimate = true;\n    }\n    var needCallLayout = dealLastTickLabelResultReusable(local, group, extraParams);\n    if (needCallLayout) {\n      layOutAxisTickLabel(cfg, local, shared, axisModel, group, transformGroup, api, AxisTickLabelComputingKind.estimate);\n    }\n  },\n  /**\n   * Finish axis tick label build.\n   * Can be only called once.\n   */\n  axisTickLabelDetermine: function (cfg, local, shared, axisModel, group, transformGroup, api, extraParams) {\n    if (process.env.NODE_ENV !== 'production') {\n      var ready = shared.ensureRecord(axisModel).ready;\n      ready.axisTickLabelDetermine = true;\n    }\n    var needCallLayout = dealLastTickLabelResultReusable(local, group, extraParams);\n    if (needCallLayout) {\n      layOutAxisTickLabel(cfg, local, shared, axisModel, group, transformGroup, api, AxisTickLabelComputingKind.determine);\n    }\n    var ticksEls = buildAxisMajorTicks(cfg, group, transformGroup, axisModel);\n    syncLabelIgnoreToMajorTicks(cfg, local.labelLayoutList, ticksEls);\n    buildAxisMinorTicks(cfg, group, transformGroup, axisModel, cfg.tickDirection);\n  },\n  /**\n   * [CAUTION] This method can be called multiple times, following the change due to `resetCfg` called\n   *  in size measurement. Thus this method should be idempotent, and should be performant.\n   */\n  axisName: function (cfg, local, shared, axisModel, group, transformGroup, api, extraParams) {\n    var sharedRecord = shared.ensureRecord(axisModel);\n    if (process.env.NODE_ENV !== 'production') {\n      var ready = sharedRecord.ready;\n      assert(ready.axisTickLabelEstimate || ready.axisTickLabelDetermine);\n      ready.axisName = true;\n    }\n    // Remove the existing name result created in estimation phase.\n    if (local.nameEl) {\n      group.remove(local.nameEl);\n      local.nameEl = sharedRecord.nameLayout = sharedRecord.nameLocation = null;\n    }\n    var name = cfg.axisName;\n    if (!hasAxisName(name)) {\n      return;\n    }\n    var nameLocation = cfg.nameLocation;\n    var nameDirection = cfg.nameDirection;\n    var textStyleModel = axisModel.getModel('nameTextStyle');\n    var gap = axisModel.get('nameGap') || 0;\n    var extent = axisModel.axis.getExtent();\n    var gapStartEndSignal = axisModel.axis.inverse ? -1 : 1;\n    var pos = new Point(0, 0);\n    var nameMoveDirVec = new Point(0, 0);\n    if (nameLocation === 'start') {\n      pos.x = extent[0] - gapStartEndSignal * gap;\n      nameMoveDirVec.x = -gapStartEndSignal;\n    } else if (nameLocation === 'end') {\n      pos.x = extent[1] + gapStartEndSignal * gap;\n      nameMoveDirVec.x = gapStartEndSignal;\n    } else {\n      // 'middle' or 'center'\n      pos.x = (extent[0] + extent[1]) / 2;\n      pos.y = cfg.labelOffset + nameDirection * gap;\n      nameMoveDirVec.y = nameDirection;\n    }\n    var mt = matrixUtil.create();\n    nameMoveDirVec.transform(matrixUtil.rotate(mt, mt, cfg.rotation));\n    var nameRotation = axisModel.get('nameRotate');\n    if (nameRotation != null) {\n      nameRotation = nameRotation * PI / 180; // To radian.\n    }\n    var labelLayout;\n    var axisNameAvailableWidth;\n    if (isNameLocationCenter(nameLocation)) {\n      labelLayout = AxisBuilder.innerTextLayout(cfg.rotation, nameRotation != null ? nameRotation : cfg.rotation,\n      // Adapt to axis.\n      nameDirection);\n    } else {\n      labelLayout = endTextLayout(cfg.rotation, nameLocation, nameRotation || 0, extent);\n      axisNameAvailableWidth = cfg.raw.axisNameAvailableWidth;\n      if (axisNameAvailableWidth != null) {\n        axisNameAvailableWidth = Math.abs(axisNameAvailableWidth / Math.sin(labelLayout.rotation));\n        !isFinite(axisNameAvailableWidth) && (axisNameAvailableWidth = null);\n      }\n    }\n    var textFont = textStyleModel.getFont();\n    var truncateOpt = axisModel.get('nameTruncate', true) || {};\n    var ellipsis = truncateOpt.ellipsis;\n    var maxWidth = retrieve(cfg.raw.nameTruncateMaxWidth, truncateOpt.maxWidth, axisNameAvailableWidth);\n    var nameMarginLevel = extraParams.nameMarginLevel || 0;\n    var textEl = new graphic.Text({\n      x: pos.x,\n      y: pos.y,\n      rotation: labelLayout.rotation,\n      silent: AxisBuilder.isLabelSilent(axisModel),\n      style: createTextStyle(textStyleModel, {\n        text: name,\n        font: textFont,\n        overflow: 'truncate',\n        width: maxWidth,\n        ellipsis: ellipsis,\n        fill: textStyleModel.getTextColor() || axisModel.get(['axisLine', 'lineStyle', 'color']),\n        align: textStyleModel.get('align') || labelLayout.textAlign,\n        verticalAlign: textStyleModel.get('verticalAlign') || labelLayout.textVerticalAlign\n      }),\n      z2: 1\n    });\n    graphic.setTooltipConfig({\n      el: textEl,\n      componentModel: axisModel,\n      itemName: name\n    });\n    textEl.__fullText = name;\n    // Id for animation\n    textEl.anid = 'name';\n    if (axisModel.get('triggerEvent')) {\n      var eventData = AxisBuilder.makeAxisEventDataBase(axisModel);\n      eventData.targetType = 'axisName';\n      eventData.name = name;\n      getECData(textEl).eventData = eventData;\n    }\n    transformGroup.add(textEl);\n    textEl.updateTransform();\n    local.nameEl = textEl;\n    var nameLayout = sharedRecord.nameLayout = ensureLabelLayoutWithGeometry({\n      label: textEl,\n      priority: textEl.z2,\n      defaultAttr: {\n        ignore: textEl.ignore\n      },\n      marginDefault: isNameLocationCenter(nameLocation)\n      // Make axis name visually far from axis labels.\n      // (but not too aggressive, consider multiple small charts)\n      ? DEFAULT_CENTER_NAME_MARGIN_LEVELS[nameMarginLevel]\n      // top/button margin is set to `0` to inserted the xAxis name into the indention\n      // above the axis labels to save space. (see example below.)\n      : DEFAULT_ENDS_NAME_MARGIN_LEVELS[nameMarginLevel]\n    });\n    sharedRecord.nameLocation = nameLocation;\n    group.add(textEl);\n    textEl.decomposeTransform();\n    if (cfg.shouldNameMoveOverlap && nameLayout) {\n      var record = shared.ensureRecord(axisModel);\n      if (process.env.NODE_ENV !== 'production') {\n        assert(record.labelInfoList);\n      }\n      shared.resolveAxisNameOverlap(cfg, shared, axisModel, nameLayout, nameMoveDirVec, record);\n    }\n  }\n};\nfunction layOutAxisTickLabel(cfg, local, shared, axisModel, group, transformGroup, api, kind) {\n  if (!axisLabelBuildResultExists(local)) {\n    buildAxisLabel(cfg, local, group, kind, axisModel, api);\n  }\n  var labelLayoutList = local.labelLayoutList;\n  updateAxisLabelChangableProps(cfg, axisModel, labelLayoutList, transformGroup);\n  adjustBreakLabels(axisModel, cfg.rotation, labelLayoutList);\n  var optionHideOverlap = cfg.optionHideOverlap;\n  fixMinMaxLabelShow(axisModel, labelLayoutList, optionHideOverlap);\n  if (optionHideOverlap) {\n    // This bit fixes the label overlap issue for the time chart.\n    // See https://github.com/apache/echarts/issues/14266 for more.\n    hideOverlap(\n    // Filter the already ignored labels by the previous overlap resolving methods.\n    filter(labelLayoutList, function (layout) {\n      return layout && !layout.label.ignore;\n    }));\n  }\n  // Always call it even this axis has no name, since it serves in overlapping detection\n  // and grid outerBounds on other axis.\n  resetOverlapRecordToShared(cfg, shared, axisModel, labelLayoutList);\n}\n;\nfunction endTextLayout(rotation, textPosition, textRotate, extent) {\n  var rotationDiff = remRadian(textRotate - rotation);\n  var textAlign;\n  var textVerticalAlign;\n  var inverse = extent[0] > extent[1];\n  var onLeft = textPosition === 'start' && !inverse || textPosition !== 'start' && inverse;\n  if (isRadianAroundZero(rotationDiff - PI / 2)) {\n    textVerticalAlign = onLeft ? 'bottom' : 'top';\n    textAlign = 'center';\n  } else if (isRadianAroundZero(rotationDiff - PI * 1.5)) {\n    textVerticalAlign = onLeft ? 'top' : 'bottom';\n    textAlign = 'center';\n  } else {\n    textVerticalAlign = 'middle';\n    if (rotationDiff < PI * 1.5 && rotationDiff > PI / 2) {\n      textAlign = onLeft ? 'left' : 'right';\n    } else {\n      textAlign = onLeft ? 'right' : 'left';\n    }\n  }\n  return {\n    rotation: rotationDiff,\n    textAlign: textAlign,\n    textVerticalAlign: textVerticalAlign\n  };\n}\n/**\n * Assume `labelLayoutList` has no `label.ignore: true`.\n * Assume `labelLayoutList` have been sorted by value ascending order.\n */\nfunction fixMinMaxLabelShow(axisModel, labelLayoutList, optionHideOverlap) {\n  if (shouldShowAllLabels(axisModel.axis)) {\n    return;\n  }\n  // FIXME\n  // Have not consider onBand yet, where tick els is more than label els.\n  // Assert no ignore in labels.\n  function deal(showMinMaxLabel, outmostLabelIdx, innerLabelIdx) {\n    var outmostLabelLayout = ensureLabelLayoutWithGeometry(labelLayoutList[outmostLabelIdx]);\n    var innerLabelLayout = ensureLabelLayoutWithGeometry(labelLayoutList[innerLabelIdx]);\n    if (!outmostLabelLayout || !innerLabelLayout) {\n      return;\n    }\n    if (showMinMaxLabel === false || outmostLabelLayout.suggestIgnore) {\n      ignoreEl(outmostLabelLayout.label);\n      return;\n    }\n    if (innerLabelLayout.suggestIgnore) {\n      ignoreEl(innerLabelLayout.label);\n      return;\n    }\n    // PENDING: Originally we thought `optionHideOverlap === false` means do not hide anything,\n    //  since currently the bounding rect of text might not accurate enough and might slightly bigger,\n    //  which causes false positive. But `optionHideOverlap: null/undfined` is falsy and likely\n    //  be treated as false.\n    // In most fonts the glyph does not reach the boundary of the bounding rect.\n    // This is needed to avoid too aggressive to hide two elements that meet at the edge\n    // due to compact layout by the same bounding rect or OBB.\n    var touchThreshold = 0.1;\n    // This treatment is for backward compatibility. And `!optionHideOverlap` implies that\n    // the user accepts the visual touch between adjacent labels, thus \"hide min/max label\"\n    // should be conservative, since the space might be sufficient in this case.\n    if (!optionHideOverlap) {\n      var marginForce = [0, 0, 0, 0];\n      // Make a copy to apply `ignoreMargin`.\n      outmostLabelLayout = newLabelLayoutWithGeometry({\n        marginForce: marginForce\n      }, outmostLabelLayout);\n      innerLabelLayout = newLabelLayoutWithGeometry({\n        marginForce: marginForce\n      }, innerLabelLayout);\n    }\n    if (labelIntersect(outmostLabelLayout, innerLabelLayout, null, {\n      touchThreshold: touchThreshold\n    })) {\n      if (showMinMaxLabel) {\n        ignoreEl(innerLabelLayout.label);\n      } else {\n        ignoreEl(outmostLabelLayout.label);\n      }\n    }\n  }\n  // If min or max are user set, we need to check\n  // If the tick on min(max) are overlap on their neighbour tick\n  // If they are overlapped, we need to hide the min(max) tick label\n  var showMinLabel = axisModel.get(['axisLabel', 'showMinLabel']);\n  var showMaxLabel = axisModel.get(['axisLabel', 'showMaxLabel']);\n  var labelsLen = labelLayoutList.length;\n  deal(showMinLabel, 0, 1);\n  deal(showMaxLabel, labelsLen - 1, labelsLen - 2);\n}\n// PENDING: Is it necessary to display a tick while the corresponding label is ignored?\nfunction syncLabelIgnoreToMajorTicks(cfg, labelLayoutList, tickEls) {\n  if (cfg.showMinorTicks) {\n    // It probably unreaasonable to hide major ticks when show minor ticks.\n    return;\n  }\n  each(labelLayoutList, function (labelLayout) {\n    if (labelLayout && labelLayout.label.ignore) {\n      for (var idx = 0; idx < tickEls.length; idx++) {\n        var tickEl = tickEls[idx];\n        // Assume small array, linear search is fine for performance.\n        // PENDING: measure?\n        var tickInner = getTickInner(tickEl);\n        var labelInner = getLabelInner(labelLayout.label);\n        if (tickInner.tickValue != null && !tickInner.onBand && tickInner.tickValue === labelInner.tickValue) {\n          ignoreEl(tickEl);\n          return;\n        }\n      }\n    }\n  });\n}\nfunction ignoreEl(el) {\n  el && (el.ignore = true);\n}\nfunction createTicks(ticksCoords, tickTransform, tickEndCoord, tickLineStyle, anidPrefix) {\n  var tickEls = [];\n  var pt1 = [];\n  var pt2 = [];\n  for (var i = 0; i < ticksCoords.length; i++) {\n    var tickCoord = ticksCoords[i].coord;\n    pt1[0] = tickCoord;\n    pt1[1] = 0;\n    pt2[0] = tickCoord;\n    pt2[1] = tickEndCoord;\n    if (tickTransform) {\n      v2ApplyTransform(pt1, pt1, tickTransform);\n      v2ApplyTransform(pt2, pt2, tickTransform);\n    }\n    // Tick line, Not use group transform to have better line draw\n    var tickEl = new graphic.Line({\n      shape: {\n        x1: pt1[0],\n        y1: pt1[1],\n        x2: pt2[0],\n        y2: pt2[1]\n      },\n      style: tickLineStyle,\n      z2: 2,\n      autoBatch: true,\n      silent: true\n    });\n    graphic.subPixelOptimizeLine(tickEl.shape, tickEl.style.lineWidth);\n    tickEl.anid = anidPrefix + '_' + ticksCoords[i].tickValue;\n    tickEls.push(tickEl);\n    var inner = getTickInner(tickEl);\n    inner.onBand = !!ticksCoords[i].onBand;\n    inner.tickValue = ticksCoords[i].tickValue;\n  }\n  return tickEls;\n}\nfunction buildAxisMajorTicks(cfg, group, transformGroup, axisModel) {\n  var axis = axisModel.axis;\n  var tickModel = axisModel.getModel('axisTick');\n  var shown = tickModel.get('show');\n  if (shown === 'auto') {\n    shown = true;\n    if (cfg.raw.axisTickAutoShow != null) {\n      shown = !!cfg.raw.axisTickAutoShow;\n    }\n  }\n  if (!shown || axis.scale.isBlank()) {\n    return [];\n  }\n  var lineStyleModel = tickModel.getModel('lineStyle');\n  var tickEndCoord = cfg.tickDirection * tickModel.get('length');\n  var ticksCoords = axis.getTicksCoords();\n  var ticksEls = createTicks(ticksCoords, transformGroup.transform, tickEndCoord, defaults(lineStyleModel.getLineStyle(), {\n    stroke: axisModel.get(['axisLine', 'lineStyle', 'color'])\n  }), 'ticks');\n  for (var i = 0; i < ticksEls.length; i++) {\n    group.add(ticksEls[i]);\n  }\n  return ticksEls;\n}\nfunction buildAxisMinorTicks(cfg, group, transformGroup, axisModel, tickDirection) {\n  var axis = axisModel.axis;\n  var minorTickModel = axisModel.getModel('minorTick');\n  if (!cfg.showMinorTicks || axis.scale.isBlank()) {\n    return;\n  }\n  var minorTicksCoords = axis.getMinorTicksCoords();\n  if (!minorTicksCoords.length) {\n    return;\n  }\n  var lineStyleModel = minorTickModel.getModel('lineStyle');\n  var tickEndCoord = tickDirection * minorTickModel.get('length');\n  var minorTickLineStyle = defaults(lineStyleModel.getLineStyle(), defaults(axisModel.getModel('axisTick').getLineStyle(), {\n    stroke: axisModel.get(['axisLine', 'lineStyle', 'color'])\n  }));\n  for (var i = 0; i < minorTicksCoords.length; i++) {\n    var minorTicksEls = createTicks(minorTicksCoords[i], transformGroup.transform, tickEndCoord, minorTickLineStyle, 'minorticks_' + i);\n    for (var k = 0; k < minorTicksEls.length; k++) {\n      group.add(minorTicksEls[k]);\n    }\n  }\n}\n// Return whether need to call `layOutAxisTickLabel` again.\nfunction dealLastTickLabelResultReusable(local, group, extraParams) {\n  if (axisLabelBuildResultExists(local)) {\n    var axisLabelsCreationContext = local.axisLabelsCreationContext;\n    if (process.env.NODE_ENV !== 'production') {\n      assert(local.labelGroup && axisLabelsCreationContext);\n    }\n    var noPxChangeTryDetermine = axisLabelsCreationContext.out.noPxChangeTryDetermine;\n    if (extraParams.noPxChange) {\n      var canDetermine = true;\n      for (var idx = 0; idx < noPxChangeTryDetermine.length; idx++) {\n        canDetermine = canDetermine && noPxChangeTryDetermine[idx]();\n      }\n      if (canDetermine) {\n        return false;\n      }\n    }\n    if (noPxChangeTryDetermine.length) {\n      // Remove the result of `buildAxisLabel`\n      group.remove(local.labelGroup);\n      axisLabelBuildResultSet(local, null, null, null);\n    }\n  }\n  return true;\n}\nfunction buildAxisLabel(cfg, local, group, kind, axisModel, api) {\n  var axis = axisModel.axis;\n  var show = retrieve(cfg.raw.axisLabelShow, axisModel.get(['axisLabel', 'show']));\n  var labelGroup = new graphic.Group();\n  group.add(labelGroup);\n  var axisLabelCreationCtx = createAxisLabelsComputingContext(kind);\n  if (!show || axis.scale.isBlank()) {\n    axisLabelBuildResultSet(local, [], labelGroup, axisLabelCreationCtx);\n    return;\n  }\n  var labelModel = axisModel.getModel('axisLabel');\n  var labels = axis.getViewLabels(axisLabelCreationCtx);\n  // Special label rotate.\n  var labelRotation = (retrieve(cfg.raw.labelRotate, labelModel.get('rotate')) || 0) * PI / 180;\n  var labelLayout = AxisBuilder.innerTextLayout(cfg.rotation, labelRotation, cfg.labelDirection);\n  var rawCategoryData = axisModel.getCategories && axisModel.getCategories(true);\n  var labelEls = [];\n  var triggerEvent = axisModel.get('triggerEvent');\n  var z2Min = Infinity;\n  var z2Max = -Infinity;\n  each(labels, function (labelItem, index) {\n    var _a;\n    var tickValue = axis.scale.type === 'ordinal' ? axis.scale.getRawOrdinalNumber(labelItem.tickValue) : labelItem.tickValue;\n    var formattedLabel = labelItem.formattedLabel;\n    var rawLabel = labelItem.rawLabel;\n    var itemLabelModel = labelModel;\n    if (rawCategoryData && rawCategoryData[tickValue]) {\n      var rawCategoryItem = rawCategoryData[tickValue];\n      if (isObject(rawCategoryItem) && rawCategoryItem.textStyle) {\n        itemLabelModel = new Model(rawCategoryItem.textStyle, labelModel, axisModel.ecModel);\n      }\n    }\n    var textColor = itemLabelModel.getTextColor() || axisModel.get(['axisLine', 'lineStyle', 'color']);\n    var align = itemLabelModel.getShallow('align', true) || labelLayout.textAlign;\n    var alignMin = retrieve2(itemLabelModel.getShallow('alignMinLabel', true), align);\n    var alignMax = retrieve2(itemLabelModel.getShallow('alignMaxLabel', true), align);\n    var verticalAlign = itemLabelModel.getShallow('verticalAlign', true) || itemLabelModel.getShallow('baseline', true) || labelLayout.textVerticalAlign;\n    var verticalAlignMin = retrieve2(itemLabelModel.getShallow('verticalAlignMinLabel', true), verticalAlign);\n    var verticalAlignMax = retrieve2(itemLabelModel.getShallow('verticalAlignMaxLabel', true), verticalAlign);\n    var z2 = 10 + (((_a = labelItem.time) === null || _a === void 0 ? void 0 : _a.level) || 0);\n    z2Min = Math.min(z2Min, z2);\n    z2Max = Math.max(z2Max, z2);\n    var textEl = new graphic.Text({\n      // --- transform props start ---\n      // All of the transform props MUST not be set here, but should be set in\n      // `updateAxisLabelChangableProps`, because they may change in estimation,\n      // and need to calculate based on global coord sys by `decomposeTransform`.\n      x: 0,\n      y: 0,\n      rotation: 0,\n      // --- transform props end ---\n      silent: AxisBuilder.isLabelSilent(axisModel),\n      z2: z2,\n      style: createTextStyle(itemLabelModel, {\n        text: formattedLabel,\n        align: index === 0 ? alignMin : index === labels.length - 1 ? alignMax : align,\n        verticalAlign: index === 0 ? verticalAlignMin : index === labels.length - 1 ? verticalAlignMax : verticalAlign,\n        fill: isFunction(textColor) ? textColor(\n        // (1) In category axis with data zoom, tick is not the original\n        // index of axis.data. So tick should not be exposed to user\n        // in category axis.\n        // (2) Compatible with previous version, which always use formatted label as\n        // input. But in interval scale the formatted label is like '223,445', which\n        // maked user replace ','. So we modify it to return original val but remain\n        // it as 'string' to avoid error in replacing.\n        axis.type === 'category' ? rawLabel : axis.type === 'value' ? tickValue + '' : tickValue, index) : textColor\n      })\n    });\n    textEl.anid = 'label_' + tickValue;\n    var inner = getLabelInner(textEl);\n    inner[\"break\"] = labelItem[\"break\"];\n    inner.tickValue = tickValue;\n    inner.layoutRotation = labelLayout.rotation;\n    graphic.setTooltipConfig({\n      el: textEl,\n      componentModel: axisModel,\n      itemName: formattedLabel,\n      formatterParamsExtra: {\n        isTruncated: function () {\n          return textEl.isTruncated;\n        },\n        value: rawLabel,\n        tickIndex: index\n      }\n    });\n    // Pack data for mouse event\n    if (triggerEvent) {\n      var eventData = AxisBuilder.makeAxisEventDataBase(axisModel);\n      eventData.targetType = 'axisLabel';\n      eventData.value = rawLabel;\n      eventData.tickIndex = index;\n      if (labelItem[\"break\"]) {\n        eventData[\"break\"] = {\n          // type: labelItem.break.type,\n          start: labelItem[\"break\"].parsedBreak.vmin,\n          end: labelItem[\"break\"].parsedBreak.vmax\n        };\n      }\n      if (axis.type === 'category') {\n        eventData.dataIndex = tickValue;\n      }\n      getECData(textEl).eventData = eventData;\n      if (labelItem[\"break\"]) {\n        addBreakEventHandler(axisModel, api, textEl, labelItem[\"break\"]);\n      }\n    }\n    labelEls.push(textEl);\n    labelGroup.add(textEl);\n  });\n  var labelLayoutList = map(labelEls, function (label) {\n    return {\n      label: label,\n      priority: getLabelInner(label)[\"break\"] ? label.z2 + (z2Max - z2Min + 1) // Make break labels be highest priority.\n      : label.z2,\n      defaultAttr: {\n        ignore: label.ignore\n      }\n    };\n  });\n  axisLabelBuildResultSet(local, labelLayoutList, labelGroup, axisLabelCreationCtx);\n}\n// Indicate that `layOutAxisTickLabel` has been called.\nfunction axisLabelBuildResultExists(local) {\n  return !!local.labelLayoutList;\n}\nfunction axisLabelBuildResultSet(local, labelLayoutList, labelGroup, axisLabelsCreationContext) {\n  // Ensure the same lifetime.\n  local.labelLayoutList = labelLayoutList;\n  local.labelGroup = labelGroup;\n  local.axisLabelsCreationContext = axisLabelsCreationContext;\n}\nfunction updateAxisLabelChangableProps(cfg, axisModel, labelLayoutList, transformGroup) {\n  var labelMargin = axisModel.get(['axisLabel', 'margin']);\n  each(labelLayoutList, function (layout, idx) {\n    var geometry = ensureLabelLayoutWithGeometry(layout);\n    if (!geometry) {\n      return;\n    }\n    var labelEl = geometry.label;\n    var inner = getLabelInner(labelEl);\n    // See the comment in `suggestIgnore`.\n    geometry.suggestIgnore = labelEl.ignore;\n    // Currently no `ignore:true` is set in `buildAxisLabel`\n    // But `ignore:true` may be set subsequently for overlap handling, thus reset it here.\n    labelEl.ignore = false;\n    copyTransform(_tmpLayoutEl, _tmpLayoutElReset);\n    _tmpLayoutEl.x = axisModel.axis.dataToCoord(inner.tickValue);\n    _tmpLayoutEl.y = cfg.labelOffset + cfg.labelDirection * labelMargin;\n    _tmpLayoutEl.rotation = inner.layoutRotation;\n    transformGroup.add(_tmpLayoutEl);\n    _tmpLayoutEl.updateTransform();\n    transformGroup.remove(_tmpLayoutEl);\n    _tmpLayoutEl.decomposeTransform();\n    copyTransform(labelEl, _tmpLayoutEl);\n    labelEl.markRedraw();\n    setLabelLayoutDirty(geometry, true);\n    ensureLabelLayoutWithGeometry(geometry);\n  });\n}\nvar _tmpLayoutEl = new graphic.Rect();\nvar _tmpLayoutElReset = new graphic.Rect();\nfunction hasAxisName(axisName) {\n  return !!axisName;\n}\nfunction addBreakEventHandler(axisModel, api, textEl, visualBreak) {\n  textEl.on('click', function (params) {\n    var payload = {\n      type: AXIS_BREAK_EXPAND_ACTION_TYPE,\n      breaks: [{\n        start: visualBreak.parsedBreak.breakOption.start,\n        end: visualBreak.parsedBreak.breakOption.end\n      }]\n    };\n    payload[axisModel.axis.dim + \"AxisIndex\"] = axisModel.componentIndex;\n    api.dispatchAction(payload);\n  });\n}\nfunction adjustBreakLabels(axisModel, axisRotation, labelLayoutList) {\n  var scaleBreakHelper = getScaleBreakHelper();\n  if (!scaleBreakHelper) {\n    return;\n  }\n  var breakLabelIndexPairs = scaleBreakHelper.retrieveAxisBreakPairs(labelLayoutList, function (layoutInfo) {\n    return layoutInfo && getLabelInner(layoutInfo.label)[\"break\"];\n  }, true);\n  var moveOverlap = axisModel.get(['breakLabelLayout', 'moveOverlap'], true);\n  if (moveOverlap === true || moveOverlap === 'auto') {\n    each(breakLabelIndexPairs, function (idxPair) {\n      getAxisBreakHelper().adjustBreakLabelPair(axisModel.axis.inverse, axisRotation, [ensureLabelLayoutWithGeometry(labelLayoutList[idxPair[0]]), ensureLabelLayoutWithGeometry(labelLayoutList[idxPair[1]])]);\n    });\n  }\n}\nexport default AxisBuilder;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { SINGLE_REFERRING } from '../../util/model.js';\nimport AxisBuilder from '../../component/axis/AxisBuilder.js';\nimport { isIntervalOrLogScale } from '../../scale/helper.js';\n/**\n * [__CAUTION__]\n *  MUST guarantee: if only the input `rect` and `axis.extent` changed,\n *  only `layout.position` changes.\n *  This character is replied on `grid.contain` calculation in `AxisBuilder`.\n *  @see updateCartesianAxisViewCommonPartBuilder\n *\n * Can only be called after coordinate system creation stage.\n * (Can be called before coordinate system update stage).\n */\nexport function layout(rect, axisModel, opt) {\n  opt = opt || {};\n  var axis = axisModel.axis;\n  var layout = {};\n  var otherAxisOnZeroOf = axis.getAxesOnZeroOf()[0];\n  var rawAxisPosition = axis.position;\n  var axisPosition = otherAxisOnZeroOf ? 'onZero' : rawAxisPosition;\n  var axisDim = axis.dim;\n  var rectBound = [rect.x, rect.x + rect.width, rect.y, rect.y + rect.height];\n  var idx = {\n    left: 0,\n    right: 1,\n    top: 0,\n    bottom: 1,\n    onZero: 2\n  };\n  var axisOffset = axisModel.get('offset') || 0;\n  var posBound = axisDim === 'x' ? [rectBound[2] - axisOffset, rectBound[3] + axisOffset] : [rectBound[0] - axisOffset, rectBound[1] + axisOffset];\n  if (otherAxisOnZeroOf) {\n    var onZeroCoord = otherAxisOnZeroOf.toGlobalCoord(otherAxisOnZeroOf.dataToCoord(0));\n    posBound[idx.onZero] = Math.max(Math.min(onZeroCoord, posBound[1]), posBound[0]);\n  }\n  // Axis position\n  layout.position = [axisDim === 'y' ? posBound[idx[axisPosition]] : rectBound[0], axisDim === 'x' ? posBound[idx[axisPosition]] : rectBound[3]];\n  // Axis rotation\n  layout.rotation = Math.PI / 2 * (axisDim === 'x' ? 0 : 1);\n  // Tick and label direction, x y is axisDim\n  var dirMap = {\n    top: -1,\n    bottom: 1,\n    left: -1,\n    right: 1\n  };\n  layout.labelDirection = layout.tickDirection = layout.nameDirection = dirMap[rawAxisPosition];\n  layout.labelOffset = otherAxisOnZeroOf ? posBound[idx[rawAxisPosition]] - posBound[idx.onZero] : 0;\n  if (axisModel.get(['axisTick', 'inside'])) {\n    layout.tickDirection = -layout.tickDirection;\n  }\n  if (zrUtil.retrieve(opt.labelInside, axisModel.get(['axisLabel', 'inside']))) {\n    layout.labelDirection = -layout.labelDirection;\n  }\n  // Special label rotation\n  var labelRotate = axisModel.get(['axisLabel', 'rotate']);\n  layout.labelRotate = axisPosition === 'top' ? -labelRotate : labelRotate;\n  // Over splitLine and splitArea\n  layout.z2 = 1;\n  return layout;\n}\nexport function isCartesian2DDeclaredSeries(seriesModel) {\n  return seriesModel.get('coordinateSystem') === 'cartesian2d';\n}\n/**\n * Note: If pie (or other similar series) use cartesian2d, here\n *  option `seriesModel.get('coordinateSystem') === 'cartesian2d'`\n *  and `seriesModel.coordinateSystem !== cartesian2dCoordSysInstance`\n *  and `seriesModel.boxCoordinateSystem === cartesian2dCoordSysInstance`,\n *  the logic below is probably wrong, therefore skip it temporarily.\n */\nexport function isCartesian2DInjectedAsDataCoordSys(seriesModel) {\n  return seriesModel.coordinateSystem && seriesModel.coordinateSystem.type === 'cartesian2d';\n}\nexport function findAxisModels(seriesModel) {\n  var axisModelMap = {\n    xAxisModel: null,\n    yAxisModel: null\n  };\n  zrUtil.each(axisModelMap, function (v, key) {\n    var axisType = key.replace(/Model$/, '');\n    var axisModel = seriesModel.getReferringComponents(axisType, SINGLE_REFERRING).models[0];\n    if (process.env.NODE_ENV !== 'production') {\n      if (!axisModel) {\n        throw new Error(axisType + ' \"' + zrUtil.retrieve3(seriesModel.get(axisType + 'Index'), seriesModel.get(axisType + 'Id'), 0) + '\" not found');\n      }\n    }\n    axisModelMap[key] = axisModel;\n  });\n  return axisModelMap;\n}\nexport function createCartesianAxisViewCommonPartBuilder(gridRect, cartesians, axisModel, api, ctx, defaultNameMoveOverlap) {\n  var layoutResult = layout(gridRect, axisModel);\n  var axisLineAutoShow = false;\n  var axisTickAutoShow = false;\n  // Not show axisTick or axisLine if other axis is category / time\n  for (var i = 0; i < cartesians.length; i++) {\n    if (isIntervalOrLogScale(cartesians[i].getOtherAxis(axisModel.axis).scale)) {\n      // Still show axis tick or axisLine if other axis is value / log\n      axisLineAutoShow = axisTickAutoShow = true;\n      if (axisModel.axis.type === 'category' && axisModel.axis.onBand) {\n        axisTickAutoShow = false;\n      }\n    }\n  }\n  layoutResult.axisLineAutoShow = axisLineAutoShow;\n  layoutResult.axisTickAutoShow = axisTickAutoShow;\n  layoutResult.defaultNameMoveOverlap = defaultNameMoveOverlap;\n  return new AxisBuilder(axisModel, api, layoutResult, ctx);\n}\nexport function updateCartesianAxisViewCommonPartBuilder(axisBuilder, gridRect, axisModel) {\n  var newRaw = layout(gridRect, axisModel);\n  if (process.env.NODE_ENV !== 'production') {\n    var oldRaw_1 = axisBuilder.__getRawCfg();\n    zrUtil.each(zrUtil.keys(newRaw), function (prop) {\n      if (prop !== 'position' && prop !== 'labelOffset') {\n        zrUtil.assert(newRaw[prop] === oldRaw_1[prop]);\n      }\n    });\n  }\n  axisBuilder.updateCfg(newRaw);\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { getPrecisionSafe, round } from '../util/number.js';\nimport IntervalScale from '../scale/Interval.js';\nimport { getScaleExtent, retrieveAxisBreaksOption } from './axisHelper.js';\nimport { warn } from '../util/log.js';\nimport { logTransform, increaseInterval, isValueNice } from '../scale/helper.js';\nexport function alignScaleTicks(scale, axisModel, alignToScale) {\n  var _a;\n  var intervalScaleProto = IntervalScale.prototype;\n  // NOTE: There is a precondition for log scale  here:\n  // In log scale we store _interval and _extent of exponent value.\n  // So if we use the method of InternalScale to set/get these data.\n  // It process the exponent value, which is linear and what we want here.\n  var alignToTicks = intervalScaleProto.getTicks.call(alignToScale);\n  var alignToNicedTicks = intervalScaleProto.getTicks.call(alignToScale, {\n    expandToNicedExtent: true\n  });\n  var alignToSplitNumber = alignToTicks.length - 1;\n  var alignToInterval = intervalScaleProto.getInterval.call(alignToScale);\n  var scaleExtent = getScaleExtent(scale, axisModel);\n  var rawExtent = scaleExtent.extent;\n  var isMinFixed = scaleExtent.fixMin;\n  var isMaxFixed = scaleExtent.fixMax;\n  if (scale.type === 'log') {\n    rawExtent = logTransform(scale.base, rawExtent, true);\n  }\n  scale.setBreaksFromOption(retrieveAxisBreaksOption(axisModel));\n  scale.setExtent(rawExtent[0], rawExtent[1]);\n  scale.calcNiceExtent({\n    splitNumber: alignToSplitNumber,\n    fixMin: isMinFixed,\n    fixMax: isMaxFixed\n  });\n  var extent = intervalScaleProto.getExtent.call(scale);\n  // Need to update the rawExtent.\n  // Because value in rawExtent may be not parsed. e.g. 'dataMin', 'dataMax'\n  if (isMinFixed) {\n    rawExtent[0] = extent[0];\n  }\n  if (isMaxFixed) {\n    rawExtent[1] = extent[1];\n  }\n  var interval = intervalScaleProto.getInterval.call(scale);\n  var min = rawExtent[0];\n  var max = rawExtent[1];\n  if (isMinFixed && isMaxFixed) {\n    // User set min, max, divide to get new interval\n    interval = (max - min) / alignToSplitNumber;\n  } else if (isMinFixed) {\n    max = rawExtent[0] + interval * alignToSplitNumber;\n    // User set min, expand extent on the other side\n    while (max < rawExtent[1] && isFinite(max) && isFinite(rawExtent[1])) {\n      interval = increaseInterval(interval);\n      max = rawExtent[0] + interval * alignToSplitNumber;\n    }\n  } else if (isMaxFixed) {\n    // User set max, expand extent on the other side\n    min = rawExtent[1] - interval * alignToSplitNumber;\n    while (min > rawExtent[0] && isFinite(min) && isFinite(rawExtent[0])) {\n      interval = increaseInterval(interval);\n      min = rawExtent[1] - interval * alignToSplitNumber;\n    }\n  } else {\n    var nicedSplitNumber = scale.getTicks().length - 1;\n    if (nicedSplitNumber > alignToSplitNumber) {\n      interval = increaseInterval(interval);\n    }\n    var range = interval * alignToSplitNumber;\n    max = Math.ceil(rawExtent[1] / interval) * interval;\n    min = round(max - range);\n    // Not change the result that crossing zero.\n    if (min < 0 && rawExtent[0] >= 0) {\n      min = 0;\n      max = round(range);\n    } else if (max > 0 && rawExtent[1] <= 0) {\n      max = 0;\n      min = -round(range);\n    }\n  }\n  // Adjust min, max based on the extent of alignTo. When min or max is set in alignTo scale\n  var t0 = (alignToTicks[0].value - alignToNicedTicks[0].value) / alignToInterval;\n  var t1 = (alignToTicks[alignToSplitNumber].value - alignToNicedTicks[alignToSplitNumber].value) / alignToInterval;\n  // NOTE: Must in setExtent -> setInterval -> setNiceExtent order.\n  intervalScaleProto.setExtent.call(scale, min + interval * t0, max + interval * t1);\n  intervalScaleProto.setInterval.call(scale, interval);\n  if (t0 || t1) {\n    intervalScaleProto.setNiceExtent.call(scale, min + interval, max - interval);\n  }\n  if (process.env.NODE_ENV !== 'production') {\n    var ticks = intervalScaleProto.getTicks.call(scale);\n    if (ticks[1] && (!isValueNice(interval) || getPrecisionSafe(ticks[1].value) > getPrecisionSafe(interval))) {\n      warn(\"The ticks may be not readable when set min: \" + axisModel.get('min') + \", max: \" + axisModel.get('max') + (\" and alignTicks: true. (\" + ((_a = axisModel.axis) === null || _a === void 0 ? void 0 : _a.dim) + \"AxisIndex: \" + axisModel.componentIndex + \")\"), true);\n    }\n  }\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n/**\n * Grid is a region which contains at most 4 cartesian systems\n *\n * TODO Default cartesian\n */\nimport { isObject, each, indexOf, retrieve3, keys, assert, eqNaN, find, retrieve2 } from 'zrender/lib/core/util.js';\nimport { createBoxLayoutReference, getLayoutRect } from '../../util/layout.js';\nimport { createScaleByModel, ifAxisCrossZero, niceScaleExtent, getDataDimensionsOnAxis, isNameLocationCenter, shouldAxisShow } from '../../coord/axisHelper.js';\nimport Cartesian2D, { cartesian2DDimensions } from './Cartesian2D.js';\nimport Axis2D from './Axis2D.js';\nimport { SINGLE_REFERRING } from '../../util/model.js';\n// Depends on GridModel, AxisModel, which performs preprocess.\nimport { OUTER_BOUNDS_CLAMP_DEFAULT, OUTER_BOUNDS_DEFAULT } from './GridModel.js';\nimport { findAxisModels, createCartesianAxisViewCommonPartBuilder, updateCartesianAxisViewCommonPartBuilder, isCartesian2DInjectedAsDataCoordSys } from './cartesianAxisHelper.js';\nimport { isIntervalOrLogScale } from '../../scale/helper.js';\nimport { alignScaleTicks } from '../axisAlignTicks.js';\nimport { expandOrShrinkRect, WH, XY } from '../../util/graphic.js';\nimport { AxisBuilderSharedContext, resolveAxisNameOverlapDefault, moveIfOverlapByLinearLabels, getLabelInner } from '../../component/axis/AxisBuilder.js';\nimport { error, log } from '../../util/log.js';\nimport { AxisTickLabelComputingKind } from '../axisTickLabelBuilder.js';\nimport { injectCoordSysByOption } from '../../core/CoordinateSystem.js';\nimport { mathMax, parsePositionSizeOption } from '../../util/number.js';\n// margin is [top, right, bottom, left]\nvar XY_TO_MARGIN_IDX = [[3, 1], [0, 2] // xyIdx 1 => 'y'\n];\nvar Grid = /** @class */function () {\n  function Grid(gridModel, ecModel, api) {\n    // FIXME:TS where used (different from registered type 'cartesian2d')?\n    this.type = 'grid';\n    this._coordsMap = {};\n    this._coordsList = [];\n    this._axesMap = {};\n    this._axesList = [];\n    this.axisPointerEnabled = true;\n    this.dimensions = cartesian2DDimensions;\n    this._initCartesian(gridModel, ecModel, api);\n    this.model = gridModel;\n  }\n  Grid.prototype.getRect = function () {\n    return this._rect;\n  };\n  Grid.prototype.update = function (ecModel, api) {\n    var axesMap = this._axesMap;\n    this._updateScale(ecModel, this.model);\n    function updateAxisTicks(axes) {\n      var alignTo;\n      // Axis is added in order of axisIndex.\n      var axesIndices = keys(axes);\n      var len = axesIndices.length;\n      if (!len) {\n        return;\n      }\n      var axisNeedsAlign = [];\n      // Process once and calculate the ticks for those don't use alignTicks.\n      for (var i = len - 1; i >= 0; i--) {\n        var idx = +axesIndices[i]; // Convert to number.\n        var axis = axes[idx];\n        var model = axis.model;\n        var scale = axis.scale;\n        if (\n        // Only value and log axis without interval support alignTicks.\n        isIntervalOrLogScale(scale) && model.get('alignTicks') && model.get('interval') == null) {\n          axisNeedsAlign.push(axis);\n        } else {\n          niceScaleExtent(scale, model);\n          if (isIntervalOrLogScale(scale)) {\n            // Can only align to interval or log axis.\n            alignTo = axis;\n          }\n        }\n      }\n      ;\n      // All axes has set alignTicks. Pick the first one.\n      // PENDING. Should we find the axis that both set interval, min, max and align to this one?\n      if (axisNeedsAlign.length) {\n        if (!alignTo) {\n          alignTo = axisNeedsAlign.pop();\n          niceScaleExtent(alignTo.scale, alignTo.model);\n        }\n        each(axisNeedsAlign, function (axis) {\n          alignScaleTicks(axis.scale, axis.model, alignTo.scale);\n        });\n      }\n    }\n    updateAxisTicks(axesMap.x);\n    updateAxisTicks(axesMap.y);\n    // Key: axisDim_axisIndex, value: boolean, whether onZero target.\n    var onZeroRecords = {};\n    each(axesMap.x, function (xAxis) {\n      fixAxisOnZero(axesMap, 'y', xAxis, onZeroRecords);\n    });\n    each(axesMap.y, function (yAxis) {\n      fixAxisOnZero(axesMap, 'x', yAxis, onZeroRecords);\n    });\n    // Resize again if containLabel is enabled\n    // FIXME It may cause getting wrong grid size in data processing stage\n    this.resize(this.model, api);\n  };\n  /**\n   * Resize the grid.\n   *\n   * [NOTE]\n   * If both \"grid.containLabel/grid.contain\" and pixel-required-data-processing (such as, \"dataSampling\")\n   * exist, circular dependency occurs in logic.\n   * The final compromised sequence is:\n   *  1. Calculate \"axis.extent\" (pixel extent) and AffineTransform based on only \"grid layout options\".\n   *      Not accurate if \"grid.containLabel/grid.contain\" is required, but it is a compromise to avoid\n   *      circular dependency.\n   *  2. Perform \"series data processing\" (where \"dataSampling\" requires \"axis.extent\").\n   *  3. Calculate \"scale.extent\" (data extent) based on \"processed series data\".\n   *  4. Modify \"axis.extent\" for \"grid.containLabel/grid.contain\":\n   *      4.1. Calculate \"axis labels\" based on \"scale.extent\".\n   *      4.2. Modify \"axis.extent\" by the bounding rects of \"axis labels and names\".\n   */\n  Grid.prototype.resize = function (gridModel, api, beforeDataProcessing) {\n    var layoutRef = createBoxLayoutReference(gridModel, api);\n    var gridRect = this._rect = getLayoutRect(gridModel.getBoxLayoutParams(), layoutRef.refContainer);\n    // PENDING: whether to support that if the input `coord` is out of the base coord sys,\n    //  do not render anything. At present, the behavior is undefined.\n    var axesMap = this._axesMap;\n    var coordsList = this._coordsList;\n    var optionContainLabel = gridModel.get('containLabel'); // No `.get(, true)` for backward compat.\n    updateAllAxisExtentTransByGridRect(axesMap, gridRect);\n    if (!beforeDataProcessing) {\n      var axisBuilderSharedCtx = createAxisBiulders(gridRect, coordsList, axesMap, optionContainLabel, api);\n      var noPxChange = void 0;\n      if (optionContainLabel) {\n        if (legacyLayOutGridByContainLabel) {\n          // console.time('legacyLayOutGridByContainLabel');\n          legacyLayOutGridByContainLabel(this._axesList, gridRect);\n          updateAllAxisExtentTransByGridRect(axesMap, gridRect);\n          // console.timeEnd('legacyLayOutGridByContainLabel');\n        } else {\n          if (process.env.NODE_ENV !== 'production') {\n            log('Specified `grid.containLabel` but no `use(LegacyGridContainLabel)`;' + 'use `grid.outerBounds` instead.', true);\n          }\n          noPxChange = layOutGridByOuterBounds(gridRect.clone(), 'axisLabel', null, gridRect, axesMap, axisBuilderSharedCtx, layoutRef);\n        }\n      } else {\n        var _a = prepareOuterBounds(gridModel, gridRect, layoutRef),\n          outerBoundsRect = _a.outerBoundsRect,\n          parsedOuterBoundsContain = _a.parsedOuterBoundsContain,\n          outerBoundsClamp = _a.outerBoundsClamp;\n        if (outerBoundsRect) {\n          // console.time('layOutGridByOuterBounds');\n          noPxChange = layOutGridByOuterBounds(outerBoundsRect, parsedOuterBoundsContain, outerBoundsClamp, gridRect, axesMap, axisBuilderSharedCtx, layoutRef);\n          // console.timeEnd('layOutGridByOuterBounds');\n        }\n      }\n      // console.time('buildAxesView_determine');\n      createOrUpdateAxesView(gridRect, axesMap, AxisTickLabelComputingKind.determine, null, noPxChange, layoutRef);\n      // console.timeEnd('buildAxesView_determine');\n    } // End of beforeDataProcessing\n    each(this._coordsList, function (coord) {\n      // Calculate affine matrix to accelerate the data to point transform.\n      // If all the axes scales are time or value.\n      coord.calcAffineTransform();\n    });\n  };\n  Grid.prototype.getAxis = function (dim, axisIndex) {\n    var axesMapOnDim = this._axesMap[dim];\n    if (axesMapOnDim != null) {\n      return axesMapOnDim[axisIndex || 0];\n    }\n  };\n  Grid.prototype.getAxes = function () {\n    return this._axesList.slice();\n  };\n  Grid.prototype.getCartesian = function (xAxisIndex, yAxisIndex) {\n    if (xAxisIndex != null && yAxisIndex != null) {\n      var key = 'x' + xAxisIndex + 'y' + yAxisIndex;\n      return this._coordsMap[key];\n    }\n    if (isObject(xAxisIndex)) {\n      yAxisIndex = xAxisIndex.yAxisIndex;\n      xAxisIndex = xAxisIndex.xAxisIndex;\n    }\n    for (var i = 0, coordList = this._coordsList; i < coordList.length; i++) {\n      if (coordList[i].getAxis('x').index === xAxisIndex || coordList[i].getAxis('y').index === yAxisIndex) {\n        return coordList[i];\n      }\n    }\n  };\n  Grid.prototype.getCartesians = function () {\n    return this._coordsList.slice();\n  };\n  /**\n   * @implements\n   */\n  Grid.prototype.convertToPixel = function (ecModel, finder, value) {\n    var target = this._findConvertTarget(finder);\n    return target.cartesian ? target.cartesian.dataToPoint(value) : target.axis ? target.axis.toGlobalCoord(target.axis.dataToCoord(value)) : null;\n  };\n  /**\n   * @implements\n   */\n  Grid.prototype.convertFromPixel = function (ecModel, finder, value) {\n    var target = this._findConvertTarget(finder);\n    return target.cartesian ? target.cartesian.pointToData(value) : target.axis ? target.axis.coordToData(target.axis.toLocalCoord(value)) : null;\n  };\n  Grid.prototype._findConvertTarget = function (finder) {\n    var seriesModel = finder.seriesModel;\n    var xAxisModel = finder.xAxisModel || seriesModel && seriesModel.getReferringComponents('xAxis', SINGLE_REFERRING).models[0];\n    var yAxisModel = finder.yAxisModel || seriesModel && seriesModel.getReferringComponents('yAxis', SINGLE_REFERRING).models[0];\n    var gridModel = finder.gridModel;\n    var coordsList = this._coordsList;\n    var cartesian;\n    var axis;\n    if (seriesModel) {\n      cartesian = seriesModel.coordinateSystem;\n      indexOf(coordsList, cartesian) < 0 && (cartesian = null);\n    } else if (xAxisModel && yAxisModel) {\n      cartesian = this.getCartesian(xAxisModel.componentIndex, yAxisModel.componentIndex);\n    } else if (xAxisModel) {\n      axis = this.getAxis('x', xAxisModel.componentIndex);\n    } else if (yAxisModel) {\n      axis = this.getAxis('y', yAxisModel.componentIndex);\n    }\n    // Lowest priority.\n    else if (gridModel) {\n      var grid = gridModel.coordinateSystem;\n      if (grid === this) {\n        cartesian = this._coordsList[0];\n      }\n    }\n    return {\n      cartesian: cartesian,\n      axis: axis\n    };\n  };\n  /**\n   * @implements\n   */\n  Grid.prototype.containPoint = function (point) {\n    var coord = this._coordsList[0];\n    if (coord) {\n      return coord.containPoint(point);\n    }\n  };\n  /**\n   * Initialize cartesian coordinate systems\n   */\n  Grid.prototype._initCartesian = function (gridModel, ecModel, api) {\n    var _this = this;\n    var grid = this;\n    var axisPositionUsed = {\n      left: false,\n      right: false,\n      top: false,\n      bottom: false\n    };\n    var axesMap = {\n      x: {},\n      y: {}\n    };\n    var axesCount = {\n      x: 0,\n      y: 0\n    };\n    // Create axis\n    ecModel.eachComponent('xAxis', createAxisCreator('x'), this);\n    ecModel.eachComponent('yAxis', createAxisCreator('y'), this);\n    if (!axesCount.x || !axesCount.y) {\n      // Roll back when there no either x or y axis\n      this._axesMap = {};\n      this._axesList = [];\n      return;\n    }\n    this._axesMap = axesMap;\n    // Create cartesian2d\n    each(axesMap.x, function (xAxis, xAxisIndex) {\n      each(axesMap.y, function (yAxis, yAxisIndex) {\n        var key = 'x' + xAxisIndex + 'y' + yAxisIndex;\n        var cartesian = new Cartesian2D(key);\n        cartesian.master = _this;\n        cartesian.model = gridModel;\n        _this._coordsMap[key] = cartesian;\n        _this._coordsList.push(cartesian);\n        cartesian.addAxis(xAxis);\n        cartesian.addAxis(yAxis);\n      });\n    });\n    function createAxisCreator(dimName) {\n      return function (axisModel, idx) {\n        if (!isAxisUsedInTheGrid(axisModel, gridModel)) {\n          return;\n        }\n        var axisPosition = axisModel.get('position');\n        if (dimName === 'x') {\n          // Fix position\n          if (axisPosition !== 'top' && axisPosition !== 'bottom') {\n            // Default bottom of X\n            axisPosition = axisPositionUsed.bottom ? 'top' : 'bottom';\n          }\n        } else {\n          // Fix position\n          if (axisPosition !== 'left' && axisPosition !== 'right') {\n            // Default left of Y\n            axisPosition = axisPositionUsed.left ? 'right' : 'left';\n          }\n        }\n        axisPositionUsed[axisPosition] = true;\n        var axis = new Axis2D(dimName, createScaleByModel(axisModel), [0, 0], axisModel.get('type'), axisPosition);\n        var isCategory = axis.type === 'category';\n        axis.onBand = isCategory && axisModel.get('boundaryGap');\n        axis.inverse = axisModel.get('inverse');\n        // Inject axis into axisModel\n        axisModel.axis = axis;\n        // Inject axisModel into axis\n        axis.model = axisModel;\n        // Inject grid info axis\n        axis.grid = grid;\n        // Index of axis, can be used as key\n        axis.index = idx;\n        grid._axesList.push(axis);\n        axesMap[dimName][idx] = axis;\n        axesCount[dimName]++;\n      };\n    }\n  };\n  /**\n   * Update cartesian properties from series.\n   */\n  Grid.prototype._updateScale = function (ecModel, gridModel) {\n    // Reset scale\n    each(this._axesList, function (axis) {\n      axis.scale.setExtent(Infinity, -Infinity);\n      if (axis.type === 'category') {\n        var categorySortInfo = axis.model.get('categorySortInfo');\n        axis.scale.setSortInfo(categorySortInfo);\n      }\n    });\n    ecModel.eachSeries(function (seriesModel) {\n      // If pie (or other similar series) use cartesian2d, the unionExtent logic below is\n      // wrong, therefore skip it temporarily. See also in `defaultAxisExtentFromData.ts`.\n      // TODO: support union extent in this case.\n      if (isCartesian2DInjectedAsDataCoordSys(seriesModel)) {\n        var axesModelMap = findAxisModels(seriesModel);\n        var xAxisModel = axesModelMap.xAxisModel;\n        var yAxisModel = axesModelMap.yAxisModel;\n        if (!isAxisUsedInTheGrid(xAxisModel, gridModel) || !isAxisUsedInTheGrid(yAxisModel, gridModel)) {\n          return;\n        }\n        var cartesian = this.getCartesian(xAxisModel.componentIndex, yAxisModel.componentIndex);\n        var data = seriesModel.getData();\n        var xAxis = cartesian.getAxis('x');\n        var yAxis = cartesian.getAxis('y');\n        unionExtent(data, xAxis);\n        unionExtent(data, yAxis);\n      }\n    }, this);\n    function unionExtent(data, axis) {\n      each(getDataDimensionsOnAxis(data, axis.dim), function (dim) {\n        axis.scale.unionExtentFromData(data, dim);\n      });\n    }\n  };\n  /**\n   * @param dim 'x' or 'y' or 'auto' or null/undefined\n   */\n  Grid.prototype.getTooltipAxes = function (dim) {\n    var baseAxes = [];\n    var otherAxes = [];\n    each(this.getCartesians(), function (cartesian) {\n      var baseAxis = dim != null && dim !== 'auto' ? cartesian.getAxis(dim) : cartesian.getBaseAxis();\n      var otherAxis = cartesian.getOtherAxis(baseAxis);\n      indexOf(baseAxes, baseAxis) < 0 && baseAxes.push(baseAxis);\n      indexOf(otherAxes, otherAxis) < 0 && otherAxes.push(otherAxis);\n    });\n    return {\n      baseAxes: baseAxes,\n      otherAxes: otherAxes\n    };\n  };\n  Grid.create = function (ecModel, api) {\n    var grids = [];\n    ecModel.eachComponent('grid', function (gridModel, idx) {\n      var grid = new Grid(gridModel, ecModel, api);\n      grid.name = 'grid_' + idx;\n      // dataSampling requires axis extent, so resize\n      // should be performed in create stage.\n      grid.resize(gridModel, api, true);\n      gridModel.coordinateSystem = grid;\n      grids.push(grid);\n    });\n    // Inject the coordinateSystems into seriesModel\n    ecModel.eachSeries(function (seriesModel) {\n      injectCoordSysByOption({\n        targetModel: seriesModel,\n        coordSysType: 'cartesian2d',\n        coordSysProvider: coordSysProvider\n      });\n      function coordSysProvider() {\n        var axesModelMap = findAxisModels(seriesModel);\n        var xAxisModel = axesModelMap.xAxisModel;\n        var yAxisModel = axesModelMap.yAxisModel;\n        var gridModel = xAxisModel.getCoordSysModel();\n        if (process.env.NODE_ENV !== 'production') {\n          if (!gridModel) {\n            throw new Error('Grid \"' + retrieve3(xAxisModel.get('gridIndex'), xAxisModel.get('gridId'), 0) + '\" not found');\n          }\n          if (xAxisModel.getCoordSysModel() !== yAxisModel.getCoordSysModel()) {\n            throw new Error('xAxis and yAxis must use the same grid');\n          }\n        }\n        var grid = gridModel.coordinateSystem;\n        return grid.getCartesian(xAxisModel.componentIndex, yAxisModel.componentIndex);\n      }\n    });\n    return grids;\n  };\n  // For deciding which dimensions to use when creating list data\n  Grid.dimensions = cartesian2DDimensions;\n  return Grid;\n}();\n/**\n * Check if the axis is used in the specified grid.\n */\nfunction isAxisUsedInTheGrid(axisModel, gridModel) {\n  return axisModel.getCoordSysModel() === gridModel;\n}\nfunction fixAxisOnZero(axesMap, otherAxisDim, axis,\n// Key: see `getOnZeroRecordKey`\nonZeroRecords) {\n  axis.getAxesOnZeroOf = function () {\n    // TODO: onZero of multiple axes.\n    return otherAxisOnZeroOf ? [otherAxisOnZeroOf] : [];\n  };\n  // onZero can not be enabled in these two situations:\n  // 1. When any other axis is a category axis.\n  // 2. When no axis is cross 0 point.\n  var otherAxes = axesMap[otherAxisDim];\n  var otherAxisOnZeroOf;\n  var axisModel = axis.model;\n  var onZero = axisModel.get(['axisLine', 'onZero']);\n  var onZeroAxisIndex = axisModel.get(['axisLine', 'onZeroAxisIndex']);\n  if (!onZero) {\n    return;\n  }\n  // If target axis is specified.\n  if (onZeroAxisIndex != null) {\n    if (canOnZeroToAxis(otherAxes[onZeroAxisIndex])) {\n      otherAxisOnZeroOf = otherAxes[onZeroAxisIndex];\n    }\n  } else {\n    // Find the first available other axis.\n    for (var idx in otherAxes) {\n      if (otherAxes.hasOwnProperty(idx) && canOnZeroToAxis(otherAxes[idx])\n      // Consider that two Y axes on one value axis,\n      // if both onZero, the two Y axes overlap.\n      && !onZeroRecords[getOnZeroRecordKey(otherAxes[idx])]) {\n        otherAxisOnZeroOf = otherAxes[idx];\n        break;\n      }\n    }\n  }\n  if (otherAxisOnZeroOf) {\n    onZeroRecords[getOnZeroRecordKey(otherAxisOnZeroOf)] = true;\n  }\n  function getOnZeroRecordKey(axis) {\n    return axis.dim + '_' + axis.index;\n  }\n}\nfunction canOnZeroToAxis(axis) {\n  return axis && axis.type !== 'category' && axis.type !== 'time' && ifAxisCrossZero(axis);\n}\nfunction updateAxisTransform(axis, coordBase) {\n  var axisExtent = axis.getExtent();\n  var axisExtentSum = axisExtent[0] + axisExtent[1];\n  // Fast transform\n  axis.toGlobalCoord = axis.dim === 'x' ? function (coord) {\n    return coord + coordBase;\n  } : function (coord) {\n    return axisExtentSum - coord + coordBase;\n  };\n  axis.toLocalCoord = axis.dim === 'x' ? function (coord) {\n    return coord - coordBase;\n  } : function (coord) {\n    return axisExtentSum - coord + coordBase;\n  };\n}\nfunction updateAllAxisExtentTransByGridRect(axesMap, gridRect) {\n  each(axesMap.x, function (axis) {\n    return updateAxisExtentTransByGridRect(axis, gridRect.x, gridRect.width);\n  });\n  each(axesMap.y, function (axis) {\n    return updateAxisExtentTransByGridRect(axis, gridRect.y, gridRect.height);\n  });\n}\nfunction updateAxisExtentTransByGridRect(axis, gridXY, gridWH) {\n  var extent = [0, gridWH];\n  var idx = axis.inverse ? 1 : 0;\n  axis.setExtent(extent[idx], extent[1 - idx]);\n  updateAxisTransform(axis, gridXY);\n}\nvar legacyLayOutGridByContainLabel;\nexport function registerLegacyGridContainLabelImpl(impl) {\n  legacyLayOutGridByContainLabel = impl;\n}\n// Return noPxChange.\nfunction layOutGridByOuterBounds(outerBoundsRect, outerBoundsContain, outerBoundsClamp, gridRect, axesMap, axisBuilderSharedCtx, layoutRef) {\n  if (process.env.NODE_ENV !== 'production') {\n    assert(outerBoundsContain === 'all' || outerBoundsContain === 'axisLabel');\n  }\n  // Assume `updateAllAxisExtentTransByGridRect` has been performed once before this call.\n  // [NOTE]:\n  // - The bounding rect of the axis elements might be sensitve to variations in `axis.extent` due to strategies\n  //  like hideOverlap/moveOverlap. @see the comment in `LabelLayoutBase['suggestIgnore']`.\n  // - The final `gridRect` might be slightly smaller than the ideally expected result if labels are giant and\n  //  get hidden due to overlapping. More iterations could improve precision, but not performant. We consider\n  //  the current result acceptable, since no alignment among charts can be guaranteed when using this feature.\n  createOrUpdateAxesView(gridRect, axesMap, AxisTickLabelComputingKind.estimate, outerBoundsContain, false, layoutRef);\n  var margin = [0, 0, 0, 0];\n  fillLabelNameOverflowOnOneDimension(0);\n  fillLabelNameOverflowOnOneDimension(1);\n  // If axis is blank, no label can be used to detect overflow.\n  // gridRect itself should not overflow.\n  fillMarginOnOneDimension(gridRect, 0, NaN);\n  fillMarginOnOneDimension(gridRect, 1, NaN);\n  var noPxChange = find(margin, function (item) {\n    return item > 0;\n  }) == null;\n  expandOrShrinkRect(gridRect, margin, true, true, outerBoundsClamp);\n  updateAllAxisExtentTransByGridRect(axesMap, gridRect);\n  return noPxChange;\n  function fillLabelNameOverflowOnOneDimension(xyIdx) {\n    each(axesMap[XY[xyIdx]], function (axis) {\n      if (!shouldAxisShow(axis.model)) {\n        return;\n      }\n      // FIXME: zr Group.union may wrongly union (0, 0, 0, 0) and not performant.\n      // unionRect.union(axis.axisBuilder.group.getBoundingRect());\n      // If ussing Group.getBoundingRect to calculate shrink space, it is not strictly accurate when\n      // the outermost label is ignored and the secondary label is very long and contribute to the\n      // union extension:\n      //      -|---|---|---|\n      //         1,000,000,000\n      // Therefore we calculate them one by one.\n      // Also considered axis may be blank or no labels.\n      var sharedRecord = axisBuilderSharedCtx.ensureRecord(axis.model);\n      var labelInfoList = sharedRecord.labelInfoList;\n      if (labelInfoList) {\n        for (var idx = 0; idx < labelInfoList.length; idx++) {\n          var labelInfo = labelInfoList[idx];\n          var proportion = axis.scale.normalize(getLabelInner(labelInfo.label).tickValue);\n          proportion = xyIdx === 1 ? 1 - proportion : proportion;\n          // xAxis use proportion on x, yAxis use proprotion on y, otherwise not.\n          fillMarginOnOneDimension(labelInfo.rect, xyIdx, proportion);\n          fillMarginOnOneDimension(labelInfo.rect, 1 - xyIdx, NaN);\n        }\n      }\n      var nameLayout = sharedRecord.nameLayout;\n      if (nameLayout) {\n        var proportion = isNameLocationCenter(sharedRecord.nameLocation) ? 0.5 : NaN;\n        fillMarginOnOneDimension(nameLayout.rect, xyIdx, proportion);\n        fillMarginOnOneDimension(nameLayout.rect, 1 - xyIdx, NaN);\n      }\n    });\n  }\n  function fillMarginOnOneDimension(itemRect, xyIdx, proportion // NaN mean no use proportion\n  ) {\n    var overflow1 = outerBoundsRect[XY[xyIdx]] - itemRect[XY[xyIdx]];\n    var overflow2 = itemRect[WH[xyIdx]] + itemRect[XY[xyIdx]] - (outerBoundsRect[WH[xyIdx]] + outerBoundsRect[XY[xyIdx]]);\n    overflow1 = applyProportion(overflow1, 1 - proportion);\n    overflow2 = applyProportion(overflow2, proportion);\n    var minIdx = XY_TO_MARGIN_IDX[xyIdx][0];\n    var maxIdx = XY_TO_MARGIN_IDX[xyIdx][1];\n    margin[minIdx] = mathMax(margin[minIdx], overflow1);\n    margin[maxIdx] = mathMax(margin[maxIdx], overflow2);\n  }\n  function applyProportion(overflow, proportion) {\n    // proportion is not likely to near zero. If so, give up shrink\n    if (overflow > 0 && !eqNaN(proportion) && proportion > 1e-4) {\n      overflow /= proportion;\n    }\n    return overflow;\n  }\n}\nfunction createAxisBiulders(gridRect, cartesians, axesMap, optionContainLabel, api) {\n  var axisBuilderSharedCtx = new AxisBuilderSharedContext(resolveAxisNameOverlapForGrid);\n  each(axesMap, function (axisList) {\n    return each(axisList, function (axis) {\n      if (shouldAxisShow(axis.model)) {\n        // See `AxisBaseOptionCommon['nameMoveOverlap']`.\n        var defaultNameMoveOverlap = !optionContainLabel;\n        axis.axisBuilder = createCartesianAxisViewCommonPartBuilder(gridRect, cartesians, axis.model, api, axisBuilderSharedCtx, defaultNameMoveOverlap);\n      }\n    });\n  });\n  return axisBuilderSharedCtx;\n}\n/**\n * Promote the axis-elements-building from \"view render\" stage to \"coordinate system resize\" stage.\n * This is aimed to resovle overlap across multiple axes, since currently it's hard to reconcile\n * multiple axes in \"view render\" stage.\n *\n * [CAUTION] But this promotion assumes that the subsequent \"visual mapping\" stage does not affect\n * this axis-elements-building; otherwise we have to refactor it again.\n */\nfunction createOrUpdateAxesView(gridRect, axesMap, kind, outerBoundsContain, noPxChange, layoutRef) {\n  var isDetermine = kind === AxisTickLabelComputingKind.determine;\n  each(axesMap, function (axisList) {\n    return each(axisList, function (axis) {\n      if (shouldAxisShow(axis.model)) {\n        updateCartesianAxisViewCommonPartBuilder(axis.axisBuilder, gridRect, axis.model);\n        axis.axisBuilder.build(isDetermine ? {\n          axisTickLabelDetermine: true\n        } : {\n          axisTickLabelEstimate: true\n        }, {\n          noPxChange: noPxChange\n        });\n      }\n    });\n  });\n  var nameMarginLevelMap = {\n    x: 0,\n    y: 0\n  };\n  calcNameMarginLevel(0);\n  calcNameMarginLevel(1);\n  function calcNameMarginLevel(xyIdx) {\n    nameMarginLevelMap[XY[1 - xyIdx]] = gridRect[WH[xyIdx]] <= layoutRef.refContainer[WH[xyIdx]] * 0.5 ? 0 : 1 - xyIdx === 1 ? 2 : 1;\n  }\n  each(axesMap, function (axisList, xy) {\n    return each(axisList, function (axis) {\n      if (shouldAxisShow(axis.model)) {\n        if (outerBoundsContain === 'all' || isDetermine) {\n          // To resolve overlap, `axisName` layout depends on `axisTickLabel` layout result\n          // (all of the axes of the same `grid`; consider multiple x or y axes).\n          axis.axisBuilder.build({\n            axisName: true\n          }, {\n            nameMarginLevel: nameMarginLevelMap[xy]\n          });\n        }\n        if (isDetermine) {\n          axis.axisBuilder.build({\n            axisLine: true\n          });\n        }\n      }\n    });\n  });\n}\nfunction prepareOuterBounds(gridModel, rawRridRect, layoutRef) {\n  var outerBoundsRect;\n  var optionOuterBoundsMode = gridModel.get('outerBoundsMode', true);\n  if (optionOuterBoundsMode === 'same') {\n    outerBoundsRect = rawRridRect.clone();\n  } else if (optionOuterBoundsMode == null || optionOuterBoundsMode === 'auto') {\n    outerBoundsRect = getLayoutRect(gridModel.get('outerBounds', true) || OUTER_BOUNDS_DEFAULT, layoutRef.refContainer);\n  } else if (optionOuterBoundsMode !== 'none') {\n    if (process.env.NODE_ENV !== 'production') {\n      error(\"Invalid grid[\" + gridModel.componentIndex + \"].outerBoundsMode.\");\n    }\n  }\n  var optionOuterBoundsContain = gridModel.get('outerBoundsContain', true);\n  var parsedOuterBoundsContain;\n  if (optionOuterBoundsContain == null || optionOuterBoundsContain === 'auto') {\n    parsedOuterBoundsContain = 'all';\n  } else if (indexOf(['all', 'axisLabel'], optionOuterBoundsContain) < 0) {\n    if (process.env.NODE_ENV !== 'production') {\n      error(\"Invalid grid[\" + gridModel.componentIndex + \"].outerBoundsContain.\");\n    }\n    parsedOuterBoundsContain = 'all';\n  } else {\n    parsedOuterBoundsContain = optionOuterBoundsContain;\n  }\n  var outerBoundsClamp = [parsePositionSizeOption(retrieve2(gridModel.get('outerBoundsClampWidth', true), OUTER_BOUNDS_CLAMP_DEFAULT[0]), rawRridRect.width), parsePositionSizeOption(retrieve2(gridModel.get('outerBoundsClampHeight', true), OUTER_BOUNDS_CLAMP_DEFAULT[1]), rawRridRect.height)];\n  return {\n    outerBoundsRect: outerBoundsRect,\n    parsedOuterBoundsContain: parsedOuterBoundsContain,\n    outerBoundsClamp: outerBoundsClamp\n  };\n}\nvar resolveAxisNameOverlapForGrid = function (cfg, ctx, axisModel, nameLayoutInfo, nameMoveDirVec, thisRecord) {\n  var perpendicularDim = axisModel.axis.dim === 'x' ? 'y' : 'x';\n  resolveAxisNameOverlapDefault(cfg, ctx, axisModel, nameLayoutInfo, nameMoveDirVec, thisRecord);\n  // If nameLocation 'center', and there are multiple axes parallel to this axis, do not adjust by\n  //  other axes, because the axis name should be close to its axis line as much as possible even\n  //  if overlapping; otherwise it might cause misleading.\n  // If nameLocation 'center', do not adjust by perpendicular axes, since they are not likely to overlap.\n  // If nameLocation 'start'/'end', move name within the same direction to escape overlap with the\n  //  perpendicular axes.\n  if (!isNameLocationCenter(cfg.nameLocation)) {\n    each(ctx.recordMap[perpendicularDim], function (perpenRecord) {\n      // perpendicular axis may be no name.\n      if (perpenRecord && perpenRecord.labelInfoList && perpenRecord.dirVec) {\n        moveIfOverlapByLinearLabels(perpenRecord.labelInfoList, perpenRecord.dirVec, nameLayoutInfo, nameMoveDirVec);\n      }\n    });\n  }\n};\nexport default Grid;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport Model from '../../model/Model.js';\nimport { each, curry, clone, defaults, isArray, indexOf } from 'zrender/lib/core/util.js';\n// Build axisPointerModel, mergin tooltip.axisPointer model for each axis.\n// allAxesInfo should be updated when setOption performed.\nexport function collect(ecModel, api) {\n  var result = {\n    /**\n     * key: makeKey(axis.model)\n     * value: {\n     *      axis,\n     *      coordSys,\n     *      axisPointerModel,\n     *      triggerTooltip,\n     *      triggerEmphasis,\n     *      involveSeries,\n     *      snap,\n     *      seriesModels,\n     *      seriesDataCount\n     * }\n     */\n    axesInfo: {},\n    seriesInvolved: false,\n    /**\n     * key: makeKey(coordSys.model)\n     * value: Object: key makeKey(axis.model), value: axisInfo\n     */\n    coordSysAxesInfo: {},\n    coordSysMap: {}\n  };\n  collectAxesInfo(result, ecModel, api);\n  // Check seriesInvolved for performance, in case too many series in some chart.\n  result.seriesInvolved && collectSeriesInfo(result, ecModel);\n  return result;\n}\nfunction collectAxesInfo(result, ecModel, api) {\n  var globalTooltipModel = ecModel.getComponent('tooltip');\n  var globalAxisPointerModel = ecModel.getComponent('axisPointer');\n  // links can only be set on global.\n  var linksOption = globalAxisPointerModel.get('link', true) || [];\n  var linkGroups = [];\n  // Collect axes info.\n  each(api.getCoordinateSystems(), function (coordSys) {\n    // Some coordinate system do not support axes, like geo.\n    if (!coordSys.axisPointerEnabled) {\n      return;\n    }\n    var coordSysKey = makeKey(coordSys.model);\n    var axesInfoInCoordSys = result.coordSysAxesInfo[coordSysKey] = {};\n    result.coordSysMap[coordSysKey] = coordSys;\n    // Set tooltip (like 'cross') is a convenient way to show axisPointer\n    // for user. So we enable setting tooltip on coordSys model.\n    var coordSysModel = coordSys.model;\n    var baseTooltipModel = coordSysModel.getModel('tooltip', globalTooltipModel);\n    each(coordSys.getAxes(), curry(saveTooltipAxisInfo, false, null));\n    // If axis tooltip used, choose tooltip axis for each coordSys.\n    // Notice this case: coordSys is `grid` but not `cartesian2D` here.\n    if (coordSys.getTooltipAxes && globalTooltipModel\n    // If tooltip.showContent is set as false, tooltip will not\n    // show but axisPointer will show as normal.\n    && baseTooltipModel.get('show')) {\n      // Compatible with previous logic. But series.tooltip.trigger: 'axis'\n      // or series.data[n].tooltip.trigger: 'axis' are not support any more.\n      var triggerAxis = baseTooltipModel.get('trigger') === 'axis';\n      var cross = baseTooltipModel.get(['axisPointer', 'type']) === 'cross';\n      var tooltipAxes = coordSys.getTooltipAxes(baseTooltipModel.get(['axisPointer', 'axis']));\n      if (triggerAxis || cross) {\n        each(tooltipAxes.baseAxes, curry(saveTooltipAxisInfo, cross ? 'cross' : true, triggerAxis));\n      }\n      if (cross) {\n        each(tooltipAxes.otherAxes, curry(saveTooltipAxisInfo, 'cross', false));\n      }\n    }\n    // fromTooltip: true | false | 'cross'\n    // triggerTooltip: true | false | null\n    function saveTooltipAxisInfo(fromTooltip, triggerTooltip, axis) {\n      var axisPointerModel = axis.model.getModel('axisPointer', globalAxisPointerModel);\n      var axisPointerShow = axisPointerModel.get('show');\n      if (!axisPointerShow || axisPointerShow === 'auto' && !fromTooltip && !isHandleTrigger(axisPointerModel)) {\n        return;\n      }\n      if (triggerTooltip == null) {\n        triggerTooltip = axisPointerModel.get('triggerTooltip');\n      }\n      axisPointerModel = fromTooltip ? makeAxisPointerModel(axis, baseTooltipModel, globalAxisPointerModel, ecModel, fromTooltip, triggerTooltip) : axisPointerModel;\n      var snap = axisPointerModel.get('snap');\n      var triggerEmphasis = axisPointerModel.get('triggerEmphasis');\n      var axisKey = makeKey(axis.model);\n      var involveSeries = triggerTooltip || snap || axis.type === 'category';\n      // If result.axesInfo[key] exist, override it (tooltip has higher priority).\n      var axisInfo = result.axesInfo[axisKey] = {\n        key: axisKey,\n        axis: axis,\n        coordSys: coordSys,\n        axisPointerModel: axisPointerModel,\n        triggerTooltip: triggerTooltip,\n        triggerEmphasis: triggerEmphasis,\n        involveSeries: involveSeries,\n        snap: snap,\n        useHandle: isHandleTrigger(axisPointerModel),\n        seriesModels: [],\n        linkGroup: null\n      };\n      axesInfoInCoordSys[axisKey] = axisInfo;\n      result.seriesInvolved = result.seriesInvolved || involveSeries;\n      var groupIndex = getLinkGroupIndex(linksOption, axis);\n      if (groupIndex != null) {\n        var linkGroup = linkGroups[groupIndex] || (linkGroups[groupIndex] = {\n          axesInfo: {}\n        });\n        linkGroup.axesInfo[axisKey] = axisInfo;\n        linkGroup.mapper = linksOption[groupIndex].mapper;\n        axisInfo.linkGroup = linkGroup;\n      }\n    }\n  });\n}\nfunction makeAxisPointerModel(axis, baseTooltipModel, globalAxisPointerModel, ecModel, fromTooltip, triggerTooltip) {\n  var tooltipAxisPointerModel = baseTooltipModel.getModel('axisPointer');\n  var fields = ['type', 'snap', 'lineStyle', 'shadowStyle', 'label', 'animation', 'animationDurationUpdate', 'animationEasingUpdate', 'z'];\n  var volatileOption = {};\n  each(fields, function (field) {\n    volatileOption[field] = clone(tooltipAxisPointerModel.get(field));\n  });\n  // category axis do not auto snap, otherwise some tick that do not\n  // has value can not be hovered. value/time/log axis default snap if\n  // triggered from tooltip and trigger tooltip.\n  volatileOption.snap = axis.type !== 'category' && !!triggerTooltip;\n  // Compatible with previous behavior, tooltip axis does not show label by default.\n  // Only these properties can be overridden from tooltip to axisPointer.\n  if (tooltipAxisPointerModel.get('type') === 'cross') {\n    volatileOption.type = 'line';\n  }\n  var labelOption = volatileOption.label || (volatileOption.label = {});\n  // Follow the convention, do not show label when triggered by tooltip by default.\n  labelOption.show == null && (labelOption.show = false);\n  if (fromTooltip === 'cross') {\n    // When 'cross', both axes show labels.\n    var tooltipAxisPointerLabelShow = tooltipAxisPointerModel.get(['label', 'show']);\n    labelOption.show = tooltipAxisPointerLabelShow != null ? tooltipAxisPointerLabelShow : true;\n    // If triggerTooltip, this is a base axis, which should better not use cross style\n    // (cross style is dashed by default)\n    if (!triggerTooltip) {\n      var crossStyle = volatileOption.lineStyle = tooltipAxisPointerModel.get('crossStyle');\n      crossStyle && defaults(labelOption, crossStyle.textStyle);\n    }\n  }\n  return axis.model.getModel('axisPointer', new Model(volatileOption, globalAxisPointerModel, ecModel));\n}\nfunction collectSeriesInfo(result, ecModel) {\n  // Prepare data for axis trigger\n  ecModel.eachSeries(function (seriesModel) {\n    // Notice this case: this coordSys is `cartesian2D` but not `grid`.\n    var coordSys = seriesModel.coordinateSystem;\n    var seriesTooltipTrigger = seriesModel.get(['tooltip', 'trigger'], true);\n    var seriesTooltipShow = seriesModel.get(['tooltip', 'show'], true);\n    if (!coordSys || !coordSys.model // PENDING: radar do not have a model.\n    || seriesTooltipTrigger === 'none' || seriesTooltipTrigger === false || seriesTooltipTrigger === 'item' || seriesTooltipShow === false || seriesModel.get(['axisPointer', 'show'], true) === false) {\n      return;\n    }\n    each(result.coordSysAxesInfo[makeKey(coordSys.model)], function (axisInfo) {\n      var axis = axisInfo.axis;\n      if (coordSys.getAxis(axis.dim) === axis) {\n        axisInfo.seriesModels.push(seriesModel);\n        axisInfo.seriesDataCount == null && (axisInfo.seriesDataCount = 0);\n        axisInfo.seriesDataCount += seriesModel.getData().count();\n      }\n    });\n  });\n}\n/**\n * For example:\n * {\n *     axisPointer: {\n *         links: [{\n *             xAxisIndex: [2, 4],\n *             yAxisIndex: 'all'\n *         }, {\n *             xAxisId: ['a5', 'a7'],\n *             xAxisName: 'xxx'\n *         }]\n *     }\n * }\n */\nfunction getLinkGroupIndex(linksOption, axis) {\n  var axisModel = axis.model;\n  var dim = axis.dim;\n  for (var i = 0; i < linksOption.length; i++) {\n    var linkOption = linksOption[i] || {};\n    if (checkPropInLink(linkOption[dim + 'AxisId'], axisModel.id) || checkPropInLink(linkOption[dim + 'AxisIndex'], axisModel.componentIndex) || checkPropInLink(linkOption[dim + 'AxisName'], axisModel.name)) {\n      return i;\n    }\n  }\n}\nfunction checkPropInLink(linkPropValue, axisPropValue) {\n  return linkPropValue === 'all' || isArray(linkPropValue) && indexOf(linkPropValue, axisPropValue) >= 0 || linkPropValue === axisPropValue;\n}\nexport function fixValue(axisModel) {\n  var axisInfo = getAxisInfo(axisModel);\n  if (!axisInfo) {\n    return;\n  }\n  var axisPointerModel = axisInfo.axisPointerModel;\n  var scale = axisInfo.axis.scale;\n  var option = axisPointerModel.option;\n  var status = axisPointerModel.get('status');\n  var value = axisPointerModel.get('value');\n  // Parse init value for category and time axis.\n  if (value != null) {\n    value = scale.parse(value);\n  }\n  var useHandle = isHandleTrigger(axisPointerModel);\n  // If `handle` used, `axisPointer` will always be displayed, so value\n  // and status should be initialized.\n  if (status == null) {\n    option.status = useHandle ? 'show' : 'hide';\n  }\n  var extent = scale.getExtent().slice();\n  extent[0] > extent[1] && extent.reverse();\n  if (\n  // Pick a value on axis when initializing.\n  value == null\n  // If both `handle` and `dataZoom` are used, value may be out of axis extent,\n  // where we should re-pick a value to keep `handle` displaying normally.\n  || value > extent[1]) {\n    // Make handle displayed on the end of the axis when init, which looks better.\n    value = extent[1];\n  }\n  if (value < extent[0]) {\n    value = extent[0];\n  }\n  option.value = value;\n  if (useHandle) {\n    option.status = axisInfo.axis.scale.isBlank() ? 'hide' : 'show';\n  }\n}\nexport function getAxisInfo(axisModel) {\n  var coordSysAxesInfo = (axisModel.ecModel.getComponent('axisPointer') || {}).coordSysAxesInfo;\n  return coordSysAxesInfo && coordSysAxesInfo.axesInfo[makeKey(axisModel)];\n}\nexport function getAxisPointerModel(axisModel) {\n  var axisInfo = getAxisInfo(axisModel);\n  return axisInfo && axisInfo.axisPointerModel;\n}\nfunction isHandleTrigger(axisPointerModel) {\n  return !!axisPointerModel.get(['handle', 'show']);\n}\n/**\n * @param {module:echarts/model/Model} model\n * @return {string} unique key\n */\nexport function makeKey(model) {\n  return model.type + '||' + model.id;\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as axisPointerModelHelper from '../axisPointer/modelHelper.js';\nimport ComponentView from '../../view/Component.js';\nvar axisPointerClazz = {};\n/**\n * Base class of AxisView.\n */\nvar AxisView = /** @class */function (_super) {\n  __extends(AxisView, _super);\n  function AxisView() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = AxisView.type;\n    return _this;\n  }\n  /**\n   * @override\n   */\n  AxisView.prototype.render = function (axisModel, ecModel, api, payload) {\n    // FIXME\n    // This process should proformed after coordinate systems updated\n    // (axis scale updated), and should be performed each time update.\n    // So put it here temporarily, although it is not appropriate to\n    // put a model-writing procedure in `view`.\n    this.axisPointerClass && axisPointerModelHelper.fixValue(axisModel);\n    _super.prototype.render.apply(this, arguments);\n    this._doUpdateAxisPointerClass(axisModel, api, true);\n  };\n  /**\n   * Action handler.\n   */\n  AxisView.prototype.updateAxisPointer = function (axisModel, ecModel, api, payload) {\n    this._doUpdateAxisPointerClass(axisModel, api, false);\n  };\n  /**\n   * @override\n   */\n  AxisView.prototype.remove = function (ecModel, api) {\n    var axisPointer = this._axisPointer;\n    axisPointer && axisPointer.remove(api);\n  };\n  /**\n   * @override\n   */\n  AxisView.prototype.dispose = function (ecModel, api) {\n    this._disposeAxisPointer(api);\n    _super.prototype.dispose.apply(this, arguments);\n  };\n  AxisView.prototype._doUpdateAxisPointerClass = function (axisModel, api, forceRender) {\n    var Clazz = AxisView.getAxisPointerClass(this.axisPointerClass);\n    if (!Clazz) {\n      return;\n    }\n    var axisPointerModel = axisPointerModelHelper.getAxisPointerModel(axisModel);\n    axisPointerModel ? (this._axisPointer || (this._axisPointer = new Clazz())).render(axisModel, axisPointerModel, api, forceRender) : this._disposeAxisPointer(api);\n  };\n  AxisView.prototype._disposeAxisPointer = function (api) {\n    this._axisPointer && this._axisPointer.dispose(api);\n    this._axisPointer = null;\n  };\n  AxisView.registerAxisPointerClass = function (type, clazz) {\n    if (process.env.NODE_ENV !== 'production') {\n      if (axisPointerClazz[type]) {\n        throw new Error('axisPointer ' + type + ' exists');\n      }\n    }\n    axisPointerClazz[type] = clazz;\n  };\n  ;\n  AxisView.getAxisPointerClass = function (type) {\n    return type && axisPointerClazz[type];\n  };\n  ;\n  AxisView.type = 'axis';\n  return AxisView;\n}(ComponentView);\nexport default AxisView;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as graphic from '../../util/graphic.js';\nimport { makeInner } from '../../util/model.js';\nvar inner = makeInner();\nexport function rectCoordAxisBuildSplitArea(axisView, axisGroup, axisModel, gridModel) {\n  var axis = axisModel.axis;\n  if (axis.scale.isBlank()) {\n    return;\n  }\n  // TODO: TYPE\n  var splitAreaModel = axisModel.getModel('splitArea');\n  var areaStyleModel = splitAreaModel.getModel('areaStyle');\n  var areaColors = areaStyleModel.get('color');\n  var gridRect = gridModel.coordinateSystem.getRect();\n  var ticksCoords = axis.getTicksCoords({\n    tickModel: splitAreaModel,\n    clamp: true,\n    breakTicks: 'none',\n    pruneByBreak: 'preserve_extent_bound'\n  });\n  if (!ticksCoords.length) {\n    return;\n  }\n  // For Making appropriate splitArea animation, the color and anid\n  // should be corresponding to previous one if possible.\n  var areaColorsLen = areaColors.length;\n  var lastSplitAreaColors = inner(axisView).splitAreaColors;\n  var newSplitAreaColors = zrUtil.createHashMap();\n  var colorIndex = 0;\n  if (lastSplitAreaColors) {\n    for (var i = 0; i < ticksCoords.length; i++) {\n      var cIndex = lastSplitAreaColors.get(ticksCoords[i].tickValue);\n      if (cIndex != null) {\n        colorIndex = (cIndex + (areaColorsLen - 1) * i) % areaColorsLen;\n        break;\n      }\n    }\n  }\n  var prev = axis.toGlobalCoord(ticksCoords[0].coord);\n  var areaStyle = areaStyleModel.getAreaStyle();\n  areaColors = zrUtil.isArray(areaColors) ? areaColors : [areaColors];\n  for (var i = 1; i < ticksCoords.length; i++) {\n    var tickCoord = axis.toGlobalCoord(ticksCoords[i].coord);\n    var x = void 0;\n    var y = void 0;\n    var width = void 0;\n    var height = void 0;\n    if (axis.isHorizontal()) {\n      x = prev;\n      y = gridRect.y;\n      width = tickCoord - x;\n      height = gridRect.height;\n      prev = x + width;\n    } else {\n      x = gridRect.x;\n      y = prev;\n      width = gridRect.width;\n      height = tickCoord - y;\n      prev = y + height;\n    }\n    var tickValue = ticksCoords[i - 1].tickValue;\n    tickValue != null && newSplitAreaColors.set(tickValue, colorIndex);\n    axisGroup.add(new graphic.Rect({\n      anid: tickValue != null ? 'area_' + tickValue : null,\n      shape: {\n        x: x,\n        y: y,\n        width: width,\n        height: height\n      },\n      style: zrUtil.defaults({\n        fill: areaColors[colorIndex]\n      }, areaStyle),\n      autoBatch: true,\n      silent: true\n    }));\n    colorIndex = (colorIndex + 1) % areaColorsLen;\n  }\n  inner(axisView).splitAreaColors = newSplitAreaColors;\n}\nexport function rectCoordAxisHandleRemove(axisView) {\n  inner(axisView).splitAreaColors = null;\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as graphic from '../../util/graphic.js';\nimport AxisView from './AxisView.js';\nimport { rectCoordAxisBuildSplitArea, rectCoordAxisHandleRemove } from './axisSplitHelper.js';\nimport { getAxisBreakHelper } from './axisBreakHelper.js';\nimport { shouldAxisShow } from '../../coord/axisHelper.js';\nvar selfBuilderAttrs = ['splitArea', 'splitLine', 'minorSplitLine', 'breakArea'];\nvar CartesianAxisView = /** @class */function (_super) {\n  __extends(CartesianAxisView, _super);\n  function CartesianAxisView() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = CartesianAxisView.type;\n    _this.axisPointerClass = 'CartesianAxisPointer';\n    return _this;\n  }\n  /**\n   * @override\n   */\n  CartesianAxisView.prototype.render = function (axisModel, ecModel, api, payload) {\n    this.group.removeAll();\n    var oldAxisGroup = this._axisGroup;\n    this._axisGroup = new graphic.Group();\n    this.group.add(this._axisGroup);\n    if (!shouldAxisShow(axisModel)) {\n      return;\n    }\n    this._axisGroup.add(axisModel.axis.axisBuilder.group);\n    zrUtil.each(selfBuilderAttrs, function (name) {\n      if (axisModel.get([name, 'show'])) {\n        axisElementBuilders[name](this, this._axisGroup, axisModel, axisModel.getCoordSysModel(), api);\n      }\n    }, this);\n    // THIS is a special case for bar racing chart.\n    // Update the axis label from the natural initial layout to\n    // sorted layout should has no animation.\n    var isInitialSortFromBarRacing = payload && payload.type === 'changeAxisOrder' && payload.isInitSort;\n    if (!isInitialSortFromBarRacing) {\n      graphic.groupTransition(oldAxisGroup, this._axisGroup, axisModel);\n    }\n    _super.prototype.render.call(this, axisModel, ecModel, api, payload);\n  };\n  CartesianAxisView.prototype.remove = function () {\n    rectCoordAxisHandleRemove(this);\n  };\n  CartesianAxisView.type = 'cartesianAxis';\n  return CartesianAxisView;\n}(AxisView);\nvar axisElementBuilders = {\n  splitLine: function (axisView, axisGroup, axisModel, gridModel, api) {\n    var axis = axisModel.axis;\n    if (axis.scale.isBlank()) {\n      return;\n    }\n    var splitLineModel = axisModel.getModel('splitLine');\n    var lineStyleModel = splitLineModel.getModel('lineStyle');\n    var lineColors = lineStyleModel.get('color');\n    var showMinLine = splitLineModel.get('showMinLine') !== false;\n    var showMaxLine = splitLineModel.get('showMaxLine') !== false;\n    lineColors = zrUtil.isArray(lineColors) ? lineColors : [lineColors];\n    var gridRect = gridModel.coordinateSystem.getRect();\n    var isHorizontal = axis.isHorizontal();\n    var lineCount = 0;\n    var ticksCoords = axis.getTicksCoords({\n      tickModel: splitLineModel,\n      breakTicks: 'none',\n      pruneByBreak: 'preserve_extent_bound'\n    });\n    var p1 = [];\n    var p2 = [];\n    var lineStyle = lineStyleModel.getLineStyle();\n    for (var i = 0; i < ticksCoords.length; i++) {\n      var tickCoord = axis.toGlobalCoord(ticksCoords[i].coord);\n      if (i === 0 && !showMinLine || i === ticksCoords.length - 1 && !showMaxLine) {\n        continue;\n      }\n      var tickValue = ticksCoords[i].tickValue;\n      if (isHorizontal) {\n        p1[0] = tickCoord;\n        p1[1] = gridRect.y;\n        p2[0] = tickCoord;\n        p2[1] = gridRect.y + gridRect.height;\n      } else {\n        p1[0] = gridRect.x;\n        p1[1] = tickCoord;\n        p2[0] = gridRect.x + gridRect.width;\n        p2[1] = tickCoord;\n      }\n      var colorIndex = lineCount++ % lineColors.length;\n      var line = new graphic.Line({\n        anid: tickValue != null ? 'line_' + tickValue : null,\n        autoBatch: true,\n        shape: {\n          x1: p1[0],\n          y1: p1[1],\n          x2: p2[0],\n          y2: p2[1]\n        },\n        style: zrUtil.defaults({\n          stroke: lineColors[colorIndex]\n        }, lineStyle),\n        silent: true\n      });\n      graphic.subPixelOptimizeLine(line.shape, lineStyle.lineWidth);\n      axisGroup.add(line);\n    }\n  },\n  minorSplitLine: function (axisView, axisGroup, axisModel, gridModel, api) {\n    var axis = axisModel.axis;\n    var minorSplitLineModel = axisModel.getModel('minorSplitLine');\n    var lineStyleModel = minorSplitLineModel.getModel('lineStyle');\n    var gridRect = gridModel.coordinateSystem.getRect();\n    var isHorizontal = axis.isHorizontal();\n    var minorTicksCoords = axis.getMinorTicksCoords();\n    if (!minorTicksCoords.length) {\n      return;\n    }\n    var p1 = [];\n    var p2 = [];\n    var lineStyle = lineStyleModel.getLineStyle();\n    for (var i = 0; i < minorTicksCoords.length; i++) {\n      for (var k = 0; k < minorTicksCoords[i].length; k++) {\n        var tickCoord = axis.toGlobalCoord(minorTicksCoords[i][k].coord);\n        if (isHorizontal) {\n          p1[0] = tickCoord;\n          p1[1] = gridRect.y;\n          p2[0] = tickCoord;\n          p2[1] = gridRect.y + gridRect.height;\n        } else {\n          p1[0] = gridRect.x;\n          p1[1] = tickCoord;\n          p2[0] = gridRect.x + gridRect.width;\n          p2[1] = tickCoord;\n        }\n        var line = new graphic.Line({\n          anid: 'minor_line_' + minorTicksCoords[i][k].tickValue,\n          autoBatch: true,\n          shape: {\n            x1: p1[0],\n            y1: p1[1],\n            x2: p2[0],\n            y2: p2[1]\n          },\n          style: lineStyle,\n          silent: true\n        });\n        graphic.subPixelOptimizeLine(line.shape, lineStyle.lineWidth);\n        axisGroup.add(line);\n      }\n    }\n  },\n  splitArea: function (axisView, axisGroup, axisModel, gridModel, api) {\n    rectCoordAxisBuildSplitArea(axisView, axisGroup, axisModel, gridModel);\n  },\n  breakArea: function (axisView, axisGroup, axisModel, gridModel, api) {\n    var axisBreakHelper = getAxisBreakHelper();\n    var scale = axisModel.axis.scale;\n    if (axisBreakHelper && scale.type !== 'ordinal') {\n      axisBreakHelper.rectCoordBuildBreakAxis(axisGroup, axisView, axisModel, gridModel.coordinateSystem.getRect(), api);\n    }\n  }\n};\nvar CartesianXAxisView = /** @class */function (_super) {\n  __extends(CartesianXAxisView, _super);\n  function CartesianXAxisView() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = CartesianXAxisView.type;\n    return _this;\n  }\n  CartesianXAxisView.type = 'xAxis';\n  return CartesianXAxisView;\n}(CartesianAxisView);\nexport { CartesianXAxisView };\nvar CartesianYAxisView = /** @class */function (_super) {\n  __extends(CartesianYAxisView, _super);\n  function CartesianYAxisView() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = CartesianXAxisView.type;\n    return _this;\n  }\n  CartesianYAxisView.type = 'yAxis';\n  return CartesianYAxisView;\n}(CartesianAxisView);\nexport { CartesianYAxisView };\nexport default CartesianAxisView;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport ComponentView from '../../view/Component.js';\nimport GridModel from '../../coord/cartesian/GridModel.js';\nimport { Rect } from '../../util/graphic.js';\nimport { defaults } from 'zrender/lib/core/util.js';\nimport { CartesianAxisModel } from '../../coord/cartesian/AxisModel.js';\nimport axisModelCreator from '../../coord/axisModelCreator.js';\nimport Grid from '../../coord/cartesian/Grid.js';\nimport { CartesianXAxisView, CartesianYAxisView } from '../axis/CartesianAxisView.js';\n// Grid view\nvar GridView = /** @class */function (_super) {\n  __extends(GridView, _super);\n  function GridView() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = 'grid';\n    return _this;\n  }\n  GridView.prototype.render = function (gridModel, ecModel) {\n    this.group.removeAll();\n    if (gridModel.get('show')) {\n      this.group.add(new Rect({\n        shape: gridModel.coordinateSystem.getRect(),\n        style: defaults({\n          fill: gridModel.get('backgroundColor')\n        }, gridModel.getItemStyle()),\n        silent: true,\n        z2: -1\n      }));\n    }\n  };\n  GridView.type = 'grid';\n  return GridView;\n}(ComponentView);\nvar extraOption = {\n  // gridIndex: 0,\n  // gridId: '',\n  offset: 0\n};\nexport function install(registers) {\n  registers.registerComponentView(GridView);\n  registers.registerComponentModel(GridModel);\n  registers.registerCoordinateSystem('cartesian2d', Grid);\n  axisModelCreator(registers, 'x', CartesianAxisModel, extraOption);\n  axisModelCreator(registers, 'y', CartesianAxisModel, extraOption);\n  registers.registerComponentView(CartesianXAxisView);\n  registers.registerComponentView(CartesianYAxisView);\n  registers.registerPreprocessor(function (option) {\n    // Only create grid when need\n    if (option.xAxis && option.yAxis && !option.grid) {\n      option.grid = {};\n    }\n  });\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport Axis2D from '../coord/cartesian/Axis2D.js';\nimport { makeInner } from './model.js';\nexport function needFixJitter(seriesModel, axis) {\n  var coordinateSystem = seriesModel.coordinateSystem;\n  var coordType = coordinateSystem && coordinateSystem.type;\n  var baseAxis = coordinateSystem && coordinateSystem.getBaseAxis && coordinateSystem.getBaseAxis();\n  var scaleType = baseAxis && baseAxis.scale && baseAxis.scale.type;\n  var seriesValid = coordType === 'cartesian2d' && scaleType === 'ordinal' || coordType === 'single';\n  var axisValid = axis.model.get('jitter') > 0;\n  return seriesValid && axisValid;\n}\nvar inner = makeInner();\n/**\n * Fix jitter for overlapping data points.\n *\n * @param fixedAxis The axis whose coord doesn't change with jitter.\n * @param fixedCoord The coord of fixedAxis.\n * @param floatCoord The coord of the other axis, which should be changed with jittering.\n * @param radius The radius of the data point, considering the symbol is a circle.\n * @returns updated floatCoord.\n */\nexport function fixJitter(fixedAxis, fixedCoord, floatCoord, radius) {\n  if (fixedAxis instanceof Axis2D) {\n    var scaleType = fixedAxis.scale.type;\n    if (scaleType !== 'category' && scaleType !== 'ordinal') {\n      return floatCoord;\n    }\n  }\n  var axisModel = fixedAxis.model;\n  var jitter = axisModel.get('jitter');\n  var jitterOverlap = axisModel.get('jitterOverlap');\n  var jitterMargin = axisModel.get('jitterMargin') || 0;\n  // Get band width to limit jitter range\n  var bandWidth = fixedAxis.scale.type === 'ordinal' ? fixedAxis.getBandWidth() : null;\n  if (jitter > 0) {\n    if (jitterOverlap) {\n      return fixJitterIgnoreOverlaps(floatCoord, jitter, bandWidth, radius);\n    } else {\n      return fixJitterAvoidOverlaps(fixedAxis, fixedCoord, floatCoord, radius, jitter, jitterMargin);\n    }\n  }\n  return floatCoord;\n}\nfunction fixJitterIgnoreOverlaps(floatCoord, jitter, bandWidth, radius) {\n  // Don't clamp single axis\n  if (bandWidth === null) {\n    return floatCoord + (Math.random() - 0.5) * jitter;\n  }\n  var maxJitter = bandWidth - radius * 2;\n  var actualJitter = Math.min(Math.max(0, jitter), maxJitter);\n  return floatCoord + (Math.random() - 0.5) * actualJitter;\n}\nfunction fixJitterAvoidOverlaps(fixedAxis, fixedCoord, floatCoord, radius, jitter, margin) {\n  var store = inner(fixedAxis);\n  if (!store.items) {\n    store.items = [];\n  }\n  var items = store.items;\n  // Try both positive and negative directions, choose the one with smaller movement\n  var overlapA = placeJitterOnDirection(items, fixedCoord, floatCoord, radius, jitter, margin, 1);\n  var overlapB = placeJitterOnDirection(items, fixedCoord, floatCoord, radius, jitter, margin, -1);\n  var minFloat = Math.abs(overlapA - floatCoord) < Math.abs(overlapB - floatCoord) ? overlapA : overlapB;\n  // Clamp only category axis\n  var bandWidth = fixedAxis.scale.type === 'ordinal' ? fixedAxis.getBandWidth() : null;\n  var distance = Math.abs(minFloat - floatCoord);\n  if (distance > jitter / 2 || bandWidth && distance > bandWidth / 2 - radius) {\n    // If the new item is moved too far, then give up.\n    // Fall back to random jitter.\n    return fixJitterIgnoreOverlaps(floatCoord, jitter, bandWidth, radius);\n  }\n  // Add new point to array\n  items.push({\n    fixedCoord: fixedCoord,\n    floatCoord: minFloat,\n    r: radius\n  });\n  return minFloat;\n}\nfunction placeJitterOnDirection(items, fixedCoord, floatCoord, radius, jitter, margin, direction) {\n  var y = floatCoord;\n  // Check all existing items for overlap and find the maximum adjustment needed\n  for (var i = 0; i < items.length; i++) {\n    var item = items[i];\n    var dx = fixedCoord - item.fixedCoord;\n    var dy = y - item.floatCoord;\n    var d2 = dx * dx + dy * dy;\n    var r = radius + item.r + margin;\n    if (d2 < r * r) {\n      // Has overlap, calculate required adjustment\n      var requiredY = item.floatCoord + Math.sqrt(r * r - dx * dx) * direction;\n      // Check if this adjustment would move too far\n      if (Math.abs(requiredY - floatCoord) > jitter / 2) {\n        return Number.MAX_VALUE; // Give up\n      }\n      // Update y only when it's larger to the center\n      if (direction === 1 && requiredY > y || direction === -1 && requiredY < y) {\n        y = requiredY;\n        // Loop from the start again\n        i = -1; // Reset index to recheck all items\n        continue; // Recalculate with the new y position\n      }\n    }\n  }\n  return y;\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { needFixJitter, fixJitter } from '../../util/jitter.js';\nexport default function jitterLayout(ecModel) {\n  ecModel.eachSeriesByType('scatter', function (seriesModel) {\n    var coordSys = seriesModel.coordinateSystem;\n    if (coordSys && (coordSys.type === 'cartesian2d' || coordSys.type === 'single')) {\n      var baseAxis_1 = coordSys.getBaseAxis ? coordSys.getBaseAxis() : null;\n      var hasJitter = baseAxis_1 && needFixJitter(seriesModel, baseAxis_1);\n      if (hasJitter) {\n        var data_1 = seriesModel.getData();\n        data_1.each(function (idx) {\n          var dim = baseAxis_1.dim;\n          var orient = baseAxis_1.orient;\n          var isSingleY = orient === 'horizontal' && baseAxis_1.type !== 'category' || orient === 'vertical' && baseAxis_1.type === 'category';\n          var layout = data_1.getItemLayout(idx);\n          var rawSize = data_1.getItemVisual(idx, 'symbolSize');\n          var size = rawSize instanceof Array ? (rawSize[1] + rawSize[0]) / 2 : rawSize;\n          if (dim === 'y' || dim === 'single' && isSingleY) {\n            // x is fixed, and y is floating\n            var jittered = fixJitter(baseAxis_1, layout[0], layout[1], size / 2);\n            data_1.setItemLayout(idx, [layout[0], jittered]);\n          } else if (dim === 'x' || dim === 'single' && !isSingleY) {\n            // y is fixed, and x is floating\n            var jittered = fixJitter(baseAxis_1, layout[1], layout[0], size / 2);\n            data_1.setItemLayout(idx, [jittered, layout[1]]);\n          }\n        });\n      }\n    }\n  });\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { use } from '../../extension.js';\nimport ScatterSeriesModel from './ScatterSeries.js';\nimport ScatterView from './ScatterView.js';\nimport { install as installGridSimple } from '../../component/grid/installSimple.js';\nimport layoutPoints from '../../layout/points.js';\nimport jitterLayout from './jitterLayout.js';\nexport function install(registers) {\n  // In case developer forget to include grid component\n  use(installGridSimple);\n  registers.registerSeriesModel(ScatterSeriesModel);\n  registers.registerChartView(ScatterView);\n  registers.registerLayout(layoutPoints('scatter'));\n}\nexport function installScatterJitter(registers) {\n  registers.registerLayout(registers.PRIORITY.VISUAL.POST_CHART_LAYOUT, jitterLayout);\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nexport default function radarLayout(ecModel) {\n  ecModel.eachSeriesByType('radar', function (seriesModel) {\n    var data = seriesModel.getData();\n    var points = [];\n    var coordSys = seriesModel.coordinateSystem;\n    if (!coordSys) {\n      return;\n    }\n    var axes = coordSys.getIndicatorAxes();\n    zrUtil.each(axes, function (axis, axisIndex) {\n      data.each(data.mapDimension(axes[axisIndex].dim), function (val, dataIndex) {\n        points[dataIndex] = points[dataIndex] || [];\n        var point = coordSys.dataToPoint(val, axisIndex);\n        points[dataIndex][axisIndex] = isValidPoint(point) ? point : getValueMissingPoint(coordSys);\n      });\n    });\n    // Close polygon\n    data.each(function (idx) {\n      // TODO\n      // Is it appropriate to connect to the next data when some data is missing?\n      // Or, should trade it like `connectNull` in line chart?\n      var firstPoint = zrUtil.find(points[idx], function (point) {\n        return isValidPoint(point);\n      }) || getValueMissingPoint(coordSys);\n      // Copy the first actual point to the end of the array\n      points[idx].push(firstPoint.slice());\n      data.setItemLayout(idx, points[idx]);\n    });\n  });\n}\nfunction isValidPoint(point) {\n  return !isNaN(point[0]) && !isNaN(point[1]);\n}\nfunction getValueMissingPoint(coordSys) {\n  // It is error-prone to input [NaN, NaN] into polygon, polygon.\n  // (probably cause problem when refreshing or animating)\n  return [coordSys.cx, coordSys.cy];\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n// @ts-nocheck\n// Backward compat for radar chart in 2\nimport * as zrUtil from 'zrender/lib/core/util.js';\nexport default function radarBackwardCompat(option) {\n  var polarOptArr = option.polar;\n  if (polarOptArr) {\n    if (!zrUtil.isArray(polarOptArr)) {\n      polarOptArr = [polarOptArr];\n    }\n    var polarNotRadar_1 = [];\n    zrUtil.each(polarOptArr, function (polarOpt, idx) {\n      if (polarOpt.indicator) {\n        if (polarOpt.type && !polarOpt.shape) {\n          polarOpt.shape = polarOpt.type;\n        }\n        option.radar = option.radar || [];\n        if (!zrUtil.isArray(option.radar)) {\n          option.radar = [option.radar];\n        }\n        option.radar.push(polarOpt);\n      } else {\n        polarNotRadar_1.push(polarOpt);\n      }\n    });\n    option.polar = polarNotRadar_1;\n  }\n  zrUtil.each(option.series, function (seriesOpt) {\n    if (seriesOpt && seriesOpt.type === 'radar' && seriesOpt.polarIndex) {\n      seriesOpt.radarIndex = seriesOpt.polarIndex;\n    }\n  });\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as graphic from '../../util/graphic.js';\nimport { setStatesStylesFromModel, toggleHoverEmphasis } from '../../util/states.js';\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as symbolUtil from '../../util/symbol.js';\nimport ChartView from '../../view/Chart.js';\nimport { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle.js';\nimport ZRImage from 'zrender/lib/graphic/Image.js';\nimport { saveOldStyle } from '../../animation/basicTransition.js';\nvar RadarView = /** @class */function (_super) {\n  __extends(RadarView, _super);\n  function RadarView() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = RadarView.type;\n    return _this;\n  }\n  RadarView.prototype.render = function (seriesModel, ecModel, api) {\n    var polar = seriesModel.coordinateSystem;\n    var group = this.group;\n    var data = seriesModel.getData();\n    var oldData = this._data;\n    function createSymbol(data, idx) {\n      var symbolType = data.getItemVisual(idx, 'symbol') || 'circle';\n      if (symbolType === 'none') {\n        return;\n      }\n      var symbolSize = symbolUtil.normalizeSymbolSize(data.getItemVisual(idx, 'symbolSize'));\n      var symbolPath = symbolUtil.createSymbol(symbolType, -1, -1, 2, 2);\n      var symbolRotate = data.getItemVisual(idx, 'symbolRotate') || 0;\n      symbolPath.attr({\n        style: {\n          strokeNoScale: true\n        },\n        z2: 100,\n        scaleX: symbolSize[0] / 2,\n        scaleY: symbolSize[1] / 2,\n        rotation: symbolRotate * Math.PI / 180 || 0\n      });\n      return symbolPath;\n    }\n    function updateSymbols(oldPoints, newPoints, symbolGroup, data, idx, isInit) {\n      // Simply rerender all\n      symbolGroup.removeAll();\n      for (var i = 0; i < newPoints.length - 1; i++) {\n        var symbolPath = createSymbol(data, idx);\n        if (symbolPath) {\n          symbolPath.__dimIdx = i;\n          if (oldPoints[i]) {\n            symbolPath.setPosition(oldPoints[i]);\n            graphic[isInit ? 'initProps' : 'updateProps'](symbolPath, {\n              x: newPoints[i][0],\n              y: newPoints[i][1]\n            }, seriesModel, idx);\n          } else {\n            symbolPath.setPosition(newPoints[i]);\n          }\n          symbolGroup.add(symbolPath);\n        }\n      }\n    }\n    function getInitialPoints(points) {\n      return zrUtil.map(points, function (pt) {\n        return [polar.cx, polar.cy];\n      });\n    }\n    data.diff(oldData).add(function (idx) {\n      var points = data.getItemLayout(idx);\n      if (!points) {\n        return;\n      }\n      var polygon = new graphic.Polygon();\n      var polyline = new graphic.Polyline();\n      var target = {\n        shape: {\n          points: points\n        }\n      };\n      polygon.shape.points = getInitialPoints(points);\n      polyline.shape.points = getInitialPoints(points);\n      graphic.initProps(polygon, target, seriesModel, idx);\n      graphic.initProps(polyline, target, seriesModel, idx);\n      var itemGroup = new graphic.Group();\n      var symbolGroup = new graphic.Group();\n      itemGroup.add(polyline);\n      itemGroup.add(polygon);\n      itemGroup.add(symbolGroup);\n      updateSymbols(polyline.shape.points, points, symbolGroup, data, idx, true);\n      data.setItemGraphicEl(idx, itemGroup);\n    }).update(function (newIdx, oldIdx) {\n      var itemGroup = oldData.getItemGraphicEl(oldIdx);\n      var polyline = itemGroup.childAt(0);\n      var polygon = itemGroup.childAt(1);\n      var symbolGroup = itemGroup.childAt(2);\n      var target = {\n        shape: {\n          points: data.getItemLayout(newIdx)\n        }\n      };\n      if (!target.shape.points) {\n        return;\n      }\n      updateSymbols(polyline.shape.points, target.shape.points, symbolGroup, data, newIdx, false);\n      saveOldStyle(polygon);\n      saveOldStyle(polyline);\n      graphic.updateProps(polyline, target, seriesModel);\n      graphic.updateProps(polygon, target, seriesModel);\n      data.setItemGraphicEl(newIdx, itemGroup);\n    }).remove(function (idx) {\n      group.remove(oldData.getItemGraphicEl(idx));\n    }).execute();\n    data.eachItemGraphicEl(function (itemGroup, idx) {\n      var itemModel = data.getItemModel(idx);\n      var polyline = itemGroup.childAt(0);\n      var polygon = itemGroup.childAt(1);\n      var symbolGroup = itemGroup.childAt(2);\n      // Radar uses the visual encoded from itemStyle.\n      var itemStyle = data.getItemVisual(idx, 'style');\n      var color = itemStyle.fill;\n      group.add(itemGroup);\n      polyline.useStyle(zrUtil.defaults(itemModel.getModel('lineStyle').getLineStyle(), {\n        fill: 'none',\n        stroke: color\n      }));\n      setStatesStylesFromModel(polyline, itemModel, 'lineStyle');\n      setStatesStylesFromModel(polygon, itemModel, 'areaStyle');\n      var areaStyleModel = itemModel.getModel('areaStyle');\n      var polygonIgnore = areaStyleModel.isEmpty() && areaStyleModel.parentModel.isEmpty();\n      polygon.ignore = polygonIgnore;\n      zrUtil.each(['emphasis', 'select', 'blur'], function (stateName) {\n        var stateModel = itemModel.getModel([stateName, 'areaStyle']);\n        var stateIgnore = stateModel.isEmpty() && stateModel.parentModel.isEmpty();\n        // Won't be ignore if normal state is not ignore.\n        polygon.ensureState(stateName).ignore = stateIgnore && polygonIgnore;\n        var lineStyle = itemModel.getModel([stateName, 'lineStyle']).getLineStyle();\n        polyline.ensureState(stateName).style = lineStyle;\n        var areaStyle = stateModel.getAreaStyle();\n        polygon.ensureState(stateName).style = areaStyle;\n        var itemStateStyle = itemModel.getModel([stateName, 'itemStyle']).getItemStyle();\n        symbolGroup.eachChild(function (symbolPath) {\n          symbolPath.ensureState(stateName).style = zrUtil.clone(itemStateStyle);\n        });\n      });\n      polygon.useStyle(zrUtil.defaults(itemModel.getModel('areaStyle').getAreaStyle(), {\n        fill: color,\n        opacity: 0.7,\n        decal: itemStyle.decal\n      }));\n      var emphasisModel = itemModel.getModel('emphasis');\n      symbolGroup.eachChild(function (symbolPath) {\n        if (symbolPath instanceof ZRImage) {\n          var pathStyle = symbolPath.style;\n          symbolPath.useStyle(zrUtil.extend({\n            // TODO other properties like x, y ?\n            image: pathStyle.image,\n            x: pathStyle.x,\n            y: pathStyle.y,\n            width: pathStyle.width,\n            height: pathStyle.height\n          }, itemStyle));\n        } else {\n          symbolPath.useStyle(itemStyle);\n          symbolPath.setColor(color);\n          symbolPath.style.strokeNoScale = true;\n        }\n        var defaultText = data.getStore().get(data.getDimensionIndex(symbolPath.__dimIdx), idx);\n        (defaultText == null || isNaN(defaultText)) && (defaultText = '');\n        setLabelStyle(symbolPath, getLabelStatesModels(itemModel), {\n          labelFetcher: data.hostModel,\n          labelDataIndex: idx,\n          labelDimIndex: symbolPath.__dimIdx,\n          defaultText: defaultText,\n          inheritColor: color,\n          defaultOpacity: itemStyle.opacity\n        });\n      });\n      toggleHoverEmphasis(itemGroup, emphasisModel.get('focus'), emphasisModel.get('blurScope'), emphasisModel.get('disabled'));\n    });\n    this._data = data;\n  };\n  RadarView.prototype.remove = function () {\n    this.group.removeAll();\n    this._data = null;\n  };\n  RadarView.type = 'radar';\n  return RadarView;\n}(ChartView);\nexport default RadarView;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport SeriesModel from '../../model/Series.js';\nimport createSeriesDataSimply from '../helper/createSeriesDataSimply.js';\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport LegendVisualProvider from '../../visual/LegendVisualProvider.js';\nimport { createTooltipMarkup, retrieveVisualColorForTooltipMarker } from '../../component/tooltip/tooltipMarkup.js';\nvar RadarSeriesModel = /** @class */function (_super) {\n  __extends(RadarSeriesModel, _super);\n  function RadarSeriesModel() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = RadarSeriesModel.type;\n    _this.hasSymbolVisual = true;\n    return _this;\n  }\n  // Overwrite\n  RadarSeriesModel.prototype.init = function (option) {\n    _super.prototype.init.apply(this, arguments);\n    // Enable legend selection for each data item\n    // Use a function instead of direct access because data reference may changed\n    this.legendVisualProvider = new LegendVisualProvider(zrUtil.bind(this.getData, this), zrUtil.bind(this.getRawData, this));\n  };\n  RadarSeriesModel.prototype.getInitialData = function (option, ecModel) {\n    return createSeriesDataSimply(this, {\n      generateCoord: 'indicator_',\n      generateCoordCount: Infinity\n    });\n  };\n  RadarSeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\n    var data = this.getData();\n    var coordSys = this.coordinateSystem;\n    var indicatorAxes = coordSys.getIndicatorAxes();\n    var name = this.getData().getName(dataIndex);\n    var nameToDisplay = name === '' ? this.name : name;\n    var markerColor = retrieveVisualColorForTooltipMarker(this, dataIndex);\n    return createTooltipMarkup('section', {\n      header: nameToDisplay,\n      sortBlocks: true,\n      blocks: zrUtil.map(indicatorAxes, function (axis) {\n        var val = data.get(data.mapDimension(axis.dim), dataIndex);\n        return createTooltipMarkup('nameValue', {\n          markerType: 'subItem',\n          markerColor: markerColor,\n          name: axis.name,\n          value: val,\n          sortParam: val\n        });\n      })\n    });\n  };\n  RadarSeriesModel.prototype.getTooltipPosition = function (dataIndex) {\n    if (dataIndex != null) {\n      var data_1 = this.getData();\n      var coordSys = this.coordinateSystem;\n      var values = data_1.getValues(zrUtil.map(coordSys.dimensions, function (dim) {\n        return data_1.mapDimension(dim);\n      }), dataIndex);\n      for (var i = 0, len = values.length; i < len; i++) {\n        if (!isNaN(values[i])) {\n          var indicatorAxes = coordSys.getIndicatorAxes();\n          return coordSys.coordToPoint(indicatorAxes[i].dataToCoord(values[i]), i);\n        }\n      }\n    }\n  };\n  RadarSeriesModel.type = 'series.radar';\n  RadarSeriesModel.dependencies = ['radar'];\n  RadarSeriesModel.defaultOption = {\n    // zlevel: 0,\n    z: 2,\n    colorBy: 'data',\n    coordinateSystem: 'radar',\n    legendHoverLink: true,\n    radarIndex: 0,\n    lineStyle: {\n      width: 2,\n      type: 'solid',\n      join: 'round'\n    },\n    label: {\n      position: 'top'\n    },\n    // areaStyle: {\n    // },\n    // itemStyle: {}\n    symbolSize: 8\n    // symbolRotate: null\n  };\n  return RadarSeriesModel;\n}(SeriesModel);\nexport default RadarSeriesModel;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport axisDefault from '../axisDefault.js';\nimport Model from '../../model/Model.js';\nimport { AxisModelCommonMixin } from '../axisModelCommonMixin.js';\nimport ComponentModel from '../../model/Component.js';\nimport tokens from '../../visual/tokens.js';\nvar valueAxisDefault = axisDefault.value;\nfunction defaultsShow(opt, show) {\n  return zrUtil.defaults({\n    show: show\n  }, opt);\n}\nvar RadarModel = /** @class */function (_super) {\n  __extends(RadarModel, _super);\n  function RadarModel() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = RadarModel.type;\n    return _this;\n  }\n  RadarModel.prototype.optionUpdated = function () {\n    var boundaryGap = this.get('boundaryGap');\n    var splitNumber = this.get('splitNumber');\n    var scale = this.get('scale');\n    var axisLine = this.get('axisLine');\n    var axisTick = this.get('axisTick');\n    // let axisType = this.get('axisType');\n    var axisLabel = this.get('axisLabel');\n    var nameTextStyle = this.get('axisName');\n    var showName = this.get(['axisName', 'show']);\n    var nameFormatter = this.get(['axisName', 'formatter']);\n    var nameGap = this.get('axisNameGap');\n    var triggerEvent = this.get('triggerEvent');\n    var indicatorModels = zrUtil.map(this.get('indicator') || [], function (indicatorOpt) {\n      // PENDING\n      if (indicatorOpt.max != null && indicatorOpt.max > 0 && !indicatorOpt.min) {\n        indicatorOpt.min = 0;\n      } else if (indicatorOpt.min != null && indicatorOpt.min < 0 && !indicatorOpt.max) {\n        indicatorOpt.max = 0;\n      }\n      var iNameTextStyle = nameTextStyle;\n      if (indicatorOpt.color != null) {\n        iNameTextStyle = zrUtil.defaults({\n          color: indicatorOpt.color\n        }, nameTextStyle);\n      }\n      // Use same configuration\n      var innerIndicatorOpt = zrUtil.merge(zrUtil.clone(indicatorOpt), {\n        boundaryGap: boundaryGap,\n        splitNumber: splitNumber,\n        scale: scale,\n        axisLine: axisLine,\n        axisTick: axisTick,\n        // axisType: axisType,\n        axisLabel: axisLabel,\n        // Compatible with 2 and use text\n        name: indicatorOpt.text,\n        showName: showName,\n        nameLocation: 'end',\n        nameGap: nameGap,\n        // min: 0,\n        nameTextStyle: iNameTextStyle,\n        triggerEvent: triggerEvent\n      }, false);\n      if (zrUtil.isString(nameFormatter)) {\n        var indName = innerIndicatorOpt.name;\n        innerIndicatorOpt.name = nameFormatter.replace('{value}', indName != null ? indName : '');\n      } else if (zrUtil.isFunction(nameFormatter)) {\n        innerIndicatorOpt.name = nameFormatter(innerIndicatorOpt.name, innerIndicatorOpt);\n      }\n      var model = new Model(innerIndicatorOpt, null, this.ecModel);\n      zrUtil.mixin(model, AxisModelCommonMixin.prototype);\n      // For triggerEvent.\n      model.mainType = 'radar';\n      model.componentIndex = this.componentIndex;\n      return model;\n    }, this);\n    this._indicatorModels = indicatorModels;\n  };\n  RadarModel.prototype.getIndicatorModels = function () {\n    return this._indicatorModels;\n  };\n  RadarModel.type = 'radar';\n  RadarModel.defaultOption = {\n    // zlevel: 0,\n    z: 0,\n    center: ['50%', '50%'],\n    radius: '50%',\n    startAngle: 90,\n    axisName: {\n      show: true,\n      color: tokens.color.axisLabel\n      // formatter: null\n      // textStyle: {}\n    },\n    boundaryGap: [0, 0],\n    splitNumber: 5,\n    axisNameGap: 15,\n    scale: false,\n    // Polygon or circle\n    shape: 'polygon',\n    axisLine: zrUtil.merge({\n      lineStyle: {\n        color: tokens.color.neutral20\n      }\n    }, valueAxisDefault.axisLine),\n    axisLabel: defaultsShow(valueAxisDefault.axisLabel, false),\n    axisTick: defaultsShow(valueAxisDefault.axisTick, false),\n    // axisType: 'value',\n    splitLine: defaultsShow(valueAxisDefault.splitLine, true),\n    splitArea: defaultsShow(valueAxisDefault.splitArea, true),\n    // {text, min, max}\n    indicator: []\n  };\n  return RadarModel;\n}(ComponentModel);\nexport default RadarModel;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport AxisBuilder from '../axis/AxisBuilder.js';\nimport * as graphic from '../../util/graphic.js';\nimport ComponentView from '../../view/Component.js';\nvar RadarView = /** @class */function (_super) {\n  __extends(RadarView, _super);\n  function RadarView() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = RadarView.type;\n    return _this;\n  }\n  RadarView.prototype.render = function (radarModel, ecModel, api) {\n    var group = this.group;\n    group.removeAll();\n    this._buildAxes(radarModel, api);\n    this._buildSplitLineAndArea(radarModel);\n  };\n  RadarView.prototype._buildAxes = function (radarModel, api) {\n    var radar = radarModel.coordinateSystem;\n    var indicatorAxes = radar.getIndicatorAxes();\n    var axisBuilders = zrUtil.map(indicatorAxes, function (indicatorAxis) {\n      var axisName = indicatorAxis.model.get('showName') ? indicatorAxis.name : ''; // hide name\n      var axisBuilder = new AxisBuilder(indicatorAxis.model, api, {\n        axisName: axisName,\n        position: [radar.cx, radar.cy],\n        rotation: indicatorAxis.angle,\n        labelDirection: -1,\n        tickDirection: -1,\n        nameDirection: 1\n      });\n      return axisBuilder;\n    });\n    zrUtil.each(axisBuilders, function (axisBuilder) {\n      axisBuilder.build();\n      this.group.add(axisBuilder.group);\n    }, this);\n  };\n  RadarView.prototype._buildSplitLineAndArea = function (radarModel) {\n    var radar = radarModel.coordinateSystem;\n    var indicatorAxes = radar.getIndicatorAxes();\n    if (!indicatorAxes.length) {\n      return;\n    }\n    var shape = radarModel.get('shape');\n    var splitLineModel = radarModel.getModel('splitLine');\n    var splitAreaModel = radarModel.getModel('splitArea');\n    var lineStyleModel = splitLineModel.getModel('lineStyle');\n    var areaStyleModel = splitAreaModel.getModel('areaStyle');\n    var showSplitLine = splitLineModel.get('show');\n    var showSplitArea = splitAreaModel.get('show');\n    var splitLineColors = lineStyleModel.get('color');\n    var splitAreaColors = areaStyleModel.get('color');\n    var splitLineColorsArr = zrUtil.isArray(splitLineColors) ? splitLineColors : [splitLineColors];\n    var splitAreaColorsArr = zrUtil.isArray(splitAreaColors) ? splitAreaColors : [splitAreaColors];\n    var splitLines = [];\n    var splitAreas = [];\n    function getColorIndex(areaOrLine, areaOrLineColorList, idx) {\n      var colorIndex = idx % areaOrLineColorList.length;\n      areaOrLine[colorIndex] = areaOrLine[colorIndex] || [];\n      return colorIndex;\n    }\n    if (shape === 'circle') {\n      var ticksRadius = indicatorAxes[0].getTicksCoords();\n      var cx = radar.cx;\n      var cy = radar.cy;\n      for (var i = 0; i < ticksRadius.length; i++) {\n        if (showSplitLine) {\n          var colorIndex = getColorIndex(splitLines, splitLineColorsArr, i);\n          splitLines[colorIndex].push(new graphic.Circle({\n            shape: {\n              cx: cx,\n              cy: cy,\n              r: ticksRadius[i].coord\n            }\n          }));\n        }\n        if (showSplitArea && i < ticksRadius.length - 1) {\n          var colorIndex = getColorIndex(splitAreas, splitAreaColorsArr, i);\n          splitAreas[colorIndex].push(new graphic.Ring({\n            shape: {\n              cx: cx,\n              cy: cy,\n              r0: ticksRadius[i].coord,\n              r: ticksRadius[i + 1].coord\n            }\n          }));\n        }\n      }\n    }\n    // Polyyon\n    else {\n      var realSplitNumber_1;\n      var axesTicksPoints = zrUtil.map(indicatorAxes, function (indicatorAxis, idx) {\n        var ticksCoords = indicatorAxis.getTicksCoords();\n        realSplitNumber_1 = realSplitNumber_1 == null ? ticksCoords.length - 1 : Math.min(ticksCoords.length - 1, realSplitNumber_1);\n        return zrUtil.map(ticksCoords, function (tickCoord) {\n          return radar.coordToPoint(tickCoord.coord, idx);\n        });\n      });\n      var prevPoints = [];\n      for (var i = 0; i <= realSplitNumber_1; i++) {\n        var points = [];\n        for (var j = 0; j < indicatorAxes.length; j++) {\n          points.push(axesTicksPoints[j][i]);\n        }\n        // Close\n        if (points[0]) {\n          points.push(points[0].slice());\n        } else {\n          if (process.env.NODE_ENV !== 'production') {\n            console.error('Can\\'t draw value axis ' + i);\n          }\n        }\n        if (showSplitLine) {\n          var colorIndex = getColorIndex(splitLines, splitLineColorsArr, i);\n          splitLines[colorIndex].push(new graphic.Polyline({\n            shape: {\n              points: points\n            }\n          }));\n        }\n        if (showSplitArea && prevPoints) {\n          var colorIndex = getColorIndex(splitAreas, splitAreaColorsArr, i - 1);\n          splitAreas[colorIndex].push(new graphic.Polygon({\n            shape: {\n              points: points.concat(prevPoints)\n            }\n          }));\n        }\n        prevPoints = points.slice().reverse();\n      }\n    }\n    var lineStyle = lineStyleModel.getLineStyle();\n    var areaStyle = areaStyleModel.getAreaStyle();\n    // Add splitArea before splitLine\n    zrUtil.each(splitAreas, function (splitAreas, idx) {\n      this.group.add(graphic.mergePath(splitAreas, {\n        style: zrUtil.defaults({\n          stroke: 'none',\n          fill: splitAreaColorsArr[idx % splitAreaColorsArr.length]\n        }, areaStyle),\n        silent: true\n      }));\n    }, this);\n    zrUtil.each(splitLines, function (splitLines, idx) {\n      this.group.add(graphic.mergePath(splitLines, {\n        style: zrUtil.defaults({\n          fill: 'none',\n          stroke: splitLineColorsArr[idx % splitLineColorsArr.length]\n        }, lineStyle),\n        silent: true\n      }));\n    }, this);\n  };\n  RadarView.type = 'radar';\n  return RadarView;\n}(ComponentView);\nexport default RadarView;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport Axis from '../Axis.js';\nvar IndicatorAxis = /** @class */function (_super) {\n  __extends(IndicatorAxis, _super);\n  function IndicatorAxis(dim, scale, radiusExtent) {\n    var _this = _super.call(this, dim, scale, radiusExtent) || this;\n    _this.type = 'value';\n    _this.angle = 0;\n    _this.name = '';\n    return _this;\n  }\n  return IndicatorAxis;\n}(Axis);\nexport default IndicatorAxis;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n// TODO clockwise\nimport IndicatorAxis from './IndicatorAxis.js';\nimport IntervalScale from '../../scale/Interval.js';\nimport * as numberUtil from '../../util/number.js';\nimport { map, each, isString, isNumber } from 'zrender/lib/core/util.js';\nimport { alignScaleTicks } from '../axisAlignTicks.js';\nimport { createBoxLayoutReference } from '../../util/layout.js';\nvar Radar = /** @class */function () {\n  function Radar(radarModel, ecModel, api) {\n    /**\n     *\n     * Radar dimensions\n     */\n    this.dimensions = [];\n    this._model = radarModel;\n    this._indicatorAxes = map(radarModel.getIndicatorModels(), function (indicatorModel, idx) {\n      var dim = 'indicator_' + idx;\n      var indicatorAxis = new IndicatorAxis(dim, new IntervalScale()\n      // (indicatorModel.get('axisType') === 'log') ? new LogScale() : new IntervalScale()\n      );\n      indicatorAxis.name = indicatorModel.get('name');\n      // Inject model and axis\n      indicatorAxis.model = indicatorModel;\n      indicatorModel.axis = indicatorAxis;\n      this.dimensions.push(dim);\n      return indicatorAxis;\n    }, this);\n    this.resize(radarModel, api);\n  }\n  Radar.prototype.getIndicatorAxes = function () {\n    return this._indicatorAxes;\n  };\n  Radar.prototype.dataToPoint = function (value, indicatorIndex) {\n    var indicatorAxis = this._indicatorAxes[indicatorIndex];\n    return this.coordToPoint(indicatorAxis.dataToCoord(value), indicatorIndex);\n  };\n  // TODO: API should be coordToPoint([coord, indicatorIndex])\n  Radar.prototype.coordToPoint = function (coord, indicatorIndex) {\n    var indicatorAxis = this._indicatorAxes[indicatorIndex];\n    var angle = indicatorAxis.angle;\n    var x = this.cx + coord * Math.cos(angle);\n    var y = this.cy - coord * Math.sin(angle);\n    return [x, y];\n  };\n  Radar.prototype.pointToData = function (pt) {\n    var dx = pt[0] - this.cx;\n    var dy = pt[1] - this.cy;\n    var radius = Math.sqrt(dx * dx + dy * dy);\n    dx /= radius;\n    dy /= radius;\n    var radian = Math.atan2(-dy, dx);\n    // Find the closest angle\n    // FIXME index can calculated directly\n    var minRadianDiff = Infinity;\n    var closestAxis;\n    var closestAxisIdx = -1;\n    for (var i = 0; i < this._indicatorAxes.length; i++) {\n      var indicatorAxis = this._indicatorAxes[i];\n      var diff = Math.abs(radian - indicatorAxis.angle);\n      if (diff < minRadianDiff) {\n        closestAxis = indicatorAxis;\n        closestAxisIdx = i;\n        minRadianDiff = diff;\n      }\n    }\n    return [closestAxisIdx, +(closestAxis && closestAxis.coordToData(radius))];\n  };\n  Radar.prototype.resize = function (radarModel, api) {\n    var refContainer = createBoxLayoutReference(radarModel, api).refContainer;\n    var center = radarModel.get('center');\n    var viewSize = Math.min(refContainer.width, refContainer.height) / 2;\n    this.cx = numberUtil.parsePercent(center[0], refContainer.width) + refContainer.x;\n    this.cy = numberUtil.parsePercent(center[1], refContainer.height) + refContainer.y;\n    this.startAngle = radarModel.get('startAngle') * Math.PI / 180;\n    // radius may be single value like `20`, `'80%'`, or array like `[10, '80%']`\n    var radius = radarModel.get('radius');\n    if (isString(radius) || isNumber(radius)) {\n      radius = [0, radius];\n    }\n    this.r0 = numberUtil.parsePercent(radius[0], viewSize);\n    this.r = numberUtil.parsePercent(radius[1], viewSize);\n    each(this._indicatorAxes, function (indicatorAxis, idx) {\n      indicatorAxis.setExtent(this.r0, this.r);\n      var angle = this.startAngle + idx * Math.PI * 2 / this._indicatorAxes.length;\n      // Normalize to [-PI, PI]\n      angle = Math.atan2(Math.sin(angle), Math.cos(angle));\n      indicatorAxis.angle = angle;\n    }, this);\n  };\n  Radar.prototype.update = function (ecModel, api) {\n    var indicatorAxes = this._indicatorAxes;\n    var radarModel = this._model;\n    each(indicatorAxes, function (indicatorAxis) {\n      indicatorAxis.scale.setExtent(Infinity, -Infinity);\n    });\n    ecModel.eachSeriesByType('radar', function (radarSeries, idx) {\n      if (radarSeries.get('coordinateSystem') !== 'radar'\n      // @ts-ignore\n      || ecModel.getComponent('radar', radarSeries.get('radarIndex')) !== radarModel) {\n        return;\n      }\n      var data = radarSeries.getData();\n      each(indicatorAxes, function (indicatorAxis) {\n        indicatorAxis.scale.unionExtentFromData(data, data.mapDimension(indicatorAxis.dim));\n      });\n    }, this);\n    var splitNumber = radarModel.get('splitNumber');\n    var dummyScale = new IntervalScale();\n    dummyScale.setExtent(0, splitNumber);\n    dummyScale.setInterval(1);\n    // Force all the axis fixing the maxSplitNumber.\n    each(indicatorAxes, function (indicatorAxis, idx) {\n      alignScaleTicks(indicatorAxis.scale, indicatorAxis.model, dummyScale);\n    });\n  };\n  Radar.prototype.convertToPixel = function (ecModel, finder, value) {\n    console.warn('Not implemented.');\n    return null;\n  };\n  Radar.prototype.convertFromPixel = function (ecModel, finder, pixel) {\n    console.warn('Not implemented.');\n    return null;\n  };\n  Radar.prototype.containPoint = function (point) {\n    console.warn('Not implemented.');\n    return false;\n  };\n  Radar.create = function (ecModel, api) {\n    var radarList = [];\n    ecModel.eachComponent('radar', function (radarModel) {\n      var radar = new Radar(radarModel, ecModel, api);\n      radarList.push(radar);\n      radarModel.coordinateSystem = radar;\n    });\n    ecModel.eachSeriesByType('radar', function (radarSeries) {\n      if (radarSeries.get('coordinateSystem') === 'radar') {\n        // Inject coordinate system\n        // @ts-ignore\n        radarSeries.coordinateSystem = radarList[radarSeries.get('radarIndex') || 0];\n      }\n    });\n    return radarList;\n  };\n  /**\n   * Radar dimensions is based on the data\n   */\n  Radar.dimensions = [];\n  return Radar;\n}();\nexport default Radar;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport RadarModel from '../../coord/radar/RadarModel.js';\nimport RadarView from './RadarView.js';\nimport Radar from '../../coord/radar/Radar.js';\nexport function install(registers) {\n  registers.registerCoordinateSystem('radar', Radar);\n  registers.registerComponentModel(RadarModel);\n  registers.registerComponentView(RadarView);\n  registers.registerVisual({\n    seriesType: 'radar',\n    reset: function (seriesModel) {\n      var data = seriesModel.getData();\n      // itemVisual symbol is for selected data\n      data.each(function (idx) {\n        data.setItemVisual(idx, 'legendIcon', 'roundRect');\n      });\n      // visual is for unselected data\n      data.setVisual('legendIcon', 'roundRect');\n    }\n  });\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { use } from '../../extension.js';\nimport radarLayout from '../radar/radarLayout.js';\nimport dataFilter from '../../processor/dataFilter.js';\nimport backwardCompat from '../radar/backwardCompat.js';\nimport RadarView from './RadarView.js';\nimport RadarSeriesModel from './RadarSeries.js';\nimport { install as installRadarComponent } from '../../component/radar/install.js';\nexport function install(registers) {\n  use(installRadarComponent);\n  registers.registerChartView(RadarView);\n  registers.registerSeriesModel(RadarSeriesModel);\n  registers.registerLayout(radarLayout);\n  registers.registerProcessor(dataFilter('radar'));\n  registers.registerPreprocessor(backwardCompat);\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as echarts from '../../core/echarts.js';\nimport { noop } from 'zrender/lib/core/util.js';\nimport { makeInner } from '../../util/model.js';\nvar inner = makeInner();\nexport function take(zr, resourceKey, userKey) {\n  inner(zr)[resourceKey] = userKey;\n}\nexport function release(zr, resourceKey, userKey) {\n  var store = inner(zr);\n  var uKey = store[resourceKey];\n  if (uKey === userKey) {\n    store[resourceKey] = null;\n  }\n}\nexport function isTaken(zr, resourceKey) {\n  return !!inner(zr)[resourceKey];\n}\n/**\n * payload: {\n *     type: 'takeGlobalCursor',\n *     key: 'dataZoomSelect', or 'brush', or ...,\n *         If no userKey, release global cursor.\n * }\n */\n// TODO: SELF REGISTERED.\necharts.registerAction({\n  type: 'takeGlobalCursor',\n  event: 'globalCursorTaken',\n  update: 'update'\n}, noop);", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { retrieveZInfo } from '../../util/graphic.js';\nvar IRRELEVANT_EXCLUDES = {\n  'axisPointer': 1,\n  'tooltip': 1,\n  'brush': 1\n};\n/**\n * Used on roam/brush triggering determination.\n * This is to avoid that: mouse clicking on an elements that is over geo or graph,\n * but roam is triggered unexpectedly.\n */\nexport function onIrrelevantElement(e, api, targetComponent) {\n  var eventElComponent = api.getComponentByElement(e.topTarget);\n  if (!eventElComponent || eventElComponent === targetComponent || IRRELEVANT_EXCLUDES.hasOwnProperty(eventElComponent.mainType)) {\n    return false;\n  }\n  // At present the `true` return is conservative. That is, the caller, such as a RoamController,\n  // is more likely to get a `false` return and start a roam behavior, becuase even if the\n  // `model.coordinateSystem` does not exist, the `e.topTarget` may be also a relevant element,\n  // such as axis split line/area or series elements, where roam should be available. Otherwise,\n  // if a dataZoom-served cartesian is full of series elements, the dataZoom-roaming can hardly\n  // be triggered.\n  var eventElCoordSys = eventElComponent.coordinateSystem;\n  // If eventElComponent is axisModel, it works only if it is injected with coordinateSystem.\n  if (!eventElCoordSys || eventElCoordSys.model === targetComponent) {\n    return false;\n  }\n  // e.g., if a cartesian is covered by a graph, the graph has a higher presedence in roam.\n  // A potential bad case is that RoamController does not prevent the cartesian from handling zr\n  // event, such as click and hovering, but it's fine so far.\n  // Aslo be conservative, if equals, return false.\n  var eventElCmptZInfo = retrieveZInfo(eventElComponent);\n  var targetCmptZInfo = retrieveZInfo(targetComponent);\n  if ((eventElCmptZInfo.zlevel - targetCmptZInfo.zlevel || eventElCmptZInfo.z - targetCmptZInfo.z) <= 0) {\n    return false;\n  }\n  return true;\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport Eventful from 'zrender/lib/core/Eventful.js';\nimport * as eventTool from 'zrender/lib/core/event.js';\nimport * as interactionMutex from './interactionMutex.js';\nimport { isString, bind, defaults, extend, retrieve2 } from 'zrender/lib/core/util.js';\nimport { makeInner } from '../../util/model.js';\nimport { retrieveZInfo } from '../../util/graphic.js';\nimport { onIrrelevantElement } from './cursorHelper.js';\n;\n/**\n * An manager of zoom and pan(darg) hehavior.\n * But it is not responsible for updating the view, since view updates vary and can\n * not be handled in a uniform way.\n *\n * Note: regarding view updates:\n *  - Transformabe views typically use `coord/View` (e.g., geo and series.graph roaming).\n *    Some commonly used view update logic has been organized into `roamHelper.ts`.\n *  - Non-transformable views handle updates themselves, possibly involving re-layout,\n *    (e.g., treemap).\n *  - Some scenarios do not require transformation (e.g., dataZoom roaming for cartesian,\n *    brush component).\n */\nvar RoamController = /** @class */function (_super) {\n  __extends(RoamController, _super);\n  function RoamController(zr) {\n    var _this = _super.call(this) || this;\n    _this._zr = zr;\n    // Avoid two roamController bind the same handler\n    var mousedownHandler = bind(_this._mousedownHandler, _this);\n    var mousemoveHandler = bind(_this._mousemoveHandler, _this);\n    var mouseupHandler = bind(_this._mouseupHandler, _this);\n    var mousewheelHandler = bind(_this._mousewheelHandler, _this);\n    var pinchHandler = bind(_this._pinchHandler, _this);\n    /**\n     * Notice:\n     *  - only enable needed types. For example, if 'zoom'\n     *    is not needed, 'zoom' should not be enabled, otherwise\n     *    default mousewheel behaviour (scroll page) will be disabled.\n     *  - This method is idempotent.\n     */\n    _this.enable = function (controlType, rawOpt) {\n      var zInfo = rawOpt.zInfo;\n      var _a = retrieveZInfo(zInfo.component),\n        z = _a.z,\n        zlevel = _a.zlevel;\n      var zInfoParsed = {\n        component: zInfo.component,\n        z: z,\n        zlevel: zlevel,\n        // By default roam controller is the lowest z2 comparing to other elememts in a component.\n        z2: retrieve2(zInfo.z2, -Infinity)\n      };\n      var triggerInfo = extend({}, rawOpt.triggerInfo);\n      this._opt = defaults(extend({}, rawOpt), {\n        zoomOnMouseWheel: true,\n        moveOnMouseMove: true,\n        // By default, wheel do not trigger move.\n        moveOnMouseWheel: false,\n        preventDefaultMouseMove: true,\n        zInfoParsed: zInfoParsed,\n        triggerInfo: triggerInfo\n      });\n      if (controlType == null) {\n        controlType = true;\n      }\n      // A handy optimization for repeatedly calling `enable` during roaming.\n      // Assert `disable` is only affected by `controlType`.\n      if (!this._enabled || this._controlType !== controlType) {\n        this._enabled = true;\n        // Disable previous first\n        this.disable();\n        if (controlType === true || controlType === 'move' || controlType === 'pan') {\n          addRoamZrListener(zr, 'mousedown', mousedownHandler, zInfoParsed);\n          addRoamZrListener(zr, 'mousemove', mousemoveHandler, zInfoParsed);\n          addRoamZrListener(zr, 'mouseup', mouseupHandler, zInfoParsed);\n        }\n        if (controlType === true || controlType === 'scale' || controlType === 'zoom') {\n          addRoamZrListener(zr, 'mousewheel', mousewheelHandler, zInfoParsed);\n          addRoamZrListener(zr, 'pinch', pinchHandler, zInfoParsed);\n        }\n      }\n    };\n    _this.disable = function () {\n      this._enabled = false;\n      removeRoamZrListener(zr, 'mousedown', mousedownHandler);\n      removeRoamZrListener(zr, 'mousemove', mousemoveHandler);\n      removeRoamZrListener(zr, 'mouseup', mouseupHandler);\n      removeRoamZrListener(zr, 'mousewheel', mousewheelHandler);\n      removeRoamZrListener(zr, 'pinch', pinchHandler);\n    };\n    return _this;\n  }\n  RoamController.prototype.isDragging = function () {\n    return this._dragging;\n  };\n  RoamController.prototype.isPinching = function () {\n    return this._pinching;\n  };\n  RoamController.prototype._checkPointer = function (e, x, y) {\n    var opt = this._opt;\n    var zInfoParsed = opt.zInfoParsed;\n    if (onIrrelevantElement(e, opt.api, zInfoParsed.component)) {\n      return false;\n    }\n    ;\n    var triggerInfo = opt.triggerInfo;\n    var roamTrigger = triggerInfo.roamTrigger;\n    var inArea = false;\n    if (roamTrigger === 'global') {\n      inArea = true;\n    }\n    if (!inArea) {\n      inArea = triggerInfo.isInSelf(e, x, y);\n    }\n    if (inArea && triggerInfo.isInClip && !triggerInfo.isInClip(e, x, y)) {\n      inArea = false;\n    }\n    return inArea;\n  };\n  RoamController.prototype._decideCursorStyle = function (e, x, y, forReverse) {\n    // If this cursor style decision is not strictly consistent with zrender,\n    // it's fine - zr will set the cursor on the next mousemove.\n    // This `grab` cursor style should take the lowest precedence. If the hovring element already\n    // have a cursor, zrender will set it to be non-'default' before entering this handler.\n    // (note, e.target is never silent, e.topTarget can be silent be irrelevant.)\n    var target = e.target;\n    if (!target && this._checkPointer(e, x, y)) {\n      // To indicate users that this area is draggable, otherwise users probably cannot kwown\n      // that when hovering out of the shape but still inside the bounding rect.\n      return 'grab';\n    }\n    if (forReverse) {\n      return target && target.cursor || 'default';\n    }\n  };\n  RoamController.prototype.dispose = function () {\n    this.disable();\n  };\n  RoamController.prototype._mousedownHandler = function (e) {\n    if (eventTool.isMiddleOrRightButtonOnMouseUpDown(e) || eventConsumed(e)) {\n      return;\n    }\n    var el = e.target;\n    while (el) {\n      if (el.draggable) {\n        return;\n      }\n      // check if host is draggable\n      el = el.__hostTarget || el.parent;\n    }\n    var x = e.offsetX;\n    var y = e.offsetY;\n    // To determine dragging start, only by checking on mosedown, but not mousemove.\n    // Mouse can be out of target when mouse moving.\n    if (this._checkPointer(e, x, y)) {\n      this._x = x;\n      this._y = y;\n      this._dragging = true;\n    }\n  };\n  RoamController.prototype._mousemoveHandler = function (e) {\n    var zr = this._zr;\n    if (e.gestureEvent === 'pinch' || interactionMutex.isTaken(zr, 'globalPan') || eventConsumed(e)) {\n      return;\n    }\n    var x = e.offsetX;\n    var y = e.offsetY;\n    if (!this._dragging || !isAvailableBehavior('moveOnMouseMove', e, this._opt)) {\n      var cursorStyle = this._decideCursorStyle(e, x, y, false);\n      if (cursorStyle) {\n        zr.setCursorStyle(cursorStyle);\n      }\n      return;\n    }\n    zr.setCursorStyle('grabbing');\n    var oldX = this._x;\n    var oldY = this._y;\n    var dx = x - oldX;\n    var dy = y - oldY;\n    this._x = x;\n    this._y = y;\n    if (this._opt.preventDefaultMouseMove) {\n      eventTool.stop(e.event);\n    }\n    e.__ecRoamConsumed = true;\n    trigger(this, 'pan', 'moveOnMouseMove', e, {\n      dx: dx,\n      dy: dy,\n      oldX: oldX,\n      oldY: oldY,\n      newX: x,\n      newY: y,\n      isAvailableBehavior: null\n    });\n  };\n  RoamController.prototype._mouseupHandler = function (e) {\n    if (eventConsumed(e)) {\n      return;\n    }\n    var zr = this._zr;\n    if (!eventTool.isMiddleOrRightButtonOnMouseUpDown(e)) {\n      this._dragging = false;\n      var cursorStyle = this._decideCursorStyle(e, e.offsetX, e.offsetY, true);\n      if (cursorStyle) {\n        zr.setCursorStyle(cursorStyle);\n      }\n    }\n  };\n  RoamController.prototype._mousewheelHandler = function (e) {\n    if (eventConsumed(e)) {\n      return;\n    }\n    var shouldZoom = isAvailableBehavior('zoomOnMouseWheel', e, this._opt);\n    var shouldMove = isAvailableBehavior('moveOnMouseWheel', e, this._opt);\n    var wheelDelta = e.wheelDelta;\n    var absWheelDeltaDelta = Math.abs(wheelDelta);\n    var originX = e.offsetX;\n    var originY = e.offsetY;\n    // wheelDelta maybe -0 in chrome mac.\n    if (wheelDelta === 0 || !shouldZoom && !shouldMove) {\n      return;\n    }\n    // If both `shouldZoom` and `shouldMove` is true, trigger\n    // their event both, and the final behavior is determined\n    // by event listener themselves.\n    if (shouldZoom) {\n      // Convenience:\n      // Mac and VM Windows on Mac: scroll up: zoom out.\n      // Windows: scroll up: zoom in.\n      // FIXME: Should do more test in different environment.\n      // wheelDelta is too complicated in difference nvironment\n      // (https://developer.mozilla.org/en-US/docs/Web/Events/mousewheel),\n      // although it has been normallized by zrender.\n      // wheelDelta of mouse wheel is bigger than touch pad.\n      var factor = absWheelDeltaDelta > 3 ? 1.4 : absWheelDeltaDelta > 1 ? 1.2 : 1.1;\n      var scale = wheelDelta > 0 ? factor : 1 / factor;\n      this._checkTriggerMoveZoom(this, 'zoom', 'zoomOnMouseWheel', e, {\n        scale: scale,\n        originX: originX,\n        originY: originY,\n        isAvailableBehavior: null\n      });\n    }\n    if (shouldMove) {\n      // FIXME: Should do more test in different environment.\n      var absDelta = Math.abs(wheelDelta);\n      // wheelDelta of mouse wheel is bigger than touch pad.\n      var scrollDelta = (wheelDelta > 0 ? 1 : -1) * (absDelta > 3 ? 0.4 : absDelta > 1 ? 0.15 : 0.05);\n      this._checkTriggerMoveZoom(this, 'scrollMove', 'moveOnMouseWheel', e, {\n        scrollDelta: scrollDelta,\n        originX: originX,\n        originY: originY,\n        isAvailableBehavior: null\n      });\n    }\n  };\n  RoamController.prototype._pinchHandler = function (e) {\n    if (interactionMutex.isTaken(this._zr, 'globalPan') || eventConsumed(e)) {\n      return;\n    }\n    var scale = e.pinchScale > 1 ? 1.1 : 1 / 1.1;\n    this._checkTriggerMoveZoom(this, 'zoom', null, e, {\n      scale: scale,\n      originX: e.pinchX,\n      originY: e.pinchY,\n      isAvailableBehavior: null\n    });\n  };\n  RoamController.prototype._checkTriggerMoveZoom = function (controller, eventName, behaviorToCheck, e, contollerEvent) {\n    if (controller._checkPointer(e, contollerEvent.originX, contollerEvent.originY)) {\n      // When mouse is out of roamController rect,\n      // default befavoius should not be be disabled, otherwise\n      // page sliding is disabled, contrary to expectation.\n      eventTool.stop(e.event);\n      e.__ecRoamConsumed = true;\n      trigger(controller, eventName, behaviorToCheck, e, contollerEvent);\n    }\n  };\n  return RoamController;\n}(Eventful);\nfunction eventConsumed(e) {\n  return e.__ecRoamConsumed;\n}\nvar innerZrStore = makeInner();\nfunction ensureZrStore(zr) {\n  var store = innerZrStore(zr);\n  store.roam = store.roam || {};\n  store.uniform = store.uniform || {};\n  return store;\n}\n/**\n * Listeners are sorted by z2/z/zlevel in descending order.\n * This decides the precedence between different roam controllers if they are overlapped.\n *\n * [MEMO]: It's not easy to perfectly reconcile the conflicts caused by overlap.\n *  - Consider cases:\n *    - Multiple roam controllers overlapped.\n *      - Usually only the topmost can trigger roam.\n *    - Roam controllers overlap with other zr elements:\n *      - zr elements are relevant or irrelevent to the host of the roam controller. e.g., axis split line\n *        or series elements is relevant to a cartesian and should trigger roam.\n *      - zr elements is above or below the roam controller host, which affects the precedence of interaction.\n *      - zr elements may not silent only for triggering tooltip by hovering, which is available to roam;\n *        or may not silent for click, where roam is not preferable.\n *  - Approach - `addRoamZrListener+pointerChecker+onIrrelevantElement` (currently used):\n *    - Resolve the precedence between different roam controllers\n *    - But cannot prevent the handling on other zr elements that under the roam controller in z-order.\n *  - Approach - \"use an invisible zr elements to receive the zr events to trigger roam\":\n *    - More complicated in impl.\n *    - May cause bad cases where zr event cannot be receive due to other non-silient zr elements covering it.\n */\nfunction addRoamZrListener(zr, eventType, listener, zInfoParsed) {\n  var store = ensureZrStore(zr);\n  var roam = store.roam;\n  var listenerList = roam[eventType] = roam[eventType] || [];\n  var idx = 0;\n  for (; idx < listenerList.length; idx++) {\n    var currZInfo = listenerList[idx].zInfoParsed;\n    if ((currZInfo.zlevel - zInfoParsed.zlevel || currZInfo.z - zInfoParsed.z || currZInfo.z2 - zInfoParsed.z2\n    // If all equals, the latter added one has a higher precedence.\n    ) <= 0) {\n      break;\n    }\n  }\n  listenerList.splice(idx, 0, {\n    listener: listener,\n    zInfoParsed: zInfoParsed\n  });\n  ensureUniformListener(zr, eventType);\n}\nfunction removeRoamZrListener(zr, eventType, listener) {\n  var store = ensureZrStore(zr);\n  var listenerList = store.roam[eventType] || [];\n  for (var idx = 0; idx < listenerList.length; idx++) {\n    if (listenerList[idx].listener === listener) {\n      listenerList.splice(idx, 1);\n      if (!listenerList.length) {\n        removeUniformListener(zr, eventType);\n      }\n      return;\n    }\n  }\n}\nfunction ensureUniformListener(zr, eventType) {\n  var store = ensureZrStore(zr);\n  if (!store.uniform[eventType]) {\n    zr.on(eventType, store.uniform[eventType] = function (event) {\n      var listenerList = store.roam[eventType];\n      if (listenerList) {\n        for (var i = 0; i < listenerList.length; i++) {\n          listenerList[i].listener(event);\n        }\n      }\n    });\n  }\n}\nfunction removeUniformListener(zr, eventType) {\n  var store = ensureZrStore(zr);\n  var uniform = store.uniform;\n  if (uniform[eventType]) {\n    zr.off(eventType, uniform[eventType]);\n    uniform[eventType] = null;\n  }\n}\nfunction trigger(controller, eventName, behaviorToCheck, e, contollerEvent) {\n  // Also provide behavior checker for event listener, for some case that\n  // multiple components share one listener.\n  contollerEvent.isAvailableBehavior = bind(isAvailableBehavior, null, behaviorToCheck, e);\n  // TODO should not have type issue.\n  controller.trigger(eventName, contollerEvent);\n}\n// settings: {\n//     zoomOnMouseWheel\n//     moveOnMouseMove\n//     moveOnMouseWheel\n// }\n// The value can be: true / false / 'shift' / 'ctrl' / 'alt'.\nfunction isAvailableBehavior(behaviorToCheck, e, settings) {\n  var setting = settings[behaviorToCheck];\n  return !behaviorToCheck || setting && (!isString(setting) || e.event[setting + 'Key']);\n}\nexport default RoamController;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { BoundingRect } from '../../util/graphic.js';\n/**\n * [CAVEAT] `updateViewOnPan` and `updateViewOnZoom` modifies the group transform directly,\n *  but the 'center' and 'zoom' in echarts option and 'View' coordinate system are not updated yet,\n *  which must be performed later in 'xxxRoam' action by calling `updateCenterAndZoom`.\n * @see {updateCenterAndZoomInAction}\n */\nexport function updateViewOnPan(controllerHost, dx, dy) {\n  var target = controllerHost.target;\n  target.x += dx;\n  target.y += dy;\n  target.dirty();\n}\nexport function updateViewOnZoom(controllerHost, zoomDelta, zoomX, zoomY) {\n  var target = controllerHost.target;\n  var zoomLimit = controllerHost.zoomLimit;\n  var newZoom = controllerHost.zoom = controllerHost.zoom || 1;\n  newZoom *= zoomDelta;\n  newZoom = clampByZoomLimit(newZoom, zoomLimit);\n  var zoomScale = newZoom / controllerHost.zoom;\n  controllerHost.zoom = newZoom;\n  zoomTransformableByOrigin(target, zoomX, zoomY, zoomScale);\n  target.dirty();\n}\n/**\n * A abstraction for some similar impl in roaming.\n */\nexport function updateController(seriesModel, api, pointerCheckerEl, controller, controllerHost, clipRect) {\n  var tmpRect = new BoundingRect(0, 0, 0, 0);\n  controller.enable(seriesModel.get('roam'), {\n    api: api,\n    zInfo: {\n      component: seriesModel\n    },\n    triggerInfo: {\n      roamTrigger: seriesModel.get('roamTrigger'),\n      isInSelf: function (e, x, y) {\n        tmpRect.copy(pointerCheckerEl.getBoundingRect());\n        tmpRect.applyTransform(pointerCheckerEl.getComputedTransform());\n        return tmpRect.contain(x, y);\n      },\n      isInClip: function (e, x, y) {\n        return !clipRect || clipRect.contain(x, y);\n      }\n    }\n  });\n  controllerHost.zoomLimit = seriesModel.get('scaleLimit');\n  var coordinate = seriesModel.coordinateSystem;\n  controllerHost.zoom = coordinate ? coordinate.getZoom() : 1;\n  var type = seriesModel.subType + 'Roam';\n  controller.off('pan').off('zoom').on('pan', function (e) {\n    updateViewOnPan(controllerHost, e.dx, e.dy);\n    api.dispatchAction({\n      seriesId: seriesModel.id,\n      type: type,\n      dx: e.dx,\n      dy: e.dy\n    });\n  }).on('zoom', function (e) {\n    /**\n     * FIXME: should do nothing except `api.dispatchAction` here, the other logic\n     *  should be performed in the action handler and `updateTransform`; otherwise,\n     *  they are inconsistent if user triggers this action explicitly.\n     */\n    updateViewOnZoom(controllerHost, e.scale, e.originX, e.originY);\n    api.dispatchAction({\n      seriesId: seriesModel.id,\n      type: type,\n      zoom: e.scale,\n      originX: e.originX,\n      originY: e.originY\n    });\n    // Only update label layout on zoom\n    api.updateLabelLayout();\n  });\n}\nfunction getCenterCoord(view, point) {\n  // Use projected coord as center because it's linear.\n  return view.pointToProjected ? view.pointToProjected(point) : view.pointToData(point);\n}\n/**\n * Should be called only in action handler.\n * @see {updateViewOnPan|updateViewOnZoom}\n */\nexport function updateCenterAndZoomInAction(view, payload, zoomLimit) {\n  var previousZoom = view.getZoom();\n  var center = view.getCenter();\n  var deltaZoom = payload.zoom;\n  var point = view.projectedToPoint ? view.projectedToPoint(center) : view.dataToPoint(center);\n  if (payload.dx != null && payload.dy != null) {\n    point[0] -= payload.dx;\n    point[1] -= payload.dy;\n    view.setCenter(getCenterCoord(view, point));\n  }\n  if (deltaZoom != null) {\n    deltaZoom = clampByZoomLimit(previousZoom * deltaZoom, zoomLimit) / previousZoom;\n    zoomTransformableByOrigin(view, payload.originX, payload.originY, deltaZoom);\n    view.updateTransform();\n    // [NOTICE] Tricky: `getCetnerCoord` uses `this.invTransform` modified by the `updateTransform` above.\n    view.setCenter(getCenterCoord(view, point));\n    view.setZoom(deltaZoom * previousZoom);\n  }\n  return {\n    center: view.getCenter(),\n    zoom: view.getZoom()\n  };\n}\nfunction zoomTransformableByOrigin(target, originX, originY, deltaZoom) {\n  // Keep the mouse center when scaling.\n  target.x -= (originX - target.x) * (deltaZoom - 1);\n  target.y -= (originY - target.y) * (deltaZoom - 1);\n  target.scaleX *= deltaZoom;\n  target.scaleY *= deltaZoom;\n}\nexport function clampByZoomLimit(zoom, zoomLimit) {\n  if (zoomLimit) {\n    var zoomMin = zoomLimit.min || 0;\n    var zoomMax = zoomLimit.max || Infinity;\n    zoom = Math.max(Math.min(zoomMax, zoom), zoomMin);\n  }\n  return zoom;\n}", "import { isString } from '../core/util.js';\nexport function parseXML(svg) {\n    if (isString(svg)) {\n        var parser = new DOMParser();\n        svg = parser.parseFromString(svg, 'text/xml');\n    }\n    var svgNode = svg;\n    if (svgNode.nodeType === 9) {\n        svgNode = svgNode.firstChild;\n    }\n    while (svgNode.nodeName.toLowerCase() !== 'svg' || svgNode.nodeType !== 1) {\n        svgNode = svgNode.nextSibling;\n    }\n    return svgNode;\n}\n", "import Group from '../graphic/Group.js';\nimport ZRImage from '../graphic/Image.js';\nimport Circle from '../graphic/shape/Circle.js';\nimport Rect from '../graphic/shape/Rect.js';\nimport Ellipse from '../graphic/shape/Ellipse.js';\nimport Line from '../graphic/shape/Line.js';\nimport Polygon from '../graphic/shape/Polygon.js';\nimport Polyline from '../graphic/shape/Polyline.js';\nimport * as matrix from '../core/matrix.js';\nimport { createFromString } from './path.js';\nimport { defaults, trim, each, map, keys, hasOwn } from '../core/util.js';\nimport LinearGradient from '../graphic/LinearGradient.js';\nimport RadialGradient from '../graphic/RadialGradient.js';\nimport TSpan from '../graphic/TSpan.js';\nimport { parseXML } from './parseXML.js';\nimport * as colorTool from './color.js';\n;\nvar nodeParsers;\nvar INHERITABLE_STYLE_ATTRIBUTES_MAP = {\n    'fill': 'fill',\n    'stroke': 'stroke',\n    'stroke-width': 'lineWidth',\n    'opacity': 'opacity',\n    'fill-opacity': 'fillOpacity',\n    'stroke-opacity': 'strokeOpacity',\n    'stroke-dasharray': 'lineDash',\n    'stroke-dashoffset': 'lineDashOffset',\n    'stroke-linecap': 'lineCap',\n    'stroke-linejoin': 'lineJoin',\n    'stroke-miterlimit': 'miterLimit',\n    'font-family': 'fontFamily',\n    'font-size': 'fontSize',\n    'font-style': 'fontStyle',\n    'font-weight': 'fontWeight',\n    'text-anchor': 'textAlign',\n    'visibility': 'visibility',\n    'display': 'display'\n};\nvar INHERITABLE_STYLE_ATTRIBUTES_MAP_KEYS = keys(INHERITABLE_STYLE_ATTRIBUTES_MAP);\nvar SELF_STYLE_ATTRIBUTES_MAP = {\n    'alignment-baseline': 'textBaseline',\n    'stop-color': 'stopColor'\n};\nvar SELF_STYLE_ATTRIBUTES_MAP_KEYS = keys(SELF_STYLE_ATTRIBUTES_MAP);\nvar SVGParser = (function () {\n    function SVGParser() {\n        this._defs = {};\n        this._root = null;\n    }\n    SVGParser.prototype.parse = function (xml, opt) {\n        opt = opt || {};\n        var svg = parseXML(xml);\n        if (process.env.NODE_ENV !== 'production') {\n            if (!svg) {\n                throw new Error('Illegal svg');\n            }\n        }\n        this._defsUsePending = [];\n        var root = new Group();\n        this._root = root;\n        var named = [];\n        var viewBox = svg.getAttribute('viewBox') || '';\n        var width = parseFloat((svg.getAttribute('width') || opt.width));\n        var height = parseFloat((svg.getAttribute('height') || opt.height));\n        isNaN(width) && (width = null);\n        isNaN(height) && (height = null);\n        parseAttributes(svg, root, null, true, false);\n        var child = svg.firstChild;\n        while (child) {\n            this._parseNode(child, root, named, null, false, false);\n            child = child.nextSibling;\n        }\n        applyDefs(this._defs, this._defsUsePending);\n        this._defsUsePending = [];\n        var viewBoxRect;\n        var viewBoxTransform;\n        if (viewBox) {\n            var viewBoxArr = splitNumberSequence(viewBox);\n            if (viewBoxArr.length >= 4) {\n                viewBoxRect = {\n                    x: parseFloat((viewBoxArr[0] || 0)),\n                    y: parseFloat((viewBoxArr[1] || 0)),\n                    width: parseFloat(viewBoxArr[2]),\n                    height: parseFloat(viewBoxArr[3])\n                };\n            }\n        }\n        if (viewBoxRect && width != null && height != null) {\n            viewBoxTransform = makeViewBoxTransform(viewBoxRect, { x: 0, y: 0, width: width, height: height });\n            if (!opt.ignoreViewBox) {\n                var elRoot = root;\n                root = new Group();\n                root.add(elRoot);\n                elRoot.scaleX = elRoot.scaleY = viewBoxTransform.scale;\n                elRoot.x = viewBoxTransform.x;\n                elRoot.y = viewBoxTransform.y;\n            }\n        }\n        if (!opt.ignoreRootClip && width != null && height != null) {\n            root.setClipPath(new Rect({\n                shape: { x: 0, y: 0, width: width, height: height }\n            }));\n        }\n        return {\n            root: root,\n            width: width,\n            height: height,\n            viewBoxRect: viewBoxRect,\n            viewBoxTransform: viewBoxTransform,\n            named: named\n        };\n    };\n    SVGParser.prototype._parseNode = function (xmlNode, parentGroup, named, namedFrom, isInDefs, isInText) {\n        var nodeName = xmlNode.nodeName.toLowerCase();\n        var el;\n        var namedFromForSub = namedFrom;\n        if (nodeName === 'defs') {\n            isInDefs = true;\n        }\n        if (nodeName === 'text') {\n            isInText = true;\n        }\n        if (nodeName === 'defs' || nodeName === 'switch') {\n            el = parentGroup;\n        }\n        else {\n            if (!isInDefs) {\n                var parser_1 = nodeParsers[nodeName];\n                if (parser_1 && hasOwn(nodeParsers, nodeName)) {\n                    el = parser_1.call(this, xmlNode, parentGroup);\n                    var nameAttr = xmlNode.getAttribute('name');\n                    if (nameAttr) {\n                        var newNamed = {\n                            name: nameAttr,\n                            namedFrom: null,\n                            svgNodeTagLower: nodeName,\n                            el: el\n                        };\n                        named.push(newNamed);\n                        if (nodeName === 'g') {\n                            namedFromForSub = newNamed;\n                        }\n                    }\n                    else if (namedFrom) {\n                        named.push({\n                            name: namedFrom.name,\n                            namedFrom: namedFrom,\n                            svgNodeTagLower: nodeName,\n                            el: el\n                        });\n                    }\n                    parentGroup.add(el);\n                }\n            }\n            var parser = paintServerParsers[nodeName];\n            if (parser && hasOwn(paintServerParsers, nodeName)) {\n                var def = parser.call(this, xmlNode);\n                var id = xmlNode.getAttribute('id');\n                if (id) {\n                    this._defs[id] = def;\n                }\n            }\n        }\n        if (el && el.isGroup) {\n            var child = xmlNode.firstChild;\n            while (child) {\n                if (child.nodeType === 1) {\n                    this._parseNode(child, el, named, namedFromForSub, isInDefs, isInText);\n                }\n                else if (child.nodeType === 3 && isInText) {\n                    this._parseText(child, el);\n                }\n                child = child.nextSibling;\n            }\n        }\n    };\n    SVGParser.prototype._parseText = function (xmlNode, parentGroup) {\n        var text = new TSpan({\n            style: {\n                text: xmlNode.textContent\n            },\n            silent: true,\n            x: this._textX || 0,\n            y: this._textY || 0\n        });\n        inheritStyle(parentGroup, text);\n        parseAttributes(xmlNode, text, this._defsUsePending, false, false);\n        applyTextAlignment(text, parentGroup);\n        var textStyle = text.style;\n        var fontSize = textStyle.fontSize;\n        if (fontSize && fontSize < 9) {\n            textStyle.fontSize = 9;\n            text.scaleX *= fontSize / 9;\n            text.scaleY *= fontSize / 9;\n        }\n        var font = (textStyle.fontSize || textStyle.fontFamily) && [\n            textStyle.fontStyle,\n            textStyle.fontWeight,\n            (textStyle.fontSize || 12) + 'px',\n            textStyle.fontFamily || 'sans-serif'\n        ].join(' ');\n        textStyle.font = font;\n        var rect = text.getBoundingRect();\n        this._textX += rect.width;\n        parentGroup.add(text);\n        return text;\n    };\n    SVGParser.internalField = (function () {\n        nodeParsers = {\n            'g': function (xmlNode, parentGroup) {\n                var g = new Group();\n                inheritStyle(parentGroup, g);\n                parseAttributes(xmlNode, g, this._defsUsePending, false, false);\n                return g;\n            },\n            'rect': function (xmlNode, parentGroup) {\n                var rect = new Rect();\n                inheritStyle(parentGroup, rect);\n                parseAttributes(xmlNode, rect, this._defsUsePending, false, false);\n                rect.setShape({\n                    x: parseFloat(xmlNode.getAttribute('x') || '0'),\n                    y: parseFloat(xmlNode.getAttribute('y') || '0'),\n                    width: parseFloat(xmlNode.getAttribute('width') || '0'),\n                    height: parseFloat(xmlNode.getAttribute('height') || '0')\n                });\n                rect.silent = true;\n                return rect;\n            },\n            'circle': function (xmlNode, parentGroup) {\n                var circle = new Circle();\n                inheritStyle(parentGroup, circle);\n                parseAttributes(xmlNode, circle, this._defsUsePending, false, false);\n                circle.setShape({\n                    cx: parseFloat(xmlNode.getAttribute('cx') || '0'),\n                    cy: parseFloat(xmlNode.getAttribute('cy') || '0'),\n                    r: parseFloat(xmlNode.getAttribute('r') || '0')\n                });\n                circle.silent = true;\n                return circle;\n            },\n            'line': function (xmlNode, parentGroup) {\n                var line = new Line();\n                inheritStyle(parentGroup, line);\n                parseAttributes(xmlNode, line, this._defsUsePending, false, false);\n                line.setShape({\n                    x1: parseFloat(xmlNode.getAttribute('x1') || '0'),\n                    y1: parseFloat(xmlNode.getAttribute('y1') || '0'),\n                    x2: parseFloat(xmlNode.getAttribute('x2') || '0'),\n                    y2: parseFloat(xmlNode.getAttribute('y2') || '0')\n                });\n                line.silent = true;\n                return line;\n            },\n            'ellipse': function (xmlNode, parentGroup) {\n                var ellipse = new Ellipse();\n                inheritStyle(parentGroup, ellipse);\n                parseAttributes(xmlNode, ellipse, this._defsUsePending, false, false);\n                ellipse.setShape({\n                    cx: parseFloat(xmlNode.getAttribute('cx') || '0'),\n                    cy: parseFloat(xmlNode.getAttribute('cy') || '0'),\n                    rx: parseFloat(xmlNode.getAttribute('rx') || '0'),\n                    ry: parseFloat(xmlNode.getAttribute('ry') || '0')\n                });\n                ellipse.silent = true;\n                return ellipse;\n            },\n            'polygon': function (xmlNode, parentGroup) {\n                var pointsStr = xmlNode.getAttribute('points');\n                var pointsArr;\n                if (pointsStr) {\n                    pointsArr = parsePoints(pointsStr);\n                }\n                var polygon = new Polygon({\n                    shape: {\n                        points: pointsArr || []\n                    },\n                    silent: true\n                });\n                inheritStyle(parentGroup, polygon);\n                parseAttributes(xmlNode, polygon, this._defsUsePending, false, false);\n                return polygon;\n            },\n            'polyline': function (xmlNode, parentGroup) {\n                var pointsStr = xmlNode.getAttribute('points');\n                var pointsArr;\n                if (pointsStr) {\n                    pointsArr = parsePoints(pointsStr);\n                }\n                var polyline = new Polyline({\n                    shape: {\n                        points: pointsArr || []\n                    },\n                    silent: true\n                });\n                inheritStyle(parentGroup, polyline);\n                parseAttributes(xmlNode, polyline, this._defsUsePending, false, false);\n                return polyline;\n            },\n            'image': function (xmlNode, parentGroup) {\n                var img = new ZRImage();\n                inheritStyle(parentGroup, img);\n                parseAttributes(xmlNode, img, this._defsUsePending, false, false);\n                img.setStyle({\n                    image: xmlNode.getAttribute('xlink:href') || xmlNode.getAttribute('href'),\n                    x: +xmlNode.getAttribute('x'),\n                    y: +xmlNode.getAttribute('y'),\n                    width: +xmlNode.getAttribute('width'),\n                    height: +xmlNode.getAttribute('height')\n                });\n                img.silent = true;\n                return img;\n            },\n            'text': function (xmlNode, parentGroup) {\n                var x = xmlNode.getAttribute('x') || '0';\n                var y = xmlNode.getAttribute('y') || '0';\n                var dx = xmlNode.getAttribute('dx') || '0';\n                var dy = xmlNode.getAttribute('dy') || '0';\n                this._textX = parseFloat(x) + parseFloat(dx);\n                this._textY = parseFloat(y) + parseFloat(dy);\n                var g = new Group();\n                inheritStyle(parentGroup, g);\n                parseAttributes(xmlNode, g, this._defsUsePending, false, true);\n                return g;\n            },\n            'tspan': function (xmlNode, parentGroup) {\n                var x = xmlNode.getAttribute('x');\n                var y = xmlNode.getAttribute('y');\n                if (x != null) {\n                    this._textX = parseFloat(x);\n                }\n                if (y != null) {\n                    this._textY = parseFloat(y);\n                }\n                var dx = xmlNode.getAttribute('dx') || '0';\n                var dy = xmlNode.getAttribute('dy') || '0';\n                var g = new Group();\n                inheritStyle(parentGroup, g);\n                parseAttributes(xmlNode, g, this._defsUsePending, false, true);\n                this._textX += parseFloat(dx);\n                this._textY += parseFloat(dy);\n                return g;\n            },\n            'path': function (xmlNode, parentGroup) {\n                var d = xmlNode.getAttribute('d') || '';\n                var path = createFromString(d);\n                inheritStyle(parentGroup, path);\n                parseAttributes(xmlNode, path, this._defsUsePending, false, false);\n                path.silent = true;\n                return path;\n            }\n        };\n    })();\n    return SVGParser;\n}());\nvar paintServerParsers = {\n    'lineargradient': function (xmlNode) {\n        var x1 = parseInt(xmlNode.getAttribute('x1') || '0', 10);\n        var y1 = parseInt(xmlNode.getAttribute('y1') || '0', 10);\n        var x2 = parseInt(xmlNode.getAttribute('x2') || '10', 10);\n        var y2 = parseInt(xmlNode.getAttribute('y2') || '0', 10);\n        var gradient = new LinearGradient(x1, y1, x2, y2);\n        parsePaintServerUnit(xmlNode, gradient);\n        parseGradientColorStops(xmlNode, gradient);\n        return gradient;\n    },\n    'radialgradient': function (xmlNode) {\n        var cx = parseInt(xmlNode.getAttribute('cx') || '0', 10);\n        var cy = parseInt(xmlNode.getAttribute('cy') || '0', 10);\n        var r = parseInt(xmlNode.getAttribute('r') || '0', 10);\n        var gradient = new RadialGradient(cx, cy, r);\n        parsePaintServerUnit(xmlNode, gradient);\n        parseGradientColorStops(xmlNode, gradient);\n        return gradient;\n    }\n};\nfunction parsePaintServerUnit(xmlNode, gradient) {\n    var gradientUnits = xmlNode.getAttribute('gradientUnits');\n    if (gradientUnits === 'userSpaceOnUse') {\n        gradient.global = true;\n    }\n}\nfunction parseGradientColorStops(xmlNode, gradient) {\n    var stop = xmlNode.firstChild;\n    while (stop) {\n        if (stop.nodeType === 1\n            && stop.nodeName.toLocaleLowerCase() === 'stop') {\n            var offsetStr = stop.getAttribute('offset');\n            var offset = void 0;\n            if (offsetStr && offsetStr.indexOf('%') > 0) {\n                offset = parseInt(offsetStr, 10) / 100;\n            }\n            else if (offsetStr) {\n                offset = parseFloat(offsetStr);\n            }\n            else {\n                offset = 0;\n            }\n            var styleVals = {};\n            parseInlineStyle(stop, styleVals, styleVals);\n            var stopColor = styleVals.stopColor\n                || stop.getAttribute('stop-color')\n                || '#000000';\n            var stopOpacity = styleVals.stopOpacity\n                || stop.getAttribute('stop-opacity');\n            if (stopOpacity) {\n                var rgba = colorTool.parse(stopColor);\n                var stopColorOpacity = rgba && rgba[3];\n                if (stopColorOpacity) {\n                    rgba[3] *= colorTool.parseCssFloat(stopOpacity);\n                    stopColor = colorTool.stringify(rgba, 'rgba');\n                }\n            }\n            gradient.colorStops.push({\n                offset: offset,\n                color: stopColor\n            });\n        }\n        stop = stop.nextSibling;\n    }\n}\nfunction inheritStyle(parent, child) {\n    if (parent && parent.__inheritedStyle) {\n        if (!child.__inheritedStyle) {\n            child.__inheritedStyle = {};\n        }\n        defaults(child.__inheritedStyle, parent.__inheritedStyle);\n    }\n}\nfunction parsePoints(pointsString) {\n    var list = splitNumberSequence(pointsString);\n    var points = [];\n    for (var i = 0; i < list.length; i += 2) {\n        var x = parseFloat(list[i]);\n        var y = parseFloat(list[i + 1]);\n        points.push([x, y]);\n    }\n    return points;\n}\nfunction parseAttributes(xmlNode, el, defsUsePending, onlyInlineStyle, isTextGroup) {\n    var disp = el;\n    var inheritedStyle = disp.__inheritedStyle = disp.__inheritedStyle || {};\n    var selfStyle = {};\n    if (xmlNode.nodeType === 1) {\n        parseTransformAttribute(xmlNode, el);\n        parseInlineStyle(xmlNode, inheritedStyle, selfStyle);\n        if (!onlyInlineStyle) {\n            parseAttributeStyle(xmlNode, inheritedStyle, selfStyle);\n        }\n    }\n    disp.style = disp.style || {};\n    if (inheritedStyle.fill != null) {\n        disp.style.fill = getFillStrokeStyle(disp, 'fill', inheritedStyle.fill, defsUsePending);\n    }\n    if (inheritedStyle.stroke != null) {\n        disp.style.stroke = getFillStrokeStyle(disp, 'stroke', inheritedStyle.stroke, defsUsePending);\n    }\n    each([\n        'lineWidth', 'opacity', 'fillOpacity', 'strokeOpacity', 'miterLimit', 'fontSize'\n    ], function (propName) {\n        if (inheritedStyle[propName] != null) {\n            disp.style[propName] = parseFloat(inheritedStyle[propName]);\n        }\n    });\n    each([\n        'lineDashOffset', 'lineCap', 'lineJoin', 'fontWeight', 'fontFamily', 'fontStyle', 'textAlign'\n    ], function (propName) {\n        if (inheritedStyle[propName] != null) {\n            disp.style[propName] = inheritedStyle[propName];\n        }\n    });\n    if (isTextGroup) {\n        disp.__selfStyle = selfStyle;\n    }\n    if (inheritedStyle.lineDash) {\n        disp.style.lineDash = map(splitNumberSequence(inheritedStyle.lineDash), function (str) {\n            return parseFloat(str);\n        });\n    }\n    if (inheritedStyle.visibility === 'hidden' || inheritedStyle.visibility === 'collapse') {\n        disp.invisible = true;\n    }\n    if (inheritedStyle.display === 'none') {\n        disp.ignore = true;\n    }\n}\nfunction applyTextAlignment(text, parentGroup) {\n    var parentSelfStyle = parentGroup.__selfStyle;\n    if (parentSelfStyle) {\n        var textBaseline = parentSelfStyle.textBaseline;\n        var zrTextBaseline = textBaseline;\n        if (!textBaseline || textBaseline === 'auto') {\n            zrTextBaseline = 'alphabetic';\n        }\n        else if (textBaseline === 'baseline') {\n            zrTextBaseline = 'alphabetic';\n        }\n        else if (textBaseline === 'before-edge' || textBaseline === 'text-before-edge') {\n            zrTextBaseline = 'top';\n        }\n        else if (textBaseline === 'after-edge' || textBaseline === 'text-after-edge') {\n            zrTextBaseline = 'bottom';\n        }\n        else if (textBaseline === 'central' || textBaseline === 'mathematical') {\n            zrTextBaseline = 'middle';\n        }\n        text.style.textBaseline = zrTextBaseline;\n    }\n    var parentInheritedStyle = parentGroup.__inheritedStyle;\n    if (parentInheritedStyle) {\n        var textAlign = parentInheritedStyle.textAlign;\n        var zrTextAlign = textAlign;\n        if (textAlign) {\n            if (textAlign === 'middle') {\n                zrTextAlign = 'center';\n            }\n            text.style.textAlign = zrTextAlign;\n        }\n    }\n}\nvar urlRegex = /^url\\(\\s*#(.*?)\\)/;\nfunction getFillStrokeStyle(el, method, str, defsUsePending) {\n    var urlMatch = str && str.match(urlRegex);\n    if (urlMatch) {\n        var url = trim(urlMatch[1]);\n        defsUsePending.push([el, method, url]);\n        return;\n    }\n    if (str === 'none') {\n        str = null;\n    }\n    return str;\n}\nfunction applyDefs(defs, defsUsePending) {\n    for (var i = 0; i < defsUsePending.length; i++) {\n        var item = defsUsePending[i];\n        item[0].style[item[1]] = defs[item[2]];\n    }\n}\nvar numberReg = /-?([0-9]*\\.)?[0-9]+([eE]-?[0-9]+)?/g;\nfunction splitNumberSequence(rawStr) {\n    return rawStr.match(numberReg) || [];\n}\nvar transformRegex = /(translate|scale|rotate|skewX|skewY|matrix)\\(([\\-\\s0-9\\.eE,]*)\\)/g;\nvar DEGREE_TO_ANGLE = Math.PI / 180;\nfunction parseTransformAttribute(xmlNode, node) {\n    var transform = xmlNode.getAttribute('transform');\n    if (transform) {\n        transform = transform.replace(/,/g, ' ');\n        var transformOps_1 = [];\n        var mt = null;\n        transform.replace(transformRegex, function (str, type, value) {\n            transformOps_1.push(type, value);\n            return '';\n        });\n        for (var i = transformOps_1.length - 1; i > 0; i -= 2) {\n            var value = transformOps_1[i];\n            var type = transformOps_1[i - 1];\n            var valueArr = splitNumberSequence(value);\n            mt = mt || matrix.create();\n            switch (type) {\n                case 'translate':\n                    matrix.translate(mt, mt, [parseFloat(valueArr[0]), parseFloat(valueArr[1] || '0')]);\n                    break;\n                case 'scale':\n                    matrix.scale(mt, mt, [parseFloat(valueArr[0]), parseFloat(valueArr[1] || valueArr[0])]);\n                    break;\n                case 'rotate':\n                    matrix.rotate(mt, mt, -parseFloat(valueArr[0]) * DEGREE_TO_ANGLE, [\n                        parseFloat(valueArr[1] || '0'),\n                        parseFloat(valueArr[2] || '0')\n                    ]);\n                    break;\n                case 'skewX':\n                    var sx = Math.tan(parseFloat(valueArr[0]) * DEGREE_TO_ANGLE);\n                    matrix.mul(mt, [1, 0, sx, 1, 0, 0], mt);\n                    break;\n                case 'skewY':\n                    var sy = Math.tan(parseFloat(valueArr[0]) * DEGREE_TO_ANGLE);\n                    matrix.mul(mt, [1, sy, 0, 1, 0, 0], mt);\n                    break;\n                case 'matrix':\n                    mt[0] = parseFloat(valueArr[0]);\n                    mt[1] = parseFloat(valueArr[1]);\n                    mt[2] = parseFloat(valueArr[2]);\n                    mt[3] = parseFloat(valueArr[3]);\n                    mt[4] = parseFloat(valueArr[4]);\n                    mt[5] = parseFloat(valueArr[5]);\n                    break;\n            }\n        }\n        node.setLocalTransform(mt);\n    }\n}\nvar styleRegex = /([^\\s:;]+)\\s*:\\s*([^:;]+)/g;\nfunction parseInlineStyle(xmlNode, inheritableStyleResult, selfStyleResult) {\n    var style = xmlNode.getAttribute('style');\n    if (!style) {\n        return;\n    }\n    styleRegex.lastIndex = 0;\n    var styleRegResult;\n    while ((styleRegResult = styleRegex.exec(style)) != null) {\n        var svgStlAttr = styleRegResult[1];\n        var zrInheritableStlAttr = hasOwn(INHERITABLE_STYLE_ATTRIBUTES_MAP, svgStlAttr)\n            ? INHERITABLE_STYLE_ATTRIBUTES_MAP[svgStlAttr]\n            : null;\n        if (zrInheritableStlAttr) {\n            inheritableStyleResult[zrInheritableStlAttr] = styleRegResult[2];\n        }\n        var zrSelfStlAttr = hasOwn(SELF_STYLE_ATTRIBUTES_MAP, svgStlAttr)\n            ? SELF_STYLE_ATTRIBUTES_MAP[svgStlAttr]\n            : null;\n        if (zrSelfStlAttr) {\n            selfStyleResult[zrSelfStlAttr] = styleRegResult[2];\n        }\n    }\n}\nfunction parseAttributeStyle(xmlNode, inheritableStyleResult, selfStyleResult) {\n    for (var i = 0; i < INHERITABLE_STYLE_ATTRIBUTES_MAP_KEYS.length; i++) {\n        var svgAttrName = INHERITABLE_STYLE_ATTRIBUTES_MAP_KEYS[i];\n        var attrValue = xmlNode.getAttribute(svgAttrName);\n        if (attrValue != null) {\n            inheritableStyleResult[INHERITABLE_STYLE_ATTRIBUTES_MAP[svgAttrName]] = attrValue;\n        }\n    }\n    for (var i = 0; i < SELF_STYLE_ATTRIBUTES_MAP_KEYS.length; i++) {\n        var svgAttrName = SELF_STYLE_ATTRIBUTES_MAP_KEYS[i];\n        var attrValue = xmlNode.getAttribute(svgAttrName);\n        if (attrValue != null) {\n            selfStyleResult[SELF_STYLE_ATTRIBUTES_MAP[svgAttrName]] = attrValue;\n        }\n    }\n}\nexport function makeViewBoxTransform(viewBoxRect, boundingRect) {\n    var scaleX = boundingRect.width / viewBoxRect.width;\n    var scaleY = boundingRect.height / viewBoxRect.height;\n    var scale = Math.min(scaleX, scaleY);\n    return {\n        scale: scale,\n        x: -(viewBoxRect.x + viewBoxRect.width / 2) * scale + (boundingRect.x + boundingRect.width / 2),\n        y: -(viewBoxRect.y + viewBoxRect.height / 2) * scale + (boundingRect.y + boundingRect.height / 2)\n    };\n}\nexport function parseSVG(xml, opt) {\n    var parser = new SVGParser();\n    return parser.parse(xml, opt);\n}\nexport { parseXML };\n", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { parseSVG, makeViewBoxTransform } from 'zrender/lib/tool/parseSVG.js';\nimport Group from 'zrender/lib/graphic/Group.js';\nimport Rect from 'zrender/lib/graphic/shape/Rect.js';\nimport { assert, createHashMap, each } from 'zrender/lib/core/util.js';\nimport BoundingRect from 'zrender/lib/core/BoundingRect.js';\nimport { parseXML } from 'zrender/lib/tool/parseXML.js';\nimport { GeoSVGRegion } from './Region.js';\n/**\n * \"region available\" means that: enable users to set attribute `name=\"xxx\"` on those tags\n * to make it be a region.\n * 1. region styles and its label styles can be defined in echarts opton:\n * ```js\n * geo: {\n *     regions: [{\n *         name: 'xxx',\n *         itemStyle: { ... },\n *         label: { ... }\n *     }, {\n *         ...\n *     },\n *     ...]\n * };\n * ```\n * 2. name can be duplicated in different SVG tag. All of the tags with the same name share\n * a region option. For exampel if there are two <path> representing two lung lobes. They have\n * no common parents but both of them need to display label \"lung\" inside.\n */\nvar REGION_AVAILABLE_SVG_TAG_MAP = createHashMap(['rect', 'circle', 'line', 'ellipse', 'polygon', 'polyline', 'path',\n// <text> <tspan> are also enabled because some SVG might paint text itself,\n// but still need to trigger events or tooltip.\n'text', 'tspan',\n// <g> is also enabled because this case: if multiple tags share one name\n// and need label displayed, every tags will display the name, which is not\n// expected. So we can put them into a <g name=\"xxx\">. Thereby only one label\n// displayed and located based on the bounding rect of the <g>.\n'g']);\nvar GeoSVGResource = /** @class */function () {\n  function GeoSVGResource(mapName, svg) {\n    this.type = 'geoSVG';\n    // All used graphics. key: hostKey, value: root\n    this._usedGraphicMap = createHashMap();\n    // All unused graphics.\n    this._freedGraphics = [];\n    this._mapName = mapName;\n    // Only perform parse to XML object here, which might be time\n    // consiming for large SVG.\n    // Although convert XML to zrender element is also time consiming,\n    // if we do it here, the clone of zrender elements has to be\n    // required. So we do it once for each geo instance, util real\n    // performance issues call for optimizing it.\n    this._parsedXML = parseXML(svg);\n  }\n  GeoSVGResource.prototype.load = function /* nameMap: NameMap */\n  () {\n    // In the \"load\" stage, graphic need to be built to\n    // get boundingRect for geo coordinate system.\n    var firstGraphic = this._firstGraphic;\n    // Create the return data structure only when first graphic created.\n    // Because they will be used in geo coordinate system update stage,\n    // and `regions` will be mounted at `geo` coordinate system,\n    // in which there is no \"view\" info, so that it should better not to\n    // make references to graphic elements.\n    if (!firstGraphic) {\n      firstGraphic = this._firstGraphic = this._buildGraphic(this._parsedXML);\n      this._freedGraphics.push(firstGraphic);\n      this._boundingRect = this._firstGraphic.boundingRect.clone();\n      // PENDING: `nameMap` will not be supported until some real requirement come.\n      // if (nameMap) {\n      //     named = applyNameMap(named, nameMap);\n      // }\n      var _a = createRegions(firstGraphic.named),\n        regions = _a.regions,\n        regionsMap = _a.regionsMap;\n      this._regions = regions;\n      this._regionsMap = regionsMap;\n    }\n    return {\n      boundingRect: this._boundingRect,\n      regions: this._regions,\n      regionsMap: this._regionsMap\n    };\n  };\n  GeoSVGResource.prototype._buildGraphic = function (svgXML) {\n    var result;\n    var rootFromParse;\n    try {\n      result = svgXML && parseSVG(svgXML, {\n        ignoreViewBox: true,\n        ignoreRootClip: true\n      }) || {};\n      rootFromParse = result.root;\n      assert(rootFromParse != null);\n    } catch (e) {\n      throw new Error('Invalid svg format\\n' + e.message);\n    }\n    // Note: we keep the covenant that the root has no transform. So always add an extra root.\n    var root = new Group();\n    root.add(rootFromParse);\n    root.isGeoSVGGraphicRoot = true;\n    // [THE_RULE_OF_VIEWPORT_AND_VIEWBOX]\n    //\n    // Consider: `<svg width=\"...\" height=\"...\" viewBox=\"...\">`\n    // - the `width/height` we call it `svgWidth/svgHeight` for short.\n    // - `(0, 0, svgWidth, svgHeight)` defines the viewport of the SVG, or say,\n    //   \"viewport boundingRect\", or `boundingRect` for short.\n    // - `viewBox` defines the transform from the real content ot the viewport.\n    //   `viewBox` has the same unit as the content of SVG.\n    //   If `viewBox` exists, a transform is defined, so the unit of `svgWidth/svgHeight` become\n    //   different from the content of SVG. Otherwise, they are the same.\n    //\n    // If both `svgWidth/svgHeight/viewBox` are specified in a SVG file, the transform rule will be:\n    // 0. `boundingRect` is `(0, 0, svgWidth, svgHeight)`. Set it to Geo['_rect'] (View['_rect']).\n    // 1. Make a transform from `viewBox` to `boundingRect`.\n    //    Note: only support `preserveAspectRatio 'xMidYMid'` here. That is, this transform will preserve\n    //    the aspect ratio.\n    // 2. Make a transform from boundingRect to Geo['_viewRect'] (View['_viewRect'])\n    //    (`Geo`/`View` will do this job).\n    //    Note: this transform might not preserve aspect radio, which depending on how users specify\n    //    viewRect in echarts option (e.g., `geo.left/top/width/height` will not preserve aspect ratio,\n    //    but `geo.layoutCenter/layoutSize` will preserve aspect ratio).\n    //\n    // If `svgWidth/svgHeight` not specified, we use `viewBox` as the `boundingRect` to make the SVG\n    // layout look good.\n    //\n    // If neither `svgWidth/svgHeight` nor `viewBox` are not specified, we calculate the boundingRect\n    // of the SVG content and use them to make SVG layout look good.\n    var svgWidth = result.width;\n    var svgHeight = result.height;\n    var viewBoxRect = result.viewBoxRect;\n    var boundingRect = this._boundingRect;\n    if (!boundingRect) {\n      var bRectX = void 0;\n      var bRectY = void 0;\n      var bRectWidth = void 0;\n      var bRectHeight = void 0;\n      if (svgWidth != null) {\n        bRectX = 0;\n        bRectWidth = svgWidth;\n      } else if (viewBoxRect) {\n        bRectX = viewBoxRect.x;\n        bRectWidth = viewBoxRect.width;\n      }\n      if (svgHeight != null) {\n        bRectY = 0;\n        bRectHeight = svgHeight;\n      } else if (viewBoxRect) {\n        bRectY = viewBoxRect.y;\n        bRectHeight = viewBoxRect.height;\n      }\n      // If both viewBox and svgWidth/svgHeight not specified,\n      // we have to determine how to layout those element to make them look good.\n      if (bRectX == null || bRectY == null) {\n        var calculatedBoundingRect = rootFromParse.getBoundingRect();\n        if (bRectX == null) {\n          bRectX = calculatedBoundingRect.x;\n          bRectWidth = calculatedBoundingRect.width;\n        }\n        if (bRectY == null) {\n          bRectY = calculatedBoundingRect.y;\n          bRectHeight = calculatedBoundingRect.height;\n        }\n      }\n      boundingRect = this._boundingRect = new BoundingRect(bRectX, bRectY, bRectWidth, bRectHeight);\n    }\n    if (viewBoxRect) {\n      var viewBoxTransform = makeViewBoxTransform(viewBoxRect, boundingRect);\n      // Only support `preserveAspectRatio 'xMidYMid'`\n      rootFromParse.scaleX = rootFromParse.scaleY = viewBoxTransform.scale;\n      rootFromParse.x = viewBoxTransform.x;\n      rootFromParse.y = viewBoxTransform.y;\n    }\n    // SVG needs to clip based on `viewBox`. And some SVG files really rely on this feature.\n    // They do not strictly confine all of the content inside a display rect, but deliberately\n    // use a `viewBox` to define a displayable rect.\n    // PENDING:\n    // The drawback of the `setClipPath` here is: the region label (genereted by echarts) near the\n    // edge might also be clipped, because region labels are put as `textContent` of the SVG path.\n    root.setClipPath(new Rect({\n      shape: boundingRect.plain()\n    }));\n    var named = [];\n    each(result.named, function (namedItem) {\n      if (REGION_AVAILABLE_SVG_TAG_MAP.get(namedItem.svgNodeTagLower) != null) {\n        named.push(namedItem);\n        setSilent(namedItem.el);\n      }\n    });\n    return {\n      root: root,\n      boundingRect: boundingRect,\n      named: named\n    };\n  };\n  /**\n   * Consider:\n   * (1) One graphic element can not be shared by different `geoView` running simultaneously.\n   *     Notice, also need to consider multiple echarts instances share a `mapRecord`.\n   * (2) Converting SVG to graphic elements is time consuming.\n   * (3) In the current architecture, `load` should be called frequently to get boundingRect,\n   *     and it is called without view info.\n   * So we maintain graphic elements in this module, and enables `view` to use/return these\n   * graphics from/to the pool with it's uid.\n   */\n  GeoSVGResource.prototype.useGraphic = function (hostKey /* , nameMap: NameMap */) {\n    var usedRootMap = this._usedGraphicMap;\n    var svgGraphic = usedRootMap.get(hostKey);\n    if (svgGraphic) {\n      return svgGraphic;\n    }\n    svgGraphic = this._freedGraphics.pop()\n    // use the first boundingRect to avoid duplicated boundingRect calculation.\n    || this._buildGraphic(this._parsedXML);\n    usedRootMap.set(hostKey, svgGraphic);\n    // PENDING: `nameMap` will not be supported until some real requirement come.\n    // `nameMap` can only be obtained from echarts option.\n    // The original `named` must not be modified.\n    // if (nameMap) {\n    //     svgGraphic = extend({}, svgGraphic);\n    //     svgGraphic.named = applyNameMap(svgGraphic.named, nameMap);\n    // }\n    return svgGraphic;\n  };\n  GeoSVGResource.prototype.freeGraphic = function (hostKey) {\n    var usedRootMap = this._usedGraphicMap;\n    var svgGraphic = usedRootMap.get(hostKey);\n    if (svgGraphic) {\n      usedRootMap.removeKey(hostKey);\n      this._freedGraphics.push(svgGraphic);\n    }\n  };\n  return GeoSVGResource;\n}();\nexport { GeoSVGResource };\nfunction setSilent(el) {\n  // Only named element has silent: false, other elements should\n  // act as background and has no user interaction.\n  el.silent = false;\n  // text|tspan will be converted to group.\n  if (el.isGroup) {\n    el.traverse(function (child) {\n      child.silent = false;\n    });\n  }\n}\nfunction createRegions(named) {\n  var regions = [];\n  var regionsMap = createHashMap();\n  // Create resions only for the first graphic.\n  each(named, function (namedItem) {\n    // Region has feature to calculate center for tooltip or other features.\n    // If there is a <g name=\"xxx\">, the center should be the center of the\n    // bounding rect of the g.\n    if (namedItem.namedFrom != null) {\n      return;\n    }\n    var region = new GeoSVGRegion(namedItem.name, namedItem.el);\n    // PENDING: if `nameMap` supported, this region can not be mounted on\n    // `this`, but can only be created each time `load()` called.\n    regions.push(region);\n    // PENDING: if multiple tag named with the same name, only one will be\n    // found by `_regionsMap`. `_regionsMap` is used to find a coordinate\n    // by name. We use `region.getCenter()` as the coordinate.\n    regionsMap.set(namedItem.name, region);\n  });\n  return {\n    regions: regions,\n    regionsMap: regionsMap\n  };\n}\n// PENDING: `nameMap` will not be supported until some real requirement come.\n// /**\n//  * Use the alias in geoNameMap.\n//  * The input `named` must not be modified.\n//  */\n// function applyNameMap(\n//     named: GeoSVGGraphicRecord['named'],\n//     nameMap: NameMap\n// ): GeoSVGGraphicRecord['named'] {\n//     const result = [] as GeoSVGGraphicRecord['named'];\n//     for (let i = 0; i < named.length; i++) {\n//         let regionGraphic = named[i];\n//         const name = regionGraphic.name;\n//         if (nameMap && nameMap.hasOwnProperty(name)) {\n//             regionGraphic = extend({}, regionGraphic);\n//             regionGraphic.name = name;\n//         }\n//         result.push(regionGraphic);\n//     }\n//     return result;\n// }", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n// Fix for \u5357\u6D77\u8BF8\u5C9B\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { GeoJSONRegion } from '../Region.js';\nvar geoCoord = [126, 25];\nvar nanhaiName = '\u5357\u6D77\u8BF8\u5C9B';\nvar points = [[[0, 3.5], [7, 11.2], [15, 11.9], [30, 7], [42, 0.7], [52, 0.7], [56, 7.7], [59, 0.7], [64, 0.7], [64, 0], [5, 0], [0, 3.5]], [[13, 16.1], [19, 14.7], [16, 21.7], [11, 23.1], [13, 16.1]], [[12, 32.2], [14, 38.5], [15, 38.5], [13, 32.2], [12, 32.2]], [[16, 47.6], [12, 53.2], [13, 53.2], [18, 47.6], [16, 47.6]], [[6, 64.4], [8, 70], [9, 70], [8, 64.4], [6, 64.4]], [[23, 82.6], [29, 79.8], [30, 79.8], [25, 82.6], [23, 82.6]], [[37, 70.7], [43, 62.3], [44, 62.3], [39, 70.7], [37, 70.7]], [[48, 51.1], [51, 45.5], [53, 45.5], [50, 51.1], [48, 51.1]], [[51, 35], [51, 28.7], [53, 28.7], [53, 35], [51, 35]], [[52, 22.4], [55, 17.5], [56, 17.5], [53, 22.4], [52, 22.4]], [[58, 12.6], [62, 7], [63, 7], [60, 12.6], [58, 12.6]], [[0, 3.5], [0, 93.1], [64, 93.1], [64, 0], [63, 0], [63, 92.4], [1, 92.4], [1, 3.5], [0, 3.5]]];\nfor (var i = 0; i < points.length; i++) {\n  for (var k = 0; k < points[i].length; k++) {\n    points[i][k][0] /= 10.5;\n    points[i][k][1] /= -10.5 / 0.75;\n    points[i][k][0] += geoCoord[0];\n    points[i][k][1] += geoCoord[1];\n  }\n}\nexport default function fixNanhai(mapType, regions) {\n  if (mapType === 'china') {\n    for (var i = 0; i < regions.length; i++) {\n      // Already exists.\n      if (regions[i].name === nanhaiName) {\n        return;\n      }\n    }\n    regions.push(new GeoJSONRegion(nanhaiName, zrUtil.map(points, function (exterior) {\n      return {\n        type: 'polygon',\n        exterior: exterior\n      };\n    }), geoCoord));\n  }\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nvar coordsOffsetMap = {\n  '\u5357\u6D77\u8BF8\u5C9B': [32, 80],\n  // \u5168\u56FD\n  '\u5E7F\u4E1C': [0, -10],\n  '\u9999\u6E2F': [10, 5],\n  '\u6FB3\u95E8': [-10, 10],\n  // '\u5317\u4EAC': [-10, 0],\n  '\u5929\u6D25': [5, 5]\n};\nexport default function fixTextCoords(mapType, region) {\n  if (mapType === 'china') {\n    var coordFix = coordsOffsetMap[region.name];\n    if (coordFix) {\n      var cp = region.getCenter();\n      cp[0] += coordFix[0] / 10.5;\n      cp[1] += -coordFix[1] / (10.5 / 0.75);\n      region.setCenter(cp);\n    }\n  }\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n// Fix for \u9493\u9C7C\u5C9B\n// let Region = require('../Region');\n// let zrUtil = require('zrender/lib/core/util');\n// let geoCoord = [126, 25];\nvar points = [[[123.45165252685547, 25.73527164402261], [123.49731445312499, 25.73527164402261], [123.49731445312499, 25.750734064600884], [123.45165252685547, 25.750734064600884], [123.45165252685547, 25.73527164402261]]];\nexport default function fixDiaoyuIsland(mapType, region) {\n  if (mapType === 'china' && region.name === '\u53F0\u6E7E') {\n    region.geometries.push({\n      type: 'polygon',\n      exterior: points[0]\n    });\n  }\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { each, isString, createHashMap, hasOwn } from 'zrender/lib/core/util.js';\nimport parseGeoJson from './parseGeoJson.js';\n// Built-in GEO fixer.\nimport fixNanhai from './fix/nanhai.js';\nimport fixTextCoord from './fix/textCoord.js';\nimport fixDiaoyuIsland from './fix/diaoyuIsland.js';\nimport BoundingRect from 'zrender/lib/core/BoundingRect.js';\nvar DEFAULT_NAME_PROPERTY = 'name';\nvar GeoJSONResource = /** @class */function () {\n  function GeoJSONResource(mapName, geoJSON, specialAreas) {\n    this.type = 'geoJSON';\n    this._parsedMap = createHashMap();\n    this._mapName = mapName;\n    this._specialAreas = specialAreas;\n    // PENDING: delay the parse to the first usage to rapid up the FMP?\n    this._geoJSON = parseInput(geoJSON);\n  }\n  /**\n   * @param nameMap can be null/undefined\n   * @param nameProperty can be null/undefined\n   */\n  GeoJSONResource.prototype.load = function (nameMap, nameProperty) {\n    nameProperty = nameProperty || DEFAULT_NAME_PROPERTY;\n    var parsed = this._parsedMap.get(nameProperty);\n    if (!parsed) {\n      var rawRegions = this._parseToRegions(nameProperty);\n      parsed = this._parsedMap.set(nameProperty, {\n        regions: rawRegions,\n        boundingRect: calculateBoundingRect(rawRegions)\n      });\n    }\n    var regionsMap = createHashMap();\n    var finalRegions = [];\n    each(parsed.regions, function (region) {\n      var regionName = region.name;\n      // Try use the alias in geoNameMap\n      if (nameMap && hasOwn(nameMap, regionName)) {\n        region = region.cloneShallow(regionName = nameMap[regionName]);\n      }\n      finalRegions.push(region);\n      regionsMap.set(regionName, region);\n    });\n    return {\n      regions: finalRegions,\n      boundingRect: parsed.boundingRect || new BoundingRect(0, 0, 0, 0),\n      regionsMap: regionsMap\n    };\n  };\n  GeoJSONResource.prototype._parseToRegions = function (nameProperty) {\n    var mapName = this._mapName;\n    var geoJSON = this._geoJSON;\n    var rawRegions;\n    // https://jsperf.com/try-catch-performance-overhead\n    try {\n      rawRegions = geoJSON ? parseGeoJson(geoJSON, nameProperty) : [];\n    } catch (e) {\n      throw new Error('Invalid geoJson format\\n' + e.message);\n    }\n    fixNanhai(mapName, rawRegions);\n    each(rawRegions, function (region) {\n      var regionName = region.name;\n      fixTextCoord(mapName, region);\n      fixDiaoyuIsland(mapName, region);\n      // Some area like Alaska in USA map needs to be tansformed\n      // to look better\n      var specialArea = this._specialAreas && this._specialAreas[regionName];\n      if (specialArea) {\n        region.transformTo(specialArea.left, specialArea.top, specialArea.width, specialArea.height);\n      }\n    }, this);\n    return rawRegions;\n  };\n  /**\n   * Only for exporting to users.\n   * **MUST NOT** used internally.\n   */\n  GeoJSONResource.prototype.getMapForUser = function () {\n    return {\n      // For backward compatibility, use geoJson\n      // PENDING: it has been returning them without clone.\n      // do we need to avoid outsite modification?\n      geoJson: this._geoJSON,\n      geoJSON: this._geoJSON,\n      specialAreas: this._specialAreas\n    };\n  };\n  return GeoJSONResource;\n}();\nexport { GeoJSONResource };\nfunction calculateBoundingRect(regions) {\n  var rect;\n  for (var i = 0; i < regions.length; i++) {\n    var regionRect = regions[i].getBoundingRect();\n    rect = rect || regionRect.clone();\n    rect.union(regionRect);\n  }\n  return rect;\n}\nfunction parseInput(source) {\n  return !isString(source) ? source : typeof JSON !== 'undefined' && JSON.parse ? JSON.parse(source) : new Function('return (' + source + ');')();\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { createHashMap } from 'zrender/lib/core/util.js';\nimport { GeoSVGResource } from './GeoSVGResource.js';\nimport { GeoJSONResource } from './GeoJSONResource.js';\nvar storage = createHashMap();\nexport default {\n  /**\n   * Compatible with previous `echarts.registerMap`.\n   *\n   * @usage\n   * ```js\n   *\n   * echarts.registerMap('USA', geoJson, specialAreas);\n   *\n   * echarts.registerMap('USA', {\n   *     geoJson: geoJson,\n   *     specialAreas: {...}\n   * });\n   * echarts.registerMap('USA', {\n   *     geoJSON: geoJson,\n   *     specialAreas: {...}\n   * });\n   *\n   * echarts.registerMap('airport', {\n   *     svg: svg\n   * }\n   * ```\n   *\n   * Note:\n   * Do not support that register multiple geoJSON or SVG\n   * one map name. Because different geoJSON and SVG have\n   * different unit. It's not easy to make sure how those\n   * units are mapping/normalize.\n   * If intending to use multiple geoJSON or SVG, we can\n   * use multiple geo coordinate system.\n   */\n  registerMap: function (mapName, rawDef, rawSpecialAreas) {\n    if (rawDef.svg) {\n      var resource = new GeoSVGResource(mapName, rawDef.svg);\n      storage.set(mapName, resource);\n    } else {\n      // Recommend:\n      //     echarts.registerMap('eu', { geoJSON: xxx, specialAreas: xxx });\n      // Backward compatibility:\n      //     echarts.registerMap('eu', geoJSON, specialAreas);\n      //     echarts.registerMap('eu', { geoJson: xxx, specialAreas: xxx });\n      var geoJSON = rawDef.geoJson || rawDef.geoJSON;\n      if (geoJSON && !rawDef.features) {\n        rawSpecialAreas = rawDef.specialAreas;\n      } else {\n        geoJSON = rawDef;\n      }\n      var resource = new GeoJSONResource(mapName, geoJSON, rawSpecialAreas);\n      storage.set(mapName, resource);\n    }\n  },\n  getGeoResource: function (mapName) {\n    return storage.get(mapName);\n  },\n  /**\n   * Only for exporting to users.\n   * **MUST NOT** used internally.\n   */\n  getMapForUser: function (mapName) {\n    var resource = storage.get(mapName);\n    // Do not support return SVG until some real requirement come.\n    return resource && resource.type === 'geoJSON' && resource.getMapForUser();\n  },\n  load: function (mapName, nameMap, nameProperty) {\n    var resource = storage.get(mapName);\n    if (!resource) {\n      if (process.env.NODE_ENV !== 'production') {\n        console.error('Map ' + mapName + ' not exists. The GeoJSON of the map must be provided.');\n      }\n      return;\n    }\n    return resource.load(nameMap, nameProperty);\n  }\n};", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport RoamController from './RoamController.js';\nimport * as roamHelper from '../../component/helper/roamHelper.js';\nimport * as graphic from '../../util/graphic.js';\nimport { toggleHoverEmphasis, enableComponentHighDownFeatures, setDefaultStateProxy } from '../../util/states.js';\nimport geoSourceManager from '../../coord/geo/geoSourceManager.js';\nimport { getUID } from '../../util/component.js';\nimport { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle.js';\nimport { getECData } from '../../util/innerStore.js';\nimport { createOrUpdatePatternFromDecal } from '../../util/decal.js';\nimport Displayable from 'zrender/lib/graphic/Displayable.js';\nimport { makeInner } from '../../util/model.js';\n/**\n * Only these tags enable use `itemStyle` if they are named in SVG.\n * Other tags like <text> <tspan> <image> might not suitable for `itemStyle`.\n * They will not be considered to be styled until some requirements come.\n */\nvar OPTION_STYLE_ENABLED_TAGS = ['rect', 'circle', 'line', 'ellipse', 'polygon', 'polyline', 'path'];\nvar OPTION_STYLE_ENABLED_TAG_MAP = zrUtil.createHashMap(OPTION_STYLE_ENABLED_TAGS);\nvar STATE_TRIGGER_TAG_MAP = zrUtil.createHashMap(OPTION_STYLE_ENABLED_TAGS.concat(['g']));\nvar LABEL_HOST_MAP = zrUtil.createHashMap(OPTION_STYLE_ENABLED_TAGS.concat(['g']));\nvar mapLabelRaw = makeInner();\nfunction getFixedItemStyle(model) {\n  var itemStyle = model.getItemStyle();\n  var areaColor = model.get('areaColor');\n  // If user want the color not to be changed when hover,\n  // they should both set areaColor and color to be null.\n  if (areaColor != null) {\n    itemStyle.fill = areaColor;\n  }\n  return itemStyle;\n}\n// Only stroke can be used for line.\n// Using fill in style if stroke not exits.\n// TODO Not sure yet. Perhaps a separate `lineStyle`?\nfunction fixLineStyle(styleHost) {\n  var style = styleHost.style;\n  if (style) {\n    style.stroke = style.stroke || style.fill;\n    style.fill = null;\n  }\n}\nvar MapDraw = /** @class */function () {\n  function MapDraw(api) {\n    var group = this.group = new graphic.Group();\n    var transformGroup = this._transformGroup = new graphic.Group();\n    group.add(transformGroup);\n    this.uid = getUID('ec_map_draw');\n    this._controller = new RoamController(api.getZr());\n    this._controllerHost = {\n      target: transformGroup\n    };\n    transformGroup.add(this._regionsGroup = new graphic.Group());\n    transformGroup.add(this._svgGroup = new graphic.Group());\n  }\n  MapDraw.prototype.draw = function (mapOrGeoModel, ecModel, api, fromView, payload) {\n    var isGeo = mapOrGeoModel.mainType === 'geo';\n    // Map series has data. GEO model that controlled by map series\n    // will be assigned with map data. Other GEO model has no data.\n    var data = mapOrGeoModel.getData && mapOrGeoModel.getData();\n    isGeo && ecModel.eachComponent({\n      mainType: 'series',\n      subType: 'map'\n    }, function (mapSeries) {\n      if (!data && mapSeries.getHostGeoModel() === mapOrGeoModel) {\n        data = mapSeries.getData();\n      }\n    });\n    var geo = mapOrGeoModel.coordinateSystem;\n    var regionsGroup = this._regionsGroup;\n    var transformGroup = this._transformGroup;\n    var transformInfo = geo.getTransformInfo();\n    var transformInfoRaw = transformInfo.raw;\n    var transformInfoRoam = transformInfo.roam;\n    // No animation when first draw or in action\n    var isFirstDraw = !regionsGroup.childAt(0) || payload;\n    var clip = mapOrGeoModel.getShallow('clip', true);\n    var clipRect;\n    if (clip) {\n      clipRect = geo.getViewRect().clone();\n      this.group.setClipPath(new graphic.Rect({\n        shape: clipRect.clone()\n      }));\n    } else {\n      this.group.removeClipPath();\n    }\n    if (isFirstDraw) {\n      transformGroup.x = transformInfoRoam.x;\n      transformGroup.y = transformInfoRoam.y;\n      transformGroup.scaleX = transformInfoRoam.scaleX;\n      transformGroup.scaleY = transformInfoRoam.scaleY;\n      transformGroup.dirty();\n    } else {\n      graphic.updateProps(transformGroup, transformInfoRoam, mapOrGeoModel);\n    }\n    var isVisualEncodedByVisualMap = data && data.getVisual('visualMeta') && data.getVisual('visualMeta').length > 0;\n    var viewBuildCtx = {\n      api: api,\n      geo: geo,\n      mapOrGeoModel: mapOrGeoModel,\n      data: data,\n      isVisualEncodedByVisualMap: isVisualEncodedByVisualMap,\n      isGeo: isGeo,\n      transformInfoRaw: transformInfoRaw\n    };\n    if (geo.resourceType === 'geoJSON') {\n      this._buildGeoJSON(viewBuildCtx);\n    } else if (geo.resourceType === 'geoSVG') {\n      this._buildSVG(viewBuildCtx);\n    }\n    this._updateController(mapOrGeoModel, clipRect, ecModel, api);\n    this._updateMapSelectHandler(mapOrGeoModel, regionsGroup, api, fromView);\n  };\n  MapDraw.prototype._buildGeoJSON = function (viewBuildCtx) {\n    var regionsGroupByName = this._regionsGroupByName = zrUtil.createHashMap();\n    var regionsInfoByName = zrUtil.createHashMap();\n    var regionsGroup = this._regionsGroup;\n    var transformInfoRaw = viewBuildCtx.transformInfoRaw;\n    var mapOrGeoModel = viewBuildCtx.mapOrGeoModel;\n    var data = viewBuildCtx.data;\n    var projection = viewBuildCtx.geo.projection;\n    var projectionStream = projection && projection.stream;\n    function transformPoint(point, project) {\n      if (project) {\n        // projection may return null point.\n        point = project(point);\n      }\n      return point && [point[0] * transformInfoRaw.scaleX + transformInfoRaw.x, point[1] * transformInfoRaw.scaleY + transformInfoRaw.y];\n    }\n    ;\n    function transformPolygonPoints(inPoints) {\n      var outPoints = [];\n      // If projectionStream is provided. Use it instead of single point project.\n      var project = !projectionStream && projection && projection.project;\n      for (var i = 0; i < inPoints.length; ++i) {\n        var newPt = transformPoint(inPoints[i], project);\n        newPt && outPoints.push(newPt);\n      }\n      return outPoints;\n    }\n    function getPolyShape(points) {\n      return {\n        shape: {\n          points: transformPolygonPoints(points)\n        }\n      };\n    }\n    regionsGroup.removeAll();\n    // Only when the resource is GeoJSON, there is `geo.regions`.\n    zrUtil.each(viewBuildCtx.geo.regions, function (region) {\n      var regionName = region.name;\n      // Consider in GeoJson properties.name may be duplicated, for example,\n      // there is multiple region named \"United Kindom\" or \"France\" (so many\n      // colonies). And it is not appropriate to merge them in geo, which\n      // will make them share the same label and bring trouble in label\n      // location calculation.\n      var regionGroup = regionsGroupByName.get(regionName);\n      var _a = regionsInfoByName.get(regionName) || {},\n        dataIdx = _a.dataIdx,\n        regionModel = _a.regionModel;\n      if (!regionGroup) {\n        regionGroup = regionsGroupByName.set(regionName, new graphic.Group());\n        regionsGroup.add(regionGroup);\n        dataIdx = data ? data.indexOfName(regionName) : null;\n        regionModel = viewBuildCtx.isGeo ? mapOrGeoModel.getRegionModel(regionName) : data ? data.getItemModel(dataIdx) : null;\n        var silent = regionModel.get('silent', true);\n        silent != null && (regionGroup.silent = silent);\n        regionsInfoByName.set(regionName, {\n          dataIdx: dataIdx,\n          regionModel: regionModel\n        });\n      }\n      var polygonSubpaths = [];\n      var polylineSubpaths = [];\n      zrUtil.each(region.geometries, function (geometry) {\n        // Polygon and MultiPolygon\n        if (geometry.type === 'polygon') {\n          var polys = [geometry.exterior].concat(geometry.interiors || []);\n          if (projectionStream) {\n            polys = projectPolys(polys, projectionStream);\n          }\n          zrUtil.each(polys, function (poly) {\n            polygonSubpaths.push(new graphic.Polygon(getPolyShape(poly)));\n          });\n        }\n        // LineString and MultiLineString\n        else {\n          var points = geometry.points;\n          if (projectionStream) {\n            points = projectPolys(points, projectionStream, true);\n          }\n          zrUtil.each(points, function (points) {\n            polylineSubpaths.push(new graphic.Polyline(getPolyShape(points)));\n          });\n        }\n      });\n      var centerPt = transformPoint(region.getCenter(), projection && projection.project);\n      function createCompoundPath(subpaths, isLine) {\n        if (!subpaths.length) {\n          return;\n        }\n        var compoundPath = new graphic.CompoundPath({\n          culling: true,\n          segmentIgnoreThreshold: 1,\n          shape: {\n            paths: subpaths\n          }\n        });\n        regionGroup.add(compoundPath);\n        applyOptionStyleForRegion(viewBuildCtx, compoundPath, dataIdx, regionModel);\n        resetLabelForRegion(viewBuildCtx, compoundPath, regionName, regionModel, mapOrGeoModel, dataIdx, centerPt);\n        if (isLine) {\n          fixLineStyle(compoundPath);\n          zrUtil.each(compoundPath.states, fixLineStyle);\n        }\n      }\n      createCompoundPath(polygonSubpaths);\n      createCompoundPath(polylineSubpaths, true);\n    });\n    // Ensure children have been added to `regionGroup` before calling them.\n    regionsGroupByName.each(function (regionGroup, regionName) {\n      var _a = regionsInfoByName.get(regionName),\n        dataIdx = _a.dataIdx,\n        regionModel = _a.regionModel;\n      resetEventTriggerForRegion(viewBuildCtx, regionGroup, regionName, regionModel, mapOrGeoModel, dataIdx);\n      resetTooltipForRegion(viewBuildCtx, regionGroup, regionName, regionModel, mapOrGeoModel);\n      resetStateTriggerForRegion(viewBuildCtx, regionGroup, regionName, regionModel, mapOrGeoModel);\n    }, this);\n  };\n  MapDraw.prototype._buildSVG = function (viewBuildCtx) {\n    var mapName = viewBuildCtx.geo.map;\n    var transformInfoRaw = viewBuildCtx.transformInfoRaw;\n    this._svgGroup.x = transformInfoRaw.x;\n    this._svgGroup.y = transformInfoRaw.y;\n    this._svgGroup.scaleX = transformInfoRaw.scaleX;\n    this._svgGroup.scaleY = transformInfoRaw.scaleY;\n    if (this._svgResourceChanged(mapName)) {\n      this._freeSVG();\n      this._useSVG(mapName);\n    }\n    var svgDispatcherMap = this._svgDispatcherMap = zrUtil.createHashMap();\n    var focusSelf = false;\n    zrUtil.each(this._svgGraphicRecord.named, function (namedItem) {\n      // Note that we also allow different elements have the same name.\n      // For example, a glyph of a city and the label of the city have\n      // the same name and their tooltip info can be defined in a single\n      // region option.\n      var regionName = namedItem.name;\n      var mapOrGeoModel = viewBuildCtx.mapOrGeoModel;\n      var data = viewBuildCtx.data;\n      var svgNodeTagLower = namedItem.svgNodeTagLower;\n      var el = namedItem.el;\n      var dataIdx = data ? data.indexOfName(regionName) : null;\n      var regionModel = mapOrGeoModel.getRegionModel(regionName);\n      if (OPTION_STYLE_ENABLED_TAG_MAP.get(svgNodeTagLower) != null && el instanceof Displayable) {\n        applyOptionStyleForRegion(viewBuildCtx, el, dataIdx, regionModel);\n      }\n      if (el instanceof Displayable) {\n        el.culling = true;\n      }\n      var silent = regionModel.get('silent', true);\n      silent != null && (el.silent = silent);\n      // We do not know how the SVG like so we'd better not to change z2.\n      // Otherwise it might bring some unexpected result. For example,\n      // an area hovered that make some inner city can not be clicked.\n      el.z2EmphasisLift = 0;\n      // If self named:\n      if (!namedItem.namedFrom) {\n        // label should batter to be displayed based on the center of <g>\n        // if it is named rather than displayed on each child.\n        if (LABEL_HOST_MAP.get(svgNodeTagLower) != null) {\n          resetLabelForRegion(viewBuildCtx, el, regionName, regionModel, mapOrGeoModel, dataIdx, null);\n        }\n        resetEventTriggerForRegion(viewBuildCtx, el, regionName, regionModel, mapOrGeoModel, dataIdx);\n        resetTooltipForRegion(viewBuildCtx, el, regionName, regionModel, mapOrGeoModel);\n        if (STATE_TRIGGER_TAG_MAP.get(svgNodeTagLower) != null) {\n          var focus_1 = resetStateTriggerForRegion(viewBuildCtx, el, regionName, regionModel, mapOrGeoModel);\n          if (focus_1 === 'self') {\n            focusSelf = true;\n          }\n          var els = svgDispatcherMap.get(regionName) || svgDispatcherMap.set(regionName, []);\n          els.push(el);\n        }\n      }\n    }, this);\n    this._enableBlurEntireSVG(focusSelf, viewBuildCtx);\n  };\n  MapDraw.prototype._enableBlurEntireSVG = function (focusSelf, viewBuildCtx) {\n    // It's a little complicated to support blurring the entire geoSVG in series-map.\n    // So do not support it until some requirements come.\n    // At present, in series-map, only regions can be blurred.\n    if (focusSelf && viewBuildCtx.isGeo) {\n      var blurStyle = viewBuildCtx.mapOrGeoModel.getModel(['blur', 'itemStyle']).getItemStyle();\n      // Only support `opacity` here. Because not sure that other props are suitable for\n      // all of the elements generated by SVG (especially for Text/TSpan/Image/... ).\n      var opacity_1 = blurStyle.opacity;\n      this._svgGraphicRecord.root.traverse(function (el) {\n        if (!el.isGroup) {\n          // PENDING: clear those settings to SVG elements when `_freeSVG`.\n          // (Currently it happen not to be needed.)\n          setDefaultStateProxy(el);\n          var style = el.ensureState('blur').style || {};\n          // Do not overwrite the region style that already set from region option.\n          if (style.opacity == null && opacity_1 != null) {\n            style.opacity = opacity_1;\n          }\n          // If `ensureState('blur').style = {}`, there will be default opacity.\n          // Enable `stateTransition` (animation).\n          el.ensureState('emphasis');\n        }\n      });\n    }\n  };\n  MapDraw.prototype.remove = function () {\n    this._regionsGroup.removeAll();\n    this._regionsGroupByName = null;\n    this._svgGroup.removeAll();\n    this._freeSVG();\n    this._controller.dispose();\n    this._controllerHost = null;\n  };\n  MapDraw.prototype.findHighDownDispatchers = function (name, geoModel) {\n    if (name == null) {\n      return [];\n    }\n    var geo = geoModel.coordinateSystem;\n    if (geo.resourceType === 'geoJSON') {\n      var regionsGroupByName = this._regionsGroupByName;\n      if (regionsGroupByName) {\n        var regionGroup = regionsGroupByName.get(name);\n        return regionGroup ? [regionGroup] : [];\n      }\n    } else if (geo.resourceType === 'geoSVG') {\n      return this._svgDispatcherMap && this._svgDispatcherMap.get(name) || [];\n    }\n  };\n  MapDraw.prototype._svgResourceChanged = function (mapName) {\n    return this._svgMapName !== mapName;\n  };\n  MapDraw.prototype._useSVG = function (mapName) {\n    var resource = geoSourceManager.getGeoResource(mapName);\n    if (resource && resource.type === 'geoSVG') {\n      var svgGraphic = resource.useGraphic(this.uid);\n      this._svgGroup.add(svgGraphic.root);\n      this._svgGraphicRecord = svgGraphic;\n      this._svgMapName = mapName;\n    }\n  };\n  MapDraw.prototype._freeSVG = function () {\n    var mapName = this._svgMapName;\n    if (mapName == null) {\n      return;\n    }\n    var resource = geoSourceManager.getGeoResource(mapName);\n    if (resource && resource.type === 'geoSVG') {\n      resource.freeGraphic(this.uid);\n    }\n    this._svgGraphicRecord = null;\n    this._svgDispatcherMap = null;\n    this._svgGroup.removeAll();\n    this._svgMapName = null;\n  };\n  MapDraw.prototype._updateController = function (mapOrGeoModel, clipRect, ecModel, api) {\n    var geo = mapOrGeoModel.coordinateSystem;\n    var controller = this._controller;\n    var controllerHost = this._controllerHost;\n    controllerHost.zoomLimit = mapOrGeoModel.get('scaleLimit');\n    controllerHost.zoom = geo.getZoom();\n    // roamType is will be set default true if it is null\n    controller.enable(mapOrGeoModel.get('roam') || false, {\n      api: api,\n      zInfo: {\n        component: mapOrGeoModel\n      },\n      triggerInfo: {\n        roamTrigger: mapOrGeoModel.get('roamTrigger'),\n        isInSelf: function (e, x, y) {\n          return geo.containPoint([x, y]);\n        },\n        isInClip: function (e, x, y) {\n          return !clipRect || clipRect.contain(x, y);\n        }\n      }\n    });\n    var mainType = mapOrGeoModel.mainType;\n    function makeActionBase() {\n      var action = {\n        type: 'geoRoam',\n        componentType: mainType\n      };\n      action[mainType + 'Id'] = mapOrGeoModel.id;\n      return action;\n    }\n    controller.off('pan').on('pan', function (e) {\n      this._mouseDownFlag = false;\n      roamHelper.updateViewOnPan(controllerHost, e.dx, e.dy);\n      api.dispatchAction(zrUtil.extend(makeActionBase(), {\n        dx: e.dx,\n        dy: e.dy,\n        animation: {\n          duration: 0\n        }\n      }));\n    }, this);\n    controller.off('zoom').on('zoom', function (e) {\n      this._mouseDownFlag = false;\n      roamHelper.updateViewOnZoom(controllerHost, e.scale, e.originX, e.originY);\n      api.dispatchAction(zrUtil.extend(makeActionBase(), {\n        totalZoom: controllerHost.zoom,\n        zoom: e.scale,\n        originX: e.originX,\n        originY: e.originY,\n        animation: {\n          duration: 0\n        }\n      }));\n    }, this);\n  };\n  /**\n   * FIXME: this is a temporarily workaround.\n   * When `geoRoam` the elements need to be reset in `MapView['render']`, because the props like\n   * `ignore` might have been modified by `LabelManager`, and `LabelManager#addLabelsOfSeries`\n   * will subsequently cache `defaultAttr` like `ignore`. If do not do this reset, the modified\n   * props will have no chance to be restored.\n   * Note: This reset should be after `clearStates` in `renderSeries` because `useStates` in\n   * `renderSeries` will cache the modified `ignore` to `el._normalState`.\n   * TODO:\n   * Use clone/immutable in `LabelManager`?\n   */\n  MapDraw.prototype.resetForLabelLayout = function () {\n    this.group.traverse(function (el) {\n      var label = el.getTextContent();\n      if (label) {\n        label.ignore = mapLabelRaw(label).ignore;\n      }\n    });\n  };\n  MapDraw.prototype._updateMapSelectHandler = function (mapOrGeoModel, regionsGroup, api, fromView) {\n    var mapDraw = this;\n    regionsGroup.off('mousedown');\n    regionsGroup.off('click');\n    // @ts-ignore FIXME:TS resolve type conflict\n    if (mapOrGeoModel.get('selectedMode')) {\n      regionsGroup.on('mousedown', function () {\n        mapDraw._mouseDownFlag = true;\n      });\n      regionsGroup.on('click', function (e) {\n        if (!mapDraw._mouseDownFlag) {\n          return;\n        }\n        mapDraw._mouseDownFlag = false;\n      });\n    }\n  };\n  return MapDraw;\n}();\n;\nfunction applyOptionStyleForRegion(viewBuildCtx, el, dataIndex, regionModel) {\n  // All of the path are using `itemStyle`, because\n  // (1) Some SVG also use fill on polyline (The different between\n  // polyline and polygon is \"open\" or \"close\" but not fill or not).\n  // (2) For the common props like opacity, if some use itemStyle\n  // and some use `lineStyle`, it might confuse users.\n  // (3) Most SVG use <path>, where can not detect whether to draw a \"line\"\n  // or a filled shape, so use `itemStyle` for <path>.\n  var normalStyleModel = regionModel.getModel('itemStyle');\n  var emphasisStyleModel = regionModel.getModel(['emphasis', 'itemStyle']);\n  var blurStyleModel = regionModel.getModel(['blur', 'itemStyle']);\n  var selectStyleModel = regionModel.getModel(['select', 'itemStyle']);\n  // NOTE: DON'T use 'style' in visual when drawing map.\n  // This component is used for drawing underlying map for both geo component and map series.\n  var normalStyle = getFixedItemStyle(normalStyleModel);\n  var emphasisStyle = getFixedItemStyle(emphasisStyleModel);\n  var selectStyle = getFixedItemStyle(selectStyleModel);\n  var blurStyle = getFixedItemStyle(blurStyleModel);\n  // Update the itemStyle if has data visual\n  var data = viewBuildCtx.data;\n  if (data) {\n    // Only visual color of each item will be used. It can be encoded by visualMap\n    // But visual color of series is used in symbol drawing\n    // Visual color for each series is for the symbol draw\n    var style = data.getItemVisual(dataIndex, 'style');\n    var decal = data.getItemVisual(dataIndex, 'decal');\n    if (viewBuildCtx.isVisualEncodedByVisualMap && style.fill) {\n      normalStyle.fill = style.fill;\n    }\n    if (decal) {\n      normalStyle.decal = createOrUpdatePatternFromDecal(decal, viewBuildCtx.api);\n    }\n  }\n  // SVG text, tspan and image can be named but not supporeted\n  // to be styled by region option yet.\n  el.setStyle(normalStyle);\n  el.style.strokeNoScale = true;\n  el.ensureState('emphasis').style = emphasisStyle;\n  el.ensureState('select').style = selectStyle;\n  el.ensureState('blur').style = blurStyle;\n  // Enable blur\n  setDefaultStateProxy(el);\n}\nfunction resetLabelForRegion(viewBuildCtx, el, regionName, regionModel, mapOrGeoModel,\n// Exist only if `viewBuildCtx.data` exists.\ndataIdx,\n// If labelXY not provided, use `textConfig.position: 'inside'`\nlabelXY) {\n  var data = viewBuildCtx.data;\n  var isGeo = viewBuildCtx.isGeo;\n  var isDataNaN = data && isNaN(data.get(data.mapDimension('value'), dataIdx));\n  var itemLayout = data && data.getItemLayout(dataIdx);\n  // In the following cases label will be drawn\n  // 1. In map series and data value is NaN\n  // 2. In geo component\n  // 3. Region has no series legendIcon, which will be add a showLabel flag in mapSymbolLayout\n  if (isGeo || isDataNaN || itemLayout && itemLayout.showLabel) {\n    var query = !isGeo ? dataIdx : regionName;\n    var labelFetcher = void 0;\n    // Consider dataIdx not found.\n    if (!data || dataIdx >= 0) {\n      labelFetcher = mapOrGeoModel;\n    }\n    var specifiedTextOpt = labelXY ? {\n      normal: {\n        align: 'center',\n        verticalAlign: 'middle'\n      }\n    } : null;\n    // Caveat: must be called after `setDefaultStateProxy(el);` called.\n    // because textContent will be assign with `el.stateProxy` inside.\n    setLabelStyle(el, getLabelStatesModels(regionModel), {\n      labelFetcher: labelFetcher,\n      labelDataIndex: query,\n      defaultText: regionName\n    }, specifiedTextOpt);\n    var textEl = el.getTextContent();\n    if (textEl) {\n      mapLabelRaw(textEl).ignore = textEl.ignore;\n      if (el.textConfig && labelXY) {\n        // Compute a relative offset based on the el bounding rect.\n        var rect = el.getBoundingRect().clone();\n        // Need to make sure the percent position base on the same rect in normal and\n        // emphasis state. Otherwise if using boundingRect of el, but the emphasis state\n        // has borderWidth (even 0.5px), the text position will be changed obviously\n        // if the position is very big like ['1234%', '1345%'].\n        el.textConfig.layoutRect = rect;\n        el.textConfig.position = [(labelXY[0] - rect.x) / rect.width * 100 + '%', (labelXY[1] - rect.y) / rect.height * 100 + '%'];\n      }\n    }\n    // PENDING:\n    // If labelLayout is enabled (test/label-layout.html), el.dataIndex should be specified.\n    // But el.dataIndex is also used to determine whether user event should be triggered,\n    // where el.seriesIndex or el.dataModel must be specified. At present for a single el\n    // there is not case that \"only label layout enabled but user event disabled\", so here\n    // we depends `resetEventTriggerForRegion` to do the job of setting `el.dataIndex`.\n    el.disableLabelAnimation = true;\n  } else {\n    el.removeTextContent();\n    el.removeTextConfig();\n    el.disableLabelAnimation = null;\n  }\n}\nfunction resetEventTriggerForRegion(viewBuildCtx, eventTrigger, regionName, regionModel, mapOrGeoModel,\n// Exist only if `viewBuildCtx.data` exists.\ndataIdx) {\n  // setItemGraphicEl, setHoverStyle after all polygons and labels\n  // are added to the regionGroup\n  if (viewBuildCtx.data) {\n    // FIXME: when series-map use a SVG map, and there are duplicated name specified\n    // on different SVG elements, after `data.setItemGraphicEl(...)`:\n    // (1) all of them will be mounted with `dataIndex`, `seriesIndex`, so that tooltip\n    // can be triggered only mouse hover. That's correct.\n    // (2) only the last element will be kept in `data`, so that if trigger tooltip\n    // by `dispatchAction`, only the last one can be found and triggered. That might be\n    // not correct. We will fix it in future if anyone demanding that.\n    viewBuildCtx.data.setItemGraphicEl(dataIdx, eventTrigger);\n  }\n  // series-map will not trigger \"geoselectchange\" no matter it is\n  // based on a declared geo component. Because series-map will\n  // trigger \"selectchange\". If it trigger both the two events,\n  // If users call `chart.dispatchAction({type: 'toggleSelect'})`,\n  // it not easy to also fire event \"geoselectchanged\".\n  else {\n    // Package custom mouse event for geo component\n    getECData(eventTrigger).eventData = {\n      componentType: 'geo',\n      componentIndex: mapOrGeoModel.componentIndex,\n      geoIndex: mapOrGeoModel.componentIndex,\n      name: regionName,\n      region: regionModel && regionModel.option || {}\n    };\n  }\n}\nfunction resetTooltipForRegion(viewBuildCtx, el, regionName, regionModel, mapOrGeoModel) {\n  if (!viewBuildCtx.data) {\n    graphic.setTooltipConfig({\n      el: el,\n      componentModel: mapOrGeoModel,\n      itemName: regionName,\n      // @ts-ignore FIXME:TS fix the \"compatible with each other\"?\n      itemTooltipOption: regionModel.get('tooltip')\n    });\n  }\n}\nfunction resetStateTriggerForRegion(viewBuildCtx, el, regionName, regionModel, mapOrGeoModel) {\n  // @ts-ignore FIXME:TS fix the \"compatible with each other\"?\n  el.highDownSilentOnTouch = !!mapOrGeoModel.get('selectedMode');\n  // @ts-ignore FIXME:TS fix the \"compatible with each other\"?\n  var emphasisModel = regionModel.getModel('emphasis');\n  var focus = emphasisModel.get('focus');\n  toggleHoverEmphasis(el, focus, emphasisModel.get('blurScope'), emphasisModel.get('disabled'));\n  if (viewBuildCtx.isGeo) {\n    enableComponentHighDownFeatures(el, mapOrGeoModel, regionName);\n  }\n  return focus;\n}\nfunction projectPolys(rings,\n// Polygons include exterior and interiors. Or polylines.\ncreateStream, isLine) {\n  var polygons = [];\n  var curPoly;\n  function startPolygon() {\n    curPoly = [];\n  }\n  function endPolygon() {\n    if (curPoly.length) {\n      polygons.push(curPoly);\n      curPoly = [];\n    }\n  }\n  var stream = createStream({\n    polygonStart: startPolygon,\n    polygonEnd: endPolygon,\n    lineStart: startPolygon,\n    lineEnd: endPolygon,\n    point: function (x, y) {\n      // May have NaN values from stream.\n      if (isFinite(x) && isFinite(y)) {\n        curPoly.push([x, y]);\n      }\n    },\n    sphere: function () {}\n  });\n  !isLine && stream.polygonStart();\n  zrUtil.each(rings, function (ring) {\n    stream.lineStart();\n    for (var i = 0; i < ring.length; i++) {\n      stream.point(ring[i][0], ring[i][1]);\n    }\n    stream.lineEnd();\n  });\n  !isLine && stream.polygonEnd();\n  return polygons;\n}\nexport default MapDraw;\n// @ts-ignore FIXME:TS fix the \"compatible with each other\"?", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as graphic from '../../util/graphic.js';\nimport MapDraw from '../../component/helper/MapDraw.js';\nimport ChartView from '../../view/Chart.js';\nimport { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle.js';\nimport { setStatesFlag, Z2_EMPHASIS_LIFT } from '../../util/states.js';\nvar MapView = /** @class */function (_super) {\n  __extends(MapView, _super);\n  function MapView() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = MapView.type;\n    return _this;\n  }\n  MapView.prototype.render = function (mapModel, ecModel, api, payload) {\n    // Not render if it is an toggleSelect action from self\n    if (payload && payload.type === 'mapToggleSelect' && payload.from === this.uid) {\n      return;\n    }\n    var group = this.group;\n    group.removeAll();\n    if (mapModel.getHostGeoModel()) {\n      return;\n    }\n    if (this._mapDraw && payload && payload.type === 'geoRoam') {\n      this._mapDraw.resetForLabelLayout();\n    }\n    // Not update map if it is an roam action from self\n    if (!(payload && payload.type === 'geoRoam' && payload.componentType === 'series' && payload.seriesId === mapModel.id)) {\n      if (mapModel.needsDrawMap) {\n        var mapDraw = this._mapDraw || new MapDraw(api);\n        group.add(mapDraw.group);\n        mapDraw.draw(mapModel, ecModel, api, this, payload);\n        this._mapDraw = mapDraw;\n      } else {\n        // Remove drawn map\n        this._mapDraw && this._mapDraw.remove();\n        this._mapDraw = null;\n      }\n    } else {\n      var mapDraw = this._mapDraw;\n      mapDraw && group.add(mapDraw.group);\n    }\n    mapModel.get('showLegendSymbol') && ecModel.getComponent('legend') && this._renderSymbols(mapModel, ecModel, api);\n  };\n  MapView.prototype.remove = function () {\n    this._mapDraw && this._mapDraw.remove();\n    this._mapDraw = null;\n    this.group.removeAll();\n  };\n  MapView.prototype.dispose = function () {\n    this._mapDraw && this._mapDraw.remove();\n    this._mapDraw = null;\n  };\n  MapView.prototype._renderSymbols = function (mapModel, ecModel, api) {\n    var originalData = mapModel.originalData;\n    var group = this.group;\n    originalData.each(originalData.mapDimension('value'), function (value, originalDataIndex) {\n      if (isNaN(value)) {\n        return;\n      }\n      var layout = originalData.getItemLayout(originalDataIndex);\n      if (!layout || !layout.point) {\n        // Not exists in map\n        return;\n      }\n      var point = layout.point;\n      var offset = layout.offset;\n      var circle = new graphic.Circle({\n        style: {\n          // Because the special of map draw.\n          // Which needs statistic of multiple series and draw on one map.\n          // And each series also need a symbol with legend color\n          //\n          // Layout and visual are put one the different data\n          // TODO\n          fill: mapModel.getData().getVisual('style').fill\n        },\n        shape: {\n          cx: point[0] + offset * 9,\n          cy: point[1],\n          r: 3\n        },\n        silent: true,\n        // Do not overlap the first series, on which labels are displayed.\n        z2: 8 + (!offset ? Z2_EMPHASIS_LIFT + 1 : 0)\n      });\n      // Only the series that has the first value on the same region is in charge of rendering the label.\n      // But consider the case:\n      // series: [\n      //     {id: 'X', type: 'map', map: 'm', {data: [{name: 'A', value: 11}, {name: 'B', {value: 22}]},\n      //     {id: 'Y', type: 'map', map: 'm', {data: [{name: 'A', value: 21}, {name: 'C', {value: 33}]}\n      // ]\n      // The offset `0` of item `A` is at series `X`, but of item `C` is at series `Y`.\n      // For backward compatibility, we follow the rule that render label `A` by the\n      // settings on series `X` but render label `C` by the settings on series `Y`.\n      if (!offset) {\n        var fullData = mapModel.mainSeries.getData();\n        var name_1 = originalData.getName(originalDataIndex);\n        var fullIndex_1 = fullData.indexOfName(name_1);\n        var itemModel = originalData.getItemModel(originalDataIndex);\n        var labelModel = itemModel.getModel('label');\n        var regionGroup = fullData.getItemGraphicEl(fullIndex_1);\n        // `getFormattedLabel` needs to use `getData` inside. Here\n        // `mapModel.getData()` is shallow cloned from `mainSeries.getData()`.\n        // FIXME\n        // If this is not the `mainSeries`, the item model (like label formatter)\n        // set on original data item will never get. But it has been working\n        // like that from the beginning, and this scenario is rarely encountered.\n        // So it won't be fixed until we have to.\n        setLabelStyle(circle, getLabelStatesModels(itemModel), {\n          labelFetcher: {\n            getFormattedLabel: function (idx, state) {\n              return mapModel.getFormattedLabel(fullIndex_1, state);\n            }\n          },\n          defaultText: name_1\n        });\n        circle.disableLabelAnimation = true;\n        if (!labelModel.get('position')) {\n          circle.setTextConfig({\n            position: 'bottom'\n          });\n        }\n        regionGroup.onHoverStateChange = function (toState) {\n          setStatesFlag(circle, toState);\n        };\n      }\n      group.add(circle);\n    });\n  };\n  MapView.type = 'map';\n  return MapView;\n}(ChartView);\nexport default MapView;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport createSeriesDataSimply from '../helper/createSeriesDataSimply.js';\nimport SeriesModel from '../../model/Series.js';\nimport geoSourceManager from '../../coord/geo/geoSourceManager.js';\nimport { makeSeriesEncodeForNameBased } from '../../data/helper/sourceHelper.js';\nimport { createTooltipMarkup } from '../../component/tooltip/tooltipMarkup.js';\nimport { createSymbol } from '../../util/symbol.js';\nimport { CoordinateSystemUsageKind, decideCoordSysUsageKind } from '../../core/CoordinateSystem.js';\nimport tokens from '../../visual/tokens.js';\nvar MapSeries = /** @class */function (_super) {\n  __extends(MapSeries, _super);\n  function MapSeries() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = MapSeries.type;\n    // Only first map series of same mapType will drawMap.\n    _this.needsDrawMap = false;\n    // Group of all map series with same mapType\n    _this.seriesGroup = [];\n    _this.getTooltipPosition = function (dataIndex) {\n      if (dataIndex != null) {\n        var name_1 = this.getData().getName(dataIndex);\n        var geo = this.coordinateSystem;\n        var region = geo.getRegion(name_1);\n        return region && geo.dataToPoint(region.getCenter());\n      }\n    };\n    return _this;\n  }\n  MapSeries.prototype.getInitialData = function (option) {\n    var data = createSeriesDataSimply(this, {\n      coordDimensions: ['value'],\n      encodeDefaulter: zrUtil.curry(makeSeriesEncodeForNameBased, this)\n    });\n    var dataNameIndexMap = zrUtil.createHashMap();\n    var toAppendItems = [];\n    for (var i = 0, len = data.count(); i < len; i++) {\n      var name_2 = data.getName(i);\n      dataNameIndexMap.set(name_2, i);\n    }\n    var geoSource = geoSourceManager.load(this.getMapType(), this.option.nameMap, this.option.nameProperty);\n    zrUtil.each(geoSource.regions, function (region) {\n      var name = region.name;\n      var dataNameIdx = dataNameIndexMap.get(name);\n      // apply specified echarts style in GeoJSON data\n      var specifiedGeoJSONRegionStyle = region.properties && region.properties.echartsStyle;\n      var dataItem;\n      if (dataNameIdx == null) {\n        dataItem = {\n          name: name\n        };\n        toAppendItems.push(dataItem);\n      } else {\n        dataItem = data.getRawDataItem(dataNameIdx);\n      }\n      specifiedGeoJSONRegionStyle && zrUtil.merge(dataItem, specifiedGeoJSONRegionStyle);\n    });\n    // Complete data with missing regions. The consequent processes (like visual\n    // map and render) can not be performed without a \"full data\". For example,\n    // find `dataIndex` by name.\n    data.appendData(toAppendItems);\n    return data;\n  };\n  /**\n   * If no host geo model, return null, which means using a\n   * inner exclusive geo model.\n   */\n  MapSeries.prototype.getHostGeoModel = function () {\n    if (decideCoordSysUsageKind(this).kind === CoordinateSystemUsageKind.boxCoordSys) {\n      // Always use an internal geo if specify a boxCoordSys.\n      // Notice that currently we do not support laying out a geo based on\n      // another geo, but preserve the possibility.\n      return;\n    }\n    return this.getReferringComponents('geo', {\n      useDefault: false,\n      enableAll: false,\n      enableNone: false\n    }).models[0];\n  };\n  MapSeries.prototype.getMapType = function () {\n    return (this.getHostGeoModel() || this).option.map;\n  };\n  // _fillOption(option, mapName) {\n  // Shallow clone\n  // option = zrUtil.extend({}, option);\n  // option.data = geoCreator.getFilledRegions(option.data, mapName, option.nameMap);\n  // return option;\n  // }\n  MapSeries.prototype.getRawValue = function (dataIndex) {\n    // Use value stored in data instead because it is calculated from multiple series\n    // FIXME Provide all value of multiple series ?\n    var data = this.getData();\n    return data.get(data.mapDimension('value'), dataIndex);\n  };\n  /**\n   * Get model of region\n   */\n  MapSeries.prototype.getRegionModel = function (regionName) {\n    var data = this.getData();\n    return data.getItemModel(data.indexOfName(regionName));\n  };\n  /**\n   * Map tooltip formatter\n   */\n  MapSeries.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\n    // FIXME orignalData and data is a bit confusing\n    var data = this.getData();\n    var value = this.getRawValue(dataIndex);\n    var name = data.getName(dataIndex);\n    var seriesGroup = this.seriesGroup;\n    var seriesNames = [];\n    for (var i = 0; i < seriesGroup.length; i++) {\n      var otherIndex = seriesGroup[i].originalData.indexOfName(name);\n      var valueDim = data.mapDimension('value');\n      if (!isNaN(seriesGroup[i].originalData.get(valueDim, otherIndex))) {\n        seriesNames.push(seriesGroup[i].name);\n      }\n    }\n    return createTooltipMarkup('section', {\n      header: seriesNames.join(', '),\n      noHeader: !seriesNames.length,\n      blocks: [createTooltipMarkup('nameValue', {\n        name: name,\n        value: value\n      })]\n    });\n  };\n  MapSeries.prototype.setZoom = function (zoom) {\n    this.option.zoom = zoom;\n  };\n  MapSeries.prototype.setCenter = function (center) {\n    this.option.center = center;\n  };\n  MapSeries.prototype.getLegendIcon = function (opt) {\n    var iconType = opt.icon || 'roundRect';\n    var icon = createSymbol(iconType, 0, 0, opt.itemWidth, opt.itemHeight, opt.itemStyle.fill);\n    icon.setStyle(opt.itemStyle);\n    // Map do not use itemStyle.borderWidth as border width\n    icon.style.stroke = 'none';\n    // No rotation because no series visual symbol for map\n    if (iconType.indexOf('empty') > -1) {\n      icon.style.stroke = icon.style.fill;\n      icon.style.fill = tokens.color.neutral00;\n      icon.style.lineWidth = 2;\n    }\n    return icon;\n  };\n  MapSeries.type = 'series.map';\n  MapSeries.dependencies = ['geo'];\n  MapSeries.layoutMode = 'box';\n  MapSeries.defaultOption = {\n    // \u4E00\u7EA7\u5C42\u53E0\n    // zlevel: 0,\n    // \u4E8C\u7EA7\u5C42\u53E0\n    z: 2,\n    coordinateSystem: 'geo',\n    // map should be explicitly specified since ec3.\n    map: '',\n    // If `geoIndex` is not specified, a exclusive geo will be\n    // created. Otherwise use the specified geo component, and\n    // `map` and `mapType` are ignored.\n    // geoIndex: 0,\n    // 'center' | 'left' | 'right' | 'x%' | {number}\n    left: 'center',\n    // 'center' | 'top' | 'bottom' | 'x%' | {number}\n    top: 'center',\n    // right\n    // bottom\n    // width:\n    // height\n    // Aspect is width / height. Inited to be geoJson bbox aspect\n    // This parameter is used for scale this aspect\n    // Default value:\n    // for geoSVG source: 1,\n    // for geoJSON source: 0.75.\n    aspectScale: null,\n    // Layout with center and size\n    // If you want to put map in a fixed size box with right aspect ratio\n    // This two properties may be more convenient.\n    // layoutCenter: [50%, 50%]\n    // layoutSize: 100\n    showLegendSymbol: true,\n    // Define left-top, right-bottom coords to control view\n    // For example, [ [180, 90], [-180, -90] ],\n    // higher priority than center and zoom\n    boundingCoords: null,\n    // Default on center of map\n    center: null,\n    zoom: 1,\n    scaleLimit: null,\n    selectedMode: true,\n    label: {\n      show: false,\n      color: tokens.color.tertiary\n    },\n    // scaleLimit: null,\n    itemStyle: {\n      borderWidth: 0.5,\n      borderColor: tokens.color.border,\n      areaColor: tokens.color.background\n    },\n    emphasis: {\n      label: {\n        show: true,\n        color: tokens.color.primary\n      },\n      itemStyle: {\n        areaColor: tokens.color.highlight\n      }\n    },\n    select: {\n      label: {\n        show: true,\n        color: tokens.color.primary\n      },\n      itemStyle: {\n        color: tokens.color.highlight\n      }\n    },\n    nameProperty: 'name'\n  };\n  return MapSeries;\n}(SeriesModel);\nexport default MapSeries;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\n// FIXME \u516C\u7528\uFF1F\nfunction dataStatistics(datas, statisticType) {\n  var dataNameMap = {};\n  zrUtil.each(datas, function (data) {\n    data.each(data.mapDimension('value'), function (value, idx) {\n      // Add prefix to avoid conflict with Object.prototype.\n      var mapKey = 'ec-' + data.getName(idx);\n      dataNameMap[mapKey] = dataNameMap[mapKey] || [];\n      if (!isNaN(value)) {\n        dataNameMap[mapKey].push(value);\n      }\n    });\n  });\n  return datas[0].map(datas[0].mapDimension('value'), function (value, idx) {\n    var mapKey = 'ec-' + datas[0].getName(idx);\n    var sum = 0;\n    var min = Infinity;\n    var max = -Infinity;\n    var len = dataNameMap[mapKey].length;\n    for (var i = 0; i < len; i++) {\n      min = Math.min(min, dataNameMap[mapKey][i]);\n      max = Math.max(max, dataNameMap[mapKey][i]);\n      sum += dataNameMap[mapKey][i];\n    }\n    var result;\n    if (statisticType === 'min') {\n      result = min;\n    } else if (statisticType === 'max') {\n      result = max;\n    } else if (statisticType === 'average') {\n      result = sum / len;\n    } else {\n      result = sum;\n    }\n    return len === 0 ? NaN : result;\n  });\n}\nexport default function mapDataStatistic(ecModel) {\n  var seriesGroups = {};\n  ecModel.eachSeriesByType('map', function (seriesModel) {\n    var hostGeoModel = seriesModel.getHostGeoModel();\n    var key = hostGeoModel ? 'o' + hostGeoModel.id : 'i' + seriesModel.getMapType();\n    (seriesGroups[key] = seriesGroups[key] || []).push(seriesModel);\n  });\n  zrUtil.each(seriesGroups, function (seriesList, key) {\n    var data = dataStatistics(zrUtil.map(seriesList, function (seriesModel) {\n      return seriesModel.getData();\n    }), seriesList[0].get('mapValueCalculation'));\n    for (var i = 0; i < seriesList.length; i++) {\n      seriesList[i].originalData = seriesList[i].getData();\n    }\n    // FIXME Put where?\n    for (var i = 0; i < seriesList.length; i++) {\n      seriesList[i].seriesGroup = seriesList;\n      seriesList[i].needsDrawMap = i === 0 && !seriesList[i].getHostGeoModel();\n      seriesList[i].setData(data.cloneShallow());\n      seriesList[i].mainSeries = seriesList[0];\n    }\n  });\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nexport default function mapSymbolLayout(ecModel) {\n  var processedMapType = {};\n  ecModel.eachSeriesByType('map', function (mapSeries) {\n    var mapType = mapSeries.getMapType();\n    if (mapSeries.getHostGeoModel() || processedMapType[mapType]) {\n      return;\n    }\n    var mapSymbolOffsets = {};\n    zrUtil.each(mapSeries.seriesGroup, function (subMapSeries) {\n      var geo = subMapSeries.coordinateSystem;\n      var data = subMapSeries.originalData;\n      if (subMapSeries.get('showLegendSymbol') && ecModel.getComponent('legend')) {\n        data.each(data.mapDimension('value'), function (value, idx) {\n          var name = data.getName(idx);\n          var region = geo.getRegion(name);\n          // If input series.data is [11, 22, '-'/null/undefined, 44],\n          // it will be filled with NaN: [11, 22, NaN, 44] and NaN will\n          // not be drawn. So here must validate if value is NaN.\n          if (!region || isNaN(value)) {\n            return;\n          }\n          var offset = mapSymbolOffsets[name] || 0;\n          var point = geo.dataToPoint(region.getCenter());\n          mapSymbolOffsets[name] = offset + 1;\n          data.setItemLayout(idx, {\n            point: point,\n            offset: offset\n          });\n        });\n      }\n    });\n    // Show label of those region not has legendIcon (which is offset 0)\n    var data = mapSeries.getData();\n    data.each(function (idx) {\n      var name = data.getName(idx);\n      var layout = data.getItemLayout(idx) || {};\n      layout.showLabel = !mapSymbolOffsets[name];\n      data.setItemLayout(idx, layout);\n    });\n    processedMapType[mapType] = true;\n  });\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\n/**\n * Simple view coordinate system\n * Mapping given x, y to transformd view x, y\n */\nimport * as vector from 'zrender/lib/core/vector.js';\nimport * as matrix from 'zrender/lib/core/matrix.js';\nimport BoundingRect from 'zrender/lib/core/BoundingRect.js';\nimport Transformable from 'zrender/lib/core/Transformable.js';\nimport { parsePercent } from '../util/number.js';\nimport { clone } from 'zrender/lib/core/util.js';\nimport { clampByZoomLimit } from '../component/helper/roamHelper.js';\nvar v2ApplyTransform = vector.applyTransform;\nvar View = /** @class */function (_super) {\n  __extends(View, _super);\n  function View(name, opt) {\n    var _this = _super.call(this) || this;\n    _this.type = 'view';\n    _this.dimensions = ['x', 'y'];\n    /**\n     * Represents the transform brought by roam/zoom.\n     * If `View['_viewRect']` applies roam transform,\n     * we can get the final displayed rect.\n     */\n    _this._roamTransformable = new Transformable();\n    /**\n     * Represents the transform from `View['_rect']` to `View['_viewRect']`.\n     */\n    _this._rawTransformable = new Transformable();\n    _this.name = name;\n    _this._opt = opt;\n    return _this;\n  }\n  View.prototype.setBoundingRect = function (x, y, width, height) {\n    this._rect = new BoundingRect(x, y, width, height);\n    this._updateCenterAndZoom();\n    return this._rect;\n  };\n  View.prototype.getBoundingRect = function () {\n    return this._rect;\n  };\n  /**\n   * If no need to transform `View['_rect']` to `View['_viewRect']`, the calling of\n   * `setViewRect` can be omitted.\n   */\n  View.prototype.setViewRect = function (x, y, width, height) {\n    this._transformTo(x, y, width, height);\n    this._viewRect = new BoundingRect(x, y, width, height);\n  };\n  /**\n   * Transformed to particular position and size\n   */\n  View.prototype._transformTo = function (x, y, width, height) {\n    var rect = this.getBoundingRect();\n    var rawTransform = this._rawTransformable;\n    rawTransform.transform = rect.calculateTransform(new BoundingRect(x, y, width, height));\n    var rawParent = rawTransform.parent;\n    rawTransform.parent = null;\n    rawTransform.decomposeTransform();\n    rawTransform.parent = rawParent;\n    this._updateTransform();\n  };\n  /**\n   * [NOTICE]\n   *  The definition of this center has always been irrelevant to some other series center like\n   *  'series-pie.center' - this center is a point on the same coord sys as `View['_rect'].x/y`,\n   *  rather than canvas viewport, and the unit is not necessarily pixel (e.g., in geo case).\n   *  @see {View['_center']} for details.\n   */\n  View.prototype.setCenter = function (centerCoord) {\n    // #16904 introcuded percentage string here, such as '33%'. But it was based on canvas\n    // width/height, which is not reasonable - the unit may incorrect, and it is unpredictable if\n    // the `View['_rect']` is not calculated based on the current canvas rect. Therefore the percentage\n    // value is changed to based on `View['_rect'].width/height` since v6. Under this definition, users\n    // can use '0%' to map the top-left of `View['_rect']` to the center of `View['_viewRect']`.\n    var opt = this._opt;\n    if (opt && opt.api && opt.ecModel && opt.ecModel.getShallow('legacyViewCoordSysCenterBase') && centerCoord) {\n      centerCoord = [parsePercent(centerCoord[0], opt.api.getWidth()), parsePercent(centerCoord[1], opt.api.getWidth())];\n    }\n    this._centerOption = clone(centerCoord);\n    this._updateCenterAndZoom();\n  };\n  View.prototype.setZoom = function (zoom) {\n    this._zoom = clampByZoomLimit(zoom || 1, this.zoomLimit);\n    this._updateCenterAndZoom();\n  };\n  /**\n   * Get default center without roam\n   */\n  View.prototype.getDefaultCenter = function () {\n    // Rect before any transform\n    var rawRect = this.getBoundingRect();\n    var cx = rawRect.x + rawRect.width / 2;\n    var cy = rawRect.y + rawRect.height / 2;\n    return [cx, cy];\n  };\n  View.prototype.getCenter = function () {\n    return this._center || this.getDefaultCenter();\n  };\n  View.prototype.getZoom = function () {\n    return this._zoom || 1;\n  };\n  View.prototype.getRoamTransform = function () {\n    return this._roamTransformable.getLocalTransform();\n  };\n  /**\n   * Ensure this method is idempotent, since it should be called when\n   * every relevant prop (e.g. _centerOption/_zoom/_rect/_viewRect) changed.\n   */\n  View.prototype._updateCenterAndZoom = function () {\n    var centerOption = this._centerOption;\n    var rect = this._rect;\n    if (centerOption && rect) {\n      this._center = [parsePercent(centerOption[0], rect.width, rect.x), parsePercent(centerOption[1], rect.height, rect.y)];\n    }\n    // Must update after view transform updated\n    var rawTransformMatrix = this._rawTransformable.getLocalTransform();\n    var roamTransform = this._roamTransformable;\n    var defaultCenter = this.getDefaultCenter();\n    var center = this.getCenter();\n    var zoom = this.getZoom();\n    center = vector.applyTransform([], center, rawTransformMatrix);\n    defaultCenter = vector.applyTransform([], defaultCenter, rawTransformMatrix);\n    roamTransform.originX = center[0];\n    roamTransform.originY = center[1];\n    roamTransform.x = defaultCenter[0] - center[0];\n    roamTransform.y = defaultCenter[1] - center[1];\n    roamTransform.scaleX = roamTransform.scaleY = zoom;\n    this._updateTransform();\n  };\n  /**\n   * Update transform props on `this` based on the current\n   * `this._roamTransformable` and `this._rawTransformable`.\n   */\n  View.prototype._updateTransform = function () {\n    var roamTransformable = this._roamTransformable;\n    var rawTransformable = this._rawTransformable;\n    rawTransformable.parent = roamTransformable;\n    roamTransformable.updateTransform();\n    rawTransformable.updateTransform();\n    matrix.copy(this.transform || (this.transform = []), rawTransformable.transform || matrix.create());\n    this._rawTransform = rawTransformable.getLocalTransform();\n    this.invTransform = this.invTransform || [];\n    matrix.invert(this.invTransform, this.transform);\n    this.decomposeTransform();\n  };\n  View.prototype.getTransformInfo = function () {\n    var rawTransformable = this._rawTransformable;\n    var roamTransformable = this._roamTransformable;\n    // Because roamTransformabel has `originX/originY` modified,\n    // but the caller of `getTransformInfo` can not handle `originX/originY`,\n    // so need to recalculate them.\n    var dummyTransformable = new Transformable();\n    dummyTransformable.transform = roamTransformable.transform;\n    dummyTransformable.decomposeTransform();\n    return {\n      roam: {\n        x: dummyTransformable.x,\n        y: dummyTransformable.y,\n        scaleX: dummyTransformable.scaleX,\n        scaleY: dummyTransformable.scaleY\n      },\n      raw: {\n        x: rawTransformable.x,\n        y: rawTransformable.y,\n        scaleX: rawTransformable.scaleX,\n        scaleY: rawTransformable.scaleY\n      }\n    };\n  };\n  View.prototype.getViewRect = function () {\n    return this._viewRect;\n  };\n  /**\n   * Get view rect after roam transform\n   */\n  View.prototype.getViewRectAfterRoam = function () {\n    var rect = this.getBoundingRect().clone();\n    rect.applyTransform(this.transform);\n    return rect;\n  };\n  /**\n   * Convert a single (lon, lat) data item to (x, y) point.\n   */\n  View.prototype.dataToPoint = function (data, noRoam, out) {\n    var transform = noRoam ? this._rawTransform : this.transform;\n    out = out || [];\n    return transform ? v2ApplyTransform(out, data, transform) : vector.copy(out, data);\n  };\n  /**\n   * Convert a (x, y) point to (lon, lat) data\n   */\n  View.prototype.pointToData = function (point, reserved, out) {\n    out = out || [];\n    var invTransform = this.invTransform;\n    return invTransform ? v2ApplyTransform(out, point, invTransform) : (out[0] = point[0], out[1] = point[1], out);\n  };\n  View.prototype.convertToPixel = function (ecModel, finder, value) {\n    var coordSys = getCoordSys(finder);\n    return coordSys === this ? coordSys.dataToPoint(value) : null;\n  };\n  View.prototype.convertFromPixel = function (ecModel, finder, pixel) {\n    var coordSys = getCoordSys(finder);\n    return coordSys === this ? coordSys.pointToData(pixel) : null;\n  };\n  /**\n   * @implements\n   */\n  View.prototype.containPoint = function (point) {\n    return this.getViewRectAfterRoam().contain(point[0], point[1]);\n  };\n  View.dimensions = ['x', 'y'];\n  return View;\n}(Transformable);\nfunction getCoordSys(finder) {\n  var seriesModel = finder.seriesModel;\n  return seriesModel ? seriesModel.coordinateSystem : null; // e.g., graph.\n}\nexport default View;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport BoundingRect from 'zrender/lib/core/BoundingRect.js';\nimport View from '../View.js';\nimport geoSourceManager from './geoSourceManager.js';\nimport { SINGLE_REFERRING } from '../../util/model.js';\nimport { warn } from '../../util/log.js';\nvar GEO_DEFAULT_PARAMS = {\n  'geoJSON': {\n    aspectScale: 0.75,\n    invertLongitute: true\n  },\n  'geoSVG': {\n    aspectScale: 1,\n    invertLongitute: false\n  }\n};\nexport var geo2DDimensions = ['lng', 'lat'];\nvar Geo = /** @class */function (_super) {\n  __extends(Geo, _super);\n  function Geo(name, map, opt) {\n    var _this = _super.call(this, name, {\n      api: opt.api,\n      ecModel: opt.ecModel\n    }) || this;\n    _this.dimensions = geo2DDimensions;\n    _this.type = 'geo';\n    // Only store specified name coord via `addGeoCoord`.\n    _this._nameCoordMap = zrUtil.createHashMap();\n    _this.map = map;\n    var projection = opt.projection;\n    var source = geoSourceManager.load(map, opt.nameMap, opt.nameProperty);\n    var resource = geoSourceManager.getGeoResource(map);\n    var resourceType = _this.resourceType = resource ? resource.type : null;\n    var regions = _this.regions = source.regions;\n    var defaultParams = GEO_DEFAULT_PARAMS[resource.type];\n    _this._regionsMap = source.regionsMap;\n    _this.regions = source.regions;\n    if (process.env.NODE_ENV !== 'production' && projection) {\n      // Do some check\n      if (resourceType === 'geoSVG') {\n        if (process.env.NODE_ENV !== 'production') {\n          warn(\"Map \" + map + \" with SVG source can't use projection. Only GeoJSON source supports projection.\");\n        }\n        projection = null;\n      }\n      if (!(projection.project && projection.unproject)) {\n        if (process.env.NODE_ENV !== 'production') {\n          warn('project and unproject must be both provided in the projeciton.');\n        }\n        projection = null;\n      }\n    }\n    _this.projection = projection;\n    var boundingRect;\n    if (projection) {\n      // Can't reuse the raw bounding rect\n      for (var i = 0; i < regions.length; i++) {\n        var regionRect = regions[i].getBoundingRect(projection);\n        boundingRect = boundingRect || regionRect.clone();\n        boundingRect.union(regionRect);\n      }\n    } else {\n      boundingRect = source.boundingRect;\n    }\n    _this.setBoundingRect(boundingRect.x, boundingRect.y, boundingRect.width, boundingRect.height);\n    // aspectScale and invertLongitute actually is the parameters default raw projection.\n    // So we ignore them if projection is given.\n    // Ignore default aspect scale if projection exits.\n    _this.aspectScale = projection ? 1 : zrUtil.retrieve2(opt.aspectScale, defaultParams.aspectScale);\n    // Not invert longitude if projection exits.\n    _this._invertLongitute = projection ? false : defaultParams.invertLongitute;\n    return _this;\n  }\n  Geo.prototype._transformTo = function (x, y, width, height) {\n    var rect = this.getBoundingRect();\n    var invertLongitute = this._invertLongitute;\n    rect = rect.clone();\n    if (invertLongitute) {\n      // Longitude is inverted.\n      rect.y = -rect.y - rect.height;\n    }\n    var rawTransformable = this._rawTransformable;\n    rawTransformable.transform = rect.calculateTransform(new BoundingRect(x, y, width, height));\n    var rawParent = rawTransformable.parent;\n    rawTransformable.parent = null;\n    rawTransformable.decomposeTransform();\n    rawTransformable.parent = rawParent;\n    if (invertLongitute) {\n      rawTransformable.scaleY = -rawTransformable.scaleY;\n    }\n    this._updateTransform();\n  };\n  Geo.prototype.getRegion = function (name) {\n    return this._regionsMap.get(name);\n  };\n  Geo.prototype.getRegionByCoord = function (coord) {\n    var regions = this.regions;\n    for (var i = 0; i < regions.length; i++) {\n      var region = regions[i];\n      if (region.type === 'geoJSON' && region.contain(coord)) {\n        return regions[i];\n      }\n    }\n  };\n  /**\n   * Add geoCoord for indexing by name\n   */\n  Geo.prototype.addGeoCoord = function (name, geoCoord) {\n    this._nameCoordMap.set(name, geoCoord);\n  };\n  /**\n   * Get geoCoord by name\n   */\n  Geo.prototype.getGeoCoord = function (name) {\n    var region = this._regionsMap.get(name);\n    // Calculate center only on demand.\n    return this._nameCoordMap.get(name) || region && region.getCenter();\n  };\n  Geo.prototype.dataToPoint = function (data, noRoam, out) {\n    if (zrUtil.isString(data)) {\n      // Map area name to geoCoord\n      data = this.getGeoCoord(data);\n    }\n    if (data) {\n      var projection = this.projection;\n      if (projection) {\n        // projection may return null point.\n        data = projection.project(data);\n      }\n      return data && this.projectedToPoint(data, noRoam, out);\n    }\n  };\n  Geo.prototype.pointToData = function (point, reserved, out) {\n    var projection = this.projection;\n    if (projection) {\n      // projection may return null point.\n      point = projection.unproject(point);\n    }\n    // FIXME: if no `point`, should return [NaN, NaN], rather than undefined.\n    //  null/undefined has special meaning in `convertFromPixel`.\n    return point && this.pointToProjected(point, out);\n  };\n  /**\n   * Point to projected data. Same with pointToData when projection is used.\n   */\n  Geo.prototype.pointToProjected = function (point, out) {\n    return _super.prototype.pointToData.call(this, point, 0, out);\n  };\n  Geo.prototype.projectedToPoint = function (projected, noRoam, out) {\n    return _super.prototype.dataToPoint.call(this, projected, noRoam, out);\n  };\n  Geo.prototype.convertToPixel = function (ecModel, finder, value) {\n    var coordSys = getCoordSys(finder);\n    return coordSys === this ? coordSys.dataToPoint(value) : null;\n  };\n  Geo.prototype.convertFromPixel = function (ecModel, finder, pixel) {\n    var coordSys = getCoordSys(finder);\n    return coordSys === this ? coordSys.pointToData(pixel) : null;\n  };\n  return Geo;\n}(View);\n;\nzrUtil.mixin(Geo, View);\nfunction getCoordSys(finder) {\n  var geoModel = finder.geoModel;\n  var seriesModel = finder.seriesModel;\n  return geoModel ? geoModel.coordinateSystem : seriesModel ? seriesModel.coordinateSystem // For map series.\n  || (seriesModel.getReferringComponents('geo', SINGLE_REFERRING).models[0] || {}).coordinateSystem : null;\n}\nexport default Geo;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport Geo, { geo2DDimensions } from './Geo.js';\nimport * as layout from '../../util/layout.js';\nimport * as numberUtil from '../../util/number.js';\nimport geoSourceManager from './geoSourceManager.js';\nimport * as vector from 'zrender/lib/core/vector.js';\nimport { injectCoordSysByOption } from '../../core/CoordinateSystem.js';\nimport { SINGLE_REFERRING } from '../../util/model.js';\n/**\n * Resize method bound to the geo\n */\nfunction resizeGeo(geoModel, api) {\n  var boundingCoords = geoModel.get('boundingCoords');\n  if (boundingCoords != null) {\n    var leftTop_1 = boundingCoords[0];\n    var rightBottom_1 = boundingCoords[1];\n    if (!(isFinite(leftTop_1[0]) && isFinite(leftTop_1[1]) && isFinite(rightBottom_1[0]) && isFinite(rightBottom_1[1]))) {\n      if (process.env.NODE_ENV !== 'production') {\n        console.error('Invalid boundingCoords');\n      }\n    } else {\n      // Sample around the lng/lat rect and use projection to calculate actual bounding rect.\n      var projection_1 = this.projection;\n      if (projection_1) {\n        var xMin = leftTop_1[0];\n        var yMin = leftTop_1[1];\n        var xMax = rightBottom_1[0];\n        var yMax = rightBottom_1[1];\n        leftTop_1 = [Infinity, Infinity];\n        rightBottom_1 = [-Infinity, -Infinity];\n        // TODO better way?\n        var sampleLine = function (x0, y0, x1, y1) {\n          var dx = x1 - x0;\n          var dy = y1 - y0;\n          for (var i = 0; i <= 100; i++) {\n            var p = i / 100;\n            var pt = projection_1.project([x0 + dx * p, y0 + dy * p]);\n            vector.min(leftTop_1, leftTop_1, pt);\n            vector.max(rightBottom_1, rightBottom_1, pt);\n          }\n        };\n        // Top\n        sampleLine(xMin, yMin, xMax, yMin);\n        // Right\n        sampleLine(xMax, yMin, xMax, yMax);\n        // Bottom\n        sampleLine(xMax, yMax, xMin, yMax);\n        // Left\n        sampleLine(xMin, yMax, xMax, yMin);\n      }\n      this.setBoundingRect(leftTop_1[0], leftTop_1[1], rightBottom_1[0] - leftTop_1[0], rightBottom_1[1] - leftTop_1[1]);\n    }\n  }\n  var rect = this.getBoundingRect();\n  var centerOption = geoModel.get('layoutCenter');\n  var sizeOption = geoModel.get('layoutSize');\n  // Laying out geo on `dataCoordSys`, such as cartesian, works theoretically but not supported yet.\n  // Therefore here we only handle cases that laying out on `boxCoordSys`, such as matrix/calendar.\n  var refContainer = layout.createBoxLayoutReference(geoModel, api).refContainer;\n  var aspect = rect.width / rect.height * this.aspectScale;\n  var useCenterAndSize = false;\n  var center;\n  var size;\n  if (centerOption && sizeOption) {\n    center = [numberUtil.parsePercent(centerOption[0], refContainer.width) + refContainer.x, numberUtil.parsePercent(centerOption[1], refContainer.height) + refContainer.y];\n    size = numberUtil.parsePercent(sizeOption, Math.min(refContainer.width, refContainer.height));\n    if (!isNaN(center[0]) && !isNaN(center[1]) && !isNaN(size)) {\n      useCenterAndSize = true;\n    } else {\n      if (process.env.NODE_ENV !== 'production') {\n        console.warn('Given layoutCenter or layoutSize data are invalid. Use left/top/width/height instead.');\n      }\n    }\n  }\n  var viewRect;\n  if (useCenterAndSize) {\n    viewRect = {};\n    if (aspect > 1) {\n      // Width is same with size\n      viewRect.width = size;\n      viewRect.height = size / aspect;\n    } else {\n      viewRect.height = size;\n      viewRect.width = size * aspect;\n    }\n    viewRect.y = center[1] - viewRect.height / 2;\n    viewRect.x = center[0] - viewRect.width / 2;\n  } else {\n    // Use left/top/width/height\n    var boxLayoutOption = geoModel.getBoxLayoutParams();\n    boxLayoutOption.aspect = aspect;\n    viewRect = layout.getLayoutRect(boxLayoutOption, refContainer);\n    viewRect = layout.applyPreserveAspect(geoModel, viewRect, aspect);\n  }\n  this.setViewRect(viewRect.x, viewRect.y, viewRect.width, viewRect.height);\n  this.setCenter(geoModel.get('center'));\n  this.setZoom(geoModel.get('zoom'));\n}\n// Back compat for ECharts2, where the coord map is set on map series:\n// {type: 'map', geoCoord: {'cityA': [116.46,39.92], 'cityA': [119.12,24.61]}},\nfunction setGeoCoords(geo, model) {\n  zrUtil.each(model.get('geoCoord'), function (geoCoord, name) {\n    geo.addGeoCoord(name, geoCoord);\n  });\n}\nvar GeoCreator = /** @class */function () {\n  function GeoCreator() {\n    // For deciding which dimensions to use when creating list data\n    this.dimensions = geo2DDimensions;\n  }\n  GeoCreator.prototype.create = function (ecModel, api) {\n    var geoList = [];\n    function getCommonGeoProperties(model) {\n      return {\n        nameProperty: model.get('nameProperty'),\n        aspectScale: model.get('aspectScale'),\n        projection: model.get('projection')\n      };\n    }\n    // FIXME Create each time may be slow\n    ecModel.eachComponent('geo', function (geoModel, idx) {\n      var mapName = geoModel.get('map');\n      var geo = new Geo(mapName + idx, mapName, zrUtil.extend({\n        nameMap: geoModel.get('nameMap'),\n        api: api,\n        ecModel: ecModel\n      }, getCommonGeoProperties(geoModel)));\n      geo.zoomLimit = geoModel.get('scaleLimit');\n      geoList.push(geo);\n      // setGeoCoords(geo, geoModel);\n      geoModel.coordinateSystem = geo;\n      geo.model = geoModel;\n      // Inject resize method\n      geo.resize = resizeGeo;\n      geo.resize(geoModel, api);\n    });\n    ecModel.eachSeries(function (seriesModel) {\n      injectCoordSysByOption({\n        targetModel: seriesModel,\n        coordSysType: 'geo',\n        coordSysProvider: function () {\n          var geoModel = seriesModel.subType === 'map' ? seriesModel.getHostGeoModel() : seriesModel.getReferringComponents('geo', SINGLE_REFERRING).models[0];\n          return geoModel && geoModel.coordinateSystem;\n        },\n        allowNotFound: true\n      });\n    });\n    // If has map series\n    var mapModelGroupBySeries = {};\n    ecModel.eachSeriesByType('map', function (seriesModel) {\n      if (!seriesModel.getHostGeoModel()) {\n        var mapType = seriesModel.getMapType();\n        mapModelGroupBySeries[mapType] = mapModelGroupBySeries[mapType] || [];\n        mapModelGroupBySeries[mapType].push(seriesModel);\n      }\n    });\n    zrUtil.each(mapModelGroupBySeries, function (mapSeries, mapType) {\n      var nameMapList = zrUtil.map(mapSeries, function (singleMapSeries) {\n        return singleMapSeries.get('nameMap');\n      });\n      var geo = new Geo(mapType, mapType, zrUtil.extend({\n        nameMap: zrUtil.mergeAll(nameMapList),\n        api: api,\n        ecModel: ecModel\n      }, getCommonGeoProperties(mapSeries[0])));\n      geo.zoomLimit = zrUtil.retrieve.apply(null, zrUtil.map(mapSeries, function (singleMapSeries) {\n        return singleMapSeries.get('scaleLimit');\n      }));\n      geoList.push(geo);\n      // Inject resize method\n      geo.resize = resizeGeo;\n      geo.resize(mapSeries[0], api);\n      zrUtil.each(mapSeries, function (singleMapSeries) {\n        singleMapSeries.coordinateSystem = geo;\n        setGeoCoords(geo, singleMapSeries);\n      });\n    });\n    return geoList;\n  };\n  /**\n   * Fill given regions array\n   */\n  GeoCreator.prototype.getFilledRegions = function (originRegionArr, mapName, nameMap, nameProperty) {\n    // Not use the original\n    var regionsArr = (originRegionArr || []).slice();\n    var dataNameMap = zrUtil.createHashMap();\n    for (var i = 0; i < regionsArr.length; i++) {\n      dataNameMap.set(regionsArr[i].name, regionsArr[i]);\n    }\n    var source = geoSourceManager.load(mapName, nameMap, nameProperty);\n    zrUtil.each(source.regions, function (region) {\n      var name = region.name;\n      var regionOption = dataNameMap.get(name);\n      // apply specified echarts style in GeoJSON data\n      var specifiedGeoJSONRegionStyle = region.properties && region.properties.echartsStyle;\n      if (!regionOption) {\n        regionOption = {\n          name: name\n        };\n        regionsArr.push(regionOption);\n      }\n      specifiedGeoJSONRegionStyle && zrUtil.merge(regionOption, specifiedGeoJSONRegionStyle);\n    });\n    return regionsArr;\n  };\n  return GeoCreator;\n}();\nvar geoCreator = new GeoCreator();\nexport default geoCreator;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as modelUtil from '../../util/model.js';\nimport ComponentModel from '../../model/Component.js';\nimport Model from '../../model/Model.js';\nimport geoCreator from './geoCreator.js';\nimport geoSourceManager from './geoSourceManager.js';\nimport tokens from '../../visual/tokens.js';\n;\nvar GeoModel = /** @class */function (_super) {\n  __extends(GeoModel, _super);\n  function GeoModel() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = GeoModel.type;\n    return _this;\n  }\n  GeoModel.prototype.init = function (option, parentModel, ecModel) {\n    this.mergeDefaultAndTheme(option, ecModel);\n    var source = geoSourceManager.getGeoResource(option.map);\n    if (source && source.type === 'geoJSON') {\n      var itemStyle = option.itemStyle = option.itemStyle || {};\n      if (!('color' in itemStyle)) {\n        itemStyle.color = option.defaultItemStyleColor || tokens.color.backgroundTint;\n      }\n    }\n    // Default label emphasis `show`\n    modelUtil.defaultEmphasis(option, 'label', ['show']);\n  };\n  GeoModel.prototype.optionUpdated = function () {\n    var _this = this;\n    var option = this.option;\n    option.regions = geoCreator.getFilledRegions(option.regions, option.map, option.nameMap, option.nameProperty);\n    var selectedMap = {};\n    this._optionModelMap = zrUtil.reduce(option.regions || [], function (optionModelMap, regionOpt) {\n      var regionName = regionOpt.name;\n      if (regionName) {\n        optionModelMap.set(regionName, new Model(regionOpt, _this, _this.ecModel));\n        if (regionOpt.selected) {\n          selectedMap[regionName] = true;\n        }\n      }\n      return optionModelMap;\n    }, zrUtil.createHashMap());\n    if (!option.selectedMap) {\n      option.selectedMap = selectedMap;\n    }\n  };\n  /**\n   * Get model of region.\n   */\n  GeoModel.prototype.getRegionModel = function (name) {\n    return this._optionModelMap.get(name) || new Model(null, this, this.ecModel);\n  };\n  /**\n   * Format label\n   * @param name Region name\n   */\n  GeoModel.prototype.getFormattedLabel = function (name, status) {\n    var regionModel = this.getRegionModel(name);\n    var formatter = status === 'normal' ? regionModel.get(['label', 'formatter']) : regionModel.get(['emphasis', 'label', 'formatter']);\n    var params = {\n      name: name\n    };\n    if (zrUtil.isFunction(formatter)) {\n      params.status = status;\n      return formatter(params);\n    } else if (zrUtil.isString(formatter)) {\n      return formatter.replace('{a}', name != null ? name : '');\n    }\n  };\n  GeoModel.prototype.setZoom = function (zoom) {\n    this.option.zoom = zoom;\n  };\n  GeoModel.prototype.setCenter = function (center) {\n    this.option.center = center;\n  };\n  // PENGING If selectedMode is null ?\n  GeoModel.prototype.select = function (name) {\n    var option = this.option;\n    var selectedMode = option.selectedMode;\n    if (!selectedMode) {\n      return;\n    }\n    if (selectedMode !== 'multiple') {\n      option.selectedMap = null;\n    }\n    var selectedMap = option.selectedMap || (option.selectedMap = {});\n    selectedMap[name] = true;\n  };\n  GeoModel.prototype.unSelect = function (name) {\n    var selectedMap = this.option.selectedMap;\n    if (selectedMap) {\n      selectedMap[name] = false;\n    }\n  };\n  GeoModel.prototype.toggleSelected = function (name) {\n    this[this.isSelected(name) ? 'unSelect' : 'select'](name);\n  };\n  GeoModel.prototype.isSelected = function (name) {\n    var selectedMap = this.option.selectedMap;\n    return !!(selectedMap && selectedMap[name]);\n  };\n  GeoModel.type = 'geo';\n  GeoModel.layoutMode = 'box';\n  GeoModel.defaultOption = {\n    // zlevel: 0,\n    z: 0,\n    show: true,\n    left: 'center',\n    top: 'center',\n    // Default value:\n    // for geoSVG source: 1,\n    // for geoJSON source: 0.75.\n    aspectScale: null,\n    // /// Layout with center and size\n    // If you want to put map in a fixed size box with right aspect ratio\n    // This two properties may be more convenient\n    // layoutCenter: [50%, 50%]\n    // layoutSize: 100\n    silent: false,\n    // Map type\n    map: '',\n    // Define left-top, right-bottom coords to control view\n    // For example, [ [180, 90], [-180, -90] ]\n    boundingCoords: null,\n    // Default on center of map\n    center: null,\n    zoom: 1,\n    scaleLimit: null,\n    // selectedMode: false\n    label: {\n      show: false,\n      color: tokens.color.tertiary\n    },\n    itemStyle: {\n      borderWidth: 0.5,\n      borderColor: tokens.color.border\n    },\n    emphasis: {\n      label: {\n        show: true,\n        color: tokens.color.primary\n      },\n      itemStyle: {\n        color: tokens.color.highlight\n      }\n    },\n    select: {\n      label: {\n        show: true,\n        color: tokens.color.primary\n      },\n      itemStyle: {\n        color: tokens.color.highlight\n      }\n    },\n    regions: []\n    // tooltip: {\n    //     show: false\n    // }\n  };\n  return GeoModel;\n}(ComponentModel);\nexport default GeoModel;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport MapDraw from '../helper/MapDraw.js';\nimport ComponentView from '../../view/Component.js';\nimport { getECData } from '../../util/innerStore.js';\nimport { findEventDispatcher } from '../../util/event.js';\nvar GeoView = /** @class */function (_super) {\n  __extends(GeoView, _super);\n  function GeoView() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = GeoView.type;\n    _this.focusBlurEnabled = true;\n    return _this;\n  }\n  GeoView.prototype.init = function (ecModel, api) {\n    this._api = api;\n  };\n  GeoView.prototype.render = function (geoModel, ecModel, api, payload) {\n    this._model = geoModel;\n    if (!geoModel.get('show')) {\n      this._mapDraw && this._mapDraw.remove();\n      this._mapDraw = null;\n      return;\n    }\n    if (!this._mapDraw) {\n      this._mapDraw = new MapDraw(api);\n    }\n    var mapDraw = this._mapDraw;\n    mapDraw.draw(geoModel, ecModel, api, this, payload);\n    mapDraw.group.on('click', this._handleRegionClick, this);\n    mapDraw.group.silent = geoModel.get('silent');\n    this.group.add(mapDraw.group);\n    this.updateSelectStatus(geoModel, ecModel, api);\n  };\n  GeoView.prototype._handleRegionClick = function (e) {\n    var eventData;\n    findEventDispatcher(e.target, function (current) {\n      return (eventData = getECData(current).eventData) != null;\n    }, true);\n    if (eventData) {\n      this._api.dispatchAction({\n        type: 'geoToggleSelect',\n        geoId: this._model.id,\n        name: eventData.name\n      });\n    }\n  };\n  GeoView.prototype.updateSelectStatus = function (model, ecModel, api) {\n    var _this = this;\n    this._mapDraw.group.traverse(function (node) {\n      var eventData = getECData(node).eventData;\n      if (eventData) {\n        _this._model.isSelected(eventData.name) ? api.enterSelect(node) : api.leaveSelect(node);\n        // No need to traverse children.\n        return true;\n      }\n    });\n  };\n  GeoView.prototype.findHighDownDispatchers = function (name) {\n    return this._mapDraw && this._mapDraw.findHighDownDispatchers(name, this._model);\n  };\n  GeoView.prototype.dispose = function () {\n    this._mapDraw && this._mapDraw.remove();\n  };\n  GeoView.type = 'geo';\n  return GeoView;\n}(ComponentView);\nexport default GeoView;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport GeoModel from '../../coord/geo/GeoModel.js';\nimport geoCreator from '../../coord/geo/geoCreator.js';\nimport { each } from 'zrender/lib/core/util.js';\nimport { updateCenterAndZoomInAction } from '../../component/helper/roamHelper.js';\nimport GeoView from './GeoView.js';\nimport geoSourceManager from '../../coord/geo/geoSourceManager.js';\nfunction registerMap(mapName, geoJson, specialAreas) {\n  geoSourceManager.registerMap(mapName, geoJson, specialAreas);\n}\nexport function install(registers) {\n  registers.registerCoordinateSystem('geo', geoCreator);\n  registers.registerComponentModel(GeoModel);\n  registers.registerComponentView(GeoView);\n  registers.registerImpl('registerMap', registerMap);\n  registers.registerImpl('getMap', function (mapName) {\n    return geoSourceManager.getMapForUser(mapName);\n  });\n  function makeAction(method, actionInfo) {\n    actionInfo.update = 'geo:updateSelectStatus';\n    registers.registerAction(actionInfo, function (payload, ecModel) {\n      var selected = {};\n      var allSelected = [];\n      ecModel.eachComponent({\n        mainType: 'geo',\n        query: payload\n      }, function (geoModel) {\n        geoModel[method](payload.name);\n        var geo = geoModel.coordinateSystem;\n        each(geo.regions, function (region) {\n          selected[region.name] = geoModel.isSelected(region.name) || false;\n        });\n        // Notice: there might be duplicated name in different regions.\n        var names = [];\n        each(selected, function (v, name) {\n          selected[name] && names.push(name);\n        });\n        allSelected.push({\n          geoIndex: geoModel.componentIndex,\n          // Use singular, the same naming convention as the event `selectchanged`.\n          name: names\n        });\n      });\n      return {\n        selected: selected,\n        allSelected: allSelected,\n        name: payload.name\n      };\n    });\n  }\n  makeAction('toggleSelected', {\n    type: 'geoToggleSelect',\n    event: 'geoselectchanged'\n  });\n  makeAction('select', {\n    type: 'geoSelect',\n    event: 'geoselected'\n  });\n  makeAction('unSelect', {\n    type: 'geoUnSelect',\n    event: 'geounselected'\n  });\n  /**\n   * @payload\n   * @property {string} [componentType=series]\n   * @property {number} [dx]\n   * @property {number} [dy]\n   * @property {number} [zoom]\n   * @property {number} [originX]\n   * @property {number} [originY]\n   */\n  registers.registerAction({\n    type: 'geoRoam',\n    event: 'geoRoam',\n    update: 'updateTransform'\n  }, function (payload, ecModel, api) {\n    var componentType = payload.componentType;\n    if (!componentType) {\n      // backward compat, but `payload.componentType` is deprecated.\n      if (payload.geoId != null) {\n        componentType = 'geo';\n      } else if (payload.seriesId != null) {\n        componentType = 'series';\n      }\n    }\n    if (!componentType) {\n      componentType = 'series';\n    }\n    // FIXME: payload.geoId/payload.seriesId should be required, but historically\n    //  it is not mandatory, causing that all of the geo or series can be queried below,\n    //  which is not reasonable.\n    ecModel.eachComponent({\n      mainType: componentType,\n      query: payload\n    }, function (componentModel) {\n      var geo = componentModel.coordinateSystem;\n      if (geo.type !== 'geo') {\n        return;\n      }\n      var res = updateCenterAndZoomInAction(geo, payload, componentModel.get('scaleLimit'));\n      componentModel.setCenter && componentModel.setCenter(res.center);\n      componentModel.setZoom && componentModel.setZoom(res.zoom);\n      // All map series with same `map` use the same geo coordinate system\n      // So the center and zoom must be in sync. Include the series not selected by legend\n      if (componentType === 'series') {\n        each(componentModel.seriesGroup, function (seriesModel) {\n          seriesModel.setCenter(res.center);\n          seriesModel.setZoom(res.zoom);\n        });\n      }\n    });\n  });\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { use } from '../../extension.js';\nimport MapView from './MapView.js';\nimport MapSeries from './MapSeries.js';\nimport mapDataStatistic from './mapDataStatistic.js';\nimport mapSymbolLayout from './mapSymbolLayout.js';\nimport { createLegacyDataSelectAction } from '../../legacy/dataSelectAction.js';\nimport { install as installGeo } from '../../component/geo/install.js';\nexport function install(registers) {\n  use(installGeo);\n  registers.registerChartView(MapView);\n  registers.registerSeriesModel(MapSeries);\n  registers.registerLayout(mapSymbolLayout);\n  registers.registerProcessor(registers.PRIORITY.PROCESSOR.STATISTIC, mapDataStatistic);\n  createLegacyDataSelectAction('map', registers.registerAction);\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n/**\n * Initialize all computational message for following algorithm.\n */\nexport function init(inRoot) {\n  var root = inRoot;\n  root.hierNode = {\n    defaultAncestor: null,\n    ancestor: root,\n    prelim: 0,\n    modifier: 0,\n    change: 0,\n    shift: 0,\n    i: 0,\n    thread: null\n  };\n  var nodes = [root];\n  var node;\n  var children;\n  while (node = nodes.pop()) {\n    // jshint ignore:line\n    children = node.children;\n    if (node.isExpand && children.length) {\n      var n = children.length;\n      for (var i = n - 1; i >= 0; i--) {\n        var child = children[i];\n        child.hierNode = {\n          defaultAncestor: null,\n          ancestor: child,\n          prelim: 0,\n          modifier: 0,\n          change: 0,\n          shift: 0,\n          i: i,\n          thread: null\n        };\n        nodes.push(child);\n      }\n    }\n  }\n}\n/**\n * The implementation of this function was originally copied from \"d3.js\"\n * <https://github.com/d3/d3-hierarchy/blob/4c1f038f2725d6eae2e49b61d01456400694bac4/src/tree.js>\n * with some modifications made for this program.\n * See the license statement at the head of this file.\n *\n * Computes a preliminary x coordinate for node. Before that, this function is\n * applied recursively to the children of node, as well as the function\n * apportion(). After spacing out the children by calling executeShifts(), the\n * node is placed to the midpoint of its outermost children.\n */\nexport function firstWalk(node, separation) {\n  var children = node.isExpand ? node.children : [];\n  var siblings = node.parentNode.children;\n  var subtreeW = node.hierNode.i ? siblings[node.hierNode.i - 1] : null;\n  if (children.length) {\n    executeShifts(node);\n    var midPoint = (children[0].hierNode.prelim + children[children.length - 1].hierNode.prelim) / 2;\n    if (subtreeW) {\n      node.hierNode.prelim = subtreeW.hierNode.prelim + separation(node, subtreeW);\n      node.hierNode.modifier = node.hierNode.prelim - midPoint;\n    } else {\n      node.hierNode.prelim = midPoint;\n    }\n  } else if (subtreeW) {\n    node.hierNode.prelim = subtreeW.hierNode.prelim + separation(node, subtreeW);\n  }\n  node.parentNode.hierNode.defaultAncestor = apportion(node, subtreeW, node.parentNode.hierNode.defaultAncestor || siblings[0], separation);\n}\n/**\n * The implementation of this function was originally copied from \"d3.js\"\n * <https://github.com/d3/d3-hierarchy/blob/4c1f038f2725d6eae2e49b61d01456400694bac4/src/tree.js>\n * with some modifications made for this program.\n * See the license statement at the head of this file.\n *\n * Computes all real x-coordinates by summing up the modifiers recursively.\n */\nexport function secondWalk(node) {\n  var nodeX = node.hierNode.prelim + node.parentNode.hierNode.modifier;\n  node.setLayout({\n    x: nodeX\n  }, true);\n  node.hierNode.modifier += node.parentNode.hierNode.modifier;\n}\nexport function separation(cb) {\n  return arguments.length ? cb : defaultSeparation;\n}\n/**\n * Transform the common coordinate to radial coordinate.\n */\nexport function radialCoordinate(rad, r) {\n  rad -= Math.PI / 2;\n  return {\n    x: r * Math.cos(rad),\n    y: r * Math.sin(rad)\n  };\n}\n/**\n * All other shifts, applied to the smaller subtrees between w- and w+, are\n * performed by this function.\n *\n * The implementation of this function was originally copied from \"d3.js\"\n * <https://github.com/d3/d3-hierarchy/blob/4c1f038f2725d6eae2e49b61d01456400694bac4/src/tree.js>\n * with some modifications made for this program.\n * See the license statement at the head of this file.\n */\nfunction executeShifts(node) {\n  var children = node.children;\n  var n = children.length;\n  var shift = 0;\n  var change = 0;\n  while (--n >= 0) {\n    var child = children[n];\n    child.hierNode.prelim += shift;\n    child.hierNode.modifier += shift;\n    change += child.hierNode.change;\n    shift += child.hierNode.shift + change;\n  }\n}\n/**\n * The implementation of this function was originally copied from \"d3.js\"\n * <https://github.com/d3/d3-hierarchy/blob/4c1f038f2725d6eae2e49b61d01456400694bac4/src/tree.js>\n * with some modifications made for this program.\n * See the license statement at the head of this file.\n *\n * The core of the algorithm. Here, a new subtree is combined with the\n * previous subtrees. Threads are used to traverse the inside and outside\n * contours of the left and right subtree up to the highest common level.\n * Whenever two nodes of the inside contours conflict, we compute the left\n * one of the greatest uncommon ancestors using the function nextAncestor()\n * and call moveSubtree() to shift the subtree and prepare the shifts of\n * smaller subtrees. Finally, we add a new thread (if necessary).\n */\nfunction apportion(subtreeV, subtreeW, ancestor, separation) {\n  if (subtreeW) {\n    var nodeOutRight = subtreeV;\n    var nodeInRight = subtreeV;\n    var nodeOutLeft = nodeInRight.parentNode.children[0];\n    var nodeInLeft = subtreeW;\n    var sumOutRight = nodeOutRight.hierNode.modifier;\n    var sumInRight = nodeInRight.hierNode.modifier;\n    var sumOutLeft = nodeOutLeft.hierNode.modifier;\n    var sumInLeft = nodeInLeft.hierNode.modifier;\n    while (nodeInLeft = nextRight(nodeInLeft), nodeInRight = nextLeft(nodeInRight), nodeInLeft && nodeInRight) {\n      nodeOutRight = nextRight(nodeOutRight);\n      nodeOutLeft = nextLeft(nodeOutLeft);\n      nodeOutRight.hierNode.ancestor = subtreeV;\n      var shift = nodeInLeft.hierNode.prelim + sumInLeft - nodeInRight.hierNode.prelim - sumInRight + separation(nodeInLeft, nodeInRight);\n      if (shift > 0) {\n        moveSubtree(nextAncestor(nodeInLeft, subtreeV, ancestor), subtreeV, shift);\n        sumInRight += shift;\n        sumOutRight += shift;\n      }\n      sumInLeft += nodeInLeft.hierNode.modifier;\n      sumInRight += nodeInRight.hierNode.modifier;\n      sumOutRight += nodeOutRight.hierNode.modifier;\n      sumOutLeft += nodeOutLeft.hierNode.modifier;\n    }\n    if (nodeInLeft && !nextRight(nodeOutRight)) {\n      nodeOutRight.hierNode.thread = nodeInLeft;\n      nodeOutRight.hierNode.modifier += sumInLeft - sumOutRight;\n    }\n    if (nodeInRight && !nextLeft(nodeOutLeft)) {\n      nodeOutLeft.hierNode.thread = nodeInRight;\n      nodeOutLeft.hierNode.modifier += sumInRight - sumOutLeft;\n      ancestor = subtreeV;\n    }\n  }\n  return ancestor;\n}\n/**\n * This function is used to traverse the right contour of a subtree.\n * It returns the rightmost child of node or the thread of node. The function\n * returns null if and only if node is on the highest depth of its subtree.\n */\nfunction nextRight(node) {\n  var children = node.children;\n  return children.length && node.isExpand ? children[children.length - 1] : node.hierNode.thread;\n}\n/**\n * This function is used to traverse the left contour of a subtree (or a subforest).\n * It returns the leftmost child of node or the thread of node. The function\n * returns null if and only if node is on the highest depth of its subtree.\n */\nfunction nextLeft(node) {\n  var children = node.children;\n  return children.length && node.isExpand ? children[0] : node.hierNode.thread;\n}\n/**\n * If nodeInLeft\u2019s ancestor is a sibling of node, returns nodeInLeft\u2019s ancestor.\n * Otherwise, returns the specified ancestor.\n */\nfunction nextAncestor(nodeInLeft, node, ancestor) {\n  return nodeInLeft.hierNode.ancestor.parentNode === node.parentNode ? nodeInLeft.hierNode.ancestor : ancestor;\n}\n/**\n * The implementation of this function was originally copied from \"d3.js\"\n * <https://github.com/d3/d3-hierarchy/blob/4c1f038f2725d6eae2e49b61d01456400694bac4/src/tree.js>\n * with some modifications made for this program.\n * See the license statement at the head of this file.\n *\n * Shifts the current subtree rooted at wr.\n * This is done by increasing prelim(w+) and modifier(w+) by shift.\n */\nfunction moveSubtree(wl, wr, shift) {\n  var change = shift / (wr.hierNode.i - wl.hierNode.i);\n  wr.hierNode.change -= change;\n  wr.hierNode.shift += shift;\n  wr.hierNode.modifier += shift;\n  wr.hierNode.prelim += shift;\n  wl.hierNode.change += change;\n}\n/**\n * The implementation of this function was originally copied from \"d3.js\"\n * <https://github.com/d3/d3-hierarchy/blob/4c1f038f2725d6eae2e49b61d01456400694bac4/src/tree.js>\n * with some modifications made for this program.\n * See the license statement at the head of this file.\n */\nfunction defaultSeparation(node1, node2) {\n  return node1.parentNode === node2.parentNode ? 1 : 2;\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as graphic from '../../util/graphic.js';\nimport { getECData } from '../../util/innerStore.js';\nimport SymbolClz from '../helper/Symbol.js';\nimport { radialCoordinate } from './layoutHelper.js';\nimport * as bbox from 'zrender/lib/core/bbox.js';\nimport View from '../../coord/View.js';\nimport * as roamHelper from '../../component/helper/roamHelper.js';\nimport RoamController from '../../component/helper/RoamController.js';\nimport { parsePercent } from '../../util/number.js';\nimport ChartView from '../../view/Chart.js';\nimport Path from 'zrender/lib/graphic/Path.js';\nimport { setStatesStylesFromModel, setStatesFlag, setDefaultStateProxy, HOVER_STATE_BLUR } from '../../util/states.js';\nimport tokens from '../../visual/tokens.js';\nvar TreeEdgeShape = /** @class */function () {\n  function TreeEdgeShape() {\n    this.parentPoint = [];\n    this.childPoints = [];\n  }\n  return TreeEdgeShape;\n}();\nvar TreePath = /** @class */function (_super) {\n  __extends(TreePath, _super);\n  function TreePath(opts) {\n    return _super.call(this, opts) || this;\n  }\n  TreePath.prototype.getDefaultStyle = function () {\n    return {\n      stroke: tokens.color.neutral99,\n      fill: null\n    };\n  };\n  TreePath.prototype.getDefaultShape = function () {\n    return new TreeEdgeShape();\n  };\n  TreePath.prototype.buildPath = function (ctx, shape) {\n    var childPoints = shape.childPoints;\n    var childLen = childPoints.length;\n    var parentPoint = shape.parentPoint;\n    var firstChildPos = childPoints[0];\n    var lastChildPos = childPoints[childLen - 1];\n    if (childLen === 1) {\n      ctx.moveTo(parentPoint[0], parentPoint[1]);\n      ctx.lineTo(firstChildPos[0], firstChildPos[1]);\n      return;\n    }\n    var orient = shape.orient;\n    var forkDim = orient === 'TB' || orient === 'BT' ? 0 : 1;\n    var otherDim = 1 - forkDim;\n    var forkPosition = parsePercent(shape.forkPosition, 1);\n    var tmpPoint = [];\n    tmpPoint[forkDim] = parentPoint[forkDim];\n    tmpPoint[otherDim] = parentPoint[otherDim] + (lastChildPos[otherDim] - parentPoint[otherDim]) * forkPosition;\n    ctx.moveTo(parentPoint[0], parentPoint[1]);\n    ctx.lineTo(tmpPoint[0], tmpPoint[1]);\n    ctx.moveTo(firstChildPos[0], firstChildPos[1]);\n    tmpPoint[forkDim] = firstChildPos[forkDim];\n    ctx.lineTo(tmpPoint[0], tmpPoint[1]);\n    tmpPoint[forkDim] = lastChildPos[forkDim];\n    ctx.lineTo(tmpPoint[0], tmpPoint[1]);\n    ctx.lineTo(lastChildPos[0], lastChildPos[1]);\n    for (var i = 1; i < childLen - 1; i++) {\n      var point = childPoints[i];\n      ctx.moveTo(point[0], point[1]);\n      tmpPoint[forkDim] = point[forkDim];\n      ctx.lineTo(tmpPoint[0], tmpPoint[1]);\n    }\n  };\n  return TreePath;\n}(Path);\nvar TreeView = /** @class */function (_super) {\n  __extends(TreeView, _super);\n  function TreeView() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = TreeView.type;\n    _this._mainGroup = new graphic.Group();\n    return _this;\n  }\n  TreeView.prototype.init = function (ecModel, api) {\n    this._controller = new RoamController(api.getZr());\n    this._controllerHost = {\n      target: this.group\n    };\n    this.group.add(this._mainGroup);\n  };\n  TreeView.prototype.render = function (seriesModel, ecModel, api) {\n    var data = seriesModel.getData();\n    var layoutInfo = seriesModel.layoutInfo;\n    var group = this._mainGroup;\n    var layout = seriesModel.get('layout');\n    if (layout === 'radial') {\n      group.x = layoutInfo.x + layoutInfo.width / 2;\n      group.y = layoutInfo.y + layoutInfo.height / 2;\n    } else {\n      group.x = layoutInfo.x;\n      group.y = layoutInfo.y;\n    }\n    this._updateViewCoordSys(seriesModel, api);\n    this._updateController(seriesModel, null, ecModel, api);\n    var oldData = this._data;\n    data.diff(oldData).add(function (newIdx) {\n      if (symbolNeedsDraw(data, newIdx)) {\n        // Create node and edge\n        updateNode(data, newIdx, null, group, seriesModel);\n      }\n    }).update(function (newIdx, oldIdx) {\n      var symbolEl = oldData.getItemGraphicEl(oldIdx);\n      if (!symbolNeedsDraw(data, newIdx)) {\n        symbolEl && removeNode(oldData, oldIdx, symbolEl, group, seriesModel);\n        return;\n      }\n      // Update node and edge\n      updateNode(data, newIdx, symbolEl, group, seriesModel);\n    }).remove(function (oldIdx) {\n      var symbolEl = oldData.getItemGraphicEl(oldIdx);\n      // When remove a collapsed node of subtree, since the collapsed\n      // node haven't been initialized with a symbol element,\n      // you can't found it's symbol element through index.\n      // so if we want to remove the symbol element we should insure\n      // that the symbol element is not null.\n      if (symbolEl) {\n        removeNode(oldData, oldIdx, symbolEl, group, seriesModel);\n      }\n    }).execute();\n    this._nodeScaleRatio = seriesModel.get('nodeScaleRatio');\n    this._updateNodeAndLinkScale(seriesModel);\n    if (seriesModel.get('expandAndCollapse') === true) {\n      data.eachItemGraphicEl(function (el, dataIndex) {\n        el.off('click').on('click', function () {\n          api.dispatchAction({\n            type: 'treeExpandAndCollapse',\n            seriesId: seriesModel.id,\n            dataIndex: dataIndex\n          });\n        });\n      });\n    }\n    this._data = data;\n  };\n  TreeView.prototype._updateViewCoordSys = function (seriesModel, api) {\n    var data = seriesModel.getData();\n    var points = [];\n    data.each(function (idx) {\n      var layout = data.getItemLayout(idx);\n      if (layout && !isNaN(layout.x) && !isNaN(layout.y)) {\n        points.push([+layout.x, +layout.y]);\n      }\n    });\n    var min = [];\n    var max = [];\n    bbox.fromPoints(points, min, max);\n    // If don't Store min max when collapse the root node after roam,\n    // the root node will disappear.\n    var oldMin = this._min;\n    var oldMax = this._max;\n    // If width or height is 0\n    if (max[0] - min[0] === 0) {\n      min[0] = oldMin ? oldMin[0] : min[0] - 1;\n      max[0] = oldMax ? oldMax[0] : max[0] + 1;\n    }\n    if (max[1] - min[1] === 0) {\n      min[1] = oldMin ? oldMin[1] : min[1] - 1;\n      max[1] = oldMax ? oldMax[1] : max[1] + 1;\n    }\n    var viewCoordSys = seriesModel.coordinateSystem = new View(null, {\n      api: api,\n      ecModel: seriesModel.ecModel\n    });\n    viewCoordSys.zoomLimit = seriesModel.get('scaleLimit');\n    viewCoordSys.setBoundingRect(min[0], min[1], max[0] - min[0], max[1] - min[1]);\n    viewCoordSys.setCenter(seriesModel.get('center'));\n    viewCoordSys.setZoom(seriesModel.get('zoom'));\n    // Here we use viewCoordSys just for computing the 'position' and 'scale' of the group,\n    // and 'treeRoam' action.\n    this.group.attr({\n      x: viewCoordSys.x,\n      y: viewCoordSys.y,\n      scaleX: viewCoordSys.scaleX,\n      scaleY: viewCoordSys.scaleY\n    });\n    this._min = min;\n    this._max = max;\n  };\n  TreeView.prototype._updateController = function (seriesModel, clipRect, ecModel, api) {\n    var _this = this;\n    roamHelper.updateController(seriesModel, api, this.group, this._controller, this._controllerHost, clipRect);\n    this._controller.on('zoom', function (e) {\n      _this._updateNodeAndLinkScale(seriesModel);\n    });\n  };\n  TreeView.prototype._updateNodeAndLinkScale = function (seriesModel) {\n    var data = seriesModel.getData();\n    var nodeScale = this._getNodeGlobalScale(seriesModel);\n    data.eachItemGraphicEl(function (el, idx) {\n      el.setSymbolScale(nodeScale);\n    });\n  };\n  TreeView.prototype._getNodeGlobalScale = function (seriesModel) {\n    var coordSys = seriesModel.coordinateSystem;\n    if (coordSys.type !== 'view') {\n      return 1;\n    }\n    var nodeScaleRatio = this._nodeScaleRatio;\n    var groupZoom = coordSys.scaleX || 1;\n    // Scale node when zoom changes\n    var roamZoom = coordSys.getZoom();\n    var nodeScale = (roamZoom - 1) * nodeScaleRatio + 1;\n    return nodeScale / groupZoom;\n  };\n  TreeView.prototype.dispose = function () {\n    this._controller && this._controller.dispose();\n    this._controllerHost = null;\n  };\n  TreeView.prototype.remove = function () {\n    this._mainGroup.removeAll();\n    this._data = null;\n  };\n  TreeView.type = 'tree';\n  return TreeView;\n}(ChartView);\nfunction symbolNeedsDraw(data, dataIndex) {\n  var layout = data.getItemLayout(dataIndex);\n  return layout && !isNaN(layout.x) && !isNaN(layout.y);\n}\nfunction updateNode(data, dataIndex, symbolEl, group, seriesModel) {\n  var isInit = !symbolEl;\n  var node = data.tree.getNodeByDataIndex(dataIndex);\n  var itemModel = node.getModel();\n  var visualColor = node.getVisual('style').fill;\n  var symbolInnerColor = node.isExpand === false && node.children.length !== 0 ? visualColor : tokens.color.neutral00;\n  var virtualRoot = data.tree.root;\n  var source = node.parentNode === virtualRoot ? node : node.parentNode || node;\n  var sourceSymbolEl = data.getItemGraphicEl(source.dataIndex);\n  var sourceLayout = source.getLayout();\n  var sourceOldLayout = sourceSymbolEl ? {\n    x: sourceSymbolEl.__oldX,\n    y: sourceSymbolEl.__oldY,\n    rawX: sourceSymbolEl.__radialOldRawX,\n    rawY: sourceSymbolEl.__radialOldRawY\n  } : sourceLayout;\n  var targetLayout = node.getLayout();\n  if (isInit) {\n    symbolEl = new SymbolClz(data, dataIndex, null, {\n      symbolInnerColor: symbolInnerColor,\n      useNameLabel: true\n    });\n    symbolEl.x = sourceOldLayout.x;\n    symbolEl.y = sourceOldLayout.y;\n  } else {\n    symbolEl.updateData(data, dataIndex, null, {\n      symbolInnerColor: symbolInnerColor,\n      useNameLabel: true\n    });\n  }\n  symbolEl.__radialOldRawX = symbolEl.__radialRawX;\n  symbolEl.__radialOldRawY = symbolEl.__radialRawY;\n  symbolEl.__radialRawX = targetLayout.rawX;\n  symbolEl.__radialRawY = targetLayout.rawY;\n  group.add(symbolEl);\n  data.setItemGraphicEl(dataIndex, symbolEl);\n  symbolEl.__oldX = symbolEl.x;\n  symbolEl.__oldY = symbolEl.y;\n  graphic.updateProps(symbolEl, {\n    x: targetLayout.x,\n    y: targetLayout.y\n  }, seriesModel);\n  var symbolPath = symbolEl.getSymbolPath();\n  if (seriesModel.get('layout') === 'radial') {\n    var realRoot = virtualRoot.children[0];\n    var rootLayout = realRoot.getLayout();\n    var length_1 = realRoot.children.length;\n    var rad = void 0;\n    var isLeft = void 0;\n    if (targetLayout.x === rootLayout.x && node.isExpand === true && realRoot.children.length) {\n      var center = {\n        x: (realRoot.children[0].getLayout().x + realRoot.children[length_1 - 1].getLayout().x) / 2,\n        y: (realRoot.children[0].getLayout().y + realRoot.children[length_1 - 1].getLayout().y) / 2\n      };\n      rad = Math.atan2(center.y - rootLayout.y, center.x - rootLayout.x);\n      if (rad < 0) {\n        rad = Math.PI * 2 + rad;\n      }\n      isLeft = center.x < rootLayout.x;\n      if (isLeft) {\n        rad = rad - Math.PI;\n      }\n    } else {\n      rad = Math.atan2(targetLayout.y - rootLayout.y, targetLayout.x - rootLayout.x);\n      if (rad < 0) {\n        rad = Math.PI * 2 + rad;\n      }\n      if (node.children.length === 0 || node.children.length !== 0 && node.isExpand === false) {\n        isLeft = targetLayout.x < rootLayout.x;\n        if (isLeft) {\n          rad = rad - Math.PI;\n        }\n      } else {\n        isLeft = targetLayout.x > rootLayout.x;\n        if (!isLeft) {\n          rad = rad - Math.PI;\n        }\n      }\n    }\n    var textPosition = isLeft ? 'left' : 'right';\n    var normalLabelModel = itemModel.getModel('label');\n    var rotate = normalLabelModel.get('rotate');\n    var labelRotateRadian = rotate * (Math.PI / 180);\n    var textContent = symbolPath.getTextContent();\n    if (textContent) {\n      symbolPath.setTextConfig({\n        position: normalLabelModel.get('position') || textPosition,\n        rotation: rotate == null ? -rad : labelRotateRadian,\n        origin: 'center'\n      });\n      textContent.setStyle('verticalAlign', 'middle');\n    }\n  }\n  // Handle status\n  var focus = itemModel.get(['emphasis', 'focus']);\n  var focusDataIndices = focus === 'relative' ? zrUtil.concatArray(node.getAncestorsIndices(), node.getDescendantIndices()) : focus === 'ancestor' ? node.getAncestorsIndices() : focus === 'descendant' ? node.getDescendantIndices() : null;\n  if (focusDataIndices) {\n    // Modify the focus to data indices.\n    getECData(symbolEl).focus = focusDataIndices;\n  }\n  drawEdge(seriesModel, node, virtualRoot, symbolEl, sourceOldLayout, sourceLayout, targetLayout, group);\n  if (symbolEl.__edge) {\n    symbolEl.onHoverStateChange = function (toState) {\n      if (toState !== 'blur') {\n        // NOTE: Ensure the parent elements will been blurred firstly.\n        // According to the return of getAncestorsIndices and getDescendantIndices\n        // TODO: A bit tricky.\n        var parentEl = node.parentNode && data.getItemGraphicEl(node.parentNode.dataIndex);\n        if (!(parentEl && parentEl.hoverState === HOVER_STATE_BLUR)) {\n          setStatesFlag(symbolEl.__edge, toState);\n        }\n      }\n    };\n  }\n}\nfunction drawEdge(seriesModel, node, virtualRoot, symbolEl, sourceOldLayout, sourceLayout, targetLayout, group) {\n  var itemModel = node.getModel();\n  var edgeShape = seriesModel.get('edgeShape');\n  var layout = seriesModel.get('layout');\n  var orient = seriesModel.getOrient();\n  var curvature = seriesModel.get(['lineStyle', 'curveness']);\n  var edgeForkPosition = seriesModel.get('edgeForkPosition');\n  var lineStyle = itemModel.getModel('lineStyle').getLineStyle();\n  var edge = symbolEl.__edge;\n  // curve edge from node -> parent\n  // polyline edge from node -> children\n  if (edgeShape === 'curve') {\n    if (node.parentNode && node.parentNode !== virtualRoot) {\n      if (!edge) {\n        edge = symbolEl.__edge = new graphic.BezierCurve({\n          shape: getEdgeShape(layout, orient, curvature, sourceOldLayout, sourceOldLayout)\n        });\n      }\n      graphic.updateProps(edge, {\n        shape: getEdgeShape(layout, orient, curvature, sourceLayout, targetLayout)\n      }, seriesModel);\n    }\n  } else if (edgeShape === 'polyline') {\n    if (layout === 'orthogonal') {\n      if (node !== virtualRoot && node.children && node.children.length !== 0 && node.isExpand === true) {\n        var children = node.children;\n        var childPoints = [];\n        for (var i = 0; i < children.length; i++) {\n          var childLayout = children[i].getLayout();\n          childPoints.push([childLayout.x, childLayout.y]);\n        }\n        if (!edge) {\n          edge = symbolEl.__edge = new TreePath({\n            shape: {\n              parentPoint: [targetLayout.x, targetLayout.y],\n              childPoints: [[targetLayout.x, targetLayout.y]],\n              orient: orient,\n              forkPosition: edgeForkPosition\n            }\n          });\n        }\n        graphic.updateProps(edge, {\n          shape: {\n            parentPoint: [targetLayout.x, targetLayout.y],\n            childPoints: childPoints\n          }\n        }, seriesModel);\n      }\n    } else {\n      if (process.env.NODE_ENV !== 'production') {\n        throw new Error('The polyline edgeShape can only be used in orthogonal layout');\n      }\n    }\n  }\n  // show all edge when edgeShape is 'curve', filter node `isExpand` is false when edgeShape is 'polyline'\n  if (edge && !(edgeShape === 'polyline' && !node.isExpand)) {\n    edge.useStyle(zrUtil.defaults({\n      strokeNoScale: true,\n      fill: null\n    }, lineStyle));\n    setStatesStylesFromModel(edge, itemModel, 'lineStyle');\n    setDefaultStateProxy(edge);\n    group.add(edge);\n  }\n}\nfunction removeNodeEdge(node, data, group, seriesModel, removeAnimationOpt) {\n  var virtualRoot = data.tree.root;\n  var _a = getSourceNode(virtualRoot, node),\n    source = _a.source,\n    sourceLayout = _a.sourceLayout;\n  var symbolEl = data.getItemGraphicEl(node.dataIndex);\n  if (!symbolEl) {\n    return;\n  }\n  var sourceSymbolEl = data.getItemGraphicEl(source.dataIndex);\n  var sourceEdge = sourceSymbolEl.__edge;\n  // 1. when expand the sub tree, delete the children node should delete the edge of\n  // the source at the same time. because the polyline edge shape is only owned by the source.\n  // 2.when the node is the only children of the source, delete the node should delete the edge of\n  // the source at the same time. the same reason as above.\n  var edge = symbolEl.__edge || (source.isExpand === false || source.children.length === 1 ? sourceEdge : undefined);\n  var edgeShape = seriesModel.get('edgeShape');\n  var layoutOpt = seriesModel.get('layout');\n  var orient = seriesModel.get('orient');\n  var curvature = seriesModel.get(['lineStyle', 'curveness']);\n  if (edge) {\n    if (edgeShape === 'curve') {\n      graphic.removeElement(edge, {\n        shape: getEdgeShape(layoutOpt, orient, curvature, sourceLayout, sourceLayout),\n        style: {\n          opacity: 0\n        }\n      }, seriesModel, {\n        cb: function () {\n          group.remove(edge);\n        },\n        removeOpt: removeAnimationOpt\n      });\n    } else if (edgeShape === 'polyline' && seriesModel.get('layout') === 'orthogonal') {\n      graphic.removeElement(edge, {\n        shape: {\n          parentPoint: [sourceLayout.x, sourceLayout.y],\n          childPoints: [[sourceLayout.x, sourceLayout.y]]\n        },\n        style: {\n          opacity: 0\n        }\n      }, seriesModel, {\n        cb: function () {\n          group.remove(edge);\n        },\n        removeOpt: removeAnimationOpt\n      });\n    }\n  }\n}\nfunction getSourceNode(virtualRoot, node) {\n  var source = node.parentNode === virtualRoot ? node : node.parentNode || node;\n  var sourceLayout;\n  while (sourceLayout = source.getLayout(), sourceLayout == null) {\n    source = source.parentNode === virtualRoot ? source : source.parentNode || source;\n  }\n  return {\n    source: source,\n    sourceLayout: sourceLayout\n  };\n}\nfunction removeNode(data, dataIndex, symbolEl, group, seriesModel) {\n  var node = data.tree.getNodeByDataIndex(dataIndex);\n  var virtualRoot = data.tree.root;\n  var sourceLayout = getSourceNode(virtualRoot, node).sourceLayout;\n  // Use same duration and easing with update to have more consistent animation.\n  var removeAnimationOpt = {\n    duration: seriesModel.get('animationDurationUpdate'),\n    easing: seriesModel.get('animationEasingUpdate')\n  };\n  graphic.removeElement(symbolEl, {\n    x: sourceLayout.x + 1,\n    y: sourceLayout.y + 1\n  }, seriesModel, {\n    cb: function () {\n      group.remove(symbolEl);\n      data.setItemGraphicEl(dataIndex, null);\n    },\n    removeOpt: removeAnimationOpt\n  });\n  symbolEl.fadeOut(null, data.hostModel, {\n    fadeLabel: true,\n    animation: removeAnimationOpt\n  });\n  // remove edge as parent node\n  node.children.forEach(function (childNode) {\n    removeNodeEdge(childNode, data, group, seriesModel, removeAnimationOpt);\n  });\n  // remove edge as child node\n  removeNodeEdge(node, data, group, seriesModel, removeAnimationOpt);\n}\nfunction getEdgeShape(layoutOpt, orient, curvature, sourceLayout, targetLayout) {\n  var cpx1;\n  var cpy1;\n  var cpx2;\n  var cpy2;\n  var x1;\n  var x2;\n  var y1;\n  var y2;\n  if (layoutOpt === 'radial') {\n    x1 = sourceLayout.rawX;\n    y1 = sourceLayout.rawY;\n    x2 = targetLayout.rawX;\n    y2 = targetLayout.rawY;\n    var radialCoor1 = radialCoordinate(x1, y1);\n    var radialCoor2 = radialCoordinate(x1, y1 + (y2 - y1) * curvature);\n    var radialCoor3 = radialCoordinate(x2, y2 + (y1 - y2) * curvature);\n    var radialCoor4 = radialCoordinate(x2, y2);\n    return {\n      x1: radialCoor1.x || 0,\n      y1: radialCoor1.y || 0,\n      x2: radialCoor4.x || 0,\n      y2: radialCoor4.y || 0,\n      cpx1: radialCoor2.x || 0,\n      cpy1: radialCoor2.y || 0,\n      cpx2: radialCoor3.x || 0,\n      cpy2: radialCoor3.y || 0\n    };\n  } else {\n    x1 = sourceLayout.x;\n    y1 = sourceLayout.y;\n    x2 = targetLayout.x;\n    y2 = targetLayout.y;\n    if (orient === 'LR' || orient === 'RL') {\n      cpx1 = x1 + (x2 - x1) * curvature;\n      cpy1 = y1;\n      cpx2 = x2 + (x1 - x2) * curvature;\n      cpy2 = y2;\n    }\n    if (orient === 'TB' || orient === 'BT') {\n      cpx1 = x1;\n      cpy1 = y1 + (y2 - y1) * curvature;\n      cpx2 = x2;\n      cpy2 = y2 + (y1 - y2) * curvature;\n    }\n  }\n  return {\n    x1: x1,\n    y1: y1,\n    x2: x2,\n    y2: y2,\n    cpx1: cpx1,\n    cpy1: cpy1,\n    cpx2: cpx2,\n    cpy2: cpy2\n  };\n}\nexport default TreeView;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n/**\n * Link lists and struct (graph or tree)\n */\nimport { curry, each, assert, extend, map, keys } from 'zrender/lib/core/util.js';\nimport { makeInner } from '../../util/model.js';\nvar inner = makeInner();\nfunction linkSeriesData(opt) {\n  var mainData = opt.mainData;\n  var datas = opt.datas;\n  if (!datas) {\n    datas = {\n      main: mainData\n    };\n    opt.datasAttr = {\n      main: 'data'\n    };\n  }\n  opt.datas = opt.mainData = null;\n  linkAll(mainData, datas, opt);\n  // Porxy data original methods.\n  each(datas, function (data) {\n    each(mainData.TRANSFERABLE_METHODS, function (methodName) {\n      data.wrapMethod(methodName, curry(transferInjection, opt));\n    });\n  });\n  // Beyond transfer, additional features should be added to `cloneShallow`.\n  mainData.wrapMethod('cloneShallow', curry(cloneShallowInjection, opt));\n  // Only mainData trigger change, because struct.update may trigger\n  // another changable methods, which may bring about dead lock.\n  each(mainData.CHANGABLE_METHODS, function (methodName) {\n    mainData.wrapMethod(methodName, curry(changeInjection, opt));\n  });\n  // Make sure datas contains mainData.\n  assert(datas[mainData.dataType] === mainData);\n}\nfunction transferInjection(opt, res) {\n  if (isMainData(this)) {\n    // Transfer datas to new main data.\n    var datas = extend({}, inner(this).datas);\n    datas[this.dataType] = res;\n    linkAll(res, datas, opt);\n  } else {\n    // Modify the reference in main data to point newData.\n    linkSingle(res, this.dataType, inner(this).mainData, opt);\n  }\n  return res;\n}\nfunction changeInjection(opt, res) {\n  opt.struct && opt.struct.update();\n  return res;\n}\nfunction cloneShallowInjection(opt, res) {\n  // cloneShallow, which brings about some fragilities, may be inappropriate\n  // to be exposed as an API. So for implementation simplicity we can make\n  // the restriction that cloneShallow of not-mainData should not be invoked\n  // outside, but only be invoked here.\n  each(inner(res).datas, function (data, dataType) {\n    data !== res && linkSingle(data.cloneShallow(), dataType, res, opt);\n  });\n  return res;\n}\n/**\n * Supplement method to List.\n *\n * @public\n * @param [dataType] If not specified, return mainData.\n */\nfunction getLinkedData(dataType) {\n  var mainData = inner(this).mainData;\n  return dataType == null || mainData == null ? mainData : inner(mainData).datas[dataType];\n}\n/**\n * Get list of all linked data\n */\nfunction getLinkedDataAll() {\n  var mainData = inner(this).mainData;\n  return mainData == null ? [{\n    data: mainData\n  }] : map(keys(inner(mainData).datas), function (type) {\n    return {\n      type: type,\n      data: inner(mainData).datas[type]\n    };\n  });\n}\nfunction isMainData(data) {\n  return inner(data).mainData === data;\n}\nfunction linkAll(mainData, datas, opt) {\n  inner(mainData).datas = {};\n  each(datas, function (data, dataType) {\n    linkSingle(data, dataType, mainData, opt);\n  });\n}\nfunction linkSingle(data, dataType, mainData, opt) {\n  inner(mainData).datas[dataType] = data;\n  inner(data).mainData = mainData;\n  data.dataType = dataType;\n  if (opt.struct) {\n    data[opt.structAttr] = opt.struct;\n    opt.struct[opt.datasAttr[dataType]] = data;\n  }\n  // Supplement method.\n  data.getLinkedData = getLinkedData;\n  data.getLinkedDataAll = getLinkedDataAll;\n}\nexport default linkSeriesData;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n/**\n * Tree data structure\n */\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport linkSeriesData from './helper/linkSeriesData.js';\nimport SeriesData from './SeriesData.js';\nimport prepareSeriesDataSchema from './helper/createDimensions.js';\nimport { convertOptionIdName } from '../util/model.js';\nvar TreeNode = /** @class */function () {\n  function TreeNode(name, hostTree) {\n    this.depth = 0;\n    this.height = 0;\n    /**\n     * Reference to list item.\n     * Do not persistent dataIndex outside,\n     * besause it may be changed by list.\n     * If dataIndex -1,\n     * this node is logical deleted (filtered) in list.\n     */\n    this.dataIndex = -1;\n    this.children = [];\n    this.viewChildren = [];\n    this.isExpand = false;\n    this.name = name || '';\n    this.hostTree = hostTree;\n  }\n  /**\n   * The node is removed.\n   */\n  TreeNode.prototype.isRemoved = function () {\n    return this.dataIndex < 0;\n  };\n  TreeNode.prototype.eachNode = function (options, cb, context) {\n    if (zrUtil.isFunction(options)) {\n      context = cb;\n      cb = options;\n      options = null;\n    }\n    options = options || {};\n    if (zrUtil.isString(options)) {\n      options = {\n        order: options\n      };\n    }\n    var order = options.order || 'preorder';\n    var children = this[options.attr || 'children'];\n    var suppressVisitSub;\n    order === 'preorder' && (suppressVisitSub = cb.call(context, this));\n    for (var i = 0; !suppressVisitSub && i < children.length; i++) {\n      children[i].eachNode(options, cb, context);\n    }\n    order === 'postorder' && cb.call(context, this);\n  };\n  /**\n   * Update depth and height of this subtree.\n   */\n  TreeNode.prototype.updateDepthAndHeight = function (depth) {\n    var height = 0;\n    this.depth = depth;\n    for (var i = 0; i < this.children.length; i++) {\n      var child = this.children[i];\n      child.updateDepthAndHeight(depth + 1);\n      if (child.height > height) {\n        height = child.height;\n      }\n    }\n    this.height = height + 1;\n  };\n  TreeNode.prototype.getNodeById = function (id) {\n    if (this.getId() === id) {\n      return this;\n    }\n    for (var i = 0, children = this.children, len = children.length; i < len; i++) {\n      var res = children[i].getNodeById(id);\n      if (res) {\n        return res;\n      }\n    }\n  };\n  TreeNode.prototype.contains = function (node) {\n    if (node === this) {\n      return true;\n    }\n    for (var i = 0, children = this.children, len = children.length; i < len; i++) {\n      var res = children[i].contains(node);\n      if (res) {\n        return res;\n      }\n    }\n  };\n  /**\n   * @param includeSelf Default false.\n   * @return order: [root, child, grandchild, ...]\n   */\n  TreeNode.prototype.getAncestors = function (includeSelf) {\n    var ancestors = [];\n    var node = includeSelf ? this : this.parentNode;\n    while (node) {\n      ancestors.push(node);\n      node = node.parentNode;\n    }\n    ancestors.reverse();\n    return ancestors;\n  };\n  TreeNode.prototype.getAncestorsIndices = function () {\n    var indices = [];\n    var currNode = this;\n    while (currNode) {\n      indices.push(currNode.dataIndex);\n      currNode = currNode.parentNode;\n    }\n    indices.reverse();\n    return indices;\n  };\n  TreeNode.prototype.getDescendantIndices = function () {\n    var indices = [];\n    this.eachNode(function (childNode) {\n      indices.push(childNode.dataIndex);\n    });\n    return indices;\n  };\n  TreeNode.prototype.getValue = function (dimension) {\n    var data = this.hostTree.data;\n    return data.getStore().get(data.getDimensionIndex(dimension || 'value'), this.dataIndex);\n  };\n  TreeNode.prototype.setLayout = function (layout, merge) {\n    this.dataIndex >= 0 && this.hostTree.data.setItemLayout(this.dataIndex, layout, merge);\n  };\n  /**\n   * @return {Object} layout\n   */\n  TreeNode.prototype.getLayout = function () {\n    return this.hostTree.data.getItemLayout(this.dataIndex);\n  };\n  // @depcrecated\n  // getModel<T = unknown, S extends keyof T = keyof T>(path: S): Model<T[S]>\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  TreeNode.prototype.getModel = function (path) {\n    if (this.dataIndex < 0) {\n      return;\n    }\n    var hostTree = this.hostTree;\n    var itemModel = hostTree.data.getItemModel(this.dataIndex);\n    return itemModel.getModel(path);\n  };\n  // TODO: TYPE More specific model\n  TreeNode.prototype.getLevelModel = function () {\n    return (this.hostTree.levelModels || [])[this.depth];\n  };\n  TreeNode.prototype.setVisual = function (key, value) {\n    this.dataIndex >= 0 && this.hostTree.data.setItemVisual(this.dataIndex, key, value);\n  };\n  /**\n   * Get item visual\n   * FIXME: make return type better\n   */\n  TreeNode.prototype.getVisual = function (key) {\n    return this.hostTree.data.getItemVisual(this.dataIndex, key);\n  };\n  TreeNode.prototype.getRawIndex = function () {\n    return this.hostTree.data.getRawIndex(this.dataIndex);\n  };\n  TreeNode.prototype.getId = function () {\n    return this.hostTree.data.getId(this.dataIndex);\n  };\n  /**\n   * index in parent's children\n   */\n  TreeNode.prototype.getChildIndex = function () {\n    if (this.parentNode) {\n      var children = this.parentNode.children;\n      for (var i = 0; i < children.length; ++i) {\n        if (children[i] === this) {\n          return i;\n        }\n      }\n      return -1;\n    }\n    return -1;\n  };\n  /**\n   * if this is an ancestor of another node\n   *\n   * @param node another node\n   * @return if is ancestor\n   */\n  TreeNode.prototype.isAncestorOf = function (node) {\n    var parent = node.parentNode;\n    while (parent) {\n      if (parent === this) {\n        return true;\n      }\n      parent = parent.parentNode;\n    }\n    return false;\n  };\n  /**\n   * if this is an descendant of another node\n   *\n   * @param node another node\n   * @return if is descendant\n   */\n  TreeNode.prototype.isDescendantOf = function (node) {\n    return node !== this && node.isAncestorOf(this);\n  };\n  return TreeNode;\n}();\nexport { TreeNode };\n;\nvar Tree = /** @class */function () {\n  function Tree(hostModel) {\n    this.type = 'tree';\n    this._nodes = [];\n    this.hostModel = hostModel;\n  }\n  Tree.prototype.eachNode = function (options, cb, context) {\n    this.root.eachNode(options, cb, context);\n  };\n  Tree.prototype.getNodeByDataIndex = function (dataIndex) {\n    var rawIndex = this.data.getRawIndex(dataIndex);\n    return this._nodes[rawIndex];\n  };\n  Tree.prototype.getNodeById = function (name) {\n    return this.root.getNodeById(name);\n  };\n  /**\n   * Update item available by list,\n   * when list has been performed options like 'filterSelf' or 'map'.\n   */\n  Tree.prototype.update = function () {\n    var data = this.data;\n    var nodes = this._nodes;\n    for (var i = 0, len = nodes.length; i < len; i++) {\n      nodes[i].dataIndex = -1;\n    }\n    for (var i = 0, len = data.count(); i < len; i++) {\n      nodes[data.getRawIndex(i)].dataIndex = i;\n    }\n  };\n  /**\n   * Clear all layouts\n   */\n  Tree.prototype.clearLayouts = function () {\n    this.data.clearItemLayouts();\n  };\n  /**\n   * data node format:\n   * {\n   *     name: ...\n   *     value: ...\n   *     children: [\n   *         {\n   *             name: ...\n   *             value: ...\n   *             children: ...\n   *         },\n   *         ...\n   *     ]\n   * }\n   */\n  Tree.createTree = function (dataRoot, hostModel, beforeLink) {\n    var tree = new Tree(hostModel);\n    var listData = [];\n    var dimMax = 1;\n    buildHierarchy(dataRoot);\n    function buildHierarchy(dataNode, parentNode) {\n      var value = dataNode.value;\n      dimMax = Math.max(dimMax, zrUtil.isArray(value) ? value.length : 1);\n      listData.push(dataNode);\n      var node = new TreeNode(convertOptionIdName(dataNode.name, ''), tree);\n      parentNode ? addChild(node, parentNode) : tree.root = node;\n      tree._nodes.push(node);\n      var children = dataNode.children;\n      if (children) {\n        for (var i = 0; i < children.length; i++) {\n          buildHierarchy(children[i], node);\n        }\n      }\n    }\n    tree.root.updateDepthAndHeight(0);\n    var dimensions = prepareSeriesDataSchema(listData, {\n      coordDimensions: ['value'],\n      dimensionsCount: dimMax\n    }).dimensions;\n    var list = new SeriesData(dimensions, hostModel);\n    list.initData(listData);\n    beforeLink && beforeLink(list);\n    linkSeriesData({\n      mainData: list,\n      struct: tree,\n      structAttr: 'tree'\n    });\n    tree.update();\n    return tree;\n  };\n  return Tree;\n}();\n/**\n * It is needed to consider the mess of 'list', 'hostModel' when creating a TreeNote,\n * so this function is not ready and not necessary to be public.\n */\nfunction addChild(child, node) {\n  var children = node.children;\n  if (child.parentNode === node) {\n    return;\n  }\n  children.push(child);\n  child.parentNode = node;\n}\nexport default Tree;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nexport function retrieveTargetInfo(payload, validPayloadTypes, seriesModel) {\n  if (payload && zrUtil.indexOf(validPayloadTypes, payload.type) >= 0) {\n    var root = seriesModel.getData().tree.root;\n    var targetNode = payload.targetNode;\n    if (zrUtil.isString(targetNode)) {\n      targetNode = root.getNodeById(targetNode);\n    }\n    if (targetNode && root.contains(targetNode)) {\n      return {\n        node: targetNode\n      };\n    }\n    var targetNodeId = payload.targetNodeId;\n    if (targetNodeId != null && (targetNode = root.getNodeById(targetNodeId))) {\n      return {\n        node: targetNode\n      };\n    }\n  }\n}\n// Not includes the given node at the last item.\nexport function getPathToRoot(node) {\n  var path = [];\n  while (node) {\n    node = node.parentNode;\n    node && path.push(node);\n  }\n  return path.reverse();\n}\nexport function aboveViewRoot(viewRoot, node) {\n  var viewPath = getPathToRoot(viewRoot);\n  return zrUtil.indexOf(viewPath, node) >= 0;\n}\n// From root to the input node (the input node will be included).\nexport function wrapTreePathInfo(node, seriesModel) {\n  var treePathInfo = [];\n  while (node) {\n    var nodeDataIndex = node.dataIndex;\n    treePathInfo.push({\n      name: node.name,\n      dataIndex: nodeDataIndex,\n      value: seriesModel.getRawValue(nodeDataIndex)\n    });\n    node = node.parentNode;\n  }\n  treePathInfo.reverse();\n  return treePathInfo;\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport SeriesModel from '../../model/Series.js';\nimport Tree from '../../data/Tree.js';\nimport Model from '../../model/Model.js';\nimport { createTooltipMarkup } from '../../component/tooltip/tooltipMarkup.js';\nimport { wrapTreePathInfo } from '../helper/treeHelper.js';\nimport tokens from '../../visual/tokens.js';\nvar TreeSeriesModel = /** @class */function (_super) {\n  __extends(TreeSeriesModel, _super);\n  function TreeSeriesModel() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.hasSymbolVisual = true;\n    // Do it self.\n    _this.ignoreStyleOnData = true;\n    return _this;\n  }\n  /**\n   * Init a tree data structure from data in option series\n   */\n  TreeSeriesModel.prototype.getInitialData = function (option) {\n    // create a virtual root\n    var root = {\n      name: option.name,\n      children: option.data\n    };\n    var leaves = option.leaves || {};\n    var leavesModel = new Model(leaves, this, this.ecModel);\n    var tree = Tree.createTree(root, this, beforeLink);\n    function beforeLink(nodeData) {\n      nodeData.wrapMethod('getItemModel', function (model, idx) {\n        var node = tree.getNodeByDataIndex(idx);\n        if (!(node && node.children.length && node.isExpand)) {\n          model.parentModel = leavesModel;\n        }\n        return model;\n      });\n    }\n    var treeDepth = 0;\n    tree.eachNode('preorder', function (node) {\n      if (node.depth > treeDepth) {\n        treeDepth = node.depth;\n      }\n    });\n    var expandAndCollapse = option.expandAndCollapse;\n    var expandTreeDepth = expandAndCollapse && option.initialTreeDepth >= 0 ? option.initialTreeDepth : treeDepth;\n    tree.root.eachNode('preorder', function (node) {\n      var item = node.hostTree.data.getRawDataItem(node.dataIndex);\n      // Add item.collapsed != null, because users can collapse node original in the series.data.\n      node.isExpand = item && item.collapsed != null ? !item.collapsed : node.depth <= expandTreeDepth;\n    });\n    return tree.data;\n  };\n  /**\n   * Make the configuration 'orient' backward compatibly, with 'horizontal = LR', 'vertical = TB'.\n   * @returns {string} orient\n   */\n  TreeSeriesModel.prototype.getOrient = function () {\n    var orient = this.get('orient');\n    if (orient === 'horizontal') {\n      orient = 'LR';\n    } else if (orient === 'vertical') {\n      orient = 'TB';\n    }\n    return orient;\n  };\n  TreeSeriesModel.prototype.setZoom = function (zoom) {\n    this.option.zoom = zoom;\n  };\n  TreeSeriesModel.prototype.setCenter = function (center) {\n    this.option.center = center;\n  };\n  TreeSeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\n    var tree = this.getData().tree;\n    var realRoot = tree.root.children[0];\n    var node = tree.getNodeByDataIndex(dataIndex);\n    var value = node.getValue();\n    var name = node.name;\n    while (node && node !== realRoot) {\n      name = node.parentNode.name + '.' + name;\n      node = node.parentNode;\n    }\n    return createTooltipMarkup('nameValue', {\n      name: name,\n      value: value,\n      noValue: isNaN(value) || value == null\n    });\n  };\n  // Add tree path to tooltip param\n  TreeSeriesModel.prototype.getDataParams = function (dataIndex) {\n    var params = _super.prototype.getDataParams.apply(this, arguments);\n    var node = this.getData().tree.getNodeByDataIndex(dataIndex);\n    params.treeAncestors = wrapTreePathInfo(node, this);\n    params.collapsed = !node.isExpand;\n    return params;\n  };\n  TreeSeriesModel.type = 'series.tree';\n  // can support the position parameters 'left', 'top','right','bottom', 'width',\n  // 'height' in the setOption() with 'merge' mode normal.\n  TreeSeriesModel.layoutMode = 'box';\n  TreeSeriesModel.defaultOption = {\n    // zlevel: 0,\n    z: 2,\n    // `coordinateSystem` can be declared as 'matrix', 'calendar',\n    //  which provides box layout container.\n    coordinateSystemUsage: 'box',\n    // the position of the whole view\n    left: '12%',\n    top: '12%',\n    right: '12%',\n    bottom: '12%',\n    // the layout of the tree, two value can be selected, 'orthogonal' or 'radial'\n    layout: 'orthogonal',\n    // value can be 'polyline'\n    edgeShape: 'curve',\n    edgeForkPosition: '50%',\n    // true | false | 'move' | 'scale', see module:component/helper/RoamController.\n    roam: false,\n    roamTrigger: 'global',\n    // Symbol size scale ratio in roam\n    nodeScaleRatio: 0.4,\n    // Default on center of graph\n    center: null,\n    zoom: 1,\n    orient: 'LR',\n    symbol: 'emptyCircle',\n    symbolSize: 7,\n    expandAndCollapse: true,\n    initialTreeDepth: 2,\n    lineStyle: {\n      color: tokens.color.borderTint,\n      width: 1.5,\n      curveness: 0.5\n    },\n    itemStyle: {\n      color: 'lightsteelblue',\n      // borderColor: '#c23531',\n      borderWidth: 1.5\n    },\n    label: {\n      show: true\n    },\n    animationEasing: 'linear',\n    animationDuration: 700,\n    animationDurationUpdate: 500\n  };\n  return TreeSeriesModel;\n}(SeriesModel);\nexport default TreeSeriesModel;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n/**\n * Traverse the tree from bottom to top and do something\n */\nfunction eachAfter(root, callback, separation) {\n  var nodes = [root];\n  var next = [];\n  var node;\n  while (node = nodes.pop()) {\n    // jshint ignore:line\n    next.push(node);\n    if (node.isExpand) {\n      var children = node.children;\n      if (children.length) {\n        for (var i = 0; i < children.length; i++) {\n          nodes.push(children[i]);\n        }\n      }\n    }\n  }\n  while (node = next.pop()) {\n    // jshint ignore:line\n    callback(node, separation);\n  }\n}\n/**\n * Traverse the tree from top to bottom and do something\n */\nfunction eachBefore(root, callback) {\n  var nodes = [root];\n  var node;\n  while (node = nodes.pop()) {\n    // jshint ignore:line\n    callback(node);\n    if (node.isExpand) {\n      var children = node.children;\n      if (children.length) {\n        for (var i = children.length - 1; i >= 0; i--) {\n          nodes.push(children[i]);\n        }\n      }\n    }\n  }\n}\nexport { eachAfter, eachBefore };", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { eachAfter, eachBefore } from './traversalHelper.js';\nimport { init, firstWalk, secondWalk, separation as sep, radialCoordinate } from './layoutHelper.js';\nimport { createBoxLayoutReference, getLayoutRect } from '../../util/layout.js';\nexport default function treeLayout(ecModel, api) {\n  ecModel.eachSeriesByType('tree', function (seriesModel) {\n    commonLayout(seriesModel, api);\n  });\n}\nfunction commonLayout(seriesModel, api) {\n  var refContainer = createBoxLayoutReference(seriesModel, api).refContainer;\n  var layoutInfo = getLayoutRect(seriesModel.getBoxLayoutParams(), refContainer);\n  seriesModel.layoutInfo = layoutInfo;\n  var layout = seriesModel.get('layout');\n  var width = 0;\n  var height = 0;\n  var separation = null;\n  if (layout === 'radial') {\n    width = 2 * Math.PI;\n    height = Math.min(layoutInfo.height, layoutInfo.width) / 2;\n    separation = sep(function (node1, node2) {\n      return (node1.parentNode === node2.parentNode ? 1 : 2) / node1.depth;\n    });\n  } else {\n    width = layoutInfo.width;\n    height = layoutInfo.height;\n    separation = sep();\n  }\n  var virtualRoot = seriesModel.getData().tree.root;\n  var realRoot = virtualRoot.children[0];\n  if (realRoot) {\n    init(virtualRoot);\n    eachAfter(realRoot, firstWalk, separation);\n    virtualRoot.hierNode.modifier = -realRoot.hierNode.prelim;\n    eachBefore(realRoot, secondWalk);\n    var left_1 = realRoot;\n    var right_1 = realRoot;\n    var bottom_1 = realRoot;\n    eachBefore(realRoot, function (node) {\n      var x = node.getLayout().x;\n      if (x < left_1.getLayout().x) {\n        left_1 = node;\n      }\n      if (x > right_1.getLayout().x) {\n        right_1 = node;\n      }\n      if (node.depth > bottom_1.depth) {\n        bottom_1 = node;\n      }\n    });\n    var delta = left_1 === right_1 ? 1 : separation(left_1, right_1) / 2;\n    var tx_1 = delta - left_1.getLayout().x;\n    var kx_1 = 0;\n    var ky_1 = 0;\n    var coorX_1 = 0;\n    var coorY_1 = 0;\n    if (layout === 'radial') {\n      kx_1 = width / (right_1.getLayout().x + delta + tx_1);\n      // here we use (node.depth - 1), bucause the real root's depth is 1\n      ky_1 = height / (bottom_1.depth - 1 || 1);\n      eachBefore(realRoot, function (node) {\n        coorX_1 = (node.getLayout().x + tx_1) * kx_1;\n        coorY_1 = (node.depth - 1) * ky_1;\n        var finalCoor = radialCoordinate(coorX_1, coorY_1);\n        node.setLayout({\n          x: finalCoor.x,\n          y: finalCoor.y,\n          rawX: coorX_1,\n          rawY: coorY_1\n        }, true);\n      });\n    } else {\n      var orient_1 = seriesModel.getOrient();\n      if (orient_1 === 'RL' || orient_1 === 'LR') {\n        ky_1 = height / (right_1.getLayout().x + delta + tx_1);\n        kx_1 = width / (bottom_1.depth - 1 || 1);\n        eachBefore(realRoot, function (node) {\n          coorY_1 = (node.getLayout().x + tx_1) * ky_1;\n          coorX_1 = orient_1 === 'LR' ? (node.depth - 1) * kx_1 : width - (node.depth - 1) * kx_1;\n          node.setLayout({\n            x: coorX_1,\n            y: coorY_1\n          }, true);\n        });\n      } else if (orient_1 === 'TB' || orient_1 === 'BT') {\n        kx_1 = width / (right_1.getLayout().x + delta + tx_1);\n        ky_1 = height / (bottom_1.depth - 1 || 1);\n        eachBefore(realRoot, function (node) {\n          coorX_1 = (node.getLayout().x + tx_1) * kx_1;\n          coorY_1 = orient_1 === 'TB' ? (node.depth - 1) * ky_1 : height - (node.depth - 1) * ky_1;\n          node.setLayout({\n            x: coorX_1,\n            y: coorY_1\n          }, true);\n        });\n      }\n    }\n  }\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { extend } from 'zrender/lib/core/util.js';\nexport default function treeVisual(ecModel) {\n  ecModel.eachSeriesByType('tree', function (seriesModel) {\n    var data = seriesModel.getData();\n    var tree = data.tree;\n    tree.eachNode(function (node) {\n      var model = node.getModel();\n      // TODO Optimize\n      var style = model.getModel('itemStyle').getItemStyle();\n      var existsStyle = data.ensureUniqueItemVisual(node.dataIndex, 'style');\n      extend(existsStyle, style);\n    });\n  });\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { updateCenterAndZoomInAction } from '../../component/helper/roamHelper.js';\nexport function installTreeAction(registers) {\n  registers.registerAction({\n    type: 'treeExpandAndCollapse',\n    event: 'treeExpandAndCollapse',\n    update: 'update'\n  }, function (payload, ecModel) {\n    ecModel.eachComponent({\n      mainType: 'series',\n      subType: 'tree',\n      query: payload\n    }, function (seriesModel) {\n      var dataIndex = payload.dataIndex;\n      var tree = seriesModel.getData().tree;\n      var node = tree.getNodeByDataIndex(dataIndex);\n      node.isExpand = !node.isExpand;\n    });\n  });\n  registers.registerAction({\n    type: 'treeRoam',\n    event: 'treeRoam',\n    // Here we set 'none' instead of 'update', because roam action\n    // just need to update the transform matrix without having to recalculate\n    // the layout. So don't need to go through the whole update process, such\n    // as 'dataPrcocess', 'coordSystemUpdate', 'layout' and so on.\n    update: 'none'\n  }, function (payload, ecModel, api) {\n    ecModel.eachComponent({\n      mainType: 'series',\n      subType: 'tree',\n      query: payload\n    }, function (seriesModel) {\n      var coordSys = seriesModel.coordinateSystem;\n      var res = updateCenterAndZoomInAction(coordSys, payload, seriesModel.get('scaleLimit'));\n      seriesModel.setCenter(res.center);\n      seriesModel.setZoom(res.zoom);\n    });\n  });\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport TreeView from './TreeView.js';\nimport TreeSeriesModel from './TreeSeries.js';\nimport treeLayout from './treeLayout.js';\nimport treeVisual from './treeVisual.js';\nimport { installTreeAction } from './treeAction.js';\nexport function install(registers) {\n  registers.registerChartView(TreeView);\n  registers.registerSeriesModel(TreeSeriesModel);\n  registers.registerLayout(treeLayout);\n  registers.registerVisual(treeVisual);\n  installTreeAction(registers);\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as helper from '../helper/treeHelper.js';\nimport { noop } from 'zrender/lib/core/util.js';\nvar actionTypes = ['treemapZoomToNode', 'treemapRender', 'treemapMove'];\nexport function installTreemapAction(registers) {\n  for (var i = 0; i < actionTypes.length; i++) {\n    registers.registerAction({\n      type: actionTypes[i],\n      update: 'updateView'\n    }, noop);\n  }\n  registers.registerAction({\n    type: 'treemapRootToNode',\n    update: 'updateView'\n  }, function (payload, ecModel) {\n    ecModel.eachComponent({\n      mainType: 'series',\n      subType: 'treemap',\n      query: payload\n    }, handleRootToNode);\n    function handleRootToNode(model, index) {\n      var types = ['treemapZoomToNode', 'treemapRootToNode'];\n      var targetInfo = helper.retrieveTargetInfo(payload, types, model);\n      if (targetInfo) {\n        var originViewRoot = model.getViewRoot();\n        if (originViewRoot) {\n          payload.direction = helper.aboveViewRoot(originViewRoot, targetInfo.node) ? 'rollUp' : 'drillDown';\n        }\n        model.resetViewRoot(targetInfo.node);\n      }\n    }\n  });\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { getDecalFromPalette } from '../../model/mixin/palette.js';\nexport default function enableAriaDecalForTree(seriesModel) {\n  var data = seriesModel.getData();\n  var tree = data.tree;\n  var decalPaletteScope = {};\n  tree.eachNode(function (node) {\n    // Use decal of level 1 node\n    var current = node;\n    while (current && current.depth > 1) {\n      current = current.parentNode;\n    }\n    var decal = getDecalFromPalette(seriesModel.ecModel, current.name || current.dataIndex + '', decalPaletteScope);\n    node.setVisual('decal', decal);\n  });\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport SeriesModel from '../../model/Series.js';\nimport Tree from '../../data/Tree.js';\nimport Model from '../../model/Model.js';\nimport { wrapTreePathInfo } from '../helper/treeHelper.js';\nimport { normalizeToArray } from '../../util/model.js';\nimport { createTooltipMarkup } from '../../component/tooltip/tooltipMarkup.js';\nimport enableAriaDecalForTree from '../helper/enableAriaDecalForTree.js';\nimport tokens from '../../visual/tokens.js';\nvar TreemapSeriesModel = /** @class */function (_super) {\n  __extends(TreemapSeriesModel, _super);\n  function TreemapSeriesModel() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = TreemapSeriesModel.type;\n    _this.preventUsingHoverLayer = true;\n    return _this;\n  }\n  /**\n   * @override\n   */\n  TreemapSeriesModel.prototype.getInitialData = function (option, ecModel) {\n    // Create a virtual root.\n    var root = {\n      name: option.name,\n      children: option.data\n    };\n    completeTreeValue(root);\n    var levels = option.levels || [];\n    // Used in \"visual priority\" in `treemapVisual.js`.\n    // This way is a little tricky, must satisfy the precondition:\n    //   1. There is no `treeNode.getModel('itemStyle.xxx')` used.\n    //   2. The `Model.prototype.getModel()` will not use any clone-like way.\n    var designatedVisualItemStyle = this.designatedVisualItemStyle = {};\n    var designatedVisualModel = new Model({\n      itemStyle: designatedVisualItemStyle\n    }, this, ecModel);\n    levels = option.levels = setDefault(levels, ecModel);\n    var levelModels = zrUtil.map(levels || [], function (levelDefine) {\n      return new Model(levelDefine, designatedVisualModel, ecModel);\n    }, this);\n    // Make sure always a new tree is created when setOption,\n    // in TreemapView, we check whether oldTree === newTree\n    // to choose mappings approach among old shapes and new shapes.\n    var tree = Tree.createTree(root, this, beforeLink);\n    function beforeLink(nodeData) {\n      nodeData.wrapMethod('getItemModel', function (model, idx) {\n        var node = tree.getNodeByDataIndex(idx);\n        var levelModel = node ? levelModels[node.depth] : null;\n        // If no levelModel, we also need `designatedVisualModel`.\n        model.parentModel = levelModel || designatedVisualModel;\n        return model;\n      });\n    }\n    return tree.data;\n  };\n  TreemapSeriesModel.prototype.optionUpdated = function () {\n    this.resetViewRoot();\n  };\n  /**\n   * @override\n   * @param {number} dataIndex\n   * @param {boolean} [mutipleSeries=false]\n   */\n  TreemapSeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\n    var data = this.getData();\n    var value = this.getRawValue(dataIndex);\n    var name = data.getName(dataIndex);\n    return createTooltipMarkup('nameValue', {\n      name: name,\n      value: value\n    });\n  };\n  /**\n   * Add tree path to tooltip param\n   *\n   * @override\n   * @param {number} dataIndex\n   * @return {Object}\n   */\n  TreemapSeriesModel.prototype.getDataParams = function (dataIndex) {\n    var params = _super.prototype.getDataParams.apply(this, arguments);\n    var node = this.getData().tree.getNodeByDataIndex(dataIndex);\n    params.treeAncestors = wrapTreePathInfo(node, this);\n    // compatitable the previous code.\n    params.treePathInfo = params.treeAncestors;\n    return params;\n  };\n  /**\n   * @public\n   * @param {Object} layoutInfo {\n   *                                x: containerGroup x\n   *                                y: containerGroup y\n   *                                width: containerGroup width\n   *                                height: containerGroup height\n   *                            }\n   */\n  TreemapSeriesModel.prototype.setLayoutInfo = function (layoutInfo) {\n    /**\n     * @readOnly\n     * @type {Object}\n     */\n    this.layoutInfo = this.layoutInfo || {};\n    zrUtil.extend(this.layoutInfo, layoutInfo);\n  };\n  /**\n   * @param  {string} id\n   * @return {number} index\n   */\n  TreemapSeriesModel.prototype.mapIdToIndex = function (id) {\n    // A feature is implemented:\n    // index is monotone increasing with the sequence of\n    // input id at the first time.\n    // This feature can make sure that each data item and its\n    // mapped color have the same index between data list and\n    // color list at the beginning, which is useful for user\n    // to adjust data-color mapping.\n    /**\n     * @private\n     * @type {Object}\n     */\n    var idIndexMap = this._idIndexMap;\n    if (!idIndexMap) {\n      idIndexMap = this._idIndexMap = zrUtil.createHashMap();\n      /**\n       * @private\n       * @type {number}\n       */\n      this._idIndexMapCount = 0;\n    }\n    var index = idIndexMap.get(id);\n    if (index == null) {\n      idIndexMap.set(id, index = this._idIndexMapCount++);\n    }\n    return index;\n  };\n  TreemapSeriesModel.prototype.getViewRoot = function () {\n    return this._viewRoot;\n  };\n  TreemapSeriesModel.prototype.resetViewRoot = function (viewRoot) {\n    viewRoot ? this._viewRoot = viewRoot : viewRoot = this._viewRoot;\n    var root = this.getRawData().tree.root;\n    if (!viewRoot || viewRoot !== root && !root.contains(viewRoot)) {\n      this._viewRoot = root;\n    }\n  };\n  TreemapSeriesModel.prototype.enableAriaDecal = function () {\n    enableAriaDecalForTree(this);\n  };\n  TreemapSeriesModel.type = 'series.treemap';\n  TreemapSeriesModel.layoutMode = 'box';\n  TreemapSeriesModel.defaultOption = {\n    // Disable progressive rendering\n    progressive: 0,\n    // size: ['80%', '80%'],            // deprecated, compatible with ec2.\n    // `coordinateSystem` can be declared as 'matrix', 'calendar',\n    //  which provides box layout container.\n    coordinateSystemUsage: 'box',\n    left: tokens.size.l,\n    top: tokens.size.xxxl,\n    right: tokens.size.l,\n    bottom: tokens.size.xxxl,\n    sort: true,\n    clipWindow: 'origin',\n    squareRatio: 0.5 * (1 + Math.sqrt(5)),\n    leafDepth: null,\n    drillDownIcon: '\u25B6',\n    // to align specialized icon. \u25B7\u25B6\u2752\u2750\u25BC\u271A\n    zoomToNodeRatio: 0.32 * 0.32,\n    scaleLimit: {\n      max: 5,\n      min: 0.2\n    },\n    roam: true,\n    roamTrigger: 'global',\n    nodeClick: 'zoomToNode',\n    animation: true,\n    animationDurationUpdate: 900,\n    animationEasing: 'quinticInOut',\n    breadcrumb: {\n      show: true,\n      height: 22,\n      left: 'center',\n      bottom: tokens.size.m,\n      // right\n      // bottom\n      emptyItemWidth: 25,\n      itemStyle: {\n        color: tokens.color.backgroundShade,\n        textStyle: {\n          color: tokens.color.secondary\n        }\n      },\n      emphasis: {\n        itemStyle: {\n          color: tokens.color.background\n        }\n      }\n    },\n    label: {\n      show: true,\n      // Do not use textDistance, for ellipsis rect just the same as treemap node rect.\n      distance: 0,\n      padding: 5,\n      position: 'inside',\n      // formatter: null,\n      color: tokens.color.neutral00,\n      overflow: 'truncate'\n      // align\n      // verticalAlign\n    },\n    upperLabel: {\n      show: false,\n      position: [0, '50%'],\n      height: 20,\n      // formatter: null,\n      // color: '#fff',\n      overflow: 'truncate',\n      // align: null,\n      verticalAlign: 'middle'\n    },\n    itemStyle: {\n      color: null,\n      colorAlpha: null,\n      colorSaturation: null,\n      borderWidth: 0,\n      gapWidth: 0,\n      borderColor: tokens.color.neutral00,\n      borderColorSaturation: null // If specified, borderColor will be ineffective, and the\n      // border color is evaluated by color of current node and\n      // borderColorSaturation.\n    },\n    emphasis: {\n      upperLabel: {\n        show: true,\n        position: [0, '50%'],\n        overflow: 'truncate',\n        verticalAlign: 'middle'\n      }\n    },\n    visualDimension: 0,\n    visualMin: null,\n    visualMax: null,\n    color: [],\n    // level[n].color (if necessary).\n    // + Specify color list of each level. level[0].color would be global\n    // color list if not specified. (see method `setDefault`).\n    // + But set as a empty array to forbid fetch color from global palette\n    // when using nodeModel.get('color'), otherwise nodes on deep level\n    // will always has color palette set and are not able to inherit color\n    // from parent node.\n    // + TreemapSeries.color can not be set as 'none', otherwise effect\n    // legend color fetching (see seriesColor.js).\n    colorAlpha: null,\n    colorSaturation: null,\n    colorMappingBy: 'index',\n    visibleMin: 10,\n    // be rendered. Only works when sort is 'asc' or 'desc'.\n    childrenVisibleMin: null,\n    // grandchildren will not show.\n    // Why grandchildren? If not grandchildren but children,\n    // some siblings show children and some not,\n    // the appearance may be mess and not consistent,\n    levels: [] // Each item: {\n    //     visibleMin, itemStyle, visualDimension, label\n    // }\n  };\n  return TreemapSeriesModel;\n}(SeriesModel);\n/**\n * @param {Object} dataNode\n */\nfunction completeTreeValue(dataNode) {\n  // Postorder travel tree.\n  // If value of none-leaf node is not set,\n  // calculate it by suming up the value of all children.\n  var sum = 0;\n  zrUtil.each(dataNode.children, function (child) {\n    completeTreeValue(child);\n    var childValue = child.value;\n    zrUtil.isArray(childValue) && (childValue = childValue[0]);\n    sum += childValue;\n  });\n  var thisValue = dataNode.value;\n  if (zrUtil.isArray(thisValue)) {\n    thisValue = thisValue[0];\n  }\n  if (thisValue == null || isNaN(thisValue)) {\n    thisValue = sum;\n  }\n  // Value should not less than 0.\n  if (thisValue < 0) {\n    thisValue = 0;\n  }\n  zrUtil.isArray(dataNode.value) ? dataNode.value[0] = thisValue : dataNode.value = thisValue;\n}\n/**\n * set default to level configuration\n */\nfunction setDefault(levels, ecModel) {\n  var globalColorList = normalizeToArray(ecModel.get('color'));\n  var globalDecalList = normalizeToArray(ecModel.get(['aria', 'decal', 'decals']));\n  if (!globalColorList) {\n    return;\n  }\n  levels = levels || [];\n  var hasColorDefine;\n  var hasDecalDefine;\n  zrUtil.each(levels, function (levelDefine) {\n    var model = new Model(levelDefine);\n    var modelColor = model.get('color');\n    var modelDecal = model.get('decal');\n    if (model.get(['itemStyle', 'color']) || modelColor && modelColor !== 'none') {\n      hasColorDefine = true;\n    }\n    if (model.get(['itemStyle', 'decal']) || modelDecal && modelDecal !== 'none') {\n      hasDecalDefine = true;\n    }\n  });\n  var level0 = levels[0] || (levels[0] = {});\n  if (!hasColorDefine) {\n    level0.color = globalColorList.slice();\n  }\n  if (!hasDecalDefine && globalDecalList) {\n    level0.decal = globalDecalList.slice();\n  }\n  return levels;\n}\nexport default TreemapSeriesModel;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as graphic from '../../util/graphic.js';\nimport { getECData } from '../../util/innerStore.js';\nimport * as layout from '../../util/layout.js';\nimport { wrapTreePathInfo } from '../helper/treeHelper.js';\nimport { curry, defaults } from 'zrender/lib/core/util.js';\nimport { convertOptionIdName } from '../../util/model.js';\nimport { toggleHoverEmphasis, Z2_EMPHASIS_LIFT } from '../../util/states.js';\nimport { createTextStyle } from '../../label/labelStyle.js';\nvar TEXT_PADDING = 8;\nvar ITEM_GAP = 8;\nvar ARRAY_LENGTH = 5;\nvar Breadcrumb = /** @class */function () {\n  function Breadcrumb(containerGroup) {\n    this.group = new graphic.Group();\n    containerGroup.add(this.group);\n  }\n  Breadcrumb.prototype.render = function (seriesModel, api, targetNode, onSelect) {\n    var model = seriesModel.getModel('breadcrumb');\n    var thisGroup = this.group;\n    thisGroup.removeAll();\n    if (!model.get('show') || !targetNode) {\n      return;\n    }\n    var normalStyleModel = model.getModel('itemStyle');\n    var emphasisModel = model.getModel('emphasis');\n    var textStyleModel = normalStyleModel.getModel('textStyle');\n    var emphasisTextStyleModel = emphasisModel.getModel(['itemStyle', 'textStyle']);\n    var refContainer = layout.createBoxLayoutReference(seriesModel, api).refContainer;\n    var boxLayoutParams = {\n      left: model.get('left'),\n      right: model.get('right'),\n      top: model.get('top'),\n      bottom: model.get('bottom')\n    };\n    var layoutParam = {\n      emptyItemWidth: model.get('emptyItemWidth'),\n      totalWidth: 0,\n      renderList: []\n    };\n    var availableSize = layout.getLayoutRect(boxLayoutParams, refContainer);\n    this._prepare(targetNode, layoutParam, textStyleModel);\n    this._renderContent(seriesModel, layoutParam, availableSize, normalStyleModel, emphasisModel, textStyleModel, emphasisTextStyleModel, onSelect);\n    layout.positionElement(thisGroup, boxLayoutParams, refContainer);\n  };\n  /**\n   * Prepare render list and total width\n   * @private\n   */\n  Breadcrumb.prototype._prepare = function (targetNode, layoutParam, textStyleModel) {\n    for (var node = targetNode; node; node = node.parentNode) {\n      var text = convertOptionIdName(node.getModel().get('name'), '');\n      var textRect = textStyleModel.getTextRect(text);\n      var itemWidth = Math.max(textRect.width + TEXT_PADDING * 2, layoutParam.emptyItemWidth);\n      layoutParam.totalWidth += itemWidth + ITEM_GAP;\n      layoutParam.renderList.push({\n        node: node,\n        text: text,\n        width: itemWidth\n      });\n    }\n  };\n  /**\n   * @private\n   */\n  Breadcrumb.prototype._renderContent = function (seriesModel, layoutParam, availableSize, normalStyleModel, emphasisModel, textStyleModel, emphasisTextStyleModel, onSelect) {\n    // Start rendering.\n    var lastX = 0;\n    var emptyItemWidth = layoutParam.emptyItemWidth;\n    var height = seriesModel.get(['breadcrumb', 'height']);\n    var totalWidth = layoutParam.totalWidth;\n    var renderList = layoutParam.renderList;\n    var emphasisItemStyle = emphasisModel.getModel('itemStyle').getItemStyle();\n    for (var i = renderList.length - 1; i >= 0; i--) {\n      var item = renderList[i];\n      var itemNode = item.node;\n      var itemWidth = item.width;\n      var text = item.text;\n      // Hdie text and shorten width if necessary.\n      if (totalWidth > availableSize.width) {\n        totalWidth -= itemWidth - emptyItemWidth;\n        itemWidth = emptyItemWidth;\n        text = null;\n      }\n      var el = new graphic.Polygon({\n        shape: {\n          points: makeItemPoints(lastX, 0, itemWidth, height, i === renderList.length - 1, i === 0)\n        },\n        style: defaults(normalStyleModel.getItemStyle(), {\n          lineJoin: 'bevel'\n        }),\n        textContent: new graphic.Text({\n          style: createTextStyle(textStyleModel, {\n            text: text\n          })\n        }),\n        textConfig: {\n          position: 'inside'\n        },\n        z2: Z2_EMPHASIS_LIFT * 1e4,\n        onclick: curry(onSelect, itemNode)\n      });\n      el.disableLabelAnimation = true;\n      el.getTextContent().ensureState('emphasis').style = createTextStyle(emphasisTextStyleModel, {\n        text: text\n      });\n      el.ensureState('emphasis').style = emphasisItemStyle;\n      toggleHoverEmphasis(el, emphasisModel.get('focus'), emphasisModel.get('blurScope'), emphasisModel.get('disabled'));\n      this.group.add(el);\n      packEventData(el, seriesModel, itemNode);\n      lastX += itemWidth + ITEM_GAP;\n    }\n  };\n  Breadcrumb.prototype.remove = function () {\n    this.group.removeAll();\n  };\n  return Breadcrumb;\n}();\nfunction makeItemPoints(x, y, itemWidth, itemHeight, head, tail) {\n  var points = [[head ? x : x - ARRAY_LENGTH, y], [x + itemWidth, y], [x + itemWidth, y + itemHeight], [head ? x : x - ARRAY_LENGTH, y + itemHeight]];\n  !tail && points.splice(2, 0, [x + itemWidth + ARRAY_LENGTH, y + itemHeight / 2]);\n  !head && points.push([x, y + itemHeight / 2]);\n  return points;\n}\n// Package custom mouse event.\nfunction packEventData(el, seriesModel, itemNode) {\n  getECData(el).eventData = {\n    componentType: 'series',\n    componentSubType: 'treemap',\n    componentIndex: seriesModel.componentIndex,\n    seriesIndex: seriesModel.seriesIndex,\n    seriesName: seriesModel.name,\n    seriesType: 'treemap',\n    selfType: 'breadcrumb',\n    nodeData: {\n      dataIndex: itemNode && itemNode.dataIndex,\n      name: itemNode && itemNode.name\n    },\n    treePathInfo: itemNode && wrapTreePathInfo(itemNode, seriesModel)\n  };\n}\nexport default Breadcrumb;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n/**\n * Animate multiple elements with a single done-callback.\n *\n * @example\n *  animation\n *      .createWrap()\n *      .add(el1, {x: 10, y: 10})\n *      .add(el2, {shape: {width: 500}, style: {fill: 'red'}}, 400)\n *      .done(function () { // done })\n *      .start('cubicOut');\n */\nvar AnimationWrap = /** @class */function () {\n  function AnimationWrap() {\n    this._storage = [];\n    this._elExistsMap = {};\n  }\n  /**\n   * Caution: a el can only be added once, otherwise 'done'\n   * might not be called. This method checks this (by el.id),\n   * suppresses adding and returns false when existing el found.\n   *\n   * @return Whether adding succeeded.\n   */\n  AnimationWrap.prototype.add = function (el, target, duration, delay, easing) {\n    if (this._elExistsMap[el.id]) {\n      return false;\n    }\n    this._elExistsMap[el.id] = true;\n    this._storage.push({\n      el: el,\n      target: target,\n      duration: duration,\n      delay: delay,\n      easing: easing\n    });\n    return true;\n  };\n  /**\n   * Only execute when animation done/aborted.\n   */\n  AnimationWrap.prototype.finished = function (callback) {\n    this._finishedCallback = callback;\n    return this;\n  };\n  /**\n   * Will stop exist animation firstly.\n   */\n  AnimationWrap.prototype.start = function () {\n    var _this = this;\n    var count = this._storage.length;\n    var checkTerminate = function () {\n      count--;\n      if (count <= 0) {\n        // Guard.\n        _this._storage.length = 0;\n        _this._elExistsMap = {};\n        _this._finishedCallback && _this._finishedCallback();\n      }\n    };\n    for (var i = 0, len = this._storage.length; i < len; i++) {\n      var item = this._storage[i];\n      item.el.animateTo(item.target, {\n        duration: item.duration,\n        delay: item.delay,\n        easing: item.easing,\n        setToFinal: true,\n        done: checkTerminate,\n        aborted: checkTerminate\n      });\n    }\n    return this;\n  };\n  return AnimationWrap;\n}();\nexport function createWrap() {\n  return new AnimationWrap();\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport { bind, each, indexOf, curry, extend, normalizeCssArray, isFunction } from 'zrender/lib/core/util.js';\nimport * as graphic from '../../util/graphic.js';\nimport { getECData } from '../../util/innerStore.js';\nimport { isHighDownDispatcher, setAsHighDownDispatcher, setDefaultStateProxy, enableHoverFocus, Z2_EMPHASIS_LIFT } from '../../util/states.js';\nimport DataDiffer from '../../data/DataDiffer.js';\nimport * as helper from '../helper/treeHelper.js';\nimport Breadcrumb from './Breadcrumb.js';\nimport RoamController from '../../component/helper/RoamController.js';\nimport BoundingRect from 'zrender/lib/core/BoundingRect.js';\nimport * as matrix from 'zrender/lib/core/matrix.js';\nimport * as animationUtil from '../../util/animation.js';\nimport makeStyleMapper from '../../model/mixin/makeStyleMapper.js';\nimport ChartView from '../../view/Chart.js';\nimport Displayable from 'zrender/lib/graphic/Displayable.js';\nimport { makeInner, convertOptionIdName } from '../../util/model.js';\nimport { windowOpen } from '../../util/format.js';\nimport { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle.js';\nvar Group = graphic.Group;\nvar Rect = graphic.Rect;\nvar DRAG_THRESHOLD = 3;\nvar PATH_LABEL_NOAMAL = 'label';\nvar PATH_UPPERLABEL_NORMAL = 'upperLabel';\n// Should larger than emphasis states lift z\nvar Z2_BASE = Z2_EMPHASIS_LIFT * 10; // Should bigger than every z2.\nvar Z2_BG = Z2_EMPHASIS_LIFT * 2;\nvar Z2_CONTENT = Z2_EMPHASIS_LIFT * 3;\nvar getStateItemStyle = makeStyleMapper([['fill', 'color'],\n// `borderColor` and `borderWidth` has been occupied,\n// so use `stroke` to indicate the stroke of the rect.\n['stroke', 'strokeColor'], ['lineWidth', 'strokeWidth'], ['shadowBlur'], ['shadowOffsetX'], ['shadowOffsetY'], ['shadowColor']\n// Option decal is in `DecalObject` but style.decal is in `PatternObject`.\n// So do not transfer decal directly.\n]);\nvar getItemStyleNormal = function (model) {\n  // Normal style props should include emphasis style props.\n  var itemStyle = getStateItemStyle(model);\n  // Clear styles set by emphasis.\n  itemStyle.stroke = itemStyle.fill = itemStyle.lineWidth = null;\n  return itemStyle;\n};\nvar inner = makeInner();\nvar TreemapView = /** @class */function (_super) {\n  __extends(TreemapView, _super);\n  function TreemapView() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = TreemapView.type;\n    _this._state = 'ready';\n    _this._storage = createStorage();\n    return _this;\n  }\n  /**\n   * @override\n   */\n  TreemapView.prototype.render = function (seriesModel, ecModel, api, payload) {\n    var models = ecModel.findComponents({\n      mainType: 'series',\n      subType: 'treemap',\n      query: payload\n    });\n    if (indexOf(models, seriesModel) < 0) {\n      return;\n    }\n    this.seriesModel = seriesModel;\n    this.api = api;\n    this.ecModel = ecModel;\n    var types = ['treemapZoomToNode', 'treemapRootToNode'];\n    var targetInfo = helper.retrieveTargetInfo(payload, types, seriesModel);\n    var payloadType = payload && payload.type;\n    var layoutInfo = seriesModel.layoutInfo;\n    var isInit = !this._oldTree;\n    var thisStorage = this._storage;\n    // Mark new root when action is treemapRootToNode.\n    var reRoot = payloadType === 'treemapRootToNode' && targetInfo && thisStorage ? {\n      rootNodeGroup: thisStorage.nodeGroup[targetInfo.node.getRawIndex()],\n      direction: payload.direction\n    } : null;\n    var containerGroup = this._giveContainerGroup(layoutInfo);\n    var hasAnimation = seriesModel.get('animation');\n    var renderResult = this._doRender(containerGroup, seriesModel, reRoot);\n    hasAnimation && !isInit && (!payloadType || payloadType === 'treemapZoomToNode' || payloadType === 'treemapRootToNode') ? this._doAnimation(containerGroup, renderResult, seriesModel, reRoot) : renderResult.renderFinally();\n    this._resetController(api);\n    this._renderBreadcrumb(seriesModel, api, targetInfo);\n  };\n  TreemapView.prototype._giveContainerGroup = function (layoutInfo) {\n    var containerGroup = this._containerGroup;\n    if (!containerGroup) {\n      // FIXME\n      // \u52A0\u4E00\u5C42containerGroup\u662F\u4E3A\u4E86clip\uFF0C\u4F46\u662F\u73B0\u5728clip\u529F\u80FD\u5E76\u6CA1\u6709\u5B9E\u73B0\u3002\n      containerGroup = this._containerGroup = new Group();\n      this._initEvents(containerGroup);\n      this.group.add(containerGroup);\n    }\n    containerGroup.x = layoutInfo.x;\n    containerGroup.y = layoutInfo.y;\n    return containerGroup;\n  };\n  TreemapView.prototype._doRender = function (containerGroup, seriesModel, reRoot) {\n    var thisTree = seriesModel.getData().tree;\n    var oldTree = this._oldTree;\n    // Clear last shape records.\n    var lastsForAnimation = createStorage();\n    var thisStorage = createStorage();\n    var oldStorage = this._storage;\n    var willInvisibleEls = [];\n    function doRenderNode(thisNode, oldNode, parentGroup, depth) {\n      return renderNode(seriesModel, thisStorage, oldStorage, reRoot, lastsForAnimation, willInvisibleEls, thisNode, oldNode, parentGroup, depth);\n    }\n    // Notice: When thisTree and oldTree are the same tree (see list.cloneShallow),\n    // the oldTree is actually losted, so we cannot find all of the old graphic\n    // elements from tree. So we use this strategy: make element storage, move\n    // from old storage to new storage, clear old storage.\n    dualTravel(thisTree.root ? [thisTree.root] : [], oldTree && oldTree.root ? [oldTree.root] : [], containerGroup, thisTree === oldTree || !oldTree, 0);\n    // Process all removing.\n    var willDeleteEls = clearStorage(oldStorage);\n    this._oldTree = thisTree;\n    this._storage = thisStorage;\n    if (this._controllerHost) {\n      var _oldRootLayout = this.seriesModel.layoutInfo;\n      var rootLayout = thisTree.root.getLayout();\n      if (rootLayout.width === _oldRootLayout.width && rootLayout.height === _oldRootLayout.height) {\n        this._controllerHost.zoom = 1;\n      }\n    }\n    return {\n      lastsForAnimation: lastsForAnimation,\n      willDeleteEls: willDeleteEls,\n      renderFinally: renderFinally\n    };\n    function dualTravel(thisViewChildren, oldViewChildren, parentGroup, sameTree, depth) {\n      // When 'render' is triggered by action,\n      // 'this' and 'old' may be the same tree,\n      // we use rawIndex in that case.\n      if (sameTree) {\n        oldViewChildren = thisViewChildren;\n        each(thisViewChildren, function (child, index) {\n          !child.isRemoved() && processNode(index, index);\n        });\n      }\n      // Diff hierarchically (diff only in each subtree, but not whole).\n      // because, consistency of view is important.\n      else {\n        new DataDiffer(oldViewChildren, thisViewChildren, getKey, getKey).add(processNode).update(processNode).remove(curry(processNode, null)).execute();\n      }\n      function getKey(node) {\n        // Identify by name or raw index.\n        return node.getId();\n      }\n      function processNode(newIndex, oldIndex) {\n        var thisNode = newIndex != null ? thisViewChildren[newIndex] : null;\n        var oldNode = oldIndex != null ? oldViewChildren[oldIndex] : null;\n        var group = doRenderNode(thisNode, oldNode, parentGroup, depth);\n        group && dualTravel(thisNode && thisNode.viewChildren || [], oldNode && oldNode.viewChildren || [], group, sameTree, depth + 1);\n      }\n    }\n    function clearStorage(storage) {\n      var willDeleteEls = createStorage();\n      storage && each(storage, function (store, storageName) {\n        var delEls = willDeleteEls[storageName];\n        each(store, function (el) {\n          el && (delEls.push(el), inner(el).willDelete = true);\n        });\n      });\n      return willDeleteEls;\n    }\n    function renderFinally() {\n      each(willDeleteEls, function (els) {\n        each(els, function (el) {\n          el.parent && el.parent.remove(el);\n        });\n      });\n      each(willInvisibleEls, function (el) {\n        el.invisible = true;\n        // Setting invisible is for optimizing, so no need to set dirty,\n        // just mark as invisible.\n        el.dirty();\n      });\n    }\n  };\n  TreemapView.prototype._doAnimation = function (containerGroup, renderResult, seriesModel, reRoot) {\n    var durationOption = seriesModel.get('animationDurationUpdate');\n    var easingOption = seriesModel.get('animationEasing');\n    // TODO: do not support function until necessary.\n    var duration = (isFunction(durationOption) ? 0 : durationOption) || 0;\n    var easing = (isFunction(easingOption) ? null : easingOption) || 'cubicOut';\n    var animationWrap = animationUtil.createWrap();\n    // Make delete animations.\n    each(renderResult.willDeleteEls, function (store, storageName) {\n      each(store, function (el, rawIndex) {\n        if (el.invisible) {\n          return;\n        }\n        var parent = el.parent; // Always has parent, and parent is nodeGroup.\n        var target;\n        var innerStore = inner(parent);\n        if (reRoot && reRoot.direction === 'drillDown') {\n          target = parent === reRoot.rootNodeGroup\n          // This is the content element of view root.\n          // Only `content` will enter this branch, because\n          // `background` and `nodeGroup` will not be deleted.\n          ? {\n            shape: {\n              x: 0,\n              y: 0,\n              width: innerStore.nodeWidth,\n              height: innerStore.nodeHeight\n            },\n            style: {\n              opacity: 0\n            }\n          }\n          // Others.\n          : {\n            style: {\n              opacity: 0\n            }\n          };\n        } else {\n          var targetX = 0;\n          var targetY = 0;\n          if (!innerStore.willDelete) {\n            // Let node animate to right-bottom corner, cooperating with fadeout,\n            // which is appropriate for user understanding.\n            // Divided by 2 for reRoot rolling up effect.\n            targetX = innerStore.nodeWidth / 2;\n            targetY = innerStore.nodeHeight / 2;\n          }\n          target = storageName === 'nodeGroup' ? {\n            x: targetX,\n            y: targetY,\n            style: {\n              opacity: 0\n            }\n          } : {\n            shape: {\n              x: targetX,\n              y: targetY,\n              width: 0,\n              height: 0\n            },\n            style: {\n              opacity: 0\n            }\n          };\n        }\n        // TODO: do not support delay until necessary.\n        target && animationWrap.add(el, target, duration, 0, easing);\n      });\n    });\n    // Make other animations\n    each(this._storage, function (store, storageName) {\n      each(store, function (el, rawIndex) {\n        var last = renderResult.lastsForAnimation[storageName][rawIndex];\n        var target = {};\n        if (!last) {\n          return;\n        }\n        if (el instanceof graphic.Group) {\n          if (last.oldX != null) {\n            target.x = el.x;\n            target.y = el.y;\n            el.x = last.oldX;\n            el.y = last.oldY;\n          }\n        } else {\n          if (last.oldShape) {\n            target.shape = extend({}, el.shape);\n            el.setShape(last.oldShape);\n          }\n          if (last.fadein) {\n            el.setStyle('opacity', 0);\n            target.style = {\n              opacity: 1\n            };\n          }\n          // When animation is stopped for succedent animation starting,\n          // el.style.opacity might not be 1\n          else if (el.style.opacity !== 1) {\n            target.style = {\n              opacity: 1\n            };\n          }\n        }\n        animationWrap.add(el, target, duration, 0, easing);\n      });\n    }, this);\n    this._state = 'animating';\n    animationWrap.finished(bind(function () {\n      this._state = 'ready';\n      renderResult.renderFinally();\n    }, this)).start();\n  };\n  TreemapView.prototype._resetController = function (api) {\n    var _this = this;\n    var controller = this._controller;\n    var controllerHost = this._controllerHost;\n    if (!controllerHost) {\n      this._controllerHost = {\n        target: this.group\n      };\n      controllerHost = this._controllerHost;\n    }\n    var seriesModel = this.seriesModel;\n    // Init controller.\n    if (!controller) {\n      controller = this._controller = new RoamController(api.getZr());\n      controller.on('pan', bind(this._onPan, this));\n      controller.on('zoom', bind(this._onZoom, this));\n    }\n    controller.enable(seriesModel.get('roam'), {\n      api: api,\n      zInfo: {\n        component: seriesModel\n      },\n      triggerInfo: {\n        roamTrigger: seriesModel.get('roamTrigger'),\n        isInSelf: function (e, x, y) {\n          var containerGroup = _this._containerGroup;\n          return containerGroup\n          // Currently only x, y exist in tranform.\n          ? containerGroup.getBoundingRect().contain(x - containerGroup.x, y - containerGroup.y) : false;\n        }\n      }\n    });\n    controllerHost.zoomLimit = seriesModel.get('scaleLimit');\n    controllerHost.zoom = seriesModel.get('zoom');\n  };\n  TreemapView.prototype._clearController = function () {\n    var controller = this._controller;\n    this._controllerHost = null;\n    if (controller) {\n      controller.dispose();\n      controller = null;\n    }\n  };\n  TreemapView.prototype._onPan = function (e) {\n    if (this._state !== 'animating' && (Math.abs(e.dx) > DRAG_THRESHOLD || Math.abs(e.dy) > DRAG_THRESHOLD)) {\n      // These param must not be cached.\n      var root = this.seriesModel.getData().tree.root;\n      if (!root) {\n        return;\n      }\n      var rootLayout = root.getLayout();\n      if (!rootLayout) {\n        return;\n      }\n      this.api.dispatchAction({\n        type: 'treemapMove',\n        from: this.uid,\n        seriesId: this.seriesModel.id,\n        rootRect: {\n          x: rootLayout.x + e.dx,\n          y: rootLayout.y + e.dy,\n          width: rootLayout.width,\n          height: rootLayout.height\n        }\n      });\n    }\n  };\n  TreemapView.prototype._onZoom = function (e) {\n    var mouseX = e.originX;\n    var mouseY = e.originY;\n    var zoomDelta = e.scale;\n    if (this._state !== 'animating') {\n      // These param must not be cached.\n      var root = this.seriesModel.getData().tree.root;\n      if (!root) {\n        return;\n      }\n      var rootLayout = root.getLayout();\n      if (!rootLayout) {\n        return;\n      }\n      var rect = new BoundingRect(rootLayout.x, rootLayout.y, rootLayout.width, rootLayout.height);\n      // scaleLimit\n      var zoomLimit = null;\n      var _controllerHost = this._controllerHost;\n      zoomLimit = _controllerHost.zoomLimit;\n      var newZoom = _controllerHost.zoom = _controllerHost.zoom || 1;\n      newZoom *= zoomDelta;\n      if (zoomLimit) {\n        var zoomMin = zoomLimit.min || 0;\n        var zoomMax = zoomLimit.max || Infinity;\n        newZoom = Math.max(Math.min(zoomMax, newZoom), zoomMin);\n      }\n      var zoomScale = newZoom / _controllerHost.zoom;\n      _controllerHost.zoom = newZoom;\n      var layoutInfo = this.seriesModel.layoutInfo;\n      // Transform mouse coord from global to containerGroup.\n      mouseX -= layoutInfo.x;\n      mouseY -= layoutInfo.y;\n      // Scale root bounding rect.\n      var m = matrix.create();\n      matrix.translate(m, m, [-mouseX, -mouseY]);\n      matrix.scale(m, m, [zoomScale, zoomScale]);\n      matrix.translate(m, m, [mouseX, mouseY]);\n      rect.applyTransform(m);\n      this.api.dispatchAction({\n        type: 'treemapRender',\n        from: this.uid,\n        seriesId: this.seriesModel.id,\n        rootRect: {\n          x: rect.x,\n          y: rect.y,\n          width: rect.width,\n          height: rect.height\n        }\n      });\n    }\n  };\n  TreemapView.prototype._initEvents = function (containerGroup) {\n    var _this = this;\n    containerGroup.on('click', function (e) {\n      if (_this._state !== 'ready') {\n        return;\n      }\n      var nodeClick = _this.seriesModel.get('nodeClick', true);\n      if (!nodeClick) {\n        return;\n      }\n      var targetInfo = _this.findTarget(e.offsetX, e.offsetY);\n      if (!targetInfo) {\n        return;\n      }\n      var node = targetInfo.node;\n      if (node.getLayout().isLeafRoot) {\n        _this._rootToNode(targetInfo);\n      } else {\n        if (nodeClick === 'zoomToNode') {\n          _this._zoomToNode(targetInfo);\n        } else if (nodeClick === 'link') {\n          var itemModel = node.hostTree.data.getItemModel(node.dataIndex);\n          var link = itemModel.get('link', true);\n          var linkTarget = itemModel.get('target', true) || 'blank';\n          link && windowOpen(link, linkTarget);\n        }\n      }\n    }, this);\n  };\n  TreemapView.prototype._renderBreadcrumb = function (seriesModel, api, targetInfo) {\n    var _this = this;\n    if (!targetInfo) {\n      targetInfo = seriesModel.get('leafDepth', true) != null ? {\n        node: seriesModel.getViewRoot()\n      }\n      // FIXME\n      // better way?\n      // Find breadcrumb tail on center of containerGroup.\n      : this.findTarget(api.getWidth() / 2, api.getHeight() / 2);\n      if (!targetInfo) {\n        targetInfo = {\n          node: seriesModel.getData().tree.root\n        };\n      }\n    }\n    (this._breadcrumb || (this._breadcrumb = new Breadcrumb(this.group))).render(seriesModel, api, targetInfo.node, function (node) {\n      if (_this._state !== 'animating') {\n        helper.aboveViewRoot(seriesModel.getViewRoot(), node) ? _this._rootToNode({\n          node: node\n        }) : _this._zoomToNode({\n          node: node\n        });\n      }\n    });\n  };\n  /**\n   * @override\n   */\n  TreemapView.prototype.remove = function () {\n    this._clearController();\n    this._containerGroup && this._containerGroup.removeAll();\n    this._storage = createStorage();\n    this._state = 'ready';\n    this._breadcrumb && this._breadcrumb.remove();\n  };\n  TreemapView.prototype.dispose = function () {\n    this._clearController();\n  };\n  TreemapView.prototype._zoomToNode = function (targetInfo) {\n    this.api.dispatchAction({\n      type: 'treemapZoomToNode',\n      from: this.uid,\n      seriesId: this.seriesModel.id,\n      targetNode: targetInfo.node\n    });\n  };\n  TreemapView.prototype._rootToNode = function (targetInfo) {\n    this.api.dispatchAction({\n      type: 'treemapRootToNode',\n      from: this.uid,\n      seriesId: this.seriesModel.id,\n      targetNode: targetInfo.node\n    });\n  };\n  /**\n   * @param x Global coord x.\n   * @param y Global coord y.\n   * @return info If not found, return undefined;\n   * @return info.node Target node.\n   * @return info.offsetX x refer to target node.\n   * @return info.offsetY y refer to target node.\n   */\n  TreemapView.prototype.findTarget = function (x, y) {\n    var targetInfo;\n    var viewRoot = this.seriesModel.getViewRoot();\n    viewRoot.eachNode({\n      attr: 'viewChildren',\n      order: 'preorder'\n    }, function (node) {\n      var bgEl = this._storage.background[node.getRawIndex()];\n      // If invisible, there might be no element.\n      if (bgEl) {\n        var point = bgEl.transformCoordToLocal(x, y);\n        var shape = bgEl.shape;\n        // For performance consideration, don't use 'getBoundingRect'.\n        if (shape.x <= point[0] && point[0] <= shape.x + shape.width && shape.y <= point[1] && point[1] <= shape.y + shape.height) {\n          targetInfo = {\n            node: node,\n            offsetX: point[0],\n            offsetY: point[1]\n          };\n        } else {\n          return false; // Suppress visit subtree.\n        }\n      }\n    }, this);\n    return targetInfo;\n  };\n  TreemapView.type = 'treemap';\n  return TreemapView;\n}(ChartView);\nfunction createStorage() {\n  return {\n    nodeGroup: [],\n    background: [],\n    content: []\n  };\n}\n/**\n * @return Return undefined means do not travel further.\n */\nfunction renderNode(seriesModel, thisStorage, oldStorage, reRoot, lastsForAnimation, willInvisibleEls, thisNode, oldNode, parentGroup, depth) {\n  // Whether under viewRoot.\n  if (!thisNode) {\n    // Deleting nodes will be performed finally. This method just find\n    // element from old storage, or create new element, set them to new\n    // storage, and set styles.\n    return;\n  }\n  // -------------------------------------------------------------------\n  // Start of closure variables available in \"Procedures in renderNode\".\n  var thisLayout = thisNode.getLayout();\n  var data = seriesModel.getData();\n  var nodeModel = thisNode.getModel();\n  // Only for enabling highlight/downplay. Clear firstly.\n  // Because some node will not be rendered.\n  data.setItemGraphicEl(thisNode.dataIndex, null);\n  if (!thisLayout || !thisLayout.isInView) {\n    return;\n  }\n  var thisWidth = thisLayout.width;\n  var thisHeight = thisLayout.height;\n  var borderWidth = thisLayout.borderWidth;\n  var thisInvisible = thisLayout.invisible;\n  var thisRawIndex = thisNode.getRawIndex();\n  var oldRawIndex = oldNode && oldNode.getRawIndex();\n  var thisViewChildren = thisNode.viewChildren;\n  var upperHeight = thisLayout.upperHeight;\n  var isParent = thisViewChildren && thisViewChildren.length;\n  var itemStyleNormalModel = nodeModel.getModel('itemStyle');\n  var itemStyleEmphasisModel = nodeModel.getModel(['emphasis', 'itemStyle']);\n  var itemStyleBlurModel = nodeModel.getModel(['blur', 'itemStyle']);\n  var itemStyleSelectModel = nodeModel.getModel(['select', 'itemStyle']);\n  var borderRadius = itemStyleNormalModel.get('borderRadius') || 0;\n  // End of closure ariables available in \"Procedures in renderNode\".\n  // -----------------------------------------------------------------\n  // Node group\n  var group = giveGraphic('nodeGroup', Group);\n  if (!group) {\n    return;\n  }\n  parentGroup.add(group);\n  // x,y are not set when el is above view root.\n  group.x = thisLayout.x || 0;\n  group.y = thisLayout.y || 0;\n  group.markRedraw();\n  inner(group).nodeWidth = thisWidth;\n  inner(group).nodeHeight = thisHeight;\n  if (thisLayout.isAboveViewRoot) {\n    return group;\n  }\n  // Background\n  var bg = giveGraphic('background', Rect, depth, Z2_BG);\n  bg && renderBackground(group, bg, isParent && thisLayout.upperLabelHeight);\n  var emphasisModel = nodeModel.getModel('emphasis');\n  var focus = emphasisModel.get('focus');\n  var blurScope = emphasisModel.get('blurScope');\n  var isDisabled = emphasisModel.get('disabled');\n  var focusOrIndices = focus === 'ancestor' ? thisNode.getAncestorsIndices() : focus === 'descendant' ? thisNode.getDescendantIndices() : focus;\n  // No children, render content.\n  if (isParent) {\n    // Because of the implementation about \"traverse\" in graphic hover style, we\n    // can not set hover listener on the \"group\" of non-leaf node. Otherwise the\n    // hover event from the descendents will be listenered.\n    if (isHighDownDispatcher(group)) {\n      setAsHighDownDispatcher(group, false);\n    }\n    if (bg) {\n      setAsHighDownDispatcher(bg, !isDisabled);\n      // Only for enabling highlight/downplay.\n      data.setItemGraphicEl(thisNode.dataIndex, bg);\n      enableHoverFocus(bg, focusOrIndices, blurScope);\n    }\n  } else {\n    var content = giveGraphic('content', Rect, depth, Z2_CONTENT);\n    content && renderContent(group, content);\n    bg.disableMorphing = true;\n    if (bg && isHighDownDispatcher(bg)) {\n      setAsHighDownDispatcher(bg, false);\n    }\n    setAsHighDownDispatcher(group, !isDisabled);\n    // Only for enabling highlight/downplay.\n    data.setItemGraphicEl(thisNode.dataIndex, group);\n    var cursorStyle = nodeModel.getShallow('cursor');\n    cursorStyle && content.attr('cursor', cursorStyle);\n    enableHoverFocus(group, focusOrIndices, blurScope);\n  }\n  return group;\n  // ----------------------------\n  // | Procedures in renderNode |\n  // ----------------------------\n  function renderBackground(group, bg, useUpperLabel) {\n    var ecData = getECData(bg);\n    // For tooltip.\n    ecData.dataIndex = thisNode.dataIndex;\n    ecData.seriesIndex = seriesModel.seriesIndex;\n    bg.setShape({\n      x: 0,\n      y: 0,\n      width: thisWidth,\n      height: thisHeight,\n      r: borderRadius\n    });\n    if (thisInvisible) {\n      // If invisible, do not set visual, otherwise the element will\n      // change immediately before animation. We think it is OK to\n      // remain its origin color when moving out of the view window.\n      processInvisible(bg);\n    } else {\n      bg.invisible = false;\n      var style = thisNode.getVisual('style');\n      var visualBorderColor = style.stroke;\n      var normalStyle = getItemStyleNormal(itemStyleNormalModel);\n      normalStyle.fill = visualBorderColor;\n      var emphasisStyle = getStateItemStyle(itemStyleEmphasisModel);\n      emphasisStyle.fill = itemStyleEmphasisModel.get('borderColor');\n      var blurStyle = getStateItemStyle(itemStyleBlurModel);\n      blurStyle.fill = itemStyleBlurModel.get('borderColor');\n      var selectStyle = getStateItemStyle(itemStyleSelectModel);\n      selectStyle.fill = itemStyleSelectModel.get('borderColor');\n      if (useUpperLabel) {\n        var upperLabelWidth = thisWidth - 2 * borderWidth;\n        prepareText(\n        // PENDING: convert ZRColor to ColorString for text.\n        bg, visualBorderColor, style.opacity, {\n          x: borderWidth,\n          y: 0,\n          width: upperLabelWidth,\n          height: upperHeight\n        });\n      }\n      // For old bg.\n      else {\n        bg.removeTextContent();\n      }\n      bg.setStyle(normalStyle);\n      bg.ensureState('emphasis').style = emphasisStyle;\n      bg.ensureState('blur').style = blurStyle;\n      bg.ensureState('select').style = selectStyle;\n      setDefaultStateProxy(bg);\n    }\n    group.add(bg);\n  }\n  function renderContent(group, content) {\n    var ecData = getECData(content);\n    // For tooltip.\n    ecData.dataIndex = thisNode.dataIndex;\n    ecData.seriesIndex = seriesModel.seriesIndex;\n    var contentWidth = Math.max(thisWidth - 2 * borderWidth, 0);\n    var contentHeight = Math.max(thisHeight - 2 * borderWidth, 0);\n    content.culling = true;\n    content.setShape({\n      x: borderWidth,\n      y: borderWidth,\n      width: contentWidth,\n      height: contentHeight,\n      r: borderRadius\n    });\n    if (thisInvisible) {\n      // If invisible, do not set visual, otherwise the element will\n      // change immediately before animation. We think it is OK to\n      // remain its origin color when moving out of the view window.\n      processInvisible(content);\n    } else {\n      content.invisible = false;\n      var nodeStyle = thisNode.getVisual('style');\n      var visualColor = nodeStyle.fill;\n      var normalStyle = getItemStyleNormal(itemStyleNormalModel);\n      normalStyle.fill = visualColor;\n      normalStyle.decal = nodeStyle.decal;\n      var emphasisStyle = getStateItemStyle(itemStyleEmphasisModel);\n      var blurStyle = getStateItemStyle(itemStyleBlurModel);\n      var selectStyle = getStateItemStyle(itemStyleSelectModel);\n      // PENDING: convert ZRColor to ColorString for text.\n      prepareText(content, visualColor, nodeStyle.opacity, null);\n      content.setStyle(normalStyle);\n      content.ensureState('emphasis').style = emphasisStyle;\n      content.ensureState('blur').style = blurStyle;\n      content.ensureState('select').style = selectStyle;\n      setDefaultStateProxy(content);\n    }\n    group.add(content);\n  }\n  function processInvisible(element) {\n    // Delay invisible setting utill animation finished,\n    // avoid element vanish suddenly before animation.\n    !element.invisible && willInvisibleEls.push(element);\n  }\n  function prepareText(rectEl, visualColor, visualOpacity,\n  // Can be null/undefined\n  upperLabelRect) {\n    var normalLabelModel = nodeModel.getModel(upperLabelRect ? PATH_UPPERLABEL_NORMAL : PATH_LABEL_NOAMAL);\n    var defaultText = convertOptionIdName(nodeModel.get('name'), null);\n    var isShow = normalLabelModel.getShallow('show');\n    setLabelStyle(rectEl, getLabelStatesModels(nodeModel, upperLabelRect ? PATH_UPPERLABEL_NORMAL : PATH_LABEL_NOAMAL), {\n      defaultText: isShow ? defaultText : null,\n      inheritColor: visualColor,\n      defaultOpacity: visualOpacity,\n      labelFetcher: seriesModel,\n      labelDataIndex: thisNode.dataIndex\n    });\n    var textEl = rectEl.getTextContent();\n    if (!textEl) {\n      return;\n    }\n    var textStyle = textEl.style;\n    var textPadding = normalizeCssArray(textStyle.padding || 0);\n    if (upperLabelRect) {\n      rectEl.setTextConfig({\n        layoutRect: upperLabelRect\n      });\n      textEl.disableLabelLayout = true;\n    }\n    textEl.beforeUpdate = function () {\n      var width = Math.max((upperLabelRect ? upperLabelRect.width : rectEl.shape.width) - textPadding[1] - textPadding[3], 0);\n      var height = Math.max((upperLabelRect ? upperLabelRect.height : rectEl.shape.height) - textPadding[0] - textPadding[2], 0);\n      if (textStyle.width !== width || textStyle.height !== height) {\n        textEl.setStyle({\n          width: width,\n          height: height\n        });\n      }\n    };\n    textStyle.truncateMinChar = 2;\n    textStyle.lineOverflow = 'truncate';\n    addDrillDownIcon(textStyle, upperLabelRect, thisLayout);\n    var textEmphasisState = textEl.getState('emphasis');\n    addDrillDownIcon(textEmphasisState ? textEmphasisState.style : null, upperLabelRect, thisLayout);\n  }\n  function addDrillDownIcon(style, upperLabelRect, thisLayout) {\n    var text = style ? style.text : null;\n    if (!upperLabelRect && thisLayout.isLeafRoot && text != null) {\n      var iconChar = seriesModel.get('drillDownIcon', true);\n      style.text = iconChar ? iconChar + ' ' + text : text;\n    }\n  }\n  function giveGraphic(storageName, Ctor, depth, z) {\n    var element = oldRawIndex != null && oldStorage[storageName][oldRawIndex];\n    var lasts = lastsForAnimation[storageName];\n    if (element) {\n      // Remove from oldStorage\n      oldStorage[storageName][oldRawIndex] = null;\n      prepareAnimationWhenHasOld(lasts, element);\n    }\n    // If invisible and no old element, do not create new element (for optimizing).\n    else if (!thisInvisible) {\n      element = new Ctor();\n      if (element instanceof Displayable) {\n        element.z2 = calculateZ2(depth, z);\n      }\n      prepareAnimationWhenNoOld(lasts, element);\n    }\n    // Set to thisStorage\n    return thisStorage[storageName][thisRawIndex] = element;\n  }\n  function prepareAnimationWhenHasOld(lasts, element) {\n    var lastCfg = lasts[thisRawIndex] = {};\n    if (element instanceof Group) {\n      lastCfg.oldX = element.x;\n      lastCfg.oldY = element.y;\n    } else {\n      lastCfg.oldShape = extend({}, element.shape);\n    }\n  }\n  // If a element is new, we need to find the animation start point carefully,\n  // otherwise it will looks strange when 'zoomToNode'.\n  function prepareAnimationWhenNoOld(lasts, element) {\n    var lastCfg = lasts[thisRawIndex] = {};\n    var parentNode = thisNode.parentNode;\n    var isGroup = element instanceof graphic.Group;\n    if (parentNode && (!reRoot || reRoot.direction === 'drillDown')) {\n      var parentOldX = 0;\n      var parentOldY = 0;\n      // New nodes appear from right-bottom corner in 'zoomToNode' animation.\n      // For convenience, get old bounding rect from background.\n      var parentOldBg = lastsForAnimation.background[parentNode.getRawIndex()];\n      if (!reRoot && parentOldBg && parentOldBg.oldShape) {\n        parentOldX = parentOldBg.oldShape.width;\n        parentOldY = parentOldBg.oldShape.height;\n      }\n      // When no parent old shape found, its parent is new too,\n      // so we can just use {x:0, y:0}.\n      if (isGroup) {\n        lastCfg.oldX = 0;\n        lastCfg.oldY = parentOldY;\n      } else {\n        lastCfg.oldShape = {\n          x: parentOldX,\n          y: parentOldY,\n          width: 0,\n          height: 0\n        };\n      }\n    }\n    // Fade in, user can be aware that these nodes are new.\n    lastCfg.fadein = !isGroup;\n  }\n}\n// We cannot set all background with the same z, because the behaviour of\n// drill down and roll up differ background creation sequence from tree\n// hierarchy sequence, which cause lower background elements to overlap\n// upper ones. So we calculate z based on depth.\n// Moreover, we try to shrink down z interval to [0, 1] to avoid that\n// treemap with large z overlaps other components.\nfunction calculateZ2(depth, z2InLevel) {\n  return depth * Z2_BASE + z2InLevel;\n}\nexport default TreemapView;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as zrColor from 'zrender/lib/tool/color.js';\nimport { linearMap } from '../util/number.js';\nimport { warn } from '../util/log.js';\nvar each = zrUtil.each;\nvar isObject = zrUtil.isObject;\nvar CATEGORY_DEFAULT_VISUAL_INDEX = -1;\nvar VisualMapping = /** @class */function () {\n  function VisualMapping(option) {\n    var mappingMethod = option.mappingMethod;\n    var visualType = option.type;\n    var thisOption = this.option = zrUtil.clone(option);\n    this.type = visualType;\n    this.mappingMethod = mappingMethod;\n    this._normalizeData = normalizers[mappingMethod];\n    var visualHandler = VisualMapping.visualHandlers[visualType];\n    this.applyVisual = visualHandler.applyVisual;\n    this.getColorMapper = visualHandler.getColorMapper;\n    this._normalizedToVisual = visualHandler._normalizedToVisual[mappingMethod];\n    if (mappingMethod === 'piecewise') {\n      normalizeVisualRange(thisOption);\n      preprocessForPiecewise(thisOption);\n    } else if (mappingMethod === 'category') {\n      thisOption.categories ? preprocessForSpecifiedCategory(thisOption)\n      // categories is ordinal when thisOption.categories not specified,\n      // which need no more preprocess except normalize visual.\n      : normalizeVisualRange(thisOption, true);\n    } else {\n      // mappingMethod === 'linear' or 'fixed'\n      zrUtil.assert(mappingMethod !== 'linear' || thisOption.dataExtent);\n      normalizeVisualRange(thisOption);\n    }\n  }\n  VisualMapping.prototype.mapValueToVisual = function (value) {\n    var normalized = this._normalizeData(value);\n    return this._normalizedToVisual(normalized, value);\n  };\n  VisualMapping.prototype.getNormalizer = function () {\n    return zrUtil.bind(this._normalizeData, this);\n  };\n  /**\n   * List available visual types.\n   *\n   * @public\n   * @return {Array.<string>}\n   */\n  VisualMapping.listVisualTypes = function () {\n    return zrUtil.keys(VisualMapping.visualHandlers);\n  };\n  // /**\n  //  * @public\n  //  */\n  // static addVisualHandler(name, handler) {\n  //     visualHandlers[name] = handler;\n  // }\n  /**\n   * @public\n   */\n  VisualMapping.isValidType = function (visualType) {\n    return VisualMapping.visualHandlers.hasOwnProperty(visualType);\n  };\n  /**\n   * Convenient method.\n   * Visual can be Object or Array or primary type.\n   */\n  VisualMapping.eachVisual = function (visual, callback, context) {\n    if (zrUtil.isObject(visual)) {\n      zrUtil.each(visual, callback, context);\n    } else {\n      callback.call(context, visual);\n    }\n  };\n  VisualMapping.mapVisual = function (visual, callback, context) {\n    var isPrimary;\n    var newVisual = zrUtil.isArray(visual) ? [] : zrUtil.isObject(visual) ? {} : (isPrimary = true, null);\n    VisualMapping.eachVisual(visual, function (v, key) {\n      var newVal = callback.call(context, v, key);\n      isPrimary ? newVisual = newVal : newVisual[key] = newVal;\n    });\n    return newVisual;\n  };\n  /**\n   * Retrieve visual properties from given object.\n   */\n  VisualMapping.retrieveVisuals = function (obj) {\n    var ret = {};\n    var hasVisual;\n    obj && each(VisualMapping.visualHandlers, function (h, visualType) {\n      if (obj.hasOwnProperty(visualType)) {\n        ret[visualType] = obj[visualType];\n        hasVisual = true;\n      }\n    });\n    return hasVisual ? ret : null;\n  };\n  /**\n   * Give order to visual types, considering colorSaturation, colorAlpha depends on color.\n   *\n   * @public\n   * @param {(Object|Array)} visualTypes If Object, like: {color: ..., colorSaturation: ...}\n   *                                     IF Array, like: ['color', 'symbol', 'colorSaturation']\n   * @return {Array.<string>} Sorted visual types.\n   */\n  VisualMapping.prepareVisualTypes = function (visualTypes) {\n    if (zrUtil.isArray(visualTypes)) {\n      visualTypes = visualTypes.slice();\n    } else if (isObject(visualTypes)) {\n      var types_1 = [];\n      each(visualTypes, function (item, type) {\n        types_1.push(type);\n      });\n      visualTypes = types_1;\n    } else {\n      return [];\n    }\n    visualTypes.sort(function (type1, type2) {\n      // color should be front of colorSaturation, colorAlpha, ...\n      // symbol and symbolSize do not matter.\n      return type2 === 'color' && type1 !== 'color' && type1.indexOf('color') === 0 ? 1 : -1;\n    });\n    return visualTypes;\n  };\n  /**\n   * 'color', 'colorSaturation', 'colorAlpha', ... are depends on 'color'.\n   * Other visuals are only depends on themself.\n   */\n  VisualMapping.dependsOn = function (visualType1, visualType2) {\n    return visualType2 === 'color' ? !!(visualType1 && visualType1.indexOf(visualType2) === 0) : visualType1 === visualType2;\n  };\n  /**\n   * @param value\n   * @param pieceList [{value: ..., interval: [min, max]}, ...]\n   *                         Always from small to big.\n   * @param findClosestWhenOutside Default to be false\n   * @return index\n   */\n  VisualMapping.findPieceIndex = function (value, pieceList, findClosestWhenOutside) {\n    var possibleI;\n    var abs = Infinity;\n    // value has the higher priority.\n    for (var i = 0, len = pieceList.length; i < len; i++) {\n      var pieceValue = pieceList[i].value;\n      if (pieceValue != null) {\n        if (pieceValue === value\n        // FIXME\n        // It is supposed to compare value according to value type of dimension,\n        // but currently value type can exactly be string or number.\n        // Compromise for numeric-like string (like '12'), especially\n        // in the case that visualMap.categories is ['22', '33'].\n        || zrUtil.isString(pieceValue) && pieceValue === value + '') {\n          return i;\n        }\n        findClosestWhenOutside && updatePossible(pieceValue, i);\n      }\n    }\n    for (var i = 0, len = pieceList.length; i < len; i++) {\n      var piece = pieceList[i];\n      var interval = piece.interval;\n      var close_1 = piece.close;\n      if (interval) {\n        if (interval[0] === -Infinity) {\n          if (littleThan(close_1[1], value, interval[1])) {\n            return i;\n          }\n        } else if (interval[1] === Infinity) {\n          if (littleThan(close_1[0], interval[0], value)) {\n            return i;\n          }\n        } else if (littleThan(close_1[0], interval[0], value) && littleThan(close_1[1], value, interval[1])) {\n          return i;\n        }\n        findClosestWhenOutside && updatePossible(interval[0], i);\n        findClosestWhenOutside && updatePossible(interval[1], i);\n      }\n    }\n    if (findClosestWhenOutside) {\n      return value === Infinity ? pieceList.length - 1 : value === -Infinity ? 0 : possibleI;\n    }\n    function updatePossible(val, index) {\n      var newAbs = Math.abs(val - value);\n      if (newAbs < abs) {\n        abs = newAbs;\n        possibleI = index;\n      }\n    }\n  };\n  VisualMapping.visualHandlers = {\n    color: {\n      applyVisual: makeApplyVisual('color'),\n      getColorMapper: function () {\n        var thisOption = this.option;\n        return zrUtil.bind(thisOption.mappingMethod === 'category' ? function (value, isNormalized) {\n          !isNormalized && (value = this._normalizeData(value));\n          return doMapCategory.call(this, value);\n        } : function (value, isNormalized, out) {\n          // If output rgb array\n          // which will be much faster and useful in pixel manipulation\n          var returnRGBArray = !!out;\n          !isNormalized && (value = this._normalizeData(value));\n          out = zrColor.fastLerp(value, thisOption.parsedVisual, out);\n          return returnRGBArray ? out : zrColor.stringify(out, 'rgba');\n        }, this);\n      },\n      _normalizedToVisual: {\n        linear: function (normalized) {\n          return zrColor.stringify(zrColor.fastLerp(normalized, this.option.parsedVisual), 'rgba');\n        },\n        category: doMapCategory,\n        piecewise: function (normalized, value) {\n          var result = getSpecifiedVisual.call(this, value);\n          if (result == null) {\n            result = zrColor.stringify(zrColor.fastLerp(normalized, this.option.parsedVisual), 'rgba');\n          }\n          return result;\n        },\n        fixed: doMapFixed\n      }\n    },\n    colorHue: makePartialColorVisualHandler(function (color, value) {\n      return zrColor.modifyHSL(color, value);\n    }),\n    colorSaturation: makePartialColorVisualHandler(function (color, value) {\n      return zrColor.modifyHSL(color, null, value);\n    }),\n    colorLightness: makePartialColorVisualHandler(function (color, value) {\n      return zrColor.modifyHSL(color, null, null, value);\n    }),\n    colorAlpha: makePartialColorVisualHandler(function (color, value) {\n      return zrColor.modifyAlpha(color, value);\n    }),\n    decal: {\n      applyVisual: makeApplyVisual('decal'),\n      _normalizedToVisual: {\n        linear: null,\n        category: doMapCategory,\n        piecewise: null,\n        fixed: null\n      }\n    },\n    opacity: {\n      applyVisual: makeApplyVisual('opacity'),\n      _normalizedToVisual: createNormalizedToNumericVisual([0, 1])\n    },\n    liftZ: {\n      applyVisual: makeApplyVisual('liftZ'),\n      _normalizedToVisual: {\n        linear: doMapFixed,\n        category: doMapFixed,\n        piecewise: doMapFixed,\n        fixed: doMapFixed\n      }\n    },\n    symbol: {\n      applyVisual: function (value, getter, setter) {\n        var symbolCfg = this.mapValueToVisual(value);\n        setter('symbol', symbolCfg);\n      },\n      _normalizedToVisual: {\n        linear: doMapToArray,\n        category: doMapCategory,\n        piecewise: function (normalized, value) {\n          var result = getSpecifiedVisual.call(this, value);\n          if (result == null) {\n            result = doMapToArray.call(this, normalized);\n          }\n          return result;\n        },\n        fixed: doMapFixed\n      }\n    },\n    symbolSize: {\n      applyVisual: makeApplyVisual('symbolSize'),\n      _normalizedToVisual: createNormalizedToNumericVisual([0, 1])\n    }\n  };\n  return VisualMapping;\n}();\nfunction preprocessForPiecewise(thisOption) {\n  var pieceList = thisOption.pieceList;\n  thisOption.hasSpecialVisual = false;\n  zrUtil.each(pieceList, function (piece, index) {\n    piece.originIndex = index;\n    // piece.visual is \"result visual value\" but not\n    // a visual range, so it does not need to be normalized.\n    if (piece.visual != null) {\n      thisOption.hasSpecialVisual = true;\n    }\n  });\n}\nfunction preprocessForSpecifiedCategory(thisOption) {\n  // Hash categories.\n  var categories = thisOption.categories;\n  var categoryMap = thisOption.categoryMap = {};\n  var visual = thisOption.visual;\n  each(categories, function (cate, index) {\n    categoryMap[cate] = index;\n  });\n  // Process visual map input.\n  if (!zrUtil.isArray(visual)) {\n    var visualArr_1 = [];\n    if (zrUtil.isObject(visual)) {\n      each(visual, function (v, cate) {\n        var index = categoryMap[cate];\n        visualArr_1[index != null ? index : CATEGORY_DEFAULT_VISUAL_INDEX] = v;\n      });\n    } else {\n      // Is primary type, represents default visual.\n      visualArr_1[CATEGORY_DEFAULT_VISUAL_INDEX] = visual;\n    }\n    visual = setVisualToOption(thisOption, visualArr_1);\n  }\n  // Remove categories that has no visual,\n  // then we can mapping them to CATEGORY_DEFAULT_VISUAL_INDEX.\n  for (var i = categories.length - 1; i >= 0; i--) {\n    if (visual[i] == null) {\n      delete categoryMap[categories[i]];\n      categories.pop();\n    }\n  }\n}\nfunction normalizeVisualRange(thisOption, isCategory) {\n  var visual = thisOption.visual;\n  var visualArr = [];\n  if (zrUtil.isObject(visual)) {\n    each(visual, function (v) {\n      visualArr.push(v);\n    });\n  } else if (visual != null) {\n    visualArr.push(visual);\n  }\n  var doNotNeedPair = {\n    color: 1,\n    symbol: 1\n  };\n  if (!isCategory && visualArr.length === 1 && !doNotNeedPair.hasOwnProperty(thisOption.type)) {\n    // Do not care visualArr.length === 0, which is illegal.\n    visualArr[1] = visualArr[0];\n  }\n  setVisualToOption(thisOption, visualArr);\n}\nfunction makePartialColorVisualHandler(applyValue) {\n  return {\n    applyVisual: function (value, getter, setter) {\n      // Only used in HSL\n      var colorChannel = this.mapValueToVisual(value);\n      // Must not be array value\n      setter('color', applyValue(getter('color'), colorChannel));\n    },\n    _normalizedToVisual: createNormalizedToNumericVisual([0, 1])\n  };\n}\nfunction doMapToArray(normalized) {\n  var visual = this.option.visual;\n  return visual[Math.round(linearMap(normalized, [0, 1], [0, visual.length - 1], true))] || {}; // TODO {}?\n}\nfunction makeApplyVisual(visualType) {\n  return function (value, getter, setter) {\n    setter(visualType, this.mapValueToVisual(value));\n  };\n}\nfunction doMapCategory(normalized) {\n  var visual = this.option.visual;\n  return visual[this.option.loop && normalized !== CATEGORY_DEFAULT_VISUAL_INDEX ? normalized % visual.length : normalized];\n}\nfunction doMapFixed() {\n  // visual will be convert to array.\n  return this.option.visual[0];\n}\n/**\n * Create mapped to numeric visual\n */\nfunction createNormalizedToNumericVisual(sourceExtent) {\n  return {\n    linear: function (normalized) {\n      return linearMap(normalized, sourceExtent, this.option.visual, true);\n    },\n    category: doMapCategory,\n    piecewise: function (normalized, value) {\n      var result = getSpecifiedVisual.call(this, value);\n      if (result == null) {\n        result = linearMap(normalized, sourceExtent, this.option.visual, true);\n      }\n      return result;\n    },\n    fixed: doMapFixed\n  };\n}\nfunction getSpecifiedVisual(value) {\n  var thisOption = this.option;\n  var pieceList = thisOption.pieceList;\n  if (thisOption.hasSpecialVisual) {\n    var pieceIndex = VisualMapping.findPieceIndex(value, pieceList);\n    var piece = pieceList[pieceIndex];\n    if (piece && piece.visual) {\n      return piece.visual[this.type];\n    }\n  }\n}\nfunction setVisualToOption(thisOption, visualArr) {\n  thisOption.visual = visualArr;\n  if (thisOption.type === 'color') {\n    thisOption.parsedVisual = zrUtil.map(visualArr, function (item) {\n      var color = zrColor.parse(item);\n      if (!color && process.env.NODE_ENV !== 'production') {\n        warn(\"'\" + item + \"' is an illegal color, fallback to '#000000'\", true);\n      }\n      return color || [0, 0, 0, 1];\n    });\n  }\n  return visualArr;\n}\n/**\n * Normalizers by mapping methods.\n */\nvar normalizers = {\n  linear: function (value) {\n    return linearMap(value, this.option.dataExtent, [0, 1], true);\n  },\n  piecewise: function (value) {\n    var pieceList = this.option.pieceList;\n    var pieceIndex = VisualMapping.findPieceIndex(value, pieceList, true);\n    if (pieceIndex != null) {\n      return linearMap(pieceIndex, [0, pieceList.length - 1], [0, 1], true);\n    }\n  },\n  category: function (value) {\n    var index = this.option.categories ? this.option.categoryMap[value] : value; // ordinal value\n    return index == null ? CATEGORY_DEFAULT_VISUAL_INDEX : index;\n  },\n  fixed: zrUtil.noop\n};\nfunction littleThan(close, a, b) {\n  return close ? a <= b : a < b;\n}\nexport default VisualMapping;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport VisualMapping from '../../visual/VisualMapping.js';\nimport { each, extend, isArray } from 'zrender/lib/core/util.js';\nimport { modifyHSL, modifyAlpha } from 'zrender/lib/tool/color.js';\nimport { makeInner } from '../../util/model.js';\nvar ITEM_STYLE_NORMAL = 'itemStyle';\nvar inner = makeInner();\nexport default {\n  seriesType: 'treemap',\n  reset: function (seriesModel) {\n    var tree = seriesModel.getData().tree;\n    var root = tree.root;\n    if (root.isRemoved()) {\n      return;\n    }\n    travelTree(root,\n    // Visual should calculate from tree root but not view root.\n    {}, seriesModel.getViewRoot().getAncestors(), seriesModel);\n  }\n};\nfunction travelTree(node, designatedVisual, viewRootAncestors, seriesModel) {\n  var nodeModel = node.getModel();\n  var nodeLayout = node.getLayout();\n  var data = node.hostTree.data;\n  // Optimize\n  if (!nodeLayout || nodeLayout.invisible || !nodeLayout.isInView) {\n    return;\n  }\n  var nodeItemStyleModel = nodeModel.getModel(ITEM_STYLE_NORMAL);\n  var visuals = buildVisuals(nodeItemStyleModel, designatedVisual, seriesModel);\n  var existsStyle = data.ensureUniqueItemVisual(node.dataIndex, 'style');\n  // calculate border color\n  var borderColor = nodeItemStyleModel.get('borderColor');\n  var borderColorSaturation = nodeItemStyleModel.get('borderColorSaturation');\n  var thisNodeColor;\n  if (borderColorSaturation != null) {\n    // For performance, do not always execute 'calculateColor'.\n    thisNodeColor = calculateColor(visuals);\n    borderColor = calculateBorderColor(borderColorSaturation, thisNodeColor);\n  }\n  existsStyle.stroke = borderColor;\n  var viewChildren = node.viewChildren;\n  if (!viewChildren || !viewChildren.length) {\n    thisNodeColor = calculateColor(visuals);\n    // Apply visual to this node.\n    existsStyle.fill = thisNodeColor;\n  } else {\n    var mapping_1 = buildVisualMapping(node, nodeModel, nodeLayout, nodeItemStyleModel, visuals, viewChildren);\n    // Designate visual to children.\n    each(viewChildren, function (child, index) {\n      // If higher than viewRoot, only ancestors of viewRoot is needed to visit.\n      if (child.depth >= viewRootAncestors.length || child === viewRootAncestors[child.depth]) {\n        var childVisual = mapVisual(nodeModel, visuals, child, index, mapping_1, seriesModel);\n        travelTree(child, childVisual, viewRootAncestors, seriesModel);\n      }\n    });\n  }\n}\nfunction buildVisuals(nodeItemStyleModel, designatedVisual, seriesModel) {\n  var visuals = extend({}, designatedVisual);\n  var designatedVisualItemStyle = seriesModel.designatedVisualItemStyle;\n  each(['color', 'colorAlpha', 'colorSaturation'], function (visualName) {\n    // Priority: thisNode > thisLevel > parentNodeDesignated > seriesModel\n    designatedVisualItemStyle[visualName] = designatedVisual[visualName];\n    var val = nodeItemStyleModel.get(visualName);\n    designatedVisualItemStyle[visualName] = null;\n    val != null && (visuals[visualName] = val);\n  });\n  return visuals;\n}\nfunction calculateColor(visuals) {\n  var color = getValueVisualDefine(visuals, 'color');\n  if (color) {\n    var colorAlpha = getValueVisualDefine(visuals, 'colorAlpha');\n    var colorSaturation = getValueVisualDefine(visuals, 'colorSaturation');\n    if (colorSaturation) {\n      color = modifyHSL(color, null, null, colorSaturation);\n    }\n    if (colorAlpha) {\n      color = modifyAlpha(color, colorAlpha);\n    }\n    return color;\n  }\n}\nfunction calculateBorderColor(borderColorSaturation, thisNodeColor) {\n  return thisNodeColor != null\n  // Can only be string\n  ? modifyHSL(thisNodeColor, null, null, borderColorSaturation) : null;\n}\nfunction getValueVisualDefine(visuals, name) {\n  var value = visuals[name];\n  if (value != null && value !== 'none') {\n    return value;\n  }\n}\nfunction buildVisualMapping(node, nodeModel, nodeLayout, nodeItemStyleModel, visuals, viewChildren) {\n  if (!viewChildren || !viewChildren.length) {\n    return;\n  }\n  var rangeVisual = getRangeVisual(nodeModel, 'color') || visuals.color != null && visuals.color !== 'none' && (getRangeVisual(nodeModel, 'colorAlpha') || getRangeVisual(nodeModel, 'colorSaturation'));\n  if (!rangeVisual) {\n    return;\n  }\n  var visualMin = nodeModel.get('visualMin');\n  var visualMax = nodeModel.get('visualMax');\n  var dataExtent = nodeLayout.dataExtent.slice();\n  visualMin != null && visualMin < dataExtent[0] && (dataExtent[0] = visualMin);\n  visualMax != null && visualMax > dataExtent[1] && (dataExtent[1] = visualMax);\n  var colorMappingBy = nodeModel.get('colorMappingBy');\n  var opt = {\n    type: rangeVisual.name,\n    dataExtent: dataExtent,\n    visual: rangeVisual.range\n  };\n  if (opt.type === 'color' && (colorMappingBy === 'index' || colorMappingBy === 'id')) {\n    opt.mappingMethod = 'category';\n    opt.loop = true;\n    // categories is ordinal, so do not set opt.categories.\n  } else {\n    opt.mappingMethod = 'linear';\n  }\n  var mapping = new VisualMapping(opt);\n  inner(mapping).drColorMappingBy = colorMappingBy;\n  return mapping;\n}\n// Notice: If we don't have the attribute 'colorRange', but only use\n// attribute 'color' to represent both concepts of 'colorRange' and 'color',\n// (It means 'colorRange' when 'color' is Array, means 'color' when not array),\n// this problem will be encountered:\n// If a level-1 node doesn't have children, and its siblings have children,\n// and colorRange is set on level-1, then the node cannot be colored.\n// So we separate 'colorRange' and 'color' to different attributes.\nfunction getRangeVisual(nodeModel, name) {\n  // 'colorRange', 'colorARange', 'colorSRange'.\n  // If not exists on this node, fetch from levels and series.\n  var range = nodeModel.get(name);\n  return isArray(range) && range.length ? {\n    name: name,\n    range: range\n  } : null;\n}\nfunction mapVisual(nodeModel, visuals, child, index, mapping, seriesModel) {\n  var childVisuals = extend({}, visuals);\n  if (mapping) {\n    // Only support color, colorAlpha, colorSaturation.\n    var mappingType = mapping.type;\n    var colorMappingBy = mappingType === 'color' && inner(mapping).drColorMappingBy;\n    var value = colorMappingBy === 'index' ? index : colorMappingBy === 'id' ? seriesModel.mapIdToIndex(child.getId()) : child.getValue(nodeModel.get('visualDimension'));\n    childVisuals[mappingType] = mapping.mapValueToVisual(value);\n  }\n  return childVisuals;\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n/*\n* A third-party license is embedded for some of the code in this file:\n* The treemap layout implementation was originally copied from\n* \"d3.js\" with some modifications made for this project.\n* (See more details in the comment of the method \"squarify\" below.)\n* The use of the source code of this file is also subject to the terms\n* and consitions of the license of \"d3.js\" (BSD-3Clause, see\n* </licenses/LICENSE-d3>).\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport BoundingRect from 'zrender/lib/core/BoundingRect.js';\nimport { parsePercent, MAX_SAFE_INTEGER } from '../../util/number.js';\nimport * as layout from '../../util/layout.js';\nimport * as helper from '../helper/treeHelper.js';\nvar mathMax = Math.max;\nvar mathMin = Math.min;\nvar retrieveValue = zrUtil.retrieve;\nvar each = zrUtil.each;\nvar PATH_BORDER_WIDTH = ['itemStyle', 'borderWidth'];\nvar PATH_GAP_WIDTH = ['itemStyle', 'gapWidth'];\nvar PATH_UPPER_LABEL_SHOW = ['upperLabel', 'show'];\nvar PATH_UPPER_LABEL_HEIGHT = ['upperLabel', 'height'];\n;\n/**\n * @public\n */\nexport default {\n  seriesType: 'treemap',\n  reset: function (seriesModel, ecModel, api, payload) {\n    // Layout result in each node:\n    // {x, y, width, height, area, borderWidth}\n    var seriesOption = seriesModel.option;\n    var refContainer = layout.createBoxLayoutReference(seriesModel, api).refContainer;\n    var layoutInfo = layout.getLayoutRect(seriesModel.getBoxLayoutParams(), refContainer);\n    var size = seriesOption.size || []; // Compatible with ec2.\n    var containerWidth = parsePercent(retrieveValue(layoutInfo.width, size[0]), refContainer.width);\n    var containerHeight = parsePercent(retrieveValue(layoutInfo.height, size[1]), refContainer.height);\n    // Fetch payload info.\n    var payloadType = payload && payload.type;\n    var types = ['treemapZoomToNode', 'treemapRootToNode'];\n    var targetInfo = helper.retrieveTargetInfo(payload, types, seriesModel);\n    var rootRect = payloadType === 'treemapRender' || payloadType === 'treemapMove' ? payload.rootRect : null;\n    var viewRoot = seriesModel.getViewRoot();\n    var viewAbovePath = helper.getPathToRoot(viewRoot);\n    if (payloadType !== 'treemapMove') {\n      var rootSize = payloadType === 'treemapZoomToNode' ? estimateRootSize(seriesModel, targetInfo, viewRoot, containerWidth, containerHeight) : rootRect ? [rootRect.width, rootRect.height] : [containerWidth, containerHeight];\n      var sort_1 = seriesOption.sort;\n      if (sort_1 && sort_1 !== 'asc' && sort_1 !== 'desc') {\n        // Default to be desc order.\n        sort_1 = 'desc';\n      }\n      var options = {\n        squareRatio: seriesOption.squareRatio,\n        sort: sort_1,\n        leafDepth: seriesOption.leafDepth\n      };\n      // layout should be cleared because using updateView but not update.\n      viewRoot.hostTree.clearLayouts();\n      // TODO\n      // optimize: if out of view clip, do not layout.\n      // But take care that if do not render node out of view clip,\n      // how to calculate start po\n      var viewRootLayout_1 = {\n        x: 0,\n        y: 0,\n        width: rootSize[0],\n        height: rootSize[1],\n        area: rootSize[0] * rootSize[1]\n      };\n      viewRoot.setLayout(viewRootLayout_1);\n      squarify(viewRoot, options, false, 0);\n      // Supplement layout.\n      viewRootLayout_1 = viewRoot.getLayout();\n      each(viewAbovePath, function (node, index) {\n        var childValue = (viewAbovePath[index + 1] || viewRoot).getValue();\n        node.setLayout(zrUtil.extend({\n          dataExtent: [childValue, childValue],\n          borderWidth: 0,\n          upperHeight: 0\n        }, viewRootLayout_1));\n      });\n    }\n    var treeRoot = seriesModel.getData().tree.root;\n    treeRoot.setLayout(calculateRootPosition(layoutInfo, rootRect, targetInfo), true);\n    seriesModel.setLayoutInfo(layoutInfo);\n    // FIXME: narrow down pruning boungding rect.\n    // Currently ec width/height is used becuases clip is not supported.\n    prunning(treeRoot,\n    // Transform to base element coordinate system.\n    new BoundingRect(-layoutInfo.x, -layoutInfo.y, api.getWidth(), api.getHeight()), viewAbovePath, viewRoot, 0);\n  }\n};\n/**\n * Layout treemap with squarify algorithm.\n * The original presentation of this algorithm\n * was made by Mark Bruls, Kees Huizing, and Jarke J. van Wijk\n * <https://graphics.ethz.ch/teaching/scivis_common/Literature/squarifiedTreeMaps.pdf>.\n * The implementation of this algorithm was originally copied from \"d3.js\"\n * <https://github.com/d3/d3/blob/9cc9a875e636a1dcf36cc1e07bdf77e1ad6e2c74/src/layout/treemap.js>\n * with some modifications made for this program.\n * See the license statement at the head of this file.\n *\n * @protected\n * @param {module:echarts/data/Tree~TreeNode} node\n * @param {Object} options\n * @param {string} options.sort 'asc' or 'desc'\n * @param {number} options.squareRatio\n * @param {boolean} hideChildren\n * @param {number} depth\n */\nfunction squarify(node, options, hideChildren, depth) {\n  var width;\n  var height;\n  if (node.isRemoved()) {\n    return;\n  }\n  var thisLayout = node.getLayout();\n  width = thisLayout.width;\n  height = thisLayout.height;\n  // Considering border and gap\n  var nodeModel = node.getModel();\n  var borderWidth = nodeModel.get(PATH_BORDER_WIDTH);\n  var halfGapWidth = nodeModel.get(PATH_GAP_WIDTH) / 2;\n  var upperLabelHeight = getUpperLabelHeight(nodeModel);\n  var upperHeight = Math.max(borderWidth, upperLabelHeight);\n  var layoutOffset = borderWidth - halfGapWidth;\n  var layoutOffsetUpper = upperHeight - halfGapWidth;\n  node.setLayout({\n    borderWidth: borderWidth,\n    upperHeight: upperHeight,\n    upperLabelHeight: upperLabelHeight\n  }, true);\n  width = mathMax(width - 2 * layoutOffset, 0);\n  height = mathMax(height - layoutOffset - layoutOffsetUpper, 0);\n  var totalArea = width * height;\n  var viewChildren = initChildren(node, nodeModel, totalArea, options, hideChildren, depth);\n  if (!viewChildren.length) {\n    return;\n  }\n  var rect = {\n    x: layoutOffset,\n    y: layoutOffsetUpper,\n    width: width,\n    height: height\n  };\n  var rowFixedLength = mathMin(width, height);\n  var best = Infinity; // the best row score so far\n  var row = [];\n  row.area = 0;\n  for (var i = 0, len = viewChildren.length; i < len;) {\n    var child = viewChildren[i];\n    row.push(child);\n    row.area += child.getLayout().area;\n    var score = worst(row, rowFixedLength, options.squareRatio);\n    // continue with this orientation\n    if (score <= best) {\n      i++;\n      best = score;\n    }\n    // abort, and try a different orientation\n    else {\n      row.area -= row.pop().getLayout().area;\n      position(row, rowFixedLength, rect, halfGapWidth, false);\n      rowFixedLength = mathMin(rect.width, rect.height);\n      row.length = row.area = 0;\n      best = Infinity;\n    }\n  }\n  if (row.length) {\n    position(row, rowFixedLength, rect, halfGapWidth, true);\n  }\n  if (!hideChildren) {\n    var childrenVisibleMin = nodeModel.get('childrenVisibleMin');\n    if (childrenVisibleMin != null && totalArea < childrenVisibleMin) {\n      hideChildren = true;\n    }\n  }\n  for (var i = 0, len = viewChildren.length; i < len; i++) {\n    squarify(viewChildren[i], options, hideChildren, depth + 1);\n  }\n}\n/**\n * Set area to each child, and calculate data extent for visual coding.\n */\nfunction initChildren(node, nodeModel, totalArea, options, hideChildren, depth) {\n  var viewChildren = node.children || [];\n  var orderBy = options.sort;\n  orderBy !== 'asc' && orderBy !== 'desc' && (orderBy = null);\n  var overLeafDepth = options.leafDepth != null && options.leafDepth <= depth;\n  // leafDepth has higher priority.\n  if (hideChildren && !overLeafDepth) {\n    return node.viewChildren = [];\n  }\n  // Sort children, order by desc.\n  viewChildren = zrUtil.filter(viewChildren, function (child) {\n    return !child.isRemoved();\n  });\n  sort(viewChildren, orderBy);\n  var info = statistic(nodeModel, viewChildren, orderBy);\n  if (info.sum === 0) {\n    return node.viewChildren = [];\n  }\n  info.sum = filterByThreshold(nodeModel, totalArea, info.sum, orderBy, viewChildren);\n  if (info.sum === 0) {\n    return node.viewChildren = [];\n  }\n  // Set area to each child.\n  for (var i = 0, len = viewChildren.length; i < len; i++) {\n    var area = viewChildren[i].getValue() / info.sum * totalArea;\n    // Do not use setLayout({...}, true), because it is needed to clear last layout.\n    viewChildren[i].setLayout({\n      area: area\n    });\n  }\n  if (overLeafDepth) {\n    viewChildren.length && node.setLayout({\n      isLeafRoot: true\n    }, true);\n    viewChildren.length = 0;\n  }\n  node.viewChildren = viewChildren;\n  node.setLayout({\n    dataExtent: info.dataExtent\n  }, true);\n  return viewChildren;\n}\n/**\n * Consider 'visibleMin'. Modify viewChildren and get new sum.\n */\nfunction filterByThreshold(nodeModel, totalArea, sum, orderBy, orderedChildren) {\n  // visibleMin is not supported yet when no option.sort.\n  if (!orderBy) {\n    return sum;\n  }\n  var visibleMin = nodeModel.get('visibleMin');\n  var len = orderedChildren.length;\n  var deletePoint = len;\n  // Always travel from little value to big value.\n  for (var i = len - 1; i >= 0; i--) {\n    var value = orderedChildren[orderBy === 'asc' ? len - i - 1 : i].getValue();\n    if (value / sum * totalArea < visibleMin) {\n      deletePoint = i;\n      sum -= value;\n    }\n  }\n  orderBy === 'asc' ? orderedChildren.splice(0, len - deletePoint) : orderedChildren.splice(deletePoint, len - deletePoint);\n  return sum;\n}\n/**\n * Sort\n */\nfunction sort(viewChildren, orderBy) {\n  if (orderBy) {\n    viewChildren.sort(function (a, b) {\n      var diff = orderBy === 'asc' ? a.getValue() - b.getValue() : b.getValue() - a.getValue();\n      return diff === 0 ? orderBy === 'asc' ? a.dataIndex - b.dataIndex : b.dataIndex - a.dataIndex : diff;\n    });\n  }\n  return viewChildren;\n}\n/**\n * Statistic\n */\nfunction statistic(nodeModel, children, orderBy) {\n  // Calculate sum.\n  var sum = 0;\n  for (var i = 0, len = children.length; i < len; i++) {\n    sum += children[i].getValue();\n  }\n  // Statistic data extent for latter visual coding.\n  // Notice: data extent should be calculate based on raw children\n  // but not filtered view children, otherwise visual mapping will not\n  // be stable when zoom (where children is filtered by visibleMin).\n  var dimension = nodeModel.get('visualDimension');\n  var dataExtent;\n  // The same as area dimension.\n  if (!children || !children.length) {\n    dataExtent = [NaN, NaN];\n  } else if (dimension === 'value' && orderBy) {\n    dataExtent = [children[children.length - 1].getValue(), children[0].getValue()];\n    orderBy === 'asc' && dataExtent.reverse();\n  }\n  // Other dimension.\n  else {\n    dataExtent = [Infinity, -Infinity];\n    each(children, function (child) {\n      var value = child.getValue(dimension);\n      value < dataExtent[0] && (dataExtent[0] = value);\n      value > dataExtent[1] && (dataExtent[1] = value);\n    });\n  }\n  return {\n    sum: sum,\n    dataExtent: dataExtent\n  };\n}\n/**\n * Computes the score for the specified row,\n * as the worst aspect ratio.\n */\nfunction worst(row, rowFixedLength, ratio) {\n  var areaMax = 0;\n  var areaMin = Infinity;\n  for (var i = 0, area = void 0, len = row.length; i < len; i++) {\n    area = row[i].getLayout().area;\n    if (area) {\n      area < areaMin && (areaMin = area);\n      area > areaMax && (areaMax = area);\n    }\n  }\n  var squareArea = row.area * row.area;\n  var f = rowFixedLength * rowFixedLength * ratio;\n  return squareArea ? mathMax(f * areaMax / squareArea, squareArea / (f * areaMin)) : Infinity;\n}\n/**\n * Positions the specified row of nodes. Modifies `rect`.\n */\nfunction position(row, rowFixedLength, rect, halfGapWidth, flush) {\n  // When rowFixedLength === rect.width,\n  // it is horizontal subdivision,\n  // rowFixedLength is the width of the subdivision,\n  // rowOtherLength is the height of the subdivision,\n  // and nodes will be positioned from left to right.\n  // wh[idx0WhenH] means: when horizontal,\n  //      wh[idx0WhenH] => wh[0] => 'width'.\n  //      xy[idx1WhenH] => xy[1] => 'y'.\n  var idx0WhenH = rowFixedLength === rect.width ? 0 : 1;\n  var idx1WhenH = 1 - idx0WhenH;\n  var xy = ['x', 'y'];\n  var wh = ['width', 'height'];\n  var last = rect[xy[idx0WhenH]];\n  var rowOtherLength = rowFixedLength ? row.area / rowFixedLength : 0;\n  if (flush || rowOtherLength > rect[wh[idx1WhenH]]) {\n    rowOtherLength = rect[wh[idx1WhenH]]; // over+underflow\n  }\n  for (var i = 0, rowLen = row.length; i < rowLen; i++) {\n    var node = row[i];\n    var nodeLayout = {};\n    var step = rowOtherLength ? node.getLayout().area / rowOtherLength : 0;\n    var wh1 = nodeLayout[wh[idx1WhenH]] = mathMax(rowOtherLength - 2 * halfGapWidth, 0);\n    // We use Math.max/min to avoid negative width/height when considering gap width.\n    var remain = rect[xy[idx0WhenH]] + rect[wh[idx0WhenH]] - last;\n    var modWH = i === rowLen - 1 || remain < step ? remain : step;\n    var wh0 = nodeLayout[wh[idx0WhenH]] = mathMax(modWH - 2 * halfGapWidth, 0);\n    nodeLayout[xy[idx1WhenH]] = rect[xy[idx1WhenH]] + mathMin(halfGapWidth, wh1 / 2);\n    nodeLayout[xy[idx0WhenH]] = last + mathMin(halfGapWidth, wh0 / 2);\n    last += modWH;\n    node.setLayout(nodeLayout, true);\n  }\n  rect[xy[idx1WhenH]] += rowOtherLength;\n  rect[wh[idx1WhenH]] -= rowOtherLength;\n}\n// Return [containerWidth, containerHeight] as default.\nfunction estimateRootSize(seriesModel, targetInfo, viewRoot, containerWidth, containerHeight) {\n  // If targetInfo.node exists, we zoom to the node,\n  // so estimate whole width and height by target node.\n  var currNode = (targetInfo || {}).node;\n  var defaultSize = [containerWidth, containerHeight];\n  if (!currNode || currNode === viewRoot) {\n    return defaultSize;\n  }\n  var parent;\n  var viewArea = containerWidth * containerHeight;\n  var area = viewArea * seriesModel.option.zoomToNodeRatio;\n  while (parent = currNode.parentNode) {\n    // jshint ignore:line\n    var sum = 0;\n    var siblings = parent.children;\n    for (var i = 0, len = siblings.length; i < len; i++) {\n      sum += siblings[i].getValue();\n    }\n    var currNodeValue = currNode.getValue();\n    if (currNodeValue === 0) {\n      return defaultSize;\n    }\n    area *= sum / currNodeValue;\n    // Considering border, suppose aspect ratio is 1.\n    var parentModel = parent.getModel();\n    var borderWidth = parentModel.get(PATH_BORDER_WIDTH);\n    var upperHeight = Math.max(borderWidth, getUpperLabelHeight(parentModel));\n    area += 4 * borderWidth * borderWidth + (3 * borderWidth + upperHeight) * Math.pow(area, 0.5);\n    area > MAX_SAFE_INTEGER && (area = MAX_SAFE_INTEGER);\n    currNode = parent;\n  }\n  area < viewArea && (area = viewArea);\n  var scale = Math.pow(area / viewArea, 0.5);\n  return [containerWidth * scale, containerHeight * scale];\n}\n// Root position based on coord of containerGroup\nfunction calculateRootPosition(layoutInfo, rootRect, targetInfo) {\n  if (rootRect) {\n    return {\n      x: rootRect.x,\n      y: rootRect.y\n    };\n  }\n  var defaultPosition = {\n    x: 0,\n    y: 0\n  };\n  if (!targetInfo) {\n    return defaultPosition;\n  }\n  // If targetInfo is fetched by 'retrieveTargetInfo',\n  // old tree and new tree are the same tree,\n  // so the node still exists and we can visit it.\n  var targetNode = targetInfo.node;\n  var layout = targetNode.getLayout();\n  if (!layout) {\n    return defaultPosition;\n  }\n  // Transform coord from local to container.\n  var targetCenter = [layout.width / 2, layout.height / 2];\n  var node = targetNode;\n  while (node) {\n    var nodeLayout = node.getLayout();\n    targetCenter[0] += nodeLayout.x;\n    targetCenter[1] += nodeLayout.y;\n    node = node.parentNode;\n  }\n  return {\n    x: layoutInfo.width / 2 - targetCenter[0],\n    y: layoutInfo.height / 2 - targetCenter[1]\n  };\n}\n// Mark nodes visible for prunning when visual coding and rendering.\n// Prunning depends on layout and root position, so we have to do it after layout.\nfunction prunning(node, clipRect, viewAbovePath, viewRoot, depth) {\n  var nodeLayout = node.getLayout();\n  var nodeInViewAbovePath = viewAbovePath[depth];\n  var isAboveViewRoot = nodeInViewAbovePath && nodeInViewAbovePath === node;\n  if (nodeInViewAbovePath && !isAboveViewRoot || depth === viewAbovePath.length && node !== viewRoot) {\n    return;\n  }\n  node.setLayout({\n    // isInView means: viewRoot sub tree + viewAbovePath\n    isInView: true,\n    // invisible only means: outside view clip so that the node can not\n    // see but still layout for animation preparation but not render.\n    invisible: !isAboveViewRoot && !clipRect.intersect(nodeLayout),\n    isAboveViewRoot: isAboveViewRoot\n  }, true);\n  // Transform to child coordinate.\n  var childClipRect = new BoundingRect(clipRect.x - nodeLayout.x, clipRect.y - nodeLayout.y, clipRect.width, clipRect.height);\n  each(node.viewChildren || [], function (child) {\n    prunning(child, childClipRect, viewAbovePath, viewRoot, depth + 1);\n  });\n}\nfunction getUpperLabelHeight(model) {\n  return model.get(PATH_UPPER_LABEL_SHOW) ? model.get(PATH_UPPER_LABEL_HEIGHT) : 0;\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { installTreemapAction } from './treemapAction.js';\nimport TreemapSeriesModel from './TreemapSeries.js';\nimport TreemapView from './TreemapView.js';\nimport treemapVisual from './treemapVisual.js';\nimport treemapLayout from './treemapLayout.js';\nexport function install(registers) {\n  registers.registerSeriesModel(TreemapSeriesModel);\n  registers.registerChartView(TreemapView);\n  registers.registerVisual(treemapVisual);\n  registers.registerLayout(treemapLayout);\n  installTreemapAction(registers);\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { isNumber } from 'zrender/lib/core/util.js';\nexport default function categoryFilter(ecModel) {\n  var legendModels = ecModel.findComponents({\n    mainType: 'legend'\n  });\n  if (!legendModels || !legendModels.length) {\n    return;\n  }\n  ecModel.eachSeriesByType('graph', function (graphSeries) {\n    var categoriesData = graphSeries.getCategoriesData();\n    var graph = graphSeries.getGraph();\n    var data = graph.data;\n    var categoryNames = categoriesData.mapArray(categoriesData.getName);\n    data.filterSelf(function (idx) {\n      var model = data.getItemModel(idx);\n      var category = model.getShallow('category');\n      if (category != null) {\n        if (isNumber(category)) {\n          category = categoryNames[category];\n        }\n        // If in any legend component the status is not selected.\n        for (var i = 0; i < legendModels.length; i++) {\n          if (!legendModels[i].isSelected(category)) {\n            return false;\n          }\n        }\n      }\n      return true;\n    });\n  });\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { extend, isString } from 'zrender/lib/core/util.js';\nexport default function categoryVisual(ecModel) {\n  var paletteScope = {};\n  ecModel.eachSeriesByType('graph', function (seriesModel) {\n    var categoriesData = seriesModel.getCategoriesData();\n    var data = seriesModel.getData();\n    var categoryNameIdxMap = {};\n    categoriesData.each(function (idx) {\n      var name = categoriesData.getName(idx);\n      // Add prefix to avoid conflict with Object.prototype.\n      categoryNameIdxMap['ec-' + name] = idx;\n      var itemModel = categoriesData.getItemModel(idx);\n      var style = itemModel.getModel('itemStyle').getItemStyle();\n      if (!style.fill) {\n        // Get color from palette.\n        style.fill = seriesModel.getColorFromPalette(name, paletteScope);\n      }\n      categoriesData.setItemVisual(idx, 'style', style);\n      var symbolVisualList = ['symbol', 'symbolSize', 'symbolKeepAspect'];\n      for (var i = 0; i < symbolVisualList.length; i++) {\n        var symbolVisual = itemModel.getShallow(symbolVisualList[i], true);\n        if (symbolVisual != null) {\n          categoriesData.setItemVisual(idx, symbolVisualList[i], symbolVisual);\n        }\n      }\n    });\n    // Assign category color to visual\n    if (categoriesData.count()) {\n      data.each(function (idx) {\n        var model = data.getItemModel(idx);\n        var categoryIdx = model.getShallow('category');\n        if (categoryIdx != null) {\n          if (isString(categoryIdx)) {\n            categoryIdx = categoryNameIdxMap['ec-' + categoryIdx];\n          }\n          var categoryStyle = categoriesData.getItemVisual(categoryIdx, 'style');\n          var style = data.ensureUniqueItemVisual(idx, 'style');\n          extend(style, categoryStyle);\n          var visualList = ['symbol', 'symbolSize', 'symbolKeepAspect'];\n          for (var i = 0; i < visualList.length; i++) {\n            data.setItemVisual(idx, visualList[i], categoriesData.getItemVisual(categoryIdx, visualList[i]));\n          }\n        }\n      });\n    }\n  });\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { extend } from 'zrender/lib/core/util.js';\nfunction normalize(a) {\n  if (!(a instanceof Array)) {\n    a = [a, a];\n  }\n  return a;\n}\nexport default function graphEdgeVisual(ecModel) {\n  ecModel.eachSeriesByType('graph', function (seriesModel) {\n    var graph = seriesModel.getGraph();\n    var edgeData = seriesModel.getEdgeData();\n    var symbolType = normalize(seriesModel.get('edgeSymbol'));\n    var symbolSize = normalize(seriesModel.get('edgeSymbolSize'));\n    // const colorQuery = ['lineStyle', 'color'] as const;\n    // const opacityQuery = ['lineStyle', 'opacity'] as const;\n    edgeData.setVisual('fromSymbol', symbolType && symbolType[0]);\n    edgeData.setVisual('toSymbol', symbolType && symbolType[1]);\n    edgeData.setVisual('fromSymbolSize', symbolSize && symbolSize[0]);\n    edgeData.setVisual('toSymbolSize', symbolSize && symbolSize[1]);\n    edgeData.setVisual('style', seriesModel.getModel('lineStyle').getLineStyle());\n    edgeData.each(function (idx) {\n      var itemModel = edgeData.getItemModel(idx);\n      var edge = graph.getEdgeByIndex(idx);\n      var symbolType = normalize(itemModel.getShallow('symbol', true));\n      var symbolSize = normalize(itemModel.getShallow('symbolSize', true));\n      // Edge visual must after node visual\n      var style = itemModel.getModel('lineStyle').getLineStyle();\n      var existsStyle = edgeData.ensureUniqueItemVisual(idx, 'style');\n      extend(existsStyle, style);\n      switch (existsStyle.stroke) {\n        case 'source':\n          {\n            var nodeStyle = edge.node1.getVisual('style');\n            existsStyle.stroke = nodeStyle && nodeStyle.fill;\n            break;\n          }\n        case 'target':\n          {\n            var nodeStyle = edge.node2.getVisual('style');\n            existsStyle.stroke = nodeStyle && nodeStyle.fill;\n            break;\n          }\n      }\n      symbolType[0] && edge.setVisual('fromSymbol', symbolType[0]);\n      symbolType[1] && edge.setVisual('toSymbol', symbolType[1]);\n      symbolSize[0] && edge.setVisual('fromSymbolSize', symbolSize[0]);\n      symbolSize[1] && edge.setVisual('toSymbolSize', symbolSize[1]);\n    });\n  });\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n// @ts-nocheck\nimport * as zrUtil from 'zrender/lib/core/util.js';\nvar KEY_DELIMITER = '-->';\n/**\n * params handler\n * @param {module:echarts/model/SeriesModel} seriesModel\n * @returns {*}\n */\nvar getAutoCurvenessParams = function (seriesModel) {\n  return seriesModel.get('autoCurveness') || null;\n};\n/**\n * Generate a list of edge curvatures, 20 is the default\n * @param {module:echarts/model/SeriesModel} seriesModel\n * @param {number} appendLength\n * @return  20 => [0, -0.2, 0.2, -0.4, 0.4, -0.6, 0.6, -0.8, 0.8, -1, 1, -1.2, 1.2, -1.4, 1.4, -1.6, 1.6, -1.8, 1.8, -2]\n */\nvar createCurveness = function (seriesModel, appendLength) {\n  var autoCurvenessParmas = getAutoCurvenessParams(seriesModel);\n  var length = 20;\n  var curvenessList = [];\n  // handler the function set\n  if (zrUtil.isNumber(autoCurvenessParmas)) {\n    length = autoCurvenessParmas;\n  } else if (zrUtil.isArray(autoCurvenessParmas)) {\n    seriesModel.__curvenessList = autoCurvenessParmas;\n    return;\n  }\n  // append length\n  if (appendLength > length) {\n    length = appendLength;\n  }\n  // make sure the length is even\n  var len = length % 2 ? length + 2 : length + 3;\n  curvenessList = [];\n  for (var i = 0; i < len; i++) {\n    curvenessList.push((i % 2 ? i + 1 : i) / 10 * (i % 2 ? -1 : 1));\n  }\n  seriesModel.__curvenessList = curvenessList;\n};\n/**\n * Create different cache key data in the positive and negative directions, in order to set the curvature later\n * @param {number|string|module:echarts/data/Graph.Node} n1\n * @param {number|string|module:echarts/data/Graph.Node} n2\n * @param {module:echarts/model/SeriesModel} seriesModel\n * @returns {string} key\n */\nvar getKeyOfEdges = function (n1, n2, seriesModel) {\n  var source = [n1.id, n1.dataIndex].join('.');\n  var target = [n2.id, n2.dataIndex].join('.');\n  return [seriesModel.uid, source, target].join(KEY_DELIMITER);\n};\n/**\n * get opposite key\n * @param {string} key\n * @returns {string}\n */\nvar getOppositeKey = function (key) {\n  var keys = key.split(KEY_DELIMITER);\n  return [keys[0], keys[2], keys[1]].join(KEY_DELIMITER);\n};\n/**\n * get edgeMap with key\n * @param edge\n * @param {module:echarts/model/SeriesModel} seriesModel\n */\nvar getEdgeFromMap = function (edge, seriesModel) {\n  var key = getKeyOfEdges(edge.node1, edge.node2, seriesModel);\n  return seriesModel.__edgeMap[key];\n};\n/**\n * calculate all cases total length\n * @param edge\n * @param seriesModel\n * @returns {number}\n */\nvar getTotalLengthBetweenNodes = function (edge, seriesModel) {\n  var len = getEdgeMapLengthWithKey(getKeyOfEdges(edge.node1, edge.node2, seriesModel), seriesModel);\n  var lenV = getEdgeMapLengthWithKey(getKeyOfEdges(edge.node2, edge.node1, seriesModel), seriesModel);\n  return len + lenV;\n};\n/**\n *\n * @param key\n */\nvar getEdgeMapLengthWithKey = function (key, seriesModel) {\n  var edgeMap = seriesModel.__edgeMap;\n  return edgeMap[key] ? edgeMap[key].length : 0;\n};\n/**\n * Count the number of edges between the same two points, used to obtain the curvature table and the parity of the edge\n * @see /graph/GraphSeries.js@getInitialData\n * @param {module:echarts/model/SeriesModel} seriesModel\n */\nexport function initCurvenessList(seriesModel) {\n  if (!getAutoCurvenessParams(seriesModel)) {\n    return;\n  }\n  seriesModel.__curvenessList = [];\n  seriesModel.__edgeMap = {};\n  // calc the array of curveness List\n  createCurveness(seriesModel);\n}\n/**\n * set edgeMap with key\n * @param {number|string|module:echarts/data/Graph.Node} n1\n * @param {number|string|module:echarts/data/Graph.Node} n2\n * @param {module:echarts/model/SeriesModel} seriesModel\n * @param {number} index\n */\nexport function createEdgeMapForCurveness(n1, n2, seriesModel, index) {\n  if (!getAutoCurvenessParams(seriesModel)) {\n    return;\n  }\n  var key = getKeyOfEdges(n1, n2, seriesModel);\n  var edgeMap = seriesModel.__edgeMap;\n  var oppositeEdges = edgeMap[getOppositeKey(key)];\n  // set direction\n  if (edgeMap[key] && !oppositeEdges) {\n    edgeMap[key].isForward = true;\n  } else if (oppositeEdges && edgeMap[key]) {\n    oppositeEdges.isForward = true;\n    edgeMap[key].isForward = false;\n  }\n  edgeMap[key] = edgeMap[key] || [];\n  edgeMap[key].push(index);\n}\n/**\n * get curvature for edge\n * @param edge\n * @param {module:echarts/model/SeriesModel} seriesModel\n * @param index\n */\nexport function getCurvenessForEdge(edge, seriesModel, index, needReverse) {\n  var autoCurvenessParams = getAutoCurvenessParams(seriesModel);\n  var isArrayParam = zrUtil.isArray(autoCurvenessParams);\n  if (!autoCurvenessParams) {\n    return null;\n  }\n  var edgeArray = getEdgeFromMap(edge, seriesModel);\n  if (!edgeArray) {\n    return null;\n  }\n  var edgeIndex = -1;\n  for (var i = 0; i < edgeArray.length; i++) {\n    if (edgeArray[i] === index) {\n      edgeIndex = i;\n      break;\n    }\n  }\n  // if totalLen is Longer createCurveness\n  var totalLen = getTotalLengthBetweenNodes(edge, seriesModel);\n  createCurveness(seriesModel, totalLen);\n  edge.lineStyle = edge.lineStyle || {};\n  // if is opposite edge, must set curvenss to opposite number\n  var curKey = getKeyOfEdges(edge.node1, edge.node2, seriesModel);\n  var curvenessList = seriesModel.__curvenessList;\n  // if pass array no need parity\n  var parityCorrection = isArrayParam ? 0 : totalLen % 2 ? 0 : 1;\n  if (!edgeArray.isForward) {\n    // the opposite edge show outside\n    var oppositeKey = getOppositeKey(curKey);\n    var len = getEdgeMapLengthWithKey(oppositeKey, seriesModel);\n    var resValue = curvenessList[edgeIndex + len + parityCorrection];\n    // isNeedReverse, simple, force type need reverse the curveness in the junction of the forword and the opposite\n    if (needReverse) {\n      // set as array may make the parity handle with the len of opposite\n      if (isArrayParam) {\n        if (autoCurvenessParams && autoCurvenessParams[0] === 0) {\n          return (len + parityCorrection) % 2 ? resValue : -resValue;\n        } else {\n          return ((len % 2 ? 0 : 1) + parityCorrection) % 2 ? resValue : -resValue;\n        }\n      } else {\n        return (len + parityCorrection) % 2 ? resValue : -resValue;\n      }\n    } else {\n      return curvenessList[edgeIndex + len + parityCorrection];\n    }\n  } else {\n    return curvenessList[parityCorrection + edgeIndex];\n  }\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as vec2 from 'zrender/lib/core/vector.js';\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { getCurvenessForEdge } from '../helper/multipleGraphEdgeHelper.js';\nexport function simpleLayout(seriesModel) {\n  var coordSys = seriesModel.coordinateSystem;\n  if (coordSys && coordSys.type !== 'view') {\n    return;\n  }\n  var graph = seriesModel.getGraph();\n  graph.eachNode(function (node) {\n    var model = node.getModel();\n    node.setLayout([+model.get('x'), +model.get('y')]);\n  });\n  simpleLayoutEdge(graph, seriesModel);\n}\nexport function simpleLayoutEdge(graph, seriesModel) {\n  graph.eachEdge(function (edge, index) {\n    var curveness = zrUtil.retrieve3(edge.getModel().get(['lineStyle', 'curveness']), -getCurvenessForEdge(edge, seriesModel, index, true), 0);\n    var p1 = vec2.clone(edge.node1.getLayout());\n    var p2 = vec2.clone(edge.node2.getLayout());\n    var points = [p1, p2];\n    if (+curveness) {\n      points.push([(p1[0] + p2[0]) / 2 - (p1[1] - p2[1]) * curveness, (p1[1] + p2[1]) / 2 - (p2[0] - p1[0]) * curveness]);\n    }\n    edge.setLayout(points);\n  });\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { each } from 'zrender/lib/core/util.js';\nimport { simpleLayout, simpleLayoutEdge } from './simpleLayoutHelper.js';\nexport default function graphSimpleLayout(ecModel, api) {\n  ecModel.eachSeriesByType('graph', function (seriesModel) {\n    var layout = seriesModel.get('layout');\n    var coordSys = seriesModel.coordinateSystem;\n    if (coordSys && coordSys.type !== 'view') {\n      var data_1 = seriesModel.getData();\n      var dimensions_1 = [];\n      each(coordSys.dimensions, function (coordDim) {\n        dimensions_1 = dimensions_1.concat(data_1.mapDimensionsAll(coordDim));\n      });\n      for (var dataIndex = 0; dataIndex < data_1.count(); dataIndex++) {\n        var value = [];\n        var hasValue = false;\n        for (var i = 0; i < dimensions_1.length; i++) {\n          var val = data_1.get(dimensions_1[i], dataIndex);\n          if (!isNaN(val)) {\n            hasValue = true;\n          }\n          value.push(val);\n        }\n        if (hasValue) {\n          data_1.setItemLayout(dataIndex, coordSys.dataToPoint(value));\n        } else {\n          // Also {Array.<number>}, not undefined to avoid if...else... statement\n          data_1.setItemLayout(dataIndex, [NaN, NaN]);\n        }\n      }\n      simpleLayoutEdge(data_1.graph, seriesModel);\n    } else if (!layout || layout === 'none') {\n      simpleLayout(seriesModel);\n    }\n  });\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nexport function getNodeGlobalScale(seriesModel) {\n  var coordSys = seriesModel.coordinateSystem;\n  if (coordSys.type !== 'view') {\n    return 1;\n  }\n  var nodeScaleRatio = seriesModel.option.nodeScaleRatio;\n  var groupZoom = coordSys.scaleX;\n  // Scale node when zoom changes\n  var roamZoom = coordSys.getZoom();\n  var nodeScale = (roamZoom - 1) * nodeScaleRatio + 1;\n  return nodeScale / groupZoom;\n}\nexport function getSymbolSize(node) {\n  var symbolSize = node.getVisual('symbolSize');\n  if (symbolSize instanceof Array) {\n    symbolSize = (symbolSize[0] + symbolSize[1]) / 2;\n  }\n  return +symbolSize;\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as vec2 from 'zrender/lib/core/vector.js';\nimport { getSymbolSize, getNodeGlobalScale } from './graphHelper.js';\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { getCurvenessForEdge } from '../helper/multipleGraphEdgeHelper.js';\nvar PI = Math.PI;\nvar _symbolRadiansHalf = [];\n/**\n * `basedOn` can be:\n * 'value':\n *     This layout is not accurate and have same bad case. For example,\n *     if the min value is very smaller than the max value, the nodes\n *     with the min value probably overlap even though there is enough\n *     space to layout them. So we only use this approach in the as the\n *     init layout of the force layout.\n *     FIXME\n *     Probably we do not need this method any more but use\n *     `basedOn: 'symbolSize'` in force layout if\n *     delay its init operations to GraphView.\n * 'symbolSize':\n *     This approach work only if all of the symbol size calculated.\n *     That is, the progressive rendering is not applied to graph.\n *     FIXME\n *     If progressive rendering is applied to graph some day,\n *     probably we have to use `basedOn: 'value'`.\n */\nexport function circularLayout(seriesModel, basedOn, draggingNode, pointer) {\n  var coordSys = seriesModel.coordinateSystem;\n  if (coordSys && coordSys.type !== 'view') {\n    return;\n  }\n  var rect = coordSys.getBoundingRect();\n  var nodeData = seriesModel.getData();\n  var graph = nodeData.graph;\n  var cx = rect.width / 2 + rect.x;\n  var cy = rect.height / 2 + rect.y;\n  var r = Math.min(rect.width, rect.height) / 2;\n  var count = nodeData.count();\n  nodeData.setLayout({\n    cx: cx,\n    cy: cy\n  });\n  if (!count) {\n    return;\n  }\n  if (draggingNode) {\n    var _a = coordSys.pointToData(pointer),\n      tempX = _a[0],\n      tempY = _a[1];\n    var v = [tempX - cx, tempY - cy];\n    vec2.normalize(v, v);\n    vec2.scale(v, v, r);\n    draggingNode.setLayout([cx + v[0], cy + v[1]], true);\n    var circularRotateLabel = seriesModel.get(['circular', 'rotateLabel']);\n    rotateNodeLabel(draggingNode, circularRotateLabel, cx, cy);\n  }\n  _layoutNodesBasedOn[basedOn](seriesModel, graph, nodeData, r, cx, cy, count);\n  graph.eachEdge(function (edge, index) {\n    var curveness = zrUtil.retrieve3(edge.getModel().get(['lineStyle', 'curveness']), getCurvenessForEdge(edge, seriesModel, index), 0);\n    var p1 = vec2.clone(edge.node1.getLayout());\n    var p2 = vec2.clone(edge.node2.getLayout());\n    var cp1;\n    var x12 = (p1[0] + p2[0]) / 2;\n    var y12 = (p1[1] + p2[1]) / 2;\n    if (+curveness) {\n      curveness *= 3;\n      cp1 = [cx * curveness + x12 * (1 - curveness), cy * curveness + y12 * (1 - curveness)];\n    }\n    edge.setLayout([p1, p2, cp1]);\n  });\n}\nvar _layoutNodesBasedOn = {\n  value: function (seriesModel, graph, nodeData, r, cx, cy, count) {\n    var angle = 0;\n    var sum = nodeData.getSum('value');\n    var unitAngle = Math.PI * 2 / (sum || count);\n    graph.eachNode(function (node) {\n      var value = node.getValue('value');\n      var radianHalf = unitAngle * (sum ? value : 1) / 2;\n      angle += radianHalf;\n      node.setLayout([r * Math.cos(angle) + cx, r * Math.sin(angle) + cy]);\n      angle += radianHalf;\n    });\n  },\n  symbolSize: function (seriesModel, graph, nodeData, r, cx, cy, count) {\n    var sumRadian = 0;\n    _symbolRadiansHalf.length = count;\n    var nodeScale = getNodeGlobalScale(seriesModel);\n    graph.eachNode(function (node) {\n      var symbolSize = getSymbolSize(node);\n      // Normally this case will not happen, but we still add\n      // some the defensive code (2px is an arbitrary value).\n      isNaN(symbolSize) && (symbolSize = 2);\n      symbolSize < 0 && (symbolSize = 0);\n      symbolSize *= nodeScale;\n      var symbolRadianHalf = Math.asin(symbolSize / 2 / r);\n      // when `symbolSize / 2` is bigger than `r`.\n      isNaN(symbolRadianHalf) && (symbolRadianHalf = PI / 2);\n      _symbolRadiansHalf[node.dataIndex] = symbolRadianHalf;\n      sumRadian += symbolRadianHalf * 2;\n    });\n    var halfRemainRadian = (2 * PI - sumRadian) / count / 2;\n    var angle = 0;\n    graph.eachNode(function (node) {\n      var radianHalf = halfRemainRadian + _symbolRadiansHalf[node.dataIndex];\n      angle += radianHalf;\n      // init circular layout for\n      // 1. layout undefined node\n      // 2. not fixed node\n      (!node.getLayout() || !node.getLayout().fixed) && node.setLayout([r * Math.cos(angle) + cx, r * Math.sin(angle) + cy]);\n      angle += radianHalf;\n    });\n  }\n};\nexport function rotateNodeLabel(node, circularRotateLabel, cx, cy) {\n  var el = node.getGraphicEl();\n  // need to check if el exists. '-' value may not create node element.\n  if (!el) {\n    return;\n  }\n  var nodeModel = node.getModel();\n  var labelRotate = nodeModel.get(['label', 'rotate']) || 0;\n  var symbolPath = el.getSymbolPath();\n  if (circularRotateLabel) {\n    var pos = node.getLayout();\n    var rad = Math.atan2(pos[1] - cy, pos[0] - cx);\n    if (rad < 0) {\n      rad = Math.PI * 2 + rad;\n    }\n    var isLeft = pos[0] < cx;\n    if (isLeft) {\n      rad = rad - Math.PI;\n    }\n    var textPosition = isLeft ? 'left' : 'right';\n    symbolPath.setTextConfig({\n      rotation: -rad,\n      position: textPosition,\n      origin: 'center'\n    });\n    var emphasisState = symbolPath.ensureState('emphasis');\n    zrUtil.extend(emphasisState.textConfig || (emphasisState.textConfig = {}), {\n      position: textPosition\n    });\n  } else {\n    symbolPath.setTextConfig({\n      rotation: labelRotate *= Math.PI / 180\n    });\n  }\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { circularLayout } from './circularLayoutHelper.js';\nexport default function graphCircularLayout(ecModel) {\n  ecModel.eachSeriesByType('graph', function (seriesModel) {\n    if (seriesModel.get('layout') === 'circular') {\n      circularLayout(seriesModel, 'symbolSize');\n    }\n  });\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n/*\n* A third-party license is embedded for some of the code in this file:\n* Some formulas were originally copied from \"d3.js\" with some\n* modifications made for this project.\n* (See more details in the comment of the method \"step\" below.)\n* The use of the source code of this file is also subject to the terms\n* and consitions of the license of \"d3.js\" (BSD-3Clause, see\n* </licenses/LICENSE-d3>).\n*/\nimport * as vec2 from 'zrender/lib/core/vector.js';\nvar scaleAndAdd = vec2.scaleAndAdd;\n// function adjacentNode(n, e) {\n//     return e.n1 === n ? e.n2 : e.n1;\n// }\nexport function forceLayout(inNodes, inEdges, opts) {\n  var nodes = inNodes;\n  var edges = inEdges;\n  var rect = opts.rect;\n  var width = rect.width;\n  var height = rect.height;\n  var center = [rect.x + width / 2, rect.y + height / 2];\n  // let scale = opts.scale || 1;\n  var gravity = opts.gravity == null ? 0.1 : opts.gravity;\n  // for (let i = 0; i < edges.length; i++) {\n  //     let e = edges[i];\n  //     let n1 = e.n1;\n  //     let n2 = e.n2;\n  //     n1.edges = n1.edges || [];\n  //     n2.edges = n2.edges || [];\n  //     n1.edges.push(e);\n  //     n2.edges.push(e);\n  // }\n  // Init position\n  for (var i = 0; i < nodes.length; i++) {\n    var n = nodes[i];\n    if (!n.p) {\n      n.p = vec2.create(width * (Math.random() - 0.5) + center[0], height * (Math.random() - 0.5) + center[1]);\n    }\n    n.pp = vec2.clone(n.p);\n    n.edges = null;\n  }\n  // Formula in 'Graph Drawing by Force-directed Placement'\n  // let k = scale * Math.sqrt(width * height / nodes.length);\n  // let k2 = k * k;\n  var initialFriction = opts.friction == null ? 0.6 : opts.friction;\n  var friction = initialFriction;\n  var beforeStepCallback;\n  var afterStepCallback;\n  return {\n    warmUp: function () {\n      friction = initialFriction * 0.8;\n    },\n    setFixed: function (idx) {\n      nodes[idx].fixed = true;\n    },\n    setUnfixed: function (idx) {\n      nodes[idx].fixed = false;\n    },\n    /**\n     * Before step hook\n     */\n    beforeStep: function (cb) {\n      beforeStepCallback = cb;\n    },\n    /**\n     * After step hook\n     */\n    afterStep: function (cb) {\n      afterStepCallback = cb;\n    },\n    /**\n     * Some formulas were originally copied from \"d3.js\"\n     * https://github.com/d3/d3/blob/b516d77fb8566b576088e73410437494717ada26/src/layout/force.js\n     * with some modifications made for this project.\n     * See the license statement at the head of this file.\n     */\n    step: function (cb) {\n      beforeStepCallback && beforeStepCallback(nodes, edges);\n      var v12 = [];\n      var nLen = nodes.length;\n      for (var i = 0; i < edges.length; i++) {\n        var e = edges[i];\n        if (e.ignoreForceLayout) {\n          continue;\n        }\n        var n1 = e.n1;\n        var n2 = e.n2;\n        vec2.sub(v12, n2.p, n1.p);\n        var d = vec2.len(v12) - e.d;\n        var w = n2.w / (n1.w + n2.w);\n        if (isNaN(w)) {\n          w = 0;\n        }\n        vec2.normalize(v12, v12);\n        !n1.fixed && scaleAndAdd(n1.p, n1.p, v12, w * d * friction);\n        !n2.fixed && scaleAndAdd(n2.p, n2.p, v12, -(1 - w) * d * friction);\n      }\n      // Gravity\n      for (var i = 0; i < nLen; i++) {\n        var n = nodes[i];\n        if (!n.fixed) {\n          vec2.sub(v12, center, n.p);\n          // let d = vec2.len(v12);\n          // vec2.scale(v12, v12, 1 / d);\n          // let gravityFactor = gravity;\n          scaleAndAdd(n.p, n.p, v12, gravity * friction);\n        }\n      }\n      // Repulsive\n      // PENDING\n      for (var i = 0; i < nLen; i++) {\n        var n1 = nodes[i];\n        for (var j = i + 1; j < nLen; j++) {\n          var n2 = nodes[j];\n          vec2.sub(v12, n2.p, n1.p);\n          var d = vec2.len(v12);\n          if (d === 0) {\n            // Random repulse\n            vec2.set(v12, Math.random() - 0.5, Math.random() - 0.5);\n            d = 1;\n          }\n          var repFact = (n1.rep + n2.rep) / d / d;\n          !n1.fixed && scaleAndAdd(n1.pp, n1.pp, v12, repFact);\n          !n2.fixed && scaleAndAdd(n2.pp, n2.pp, v12, -repFact);\n        }\n      }\n      var v = [];\n      for (var i = 0; i < nLen; i++) {\n        var n = nodes[i];\n        if (!n.fixed) {\n          vec2.sub(v, n.p, n.pp);\n          scaleAndAdd(n.p, n.p, v, friction);\n          vec2.copy(n.pp, n.p);\n        }\n      }\n      friction = friction * 0.992;\n      var finished = friction < 0.01;\n      afterStepCallback && afterStepCallback(nodes, edges, finished);\n      cb && cb(finished);\n    }\n  };\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { forceLayout } from './forceHelper.js';\nimport { simpleLayout } from './simpleLayoutHelper.js';\nimport { circularLayout } from './circularLayoutHelper.js';\nimport { linearMap } from '../../util/number.js';\nimport * as vec2 from 'zrender/lib/core/vector.js';\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { getCurvenessForEdge } from '../helper/multipleGraphEdgeHelper.js';\nexport default function graphForceLayout(ecModel) {\n  ecModel.eachSeriesByType('graph', function (graphSeries) {\n    var coordSys = graphSeries.coordinateSystem;\n    if (coordSys && coordSys.type !== 'view') {\n      return;\n    }\n    if (graphSeries.get('layout') === 'force') {\n      var preservedPoints_1 = graphSeries.preservedPoints || {};\n      var graph_1 = graphSeries.getGraph();\n      var nodeData_1 = graph_1.data;\n      var edgeData = graph_1.edgeData;\n      var forceModel = graphSeries.getModel('force');\n      var initLayout = forceModel.get('initLayout');\n      if (graphSeries.preservedPoints) {\n        nodeData_1.each(function (idx) {\n          var id = nodeData_1.getId(idx);\n          nodeData_1.setItemLayout(idx, preservedPoints_1[id] || [NaN, NaN]);\n        });\n      } else if (!initLayout || initLayout === 'none') {\n        simpleLayout(graphSeries);\n      } else if (initLayout === 'circular') {\n        circularLayout(graphSeries, 'value');\n      }\n      var nodeDataExtent_1 = nodeData_1.getDataExtent('value');\n      var edgeDataExtent_1 = edgeData.getDataExtent('value');\n      // let edgeDataExtent = edgeData.getDataExtent('value');\n      var repulsion = forceModel.get('repulsion');\n      var edgeLength = forceModel.get('edgeLength');\n      var repulsionArr_1 = zrUtil.isArray(repulsion) ? repulsion : [repulsion, repulsion];\n      var edgeLengthArr_1 = zrUtil.isArray(edgeLength) ? edgeLength : [edgeLength, edgeLength];\n      // Larger value has smaller length\n      edgeLengthArr_1 = [edgeLengthArr_1[1], edgeLengthArr_1[0]];\n      var nodes_1 = nodeData_1.mapArray('value', function (value, idx) {\n        var point = nodeData_1.getItemLayout(idx);\n        var rep = linearMap(value, nodeDataExtent_1, repulsionArr_1);\n        if (isNaN(rep)) {\n          rep = (repulsionArr_1[0] + repulsionArr_1[1]) / 2;\n        }\n        return {\n          w: rep,\n          rep: rep,\n          fixed: nodeData_1.getItemModel(idx).get('fixed'),\n          p: !point || isNaN(point[0]) || isNaN(point[1]) ? null : point\n        };\n      });\n      var edges = edgeData.mapArray('value', function (value, idx) {\n        var edge = graph_1.getEdgeByIndex(idx);\n        var d = linearMap(value, edgeDataExtent_1, edgeLengthArr_1);\n        if (isNaN(d)) {\n          d = (edgeLengthArr_1[0] + edgeLengthArr_1[1]) / 2;\n        }\n        var edgeModel = edge.getModel();\n        var curveness = zrUtil.retrieve3(edge.getModel().get(['lineStyle', 'curveness']), -getCurvenessForEdge(edge, graphSeries, idx, true), 0);\n        return {\n          n1: nodes_1[edge.node1.dataIndex],\n          n2: nodes_1[edge.node2.dataIndex],\n          d: d,\n          curveness: curveness,\n          ignoreForceLayout: edgeModel.get('ignoreForceLayout')\n        };\n      });\n      // let coordSys = graphSeries.coordinateSystem;\n      var rect = coordSys.getBoundingRect();\n      var forceInstance = forceLayout(nodes_1, edges, {\n        rect: rect,\n        gravity: forceModel.get('gravity'),\n        friction: forceModel.get('friction')\n      });\n      forceInstance.beforeStep(function (nodes, edges) {\n        for (var i = 0, l = nodes.length; i < l; i++) {\n          if (nodes[i].fixed) {\n            // Write back to layout instance\n            vec2.copy(nodes[i].p, graph_1.getNodeByIndex(i).getLayout());\n          }\n        }\n      });\n      forceInstance.afterStep(function (nodes, edges, stopped) {\n        for (var i = 0, l = nodes.length; i < l; i++) {\n          if (!nodes[i].fixed) {\n            graph_1.getNodeByIndex(i).setLayout(nodes[i].p);\n          }\n          preservedPoints_1[nodeData_1.getId(i)] = nodes[i].p;\n        }\n        for (var i = 0, l = edges.length; i < l; i++) {\n          var e = edges[i];\n          var edge = graph_1.getEdgeByIndex(i);\n          var p1 = e.n1.p;\n          var p2 = e.n2.p;\n          var points = edge.getLayout();\n          points = points ? points.slice() : [];\n          points[0] = points[0] || [];\n          points[1] = points[1] || [];\n          vec2.copy(points[0], p1);\n          vec2.copy(points[1], p2);\n          if (+e.curveness) {\n            points[2] = [(p1[0] + p2[0]) / 2 - (p1[1] - p2[1]) * e.curveness, (p1[1] + p2[1]) / 2 - (p2[0] - p1[0]) * e.curveness];\n          }\n          edge.setLayout(points);\n        }\n      });\n      graphSeries.forceLayout = forceInstance;\n      graphSeries.preservedPoints = preservedPoints_1;\n      // Step to get the layout\n      forceInstance.step();\n    } else {\n      // Remove prev injected forceLayout instance\n      graphSeries.forceLayout = null;\n    }\n  });\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n// FIXME Where to create the simple view coordinate system\nimport View from '../../coord/View.js';\nimport { createBoxLayoutReference, getLayoutRect, applyPreserveAspect } from '../../util/layout.js';\nimport * as bbox from 'zrender/lib/core/bbox.js';\nimport { extend } from 'zrender/lib/core/util.js';\nimport { injectCoordSysByOption } from '../../core/CoordinateSystem.js';\nfunction getViewRect(seriesModel, api, aspect) {\n  var layoutRef = createBoxLayoutReference(seriesModel, api);\n  var option = extend(seriesModel.getBoxLayoutParams(), {\n    aspect: aspect\n  });\n  var viewRect = getLayoutRect(option, layoutRef.refContainer);\n  return applyPreserveAspect(seriesModel, viewRect, aspect);\n}\nexport default function createViewCoordSys(ecModel, api) {\n  var viewList = [];\n  ecModel.eachSeriesByType('graph', function (seriesModel) {\n    injectCoordSysByOption({\n      targetModel: seriesModel,\n      coordSysType: 'view',\n      coordSysProvider: createViewCoordSys,\n      isDefaultDataCoordSys: true\n    });\n    function createViewCoordSys() {\n      var data = seriesModel.getData();\n      var positions = data.mapArray(function (idx) {\n        var itemModel = data.getItemModel(idx);\n        return [+itemModel.get('x'), +itemModel.get('y')];\n      });\n      var min = [];\n      var max = [];\n      bbox.fromPoints(positions, min, max);\n      // If width or height is 0\n      if (max[0] - min[0] === 0) {\n        max[0] += 1;\n        min[0] -= 1;\n      }\n      if (max[1] - min[1] === 0) {\n        max[1] += 1;\n        min[1] -= 1;\n      }\n      var aspect = (max[0] - min[0]) / (max[1] - min[1]);\n      // FIXME If get view rect after data processed?\n      var viewRect = getViewRect(seriesModel, api, aspect);\n      // Position may be NaN, use view rect instead\n      if (isNaN(aspect)) {\n        min = [viewRect.x, viewRect.y];\n        max = [viewRect.x + viewRect.width, viewRect.y + viewRect.height];\n      }\n      var bbWidth = max[0] - min[0];\n      var bbHeight = max[1] - min[1];\n      var viewCoordSys = new View(null, {\n        api: api,\n        ecModel: ecModel\n      });\n      viewCoordSys.zoomLimit = seriesModel.get('scaleLimit');\n      viewCoordSys.setBoundingRect(min[0], min[1], bbWidth, bbHeight);\n      viewCoordSys.setViewRect(viewRect.x, viewRect.y, viewRect.width, viewRect.height);\n      // Update roam info\n      viewCoordSys.setCenter(seriesModel.get('center'));\n      viewCoordSys.setZoom(seriesModel.get('zoom'));\n      viewList.push(viewCoordSys);\n      return viewCoordSys;\n    }\n  });\n  return viewList;\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\n/**\n * Line path for bezier and straight line draw\n */\nimport * as graphic from '../../util/graphic.js';\nimport * as vec2 from 'zrender/lib/core/vector.js';\nimport tokens from '../../visual/tokens.js';\nvar straightLineProto = graphic.Line.prototype;\nvar bezierCurveProto = graphic.BezierCurve.prototype;\nvar StraightLineShape = /** @class */function () {\n  function StraightLineShape() {\n    // Start point\n    this.x1 = 0;\n    this.y1 = 0;\n    // End point\n    this.x2 = 0;\n    this.y2 = 0;\n    this.percent = 1;\n  }\n  return StraightLineShape;\n}();\nvar CurveShape = /** @class */function (_super) {\n  __extends(CurveShape, _super);\n  function CurveShape() {\n    return _super !== null && _super.apply(this, arguments) || this;\n  }\n  return CurveShape;\n}(StraightLineShape);\nfunction isStraightLine(shape) {\n  return isNaN(+shape.cpx1) || isNaN(+shape.cpy1);\n}\nvar ECLinePath = /** @class */function (_super) {\n  __extends(ECLinePath, _super);\n  function ECLinePath(opts) {\n    var _this = _super.call(this, opts) || this;\n    _this.type = 'ec-line';\n    return _this;\n  }\n  ECLinePath.prototype.getDefaultStyle = function () {\n    return {\n      stroke: tokens.color.neutral99,\n      fill: null\n    };\n  };\n  ECLinePath.prototype.getDefaultShape = function () {\n    return new StraightLineShape();\n  };\n  ECLinePath.prototype.buildPath = function (ctx, shape) {\n    if (isStraightLine(shape)) {\n      straightLineProto.buildPath.call(this, ctx, shape);\n    } else {\n      bezierCurveProto.buildPath.call(this, ctx, shape);\n    }\n  };\n  ECLinePath.prototype.pointAt = function (t) {\n    if (isStraightLine(this.shape)) {\n      return straightLineProto.pointAt.call(this, t);\n    } else {\n      return bezierCurveProto.pointAt.call(this, t);\n    }\n  };\n  ECLinePath.prototype.tangentAt = function (t) {\n    var shape = this.shape;\n    var p = isStraightLine(shape) ? [shape.x2 - shape.x1, shape.y2 - shape.y1] : bezierCurveProto.tangentAt.call(this, t);\n    return vec2.normalize(p, p);\n  };\n  return ECLinePath;\n}(graphic.Path);\nexport default ECLinePath;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport { isArray, each, retrieve2 } from 'zrender/lib/core/util.js';\nimport * as vector from 'zrender/lib/core/vector.js';\nimport * as symbolUtil from '../../util/symbol.js';\nimport ECLinePath from './LinePath.js';\nimport * as graphic from '../../util/graphic.js';\nimport { toggleHoverEmphasis, enterEmphasis, leaveEmphasis, SPECIAL_STATES } from '../../util/states.js';\nimport { getLabelStatesModels, setLabelStyle } from '../../label/labelStyle.js';\nimport { round } from '../../util/number.js';\nimport tokens from '../../visual/tokens.js';\nvar SYMBOL_CATEGORIES = ['fromSymbol', 'toSymbol'];\nfunction makeSymbolTypeKey(symbolCategory) {\n  return '_' + symbolCategory + 'Type';\n}\nfunction makeSymbolTypeValue(name, lineData, idx) {\n  var symbolType = lineData.getItemVisual(idx, name);\n  if (!symbolType || symbolType === 'none') {\n    return symbolType;\n  }\n  var symbolSize = lineData.getItemVisual(idx, name + 'Size');\n  var symbolRotate = lineData.getItemVisual(idx, name + 'Rotate');\n  var symbolOffset = lineData.getItemVisual(idx, name + 'Offset');\n  var symbolKeepAspect = lineData.getItemVisual(idx, name + 'KeepAspect');\n  var symbolSizeArr = symbolUtil.normalizeSymbolSize(symbolSize);\n  var symbolOffsetArr = symbolUtil.normalizeSymbolOffset(symbolOffset || 0, symbolSizeArr);\n  return symbolType + symbolSizeArr + symbolOffsetArr + (symbolRotate || '') + (symbolKeepAspect || '');\n}\n/**\n * @inner\n */\nfunction createSymbol(name, lineData, idx) {\n  var symbolType = lineData.getItemVisual(idx, name);\n  if (!symbolType || symbolType === 'none') {\n    return;\n  }\n  var symbolSize = lineData.getItemVisual(idx, name + 'Size');\n  var symbolRotate = lineData.getItemVisual(idx, name + 'Rotate');\n  var symbolOffset = lineData.getItemVisual(idx, name + 'Offset');\n  var symbolKeepAspect = lineData.getItemVisual(idx, name + 'KeepAspect');\n  var symbolSizeArr = symbolUtil.normalizeSymbolSize(symbolSize);\n  var symbolOffsetArr = symbolUtil.normalizeSymbolOffset(symbolOffset || 0, symbolSizeArr);\n  var symbolPath = symbolUtil.createSymbol(symbolType, -symbolSizeArr[0] / 2 + symbolOffsetArr[0], -symbolSizeArr[1] / 2 + symbolOffsetArr[1], symbolSizeArr[0], symbolSizeArr[1], null, symbolKeepAspect);\n  symbolPath.__specifiedRotation = symbolRotate == null || isNaN(symbolRotate) ? void 0 : +symbolRotate * Math.PI / 180 || 0;\n  symbolPath.name = name;\n  return symbolPath;\n}\nfunction createLine(points) {\n  var line = new ECLinePath({\n    name: 'line',\n    subPixelOptimize: true\n  });\n  setLinePoints(line.shape, points);\n  return line;\n}\nfunction setLinePoints(targetShape, points) {\n  targetShape.x1 = points[0][0];\n  targetShape.y1 = points[0][1];\n  targetShape.x2 = points[1][0];\n  targetShape.y2 = points[1][1];\n  targetShape.percent = 1;\n  var cp1 = points[2];\n  if (cp1) {\n    targetShape.cpx1 = cp1[0];\n    targetShape.cpy1 = cp1[1];\n  } else {\n    targetShape.cpx1 = NaN;\n    targetShape.cpy1 = NaN;\n  }\n}\nvar Line = /** @class */function (_super) {\n  __extends(Line, _super);\n  function Line(lineData, idx, seriesScope) {\n    var _this = _super.call(this) || this;\n    _this._createLine(lineData, idx, seriesScope);\n    return _this;\n  }\n  Line.prototype._createLine = function (lineData, idx, seriesScope) {\n    var seriesModel = lineData.hostModel;\n    var linePoints = lineData.getItemLayout(idx);\n    var z2 = lineData.getItemVisual(idx, 'z2');\n    var line = createLine(linePoints);\n    line.shape.percent = 0;\n    graphic.initProps(line, {\n      z2: retrieve2(z2, 0),\n      shape: {\n        percent: 1\n      }\n    }, seriesModel, idx);\n    this.add(line);\n    each(SYMBOL_CATEGORIES, function (symbolCategory) {\n      var symbol = createSymbol(symbolCategory, lineData, idx);\n      // symbols must added after line to make sure\n      // it will be updated after line#update.\n      // Or symbol position and rotation update in line#beforeUpdate will be one frame slow\n      this.add(symbol);\n      this[makeSymbolTypeKey(symbolCategory)] = makeSymbolTypeValue(symbolCategory, lineData, idx);\n    }, this);\n    this._updateCommonStl(lineData, idx, seriesScope);\n  };\n  // TODO More strict on the List type in parameters?\n  Line.prototype.updateData = function (lineData, idx, seriesScope) {\n    var seriesModel = lineData.hostModel;\n    var line = this.childOfName('line');\n    var linePoints = lineData.getItemLayout(idx);\n    var target = {\n      shape: {}\n    };\n    setLinePoints(target.shape, linePoints);\n    graphic.updateProps(line, target, seriesModel, idx);\n    each(SYMBOL_CATEGORIES, function (symbolCategory) {\n      var symbolType = makeSymbolTypeValue(symbolCategory, lineData, idx);\n      var key = makeSymbolTypeKey(symbolCategory);\n      // Symbol changed\n      if (this[key] !== symbolType) {\n        this.remove(this.childOfName(symbolCategory));\n        var symbol = createSymbol(symbolCategory, lineData, idx);\n        this.add(symbol);\n      }\n      this[key] = symbolType;\n    }, this);\n    this._updateCommonStl(lineData, idx, seriesScope);\n  };\n  ;\n  Line.prototype.getLinePath = function () {\n    return this.childAt(0);\n  };\n  Line.prototype._updateCommonStl = function (lineData, idx, seriesScope) {\n    var seriesModel = lineData.hostModel;\n    var line = this.childOfName('line');\n    var emphasisLineStyle = seriesScope && seriesScope.emphasisLineStyle;\n    var blurLineStyle = seriesScope && seriesScope.blurLineStyle;\n    var selectLineStyle = seriesScope && seriesScope.selectLineStyle;\n    var labelStatesModels = seriesScope && seriesScope.labelStatesModels;\n    var emphasisDisabled = seriesScope && seriesScope.emphasisDisabled;\n    var focus = seriesScope && seriesScope.focus;\n    var blurScope = seriesScope && seriesScope.blurScope;\n    // Optimization for large dataset\n    if (!seriesScope || lineData.hasItemOption) {\n      var itemModel = lineData.getItemModel(idx);\n      var emphasisModel = itemModel.getModel('emphasis');\n      emphasisLineStyle = emphasisModel.getModel('lineStyle').getLineStyle();\n      blurLineStyle = itemModel.getModel(['blur', 'lineStyle']).getLineStyle();\n      selectLineStyle = itemModel.getModel(['select', 'lineStyle']).getLineStyle();\n      emphasisDisabled = emphasisModel.get('disabled');\n      focus = emphasisModel.get('focus');\n      blurScope = emphasisModel.get('blurScope');\n      labelStatesModels = getLabelStatesModels(itemModel);\n    }\n    var lineStyle = lineData.getItemVisual(idx, 'style');\n    var visualColor = lineStyle.stroke;\n    line.useStyle(lineStyle);\n    line.style.fill = null;\n    line.style.strokeNoScale = true;\n    line.ensureState('emphasis').style = emphasisLineStyle;\n    line.ensureState('blur').style = blurLineStyle;\n    line.ensureState('select').style = selectLineStyle;\n    // Update symbol\n    each(SYMBOL_CATEGORIES, function (symbolCategory) {\n      var symbol = this.childOfName(symbolCategory);\n      if (symbol) {\n        // Share opacity and color with line.\n        symbol.setColor(visualColor);\n        symbol.style.opacity = lineStyle.opacity;\n        for (var i = 0; i < SPECIAL_STATES.length; i++) {\n          var stateName = SPECIAL_STATES[i];\n          var lineState = line.getState(stateName);\n          if (lineState) {\n            var lineStateStyle = lineState.style || {};\n            var state = symbol.ensureState(stateName);\n            var stateStyle = state.style || (state.style = {});\n            if (lineStateStyle.stroke != null) {\n              stateStyle[symbol.__isEmptyBrush ? 'stroke' : 'fill'] = lineStateStyle.stroke;\n            }\n            if (lineStateStyle.opacity != null) {\n              stateStyle.opacity = lineStateStyle.opacity;\n            }\n          }\n        }\n        symbol.markRedraw();\n      }\n    }, this);\n    var rawVal = seriesModel.getRawValue(idx);\n    setLabelStyle(this, labelStatesModels, {\n      labelDataIndex: idx,\n      labelFetcher: {\n        getFormattedLabel: function (dataIndex, stateName) {\n          return seriesModel.getFormattedLabel(dataIndex, stateName, lineData.dataType);\n        }\n      },\n      inheritColor: visualColor || tokens.color.neutral99,\n      defaultOpacity: lineStyle.opacity,\n      defaultText: (rawVal == null ? lineData.getName(idx) : isFinite(rawVal) ? round(rawVal) : rawVal) + ''\n    });\n    var label = this.getTextContent();\n    // Always set `textStyle` even if `normalStyle.text` is null, because default\n    // values have to be set on `normalStyle`.\n    if (label) {\n      var labelNormalModel = labelStatesModels.normal;\n      label.__align = label.style.align;\n      label.__verticalAlign = label.style.verticalAlign;\n      // 'start', 'middle', 'end'\n      label.__position = labelNormalModel.get('position') || 'middle';\n      var distance = labelNormalModel.get('distance');\n      if (!isArray(distance)) {\n        distance = [distance, distance];\n      }\n      label.__labelDistance = distance;\n    }\n    this.setTextConfig({\n      position: null,\n      local: true,\n      inside: false // Can't be inside for stroke element.\n    });\n    toggleHoverEmphasis(this, focus, blurScope, emphasisDisabled);\n  };\n  Line.prototype.highlight = function () {\n    enterEmphasis(this);\n  };\n  Line.prototype.downplay = function () {\n    leaveEmphasis(this);\n  };\n  Line.prototype.updateLayout = function (lineData, idx) {\n    this.setLinePoints(lineData.getItemLayout(idx));\n  };\n  Line.prototype.setLinePoints = function (points) {\n    var linePath = this.childOfName('line');\n    setLinePoints(linePath.shape, points);\n    linePath.dirty();\n  };\n  Line.prototype.beforeUpdate = function () {\n    var lineGroup = this;\n    var symbolFrom = lineGroup.childOfName('fromSymbol');\n    var symbolTo = lineGroup.childOfName('toSymbol');\n    var label = lineGroup.getTextContent();\n    // Quick reject\n    if (!symbolFrom && !symbolTo && (!label || label.ignore)) {\n      return;\n    }\n    var invScale = 1;\n    var parentNode = this.parent;\n    while (parentNode) {\n      if (parentNode.scaleX) {\n        invScale /= parentNode.scaleX;\n      }\n      parentNode = parentNode.parent;\n    }\n    var line = lineGroup.childOfName('line');\n    // If line not changed\n    // FIXME Parent scale changed\n    if (!this.__dirty && !line.__dirty) {\n      return;\n    }\n    var percent = line.shape.percent;\n    var fromPos = line.pointAt(0);\n    var toPos = line.pointAt(percent);\n    var d = vector.sub([], toPos, fromPos);\n    vector.normalize(d, d);\n    function setSymbolRotation(symbol, percent) {\n      // Fix #12388\n      // when symbol is set to be 'arrow' in markLine,\n      // symbolRotate value will be ignored, and compulsively use tangent angle.\n      // rotate by default if symbol rotation is not specified\n      var specifiedRotation = symbol.__specifiedRotation;\n      if (specifiedRotation == null) {\n        var tangent = line.tangentAt(percent);\n        symbol.attr('rotation', (percent === 1 ? -1 : 1) * Math.PI / 2 - Math.atan2(tangent[1], tangent[0]));\n      } else {\n        symbol.attr('rotation', specifiedRotation);\n      }\n    }\n    if (symbolFrom) {\n      symbolFrom.setPosition(fromPos);\n      setSymbolRotation(symbolFrom, 0);\n      symbolFrom.scaleX = symbolFrom.scaleY = invScale * percent;\n      symbolFrom.markRedraw();\n    }\n    if (symbolTo) {\n      symbolTo.setPosition(toPos);\n      setSymbolRotation(symbolTo, 1);\n      symbolTo.scaleX = symbolTo.scaleY = invScale * percent;\n      symbolTo.markRedraw();\n    }\n    if (label && !label.ignore) {\n      label.x = label.y = 0;\n      label.originX = label.originY = 0;\n      var textAlign = void 0;\n      var textVerticalAlign = void 0;\n      var distance = label.__labelDistance;\n      var distanceX = distance[0] * invScale;\n      var distanceY = distance[1] * invScale;\n      var halfPercent = percent / 2;\n      var tangent = line.tangentAt(halfPercent);\n      var n = [tangent[1], -tangent[0]];\n      var cp = line.pointAt(halfPercent);\n      if (n[1] > 0) {\n        n[0] = -n[0];\n        n[1] = -n[1];\n      }\n      var dir = tangent[0] < 0 ? -1 : 1;\n      if (label.__position !== 'start' && label.__position !== 'end') {\n        var rotation = -Math.atan2(tangent[1], tangent[0]);\n        if (toPos[0] < fromPos[0]) {\n          rotation = Math.PI + rotation;\n        }\n        label.rotation = rotation;\n      }\n      var dy = void 0;\n      switch (label.__position) {\n        case 'insideStartTop':\n        case 'insideMiddleTop':\n        case 'insideEndTop':\n        case 'middle':\n          dy = -distanceY;\n          textVerticalAlign = 'bottom';\n          break;\n        case 'insideStartBottom':\n        case 'insideMiddleBottom':\n        case 'insideEndBottom':\n          dy = distanceY;\n          textVerticalAlign = 'top';\n          break;\n        default:\n          dy = 0;\n          textVerticalAlign = 'middle';\n      }\n      switch (label.__position) {\n        case 'end':\n          label.x = d[0] * distanceX + toPos[0];\n          label.y = d[1] * distanceY + toPos[1];\n          textAlign = d[0] > 0.8 ? 'left' : d[0] < -0.8 ? 'right' : 'center';\n          textVerticalAlign = d[1] > 0.8 ? 'top' : d[1] < -0.8 ? 'bottom' : 'middle';\n          break;\n        case 'start':\n          label.x = -d[0] * distanceX + fromPos[0];\n          label.y = -d[1] * distanceY + fromPos[1];\n          textAlign = d[0] > 0.8 ? 'right' : d[0] < -0.8 ? 'left' : 'center';\n          textVerticalAlign = d[1] > 0.8 ? 'bottom' : d[1] < -0.8 ? 'top' : 'middle';\n          break;\n        case 'insideStartTop':\n        case 'insideStart':\n        case 'insideStartBottom':\n          label.x = distanceX * dir + fromPos[0];\n          label.y = fromPos[1] + dy;\n          textAlign = tangent[0] < 0 ? 'right' : 'left';\n          label.originX = -distanceX * dir;\n          label.originY = -dy;\n          break;\n        case 'insideMiddleTop':\n        case 'insideMiddle':\n        case 'insideMiddleBottom':\n        case 'middle':\n          label.x = cp[0];\n          label.y = cp[1] + dy;\n          textAlign = 'center';\n          label.originY = -dy;\n          break;\n        case 'insideEndTop':\n        case 'insideEnd':\n        case 'insideEndBottom':\n          label.x = -distanceX * dir + toPos[0];\n          label.y = toPos[1] + dy;\n          textAlign = tangent[0] >= 0 ? 'right' : 'left';\n          label.originX = distanceX * dir;\n          label.originY = -dy;\n          break;\n      }\n      label.scaleX = label.scaleY = invScale;\n      label.setStyle({\n        // Use the user specified text align and baseline first\n        verticalAlign: label.__verticalAlign || textVerticalAlign,\n        align: label.__align || textAlign\n      });\n    }\n  };\n  return Line;\n}(graphic.Group);\nexport default Line;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as graphic from '../../util/graphic.js';\nimport LineGroup from './Line.js';\nimport { getLabelStatesModels } from '../../label/labelStyle.js';\nvar LineDraw = /** @class */function () {\n  function LineDraw(LineCtor) {\n    this.group = new graphic.Group();\n    this._LineCtor = LineCtor || LineGroup;\n  }\n  LineDraw.prototype.updateData = function (lineData) {\n    var _this = this;\n    // Remove progressive els.\n    this._progressiveEls = null;\n    var lineDraw = this;\n    var group = lineDraw.group;\n    var oldLineData = lineDraw._lineData;\n    lineDraw._lineData = lineData;\n    // There is no oldLineData only when first rendering or switching from\n    // stream mode to normal mode, where previous elements should be removed.\n    if (!oldLineData) {\n      group.removeAll();\n    }\n    var seriesScope = makeSeriesScope(lineData);\n    lineData.diff(oldLineData).add(function (idx) {\n      _this._doAdd(lineData, idx, seriesScope);\n    }).update(function (newIdx, oldIdx) {\n      _this._doUpdate(oldLineData, lineData, oldIdx, newIdx, seriesScope);\n    }).remove(function (idx) {\n      group.remove(oldLineData.getItemGraphicEl(idx));\n    }).execute();\n  };\n  ;\n  LineDraw.prototype.updateLayout = function () {\n    var lineData = this._lineData;\n    // Do not support update layout in incremental mode.\n    if (!lineData) {\n      return;\n    }\n    lineData.eachItemGraphicEl(function (el, idx) {\n      el.updateLayout(lineData, idx);\n    }, this);\n  };\n  ;\n  LineDraw.prototype.incrementalPrepareUpdate = function (lineData) {\n    this._seriesScope = makeSeriesScope(lineData);\n    this._lineData = null;\n    this.group.removeAll();\n  };\n  ;\n  LineDraw.prototype.incrementalUpdate = function (taskParams, lineData) {\n    this._progressiveEls = [];\n    function updateIncrementalAndHover(el) {\n      if (!el.isGroup && !isEffectObject(el)) {\n        el.incremental = true;\n        el.ensureState('emphasis').hoverLayer = true;\n      }\n    }\n    for (var idx = taskParams.start; idx < taskParams.end; idx++) {\n      var itemLayout = lineData.getItemLayout(idx);\n      if (lineNeedsDraw(itemLayout)) {\n        var el = new this._LineCtor(lineData, idx, this._seriesScope);\n        el.traverse(updateIncrementalAndHover);\n        this.group.add(el);\n        lineData.setItemGraphicEl(idx, el);\n        this._progressiveEls.push(el);\n      }\n    }\n  };\n  ;\n  LineDraw.prototype.remove = function () {\n    this.group.removeAll();\n  };\n  ;\n  LineDraw.prototype.eachRendered = function (cb) {\n    graphic.traverseElements(this._progressiveEls || this.group, cb);\n  };\n  LineDraw.prototype._doAdd = function (lineData, idx, seriesScope) {\n    var itemLayout = lineData.getItemLayout(idx);\n    if (!lineNeedsDraw(itemLayout)) {\n      return;\n    }\n    var el = new this._LineCtor(lineData, idx, seriesScope);\n    lineData.setItemGraphicEl(idx, el);\n    this.group.add(el);\n  };\n  LineDraw.prototype._doUpdate = function (oldLineData, newLineData, oldIdx, newIdx, seriesScope) {\n    var itemEl = oldLineData.getItemGraphicEl(oldIdx);\n    if (!lineNeedsDraw(newLineData.getItemLayout(newIdx))) {\n      this.group.remove(itemEl);\n      return;\n    }\n    if (!itemEl) {\n      itemEl = new this._LineCtor(newLineData, newIdx, seriesScope);\n    } else {\n      itemEl.updateData(newLineData, newIdx, seriesScope);\n    }\n    newLineData.setItemGraphicEl(newIdx, itemEl);\n    this.group.add(itemEl);\n  };\n  return LineDraw;\n}();\nfunction isEffectObject(el) {\n  return el.animators && el.animators.length > 0;\n}\nfunction makeSeriesScope(lineData) {\n  var hostModel = lineData.hostModel;\n  var emphasisModel = hostModel.getModel('emphasis');\n  return {\n    lineStyle: hostModel.getModel('lineStyle').getLineStyle(),\n    emphasisLineStyle: emphasisModel.getModel(['lineStyle']).getLineStyle(),\n    blurLineStyle: hostModel.getModel(['blur', 'lineStyle']).getLineStyle(),\n    selectLineStyle: hostModel.getModel(['select', 'lineStyle']).getLineStyle(),\n    emphasisDisabled: emphasisModel.get('disabled'),\n    blurScope: emphasisModel.get('blurScope'),\n    focus: emphasisModel.get('focus'),\n    labelStatesModels: getLabelStatesModels(hostModel)\n  };\n}\nfunction isPointNaN(pt) {\n  return isNaN(pt[0]) || isNaN(pt[1]);\n}\nfunction lineNeedsDraw(pts) {\n  return pts && !isPointNaN(pts[0]) && !isPointNaN(pts[1]);\n}\nexport default LineDraw;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as curveTool from 'zrender/lib/core/curve.js';\nimport * as vec2 from 'zrender/lib/core/vector.js';\nimport { getSymbolSize } from './graphHelper.js';\nvar v1 = [];\nvar v2 = [];\nvar v3 = [];\nvar quadraticAt = curveTool.quadraticAt;\nvar v2DistSquare = vec2.distSquare;\nvar mathAbs = Math.abs;\nfunction intersectCurveCircle(curvePoints, center, radius) {\n  var p0 = curvePoints[0];\n  var p1 = curvePoints[1];\n  var p2 = curvePoints[2];\n  var d = Infinity;\n  var t;\n  var radiusSquare = radius * radius;\n  var interval = 0.1;\n  for (var _t = 0.1; _t <= 0.9; _t += 0.1) {\n    v1[0] = quadraticAt(p0[0], p1[0], p2[0], _t);\n    v1[1] = quadraticAt(p0[1], p1[1], p2[1], _t);\n    var diff = mathAbs(v2DistSquare(v1, center) - radiusSquare);\n    if (diff < d) {\n      d = diff;\n      t = _t;\n    }\n  }\n  // Assume the segment is monotone\uFF0CFind root through Bisection method\n  // At most 32 iteration\n  for (var i = 0; i < 32; i++) {\n    // let prev = t - interval;\n    var next = t + interval;\n    // v1[0] = quadraticAt(p0[0], p1[0], p2[0], prev);\n    // v1[1] = quadraticAt(p0[1], p1[1], p2[1], prev);\n    v2[0] = quadraticAt(p0[0], p1[0], p2[0], t);\n    v2[1] = quadraticAt(p0[1], p1[1], p2[1], t);\n    v3[0] = quadraticAt(p0[0], p1[0], p2[0], next);\n    v3[1] = quadraticAt(p0[1], p1[1], p2[1], next);\n    var diff = v2DistSquare(v2, center) - radiusSquare;\n    if (mathAbs(diff) < 1e-2) {\n      break;\n    }\n    // let prevDiff = v2DistSquare(v1, center) - radiusSquare;\n    var nextDiff = v2DistSquare(v3, center) - radiusSquare;\n    interval /= 2;\n    if (diff < 0) {\n      if (nextDiff >= 0) {\n        t = t + interval;\n      } else {\n        t = t - interval;\n      }\n    } else {\n      if (nextDiff >= 0) {\n        t = t - interval;\n      } else {\n        t = t + interval;\n      }\n    }\n  }\n  return t;\n}\n// Adjust edge to avoid\nexport default function adjustEdge(graph, scale) {\n  var tmp0 = [];\n  var quadraticSubdivide = curveTool.quadraticSubdivide;\n  var pts = [[], [], []];\n  var pts2 = [[], []];\n  var v = [];\n  scale /= 2;\n  graph.eachEdge(function (edge, idx) {\n    var linePoints = edge.getLayout();\n    var fromSymbol = edge.getVisual('fromSymbol');\n    var toSymbol = edge.getVisual('toSymbol');\n    if (!linePoints.__original) {\n      linePoints.__original = [vec2.clone(linePoints[0]), vec2.clone(linePoints[1])];\n      if (linePoints[2]) {\n        linePoints.__original.push(vec2.clone(linePoints[2]));\n      }\n    }\n    var originalPoints = linePoints.__original;\n    // Quadratic curve\n    if (linePoints[2] != null) {\n      vec2.copy(pts[0], originalPoints[0]);\n      vec2.copy(pts[1], originalPoints[2]);\n      vec2.copy(pts[2], originalPoints[1]);\n      if (fromSymbol && fromSymbol !== 'none') {\n        var symbolSize = getSymbolSize(edge.node1);\n        var t = intersectCurveCircle(pts, originalPoints[0], symbolSize * scale);\n        // Subdivide and get the second\n        quadraticSubdivide(pts[0][0], pts[1][0], pts[2][0], t, tmp0);\n        pts[0][0] = tmp0[3];\n        pts[1][0] = tmp0[4];\n        quadraticSubdivide(pts[0][1], pts[1][1], pts[2][1], t, tmp0);\n        pts[0][1] = tmp0[3];\n        pts[1][1] = tmp0[4];\n      }\n      if (toSymbol && toSymbol !== 'none') {\n        var symbolSize = getSymbolSize(edge.node2);\n        var t = intersectCurveCircle(pts, originalPoints[1], symbolSize * scale);\n        // Subdivide and get the first\n        quadraticSubdivide(pts[0][0], pts[1][0], pts[2][0], t, tmp0);\n        pts[1][0] = tmp0[1];\n        pts[2][0] = tmp0[2];\n        quadraticSubdivide(pts[0][1], pts[1][1], pts[2][1], t, tmp0);\n        pts[1][1] = tmp0[1];\n        pts[2][1] = tmp0[2];\n      }\n      // Copy back to layout\n      vec2.copy(linePoints[0], pts[0]);\n      vec2.copy(linePoints[1], pts[2]);\n      vec2.copy(linePoints[2], pts[1]);\n    }\n    // Line\n    else {\n      vec2.copy(pts2[0], originalPoints[0]);\n      vec2.copy(pts2[1], originalPoints[1]);\n      vec2.sub(v, pts2[1], pts2[0]);\n      vec2.normalize(v, v);\n      if (fromSymbol && fromSymbol !== 'none') {\n        var symbolSize = getSymbolSize(edge.node1);\n        vec2.scaleAndAdd(pts2[0], pts2[0], v, symbolSize * scale);\n      }\n      if (toSymbol && toSymbol !== 'none') {\n        var symbolSize = getSymbolSize(edge.node2);\n        vec2.scaleAndAdd(pts2[1], pts2[1], v, -symbolSize * scale);\n      }\n      vec2.copy(linePoints[0], pts2[0]);\n      vec2.copy(linePoints[1], pts2[1]);\n    }\n  });\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { makeInner } from '../../util/model.js';\n/**\n * @caveat Do not import other `src/component/thumbnail/*` files.\n *  This file should be decoupled from them for sake of the size consideration.\n */\n/**\n * FIXME: This is a temporary implmentation. May need refactor to decouple\n *  the direct call from series.graph to thumbnail.\n */\nvar inner = makeInner();\nexport function getThumbnailBridge(model) {\n  if (model) {\n    return inner(model).bridge;\n  }\n}\nexport function injectThumbnailBridge(model, thumbnailBridge) {\n  if (model) {\n    inner(model).bridge = thumbnailBridge;\n  }\n}\n;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport SymbolDraw from '../helper/SymbolDraw.js';\nimport LineDraw from '../helper/LineDraw.js';\nimport RoamController from '../../component/helper/RoamController.js';\nimport { updateViewOnZoom, updateViewOnPan } from '../../component/helper/roamHelper.js';\nimport * as graphic from '../../util/graphic.js';\nimport adjustEdge from './adjustEdge.js';\nimport { getNodeGlobalScale } from './graphHelper.js';\nimport ChartView from '../../view/Chart.js';\nimport { getECData } from '../../util/innerStore.js';\nimport { simpleLayoutEdge } from './simpleLayoutHelper.js';\nimport { circularLayout, rotateNodeLabel } from './circularLayoutHelper.js';\nimport { clone, extend } from 'zrender/lib/core/util.js';\nimport ECLinePath from '../helper/LinePath.js';\nimport { getThumbnailBridge } from '../../component/helper/thumbnailBridge.js';\nfunction isViewCoordSys(coordSys) {\n  return coordSys.type === 'view';\n}\nvar GraphView = /** @class */function (_super) {\n  __extends(GraphView, _super);\n  function GraphView() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = GraphView.type;\n    return _this;\n  }\n  GraphView.prototype.init = function (ecModel, api) {\n    var symbolDraw = new SymbolDraw();\n    var lineDraw = new LineDraw();\n    var group = this.group;\n    var mainGroup = new graphic.Group();\n    this._controller = new RoamController(api.getZr());\n    this._controllerHost = {\n      target: mainGroup\n    };\n    mainGroup.add(symbolDraw.group);\n    mainGroup.add(lineDraw.group);\n    group.add(mainGroup);\n    this._symbolDraw = symbolDraw;\n    this._lineDraw = lineDraw;\n    this._mainGroup = mainGroup;\n    this._firstRender = true;\n  };\n  GraphView.prototype.render = function (seriesModel, ecModel, api) {\n    var _this = this;\n    var coordSys = seriesModel.coordinateSystem;\n    var isForceLayout = false;\n    this._model = seriesModel;\n    this._api = api;\n    this._active = true;\n    var thumbnailInfo = this._getThumbnailInfo();\n    if (thumbnailInfo) {\n      thumbnailInfo.bridge.reset(api);\n    }\n    var symbolDraw = this._symbolDraw;\n    var lineDraw = this._lineDraw;\n    if (isViewCoordSys(coordSys)) {\n      var groupNewProp = {\n        x: coordSys.x,\n        y: coordSys.y,\n        scaleX: coordSys.scaleX,\n        scaleY: coordSys.scaleY\n      };\n      if (this._firstRender) {\n        this._mainGroup.attr(groupNewProp);\n      } else {\n        graphic.updateProps(this._mainGroup, groupNewProp, seriesModel);\n      }\n    }\n    // Fix edge contact point with node\n    adjustEdge(seriesModel.getGraph(), getNodeGlobalScale(seriesModel));\n    var data = seriesModel.getData();\n    symbolDraw.updateData(data);\n    var edgeData = seriesModel.getEdgeData();\n    // TODO: TYPE\n    lineDraw.updateData(edgeData);\n    this._updateNodeAndLinkScale();\n    this._updateController(null, seriesModel, api);\n    clearTimeout(this._layoutTimeout);\n    var forceLayout = seriesModel.forceLayout;\n    var layoutAnimation = seriesModel.get(['force', 'layoutAnimation']);\n    if (forceLayout) {\n      isForceLayout = true;\n      this._startForceLayoutIteration(forceLayout, api, layoutAnimation);\n    }\n    var layout = seriesModel.get('layout');\n    data.graph.eachNode(function (node) {\n      var idx = node.dataIndex;\n      var el = node.getGraphicEl();\n      var itemModel = node.getModel();\n      if (!el) {\n        return;\n      }\n      // Update draggable\n      el.off('drag').off('dragend');\n      var draggable = itemModel.get('draggable');\n      if (draggable) {\n        el.on('drag', function (e) {\n          switch (layout) {\n            case 'force':\n              forceLayout.warmUp();\n              !_this._layouting && _this._startForceLayoutIteration(forceLayout, api, layoutAnimation);\n              forceLayout.setFixed(idx);\n              // Write position back to layout\n              data.setItemLayout(idx, [el.x, el.y]);\n              break;\n            case 'circular':\n              data.setItemLayout(idx, [el.x, el.y]);\n              // mark node fixed\n              node.setLayout({\n                fixed: true\n              }, true);\n              // recalculate circular layout\n              circularLayout(seriesModel, 'symbolSize', node, [e.offsetX, e.offsetY]);\n              _this.updateLayout(seriesModel);\n              break;\n            case 'none':\n            default:\n              data.setItemLayout(idx, [el.x, el.y]);\n              // update edge\n              simpleLayoutEdge(seriesModel.getGraph(), seriesModel);\n              _this.updateLayout(seriesModel);\n              break;\n          }\n        }).on('dragend', function () {\n          if (forceLayout) {\n            forceLayout.setUnfixed(idx);\n          }\n        });\n      }\n      el.setDraggable(draggable, !!itemModel.get('cursor'));\n      var focus = itemModel.get(['emphasis', 'focus']);\n      if (focus === 'adjacency') {\n        getECData(el).focus = node.getAdjacentDataIndices();\n      }\n    });\n    data.graph.eachEdge(function (edge) {\n      var el = edge.getGraphicEl();\n      var focus = edge.getModel().get(['emphasis', 'focus']);\n      if (!el) {\n        return;\n      }\n      if (focus === 'adjacency') {\n        getECData(el).focus = {\n          edge: [edge.dataIndex],\n          node: [edge.node1.dataIndex, edge.node2.dataIndex]\n        };\n      }\n    });\n    var circularRotateLabel = seriesModel.get('layout') === 'circular' && seriesModel.get(['circular', 'rotateLabel']);\n    var cx = data.getLayout('cx');\n    var cy = data.getLayout('cy');\n    data.graph.eachNode(function (node) {\n      rotateNodeLabel(node, circularRotateLabel, cx, cy);\n    });\n    this._firstRender = false;\n    // Force layout will render thumbnail when layout is finished.\n    if (!isForceLayout) {\n      this._renderThumbnail(seriesModel, api, this._symbolDraw, this._lineDraw);\n    }\n  };\n  GraphView.prototype.dispose = function () {\n    this.remove();\n    this._controller && this._controller.dispose();\n    this._controllerHost = null;\n  };\n  GraphView.prototype._startForceLayoutIteration = function (forceLayout, api, layoutAnimation) {\n    var self = this;\n    var firstRendered = false;\n    (function step() {\n      forceLayout.step(function (stopped) {\n        self.updateLayout(self._model);\n        if (stopped || !firstRendered) {\n          firstRendered = true;\n          self._renderThumbnail(self._model, api, self._symbolDraw, self._lineDraw);\n        }\n        (self._layouting = !stopped) && (layoutAnimation ? self._layoutTimeout = setTimeout(step, 16) : step());\n      });\n    })();\n  };\n  GraphView.prototype._updateController = function (clipRect, seriesModel, api) {\n    var controller = this._controller;\n    var controllerHost = this._controllerHost;\n    var coordSys = seriesModel.coordinateSystem;\n    if (!isViewCoordSys(coordSys)) {\n      controller.disable();\n      return;\n    }\n    controller.enable(seriesModel.get('roam'), {\n      api: api,\n      zInfo: {\n        component: seriesModel\n      },\n      triggerInfo: {\n        roamTrigger: seriesModel.get('roamTrigger'),\n        isInSelf: function (e, x, y) {\n          return coordSys.containPoint([x, y]);\n        },\n        isInClip: function (e, x, y) {\n          return !clipRect || clipRect.contain(x, y);\n        }\n      }\n    });\n    controllerHost.zoomLimit = seriesModel.get('scaleLimit');\n    controllerHost.zoom = coordSys.getZoom();\n    controller.off('pan').off('zoom').on('pan', function (e) {\n      api.dispatchAction({\n        seriesId: seriesModel.id,\n        type: 'graphRoam',\n        dx: e.dx,\n        dy: e.dy\n      });\n    }).on('zoom', function (e) {\n      api.dispatchAction({\n        seriesId: seriesModel.id,\n        type: 'graphRoam',\n        zoom: e.scale,\n        originX: e.originX,\n        originY: e.originY\n      });\n    });\n  };\n  /**\n   * A performance shortcut - called by action handler to update the view directly\n   * without any data/visual processing (which are assumed to be unchanged), while\n   * ensuring consistent behavior between internal and external action triggers.\n   */\n  GraphView.prototype.updateViewOnPan = function (seriesModel, api, params) {\n    if (!this._active) {\n      return;\n    }\n    updateViewOnPan(this._controllerHost, params.dx, params.dy);\n    this._updateThumbnailWindow();\n  };\n  /**\n   * A performance shortcut - called by action handler to update the view directly\n   * without any data/visual processing (which are assumed to be unchanged), while\n   * ensuring consistent behavior between internal and external action triggers.\n   */\n  GraphView.prototype.updateViewOnZoom = function (seriesModel, api, params) {\n    if (!this._active) {\n      return;\n    }\n    updateViewOnZoom(this._controllerHost, params.zoom, params.originX, params.originY);\n    this._updateNodeAndLinkScale();\n    adjustEdge(seriesModel.getGraph(), getNodeGlobalScale(seriesModel));\n    this._lineDraw.updateLayout();\n    // Only update label layout on zoom\n    api.updateLabelLayout();\n    this._updateThumbnailWindow();\n  };\n  GraphView.prototype._updateNodeAndLinkScale = function () {\n    var seriesModel = this._model;\n    var data = seriesModel.getData();\n    var nodeScale = getNodeGlobalScale(seriesModel);\n    data.eachItemGraphicEl(function (el, idx) {\n      el && el.setSymbolScale(nodeScale);\n    });\n  };\n  GraphView.prototype.updateLayout = function (seriesModel) {\n    if (!this._active) {\n      return;\n    }\n    adjustEdge(seriesModel.getGraph(), getNodeGlobalScale(seriesModel));\n    this._symbolDraw.updateLayout();\n    this._lineDraw.updateLayout();\n  };\n  GraphView.prototype.remove = function () {\n    this._active = false;\n    clearTimeout(this._layoutTimeout);\n    this._layouting = false;\n    this._layoutTimeout = null;\n    this._symbolDraw && this._symbolDraw.remove();\n    this._lineDraw && this._lineDraw.remove();\n    this._controller && this._controller.disable();\n  };\n  /**\n   * Get thumbnail data structure only if supported.\n   */\n  GraphView.prototype._getThumbnailInfo = function () {\n    var model = this._model;\n    var coordSys = model.coordinateSystem;\n    if (coordSys.type !== 'view') {\n      return;\n    }\n    var bridge = getThumbnailBridge(model);\n    if (!bridge) {\n      return;\n    }\n    return {\n      bridge: bridge,\n      coordSys: coordSys\n    };\n  };\n  GraphView.prototype._updateThumbnailWindow = function () {\n    var info = this._getThumbnailInfo();\n    if (info) {\n      info.bridge.updateWindow(info.coordSys.transform, this._api);\n    }\n  };\n  GraphView.prototype._renderThumbnail = function (seriesModel, api, symbolDraw, lineDraw) {\n    var info = this._getThumbnailInfo();\n    if (!info) {\n      return;\n    }\n    var bridgeGroup = new graphic.Group();\n    var symbolNodes = symbolDraw.group.children();\n    var lineNodes = lineDraw.group.children();\n    var lineGroup = new graphic.Group();\n    var symbolGroup = new graphic.Group();\n    bridgeGroup.add(symbolGroup);\n    bridgeGroup.add(lineGroup);\n    // TODO: reuse elemenents for performance in large graph?\n    for (var i = 0; i < symbolNodes.length; i++) {\n      var node = symbolNodes[i];\n      var sub = node.children()[0];\n      var x = node.x;\n      var y = node.y;\n      var subShape = clone(sub.shape);\n      var shape = extend(subShape, {\n        width: sub.scaleX,\n        height: sub.scaleY,\n        x: x - sub.scaleX / 2,\n        y: y - sub.scaleY / 2\n      });\n      var style = clone(sub.style);\n      var subThumbnail = new sub.constructor({\n        shape: shape,\n        style: style,\n        z2: 151\n      });\n      symbolGroup.add(subThumbnail);\n    }\n    for (var i = 0; i < lineNodes.length; i++) {\n      var node = lineNodes[i];\n      var line = node.children()[0];\n      var style = clone(line.style);\n      var shape = clone(line.shape);\n      var lineThumbnail = new ECLinePath({\n        style: style,\n        shape: shape,\n        z2: 151\n      });\n      lineGroup.add(lineThumbnail);\n    }\n    info.bridge.renderContent({\n      api: api,\n      roamType: seriesModel.get('roam'),\n      viewportRect: null,\n      group: bridgeGroup,\n      targetTrans: info.coordSys.transform\n    });\n  };\n  GraphView.type = 'graph';\n  return GraphView;\n}(ChartView);\nexport default GraphView;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\n// id may be function name of Object, add a prefix to avoid this problem.\nfunction generateNodeKey(id) {\n  return '_EC_' + id;\n}\nvar Graph = /** @class */function () {\n  function Graph(directed) {\n    this.type = 'graph';\n    this.nodes = [];\n    this.edges = [];\n    this._nodesMap = {};\n    /**\n     * @type {Object.<string, module:echarts/data/Graph.Edge>}\n     * @private\n     */\n    this._edgesMap = {};\n    this._directed = directed || false;\n  }\n  /**\n   * If is directed graph\n   */\n  Graph.prototype.isDirected = function () {\n    return this._directed;\n  };\n  ;\n  /**\n   * Add a new node\n   */\n  Graph.prototype.addNode = function (id, dataIndex) {\n    id = id == null ? '' + dataIndex : '' + id;\n    var nodesMap = this._nodesMap;\n    if (nodesMap[generateNodeKey(id)]) {\n      if (process.env.NODE_ENV !== 'production') {\n        console.error('Graph nodes have duplicate name or id');\n      }\n      return;\n    }\n    var node = new GraphNode(id, dataIndex);\n    node.hostGraph = this;\n    this.nodes.push(node);\n    nodesMap[generateNodeKey(id)] = node;\n    return node;\n  };\n  ;\n  /**\n   * Get node by data index\n   */\n  Graph.prototype.getNodeByIndex = function (dataIndex) {\n    var rawIdx = this.data.getRawIndex(dataIndex);\n    return this.nodes[rawIdx];\n  };\n  ;\n  /**\n   * Get node by id\n   */\n  Graph.prototype.getNodeById = function (id) {\n    return this._nodesMap[generateNodeKey(id)];\n  };\n  ;\n  /**\n   * Add a new edge\n   */\n  Graph.prototype.addEdge = function (n1, n2, dataIndex) {\n    var nodesMap = this._nodesMap;\n    var edgesMap = this._edgesMap;\n    // PENDING\n    if (zrUtil.isNumber(n1)) {\n      n1 = this.nodes[n1];\n    }\n    if (zrUtil.isNumber(n2)) {\n      n2 = this.nodes[n2];\n    }\n    if (!(n1 instanceof GraphNode)) {\n      n1 = nodesMap[generateNodeKey(n1)];\n    }\n    if (!(n2 instanceof GraphNode)) {\n      n2 = nodesMap[generateNodeKey(n2)];\n    }\n    if (!n1 || !n2) {\n      return;\n    }\n    var key = n1.id + '-' + n2.id;\n    var edge = new GraphEdge(n1, n2, dataIndex);\n    edge.hostGraph = this;\n    if (this._directed) {\n      n1.outEdges.push(edge);\n      n2.inEdges.push(edge);\n    }\n    n1.edges.push(edge);\n    if (n1 !== n2) {\n      n2.edges.push(edge);\n    }\n    this.edges.push(edge);\n    edgesMap[key] = edge;\n    return edge;\n  };\n  ;\n  /**\n   * Get edge by data index\n   */\n  Graph.prototype.getEdgeByIndex = function (dataIndex) {\n    var rawIdx = this.edgeData.getRawIndex(dataIndex);\n    return this.edges[rawIdx];\n  };\n  ;\n  /**\n   * Get edge by two linked nodes\n   */\n  Graph.prototype.getEdge = function (n1, n2) {\n    if (n1 instanceof GraphNode) {\n      n1 = n1.id;\n    }\n    if (n2 instanceof GraphNode) {\n      n2 = n2.id;\n    }\n    var edgesMap = this._edgesMap;\n    if (this._directed) {\n      return edgesMap[n1 + '-' + n2];\n    } else {\n      return edgesMap[n1 + '-' + n2] || edgesMap[n2 + '-' + n1];\n    }\n  };\n  ;\n  /**\n   * Iterate all nodes\n   */\n  Graph.prototype.eachNode = function (cb, context) {\n    var nodes = this.nodes;\n    var len = nodes.length;\n    for (var i = 0; i < len; i++) {\n      if (nodes[i].dataIndex >= 0) {\n        cb.call(context, nodes[i], i);\n      }\n    }\n  };\n  ;\n  /**\n   * Iterate all edges\n   */\n  Graph.prototype.eachEdge = function (cb, context) {\n    var edges = this.edges;\n    var len = edges.length;\n    for (var i = 0; i < len; i++) {\n      if (edges[i].dataIndex >= 0 && edges[i].node1.dataIndex >= 0 && edges[i].node2.dataIndex >= 0) {\n        cb.call(context, edges[i], i);\n      }\n    }\n  };\n  ;\n  /**\n   * Breadth first traverse\n   * Return true to stop traversing\n   */\n  Graph.prototype.breadthFirstTraverse = function (cb, startNode, direction, context) {\n    if (!(startNode instanceof GraphNode)) {\n      startNode = this._nodesMap[generateNodeKey(startNode)];\n    }\n    if (!startNode) {\n      return;\n    }\n    var edgeType = direction === 'out' ? 'outEdges' : direction === 'in' ? 'inEdges' : 'edges';\n    for (var i = 0; i < this.nodes.length; i++) {\n      this.nodes[i].__visited = false;\n    }\n    if (cb.call(context, startNode, null)) {\n      return;\n    }\n    var queue = [startNode];\n    while (queue.length) {\n      var currentNode = queue.shift();\n      var edges = currentNode[edgeType];\n      for (var i = 0; i < edges.length; i++) {\n        var e = edges[i];\n        var otherNode = e.node1 === currentNode ? e.node2 : e.node1;\n        if (!otherNode.__visited) {\n          if (cb.call(context, otherNode, currentNode)) {\n            // Stop traversing\n            return;\n          }\n          queue.push(otherNode);\n          otherNode.__visited = true;\n        }\n      }\n    }\n  };\n  ;\n  // TODO\n  // depthFirstTraverse(\n  //     cb, startNode, direction, context\n  // ) {\n  // };\n  // Filter update\n  Graph.prototype.update = function () {\n    var data = this.data;\n    var edgeData = this.edgeData;\n    var nodes = this.nodes;\n    var edges = this.edges;\n    for (var i = 0, len = nodes.length; i < len; i++) {\n      nodes[i].dataIndex = -1;\n    }\n    for (var i = 0, len = data.count(); i < len; i++) {\n      nodes[data.getRawIndex(i)].dataIndex = i;\n    }\n    edgeData.filterSelf(function (idx) {\n      var edge = edges[edgeData.getRawIndex(idx)];\n      return edge.node1.dataIndex >= 0 && edge.node2.dataIndex >= 0;\n    });\n    // Update edge\n    for (var i = 0, len = edges.length; i < len; i++) {\n      edges[i].dataIndex = -1;\n    }\n    for (var i = 0, len = edgeData.count(); i < len; i++) {\n      edges[edgeData.getRawIndex(i)].dataIndex = i;\n    }\n  };\n  ;\n  /**\n   * @return {module:echarts/data/Graph}\n   */\n  Graph.prototype.clone = function () {\n    var graph = new Graph(this._directed);\n    var nodes = this.nodes;\n    var edges = this.edges;\n    for (var i = 0; i < nodes.length; i++) {\n      graph.addNode(nodes[i].id, nodes[i].dataIndex);\n    }\n    for (var i = 0; i < edges.length; i++) {\n      var e = edges[i];\n      graph.addEdge(e.node1.id, e.node2.id, e.dataIndex);\n    }\n    return graph;\n  };\n  ;\n  return Graph;\n}();\nvar GraphNode = /** @class */function () {\n  function GraphNode(id, dataIndex) {\n    this.inEdges = [];\n    this.outEdges = [];\n    this.edges = [];\n    this.dataIndex = -1;\n    this.id = id == null ? '' : id;\n    this.dataIndex = dataIndex == null ? -1 : dataIndex;\n  }\n  /**\n   * @return {number}\n   */\n  GraphNode.prototype.degree = function () {\n    return this.edges.length;\n  };\n  /**\n   * @return {number}\n   */\n  GraphNode.prototype.inDegree = function () {\n    return this.inEdges.length;\n  };\n  /**\n  * @return {number}\n  */\n  GraphNode.prototype.outDegree = function () {\n    return this.outEdges.length;\n  };\n  GraphNode.prototype.getModel = function (path) {\n    if (this.dataIndex < 0) {\n      return;\n    }\n    var graph = this.hostGraph;\n    var itemModel = graph.data.getItemModel(this.dataIndex);\n    return itemModel.getModel(path);\n  };\n  GraphNode.prototype.getAdjacentDataIndices = function () {\n    var dataIndices = {\n      edge: [],\n      node: []\n    };\n    for (var i = 0; i < this.edges.length; i++) {\n      var adjacentEdge = this.edges[i];\n      if (adjacentEdge.dataIndex < 0) {\n        continue;\n      }\n      dataIndices.edge.push(adjacentEdge.dataIndex);\n      dataIndices.node.push(adjacentEdge.node1.dataIndex, adjacentEdge.node2.dataIndex);\n    }\n    return dataIndices;\n  };\n  GraphNode.prototype.getTrajectoryDataIndices = function () {\n    var connectedEdgesMap = zrUtil.createHashMap();\n    var connectedNodesMap = zrUtil.createHashMap();\n    for (var i = 0, len = this.edges.length; i < len; i++) {\n      var adjacentEdge = this.edges[i];\n      if (adjacentEdge.dataIndex < 0) {\n        continue;\n      }\n      connectedEdgesMap.set(adjacentEdge.dataIndex, true);\n      var sourceNodesQueue = [adjacentEdge.node1];\n      var targetNodesQueue = [adjacentEdge.node2];\n      var nodeIteratorIndex = 0;\n      while (nodeIteratorIndex < sourceNodesQueue.length) {\n        var sourceNode = sourceNodesQueue[nodeIteratorIndex];\n        nodeIteratorIndex++;\n        connectedNodesMap.set(sourceNode.dataIndex, true);\n        var sourceNodeInEdges = sourceNode.inEdges;\n        for (var j = 0, len_1 = sourceNodeInEdges.length, inEdge = void 0, inEdgeDataIndex = void 0; j < len_1; j++) {\n          inEdge = sourceNodeInEdges[j];\n          inEdgeDataIndex = inEdge.dataIndex;\n          if (inEdgeDataIndex >= 0 && !connectedEdgesMap.hasKey(inEdgeDataIndex)) {\n            connectedEdgesMap.set(inEdgeDataIndex, true);\n            sourceNodesQueue.push(inEdge.node1);\n          }\n        }\n      }\n      nodeIteratorIndex = 0;\n      while (nodeIteratorIndex < targetNodesQueue.length) {\n        var targetNode = targetNodesQueue[nodeIteratorIndex];\n        nodeIteratorIndex++;\n        connectedNodesMap.set(targetNode.dataIndex, true);\n        var targetNodeOutEdges = targetNode.outEdges;\n        for (var j = 0, len_2 = targetNodeOutEdges.length, outEdge = void 0, outEdgeDataIndex = void 0; j < len_2; j++) {\n          outEdge = targetNodeOutEdges[j];\n          outEdgeDataIndex = outEdge.dataIndex;\n          if (outEdgeDataIndex >= 0 && !connectedEdgesMap.hasKey(outEdgeDataIndex)) {\n            connectedEdgesMap.set(outEdgeDataIndex, true);\n            targetNodesQueue.push(outEdge.node2);\n          }\n        }\n      }\n    }\n    return {\n      edge: connectedEdgesMap.keys(),\n      node: connectedNodesMap.keys()\n    };\n  };\n  return GraphNode;\n}();\nvar GraphEdge = /** @class */function () {\n  function GraphEdge(n1, n2, dataIndex) {\n    this.dataIndex = -1;\n    this.node1 = n1;\n    this.node2 = n2;\n    this.dataIndex = dataIndex == null ? -1 : dataIndex;\n  }\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  GraphEdge.prototype.getModel = function (path) {\n    if (this.dataIndex < 0) {\n      return;\n    }\n    var graph = this.hostGraph;\n    var itemModel = graph.edgeData.getItemModel(this.dataIndex);\n    return itemModel.getModel(path);\n  };\n  GraphEdge.prototype.getAdjacentDataIndices = function () {\n    return {\n      edge: [this.dataIndex],\n      node: [this.node1.dataIndex, this.node2.dataIndex]\n    };\n  };\n  GraphEdge.prototype.getTrajectoryDataIndices = function () {\n    var connectedEdgesMap = zrUtil.createHashMap();\n    var connectedNodesMap = zrUtil.createHashMap();\n    connectedEdgesMap.set(this.dataIndex, true);\n    var sourceNodes = [this.node1];\n    var targetNodes = [this.node2];\n    var nodeIteratorIndex = 0;\n    while (nodeIteratorIndex < sourceNodes.length) {\n      var sourceNode = sourceNodes[nodeIteratorIndex];\n      nodeIteratorIndex++;\n      connectedNodesMap.set(sourceNode.dataIndex, true);\n      var sourceNodeInEdges = sourceNode.inEdges;\n      for (var j = 0, len = sourceNodeInEdges.length, inEdge = void 0, inEdgeDataIndex = void 0; j < len; j++) {\n        inEdge = sourceNode.inEdges[j];\n        inEdgeDataIndex = inEdge.dataIndex;\n        if (inEdgeDataIndex >= 0 && !connectedEdgesMap.hasKey(inEdgeDataIndex)) {\n          connectedEdgesMap.set(inEdgeDataIndex, true);\n          sourceNodes.push(inEdge.node1);\n        }\n      }\n    }\n    nodeIteratorIndex = 0;\n    while (nodeIteratorIndex < targetNodes.length) {\n      var targetNode = targetNodes[nodeIteratorIndex];\n      nodeIteratorIndex++;\n      connectedNodesMap.set(targetNode.dataIndex, true);\n      var targetNodeOutEdges = targetNode.outEdges;\n      for (var j = 0, len = targetNodeOutEdges.length, outEdge = void 0, outEdgeDataIndex = void 0; j < len; j++) {\n        outEdge = targetNode.outEdges[j];\n        outEdgeDataIndex = outEdge.dataIndex;\n        if (outEdgeDataIndex >= 0 && !connectedEdgesMap.hasKey(outEdgeDataIndex)) {\n          connectedEdgesMap.set(outEdgeDataIndex, true);\n          targetNodes.push(outEdge.node2);\n        }\n      }\n    }\n    return {\n      edge: connectedEdgesMap.keys(),\n      node: connectedNodesMap.keys()\n    };\n  };\n  return GraphEdge;\n}();\nfunction createGraphDataProxyMixin(hostName, dataName) {\n  return {\n    /**\n     * @param Default 'value'. can be 'a', 'b', 'c', 'd', 'e'.\n     */\n    getValue: function (dimension) {\n      var data = this[hostName][dataName];\n      return data.getStore().get(data.getDimensionIndex(dimension || 'value'), this.dataIndex);\n    },\n    // TODO: TYPE stricter type.\n    setVisual: function (key, value) {\n      this.dataIndex >= 0 && this[hostName][dataName].setItemVisual(this.dataIndex, key, value);\n    },\n    getVisual: function (key) {\n      return this[hostName][dataName].getItemVisual(this.dataIndex, key);\n    },\n    setLayout: function (layout, merge) {\n      this.dataIndex >= 0 && this[hostName][dataName].setItemLayout(this.dataIndex, layout, merge);\n    },\n    getLayout: function () {\n      return this[hostName][dataName].getItemLayout(this.dataIndex);\n    },\n    getGraphicEl: function () {\n      return this[hostName][dataName].getItemGraphicEl(this.dataIndex);\n    },\n    getRawIndex: function () {\n      return this[hostName][dataName].getRawIndex(this.dataIndex);\n    }\n  };\n}\n;\n;\n;\nzrUtil.mixin(GraphNode, createGraphDataProxyMixin('hostGraph', 'data'));\nzrUtil.mixin(GraphEdge, createGraphDataProxyMixin('hostGraph', 'edgeData'));\nexport default Graph;\nexport { GraphNode, GraphEdge };", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport SeriesData from '../../data/SeriesData.js';\nimport Graph from '../../data/Graph.js';\nimport linkSeriesData from '../../data/helper/linkSeriesData.js';\nimport prepareSeriesDataSchema from '../../data/helper/createDimensions.js';\nimport CoordinateSystem from '../../core/CoordinateSystem.js';\nimport createSeriesData from './createSeriesData.js';\nimport { convertOptionIdName } from '../../util/model.js';\nexport default function createGraphFromNodeEdge(nodes, edges, seriesModel, directed, beforeLink) {\n  // ??? TODO\n  // support dataset?\n  var graph = new Graph(directed);\n  for (var i = 0; i < nodes.length; i++) {\n    graph.addNode(zrUtil.retrieve(\n    // Id, name, dataIndex\n    nodes[i].id, nodes[i].name, i), i);\n  }\n  var linkNameList = [];\n  var validEdges = [];\n  var linkCount = 0;\n  for (var i = 0; i < edges.length; i++) {\n    var link = edges[i];\n    var source = link.source;\n    var target = link.target;\n    // addEdge may fail when source or target not exists\n    if (graph.addEdge(source, target, linkCount)) {\n      validEdges.push(link);\n      linkNameList.push(zrUtil.retrieve(convertOptionIdName(link.id, null), source + ' > ' + target));\n      linkCount++;\n    }\n  }\n  var coordSys = seriesModel.get('coordinateSystem');\n  var nodeData;\n  if (coordSys === 'cartesian2d' || coordSys === 'polar' || coordSys === 'matrix') {\n    nodeData = createSeriesData(nodes, seriesModel);\n  } else {\n    var coordSysCtor = CoordinateSystem.get(coordSys);\n    var coordDimensions = coordSysCtor ? coordSysCtor.dimensions || [] : [];\n    // FIXME: Some geo do not need `value` dimenson, whereas `calendar` needs\n    // `value` dimension, but graph need `value` dimension. It's better to\n    // uniform this behavior.\n    if (zrUtil.indexOf(coordDimensions, 'value') < 0) {\n      coordDimensions.concat(['value']);\n    }\n    var dimensions = prepareSeriesDataSchema(nodes, {\n      coordDimensions: coordDimensions,\n      encodeDefine: seriesModel.getEncode()\n    }).dimensions;\n    nodeData = new SeriesData(dimensions, seriesModel);\n    nodeData.initData(nodes);\n  }\n  var edgeData = new SeriesData(['value'], seriesModel);\n  edgeData.initData(validEdges, linkNameList);\n  beforeLink && beforeLink(nodeData, edgeData);\n  linkSeriesData({\n    mainData: nodeData,\n    struct: graph,\n    structAttr: 'graph',\n    datas: {\n      node: nodeData,\n      edge: edgeData\n    },\n    datasAttr: {\n      node: 'data',\n      edge: 'edgeData'\n    }\n  });\n  // Update dataIndex of nodes and edges because invalid edge may be removed\n  graph.update();\n  return graph;\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport SeriesData from '../../data/SeriesData.js';\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { defaultEmphasis } from '../../util/model.js';\nimport Model from '../../model/Model.js';\nimport createGraphFromNodeEdge from '../helper/createGraphFromNodeEdge.js';\nimport LegendVisualProvider from '../../visual/LegendVisualProvider.js';\nimport SeriesModel from '../../model/Series.js';\nimport { createTooltipMarkup } from '../../component/tooltip/tooltipMarkup.js';\nimport { defaultSeriesFormatTooltip } from '../../component/tooltip/seriesFormatTooltip.js';\nimport { initCurvenessList, createEdgeMapForCurveness } from '../helper/multipleGraphEdgeHelper.js';\nimport tokens from '../../visual/tokens.js';\nvar GraphSeriesModel = /** @class */function (_super) {\n  __extends(GraphSeriesModel, _super);\n  function GraphSeriesModel() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = GraphSeriesModel.type;\n    _this.hasSymbolVisual = true;\n    return _this;\n  }\n  GraphSeriesModel.prototype.init = function (option) {\n    _super.prototype.init.apply(this, arguments);\n    var self = this;\n    function getCategoriesData() {\n      return self._categoriesData;\n    }\n    // Provide data for legend select\n    this.legendVisualProvider = new LegendVisualProvider(getCategoriesData, getCategoriesData);\n    this.fillDataTextStyle(option.edges || option.links);\n    this._updateCategoriesData();\n  };\n  GraphSeriesModel.prototype.mergeOption = function (option) {\n    _super.prototype.mergeOption.apply(this, arguments);\n    this.fillDataTextStyle(option.edges || option.links);\n    this._updateCategoriesData();\n  };\n  GraphSeriesModel.prototype.mergeDefaultAndTheme = function (option) {\n    _super.prototype.mergeDefaultAndTheme.apply(this, arguments);\n    defaultEmphasis(option, 'edgeLabel', ['show']);\n  };\n  GraphSeriesModel.prototype.getInitialData = function (option, ecModel) {\n    var edges = option.edges || option.links || [];\n    var nodes = option.data || option.nodes || [];\n    var self = this;\n    if (nodes && edges) {\n      // auto curveness\n      initCurvenessList(this);\n      var graph = createGraphFromNodeEdge(nodes, edges, this, true, beforeLink);\n      zrUtil.each(graph.edges, function (edge) {\n        createEdgeMapForCurveness(edge.node1, edge.node2, this, edge.dataIndex);\n      }, this);\n      return graph.data;\n    }\n    function beforeLink(nodeData, edgeData) {\n      // Overwrite nodeData.getItemModel to\n      nodeData.wrapMethod('getItemModel', function (model) {\n        var categoriesModels = self._categoriesModels;\n        var categoryIdx = model.getShallow('category');\n        var categoryModel = categoriesModels[categoryIdx];\n        if (categoryModel) {\n          categoryModel.parentModel = model.parentModel;\n          model.parentModel = categoryModel;\n        }\n        return model;\n      });\n      // TODO Inherit resolveParentPath by default in Model#getModel?\n      var oldGetModel = Model.prototype.getModel;\n      function newGetModel(path, parentModel) {\n        var model = oldGetModel.call(this, path, parentModel);\n        model.resolveParentPath = resolveParentPath;\n        return model;\n      }\n      edgeData.wrapMethod('getItemModel', function (model) {\n        model.resolveParentPath = resolveParentPath;\n        model.getModel = newGetModel;\n        return model;\n      });\n      function resolveParentPath(pathArr) {\n        if (pathArr && (pathArr[0] === 'label' || pathArr[1] === 'label')) {\n          var newPathArr = pathArr.slice();\n          if (pathArr[0] === 'label') {\n            newPathArr[0] = 'edgeLabel';\n          } else if (pathArr[1] === 'label') {\n            newPathArr[1] = 'edgeLabel';\n          }\n          return newPathArr;\n        }\n        return pathArr;\n      }\n    }\n  };\n  GraphSeriesModel.prototype.getGraph = function () {\n    return this.getData().graph;\n  };\n  GraphSeriesModel.prototype.getEdgeData = function () {\n    return this.getGraph().edgeData;\n  };\n  GraphSeriesModel.prototype.getCategoriesData = function () {\n    return this._categoriesData;\n  };\n  GraphSeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\n    if (dataType === 'edge') {\n      var nodeData = this.getData();\n      var params = this.getDataParams(dataIndex, dataType);\n      var edge = nodeData.graph.getEdgeByIndex(dataIndex);\n      var sourceName = nodeData.getName(edge.node1.dataIndex);\n      var targetName = nodeData.getName(edge.node2.dataIndex);\n      var nameArr = [];\n      sourceName != null && nameArr.push(sourceName);\n      targetName != null && nameArr.push(targetName);\n      return createTooltipMarkup('nameValue', {\n        name: nameArr.join(' > '),\n        value: params.value,\n        noValue: params.value == null\n      });\n    }\n    // dataType === 'node' or empty\n    var nodeMarkup = defaultSeriesFormatTooltip({\n      series: this,\n      dataIndex: dataIndex,\n      multipleSeries: multipleSeries\n    });\n    return nodeMarkup;\n  };\n  GraphSeriesModel.prototype._updateCategoriesData = function () {\n    var categories = zrUtil.map(this.option.categories || [], function (category) {\n      // Data must has value\n      return category.value != null ? category : zrUtil.extend({\n        value: 0\n      }, category);\n    });\n    var categoriesData = new SeriesData(['value'], this);\n    categoriesData.initData(categories);\n    this._categoriesData = categoriesData;\n    this._categoriesModels = categoriesData.mapArray(function (idx) {\n      return categoriesData.getItemModel(idx);\n    });\n  };\n  GraphSeriesModel.prototype.setZoom = function (zoom) {\n    this.option.zoom = zoom;\n  };\n  GraphSeriesModel.prototype.setCenter = function (center) {\n    this.option.center = center;\n  };\n  GraphSeriesModel.prototype.isAnimationEnabled = function () {\n    return _super.prototype.isAnimationEnabled.call(this)\n    // Not enable animation when do force layout\n    && !(this.get('layout') === 'force' && this.get(['force', 'layoutAnimation']));\n  };\n  GraphSeriesModel.type = 'series.graph';\n  GraphSeriesModel.dependencies = ['grid', 'polar', 'geo', 'singleAxis', 'calendar'];\n  GraphSeriesModel.defaultOption = {\n    // zlevel: 0,\n    z: 2,\n    coordinateSystem: 'view',\n    // Default option for all coordinate systems\n    // xAxisIndex: 0,\n    // yAxisIndex: 0,\n    // polarIndex: 0,\n    // geoIndex: 0,\n    legendHoverLink: true,\n    layout: null,\n    // Configuration of circular layout\n    circular: {\n      rotateLabel: false\n    },\n    // Configuration of force directed layout\n    force: {\n      initLayout: null,\n      // Node repulsion. Can be an array to represent range.\n      repulsion: [0, 50],\n      gravity: 0.1,\n      // Initial friction\n      friction: 0.6,\n      // Edge length. Can be an array to represent range.\n      edgeLength: 30,\n      layoutAnimation: true\n    },\n    left: 'center',\n    top: 'center',\n    // right: null,\n    // bottom: null,\n    // width: '80%',\n    // height: '80%',\n    symbol: 'circle',\n    symbolSize: 10,\n    edgeSymbol: ['none', 'none'],\n    edgeSymbolSize: 10,\n    edgeLabel: {\n      position: 'middle',\n      distance: 5\n    },\n    draggable: false,\n    roam: false,\n    // Default on center of graph\n    center: null,\n    zoom: 1,\n    // Symbol size scale ratio in roam\n    nodeScaleRatio: 0.6,\n    // cursor: null,\n    // categories: [],\n    // data: []\n    // Or\n    // nodes: []\n    //\n    // links: []\n    // Or\n    // edges: []\n    label: {\n      show: false,\n      formatter: '{b}'\n    },\n    itemStyle: {},\n    lineStyle: {\n      // Don't use tokens.color.border because of the opacity\n      color: tokens.color.neutral50,\n      width: 1,\n      opacity: 0.5\n    },\n    emphasis: {\n      scale: true,\n      label: {\n        show: true\n      }\n    },\n    select: {\n      itemStyle: {\n        borderColor: tokens.color.primary\n      }\n    }\n  };\n  return GraphSeriesModel;\n}(SeriesModel);\nexport default GraphSeriesModel;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport categoryFilter from './categoryFilter.js';\nimport categoryVisual from './categoryVisual.js';\nimport edgeVisual from './edgeVisual.js';\nimport simpleLayout from './simpleLayout.js';\nimport circularLayout from './circularLayout.js';\nimport forceLayout from './forceLayout.js';\nimport createView from './createView.js';\nimport View from '../../coord/View.js';\nimport GraphView from './GraphView.js';\nimport GraphSeriesModel from './GraphSeries.js';\nimport { updateCenterAndZoomInAction } from '../../component/helper/roamHelper.js';\nimport { noop } from 'zrender/lib/core/util.js';\nexport function install(registers) {\n  registers.registerChartView(GraphView);\n  registers.registerSeriesModel(GraphSeriesModel);\n  registers.registerProcessor(categoryFilter);\n  registers.registerVisual(categoryVisual);\n  registers.registerVisual(edgeVisual);\n  registers.registerLayout(simpleLayout);\n  registers.registerLayout(registers.PRIORITY.VISUAL.POST_CHART_LAYOUT, circularLayout);\n  registers.registerLayout(forceLayout);\n  registers.registerCoordinateSystem('graphView', {\n    dimensions: View.dimensions,\n    create: createView\n  });\n  // Register legacy focus actions\n  registers.registerAction({\n    type: 'focusNodeAdjacency',\n    event: 'focusNodeAdjacency',\n    update: 'series:focusNodeAdjacency'\n  }, noop);\n  registers.registerAction({\n    type: 'unfocusNodeAdjacency',\n    event: 'unfocusNodeAdjacency',\n    update: 'series:unfocusNodeAdjacency'\n  }, noop);\n  // Register roam action.\n  registers.registerAction({\n    type: 'graphRoam',\n    event: 'graphRoam',\n    update: 'none'\n  }, function (payload, ecModel, api) {\n    ecModel.eachComponent({\n      mainType: 'series',\n      query: payload\n    }, function (seriesModel) {\n      var graphView = api.getViewOfSeriesModel(seriesModel);\n      if (graphView) {\n        if (payload.dx != null && payload.dy != null) {\n          graphView.updateViewOnPan(seriesModel, api, payload);\n        }\n        if (payload.zoom != null && payload.originX != null && payload.originY != null) {\n          graphView.updateViewOnZoom(seriesModel, api, payload);\n        }\n      }\n      var coordSys = seriesModel.coordinateSystem;\n      var res = updateCenterAndZoomInAction(coordSys, payload, seriesModel.get('scaleLimit'));\n      seriesModel.setCenter && seriesModel.setCenter(res.center);\n      seriesModel.setZoom && seriesModel.setZoom(res.zoom);\n    });\n  });\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport { extend, retrieve3 } from 'zrender/lib/core/util.js';\nimport * as graphic from '../../util/graphic.js';\nimport { getSectorCornerRadius } from '../helper/sectorHelper.js';\nimport { getLabelStatesModels, setLabelStyle } from '../../label/labelStyle.js';\nimport { setStatesStylesFromModel, toggleHoverEmphasis } from '../../util/states.js';\nimport { getECData } from '../../util/innerStore.js';\nvar ChordPiece = /** @class */function (_super) {\n  __extends(ChordPiece, _super);\n  function ChordPiece(data, idx, startAngle) {\n    var _this = _super.call(this) || this;\n    getECData(_this).dataType = 'node';\n    _this.z2 = 2;\n    var text = new graphic.Text();\n    _this.setTextContent(text);\n    _this.updateData(data, idx, startAngle, true);\n    return _this;\n  }\n  ChordPiece.prototype.updateData = function (data, idx, startAngle, firstCreate) {\n    var sector = this;\n    var node = data.graph.getNodeByIndex(idx);\n    var seriesModel = data.hostModel;\n    var itemModel = node.getModel();\n    var emphasisModel = itemModel.getModel('emphasis');\n    // layout position is the center of the sector\n    var layout = data.getItemLayout(idx);\n    var shape = extend(getSectorCornerRadius(itemModel.getModel('itemStyle'), layout, true), layout);\n    var el = this;\n    // Ignore NaN data.\n    if (isNaN(shape.startAngle)) {\n      // Use NaN shape to avoid drawing shape.\n      el.setShape(shape);\n      return;\n    }\n    if (firstCreate) {\n      el.setShape(shape);\n    } else {\n      graphic.updateProps(el, {\n        shape: shape\n      }, seriesModel, idx);\n    }\n    var sectorShape = extend(getSectorCornerRadius(itemModel.getModel('itemStyle'), layout, true), layout);\n    sector.setShape(sectorShape);\n    sector.useStyle(data.getItemVisual(idx, 'style'));\n    setStatesStylesFromModel(sector, itemModel);\n    this._updateLabel(seriesModel, itemModel, node);\n    data.setItemGraphicEl(idx, el);\n    setStatesStylesFromModel(el, itemModel, 'itemStyle');\n    // Add focus/blur states handling\n    var focus = emphasisModel.get('focus');\n    toggleHoverEmphasis(this, focus === 'adjacency' ? node.getAdjacentDataIndices() : focus, emphasisModel.get('blurScope'), emphasisModel.get('disabled'));\n  };\n  ChordPiece.prototype._updateLabel = function (seriesModel, itemModel, node) {\n    var label = this.getTextContent();\n    var layout = node.getLayout();\n    var midAngle = (layout.startAngle + layout.endAngle) / 2;\n    var dx = Math.cos(midAngle);\n    var dy = Math.sin(midAngle);\n    var normalLabelModel = itemModel.getModel('label');\n    label.ignore = !normalLabelModel.get('show');\n    // Set label style\n    var labelStateModels = getLabelStatesModels(itemModel);\n    var style = node.getVisual('style');\n    setLabelStyle(label, labelStateModels, {\n      labelFetcher: {\n        getFormattedLabel: function (dataIndex, stateName, dataType, labelDimIndex, formatter, extendParams) {\n          return seriesModel.getFormattedLabel(dataIndex, stateName, 'node', labelDimIndex,\n          // ensure edgeLabel formatter is provided\n          // to prevent the inheritance from `label.formatter` of the series\n          retrieve3(formatter, labelStateModels.normal && labelStateModels.normal.get('formatter'), itemModel.get('name')), extendParams);\n        }\n      },\n      labelDataIndex: node.dataIndex,\n      defaultText: node.dataIndex + '',\n      inheritColor: style.fill,\n      defaultOpacity: style.opacity,\n      defaultOutsidePosition: 'startArc'\n    });\n    // Set label position\n    var labelPosition = normalLabelModel.get('position') || 'outside';\n    var labelPadding = normalLabelModel.get('distance') || 0;\n    var r;\n    if (labelPosition === 'outside') {\n      r = layout.r + labelPadding;\n    } else {\n      r = (layout.r + layout.r0) / 2;\n    }\n    this.textConfig = {\n      inside: labelPosition !== 'outside'\n    };\n    var align = labelPosition !== 'outside' ? normalLabelModel.get('align') || 'center' : dx > 0 ? 'left' : 'right';\n    var verticalAlign = labelPosition !== 'outside' ? normalLabelModel.get('verticalAlign') || 'middle' : dy > 0 ? 'top' : 'bottom';\n    label.attr({\n      x: dx * r + layout.cx,\n      y: dy * r + layout.cy,\n      rotation: 0,\n      style: {\n        align: align,\n        verticalAlign: verticalAlign\n      }\n    });\n  };\n  return ChordPiece;\n}(graphic.Sector);\nexport default ChordPiece;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport { extend, isString } from 'zrender/lib/core/util.js';\nimport * as graphic from '../../util/graphic.js';\nimport { getSectorCornerRadius } from '../helper/sectorHelper.js';\nimport { saveOldStyle } from '../../animation/basicTransition.js';\nimport { setStatesStylesFromModel, toggleHoverEmphasis } from '../../util/states.js';\nimport { getECData } from '../../util/innerStore.js';\nvar ChordPathShape = /** @class */function () {\n  function ChordPathShape() {\n    // Souce node, two points forming an arc\n    this.s1 = [0, 0];\n    this.s2 = [0, 0];\n    this.sStartAngle = 0;\n    this.sEndAngle = 0;\n    // Target node, two points forming an arc\n    this.t1 = [0, 0];\n    this.t2 = [0, 0];\n    this.tStartAngle = 0;\n    this.tEndAngle = 0;\n    this.cx = 0;\n    this.cy = 0;\n    // series.r0 of ChordSeries\n    this.r = 0;\n    this.clockwise = true;\n  }\n  return ChordPathShape;\n}();\nexport { ChordPathShape };\nvar ChordEdge = /** @class */function (_super) {\n  __extends(ChordEdge, _super);\n  function ChordEdge(nodeData, edgeData, edgeIdx, startAngle) {\n    var _this = _super.call(this) || this;\n    getECData(_this).dataType = 'edge';\n    _this.updateData(nodeData, edgeData, edgeIdx, startAngle, true);\n    return _this;\n  }\n  ChordEdge.prototype.buildPath = function (ctx, shape) {\n    // Start from n11\n    ctx.moveTo(shape.s1[0], shape.s1[1]);\n    var ratio = 0.7;\n    var clockwise = shape.clockwise;\n    // Draw the arc from n11 to n12\n    ctx.arc(shape.cx, shape.cy, shape.r, shape.sStartAngle, shape.sEndAngle, !clockwise);\n    // Bezier curve to cp1 and then to n21\n    ctx.bezierCurveTo((shape.cx - shape.s2[0]) * ratio + shape.s2[0], (shape.cy - shape.s2[1]) * ratio + shape.s2[1], (shape.cx - shape.t1[0]) * ratio + shape.t1[0], (shape.cy - shape.t1[1]) * ratio + shape.t1[1], shape.t1[0], shape.t1[1]);\n    // Draw the arc from n21 to n22\n    ctx.arc(shape.cx, shape.cy, shape.r, shape.tStartAngle, shape.tEndAngle, !clockwise);\n    // Bezier curve back to cp2 and then to n11\n    ctx.bezierCurveTo((shape.cx - shape.t2[0]) * ratio + shape.t2[0], (shape.cy - shape.t2[1]) * ratio + shape.t2[1], (shape.cx - shape.s1[0]) * ratio + shape.s1[0], (shape.cy - shape.s1[1]) * ratio + shape.s1[1], shape.s1[0], shape.s1[1]);\n    ctx.closePath();\n  };\n  ChordEdge.prototype.updateData = function (nodeData, edgeData, edgeIdx, startAngle, firstCreate) {\n    var seriesModel = nodeData.hostModel;\n    var edge = edgeData.graph.getEdgeByIndex(edgeIdx);\n    var layout = edge.getLayout();\n    var itemModel = edge.node1.getModel();\n    var edgeModel = edgeData.getItemModel(edge.dataIndex);\n    var lineStyle = edgeModel.getModel('lineStyle');\n    var emphasisModel = edgeModel.getModel('emphasis');\n    var focus = emphasisModel.get('focus');\n    var shape = extend(getSectorCornerRadius(itemModel.getModel('itemStyle'), layout, true), layout);\n    var el = this;\n    // Ignore NaN data.\n    if (isNaN(shape.sStartAngle) || isNaN(shape.tStartAngle)) {\n      // Use NaN shape to avoid drawing shape.\n      el.setShape(shape);\n      return;\n    }\n    if (firstCreate) {\n      el.setShape(shape);\n      applyEdgeFill(el, edge, nodeData, lineStyle);\n    } else {\n      saveOldStyle(el);\n      applyEdgeFill(el, edge, nodeData, lineStyle);\n      graphic.updateProps(el, {\n        shape: shape\n      }, seriesModel, edgeIdx);\n    }\n    toggleHoverEmphasis(this, focus === 'adjacency' ? edge.getAdjacentDataIndices() : focus, emphasisModel.get('blurScope'), emphasisModel.get('disabled'));\n    setStatesStylesFromModel(el, edgeModel, 'lineStyle');\n    edgeData.setItemGraphicEl(edge.dataIndex, el);\n  };\n  return ChordEdge;\n}(graphic.Path);\nexport { ChordEdge };\nfunction applyEdgeFill(edgeShape, edge, nodeData, lineStyleModel) {\n  var node1 = edge.node1;\n  var node2 = edge.node2;\n  var edgeStyle = edgeShape.style;\n  edgeShape.setStyle(lineStyleModel.getLineStyle());\n  var color = lineStyleModel.get('color');\n  switch (color) {\n    case 'source':\n      // TODO: use visual and node1.getVisual('color');\n      edgeStyle.fill = nodeData.getItemVisual(node1.dataIndex, 'style').fill;\n      edgeStyle.decal = node1.getVisual('style').decal;\n      break;\n    case 'target':\n      edgeStyle.fill = nodeData.getItemVisual(node2.dataIndex, 'style').fill;\n      edgeStyle.decal = node2.getVisual('style').decal;\n      break;\n    case 'gradient':\n      var sourceColor = nodeData.getItemVisual(node1.dataIndex, 'style').fill;\n      var targetColor = nodeData.getItemVisual(node2.dataIndex, 'style').fill;\n      if (isString(sourceColor) && isString(targetColor)) {\n        // Gradient direction is perpendicular to the mid-angles\n        // of source and target nodes.\n        var shape = edgeShape.shape;\n        var sMidX = (shape.s1[0] + shape.s2[0]) / 2;\n        var sMidY = (shape.s1[1] + shape.s2[1]) / 2;\n        var tMidX = (shape.t1[0] + shape.t2[0]) / 2;\n        var tMidY = (shape.t1[1] + shape.t2[1]) / 2;\n        edgeStyle.fill = new graphic.LinearGradient(sMidX, sMidY, tMidX, tMidY, [{\n          offset: 0,\n          color: sourceColor\n        }, {\n          offset: 1,\n          color: targetColor\n        }], true);\n      }\n      break;\n  }\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as graphic from '../../util/graphic.js';\nimport ChartView from '../../view/Chart.js';\nimport ChordPiece from './ChordPiece.js';\nimport { ChordEdge } from './ChordEdge.js';\nimport { parsePercent } from '../../util/number.js';\nimport { getECData } from '../../util/innerStore.js';\nvar RADIAN = Math.PI / 180;\nvar ChordView = /** @class */function (_super) {\n  __extends(ChordView, _super);\n  function ChordView() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = ChordView.type;\n    return _this;\n  }\n  ChordView.prototype.init = function (ecModel, api) {};\n  ChordView.prototype.render = function (seriesModel, ecModel, api) {\n    var data = seriesModel.getData();\n    var oldData = this._data;\n    var group = this.group;\n    var startAngle = -seriesModel.get('startAngle') * RADIAN;\n    data.diff(oldData).add(function (newIdx) {\n      /* Consider the case when there are only two nodes A and B,\n       * and there is a link between A and B.\n       * At first, they are both disselected from legend. And then\n       * when A is selected, A will go into `add` method. But since\n       * there are no edges to be displayed, A should not be added.\n       * So we should only add A when layout is defined.\n       */\n      var layout = data.getItemLayout(newIdx);\n      if (layout) {\n        var el = new ChordPiece(data, newIdx, startAngle);\n        getECData(el).dataIndex = newIdx;\n        group.add(el);\n      }\n    }).update(function (newIdx, oldIdx) {\n      var el = oldData.getItemGraphicEl(oldIdx);\n      var layout = data.getItemLayout(newIdx);\n      /* Consider the case when there are only two nodes A and B,\n       * and there is a link between A and B.\n       * and when A is disselected from legend, there should be\n       * nothing to display. But in the `data.diff` method, B will go\n       * into `update` method and having no layout.\n       * In this case, we need to remove B.\n       */\n      if (!layout) {\n        el && graphic.removeElementWithFadeOut(el, seriesModel, oldIdx);\n        return;\n      }\n      if (!el) {\n        el = new ChordPiece(data, newIdx, startAngle);\n      } else {\n        el.updateData(data, newIdx, startAngle);\n      }\n      group.add(el);\n    }).remove(function (oldIdx) {\n      var el = oldData.getItemGraphicEl(oldIdx);\n      el && graphic.removeElementWithFadeOut(el, seriesModel, oldIdx);\n    }).execute();\n    if (!oldData) {\n      var center = seriesModel.get('center');\n      this.group.scaleX = 0.01;\n      this.group.scaleY = 0.01;\n      this.group.originX = parsePercent(center[0], api.getWidth());\n      this.group.originY = parsePercent(center[1], api.getHeight());\n      graphic.initProps(this.group, {\n        scaleX: 1,\n        scaleY: 1\n      }, seriesModel);\n    }\n    this._data = data;\n    this.renderEdges(seriesModel, startAngle);\n  };\n  ChordView.prototype.renderEdges = function (seriesModel, startAngle) {\n    var nodeData = seriesModel.getData();\n    var edgeData = seriesModel.getEdgeData();\n    var oldData = this._edgeData;\n    var group = this.group;\n    edgeData.diff(oldData).add(function (newIdx) {\n      var el = new ChordEdge(nodeData, edgeData, newIdx, startAngle);\n      getECData(el).dataIndex = newIdx;\n      group.add(el);\n    }).update(function (newIdx, oldIdx) {\n      var el = oldData.getItemGraphicEl(oldIdx);\n      el.updateData(nodeData, edgeData, newIdx, startAngle);\n      group.add(el);\n    }).remove(function (oldIdx) {\n      var el = oldData.getItemGraphicEl(oldIdx);\n      el && graphic.removeElementWithFadeOut(el, seriesModel, oldIdx);\n    }).execute();\n    this._edgeData = edgeData;\n  };\n  ChordView.prototype.dispose = function () {};\n  ChordView.type = 'chord';\n  return ChordView;\n}(ChartView);\nexport default ChordView;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport Model from '../../model/Model.js';\nimport SeriesModel from '../../model/Series.js';\nimport createGraphFromNodeEdge from '../helper/createGraphFromNodeEdge.js';\nimport { createTooltipMarkup } from '../../component/tooltip/tooltipMarkup.js';\nimport LegendVisualProvider from '../../visual/LegendVisualProvider.js';\nimport * as zrUtil from 'zrender/lib/core/util.js';\nvar ChordSeriesModel = /** @class */function (_super) {\n  __extends(ChordSeriesModel, _super);\n  function ChordSeriesModel() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = ChordSeriesModel.type;\n    return _this;\n  }\n  ChordSeriesModel.prototype.init = function (option) {\n    _super.prototype.init.apply(this, arguments);\n    this.fillDataTextStyle(option.edges || option.links);\n    // Enable legend selection for each data item\n    this.legendVisualProvider = new LegendVisualProvider(zrUtil.bind(this.getData, this), zrUtil.bind(this.getRawData, this));\n  };\n  ChordSeriesModel.prototype.mergeOption = function (option) {\n    _super.prototype.mergeOption.apply(this, arguments);\n    this.fillDataTextStyle(option.edges || option.links);\n  };\n  ChordSeriesModel.prototype.getInitialData = function (option, ecModel) {\n    var edges = option.edges || option.links || [];\n    var nodes = option.data || option.nodes || [];\n    if (nodes && edges) {\n      var graph = createGraphFromNodeEdge(nodes, edges, this, true, beforeLink);\n      return graph.data;\n    }\n    function beforeLink(nodeData, edgeData) {\n      // TODO Inherit resolveParentPath by default in Model#getModel?\n      var oldGetModel = Model.prototype.getModel;\n      function newGetModel(path, parentModel) {\n        var model = oldGetModel.call(this, path, parentModel);\n        model.resolveParentPath = resolveParentPath;\n        return model;\n      }\n      edgeData.wrapMethod('getItemModel', function (model) {\n        model.resolveParentPath = resolveParentPath;\n        model.getModel = newGetModel;\n        return model;\n      });\n      function resolveParentPath(pathArr) {\n        if (pathArr && (pathArr[0] === 'label' || pathArr[1] === 'label')) {\n          var newPathArr = pathArr.slice();\n          if (pathArr[0] === 'label') {\n            newPathArr[0] = 'edgeLabel';\n          } else if (pathArr[1] === 'label') {\n            newPathArr[1] = 'edgeLabel';\n          }\n          return newPathArr;\n        }\n        return pathArr;\n      }\n    }\n  };\n  ChordSeriesModel.prototype.getGraph = function () {\n    return this.getData().graph;\n  };\n  ChordSeriesModel.prototype.getEdgeData = function () {\n    return this.getGraph().edgeData;\n  };\n  ChordSeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\n    var params = this.getDataParams(dataIndex, dataType);\n    if (dataType === 'edge') {\n      var nodeData = this.getData();\n      var edge = nodeData.graph.getEdgeByIndex(dataIndex);\n      var sourceName = nodeData.getName(edge.node1.dataIndex);\n      var targetName = nodeData.getName(edge.node2.dataIndex);\n      var nameArr = [];\n      sourceName != null && nameArr.push(sourceName);\n      targetName != null && nameArr.push(targetName);\n      return createTooltipMarkup('nameValue', {\n        name: nameArr.join(' > '),\n        value: params.value,\n        noValue: params.value == null\n      });\n    }\n    // dataType === 'node' or empty\n    return createTooltipMarkup('nameValue', {\n      name: params.name,\n      value: params.value,\n      noValue: params.value == null\n    });\n  };\n  ChordSeriesModel.prototype.getDataParams = function (dataIndex, dataType) {\n    var params = _super.prototype.getDataParams.call(this, dataIndex, dataType);\n    if (dataType === 'node') {\n      var nodeData = this.getData();\n      var node = this.getGraph().getNodeByIndex(dataIndex);\n      // Set name if not already set\n      if (params.name == null) {\n        params.name = nodeData.getName(dataIndex);\n      }\n      // Set value if not already set\n      if (params.value == null) {\n        var nodeValue = node.getLayout().value;\n        params.value = nodeValue;\n      }\n    }\n    return params;\n  };\n  ChordSeriesModel.type = 'series.chord';\n  ChordSeriesModel.defaultOption = {\n    // zlevel: 0,\n    z: 2,\n    coordinateSystem: 'none',\n    legendHoverLink: true,\n    colorBy: 'data',\n    left: 0,\n    top: 0,\n    right: 0,\n    bottom: 0,\n    width: null,\n    height: null,\n    center: ['50%', '50%'],\n    radius: ['70%', '80%'],\n    clockwise: true,\n    startAngle: 90,\n    endAngle: 'auto',\n    minAngle: 0,\n    padAngle: 3,\n    itemStyle: {\n      borderRadius: [0, 0, 5, 5]\n    },\n    lineStyle: {\n      width: 0,\n      color: 'source',\n      opacity: 0.2\n    },\n    label: {\n      show: true,\n      position: 'outside',\n      distance: 5\n    },\n    emphasis: {\n      focus: 'adjacency',\n      lineStyle: {\n        opacity: 0.5\n      }\n    }\n  };\n  return ChordSeriesModel;\n}(SeriesModel);\nexport default ChordSeriesModel;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { normalizeArcAngles } from 'zrender/lib/core/PathProxy.js';\nimport { getCircleLayout } from '../../util/layout.js';\nvar RADIAN = Math.PI / 180;\nexport default function chordCircularLayout(ecModel, api) {\n  ecModel.eachSeriesByType('chord', function (seriesModel) {\n    chordLayout(seriesModel, api);\n  });\n}\nfunction chordLayout(seriesModel, api) {\n  var nodeData = seriesModel.getData();\n  var nodeGraph = nodeData.graph;\n  var edgeData = seriesModel.getEdgeData();\n  var edgeCount = edgeData.count();\n  if (!edgeCount) {\n    return;\n  }\n  var _a = getCircleLayout(seriesModel, api),\n    cx = _a.cx,\n    cy = _a.cy,\n    r = _a.r,\n    r0 = _a.r0;\n  var padAngle = Math.max((seriesModel.get('padAngle') || 0) * RADIAN, 0);\n  var minAngle = Math.max((seriesModel.get('minAngle') || 0) * RADIAN, 0);\n  var startAngle = -seriesModel.get('startAngle') * RADIAN;\n  var endAngle = startAngle + Math.PI * 2;\n  var clockwise = seriesModel.get('clockwise');\n  var dir = clockwise ? 1 : -1;\n  // Normalize angles\n  var angles = [startAngle, endAngle];\n  normalizeArcAngles(angles, !clockwise);\n  var normalizedStartAngle = angles[0],\n    normalizedEndAngle = angles[1];\n  var totalAngle = normalizedEndAngle - normalizedStartAngle;\n  var allZero = nodeData.getSum('value') === 0 && edgeData.getSum('value') === 0;\n  // Sum of each node's edge values\n  var nodeValues = [];\n  var renderedNodeCount = 0;\n  nodeGraph.eachEdge(function (edge) {\n    // All links use the same value 1 when allZero is true\n    var value = allZero ? 1 : edge.getValue('value');\n    if (allZero && (value > 0 || minAngle)) {\n      // When allZero is true, angle is in direct proportion to number\n      // of links both in and out of the node.\n      renderedNodeCount += 2;\n    }\n    var node1Index = edge.node1.dataIndex;\n    var node2Index = edge.node2.dataIndex;\n    nodeValues[node1Index] = (nodeValues[node1Index] || 0) + value;\n    nodeValues[node2Index] = (nodeValues[node2Index] || 0) + value;\n  });\n  // Update nodeValues with data.value if exists\n  var nodeValueSum = 0;\n  nodeGraph.eachNode(function (node) {\n    var dataValue = node.getValue('value');\n    if (!isNaN(dataValue)) {\n      nodeValues[node.dataIndex] = Math.max(dataValue, nodeValues[node.dataIndex] || 0);\n    }\n    if (!allZero && (nodeValues[node.dataIndex] > 0 || minAngle)) {\n      // When allZero is false, angle is in direct proportion to node's\n      // value\n      renderedNodeCount++;\n    }\n    nodeValueSum += nodeValues[node.dataIndex] || 0;\n  });\n  if (renderedNodeCount === 0 || nodeValueSum === 0) {\n    return;\n  }\n  if (padAngle * renderedNodeCount >= Math.abs(totalAngle)) {\n    // Not enough angle to render the pad, minAngle has higher priority, and padAngle takes the rest\n    padAngle = Math.max(0, (Math.abs(totalAngle) - minAngle * renderedNodeCount) / renderedNodeCount);\n  }\n  if ((padAngle + minAngle) * renderedNodeCount >= Math.abs(totalAngle)) {\n    // Not enough angle to render the minAngle, so ignore the minAngle\n    minAngle = (Math.abs(totalAngle) - padAngle * renderedNodeCount) / renderedNodeCount;\n  }\n  var unitAngle = (totalAngle - padAngle * renderedNodeCount * dir) / nodeValueSum;\n  var totalDeficit = 0; // sum of deficits of nodes with span < minAngle\n  var totalSurplus = 0; // sum of (spans - minAngle) of nodes with span > minAngle\n  var totalSurplusSpan = 0; // sum of spans of nodes with span > minAngle\n  var minSurplus = Infinity; // min of (spans - minAngle) of nodes with span > minAngle\n  nodeGraph.eachNode(function (node) {\n    var value = nodeValues[node.dataIndex] || 0;\n    var spanAngle = unitAngle * (nodeValueSum ? value : 1) * dir;\n    if (Math.abs(spanAngle) < minAngle) {\n      totalDeficit += minAngle - Math.abs(spanAngle);\n    } else {\n      minSurplus = Math.min(minSurplus, Math.abs(spanAngle) - minAngle);\n      totalSurplus += Math.abs(spanAngle) - minAngle;\n      totalSurplusSpan += Math.abs(spanAngle);\n    }\n    node.setLayout({\n      angle: spanAngle,\n      value: value\n    });\n  });\n  var surplusAsMuchAsPossible = false;\n  if (totalDeficit > totalSurplus) {\n    // Not enough angle to spread the nodes, scale all\n    var scale_1 = totalDeficit / totalSurplus;\n    nodeGraph.eachNode(function (node) {\n      var spanAngle = node.getLayout().angle;\n      if (Math.abs(spanAngle) >= minAngle) {\n        node.setLayout({\n          angle: spanAngle * scale_1,\n          ratio: scale_1\n        }, true);\n      } else {\n        node.setLayout({\n          angle: minAngle,\n          ratio: minAngle === 0 ? 1 : spanAngle / minAngle\n        }, true);\n      }\n    });\n  } else {\n    // For example, if totalDeficit is 60 degrees and totalSurplus is 70\n    // degrees but one of the sector can only reduced by 1 degree,\n    // if we decrease it with the ratio of value to other surplused nodes,\n    // it will have smaller angle than minAngle itself.\n    // So we need to borrow some angle from other nodes.\n    nodeGraph.eachNode(function (node) {\n      if (surplusAsMuchAsPossible) {\n        return;\n      }\n      var spanAngle = node.getLayout().angle;\n      var borrowRatio = Math.min(spanAngle / totalSurplusSpan, 1);\n      var borrowAngle = borrowRatio * totalDeficit;\n      if (spanAngle - borrowAngle < minAngle) {\n        // It will have less than minAngle after borrowing\n        surplusAsMuchAsPossible = true;\n      }\n    });\n  }\n  var restDeficit = totalDeficit;\n  nodeGraph.eachNode(function (node) {\n    if (restDeficit <= 0) {\n      return;\n    }\n    var spanAngle = node.getLayout().angle;\n    if (spanAngle > minAngle && minAngle > 0) {\n      var borrowRatio = surplusAsMuchAsPossible ? 1 : Math.min(spanAngle / totalSurplusSpan, 1);\n      var maxBorrowAngle = spanAngle - minAngle;\n      var borrowAngle = Math.min(maxBorrowAngle, Math.min(restDeficit, totalDeficit * borrowRatio));\n      restDeficit -= borrowAngle;\n      node.setLayout({\n        angle: spanAngle - borrowAngle,\n        ratio: (spanAngle - borrowAngle) / spanAngle\n      }, true);\n    } else if (minAngle > 0) {\n      node.setLayout({\n        angle: minAngle,\n        ratio: spanAngle === 0 ? 1 : minAngle / spanAngle\n      }, true);\n    }\n  });\n  var angle = normalizedStartAngle;\n  var edgeAccAngle = [];\n  nodeGraph.eachNode(function (node) {\n    var spanAngle = Math.max(node.getLayout().angle, minAngle);\n    node.setLayout({\n      cx: cx,\n      cy: cy,\n      r0: r0,\n      r: r,\n      startAngle: angle,\n      endAngle: angle + spanAngle * dir,\n      clockwise: clockwise\n    }, true);\n    edgeAccAngle[node.dataIndex] = angle;\n    angle += (spanAngle + padAngle) * dir;\n  });\n  nodeGraph.eachEdge(function (edge) {\n    var value = allZero ? 1 : edge.getValue('value');\n    var spanAngle = unitAngle * (nodeValueSum ? value : 1) * dir;\n    var node1Index = edge.node1.dataIndex;\n    var sStartAngle = edgeAccAngle[node1Index] || 0;\n    var sSpan = Math.abs((edge.node1.getLayout().ratio || 1) * spanAngle);\n    var sEndAngle = sStartAngle + sSpan * dir;\n    var s1 = [cx + r0 * Math.cos(sStartAngle), cy + r0 * Math.sin(sStartAngle)];\n    var s2 = [cx + r0 * Math.cos(sEndAngle), cy + r0 * Math.sin(sEndAngle)];\n    var node2Index = edge.node2.dataIndex;\n    var tStartAngle = edgeAccAngle[node2Index] || 0;\n    var tSpan = Math.abs((edge.node2.getLayout().ratio || 1) * spanAngle);\n    var tEndAngle = tStartAngle + tSpan * dir;\n    var t1 = [cx + r0 * Math.cos(tStartAngle), cy + r0 * Math.sin(tStartAngle)];\n    var t2 = [cx + r0 * Math.cos(tEndAngle), cy + r0 * Math.sin(tEndAngle)];\n    edge.setLayout({\n      s1: s1,\n      s2: s2,\n      sStartAngle: sStartAngle,\n      sEndAngle: sEndAngle,\n      t1: t1,\n      t2: t2,\n      tStartAngle: tStartAngle,\n      tEndAngle: tEndAngle,\n      cx: cx,\n      cy: cy,\n      r: r0,\n      value: value,\n      clockwise: clockwise\n    });\n    edgeAccAngle[node1Index] = sEndAngle;\n    edgeAccAngle[node2Index] = tEndAngle;\n  });\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport ChordView from './ChordView.js';\nimport ChordSeriesModel from './ChordSeries.js';\nimport chordLayout from './chordLayout.js';\nimport dataFilter from '../../processor/dataFilter.js';\nexport function install(registers) {\n  registers.registerChartView(ChordView);\n  registers.registerSeriesModel(ChordSeriesModel);\n  registers.registerLayout(registers.PRIORITY.VISUAL.POST_CHART_LAYOUT, chordLayout);\n  // Add data filter processor\n  registers.registerProcessor(dataFilter('chord'));\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport Path from 'zrender/lib/graphic/Path.js';\nvar PointerShape = /** @class */function () {\n  function PointerShape() {\n    this.angle = 0;\n    this.width = 10;\n    this.r = 10;\n    this.x = 0;\n    this.y = 0;\n  }\n  return PointerShape;\n}();\nvar PointerPath = /** @class */function (_super) {\n  __extends(PointerPath, _super);\n  function PointerPath(opts) {\n    var _this = _super.call(this, opts) || this;\n    _this.type = 'pointer';\n    return _this;\n  }\n  PointerPath.prototype.getDefaultShape = function () {\n    return new PointerShape();\n  };\n  PointerPath.prototype.buildPath = function (ctx, shape) {\n    var mathCos = Math.cos;\n    var mathSin = Math.sin;\n    var r = shape.r;\n    var width = shape.width;\n    var angle = shape.angle;\n    var x = shape.x - mathCos(angle) * width * (width >= r / 3 ? 1 : 2);\n    var y = shape.y - mathSin(angle) * width * (width >= r / 3 ? 1 : 2);\n    angle = shape.angle - Math.PI / 2;\n    ctx.moveTo(x, y);\n    ctx.lineTo(shape.x + mathCos(angle) * width, shape.y + mathSin(angle) * width);\n    ctx.lineTo(shape.x + mathCos(shape.angle) * r, shape.y + mathSin(shape.angle) * r);\n    ctx.lineTo(shape.x - mathCos(angle) * width, shape.y - mathSin(angle) * width);\n    ctx.lineTo(x, y);\n  };\n  return PointerPath;\n}(Path);\nexport default PointerPath;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport PointerPath from './PointerPath.js';\nimport * as graphic from '../../util/graphic.js';\nimport { setStatesStylesFromModel, toggleHoverEmphasis } from '../../util/states.js';\nimport { createTextStyle, setLabelValueAnimation, animateLabelValue } from '../../label/labelStyle.js';\nimport ChartView from '../../view/Chart.js';\nimport { parsePercent, round, linearMap } from '../../util/number.js';\nimport Sausage from '../../util/shape/sausage.js';\nimport { createSymbol } from '../../util/symbol.js';\nimport ZRImage from 'zrender/lib/graphic/Image.js';\nimport { extend, isFunction, isString, isNumber, each } from 'zrender/lib/core/util.js';\nimport { setCommonECData } from '../../util/innerStore.js';\nimport { normalizeArcAngles } from 'zrender/lib/core/PathProxy.js';\nfunction parsePosition(seriesModel, api) {\n  var center = seriesModel.get('center');\n  var width = api.getWidth();\n  var height = api.getHeight();\n  var size = Math.min(width, height);\n  var cx = parsePercent(center[0], api.getWidth());\n  var cy = parsePercent(center[1], api.getHeight());\n  var r = parsePercent(seriesModel.get('radius'), size / 2);\n  return {\n    cx: cx,\n    cy: cy,\n    r: r\n  };\n}\nfunction formatLabel(value, labelFormatter) {\n  var label = value == null ? '' : value + '';\n  if (labelFormatter) {\n    if (isString(labelFormatter)) {\n      label = labelFormatter.replace('{value}', label);\n    } else if (isFunction(labelFormatter)) {\n      label = labelFormatter(value);\n    }\n  }\n  return label;\n}\nvar GaugeView = /** @class */function (_super) {\n  __extends(GaugeView, _super);\n  function GaugeView() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = GaugeView.type;\n    return _this;\n  }\n  GaugeView.prototype.render = function (seriesModel, ecModel, api) {\n    this.group.removeAll();\n    var colorList = seriesModel.get(['axisLine', 'lineStyle', 'color']);\n    var posInfo = parsePosition(seriesModel, api);\n    this._renderMain(seriesModel, ecModel, api, colorList, posInfo);\n    this._data = seriesModel.getData();\n  };\n  GaugeView.prototype.dispose = function () {};\n  GaugeView.prototype._renderMain = function (seriesModel, ecModel, api, colorList, posInfo) {\n    var group = this.group;\n    var clockwise = seriesModel.get('clockwise');\n    var startAngle = -seriesModel.get('startAngle') / 180 * Math.PI;\n    var endAngle = -seriesModel.get('endAngle') / 180 * Math.PI;\n    var axisLineModel = seriesModel.getModel('axisLine');\n    var roundCap = axisLineModel.get('roundCap');\n    var MainPath = roundCap ? Sausage : graphic.Sector;\n    var showAxis = axisLineModel.get('show');\n    var lineStyleModel = axisLineModel.getModel('lineStyle');\n    var axisLineWidth = lineStyleModel.get('width');\n    var angles = [startAngle, endAngle];\n    normalizeArcAngles(angles, !clockwise);\n    startAngle = angles[0];\n    endAngle = angles[1];\n    var angleRangeSpan = endAngle - startAngle;\n    var prevEndAngle = startAngle;\n    var sectors = [];\n    for (var i = 0; showAxis && i < colorList.length; i++) {\n      // Clamp\n      var percent = Math.min(Math.max(colorList[i][0], 0), 1);\n      endAngle = startAngle + angleRangeSpan * percent;\n      var sector = new MainPath({\n        shape: {\n          startAngle: prevEndAngle,\n          endAngle: endAngle,\n          cx: posInfo.cx,\n          cy: posInfo.cy,\n          clockwise: clockwise,\n          r0: posInfo.r - axisLineWidth,\n          r: posInfo.r\n        },\n        silent: true\n      });\n      sector.setStyle({\n        fill: colorList[i][1]\n      });\n      sector.setStyle(lineStyleModel.getLineStyle(\n      // Because we use sector to simulate arc\n      // so the properties for stroking are useless\n      ['color', 'width']));\n      sectors.push(sector);\n      prevEndAngle = endAngle;\n    }\n    sectors.reverse();\n    each(sectors, function (sector) {\n      return group.add(sector);\n    });\n    var getColor = function (percent) {\n      // Less than 0\n      if (percent <= 0) {\n        return colorList[0][1];\n      }\n      var i;\n      for (i = 0; i < colorList.length; i++) {\n        if (colorList[i][0] >= percent && (i === 0 ? 0 : colorList[i - 1][0]) < percent) {\n          return colorList[i][1];\n        }\n      }\n      // More than 1\n      return colorList[i - 1][1];\n    };\n    this._renderTicks(seriesModel, ecModel, api, getColor, posInfo, startAngle, endAngle, clockwise, axisLineWidth);\n    this._renderTitleAndDetail(seriesModel, ecModel, api, getColor, posInfo);\n    this._renderAnchor(seriesModel, posInfo);\n    this._renderPointer(seriesModel, ecModel, api, getColor, posInfo, startAngle, endAngle, clockwise, axisLineWidth);\n  };\n  GaugeView.prototype._renderTicks = function (seriesModel, ecModel, api, getColor, posInfo, startAngle, endAngle, clockwise, axisLineWidth) {\n    var group = this.group;\n    var cx = posInfo.cx;\n    var cy = posInfo.cy;\n    var r = posInfo.r;\n    var minVal = +seriesModel.get('min');\n    var maxVal = +seriesModel.get('max');\n    var splitLineModel = seriesModel.getModel('splitLine');\n    var tickModel = seriesModel.getModel('axisTick');\n    var labelModel = seriesModel.getModel('axisLabel');\n    var splitNumber = seriesModel.get('splitNumber');\n    var subSplitNumber = tickModel.get('splitNumber');\n    var splitLineLen = parsePercent(splitLineModel.get('length'), r);\n    var tickLen = parsePercent(tickModel.get('length'), r);\n    var angle = startAngle;\n    var step = (endAngle - startAngle) / splitNumber;\n    var subStep = step / subSplitNumber;\n    var splitLineStyle = splitLineModel.getModel('lineStyle').getLineStyle();\n    var tickLineStyle = tickModel.getModel('lineStyle').getLineStyle();\n    var splitLineDistance = splitLineModel.get('distance');\n    var unitX;\n    var unitY;\n    for (var i = 0; i <= splitNumber; i++) {\n      unitX = Math.cos(angle);\n      unitY = Math.sin(angle);\n      // Split line\n      if (splitLineModel.get('show')) {\n        var distance = splitLineDistance ? splitLineDistance + axisLineWidth : axisLineWidth;\n        var splitLine = new graphic.Line({\n          shape: {\n            x1: unitX * (r - distance) + cx,\n            y1: unitY * (r - distance) + cy,\n            x2: unitX * (r - splitLineLen - distance) + cx,\n            y2: unitY * (r - splitLineLen - distance) + cy\n          },\n          style: splitLineStyle,\n          silent: true\n        });\n        if (splitLineStyle.stroke === 'auto') {\n          splitLine.setStyle({\n            stroke: getColor(i / splitNumber)\n          });\n        }\n        group.add(splitLine);\n      }\n      // Label\n      if (labelModel.get('show')) {\n        var distance = labelModel.get('distance') + splitLineDistance;\n        var label = formatLabel(round(i / splitNumber * (maxVal - minVal) + minVal), labelModel.get('formatter'));\n        var autoColor = getColor(i / splitNumber);\n        var textStyleX = unitX * (r - splitLineLen - distance) + cx;\n        var textStyleY = unitY * (r - splitLineLen - distance) + cy;\n        var rotateType = labelModel.get('rotate');\n        var rotate = 0;\n        if (rotateType === 'radial') {\n          rotate = -angle + 2 * Math.PI;\n          if (rotate > Math.PI / 2) {\n            rotate += Math.PI;\n          }\n        } else if (rotateType === 'tangential') {\n          rotate = -angle - Math.PI / 2;\n        } else if (isNumber(rotateType)) {\n          rotate = rotateType * Math.PI / 180;\n        }\n        if (rotate === 0) {\n          group.add(new graphic.Text({\n            style: createTextStyle(labelModel, {\n              text: label,\n              x: textStyleX,\n              y: textStyleY,\n              verticalAlign: unitY < -0.8 ? 'top' : unitY > 0.8 ? 'bottom' : 'middle',\n              align: unitX < -0.4 ? 'left' : unitX > 0.4 ? 'right' : 'center'\n            }, {\n              inheritColor: autoColor\n            }),\n            silent: true\n          }));\n        } else {\n          group.add(new graphic.Text({\n            style: createTextStyle(labelModel, {\n              text: label,\n              x: textStyleX,\n              y: textStyleY,\n              verticalAlign: 'middle',\n              align: 'center'\n            }, {\n              inheritColor: autoColor\n            }),\n            silent: true,\n            originX: textStyleX,\n            originY: textStyleY,\n            rotation: rotate\n          }));\n        }\n      }\n      // Axis tick\n      if (tickModel.get('show') && i !== splitNumber) {\n        var distance = tickModel.get('distance');\n        distance = distance ? distance + axisLineWidth : axisLineWidth;\n        for (var j = 0; j <= subSplitNumber; j++) {\n          unitX = Math.cos(angle);\n          unitY = Math.sin(angle);\n          var tickLine = new graphic.Line({\n            shape: {\n              x1: unitX * (r - distance) + cx,\n              y1: unitY * (r - distance) + cy,\n              x2: unitX * (r - tickLen - distance) + cx,\n              y2: unitY * (r - tickLen - distance) + cy\n            },\n            silent: true,\n            style: tickLineStyle\n          });\n          if (tickLineStyle.stroke === 'auto') {\n            tickLine.setStyle({\n              stroke: getColor((i + j / subSplitNumber) / splitNumber)\n            });\n          }\n          group.add(tickLine);\n          angle += subStep;\n        }\n        angle -= subStep;\n      } else {\n        angle += step;\n      }\n    }\n  };\n  GaugeView.prototype._renderPointer = function (seriesModel, ecModel, api, getColor, posInfo, startAngle, endAngle, clockwise, axisLineWidth) {\n    var group = this.group;\n    var oldData = this._data;\n    var oldProgressData = this._progressEls;\n    var progressList = [];\n    var showPointer = seriesModel.get(['pointer', 'show']);\n    var progressModel = seriesModel.getModel('progress');\n    var showProgress = progressModel.get('show');\n    var data = seriesModel.getData();\n    var valueDim = data.mapDimension('value');\n    var minVal = +seriesModel.get('min');\n    var maxVal = +seriesModel.get('max');\n    var valueExtent = [minVal, maxVal];\n    var angleExtent = [startAngle, endAngle];\n    function createPointer(idx, angle) {\n      var itemModel = data.getItemModel(idx);\n      var pointerModel = itemModel.getModel('pointer');\n      var pointerWidth = parsePercent(pointerModel.get('width'), posInfo.r);\n      var pointerLength = parsePercent(pointerModel.get('length'), posInfo.r);\n      var pointerStr = seriesModel.get(['pointer', 'icon']);\n      var pointerOffset = pointerModel.get('offsetCenter');\n      var pointerOffsetX = parsePercent(pointerOffset[0], posInfo.r);\n      var pointerOffsetY = parsePercent(pointerOffset[1], posInfo.r);\n      var pointerKeepAspect = pointerModel.get('keepAspect');\n      var pointer;\n      // not exist icon type will be set 'rect'\n      if (pointerStr) {\n        pointer = createSymbol(pointerStr, pointerOffsetX - pointerWidth / 2, pointerOffsetY - pointerLength, pointerWidth, pointerLength, null, pointerKeepAspect);\n      } else {\n        pointer = new PointerPath({\n          shape: {\n            angle: -Math.PI / 2,\n            width: pointerWidth,\n            r: pointerLength,\n            x: pointerOffsetX,\n            y: pointerOffsetY\n          }\n        });\n      }\n      pointer.rotation = -(angle + Math.PI / 2);\n      pointer.x = posInfo.cx;\n      pointer.y = posInfo.cy;\n      return pointer;\n    }\n    function createProgress(idx, endAngle) {\n      var roundCap = progressModel.get('roundCap');\n      var ProgressPath = roundCap ? Sausage : graphic.Sector;\n      var isOverlap = progressModel.get('overlap');\n      var progressWidth = isOverlap ? progressModel.get('width') : axisLineWidth / data.count();\n      var r0 = isOverlap ? posInfo.r - progressWidth : posInfo.r - (idx + 1) * progressWidth;\n      var r = isOverlap ? posInfo.r : posInfo.r - idx * progressWidth;\n      var progress = new ProgressPath({\n        shape: {\n          startAngle: startAngle,\n          endAngle: endAngle,\n          cx: posInfo.cx,\n          cy: posInfo.cy,\n          clockwise: clockwise,\n          r0: r0,\n          r: r\n        }\n      });\n      isOverlap && (progress.z2 = linearMap(data.get(valueDim, idx), [minVal, maxVal], [100, 0], true));\n      return progress;\n    }\n    if (showProgress || showPointer) {\n      data.diff(oldData).add(function (idx) {\n        var val = data.get(valueDim, idx);\n        if (showPointer) {\n          var pointer = createPointer(idx, startAngle);\n          // TODO hide pointer on NaN value?\n          graphic.initProps(pointer, {\n            rotation: -((isNaN(+val) ? angleExtent[0] : linearMap(val, valueExtent, angleExtent, true)) + Math.PI / 2)\n          }, seriesModel);\n          group.add(pointer);\n          data.setItemGraphicEl(idx, pointer);\n        }\n        if (showProgress) {\n          var progress = createProgress(idx, startAngle);\n          var isClip = progressModel.get('clip');\n          graphic.initProps(progress, {\n            shape: {\n              endAngle: linearMap(val, valueExtent, angleExtent, isClip)\n            }\n          }, seriesModel);\n          group.add(progress);\n          // Add data index and series index for indexing the data by element\n          // Useful in tooltip\n          setCommonECData(seriesModel.seriesIndex, data.dataType, idx, progress);\n          progressList[idx] = progress;\n        }\n      }).update(function (newIdx, oldIdx) {\n        var val = data.get(valueDim, newIdx);\n        if (showPointer) {\n          var previousPointer = oldData.getItemGraphicEl(oldIdx);\n          var previousRotate = previousPointer ? previousPointer.rotation : startAngle;\n          var pointer = createPointer(newIdx, previousRotate);\n          pointer.rotation = previousRotate;\n          graphic.updateProps(pointer, {\n            rotation: -((isNaN(+val) ? angleExtent[0] : linearMap(val, valueExtent, angleExtent, true)) + Math.PI / 2)\n          }, seriesModel);\n          group.add(pointer);\n          data.setItemGraphicEl(newIdx, pointer);\n        }\n        if (showProgress) {\n          var previousProgress = oldProgressData[oldIdx];\n          var previousEndAngle = previousProgress ? previousProgress.shape.endAngle : startAngle;\n          var progress = createProgress(newIdx, previousEndAngle);\n          var isClip = progressModel.get('clip');\n          graphic.updateProps(progress, {\n            shape: {\n              endAngle: linearMap(val, valueExtent, angleExtent, isClip)\n            }\n          }, seriesModel);\n          group.add(progress);\n          // Add data index and series index for indexing the data by element\n          // Useful in tooltip\n          setCommonECData(seriesModel.seriesIndex, data.dataType, newIdx, progress);\n          progressList[newIdx] = progress;\n        }\n      }).execute();\n      data.each(function (idx) {\n        var itemModel = data.getItemModel(idx);\n        var emphasisModel = itemModel.getModel('emphasis');\n        var focus = emphasisModel.get('focus');\n        var blurScope = emphasisModel.get('blurScope');\n        var emphasisDisabled = emphasisModel.get('disabled');\n        if (showPointer) {\n          var pointer = data.getItemGraphicEl(idx);\n          var symbolStyle = data.getItemVisual(idx, 'style');\n          var visualColor = symbolStyle.fill;\n          if (pointer instanceof ZRImage) {\n            var pathStyle = pointer.style;\n            pointer.useStyle(extend({\n              image: pathStyle.image,\n              x: pathStyle.x,\n              y: pathStyle.y,\n              width: pathStyle.width,\n              height: pathStyle.height\n            }, symbolStyle));\n          } else {\n            pointer.useStyle(symbolStyle);\n            pointer.type !== 'pointer' && pointer.setColor(visualColor);\n          }\n          pointer.setStyle(itemModel.getModel(['pointer', 'itemStyle']).getItemStyle());\n          if (pointer.style.fill === 'auto') {\n            pointer.setStyle('fill', getColor(linearMap(data.get(valueDim, idx), valueExtent, [0, 1], true)));\n          }\n          pointer.z2EmphasisLift = 0;\n          setStatesStylesFromModel(pointer, itemModel);\n          toggleHoverEmphasis(pointer, focus, blurScope, emphasisDisabled);\n        }\n        if (showProgress) {\n          var progress = progressList[idx];\n          progress.useStyle(data.getItemVisual(idx, 'style'));\n          progress.setStyle(itemModel.getModel(['progress', 'itemStyle']).getItemStyle());\n          progress.z2EmphasisLift = 0;\n          setStatesStylesFromModel(progress, itemModel);\n          toggleHoverEmphasis(progress, focus, blurScope, emphasisDisabled);\n        }\n      });\n      this._progressEls = progressList;\n    }\n  };\n  GaugeView.prototype._renderAnchor = function (seriesModel, posInfo) {\n    var anchorModel = seriesModel.getModel('anchor');\n    var showAnchor = anchorModel.get('show');\n    if (showAnchor) {\n      var anchorSize = anchorModel.get('size');\n      var anchorType = anchorModel.get('icon');\n      var offsetCenter = anchorModel.get('offsetCenter');\n      var anchorKeepAspect = anchorModel.get('keepAspect');\n      var anchor = createSymbol(anchorType, posInfo.cx - anchorSize / 2 + parsePercent(offsetCenter[0], posInfo.r), posInfo.cy - anchorSize / 2 + parsePercent(offsetCenter[1], posInfo.r), anchorSize, anchorSize, null, anchorKeepAspect);\n      anchor.z2 = anchorModel.get('showAbove') ? 1 : 0;\n      anchor.setStyle(anchorModel.getModel('itemStyle').getItemStyle());\n      this.group.add(anchor);\n    }\n  };\n  GaugeView.prototype._renderTitleAndDetail = function (seriesModel, ecModel, api, getColor, posInfo) {\n    var _this = this;\n    var data = seriesModel.getData();\n    var valueDim = data.mapDimension('value');\n    var minVal = +seriesModel.get('min');\n    var maxVal = +seriesModel.get('max');\n    var contentGroup = new graphic.Group();\n    var newTitleEls = [];\n    var newDetailEls = [];\n    var hasAnimation = seriesModel.isAnimationEnabled();\n    var showPointerAbove = seriesModel.get(['pointer', 'showAbove']);\n    data.diff(this._data).add(function (idx) {\n      newTitleEls[idx] = new graphic.Text({\n        silent: true\n      });\n      newDetailEls[idx] = new graphic.Text({\n        silent: true\n      });\n    }).update(function (idx, oldIdx) {\n      newTitleEls[idx] = _this._titleEls[oldIdx];\n      newDetailEls[idx] = _this._detailEls[oldIdx];\n    }).execute();\n    data.each(function (idx) {\n      var itemModel = data.getItemModel(idx);\n      var value = data.get(valueDim, idx);\n      var itemGroup = new graphic.Group();\n      var autoColor = getColor(linearMap(value, [minVal, maxVal], [0, 1], true));\n      var itemTitleModel = itemModel.getModel('title');\n      if (itemTitleModel.get('show')) {\n        var titleOffsetCenter = itemTitleModel.get('offsetCenter');\n        var titleX = posInfo.cx + parsePercent(titleOffsetCenter[0], posInfo.r);\n        var titleY = posInfo.cy + parsePercent(titleOffsetCenter[1], posInfo.r);\n        var labelEl = newTitleEls[idx];\n        labelEl.attr({\n          z2: showPointerAbove ? 0 : 2,\n          style: createTextStyle(itemTitleModel, {\n            x: titleX,\n            y: titleY,\n            text: data.getName(idx),\n            align: 'center',\n            verticalAlign: 'middle'\n          }, {\n            inheritColor: autoColor\n          })\n        });\n        itemGroup.add(labelEl);\n      }\n      var itemDetailModel = itemModel.getModel('detail');\n      if (itemDetailModel.get('show')) {\n        var detailOffsetCenter = itemDetailModel.get('offsetCenter');\n        var detailX = posInfo.cx + parsePercent(detailOffsetCenter[0], posInfo.r);\n        var detailY = posInfo.cy + parsePercent(detailOffsetCenter[1], posInfo.r);\n        var width = parsePercent(itemDetailModel.get('width'), posInfo.r);\n        var height = parsePercent(itemDetailModel.get('height'), posInfo.r);\n        var detailColor = seriesModel.get(['progress', 'show']) ? data.getItemVisual(idx, 'style').fill : autoColor;\n        var labelEl = newDetailEls[idx];\n        var formatter_1 = itemDetailModel.get('formatter');\n        labelEl.attr({\n          z2: showPointerAbove ? 0 : 2,\n          style: createTextStyle(itemDetailModel, {\n            x: detailX,\n            y: detailY,\n            text: formatLabel(value, formatter_1),\n            width: isNaN(width) ? null : width,\n            height: isNaN(height) ? null : height,\n            align: 'center',\n            verticalAlign: 'middle'\n          }, {\n            inheritColor: detailColor\n          })\n        });\n        setLabelValueAnimation(labelEl, {\n          normal: itemDetailModel\n        }, value, function (value) {\n          return formatLabel(value, formatter_1);\n        });\n        hasAnimation && animateLabelValue(labelEl, idx, data, seriesModel, {\n          getFormattedLabel: function (labelDataIndex, status, dataType, labelDimIndex, fmt, extendParams) {\n            return formatLabel(extendParams ? extendParams.interpolatedValue : value, formatter_1);\n          }\n        });\n        itemGroup.add(labelEl);\n      }\n      contentGroup.add(itemGroup);\n    });\n    this.group.add(contentGroup);\n    this._titleEls = newTitleEls;\n    this._detailEls = newDetailEls;\n  };\n  GaugeView.type = 'gauge';\n  return GaugeView;\n}(ChartView);\nexport default GaugeView;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport createSeriesDataSimply from '../helper/createSeriesDataSimply.js';\nimport SeriesModel from '../../model/Series.js';\nimport tokens from '../../visual/tokens.js';\nvar GaugeSeriesModel = /** @class */function (_super) {\n  __extends(GaugeSeriesModel, _super);\n  function GaugeSeriesModel() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = GaugeSeriesModel.type;\n    _this.visualStyleAccessPath = 'itemStyle';\n    return _this;\n  }\n  GaugeSeriesModel.prototype.getInitialData = function (option, ecModel) {\n    return createSeriesDataSimply(this, ['value']);\n  };\n  GaugeSeriesModel.type = 'series.gauge';\n  GaugeSeriesModel.defaultOption = {\n    // zlevel: 0,\n    z: 2,\n    colorBy: 'data',\n    // \u9ED8\u8BA4\u5168\u5C40\u5C45\u4E2D\n    center: ['50%', '50%'],\n    legendHoverLink: true,\n    radius: '75%',\n    startAngle: 225,\n    endAngle: -45,\n    clockwise: true,\n    // \u6700\u5C0F\u503C\n    min: 0,\n    // \u6700\u5927\u503C\n    max: 100,\n    // \u5206\u5272\u6BB5\u6570\uFF0C\u9ED8\u8BA4\u4E3A10\n    splitNumber: 10,\n    // \u5750\u6807\u8F74\u7EBF\n    axisLine: {\n      // \u9ED8\u8BA4\u663E\u793A\uFF0C\u5C5E\u6027show\u63A7\u5236\u663E\u793A\u4E0E\u5426\n      show: true,\n      roundCap: false,\n      lineStyle: {\n        color: [[1, tokens.color.neutral10]],\n        width: 10\n      }\n    },\n    // \u5750\u6807\u8F74\u7EBF\n    progress: {\n      // \u9ED8\u8BA4\u663E\u793A\uFF0C\u5C5E\u6027show\u63A7\u5236\u663E\u793A\u4E0E\u5426\n      show: false,\n      overlap: true,\n      width: 10,\n      roundCap: false,\n      clip: true\n    },\n    // \u5206\u9694\u7EBF\n    splitLine: {\n      // \u9ED8\u8BA4\u663E\u793A\uFF0C\u5C5E\u6027show\u63A7\u5236\u663E\u793A\u4E0E\u5426\n      show: true,\n      // \u5C5E\u6027length\u63A7\u5236\u7EBF\u957F\n      length: 10,\n      distance: 10,\n      // \u5C5E\u6027lineStyle\uFF08\u8BE6\u89C1lineStyle\uFF09\u63A7\u5236\u7EBF\u6761\u6837\u5F0F\n      lineStyle: {\n        color: tokens.color.axisTick,\n        width: 3,\n        type: 'solid'\n      }\n    },\n    // \u5750\u6807\u8F74\u5C0F\u6807\u8BB0\n    axisTick: {\n      // \u5C5E\u6027show\u63A7\u5236\u663E\u793A\u4E0E\u5426\uFF0C\u9ED8\u8BA4\u4E0D\u663E\u793A\n      show: true,\n      // \u6BCF\u4EFDsplit\u7EC6\u5206\u591A\u5C11\u6BB5\n      splitNumber: 5,\n      // \u5C5E\u6027length\u63A7\u5236\u7EBF\u957F\n      length: 6,\n      distance: 10,\n      // \u5C5E\u6027lineStyle\u63A7\u5236\u7EBF\u6761\u6837\u5F0F\n      lineStyle: {\n        color: tokens.color.axisTickMinor,\n        width: 1,\n        type: 'solid'\n      }\n    },\n    axisLabel: {\n      show: true,\n      distance: 15,\n      // formatter: null,\n      color: tokens.color.axisLabel,\n      fontSize: 12,\n      rotate: 0\n    },\n    pointer: {\n      icon: null,\n      offsetCenter: [0, 0],\n      show: true,\n      showAbove: true,\n      length: '60%',\n      width: 6,\n      keepAspect: false\n    },\n    anchor: {\n      show: false,\n      showAbove: false,\n      size: 6,\n      icon: 'circle',\n      offsetCenter: [0, 0],\n      keepAspect: false,\n      itemStyle: {\n        color: tokens.color.neutral00,\n        borderWidth: 0,\n        borderColor: tokens.color.theme[0]\n      }\n    },\n    title: {\n      show: true,\n      // x, y\uFF0C\u5355\u4F4Dpx\n      offsetCenter: [0, '20%'],\n      // \u5176\u4F59\u5C5E\u6027\u9ED8\u8BA4\u4F7F\u7528\u5168\u5C40\u6587\u672C\u6837\u5F0F\uFF0C\u8BE6\u89C1TEXTSTYLE\n      color: tokens.color.secondary,\n      fontSize: 16,\n      valueAnimation: false\n    },\n    detail: {\n      show: true,\n      backgroundColor: tokens.color.transparent,\n      borderWidth: 0,\n      borderColor: tokens.color.neutral40,\n      width: 100,\n      height: null,\n      padding: [5, 10],\n      // x, y\uFF0C\u5355\u4F4Dpx\n      offsetCenter: [0, '40%'],\n      // formatter: null,\n      // \u5176\u4F59\u5C5E\u6027\u9ED8\u8BA4\u4F7F\u7528\u5168\u5C40\u6587\u672C\u6837\u5F0F\uFF0C\u8BE6\u89C1TEXTSTYLE\n      color: tokens.color.primary,\n      fontSize: 30,\n      fontWeight: 'bold',\n      lineHeight: 30,\n      valueAnimation: false\n    }\n  };\n  return GaugeSeriesModel;\n}(SeriesModel);\nexport default GaugeSeriesModel;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport GaugeView from './GaugeView.js';\nimport GaugeSeriesModel from './GaugeSeries.js';\nexport function install(registers) {\n  registers.registerChartView(GaugeView);\n  registers.registerSeriesModel(GaugeSeriesModel);\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as graphic from '../../util/graphic.js';\nimport { setStatesStylesFromModel, toggleHoverEmphasis } from '../../util/states.js';\nimport ChartView from '../../view/Chart.js';\nimport { setLabelLineStyle, getLabelLineStatesModels } from '../../label/labelGuideHelper.js';\nimport { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle.js';\nimport { saveOldStyle } from '../../animation/basicTransition.js';\nvar opacityAccessPath = ['itemStyle', 'opacity'];\n/**\n * Piece of pie including Sector, Label, LabelLine\n */\nvar FunnelPiece = /** @class */function (_super) {\n  __extends(FunnelPiece, _super);\n  function FunnelPiece(data, idx) {\n    var _this = _super.call(this) || this;\n    var polygon = _this;\n    var labelLine = new graphic.Polyline();\n    var text = new graphic.Text();\n    polygon.setTextContent(text);\n    _this.setTextGuideLine(labelLine);\n    _this.updateData(data, idx, true);\n    return _this;\n  }\n  FunnelPiece.prototype.updateData = function (data, idx, firstCreate) {\n    var polygon = this;\n    var seriesModel = data.hostModel;\n    var itemModel = data.getItemModel(idx);\n    var layout = data.getItemLayout(idx);\n    var emphasisModel = itemModel.getModel('emphasis');\n    var opacity = itemModel.get(opacityAccessPath);\n    opacity = opacity == null ? 1 : opacity;\n    if (!firstCreate) {\n      saveOldStyle(polygon);\n    }\n    // Update common style\n    polygon.useStyle(data.getItemVisual(idx, 'style'));\n    polygon.style.lineJoin = 'round';\n    if (firstCreate) {\n      polygon.setShape({\n        points: layout.points\n      });\n      polygon.style.opacity = 0;\n      graphic.initProps(polygon, {\n        style: {\n          opacity: opacity\n        }\n      }, seriesModel, idx);\n    } else {\n      graphic.updateProps(polygon, {\n        style: {\n          opacity: opacity\n        },\n        shape: {\n          points: layout.points\n        }\n      }, seriesModel, idx);\n    }\n    setStatesStylesFromModel(polygon, itemModel);\n    this._updateLabel(data, idx);\n    toggleHoverEmphasis(this, emphasisModel.get('focus'), emphasisModel.get('blurScope'), emphasisModel.get('disabled'));\n  };\n  FunnelPiece.prototype._updateLabel = function (data, idx) {\n    var polygon = this;\n    var labelLine = this.getTextGuideLine();\n    var labelText = polygon.getTextContent();\n    var seriesModel = data.hostModel;\n    var itemModel = data.getItemModel(idx);\n    var layout = data.getItemLayout(idx);\n    var labelLayout = layout.label;\n    var style = data.getItemVisual(idx, 'style');\n    var visualColor = style.fill;\n    setLabelStyle(\n    // position will not be used in setLabelStyle\n    labelText, getLabelStatesModels(itemModel), {\n      labelFetcher: data.hostModel,\n      labelDataIndex: idx,\n      defaultOpacity: style.opacity,\n      defaultText: data.getName(idx)\n    }, {\n      normal: {\n        align: labelLayout.textAlign,\n        verticalAlign: labelLayout.verticalAlign\n      }\n    });\n    var labelModel = itemModel.getModel('label');\n    var labelColor = labelModel.get('color');\n    var overrideColor = labelColor === 'inherit' ? visualColor : null;\n    polygon.setTextConfig({\n      local: true,\n      inside: !!labelLayout.inside,\n      insideStroke: overrideColor,\n      outsideFill: overrideColor\n    });\n    var linePoints = labelLayout.linePoints;\n    labelLine.setShape({\n      points: linePoints\n    });\n    polygon.textGuideLineConfig = {\n      anchor: linePoints ? new graphic.Point(linePoints[0][0], linePoints[0][1]) : null\n    };\n    // Make sure update style on labelText after setLabelStyle.\n    // Because setLabelStyle will replace a new style on it.\n    graphic.updateProps(labelText, {\n      style: {\n        x: labelLayout.x,\n        y: labelLayout.y\n      }\n    }, seriesModel, idx);\n    labelText.attr({\n      rotation: labelLayout.rotation,\n      originX: labelLayout.x,\n      originY: labelLayout.y,\n      z2: 10\n    });\n    setLabelLineStyle(polygon, getLabelLineStatesModels(itemModel), {\n      // Default use item visual color\n      stroke: visualColor\n    });\n  };\n  return FunnelPiece;\n}(graphic.Polygon);\nvar FunnelView = /** @class */function (_super) {\n  __extends(FunnelView, _super);\n  function FunnelView() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = FunnelView.type;\n    _this.ignoreLabelLineUpdate = true;\n    return _this;\n  }\n  FunnelView.prototype.render = function (seriesModel, ecModel, api) {\n    var data = seriesModel.getData();\n    var oldData = this._data;\n    var group = this.group;\n    data.diff(oldData).add(function (idx) {\n      var funnelPiece = new FunnelPiece(data, idx);\n      data.setItemGraphicEl(idx, funnelPiece);\n      group.add(funnelPiece);\n    }).update(function (newIdx, oldIdx) {\n      var piece = oldData.getItemGraphicEl(oldIdx);\n      piece.updateData(data, newIdx);\n      group.add(piece);\n      data.setItemGraphicEl(newIdx, piece);\n    }).remove(function (idx) {\n      var piece = oldData.getItemGraphicEl(idx);\n      graphic.removeElementWithFadeOut(piece, seriesModel, idx);\n    }).execute();\n    this._data = data;\n  };\n  FunnelView.prototype.remove = function () {\n    this.group.removeAll();\n    this._data = null;\n  };\n  FunnelView.prototype.dispose = function () {};\n  FunnelView.type = 'funnel';\n  return FunnelView;\n}(ChartView);\nexport default FunnelView;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport createSeriesDataSimply from '../helper/createSeriesDataSimply.js';\nimport { defaultEmphasis } from '../../util/model.js';\nimport { makeSeriesEncodeForNameBased } from '../../data/helper/sourceHelper.js';\nimport LegendVisualProvider from '../../visual/LegendVisualProvider.js';\nimport SeriesModel from '../../model/Series.js';\nimport tokens from '../../visual/tokens.js';\nvar FunnelSeriesModel = /** @class */function (_super) {\n  __extends(FunnelSeriesModel, _super);\n  function FunnelSeriesModel() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = FunnelSeriesModel.type;\n    return _this;\n  }\n  FunnelSeriesModel.prototype.init = function (option) {\n    _super.prototype.init.apply(this, arguments);\n    // Enable legend selection for each data item\n    // Use a function instead of direct access because data reference may changed\n    this.legendVisualProvider = new LegendVisualProvider(zrUtil.bind(this.getData, this), zrUtil.bind(this.getRawData, this));\n    // Extend labelLine emphasis\n    this._defaultLabelLine(option);\n  };\n  FunnelSeriesModel.prototype.getInitialData = function (option, ecModel) {\n    return createSeriesDataSimply(this, {\n      coordDimensions: ['value'],\n      encodeDefaulter: zrUtil.curry(makeSeriesEncodeForNameBased, this)\n    });\n  };\n  FunnelSeriesModel.prototype._defaultLabelLine = function (option) {\n    // Extend labelLine emphasis\n    defaultEmphasis(option, 'labelLine', ['show']);\n    var labelLineNormalOpt = option.labelLine;\n    var labelLineEmphasisOpt = option.emphasis.labelLine;\n    // Not show label line if `label.normal.show = false`\n    labelLineNormalOpt.show = labelLineNormalOpt.show && option.label.show;\n    labelLineEmphasisOpt.show = labelLineEmphasisOpt.show && option.emphasis.label.show;\n  };\n  // Overwrite\n  FunnelSeriesModel.prototype.getDataParams = function (dataIndex) {\n    var data = this.getData();\n    var params = _super.prototype.getDataParams.call(this, dataIndex);\n    var valueDim = data.mapDimension('value');\n    var sum = data.getSum(valueDim);\n    // Percent is 0 if sum is 0\n    params.percent = !sum ? 0 : +(data.get(valueDim, dataIndex) / sum * 100).toFixed(2);\n    params.$vars.push('percent');\n    return params;\n  };\n  FunnelSeriesModel.type = 'series.funnel';\n  FunnelSeriesModel.defaultOption = {\n    coordinateSystemUsage: 'box',\n    // zlevel: 0,                  // \u4E00\u7EA7\u5C42\u53E0\n    z: 2,\n    legendHoverLink: true,\n    colorBy: 'data',\n    left: 80,\n    top: 60,\n    right: 80,\n    bottom: 65,\n    // width: {totalWidth} - left - right,\n    // height: {totalHeight} - top - bottom,\n    // \u9ED8\u8BA4\u53D6\u6570\u636E\u6700\u5C0F\u6700\u5927\u503C\n    // min: 0,\n    // max: 100,\n    minSize: '0%',\n    maxSize: '100%',\n    sort: 'descending',\n    orient: 'vertical',\n    gap: 0,\n    funnelAlign: 'center',\n    label: {\n      show: true,\n      position: 'outer'\n      // formatter: \u6807\u7B7E\u6587\u672C\u683C\u5F0F\u5668\uFF0C\u540CTooltip.formatter\uFF0C\u4E0D\u652F\u6301\u5F02\u6B65\u56DE\u8C03\n    },\n    labelLine: {\n      show: true,\n      length: 20,\n      lineStyle: {\n        // color: \u5404\u5F02,\n        width: 1\n      }\n    },\n    itemStyle: {\n      // color: \u5404\u5F02,\n      borderColor: tokens.color.neutral00,\n      borderWidth: 1\n    },\n    emphasis: {\n      label: {\n        show: true\n      }\n    },\n    select: {\n      itemStyle: {\n        borderColor: tokens.color.primary\n      }\n    }\n  };\n  return FunnelSeriesModel;\n}(SeriesModel);\nexport default FunnelSeriesModel;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as layout from '../../util/layout.js';\nimport { parsePercent, linearMap } from '../../util/number.js';\nimport { isFunction } from 'zrender/lib/core/util.js';\nfunction getSortedIndices(data, sort) {\n  var valueDim = data.mapDimension('value');\n  var valueArr = data.mapArray(valueDim, function (val) {\n    return val;\n  });\n  var indices = [];\n  var isAscending = sort === 'ascending';\n  for (var i = 0, len = data.count(); i < len; i++) {\n    indices[i] = i;\n  }\n  // Add custom sortable function & none sortable opetion by \"options.sort\"\n  if (isFunction(sort)) {\n    indices.sort(sort);\n  } else if (sort !== 'none') {\n    indices.sort(function (a, b) {\n      return isAscending ? valueArr[a] - valueArr[b] : valueArr[b] - valueArr[a];\n    });\n  }\n  return indices;\n}\nfunction labelLayout(data) {\n  var seriesModel = data.hostModel;\n  var orient = seriesModel.get('orient');\n  data.each(function (idx) {\n    var itemModel = data.getItemModel(idx);\n    var labelModel = itemModel.getModel('label');\n    var labelPosition = labelModel.get('position');\n    var labelLineModel = itemModel.getModel('labelLine');\n    var layout = data.getItemLayout(idx);\n    var points = layout.points;\n    var isLabelInside = labelPosition === 'inner' || labelPosition === 'inside' || labelPosition === 'center' || labelPosition === 'insideLeft' || labelPosition === 'insideRight';\n    var textAlign;\n    var textX;\n    var textY;\n    var linePoints;\n    if (isLabelInside) {\n      if (labelPosition === 'insideLeft') {\n        textX = (points[0][0] + points[3][0]) / 2 + 5;\n        textY = (points[0][1] + points[3][1]) / 2;\n        textAlign = 'left';\n      } else if (labelPosition === 'insideRight') {\n        textX = (points[1][0] + points[2][0]) / 2 - 5;\n        textY = (points[1][1] + points[2][1]) / 2;\n        textAlign = 'right';\n      } else {\n        textX = (points[0][0] + points[1][0] + points[2][0] + points[3][0]) / 4;\n        textY = (points[0][1] + points[1][1] + points[2][1] + points[3][1]) / 4;\n        textAlign = 'center';\n      }\n      linePoints = [[textX, textY], [textX, textY]];\n    } else {\n      var x1 = void 0;\n      var y1 = void 0;\n      var x2 = void 0;\n      var y2 = void 0;\n      var labelLineLen = labelLineModel.get('length');\n      if (process.env.NODE_ENV !== 'production') {\n        if (orient === 'vertical' && ['top', 'bottom'].indexOf(labelPosition) > -1) {\n          labelPosition = 'left';\n          console.warn('Position error: Funnel chart on vertical orient dose not support top and bottom.');\n        }\n        if (orient === 'horizontal' && ['left', 'right'].indexOf(labelPosition) > -1) {\n          labelPosition = 'bottom';\n          console.warn('Position error: Funnel chart on horizontal orient dose not support left and right.');\n        }\n      }\n      if (labelPosition === 'left') {\n        // Left side\n        x1 = (points[3][0] + points[0][0]) / 2;\n        y1 = (points[3][1] + points[0][1]) / 2;\n        x2 = x1 - labelLineLen;\n        textX = x2 - 5;\n        textAlign = 'right';\n      } else if (labelPosition === 'right') {\n        // Right side\n        x1 = (points[1][0] + points[2][0]) / 2;\n        y1 = (points[1][1] + points[2][1]) / 2;\n        x2 = x1 + labelLineLen;\n        textX = x2 + 5;\n        textAlign = 'left';\n      } else if (labelPosition === 'top') {\n        // Top side\n        x1 = (points[3][0] + points[0][0]) / 2;\n        y1 = (points[3][1] + points[0][1]) / 2;\n        y2 = y1 - labelLineLen;\n        textY = y2 - 5;\n        textAlign = 'center';\n      } else if (labelPosition === 'bottom') {\n        // Bottom side\n        x1 = (points[1][0] + points[2][0]) / 2;\n        y1 = (points[1][1] + points[2][1]) / 2;\n        y2 = y1 + labelLineLen;\n        textY = y2 + 5;\n        textAlign = 'center';\n      } else if (labelPosition === 'rightTop') {\n        // RightTop side\n        x1 = orient === 'horizontal' ? points[3][0] : points[1][0];\n        y1 = orient === 'horizontal' ? points[3][1] : points[1][1];\n        if (orient === 'horizontal') {\n          y2 = y1 - labelLineLen;\n          textY = y2 - 5;\n          textAlign = 'center';\n        } else {\n          x2 = x1 + labelLineLen;\n          textX = x2 + 5;\n          textAlign = 'top';\n        }\n      } else if (labelPosition === 'rightBottom') {\n        // RightBottom side\n        x1 = points[2][0];\n        y1 = points[2][1];\n        if (orient === 'horizontal') {\n          y2 = y1 + labelLineLen;\n          textY = y2 + 5;\n          textAlign = 'center';\n        } else {\n          x2 = x1 + labelLineLen;\n          textX = x2 + 5;\n          textAlign = 'bottom';\n        }\n      } else if (labelPosition === 'leftTop') {\n        // LeftTop side\n        x1 = points[0][0];\n        y1 = orient === 'horizontal' ? points[0][1] : points[1][1];\n        if (orient === 'horizontal') {\n          y2 = y1 - labelLineLen;\n          textY = y2 - 5;\n          textAlign = 'center';\n        } else {\n          x2 = x1 - labelLineLen;\n          textX = x2 - 5;\n          textAlign = 'right';\n        }\n      } else if (labelPosition === 'leftBottom') {\n        // LeftBottom side\n        x1 = orient === 'horizontal' ? points[1][0] : points[3][0];\n        y1 = orient === 'horizontal' ? points[1][1] : points[2][1];\n        if (orient === 'horizontal') {\n          y2 = y1 + labelLineLen;\n          textY = y2 + 5;\n          textAlign = 'center';\n        } else {\n          x2 = x1 - labelLineLen;\n          textX = x2 - 5;\n          textAlign = 'right';\n        }\n      } else {\n        // Right side or Bottom side\n        x1 = (points[1][0] + points[2][0]) / 2;\n        y1 = (points[1][1] + points[2][1]) / 2;\n        if (orient === 'horizontal') {\n          y2 = y1 + labelLineLen;\n          textY = y2 + 5;\n          textAlign = 'center';\n        } else {\n          x2 = x1 + labelLineLen;\n          textX = x2 + 5;\n          textAlign = 'left';\n        }\n      }\n      if (orient === 'horizontal') {\n        x2 = x1;\n        textX = x2;\n      } else {\n        y2 = y1;\n        textY = y2;\n      }\n      linePoints = [[x1, y1], [x2, y2]];\n    }\n    layout.label = {\n      linePoints: linePoints,\n      x: textX,\n      y: textY,\n      verticalAlign: 'middle',\n      textAlign: textAlign,\n      inside: isLabelInside\n    };\n  });\n}\nexport default function funnelLayout(ecModel, api) {\n  ecModel.eachSeriesByType('funnel', function (seriesModel) {\n    var data = seriesModel.getData();\n    var valueDim = data.mapDimension('value');\n    var sort = seriesModel.get('sort');\n    var layoutRef = layout.createBoxLayoutReference(seriesModel, api);\n    var viewRect = layout.getLayoutRect(seriesModel.getBoxLayoutParams(), layoutRef.refContainer);\n    var orient = seriesModel.get('orient');\n    var viewWidth = viewRect.width;\n    var viewHeight = viewRect.height;\n    var indices = getSortedIndices(data, sort);\n    var x = viewRect.x;\n    var y = viewRect.y;\n    var sizeExtent = orient === 'horizontal' ? [parsePercent(seriesModel.get('minSize'), viewHeight), parsePercent(seriesModel.get('maxSize'), viewHeight)] : [parsePercent(seriesModel.get('minSize'), viewWidth), parsePercent(seriesModel.get('maxSize'), viewWidth)];\n    var dataExtent = data.getDataExtent(valueDim);\n    var min = seriesModel.get('min');\n    var max = seriesModel.get('max');\n    if (min == null) {\n      min = Math.min(dataExtent[0], 0);\n    }\n    if (max == null) {\n      max = dataExtent[1];\n    }\n    var funnelAlign = seriesModel.get('funnelAlign');\n    var gap = seriesModel.get('gap');\n    var viewSize = orient === 'horizontal' ? viewWidth : viewHeight;\n    var itemSize = (viewSize - gap * (data.count() - 1)) / data.count();\n    var getLinePoints = function (idx, offset) {\n      // End point index is data.count() and we assign it 0\n      if (orient === 'horizontal') {\n        var val_1 = data.get(valueDim, idx) || 0;\n        var itemHeight = linearMap(val_1, [min, max], sizeExtent, true);\n        var y0 = void 0;\n        switch (funnelAlign) {\n          case 'top':\n            y0 = y;\n            break;\n          case 'center':\n            y0 = y + (viewHeight - itemHeight) / 2;\n            break;\n          case 'bottom':\n            y0 = y + (viewHeight - itemHeight);\n            break;\n        }\n        return [[offset, y0], [offset, y0 + itemHeight]];\n      }\n      var val = data.get(valueDim, idx) || 0;\n      var itemWidth = linearMap(val, [min, max], sizeExtent, true);\n      var x0;\n      switch (funnelAlign) {\n        case 'left':\n          x0 = x;\n          break;\n        case 'center':\n          x0 = x + (viewWidth - itemWidth) / 2;\n          break;\n        case 'right':\n          x0 = x + viewWidth - itemWidth;\n          break;\n      }\n      return [[x0, offset], [x0 + itemWidth, offset]];\n    };\n    if (sort === 'ascending') {\n      // From bottom to top\n      itemSize = -itemSize;\n      gap = -gap;\n      if (orient === 'horizontal') {\n        x += viewWidth;\n      } else {\n        y += viewHeight;\n      }\n      indices = indices.reverse();\n    }\n    for (var i = 0; i < indices.length; i++) {\n      var idx = indices[i];\n      var nextIdx = indices[i + 1];\n      var itemModel = data.getItemModel(idx);\n      if (orient === 'horizontal') {\n        var width = itemModel.get(['itemStyle', 'width']);\n        if (width == null) {\n          width = itemSize;\n        } else {\n          width = parsePercent(width, viewWidth);\n          if (sort === 'ascending') {\n            width = -width;\n          }\n        }\n        var start = getLinePoints(idx, x);\n        var end = getLinePoints(nextIdx, x + width);\n        x += width + gap;\n        data.setItemLayout(idx, {\n          points: start.concat(end.slice().reverse())\n        });\n      } else {\n        var height = itemModel.get(['itemStyle', 'height']);\n        if (height == null) {\n          height = itemSize;\n        } else {\n          height = parsePercent(height, viewHeight);\n          if (sort === 'ascending') {\n            height = -height;\n          }\n        }\n        var start = getLinePoints(idx, y);\n        var end = getLinePoints(nextIdx, y + height);\n        y += height + gap;\n        data.setItemLayout(idx, {\n          points: start.concat(end.slice().reverse())\n        });\n      }\n    }\n    labelLayout(data);\n  });\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport FunnelView from './FunnelView.js';\nimport FunnelSeriesModel from './FunnelSeries.js';\nimport funnelLayout from './funnelLayout.js';\nimport dataFilter from '../../processor/dataFilter.js';\nexport function install(registers) {\n  registers.registerChartView(FunnelView);\n  registers.registerSeriesModel(FunnelSeriesModel);\n  registers.registerLayout(funnelLayout);\n  registers.registerProcessor(dataFilter('funnel'));\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as graphic from '../../util/graphic.js';\nimport { setStatesStylesFromModel, toggleHoverEmphasis } from '../../util/states.js';\nimport ChartView from '../../view/Chart.js';\nimport { numericToNumber } from '../../util/number.js';\nimport { eqNaN } from 'zrender/lib/core/util.js';\nimport { saveOldStyle } from '../../animation/basicTransition.js';\nvar DEFAULT_SMOOTH = 0.3;\nvar ParallelView = /** @class */function (_super) {\n  __extends(ParallelView, _super);\n  function ParallelView() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = ParallelView.type;\n    _this._dataGroup = new graphic.Group();\n    _this._initialized = false;\n    return _this;\n  }\n  ParallelView.prototype.init = function () {\n    this.group.add(this._dataGroup);\n  };\n  /**\n   * @override\n   */\n  ParallelView.prototype.render = function (seriesModel, ecModel, api, payload) {\n    // Clear previously rendered progressive elements.\n    this._progressiveEls = null;\n    var dataGroup = this._dataGroup;\n    var data = seriesModel.getData();\n    var oldData = this._data;\n    var coordSys = seriesModel.coordinateSystem;\n    var dimensions = coordSys.dimensions;\n    var seriesScope = makeSeriesScope(seriesModel);\n    data.diff(oldData).add(add).update(update).remove(remove).execute();\n    function add(newDataIndex) {\n      var line = addEl(data, dataGroup, newDataIndex, dimensions, coordSys);\n      updateElCommon(line, data, newDataIndex, seriesScope);\n    }\n    function update(newDataIndex, oldDataIndex) {\n      var line = oldData.getItemGraphicEl(oldDataIndex);\n      var points = createLinePoints(data, newDataIndex, dimensions, coordSys);\n      data.setItemGraphicEl(newDataIndex, line);\n      graphic.updateProps(line, {\n        shape: {\n          points: points\n        }\n      }, seriesModel, newDataIndex);\n      saveOldStyle(line);\n      updateElCommon(line, data, newDataIndex, seriesScope);\n    }\n    function remove(oldDataIndex) {\n      var line = oldData.getItemGraphicEl(oldDataIndex);\n      dataGroup.remove(line);\n    }\n    // First create\n    if (!this._initialized) {\n      this._initialized = true;\n      var clipPath = createGridClipShape(coordSys, seriesModel, function () {\n        // Callback will be invoked immediately if there is no animation\n        setTimeout(function () {\n          dataGroup.removeClipPath();\n        });\n      });\n      dataGroup.setClipPath(clipPath);\n    }\n    this._data = data;\n  };\n  ParallelView.prototype.incrementalPrepareRender = function (seriesModel, ecModel, api) {\n    this._initialized = true;\n    this._data = null;\n    this._dataGroup.removeAll();\n  };\n  ParallelView.prototype.incrementalRender = function (taskParams, seriesModel, ecModel) {\n    var data = seriesModel.getData();\n    var coordSys = seriesModel.coordinateSystem;\n    var dimensions = coordSys.dimensions;\n    var seriesScope = makeSeriesScope(seriesModel);\n    var progressiveEls = this._progressiveEls = [];\n    for (var dataIndex = taskParams.start; dataIndex < taskParams.end; dataIndex++) {\n      var line = addEl(data, this._dataGroup, dataIndex, dimensions, coordSys);\n      line.incremental = true;\n      updateElCommon(line, data, dataIndex, seriesScope);\n      progressiveEls.push(line);\n    }\n  };\n  ParallelView.prototype.remove = function () {\n    this._dataGroup && this._dataGroup.removeAll();\n    this._data = null;\n  };\n  ParallelView.type = 'parallel';\n  return ParallelView;\n}(ChartView);\nfunction createGridClipShape(coordSys, seriesModel, cb) {\n  var parallelModel = coordSys.model;\n  var rect = coordSys.getRect();\n  var rectEl = new graphic.Rect({\n    shape: {\n      x: rect.x,\n      y: rect.y,\n      width: rect.width,\n      height: rect.height\n    }\n  });\n  var dim = parallelModel.get('layout') === 'horizontal' ? 'width' : 'height';\n  rectEl.setShape(dim, 0);\n  graphic.initProps(rectEl, {\n    shape: {\n      width: rect.width,\n      height: rect.height\n    }\n  }, seriesModel, cb);\n  return rectEl;\n}\nfunction createLinePoints(data, dataIndex, dimensions, coordSys) {\n  var points = [];\n  for (var i = 0; i < dimensions.length; i++) {\n    var dimName = dimensions[i];\n    var value = data.get(data.mapDimension(dimName), dataIndex);\n    if (!isEmptyValue(value, coordSys.getAxis(dimName).type)) {\n      points.push(coordSys.dataToPoint(value, dimName));\n    }\n  }\n  return points;\n}\nfunction addEl(data, dataGroup, dataIndex, dimensions, coordSys) {\n  var points = createLinePoints(data, dataIndex, dimensions, coordSys);\n  var line = new graphic.Polyline({\n    shape: {\n      points: points\n    },\n    // silent: true,\n    z2: 10\n  });\n  dataGroup.add(line);\n  data.setItemGraphicEl(dataIndex, line);\n  return line;\n}\nfunction makeSeriesScope(seriesModel) {\n  var smooth = seriesModel.get('smooth', true);\n  smooth === true && (smooth = DEFAULT_SMOOTH);\n  smooth = numericToNumber(smooth);\n  eqNaN(smooth) && (smooth = 0);\n  return {\n    smooth: smooth\n  };\n}\nfunction updateElCommon(el, data, dataIndex, seriesScope) {\n  el.useStyle(data.getItemVisual(dataIndex, 'style'));\n  el.style.fill = null;\n  el.setShape('smooth', seriesScope.smooth);\n  var itemModel = data.getItemModel(dataIndex);\n  var emphasisModel = itemModel.getModel('emphasis');\n  setStatesStylesFromModel(el, itemModel, 'lineStyle');\n  toggleHoverEmphasis(el, emphasisModel.get('focus'), emphasisModel.get('blurScope'), emphasisModel.get('disabled'));\n}\n// function simpleDiff(oldData, newData, dimensions) {\n//     let oldLen;\n//     if (!oldData\n//         || !oldData.__plProgressive\n//         || (oldLen = oldData.count()) !== newData.count()\n//     ) {\n//         return true;\n//     }\n//     let dimLen = dimensions.length;\n//     for (let i = 0; i < oldLen; i++) {\n//         for (let j = 0; j < dimLen; j++) {\n//             if (oldData.get(dimensions[j], i) !== newData.get(dimensions[j], i)) {\n//                 return true;\n//             }\n//         }\n//     }\n//     return false;\n// }\n// FIXME put in common util?\nfunction isEmptyValue(val, axisType) {\n  return axisType === 'category' ? val == null : val == null || isNaN(val); // axisType === 'value'\n}\nexport default ParallelView;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport { each, bind } from 'zrender/lib/core/util.js';\nimport SeriesModel from '../../model/Series.js';\nimport createSeriesData from '../helper/createSeriesData.js';\nvar ParallelSeriesModel = /** @class */function (_super) {\n  __extends(ParallelSeriesModel, _super);\n  function ParallelSeriesModel() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = ParallelSeriesModel.type;\n    _this.visualStyleAccessPath = 'lineStyle';\n    _this.visualDrawType = 'stroke';\n    return _this;\n  }\n  ParallelSeriesModel.prototype.getInitialData = function (option, ecModel) {\n    return createSeriesData(null, this, {\n      useEncodeDefaulter: bind(makeDefaultEncode, null, this)\n    });\n  };\n  /**\n   * User can get data raw indices on 'axisAreaSelected' event received.\n   *\n   * @return Raw indices\n   */\n  ParallelSeriesModel.prototype.getRawIndicesByActiveState = function (activeState) {\n    var coordSys = this.coordinateSystem;\n    var data = this.getData();\n    var indices = [];\n    coordSys.eachActiveState(data, function (theActiveState, dataIndex) {\n      if (activeState === theActiveState) {\n        indices.push(data.getRawIndex(dataIndex));\n      }\n    });\n    return indices;\n  };\n  ParallelSeriesModel.type = 'series.parallel';\n  ParallelSeriesModel.dependencies = ['parallel'];\n  ParallelSeriesModel.defaultOption = {\n    // zlevel: 0,\n    z: 2,\n    coordinateSystem: 'parallel',\n    parallelIndex: 0,\n    label: {\n      show: false\n    },\n    inactiveOpacity: 0.05,\n    activeOpacity: 1,\n    lineStyle: {\n      width: 1,\n      opacity: 0.45,\n      type: 'solid'\n    },\n    emphasis: {\n      label: {\n        show: false\n      }\n    },\n    progressive: 500,\n    smooth: false,\n    animationEasing: 'linear'\n  };\n  return ParallelSeriesModel;\n}(SeriesModel);\nfunction makeDefaultEncode(seriesModel) {\n  // The mapping of parallelAxis dimension to data dimension can\n  // be specified in parallelAxis.option.dim. For example, if\n  // parallelAxis.option.dim is 'dim3', it mapping to the third\n  // dimension of data. But `data.encode` has higher priority.\n  // Moreover, parallelModel.dimension should not be regarded as data\n  // dimensions. Consider dimensions = ['dim4', 'dim2', 'dim6'];\n  var parallelModel = seriesModel.ecModel.getComponent('parallel', seriesModel.get('parallelIndex'));\n  if (!parallelModel) {\n    return;\n  }\n  var encodeDefine = {};\n  each(parallelModel.dimensions, function (axisDim) {\n    var dataDimIndex = convertDimNameToNumber(axisDim);\n    encodeDefine[axisDim] = dataDimIndex;\n  });\n  return encodeDefine;\n}\nfunction convertDimNameToNumber(dimName) {\n  return +dimName.replace('dim', '');\n}\nexport default ParallelSeriesModel;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nvar opacityAccessPath = ['lineStyle', 'opacity'];\nvar parallelVisual = {\n  seriesType: 'parallel',\n  reset: function (seriesModel, ecModel) {\n    var coordSys = seriesModel.coordinateSystem;\n    var opacityMap = {\n      normal: seriesModel.get(['lineStyle', 'opacity']),\n      active: seriesModel.get('activeOpacity'),\n      inactive: seriesModel.get('inactiveOpacity')\n    };\n    return {\n      progress: function (params, data) {\n        coordSys.eachActiveState(data, function (activeState, dataIndex) {\n          var opacity = opacityMap[activeState];\n          if (activeState === 'normal' && data.hasItemOption) {\n            var itemOpacity = data.getItemModel(dataIndex).get(opacityAccessPath, true);\n            itemOpacity != null && (opacity = itemOpacity);\n          }\n          var existsStyle = data.ensureUniqueItemVisual(dataIndex, 'style');\n          existsStyle.opacity = opacity;\n        }, params.start, params.end);\n      }\n    };\n  }\n};\nexport default parallelVisual;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as modelUtil from '../../util/model.js';\nexport default function parallelPreprocessor(option) {\n  createParallelIfNeeded(option);\n  mergeAxisOptionFromParallel(option);\n}\n/**\n * Create a parallel coordinate if not exists.\n * @inner\n */\nfunction createParallelIfNeeded(option) {\n  if (option.parallel) {\n    return;\n  }\n  var hasParallelSeries = false;\n  zrUtil.each(option.series, function (seriesOpt) {\n    if (seriesOpt && seriesOpt.type === 'parallel') {\n      hasParallelSeries = true;\n    }\n  });\n  if (hasParallelSeries) {\n    option.parallel = [{}];\n  }\n}\n/**\n * Merge aixs definition from parallel option (if exists) to axis option.\n * @inner\n */\nfunction mergeAxisOptionFromParallel(option) {\n  var axes = modelUtil.normalizeToArray(option.parallelAxis);\n  zrUtil.each(axes, function (axisOption) {\n    if (!zrUtil.isObject(axisOption)) {\n      return;\n    }\n    var parallelIndex = axisOption.parallelIndex || 0;\n    var parallelOption = modelUtil.normalizeToArray(option.parallel)[parallelIndex];\n    if (parallelOption && parallelOption.parallelAxisDefault) {\n      zrUtil.merge(axisOption, parallelOption.parallelAxisDefault, false);\n    }\n  });\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport ComponentView from '../../view/Component.js';\nimport { each, bind, extend } from 'zrender/lib/core/util.js';\nimport { createOrUpdate, clear } from '../../util/throttle.js';\nvar CLICK_THRESHOLD = 5; // > 4\nvar ParallelView = /** @class */function (_super) {\n  __extends(ParallelView, _super);\n  function ParallelView() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = ParallelView.type;\n    return _this;\n  }\n  ParallelView.prototype.render = function (parallelModel, ecModel, api) {\n    this._model = parallelModel;\n    this._api = api;\n    if (!this._handlers) {\n      this._handlers = {};\n      each(handlers, function (handler, eventName) {\n        api.getZr().on(eventName, this._handlers[eventName] = bind(handler, this));\n      }, this);\n    }\n    createOrUpdate(this, '_throttledDispatchExpand', parallelModel.get('axisExpandRate'), 'fixRate');\n  };\n  ParallelView.prototype.dispose = function (ecModel, api) {\n    clear(this, '_throttledDispatchExpand');\n    each(this._handlers, function (handler, eventName) {\n      api.getZr().off(eventName, handler);\n    });\n    this._handlers = null;\n  };\n  /**\n   * @internal\n   * @param {Object} [opt] If null, cancel the last action triggering for debounce.\n   */\n  ParallelView.prototype._throttledDispatchExpand = function (opt) {\n    this._dispatchExpand(opt);\n  };\n  /**\n   * @internal\n   */\n  ParallelView.prototype._dispatchExpand = function (opt) {\n    opt && this._api.dispatchAction(extend({\n      type: 'parallelAxisExpand'\n    }, opt));\n  };\n  ParallelView.type = 'parallel';\n  return ParallelView;\n}(ComponentView);\nvar handlers = {\n  mousedown: function (e) {\n    if (checkTrigger(this, 'click')) {\n      this._mouseDownPoint = [e.offsetX, e.offsetY];\n    }\n  },\n  mouseup: function (e) {\n    var mouseDownPoint = this._mouseDownPoint;\n    if (checkTrigger(this, 'click') && mouseDownPoint) {\n      var point = [e.offsetX, e.offsetY];\n      var dist = Math.pow(mouseDownPoint[0] - point[0], 2) + Math.pow(mouseDownPoint[1] - point[1], 2);\n      if (dist > CLICK_THRESHOLD) {\n        return;\n      }\n      var result = this._model.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX, e.offsetY]);\n      result.behavior !== 'none' && this._dispatchExpand({\n        axisExpandWindow: result.axisExpandWindow\n      });\n    }\n    this._mouseDownPoint = null;\n  },\n  mousemove: function (e) {\n    // Should do nothing when brushing.\n    if (this._mouseDownPoint || !checkTrigger(this, 'mousemove')) {\n      return;\n    }\n    var model = this._model;\n    var result = model.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX, e.offsetY]);\n    var behavior = result.behavior;\n    behavior === 'jump' && this._throttledDispatchExpand.debounceNextCall(model.get('axisExpandDebounce'));\n    this._throttledDispatchExpand(behavior === 'none' ? null // Cancel the last trigger, in case that mouse slide out of the area quickly.\n    : {\n      axisExpandWindow: result.axisExpandWindow,\n      // Jumping uses animation, and sliding suppresses animation.\n      animation: behavior === 'jump' ? null : {\n        duration: 0 // Disable animation.\n      }\n    });\n  }\n};\nfunction checkTrigger(view, triggerOn) {\n  var model = view._model;\n  return model.get('axisExpandable') && model.get('axisExpandTriggerOn') === triggerOn;\n}\nexport default ParallelView;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport ComponentModel from '../../model/Component.js';\nvar ParallelModel = /** @class */function (_super) {\n  __extends(ParallelModel, _super);\n  function ParallelModel() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = ParallelModel.type;\n    return _this;\n  }\n  ParallelModel.prototype.init = function () {\n    _super.prototype.init.apply(this, arguments);\n    this.mergeOption({});\n  };\n  ParallelModel.prototype.mergeOption = function (newOption) {\n    var thisOption = this.option;\n    newOption && zrUtil.merge(thisOption, newOption, true);\n    this._initDimensions();\n  };\n  /**\n   * Whether series or axis is in this coordinate system.\n   */\n  ParallelModel.prototype.contains = function (model, ecModel) {\n    var parallelIndex = model.get('parallelIndex');\n    return parallelIndex != null && ecModel.getComponent('parallel', parallelIndex) === this;\n  };\n  ParallelModel.prototype.setAxisExpand = function (opt) {\n    zrUtil.each(['axisExpandable', 'axisExpandCenter', 'axisExpandCount', 'axisExpandWidth', 'axisExpandWindow'], function (name) {\n      if (opt.hasOwnProperty(name)) {\n        // @ts-ignore FIXME: why \"never\" inferred in this.option[name]?\n        this.option[name] = opt[name];\n      }\n    }, this);\n  };\n  ParallelModel.prototype._initDimensions = function () {\n    var dimensions = this.dimensions = [];\n    var parallelAxisIndex = this.parallelAxisIndex = [];\n    var axisModels = zrUtil.filter(this.ecModel.queryComponents({\n      mainType: 'parallelAxis'\n    }), function (axisModel) {\n      // Can not use this.contains here, because\n      // initialization has not been completed yet.\n      return (axisModel.get('parallelIndex') || 0) === this.componentIndex;\n    }, this);\n    zrUtil.each(axisModels, function (axisModel) {\n      dimensions.push('dim' + axisModel.get('dim'));\n      parallelAxisIndex.push(axisModel.componentIndex);\n    });\n  };\n  ParallelModel.type = 'parallel';\n  ParallelModel.dependencies = ['parallelAxis'];\n  ParallelModel.layoutMode = 'box';\n  ParallelModel.defaultOption = {\n    // zlevel: 0,\n    z: 0,\n    left: 80,\n    top: 60,\n    right: 80,\n    bottom: 60,\n    // width: {totalWidth} - left - right,\n    // height: {totalHeight} - top - bottom,\n    layout: 'horizontal',\n    // FIXME\n    // naming?\n    axisExpandable: false,\n    axisExpandCenter: null,\n    axisExpandCount: 0,\n    axisExpandWidth: 50,\n    axisExpandRate: 17,\n    axisExpandDebounce: 50,\n    // [out, in, jumpTarget]. In percentage. If use [null, 0.05], null means full.\n    // Do not doc to user until necessary.\n    axisExpandSlideTriggerArea: [-0.15, 0.05, 0.4],\n    axisExpandTriggerOn: 'click',\n    parallelAxisDefault: null\n  };\n  return ParallelModel;\n}(ComponentModel);\nexport default ParallelModel;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport Axis from '../Axis.js';\nvar ParallelAxis = /** @class */function (_super) {\n  __extends(ParallelAxis, _super);\n  function ParallelAxis(dim, scale, coordExtent, axisType, axisIndex) {\n    var _this = _super.call(this, dim, scale, coordExtent) || this;\n    _this.type = axisType || 'value';\n    _this.axisIndex = axisIndex;\n    return _this;\n  }\n  ParallelAxis.prototype.isHorizontal = function () {\n    return this.coordinateSystem.getModel().get('layout') !== 'horizontal';\n  };\n  return ParallelAxis;\n}(Axis);\nexport default ParallelAxis;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n/**\n * Calculate slider move result.\n * Usage:\n * (1) If both handle0 and handle1 are needed to be moved, set minSpan the same as\n * maxSpan and the same as `Math.abs(handleEnd[1] - handleEnds[0])`.\n * (2) If handle0 is forbidden to cross handle1, set minSpan as `0`.\n *\n * @param delta Move length.\n * @param handleEnds handleEnds[0] can be bigger then handleEnds[1].\n *              handleEnds will be modified in this method.\n * @param extent handleEnds is restricted by extent.\n *              extent[0] should less or equals than extent[1].\n * @param handleIndex Can be 'all', means that both move the two handleEnds.\n * @param minSpan The range of dataZoom can not be smaller than that.\n *              If not set, handle0 and cross handle1. If set as a non-negative\n *              number (including `0`), handles will push each other when reaching\n *              the minSpan.\n * @param maxSpan The range of dataZoom can not be larger than that.\n * @return The input handleEnds.\n */\nexport default function sliderMove(delta, handleEnds, extent, handleIndex, minSpan, maxSpan) {\n  delta = delta || 0;\n  var extentSpan = extent[1] - extent[0];\n  // Notice maxSpan and minSpan can be null/undefined.\n  if (minSpan != null) {\n    minSpan = restrict(minSpan, [0, extentSpan]);\n  }\n  if (maxSpan != null) {\n    maxSpan = Math.max(maxSpan, minSpan != null ? minSpan : 0);\n  }\n  if (handleIndex === 'all') {\n    var handleSpan = Math.abs(handleEnds[1] - handleEnds[0]);\n    handleSpan = restrict(handleSpan, [0, extentSpan]);\n    minSpan = maxSpan = restrict(handleSpan, [minSpan, maxSpan]);\n    handleIndex = 0;\n  }\n  handleEnds[0] = restrict(handleEnds[0], extent);\n  handleEnds[1] = restrict(handleEnds[1], extent);\n  var originalDistSign = getSpanSign(handleEnds, handleIndex);\n  handleEnds[handleIndex] += delta;\n  // Restrict in extent.\n  var extentMinSpan = minSpan || 0;\n  var realExtent = extent.slice();\n  originalDistSign.sign < 0 ? realExtent[0] += extentMinSpan : realExtent[1] -= extentMinSpan;\n  handleEnds[handleIndex] = restrict(handleEnds[handleIndex], realExtent);\n  // Expand span.\n  var currDistSign;\n  currDistSign = getSpanSign(handleEnds, handleIndex);\n  if (minSpan != null && (currDistSign.sign !== originalDistSign.sign || currDistSign.span < minSpan)) {\n    // If minSpan exists, 'cross' is forbidden.\n    handleEnds[1 - handleIndex] = handleEnds[handleIndex] + originalDistSign.sign * minSpan;\n  }\n  // Shrink span.\n  currDistSign = getSpanSign(handleEnds, handleIndex);\n  if (maxSpan != null && currDistSign.span > maxSpan) {\n    handleEnds[1 - handleIndex] = handleEnds[handleIndex] + currDistSign.sign * maxSpan;\n  }\n  return handleEnds;\n}\nfunction getSpanSign(handleEnds, handleIndex) {\n  var dist = handleEnds[handleIndex] - handleEnds[1 - handleIndex];\n  // If `handleEnds[0] === handleEnds[1]`, always believe that handleEnd[0]\n  // is at left of handleEnds[1] for non-cross case.\n  return {\n    span: Math.abs(dist),\n    sign: dist > 0 ? -1 : dist < 0 ? 1 : handleIndex ? -1 : 1\n  };\n}\nfunction restrict(value, extend) {\n  return Math.min(extend[1] != null ? extend[1] : Infinity, Math.max(extend[0] != null ? extend[0] : -Infinity, value));\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n/**\n * Parallel Coordinates\n * <https://en.wikipedia.org/wiki/Parallel_coordinates>\n */\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as matrix from 'zrender/lib/core/matrix.js';\nimport * as layoutUtil from '../../util/layout.js';\nimport * as axisHelper from '../../coord/axisHelper.js';\nimport ParallelAxis from './ParallelAxis.js';\nimport * as graphic from '../../util/graphic.js';\nimport * as numberUtil from '../../util/number.js';\nimport sliderMove from '../../component/helper/sliderMove.js';\nvar each = zrUtil.each;\nvar mathMin = Math.min;\nvar mathMax = Math.max;\nvar mathFloor = Math.floor;\nvar mathCeil = Math.ceil;\nvar round = numberUtil.round;\nvar PI = Math.PI;\nvar Parallel = /** @class */function () {\n  function Parallel(parallelModel, ecModel, api) {\n    this.type = 'parallel';\n    /**\n     * key: dimension\n     */\n    this._axesMap = zrUtil.createHashMap();\n    /**\n     * key: dimension\n     * value: {position: [], rotation, }\n     */\n    this._axesLayout = {};\n    this.dimensions = parallelModel.dimensions;\n    this._model = parallelModel;\n    this._init(parallelModel, ecModel, api);\n  }\n  Parallel.prototype._init = function (parallelModel, ecModel, api) {\n    var dimensions = parallelModel.dimensions;\n    var parallelAxisIndex = parallelModel.parallelAxisIndex;\n    each(dimensions, function (dim, idx) {\n      var axisIndex = parallelAxisIndex[idx];\n      var axisModel = ecModel.getComponent('parallelAxis', axisIndex);\n      var axis = this._axesMap.set(dim, new ParallelAxis(dim, axisHelper.createScaleByModel(axisModel), [0, 0], axisModel.get('type'), axisIndex));\n      var isCategory = axis.type === 'category';\n      axis.onBand = isCategory && axisModel.get('boundaryGap');\n      axis.inverse = axisModel.get('inverse');\n      // Injection\n      axisModel.axis = axis;\n      axis.model = axisModel;\n      axis.coordinateSystem = axisModel.coordinateSystem = this;\n    }, this);\n  };\n  /**\n   * Update axis scale after data processed\n   */\n  Parallel.prototype.update = function (ecModel, api) {\n    this._updateAxesFromSeries(this._model, ecModel);\n  };\n  Parallel.prototype.containPoint = function (point) {\n    var layoutInfo = this._makeLayoutInfo();\n    var axisBase = layoutInfo.axisBase;\n    var layoutBase = layoutInfo.layoutBase;\n    var pixelDimIndex = layoutInfo.pixelDimIndex;\n    var pAxis = point[1 - pixelDimIndex];\n    var pLayout = point[pixelDimIndex];\n    return pAxis >= axisBase && pAxis <= axisBase + layoutInfo.axisLength && pLayout >= layoutBase && pLayout <= layoutBase + layoutInfo.layoutLength;\n  };\n  Parallel.prototype.getModel = function () {\n    return this._model;\n  };\n  /**\n   * Update properties from series\n   */\n  Parallel.prototype._updateAxesFromSeries = function (parallelModel, ecModel) {\n    ecModel.eachSeries(function (seriesModel) {\n      if (!parallelModel.contains(seriesModel, ecModel)) {\n        return;\n      }\n      var data = seriesModel.getData();\n      each(this.dimensions, function (dim) {\n        var axis = this._axesMap.get(dim);\n        axis.scale.unionExtentFromData(data, data.mapDimension(dim));\n        axisHelper.niceScaleExtent(axis.scale, axis.model);\n      }, this);\n    }, this);\n  };\n  /**\n   * Resize the parallel coordinate system.\n   */\n  Parallel.prototype.resize = function (parallelModel, api) {\n    var refContainer = layoutUtil.createBoxLayoutReference(parallelModel, api).refContainer;\n    this._rect = layoutUtil.getLayoutRect(parallelModel.getBoxLayoutParams(), refContainer);\n    this._layoutAxes();\n  };\n  Parallel.prototype.getRect = function () {\n    return this._rect;\n  };\n  Parallel.prototype._makeLayoutInfo = function () {\n    var parallelModel = this._model;\n    var rect = this._rect;\n    var xy = ['x', 'y'];\n    var wh = ['width', 'height'];\n    var layout = parallelModel.get('layout');\n    var pixelDimIndex = layout === 'horizontal' ? 0 : 1;\n    var layoutLength = rect[wh[pixelDimIndex]];\n    var layoutExtent = [0, layoutLength];\n    var axisCount = this.dimensions.length;\n    var axisExpandWidth = restrict(parallelModel.get('axisExpandWidth'), layoutExtent);\n    var axisExpandCount = restrict(parallelModel.get('axisExpandCount') || 0, [0, axisCount]);\n    var axisExpandable = parallelModel.get('axisExpandable') && axisCount > 3 && axisCount > axisExpandCount && axisExpandCount > 1 && axisExpandWidth > 0 && layoutLength > 0;\n    // `axisExpandWindow` is According to the coordinates of [0, axisExpandLength],\n    // for sake of consider the case that axisCollapseWidth is 0 (when screen is narrow),\n    // where collapsed axes should be overlapped.\n    var axisExpandWindow = parallelModel.get('axisExpandWindow');\n    var winSize;\n    if (!axisExpandWindow) {\n      winSize = restrict(axisExpandWidth * (axisExpandCount - 1), layoutExtent);\n      var axisExpandCenter = parallelModel.get('axisExpandCenter') || mathFloor(axisCount / 2);\n      axisExpandWindow = [axisExpandWidth * axisExpandCenter - winSize / 2];\n      axisExpandWindow[1] = axisExpandWindow[0] + winSize;\n    } else {\n      winSize = restrict(axisExpandWindow[1] - axisExpandWindow[0], layoutExtent);\n      axisExpandWindow[1] = axisExpandWindow[0] + winSize;\n    }\n    var axisCollapseWidth = (layoutLength - winSize) / (axisCount - axisExpandCount);\n    // Avoid axisCollapseWidth is too small.\n    axisCollapseWidth < 3 && (axisCollapseWidth = 0);\n    // Find the first and last indices > ewin[0] and < ewin[1].\n    var winInnerIndices = [mathFloor(round(axisExpandWindow[0] / axisExpandWidth, 1)) + 1, mathCeil(round(axisExpandWindow[1] / axisExpandWidth, 1)) - 1];\n    // Pos in ec coordinates.\n    var axisExpandWindow0Pos = axisCollapseWidth / axisExpandWidth * axisExpandWindow[0];\n    return {\n      layout: layout,\n      pixelDimIndex: pixelDimIndex,\n      layoutBase: rect[xy[pixelDimIndex]],\n      layoutLength: layoutLength,\n      axisBase: rect[xy[1 - pixelDimIndex]],\n      axisLength: rect[wh[1 - pixelDimIndex]],\n      axisExpandable: axisExpandable,\n      axisExpandWidth: axisExpandWidth,\n      axisCollapseWidth: axisCollapseWidth,\n      axisExpandWindow: axisExpandWindow,\n      axisCount: axisCount,\n      winInnerIndices: winInnerIndices,\n      axisExpandWindow0Pos: axisExpandWindow0Pos\n    };\n  };\n  Parallel.prototype._layoutAxes = function () {\n    var rect = this._rect;\n    var axes = this._axesMap;\n    var dimensions = this.dimensions;\n    var layoutInfo = this._makeLayoutInfo();\n    var layout = layoutInfo.layout;\n    axes.each(function (axis) {\n      var axisExtent = [0, layoutInfo.axisLength];\n      var idx = axis.inverse ? 1 : 0;\n      axis.setExtent(axisExtent[idx], axisExtent[1 - idx]);\n    });\n    each(dimensions, function (dim, idx) {\n      var posInfo = (layoutInfo.axisExpandable ? layoutAxisWithExpand : layoutAxisWithoutExpand)(idx, layoutInfo);\n      var positionTable = {\n        horizontal: {\n          x: posInfo.position,\n          y: layoutInfo.axisLength\n        },\n        vertical: {\n          x: 0,\n          y: posInfo.position\n        }\n      };\n      var rotationTable = {\n        horizontal: PI / 2,\n        vertical: 0\n      };\n      var position = [positionTable[layout].x + rect.x, positionTable[layout].y + rect.y];\n      var rotation = rotationTable[layout];\n      var transform = matrix.create();\n      matrix.rotate(transform, transform, rotation);\n      matrix.translate(transform, transform, position);\n      // TODO\n      // tick layout info\n      // TODO\n      // update dimensions info based on axis order.\n      this._axesLayout[dim] = {\n        position: position,\n        rotation: rotation,\n        transform: transform,\n        axisNameAvailableWidth: posInfo.axisNameAvailableWidth,\n        axisLabelShow: posInfo.axisLabelShow,\n        nameTruncateMaxWidth: posInfo.nameTruncateMaxWidth,\n        tickDirection: 1,\n        labelDirection: 1\n      };\n    }, this);\n  };\n  /**\n   * Get axis by dim.\n   */\n  Parallel.prototype.getAxis = function (dim) {\n    return this._axesMap.get(dim);\n  };\n  /**\n   * Convert a dim value of a single item of series data to Point.\n   */\n  Parallel.prototype.dataToPoint = function (value, dim) {\n    return this.axisCoordToPoint(this._axesMap.get(dim).dataToCoord(value), dim);\n  };\n  /**\n   * Travel data for one time, get activeState of each data item.\n   * @param start the start dataIndex that travel from.\n   * @param end the next dataIndex of the last dataIndex will be travel.\n   */\n  Parallel.prototype.eachActiveState = function (data, callback, start, end) {\n    start == null && (start = 0);\n    end == null && (end = data.count());\n    var axesMap = this._axesMap;\n    var dimensions = this.dimensions;\n    var dataDimensions = [];\n    var axisModels = [];\n    zrUtil.each(dimensions, function (axisDim) {\n      dataDimensions.push(data.mapDimension(axisDim));\n      axisModels.push(axesMap.get(axisDim).model);\n    });\n    var hasActiveSet = this.hasAxisBrushed();\n    for (var dataIndex = start; dataIndex < end; dataIndex++) {\n      var activeState = void 0;\n      if (!hasActiveSet) {\n        activeState = 'normal';\n      } else {\n        activeState = 'active';\n        var values = data.getValues(dataDimensions, dataIndex);\n        for (var j = 0, lenj = dimensions.length; j < lenj; j++) {\n          var state = axisModels[j].getActiveState(values[j]);\n          if (state === 'inactive') {\n            activeState = 'inactive';\n            break;\n          }\n        }\n      }\n      callback(activeState, dataIndex);\n    }\n  };\n  /**\n   * Whether has any activeSet.\n   */\n  Parallel.prototype.hasAxisBrushed = function () {\n    var dimensions = this.dimensions;\n    var axesMap = this._axesMap;\n    var hasActiveSet = false;\n    for (var j = 0, lenj = dimensions.length; j < lenj; j++) {\n      if (axesMap.get(dimensions[j]).model.getActiveState() !== 'normal') {\n        hasActiveSet = true;\n      }\n    }\n    return hasActiveSet;\n  };\n  /**\n   * Convert coords of each axis to Point.\n   *  Return point. For example: [10, 20]\n   */\n  Parallel.prototype.axisCoordToPoint = function (coord, dim) {\n    var axisLayout = this._axesLayout[dim];\n    return graphic.applyTransform([coord, 0], axisLayout.transform);\n  };\n  /**\n   * Get axis layout.\n   */\n  Parallel.prototype.getAxisLayout = function (dim) {\n    return zrUtil.clone(this._axesLayout[dim]);\n  };\n  /**\n   * @return {Object} {axisExpandWindow, delta, behavior: 'jump' | 'slide' | 'none'}.\n   */\n  Parallel.prototype.getSlidedAxisExpandWindow = function (point) {\n    var layoutInfo = this._makeLayoutInfo();\n    var pixelDimIndex = layoutInfo.pixelDimIndex;\n    var axisExpandWindow = layoutInfo.axisExpandWindow.slice();\n    var winSize = axisExpandWindow[1] - axisExpandWindow[0];\n    var extent = [0, layoutInfo.axisExpandWidth * (layoutInfo.axisCount - 1)];\n    // Out of the area of coordinate system.\n    if (!this.containPoint(point)) {\n      return {\n        behavior: 'none',\n        axisExpandWindow: axisExpandWindow\n      };\n    }\n    // Convert the point from global to expand coordinates.\n    var pointCoord = point[pixelDimIndex] - layoutInfo.layoutBase - layoutInfo.axisExpandWindow0Pos;\n    // For dragging operation convenience, the window should not be\n    // slided when mouse is the center area of the window.\n    var delta;\n    var behavior = 'slide';\n    var axisCollapseWidth = layoutInfo.axisCollapseWidth;\n    var triggerArea = this._model.get('axisExpandSlideTriggerArea');\n    // But consider touch device, jump is necessary.\n    var useJump = triggerArea[0] != null;\n    if (axisCollapseWidth) {\n      if (useJump && axisCollapseWidth && pointCoord < winSize * triggerArea[0]) {\n        behavior = 'jump';\n        delta = pointCoord - winSize * triggerArea[2];\n      } else if (useJump && axisCollapseWidth && pointCoord > winSize * (1 - triggerArea[0])) {\n        behavior = 'jump';\n        delta = pointCoord - winSize * (1 - triggerArea[2]);\n      } else {\n        (delta = pointCoord - winSize * triggerArea[1]) >= 0 && (delta = pointCoord - winSize * (1 - triggerArea[1])) <= 0 && (delta = 0);\n      }\n      delta *= layoutInfo.axisExpandWidth / axisCollapseWidth;\n      delta ? sliderMove(delta, axisExpandWindow, extent, 'all')\n      // Avoid nonsense triger on mousemove.\n      : behavior = 'none';\n    }\n    // When screen is too narrow, make it visible and slidable, although it is hard to interact.\n    else {\n      var winSize2 = axisExpandWindow[1] - axisExpandWindow[0];\n      var pos = extent[1] * pointCoord / winSize2;\n      axisExpandWindow = [mathMax(0, pos - winSize2 / 2)];\n      axisExpandWindow[1] = mathMin(extent[1], axisExpandWindow[0] + winSize2);\n      axisExpandWindow[0] = axisExpandWindow[1] - winSize2;\n    }\n    return {\n      axisExpandWindow: axisExpandWindow,\n      behavior: behavior\n    };\n  };\n  return Parallel;\n}();\nfunction restrict(len, extent) {\n  return mathMin(mathMax(len, extent[0]), extent[1]);\n}\nfunction layoutAxisWithoutExpand(axisIndex, layoutInfo) {\n  var step = layoutInfo.layoutLength / (layoutInfo.axisCount - 1);\n  return {\n    position: step * axisIndex,\n    axisNameAvailableWidth: step,\n    axisLabelShow: true\n  };\n}\nfunction layoutAxisWithExpand(axisIndex, layoutInfo) {\n  var layoutLength = layoutInfo.layoutLength;\n  var axisExpandWidth = layoutInfo.axisExpandWidth;\n  var axisCount = layoutInfo.axisCount;\n  var axisCollapseWidth = layoutInfo.axisCollapseWidth;\n  var winInnerIndices = layoutInfo.winInnerIndices;\n  var position;\n  var axisNameAvailableWidth = axisCollapseWidth;\n  var axisLabelShow = false;\n  var nameTruncateMaxWidth;\n  if (axisIndex < winInnerIndices[0]) {\n    position = axisIndex * axisCollapseWidth;\n    nameTruncateMaxWidth = axisCollapseWidth;\n  } else if (axisIndex <= winInnerIndices[1]) {\n    position = layoutInfo.axisExpandWindow0Pos + axisIndex * axisExpandWidth - layoutInfo.axisExpandWindow[0];\n    axisNameAvailableWidth = axisExpandWidth;\n    axisLabelShow = true;\n  } else {\n    position = layoutLength - (axisCount - 1 - axisIndex) * axisCollapseWidth;\n    nameTruncateMaxWidth = axisCollapseWidth;\n  }\n  return {\n    position: position,\n    axisNameAvailableWidth: axisNameAvailableWidth,\n    axisLabelShow: axisLabelShow,\n    nameTruncateMaxWidth: nameTruncateMaxWidth\n  };\n}\nexport default Parallel;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n/**\n * Parallel coordinate system creater.\n */\nimport Parallel from './Parallel.js';\nimport { SINGLE_REFERRING } from '../../util/model.js';\nfunction createParallelCoordSys(ecModel, api) {\n  var coordSysList = [];\n  ecModel.eachComponent('parallel', function (parallelModel, idx) {\n    var coordSys = new Parallel(parallelModel, ecModel, api);\n    coordSys.name = 'parallel_' + idx;\n    coordSys.resize(parallelModel, api);\n    parallelModel.coordinateSystem = coordSys;\n    coordSys.model = parallelModel;\n    coordSysList.push(coordSys);\n  });\n  // Inject the coordinateSystems into seriesModel\n  ecModel.eachSeries(function (seriesModel) {\n    if (seriesModel.get('coordinateSystem') === 'parallel') {\n      var parallelModel = seriesModel.getReferringComponents('parallel', SINGLE_REFERRING).models[0];\n      seriesModel.coordinateSystem = parallelModel.coordinateSystem;\n    }\n  });\n  return coordSysList;\n}\nvar parallelCoordSysCreator = {\n  create: createParallelCoordSys\n};\nexport default parallelCoordSysCreator;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport ComponentModel from '../../model/Component.js';\nimport makeStyleMapper from '../../model/mixin/makeStyleMapper.js';\nimport * as numberUtil from '../../util/number.js';\nimport { AxisModelCommonMixin } from '../axisModelCommonMixin.js';\nvar ParallelAxisModel = /** @class */function (_super) {\n  __extends(ParallelAxisModel, _super);\n  function ParallelAxisModel() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = ParallelAxisModel.type;\n    /**\n     * @readOnly\n     */\n    _this.activeIntervals = [];\n    return _this;\n  }\n  ParallelAxisModel.prototype.getAreaSelectStyle = function () {\n    return makeStyleMapper([['fill', 'color'], ['lineWidth', 'borderWidth'], ['stroke', 'borderColor'], ['width', 'width'], ['opacity', 'opacity']\n    // Option decal is in `DecalObject` but style.decal is in `PatternObject`.\n    // So do not transfer decal directly.\n    ])(this.getModel('areaSelectStyle'));\n  };\n  /**\n   * The code of this feature is put on AxisModel but not ParallelAxis,\n   * because axisModel can be alive after echarts updating but instance of\n   * ParallelAxis having been disposed. this._activeInterval should be kept\n   * when action dispatched (i.e. legend click).\n   *\n   * @param intervals `interval.length === 0` means set all active.\n   */\n  ParallelAxisModel.prototype.setActiveIntervals = function (intervals) {\n    var activeIntervals = this.activeIntervals = zrUtil.clone(intervals);\n    // Normalize\n    if (activeIntervals) {\n      for (var i = activeIntervals.length - 1; i >= 0; i--) {\n        numberUtil.asc(activeIntervals[i]);\n      }\n    }\n  };\n  /**\n   * @param value When only attempting detect whether 'no activeIntervals set',\n   *        `value` is not needed to be input.\n   */\n  ParallelAxisModel.prototype.getActiveState = function (value) {\n    var activeIntervals = this.activeIntervals;\n    if (!activeIntervals.length) {\n      return 'normal';\n    }\n    if (value == null || isNaN(+value)) {\n      return 'inactive';\n    }\n    // Simple optimization\n    if (activeIntervals.length === 1) {\n      var interval = activeIntervals[0];\n      if (interval[0] <= value && value <= interval[1]) {\n        return 'active';\n      }\n    } else {\n      for (var i = 0, len = activeIntervals.length; i < len; i++) {\n        if (activeIntervals[i][0] <= value && value <= activeIntervals[i][1]) {\n          return 'active';\n        }\n      }\n    }\n    return 'inactive';\n  };\n  return ParallelAxisModel;\n}(ComponentModel);\nzrUtil.mixin(ParallelAxisModel, AxisModelCommonMixin);\nexport default ParallelAxisModel;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport { curry, each, map, bind, merge, clone, defaults, assert } from 'zrender/lib/core/util.js';\nimport Eventful from 'zrender/lib/core/Eventful.js';\nimport * as graphic from '../../util/graphic.js';\nimport * as interactionMutex from './interactionMutex.js';\nimport DataDiffer from '../../data/DataDiffer.js';\nimport tokens from '../../visual/tokens.js';\nvar BRUSH_PANEL_GLOBAL = true;\nvar mathMin = Math.min;\nvar mathMax = Math.max;\nvar mathPow = Math.pow;\nvar COVER_Z = 10000;\nvar UNSELECT_THRESHOLD = 6;\nvar MIN_RESIZE_LINE_WIDTH = 6;\nvar MUTEX_RESOURCE_KEY = 'globalPan';\nvar DIRECTION_MAP = {\n  w: [0, 0],\n  e: [0, 1],\n  n: [1, 0],\n  s: [1, 1]\n};\nvar CURSOR_MAP = {\n  w: 'ew',\n  e: 'ew',\n  n: 'ns',\n  s: 'ns',\n  ne: 'nesw',\n  sw: 'nesw',\n  nw: 'nwse',\n  se: 'nwse'\n};\nvar DEFAULT_BRUSH_OPT = {\n  brushStyle: {\n    lineWidth: 2,\n    stroke: tokens.color.backgroundTint,\n    fill: tokens.color.borderTint\n  },\n  transformable: true,\n  brushMode: 'single',\n  removeOnClick: false\n};\nvar baseUID = 0;\n/**\n * params:\n *     areas: Array.<Array>, coord relates to container group,\n *                             If no container specified, to global.\n *     opt {\n *         isEnd: boolean,\n *         removeOnClick: boolean\n *     }\n */\nvar BrushController = /** @class */function (_super) {\n  __extends(BrushController, _super);\n  function BrushController(zr) {\n    var _this = _super.call(this) || this;\n    /**\n     * @internal\n     */\n    _this._track = [];\n    /**\n     * @internal\n     */\n    _this._covers = [];\n    _this._handlers = {};\n    if (process.env.NODE_ENV !== 'production') {\n      assert(zr);\n    }\n    _this._zr = zr;\n    _this.group = new graphic.Group();\n    _this._uid = 'brushController_' + baseUID++;\n    each(pointerHandlers, function (handler, eventName) {\n      this._handlers[eventName] = bind(handler, this);\n    }, _this);\n    return _this;\n  }\n  /**\n   * If set to `false`, select disabled.\n   */\n  BrushController.prototype.enableBrush = function (brushOption) {\n    if (process.env.NODE_ENV !== 'production') {\n      assert(this._mounted);\n    }\n    this._brushType && this._doDisableBrush();\n    brushOption.brushType && this._doEnableBrush(brushOption);\n    return this;\n  };\n  BrushController.prototype._doEnableBrush = function (brushOption) {\n    var zr = this._zr;\n    // Consider roam, which takes globalPan too.\n    if (!this._enableGlobalPan) {\n      interactionMutex.take(zr, MUTEX_RESOURCE_KEY, this._uid);\n    }\n    each(this._handlers, function (handler, eventName) {\n      zr.on(eventName, handler);\n    });\n    this._brushType = brushOption.brushType;\n    this._brushOption = merge(clone(DEFAULT_BRUSH_OPT), brushOption, true);\n  };\n  BrushController.prototype._doDisableBrush = function () {\n    var zr = this._zr;\n    interactionMutex.release(zr, MUTEX_RESOURCE_KEY, this._uid);\n    each(this._handlers, function (handler, eventName) {\n      zr.off(eventName, handler);\n    });\n    this._brushType = this._brushOption = null;\n  };\n  /**\n   * @param panelOpts If not pass, it is global brush.\n   */\n  BrushController.prototype.setPanels = function (panelOpts) {\n    if (panelOpts && panelOpts.length) {\n      var panels_1 = this._panels = {};\n      each(panelOpts, function (panelOpts) {\n        panels_1[panelOpts.panelId] = clone(panelOpts);\n      });\n    } else {\n      this._panels = null;\n    }\n    return this;\n  };\n  BrushController.prototype.mount = function (opt) {\n    opt = opt || {};\n    if (process.env.NODE_ENV !== 'production') {\n      this._mounted = true; // should be at first.\n    }\n    this._enableGlobalPan = opt.enableGlobalPan;\n    var thisGroup = this.group;\n    this._zr.add(thisGroup);\n    thisGroup.attr({\n      x: opt.x || 0,\n      y: opt.y || 0,\n      rotation: opt.rotation || 0,\n      scaleX: opt.scaleX || 1,\n      scaleY: opt.scaleY || 1\n    });\n    this._transform = thisGroup.getLocalTransform();\n    return this;\n  };\n  // eachCover(cb, context): void {\n  //     each(this._covers, cb, context);\n  // }\n  /**\n   * Update covers.\n   * @param coverConfigList\n   *        If coverConfigList is null/undefined, all covers removed.\n   */\n  BrushController.prototype.updateCovers = function (coverConfigList) {\n    if (process.env.NODE_ENV !== 'production') {\n      assert(this._mounted);\n    }\n    coverConfigList = map(coverConfigList, function (coverConfig) {\n      return merge(clone(DEFAULT_BRUSH_OPT), coverConfig, true);\n    });\n    var tmpIdPrefix = '\\0-brush-index-';\n    var oldCovers = this._covers;\n    var newCovers = this._covers = [];\n    var controller = this;\n    var creatingCover = this._creatingCover;\n    new DataDiffer(oldCovers, coverConfigList, oldGetKey, getKey).add(addOrUpdate).update(addOrUpdate).remove(remove).execute();\n    return this;\n    function getKey(brushOption, index) {\n      return (brushOption.id != null ? brushOption.id : tmpIdPrefix + index) + '-' + brushOption.brushType;\n    }\n    function oldGetKey(cover, index) {\n      return getKey(cover.__brushOption, index);\n    }\n    function addOrUpdate(newIndex, oldIndex) {\n      var newBrushInternal = coverConfigList[newIndex];\n      // Consider setOption in event listener of brushSelect,\n      // where updating cover when creating should be forbidden.\n      if (oldIndex != null && oldCovers[oldIndex] === creatingCover) {\n        newCovers[newIndex] = oldCovers[oldIndex];\n      } else {\n        var cover = newCovers[newIndex] = oldIndex != null ? (oldCovers[oldIndex].__brushOption = newBrushInternal, oldCovers[oldIndex]) : endCreating(controller, createCover(controller, newBrushInternal));\n        updateCoverAfterCreation(controller, cover);\n      }\n    }\n    function remove(oldIndex) {\n      if (oldCovers[oldIndex] !== creatingCover) {\n        controller.group.remove(oldCovers[oldIndex]);\n      }\n    }\n  };\n  BrushController.prototype.unmount = function () {\n    if (process.env.NODE_ENV !== 'production') {\n      if (!this._mounted) {\n        return;\n      }\n    }\n    this.enableBrush(false);\n    // container may 'removeAll' outside.\n    clearCovers(this);\n    this._zr.remove(this.group);\n    if (process.env.NODE_ENV !== 'production') {\n      this._mounted = false; // should be at last.\n    }\n    return this;\n  };\n  BrushController.prototype.dispose = function () {\n    this.unmount();\n    this.off();\n  };\n  return BrushController;\n}(Eventful);\nfunction createCover(controller, brushOption) {\n  var cover = coverRenderers[brushOption.brushType].createCover(controller, brushOption);\n  cover.__brushOption = brushOption;\n  updateZ(cover, brushOption);\n  controller.group.add(cover);\n  return cover;\n}\nfunction endCreating(controller, creatingCover) {\n  var coverRenderer = getCoverRenderer(creatingCover);\n  if (coverRenderer.endCreating) {\n    coverRenderer.endCreating(controller, creatingCover);\n    updateZ(creatingCover, creatingCover.__brushOption);\n  }\n  return creatingCover;\n}\nfunction updateCoverShape(controller, cover) {\n  var brushOption = cover.__brushOption;\n  getCoverRenderer(cover).updateCoverShape(controller, cover, brushOption.range, brushOption);\n}\nfunction updateZ(cover, brushOption) {\n  var z = brushOption.z;\n  z == null && (z = COVER_Z);\n  cover.traverse(function (el) {\n    el.z = z;\n    el.z2 = z; // Consider in given container.\n  });\n}\nfunction updateCoverAfterCreation(controller, cover) {\n  getCoverRenderer(cover).updateCommon(controller, cover);\n  updateCoverShape(controller, cover);\n}\nfunction getCoverRenderer(cover) {\n  return coverRenderers[cover.__brushOption.brushType];\n}\n// return target panel or `true` (means global panel)\nfunction getPanelByPoint(controller, e, localCursorPoint) {\n  var panels = controller._panels;\n  if (!panels) {\n    return BRUSH_PANEL_GLOBAL; // Global panel\n  }\n  var panel;\n  var transform = controller._transform;\n  each(panels, function (pn) {\n    pn.isTargetByCursor(e, localCursorPoint, transform) && (panel = pn);\n  });\n  return panel;\n}\n// Return a panel or true\nfunction getPanelByCover(controller, cover) {\n  var panels = controller._panels;\n  if (!panels) {\n    return BRUSH_PANEL_GLOBAL; // Global panel\n  }\n  var panelId = cover.__brushOption.panelId;\n  // User may give cover without coord sys info,\n  // which is then treated as global panel.\n  return panelId != null ? panels[panelId] : BRUSH_PANEL_GLOBAL;\n}\nfunction clearCovers(controller) {\n  var covers = controller._covers;\n  var originalLength = covers.length;\n  each(covers, function (cover) {\n    controller.group.remove(cover);\n  }, controller);\n  covers.length = 0;\n  return !!originalLength;\n}\nfunction trigger(controller, opt) {\n  var areas = map(controller._covers, function (cover) {\n    var brushOption = cover.__brushOption;\n    var range = clone(brushOption.range);\n    return {\n      brushType: brushOption.brushType,\n      panelId: brushOption.panelId,\n      range: range\n    };\n  });\n  controller.trigger('brush', {\n    areas: areas,\n    isEnd: !!opt.isEnd,\n    removeOnClick: !!opt.removeOnClick\n  });\n}\nfunction shouldShowCover(controller) {\n  var track = controller._track;\n  if (!track.length) {\n    return false;\n  }\n  var p2 = track[track.length - 1];\n  var p1 = track[0];\n  var dx = p2[0] - p1[0];\n  var dy = p2[1] - p1[1];\n  var dist = mathPow(dx * dx + dy * dy, 0.5);\n  return dist > UNSELECT_THRESHOLD;\n}\nfunction getTrackEnds(track) {\n  var tail = track.length - 1;\n  tail < 0 && (tail = 0);\n  return [track[0], track[tail]];\n}\n;\nfunction createBaseRectCover(rectRangeConverter, controller, brushOption, edgeNameSequences) {\n  var cover = new graphic.Group();\n  cover.add(new graphic.Rect({\n    name: 'main',\n    style: makeStyle(brushOption),\n    silent: true,\n    draggable: true,\n    cursor: 'move',\n    drift: curry(driftRect, rectRangeConverter, controller, cover, ['n', 's', 'w', 'e']),\n    ondragend: curry(trigger, controller, {\n      isEnd: true\n    })\n  }));\n  each(edgeNameSequences, function (nameSequence) {\n    cover.add(new graphic.Rect({\n      name: nameSequence.join(''),\n      style: {\n        opacity: 0\n      },\n      draggable: true,\n      silent: true,\n      invisible: true,\n      drift: curry(driftRect, rectRangeConverter, controller, cover, nameSequence),\n      ondragend: curry(trigger, controller, {\n        isEnd: true\n      })\n    }));\n  });\n  return cover;\n}\nfunction updateBaseRect(controller, cover, localRange, brushOption) {\n  var lineWidth = brushOption.brushStyle.lineWidth || 0;\n  var handleSize = mathMax(lineWidth, MIN_RESIZE_LINE_WIDTH);\n  var x = localRange[0][0];\n  var y = localRange[1][0];\n  var xa = x - lineWidth / 2;\n  var ya = y - lineWidth / 2;\n  var x2 = localRange[0][1];\n  var y2 = localRange[1][1];\n  var x2a = x2 - handleSize + lineWidth / 2;\n  var y2a = y2 - handleSize + lineWidth / 2;\n  var width = x2 - x;\n  var height = y2 - y;\n  var widtha = width + lineWidth;\n  var heighta = height + lineWidth;\n  updateRectShape(controller, cover, 'main', x, y, width, height);\n  if (brushOption.transformable) {\n    updateRectShape(controller, cover, 'w', xa, ya, handleSize, heighta);\n    updateRectShape(controller, cover, 'e', x2a, ya, handleSize, heighta);\n    updateRectShape(controller, cover, 'n', xa, ya, widtha, handleSize);\n    updateRectShape(controller, cover, 's', xa, y2a, widtha, handleSize);\n    updateRectShape(controller, cover, 'nw', xa, ya, handleSize, handleSize);\n    updateRectShape(controller, cover, 'ne', x2a, ya, handleSize, handleSize);\n    updateRectShape(controller, cover, 'sw', xa, y2a, handleSize, handleSize);\n    updateRectShape(controller, cover, 'se', x2a, y2a, handleSize, handleSize);\n  }\n}\nfunction updateCommon(controller, cover) {\n  var brushOption = cover.__brushOption;\n  var transformable = brushOption.transformable;\n  var mainEl = cover.childAt(0);\n  mainEl.useStyle(makeStyle(brushOption));\n  mainEl.attr({\n    silent: !transformable,\n    cursor: transformable ? 'move' : 'default'\n  });\n  each([['w'], ['e'], ['n'], ['s'], ['s', 'e'], ['s', 'w'], ['n', 'e'], ['n', 'w']], function (nameSequence) {\n    var el = cover.childOfName(nameSequence.join(''));\n    var globalDir = nameSequence.length === 1 ? getGlobalDirection1(controller, nameSequence[0]) : getGlobalDirection2(controller, nameSequence);\n    el && el.attr({\n      silent: !transformable,\n      invisible: !transformable,\n      cursor: transformable ? CURSOR_MAP[globalDir] + '-resize' : null\n    });\n  });\n}\nfunction updateRectShape(controller, cover, name, x, y, w, h) {\n  var el = cover.childOfName(name);\n  el && el.setShape(pointsToRect(clipByPanel(controller, cover, [[x, y], [x + w, y + h]])));\n}\nfunction makeStyle(brushOption) {\n  return defaults({\n    strokeNoScale: true\n  }, brushOption.brushStyle);\n}\nfunction formatRectRange(x, y, x2, y2) {\n  var min = [mathMin(x, x2), mathMin(y, y2)];\n  var max = [mathMax(x, x2), mathMax(y, y2)];\n  return [[min[0], max[0]], [min[1], max[1]] // y range\n  ];\n}\nfunction getTransform(controller) {\n  return graphic.getTransform(controller.group);\n}\nfunction getGlobalDirection1(controller, localDirName) {\n  var map = {\n    w: 'left',\n    e: 'right',\n    n: 'top',\n    s: 'bottom'\n  };\n  var inverseMap = {\n    left: 'w',\n    right: 'e',\n    top: 'n',\n    bottom: 's'\n  };\n  var dir = graphic.transformDirection(map[localDirName], getTransform(controller));\n  return inverseMap[dir];\n}\nfunction getGlobalDirection2(controller, localDirNameSeq) {\n  var globalDir = [getGlobalDirection1(controller, localDirNameSeq[0]), getGlobalDirection1(controller, localDirNameSeq[1])];\n  (globalDir[0] === 'e' || globalDir[0] === 'w') && globalDir.reverse();\n  return globalDir.join('');\n}\nfunction driftRect(rectRangeConverter, controller, cover, dirNameSequence, dx, dy) {\n  var brushOption = cover.__brushOption;\n  var rectRange = rectRangeConverter.toRectRange(brushOption.range);\n  var localDelta = toLocalDelta(controller, dx, dy);\n  each(dirNameSequence, function (dirName) {\n    var ind = DIRECTION_MAP[dirName];\n    rectRange[ind[0]][ind[1]] += localDelta[ind[0]];\n  });\n  brushOption.range = rectRangeConverter.fromRectRange(formatRectRange(rectRange[0][0], rectRange[1][0], rectRange[0][1], rectRange[1][1]));\n  updateCoverAfterCreation(controller, cover);\n  trigger(controller, {\n    isEnd: false\n  });\n}\nfunction driftPolygon(controller, cover, dx, dy) {\n  var range = cover.__brushOption.range;\n  var localDelta = toLocalDelta(controller, dx, dy);\n  each(range, function (point) {\n    point[0] += localDelta[0];\n    point[1] += localDelta[1];\n  });\n  updateCoverAfterCreation(controller, cover);\n  trigger(controller, {\n    isEnd: false\n  });\n}\nfunction toLocalDelta(controller, dx, dy) {\n  var thisGroup = controller.group;\n  var localD = thisGroup.transformCoordToLocal(dx, dy);\n  var localZero = thisGroup.transformCoordToLocal(0, 0);\n  return [localD[0] - localZero[0], localD[1] - localZero[1]];\n}\nfunction clipByPanel(controller, cover, data) {\n  var panel = getPanelByCover(controller, cover);\n  return panel && panel !== BRUSH_PANEL_GLOBAL ? panel.clipPath(data, controller._transform) : clone(data);\n}\nfunction pointsToRect(points) {\n  var xmin = mathMin(points[0][0], points[1][0]);\n  var ymin = mathMin(points[0][1], points[1][1]);\n  var xmax = mathMax(points[0][0], points[1][0]);\n  var ymax = mathMax(points[0][1], points[1][1]);\n  return {\n    x: xmin,\n    y: ymin,\n    width: xmax - xmin,\n    height: ymax - ymin\n  };\n}\nfunction resetCursor(controller, e, localCursorPoint) {\n  if (\n  // Check active\n  !controller._brushType\n  // resetCursor should be always called when mouse is in zr area,\n  // but not called when mouse is out of zr area to avoid bad influence\n  // if `mousemove`, `mouseup` are triggered from `document` event.\n  || isOutsideZrArea(controller, e.offsetX, e.offsetY)) {\n    return;\n  }\n  var zr = controller._zr;\n  var covers = controller._covers;\n  var currPanel = getPanelByPoint(controller, e, localCursorPoint);\n  // Check whether in covers.\n  if (!controller._dragging) {\n    for (var i = 0; i < covers.length; i++) {\n      var brushOption = covers[i].__brushOption;\n      if (currPanel && (currPanel === BRUSH_PANEL_GLOBAL || brushOption.panelId === currPanel.panelId) && coverRenderers[brushOption.brushType].contain(covers[i], localCursorPoint[0], localCursorPoint[1])) {\n        // Use cursor style set on cover.\n        return;\n      }\n    }\n  }\n  currPanel && zr.setCursorStyle('crosshair');\n}\nfunction preventDefault(e) {\n  var rawE = e.event;\n  rawE.preventDefault && rawE.preventDefault();\n}\nfunction mainShapeContain(cover, x, y) {\n  return cover.childOfName('main').contain(x, y);\n}\nfunction updateCoverByMouse(controller, e, localCursorPoint, isEnd) {\n  var creatingCover = controller._creatingCover;\n  var panel = controller._creatingPanel;\n  var thisBrushOption = controller._brushOption;\n  var eventParams;\n  controller._track.push(localCursorPoint.slice());\n  if (shouldShowCover(controller) || creatingCover) {\n    if (panel && !creatingCover) {\n      thisBrushOption.brushMode === 'single' && clearCovers(controller);\n      var brushOption = clone(thisBrushOption);\n      brushOption.brushType = determineBrushType(brushOption.brushType, panel);\n      brushOption.panelId = panel === BRUSH_PANEL_GLOBAL ? null : panel.panelId;\n      creatingCover = controller._creatingCover = createCover(controller, brushOption);\n      controller._covers.push(creatingCover);\n    }\n    if (creatingCover) {\n      var coverRenderer = coverRenderers[determineBrushType(controller._brushType, panel)];\n      var coverBrushOption = creatingCover.__brushOption;\n      coverBrushOption.range = coverRenderer.getCreatingRange(clipByPanel(controller, creatingCover, controller._track));\n      if (isEnd) {\n        endCreating(controller, creatingCover);\n        coverRenderer.updateCommon(controller, creatingCover);\n      }\n      updateCoverShape(controller, creatingCover);\n      eventParams = {\n        isEnd: isEnd\n      };\n    }\n  } else if (isEnd && thisBrushOption.brushMode === 'single' && thisBrushOption.removeOnClick) {\n    // Help user to remove covers easily, only by a tiny drag, in 'single' mode.\n    // But a single click do not clear covers, because user may have casual\n    // clicks (for example, click on other component and do not expect covers\n    // disappear).\n    // Only some cover removed, trigger action, but not every click trigger action.\n    if (getPanelByPoint(controller, e, localCursorPoint) && clearCovers(controller)) {\n      eventParams = {\n        isEnd: isEnd,\n        removeOnClick: true\n      };\n    }\n  }\n  return eventParams;\n}\nfunction determineBrushType(brushType, panel) {\n  if (brushType === 'auto') {\n    if (process.env.NODE_ENV !== 'production') {\n      assert(panel && panel.defaultBrushType, 'MUST have defaultBrushType when brushType is \"atuo\"');\n    }\n    return panel.defaultBrushType;\n  }\n  return brushType;\n}\nvar pointerHandlers = {\n  mousedown: function (e) {\n    if (this._dragging) {\n      // In case some browser do not support globalOut,\n      // and release mouse out side the browser.\n      handleDragEnd(this, e);\n    } else if (!e.target || !e.target.draggable) {\n      preventDefault(e);\n      var localCursorPoint = this.group.transformCoordToLocal(e.offsetX, e.offsetY);\n      this._creatingCover = null;\n      var panel = this._creatingPanel = getPanelByPoint(this, e, localCursorPoint);\n      if (panel) {\n        this._dragging = true;\n        this._track = [localCursorPoint.slice()];\n      }\n    }\n  },\n  mousemove: function (e) {\n    var x = e.offsetX;\n    var y = e.offsetY;\n    var localCursorPoint = this.group.transformCoordToLocal(x, y);\n    resetCursor(this, e, localCursorPoint);\n    if (this._dragging) {\n      preventDefault(e);\n      var eventParams = updateCoverByMouse(this, e, localCursorPoint, false);\n      eventParams && trigger(this, eventParams);\n    }\n  },\n  mouseup: function (e) {\n    handleDragEnd(this, e);\n  }\n};\nfunction handleDragEnd(controller, e) {\n  if (controller._dragging) {\n    preventDefault(e);\n    var x = e.offsetX;\n    var y = e.offsetY;\n    var localCursorPoint = controller.group.transformCoordToLocal(x, y);\n    var eventParams = updateCoverByMouse(controller, e, localCursorPoint, true);\n    controller._dragging = false;\n    controller._track = [];\n    controller._creatingCover = null;\n    // trigger event should be at final, after procedure will be nested.\n    eventParams && trigger(controller, eventParams);\n  }\n}\nfunction isOutsideZrArea(controller, x, y) {\n  var zr = controller._zr;\n  return x < 0 || x > zr.getWidth() || y < 0 || y > zr.getHeight();\n}\n/**\n * key: brushType\n */\nvar coverRenderers = {\n  lineX: getLineRenderer(0),\n  lineY: getLineRenderer(1),\n  rect: {\n    createCover: function (controller, brushOption) {\n      function returnInput(range) {\n        return range;\n      }\n      return createBaseRectCover({\n        toRectRange: returnInput,\n        fromRectRange: returnInput\n      }, controller, brushOption, [['w'], ['e'], ['n'], ['s'], ['s', 'e'], ['s', 'w'], ['n', 'e'], ['n', 'w']]);\n    },\n    getCreatingRange: function (localTrack) {\n      var ends = getTrackEnds(localTrack);\n      return formatRectRange(ends[1][0], ends[1][1], ends[0][0], ends[0][1]);\n    },\n    updateCoverShape: function (controller, cover, localRange, brushOption) {\n      updateBaseRect(controller, cover, localRange, brushOption);\n    },\n    updateCommon: updateCommon,\n    contain: mainShapeContain\n  },\n  polygon: {\n    createCover: function (controller, brushOption) {\n      var cover = new graphic.Group();\n      // Do not use graphic.Polygon because graphic.Polyline do not close the\n      // border of the shape when drawing, which is a better experience for user.\n      cover.add(new graphic.Polyline({\n        name: 'main',\n        style: makeStyle(brushOption),\n        silent: true\n      }));\n      return cover;\n    },\n    getCreatingRange: function (localTrack) {\n      return localTrack;\n    },\n    endCreating: function (controller, cover) {\n      cover.remove(cover.childAt(0));\n      // Use graphic.Polygon close the shape.\n      cover.add(new graphic.Polygon({\n        name: 'main',\n        draggable: true,\n        drift: curry(driftPolygon, controller, cover),\n        ondragend: curry(trigger, controller, {\n          isEnd: true\n        })\n      }));\n    },\n    updateCoverShape: function (controller, cover, localRange, brushOption) {\n      cover.childAt(0).setShape({\n        points: clipByPanel(controller, cover, localRange)\n      });\n    },\n    updateCommon: updateCommon,\n    contain: mainShapeContain\n  }\n};\nfunction getLineRenderer(xyIndex) {\n  return {\n    createCover: function (controller, brushOption) {\n      return createBaseRectCover({\n        toRectRange: function (range) {\n          var rectRange = [range, [0, 100]];\n          xyIndex && rectRange.reverse();\n          return rectRange;\n        },\n        fromRectRange: function (rectRange) {\n          return rectRange[xyIndex];\n        }\n      }, controller, brushOption, [[['w'], ['e']], [['n'], ['s']]][xyIndex]);\n    },\n    getCreatingRange: function (localTrack) {\n      var ends = getTrackEnds(localTrack);\n      var min = mathMin(ends[0][xyIndex], ends[1][xyIndex]);\n      var max = mathMax(ends[0][xyIndex], ends[1][xyIndex]);\n      return [min, max];\n    },\n    updateCoverShape: function (controller, cover, localRange, brushOption) {\n      var otherExtent;\n      // If brushWidth not specified, fit the panel.\n      var panel = getPanelByCover(controller, cover);\n      if (panel !== BRUSH_PANEL_GLOBAL && panel.getLinearBrushOtherExtent) {\n        otherExtent = panel.getLinearBrushOtherExtent(xyIndex);\n      } else {\n        var zr = controller._zr;\n        otherExtent = [0, [zr.getWidth(), zr.getHeight()][1 - xyIndex]];\n      }\n      var rectRange = [localRange, otherExtent];\n      xyIndex && rectRange.reverse();\n      updateBaseRect(controller, cover, rectRange, brushOption);\n    },\n    updateCommon: updateCommon,\n    contain: mainShapeContain\n  };\n}\nexport default BrushController;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport BoundingRect from 'zrender/lib/core/BoundingRect.js';\nimport { onIrrelevantElement } from './cursorHelper.js';\nimport * as graphicUtil from '../../util/graphic.js';\nexport function makeRectPanelClipPath(rect) {\n  rect = normalizeRect(rect);\n  return function (localPoints) {\n    return graphicUtil.clipPointsByRect(localPoints, rect);\n  };\n}\nexport function makeLinearBrushOtherExtent(rect, specifiedXYIndex) {\n  rect = normalizeRect(rect);\n  return function (xyIndex) {\n    var idx = specifiedXYIndex != null ? specifiedXYIndex : xyIndex;\n    var brushWidth = idx ? rect.width : rect.height;\n    var base = idx ? rect.x : rect.y;\n    return [base, base + (brushWidth || 0)];\n  };\n}\nexport function makeRectIsTargetByCursor(rect, api, targetModel) {\n  var boundingRect = normalizeRect(rect);\n  return function (e, localCursorPoint) {\n    return boundingRect.contain(localCursorPoint[0], localCursorPoint[1]) && !onIrrelevantElement(e, api, targetModel);\n  };\n}\n// Consider width/height is negative.\nfunction normalizeRect(rect) {\n  return BoundingRect.create(rect);\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport AxisBuilder from './AxisBuilder.js';\nimport BrushController from '../helper/BrushController.js';\nimport * as brushHelper from '../helper/brushHelper.js';\nimport * as graphic from '../../util/graphic.js';\nimport ComponentView from '../../view/Component.js';\nvar ParallelAxisView = /** @class */function (_super) {\n  __extends(ParallelAxisView, _super);\n  function ParallelAxisView() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = ParallelAxisView.type;\n    return _this;\n  }\n  ParallelAxisView.prototype.init = function (ecModel, api) {\n    _super.prototype.init.apply(this, arguments);\n    (this._brushController = new BrushController(api.getZr())).on('brush', zrUtil.bind(this._onBrush, this));\n  };\n  ParallelAxisView.prototype.render = function (axisModel, ecModel, api, payload) {\n    if (fromAxisAreaSelect(axisModel, ecModel, payload)) {\n      return;\n    }\n    this.axisModel = axisModel;\n    this.api = api;\n    this.group.removeAll();\n    var oldAxisGroup = this._axisGroup;\n    this._axisGroup = new graphic.Group();\n    this.group.add(this._axisGroup);\n    if (!axisModel.get('show')) {\n      return;\n    }\n    var coordSysModel = getCoordSysModel(axisModel, ecModel);\n    var coordSys = coordSysModel.coordinateSystem;\n    var areaSelectStyle = axisModel.getAreaSelectStyle();\n    var areaWidth = areaSelectStyle.width;\n    var dim = axisModel.axis.dim;\n    var axisLayout = coordSys.getAxisLayout(dim);\n    var builderOpt = zrUtil.extend({\n      strokeContainThreshold: areaWidth\n    }, axisLayout);\n    var axisBuilder = new AxisBuilder(axisModel, api, builderOpt);\n    axisBuilder.build();\n    this._axisGroup.add(axisBuilder.group);\n    this._refreshBrushController(builderOpt, areaSelectStyle, axisModel, coordSysModel, areaWidth, api);\n    graphic.groupTransition(oldAxisGroup, this._axisGroup, axisModel);\n  };\n  // /**\n  //  * @override\n  //  */\n  // updateVisual(axisModel, ecModel, api, payload) {\n  //     this._brushController && this._brushController\n  //         .updateCovers(getCoverInfoList(axisModel));\n  // }\n  ParallelAxisView.prototype._refreshBrushController = function (builderOpt, areaSelectStyle, axisModel, coordSysModel, areaWidth, api) {\n    // After filtering, axis may change, select area needs to be update.\n    var extent = axisModel.axis.getExtent();\n    var extentLen = extent[1] - extent[0];\n    var extra = Math.min(30, Math.abs(extentLen) * 0.1); // Arbitrary value.\n    // width/height might be negative, which will be\n    // normalized in BoundingRect.\n    var rect = graphic.BoundingRect.create({\n      x: extent[0],\n      y: -areaWidth / 2,\n      width: extentLen,\n      height: areaWidth\n    });\n    rect.x -= extra;\n    rect.width += 2 * extra;\n    this._brushController.mount({\n      enableGlobalPan: true,\n      rotation: builderOpt.rotation,\n      x: builderOpt.position[0],\n      y: builderOpt.position[1]\n    }).setPanels([{\n      panelId: 'pl',\n      clipPath: brushHelper.makeRectPanelClipPath(rect),\n      isTargetByCursor: brushHelper.makeRectIsTargetByCursor(rect, api, coordSysModel),\n      getLinearBrushOtherExtent: brushHelper.makeLinearBrushOtherExtent(rect, 0)\n    }]).enableBrush({\n      brushType: 'lineX',\n      brushStyle: areaSelectStyle,\n      removeOnClick: true\n    }).updateCovers(getCoverInfoList(axisModel));\n  };\n  ParallelAxisView.prototype._onBrush = function (eventParam) {\n    var coverInfoList = eventParam.areas;\n    // Do not cache these object, because the mey be changed.\n    var axisModel = this.axisModel;\n    var axis = axisModel.axis;\n    var intervals = zrUtil.map(coverInfoList, function (coverInfo) {\n      return [axis.coordToData(coverInfo.range[0], true), axis.coordToData(coverInfo.range[1], true)];\n    });\n    // If realtime is true, action is not dispatched on drag end, because\n    // the drag end emits the same params with the last drag move event,\n    // and may have some delay when using touch pad.\n    if (!axisModel.option.realtime === eventParam.isEnd || eventParam.removeOnClick) {\n      // jshint ignore:line\n      this.api.dispatchAction({\n        type: 'axisAreaSelect',\n        parallelAxisId: axisModel.id,\n        intervals: intervals\n      });\n    }\n  };\n  ParallelAxisView.prototype.dispose = function () {\n    this._brushController.dispose();\n  };\n  ParallelAxisView.type = 'parallelAxis';\n  return ParallelAxisView;\n}(ComponentView);\nfunction fromAxisAreaSelect(axisModel, ecModel, payload) {\n  return payload && payload.type === 'axisAreaSelect' && ecModel.findComponents({\n    mainType: 'parallelAxis',\n    query: payload\n  })[0] === axisModel;\n}\nfunction getCoverInfoList(axisModel) {\n  var axis = axisModel.axis;\n  return zrUtil.map(axisModel.activeIntervals, function (interval) {\n    return {\n      brushType: 'lineX',\n      panelId: 'pl',\n      range: [axis.dataToCoord(interval[0], true), axis.dataToCoord(interval[1], true)]\n    };\n  });\n}\nfunction getCoordSysModel(axisModel, ecModel) {\n  return ecModel.getComponent('parallel', axisModel.get('parallelIndex'));\n}\nexport default ParallelAxisView;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nvar actionInfo = {\n  type: 'axisAreaSelect',\n  event: 'axisAreaSelected'\n  // update: 'updateVisual'\n};\nexport function installParallelActions(registers) {\n  registers.registerAction(actionInfo, function (payload, ecModel) {\n    ecModel.eachComponent({\n      mainType: 'parallelAxis',\n      query: payload\n    }, function (parallelAxisModel) {\n      parallelAxisModel.axis.model.setActiveIntervals(payload.intervals);\n    });\n  });\n  /**\n   * @payload\n   */\n  registers.registerAction('parallelAxisExpand', function (payload, ecModel) {\n    ecModel.eachComponent({\n      mainType: 'parallel',\n      query: payload\n    }, function (parallelModel) {\n      parallelModel.setAxisExpand(payload);\n    });\n  });\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport parallelPreprocessor from '../../coord/parallel/parallelPreprocessor.js';\nimport ParallelView from './ParallelView.js';\nimport ParallelModel from '../../coord/parallel/ParallelModel.js';\nimport parallelCoordSysCreator from '../../coord/parallel/parallelCreator.js';\nimport axisModelCreator from '../../coord/axisModelCreator.js';\nimport ParallelAxisModel from '../../coord/parallel/AxisModel.js';\nimport ParallelAxisView from '../axis/ParallelAxisView.js';\nimport { installParallelActions } from '../axis/parallelAxisAction.js';\nvar defaultAxisOption = {\n  type: 'value',\n  areaSelectStyle: {\n    width: 20,\n    borderWidth: 1,\n    borderColor: 'rgba(160,197,232)',\n    color: 'rgba(160,197,232)',\n    opacity: 0.3\n  },\n  realtime: true,\n  z: 10\n};\nexport function install(registers) {\n  registers.registerComponentView(ParallelView);\n  registers.registerComponentModel(ParallelModel);\n  registers.registerCoordinateSystem('parallel', parallelCoordSysCreator);\n  registers.registerPreprocessor(parallelPreprocessor);\n  registers.registerComponentModel(ParallelAxisModel);\n  registers.registerComponentView(ParallelAxisView);\n  axisModelCreator(registers, 'parallel', ParallelAxisModel, defaultAxisOption);\n  installParallelActions(registers);\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { use } from '../../extension.js';\nimport ParallelView from './ParallelView.js';\nimport ParallelSeriesModel from './ParallelSeries.js';\nimport parallelVisual from './parallelVisual.js';\nimport { install as installParallelComponent } from '../../component/parallel/install.js';\nexport function install(registers) {\n  use(installParallelComponent);\n  registers.registerChartView(ParallelView);\n  registers.registerSeriesModel(ParallelSeriesModel);\n  registers.registerVisual(registers.PRIORITY.VISUAL.BRUSH, parallelVisual);\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as graphic from '../../util/graphic.js';\nimport { enterEmphasis, leaveEmphasis, toggleHoverEmphasis, setStatesStylesFromModel } from '../../util/states.js';\nimport ChartView from '../../view/Chart.js';\nimport { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle.js';\nimport { getECData } from '../../util/innerStore.js';\nimport { isString, retrieve3 } from 'zrender/lib/core/util.js';\nimport RoamController from '../../component/helper/RoamController.js';\nimport * as roamHelper from '../../component/helper/roamHelper.js';\nimport View from '../../coord/View.js';\nvar SankeyPathShape = /** @class */function () {\n  function SankeyPathShape() {\n    this.x1 = 0;\n    this.y1 = 0;\n    this.x2 = 0;\n    this.y2 = 0;\n    this.cpx1 = 0;\n    this.cpy1 = 0;\n    this.cpx2 = 0;\n    this.cpy2 = 0;\n    this.extent = 0;\n  }\n  return SankeyPathShape;\n}();\nvar SankeyPath = /** @class */function (_super) {\n  __extends(SankeyPath, _super);\n  function SankeyPath(opts) {\n    return _super.call(this, opts) || this;\n  }\n  SankeyPath.prototype.getDefaultShape = function () {\n    return new SankeyPathShape();\n  };\n  SankeyPath.prototype.buildPath = function (ctx, shape) {\n    var extent = shape.extent;\n    ctx.moveTo(shape.x1, shape.y1);\n    ctx.bezierCurveTo(shape.cpx1, shape.cpy1, shape.cpx2, shape.cpy2, shape.x2, shape.y2);\n    if (shape.orient === 'vertical') {\n      ctx.lineTo(shape.x2 + extent, shape.y2);\n      ctx.bezierCurveTo(shape.cpx2 + extent, shape.cpy2, shape.cpx1 + extent, shape.cpy1, shape.x1 + extent, shape.y1);\n    } else {\n      ctx.lineTo(shape.x2, shape.y2 + extent);\n      ctx.bezierCurveTo(shape.cpx2, shape.cpy2 + extent, shape.cpx1, shape.cpy1 + extent, shape.x1, shape.y1 + extent);\n    }\n    ctx.closePath();\n  };\n  SankeyPath.prototype.highlight = function () {\n    enterEmphasis(this);\n  };\n  SankeyPath.prototype.downplay = function () {\n    leaveEmphasis(this);\n  };\n  return SankeyPath;\n}(graphic.Path);\nvar SankeyView = /** @class */function (_super) {\n  __extends(SankeyView, _super);\n  function SankeyView() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = SankeyView.type;\n    _this._mainGroup = new graphic.Group();\n    _this._focusAdjacencyDisabled = false;\n    return _this;\n  }\n  SankeyView.prototype.init = function (ecModel, api) {\n    this._controller = new RoamController(api.getZr());\n    this._controllerHost = {\n      target: this.group\n    };\n    this.group.add(this._mainGroup);\n  };\n  SankeyView.prototype.render = function (seriesModel, ecModel, api) {\n    var sankeyView = this;\n    var graph = seriesModel.getGraph();\n    var mainGroup = this._mainGroup;\n    var layoutInfo = seriesModel.layoutInfo;\n    // view width\n    var width = layoutInfo.width;\n    // view height\n    var height = layoutInfo.height;\n    var nodeData = seriesModel.getData();\n    var edgeData = seriesModel.getData('edge');\n    var orient = seriesModel.get('orient');\n    this._model = seriesModel;\n    mainGroup.removeAll();\n    mainGroup.x = layoutInfo.x;\n    mainGroup.y = layoutInfo.y;\n    this._updateViewCoordSys(seriesModel, api);\n    roamHelper.updateController(seriesModel, api, mainGroup, this._controller, this._controllerHost, null);\n    // generate a bezire Curve for each edge\n    graph.eachEdge(function (edge) {\n      var curve = new SankeyPath();\n      var ecData = getECData(curve);\n      ecData.dataIndex = edge.dataIndex;\n      ecData.seriesIndex = seriesModel.seriesIndex;\n      ecData.dataType = 'edge';\n      var edgeModel = edge.getModel();\n      var lineStyleModel = edgeModel.getModel('lineStyle');\n      var curvature = lineStyleModel.get('curveness');\n      var n1Layout = edge.node1.getLayout();\n      var node1Model = edge.node1.getModel();\n      var dragX1 = node1Model.get('localX');\n      var dragY1 = node1Model.get('localY');\n      var n2Layout = edge.node2.getLayout();\n      var node2Model = edge.node2.getModel();\n      var dragX2 = node2Model.get('localX');\n      var dragY2 = node2Model.get('localY');\n      var edgeLayout = edge.getLayout();\n      var x1;\n      var y1;\n      var x2;\n      var y2;\n      var cpx1;\n      var cpy1;\n      var cpx2;\n      var cpy2;\n      curve.shape.extent = Math.max(1, edgeLayout.dy);\n      curve.shape.orient = orient;\n      if (orient === 'vertical') {\n        x1 = (dragX1 != null ? dragX1 * width : n1Layout.x) + edgeLayout.sy;\n        y1 = (dragY1 != null ? dragY1 * height : n1Layout.y) + n1Layout.dy;\n        x2 = (dragX2 != null ? dragX2 * width : n2Layout.x) + edgeLayout.ty;\n        y2 = dragY2 != null ? dragY2 * height : n2Layout.y;\n        cpx1 = x1;\n        cpy1 = y1 * (1 - curvature) + y2 * curvature;\n        cpx2 = x2;\n        cpy2 = y1 * curvature + y2 * (1 - curvature);\n      } else {\n        x1 = (dragX1 != null ? dragX1 * width : n1Layout.x) + n1Layout.dx;\n        y1 = (dragY1 != null ? dragY1 * height : n1Layout.y) + edgeLayout.sy;\n        x2 = dragX2 != null ? dragX2 * width : n2Layout.x;\n        y2 = (dragY2 != null ? dragY2 * height : n2Layout.y) + edgeLayout.ty;\n        cpx1 = x1 * (1 - curvature) + x2 * curvature;\n        cpy1 = y1;\n        cpx2 = x1 * curvature + x2 * (1 - curvature);\n        cpy2 = y2;\n      }\n      curve.setShape({\n        x1: x1,\n        y1: y1,\n        x2: x2,\n        y2: y2,\n        cpx1: cpx1,\n        cpy1: cpy1,\n        cpx2: cpx2,\n        cpy2: cpy2\n      });\n      curve.useStyle(lineStyleModel.getItemStyle());\n      // Special color, use source node color or target node color\n      applyCurveStyle(curve.style, orient, edge);\n      var defaultEdgeLabelText = \"\" + edgeModel.get('value');\n      var edgeLabelStateModels = getLabelStatesModels(edgeModel, 'edgeLabel');\n      setLabelStyle(curve, edgeLabelStateModels, {\n        labelFetcher: {\n          getFormattedLabel: function (dataIndex, stateName, dataType, labelDimIndex, formatter, extendParams) {\n            return seriesModel.getFormattedLabel(dataIndex, stateName, 'edge', labelDimIndex,\n            // ensure edgeLabel formatter is provided\n            // to prevent the inheritance from `label.formatter` of the series\n            retrieve3(formatter, edgeLabelStateModels.normal && edgeLabelStateModels.normal.get('formatter'), defaultEdgeLabelText), extendParams);\n          }\n        },\n        labelDataIndex: edge.dataIndex,\n        defaultText: defaultEdgeLabelText\n      });\n      curve.setTextConfig({\n        position: 'inside'\n      });\n      var emphasisModel = edgeModel.getModel('emphasis');\n      setStatesStylesFromModel(curve, edgeModel, 'lineStyle', function (model) {\n        var style = model.getItemStyle();\n        applyCurveStyle(style, orient, edge);\n        return style;\n      });\n      mainGroup.add(curve);\n      edgeData.setItemGraphicEl(edge.dataIndex, curve);\n      var focus = emphasisModel.get('focus');\n      toggleHoverEmphasis(curve, focus === 'adjacency' ? edge.getAdjacentDataIndices() : focus === 'trajectory' ? edge.getTrajectoryDataIndices() : focus, emphasisModel.get('blurScope'), emphasisModel.get('disabled'));\n    });\n    // Generate a rect for each node\n    graph.eachNode(function (node) {\n      var layout = node.getLayout();\n      var itemModel = node.getModel();\n      var dragX = itemModel.get('localX');\n      var dragY = itemModel.get('localY');\n      var emphasisModel = itemModel.getModel('emphasis');\n      var borderRadius = itemModel.get(['itemStyle', 'borderRadius']) || 0;\n      var rect = new graphic.Rect({\n        shape: {\n          x: dragX != null ? dragX * width : layout.x,\n          y: dragY != null ? dragY * height : layout.y,\n          width: layout.dx,\n          height: layout.dy,\n          r: borderRadius\n        },\n        style: itemModel.getModel('itemStyle').getItemStyle(),\n        z2: 10\n      });\n      setLabelStyle(rect, getLabelStatesModels(itemModel), {\n        labelFetcher: {\n          getFormattedLabel: function (dataIndex, stateName) {\n            return seriesModel.getFormattedLabel(dataIndex, stateName, 'node');\n          }\n        },\n        labelDataIndex: node.dataIndex,\n        defaultText: node.id\n      });\n      rect.disableLabelAnimation = true;\n      rect.setStyle('fill', node.getVisual('color'));\n      rect.setStyle('decal', node.getVisual('style').decal);\n      setStatesStylesFromModel(rect, itemModel);\n      mainGroup.add(rect);\n      nodeData.setItemGraphicEl(node.dataIndex, rect);\n      getECData(rect).dataType = 'node';\n      var focus = emphasisModel.get('focus');\n      toggleHoverEmphasis(rect, focus === 'adjacency' ? node.getAdjacentDataIndices() : focus === 'trajectory' ? node.getTrajectoryDataIndices() : focus, emphasisModel.get('blurScope'), emphasisModel.get('disabled'));\n    });\n    nodeData.eachItemGraphicEl(function (el, dataIndex) {\n      var itemModel = nodeData.getItemModel(dataIndex);\n      if (itemModel.get('draggable')) {\n        el.drift = function (dx, dy) {\n          sankeyView._focusAdjacencyDisabled = true;\n          this.shape.x += dx;\n          this.shape.y += dy;\n          this.dirty();\n          api.dispatchAction({\n            type: 'dragNode',\n            seriesId: seriesModel.id,\n            dataIndex: nodeData.getRawIndex(dataIndex),\n            localX: this.shape.x / width,\n            localY: this.shape.y / height\n          });\n        };\n        el.ondragend = function () {\n          sankeyView._focusAdjacencyDisabled = false;\n        };\n        el.draggable = true;\n        el.cursor = 'move';\n      }\n    });\n    if (!this._data && seriesModel.isAnimationEnabled()) {\n      mainGroup.setClipPath(createGridClipShape(mainGroup.getBoundingRect(), seriesModel, function () {\n        mainGroup.removeClipPath();\n      }));\n    }\n    this._data = seriesModel.getData();\n  };\n  SankeyView.prototype.dispose = function () {\n    this._controller && this._controller.dispose();\n    this._controllerHost = null;\n  };\n  SankeyView.prototype._updateViewCoordSys = function (seriesModel, api) {\n    var layoutInfo = seriesModel.layoutInfo;\n    var width = layoutInfo.width;\n    var height = layoutInfo.height;\n    var viewCoordSys = seriesModel.coordinateSystem = new View(null, {\n      api: api,\n      ecModel: seriesModel.ecModel\n    });\n    viewCoordSys.zoomLimit = seriesModel.get('scaleLimit');\n    viewCoordSys.setBoundingRect(0, 0, width, height);\n    viewCoordSys.setCenter(seriesModel.get('center'));\n    viewCoordSys.setZoom(seriesModel.get('zoom'));\n    this._controllerHost.target.attr({\n      x: viewCoordSys.x,\n      y: viewCoordSys.y,\n      scaleX: viewCoordSys.scaleX,\n      scaleY: viewCoordSys.scaleY\n    });\n  };\n  SankeyView.type = 'sankey';\n  return SankeyView;\n}(ChartView);\n/**\n * Special color, use source node color or target node color\n * @param curveProps curve's style to parse\n * @param orient direction\n * @param edge current curve data\n */\nfunction applyCurveStyle(curveProps, orient, edge) {\n  switch (curveProps.fill) {\n    case 'source':\n      curveProps.fill = edge.node1.getVisual('color');\n      curveProps.decal = edge.node1.getVisual('style').decal;\n      break;\n    case 'target':\n      curveProps.fill = edge.node2.getVisual('color');\n      curveProps.decal = edge.node2.getVisual('style').decal;\n      break;\n    case 'gradient':\n      var sourceColor = edge.node1.getVisual('color');\n      var targetColor = edge.node2.getVisual('color');\n      if (isString(sourceColor) && isString(targetColor)) {\n        curveProps.fill = new graphic.LinearGradient(0, 0, +(orient === 'horizontal'), +(orient === 'vertical'), [{\n          color: sourceColor,\n          offset: 0\n        }, {\n          color: targetColor,\n          offset: 1\n        }]);\n      }\n  }\n}\n// Add animation to the view\nfunction createGridClipShape(rect, seriesModel, cb) {\n  var rectEl = new graphic.Rect({\n    shape: {\n      x: rect.x - 10,\n      y: rect.y - 10,\n      width: 0,\n      height: rect.height + 20\n    }\n  });\n  graphic.initProps(rectEl, {\n    shape: {\n      width: rect.width + 20\n    }\n  }, seriesModel, cb);\n  return rectEl;\n}\nexport default SankeyView;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport SeriesModel from '../../model/Series.js';\nimport createGraphFromNodeEdge from '../helper/createGraphFromNodeEdge.js';\nimport Model from '../../model/Model.js';\nimport { createTooltipMarkup } from '../../component/tooltip/tooltipMarkup.js';\nimport tokens from '../../visual/tokens.js';\nvar SankeySeriesModel = /** @class */function (_super) {\n  __extends(SankeySeriesModel, _super);\n  function SankeySeriesModel() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = SankeySeriesModel.type;\n    return _this;\n  }\n  /**\n   * Init a graph data structure from data in option series\n   */\n  SankeySeriesModel.prototype.getInitialData = function (option, ecModel) {\n    var links = option.edges || option.links || [];\n    var nodes = option.data || option.nodes || [];\n    var levels = option.levels || [];\n    this.levelModels = [];\n    var levelModels = this.levelModels;\n    for (var i = 0; i < levels.length; i++) {\n      if (levels[i].depth != null && levels[i].depth >= 0) {\n        levelModels[levels[i].depth] = new Model(levels[i], this, ecModel);\n      } else {\n        if (process.env.NODE_ENV !== 'production') {\n          throw new Error('levels[i].depth is mandatory and should be natural number');\n        }\n      }\n    }\n    var graph = createGraphFromNodeEdge(nodes, links, this, true, beforeLink);\n    return graph.data;\n    function beforeLink(nodeData, edgeData) {\n      nodeData.wrapMethod('getItemModel', function (model, idx) {\n        var seriesModel = model.parentModel;\n        var layout = seriesModel.getData().getItemLayout(idx);\n        if (layout) {\n          var nodeDepth = layout.depth;\n          var levelModel = seriesModel.levelModels[nodeDepth];\n          if (levelModel) {\n            model.parentModel = levelModel;\n          }\n        }\n        return model;\n      });\n      edgeData.wrapMethod('getItemModel', function (model, idx) {\n        var seriesModel = model.parentModel;\n        var edge = seriesModel.getGraph().getEdgeByIndex(idx);\n        var layout = edge.node1.getLayout();\n        if (layout) {\n          var depth = layout.depth;\n          var levelModel = seriesModel.levelModels[depth];\n          if (levelModel) {\n            model.parentModel = levelModel;\n          }\n        }\n        return model;\n      });\n    }\n  };\n  SankeySeriesModel.prototype.setNodePosition = function (dataIndex, localPosition) {\n    var nodes = this.option.data || this.option.nodes;\n    var dataItem = nodes[dataIndex];\n    dataItem.localX = localPosition[0];\n    dataItem.localY = localPosition[1];\n  };\n  SankeySeriesModel.prototype.setCenter = function (center) {\n    this.option.center = center;\n  };\n  SankeySeriesModel.prototype.setZoom = function (zoom) {\n    this.option.zoom = zoom;\n  };\n  /**\n   * Return the graphic data structure\n   *\n   * @return graphic data structure\n   */\n  SankeySeriesModel.prototype.getGraph = function () {\n    return this.getData().graph;\n  };\n  /**\n   * Get edge data of graphic data structure\n   *\n   * @return data structure of list\n   */\n  SankeySeriesModel.prototype.getEdgeData = function () {\n    return this.getGraph().edgeData;\n  };\n  SankeySeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\n    function noValue(val) {\n      return isNaN(val) || val == null;\n    }\n    // dataType === 'node' or empty do not show tooltip by default\n    if (dataType === 'edge') {\n      var params = this.getDataParams(dataIndex, dataType);\n      var rawDataOpt = params.data;\n      var edgeValue = params.value;\n      var edgeName = rawDataOpt.source + ' -- ' + rawDataOpt.target;\n      return createTooltipMarkup('nameValue', {\n        name: edgeName,\n        value: edgeValue,\n        noValue: noValue(edgeValue)\n      });\n    }\n    // dataType === 'node'\n    else {\n      var node = this.getGraph().getNodeByIndex(dataIndex);\n      var value = node.getLayout().value;\n      var name_1 = this.getDataParams(dataIndex, dataType).data.name;\n      return createTooltipMarkup('nameValue', {\n        name: name_1 != null ? name_1 + '' : null,\n        value: value,\n        noValue: noValue(value)\n      });\n    }\n  };\n  SankeySeriesModel.prototype.optionUpdated = function () {};\n  // Override Series.getDataParams()\n  SankeySeriesModel.prototype.getDataParams = function (dataIndex, dataType) {\n    var params = _super.prototype.getDataParams.call(this, dataIndex, dataType);\n    if (params.value == null && dataType === 'node') {\n      var node = this.getGraph().getNodeByIndex(dataIndex);\n      var nodeValue = node.getLayout().value;\n      params.value = nodeValue;\n    }\n    return params;\n  };\n  SankeySeriesModel.type = 'series.sankey';\n  SankeySeriesModel.layoutMode = 'box';\n  SankeySeriesModel.defaultOption = {\n    // zlevel: 0,\n    z: 2,\n    // `coordinateSystem` can be declared as 'matrix', 'calendar',\n    //  which provides box layout container.\n    coordinateSystemUsage: 'box',\n    left: '5%',\n    top: '5%',\n    right: '20%',\n    bottom: '5%',\n    orient: 'horizontal',\n    nodeWidth: 20,\n    nodeGap: 8,\n    draggable: true,\n    layoutIterations: 32,\n    // true | false | 'move' | 'scale', see module:component/helper/RoamController.\n    roam: false,\n    roamTrigger: 'global',\n    center: null,\n    zoom: 1,\n    label: {\n      show: true,\n      position: 'right',\n      fontSize: 12\n    },\n    edgeLabel: {\n      show: false,\n      fontSize: 12\n    },\n    levels: [],\n    nodeAlign: 'justify',\n    lineStyle: {\n      color: tokens.color.neutral50,\n      opacity: 0.2,\n      curveness: 0.5\n    },\n    emphasis: {\n      label: {\n        show: true\n      },\n      lineStyle: {\n        opacity: 0.5\n      }\n    },\n    select: {\n      itemStyle: {\n        borderColor: tokens.color.primary\n      }\n    },\n    animationEasing: 'linear',\n    animationDuration: 1000\n  };\n  return SankeySeriesModel;\n}(SeriesModel);\nexport default SankeySeriesModel;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { groupData } from '../../util/model.js';\nimport { createBoxLayoutReference, getLayoutRect } from '../../util/layout.js';\nexport default function sankeyLayout(ecModel, api) {\n  ecModel.eachSeriesByType('sankey', function (seriesModel) {\n    var nodeWidth = seriesModel.get('nodeWidth');\n    var nodeGap = seriesModel.get('nodeGap');\n    var refContainer = createBoxLayoutReference(seriesModel, api).refContainer;\n    var layoutInfo = getLayoutRect(seriesModel.getBoxLayoutParams(), refContainer);\n    seriesModel.layoutInfo = layoutInfo;\n    var width = layoutInfo.width;\n    var height = layoutInfo.height;\n    var graph = seriesModel.getGraph();\n    var nodes = graph.nodes;\n    var edges = graph.edges;\n    computeNodeValues(nodes);\n    var filteredNodes = zrUtil.filter(nodes, function (node) {\n      return node.getLayout().value === 0;\n    });\n    var iterations = filteredNodes.length !== 0 ? 0 : seriesModel.get('layoutIterations');\n    var orient = seriesModel.get('orient');\n    var nodeAlign = seriesModel.get('nodeAlign');\n    layoutSankey(nodes, edges, nodeWidth, nodeGap, width, height, iterations, orient, nodeAlign);\n  });\n}\nfunction layoutSankey(nodes, edges, nodeWidth, nodeGap, width, height, iterations, orient, nodeAlign) {\n  computeNodeBreadths(nodes, edges, nodeWidth, width, height, orient, nodeAlign);\n  computeNodeDepths(nodes, edges, height, width, nodeGap, iterations, orient);\n  computeEdgeDepths(nodes, orient);\n}\n/**\n * Compute the value of each node by summing the associated edge's value\n */\nfunction computeNodeValues(nodes) {\n  zrUtil.each(nodes, function (node) {\n    var value1 = sum(node.outEdges, getEdgeValue);\n    var value2 = sum(node.inEdges, getEdgeValue);\n    var nodeRawValue = node.getValue() || 0;\n    var value = Math.max(value1, value2, nodeRawValue);\n    node.setLayout({\n      value: value\n    }, true);\n  });\n}\n/**\n * Compute the x-position for each node.\n *\n * Here we use Kahn algorithm to detect cycle when we traverse\n * the node to computer the initial x position.\n */\nfunction computeNodeBreadths(nodes, edges, nodeWidth, width, height, orient, nodeAlign) {\n  // Used to mark whether the edge is deleted. if it is deleted,\n  // the value is 0, otherwise it is 1.\n  var remainEdges = [];\n  // Storage each node's indegree.\n  var indegreeArr = [];\n  // Used to storage the node with indegree is equal to 0.\n  var zeroIndegrees = [];\n  var nextTargetNode = [];\n  var x = 0;\n  // let kx = 0;\n  for (var i = 0; i < edges.length; i++) {\n    remainEdges[i] = 1;\n  }\n  for (var i = 0; i < nodes.length; i++) {\n    indegreeArr[i] = nodes[i].inEdges.length;\n    if (indegreeArr[i] === 0) {\n      zeroIndegrees.push(nodes[i]);\n    }\n  }\n  var maxNodeDepth = -1;\n  // Traversing nodes using topological sorting to calculate the\n  // horizontal(if orient === 'horizontal') or vertical(if orient === 'vertical')\n  // position of the nodes.\n  while (zeroIndegrees.length) {\n    for (var idx = 0; idx < zeroIndegrees.length; idx++) {\n      var node = zeroIndegrees[idx];\n      var item = node.hostGraph.data.getRawDataItem(node.dataIndex);\n      var isItemDepth = item.depth != null && item.depth >= 0;\n      if (isItemDepth && item.depth > maxNodeDepth) {\n        maxNodeDepth = item.depth;\n      }\n      node.setLayout({\n        depth: isItemDepth ? item.depth : x\n      }, true);\n      orient === 'vertical' ? node.setLayout({\n        dy: nodeWidth\n      }, true) : node.setLayout({\n        dx: nodeWidth\n      }, true);\n      for (var edgeIdx = 0; edgeIdx < node.outEdges.length; edgeIdx++) {\n        var edge = node.outEdges[edgeIdx];\n        var indexEdge = edges.indexOf(edge);\n        remainEdges[indexEdge] = 0;\n        var targetNode = edge.node2;\n        var nodeIndex = nodes.indexOf(targetNode);\n        if (--indegreeArr[nodeIndex] === 0 && nextTargetNode.indexOf(targetNode) < 0) {\n          nextTargetNode.push(targetNode);\n        }\n      }\n    }\n    ++x;\n    zeroIndegrees = nextTargetNode;\n    nextTargetNode = [];\n  }\n  for (var i = 0; i < remainEdges.length; i++) {\n    if (remainEdges[i] === 1) {\n      throw new Error('Sankey is a DAG, the original data has cycle!');\n    }\n  }\n  var maxDepth = maxNodeDepth > x - 1 ? maxNodeDepth : x - 1;\n  if (nodeAlign && nodeAlign !== 'left') {\n    adjustNodeWithNodeAlign(nodes, nodeAlign, orient, maxDepth);\n  }\n  var kx = orient === 'vertical' ? (height - nodeWidth) / maxDepth : (width - nodeWidth) / maxDepth;\n  scaleNodeBreadths(nodes, kx, orient);\n}\nfunction isNodeDepth(node) {\n  var item = node.hostGraph.data.getRawDataItem(node.dataIndex);\n  return item.depth != null && item.depth >= 0;\n}\nfunction adjustNodeWithNodeAlign(nodes, nodeAlign, orient, maxDepth) {\n  if (nodeAlign === 'right') {\n    var nextSourceNode = [];\n    var remainNodes = nodes;\n    var nodeHeight = 0;\n    while (remainNodes.length) {\n      for (var i = 0; i < remainNodes.length; i++) {\n        var node = remainNodes[i];\n        node.setLayout({\n          skNodeHeight: nodeHeight\n        }, true);\n        for (var j = 0; j < node.inEdges.length; j++) {\n          var edge = node.inEdges[j];\n          if (nextSourceNode.indexOf(edge.node1) < 0) {\n            nextSourceNode.push(edge.node1);\n          }\n        }\n      }\n      remainNodes = nextSourceNode;\n      nextSourceNode = [];\n      ++nodeHeight;\n    }\n    zrUtil.each(nodes, function (node) {\n      if (!isNodeDepth(node)) {\n        node.setLayout({\n          depth: Math.max(0, maxDepth - node.getLayout().skNodeHeight)\n        }, true);\n      }\n    });\n  } else if (nodeAlign === 'justify') {\n    moveSinksRight(nodes, maxDepth);\n  }\n}\n/**\n * All the node without outEgdes are assigned maximum x-position and\n *     be aligned in the last column.\n *\n * @param nodes.  node of sankey view.\n * @param maxDepth.  use to assign to node without outEdges as x-position.\n */\nfunction moveSinksRight(nodes, maxDepth) {\n  zrUtil.each(nodes, function (node) {\n    if (!isNodeDepth(node) && !node.outEdges.length) {\n      node.setLayout({\n        depth: maxDepth\n      }, true);\n    }\n  });\n}\n/**\n * Scale node x-position to the width\n *\n * @param nodes  node of sankey view\n * @param kx   multiple used to scale nodes\n */\nfunction scaleNodeBreadths(nodes, kx, orient) {\n  zrUtil.each(nodes, function (node) {\n    var nodeDepth = node.getLayout().depth * kx;\n    orient === 'vertical' ? node.setLayout({\n      y: nodeDepth\n    }, true) : node.setLayout({\n      x: nodeDepth\n    }, true);\n  });\n}\n/**\n * Using Gauss-Seidel iterations method to compute the node depth(y-position)\n *\n * @param nodes  node of sankey view\n * @param edges  edge of sankey view\n * @param height  the whole height of the area to draw the view\n * @param nodeGap  the vertical distance between two nodes\n *     in the same column.\n * @param iterations  the number of iterations for the algorithm\n */\nfunction computeNodeDepths(nodes, edges, height, width, nodeGap, iterations, orient) {\n  var nodesByBreadth = prepareNodesByBreadth(nodes, orient);\n  initializeNodeDepth(nodesByBreadth, edges, height, width, nodeGap, orient);\n  resolveCollisions(nodesByBreadth, nodeGap, height, width, orient);\n  for (var alpha = 1; iterations > 0; iterations--) {\n    // 0.99 is a experience parameter, ensure that each iterations of\n    // changes as small as possible.\n    alpha *= 0.99;\n    relaxRightToLeft(nodesByBreadth, alpha, orient);\n    resolveCollisions(nodesByBreadth, nodeGap, height, width, orient);\n    relaxLeftToRight(nodesByBreadth, alpha, orient);\n    resolveCollisions(nodesByBreadth, nodeGap, height, width, orient);\n  }\n}\nfunction prepareNodesByBreadth(nodes, orient) {\n  var nodesByBreadth = [];\n  var keyAttr = orient === 'vertical' ? 'y' : 'x';\n  var groupResult = groupData(nodes, function (node) {\n    return node.getLayout()[keyAttr];\n  });\n  groupResult.keys.sort(function (a, b) {\n    return a - b;\n  });\n  zrUtil.each(groupResult.keys, function (key) {\n    nodesByBreadth.push(groupResult.buckets.get(key));\n  });\n  return nodesByBreadth;\n}\n/**\n * Compute the original y-position for each node\n */\nfunction initializeNodeDepth(nodesByBreadth, edges, height, width, nodeGap, orient) {\n  var minKy = Infinity;\n  zrUtil.each(nodesByBreadth, function (nodes) {\n    var n = nodes.length;\n    var sum = 0;\n    zrUtil.each(nodes, function (node) {\n      sum += node.getLayout().value;\n    });\n    var ky = orient === 'vertical' ? (width - (n - 1) * nodeGap) / sum : (height - (n - 1) * nodeGap) / sum;\n    if (ky < minKy) {\n      minKy = ky;\n    }\n  });\n  zrUtil.each(nodesByBreadth, function (nodes) {\n    zrUtil.each(nodes, function (node, i) {\n      var nodeDy = node.getLayout().value * minKy;\n      if (orient === 'vertical') {\n        node.setLayout({\n          x: i\n        }, true);\n        node.setLayout({\n          dx: nodeDy\n        }, true);\n      } else {\n        node.setLayout({\n          y: i\n        }, true);\n        node.setLayout({\n          dy: nodeDy\n        }, true);\n      }\n    });\n  });\n  zrUtil.each(edges, function (edge) {\n    var edgeDy = +edge.getValue() * minKy;\n    edge.setLayout({\n      dy: edgeDy\n    }, true);\n  });\n}\n/**\n * Resolve the collision of initialized depth (y-position)\n */\nfunction resolveCollisions(nodesByBreadth, nodeGap, height, width, orient) {\n  var keyAttr = orient === 'vertical' ? 'x' : 'y';\n  zrUtil.each(nodesByBreadth, function (nodes) {\n    nodes.sort(function (a, b) {\n      return a.getLayout()[keyAttr] - b.getLayout()[keyAttr];\n    });\n    var nodeX;\n    var node;\n    var dy;\n    var y0 = 0;\n    var n = nodes.length;\n    var nodeDyAttr = orient === 'vertical' ? 'dx' : 'dy';\n    for (var i = 0; i < n; i++) {\n      node = nodes[i];\n      dy = y0 - node.getLayout()[keyAttr];\n      if (dy > 0) {\n        nodeX = node.getLayout()[keyAttr] + dy;\n        orient === 'vertical' ? node.setLayout({\n          x: nodeX\n        }, true) : node.setLayout({\n          y: nodeX\n        }, true);\n      }\n      y0 = node.getLayout()[keyAttr] + node.getLayout()[nodeDyAttr] + nodeGap;\n    }\n    var viewWidth = orient === 'vertical' ? width : height;\n    // If the bottommost node goes outside the bounds, push it back up\n    dy = y0 - nodeGap - viewWidth;\n    if (dy > 0) {\n      nodeX = node.getLayout()[keyAttr] - dy;\n      orient === 'vertical' ? node.setLayout({\n        x: nodeX\n      }, true) : node.setLayout({\n        y: nodeX\n      }, true);\n      y0 = nodeX;\n      for (var i = n - 2; i >= 0; --i) {\n        node = nodes[i];\n        dy = node.getLayout()[keyAttr] + node.getLayout()[nodeDyAttr] + nodeGap - y0;\n        if (dy > 0) {\n          nodeX = node.getLayout()[keyAttr] - dy;\n          orient === 'vertical' ? node.setLayout({\n            x: nodeX\n          }, true) : node.setLayout({\n            y: nodeX\n          }, true);\n        }\n        y0 = node.getLayout()[keyAttr];\n      }\n    }\n  });\n}\n/**\n * Change the y-position of the nodes, except most the right side nodes\n * @param nodesByBreadth\n * @param alpha  parameter used to adjust the nodes y-position\n */\nfunction relaxRightToLeft(nodesByBreadth, alpha, orient) {\n  zrUtil.each(nodesByBreadth.slice().reverse(), function (nodes) {\n    zrUtil.each(nodes, function (node) {\n      if (node.outEdges.length) {\n        var y = sum(node.outEdges, weightedTarget, orient) / sum(node.outEdges, getEdgeValue);\n        if (isNaN(y)) {\n          var len = node.outEdges.length;\n          y = len ? sum(node.outEdges, centerTarget, orient) / len : 0;\n        }\n        if (orient === 'vertical') {\n          var nodeX = node.getLayout().x + (y - center(node, orient)) * alpha;\n          node.setLayout({\n            x: nodeX\n          }, true);\n        } else {\n          var nodeY = node.getLayout().y + (y - center(node, orient)) * alpha;\n          node.setLayout({\n            y: nodeY\n          }, true);\n        }\n      }\n    });\n  });\n}\nfunction weightedTarget(edge, orient) {\n  return center(edge.node2, orient) * edge.getValue();\n}\nfunction centerTarget(edge, orient) {\n  return center(edge.node2, orient);\n}\nfunction weightedSource(edge, orient) {\n  return center(edge.node1, orient) * edge.getValue();\n}\nfunction centerSource(edge, orient) {\n  return center(edge.node1, orient);\n}\nfunction center(node, orient) {\n  return orient === 'vertical' ? node.getLayout().x + node.getLayout().dx / 2 : node.getLayout().y + node.getLayout().dy / 2;\n}\nfunction getEdgeValue(edge) {\n  return edge.getValue();\n}\nfunction sum(array, cb, orient) {\n  var sum = 0;\n  var len = array.length;\n  var i = -1;\n  while (++i < len) {\n    var value = +cb(array[i], orient);\n    if (!isNaN(value)) {\n      sum += value;\n    }\n  }\n  return sum;\n}\n/**\n * Change the y-position of the nodes, except most the left side nodes\n */\nfunction relaxLeftToRight(nodesByBreadth, alpha, orient) {\n  zrUtil.each(nodesByBreadth, function (nodes) {\n    zrUtil.each(nodes, function (node) {\n      if (node.inEdges.length) {\n        var y = sum(node.inEdges, weightedSource, orient) / sum(node.inEdges, getEdgeValue);\n        if (isNaN(y)) {\n          var len = node.inEdges.length;\n          y = len ? sum(node.inEdges, centerSource, orient) / len : 0;\n        }\n        if (orient === 'vertical') {\n          var nodeX = node.getLayout().x + (y - center(node, orient)) * alpha;\n          node.setLayout({\n            x: nodeX\n          }, true);\n        } else {\n          var nodeY = node.getLayout().y + (y - center(node, orient)) * alpha;\n          node.setLayout({\n            y: nodeY\n          }, true);\n        }\n      }\n    });\n  });\n}\n/**\n * Compute the depth(y-position) of each edge\n */\nfunction computeEdgeDepths(nodes, orient) {\n  var keyAttr = orient === 'vertical' ? 'x' : 'y';\n  zrUtil.each(nodes, function (node) {\n    node.outEdges.sort(function (a, b) {\n      return a.node2.getLayout()[keyAttr] - b.node2.getLayout()[keyAttr];\n    });\n    node.inEdges.sort(function (a, b) {\n      return a.node1.getLayout()[keyAttr] - b.node1.getLayout()[keyAttr];\n    });\n  });\n  zrUtil.each(nodes, function (node) {\n    var sy = 0;\n    var ty = 0;\n    zrUtil.each(node.outEdges, function (edge) {\n      edge.setLayout({\n        sy: sy\n      }, true);\n      sy += edge.getLayout().dy;\n    });\n    zrUtil.each(node.inEdges, function (edge) {\n      edge.setLayout({\n        ty: ty\n      }, true);\n      ty += edge.getLayout().dy;\n    });\n  });\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport VisualMapping from '../../visual/VisualMapping.js';\nexport default function sankeyVisual(ecModel) {\n  ecModel.eachSeriesByType('sankey', function (seriesModel) {\n    var graph = seriesModel.getGraph();\n    var nodes = graph.nodes;\n    var edges = graph.edges;\n    if (nodes.length) {\n      var minValue_1 = Infinity;\n      var maxValue_1 = -Infinity;\n      zrUtil.each(nodes, function (node) {\n        var nodeValue = node.getLayout().value;\n        if (nodeValue < minValue_1) {\n          minValue_1 = nodeValue;\n        }\n        if (nodeValue > maxValue_1) {\n          maxValue_1 = nodeValue;\n        }\n      });\n      zrUtil.each(nodes, function (node) {\n        var mapping = new VisualMapping({\n          type: 'color',\n          mappingMethod: 'linear',\n          dataExtent: [minValue_1, maxValue_1],\n          visual: seriesModel.get('color')\n        });\n        var mapValueToColor = mapping.mapValueToVisual(node.getLayout().value);\n        var customColor = node.getModel().get(['itemStyle', 'color']);\n        if (customColor != null) {\n          node.setVisual('color', customColor);\n          node.setVisual('style', {\n            fill: customColor\n          });\n        } else {\n          node.setVisual('color', mapValueToColor);\n          node.setVisual('style', {\n            fill: mapValueToColor\n          });\n        }\n      });\n    }\n    if (edges.length) {\n      zrUtil.each(edges, function (edge) {\n        var edgeStyle = edge.getModel().get('lineStyle');\n        edge.setVisual('style', edgeStyle);\n      });\n    }\n  });\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport SankeyView from './SankeyView.js';\nimport SankeySeriesModel from './SankeySeries.js';\nimport sankeyLayout from './sankeyLayout.js';\nimport sankeyVisual from './sankeyVisual.js';\nimport { updateCenterAndZoomInAction } from '../../component/helper/roamHelper.js';\nexport function install(registers) {\n  registers.registerChartView(SankeyView);\n  registers.registerSeriesModel(SankeySeriesModel);\n  registers.registerLayout(sankeyLayout);\n  registers.registerVisual(sankeyVisual);\n  registers.registerAction({\n    type: 'dragNode',\n    event: 'dragnode',\n    // here can only use 'update' now, other value is not support in echarts.\n    update: 'update'\n  }, function (payload, ecModel) {\n    ecModel.eachComponent({\n      mainType: 'series',\n      subType: 'sankey',\n      query: payload\n    }, function (seriesModel) {\n      seriesModel.setNodePosition(payload.dataIndex, [payload.localX, payload.localY]);\n    });\n  });\n  registers.registerAction({\n    type: 'sankeyRoam',\n    event: 'sankeyRoam',\n    update: 'none'\n  }, function (payload, ecModel, api) {\n    ecModel.eachComponent({\n      mainType: 'series',\n      subType: 'sankey',\n      query: payload\n    }, function (seriesModel) {\n      var coordSys = seriesModel.coordinateSystem;\n      var res = updateCenterAndZoomInAction(coordSys, payload, seriesModel.get('scaleLimit'));\n      seriesModel.setCenter(res.center);\n      seriesModel.setZoom(res.zoom);\n    });\n  });\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport createSeriesDataSimply from './createSeriesDataSimply.js';\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { getDimensionTypeByAxis } from '../../data/helper/dimensionHelper.js';\nimport { makeSeriesEncodeForAxisCoordSys } from '../../data/helper/sourceHelper.js';\nvar WhiskerBoxCommonMixin = /** @class */function () {\n  function WhiskerBoxCommonMixin() {}\n  /**\n   * @private\n   */\n  WhiskerBoxCommonMixin.prototype._hasEncodeRule = function (key) {\n    var encodeRules = this.getEncode();\n    return encodeRules && encodeRules.get(key) != null;\n  };\n  /**\n   * @override\n   */\n  WhiskerBoxCommonMixin.prototype.getInitialData = function (option, ecModel) {\n    // When both types of xAxis and yAxis are 'value', layout is\n    // needed to be specified by user. Otherwise, layout can be\n    // judged by which axis is category.\n    var ordinalMeta;\n    var xAxisModel = ecModel.getComponent('xAxis', this.get('xAxisIndex'));\n    var yAxisModel = ecModel.getComponent('yAxis', this.get('yAxisIndex'));\n    var xAxisType = xAxisModel.get('type');\n    var yAxisType = yAxisModel.get('type');\n    var addOrdinal;\n    // FIXME\n    // Consider time axis.\n    if (xAxisType === 'category') {\n      option.layout = 'horizontal';\n      ordinalMeta = xAxisModel.getOrdinalMeta();\n      addOrdinal = !this._hasEncodeRule('x');\n    } else if (yAxisType === 'category') {\n      option.layout = 'vertical';\n      ordinalMeta = yAxisModel.getOrdinalMeta();\n      addOrdinal = !this._hasEncodeRule('y');\n    } else {\n      option.layout = option.layout || 'horizontal';\n    }\n    var coordDims = ['x', 'y'];\n    var baseAxisDimIndex = option.layout === 'horizontal' ? 0 : 1;\n    var baseAxisDim = this._baseAxisDim = coordDims[baseAxisDimIndex];\n    var otherAxisDim = coordDims[1 - baseAxisDimIndex];\n    var axisModels = [xAxisModel, yAxisModel];\n    var baseAxisType = axisModels[baseAxisDimIndex].get('type');\n    var otherAxisType = axisModels[1 - baseAxisDimIndex].get('type');\n    var data = option.data;\n    // Clone a new data for next setOption({}) usage.\n    // Avoid modifying current data will affect further update.\n    if (data && addOrdinal) {\n      var newOptionData_1 = [];\n      zrUtil.each(data, function (item, index) {\n        var newItem;\n        if (zrUtil.isArray(item)) {\n          newItem = item.slice();\n          // Modify current using data.\n          item.unshift(index);\n        } else if (zrUtil.isArray(item.value)) {\n          newItem = zrUtil.extend({}, item);\n          newItem.value = newItem.value.slice();\n          // Modify current using data.\n          item.value.unshift(index);\n        } else {\n          newItem = item;\n        }\n        newOptionData_1.push(newItem);\n      });\n      option.data = newOptionData_1;\n    }\n    var defaultValueDimensions = this.defaultValueDimensions;\n    var coordDimensions = [{\n      name: baseAxisDim,\n      type: getDimensionTypeByAxis(baseAxisType),\n      ordinalMeta: ordinalMeta,\n      otherDims: {\n        tooltip: false,\n        itemName: 0\n      },\n      dimsDef: ['base']\n    }, {\n      name: otherAxisDim,\n      type: getDimensionTypeByAxis(otherAxisType),\n      dimsDef: defaultValueDimensions.slice()\n    }];\n    return createSeriesDataSimply(this, {\n      coordDimensions: coordDimensions,\n      dimensionsCount: defaultValueDimensions.length + 1,\n      encodeDefaulter: zrUtil.curry(makeSeriesEncodeForAxisCoordSys, coordDimensions, this)\n    });\n  };\n  /**\n   * If horizontal, base axis is x, otherwise y.\n   * @override\n   */\n  WhiskerBoxCommonMixin.prototype.getBaseAxis = function () {\n    var dim = this._baseAxisDim;\n    return this.ecModel.getComponent(dim + 'Axis', this.get(dim + 'AxisIndex')).axis;\n  };\n  return WhiskerBoxCommonMixin;\n}();\n;\nexport { WhiskerBoxCommonMixin };", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport SeriesModel from '../../model/Series.js';\nimport { WhiskerBoxCommonMixin } from '../helper/whiskerBoxCommon.js';\nimport { mixin } from 'zrender/lib/core/util.js';\nimport tokens from '../../visual/tokens.js';\nvar BoxplotSeriesModel = /** @class */function (_super) {\n  __extends(BoxplotSeriesModel, _super);\n  function BoxplotSeriesModel() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = BoxplotSeriesModel.type;\n    // TODO\n    // box width represents group size, so dimension should have 'size'.\n    /**\n     * @see <https://en.wikipedia.org/wiki/Box_plot>\n     * The meanings of 'min' and 'max' depend on user,\n     * and echarts do not need to know it.\n     * @readOnly\n     */\n    _this.defaultValueDimensions = [{\n      name: 'min',\n      defaultTooltip: true\n    }, {\n      name: 'Q1',\n      defaultTooltip: true\n    }, {\n      name: 'median',\n      defaultTooltip: true\n    }, {\n      name: 'Q3',\n      defaultTooltip: true\n    }, {\n      name: 'max',\n      defaultTooltip: true\n    }];\n    _this.visualDrawType = 'stroke';\n    return _this;\n  }\n  BoxplotSeriesModel.type = 'series.boxplot';\n  BoxplotSeriesModel.dependencies = ['xAxis', 'yAxis', 'grid'];\n  BoxplotSeriesModel.defaultOption = {\n    // zlevel: 0,\n    z: 2,\n    coordinateSystem: 'cartesian2d',\n    legendHoverLink: true,\n    layout: null,\n    boxWidth: [7, 50],\n    itemStyle: {\n      color: tokens.color.neutral00,\n      borderWidth: 1\n    },\n    emphasis: {\n      scale: true,\n      itemStyle: {\n        borderWidth: 2,\n        shadowBlur: 5,\n        shadowOffsetX: 1,\n        shadowOffsetY: 1,\n        shadowColor: tokens.color.shadow\n      }\n    },\n    animationDuration: 800\n  };\n  return BoxplotSeriesModel;\n}(SeriesModel);\nmixin(BoxplotSeriesModel, WhiskerBoxCommonMixin, true);\nexport default BoxplotSeriesModel;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport ChartView from '../../view/Chart.js';\nimport * as graphic from '../../util/graphic.js';\nimport { setStatesStylesFromModel, toggleHoverEmphasis } from '../../util/states.js';\nimport Path from 'zrender/lib/graphic/Path.js';\nimport { saveOldStyle } from '../../animation/basicTransition.js';\nvar BoxplotView = /** @class */function (_super) {\n  __extends(BoxplotView, _super);\n  function BoxplotView() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = BoxplotView.type;\n    return _this;\n  }\n  BoxplotView.prototype.render = function (seriesModel, ecModel, api) {\n    var data = seriesModel.getData();\n    var group = this.group;\n    var oldData = this._data;\n    // There is no old data only when first rendering or switching from\n    // stream mode to normal mode, where previous elements should be removed.\n    if (!this._data) {\n      group.removeAll();\n    }\n    var constDim = seriesModel.get('layout') === 'horizontal' ? 1 : 0;\n    data.diff(oldData).add(function (newIdx) {\n      if (data.hasValue(newIdx)) {\n        var itemLayout = data.getItemLayout(newIdx);\n        var symbolEl = createNormalBox(itemLayout, data, newIdx, constDim, true);\n        data.setItemGraphicEl(newIdx, symbolEl);\n        group.add(symbolEl);\n      }\n    }).update(function (newIdx, oldIdx) {\n      var symbolEl = oldData.getItemGraphicEl(oldIdx);\n      // Empty data\n      if (!data.hasValue(newIdx)) {\n        group.remove(symbolEl);\n        return;\n      }\n      var itemLayout = data.getItemLayout(newIdx);\n      if (!symbolEl) {\n        symbolEl = createNormalBox(itemLayout, data, newIdx, constDim);\n      } else {\n        saveOldStyle(symbolEl);\n        updateNormalBoxData(itemLayout, symbolEl, data, newIdx);\n      }\n      group.add(symbolEl);\n      data.setItemGraphicEl(newIdx, symbolEl);\n    }).remove(function (oldIdx) {\n      var el = oldData.getItemGraphicEl(oldIdx);\n      el && group.remove(el);\n    }).execute();\n    this._data = data;\n  };\n  BoxplotView.prototype.remove = function (ecModel) {\n    var group = this.group;\n    var data = this._data;\n    this._data = null;\n    data && data.eachItemGraphicEl(function (el) {\n      el && group.remove(el);\n    });\n  };\n  BoxplotView.type = 'boxplot';\n  return BoxplotView;\n}(ChartView);\nvar BoxPathShape = /** @class */function () {\n  function BoxPathShape() {}\n  return BoxPathShape;\n}();\nvar BoxPath = /** @class */function (_super) {\n  __extends(BoxPath, _super);\n  function BoxPath(opts) {\n    var _this = _super.call(this, opts) || this;\n    _this.type = 'boxplotBoxPath';\n    return _this;\n  }\n  BoxPath.prototype.getDefaultShape = function () {\n    return new BoxPathShape();\n  };\n  BoxPath.prototype.buildPath = function (ctx, shape) {\n    var ends = shape.points;\n    var i = 0;\n    ctx.moveTo(ends[i][0], ends[i][1]);\n    i++;\n    for (; i < 4; i++) {\n      ctx.lineTo(ends[i][0], ends[i][1]);\n    }\n    ctx.closePath();\n    for (; i < ends.length; i++) {\n      ctx.moveTo(ends[i][0], ends[i][1]);\n      i++;\n      ctx.lineTo(ends[i][0], ends[i][1]);\n    }\n  };\n  return BoxPath;\n}(Path);\nfunction createNormalBox(itemLayout, data, dataIndex, constDim, isInit) {\n  var ends = itemLayout.ends;\n  var el = new BoxPath({\n    shape: {\n      points: isInit ? transInit(ends, constDim, itemLayout) : ends\n    }\n  });\n  updateNormalBoxData(itemLayout, el, data, dataIndex, isInit);\n  return el;\n}\nfunction updateNormalBoxData(itemLayout, el, data, dataIndex, isInit) {\n  var seriesModel = data.hostModel;\n  var updateMethod = graphic[isInit ? 'initProps' : 'updateProps'];\n  updateMethod(el, {\n    shape: {\n      points: itemLayout.ends\n    }\n  }, seriesModel, dataIndex);\n  el.useStyle(data.getItemVisual(dataIndex, 'style'));\n  el.style.strokeNoScale = true;\n  el.z2 = 100;\n  var itemModel = data.getItemModel(dataIndex);\n  var emphasisModel = itemModel.getModel('emphasis');\n  setStatesStylesFromModel(el, itemModel);\n  toggleHoverEmphasis(el, emphasisModel.get('focus'), emphasisModel.get('blurScope'), emphasisModel.get('disabled'));\n}\nfunction transInit(points, dim, itemLayout) {\n  return zrUtil.map(points, function (point) {\n    point = point.slice();\n    point[dim] = itemLayout.initBaseline;\n    return point;\n  });\n}\nexport default BoxplotView;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { parsePercent } from '../../util/number.js';\nvar each = zrUtil.each;\nexport default function boxplotLayout(ecModel) {\n  var groupResult = groupSeriesByAxis(ecModel);\n  each(groupResult, function (groupItem) {\n    var seriesModels = groupItem.seriesModels;\n    if (!seriesModels.length) {\n      return;\n    }\n    calculateBase(groupItem);\n    each(seriesModels, function (seriesModel, idx) {\n      layoutSingleSeries(seriesModel, groupItem.boxOffsetList[idx], groupItem.boxWidthList[idx]);\n    });\n  });\n}\n/**\n * Group series by axis.\n */\nfunction groupSeriesByAxis(ecModel) {\n  var result = [];\n  var axisList = [];\n  ecModel.eachSeriesByType('boxplot', function (seriesModel) {\n    var baseAxis = seriesModel.getBaseAxis();\n    var idx = zrUtil.indexOf(axisList, baseAxis);\n    if (idx < 0) {\n      idx = axisList.length;\n      axisList[idx] = baseAxis;\n      result[idx] = {\n        axis: baseAxis,\n        seriesModels: []\n      };\n    }\n    result[idx].seriesModels.push(seriesModel);\n  });\n  return result;\n}\n/**\n * Calculate offset and box width for each series.\n */\nfunction calculateBase(groupItem) {\n  var baseAxis = groupItem.axis;\n  var seriesModels = groupItem.seriesModels;\n  var seriesCount = seriesModels.length;\n  var boxWidthList = groupItem.boxWidthList = [];\n  var boxOffsetList = groupItem.boxOffsetList = [];\n  var boundList = [];\n  var bandWidth;\n  if (baseAxis.type === 'category') {\n    bandWidth = baseAxis.getBandWidth();\n  } else {\n    var maxDataCount_1 = 0;\n    each(seriesModels, function (seriesModel) {\n      maxDataCount_1 = Math.max(maxDataCount_1, seriesModel.getData().count());\n    });\n    var extent = baseAxis.getExtent();\n    bandWidth = Math.abs(extent[1] - extent[0]) / maxDataCount_1;\n  }\n  each(seriesModels, function (seriesModel) {\n    var boxWidthBound = seriesModel.get('boxWidth');\n    if (!zrUtil.isArray(boxWidthBound)) {\n      boxWidthBound = [boxWidthBound, boxWidthBound];\n    }\n    boundList.push([parsePercent(boxWidthBound[0], bandWidth) || 0, parsePercent(boxWidthBound[1], bandWidth) || 0]);\n  });\n  var availableWidth = bandWidth * 0.8 - 2;\n  var boxGap = availableWidth / seriesCount * 0.3;\n  var boxWidth = (availableWidth - boxGap * (seriesCount - 1)) / seriesCount;\n  var base = boxWidth / 2 - availableWidth / 2;\n  each(seriesModels, function (seriesModel, idx) {\n    boxOffsetList.push(base);\n    base += boxGap + boxWidth;\n    boxWidthList.push(Math.min(Math.max(boxWidth, boundList[idx][0]), boundList[idx][1]));\n  });\n}\n/**\n * Calculate points location for each series.\n */\nfunction layoutSingleSeries(seriesModel, offset, boxWidth) {\n  var coordSys = seriesModel.coordinateSystem;\n  var data = seriesModel.getData();\n  var halfWidth = boxWidth / 2;\n  var cDimIdx = seriesModel.get('layout') === 'horizontal' ? 0 : 1;\n  var vDimIdx = 1 - cDimIdx;\n  var coordDims = ['x', 'y'];\n  var cDim = data.mapDimension(coordDims[cDimIdx]);\n  var vDims = data.mapDimensionsAll(coordDims[vDimIdx]);\n  if (cDim == null || vDims.length < 5) {\n    return;\n  }\n  for (var dataIndex = 0; dataIndex < data.count(); dataIndex++) {\n    var axisDimVal = data.get(cDim, dataIndex);\n    var median = getPoint(axisDimVal, vDims[2], dataIndex);\n    var end1 = getPoint(axisDimVal, vDims[0], dataIndex);\n    var end2 = getPoint(axisDimVal, vDims[1], dataIndex);\n    var end4 = getPoint(axisDimVal, vDims[3], dataIndex);\n    var end5 = getPoint(axisDimVal, vDims[4], dataIndex);\n    var ends = [];\n    addBodyEnd(ends, end2, false);\n    addBodyEnd(ends, end4, true);\n    ends.push(end1, end2, end5, end4);\n    layEndLine(ends, end1);\n    layEndLine(ends, end5);\n    layEndLine(ends, median);\n    data.setItemLayout(dataIndex, {\n      initBaseline: median[vDimIdx],\n      ends: ends\n    });\n  }\n  function getPoint(axisDimVal, dim, dataIndex) {\n    var val = data.get(dim, dataIndex);\n    var p = [];\n    p[cDimIdx] = axisDimVal;\n    p[vDimIdx] = val;\n    var point;\n    if (isNaN(axisDimVal) || isNaN(val)) {\n      point = [NaN, NaN];\n    } else {\n      point = coordSys.dataToPoint(p);\n      point[cDimIdx] += offset;\n    }\n    return point;\n  }\n  function addBodyEnd(ends, point, start) {\n    var point1 = point.slice();\n    var point2 = point.slice();\n    point1[cDimIdx] += halfWidth;\n    point2[cDimIdx] -= halfWidth;\n    start ? ends.push(point1, point2) : ends.push(point2, point1);\n  }\n  function layEndLine(ends, endCenter) {\n    var from = endCenter.slice();\n    var to = endCenter.slice();\n    from[cDimIdx] -= halfWidth;\n    to[cDimIdx] += halfWidth;\n    ends.push(from, to);\n  }\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { quantile, asc } from '../../util/number.js';\nimport { isFunction, isString } from 'zrender/lib/core/util.js';\n/**\n * See:\n *  <https://en.wikipedia.org/wiki/Box_plot#cite_note-frigge_hoaglin_iglewicz-2>\n *  <http://stat.ethz.ch/R-manual/R-devel/library/grDevices/html/boxplot.stats.html>\n *\n * Helper method for preparing data.\n *\n * @param rawData like\n *        [\n *            [12,232,443], (raw data set for the first box)\n *            [3843,5545,1232], (raw data set for the second box)\n *            ...\n *        ]\n * @param opt.boundIQR=1.5 Data less than min bound is outlier.\n *      default 1.5, means Q1 - 1.5 * (Q3 - Q1).\n *      If 'none'/0 passed, min bound will not be used.\n */\nexport default function prepareBoxplotData(rawData, opt) {\n  opt = opt || {};\n  var boxData = [];\n  var outliers = [];\n  var boundIQR = opt.boundIQR;\n  var useExtreme = boundIQR === 'none' || boundIQR === 0;\n  for (var i = 0; i < rawData.length; i++) {\n    var ascList = asc(rawData[i].slice());\n    var Q1 = quantile(ascList, 0.25);\n    var Q2 = quantile(ascList, 0.5);\n    var Q3 = quantile(ascList, 0.75);\n    var min = ascList[0];\n    var max = ascList[ascList.length - 1];\n    var bound = (boundIQR == null ? 1.5 : boundIQR) * (Q3 - Q1);\n    var low = useExtreme ? min : Math.max(min, Q1 - bound);\n    var high = useExtreme ? max : Math.min(max, Q3 + bound);\n    var itemNameFormatter = opt.itemNameFormatter;\n    var itemName = isFunction(itemNameFormatter) ? itemNameFormatter({\n      value: i\n    }) : isString(itemNameFormatter) ? itemNameFormatter.replace('{value}', i + '') : i + '';\n    boxData.push([itemName, low, Q1, Q2, Q3, high]);\n    for (var j = 0; j < ascList.length; j++) {\n      var dataItem = ascList[j];\n      if (dataItem < low || dataItem > high) {\n        var outlier = [itemName, dataItem];\n        outliers.push(outlier);\n      }\n    }\n  }\n  return {\n    boxData: boxData,\n    outliers: outliers\n  };\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport prepareBoxplotData from './prepareBoxplotData.js';\nimport { throwError, makePrintable } from '../../util/log.js';\nimport { SOURCE_FORMAT_ARRAY_ROWS } from '../../util/types.js';\nexport var boxplotTransform = {\n  type: 'echarts:boxplot',\n  transform: function transform(params) {\n    var upstream = params.upstream;\n    if (upstream.sourceFormat !== SOURCE_FORMAT_ARRAY_ROWS) {\n      var errMsg = '';\n      if (process.env.NODE_ENV !== 'production') {\n        errMsg = makePrintable('source data is not applicable for this boxplot transform. Expect number[][].');\n      }\n      throwError(errMsg);\n    }\n    var result = prepareBoxplotData(upstream.getRawData(), params.config);\n    return [{\n      dimensions: ['ItemName', 'Low', 'Q1', 'Q2', 'Q3', 'High'],\n      data: result.boxData\n    }, {\n      data: result.outliers\n    }];\n  }\n};", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport BoxplotSeriesModel from './BoxplotSeries.js';\nimport BoxplotView from './BoxplotView.js';\nimport boxplotLayout from './boxplotLayout.js';\nimport { boxplotTransform } from './boxplotTransform.js';\nexport function install(registers) {\n  registers.registerSeriesModel(BoxplotSeriesModel);\n  registers.registerChartView(BoxplotView);\n  registers.registerLayout(boxplotLayout);\n  registers.registerTransform(boxplotTransform);\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport createRenderPlanner from '../helper/createRenderPlanner.js';\nimport { extend } from 'zrender/lib/core/util.js';\nvar positiveBorderColorQuery = ['itemStyle', 'borderColor'];\nvar negativeBorderColorQuery = ['itemStyle', 'borderColor0'];\nvar dojiBorderColorQuery = ['itemStyle', 'borderColorDoji'];\nvar positiveColorQuery = ['itemStyle', 'color'];\nvar negativeColorQuery = ['itemStyle', 'color0'];\nexport function getColor(sign, model) {\n  return model.get(sign > 0 ? positiveColorQuery : negativeColorQuery);\n}\nexport function getBorderColor(sign, model) {\n  return model.get(sign === 0 ? dojiBorderColorQuery : sign > 0 ? positiveBorderColorQuery : negativeBorderColorQuery);\n}\nvar candlestickVisual = {\n  seriesType: 'candlestick',\n  plan: createRenderPlanner(),\n  // For legend.\n  performRawSeries: true,\n  reset: function (seriesModel, ecModel) {\n    // Only visible series has each data be visual encoded\n    if (ecModel.isSeriesFiltered(seriesModel)) {\n      return;\n    }\n    var isLargeRender = seriesModel.pipelineContext.large;\n    return !isLargeRender && {\n      progress: function (params, data) {\n        var dataIndex;\n        while ((dataIndex = params.next()) != null) {\n          var itemModel = data.getItemModel(dataIndex);\n          var sign = data.getItemLayout(dataIndex).sign;\n          var style = itemModel.getItemStyle();\n          style.fill = getColor(sign, itemModel);\n          style.stroke = getBorderColor(sign, itemModel) || style.fill;\n          var existsStyle = data.ensureUniqueItemVisual(dataIndex, 'style');\n          extend(existsStyle, style);\n        }\n      }\n    };\n  }\n};\nexport default candlestickVisual;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport ChartView from '../../view/Chart.js';\nimport * as graphic from '../../util/graphic.js';\nimport { setStatesStylesFromModel, toggleHoverEmphasis } from '../../util/states.js';\nimport Path from 'zrender/lib/graphic/Path.js';\nimport { createClipPath } from '../helper/createClipPathFromCoordSys.js';\nimport { saveOldStyle } from '../../animation/basicTransition.js';\nimport { getBorderColor, getColor } from './candlestickVisual.js';\nvar SKIP_PROPS = ['color', 'borderColor'];\nvar CandlestickView = /** @class */function (_super) {\n  __extends(CandlestickView, _super);\n  function CandlestickView() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = CandlestickView.type;\n    return _this;\n  }\n  CandlestickView.prototype.render = function (seriesModel, ecModel, api) {\n    // If there is clipPath created in large mode. Remove it.\n    this.group.removeClipPath();\n    // Clear previously rendered progressive elements.\n    this._progressiveEls = null;\n    this._updateDrawMode(seriesModel);\n    this._isLargeDraw ? this._renderLarge(seriesModel) : this._renderNormal(seriesModel);\n  };\n  CandlestickView.prototype.incrementalPrepareRender = function (seriesModel, ecModel, api) {\n    this._clear();\n    this._updateDrawMode(seriesModel);\n  };\n  CandlestickView.prototype.incrementalRender = function (params, seriesModel, ecModel, api) {\n    this._progressiveEls = [];\n    this._isLargeDraw ? this._incrementalRenderLarge(params, seriesModel) : this._incrementalRenderNormal(params, seriesModel);\n  };\n  CandlestickView.prototype.eachRendered = function (cb) {\n    graphic.traverseElements(this._progressiveEls || this.group, cb);\n  };\n  CandlestickView.prototype._updateDrawMode = function (seriesModel) {\n    var isLargeDraw = seriesModel.pipelineContext.large;\n    if (this._isLargeDraw == null || isLargeDraw !== this._isLargeDraw) {\n      this._isLargeDraw = isLargeDraw;\n      this._clear();\n    }\n  };\n  CandlestickView.prototype._renderNormal = function (seriesModel) {\n    var data = seriesModel.getData();\n    var oldData = this._data;\n    var group = this.group;\n    var isSimpleBox = data.getLayout('isSimpleBox');\n    var needsClip = seriesModel.get('clip', true);\n    var coord = seriesModel.coordinateSystem;\n    var clipArea = coord.getArea && coord.getArea();\n    // There is no old data only when first rendering or switching from\n    // stream mode to normal mode, where previous elements should be removed.\n    if (!this._data) {\n      group.removeAll();\n    }\n    data.diff(oldData).add(function (newIdx) {\n      if (data.hasValue(newIdx)) {\n        var itemLayout = data.getItemLayout(newIdx);\n        if (needsClip && isNormalBoxClipped(clipArea, itemLayout)) {\n          return;\n        }\n        var el = createNormalBox(itemLayout, newIdx, true);\n        graphic.initProps(el, {\n          shape: {\n            points: itemLayout.ends\n          }\n        }, seriesModel, newIdx);\n        setBoxCommon(el, data, newIdx, isSimpleBox);\n        group.add(el);\n        data.setItemGraphicEl(newIdx, el);\n      }\n    }).update(function (newIdx, oldIdx) {\n      var el = oldData.getItemGraphicEl(oldIdx);\n      // Empty data\n      if (!data.hasValue(newIdx)) {\n        group.remove(el);\n        return;\n      }\n      var itemLayout = data.getItemLayout(newIdx);\n      if (needsClip && isNormalBoxClipped(clipArea, itemLayout)) {\n        group.remove(el);\n        return;\n      }\n      if (!el) {\n        el = createNormalBox(itemLayout, newIdx);\n      } else {\n        graphic.updateProps(el, {\n          shape: {\n            points: itemLayout.ends\n          }\n        }, seriesModel, newIdx);\n        saveOldStyle(el);\n      }\n      setBoxCommon(el, data, newIdx, isSimpleBox);\n      group.add(el);\n      data.setItemGraphicEl(newIdx, el);\n    }).remove(function (oldIdx) {\n      var el = oldData.getItemGraphicEl(oldIdx);\n      el && group.remove(el);\n    }).execute();\n    this._data = data;\n  };\n  CandlestickView.prototype._renderLarge = function (seriesModel) {\n    this._clear();\n    createLarge(seriesModel, this.group);\n    var clipPath = seriesModel.get('clip', true) ? createClipPath(seriesModel.coordinateSystem, false, seriesModel) : null;\n    if (clipPath) {\n      this.group.setClipPath(clipPath);\n    } else {\n      this.group.removeClipPath();\n    }\n  };\n  CandlestickView.prototype._incrementalRenderNormal = function (params, seriesModel) {\n    var data = seriesModel.getData();\n    var isSimpleBox = data.getLayout('isSimpleBox');\n    var dataIndex;\n    while ((dataIndex = params.next()) != null) {\n      var itemLayout = data.getItemLayout(dataIndex);\n      var el = createNormalBox(itemLayout, dataIndex);\n      setBoxCommon(el, data, dataIndex, isSimpleBox);\n      el.incremental = true;\n      this.group.add(el);\n      this._progressiveEls.push(el);\n    }\n  };\n  CandlestickView.prototype._incrementalRenderLarge = function (params, seriesModel) {\n    createLarge(seriesModel, this.group, this._progressiveEls, true);\n  };\n  CandlestickView.prototype.remove = function (ecModel) {\n    this._clear();\n  };\n  CandlestickView.prototype._clear = function () {\n    this.group.removeAll();\n    this._data = null;\n  };\n  CandlestickView.type = 'candlestick';\n  return CandlestickView;\n}(ChartView);\nvar NormalBoxPathShape = /** @class */function () {\n  function NormalBoxPathShape() {}\n  return NormalBoxPathShape;\n}();\nvar NormalBoxPath = /** @class */function (_super) {\n  __extends(NormalBoxPath, _super);\n  function NormalBoxPath(opts) {\n    var _this = _super.call(this, opts) || this;\n    _this.type = 'normalCandlestickBox';\n    return _this;\n  }\n  NormalBoxPath.prototype.getDefaultShape = function () {\n    return new NormalBoxPathShape();\n  };\n  NormalBoxPath.prototype.buildPath = function (ctx, shape) {\n    var ends = shape.points;\n    if (this.__simpleBox) {\n      ctx.moveTo(ends[4][0], ends[4][1]);\n      ctx.lineTo(ends[6][0], ends[6][1]);\n    } else {\n      ctx.moveTo(ends[0][0], ends[0][1]);\n      ctx.lineTo(ends[1][0], ends[1][1]);\n      ctx.lineTo(ends[2][0], ends[2][1]);\n      ctx.lineTo(ends[3][0], ends[3][1]);\n      ctx.closePath();\n      ctx.moveTo(ends[4][0], ends[4][1]);\n      ctx.lineTo(ends[5][0], ends[5][1]);\n      ctx.moveTo(ends[6][0], ends[6][1]);\n      ctx.lineTo(ends[7][0], ends[7][1]);\n    }\n  };\n  return NormalBoxPath;\n}(Path);\nfunction createNormalBox(itemLayout, dataIndex, isInit) {\n  var ends = itemLayout.ends;\n  return new NormalBoxPath({\n    shape: {\n      points: isInit ? transInit(ends, itemLayout) : ends\n    },\n    z2: 100\n  });\n}\nfunction isNormalBoxClipped(clipArea, itemLayout) {\n  var clipped = true;\n  for (var i = 0; i < itemLayout.ends.length; i++) {\n    // If any point are in the region.\n    if (clipArea.contain(itemLayout.ends[i][0], itemLayout.ends[i][1])) {\n      clipped = false;\n      break;\n    }\n  }\n  return clipped;\n}\nfunction setBoxCommon(el, data, dataIndex, isSimpleBox) {\n  var itemModel = data.getItemModel(dataIndex);\n  el.useStyle(data.getItemVisual(dataIndex, 'style'));\n  el.style.strokeNoScale = true;\n  el.__simpleBox = isSimpleBox;\n  setStatesStylesFromModel(el, itemModel);\n  var sign = data.getItemLayout(dataIndex).sign;\n  zrUtil.each(el.states, function (state, stateName) {\n    var stateModel = itemModel.getModel(stateName);\n    var color = getColor(sign, stateModel);\n    var borderColor = getBorderColor(sign, stateModel) || color;\n    var stateStyle = state.style || (state.style = {});\n    color && (stateStyle.fill = color);\n    borderColor && (stateStyle.stroke = borderColor);\n  });\n  var emphasisModel = itemModel.getModel('emphasis');\n  toggleHoverEmphasis(el, emphasisModel.get('focus'), emphasisModel.get('blurScope'), emphasisModel.get('disabled'));\n}\nfunction transInit(points, itemLayout) {\n  return zrUtil.map(points, function (point) {\n    point = point.slice();\n    point[1] = itemLayout.initBaseline;\n    return point;\n  });\n}\nvar LargeBoxPathShape = /** @class */function () {\n  function LargeBoxPathShape() {}\n  return LargeBoxPathShape;\n}();\nvar LargeBoxPath = /** @class */function (_super) {\n  __extends(LargeBoxPath, _super);\n  function LargeBoxPath(opts) {\n    var _this = _super.call(this, opts) || this;\n    _this.type = 'largeCandlestickBox';\n    return _this;\n  }\n  LargeBoxPath.prototype.getDefaultShape = function () {\n    return new LargeBoxPathShape();\n  };\n  LargeBoxPath.prototype.buildPath = function (ctx, shape) {\n    // Drawing lines is more efficient than drawing\n    // a whole line or drawing rects.\n    var points = shape.points;\n    for (var i = 0; i < points.length;) {\n      if (this.__sign === points[i++]) {\n        var x = points[i++];\n        ctx.moveTo(x, points[i++]);\n        ctx.lineTo(x, points[i++]);\n      } else {\n        i += 3;\n      }\n    }\n  };\n  return LargeBoxPath;\n}(Path);\nfunction createLarge(seriesModel, group, progressiveEls, incremental) {\n  var data = seriesModel.getData();\n  var largePoints = data.getLayout('largePoints');\n  var elP = new LargeBoxPath({\n    shape: {\n      points: largePoints\n    },\n    __sign: 1,\n    ignoreCoarsePointer: true\n  });\n  group.add(elP);\n  var elN = new LargeBoxPath({\n    shape: {\n      points: largePoints\n    },\n    __sign: -1,\n    ignoreCoarsePointer: true\n  });\n  group.add(elN);\n  var elDoji = new LargeBoxPath({\n    shape: {\n      points: largePoints\n    },\n    __sign: 0,\n    ignoreCoarsePointer: true\n  });\n  group.add(elDoji);\n  setLargeStyle(1, elP, seriesModel, data);\n  setLargeStyle(-1, elN, seriesModel, data);\n  setLargeStyle(0, elDoji, seriesModel, data);\n  if (incremental) {\n    elP.incremental = true;\n    elN.incremental = true;\n  }\n  if (progressiveEls) {\n    progressiveEls.push(elP, elN);\n  }\n}\nfunction setLargeStyle(sign, el, seriesModel, data) {\n  // TODO put in visual?\n  var borderColor = getBorderColor(sign, seriesModel)\n  // Use color for border color by default.\n  || getColor(sign, seriesModel);\n  // Color must be excluded.\n  // Because symbol provide setColor individually to set fill and stroke\n  var itemStyle = seriesModel.getModel('itemStyle').getItemStyle(SKIP_PROPS);\n  el.useStyle(itemStyle);\n  el.style.fill = null;\n  el.style.stroke = borderColor;\n}\nexport default CandlestickView;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport SeriesModel from '../../model/Series.js';\nimport { WhiskerBoxCommonMixin } from '../helper/whiskerBoxCommon.js';\nimport { mixin } from 'zrender/lib/core/util.js';\nvar CandlestickSeriesModel = /** @class */function (_super) {\n  __extends(CandlestickSeriesModel, _super);\n  function CandlestickSeriesModel() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = CandlestickSeriesModel.type;\n    _this.defaultValueDimensions = [{\n      name: 'open',\n      defaultTooltip: true\n    }, {\n      name: 'close',\n      defaultTooltip: true\n    }, {\n      name: 'lowest',\n      defaultTooltip: true\n    }, {\n      name: 'highest',\n      defaultTooltip: true\n    }];\n    return _this;\n  }\n  /**\n   * Get dimension for shadow in dataZoom\n   * @return dimension name\n   */\n  CandlestickSeriesModel.prototype.getShadowDim = function () {\n    return 'open';\n  };\n  CandlestickSeriesModel.prototype.brushSelector = function (dataIndex, data, selectors) {\n    var itemLayout = data.getItemLayout(dataIndex);\n    return itemLayout && selectors.rect(itemLayout.brushRect);\n  };\n  CandlestickSeriesModel.type = 'series.candlestick';\n  CandlestickSeriesModel.dependencies = ['xAxis', 'yAxis', 'grid'];\n  CandlestickSeriesModel.defaultOption = {\n    // zlevel: 0,\n    z: 2,\n    coordinateSystem: 'cartesian2d',\n    legendHoverLink: true,\n    // xAxisIndex: 0,\n    // yAxisIndex: 0,\n    layout: null,\n    clip: true,\n    itemStyle: {\n      color: '#eb5454',\n      color0: '#47b262',\n      borderColor: '#eb5454',\n      borderColor0: '#47b262',\n      borderColorDoji: null,\n      // borderColor: '#d24040',\n      // borderColor0: '#398f4f',\n      borderWidth: 1\n    },\n    emphasis: {\n      itemStyle: {\n        borderWidth: 2\n      }\n    },\n    barMaxWidth: null,\n    barMinWidth: null,\n    barWidth: null,\n    large: true,\n    largeThreshold: 600,\n    progressive: 3e3,\n    progressiveThreshold: 1e4,\n    progressiveChunkMode: 'mod',\n    animationEasing: 'linear',\n    animationDuration: 300\n  };\n  return CandlestickSeriesModel;\n}(SeriesModel);\nmixin(CandlestickSeriesModel, WhiskerBoxCommonMixin, true);\nexport default CandlestickSeriesModel;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nexport default function candlestickPreprocessor(option) {\n  if (!option || !zrUtil.isArray(option.series)) {\n    return;\n  }\n  // Translate 'k' to 'candlestick'.\n  zrUtil.each(option.series, function (seriesItem) {\n    if (zrUtil.isObject(seriesItem) && seriesItem.type === 'k') {\n      seriesItem.type = 'candlestick';\n    }\n  });\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { subPixelOptimize } from '../../util/graphic.js';\nimport createRenderPlanner from '../helper/createRenderPlanner.js';\nimport { parsePercent } from '../../util/number.js';\nimport { map, retrieve2 } from 'zrender/lib/core/util.js';\nimport { createFloat32Array } from '../../util/vendor.js';\nvar candlestickLayout = {\n  seriesType: 'candlestick',\n  plan: createRenderPlanner(),\n  reset: function (seriesModel) {\n    var coordSys = seriesModel.coordinateSystem;\n    var data = seriesModel.getData();\n    var candleWidth = calculateCandleWidth(seriesModel, data);\n    var cDimIdx = 0;\n    var vDimIdx = 1;\n    var coordDims = ['x', 'y'];\n    var cDimI = data.getDimensionIndex(data.mapDimension(coordDims[cDimIdx]));\n    var vDimsI = map(data.mapDimensionsAll(coordDims[vDimIdx]), data.getDimensionIndex, data);\n    var openDimI = vDimsI[0];\n    var closeDimI = vDimsI[1];\n    var lowestDimI = vDimsI[2];\n    var highestDimI = vDimsI[3];\n    data.setLayout({\n      candleWidth: candleWidth,\n      // The value is experimented visually.\n      isSimpleBox: candleWidth <= 1.3\n    });\n    if (cDimI < 0 || vDimsI.length < 4) {\n      return;\n    }\n    return {\n      progress: seriesModel.pipelineContext.large ? largeProgress : normalProgress\n    };\n    function normalProgress(params, data) {\n      var dataIndex;\n      var store = data.getStore();\n      while ((dataIndex = params.next()) != null) {\n        var axisDimVal = store.get(cDimI, dataIndex);\n        var openVal = store.get(openDimI, dataIndex);\n        var closeVal = store.get(closeDimI, dataIndex);\n        var lowestVal = store.get(lowestDimI, dataIndex);\n        var highestVal = store.get(highestDimI, dataIndex);\n        var ocLow = Math.min(openVal, closeVal);\n        var ocHigh = Math.max(openVal, closeVal);\n        var ocLowPoint = getPoint(ocLow, axisDimVal);\n        var ocHighPoint = getPoint(ocHigh, axisDimVal);\n        var lowestPoint = getPoint(lowestVal, axisDimVal);\n        var highestPoint = getPoint(highestVal, axisDimVal);\n        var ends = [];\n        addBodyEnd(ends, ocHighPoint, 0);\n        addBodyEnd(ends, ocLowPoint, 1);\n        ends.push(subPixelOptimizePoint(highestPoint), subPixelOptimizePoint(ocHighPoint), subPixelOptimizePoint(lowestPoint), subPixelOptimizePoint(ocLowPoint));\n        var itemModel = data.getItemModel(dataIndex);\n        var hasDojiColor = !!itemModel.get(['itemStyle', 'borderColorDoji']);\n        data.setItemLayout(dataIndex, {\n          sign: getSign(store, dataIndex, openVal, closeVal, closeDimI, hasDojiColor),\n          initBaseline: openVal > closeVal ? ocHighPoint[vDimIdx] : ocLowPoint[vDimIdx],\n          ends: ends,\n          brushRect: makeBrushRect(lowestVal, highestVal, axisDimVal)\n        });\n      }\n      function getPoint(val, axisDimVal) {\n        var p = [];\n        p[cDimIdx] = axisDimVal;\n        p[vDimIdx] = val;\n        return isNaN(axisDimVal) || isNaN(val) ? [NaN, NaN] : coordSys.dataToPoint(p);\n      }\n      function addBodyEnd(ends, point, start) {\n        var point1 = point.slice();\n        var point2 = point.slice();\n        point1[cDimIdx] = subPixelOptimize(point1[cDimIdx] + candleWidth / 2, 1, false);\n        point2[cDimIdx] = subPixelOptimize(point2[cDimIdx] - candleWidth / 2, 1, true);\n        start ? ends.push(point1, point2) : ends.push(point2, point1);\n      }\n      function makeBrushRect(lowestVal, highestVal, axisDimVal) {\n        var pmin = getPoint(lowestVal, axisDimVal);\n        var pmax = getPoint(highestVal, axisDimVal);\n        pmin[cDimIdx] -= candleWidth / 2;\n        pmax[cDimIdx] -= candleWidth / 2;\n        return {\n          x: pmin[0],\n          y: pmin[1],\n          width: vDimIdx ? candleWidth : pmax[0] - pmin[0],\n          height: vDimIdx ? pmax[1] - pmin[1] : candleWidth\n        };\n      }\n      function subPixelOptimizePoint(point) {\n        point[cDimIdx] = subPixelOptimize(point[cDimIdx], 1);\n        return point;\n      }\n    }\n    function largeProgress(params, data) {\n      // Structure: [sign, x, yhigh, ylow, sign, x, yhigh, ylow, ...]\n      var points = createFloat32Array(params.count * 4);\n      var offset = 0;\n      var point;\n      var tmpIn = [];\n      var tmpOut = [];\n      var dataIndex;\n      var store = data.getStore();\n      var hasDojiColor = !!seriesModel.get(['itemStyle', 'borderColorDoji']);\n      while ((dataIndex = params.next()) != null) {\n        var axisDimVal = store.get(cDimI, dataIndex);\n        var openVal = store.get(openDimI, dataIndex);\n        var closeVal = store.get(closeDimI, dataIndex);\n        var lowestVal = store.get(lowestDimI, dataIndex);\n        var highestVal = store.get(highestDimI, dataIndex);\n        if (isNaN(axisDimVal) || isNaN(lowestVal) || isNaN(highestVal)) {\n          points[offset++] = NaN;\n          offset += 3;\n          continue;\n        }\n        points[offset++] = getSign(store, dataIndex, openVal, closeVal, closeDimI, hasDojiColor);\n        tmpIn[cDimIdx] = axisDimVal;\n        tmpIn[vDimIdx] = lowestVal;\n        point = coordSys.dataToPoint(tmpIn, null, tmpOut);\n        points[offset++] = point ? point[0] : NaN;\n        points[offset++] = point ? point[1] : NaN;\n        tmpIn[vDimIdx] = highestVal;\n        point = coordSys.dataToPoint(tmpIn, null, tmpOut);\n        points[offset++] = point ? point[1] : NaN;\n      }\n      data.setLayout('largePoints', points);\n    }\n  }\n};\n/**\n * Get the sign of a single data.\n *\n * @returns 0 for doji with hasDojiColor: true,\n *          1 for positive,\n *          -1 for negative.\n */\nfunction getSign(store, dataIndex, openVal, closeVal, closeDimI, hasDojiColor) {\n  var sign;\n  if (openVal > closeVal) {\n    sign = -1;\n  } else if (openVal < closeVal) {\n    sign = 1;\n  } else {\n    sign = hasDojiColor\n    // When doji color is set, use it instead of color/color0.\n    ? 0 : dataIndex > 0\n    // If close === open, compare with close of last record\n    ? store.get(closeDimI, dataIndex - 1) <= closeVal ? 1 : -1\n    // No record of previous, set to be positive\n    : 1;\n  }\n  return sign;\n}\nfunction calculateCandleWidth(seriesModel, data) {\n  var baseAxis = seriesModel.getBaseAxis();\n  var extent;\n  var bandWidth = baseAxis.type === 'category' ? baseAxis.getBandWidth() : (extent = baseAxis.getExtent(), Math.abs(extent[1] - extent[0]) / data.count());\n  var barMaxWidth = parsePercent(retrieve2(seriesModel.get('barMaxWidth'), bandWidth), bandWidth);\n  var barMinWidth = parsePercent(retrieve2(seriesModel.get('barMinWidth'), 1), bandWidth);\n  var barWidth = seriesModel.get('barWidth');\n  return barWidth != null ? parsePercent(barWidth, bandWidth)\n  // Put max outer to ensure bar visible in spite of overlap.\n  : Math.max(Math.min(bandWidth / 2, barMaxWidth), barMinWidth);\n}\nexport default candlestickLayout;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport CandlestickView from './CandlestickView.js';\nimport CandlestickSeriesModel from './CandlestickSeries.js';\nimport preprocessor from './preprocessor.js';\nimport candlestickVisual from './candlestickVisual.js';\nimport candlestickLayout from './candlestickLayout.js';\nexport function install(registers) {\n  registers.registerChartView(CandlestickView);\n  registers.registerSeriesModel(CandlestickSeriesModel);\n  registers.registerPreprocessor(preprocessor);\n  registers.registerVisual(candlestickVisual);\n  registers.registerLayout(candlestickLayout);\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport { createSymbol, normalizeSymbolOffset, normalizeSymbolSize } from '../../util/symbol.js';\nimport { Group } from '../../util/graphic.js';\nimport { enterEmphasis, leaveEmphasis, toggleHoverEmphasis } from '../../util/states.js';\nimport SymbolClz from './Symbol.js';\nfunction updateRipplePath(rippleGroup, effectCfg) {\n  var color = effectCfg.rippleEffectColor || effectCfg.color;\n  rippleGroup.eachChild(function (ripplePath) {\n    ripplePath.attr({\n      z: effectCfg.z,\n      zlevel: effectCfg.zlevel,\n      style: {\n        stroke: effectCfg.brushType === 'stroke' ? color : null,\n        fill: effectCfg.brushType === 'fill' ? color : null\n      }\n    });\n  });\n}\nvar EffectSymbol = /** @class */function (_super) {\n  __extends(EffectSymbol, _super);\n  function EffectSymbol(data, idx) {\n    var _this = _super.call(this) || this;\n    var symbol = new SymbolClz(data, idx);\n    var rippleGroup = new Group();\n    _this.add(symbol);\n    _this.add(rippleGroup);\n    _this.updateData(data, idx);\n    return _this;\n  }\n  EffectSymbol.prototype.stopEffectAnimation = function () {\n    this.childAt(1).removeAll();\n  };\n  EffectSymbol.prototype.startEffectAnimation = function (effectCfg) {\n    var symbolType = effectCfg.symbolType;\n    var color = effectCfg.color;\n    var rippleNumber = effectCfg.rippleNumber;\n    var rippleGroup = this.childAt(1);\n    for (var i = 0; i < rippleNumber; i++) {\n      // If width/height are set too small (e.g., set to 1) on ios10\n      // and macOS Sierra, a circle stroke become a rect, no matter what\n      // the scale is set. So we set width/height as 2. See #4136.\n      var ripplePath = createSymbol(symbolType, -1, -1, 2, 2, color);\n      ripplePath.attr({\n        style: {\n          strokeNoScale: true\n        },\n        z2: 99,\n        silent: true,\n        scaleX: 0.5,\n        scaleY: 0.5\n      });\n      var delay = -i / rippleNumber * effectCfg.period + effectCfg.effectOffset;\n      ripplePath.animate('', true).when(effectCfg.period, {\n        scaleX: effectCfg.rippleScale / 2,\n        scaleY: effectCfg.rippleScale / 2\n      }).delay(delay).start();\n      ripplePath.animateStyle(true).when(effectCfg.period, {\n        opacity: 0\n      }).delay(delay).start();\n      rippleGroup.add(ripplePath);\n    }\n    updateRipplePath(rippleGroup, effectCfg);\n  };\n  /**\n   * Update effect symbol\n   */\n  EffectSymbol.prototype.updateEffectAnimation = function (effectCfg) {\n    var oldEffectCfg = this._effectCfg;\n    var rippleGroup = this.childAt(1);\n    // Must reinitialize effect if following configuration changed\n    var DIFFICULT_PROPS = ['symbolType', 'period', 'rippleScale', 'rippleNumber'];\n    for (var i = 0; i < DIFFICULT_PROPS.length; i++) {\n      var propName = DIFFICULT_PROPS[i];\n      if (oldEffectCfg[propName] !== effectCfg[propName]) {\n        this.stopEffectAnimation();\n        this.startEffectAnimation(effectCfg);\n        return;\n      }\n    }\n    updateRipplePath(rippleGroup, effectCfg);\n  };\n  /**\n   * Highlight symbol\n   */\n  EffectSymbol.prototype.highlight = function () {\n    enterEmphasis(this);\n  };\n  /**\n   * Downplay symbol\n   */\n  EffectSymbol.prototype.downplay = function () {\n    leaveEmphasis(this);\n  };\n  EffectSymbol.prototype.getSymbolType = function () {\n    var symbol = this.childAt(0);\n    return symbol && symbol.getSymbolType();\n  };\n  /**\n   * Update symbol properties\n   */\n  EffectSymbol.prototype.updateData = function (data, idx) {\n    var _this = this;\n    var seriesModel = data.hostModel;\n    this.childAt(0).updateData(data, idx);\n    var rippleGroup = this.childAt(1);\n    var itemModel = data.getItemModel(idx);\n    var symbolType = data.getItemVisual(idx, 'symbol');\n    var symbolSize = normalizeSymbolSize(data.getItemVisual(idx, 'symbolSize'));\n    var symbolStyle = data.getItemVisual(idx, 'style');\n    var color = symbolStyle && symbolStyle.fill;\n    var emphasisModel = itemModel.getModel('emphasis');\n    rippleGroup.setScale(symbolSize);\n    rippleGroup.traverse(function (ripplePath) {\n      ripplePath.setStyle('fill', color);\n    });\n    var symbolOffset = normalizeSymbolOffset(data.getItemVisual(idx, 'symbolOffset'), symbolSize);\n    if (symbolOffset) {\n      rippleGroup.x = symbolOffset[0];\n      rippleGroup.y = symbolOffset[1];\n    }\n    var symbolRotate = data.getItemVisual(idx, 'symbolRotate');\n    rippleGroup.rotation = (symbolRotate || 0) * Math.PI / 180 || 0;\n    var effectCfg = {};\n    effectCfg.showEffectOn = seriesModel.get('showEffectOn');\n    effectCfg.rippleScale = itemModel.get(['rippleEffect', 'scale']);\n    effectCfg.brushType = itemModel.get(['rippleEffect', 'brushType']);\n    effectCfg.period = itemModel.get(['rippleEffect', 'period']) * 1000;\n    effectCfg.effectOffset = idx / data.count();\n    effectCfg.z = seriesModel.getShallow('z') || 0;\n    effectCfg.zlevel = seriesModel.getShallow('zlevel') || 0;\n    effectCfg.symbolType = symbolType;\n    effectCfg.color = color;\n    effectCfg.rippleEffectColor = itemModel.get(['rippleEffect', 'color']);\n    effectCfg.rippleNumber = itemModel.get(['rippleEffect', 'number']);\n    if (effectCfg.showEffectOn === 'render') {\n      this._effectCfg ? this.updateEffectAnimation(effectCfg) : this.startEffectAnimation(effectCfg);\n      this._effectCfg = effectCfg;\n    } else {\n      // Not keep old effect config\n      this._effectCfg = null;\n      this.stopEffectAnimation();\n      this.onHoverStateChange = function (toState) {\n        if (toState === 'emphasis') {\n          if (effectCfg.showEffectOn !== 'render') {\n            _this.startEffectAnimation(effectCfg);\n          }\n        } else if (toState === 'normal') {\n          if (effectCfg.showEffectOn !== 'render') {\n            _this.stopEffectAnimation();\n          }\n        }\n      };\n    }\n    this._effectCfg = effectCfg;\n    toggleHoverEmphasis(this, emphasisModel.get('focus'), emphasisModel.get('blurScope'), emphasisModel.get('disabled'));\n  };\n  ;\n  EffectSymbol.prototype.fadeOut = function (cb) {\n    cb && cb();\n  };\n  ;\n  return EffectSymbol;\n}(Group);\nexport default EffectSymbol;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport SymbolDraw from '../helper/SymbolDraw.js';\nimport EffectSymbol from '../helper/EffectSymbol.js';\nimport * as matrix from 'zrender/lib/core/matrix.js';\nimport pointsLayout from '../../layout/points.js';\nimport ChartView from '../../view/Chart.js';\nvar EffectScatterView = /** @class */function (_super) {\n  __extends(EffectScatterView, _super);\n  function EffectScatterView() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = EffectScatterView.type;\n    return _this;\n  }\n  EffectScatterView.prototype.init = function () {\n    this._symbolDraw = new SymbolDraw(EffectSymbol);\n  };\n  EffectScatterView.prototype.render = function (seriesModel, ecModel, api) {\n    var data = seriesModel.getData();\n    var effectSymbolDraw = this._symbolDraw;\n    effectSymbolDraw.updateData(data, {\n      clipShape: this._getClipShape(seriesModel)\n    });\n    this.group.add(effectSymbolDraw.group);\n  };\n  EffectScatterView.prototype._getClipShape = function (seriesModel) {\n    var coordSys = seriesModel.coordinateSystem;\n    var clipArea = coordSys && coordSys.getArea && coordSys.getArea();\n    return seriesModel.get('clip', true) ? clipArea : null;\n  };\n  EffectScatterView.prototype.updateTransform = function (seriesModel, ecModel, api) {\n    var data = seriesModel.getData();\n    this.group.dirty();\n    var res = pointsLayout('').reset(seriesModel, ecModel, api);\n    if (res.progress) {\n      res.progress({\n        start: 0,\n        end: data.count(),\n        count: data.count()\n      }, data);\n    }\n    this._symbolDraw.updateLayout();\n  };\n  EffectScatterView.prototype._updateGroupTransform = function (seriesModel) {\n    var coordSys = seriesModel.coordinateSystem;\n    if (coordSys && coordSys.getRoamTransform) {\n      this.group.transform = matrix.clone(coordSys.getRoamTransform());\n      this.group.decomposeTransform();\n    }\n  };\n  EffectScatterView.prototype.remove = function (ecModel, api) {\n    this._symbolDraw && this._symbolDraw.remove(true);\n  };\n  EffectScatterView.type = 'effectScatter';\n  return EffectScatterView;\n}(ChartView);\nexport default EffectScatterView;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport createSeriesData from '../helper/createSeriesData.js';\nimport SeriesModel from '../../model/Series.js';\nvar EffectScatterSeriesModel = /** @class */function (_super) {\n  __extends(EffectScatterSeriesModel, _super);\n  function EffectScatterSeriesModel() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = EffectScatterSeriesModel.type;\n    _this.hasSymbolVisual = true;\n    return _this;\n  }\n  EffectScatterSeriesModel.prototype.getInitialData = function (option, ecModel) {\n    return createSeriesData(null, this, {\n      useEncodeDefaulter: true\n    });\n  };\n  EffectScatterSeriesModel.prototype.brushSelector = function (dataIndex, data, selectors) {\n    return selectors.point(data.getItemLayout(dataIndex));\n  };\n  EffectScatterSeriesModel.type = 'series.effectScatter';\n  EffectScatterSeriesModel.dependencies = ['grid', 'polar'];\n  EffectScatterSeriesModel.defaultOption = {\n    coordinateSystem: 'cartesian2d',\n    // zlevel: 0,\n    z: 2,\n    legendHoverLink: true,\n    effectType: 'ripple',\n    progressive: 0,\n    // When to show the effect, option: 'render'|'emphasis'\n    showEffectOn: 'render',\n    clip: true,\n    // Ripple effect config\n    rippleEffect: {\n      period: 4,\n      // Scale of ripple\n      scale: 2.5,\n      // Brush type can be fill or stroke\n      brushType: 'fill',\n      // Ripple number\n      number: 3\n    },\n    universalTransition: {\n      divideShape: 'clone'\n    },\n    // Cartesian coordinate system\n    // xAxisIndex: 0,\n    // yAxisIndex: 0,\n    // Polar coordinate system\n    // polarIndex: 0,\n    // Geo coordinate system\n    // geoIndex: 0,\n    // symbol: null,        // \u56FE\u5F62\u7C7B\u578B\n    symbolSize: 10 // \u56FE\u5F62\u5927\u5C0F\uFF0C\u534A\u5BBD\uFF08\u534A\u5F84\uFF09\u53C2\u6570\uFF0C\u5F53\u56FE\u5F62\u4E3A\u65B9\u5411\u6216\u83F1\u5F62\u5219\u603B\u5BBD\u5EA6\u4E3AsymbolSize * 2\n    // symbolRotate: null,  // \u56FE\u5F62\u65CB\u8F6C\u63A7\u5236\n    // itemStyle: {\n    //     opacity: 1\n    // }\n  };\n  return EffectScatterSeriesModel;\n}(SeriesModel);\nexport default EffectScatterSeriesModel;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport EffectScatterView from './EffectScatterView.js';\nimport EffectScatterSeriesModel from './EffectScatterSeries.js';\nimport layoutPoints from '../../layout/points.js';\nexport function install(registers) {\n  registers.registerChartView(EffectScatterView);\n  registers.registerSeriesModel(EffectScatterSeriesModel);\n  registers.registerLayout(layoutPoints('effectScatter'));\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\n/**\n * Provide effect for line\n */\nimport * as graphic from '../../util/graphic.js';\nimport Line from './Line.js';\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { createSymbol } from '../../util/symbol.js';\nimport * as vec2 from 'zrender/lib/core/vector.js';\nimport * as curveUtil from 'zrender/lib/core/curve.js';\nvar EffectLine = /** @class */function (_super) {\n  __extends(EffectLine, _super);\n  function EffectLine(lineData, idx, seriesScope) {\n    var _this = _super.call(this) || this;\n    _this.add(_this.createLine(lineData, idx, seriesScope));\n    _this._updateEffectSymbol(lineData, idx);\n    return _this;\n  }\n  EffectLine.prototype.createLine = function (lineData, idx, seriesScope) {\n    return new Line(lineData, idx, seriesScope);\n  };\n  EffectLine.prototype._updateEffectSymbol = function (lineData, idx) {\n    var itemModel = lineData.getItemModel(idx);\n    var effectModel = itemModel.getModel('effect');\n    var size = effectModel.get('symbolSize');\n    var symbolType = effectModel.get('symbol');\n    if (!zrUtil.isArray(size)) {\n      size = [size, size];\n    }\n    var lineStyle = lineData.getItemVisual(idx, 'style');\n    var color = effectModel.get('color') || lineStyle && lineStyle.stroke;\n    var symbol = this.childAt(1);\n    if (this._symbolType !== symbolType) {\n      // Remove previous\n      this.remove(symbol);\n      symbol = createSymbol(symbolType, -0.5, -0.5, 1, 1, color);\n      symbol.z2 = 100;\n      symbol.culling = true;\n      this.add(symbol);\n    }\n    // Symbol may be removed if loop is false\n    if (!symbol) {\n      return;\n    }\n    // Shadow color is same with color in default\n    symbol.setStyle('shadowColor', color);\n    symbol.setStyle(effectModel.getItemStyle(['color']));\n    symbol.scaleX = size[0];\n    symbol.scaleY = size[1];\n    symbol.setColor(color);\n    this._symbolType = symbolType;\n    this._symbolScale = size;\n    this._updateEffectAnimation(lineData, effectModel, idx);\n  };\n  EffectLine.prototype._updateEffectAnimation = function (lineData, effectModel, idx) {\n    var symbol = this.childAt(1);\n    if (!symbol) {\n      return;\n    }\n    var points = lineData.getItemLayout(idx);\n    var period = effectModel.get('period') * 1000;\n    var loop = effectModel.get('loop');\n    var roundTrip = effectModel.get('roundTrip');\n    var constantSpeed = effectModel.get('constantSpeed');\n    var delayExpr = zrUtil.retrieve(effectModel.get('delay'), function (idx) {\n      return idx / lineData.count() * period / 3;\n    });\n    // Ignore when updating\n    symbol.ignore = true;\n    this._updateAnimationPoints(symbol, points);\n    if (constantSpeed > 0) {\n      period = this._getLineLength(symbol) / constantSpeed * 1000;\n    }\n    if (period !== this._period || loop !== this._loop || roundTrip !== this._roundTrip) {\n      symbol.stopAnimation();\n      var delayNum = void 0;\n      if (zrUtil.isFunction(delayExpr)) {\n        delayNum = delayExpr(idx);\n      } else {\n        delayNum = delayExpr;\n      }\n      if (symbol.__t > 0) {\n        delayNum = -period * symbol.__t;\n      }\n      this._animateSymbol(symbol, period, delayNum, loop, roundTrip);\n    }\n    this._period = period;\n    this._loop = loop;\n    this._roundTrip = roundTrip;\n  };\n  EffectLine.prototype._animateSymbol = function (symbol, period, delayNum, loop, roundTrip) {\n    if (period > 0) {\n      symbol.__t = 0;\n      var self_1 = this;\n      var animator = symbol.animate('', loop).when(roundTrip ? period * 2 : period, {\n        __t: roundTrip ? 2 : 1\n      }).delay(delayNum).during(function () {\n        self_1._updateSymbolPosition(symbol);\n      });\n      if (!loop) {\n        animator.done(function () {\n          self_1.remove(symbol);\n        });\n      }\n      animator.start();\n    }\n  };\n  EffectLine.prototype._getLineLength = function (symbol) {\n    // Not so accurate\n    return vec2.dist(symbol.__p1, symbol.__cp1) + vec2.dist(symbol.__cp1, symbol.__p2);\n  };\n  EffectLine.prototype._updateAnimationPoints = function (symbol, points) {\n    symbol.__p1 = points[0];\n    symbol.__p2 = points[1];\n    symbol.__cp1 = points[2] || [(points[0][0] + points[1][0]) / 2, (points[0][1] + points[1][1]) / 2];\n  };\n  EffectLine.prototype.updateData = function (lineData, idx, seriesScope) {\n    this.childAt(0).updateData(lineData, idx, seriesScope);\n    this._updateEffectSymbol(lineData, idx);\n  };\n  EffectLine.prototype._updateSymbolPosition = function (symbol) {\n    var p1 = symbol.__p1;\n    var p2 = symbol.__p2;\n    var cp1 = symbol.__cp1;\n    var t = symbol.__t < 1 ? symbol.__t : 2 - symbol.__t;\n    var pos = [symbol.x, symbol.y];\n    var lastPos = pos.slice();\n    var quadraticAt = curveUtil.quadraticAt;\n    var quadraticDerivativeAt = curveUtil.quadraticDerivativeAt;\n    pos[0] = quadraticAt(p1[0], cp1[0], p2[0], t);\n    pos[1] = quadraticAt(p1[1], cp1[1], p2[1], t);\n    // Tangent\n    var tx = symbol.__t < 1 ? quadraticDerivativeAt(p1[0], cp1[0], p2[0], t) : quadraticDerivativeAt(p2[0], cp1[0], p1[0], 1 - t);\n    var ty = symbol.__t < 1 ? quadraticDerivativeAt(p1[1], cp1[1], p2[1], t) : quadraticDerivativeAt(p2[1], cp1[1], p1[1], 1 - t);\n    symbol.rotation = -Math.atan2(ty, tx) - Math.PI / 2;\n    // enable continuity trail for 'line', 'rect', 'roundRect' symbolType\n    if (this._symbolType === 'line' || this._symbolType === 'rect' || this._symbolType === 'roundRect') {\n      if (symbol.__lastT !== undefined && symbol.__lastT < symbol.__t) {\n        symbol.scaleY = vec2.dist(lastPos, pos) * 1.05;\n        // make sure the last segment render within endPoint\n        if (t === 1) {\n          pos[0] = lastPos[0] + (pos[0] - lastPos[0]) / 2;\n          pos[1] = lastPos[1] + (pos[1] - lastPos[1]) / 2;\n        }\n      } else if (symbol.__lastT === 1) {\n        // After first loop, symbol.__t does NOT start with 0, so connect p1 to pos directly.\n        symbol.scaleY = 2 * vec2.dist(p1, pos);\n      } else {\n        symbol.scaleY = this._symbolScale[1];\n      }\n    }\n    symbol.__lastT = symbol.__t;\n    symbol.ignore = false;\n    symbol.x = pos[0];\n    symbol.y = pos[1];\n  };\n  EffectLine.prototype.updateLayout = function (lineData, idx) {\n    this.childAt(0).updateLayout(lineData, idx);\n    var effectModel = lineData.getItemModel(idx).getModel('effect');\n    this._updateEffectAnimation(lineData, effectModel, idx);\n  };\n  return EffectLine;\n}(graphic.Group);\nexport default EffectLine;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as graphic from '../../util/graphic.js';\nimport { toggleHoverEmphasis } from '../../util/states.js';\nvar Polyline = /** @class */function (_super) {\n  __extends(Polyline, _super);\n  function Polyline(lineData, idx, seriesScope) {\n    var _this = _super.call(this) || this;\n    _this._createPolyline(lineData, idx, seriesScope);\n    return _this;\n  }\n  Polyline.prototype._createPolyline = function (lineData, idx, seriesScope) {\n    // let seriesModel = lineData.hostModel;\n    var points = lineData.getItemLayout(idx);\n    var line = new graphic.Polyline({\n      shape: {\n        points: points\n      }\n    });\n    this.add(line);\n    this._updateCommonStl(lineData, idx, seriesScope);\n  };\n  ;\n  Polyline.prototype.updateData = function (lineData, idx, seriesScope) {\n    var seriesModel = lineData.hostModel;\n    var line = this.childAt(0);\n    var target = {\n      shape: {\n        points: lineData.getItemLayout(idx)\n      }\n    };\n    graphic.updateProps(line, target, seriesModel, idx);\n    this._updateCommonStl(lineData, idx, seriesScope);\n  };\n  ;\n  Polyline.prototype._updateCommonStl = function (lineData, idx, seriesScope) {\n    var line = this.childAt(0);\n    var itemModel = lineData.getItemModel(idx);\n    var emphasisLineStyle = seriesScope && seriesScope.emphasisLineStyle;\n    var focus = seriesScope && seriesScope.focus;\n    var blurScope = seriesScope && seriesScope.blurScope;\n    var emphasisDisabled = seriesScope && seriesScope.emphasisDisabled;\n    if (!seriesScope || lineData.hasItemOption) {\n      var emphasisModel = itemModel.getModel('emphasis');\n      emphasisLineStyle = emphasisModel.getModel('lineStyle').getLineStyle();\n      emphasisDisabled = emphasisModel.get('disabled');\n      focus = emphasisModel.get('focus');\n      blurScope = emphasisModel.get('blurScope');\n    }\n    line.useStyle(lineData.getItemVisual(idx, 'style'));\n    line.style.fill = null;\n    line.style.strokeNoScale = true;\n    var lineEmphasisState = line.ensureState('emphasis');\n    lineEmphasisState.style = emphasisLineStyle;\n    toggleHoverEmphasis(this, focus, blurScope, emphasisDisabled);\n  };\n  ;\n  Polyline.prototype.updateLayout = function (lineData, idx) {\n    var polyline = this.childAt(0);\n    polyline.setShape('points', lineData.getItemLayout(idx));\n  };\n  ;\n  return Polyline;\n}(graphic.Group);\nexport default Polyline;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport Polyline from './Polyline.js';\nimport EffectLine from './EffectLine.js';\nimport * as vec2 from 'zrender/lib/core/vector.js';\nvar EffectPolyline = /** @class */function (_super) {\n  __extends(EffectPolyline, _super);\n  function EffectPolyline() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this._lastFrame = 0;\n    _this._lastFramePercent = 0;\n    return _this;\n  }\n  // Override\n  EffectPolyline.prototype.createLine = function (lineData, idx, seriesScope) {\n    return new Polyline(lineData, idx, seriesScope);\n  };\n  ;\n  // Override\n  EffectPolyline.prototype._updateAnimationPoints = function (symbol, points) {\n    this._points = points;\n    var accLenArr = [0];\n    var len = 0;\n    for (var i = 1; i < points.length; i++) {\n      var p1 = points[i - 1];\n      var p2 = points[i];\n      len += vec2.dist(p1, p2);\n      accLenArr.push(len);\n    }\n    if (len === 0) {\n      this._length = 0;\n      return;\n    }\n    for (var i = 0; i < accLenArr.length; i++) {\n      accLenArr[i] /= len;\n    }\n    this._offsets = accLenArr;\n    this._length = len;\n  };\n  ;\n  // Override\n  EffectPolyline.prototype._getLineLength = function () {\n    return this._length;\n  };\n  ;\n  // Override\n  EffectPolyline.prototype._updateSymbolPosition = function (symbol) {\n    var t = symbol.__t < 1 ? symbol.__t : 2 - symbol.__t;\n    var points = this._points;\n    var offsets = this._offsets;\n    var len = points.length;\n    if (!offsets) {\n      // Has length 0\n      return;\n    }\n    var lastFrame = this._lastFrame;\n    var frame;\n    if (t < this._lastFramePercent) {\n      // Start from the next frame\n      // PENDING start from lastFrame ?\n      var start = Math.min(lastFrame + 1, len - 1);\n      for (frame = start; frame >= 0; frame--) {\n        if (offsets[frame] <= t) {\n          break;\n        }\n      }\n      // PENDING really need to do this ?\n      frame = Math.min(frame, len - 2);\n    } else {\n      for (frame = lastFrame; frame < len; frame++) {\n        if (offsets[frame] > t) {\n          break;\n        }\n      }\n      frame = Math.min(frame - 1, len - 2);\n    }\n    var p = (t - offsets[frame]) / (offsets[frame + 1] - offsets[frame]);\n    var p0 = points[frame];\n    var p1 = points[frame + 1];\n    symbol.x = p0[0] * (1 - p) + p * p1[0];\n    symbol.y = p0[1] * (1 - p) + p * p1[1];\n    var tx = symbol.__t < 1 ? p1[0] - p0[0] : p0[0] - p1[0];\n    var ty = symbol.__t < 1 ? p1[1] - p0[1] : p0[1] - p1[1];\n    symbol.rotation = -Math.atan2(ty, tx) - Math.PI / 2;\n    this._lastFrame = frame;\n    this._lastFramePercent = t;\n    symbol.ignore = false;\n  };\n  ;\n  return EffectPolyline;\n}(EffectLine);\nexport default EffectPolyline;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\n// TODO Batch by color\nimport * as graphic from '../../util/graphic.js';\nimport * as lineContain from 'zrender/lib/contain/line.js';\nimport * as quadraticContain from 'zrender/lib/contain/quadratic.js';\nimport { getECData } from '../../util/innerStore.js';\nimport tokens from '../../visual/tokens.js';\nvar LargeLinesPathShape = /** @class */function () {\n  function LargeLinesPathShape() {\n    this.polyline = false;\n    this.curveness = 0;\n    this.segs = [];\n  }\n  return LargeLinesPathShape;\n}();\nvar LargeLinesPath = /** @class */function (_super) {\n  __extends(LargeLinesPath, _super);\n  function LargeLinesPath(opts) {\n    var _this = _super.call(this, opts) || this;\n    _this._off = 0;\n    _this.hoverDataIdx = -1;\n    return _this;\n  }\n  LargeLinesPath.prototype.reset = function () {\n    this.notClear = false;\n    this._off = 0;\n  };\n  LargeLinesPath.prototype.getDefaultStyle = function () {\n    return {\n      stroke: tokens.color.neutral99,\n      fill: null\n    };\n  };\n  LargeLinesPath.prototype.getDefaultShape = function () {\n    return new LargeLinesPathShape();\n  };\n  LargeLinesPath.prototype.buildPath = function (ctx, shape) {\n    var segs = shape.segs;\n    var curveness = shape.curveness;\n    var i;\n    if (shape.polyline) {\n      for (i = this._off; i < segs.length;) {\n        var count = segs[i++];\n        if (count > 0) {\n          ctx.moveTo(segs[i++], segs[i++]);\n          for (var k = 1; k < count; k++) {\n            ctx.lineTo(segs[i++], segs[i++]);\n          }\n        }\n      }\n    } else {\n      for (i = this._off; i < segs.length;) {\n        var x0 = segs[i++];\n        var y0 = segs[i++];\n        var x1 = segs[i++];\n        var y1 = segs[i++];\n        ctx.moveTo(x0, y0);\n        if (curveness > 0) {\n          var x2 = (x0 + x1) / 2 - (y0 - y1) * curveness;\n          var y2 = (y0 + y1) / 2 - (x1 - x0) * curveness;\n          ctx.quadraticCurveTo(x2, y2, x1, y1);\n        } else {\n          ctx.lineTo(x1, y1);\n        }\n      }\n    }\n    if (this.incremental) {\n      this._off = i;\n      this.notClear = true;\n    }\n  };\n  LargeLinesPath.prototype.findDataIndex = function (x, y) {\n    var shape = this.shape;\n    var segs = shape.segs;\n    var curveness = shape.curveness;\n    var lineWidth = this.style.lineWidth;\n    if (shape.polyline) {\n      var dataIndex = 0;\n      for (var i = 0; i < segs.length;) {\n        var count = segs[i++];\n        if (count > 0) {\n          var x0 = segs[i++];\n          var y0 = segs[i++];\n          for (var k = 1; k < count; k++) {\n            var x1 = segs[i++];\n            var y1 = segs[i++];\n            if (lineContain.containStroke(x0, y0, x1, y1, lineWidth, x, y)) {\n              return dataIndex;\n            }\n          }\n        }\n        dataIndex++;\n      }\n    } else {\n      var dataIndex = 0;\n      for (var i = 0; i < segs.length;) {\n        var x0 = segs[i++];\n        var y0 = segs[i++];\n        var x1 = segs[i++];\n        var y1 = segs[i++];\n        if (curveness > 0) {\n          var x2 = (x0 + x1) / 2 - (y0 - y1) * curveness;\n          var y2 = (y0 + y1) / 2 - (x1 - x0) * curveness;\n          if (quadraticContain.containStroke(x0, y0, x2, y2, x1, y1, lineWidth, x, y)) {\n            return dataIndex;\n          }\n        } else {\n          if (lineContain.containStroke(x0, y0, x1, y1, lineWidth, x, y)) {\n            return dataIndex;\n          }\n        }\n        dataIndex++;\n      }\n    }\n    return -1;\n  };\n  LargeLinesPath.prototype.contain = function (x, y) {\n    var localPos = this.transformCoordToLocal(x, y);\n    var rect = this.getBoundingRect();\n    x = localPos[0];\n    y = localPos[1];\n    if (rect.contain(x, y)) {\n      // Cache found data index.\n      var dataIdx = this.hoverDataIdx = this.findDataIndex(x, y);\n      return dataIdx >= 0;\n    }\n    this.hoverDataIdx = -1;\n    return false;\n  };\n  LargeLinesPath.prototype.getBoundingRect = function () {\n    // Ignore stroke for large symbol draw.\n    var rect = this._rect;\n    if (!rect) {\n      var shape = this.shape;\n      var points = shape.segs;\n      var minX = Infinity;\n      var minY = Infinity;\n      var maxX = -Infinity;\n      var maxY = -Infinity;\n      for (var i = 0; i < points.length;) {\n        var x = points[i++];\n        var y = points[i++];\n        minX = Math.min(x, minX);\n        maxX = Math.max(x, maxX);\n        minY = Math.min(y, minY);\n        maxY = Math.max(y, maxY);\n      }\n      rect = this._rect = new graphic.BoundingRect(minX, minY, maxX, maxY);\n    }\n    return rect;\n  };\n  return LargeLinesPath;\n}(graphic.Path);\nvar LargeLineDraw = /** @class */function () {\n  function LargeLineDraw() {\n    this.group = new graphic.Group();\n  }\n  /**\n   * Update symbols draw by new data\n   */\n  LargeLineDraw.prototype.updateData = function (data) {\n    this._clear();\n    var lineEl = this._create();\n    lineEl.setShape({\n      segs: data.getLayout('linesPoints')\n    });\n    this._setCommon(lineEl, data);\n  };\n  ;\n  /**\n   * @override\n   */\n  LargeLineDraw.prototype.incrementalPrepareUpdate = function (data) {\n    this.group.removeAll();\n    this._clear();\n  };\n  ;\n  /**\n   * @override\n   */\n  LargeLineDraw.prototype.incrementalUpdate = function (taskParams, data) {\n    var lastAdded = this._newAdded[0];\n    var linePoints = data.getLayout('linesPoints');\n    var oldSegs = lastAdded && lastAdded.shape.segs;\n    // Merging the exists. Each element has 1e4 points.\n    // Consider the performance balance between too much elements and too much points in one shape(may affect hover optimization)\n    if (oldSegs && oldSegs.length < 2e4) {\n      var oldLen = oldSegs.length;\n      var newSegs = new Float32Array(oldLen + linePoints.length);\n      // Concat two array\n      newSegs.set(oldSegs);\n      newSegs.set(linePoints, oldLen);\n      lastAdded.setShape({\n        segs: newSegs\n      });\n    } else {\n      // Clear\n      this._newAdded = [];\n      var lineEl = this._create();\n      lineEl.incremental = true;\n      lineEl.setShape({\n        segs: linePoints\n      });\n      this._setCommon(lineEl, data);\n      lineEl.__startIndex = taskParams.start;\n    }\n  };\n  /**\n   * @override\n   */\n  LargeLineDraw.prototype.remove = function () {\n    this._clear();\n  };\n  LargeLineDraw.prototype.eachRendered = function (cb) {\n    this._newAdded[0] && cb(this._newAdded[0]);\n  };\n  LargeLineDraw.prototype._create = function () {\n    var lineEl = new LargeLinesPath({\n      cursor: 'default',\n      ignoreCoarsePointer: true\n    });\n    this._newAdded.push(lineEl);\n    this.group.add(lineEl);\n    return lineEl;\n  };\n  LargeLineDraw.prototype._setCommon = function (lineEl, data, isIncremental) {\n    var hostModel = data.hostModel;\n    lineEl.setShape({\n      polyline: hostModel.get('polyline'),\n      curveness: hostModel.get(['lineStyle', 'curveness'])\n    });\n    lineEl.useStyle(hostModel.getModel('lineStyle').getLineStyle());\n    lineEl.style.strokeNoScale = true;\n    var style = data.getVisual('style');\n    if (style && style.stroke) {\n      lineEl.setStyle('stroke', style.stroke);\n    }\n    lineEl.setStyle('fill', null);\n    var ecData = getECData(lineEl);\n    // Enable tooltip\n    // PENDING May have performance issue when path is extremely large\n    ecData.seriesIndex = hostModel.seriesIndex;\n    lineEl.on('mousemove', function (e) {\n      ecData.dataIndex = null;\n      var dataIndex = lineEl.hoverDataIdx;\n      if (dataIndex > 0) {\n        // Provide dataIndex for tooltip\n        ecData.dataIndex = dataIndex + lineEl.__startIndex;\n      }\n    });\n  };\n  ;\n  LargeLineDraw.prototype._clear = function () {\n    this._newAdded = [];\n    this.group.removeAll();\n  };\n  ;\n  return LargeLineDraw;\n}();\nexport default LargeLineDraw;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n/* global Float32Array */\nimport createRenderPlanner from '../helper/createRenderPlanner.js';\nimport { error } from '../../util/log.js';\nvar linesLayout = {\n  seriesType: 'lines',\n  plan: createRenderPlanner(),\n  reset: function (seriesModel) {\n    var coordSys = seriesModel.coordinateSystem;\n    if (!coordSys) {\n      if (process.env.NODE_ENV !== 'production') {\n        error('The lines series must have a coordinate system.');\n      }\n      return;\n    }\n    var isPolyline = seriesModel.get('polyline');\n    var isLarge = seriesModel.pipelineContext.large;\n    return {\n      progress: function (params, lineData) {\n        var lineCoords = [];\n        if (isLarge) {\n          var points = void 0;\n          var segCount = params.end - params.start;\n          if (isPolyline) {\n            var totalCoordsCount = 0;\n            for (var i = params.start; i < params.end; i++) {\n              totalCoordsCount += seriesModel.getLineCoordsCount(i);\n            }\n            points = new Float32Array(segCount + totalCoordsCount * 2);\n          } else {\n            points = new Float32Array(segCount * 4);\n          }\n          var offset = 0;\n          var pt = [];\n          for (var i = params.start; i < params.end; i++) {\n            var len = seriesModel.getLineCoords(i, lineCoords);\n            if (isPolyline) {\n              points[offset++] = len;\n            }\n            for (var k = 0; k < len; k++) {\n              pt = coordSys.dataToPoint(lineCoords[k], false, pt);\n              points[offset++] = pt[0];\n              points[offset++] = pt[1];\n            }\n          }\n          lineData.setLayout('linesPoints', points);\n        } else {\n          for (var i = params.start; i < params.end; i++) {\n            var itemModel = lineData.getItemModel(i);\n            var len = seriesModel.getLineCoords(i, lineCoords);\n            var pts = [];\n            if (isPolyline) {\n              for (var j = 0; j < len; j++) {\n                pts.push(coordSys.dataToPoint(lineCoords[j]));\n              }\n            } else {\n              pts[0] = coordSys.dataToPoint(lineCoords[0]);\n              pts[1] = coordSys.dataToPoint(lineCoords[1]);\n              var curveness = itemModel.get(['lineStyle', 'curveness']);\n              if (+curveness) {\n                pts[2] = [(pts[0][0] + pts[1][0]) / 2 - (pts[0][1] - pts[1][1]) * curveness, (pts[0][1] + pts[1][1]) / 2 - (pts[1][0] - pts[0][0]) * curveness];\n              }\n            }\n            lineData.setItemLayout(i, pts);\n          }\n        }\n      }\n    };\n  }\n};\nexport default linesLayout;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport LineDraw from '../helper/LineDraw.js';\nimport EffectLine from '../helper/EffectLine.js';\nimport Line from '../helper/Line.js';\nimport Polyline from '../helper/Polyline.js';\nimport EffectPolyline from '../helper/EffectPolyline.js';\nimport LargeLineDraw from '../helper/LargeLineDraw.js';\nimport linesLayout from './linesLayout.js';\nimport { createClipPath } from '../helper/createClipPathFromCoordSys.js';\nimport ChartView from '../../view/Chart.js';\nvar LinesView = /** @class */function (_super) {\n  __extends(LinesView, _super);\n  function LinesView() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = LinesView.type;\n    return _this;\n  }\n  LinesView.prototype.render = function (seriesModel, ecModel, api) {\n    var data = seriesModel.getData();\n    var lineDraw = this._updateLineDraw(data, seriesModel);\n    var zlevel = seriesModel.get('zlevel');\n    var trailLength = seriesModel.get(['effect', 'trailLength']);\n    var zr = api.getZr();\n    // Avoid the drag cause ghost shadow\n    // FIXME Better way ?\n    // SVG doesn't support\n    var isSvg = zr.painter.getType() === 'svg';\n    if (!isSvg) {\n      zr.painter.getLayer(zlevel).clear(true);\n    }\n    // Config layer with motion blur\n    if (this._lastZlevel != null && !isSvg) {\n      zr.configLayer(this._lastZlevel, {\n        motionBlur: false\n      });\n    }\n    if (this._showEffect(seriesModel) && trailLength > 0) {\n      if (!isSvg) {\n        zr.configLayer(zlevel, {\n          motionBlur: true,\n          lastFrameAlpha: Math.max(Math.min(trailLength / 10 + 0.9, 1), 0)\n        });\n      } else if (process.env.NODE_ENV !== 'production') {\n        console.warn('SVG render mode doesn\\'t support lines with trail effect');\n      }\n    }\n    lineDraw.updateData(data);\n    var clipPath = seriesModel.get('clip', true) && createClipPath(seriesModel.coordinateSystem, false, seriesModel);\n    if (clipPath) {\n      this.group.setClipPath(clipPath);\n    } else {\n      this.group.removeClipPath();\n    }\n    this._lastZlevel = zlevel;\n    this._finished = true;\n  };\n  LinesView.prototype.incrementalPrepareRender = function (seriesModel, ecModel, api) {\n    var data = seriesModel.getData();\n    var lineDraw = this._updateLineDraw(data, seriesModel);\n    lineDraw.incrementalPrepareUpdate(data);\n    this._clearLayer(api);\n    this._finished = false;\n  };\n  LinesView.prototype.incrementalRender = function (taskParams, seriesModel, ecModel) {\n    this._lineDraw.incrementalUpdate(taskParams, seriesModel.getData());\n    this._finished = taskParams.end === seriesModel.getData().count();\n  };\n  LinesView.prototype.eachRendered = function (cb) {\n    this._lineDraw && this._lineDraw.eachRendered(cb);\n  };\n  LinesView.prototype.updateTransform = function (seriesModel, ecModel, api) {\n    var data = seriesModel.getData();\n    var pipelineContext = seriesModel.pipelineContext;\n    if (!this._finished || pipelineContext.large || pipelineContext.progressiveRender) {\n      // TODO Don't have to do update in large mode. Only do it when there are millions of data.\n      return {\n        update: true\n      };\n    } else {\n      // TODO Use same logic with ScatterView.\n      // Manually update layout\n      var res = linesLayout.reset(seriesModel, ecModel, api);\n      if (res.progress) {\n        res.progress({\n          start: 0,\n          end: data.count(),\n          count: data.count()\n        }, data);\n      }\n      // Not in large mode\n      this._lineDraw.updateLayout();\n      this._clearLayer(api);\n    }\n  };\n  LinesView.prototype._updateLineDraw = function (data, seriesModel) {\n    var lineDraw = this._lineDraw;\n    var hasEffect = this._showEffect(seriesModel);\n    var isPolyline = !!seriesModel.get('polyline');\n    var pipelineContext = seriesModel.pipelineContext;\n    var isLargeDraw = pipelineContext.large;\n    if (process.env.NODE_ENV !== 'production') {\n      if (hasEffect && isLargeDraw) {\n        console.warn('Large lines not support effect');\n      }\n    }\n    if (!lineDraw || hasEffect !== this._hasEffet || isPolyline !== this._isPolyline || isLargeDraw !== this._isLargeDraw) {\n      if (lineDraw) {\n        lineDraw.remove();\n      }\n      lineDraw = this._lineDraw = isLargeDraw ? new LargeLineDraw() : new LineDraw(isPolyline ? hasEffect ? EffectPolyline : Polyline : hasEffect ? EffectLine : Line);\n      this._hasEffet = hasEffect;\n      this._isPolyline = isPolyline;\n      this._isLargeDraw = isLargeDraw;\n    }\n    this.group.add(lineDraw.group);\n    return lineDraw;\n  };\n  LinesView.prototype._showEffect = function (seriesModel) {\n    return !!seriesModel.get(['effect', 'show']);\n  };\n  LinesView.prototype._clearLayer = function (api) {\n    // Not use motion when dragging or zooming\n    var zr = api.getZr();\n    var isSvg = zr.painter.getType() === 'svg';\n    if (!isSvg && this._lastZlevel != null) {\n      zr.painter.getLayer(this._lastZlevel).clear(true);\n    }\n  };\n  LinesView.prototype.remove = function (ecModel, api) {\n    this._lineDraw && this._lineDraw.remove();\n    this._lineDraw = null;\n    // Clear motion when lineDraw is removed\n    this._clearLayer(api);\n  };\n  LinesView.prototype.dispose = function (ecModel, api) {\n    this.remove(ecModel, api);\n  };\n  LinesView.type = 'lines';\n  return LinesView;\n}(ChartView);\nexport default LinesView;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\n/* global Uint32Array, Float64Array, Float32Array */\nimport SeriesModel from '../../model/Series.js';\nimport SeriesData from '../../data/SeriesData.js';\nimport { concatArray, mergeAll, map, isNumber } from 'zrender/lib/core/util.js';\nimport CoordinateSystem from '../../core/CoordinateSystem.js';\nimport { createTooltipMarkup } from '../../component/tooltip/tooltipMarkup.js';\nvar Uint32Arr = typeof Uint32Array === 'undefined' ? Array : Uint32Array;\nvar Float64Arr = typeof Float64Array === 'undefined' ? Array : Float64Array;\nfunction compatEc2(seriesOpt) {\n  var data = seriesOpt.data;\n  if (data && data[0] && data[0][0] && data[0][0].coord) {\n    if (process.env.NODE_ENV !== 'production') {\n      console.warn('Lines data configuration has been changed to' + ' { coords:[[1,2],[2,3]] }');\n    }\n    seriesOpt.data = map(data, function (itemOpt) {\n      var coords = [itemOpt[0].coord, itemOpt[1].coord];\n      var target = {\n        coords: coords\n      };\n      if (itemOpt[0].name) {\n        target.fromName = itemOpt[0].name;\n      }\n      if (itemOpt[1].name) {\n        target.toName = itemOpt[1].name;\n      }\n      return mergeAll([target, itemOpt[0], itemOpt[1]]);\n    });\n  }\n}\nvar LinesSeriesModel = /** @class */function (_super) {\n  __extends(LinesSeriesModel, _super);\n  function LinesSeriesModel() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = LinesSeriesModel.type;\n    _this.visualStyleAccessPath = 'lineStyle';\n    _this.visualDrawType = 'stroke';\n    return _this;\n  }\n  LinesSeriesModel.prototype.init = function (option) {\n    // The input data may be null/undefined.\n    option.data = option.data || [];\n    // Not using preprocessor because mergeOption may not have series.type\n    compatEc2(option);\n    var result = this._processFlatCoordsArray(option.data);\n    this._flatCoords = result.flatCoords;\n    this._flatCoordsOffset = result.flatCoordsOffset;\n    if (result.flatCoords) {\n      option.data = new Float32Array(result.count);\n    }\n    _super.prototype.init.apply(this, arguments);\n  };\n  LinesSeriesModel.prototype.mergeOption = function (option) {\n    compatEc2(option);\n    if (option.data) {\n      // Only update when have option data to merge.\n      var result = this._processFlatCoordsArray(option.data);\n      this._flatCoords = result.flatCoords;\n      this._flatCoordsOffset = result.flatCoordsOffset;\n      if (result.flatCoords) {\n        option.data = new Float32Array(result.count);\n      }\n    }\n    _super.prototype.mergeOption.apply(this, arguments);\n  };\n  LinesSeriesModel.prototype.appendData = function (params) {\n    var result = this._processFlatCoordsArray(params.data);\n    if (result.flatCoords) {\n      if (!this._flatCoords) {\n        this._flatCoords = result.flatCoords;\n        this._flatCoordsOffset = result.flatCoordsOffset;\n      } else {\n        this._flatCoords = concatArray(this._flatCoords, result.flatCoords);\n        this._flatCoordsOffset = concatArray(this._flatCoordsOffset, result.flatCoordsOffset);\n      }\n      params.data = new Float32Array(result.count);\n    }\n    this.getRawData().appendData(params.data);\n  };\n  LinesSeriesModel.prototype._getCoordsFromItemModel = function (idx) {\n    var itemModel = this.getData().getItemModel(idx);\n    var coords = itemModel.option instanceof Array ? itemModel.option : itemModel.getShallow('coords');\n    if (process.env.NODE_ENV !== 'production') {\n      if (!(coords instanceof Array && coords.length > 0 && coords[0] instanceof Array)) {\n        throw new Error('Invalid coords ' + JSON.stringify(coords) + '. Lines must have 2d coords array in data item.');\n      }\n    }\n    return coords;\n  };\n  LinesSeriesModel.prototype.getLineCoordsCount = function (idx) {\n    if (this._flatCoordsOffset) {\n      return this._flatCoordsOffset[idx * 2 + 1];\n    } else {\n      return this._getCoordsFromItemModel(idx).length;\n    }\n  };\n  LinesSeriesModel.prototype.getLineCoords = function (idx, out) {\n    if (this._flatCoordsOffset) {\n      var offset = this._flatCoordsOffset[idx * 2];\n      var len = this._flatCoordsOffset[idx * 2 + 1];\n      for (var i = 0; i < len; i++) {\n        out[i] = out[i] || [];\n        out[i][0] = this._flatCoords[offset + i * 2];\n        out[i][1] = this._flatCoords[offset + i * 2 + 1];\n      }\n      return len;\n    } else {\n      var coords = this._getCoordsFromItemModel(idx);\n      for (var i = 0; i < coords.length; i++) {\n        out[i] = out[i] || [];\n        out[i][0] = coords[i][0];\n        out[i][1] = coords[i][1];\n      }\n      return coords.length;\n    }\n  };\n  LinesSeriesModel.prototype._processFlatCoordsArray = function (data) {\n    var startOffset = 0;\n    if (this._flatCoords) {\n      startOffset = this._flatCoords.length;\n    }\n    // Stored as a typed array. In format\n    // Points Count(2) | x | y | x | y | Points Count(3) | x |  y | x | y | x | y |\n    if (isNumber(data[0])) {\n      var len = data.length;\n      // Store offset and len of each segment\n      var coordsOffsetAndLenStorage = new Uint32Arr(len);\n      var coordsStorage = new Float64Arr(len);\n      var coordsCursor = 0;\n      var offsetCursor = 0;\n      var dataCount = 0;\n      for (var i = 0; i < len;) {\n        dataCount++;\n        var count = data[i++];\n        // Offset\n        coordsOffsetAndLenStorage[offsetCursor++] = coordsCursor + startOffset;\n        // Len\n        coordsOffsetAndLenStorage[offsetCursor++] = count;\n        for (var k = 0; k < count; k++) {\n          var x = data[i++];\n          var y = data[i++];\n          coordsStorage[coordsCursor++] = x;\n          coordsStorage[coordsCursor++] = y;\n          if (i > len) {\n            if (process.env.NODE_ENV !== 'production') {\n              throw new Error('Invalid data format.');\n            }\n          }\n        }\n      }\n      return {\n        flatCoordsOffset: new Uint32Array(coordsOffsetAndLenStorage.buffer, 0, offsetCursor),\n        flatCoords: coordsStorage,\n        count: dataCount\n      };\n    }\n    return {\n      flatCoordsOffset: null,\n      flatCoords: null,\n      count: data.length\n    };\n  };\n  LinesSeriesModel.prototype.getInitialData = function (option, ecModel) {\n    if (process.env.NODE_ENV !== 'production') {\n      var CoordSys = CoordinateSystem.get(option.coordinateSystem);\n      if (!CoordSys) {\n        throw new Error('Unknown coordinate system ' + option.coordinateSystem);\n      }\n    }\n    var lineData = new SeriesData(['value'], this);\n    lineData.hasItemOption = false;\n    lineData.initData(option.data, [], function (dataItem, dimName, dataIndex, dimIndex) {\n      // dataItem is simply coords\n      if (dataItem instanceof Array) {\n        return NaN;\n      } else {\n        lineData.hasItemOption = true;\n        var value = dataItem.value;\n        if (value != null) {\n          return value instanceof Array ? value[dimIndex] : value;\n        }\n      }\n    });\n    return lineData;\n  };\n  LinesSeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\n    var data = this.getData();\n    var itemModel = data.getItemModel(dataIndex);\n    var name = itemModel.get('name');\n    if (name) {\n      return name;\n    }\n    var fromName = itemModel.get('fromName');\n    var toName = itemModel.get('toName');\n    var nameArr = [];\n    fromName != null && nameArr.push(fromName);\n    toName != null && nameArr.push(toName);\n    return createTooltipMarkup('nameValue', {\n      name: nameArr.join(' > ')\n    });\n  };\n  LinesSeriesModel.prototype.preventIncremental = function () {\n    return !!this.get(['effect', 'show']);\n  };\n  LinesSeriesModel.prototype.getProgressive = function () {\n    var progressive = this.option.progressive;\n    if (progressive == null) {\n      return this.option.large ? 1e4 : this.get('progressive');\n    }\n    return progressive;\n  };\n  LinesSeriesModel.prototype.getProgressiveThreshold = function () {\n    var progressiveThreshold = this.option.progressiveThreshold;\n    if (progressiveThreshold == null) {\n      return this.option.large ? 2e4 : this.get('progressiveThreshold');\n    }\n    return progressiveThreshold;\n  };\n  LinesSeriesModel.prototype.getZLevelKey = function () {\n    var effectModel = this.getModel('effect');\n    var trailLength = effectModel.get('trailLength');\n    return this.getData().count() > this.getProgressiveThreshold()\n    // Each progressive series has individual key.\n    ? this.id : effectModel.get('show') && trailLength > 0 ? trailLength + '' : '';\n  };\n  LinesSeriesModel.type = 'series.lines';\n  LinesSeriesModel.dependencies = ['grid', 'polar', 'geo', 'calendar'];\n  LinesSeriesModel.defaultOption = {\n    coordinateSystem: 'geo',\n    // zlevel: 0,\n    z: 2,\n    legendHoverLink: true,\n    // Cartesian coordinate system\n    xAxisIndex: 0,\n    yAxisIndex: 0,\n    symbol: ['none', 'none'],\n    symbolSize: [10, 10],\n    // Geo coordinate system\n    geoIndex: 0,\n    effect: {\n      show: false,\n      period: 4,\n      constantSpeed: 0,\n      symbol: 'circle',\n      symbolSize: 3,\n      loop: true,\n      trailLength: 0.2\n    },\n    large: false,\n    // Available when large is true\n    largeThreshold: 2000,\n    polyline: false,\n    clip: true,\n    label: {\n      show: false,\n      position: 'end'\n      // distance: 5,\n      // formatter: \u6807\u7B7E\u6587\u672C\u683C\u5F0F\u5668\uFF0C\u540CTooltip.formatter\uFF0C\u4E0D\u652F\u6301\u5F02\u6B65\u56DE\u8C03\n    },\n    lineStyle: {\n      opacity: 0.5\n    }\n  };\n  return LinesSeriesModel;\n}(SeriesModel);\nexport default LinesSeriesModel;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nfunction normalize(a) {\n  if (!(a instanceof Array)) {\n    a = [a, a];\n  }\n  return a;\n}\nvar linesVisual = {\n  seriesType: 'lines',\n  reset: function (seriesModel) {\n    var symbolType = normalize(seriesModel.get('symbol'));\n    var symbolSize = normalize(seriesModel.get('symbolSize'));\n    var data = seriesModel.getData();\n    data.setVisual('fromSymbol', symbolType && symbolType[0]);\n    data.setVisual('toSymbol', symbolType && symbolType[1]);\n    data.setVisual('fromSymbolSize', symbolSize && symbolSize[0]);\n    data.setVisual('toSymbolSize', symbolSize && symbolSize[1]);\n    function dataEach(data, idx) {\n      var itemModel = data.getItemModel(idx);\n      var symbolType = normalize(itemModel.getShallow('symbol', true));\n      var symbolSize = normalize(itemModel.getShallow('symbolSize', true));\n      symbolType[0] && data.setItemVisual(idx, 'fromSymbol', symbolType[0]);\n      symbolType[1] && data.setItemVisual(idx, 'toSymbol', symbolType[1]);\n      symbolSize[0] && data.setItemVisual(idx, 'fromSymbolSize', symbolSize[0]);\n      symbolSize[1] && data.setItemVisual(idx, 'toSymbolSize', symbolSize[1]);\n    }\n    return {\n      dataEach: data.hasItemOption ? dataEach : null\n    };\n  }\n};\nexport default linesVisual;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport LinesView from './LinesView.js';\nimport LinesSeriesModel from './LinesSeries.js';\nimport linesLayout from './linesLayout.js';\nimport linesVisual from './linesVisual.js';\nexport function install(registers) {\n  registers.registerChartView(LinesView);\n  registers.registerSeriesModel(LinesSeriesModel);\n  registers.registerLayout(linesLayout);\n  registers.registerVisual(linesVisual);\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n/* global Uint8ClampedArray */\nimport { platformApi } from 'zrender/lib/core/platform.js';\nimport tokens from '../../visual/tokens.js';\nvar GRADIENT_LEVELS = 256;\nvar HeatmapLayer = /** @class */function () {\n  function HeatmapLayer() {\n    this.blurSize = 30;\n    this.pointSize = 20;\n    this.maxOpacity = 1;\n    this.minOpacity = 0;\n    this._gradientPixels = {\n      inRange: null,\n      outOfRange: null\n    };\n    var canvas = platformApi.createCanvas();\n    this.canvas = canvas;\n  }\n  /**\n   * Renders Heatmap and returns the rendered canvas\n   * @param data array of data, each has x, y, value\n   * @param width canvas width\n   * @param height canvas height\n   */\n  HeatmapLayer.prototype.update = function (data, width, height, normalize, colorFunc, isInRange) {\n    var brush = this._getBrush();\n    var gradientInRange = this._getGradient(colorFunc, 'inRange');\n    var gradientOutOfRange = this._getGradient(colorFunc, 'outOfRange');\n    var r = this.pointSize + this.blurSize;\n    var canvas = this.canvas;\n    var ctx = canvas.getContext('2d');\n    var len = data.length;\n    canvas.width = width;\n    canvas.height = height;\n    for (var i = 0; i < len; ++i) {\n      var p = data[i];\n      var x = p[0];\n      var y = p[1];\n      var value = p[2];\n      // calculate alpha using value\n      var alpha = normalize(value);\n      // draw with the circle brush with alpha\n      ctx.globalAlpha = alpha;\n      ctx.drawImage(brush, x - r, y - r);\n    }\n    if (!canvas.width || !canvas.height) {\n      // Avoid \"Uncaught DOMException: Failed to execute 'getImageData' on\n      // 'CanvasRenderingContext2D': The source height is 0.\"\n      return canvas;\n    }\n    // colorize the canvas using alpha value and set with gradient\n    var imageData = ctx.getImageData(0, 0, canvas.width, canvas.height);\n    var pixels = imageData.data;\n    var offset = 0;\n    var pixelLen = pixels.length;\n    var minOpacity = this.minOpacity;\n    var maxOpacity = this.maxOpacity;\n    var diffOpacity = maxOpacity - minOpacity;\n    while (offset < pixelLen) {\n      var alpha = pixels[offset + 3] / 256;\n      var gradientOffset = Math.floor(alpha * (GRADIENT_LEVELS - 1)) * 4;\n      // Simple optimize to ignore the empty data\n      if (alpha > 0) {\n        var gradient = isInRange(alpha) ? gradientInRange : gradientOutOfRange;\n        // Any alpha > 0 will be mapped to [minOpacity, maxOpacity]\n        alpha > 0 && (alpha = alpha * diffOpacity + minOpacity);\n        pixels[offset++] = gradient[gradientOffset];\n        pixels[offset++] = gradient[gradientOffset + 1];\n        pixels[offset++] = gradient[gradientOffset + 2];\n        pixels[offset++] = gradient[gradientOffset + 3] * alpha * 256;\n      } else {\n        offset += 4;\n      }\n    }\n    ctx.putImageData(imageData, 0, 0);\n    return canvas;\n  };\n  /**\n   * get canvas of a black circle brush used for canvas to draw later\n   */\n  HeatmapLayer.prototype._getBrush = function () {\n    var brushCanvas = this._brushCanvas || (this._brushCanvas = platformApi.createCanvas());\n    // set brush size\n    var r = this.pointSize + this.blurSize;\n    var d = r * 2;\n    brushCanvas.width = d;\n    brushCanvas.height = d;\n    var ctx = brushCanvas.getContext('2d');\n    ctx.clearRect(0, 0, d, d);\n    // in order to render shadow without the distinct circle,\n    // draw the distinct circle in an invisible place,\n    // and use shadowOffset to draw shadow in the center of the canvas\n    ctx.shadowOffsetX = d;\n    ctx.shadowBlur = this.blurSize;\n    // draw the shadow in black, and use alpha and shadow blur to generate\n    // color in color map\n    ctx.shadowColor = tokens.color.neutral99;\n    // draw circle in the left to the canvas\n    ctx.beginPath();\n    ctx.arc(-r, r, this.pointSize, 0, Math.PI * 2, true);\n    ctx.closePath();\n    ctx.fill();\n    return brushCanvas;\n  };\n  /**\n   * get gradient color map\n   * @private\n   */\n  HeatmapLayer.prototype._getGradient = function (colorFunc, state) {\n    var gradientPixels = this._gradientPixels;\n    var pixelsSingleState = gradientPixels[state] || (gradientPixels[state] = new Uint8ClampedArray(256 * 4));\n    var color = [0, 0, 0, 0];\n    var off = 0;\n    for (var i = 0; i < 256; i++) {\n      colorFunc[state](i / 255, true, color);\n      pixelsSingleState[off++] = color[0];\n      pixelsSingleState[off++] = color[1];\n      pixelsSingleState[off++] = color[2];\n      pixelsSingleState[off++] = color[3];\n    }\n    return pixelsSingleState;\n  };\n  return HeatmapLayer;\n}();\nexport default HeatmapLayer;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as graphic from '../../util/graphic.js';\nimport { toggleHoverEmphasis } from '../../util/states.js';\nimport HeatmapLayer from './HeatmapLayer.js';\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport ChartView from '../../view/Chart.js';\nimport { isCoordinateSystemType } from '../../coord/CoordinateSystem.js';\nimport { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle.js';\nfunction getIsInPiecewiseRange(dataExtent, pieceList, selected) {\n  var dataSpan = dataExtent[1] - dataExtent[0];\n  pieceList = zrUtil.map(pieceList, function (piece) {\n    return {\n      interval: [(piece.interval[0] - dataExtent[0]) / dataSpan, (piece.interval[1] - dataExtent[0]) / dataSpan]\n    };\n  });\n  var len = pieceList.length;\n  var lastIndex = 0;\n  return function (val) {\n    var i;\n    // Try to find in the location of the last found\n    for (i = lastIndex; i < len; i++) {\n      var interval = pieceList[i].interval;\n      if (interval[0] <= val && val <= interval[1]) {\n        lastIndex = i;\n        break;\n      }\n    }\n    if (i === len) {\n      // Not found, back interation\n      for (i = lastIndex - 1; i >= 0; i--) {\n        var interval = pieceList[i].interval;\n        if (interval[0] <= val && val <= interval[1]) {\n          lastIndex = i;\n          break;\n        }\n      }\n    }\n    return i >= 0 && i < len && selected[i];\n  };\n}\nfunction getIsInContinuousRange(dataExtent, range) {\n  var dataSpan = dataExtent[1] - dataExtent[0];\n  range = [(range[0] - dataExtent[0]) / dataSpan, (range[1] - dataExtent[0]) / dataSpan];\n  return function (val) {\n    return val >= range[0] && val <= range[1];\n  };\n}\nfunction isGeoCoordSys(coordSys) {\n  var dimensions = coordSys.dimensions;\n  // Not use coordSys.type === 'geo' because coordSys maybe extended\n  return dimensions[0] === 'lng' && dimensions[1] === 'lat';\n}\nvar HeatmapView = /** @class */function (_super) {\n  __extends(HeatmapView, _super);\n  function HeatmapView() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = HeatmapView.type;\n    return _this;\n  }\n  HeatmapView.prototype.render = function (seriesModel, ecModel, api) {\n    var visualMapOfThisSeries;\n    ecModel.eachComponent('visualMap', function (visualMap) {\n      visualMap.eachTargetSeries(function (targetSeries) {\n        if (targetSeries === seriesModel) {\n          visualMapOfThisSeries = visualMap;\n        }\n      });\n    });\n    if (process.env.NODE_ENV !== 'production') {\n      if (!visualMapOfThisSeries) {\n        throw new Error('Heatmap must use with visualMap');\n      }\n    }\n    // Clear previously rendered progressive elements.\n    this._progressiveEls = null;\n    this.group.removeAll();\n    var coordSys = seriesModel.coordinateSystem;\n    if (coordSys.type === 'cartesian2d' || coordSys.type === 'calendar' || coordSys.type === 'matrix') {\n      this._renderOnGridLike(seriesModel, api, 0, seriesModel.getData().count());\n    } else if (isGeoCoordSys(coordSys)) {\n      this._renderOnGeo(coordSys, seriesModel, visualMapOfThisSeries, api);\n    }\n  };\n  HeatmapView.prototype.incrementalPrepareRender = function (seriesModel, ecModel, api) {\n    this.group.removeAll();\n  };\n  HeatmapView.prototype.incrementalRender = function (params, seriesModel, ecModel, api) {\n    var coordSys = seriesModel.coordinateSystem;\n    if (coordSys) {\n      // geo does not support incremental rendering?\n      if (isGeoCoordSys(coordSys)) {\n        this.render(seriesModel, ecModel, api);\n      } else {\n        this._progressiveEls = [];\n        this._renderOnGridLike(seriesModel, api, params.start, params.end, true);\n      }\n    }\n  };\n  HeatmapView.prototype.eachRendered = function (cb) {\n    graphic.traverseElements(this._progressiveEls || this.group, cb);\n  };\n  HeatmapView.prototype._renderOnGridLike = function (seriesModel, api, start, end, incremental) {\n    var coordSys = seriesModel.coordinateSystem;\n    var isCartesian2d = isCoordinateSystemType(coordSys, 'cartesian2d');\n    var isMatrix = isCoordinateSystemType(coordSys, 'matrix');\n    var width;\n    var height;\n    var xAxisExtent;\n    var yAxisExtent;\n    if (isCartesian2d) {\n      var xAxis = coordSys.getAxis('x');\n      var yAxis = coordSys.getAxis('y');\n      if (process.env.NODE_ENV !== 'production') {\n        if (!(xAxis.type === 'category' && yAxis.type === 'category')) {\n          throw new Error('Heatmap on cartesian must have two category axes');\n        }\n        if (!(xAxis.onBand && yAxis.onBand)) {\n          throw new Error('Heatmap on cartesian must have two axes with boundaryGap true');\n        }\n      }\n      // add 0.5px to avoid the gaps\n      width = xAxis.getBandWidth() + .5;\n      height = yAxis.getBandWidth() + .5;\n      xAxisExtent = xAxis.scale.getExtent();\n      yAxisExtent = yAxis.scale.getExtent();\n    }\n    var group = this.group;\n    var data = seriesModel.getData();\n    var emphasisStyle = seriesModel.getModel(['emphasis', 'itemStyle']).getItemStyle();\n    var blurStyle = seriesModel.getModel(['blur', 'itemStyle']).getItemStyle();\n    var selectStyle = seriesModel.getModel(['select', 'itemStyle']).getItemStyle();\n    var borderRadius = seriesModel.get(['itemStyle', 'borderRadius']);\n    var labelStatesModels = getLabelStatesModels(seriesModel);\n    var emphasisModel = seriesModel.getModel('emphasis');\n    var focus = emphasisModel.get('focus');\n    var blurScope = emphasisModel.get('blurScope');\n    var emphasisDisabled = emphasisModel.get('disabled');\n    var dataDims = isCartesian2d || isMatrix ? [data.mapDimension('x'), data.mapDimension('y'), data.mapDimension('value')] : [data.mapDimension('time'), data.mapDimension('value')];\n    for (var idx = start; idx < end; idx++) {\n      var rect = void 0;\n      var style = data.getItemVisual(idx, 'style');\n      if (isCartesian2d) {\n        var dataDimX = data.get(dataDims[0], idx);\n        var dataDimY = data.get(dataDims[1], idx);\n        // Ignore empty data and out of extent data\n        if (isNaN(data.get(dataDims[2], idx)) || isNaN(dataDimX) || isNaN(dataDimY) || dataDimX < xAxisExtent[0] || dataDimX > xAxisExtent[1] || dataDimY < yAxisExtent[0] || dataDimY > yAxisExtent[1]) {\n          continue;\n        }\n        var point = coordSys.dataToPoint([dataDimX, dataDimY]);\n        rect = new graphic.Rect({\n          shape: {\n            x: point[0] - width / 2,\n            y: point[1] - height / 2,\n            width: width,\n            height: height\n          },\n          style: style\n        });\n      } else if (isMatrix) {\n        var shape = coordSys.dataToLayout([data.get(dataDims[0], idx), data.get(dataDims[1], idx)]).rect;\n        if (zrUtil.eqNaN(shape.x)) {\n          continue;\n        }\n        rect = new graphic.Rect({\n          z2: 1,\n          shape: shape,\n          style: style\n        });\n      } else {\n        // Calendar\n        // Ignore empty data\n        if (isNaN(data.get(dataDims[1], idx))) {\n          continue;\n        }\n        var layout = coordSys.dataToLayout([data.get(dataDims[0], idx)]);\n        var shape = layout.contentRect || layout.rect;\n        if (zrUtil.eqNaN(shape.x) || zrUtil.eqNaN(shape.y)) {\n          continue;\n        }\n        rect = new graphic.Rect({\n          z2: 1,\n          shape: shape,\n          style: style\n        });\n      }\n      // Optimization for large dataset\n      if (data.hasItemOption) {\n        var itemModel = data.getItemModel(idx);\n        var emphasisModel_1 = itemModel.getModel('emphasis');\n        emphasisStyle = emphasisModel_1.getModel('itemStyle').getItemStyle();\n        blurStyle = itemModel.getModel(['blur', 'itemStyle']).getItemStyle();\n        selectStyle = itemModel.getModel(['select', 'itemStyle']).getItemStyle();\n        // Each item value struct in the data would be firstly\n        // {\n        //     itemStyle: { borderRadius: [30, 30] },\n        //     value: [2022, 02, 22]\n        // }\n        borderRadius = itemModel.get(['itemStyle', 'borderRadius']);\n        focus = emphasisModel_1.get('focus');\n        blurScope = emphasisModel_1.get('blurScope');\n        emphasisDisabled = emphasisModel_1.get('disabled');\n        labelStatesModels = getLabelStatesModels(itemModel);\n      }\n      rect.shape.r = borderRadius;\n      var rawValue = seriesModel.getRawValue(idx);\n      var defaultText = '-';\n      if (rawValue && rawValue[2] != null) {\n        defaultText = rawValue[2] + '';\n      }\n      setLabelStyle(rect, labelStatesModels, {\n        labelFetcher: seriesModel,\n        labelDataIndex: idx,\n        defaultOpacity: style.opacity,\n        defaultText: defaultText\n      });\n      rect.ensureState('emphasis').style = emphasisStyle;\n      rect.ensureState('blur').style = blurStyle;\n      rect.ensureState('select').style = selectStyle;\n      toggleHoverEmphasis(rect, focus, blurScope, emphasisDisabled);\n      rect.incremental = incremental;\n      // PENDING\n      if (incremental) {\n        // Rect must use hover layer if it's incremental.\n        rect.states.emphasis.hoverLayer = true;\n      }\n      group.add(rect);\n      data.setItemGraphicEl(idx, rect);\n      if (this._progressiveEls) {\n        this._progressiveEls.push(rect);\n      }\n    }\n  };\n  HeatmapView.prototype._renderOnGeo = function (geo, seriesModel, visualMapModel, api) {\n    var inRangeVisuals = visualMapModel.targetVisuals.inRange;\n    var outOfRangeVisuals = visualMapModel.targetVisuals.outOfRange;\n    // if (!visualMapping) {\n    //     throw new Error('Data range must have color visuals');\n    // }\n    var data = seriesModel.getData();\n    var hmLayer = this._hmLayer || this._hmLayer || new HeatmapLayer();\n    hmLayer.blurSize = seriesModel.get('blurSize');\n    hmLayer.pointSize = seriesModel.get('pointSize');\n    hmLayer.minOpacity = seriesModel.get('minOpacity');\n    hmLayer.maxOpacity = seriesModel.get('maxOpacity');\n    var rect = geo.getViewRect().clone();\n    var roamTransform = geo.getRoamTransform();\n    rect.applyTransform(roamTransform);\n    // Clamp on viewport\n    var x = Math.max(rect.x, 0);\n    var y = Math.max(rect.y, 0);\n    var x2 = Math.min(rect.width + rect.x, api.getWidth());\n    var y2 = Math.min(rect.height + rect.y, api.getHeight());\n    var width = x2 - x;\n    var height = y2 - y;\n    var dims = [data.mapDimension('lng'), data.mapDimension('lat'), data.mapDimension('value')];\n    var points = data.mapArray(dims, function (lng, lat, value) {\n      var pt = geo.dataToPoint([lng, lat]);\n      pt[0] -= x;\n      pt[1] -= y;\n      pt.push(value);\n      return pt;\n    });\n    var dataExtent = visualMapModel.getExtent();\n    var isInRange = visualMapModel.type === 'visualMap.continuous' ? getIsInContinuousRange(dataExtent, visualMapModel.option.range) : getIsInPiecewiseRange(dataExtent, visualMapModel.getPieceList(), visualMapModel.option.selected);\n    hmLayer.update(points, width, height, inRangeVisuals.color.getNormalizer(), {\n      inRange: inRangeVisuals.color.getColorMapper(),\n      outOfRange: outOfRangeVisuals.color.getColorMapper()\n    }, isInRange);\n    var img = new graphic.Image({\n      style: {\n        width: width,\n        height: height,\n        x: x,\n        y: y,\n        image: hmLayer.canvas\n      },\n      silent: true\n    });\n    this.group.add(img);\n  };\n  HeatmapView.type = 'heatmap';\n  return HeatmapView;\n}(ChartView);\nexport default HeatmapView;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport SeriesModel from '../../model/Series.js';\nimport createSeriesData from '../helper/createSeriesData.js';\nimport CoordinateSystem from '../../core/CoordinateSystem.js';\nimport tokens from '../../visual/tokens.js';\nvar HeatmapSeriesModel = /** @class */function (_super) {\n  __extends(HeatmapSeriesModel, _super);\n  function HeatmapSeriesModel() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = HeatmapSeriesModel.type;\n    return _this;\n  }\n  HeatmapSeriesModel.prototype.getInitialData = function (option, ecModel) {\n    return createSeriesData(null, this, {\n      generateCoord: 'value'\n    });\n  };\n  HeatmapSeriesModel.prototype.preventIncremental = function () {\n    var coordSysCreator = CoordinateSystem.get(this.get('coordinateSystem'));\n    if (coordSysCreator && coordSysCreator.dimensions) {\n      return coordSysCreator.dimensions[0] === 'lng' && coordSysCreator.dimensions[1] === 'lat';\n    }\n  };\n  HeatmapSeriesModel.type = 'series.heatmap';\n  HeatmapSeriesModel.dependencies = ['grid', 'geo', 'calendar', 'matrix'];\n  HeatmapSeriesModel.defaultOption = {\n    coordinateSystem: 'cartesian2d',\n    // zlevel: 0,\n    z: 2,\n    // Cartesian coordinate system\n    // xAxisIndex: 0,\n    // yAxisIndex: 0,\n    // Geo coordinate system\n    geoIndex: 0,\n    blurSize: 30,\n    pointSize: 20,\n    maxOpacity: 1,\n    minOpacity: 0,\n    select: {\n      itemStyle: {\n        borderColor: tokens.color.primary\n      }\n    }\n  };\n  return HeatmapSeriesModel;\n}(SeriesModel);\nexport default HeatmapSeriesModel;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport HeatmapView from './HeatmapView.js';\nimport HeatmapSeriesModel from './HeatmapSeries.js';\nexport function install(registers) {\n  registers.registerChartView(HeatmapView);\n  registers.registerSeriesModel(HeatmapSeriesModel);\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as graphic from '../../util/graphic.js';\nimport { toggleHoverEmphasis } from '../../util/states.js';\nimport { createSymbol, normalizeSymbolOffset } from '../../util/symbol.js';\nimport { parsePercent, isNumeric } from '../../util/number.js';\nimport ChartView from '../../view/Chart.js';\nimport { getDefaultLabel } from '../helper/labelHelper.js';\nimport { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle.js';\nimport ZRImage from 'zrender/lib/graphic/Image.js';\nimport { getECData } from '../../util/innerStore.js';\nimport { createClipPath } from '../helper/createClipPathFromCoordSys.js';\nvar BAR_BORDER_WIDTH_QUERY = ['itemStyle', 'borderWidth'];\n// index: +isHorizontal\nvar LAYOUT_ATTRS = [{\n  xy: 'x',\n  wh: 'width',\n  index: 0,\n  posDesc: ['left', 'right']\n}, {\n  xy: 'y',\n  wh: 'height',\n  index: 1,\n  posDesc: ['top', 'bottom']\n}];\nvar pathForLineWidth = new graphic.Circle();\nvar PictorialBarView = /** @class */function (_super) {\n  __extends(PictorialBarView, _super);\n  function PictorialBarView() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = PictorialBarView.type;\n    return _this;\n  }\n  PictorialBarView.prototype.render = function (seriesModel, ecModel, api) {\n    var group = this.group;\n    var data = seriesModel.getData();\n    var oldData = this._data;\n    var cartesian = seriesModel.coordinateSystem;\n    var baseAxis = cartesian.getBaseAxis();\n    var isHorizontal = baseAxis.isHorizontal();\n    var coordSysRect = cartesian.master.getRect();\n    var opt = {\n      ecSize: {\n        width: api.getWidth(),\n        height: api.getHeight()\n      },\n      seriesModel: seriesModel,\n      coordSys: cartesian,\n      coordSysExtent: [[coordSysRect.x, coordSysRect.x + coordSysRect.width], [coordSysRect.y, coordSysRect.y + coordSysRect.height]],\n      isHorizontal: isHorizontal,\n      valueDim: LAYOUT_ATTRS[+isHorizontal],\n      categoryDim: LAYOUT_ATTRS[1 - +isHorizontal]\n    };\n    data.diff(oldData).add(function (dataIndex) {\n      if (!data.hasValue(dataIndex)) {\n        return;\n      }\n      var itemModel = getItemModel(data, dataIndex);\n      var symbolMeta = getSymbolMeta(data, dataIndex, itemModel, opt);\n      var bar = createBar(data, opt, symbolMeta);\n      data.setItemGraphicEl(dataIndex, bar);\n      group.add(bar);\n      updateCommon(bar, opt, symbolMeta);\n    }).update(function (newIndex, oldIndex) {\n      var bar = oldData.getItemGraphicEl(oldIndex);\n      if (!data.hasValue(newIndex)) {\n        group.remove(bar);\n        return;\n      }\n      var itemModel = getItemModel(data, newIndex);\n      var symbolMeta = getSymbolMeta(data, newIndex, itemModel, opt);\n      var pictorialShapeStr = getShapeStr(data, symbolMeta);\n      if (bar && pictorialShapeStr !== bar.__pictorialShapeStr) {\n        group.remove(bar);\n        data.setItemGraphicEl(newIndex, null);\n        bar = null;\n      }\n      if (bar) {\n        updateBar(bar, opt, symbolMeta);\n      } else {\n        bar = createBar(data, opt, symbolMeta, true);\n      }\n      data.setItemGraphicEl(newIndex, bar);\n      bar.__pictorialSymbolMeta = symbolMeta;\n      // Add back\n      group.add(bar);\n      updateCommon(bar, opt, symbolMeta);\n    }).remove(function (dataIndex) {\n      var bar = oldData.getItemGraphicEl(dataIndex);\n      bar && removeBar(oldData, dataIndex, bar.__pictorialSymbolMeta.animationModel, bar);\n    }).execute();\n    // Do clipping\n    var clipPath = seriesModel.get('clip', true) ? createClipPath(seriesModel.coordinateSystem, false, seriesModel) : null;\n    if (clipPath) {\n      group.setClipPath(clipPath);\n    } else {\n      group.removeClipPath();\n    }\n    this._data = data;\n    return this.group;\n  };\n  PictorialBarView.prototype.remove = function (ecModel, api) {\n    var group = this.group;\n    var data = this._data;\n    if (ecModel.get('animation')) {\n      if (data) {\n        data.eachItemGraphicEl(function (bar) {\n          removeBar(data, getECData(bar).dataIndex, ecModel, bar);\n        });\n      }\n    } else {\n      group.removeAll();\n    }\n  };\n  PictorialBarView.type = 'pictorialBar';\n  return PictorialBarView;\n}(ChartView);\n// Set or calculate default value about symbol, and calculate layout info.\nfunction getSymbolMeta(data, dataIndex, itemModel, opt) {\n  var layout = data.getItemLayout(dataIndex);\n  var symbolRepeat = itemModel.get('symbolRepeat');\n  var symbolClip = itemModel.get('symbolClip');\n  var symbolPosition = itemModel.get('symbolPosition') || 'start';\n  var symbolRotate = itemModel.get('symbolRotate');\n  var rotation = (symbolRotate || 0) * Math.PI / 180 || 0;\n  var symbolPatternSize = itemModel.get('symbolPatternSize') || 2;\n  var isAnimationEnabled = itemModel.isAnimationEnabled();\n  var symbolMeta = {\n    dataIndex: dataIndex,\n    layout: layout,\n    itemModel: itemModel,\n    symbolType: data.getItemVisual(dataIndex, 'symbol') || 'circle',\n    style: data.getItemVisual(dataIndex, 'style'),\n    symbolClip: symbolClip,\n    symbolRepeat: symbolRepeat,\n    symbolRepeatDirection: itemModel.get('symbolRepeatDirection'),\n    symbolPatternSize: symbolPatternSize,\n    rotation: rotation,\n    animationModel: isAnimationEnabled ? itemModel : null,\n    hoverScale: isAnimationEnabled && itemModel.get(['emphasis', 'scale']),\n    z2: itemModel.getShallow('z', true) || 0\n  };\n  prepareBarLength(itemModel, symbolRepeat, layout, opt, symbolMeta);\n  prepareSymbolSize(data, dataIndex, layout, symbolRepeat, symbolClip, symbolMeta.boundingLength, symbolMeta.pxSign, symbolPatternSize, opt, symbolMeta);\n  prepareLineWidth(itemModel, symbolMeta.symbolScale, rotation, opt, symbolMeta);\n  var symbolSize = symbolMeta.symbolSize;\n  var symbolOffset = normalizeSymbolOffset(itemModel.get('symbolOffset'), symbolSize);\n  prepareLayoutInfo(itemModel, symbolSize, layout, symbolRepeat, symbolClip, symbolOffset, symbolPosition, symbolMeta.valueLineWidth, symbolMeta.boundingLength, symbolMeta.repeatCutLength, opt, symbolMeta);\n  return symbolMeta;\n}\n// bar length can be negative.\nfunction prepareBarLength(itemModel, symbolRepeat, layout, opt, outputSymbolMeta) {\n  var valueDim = opt.valueDim;\n  var symbolBoundingData = itemModel.get('symbolBoundingData');\n  var valueAxis = opt.coordSys.getOtherAxis(opt.coordSys.getBaseAxis());\n  var zeroPx = valueAxis.toGlobalCoord(valueAxis.dataToCoord(0));\n  var pxSignIdx = 1 - +(layout[valueDim.wh] <= 0);\n  var boundingLength;\n  if (zrUtil.isArray(symbolBoundingData)) {\n    var symbolBoundingExtent = [convertToCoordOnAxis(valueAxis, symbolBoundingData[0]) - zeroPx, convertToCoordOnAxis(valueAxis, symbolBoundingData[1]) - zeroPx];\n    symbolBoundingExtent[1] < symbolBoundingExtent[0] && symbolBoundingExtent.reverse();\n    boundingLength = symbolBoundingExtent[pxSignIdx];\n  } else if (symbolBoundingData != null) {\n    boundingLength = convertToCoordOnAxis(valueAxis, symbolBoundingData) - zeroPx;\n  } else if (symbolRepeat) {\n    boundingLength = opt.coordSysExtent[valueDim.index][pxSignIdx] - zeroPx;\n  } else {\n    boundingLength = layout[valueDim.wh];\n  }\n  outputSymbolMeta.boundingLength = boundingLength;\n  if (symbolRepeat) {\n    outputSymbolMeta.repeatCutLength = layout[valueDim.wh];\n  }\n  // if 'pxSign' means sign of pixel,  it can't be zero, or symbolScale will be zero\n  // and when borderWidth be settled, the actual linewidth will be NaN\n  var isXAxis = valueDim.xy === 'x';\n  var isInverse = valueAxis.inverse;\n  outputSymbolMeta.pxSign = isXAxis && !isInverse || !isXAxis && isInverse ? boundingLength >= 0 ? 1 : -1 : boundingLength > 0 ? 1 : -1;\n}\nfunction convertToCoordOnAxis(axis, value) {\n  return axis.toGlobalCoord(axis.dataToCoord(axis.scale.parse(value)));\n}\n// Support ['100%', '100%']\nfunction prepareSymbolSize(data, dataIndex, layout, symbolRepeat, symbolClip, boundingLength, pxSign, symbolPatternSize, opt, outputSymbolMeta) {\n  var valueDim = opt.valueDim;\n  var categoryDim = opt.categoryDim;\n  var categorySize = Math.abs(layout[categoryDim.wh]);\n  var symbolSize = data.getItemVisual(dataIndex, 'symbolSize');\n  var parsedSymbolSize;\n  if (zrUtil.isArray(symbolSize)) {\n    parsedSymbolSize = symbolSize.slice();\n  } else {\n    if (symbolSize == null) {\n      // will parse to number below\n      parsedSymbolSize = ['100%', '100%'];\n    } else {\n      parsedSymbolSize = [symbolSize, symbolSize];\n    }\n  }\n  // Note: percentage symbolSize (like '100%') do not consider lineWidth, because it is\n  // to complicated to calculate real percent value if considering scaled lineWidth.\n  // So the actual size will bigger than layout size if lineWidth is bigger than zero,\n  // which can be tolerated in pictorial chart.\n  parsedSymbolSize[categoryDim.index] = parsePercent(parsedSymbolSize[categoryDim.index], categorySize);\n  parsedSymbolSize[valueDim.index] = parsePercent(parsedSymbolSize[valueDim.index], symbolRepeat ? categorySize : Math.abs(boundingLength));\n  outputSymbolMeta.symbolSize = parsedSymbolSize;\n  // If x or y is less than zero, show reversed shape.\n  var symbolScale = outputSymbolMeta.symbolScale = [parsedSymbolSize[0] / symbolPatternSize, parsedSymbolSize[1] / symbolPatternSize];\n  // Follow convention, 'right' and 'top' is the normal scale.\n  symbolScale[valueDim.index] *= (opt.isHorizontal ? -1 : 1) * pxSign;\n}\nfunction prepareLineWidth(itemModel, symbolScale, rotation, opt, outputSymbolMeta) {\n  // In symbols are drawn with scale, so do not need to care about the case that width\n  // or height are too small. But symbol use strokeNoScale, where acture lineWidth should\n  // be calculated.\n  var valueLineWidth = itemModel.get(BAR_BORDER_WIDTH_QUERY) || 0;\n  if (valueLineWidth) {\n    pathForLineWidth.attr({\n      scaleX: symbolScale[0],\n      scaleY: symbolScale[1],\n      rotation: rotation\n    });\n    pathForLineWidth.updateTransform();\n    valueLineWidth /= pathForLineWidth.getLineScale();\n    valueLineWidth *= symbolScale[opt.valueDim.index];\n  }\n  outputSymbolMeta.valueLineWidth = valueLineWidth || 0;\n}\nfunction prepareLayoutInfo(itemModel, symbolSize, layout, symbolRepeat, symbolClip, symbolOffset, symbolPosition, valueLineWidth, boundingLength, repeatCutLength, opt, outputSymbolMeta) {\n  var categoryDim = opt.categoryDim;\n  var valueDim = opt.valueDim;\n  var pxSign = outputSymbolMeta.pxSign;\n  var unitLength = Math.max(symbolSize[valueDim.index] + valueLineWidth, 0);\n  var pathLen = unitLength;\n  // Note: rotation will not effect the layout of symbols, because user may\n  // want symbols to rotate on its center, which should not be translated\n  // when rotating.\n  if (symbolRepeat) {\n    var absBoundingLength = Math.abs(boundingLength);\n    var symbolMargin = zrUtil.retrieve(itemModel.get('symbolMargin'), '15%') + '';\n    var hasEndGap = false;\n    if (symbolMargin.lastIndexOf('!') === symbolMargin.length - 1) {\n      hasEndGap = true;\n      symbolMargin = symbolMargin.slice(0, symbolMargin.length - 1);\n    }\n    var symbolMarginNumeric = parsePercent(symbolMargin, symbolSize[valueDim.index]);\n    var uLenWithMargin = Math.max(unitLength + symbolMarginNumeric * 2, 0);\n    // When symbol margin is less than 0, margin at both ends will be subtracted\n    // to ensure that all of the symbols will not be overflow the given area.\n    var endFix = hasEndGap ? 0 : symbolMarginNumeric * 2;\n    // Both final repeatTimes and final symbolMarginNumeric area calculated based on\n    // boundingLength.\n    var repeatSpecified = isNumeric(symbolRepeat);\n    var repeatTimes = repeatSpecified ? symbolRepeat : toIntTimes((absBoundingLength + endFix) / uLenWithMargin);\n    // Adjust calculate margin, to ensure each symbol is displayed\n    // entirely in the given layout area.\n    var mDiff = absBoundingLength - repeatTimes * unitLength;\n    symbolMarginNumeric = mDiff / 2 / (hasEndGap ? repeatTimes : Math.max(repeatTimes - 1, 1));\n    uLenWithMargin = unitLength + symbolMarginNumeric * 2;\n    endFix = hasEndGap ? 0 : symbolMarginNumeric * 2;\n    // Update repeatTimes when not all symbol will be shown.\n    if (!repeatSpecified && symbolRepeat !== 'fixed') {\n      repeatTimes = repeatCutLength ? toIntTimes((Math.abs(repeatCutLength) + endFix) / uLenWithMargin) : 0;\n    }\n    pathLen = repeatTimes * uLenWithMargin - endFix;\n    outputSymbolMeta.repeatTimes = repeatTimes;\n    outputSymbolMeta.symbolMargin = symbolMarginNumeric;\n  }\n  var sizeFix = pxSign * (pathLen / 2);\n  var pathPosition = outputSymbolMeta.pathPosition = [];\n  pathPosition[categoryDim.index] = layout[categoryDim.wh] / 2;\n  pathPosition[valueDim.index] = symbolPosition === 'start' ? sizeFix : symbolPosition === 'end' ? boundingLength - sizeFix : boundingLength / 2; // 'center'\n  if (symbolOffset) {\n    pathPosition[0] += symbolOffset[0];\n    pathPosition[1] += symbolOffset[1];\n  }\n  var bundlePosition = outputSymbolMeta.bundlePosition = [];\n  bundlePosition[categoryDim.index] = layout[categoryDim.xy];\n  bundlePosition[valueDim.index] = layout[valueDim.xy];\n  var barRectShape = outputSymbolMeta.barRectShape = zrUtil.extend({}, layout);\n  barRectShape[valueDim.wh] = pxSign * Math.max(Math.abs(layout[valueDim.wh]), Math.abs(pathPosition[valueDim.index] + sizeFix));\n  barRectShape[categoryDim.wh] = layout[categoryDim.wh];\n  var clipShape = outputSymbolMeta.clipShape = {};\n  // Consider that symbol may be overflow layout rect.\n  clipShape[categoryDim.xy] = -layout[categoryDim.xy];\n  clipShape[categoryDim.wh] = opt.ecSize[categoryDim.wh];\n  clipShape[valueDim.xy] = 0;\n  clipShape[valueDim.wh] = layout[valueDim.wh];\n}\nfunction createPath(symbolMeta) {\n  var symbolPatternSize = symbolMeta.symbolPatternSize;\n  var path = createSymbol(\n  // Consider texture img, make a big size.\n  symbolMeta.symbolType, -symbolPatternSize / 2, -symbolPatternSize / 2, symbolPatternSize, symbolPatternSize);\n  path.attr({\n    culling: true\n  });\n  path.type !== 'image' && path.setStyle({\n    strokeNoScale: true\n  });\n  return path;\n}\nfunction createOrUpdateRepeatSymbols(bar, opt, symbolMeta, isUpdate) {\n  var bundle = bar.__pictorialBundle;\n  var symbolSize = symbolMeta.symbolSize;\n  var valueLineWidth = symbolMeta.valueLineWidth;\n  var pathPosition = symbolMeta.pathPosition;\n  var valueDim = opt.valueDim;\n  var repeatTimes = symbolMeta.repeatTimes || 0;\n  var index = 0;\n  var unit = symbolSize[opt.valueDim.index] + valueLineWidth + symbolMeta.symbolMargin * 2;\n  eachPath(bar, function (path) {\n    path.__pictorialAnimationIndex = index;\n    path.__pictorialRepeatTimes = repeatTimes;\n    if (index < repeatTimes) {\n      updateAttr(path, null, makeTarget(index), symbolMeta, isUpdate);\n    } else {\n      updateAttr(path, null, {\n        scaleX: 0,\n        scaleY: 0\n      }, symbolMeta, isUpdate, function () {\n        bundle.remove(path);\n      });\n    }\n    // updateHoverAnimation(path, symbolMeta);\n    index++;\n  });\n  for (; index < repeatTimes; index++) {\n    var path = createPath(symbolMeta);\n    path.__pictorialAnimationIndex = index;\n    path.__pictorialRepeatTimes = repeatTimes;\n    bundle.add(path);\n    var target = makeTarget(index);\n    updateAttr(path, {\n      x: target.x,\n      y: target.y,\n      scaleX: 0,\n      scaleY: 0\n    }, {\n      scaleX: target.scaleX,\n      scaleY: target.scaleY,\n      rotation: target.rotation\n    }, symbolMeta, isUpdate);\n  }\n  function makeTarget(index) {\n    var position = pathPosition.slice();\n    // (start && pxSign > 0) || (end && pxSign < 0): i = repeatTimes - index\n    // Otherwise: i = index;\n    var pxSign = symbolMeta.pxSign;\n    var i = index;\n    if (symbolMeta.symbolRepeatDirection === 'start' ? pxSign > 0 : pxSign < 0) {\n      i = repeatTimes - 1 - index;\n    }\n    position[valueDim.index] = unit * (i - repeatTimes / 2 + 0.5) + pathPosition[valueDim.index];\n    return {\n      x: position[0],\n      y: position[1],\n      scaleX: symbolMeta.symbolScale[0],\n      scaleY: symbolMeta.symbolScale[1],\n      rotation: symbolMeta.rotation\n    };\n  }\n}\nfunction createOrUpdateSingleSymbol(bar, opt, symbolMeta, isUpdate) {\n  var bundle = bar.__pictorialBundle;\n  var mainPath = bar.__pictorialMainPath;\n  if (!mainPath) {\n    mainPath = bar.__pictorialMainPath = createPath(symbolMeta);\n    bundle.add(mainPath);\n    updateAttr(mainPath, {\n      x: symbolMeta.pathPosition[0],\n      y: symbolMeta.pathPosition[1],\n      scaleX: 0,\n      scaleY: 0,\n      rotation: symbolMeta.rotation\n    }, {\n      scaleX: symbolMeta.symbolScale[0],\n      scaleY: symbolMeta.symbolScale[1]\n    }, symbolMeta, isUpdate);\n  } else {\n    updateAttr(mainPath, null, {\n      x: symbolMeta.pathPosition[0],\n      y: symbolMeta.pathPosition[1],\n      scaleX: symbolMeta.symbolScale[0],\n      scaleY: symbolMeta.symbolScale[1],\n      rotation: symbolMeta.rotation\n    }, symbolMeta, isUpdate);\n  }\n}\n// bar rect is used for label.\nfunction createOrUpdateBarRect(bar, symbolMeta, isUpdate) {\n  var rectShape = zrUtil.extend({}, symbolMeta.barRectShape);\n  var barRect = bar.__pictorialBarRect;\n  if (!barRect) {\n    barRect = bar.__pictorialBarRect = new graphic.Rect({\n      z2: 2,\n      shape: rectShape,\n      silent: true,\n      style: {\n        stroke: 'transparent',\n        fill: 'transparent',\n        lineWidth: 0\n      }\n    });\n    barRect.disableMorphing = true;\n    bar.add(barRect);\n  } else {\n    updateAttr(barRect, null, {\n      shape: rectShape\n    }, symbolMeta, isUpdate);\n  }\n}\nfunction createOrUpdateClip(bar, opt, symbolMeta, isUpdate) {\n  // If not clip, symbol will be remove and rebuilt.\n  if (symbolMeta.symbolClip) {\n    var clipPath = bar.__pictorialClipPath;\n    var clipShape = zrUtil.extend({}, symbolMeta.clipShape);\n    var valueDim = opt.valueDim;\n    var animationModel = symbolMeta.animationModel;\n    var dataIndex = symbolMeta.dataIndex;\n    if (clipPath) {\n      graphic.updateProps(clipPath, {\n        shape: clipShape\n      }, animationModel, dataIndex);\n    } else {\n      clipShape[valueDim.wh] = 0;\n      clipPath = new graphic.Rect({\n        shape: clipShape\n      });\n      bar.__pictorialBundle.setClipPath(clipPath);\n      bar.__pictorialClipPath = clipPath;\n      var target = {};\n      target[valueDim.wh] = symbolMeta.clipShape[valueDim.wh];\n      graphic[isUpdate ? 'updateProps' : 'initProps'](clipPath, {\n        shape: target\n      }, animationModel, dataIndex);\n    }\n  }\n}\nfunction getItemModel(data, dataIndex) {\n  var itemModel = data.getItemModel(dataIndex);\n  itemModel.getAnimationDelayParams = getAnimationDelayParams;\n  itemModel.isAnimationEnabled = isAnimationEnabled;\n  return itemModel;\n}\nfunction getAnimationDelayParams(path) {\n  // The order is the same as the z-order, see `symbolRepeatDiretion`.\n  return {\n    index: path.__pictorialAnimationIndex,\n    count: path.__pictorialRepeatTimes\n  };\n}\nfunction isAnimationEnabled() {\n  // `animation` prop can be set on itemModel in pictorial bar chart.\n  return this.parentModel.isAnimationEnabled() && !!this.getShallow('animation');\n}\nfunction createBar(data, opt, symbolMeta, isUpdate) {\n  // bar is the main element for each data.\n  var bar = new graphic.Group();\n  // bundle is used for location and clip.\n  var bundle = new graphic.Group();\n  bar.add(bundle);\n  bar.__pictorialBundle = bundle;\n  bundle.x = symbolMeta.bundlePosition[0];\n  bundle.y = symbolMeta.bundlePosition[1];\n  if (symbolMeta.symbolRepeat) {\n    createOrUpdateRepeatSymbols(bar, opt, symbolMeta);\n  } else {\n    createOrUpdateSingleSymbol(bar, opt, symbolMeta);\n  }\n  createOrUpdateBarRect(bar, symbolMeta, isUpdate);\n  createOrUpdateClip(bar, opt, symbolMeta, isUpdate);\n  bar.__pictorialShapeStr = getShapeStr(data, symbolMeta);\n  bar.__pictorialSymbolMeta = symbolMeta;\n  return bar;\n}\nfunction updateBar(bar, opt, symbolMeta) {\n  var animationModel = symbolMeta.animationModel;\n  var dataIndex = symbolMeta.dataIndex;\n  var bundle = bar.__pictorialBundle;\n  graphic.updateProps(bundle, {\n    x: symbolMeta.bundlePosition[0],\n    y: symbolMeta.bundlePosition[1]\n  }, animationModel, dataIndex);\n  if (symbolMeta.symbolRepeat) {\n    createOrUpdateRepeatSymbols(bar, opt, symbolMeta, true);\n  } else {\n    createOrUpdateSingleSymbol(bar, opt, symbolMeta, true);\n  }\n  createOrUpdateBarRect(bar, symbolMeta, true);\n  createOrUpdateClip(bar, opt, symbolMeta, true);\n}\nfunction removeBar(data, dataIndex, animationModel, bar) {\n  // Not show text when animating\n  var labelRect = bar.__pictorialBarRect;\n  labelRect && labelRect.removeTextContent();\n  var paths = [];\n  eachPath(bar, function (path) {\n    paths.push(path);\n  });\n  bar.__pictorialMainPath && paths.push(bar.__pictorialMainPath);\n  // I do not find proper remove animation for clip yet.\n  bar.__pictorialClipPath && (animationModel = null);\n  zrUtil.each(paths, function (path) {\n    graphic.removeElement(path, {\n      scaleX: 0,\n      scaleY: 0\n    }, animationModel, dataIndex, function () {\n      bar.parent && bar.parent.remove(bar);\n    });\n  });\n  data.setItemGraphicEl(dataIndex, null);\n}\nfunction getShapeStr(data, symbolMeta) {\n  return [data.getItemVisual(symbolMeta.dataIndex, 'symbol') || 'none', !!symbolMeta.symbolRepeat, !!symbolMeta.symbolClip].join(':');\n}\nfunction eachPath(bar, cb, context) {\n  // Do not use Group#eachChild, because it do not support remove.\n  zrUtil.each(bar.__pictorialBundle.children(), function (el) {\n    el !== bar.__pictorialBarRect && cb.call(context, el);\n  });\n}\nfunction updateAttr(el, immediateAttrs, animationAttrs, symbolMeta, isUpdate, cb) {\n  immediateAttrs && el.attr(immediateAttrs);\n  // when symbolCip used, only clip path has init animation, otherwise it would be weird effect.\n  if (symbolMeta.symbolClip && !isUpdate) {\n    animationAttrs && el.attr(animationAttrs);\n  } else {\n    animationAttrs && graphic[isUpdate ? 'updateProps' : 'initProps'](el, animationAttrs, symbolMeta.animationModel, symbolMeta.dataIndex, cb);\n  }\n}\nfunction updateCommon(bar, opt, symbolMeta) {\n  var dataIndex = symbolMeta.dataIndex;\n  var itemModel = symbolMeta.itemModel;\n  // Color must be excluded.\n  // Because symbol provide setColor individually to set fill and stroke\n  var emphasisModel = itemModel.getModel('emphasis');\n  var emphasisStyle = emphasisModel.getModel('itemStyle').getItemStyle();\n  var blurStyle = itemModel.getModel(['blur', 'itemStyle']).getItemStyle();\n  var selectStyle = itemModel.getModel(['select', 'itemStyle']).getItemStyle();\n  var cursorStyle = itemModel.getShallow('cursor');\n  var focus = emphasisModel.get('focus');\n  var blurScope = emphasisModel.get('blurScope');\n  var hoverScale = emphasisModel.get('scale');\n  eachPath(bar, function (path) {\n    if (path instanceof ZRImage) {\n      var pathStyle = path.style;\n      path.useStyle(zrUtil.extend({\n        // TODO other properties like dx, dy ?\n        image: pathStyle.image,\n        x: pathStyle.x,\n        y: pathStyle.y,\n        width: pathStyle.width,\n        height: pathStyle.height\n      }, symbolMeta.style));\n    } else {\n      path.useStyle(symbolMeta.style);\n    }\n    var emphasisState = path.ensureState('emphasis');\n    emphasisState.style = emphasisStyle;\n    if (hoverScale) {\n      // NOTE: Must after scale is set after updateAttr\n      emphasisState.scaleX = path.scaleX * 1.1;\n      emphasisState.scaleY = path.scaleY * 1.1;\n    }\n    path.ensureState('blur').style = blurStyle;\n    path.ensureState('select').style = selectStyle;\n    cursorStyle && (path.cursor = cursorStyle);\n    path.z2 = symbolMeta.z2;\n  });\n  var barPositionOutside = opt.valueDim.posDesc[+(symbolMeta.boundingLength > 0)];\n  var barRect = bar.__pictorialBarRect;\n  barRect.ignoreClip = true;\n  setLabelStyle(barRect, getLabelStatesModels(itemModel), {\n    labelFetcher: opt.seriesModel,\n    labelDataIndex: dataIndex,\n    defaultText: getDefaultLabel(opt.seriesModel.getData(), dataIndex),\n    inheritColor: symbolMeta.style.fill,\n    defaultOpacity: symbolMeta.style.opacity,\n    defaultOutsidePosition: barPositionOutside\n  });\n  toggleHoverEmphasis(bar, focus, blurScope, emphasisModel.get('disabled'));\n}\nfunction toIntTimes(times) {\n  var roundedTimes = Math.round(times);\n  // Escapse accurate error\n  return Math.abs(times - roundedTimes) < 1e-4 ? roundedTimes : Math.ceil(times);\n}\nexport default PictorialBarView;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport BaseBarSeriesModel from './BaseBarSeries.js';\nimport { inheritDefaultOption } from '../../util/component.js';\nimport tokens from '../../visual/tokens.js';\nvar PictorialBarSeriesModel = /** @class */function (_super) {\n  __extends(PictorialBarSeriesModel, _super);\n  function PictorialBarSeriesModel() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = PictorialBarSeriesModel.type;\n    _this.hasSymbolVisual = true;\n    _this.defaultSymbol = 'roundRect';\n    return _this;\n  }\n  PictorialBarSeriesModel.prototype.getInitialData = function (option) {\n    // Disable stack.\n    option.stack = null;\n    return _super.prototype.getInitialData.apply(this, arguments);\n  };\n  PictorialBarSeriesModel.type = 'series.pictorialBar';\n  PictorialBarSeriesModel.dependencies = ['grid'];\n  PictorialBarSeriesModel.defaultOption = inheritDefaultOption(BaseBarSeriesModel.defaultOption, {\n    symbol: 'circle',\n    symbolSize: null,\n    symbolRotate: null,\n    symbolPosition: null,\n    symbolOffset: null,\n    symbolMargin: null,\n    symbolRepeat: false,\n    symbolRepeatDirection: 'end',\n    symbolClip: false,\n    symbolBoundingData: null,\n    symbolPatternSize: 400,\n    barGap: '-100%',\n    // Pictorial bar do not clip by default because in many cases\n    // xAxis and yAxis are not displayed and it's expected not to clip\n    clip: false,\n    // z can be set in data item, which is z2 actually.\n    // Disable progressive\n    progressive: 0,\n    emphasis: {\n      // By default pictorialBar do not hover scale. Hover scale is not suitable\n      // for the case that both has foreground and background.\n      scale: false\n    },\n    select: {\n      itemStyle: {\n        borderColor: tokens.color.primary\n      }\n    }\n  });\n  return PictorialBarSeriesModel;\n}(BaseBarSeriesModel);\nexport default PictorialBarSeriesModel;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport PictorialBarView from './PictorialBarView.js';\nimport PictorialBarSeriesModel from './PictorialBarSeries.js';\nimport { createProgressiveLayout, layout } from '../../layout/barGrid.js';\nimport { curry } from 'zrender/lib/core/util.js';\nexport function install(registers) {\n  registers.registerChartView(PictorialBarView);\n  registers.registerSeriesModel(PictorialBarSeriesModel);\n  registers.registerLayout(registers.PRIORITY.VISUAL.LAYOUT, curry(layout, 'pictorialBar'));\n  // Do layout after other overall layout, which can prepare some information.\n  registers.registerLayout(registers.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT, createProgressiveLayout('pictorialBar'));\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport { ECPolygon } from '../line/poly.js';\nimport * as graphic from '../../util/graphic.js';\nimport { setStatesStylesFromModel, toggleHoverEmphasis } from '../../util/states.js';\nimport { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle.js';\nimport { bind } from 'zrender/lib/core/util.js';\nimport DataDiffer from '../../data/DataDiffer.js';\nimport ChartView from '../../view/Chart.js';\nimport { saveOldStyle } from '../../animation/basicTransition.js';\nvar ThemeRiverView = /** @class */function (_super) {\n  __extends(ThemeRiverView, _super);\n  function ThemeRiverView() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = ThemeRiverView.type;\n    _this._layers = [];\n    return _this;\n  }\n  ThemeRiverView.prototype.render = function (seriesModel, ecModel, api) {\n    var data = seriesModel.getData();\n    var self = this;\n    var group = this.group;\n    var layersSeries = seriesModel.getLayerSeries();\n    var layoutInfo = data.getLayout('layoutInfo');\n    var rect = layoutInfo.rect;\n    var boundaryGap = layoutInfo.boundaryGap;\n    group.x = 0;\n    group.y = rect.y + boundaryGap[0];\n    function keyGetter(item) {\n      return item.name;\n    }\n    var dataDiffer = new DataDiffer(this._layersSeries || [], layersSeries, keyGetter, keyGetter);\n    var newLayersGroups = [];\n    dataDiffer.add(bind(process, this, 'add')).update(bind(process, this, 'update')).remove(bind(process, this, 'remove')).execute();\n    function process(status, idx, oldIdx) {\n      var oldLayersGroups = self._layers;\n      if (status === 'remove') {\n        group.remove(oldLayersGroups[idx]);\n        return;\n      }\n      var points0 = [];\n      var points1 = [];\n      var style;\n      var indices = layersSeries[idx].indices;\n      var j = 0;\n      for (; j < indices.length; j++) {\n        var layout = data.getItemLayout(indices[j]);\n        var x = layout.x;\n        var y0 = layout.y0;\n        var y = layout.y;\n        points0.push(x, y0);\n        points1.push(x, y0 + y);\n        style = data.getItemVisual(indices[j], 'style');\n      }\n      var polygon;\n      var textLayout = data.getItemLayout(indices[0]);\n      var labelModel = seriesModel.getModel('label');\n      var margin = labelModel.get('margin');\n      var emphasisModel = seriesModel.getModel('emphasis');\n      if (status === 'add') {\n        var layerGroup = newLayersGroups[idx] = new graphic.Group();\n        polygon = new ECPolygon({\n          shape: {\n            points: points0,\n            stackedOnPoints: points1,\n            smooth: 0.4,\n            stackedOnSmooth: 0.4,\n            smoothConstraint: false\n          },\n          z2: 0\n        });\n        layerGroup.add(polygon);\n        group.add(layerGroup);\n        if (seriesModel.isAnimationEnabled()) {\n          polygon.setClipPath(createGridClipShape(polygon.getBoundingRect(), seriesModel, function () {\n            polygon.removeClipPath();\n          }));\n        }\n      } else {\n        var layerGroup = oldLayersGroups[oldIdx];\n        polygon = layerGroup.childAt(0);\n        group.add(layerGroup);\n        newLayersGroups[idx] = layerGroup;\n        graphic.updateProps(polygon, {\n          shape: {\n            points: points0,\n            stackedOnPoints: points1\n          }\n        }, seriesModel);\n        saveOldStyle(polygon);\n      }\n      setLabelStyle(polygon, getLabelStatesModels(seriesModel), {\n        labelDataIndex: indices[j - 1],\n        defaultText: data.getName(indices[j - 1]),\n        inheritColor: style.fill\n      }, {\n        normal: {\n          verticalAlign: 'middle'\n          // align: 'right'\n        }\n      });\n      polygon.setTextConfig({\n        position: null,\n        local: true\n      });\n      var labelEl = polygon.getTextContent();\n      // TODO More label position options.\n      if (labelEl) {\n        labelEl.x = textLayout.x - margin;\n        labelEl.y = textLayout.y0 + textLayout.y / 2;\n      }\n      polygon.useStyle(style);\n      data.setItemGraphicEl(idx, polygon);\n      setStatesStylesFromModel(polygon, seriesModel);\n      toggleHoverEmphasis(polygon, emphasisModel.get('focus'), emphasisModel.get('blurScope'), emphasisModel.get('disabled'));\n    }\n    this._layersSeries = layersSeries;\n    this._layers = newLayersGroups;\n  };\n  ThemeRiverView.type = 'themeRiver';\n  return ThemeRiverView;\n}(ChartView);\n;\n// add animation to the view\nfunction createGridClipShape(rect, seriesModel, cb) {\n  var rectEl = new graphic.Rect({\n    shape: {\n      x: rect.x - 10,\n      y: rect.y - 10,\n      width: 0,\n      height: rect.height + 20\n    }\n  });\n  graphic.initProps(rectEl, {\n    shape: {\n      x: rect.x - 50,\n      width: rect.width + 100,\n      height: rect.height + 20\n    }\n  }, seriesModel, cb);\n  return rectEl;\n}\nexport default ThemeRiverView;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport SeriesModel from '../../model/Series.js';\nimport prepareSeriesDataSchema from '../../data/helper/createDimensions.js';\nimport { getDimensionTypeByAxis } from '../../data/helper/dimensionHelper.js';\nimport SeriesData from '../../data/SeriesData.js';\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { groupData, SINGLE_REFERRING } from '../../util/model.js';\nimport LegendVisualProvider from '../../visual/LegendVisualProvider.js';\nimport { createTooltipMarkup } from '../../component/tooltip/tooltipMarkup.js';\nvar DATA_NAME_INDEX = 2;\nvar ThemeRiverSeriesModel = /** @class */function (_super) {\n  __extends(ThemeRiverSeriesModel, _super);\n  function ThemeRiverSeriesModel() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = ThemeRiverSeriesModel.type;\n    return _this;\n  }\n  /**\n   * @override\n   */\n  ThemeRiverSeriesModel.prototype.init = function (option) {\n    // eslint-disable-next-line\n    _super.prototype.init.apply(this, arguments);\n    // Put this function here is for the sake of consistency of code style.\n    // Enable legend selection for each data item\n    // Use a function instead of direct access because data reference may changed\n    this.legendVisualProvider = new LegendVisualProvider(zrUtil.bind(this.getData, this), zrUtil.bind(this.getRawData, this));\n  };\n  /**\n   * If there is no value of a certain point in the time for some event,set it value to 0.\n   *\n   * @param {Array} data  initial data in the option\n   * @return {Array}\n   */\n  ThemeRiverSeriesModel.prototype.fixData = function (data) {\n    var rawDataLength = data.length;\n    /**\n     * Make sure every layer data get the same keys.\n     * The value index tells which layer has visited.\n     * {\n     *  2014/01/01: -1\n     * }\n     */\n    var timeValueKeys = {};\n    // grouped data by name\n    var groupResult = groupData(data, function (item) {\n      if (!timeValueKeys.hasOwnProperty(item[0] + '')) {\n        timeValueKeys[item[0] + ''] = -1;\n      }\n      return item[2];\n    });\n    var layerData = [];\n    groupResult.buckets.each(function (items, key) {\n      layerData.push({\n        name: key,\n        dataList: items\n      });\n    });\n    var layerNum = layerData.length;\n    for (var k = 0; k < layerNum; ++k) {\n      var name_1 = layerData[k].name;\n      for (var j = 0; j < layerData[k].dataList.length; ++j) {\n        var timeValue = layerData[k].dataList[j][0] + '';\n        timeValueKeys[timeValue] = k;\n      }\n      for (var timeValue in timeValueKeys) {\n        if (timeValueKeys.hasOwnProperty(timeValue) && timeValueKeys[timeValue] !== k) {\n          timeValueKeys[timeValue] = k;\n          data[rawDataLength] = [timeValue, 0, name_1];\n          rawDataLength++;\n        }\n      }\n    }\n    return data;\n  };\n  /**\n   * @override\n   * @param  option  the initial option that user gave\n   * @param  ecModel  the model object for themeRiver option\n   */\n  ThemeRiverSeriesModel.prototype.getInitialData = function (option, ecModel) {\n    var singleAxisModel = this.getReferringComponents('singleAxis', SINGLE_REFERRING).models[0];\n    var axisType = singleAxisModel.get('type');\n    // filter the data item with the value of label is undefined\n    var filterData = zrUtil.filter(option.data, function (dataItem) {\n      return dataItem[2] !== undefined;\n    });\n    // ??? TODO design a stage to transfer data for themeRiver and lines?\n    var data = this.fixData(filterData || []);\n    var nameList = [];\n    var nameMap = this.nameMap = zrUtil.createHashMap();\n    var count = 0;\n    for (var i = 0; i < data.length; ++i) {\n      nameList.push(data[i][DATA_NAME_INDEX]);\n      if (!nameMap.get(data[i][DATA_NAME_INDEX])) {\n        nameMap.set(data[i][DATA_NAME_INDEX], count);\n        count++;\n      }\n    }\n    var dimensions = prepareSeriesDataSchema(data, {\n      coordDimensions: ['single'],\n      dimensionsDefine: [{\n        name: 'time',\n        type: getDimensionTypeByAxis(axisType)\n      }, {\n        name: 'value',\n        type: 'float'\n      }, {\n        name: 'name',\n        type: 'ordinal'\n      }],\n      encodeDefine: {\n        single: 0,\n        value: 1,\n        itemName: 2\n      }\n    }).dimensions;\n    var list = new SeriesData(dimensions, this);\n    list.initData(data);\n    return list;\n  };\n  /**\n   * The raw data is divided into multiple layers and each layer\n   *     has same name.\n   */\n  ThemeRiverSeriesModel.prototype.getLayerSeries = function () {\n    var data = this.getData();\n    var lenCount = data.count();\n    var indexArr = [];\n    for (var i = 0; i < lenCount; ++i) {\n      indexArr[i] = i;\n    }\n    var timeDim = data.mapDimension('single');\n    // data group by name\n    var groupResult = groupData(indexArr, function (index) {\n      return data.get('name', index);\n    });\n    var layerSeries = [];\n    groupResult.buckets.each(function (items, key) {\n      items.sort(function (index1, index2) {\n        return data.get(timeDim, index1) - data.get(timeDim, index2);\n      });\n      layerSeries.push({\n        name: key,\n        indices: items\n      });\n    });\n    return layerSeries;\n  };\n  /**\n   * Get data indices for show tooltip content\n   */\n  ThemeRiverSeriesModel.prototype.getAxisTooltipData = function (dim, value, baseAxis) {\n    if (!zrUtil.isArray(dim)) {\n      dim = dim ? [dim] : [];\n    }\n    var data = this.getData();\n    var layerSeries = this.getLayerSeries();\n    var indices = [];\n    var layerNum = layerSeries.length;\n    var nestestValue;\n    for (var i = 0; i < layerNum; ++i) {\n      var minDist = Number.MAX_VALUE;\n      var nearestIdx = -1;\n      var pointNum = layerSeries[i].indices.length;\n      for (var j = 0; j < pointNum; ++j) {\n        var theValue = data.get(dim[0], layerSeries[i].indices[j]);\n        var dist = Math.abs(theValue - value);\n        if (dist <= minDist) {\n          nestestValue = theValue;\n          minDist = dist;\n          nearestIdx = layerSeries[i].indices[j];\n        }\n      }\n      indices.push(nearestIdx);\n    }\n    return {\n      dataIndices: indices,\n      nestestValue: nestestValue\n    };\n  };\n  ThemeRiverSeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\n    var data = this.getData();\n    var name = data.getName(dataIndex);\n    var value = data.get(data.mapDimension('value'), dataIndex);\n    return createTooltipMarkup('nameValue', {\n      name: name,\n      value: value\n    });\n  };\n  ThemeRiverSeriesModel.type = 'series.themeRiver';\n  ThemeRiverSeriesModel.dependencies = ['singleAxis'];\n  ThemeRiverSeriesModel.defaultOption = {\n    // zlevel: 0,\n    z: 2,\n    colorBy: 'data',\n    coordinateSystem: 'singleAxis',\n    // gap in axis's orthogonal orientation\n    boundaryGap: ['10%', '10%'],\n    // legendHoverLink: true,\n    singleAxisIndex: 0,\n    animationEasing: 'linear',\n    label: {\n      margin: 4,\n      show: true,\n      position: 'left',\n      fontSize: 11\n    },\n    emphasis: {\n      label: {\n        show: true\n      }\n    }\n  };\n  return ThemeRiverSeriesModel;\n}(SeriesModel);\nexport default ThemeRiverSeriesModel;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as numberUtil from '../../util/number.js';\nexport default function themeRiverLayout(ecModel, api) {\n  ecModel.eachSeriesByType('themeRiver', function (seriesModel) {\n    var data = seriesModel.getData();\n    var single = seriesModel.coordinateSystem;\n    var layoutInfo = {};\n    // use the axis boundingRect for view\n    var rect = single.getRect();\n    layoutInfo.rect = rect;\n    var boundaryGap = seriesModel.get('boundaryGap');\n    var axis = single.getAxis();\n    layoutInfo.boundaryGap = boundaryGap;\n    if (axis.orient === 'horizontal') {\n      boundaryGap[0] = numberUtil.parsePercent(boundaryGap[0], rect.height);\n      boundaryGap[1] = numberUtil.parsePercent(boundaryGap[1], rect.height);\n      var height = rect.height - boundaryGap[0] - boundaryGap[1];\n      doThemeRiverLayout(data, seriesModel, height);\n    } else {\n      boundaryGap[0] = numberUtil.parsePercent(boundaryGap[0], rect.width);\n      boundaryGap[1] = numberUtil.parsePercent(boundaryGap[1], rect.width);\n      var width = rect.width - boundaryGap[0] - boundaryGap[1];\n      doThemeRiverLayout(data, seriesModel, width);\n    }\n    data.setLayout('layoutInfo', layoutInfo);\n  });\n}\n/**\n * The layout information about themeriver\n *\n * @param data  data in the series\n * @param seriesModel  the model object of themeRiver series\n * @param height  value used to compute every series height\n */\nfunction doThemeRiverLayout(data, seriesModel, height) {\n  if (!data.count()) {\n    return;\n  }\n  var coordSys = seriesModel.coordinateSystem;\n  // the data in each layer are organized into a series.\n  var layerSeries = seriesModel.getLayerSeries();\n  // the points in each layer.\n  var timeDim = data.mapDimension('single');\n  var valueDim = data.mapDimension('value');\n  var layerPoints = zrUtil.map(layerSeries, function (singleLayer) {\n    return zrUtil.map(singleLayer.indices, function (idx) {\n      var pt = coordSys.dataToPoint(data.get(timeDim, idx));\n      pt[1] = data.get(valueDim, idx);\n      return pt;\n    });\n  });\n  var base = computeBaseline(layerPoints);\n  var baseLine = base.y0;\n  var ky = height / base.max;\n  // set layout information for each item.\n  var n = layerSeries.length;\n  var m = layerSeries[0].indices.length;\n  var baseY0;\n  for (var j = 0; j < m; ++j) {\n    baseY0 = baseLine[j] * ky;\n    data.setItemLayout(layerSeries[0].indices[j], {\n      layerIndex: 0,\n      x: layerPoints[0][j][0],\n      y0: baseY0,\n      y: layerPoints[0][j][1] * ky\n    });\n    for (var i = 1; i < n; ++i) {\n      baseY0 += layerPoints[i - 1][j][1] * ky;\n      data.setItemLayout(layerSeries[i].indices[j], {\n        layerIndex: i,\n        x: layerPoints[i][j][0],\n        y0: baseY0,\n        y: layerPoints[i][j][1] * ky\n      });\n    }\n  }\n}\n/**\n * Compute the baseLine of the rawdata\n * Inspired by Lee Byron's paper Stacked Graphs - Geometry & Aesthetics\n *\n * @param  data  the points in each layer\n */\nfunction computeBaseline(data) {\n  var layerNum = data.length;\n  var pointNum = data[0].length;\n  var sums = [];\n  var y0 = [];\n  var max = 0;\n  for (var i = 0; i < pointNum; ++i) {\n    var temp = 0;\n    for (var j = 0; j < layerNum; ++j) {\n      temp += data[j][i][1];\n    }\n    if (temp > max) {\n      max = temp;\n    }\n    sums.push(temp);\n  }\n  for (var k = 0; k < pointNum; ++k) {\n    y0[k] = (max - sums[k]) / 2;\n  }\n  max = 0;\n  for (var l = 0; l < pointNum; ++l) {\n    var sum = sums[l] + y0[l];\n    if (sum > max) {\n      max = sum;\n    }\n  }\n  return {\n    y0: y0,\n    max: max\n  };\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\nimport ThemeRiverView from './ThemeRiverView.js';\nimport ThemeRiverSeriesModel from './ThemeRiverSeries.js';\nimport themeRiverLayout from './themeRiverLayout.js';\nimport dataFilter from '../../processor/dataFilter.js';\nexport function install(registers) {\n  registers.registerChartView(ThemeRiverView);\n  registers.registerSeriesModel(ThemeRiverSeriesModel);\n  registers.registerLayout(themeRiverLayout);\n  registers.registerProcessor(dataFilter('themeRiver'));\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as graphic from '../../util/graphic.js';\nimport { toggleHoverEmphasis, SPECIAL_STATES, DISPLAY_STATES } from '../../util/states.js';\nimport { createTextStyle } from '../../label/labelStyle.js';\nimport { getECData } from '../../util/innerStore.js';\nimport { getSectorCornerRadius } from '../helper/sectorHelper.js';\nimport { createOrUpdatePatternFromDecal } from '../../util/decal.js';\nimport { saveOldStyle } from '../../animation/basicTransition.js';\nimport { normalizeRadian } from 'zrender/lib/contain/util.js';\nimport { isRadianAroundZero } from '../../util/number.js';\nvar DEFAULT_SECTOR_Z = 2;\nvar DEFAULT_TEXT_Z = 4;\n/**\n * Sunburstce of Sunburst including Sector, Label, LabelLine\n */\nvar SunburstPiece = /** @class */function (_super) {\n  __extends(SunburstPiece, _super);\n  function SunburstPiece(node, seriesModel, ecModel, api) {\n    var _this = _super.call(this) || this;\n    _this.z2 = DEFAULT_SECTOR_Z;\n    _this.textConfig = {\n      inside: true\n    };\n    getECData(_this).seriesIndex = seriesModel.seriesIndex;\n    var text = new graphic.Text({\n      z2: DEFAULT_TEXT_Z,\n      silent: node.getModel().get(['label', 'silent'])\n    });\n    _this.setTextContent(text);\n    _this.updateData(true, node, seriesModel, ecModel, api);\n    return _this;\n  }\n  SunburstPiece.prototype.updateData = function (firstCreate, node,\n  // state: 'emphasis' | 'normal' | 'highlight' | 'downplay',\n  seriesModel, ecModel, api) {\n    this.node = node;\n    node.piece = this;\n    seriesModel = seriesModel || this._seriesModel;\n    ecModel = ecModel || this._ecModel;\n    var sector = this;\n    getECData(sector).dataIndex = node.dataIndex;\n    var itemModel = node.getModel();\n    var emphasisModel = itemModel.getModel('emphasis');\n    var layout = node.getLayout();\n    var sectorShape = zrUtil.extend({}, layout);\n    sectorShape.label = null;\n    var normalStyle = node.getVisual('style');\n    normalStyle.lineJoin = 'bevel';\n    var decal = node.getVisual('decal');\n    if (decal) {\n      normalStyle.decal = createOrUpdatePatternFromDecal(decal, api);\n    }\n    var cornerRadius = getSectorCornerRadius(itemModel.getModel('itemStyle'), sectorShape, true);\n    zrUtil.extend(sectorShape, cornerRadius);\n    zrUtil.each(SPECIAL_STATES, function (stateName) {\n      var state = sector.ensureState(stateName);\n      var itemStyleModel = itemModel.getModel([stateName, 'itemStyle']);\n      state.style = itemStyleModel.getItemStyle();\n      // border radius\n      var cornerRadius = getSectorCornerRadius(itemStyleModel, sectorShape);\n      if (cornerRadius) {\n        state.shape = cornerRadius;\n      }\n    });\n    if (firstCreate) {\n      sector.setShape(sectorShape);\n      sector.shape.r = layout.r0;\n      graphic.initProps(sector, {\n        shape: {\n          r: layout.r\n        }\n      }, seriesModel, node.dataIndex);\n    } else {\n      // Disable animation for gradient since no interpolation method\n      // is supported for gradient\n      graphic.updateProps(sector, {\n        shape: sectorShape\n      }, seriesModel);\n      saveOldStyle(sector);\n    }\n    sector.useStyle(normalStyle);\n    this._updateLabel(seriesModel);\n    var cursorStyle = itemModel.getShallow('cursor');\n    cursorStyle && sector.attr('cursor', cursorStyle);\n    this._seriesModel = seriesModel || this._seriesModel;\n    this._ecModel = ecModel || this._ecModel;\n    var focus = emphasisModel.get('focus');\n    var focusOrIndices = focus === 'relative' ? zrUtil.concatArray(node.getAncestorsIndices(), node.getDescendantIndices()) : focus === 'ancestor' ? node.getAncestorsIndices() : focus === 'descendant' ? node.getDescendantIndices() : focus;\n    toggleHoverEmphasis(this, focusOrIndices, emphasisModel.get('blurScope'), emphasisModel.get('disabled'));\n  };\n  SunburstPiece.prototype._updateLabel = function (seriesModel) {\n    var _this = this;\n    var itemModel = this.node.getModel();\n    var normalLabelModel = itemModel.getModel('label');\n    var layout = this.node.getLayout();\n    var angle = layout.endAngle - layout.startAngle;\n    var midAngle = (layout.startAngle + layout.endAngle) / 2;\n    var dx = Math.cos(midAngle);\n    var dy = Math.sin(midAngle);\n    var sector = this;\n    var label = sector.getTextContent();\n    var dataIndex = this.node.dataIndex;\n    var labelMinAngle = normalLabelModel.get('minAngle') / 180 * Math.PI;\n    var isNormalShown = normalLabelModel.get('show') && !(labelMinAngle != null && Math.abs(angle) < labelMinAngle);\n    label.ignore = !isNormalShown;\n    // TODO use setLabelStyle\n    zrUtil.each(DISPLAY_STATES, function (stateName) {\n      var labelStateModel = stateName === 'normal' ? itemModel.getModel('label') : itemModel.getModel([stateName, 'label']);\n      var isNormal = stateName === 'normal';\n      var state = isNormal ? label : label.ensureState(stateName);\n      var text = seriesModel.getFormattedLabel(dataIndex, stateName);\n      if (isNormal) {\n        text = text || _this.node.name;\n      }\n      state.style = createTextStyle(labelStateModel, {}, null, stateName !== 'normal', true);\n      if (text) {\n        state.style.text = text;\n      }\n      // Not displaying text when angle is too small\n      var isShown = labelStateModel.get('show');\n      if (isShown != null && !isNormal) {\n        state.ignore = !isShown;\n      }\n      var labelPosition = getLabelAttr(labelStateModel, 'position');\n      var sectorState = isNormal ? sector : sector.states[stateName];\n      var labelColor = sectorState.style.fill;\n      sectorState.textConfig = {\n        outsideFill: labelStateModel.get('color') === 'inherit' ? labelColor : null,\n        inside: labelPosition !== 'outside'\n      };\n      var r;\n      var labelPadding = getLabelAttr(labelStateModel, 'distance') || 0;\n      var textAlign = getLabelAttr(labelStateModel, 'align');\n      var rotateType = getLabelAttr(labelStateModel, 'rotate');\n      var flipStartAngle = Math.PI * 0.5;\n      var flipEndAngle = Math.PI * 1.5;\n      var midAngleNormal = normalizeRadian(rotateType === 'tangential' ? Math.PI / 2 - midAngle : midAngle);\n      // For text that is up-side down, rotate 180 degrees to make sure\n      // it's readable\n      var needsFlip = midAngleNormal > flipStartAngle && !isRadianAroundZero(midAngleNormal - flipStartAngle) && midAngleNormal < flipEndAngle;\n      if (labelPosition === 'outside') {\n        r = layout.r + labelPadding;\n        textAlign = needsFlip ? 'right' : 'left';\n      } else {\n        if (!textAlign || textAlign === 'center') {\n          // Put label in the center if it's a circle\n          if (angle === 2 * Math.PI && layout.r0 === 0) {\n            r = 0;\n          } else {\n            r = (layout.r + layout.r0) / 2;\n          }\n          textAlign = 'center';\n        } else if (textAlign === 'left') {\n          r = layout.r0 + labelPadding;\n          textAlign = needsFlip ? 'right' : 'left';\n        } else if (textAlign === 'right') {\n          r = layout.r - labelPadding;\n          textAlign = needsFlip ? 'left' : 'right';\n        }\n      }\n      state.style.align = textAlign;\n      state.style.verticalAlign = getLabelAttr(labelStateModel, 'verticalAlign') || 'middle';\n      state.x = r * dx + layout.cx;\n      state.y = r * dy + layout.cy;\n      var rotate = 0;\n      if (rotateType === 'radial') {\n        rotate = normalizeRadian(-midAngle) + (needsFlip ? Math.PI : 0);\n      } else if (rotateType === 'tangential') {\n        rotate = normalizeRadian(Math.PI / 2 - midAngle) + (needsFlip ? Math.PI : 0);\n      } else if (zrUtil.isNumber(rotateType)) {\n        rotate = rotateType * Math.PI / 180;\n      }\n      state.rotation = normalizeRadian(rotate);\n    });\n    function getLabelAttr(model, name) {\n      var stateAttr = model.get(name);\n      if (stateAttr == null) {\n        return normalLabelModel.get(name);\n      }\n      return stateAttr;\n    }\n    label.dirtyStyle();\n  };\n  return SunburstPiece;\n}(graphic.Sector);\nexport default SunburstPiece;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { extend } from 'zrender/lib/core/util.js';\nimport { deprecateReplaceLog } from '../../util/log.js';\nimport { retrieveTargetInfo, aboveViewRoot } from '../helper/treeHelper.js';\nexport var ROOT_TO_NODE_ACTION = 'sunburstRootToNode';\nvar HIGHLIGHT_ACTION = 'sunburstHighlight';\nvar UNHIGHLIGHT_ACTION = 'sunburstUnhighlight';\nexport function installSunburstAction(registers) {\n  registers.registerAction({\n    type: ROOT_TO_NODE_ACTION,\n    update: 'updateView'\n  }, function (payload, ecModel) {\n    ecModel.eachComponent({\n      mainType: 'series',\n      subType: 'sunburst',\n      query: payload\n    }, handleRootToNode);\n    function handleRootToNode(model, index) {\n      var targetInfo = retrieveTargetInfo(payload, [ROOT_TO_NODE_ACTION], model);\n      if (targetInfo) {\n        var originViewRoot = model.getViewRoot();\n        if (originViewRoot) {\n          payload.direction = aboveViewRoot(originViewRoot, targetInfo.node) ? 'rollUp' : 'drillDown';\n        }\n        model.resetViewRoot(targetInfo.node);\n      }\n    }\n  });\n  registers.registerAction({\n    type: HIGHLIGHT_ACTION,\n    update: 'none'\n  }, function (payload, ecModel, api) {\n    // Clone\n    payload = extend({}, payload);\n    ecModel.eachComponent({\n      mainType: 'series',\n      subType: 'sunburst',\n      query: payload\n    }, handleHighlight);\n    function handleHighlight(model) {\n      var targetInfo = retrieveTargetInfo(payload, [HIGHLIGHT_ACTION], model);\n      if (targetInfo) {\n        payload.dataIndex = targetInfo.node.dataIndex;\n      }\n    }\n    if (process.env.NODE_ENV !== 'production') {\n      deprecateReplaceLog('sunburstHighlight', 'highlight');\n    }\n    // Fast forward action\n    api.dispatchAction(extend(payload, {\n      type: 'highlight'\n    }));\n  });\n  registers.registerAction({\n    type: UNHIGHLIGHT_ACTION,\n    update: 'updateView'\n  }, function (payload, ecModel, api) {\n    payload = extend({}, payload);\n    if (process.env.NODE_ENV !== 'production') {\n      deprecateReplaceLog('sunburstUnhighlight', 'downplay');\n    }\n    api.dispatchAction(extend(payload, {\n      type: 'downplay'\n    }));\n  });\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport ChartView from '../../view/Chart.js';\nimport SunburstPiece from './SunburstPiece.js';\nimport DataDiffer from '../../data/DataDiffer.js';\nimport { ROOT_TO_NODE_ACTION } from './sunburstAction.js';\nimport { windowOpen } from '../../util/format.js';\nvar SunburstView = /** @class */function (_super) {\n  __extends(SunburstView, _super);\n  function SunburstView() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = SunburstView.type;\n    return _this;\n  }\n  SunburstView.prototype.render = function (seriesModel, ecModel, api,\n  // @ts-ignore\n  payload) {\n    var self = this;\n    this.seriesModel = seriesModel;\n    this.api = api;\n    this.ecModel = ecModel;\n    var data = seriesModel.getData();\n    var virtualRoot = data.tree.root;\n    var newRoot = seriesModel.getViewRoot();\n    var group = this.group;\n    var renderLabelForZeroData = seriesModel.get('renderLabelForZeroData');\n    var newChildren = [];\n    newRoot.eachNode(function (node) {\n      newChildren.push(node);\n    });\n    var oldChildren = this._oldChildren || [];\n    dualTravel(newChildren, oldChildren);\n    renderRollUp(virtualRoot, newRoot);\n    this._initEvents();\n    this._oldChildren = newChildren;\n    function dualTravel(newChildren, oldChildren) {\n      if (newChildren.length === 0 && oldChildren.length === 0) {\n        return;\n      }\n      new DataDiffer(oldChildren, newChildren, getKey, getKey).add(processNode).update(processNode).remove(zrUtil.curry(processNode, null)).execute();\n      function getKey(node) {\n        return node.getId();\n      }\n      function processNode(newIdx, oldIdx) {\n        var newNode = newIdx == null ? null : newChildren[newIdx];\n        var oldNode = oldIdx == null ? null : oldChildren[oldIdx];\n        doRenderNode(newNode, oldNode);\n      }\n    }\n    function doRenderNode(newNode, oldNode) {\n      if (!renderLabelForZeroData && newNode && !newNode.getValue()) {\n        // Not render data with value 0\n        newNode = null;\n      }\n      if (newNode !== virtualRoot && oldNode !== virtualRoot) {\n        if (oldNode && oldNode.piece) {\n          if (newNode) {\n            // Update\n            oldNode.piece.updateData(false, newNode, seriesModel, ecModel, api);\n            // For tooltip\n            data.setItemGraphicEl(newNode.dataIndex, oldNode.piece);\n          } else {\n            // Remove\n            removeNode(oldNode);\n          }\n        } else if (newNode) {\n          // Add\n          var piece = new SunburstPiece(newNode, seriesModel, ecModel, api);\n          group.add(piece);\n          // For tooltip\n          data.setItemGraphicEl(newNode.dataIndex, piece);\n        }\n      }\n    }\n    function removeNode(node) {\n      if (!node) {\n        return;\n      }\n      if (node.piece) {\n        group.remove(node.piece);\n        node.piece = null;\n      }\n    }\n    function renderRollUp(virtualRoot, viewRoot) {\n      if (viewRoot.depth > 0) {\n        // Render\n        if (self.virtualPiece) {\n          // Update\n          self.virtualPiece.updateData(false, virtualRoot, seriesModel, ecModel, api);\n        } else {\n          // Add\n          self.virtualPiece = new SunburstPiece(virtualRoot, seriesModel, ecModel, api);\n          group.add(self.virtualPiece);\n        }\n        // TODO event scope\n        viewRoot.piece.off('click');\n        self.virtualPiece.on('click', function (e) {\n          self._rootToNode(viewRoot.parentNode);\n        });\n      } else if (self.virtualPiece) {\n        // Remove\n        group.remove(self.virtualPiece);\n        self.virtualPiece = null;\n      }\n    }\n  };\n  /**\n   * @private\n   */\n  SunburstView.prototype._initEvents = function () {\n    var _this = this;\n    this.group.off('click');\n    this.group.on('click', function (e) {\n      var targetFound = false;\n      var viewRoot = _this.seriesModel.getViewRoot();\n      viewRoot.eachNode(function (node) {\n        if (!targetFound && node.piece && node.piece === e.target) {\n          var nodeClick = node.getModel().get('nodeClick');\n          if (nodeClick === 'rootToNode') {\n            _this._rootToNode(node);\n          } else if (nodeClick === 'link') {\n            var itemModel = node.getModel();\n            var link = itemModel.get('link');\n            if (link) {\n              var linkTarget = itemModel.get('target', true) || '_blank';\n              windowOpen(link, linkTarget);\n            }\n          }\n          targetFound = true;\n        }\n      });\n    });\n  };\n  /**\n   * @private\n   */\n  SunburstView.prototype._rootToNode = function (node) {\n    if (node !== this.seriesModel.getViewRoot()) {\n      this.api.dispatchAction({\n        type: ROOT_TO_NODE_ACTION,\n        from: this.uid,\n        seriesId: this.seriesModel.id,\n        targetNode: node\n      });\n    }\n  };\n  /**\n   * @implement\n   */\n  SunburstView.prototype.containPoint = function (point, seriesModel) {\n    var treeRoot = seriesModel.getData();\n    var itemLayout = treeRoot.getItemLayout(0);\n    if (itemLayout) {\n      var dx = point[0] - itemLayout.cx;\n      var dy = point[1] - itemLayout.cy;\n      var radius = Math.sqrt(dx * dx + dy * dy);\n      return radius <= itemLayout.r && radius >= itemLayout.r0;\n    }\n  };\n  SunburstView.type = 'sunburst';\n  return SunburstView;\n}(ChartView);\nexport default SunburstView;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport SeriesModel from '../../model/Series.js';\nimport Tree from '../../data/Tree.js';\nimport { wrapTreePathInfo } from '../helper/treeHelper.js';\nimport Model from '../../model/Model.js';\nimport enableAriaDecalForTree from '../helper/enableAriaDecalForTree.js';\nvar SunburstSeriesModel = /** @class */function (_super) {\n  __extends(SunburstSeriesModel, _super);\n  function SunburstSeriesModel() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = SunburstSeriesModel.type;\n    _this.ignoreStyleOnData = true;\n    return _this;\n  }\n  SunburstSeriesModel.prototype.getInitialData = function (option, ecModel) {\n    // Create a virtual root.\n    var root = {\n      name: option.name,\n      children: option.data\n    };\n    completeTreeValue(root);\n    var levelModels = this._levelModels = zrUtil.map(option.levels || [], function (levelDefine) {\n      return new Model(levelDefine, this, ecModel);\n    }, this);\n    // Make sure always a new tree is created when setOption,\n    // in TreemapView, we check whether oldTree === newTree\n    // to choose mappings approach among old shapes and new shapes.\n    var tree = Tree.createTree(root, this, beforeLink);\n    function beforeLink(nodeData) {\n      nodeData.wrapMethod('getItemModel', function (model, idx) {\n        var node = tree.getNodeByDataIndex(idx);\n        var levelModel = levelModels[node.depth];\n        levelModel && (model.parentModel = levelModel);\n        return model;\n      });\n    }\n    return tree.data;\n  };\n  SunburstSeriesModel.prototype.optionUpdated = function () {\n    this.resetViewRoot();\n  };\n  /*\n   * @override\n   */\n  SunburstSeriesModel.prototype.getDataParams = function (dataIndex) {\n    var params = _super.prototype.getDataParams.apply(this, arguments);\n    var node = this.getData().tree.getNodeByDataIndex(dataIndex);\n    params.treePathInfo = wrapTreePathInfo(node, this);\n    return params;\n  };\n  SunburstSeriesModel.prototype.getLevelModel = function (node) {\n    return this._levelModels && this._levelModels[node.depth];\n  };\n  SunburstSeriesModel.prototype.getViewRoot = function () {\n    return this._viewRoot;\n  };\n  SunburstSeriesModel.prototype.resetViewRoot = function (viewRoot) {\n    viewRoot ? this._viewRoot = viewRoot : viewRoot = this._viewRoot;\n    var root = this.getRawData().tree.root;\n    if (!viewRoot || viewRoot !== root && !root.contains(viewRoot)) {\n      this._viewRoot = root;\n    }\n  };\n  SunburstSeriesModel.prototype.enableAriaDecal = function () {\n    enableAriaDecalForTree(this);\n  };\n  SunburstSeriesModel.type = 'series.sunburst';\n  SunburstSeriesModel.defaultOption = {\n    // zlevel: 0,\n    z: 2,\n    // \u9ED8\u8BA4\u5168\u5C40\u5C45\u4E2D\n    center: ['50%', '50%'],\n    radius: [0, '75%'],\n    // \u9ED8\u8BA4\u987A\u65F6\u9488\n    clockwise: true,\n    startAngle: 90,\n    // \u6700\u5C0F\u89D2\u5EA6\u6539\u4E3A0\n    minAngle: 0,\n    // If still show when all data zero.\n    stillShowZeroSum: true,\n    // 'rootToNode', 'link', or false\n    nodeClick: 'rootToNode',\n    renderLabelForZeroData: false,\n    label: {\n      // could be: 'radial', 'tangential', or 'none'\n      rotate: 'radial',\n      show: true,\n      opacity: 1,\n      // 'left' is for inner side of inside, and 'right' is for outer\n      // side for inside\n      align: 'center',\n      position: 'inside',\n      distance: 5,\n      silent: true\n    },\n    itemStyle: {\n      borderWidth: 1,\n      borderColor: 'white',\n      borderType: 'solid',\n      shadowBlur: 0,\n      shadowColor: 'rgba(0, 0, 0, 0.2)',\n      shadowOffsetX: 0,\n      shadowOffsetY: 0,\n      opacity: 1\n    },\n    emphasis: {\n      focus: 'descendant'\n    },\n    blur: {\n      itemStyle: {\n        opacity: 0.2\n      },\n      label: {\n        opacity: 0.1\n      }\n    },\n    // Animation type can be expansion, scale.\n    animationType: 'expansion',\n    animationDuration: 1000,\n    animationDurationUpdate: 500,\n    data: [],\n    /**\n     * Sort order.\n     *\n     * Valid values: 'desc', 'asc', null, or callback function.\n     * 'desc' and 'asc' for descend and ascendant order;\n     * null for not sorting;\n     * example of callback function:\n     * function(nodeA, nodeB) {\n     *     return nodeA.getValue() - nodeB.getValue();\n     * }\n     */\n    sort: 'desc'\n  };\n  return SunburstSeriesModel;\n}(SeriesModel);\nfunction completeTreeValue(dataNode) {\n  // Postorder travel tree.\n  // If value of none-leaf node is not set,\n  // calculate it by suming up the value of all children.\n  var sum = 0;\n  zrUtil.each(dataNode.children, function (child) {\n    completeTreeValue(child);\n    var childValue = child.value;\n    // TODO First value of array must be a number\n    zrUtil.isArray(childValue) && (childValue = childValue[0]);\n    sum += childValue;\n  });\n  var thisValue = dataNode.value;\n  if (zrUtil.isArray(thisValue)) {\n    thisValue = thisValue[0];\n  }\n  if (thisValue == null || isNaN(thisValue)) {\n    thisValue = sum;\n  }\n  // Value should not less than 0.\n  if (thisValue < 0) {\n    thisValue = 0;\n  }\n  zrUtil.isArray(dataNode.value) ? dataNode.value[0] = thisValue : dataNode.value = thisValue;\n}\nexport default SunburstSeriesModel;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { parsePercent } from '../../util/number.js';\nimport * as zrUtil from 'zrender/lib/core/util.js';\n// let PI2 = Math.PI * 2;\nvar RADIAN = Math.PI / 180;\nexport default function sunburstLayout(seriesType, ecModel, api) {\n  ecModel.eachSeriesByType(seriesType, function (seriesModel) {\n    var center = seriesModel.get('center');\n    var radius = seriesModel.get('radius');\n    if (!zrUtil.isArray(radius)) {\n      radius = [0, radius];\n    }\n    if (!zrUtil.isArray(center)) {\n      center = [center, center];\n    }\n    var width = api.getWidth();\n    var height = api.getHeight();\n    var size = Math.min(width, height);\n    var cx = parsePercent(center[0], width);\n    var cy = parsePercent(center[1], height);\n    var r0 = parsePercent(radius[0], size / 2);\n    var r = parsePercent(radius[1], size / 2);\n    var startAngle = -seriesModel.get('startAngle') * RADIAN;\n    var minAngle = seriesModel.get('minAngle') * RADIAN;\n    var virtualRoot = seriesModel.getData().tree.root;\n    var treeRoot = seriesModel.getViewRoot();\n    var rootDepth = treeRoot.depth;\n    var sort = seriesModel.get('sort');\n    if (sort != null) {\n      initChildren(treeRoot, sort);\n    }\n    var validDataCount = 0;\n    zrUtil.each(treeRoot.children, function (child) {\n      !isNaN(child.getValue()) && validDataCount++;\n    });\n    var sum = treeRoot.getValue();\n    // Sum may be 0\n    var unitRadian = Math.PI / (sum || validDataCount) * 2;\n    var renderRollupNode = treeRoot.depth > 0;\n    var levels = treeRoot.height - (renderRollupNode ? -1 : 1);\n    var rPerLevel = (r - r0) / (levels || 1);\n    var clockwise = seriesModel.get('clockwise');\n    var stillShowZeroSum = seriesModel.get('stillShowZeroSum');\n    // In the case some sector angle is smaller than minAngle\n    // let restAngle = PI2;\n    // let valueSumLargerThanMinAngle = 0;\n    var dir = clockwise ? 1 : -1;\n    /**\n     * Render a tree\n     * @return increased angle\n     */\n    var renderNode = function (node, startAngle) {\n      if (!node) {\n        return;\n      }\n      var endAngle = startAngle;\n      // Render self\n      if (node !== virtualRoot) {\n        // Tree node is virtual, so it doesn't need to be drawn\n        var value = node.getValue();\n        var angle = sum === 0 && stillShowZeroSum ? unitRadian : value * unitRadian;\n        if (angle < minAngle) {\n          angle = minAngle;\n          // restAngle -= minAngle;\n        }\n        // else {\n        //     valueSumLargerThanMinAngle += value;\n        // }\n        endAngle = startAngle + dir * angle;\n        var depth = node.depth - rootDepth - (renderRollupNode ? -1 : 1);\n        var rStart = r0 + rPerLevel * depth;\n        var rEnd = r0 + rPerLevel * (depth + 1);\n        var levelModel = seriesModel.getLevelModel(node);\n        if (levelModel) {\n          var r0_1 = levelModel.get('r0', true);\n          var r_1 = levelModel.get('r', true);\n          var radius_1 = levelModel.get('radius', true);\n          if (radius_1 != null) {\n            r0_1 = radius_1[0];\n            r_1 = radius_1[1];\n          }\n          r0_1 != null && (rStart = parsePercent(r0_1, size / 2));\n          r_1 != null && (rEnd = parsePercent(r_1, size / 2));\n        }\n        node.setLayout({\n          angle: angle,\n          startAngle: startAngle,\n          endAngle: endAngle,\n          clockwise: clockwise,\n          cx: cx,\n          cy: cy,\n          r0: rStart,\n          r: rEnd\n        });\n      }\n      // Render children\n      if (node.children && node.children.length) {\n        // currentAngle = startAngle;\n        var siblingAngle_1 = 0;\n        zrUtil.each(node.children, function (node) {\n          siblingAngle_1 += renderNode(node, startAngle + siblingAngle_1);\n        });\n      }\n      return endAngle - startAngle;\n    };\n    // Virtual root node for roll up\n    if (renderRollupNode) {\n      var rStart = r0;\n      var rEnd = r0 + rPerLevel;\n      var angle = Math.PI * 2;\n      virtualRoot.setLayout({\n        angle: angle,\n        startAngle: startAngle,\n        endAngle: startAngle + angle,\n        clockwise: clockwise,\n        cx: cx,\n        cy: cy,\n        r0: rStart,\n        r: rEnd\n      });\n    }\n    renderNode(treeRoot, startAngle);\n  });\n}\n/**\n * Init node children by order and update visual\n */\nfunction initChildren(node, sortOrder) {\n  var children = node.children || [];\n  node.children = sort(children, sortOrder);\n  // Init children recursively\n  if (children.length) {\n    zrUtil.each(node.children, function (child) {\n      initChildren(child, sortOrder);\n    });\n  }\n}\n/**\n * Sort children nodes\n *\n * @param {TreeNode[]}               children children of node to be sorted\n * @param {string | function | null} sort sort method\n *                                   See SunburstSeries.js for details.\n */\nfunction sort(children, sortOrder) {\n  if (zrUtil.isFunction(sortOrder)) {\n    var sortTargets = zrUtil.map(children, function (child, idx) {\n      var value = child.getValue();\n      return {\n        params: {\n          depth: child.depth,\n          height: child.height,\n          dataIndex: child.dataIndex,\n          getValue: function () {\n            return value;\n          }\n        },\n        index: idx\n      };\n    });\n    sortTargets.sort(function (a, b) {\n      return sortOrder(a.params, b.params);\n    });\n    return zrUtil.map(sortTargets, function (target) {\n      return children[target.index];\n    });\n  } else {\n    var isAsc_1 = sortOrder === 'asc';\n    return children.sort(function (a, b) {\n      var diff = (a.getValue() - b.getValue()) * (isAsc_1 ? 1 : -1);\n      return diff === 0 ? (a.dataIndex - b.dataIndex) * (isAsc_1 ? -1 : 1) : diff;\n    });\n  }\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { lift } from 'zrender/lib/tool/color.js';\nimport { extend, isString } from 'zrender/lib/core/util.js';\nimport tokens from '../../visual/tokens.js';\nexport default function sunburstVisual(ecModel) {\n  var paletteScope = {};\n  // Default color strategy\n  function pickColor(node, seriesModel, treeHeight) {\n    if (node.depth === 0) {\n      // Don't use palette color for the root node, because it's displayed only when drilling down.\n      return tokens.color.neutral50;\n    }\n    // Choose color from palette based on the first level.\n    var current = node;\n    while (current && current.depth > 1) {\n      current = current.parentNode;\n    }\n    var color = seriesModel.getColorFromPalette(current.name || current.dataIndex + '', paletteScope);\n    if (node.depth > 1 && isString(color)) {\n      // Lighter on the deeper level.\n      color = lift(color, (node.depth - 1) / (treeHeight - 1) * 0.5);\n    }\n    return color;\n  }\n  ecModel.eachSeriesByType('sunburst', function (seriesModel) {\n    var data = seriesModel.getData();\n    var tree = data.tree;\n    tree.eachNode(function (node) {\n      var model = node.getModel();\n      var style = model.getModel('itemStyle').getItemStyle();\n      if (!style.fill) {\n        style.fill = pickColor(node, seriesModel, tree.root.height);\n      }\n      var existsStyle = data.ensureUniqueItemVisual(node.dataIndex, 'style');\n      extend(existsStyle, style);\n    });\n  });\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport SunburstView from './SunburstView.js';\nimport SunburstSeriesModel from './SunburstSeries.js';\nimport sunburstLayout from './sunburstLayout.js';\nimport sunburstVisual from './sunburstVisual.js';\nimport dataFilter from '../../processor/dataFilter.js';\nimport { curry } from 'zrender/lib/core/util.js';\nimport { installSunburstAction } from './sunburstAction.js';\nexport function install(registers) {\n  registers.registerChartView(SunburstView);\n  registers.registerSeriesModel(SunburstSeriesModel);\n  registers.registerLayout(curry(sunburstLayout, 'sunburst'));\n  registers.registerProcessor(curry(dataFilter, 'sunburst'));\n  registers.registerVisual(sunburstVisual);\n  installSunburstAction(registers);\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport createSeriesData from '../helper/createSeriesData.js';\nimport { makeInner } from '../../util/model.js';\nimport SeriesModel from '../../model/Series.js';\n// Also compat with ec4, where\n// `visual('color') visual('borderColor')` is supported.\nexport var STYLE_VISUAL_TYPE = {\n  color: 'fill',\n  borderColor: 'stroke'\n};\nexport var NON_STYLE_VISUAL_PROPS = {\n  symbol: 1,\n  symbolSize: 1,\n  symbolKeepAspect: 1,\n  legendIcon: 1,\n  visualMeta: 1,\n  liftZ: 1,\n  decal: 1\n};\n;\nexport var customInnerStore = makeInner();\nvar CustomSeriesModel = /** @class */function (_super) {\n  __extends(CustomSeriesModel, _super);\n  function CustomSeriesModel() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = CustomSeriesModel.type;\n    return _this;\n  }\n  CustomSeriesModel.prototype.optionUpdated = function () {\n    this.currentZLevel = this.get('zlevel', true);\n    this.currentZ = this.get('z', true);\n  };\n  CustomSeriesModel.prototype.getInitialData = function (option, ecModel) {\n    return createSeriesData(null, this);\n  };\n  CustomSeriesModel.prototype.getDataParams = function (dataIndex, dataType, el) {\n    var params = _super.prototype.getDataParams.call(this, dataIndex, dataType);\n    el && (params.info = customInnerStore(el).info);\n    return params;\n  };\n  CustomSeriesModel.type = 'series.custom';\n  CustomSeriesModel.dependencies = ['grid', 'polar', 'geo', 'singleAxis', 'calendar', 'matrix'];\n  CustomSeriesModel.defaultOption = {\n    coordinateSystem: 'cartesian2d',\n    // zlevel: 0,\n    z: 2,\n    legendHoverLink: true,\n    // Custom series will not clip by default.\n    // Some case will use custom series to draw label\n    // For example https://echarts.apache.org/examples/en/editor.html?c=custom-gantt-flight\n    clip: false\n    // Cartesian coordinate system\n    // xAxisIndex: 0,\n    // yAxisIndex: 0,\n    // Polar coordinate system\n    // polarIndex: 0,\n    // Geo coordinate system\n    // geoIndex: 0,\n  };\n  return CustomSeriesModel;\n}(SeriesModel);\nexport default CustomSeriesModel;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nfunction dataToCoordSize(dataSize, dataItem) {\n  // dataItem is necessary in log axis.\n  dataItem = dataItem || [0, 0];\n  return zrUtil.map(['x', 'y'], function (dim, dimIdx) {\n    var axis = this.getAxis(dim);\n    var val = dataItem[dimIdx];\n    var halfSize = dataSize[dimIdx] / 2;\n    return axis.type === 'category' ? axis.getBandWidth() : Math.abs(axis.dataToCoord(val - halfSize) - axis.dataToCoord(val + halfSize));\n  }, this);\n}\nexport default function cartesianPrepareCustom(coordSys) {\n  var rect = coordSys.master.getRect();\n  return {\n    coordSys: {\n      // The name exposed to user is always 'cartesian2d' but not 'grid'.\n      type: 'cartesian2d',\n      x: rect.x,\n      y: rect.y,\n      width: rect.width,\n      height: rect.height\n    },\n    api: {\n      coord: function (data) {\n        // do not provide \"out\" param\n        return coordSys.dataToPoint(data);\n      },\n      size: zrUtil.bind(dataToCoordSize, coordSys)\n    }\n  };\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nfunction dataToCoordSize(dataSize, dataItem) {\n  dataItem = dataItem || [0, 0];\n  return zrUtil.map([0, 1], function (dimIdx) {\n    var val = dataItem[dimIdx];\n    var halfSize = dataSize[dimIdx] / 2;\n    var p1 = [];\n    var p2 = [];\n    p1[dimIdx] = val - halfSize;\n    p2[dimIdx] = val + halfSize;\n    p1[1 - dimIdx] = p2[1 - dimIdx] = dataItem[1 - dimIdx];\n    return Math.abs(this.dataToPoint(p1)[dimIdx] - this.dataToPoint(p2)[dimIdx]);\n  }, this);\n}\nexport default function geoPrepareCustom(coordSys) {\n  var rect = coordSys.getBoundingRect();\n  return {\n    coordSys: {\n      type: 'geo',\n      x: rect.x,\n      y: rect.y,\n      width: rect.width,\n      height: rect.height,\n      zoom: coordSys.getZoom()\n    },\n    api: {\n      coord: function (data) {\n        // do not provide \"out\" and noRoam param,\n        // Compatible with this usage:\n        // echarts.util.map(item.points, api.coord)\n        return coordSys.dataToPoint(data);\n      },\n      size: zrUtil.bind(dataToCoordSize, coordSys)\n    }\n  };\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { bind } from 'zrender/lib/core/util.js';\nfunction dataToCoordSize(dataSize, dataItem) {\n  // dataItem is necessary in log axis.\n  var axis = this.getAxis();\n  var val = dataItem instanceof Array ? dataItem[0] : dataItem;\n  var halfSize = (dataSize instanceof Array ? dataSize[0] : dataSize) / 2;\n  return axis.type === 'category' ? axis.getBandWidth() : Math.abs(axis.dataToCoord(val - halfSize) - axis.dataToCoord(val + halfSize));\n}\nexport default function singlePrepareCustom(coordSys) {\n  var rect = coordSys.getRect();\n  return {\n    coordSys: {\n      type: 'singleAxis',\n      x: rect.x,\n      y: rect.y,\n      width: rect.width,\n      height: rect.height\n    },\n    api: {\n      coord: function (val) {\n        // do not provide \"out\" param\n        return coordSys.dataToPoint(val);\n      },\n      size: bind(dataToCoordSize, coordSys)\n    }\n  };\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\n// import AngleAxis from './AngleAxis.js';\nfunction dataToCoordSize(dataSize, dataItem) {\n  // dataItem is necessary in log axis.\n  dataItem = dataItem || [0, 0];\n  return zrUtil.map(['Radius', 'Angle'], function (dim, dimIdx) {\n    var getterName = 'get' + dim + 'Axis';\n    // TODO: TYPE Check Angle Axis\n    var axis = this[getterName]();\n    var val = dataItem[dimIdx];\n    var halfSize = dataSize[dimIdx] / 2;\n    var result = axis.type === 'category' ? axis.getBandWidth() : Math.abs(axis.dataToCoord(val - halfSize) - axis.dataToCoord(val + halfSize));\n    if (dim === 'Angle') {\n      result = result * Math.PI / 180;\n    }\n    return result;\n  }, this);\n}\nexport default function polarPrepareCustom(coordSys) {\n  var radiusAxis = coordSys.getRadiusAxis();\n  var angleAxis = coordSys.getAngleAxis();\n  var radius = radiusAxis.getExtent();\n  radius[0] > radius[1] && radius.reverse();\n  return {\n    coordSys: {\n      type: 'polar',\n      cx: coordSys.cx,\n      cy: coordSys.cy,\n      r: radius[1],\n      r0: radius[0]\n    },\n    api: {\n      coord: function (data) {\n        var radius = radiusAxis.dataToRadius(data[0]);\n        var angle = angleAxis.dataToAngle(data[1]);\n        var coord = coordSys.coordToPoint([radius, angle]);\n        coord.push(radius, angle * Math.PI / 180);\n        return coord;\n      },\n      size: zrUtil.bind(dataToCoordSize, coordSys)\n    }\n  };\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nexport default function calendarPrepareCustom(coordSys) {\n  var rect = coordSys.getRect();\n  var rangeInfo = coordSys.getRangeInfo();\n  return {\n    coordSys: {\n      type: 'calendar',\n      x: rect.x,\n      y: rect.y,\n      width: rect.width,\n      height: rect.height,\n      cellWidth: coordSys.getCellWidth(),\n      cellHeight: coordSys.getCellHeight(),\n      rangeInfo: {\n        start: rangeInfo.start,\n        end: rangeInfo.end,\n        weeks: rangeInfo.weeks,\n        dayCount: rangeInfo.allDay\n      }\n    },\n    api: {\n      coord: function (data, clamp) {\n        return coordSys.dataToPoint(data, clamp);\n      },\n      layout: function (data, clamp) {\n        return coordSys.dataToLayout(data, clamp);\n      }\n    }\n  };\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nexport default function matrixPrepareCustom(coordSys) {\n  var rect = coordSys.getRect();\n  return {\n    coordSys: {\n      type: 'matrix',\n      x: rect.x,\n      y: rect.y,\n      width: rect.width,\n      height: rect.height\n    },\n    api: {\n      coord: function (data, opt) {\n        return coordSys.dataToPoint(data, opt);\n      },\n      layout: function (data, opt) {\n        return coordSys.dataToLayout(data, opt);\n      }\n    }\n  };\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { each, hasOwn } from 'zrender/lib/core/util.js';\nimport tokens from '../visual/tokens.js';\nvar deprecatedLogs = {};\n/**\n * Whether need to call `convertEC4CompatibleStyle`.\n */\nexport function isEC4CompatibleStyle(style, elType, hasOwnTextContentOption, hasOwnTextConfig) {\n  // Since echarts5, `RectText` is separated from its host element and style.text\n  // does not exist any more. The compat work brings some extra burden on performance.\n  // So we provide:\n  // `legacy: true` force make compat.\n  // `legacy: false`, force do not compat.\n  // `legacy` not set: auto detect whether legacy.\n  //     But in this case we do not compat (difficult to detect and rare case):\n  //     Because custom series and graphic component support \"merge\", users may firstly\n  //     only set `textStrokeWidth` style or secondly only set `text`.\n  return style && (style.legacy || style.legacy !== false && !hasOwnTextContentOption && !hasOwnTextConfig && elType !== 'tspan'\n  // Difficult to detect whether legacy for a \"text\" el.\n  && (elType === 'text' || hasOwn(style, 'text')));\n}\n/**\n * `EC4CompatibleStyle` is style that might be in echarts4 format or echarts5 format.\n * @param hostStyle The properties might be modified.\n * @return If be text el, `textContentStyle` and `textConfig` will not be returned.\n *         Otherwise a `textContentStyle` and `textConfig` will be created, whose props area\n *         retried from the `hostStyle`.\n */\nexport function convertFromEC4CompatibleStyle(hostStyle, elType, isNormal) {\n  var srcStyle = hostStyle;\n  var textConfig;\n  var textContent;\n  var textContentStyle;\n  if (elType === 'text') {\n    textContentStyle = srcStyle;\n  } else {\n    textContentStyle = {};\n    hasOwn(srcStyle, 'text') && (textContentStyle.text = srcStyle.text);\n    hasOwn(srcStyle, 'rich') && (textContentStyle.rich = srcStyle.rich);\n    hasOwn(srcStyle, 'textFill') && (textContentStyle.fill = srcStyle.textFill);\n    hasOwn(srcStyle, 'textStroke') && (textContentStyle.stroke = srcStyle.textStroke);\n    hasOwn(srcStyle, 'fontFamily') && (textContentStyle.fontFamily = srcStyle.fontFamily);\n    hasOwn(srcStyle, 'fontSize') && (textContentStyle.fontSize = srcStyle.fontSize);\n    hasOwn(srcStyle, 'fontStyle') && (textContentStyle.fontStyle = srcStyle.fontStyle);\n    hasOwn(srcStyle, 'fontWeight') && (textContentStyle.fontWeight = srcStyle.fontWeight);\n    textContent = {\n      type: 'text',\n      style: textContentStyle,\n      // ec4 does not support rectText trigger.\n      // And when text position is different in normal and emphasis\n      // => hover text trigger emphasis;\n      // => text position changed, leave mouse pointer immediately;\n      // That might cause incorrect state.\n      silent: true\n    };\n    textConfig = {};\n    var hasOwnPos = hasOwn(srcStyle, 'textPosition');\n    if (isNormal) {\n      textConfig.position = hasOwnPos ? srcStyle.textPosition : 'inside';\n    } else {\n      hasOwnPos && (textConfig.position = srcStyle.textPosition);\n    }\n    hasOwn(srcStyle, 'textPosition') && (textConfig.position = srcStyle.textPosition);\n    hasOwn(srcStyle, 'textOffset') && (textConfig.offset = srcStyle.textOffset);\n    hasOwn(srcStyle, 'textRotation') && (textConfig.rotation = srcStyle.textRotation);\n    hasOwn(srcStyle, 'textDistance') && (textConfig.distance = srcStyle.textDistance);\n  }\n  convertEC4CompatibleRichItem(textContentStyle, hostStyle);\n  each(textContentStyle.rich, function (richItem) {\n    convertEC4CompatibleRichItem(richItem, richItem);\n  });\n  return {\n    textConfig: textConfig,\n    textContent: textContent\n  };\n}\n/**\n * The result will be set to `out`.\n */\nfunction convertEC4CompatibleRichItem(out, richItem) {\n  if (!richItem) {\n    return;\n  }\n  // (1) For simplicity, make textXXX properties (deprecated since ec5) has\n  // higher priority. For example, consider in ec4 `borderColor: 5, textBorderColor: 10`\n  // on a rect means `borderColor: 4` on the rect and `borderColor: 10` on an attached\n  // richText in ec5.\n  // (2) `out === richItem` if and only if `out` is text el or rich item.\n  // So we can overwrite existing props in `out` since textXXX has higher priority.\n  richItem.font = richItem.textFont || richItem.font;\n  hasOwn(richItem, 'textStrokeWidth') && (out.lineWidth = richItem.textStrokeWidth);\n  hasOwn(richItem, 'textAlign') && (out.align = richItem.textAlign);\n  hasOwn(richItem, 'textVerticalAlign') && (out.verticalAlign = richItem.textVerticalAlign);\n  hasOwn(richItem, 'textLineHeight') && (out.lineHeight = richItem.textLineHeight);\n  hasOwn(richItem, 'textWidth') && (out.width = richItem.textWidth);\n  hasOwn(richItem, 'textHeight') && (out.height = richItem.textHeight);\n  hasOwn(richItem, 'textBackgroundColor') && (out.backgroundColor = richItem.textBackgroundColor);\n  hasOwn(richItem, 'textPadding') && (out.padding = richItem.textPadding);\n  hasOwn(richItem, 'textBorderColor') && (out.borderColor = richItem.textBorderColor);\n  hasOwn(richItem, 'textBorderWidth') && (out.borderWidth = richItem.textBorderWidth);\n  hasOwn(richItem, 'textBorderRadius') && (out.borderRadius = richItem.textBorderRadius);\n  hasOwn(richItem, 'textBoxShadowColor') && (out.shadowColor = richItem.textBoxShadowColor);\n  hasOwn(richItem, 'textBoxShadowBlur') && (out.shadowBlur = richItem.textBoxShadowBlur);\n  hasOwn(richItem, 'textBoxShadowOffsetX') && (out.shadowOffsetX = richItem.textBoxShadowOffsetX);\n  hasOwn(richItem, 'textBoxShadowOffsetY') && (out.shadowOffsetY = richItem.textBoxShadowOffsetY);\n}\n/**\n * Convert to pure echarts4 format style.\n * `itemStyle` will be modified, added with ec4 style properties from\n * `textStyle` and `textConfig`.\n *\n * [Caveat]: For simplicity, `insideRollback` in ec4 does not compat, where\n * `styleEmphasis: {textFill: 'red'}` will remove the normal auto added stroke.\n */\nexport function convertToEC4StyleForCustomSerise(itemStl, txStl, txCfg) {\n  var out = itemStl;\n  // See `custom.ts`, a trick to set extra `textPosition` firstly.\n  out.textPosition = out.textPosition || txCfg.position || 'inside';\n  txCfg.offset != null && (out.textOffset = txCfg.offset);\n  txCfg.rotation != null && (out.textRotation = txCfg.rotation);\n  txCfg.distance != null && (out.textDistance = txCfg.distance);\n  var isInside = out.textPosition.indexOf('inside') >= 0;\n  var hostFill = itemStl.fill || tokens.color.neutral99;\n  convertToEC4RichItem(out, txStl);\n  var textFillNotSet = out.textFill == null;\n  if (isInside) {\n    if (textFillNotSet) {\n      out.textFill = txCfg.insideFill || tokens.color.neutral00;\n      !out.textStroke && txCfg.insideStroke && (out.textStroke = txCfg.insideStroke);\n      !out.textStroke && (out.textStroke = hostFill);\n      out.textStrokeWidth == null && (out.textStrokeWidth = 2);\n    }\n  } else {\n    if (textFillNotSet) {\n      out.textFill = itemStl.fill || txCfg.outsideFill || tokens.color.neutral00;\n    }\n    !out.textStroke && txCfg.outsideStroke && (out.textStroke = txCfg.outsideStroke);\n  }\n  out.text = txStl.text;\n  out.rich = txStl.rich;\n  each(txStl.rich, function (richItem) {\n    convertToEC4RichItem(richItem, richItem);\n  });\n  return out;\n}\nfunction convertToEC4RichItem(out, richItem) {\n  if (!richItem) {\n    return;\n  }\n  hasOwn(richItem, 'fill') && (out.textFill = richItem.fill);\n  hasOwn(richItem, 'stroke') && (out.textStroke = richItem.fill);\n  hasOwn(richItem, 'lineWidth') && (out.textStrokeWidth = richItem.lineWidth);\n  hasOwn(richItem, 'font') && (out.font = richItem.font);\n  hasOwn(richItem, 'fontStyle') && (out.fontStyle = richItem.fontStyle);\n  hasOwn(richItem, 'fontWeight') && (out.fontWeight = richItem.fontWeight);\n  hasOwn(richItem, 'fontSize') && (out.fontSize = richItem.fontSize);\n  hasOwn(richItem, 'fontFamily') && (out.fontFamily = richItem.fontFamily);\n  hasOwn(richItem, 'align') && (out.textAlign = richItem.align);\n  hasOwn(richItem, 'verticalAlign') && (out.textVerticalAlign = richItem.verticalAlign);\n  hasOwn(richItem, 'lineHeight') && (out.textLineHeight = richItem.lineHeight);\n  hasOwn(richItem, 'width') && (out.textWidth = richItem.width);\n  hasOwn(richItem, 'height') && (out.textHeight = richItem.height);\n  hasOwn(richItem, 'backgroundColor') && (out.textBackgroundColor = richItem.backgroundColor);\n  hasOwn(richItem, 'padding') && (out.textPadding = richItem.padding);\n  hasOwn(richItem, 'borderColor') && (out.textBorderColor = richItem.borderColor);\n  hasOwn(richItem, 'borderWidth') && (out.textBorderWidth = richItem.borderWidth);\n  hasOwn(richItem, 'borderRadius') && (out.textBorderRadius = richItem.borderRadius);\n  hasOwn(richItem, 'shadowColor') && (out.textBoxShadowColor = richItem.shadowColor);\n  hasOwn(richItem, 'shadowBlur') && (out.textBoxShadowBlur = richItem.shadowBlur);\n  hasOwn(richItem, 'shadowOffsetX') && (out.textBoxShadowOffsetX = richItem.shadowOffsetX);\n  hasOwn(richItem, 'shadowOffsetY') && (out.textBoxShadowOffsetY = richItem.shadowOffsetY);\n  hasOwn(richItem, 'textShadowColor') && (out.textShadowColor = richItem.textShadowColor);\n  hasOwn(richItem, 'textShadowBlur') && (out.textShadowBlur = richItem.textShadowBlur);\n  hasOwn(richItem, 'textShadowOffsetX') && (out.textShadowOffsetX = richItem.textShadowOffsetX);\n  hasOwn(richItem, 'textShadowOffsetY') && (out.textShadowOffsetY = richItem.textShadowOffsetY);\n}\nexport function warnDeprecated(deprecated, insteadApproach) {\n  if (process.env.NODE_ENV !== 'production') {\n    var key = deprecated + '^_^' + insteadApproach;\n    if (!deprecatedLogs[key]) {\n      console.warn(\"[ECharts] DEPRECATED: \\\"\" + deprecated + \"\\\" has been deprecated. \" + insteadApproach);\n      deprecatedLogs[key] = true;\n    }\n  }\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { makeInner, normalizeToArray } from '../util/model.js';\nimport { assert, bind, each, eqNaN, extend, hasOwn, indexOf, isArrayLike, keys, reduce } from 'zrender/lib/core/util.js';\nimport { cloneValue } from 'zrender/lib/animation/Animator.js';\nimport Displayable from 'zrender/lib/graphic/Displayable.js';\nimport { getAnimationConfig } from './basicTransition.js';\nimport { Path } from '../util/graphic.js';\nimport { warn } from '../util/log.js';\nimport { TRANSFORMABLE_PROPS } from 'zrender/lib/core/Transformable.js';\nvar LEGACY_TRANSFORM_PROPS_MAP = {\n  position: ['x', 'y'],\n  scale: ['scaleX', 'scaleY'],\n  origin: ['originX', 'originY']\n};\nvar LEGACY_TRANSFORM_PROPS = keys(LEGACY_TRANSFORM_PROPS_MAP);\nvar TRANSFORM_PROPS_MAP = reduce(TRANSFORMABLE_PROPS, function (obj, key) {\n  obj[key] = 1;\n  return obj;\n}, {});\nvar transformPropNamesStr = TRANSFORMABLE_PROPS.join(', ');\n// '' means root\nexport var ELEMENT_ANIMATABLE_PROPS = ['', 'style', 'shape', 'extra'];\n;\nvar transitionInnerStore = makeInner();\n;\nfunction getElementAnimationConfig(animationType, el, elOption, parentModel, dataIndex) {\n  var animationProp = animationType + \"Animation\";\n  var config = getAnimationConfig(animationType, parentModel, dataIndex) || {};\n  var userDuring = transitionInnerStore(el).userDuring;\n  // Only set when duration is > 0 and it's need to be animated.\n  if (config.duration > 0) {\n    // For simplicity, if during not specified, the previous during will not work any more.\n    config.during = userDuring ? bind(duringCall, {\n      el: el,\n      userDuring: userDuring\n    }) : null;\n    config.setToFinal = true;\n    config.scope = animationType;\n  }\n  extend(config, elOption[animationProp]);\n  return config;\n}\nexport function applyUpdateTransition(el, elOption, animatableModel, opts) {\n  opts = opts || {};\n  var dataIndex = opts.dataIndex,\n    isInit = opts.isInit,\n    clearStyle = opts.clearStyle;\n  var hasAnimation = animatableModel.isAnimationEnabled();\n  // Save the meta info for further morphing. Like apply on the sub morphing elements.\n  var store = transitionInnerStore(el);\n  var styleOpt = elOption.style;\n  store.userDuring = elOption.during;\n  var transFromProps = {};\n  var propsToSet = {};\n  prepareTransformAllPropsFinal(el, elOption, propsToSet);\n  if (el.type === 'compound') {\n    /**\n     * We cannot directly clone shape for compoundPath,\n     * because it makes the path to be an object instead of a Path instance,\n     * and thus missing `buildPath` method.\n     */\n    var paths = el.shape.paths;\n    var optionPaths = elOption.shape.paths;\n    for (var i = 0; i < optionPaths.length; i++) {\n      var path = optionPaths[i];\n      prepareShapeOrExtraAllPropsFinal('shape', path, paths[i]);\n    }\n  } else {\n    prepareShapeOrExtraAllPropsFinal('shape', elOption, propsToSet);\n    prepareShapeOrExtraAllPropsFinal('extra', elOption, propsToSet);\n  }\n  if (!isInit && hasAnimation) {\n    prepareTransformTransitionFrom(el, elOption, transFromProps);\n    prepareShapeOrExtraTransitionFrom('shape', el, elOption, transFromProps);\n    prepareShapeOrExtraTransitionFrom('extra', el, elOption, transFromProps);\n    prepareStyleTransitionFrom(el, elOption, styleOpt, transFromProps);\n  }\n  propsToSet.style = styleOpt;\n  applyPropsDirectly(el, propsToSet, clearStyle);\n  applyMiscProps(el, elOption);\n  if (hasAnimation) {\n    if (isInit) {\n      var enterFromProps_1 = {};\n      each(ELEMENT_ANIMATABLE_PROPS, function (propName) {\n        var prop = propName ? elOption[propName] : elOption;\n        if (prop && prop.enterFrom) {\n          if (propName) {\n            enterFromProps_1[propName] = enterFromProps_1[propName] || {};\n          }\n          extend(propName ? enterFromProps_1[propName] : enterFromProps_1, prop.enterFrom);\n        }\n      });\n      var config = getElementAnimationConfig('enter', el, elOption, animatableModel, dataIndex);\n      if (config.duration > 0) {\n        el.animateFrom(enterFromProps_1, config);\n      }\n    } else {\n      applyPropsTransition(el, elOption, dataIndex || 0, animatableModel, transFromProps);\n    }\n  }\n  // Store leave to be used in leave transition.\n  updateLeaveTo(el, elOption);\n  styleOpt ? el.dirty() : el.markRedraw();\n}\nexport function updateLeaveTo(el, elOption) {\n  // Try merge to previous set leaveTo\n  var leaveToProps = transitionInnerStore(el).leaveToProps;\n  for (var i = 0; i < ELEMENT_ANIMATABLE_PROPS.length; i++) {\n    var propName = ELEMENT_ANIMATABLE_PROPS[i];\n    var prop = propName ? elOption[propName] : elOption;\n    if (prop && prop.leaveTo) {\n      if (!leaveToProps) {\n        leaveToProps = transitionInnerStore(el).leaveToProps = {};\n      }\n      if (propName) {\n        leaveToProps[propName] = leaveToProps[propName] || {};\n      }\n      extend(propName ? leaveToProps[propName] : leaveToProps, prop.leaveTo);\n    }\n  }\n}\nexport function applyLeaveTransition(el, elOption, animatableModel, onRemove) {\n  if (el) {\n    var parent_1 = el.parent;\n    var leaveToProps = transitionInnerStore(el).leaveToProps;\n    if (leaveToProps) {\n      // TODO TODO use leave after leaveAnimation in series is introduced\n      // TODO Data index?\n      var config = getElementAnimationConfig('update', el, elOption, animatableModel, 0);\n      config.done = function () {\n        parent_1 && parent_1.remove(el);\n        onRemove && onRemove();\n      };\n      el.animateTo(leaveToProps, config);\n    } else {\n      parent_1 && parent_1.remove(el);\n      onRemove && onRemove();\n    }\n  }\n}\nexport function isTransitionAll(transition) {\n  return transition === 'all';\n}\nfunction applyPropsDirectly(el,\n// Can be null/undefined\nallPropsFinal, clearStyle) {\n  var styleOpt = allPropsFinal.style;\n  if (!el.isGroup && styleOpt) {\n    if (clearStyle) {\n      el.useStyle({});\n      // When style object changed, how to trade the existing animation?\n      // It is probably complicated and not needed to cover all the cases.\n      // But still need consider the case:\n      // (1) When using init animation on `style.opacity`, and before the animation\n      //     ended users triggers an update by mousewhel. At that time the init\n      //     animation should better be continued rather than terminated.\n      //     So after `useStyle` called, we should change the animation target manually\n      //     to continue the effect of the init animation.\n      // (2) PENDING: If the previous animation targeted at a `val1`, and currently we need\n      //     to update the value to `val2` and no animation declared, should be terminate\n      //     the previous animation or just modify the target of the animation?\n      //     Therotically That will happen not only on `style` but also on `shape` and\n      //     `transfrom` props. But we haven't handle this case at present yet.\n      // (3) PENDING: Is it proper to visit `animators` and `targetName`?\n      var animators = el.animators;\n      for (var i = 0; i < animators.length; i++) {\n        var animator = animators[i];\n        // targetName is the \"topKey\".\n        if (animator.targetName === 'style') {\n          animator.changeTarget(el.style);\n        }\n      }\n    }\n    el.setStyle(styleOpt);\n  }\n  if (allPropsFinal) {\n    // Not set style here.\n    allPropsFinal.style = null;\n    // Set el to the final state firstly.\n    allPropsFinal && el.attr(allPropsFinal);\n    allPropsFinal.style = styleOpt;\n  }\n}\nfunction applyPropsTransition(el, elOption, dataIndex, model,\n// Can be null/undefined\ntransFromProps) {\n  if (transFromProps) {\n    var config = getElementAnimationConfig('update', el, elOption, model, dataIndex);\n    if (config.duration > 0) {\n      el.animateFrom(transFromProps, config);\n    }\n  }\n}\nfunction applyMiscProps(el, elOption) {\n  // Merge by default.\n  hasOwn(elOption, 'silent') && (el.silent = elOption.silent);\n  hasOwn(elOption, 'ignore') && (el.ignore = elOption.ignore);\n  if (el instanceof Displayable) {\n    hasOwn(elOption, 'invisible') && (el.invisible = elOption.invisible);\n  }\n  if (el instanceof Path) {\n    hasOwn(elOption, 'autoBatch') && (el.autoBatch = elOption.autoBatch);\n  }\n}\n// Use it to avoid it be exposed to user.\nvar tmpDuringScope = {};\nvar transitionDuringAPI = {\n  // Usually other props do not need to be changed in animation during.\n  setTransform: function (key, val) {\n    if (process.env.NODE_ENV !== 'production') {\n      assert(hasOwn(TRANSFORM_PROPS_MAP, key), 'Only ' + transformPropNamesStr + ' available in `setTransform`.');\n    }\n    tmpDuringScope.el[key] = val;\n    return this;\n  },\n  getTransform: function (key) {\n    if (process.env.NODE_ENV !== 'production') {\n      assert(hasOwn(TRANSFORM_PROPS_MAP, key), 'Only ' + transformPropNamesStr + ' available in `getTransform`.');\n    }\n    return tmpDuringScope.el[key];\n  },\n  setShape: function (key, val) {\n    if (process.env.NODE_ENV !== 'production') {\n      assertNotReserved(key);\n    }\n    var el = tmpDuringScope.el;\n    var shape = el.shape || (el.shape = {});\n    shape[key] = val;\n    el.dirtyShape && el.dirtyShape();\n    return this;\n  },\n  getShape: function (key) {\n    if (process.env.NODE_ENV !== 'production') {\n      assertNotReserved(key);\n    }\n    var shape = tmpDuringScope.el.shape;\n    if (shape) {\n      return shape[key];\n    }\n  },\n  setStyle: function (key, val) {\n    if (process.env.NODE_ENV !== 'production') {\n      assertNotReserved(key);\n    }\n    var el = tmpDuringScope.el;\n    var style = el.style;\n    if (style) {\n      if (process.env.NODE_ENV !== 'production') {\n        if (eqNaN(val)) {\n          warn('style.' + key + ' must not be assigned with NaN.');\n        }\n      }\n      style[key] = val;\n      el.dirtyStyle && el.dirtyStyle();\n    }\n    return this;\n  },\n  getStyle: function (key) {\n    if (process.env.NODE_ENV !== 'production') {\n      assertNotReserved(key);\n    }\n    var style = tmpDuringScope.el.style;\n    if (style) {\n      return style[key];\n    }\n  },\n  setExtra: function (key, val) {\n    if (process.env.NODE_ENV !== 'production') {\n      assertNotReserved(key);\n    }\n    var extra = tmpDuringScope.el.extra || (tmpDuringScope.el.extra = {});\n    extra[key] = val;\n    return this;\n  },\n  getExtra: function (key) {\n    if (process.env.NODE_ENV !== 'production') {\n      assertNotReserved(key);\n    }\n    var extra = tmpDuringScope.el.extra;\n    if (extra) {\n      return extra[key];\n    }\n  }\n};\nfunction assertNotReserved(key) {\n  if (process.env.NODE_ENV !== 'production') {\n    if (key === 'transition' || key === 'enterFrom' || key === 'leaveTo') {\n      throw new Error('key must not be \"' + key + '\"');\n    }\n  }\n}\nfunction duringCall() {\n  // Do not provide \"percent\" until some requirements come.\n  // Because consider thies case:\n  // enterFrom: {x: 100, y: 30}, transition: 'x'.\n  // And enter duration is different from update duration.\n  // Thus it might be confused about the meaning of \"percent\" in during callback.\n  var scope = this;\n  var el = scope.el;\n  if (!el) {\n    return;\n  }\n  // If el is remove from zr by reason like legend, during still need to called,\n  // because el will be added back to zr and the prop value should not be incorrect.\n  var latestUserDuring = transitionInnerStore(el).userDuring;\n  var scopeUserDuring = scope.userDuring;\n  // Ensured a during is only called once in each animation frame.\n  // If a during is called multiple times in one frame, maybe some users' calculation logic\n  // might be wrong (not sure whether this usage exists).\n  // The case of a during might be called twice can be: by default there is a animator for\n  // 'x', 'y' when init. Before the init animation finished, call `setOption` to start\n  // another animators for 'style'/'shape'/'extra'.\n  if (latestUserDuring !== scopeUserDuring) {\n    // release\n    scope.el = scope.userDuring = null;\n    return;\n  }\n  tmpDuringScope.el = el;\n  // Give no `this` to user in \"during\" calling.\n  scopeUserDuring(transitionDuringAPI);\n  // FIXME: if in future meet the case that some prop will be both modified in `during` and `state`,\n  // consider the issue that the prop might be incorrect when return to \"normal\" state.\n}\nfunction prepareShapeOrExtraTransitionFrom(mainAttr, fromEl, elOption, transFromProps) {\n  var attrOpt = elOption[mainAttr];\n  if (!attrOpt) {\n    return;\n  }\n  var elPropsInAttr = fromEl[mainAttr];\n  var transFromPropsInAttr;\n  if (elPropsInAttr) {\n    var transition = elOption.transition;\n    var attrTransition = attrOpt.transition;\n    if (attrTransition) {\n      !transFromPropsInAttr && (transFromPropsInAttr = transFromProps[mainAttr] = {});\n      if (isTransitionAll(attrTransition)) {\n        extend(transFromPropsInAttr, elPropsInAttr);\n      } else {\n        var transitionKeys = normalizeToArray(attrTransition);\n        for (var i = 0; i < transitionKeys.length; i++) {\n          var key = transitionKeys[i];\n          var elVal = elPropsInAttr[key];\n          transFromPropsInAttr[key] = elVal;\n        }\n      }\n    } else if (isTransitionAll(transition) || indexOf(transition, mainAttr) >= 0) {\n      !transFromPropsInAttr && (transFromPropsInAttr = transFromProps[mainAttr] = {});\n      var elPropsInAttrKeys = keys(elPropsInAttr);\n      for (var i = 0; i < elPropsInAttrKeys.length; i++) {\n        var key = elPropsInAttrKeys[i];\n        var elVal = elPropsInAttr[key];\n        if (isNonStyleTransitionEnabled(attrOpt[key], elVal)) {\n          transFromPropsInAttr[key] = elVal;\n        }\n      }\n    }\n  }\n}\nfunction prepareShapeOrExtraAllPropsFinal(mainAttr, elOption, allProps) {\n  var attrOpt = elOption[mainAttr];\n  if (!attrOpt) {\n    return;\n  }\n  var allPropsInAttr = allProps[mainAttr] = {};\n  var keysInAttr = keys(attrOpt);\n  for (var i = 0; i < keysInAttr.length; i++) {\n    var key = keysInAttr[i];\n    // To avoid share one object with different element, and\n    // to avoid user modify the object inexpectedly, have to clone.\n    allPropsInAttr[key] = cloneValue(attrOpt[key]);\n  }\n}\nfunction prepareTransformTransitionFrom(el, elOption, transFromProps) {\n  var transition = elOption.transition;\n  var transitionKeys = isTransitionAll(transition) ? TRANSFORMABLE_PROPS : normalizeToArray(transition || []);\n  for (var i = 0; i < transitionKeys.length; i++) {\n    var key = transitionKeys[i];\n    if (key === 'style' || key === 'shape' || key === 'extra') {\n      continue;\n    }\n    var elVal = el[key];\n    if (process.env.NODE_ENV !== 'production') {\n      checkTransformPropRefer(key, 'el.transition');\n    }\n    // Do not clone, animator will perform that clone.\n    transFromProps[key] = elVal;\n  }\n}\nfunction prepareTransformAllPropsFinal(el, elOption, allProps) {\n  for (var i = 0; i < LEGACY_TRANSFORM_PROPS.length; i++) {\n    var legacyName = LEGACY_TRANSFORM_PROPS[i];\n    var xyName = LEGACY_TRANSFORM_PROPS_MAP[legacyName];\n    var legacyArr = elOption[legacyName];\n    if (legacyArr) {\n      allProps[xyName[0]] = legacyArr[0];\n      allProps[xyName[1]] = legacyArr[1];\n    }\n  }\n  for (var i = 0; i < TRANSFORMABLE_PROPS.length; i++) {\n    var key = TRANSFORMABLE_PROPS[i];\n    if (elOption[key] != null) {\n      allProps[key] = elOption[key];\n    }\n  }\n}\nfunction prepareStyleTransitionFrom(fromEl, elOption, styleOpt, transFromProps) {\n  if (!styleOpt) {\n    return;\n  }\n  var fromElStyle = fromEl.style;\n  var transFromStyleProps;\n  if (fromElStyle) {\n    var styleTransition = styleOpt.transition;\n    var elTransition = elOption.transition;\n    if (styleTransition && !isTransitionAll(styleTransition)) {\n      var transitionKeys = normalizeToArray(styleTransition);\n      !transFromStyleProps && (transFromStyleProps = transFromProps.style = {});\n      for (var i = 0; i < transitionKeys.length; i++) {\n        var key = transitionKeys[i];\n        var elVal = fromElStyle[key];\n        // Do not clone, see `checkNonStyleTansitionRefer`.\n        transFromStyleProps[key] = elVal;\n      }\n    } else if (fromEl.getAnimationStyleProps && (isTransitionAll(elTransition) || isTransitionAll(styleTransition) || indexOf(elTransition, 'style') >= 0)) {\n      var animationProps = fromEl.getAnimationStyleProps();\n      var animationStyleProps = animationProps ? animationProps.style : null;\n      if (animationStyleProps) {\n        !transFromStyleProps && (transFromStyleProps = transFromProps.style = {});\n        var styleKeys = keys(styleOpt);\n        for (var i = 0; i < styleKeys.length; i++) {\n          var key = styleKeys[i];\n          if (animationStyleProps[key]) {\n            var elVal = fromElStyle[key];\n            transFromStyleProps[key] = elVal;\n          }\n        }\n      }\n    }\n  }\n}\nfunction isNonStyleTransitionEnabled(optVal, elVal) {\n  // The same as `checkNonStyleTansitionRefer`.\n  return !isArrayLike(optVal) ? optVal != null && isFinite(optVal) : optVal !== elVal;\n}\nvar checkTransformPropRefer;\nif (process.env.NODE_ENV !== 'production') {\n  checkTransformPropRefer = function (key, usedIn) {\n    if (!hasOwn(TRANSFORM_PROPS_MAP, key)) {\n      warn('Prop `' + key + '` is not a permitted in `' + usedIn + '`. ' + 'Only `' + keys(TRANSFORM_PROPS_MAP).join('`, `') + '` are permitted.');\n    }\n  };\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { keys, filter, each, isArray, indexOf } from 'zrender/lib/core/util.js';\nimport { ELEMENT_ANIMATABLE_PROPS } from './customGraphicTransition.js';\nimport { getAnimationConfig } from './basicTransition.js';\nimport { warn } from '../util/log.js';\nimport { makeInner } from '../util/model.js';\nvar getStateToRestore = makeInner();\nvar KEYFRAME_EXCLUDE_KEYS = ['percent', 'easing', 'shape', 'style', 'extra'];\n/**\n * Stop previous keyframe animation and restore the attributes.\n * Avoid new keyframe animation starts with wrong internal state when the percent: 0 is not set.\n */\nexport function stopPreviousKeyframeAnimationAndRestore(el) {\n  // Stop previous keyframe animation.\n  el.stopAnimation('keyframe');\n  // Restore\n  el.attr(getStateToRestore(el));\n}\nexport function applyKeyframeAnimation(el, animationOpts, animatableModel) {\n  if (!animatableModel.isAnimationEnabled() || !animationOpts) {\n    return;\n  }\n  if (isArray(animationOpts)) {\n    each(animationOpts, function (singleAnimationOpts) {\n      applyKeyframeAnimation(el, singleAnimationOpts, animatableModel);\n    });\n    return;\n  }\n  var keyframes = animationOpts.keyframes;\n  var duration = animationOpts.duration;\n  if (animatableModel && duration == null) {\n    // Default to use duration of config.\n    // NOTE: animation config from payload will be ignored because they are mainly for transitions.\n    var config = getAnimationConfig('enter', animatableModel, 0);\n    duration = config && config.duration;\n  }\n  if (!keyframes || !duration) {\n    return;\n  }\n  var stateToRestore = getStateToRestore(el);\n  each(ELEMENT_ANIMATABLE_PROPS, function (targetPropName) {\n    if (targetPropName && !el[targetPropName]) {\n      return;\n    }\n    var animator;\n    var endFrameIsSet = false;\n    // Sort keyframes by percent.\n    keyframes.sort(function (a, b) {\n      return a.percent - b.percent;\n    });\n    each(keyframes, function (kf) {\n      // Stop current animation.\n      var animators = el.animators;\n      var kfValues = targetPropName ? kf[targetPropName] : kf;\n      if (process.env.NODE_ENV !== 'production') {\n        if (kf.percent >= 1) {\n          endFrameIsSet = true;\n        }\n      }\n      if (!kfValues) {\n        return;\n      }\n      var propKeys = keys(kfValues);\n      if (!targetPropName) {\n        // PENDING performance?\n        propKeys = filter(propKeys, function (key) {\n          return indexOf(KEYFRAME_EXCLUDE_KEYS, key) < 0;\n        });\n      }\n      if (!propKeys.length) {\n        return;\n      }\n      if (!animator) {\n        animator = el.animate(targetPropName, animationOpts.loop, true);\n        animator.scope = 'keyframe';\n      }\n      for (var i = 0; i < animators.length; i++) {\n        // Stop all other animation that is not keyframe.\n        if (animators[i] !== animator && animators[i].targetName === animator.targetName) {\n          animators[i].stopTracks(propKeys);\n        }\n      }\n      targetPropName && (stateToRestore[targetPropName] = stateToRestore[targetPropName] || {});\n      var savedTarget = targetPropName ? stateToRestore[targetPropName] : stateToRestore;\n      each(propKeys, function (key) {\n        // Save original value.\n        savedTarget[key] = ((targetPropName ? el[targetPropName] : el) || {})[key];\n      });\n      animator.whenWithKeys(duration * kf.percent, kfValues, propKeys, kf.easing);\n    });\n    if (!animator) {\n      return;\n    }\n    if (process.env.NODE_ENV !== 'production') {\n      if (!endFrameIsSet) {\n        warn('End frame with percent: 1 is missing in the keyframeAnimation.', true);\n      }\n    }\n    animator.delay(animationOpts.delay || 0).duration(duration).start(animationOpts.easing);\n  });\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport { hasOwn, assert, isString, retrieve2, retrieve3, defaults, each, indexOf, map } from 'zrender/lib/core/util.js';\nimport * as graphicUtil from '../../util/graphic.js';\nimport { setDefaultStateProxy, toggleHoverEmphasis } from '../../util/states.js';\nimport * as labelStyleHelper from '../../label/labelStyle.js';\nimport { getDefaultLabel } from '../helper/labelHelper.js';\nimport { getLayoutOnAxis } from '../../layout/barGrid.js';\nimport DataDiffer from '../../data/DataDiffer.js';\nimport ChartView from '../../view/Chart.js';\nimport { createClipPath } from '../helper/createClipPathFromCoordSys.js';\nimport prepareCartesian2d from '../../coord/cartesian/prepareCustom.js';\nimport prepareGeo from '../../coord/geo/prepareCustom.js';\nimport prepareSingleAxis from '../../coord/single/prepareCustom.js';\nimport preparePolar from '../../coord/polar/prepareCustom.js';\nimport prepareCalendar from '../../coord/calendar/prepareCustom.js';\nimport prepareMatrix from '../../coord/matrix/prepareCustom.js';\nimport Displayable from 'zrender/lib/graphic/Displayable.js';\nimport { convertToEC4StyleForCustomSerise, isEC4CompatibleStyle, convertFromEC4CompatibleStyle, warnDeprecated } from '../../util/styleCompat.js';\nimport { throwError } from '../../util/log.js';\nimport { createOrUpdatePatternFromDecal } from '../../util/decal.js';\nimport { STYLE_VISUAL_TYPE, NON_STYLE_VISUAL_PROPS, customInnerStore } from './CustomSeries.js';\nimport { applyLeaveTransition, applyUpdateTransition } from '../../animation/customGraphicTransition.js';\nimport { applyKeyframeAnimation, stopPreviousKeyframeAnimationAndRestore } from '../../animation/customGraphicKeyframeAnimation.js';\nimport { getCustomSeries } from './customSeriesRegister.js';\nimport tokens from '../../visual/tokens.js';\nvar EMPHASIS = 'emphasis';\nvar NORMAL = 'normal';\nvar BLUR = 'blur';\nvar SELECT = 'select';\nvar STATES = [NORMAL, EMPHASIS, BLUR, SELECT];\nvar PATH_ITEM_STYLE = {\n  normal: ['itemStyle'],\n  emphasis: [EMPHASIS, 'itemStyle'],\n  blur: [BLUR, 'itemStyle'],\n  select: [SELECT, 'itemStyle']\n};\nvar PATH_LABEL = {\n  normal: ['label'],\n  emphasis: [EMPHASIS, 'label'],\n  blur: [BLUR, 'label'],\n  select: [SELECT, 'label']\n};\nvar DEFAULT_TRANSITION = ['x', 'y'];\n// Use prefix to avoid index to be the same as el.name,\n// which will cause weird update animation.\nvar GROUP_DIFF_PREFIX = 'e\\0\\0';\nvar attachedTxInfoTmp = {\n  normal: {},\n  emphasis: {},\n  blur: {},\n  select: {}\n};\n/**\n * FIXME: register rather than import directly, for size.\n *\n * To reduce total package size of each coordinate systems, the modules `prepareCustom`\n * of each coordinate systems are not required by each coordinate systems directly, but\n * required by the module `custom`.\n *\n * prepareInfoForCustomSeries {Function}: optional\n *     @return {Object} {coordSys: {...}, api: {\n *         coord: function (data, clamp) {}, // return point in global.\n *         size: function (dataSize, dataItem) {} // return size of each axis in coordSys.\n *     }}\n */\nvar prepareCustoms = {\n  cartesian2d: prepareCartesian2d,\n  geo: prepareGeo,\n  single: prepareSingleAxis,\n  polar: preparePolar,\n  calendar: prepareCalendar,\n  matrix: prepareMatrix\n};\nfunction isPath(el) {\n  return el instanceof graphicUtil.Path;\n}\nfunction isDisplayable(el) {\n  return el instanceof Displayable;\n}\nfunction copyElement(sourceEl, targetEl) {\n  targetEl.copyTransform(sourceEl);\n  if (isDisplayable(targetEl) && isDisplayable(sourceEl)) {\n    targetEl.setStyle(sourceEl.style);\n    targetEl.z = sourceEl.z;\n    targetEl.z2 = sourceEl.z2;\n    targetEl.zlevel = sourceEl.zlevel;\n    targetEl.invisible = sourceEl.invisible;\n    targetEl.ignore = sourceEl.ignore;\n    if (isPath(targetEl) && isPath(sourceEl)) {\n      targetEl.setShape(sourceEl.shape);\n    }\n  }\n}\nvar CustomChartView = /** @class */function (_super) {\n  __extends(CustomChartView, _super);\n  function CustomChartView() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = CustomChartView.type;\n    return _this;\n  }\n  CustomChartView.prototype.render = function (customSeries, ecModel, api, payload) {\n    // Clear previously rendered progressive elements.\n    this._progressiveEls = null;\n    var oldData = this._data;\n    var data = customSeries.getData();\n    var group = this.group;\n    var renderItem = makeRenderItem(customSeries, data, ecModel, api);\n    if (!oldData) {\n      // Previous render is incremental render or first render.\n      // Needs remove the incremental rendered elements.\n      group.removeAll();\n    }\n    data.diff(oldData).add(function (newIdx) {\n      createOrUpdateItem(api, null, newIdx, renderItem(newIdx, payload), customSeries, group, data);\n    }).remove(function (oldIdx) {\n      var el = oldData.getItemGraphicEl(oldIdx);\n      el && applyLeaveTransition(el, customInnerStore(el).option, customSeries);\n    }).update(function (newIdx, oldIdx) {\n      var oldEl = oldData.getItemGraphicEl(oldIdx);\n      createOrUpdateItem(api, oldEl, newIdx, renderItem(newIdx, payload), customSeries, group, data);\n    }).execute();\n    // Do clipping\n    var clipPath = customSeries.get('clip', true) ? createClipPath(customSeries.coordinateSystem, false, customSeries) : null;\n    if (clipPath) {\n      group.setClipPath(clipPath);\n    } else {\n      group.removeClipPath();\n    }\n    this._data = data;\n  };\n  CustomChartView.prototype.incrementalPrepareRender = function (customSeries, ecModel, api) {\n    this.group.removeAll();\n    this._data = null;\n  };\n  CustomChartView.prototype.incrementalRender = function (params, customSeries, ecModel, api, payload) {\n    var data = customSeries.getData();\n    var renderItem = makeRenderItem(customSeries, data, ecModel, api);\n    var progressiveEls = this._progressiveEls = [];\n    function setIncrementalAndHoverLayer(el) {\n      if (!el.isGroup) {\n        el.incremental = true;\n        el.ensureState('emphasis').hoverLayer = true;\n      }\n    }\n    for (var idx = params.start; idx < params.end; idx++) {\n      var el = createOrUpdateItem(null, null, idx, renderItem(idx, payload), customSeries, this.group, data);\n      if (el) {\n        el.traverse(setIncrementalAndHoverLayer);\n        progressiveEls.push(el);\n      }\n    }\n  };\n  CustomChartView.prototype.eachRendered = function (cb) {\n    graphicUtil.traverseElements(this._progressiveEls || this.group, cb);\n  };\n  CustomChartView.prototype.filterForExposedEvent = function (eventType, query, targetEl, packedEvent) {\n    var elementName = query.element;\n    if (elementName == null || targetEl.name === elementName) {\n      return true;\n    }\n    // Enable to give a name on a group made by `renderItem`, and listen\n    // events that are triggered by its descendents.\n    while ((targetEl = targetEl.__hostTarget || targetEl.parent) && targetEl !== this.group) {\n      if (targetEl.name === elementName) {\n        return true;\n      }\n    }\n    return false;\n  };\n  CustomChartView.type = 'custom';\n  return CustomChartView;\n}(ChartView);\nexport default CustomChartView;\nfunction createEl(elOption) {\n  var graphicType = elOption.type;\n  var el;\n  // Those graphic elements are not shapes. They should not be\n  // overwritten by users, so do them first.\n  if (graphicType === 'path') {\n    var shape = elOption.shape;\n    // Using pathRect brings convenience to users sacle svg path.\n    var pathRect = shape.width != null && shape.height != null ? {\n      x: shape.x || 0,\n      y: shape.y || 0,\n      width: shape.width,\n      height: shape.height\n    } : null;\n    var pathData = getPathData(shape);\n    // Path is also used for icon, so layout 'center' by default.\n    el = graphicUtil.makePath(pathData, null, pathRect, shape.layout || 'center');\n    customInnerStore(el).customPathData = pathData;\n  } else if (graphicType === 'image') {\n    el = new graphicUtil.Image({});\n    customInnerStore(el).customImagePath = elOption.style.image;\n  } else if (graphicType === 'text') {\n    el = new graphicUtil.Text({});\n    // customInnerStore(el).customText = (elOption.style as TextStyleProps).text;\n  } else if (graphicType === 'group') {\n    el = new graphicUtil.Group();\n  } else if (graphicType === 'compoundPath') {\n    var shape = elOption.shape;\n    if (!shape || !shape.paths) {\n      var errMsg = '';\n      if (process.env.NODE_ENV !== 'production') {\n        errMsg = 'shape.paths must be specified in compoundPath';\n      }\n      throwError(errMsg);\n    }\n    var paths = map(shape.paths, function (path) {\n      if (path.type === 'path') {\n        return graphicUtil.makePath(path.shape.pathData, path, null);\n      }\n      var Clz = graphicUtil.getShapeClass(path.type);\n      if (!Clz) {\n        var errMsg = '';\n        if (process.env.NODE_ENV !== 'production') {\n          errMsg = 'graphic type \"' + graphicType + '\" can not be found.';\n        }\n        throwError(errMsg);\n      }\n      return new Clz();\n    });\n    el = new graphicUtil.CompoundPath({\n      shape: {\n        paths: paths\n      }\n    });\n  } else {\n    var Clz = graphicUtil.getShapeClass(graphicType);\n    if (!Clz) {\n      var errMsg = '';\n      if (process.env.NODE_ENV !== 'production') {\n        errMsg = 'graphic type \"' + graphicType + '\" can not be found.';\n      }\n      throwError(errMsg);\n    }\n    el = new Clz();\n  }\n  customInnerStore(el).customGraphicType = graphicType;\n  el.name = elOption.name;\n  // Compat ec4: the default z2 lift is 1. If changing the number,\n  // some cases probably be broken: hierarchy layout along z, like circle packing,\n  // where emphasis only intending to modify color/border rather than lift z2.\n  el.z2EmphasisLift = 1;\n  el.z2SelectLift = 1;\n  return el;\n}\nfunction updateElNormal(\n// Can be null/undefined\napi, el, dataIndex, elOption, attachedTxInfo, seriesModel, isInit) {\n  // Stop and restore before update any other attributes.\n  stopPreviousKeyframeAnimationAndRestore(el);\n  var txCfgOpt = attachedTxInfo && attachedTxInfo.normal.cfg;\n  if (txCfgOpt) {\n    // PENDING: whether use user object directly rather than clone?\n    // TODO:5.0 textConfig transition animation?\n    el.setTextConfig(txCfgOpt);\n  }\n  // Default transition ['x', 'y']\n  if (elOption && elOption.transition == null) {\n    elOption.transition = DEFAULT_TRANSITION;\n  }\n  // Do some normalization on style.\n  var styleOpt = elOption && elOption.style;\n  if (styleOpt) {\n    if (el.type === 'text') {\n      var textOptionStyle = styleOpt;\n      // Compatible with ec4: if `textFill` or `textStroke` exists use them.\n      hasOwn(textOptionStyle, 'textFill') && (textOptionStyle.fill = textOptionStyle.textFill);\n      hasOwn(textOptionStyle, 'textStroke') && (textOptionStyle.stroke = textOptionStyle.textStroke);\n    }\n    var decalPattern = void 0;\n    var decalObj = isPath(el) ? styleOpt.decal : null;\n    if (api && decalObj) {\n      decalObj.dirty = true;\n      decalPattern = createOrUpdatePatternFromDecal(decalObj, api);\n    }\n    // Always overwrite in case user specify this prop.\n    styleOpt.__decalPattern = decalPattern;\n  }\n  if (isDisplayable(el)) {\n    if (styleOpt) {\n      var decalPattern = styleOpt.__decalPattern;\n      if (decalPattern) {\n        styleOpt.decal = decalPattern;\n      }\n    }\n  }\n  applyUpdateTransition(el, elOption, seriesModel, {\n    dataIndex: dataIndex,\n    isInit: isInit,\n    clearStyle: true\n  });\n  applyKeyframeAnimation(el, elOption.keyframeAnimation, seriesModel);\n}\nfunction updateElOnState(state, el, elStateOpt, styleOpt, attachedTxInfo) {\n  var elDisplayable = el.isGroup ? null : el;\n  var txCfgOpt = attachedTxInfo && attachedTxInfo[state].cfg;\n  // PENDING:5.0 support customize scale change and transition animation?\n  if (elDisplayable) {\n    // By default support auto lift color when hover whether `emphasis` specified.\n    var stateObj = elDisplayable.ensureState(state);\n    if (styleOpt === false) {\n      var existingEmphasisState = elDisplayable.getState(state);\n      if (existingEmphasisState) {\n        existingEmphasisState.style = null;\n      }\n    } else {\n      // style is needed to enable default emphasis.\n      stateObj.style = styleOpt || null;\n    }\n    // If `elOption.styleEmphasis` or `elOption.emphasis.style` is `false`,\n    // remove hover style.\n    // If `elOption.textConfig` or `elOption.emphasis.textConfig` is null/undefined, it does not\n    // make sense. So for simplicity, we do not ditinguish `hasOwnProperty` and null/undefined.\n    if (txCfgOpt) {\n      stateObj.textConfig = txCfgOpt;\n    }\n    setDefaultStateProxy(elDisplayable);\n  }\n}\nfunction updateZ(el, elOption, seriesModel) {\n  // Group not support textContent and not support z yet.\n  if (el.isGroup) {\n    return;\n  }\n  var elDisplayable = el;\n  var currentZ = seriesModel.currentZ;\n  var currentZLevel = seriesModel.currentZLevel;\n  // Always erase.\n  elDisplayable.z = currentZ;\n  elDisplayable.zlevel = currentZLevel;\n  // z2 must not be null/undefined, otherwise sort error may occur.\n  var optZ2 = elOption.z2;\n  optZ2 != null && (elDisplayable.z2 = optZ2 || 0);\n  for (var i = 0; i < STATES.length; i++) {\n    updateZForEachState(elDisplayable, elOption, STATES[i]);\n  }\n}\nfunction updateZForEachState(elDisplayable, elOption, state) {\n  var isNormal = state === NORMAL;\n  var elStateOpt = isNormal ? elOption : retrieveStateOption(elOption, state);\n  var optZ2 = elStateOpt ? elStateOpt.z2 : null;\n  var stateObj;\n  if (optZ2 != null) {\n    // Do not `ensureState` until required.\n    stateObj = isNormal ? elDisplayable : elDisplayable.ensureState(state);\n    stateObj.z2 = optZ2 || 0;\n  }\n}\nfunction makeRenderItem(customSeries, data, ecModel, api) {\n  var renderItem = customSeries.get('renderItem');\n  if (typeof renderItem === 'string') {\n    // Find renderItem in registered custom series\n    var registeredRenderItem = getCustomSeries(renderItem);\n    if (registeredRenderItem) {\n      renderItem = registeredRenderItem;\n    } else if (process.env.NODE_ENV !== 'production') {\n      console.warn(\"Custom series renderItem '\" + renderItem + \"' not found.\\n                Call 'echarts.registerCustomSeries' to register it.\");\n    }\n  }\n  var coordSys = customSeries.coordinateSystem;\n  var prepareResult = {};\n  if (coordSys) {\n    if (process.env.NODE_ENV !== 'production') {\n      assert(renderItem, 'series.render is required.');\n      assert(coordSys.prepareCustoms || prepareCustoms[coordSys.type], 'This coordSys does not support custom series.');\n    }\n    // `coordSys.prepareCustoms` is used for external coord sys like bmap.\n    prepareResult = coordSys.prepareCustoms ? coordSys.prepareCustoms(coordSys) : prepareCustoms[coordSys.type](coordSys);\n  }\n  var userAPI = defaults({\n    getWidth: api.getWidth,\n    getHeight: api.getHeight,\n    getZr: api.getZr,\n    getDevicePixelRatio: api.getDevicePixelRatio,\n    value: value,\n    style: style,\n    ordinalRawValue: ordinalRawValue,\n    styleEmphasis: styleEmphasis,\n    visual: visual,\n    barLayout: barLayout,\n    currentSeriesIndices: currentSeriesIndices,\n    font: font\n  }, prepareResult.api || {});\n  var userParams = {\n    // The life cycle of context: current round of rendering.\n    // The global life cycle is probably not necessary, because\n    // user can store global status by themselves.\n    context: {},\n    seriesId: customSeries.id,\n    seriesName: customSeries.name,\n    seriesIndex: customSeries.seriesIndex,\n    coordSys: prepareResult.coordSys,\n    dataInsideLength: data.count(),\n    encode: wrapEncodeDef(customSeries.getData()),\n    itemPayload: customSeries.get('itemPayload') || {}\n  };\n  // If someday intending to refactor them to a class, should consider do not\n  // break change: currently these attribute member are encapsulated in a closure\n  // so that do not need to force user to call these method with a scope.\n  // Do not support call `api` asynchronously without dataIndexInside input.\n  var currDataIndexInside;\n  var currItemModel;\n  var currItemStyleModels = {};\n  var currLabelModels = {};\n  var seriesItemStyleModels = {};\n  var seriesLabelModels = {};\n  for (var i = 0; i < STATES.length; i++) {\n    var stateName = STATES[i];\n    seriesItemStyleModels[stateName] = customSeries.getModel(PATH_ITEM_STYLE[stateName]);\n    seriesLabelModels[stateName] = customSeries.getModel(PATH_LABEL[stateName]);\n  }\n  function getItemModel(dataIndexInside) {\n    return dataIndexInside === currDataIndexInside ? currItemModel || (currItemModel = data.getItemModel(dataIndexInside)) : data.getItemModel(dataIndexInside);\n  }\n  function getItemStyleModel(dataIndexInside, state) {\n    return !data.hasItemOption ? seriesItemStyleModels[state] : dataIndexInside === currDataIndexInside ? currItemStyleModels[state] || (currItemStyleModels[state] = getItemModel(dataIndexInside).getModel(PATH_ITEM_STYLE[state])) : getItemModel(dataIndexInside).getModel(PATH_ITEM_STYLE[state]);\n  }\n  function getLabelModel(dataIndexInside, state) {\n    return !data.hasItemOption ? seriesLabelModels[state] : dataIndexInside === currDataIndexInside ? currLabelModels[state] || (currLabelModels[state] = getItemModel(dataIndexInside).getModel(PATH_LABEL[state])) : getItemModel(dataIndexInside).getModel(PATH_LABEL[state]);\n  }\n  return function (dataIndexInside, payload) {\n    currDataIndexInside = dataIndexInside;\n    currItemModel = null;\n    currItemStyleModels = {};\n    currLabelModels = {};\n    return renderItem && renderItem(defaults({\n      dataIndexInside: dataIndexInside,\n      dataIndex: data.getRawIndex(dataIndexInside),\n      // Can be used for optimization when zoom or roam.\n      actionType: payload ? payload.type : null\n    }, userParams), userAPI);\n  };\n  /**\n   * @public\n   * @param dim by default 0.\n   * @param dataIndexInside by default `currDataIndexInside`.\n   */\n  function value(dim, dataIndexInside) {\n    dataIndexInside == null && (dataIndexInside = currDataIndexInside);\n    return data.getStore().get(data.getDimensionIndex(dim || 0), dataIndexInside);\n  }\n  /**\n   * @public\n   * @param dim by default 0.\n   * @param dataIndexInside by default `currDataIndexInside`.\n   */\n  function ordinalRawValue(dim, dataIndexInside) {\n    dataIndexInside == null && (dataIndexInside = currDataIndexInside);\n    dim = dim || 0;\n    var dimInfo = data.getDimensionInfo(dim);\n    if (!dimInfo) {\n      var dimIndex = data.getDimensionIndex(dim);\n      return dimIndex >= 0 ? data.getStore().get(dimIndex, dataIndexInside) : undefined;\n    }\n    var val = data.get(dimInfo.name, dataIndexInside);\n    var ordinalMeta = dimInfo && dimInfo.ordinalMeta;\n    return ordinalMeta ? ordinalMeta.categories[val] : val;\n  }\n  /**\n   * @deprecated The original intention of `api.style` is enable to set itemStyle\n   * like other series. But it is not necessary and not easy to give a strict definition\n   * of what it returns. And since echarts5 it needs to be make compat work. So\n   * deprecates it since echarts5.\n   *\n   * By default, `visual` is applied to style (to support visualMap).\n   * `visual.color` is applied at `fill`. If user want apply visual.color on `stroke`,\n   * it can be implemented as:\n   * `api.style({stroke: api.visual('color'), fill: null})`;\n   *\n   * [Compat]: since ec5, RectText has been separated from its hosts el.\n   * so `api.style()` will only return the style from `itemStyle` but not handle `label`\n   * any more. But `series.label` config is never published in doc.\n   * We still compat it in `api.style()`. But not encourage to use it and will still not\n   * to pulish it to doc.\n   * @public\n   * @param dataIndexInside by default `currDataIndexInside`.\n   */\n  function style(userProps, dataIndexInside) {\n    if (process.env.NODE_ENV !== 'production') {\n      warnDeprecated('api.style', 'Please write literal style directly instead.');\n    }\n    dataIndexInside == null && (dataIndexInside = currDataIndexInside);\n    var style = data.getItemVisual(dataIndexInside, 'style');\n    var visualColor = style && style.fill;\n    var opacity = style && style.opacity;\n    var itemStyle = getItemStyleModel(dataIndexInside, NORMAL).getItemStyle();\n    visualColor != null && (itemStyle.fill = visualColor);\n    opacity != null && (itemStyle.opacity = opacity);\n    var opt = {\n      inheritColor: isString(visualColor) ? visualColor : tokens.color.neutral99\n    };\n    var labelModel = getLabelModel(dataIndexInside, NORMAL);\n    // Now that the feature of \"auto adjust text fill/stroke\" has been migrated to zrender\n    // since ec5, we should set `isAttached` as `false` here and make compat in\n    // `convertToEC4StyleForCustomSerise`.\n    var textStyle = labelStyleHelper.createTextStyle(labelModel, null, opt, false, true);\n    textStyle.text = labelModel.getShallow('show') ? retrieve2(customSeries.getFormattedLabel(dataIndexInside, NORMAL), getDefaultLabel(data, dataIndexInside)) : null;\n    var textConfig = labelStyleHelper.createTextConfig(labelModel, opt, false);\n    preFetchFromExtra(userProps, itemStyle);\n    itemStyle = convertToEC4StyleForCustomSerise(itemStyle, textStyle, textConfig);\n    userProps && applyUserPropsAfter(itemStyle, userProps);\n    itemStyle.legacy = true;\n    return itemStyle;\n  }\n  /**\n   * @deprecated The reason see `api.style()`\n   * @public\n   * @param dataIndexInside by default `currDataIndexInside`.\n   */\n  function styleEmphasis(userProps, dataIndexInside) {\n    if (process.env.NODE_ENV !== 'production') {\n      warnDeprecated('api.styleEmphasis', 'Please write literal style directly instead.');\n    }\n    dataIndexInside == null && (dataIndexInside = currDataIndexInside);\n    var itemStyle = getItemStyleModel(dataIndexInside, EMPHASIS).getItemStyle();\n    var labelModel = getLabelModel(dataIndexInside, EMPHASIS);\n    var textStyle = labelStyleHelper.createTextStyle(labelModel, null, null, true, true);\n    textStyle.text = labelModel.getShallow('show') ? retrieve3(customSeries.getFormattedLabel(dataIndexInside, EMPHASIS), customSeries.getFormattedLabel(dataIndexInside, NORMAL), getDefaultLabel(data, dataIndexInside)) : null;\n    var textConfig = labelStyleHelper.createTextConfig(labelModel, null, true);\n    preFetchFromExtra(userProps, itemStyle);\n    itemStyle = convertToEC4StyleForCustomSerise(itemStyle, textStyle, textConfig);\n    userProps && applyUserPropsAfter(itemStyle, userProps);\n    itemStyle.legacy = true;\n    return itemStyle;\n  }\n  function applyUserPropsAfter(itemStyle, extra) {\n    for (var key in extra) {\n      if (hasOwn(extra, key)) {\n        itemStyle[key] = extra[key];\n      }\n    }\n  }\n  function preFetchFromExtra(extra, itemStyle) {\n    // A trick to retrieve those props firstly, which are used to\n    // apply auto inside fill/stroke in `convertToEC4StyleForCustomSerise`.\n    // (It's not reasonable but only for a degree of compat)\n    if (extra) {\n      extra.textFill && (itemStyle.textFill = extra.textFill);\n      extra.textPosition && (itemStyle.textPosition = extra.textPosition);\n    }\n  }\n  /**\n   * @public\n   * @param dataIndexInside by default `currDataIndexInside`.\n   */\n  function visual(visualType, dataIndexInside) {\n    dataIndexInside == null && (dataIndexInside = currDataIndexInside);\n    if (hasOwn(STYLE_VISUAL_TYPE, visualType)) {\n      var style_1 = data.getItemVisual(dataIndexInside, 'style');\n      return style_1 ? style_1[STYLE_VISUAL_TYPE[visualType]] : null;\n    }\n    // Only support these visuals. Other visual might be inner tricky\n    // for performance (like `style`), do not expose to users.\n    if (hasOwn(NON_STYLE_VISUAL_PROPS, visualType)) {\n      return data.getItemVisual(dataIndexInside, visualType);\n    }\n  }\n  /**\n   * @public\n   * @return If not support, return undefined.\n   */\n  function barLayout(opt) {\n    if (coordSys.type === 'cartesian2d') {\n      var baseAxis = coordSys.getBaseAxis();\n      return getLayoutOnAxis(defaults({\n        axis: baseAxis\n      }, opt));\n    }\n  }\n  /**\n   * @public\n   */\n  function currentSeriesIndices() {\n    return ecModel.getCurrentSeriesIndices();\n  }\n  /**\n   * @public\n   * @return font string\n   */\n  function font(opt) {\n    return labelStyleHelper.getFont(opt, ecModel);\n  }\n}\nfunction wrapEncodeDef(data) {\n  var encodeDef = {};\n  each(data.dimensions, function (dimName) {\n    var dimInfo = data.getDimensionInfo(dimName);\n    if (!dimInfo.isExtraCoord) {\n      var coordDim = dimInfo.coordDim;\n      var dataDims = encodeDef[coordDim] = encodeDef[coordDim] || [];\n      dataDims[dimInfo.coordDimIndex] = data.getDimensionIndex(dimName);\n    }\n  });\n  return encodeDef;\n}\nfunction createOrUpdateItem(api, existsEl, dataIndex, elOption, seriesModel, group, data) {\n  // [Rule]\n  // If `renderItem` returns `null`/`undefined`/`false`, remove the previous el if existing.\n  //     (It seems that violate the \"merge\" principle, but most of users probably intuitively\n  //     regard \"return;\" as \"show nothing element whatever\", so make a exception to meet the\n  //     most cases.)\n  // The rule or \"merge\" see [STRATEGY_MERGE].\n  // If `elOption` is `null`/`undefined`/`false` (when `renderItem` returns nothing).\n  if (!elOption) {\n    group.remove(existsEl);\n    return;\n  }\n  var el = doCreateOrUpdateEl(api, existsEl, dataIndex, elOption, seriesModel, group);\n  el && data.setItemGraphicEl(dataIndex, el);\n  el && toggleHoverEmphasis(el, elOption.focus, elOption.blurScope, elOption.emphasisDisabled);\n  return el;\n}\nfunction doCreateOrUpdateEl(api, existsEl, dataIndex, elOption, seriesModel, group) {\n  if (process.env.NODE_ENV !== 'production') {\n    assert(elOption, 'should not have an null/undefined element setting');\n  }\n  var toBeReplacedIdx = -1;\n  var oldEl = existsEl;\n  if (existsEl && doesElNeedRecreate(existsEl, elOption, seriesModel)\n  // || (\n  //     // PENDING: even in one-to-one mapping case, if el is marked as morph,\n  //     // do not sure whether the el will be mapped to another el with different\n  //     // hierarchy in Group tree. So always recreate el rather than reuse the el.\n  //     morphHelper && morphHelper.isOneToOneFrom(el)\n  // )\n  ) {\n    // Should keep at the original index, otherwise \"merge by index\" will be incorrect.\n    toBeReplacedIdx = indexOf(group.childrenRef(), existsEl);\n    existsEl = null;\n  }\n  var isInit = !existsEl;\n  var el = existsEl;\n  if (!el) {\n    el = createEl(elOption);\n    if (oldEl) {\n      copyElement(oldEl, el);\n    }\n  } else {\n    // FIMXE:NEXT unified clearState?\n    // If in some case the performance issue arised, consider\n    // do not clearState but update cached normal state directly.\n    el.clearStates();\n  }\n  // Need to set morph: false explictly to disable automatically morphing.\n  if (elOption.morph === false) {\n    el.disableMorphing = true;\n  } else if (el.disableMorphing) {\n    el.disableMorphing = false;\n  }\n  if (elOption.tooltipDisabled) {\n    el.tooltipDisabled = true;\n  }\n  attachedTxInfoTmp.normal.cfg = attachedTxInfoTmp.normal.conOpt = attachedTxInfoTmp.emphasis.cfg = attachedTxInfoTmp.emphasis.conOpt = attachedTxInfoTmp.blur.cfg = attachedTxInfoTmp.blur.conOpt = attachedTxInfoTmp.select.cfg = attachedTxInfoTmp.select.conOpt = null;\n  attachedTxInfoTmp.isLegacy = false;\n  doCreateOrUpdateAttachedTx(el, dataIndex, elOption, seriesModel, isInit, attachedTxInfoTmp);\n  doCreateOrUpdateClipPath(el, dataIndex, elOption, seriesModel, isInit);\n  updateElNormal(api, el, dataIndex, elOption, attachedTxInfoTmp, seriesModel, isInit);\n  // `elOption.info` enables user to mount some info on\n  // elements and use them in event handlers.\n  // Update them only when user specified, otherwise, remain.\n  hasOwn(elOption, 'info') && (customInnerStore(el).info = elOption.info);\n  for (var i = 0; i < STATES.length; i++) {\n    var stateName = STATES[i];\n    if (stateName !== NORMAL) {\n      var otherStateOpt = retrieveStateOption(elOption, stateName);\n      var otherStyleOpt = retrieveStyleOptionOnState(elOption, otherStateOpt, stateName);\n      updateElOnState(stateName, el, otherStateOpt, otherStyleOpt, attachedTxInfoTmp);\n    }\n  }\n  updateZ(el, elOption, seriesModel);\n  if (elOption.type === 'group') {\n    mergeChildren(api, el, dataIndex, elOption, seriesModel);\n  }\n  if (toBeReplacedIdx >= 0) {\n    group.replaceAt(el, toBeReplacedIdx);\n  } else {\n    group.add(el);\n  }\n  return el;\n}\n// `el` must not be null/undefined.\nfunction doesElNeedRecreate(el, elOption, seriesModel) {\n  var elInner = customInnerStore(el);\n  var elOptionType = elOption.type;\n  var elOptionShape = elOption.shape;\n  var elOptionStyle = elOption.style;\n  return (\n    // Always create new if universal transition is enabled.\n    // Because we do transition after render. It needs to know what old element is. Replacement will loose it.\n    seriesModel.isUniversalTransitionEnabled()\n    // If `elOptionType` is `null`, follow the merge principle.\n    || elOptionType != null && elOptionType !== elInner.customGraphicType || elOptionType === 'path' && hasOwnPathData(elOptionShape) && getPathData(elOptionShape) !== elInner.customPathData || elOptionType === 'image' && hasOwn(elOptionStyle, 'image') && elOptionStyle.image !== elInner.customImagePath\n    // // FIXME test and remove this restriction?\n    // || (elOptionType === 'text'\n    //     && hasOwn(elOptionStyle, 'text')\n    //     && (elOptionStyle as TextStyleProps).text !== elInner.customText\n    // )\n  );\n}\nfunction doCreateOrUpdateClipPath(el, dataIndex, elOption, seriesModel, isInit) {\n  // Based on the \"merge\" principle, if no clipPath provided,\n  // do nothing. The exists clip will be totally removed only if\n  // `el.clipPath` is `false`. Otherwise it will be merged/replaced.\n  var clipPathOpt = elOption.clipPath;\n  if (clipPathOpt === false) {\n    if (el && el.getClipPath()) {\n      el.removeClipPath();\n    }\n  } else if (clipPathOpt) {\n    var clipPath = el.getClipPath();\n    if (clipPath && doesElNeedRecreate(clipPath, clipPathOpt, seriesModel)) {\n      clipPath = null;\n    }\n    if (!clipPath) {\n      clipPath = createEl(clipPathOpt);\n      if (process.env.NODE_ENV !== 'production') {\n        assert(isPath(clipPath), 'Only any type of `path` can be used in `clipPath`, rather than ' + clipPath.type + '.');\n      }\n      el.setClipPath(clipPath);\n    }\n    updateElNormal(null, clipPath, dataIndex, clipPathOpt, null, seriesModel, isInit);\n  }\n  // If not define `clipPath` in option, do nothing unnecessary.\n}\nfunction doCreateOrUpdateAttachedTx(el, dataIndex, elOption, seriesModel, isInit, attachedTxInfo) {\n  // Group does not support textContent temporarily until necessary.\n  if (el.isGroup || el.type === 'compoundPath') {\n    return;\n  }\n  // Normal must be called before emphasis, for `isLegacy` detection.\n  processTxInfo(elOption, null, attachedTxInfo);\n  processTxInfo(elOption, EMPHASIS, attachedTxInfo);\n  // If `elOption.textConfig` or `elOption.textContent` is null/undefined, it does not make sense.\n  // So for simplicity, if \"elOption hasOwnProperty of them but be null/undefined\", we do not\n  // trade them as set to null to el.\n  // Especially:\n  // `elOption.textContent: false` means remove textContent.\n  // `elOption.textContent.emphasis.style: false` means remove the style from emphasis state.\n  var txConOptNormal = attachedTxInfo.normal.conOpt;\n  var txConOptEmphasis = attachedTxInfo.emphasis.conOpt;\n  var txConOptBlur = attachedTxInfo.blur.conOpt;\n  var txConOptSelect = attachedTxInfo.select.conOpt;\n  if (txConOptNormal != null || txConOptEmphasis != null || txConOptSelect != null || txConOptBlur != null) {\n    var textContent = el.getTextContent();\n    if (txConOptNormal === false) {\n      textContent && el.removeTextContent();\n    } else {\n      txConOptNormal = attachedTxInfo.normal.conOpt = txConOptNormal || {\n        type: 'text'\n      };\n      if (!textContent) {\n        textContent = createEl(txConOptNormal);\n        el.setTextContent(textContent);\n      } else {\n        // If in some case the performance issue arised, consider\n        // do not clearState but update cached normal state directly.\n        textContent.clearStates();\n      }\n      updateElNormal(null, textContent, dataIndex, txConOptNormal, null, seriesModel, isInit);\n      var txConStlOptNormal = txConOptNormal && txConOptNormal.style;\n      for (var i = 0; i < STATES.length; i++) {\n        var stateName = STATES[i];\n        if (stateName !== NORMAL) {\n          var txConOptOtherState = attachedTxInfo[stateName].conOpt;\n          updateElOnState(stateName, textContent, txConOptOtherState, retrieveStyleOptionOnState(txConOptNormal, txConOptOtherState, stateName), null);\n        }\n      }\n      txConStlOptNormal ? textContent.dirty() : textContent.markRedraw();\n    }\n  }\n}\nfunction processTxInfo(elOption, state, attachedTxInfo) {\n  var stateOpt = !state ? elOption : retrieveStateOption(elOption, state);\n  var styleOpt = !state ? elOption.style : retrieveStyleOptionOnState(elOption, stateOpt, EMPHASIS);\n  var elType = elOption.type;\n  var txCfg = stateOpt ? stateOpt.textConfig : null;\n  var txConOptNormal = elOption.textContent;\n  var txConOpt = !txConOptNormal ? null : !state ? txConOptNormal : retrieveStateOption(txConOptNormal, state);\n  if (styleOpt && (\n  // Because emphasis style has little info to detect legacy,\n  // if normal is legacy, emphasis is trade as legacy.\n  attachedTxInfo.isLegacy || isEC4CompatibleStyle(styleOpt, elType, !!txCfg, !!txConOpt))) {\n    attachedTxInfo.isLegacy = true;\n    var convertResult = convertFromEC4CompatibleStyle(styleOpt, elType, !state);\n    // Explicitly specified `textConfig` and `textContent` has higher priority than\n    // the ones generated by legacy style. Otherwise if users use them and `api.style`\n    // at the same time, they not both work and hardly to known why.\n    if (!txCfg && convertResult.textConfig) {\n      txCfg = convertResult.textConfig;\n    }\n    if (!txConOpt && convertResult.textContent) {\n      txConOpt = convertResult.textContent;\n    }\n  }\n  if (!state && txConOpt) {\n    var txConOptNormal_1 = txConOpt;\n    // `textContent: {type: 'text'}`, the \"type\" is easy to be missing. So we tolerate it.\n    !txConOptNormal_1.type && (txConOptNormal_1.type = 'text');\n    if (process.env.NODE_ENV !== 'production') {\n      // Do not tolerate incorrcet type for forward compat.\n      assert(txConOptNormal_1.type === 'text', 'textContent.type must be \"text\"');\n    }\n  }\n  var info = !state ? attachedTxInfo.normal : attachedTxInfo[state];\n  info.cfg = txCfg;\n  info.conOpt = txConOpt;\n}\nfunction retrieveStateOption(elOption, state) {\n  return !state ? elOption : elOption ? elOption[state] : null;\n}\nfunction retrieveStyleOptionOnState(stateOptionNormal, stateOption, state) {\n  var style = stateOption && stateOption.style;\n  if (style == null && state === EMPHASIS && stateOptionNormal) {\n    style = stateOptionNormal.styleEmphasis;\n  }\n  return style;\n}\n// Usage:\n// (1) By default, `elOption.$mergeChildren` is `'byIndex'`, which indicates\n//     that the existing children will not be removed, and enables the feature\n//     that update some of the props of some of the children simply by construct\n//     the returned children of `renderItem` like:\n//     `var children = group.children = []; children[3] = {opacity: 0.5};`\n// (2) If `elOption.$mergeChildren` is `'byName'`, add/update/remove children\n//     by child.name. But that might be lower performance.\n// (3) If `elOption.$mergeChildren` is `false`, the existing children will be\n//     replaced totally.\n// (4) If `!elOption.children`, following the \"merge\" principle, nothing will\n//     happen.\n// (5) If `elOption.$mergeChildren` is not `false` neither `'byName'` and the\n//     `el` is a group, and if any of the new child is null, it means to remove\n//     the element at the same index, if exists. On the other hand, if the new\n//     child is and empty object `{}`, it means to keep the element not changed.\n//\n// For implementation simpleness, do not provide a direct way to remove single\n// child (otherwise the total indices of the children array have to be modified).\n// User can remove a single child by setting its `ignore` to `true`.\nfunction mergeChildren(api, el, dataIndex, elOption, seriesModel) {\n  var newChildren = elOption.children;\n  var newLen = newChildren ? newChildren.length : 0;\n  var mergeChildren = elOption.$mergeChildren;\n  // `diffChildrenByName` has been deprecated.\n  var byName = mergeChildren === 'byName' || elOption.diffChildrenByName;\n  var notMerge = mergeChildren === false;\n  // For better performance on roam update, only enter if necessary.\n  if (!newLen && !byName && !notMerge) {\n    return;\n  }\n  if (byName) {\n    diffGroupChildren({\n      api: api,\n      oldChildren: el.children() || [],\n      newChildren: newChildren || [],\n      dataIndex: dataIndex,\n      seriesModel: seriesModel,\n      group: el\n    });\n    return;\n  }\n  notMerge && el.removeAll();\n  // Mapping children of a group simply by index, which\n  // might be better performance.\n  var index = 0;\n  for (; index < newLen; index++) {\n    var newChild = newChildren[index];\n    var oldChild = el.childAt(index);\n    if (newChild) {\n      if (newChild.ignore == null) {\n        // The old child is set to be ignored if null (see comments\n        // below). So we need to set ignore to be false back.\n        newChild.ignore = false;\n      }\n      doCreateOrUpdateEl(api, oldChild, dataIndex, newChild, seriesModel, el);\n    } else {\n      if (process.env.NODE_ENV !== 'production') {\n        assert(oldChild, 'renderItem should not return a group containing elements' + ' as null/undefined/{} if they do not exist before.');\n      }\n      // If the new element option is null, it means to remove the old\n      // element. But we cannot really remove the element from the group\n      // directly, because the element order may not be stable when this\n      // element is added back. So we set the element to be ignored.\n      oldChild.ignore = true;\n    }\n  }\n  for (var i = el.childCount() - 1; i >= index; i--) {\n    var child = el.childAt(i);\n    removeChildFromGroup(el, child, seriesModel);\n  }\n}\nfunction removeChildFromGroup(group, child, seriesModel) {\n  // Do not support leave elements that are not mentioned in the latest\n  // `renderItem` return. Otherwise users may not have a clear and simple\n  // concept that how to control all of the elements.\n  child && applyLeaveTransition(child, customInnerStore(group).option, seriesModel);\n}\nfunction diffGroupChildren(context) {\n  new DataDiffer(context.oldChildren, context.newChildren, getKey, getKey, context).add(processAddUpdate).update(processAddUpdate).remove(processRemove).execute();\n}\nfunction getKey(item, idx) {\n  var name = item && item.name;\n  return name != null ? name : GROUP_DIFF_PREFIX + idx;\n}\nfunction processAddUpdate(newIndex, oldIndex) {\n  var context = this.context;\n  var childOption = newIndex != null ? context.newChildren[newIndex] : null;\n  var child = oldIndex != null ? context.oldChildren[oldIndex] : null;\n  doCreateOrUpdateEl(context.api, child, context.dataIndex, childOption, context.seriesModel, context.group);\n}\nfunction processRemove(oldIndex) {\n  var context = this.context;\n  var child = context.oldChildren[oldIndex];\n  child && applyLeaveTransition(child, customInnerStore(child).option, context.seriesModel);\n}\n/**\n * @return SVG Path data.\n */\nfunction getPathData(shape) {\n  // \"d\" follows the SVG convention.\n  return shape && (shape.pathData || shape.d);\n}\nfunction hasOwnPathData(shape) {\n  return shape && (hasOwn(shape, 'pathData') || hasOwn(shape, 'd'));\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport CustomSeriesModel from './CustomSeries.js';\nimport CustomChartView from './CustomView.js';\nexport function install(registers) {\n  registers.registerChartView(CustomChartView);\n  registers.registerSeriesModel(CustomSeriesModel);\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as graphic from '../../util/graphic.js';\nimport * as axisPointerModelHelper from './modelHelper.js';\nimport * as eventTool from 'zrender/lib/core/event.js';\nimport * as throttleUtil from '../../util/throttle.js';\nimport { makeInner } from '../../util/model.js';\nvar inner = makeInner();\nvar clone = zrUtil.clone;\nvar bind = zrUtil.bind;\n/**\n * Base axis pointer class in 2D.\n */\nvar BaseAxisPointer = /** @class */function () {\n  function BaseAxisPointer() {\n    this._dragging = false;\n    /**\n     * In px, arbitrary value. Do not set too small,\n     * no animation is ok for most cases.\n     */\n    this.animationThreshold = 15;\n  }\n  /**\n   * @implement\n   */\n  BaseAxisPointer.prototype.render = function (axisModel, axisPointerModel, api, forceRender) {\n    var value = axisPointerModel.get('value');\n    var status = axisPointerModel.get('status');\n    // Bind them to `this`, not in closure, otherwise they will not\n    // be replaced when user calling setOption in not merge mode.\n    this._axisModel = axisModel;\n    this._axisPointerModel = axisPointerModel;\n    this._api = api;\n    // Optimize: `render` will be called repeatedly during mouse move.\n    // So it is power consuming if performing `render` each time,\n    // especially on mobile device.\n    if (!forceRender && this._lastValue === value && this._lastStatus === status) {\n      return;\n    }\n    this._lastValue = value;\n    this._lastStatus = status;\n    var group = this._group;\n    var handle = this._handle;\n    if (!status || status === 'hide') {\n      // Do not clear here, for animation better.\n      group && group.hide();\n      handle && handle.hide();\n      return;\n    }\n    group && group.show();\n    handle && handle.show();\n    // Otherwise status is 'show'\n    var elOption = {};\n    this.makeElOption(elOption, value, axisModel, axisPointerModel, api);\n    // Enable change axis pointer type.\n    var graphicKey = elOption.graphicKey;\n    if (graphicKey !== this._lastGraphicKey) {\n      this.clear(api);\n    }\n    this._lastGraphicKey = graphicKey;\n    var moveAnimation = this._moveAnimation = this.determineAnimation(axisModel, axisPointerModel);\n    if (!group) {\n      group = this._group = new graphic.Group();\n      this.createPointerEl(group, elOption, axisModel, axisPointerModel);\n      this.createLabelEl(group, elOption, axisModel, axisPointerModel);\n      api.getZr().add(group);\n    } else {\n      var doUpdateProps = zrUtil.curry(updateProps, axisPointerModel, moveAnimation);\n      this.updatePointerEl(group, elOption, doUpdateProps);\n      this.updateLabelEl(group, elOption, doUpdateProps, axisPointerModel);\n    }\n    updateMandatoryProps(group, axisPointerModel, true);\n    this._renderHandle(value);\n  };\n  /**\n   * @implement\n   */\n  BaseAxisPointer.prototype.remove = function (api) {\n    this.clear(api);\n  };\n  /**\n   * @implement\n   */\n  BaseAxisPointer.prototype.dispose = function (api) {\n    this.clear(api);\n  };\n  /**\n   * @protected\n   */\n  BaseAxisPointer.prototype.determineAnimation = function (axisModel, axisPointerModel) {\n    var animation = axisPointerModel.get('animation');\n    var axis = axisModel.axis;\n    var isCategoryAxis = axis.type === 'category';\n    var useSnap = axisPointerModel.get('snap');\n    // Value axis without snap always do not snap.\n    if (!useSnap && !isCategoryAxis) {\n      return false;\n    }\n    if (animation === 'auto' || animation == null) {\n      var animationThreshold = this.animationThreshold;\n      if (isCategoryAxis && axis.getBandWidth() > animationThreshold) {\n        return true;\n      }\n      // It is important to auto animation when snap used. Consider if there is\n      // a dataZoom, animation will be disabled when too many points exist, while\n      // it will be enabled for better visual effect when little points exist.\n      if (useSnap) {\n        var seriesDataCount = axisPointerModelHelper.getAxisInfo(axisModel).seriesDataCount;\n        var axisExtent = axis.getExtent();\n        // Approximate band width\n        return Math.abs(axisExtent[0] - axisExtent[1]) / seriesDataCount > animationThreshold;\n      }\n      return false;\n    }\n    return animation === true;\n  };\n  /**\n   * add {pointer, label, graphicKey} to elOption\n   * @protected\n   */\n  BaseAxisPointer.prototype.makeElOption = function (elOption, value, axisModel, axisPointerModel, api) {\n    // Should be implemenented by sub-class.\n  };\n  /**\n   * @protected\n   */\n  BaseAxisPointer.prototype.createPointerEl = function (group, elOption, axisModel, axisPointerModel) {\n    var pointerOption = elOption.pointer;\n    if (pointerOption) {\n      var pointerEl = inner(group).pointerEl = new graphic[pointerOption.type](clone(elOption.pointer));\n      group.add(pointerEl);\n    }\n  };\n  /**\n   * @protected\n   */\n  BaseAxisPointer.prototype.createLabelEl = function (group, elOption, axisModel, axisPointerModel) {\n    if (elOption.label) {\n      var labelEl = inner(group).labelEl = new graphic.Text(clone(elOption.label));\n      group.add(labelEl);\n      updateLabelShowHide(labelEl, axisPointerModel);\n    }\n  };\n  /**\n   * @protected\n   */\n  BaseAxisPointer.prototype.updatePointerEl = function (group, elOption, updateProps) {\n    var pointerEl = inner(group).pointerEl;\n    if (pointerEl && elOption.pointer) {\n      pointerEl.setStyle(elOption.pointer.style);\n      updateProps(pointerEl, {\n        shape: elOption.pointer.shape\n      });\n    }\n  };\n  /**\n   * @protected\n   */\n  BaseAxisPointer.prototype.updateLabelEl = function (group, elOption, updateProps, axisPointerModel) {\n    var labelEl = inner(group).labelEl;\n    if (labelEl) {\n      labelEl.setStyle(elOption.label.style);\n      updateProps(labelEl, {\n        // Consider text length change in vertical axis, animation should\n        // be used on shape, otherwise the effect will be weird.\n        // TODOTODO\n        // shape: elOption.label.shape,\n        x: elOption.label.x,\n        y: elOption.label.y\n      });\n      updateLabelShowHide(labelEl, axisPointerModel);\n    }\n  };\n  /**\n   * @private\n   */\n  BaseAxisPointer.prototype._renderHandle = function (value) {\n    if (this._dragging || !this.updateHandleTransform) {\n      return;\n    }\n    var axisPointerModel = this._axisPointerModel;\n    var zr = this._api.getZr();\n    var handle = this._handle;\n    var handleModel = axisPointerModel.getModel('handle');\n    var status = axisPointerModel.get('status');\n    if (!handleModel.get('show') || !status || status === 'hide') {\n      handle && zr.remove(handle);\n      this._handle = null;\n      return;\n    }\n    var isInit;\n    if (!this._handle) {\n      isInit = true;\n      handle = this._handle = graphic.createIcon(handleModel.get('icon'), {\n        cursor: 'move',\n        draggable: true,\n        onmousemove: function (e) {\n          // For mobile device, prevent screen slider on the button.\n          eventTool.stop(e.event);\n        },\n        onmousedown: bind(this._onHandleDragMove, this, 0, 0),\n        drift: bind(this._onHandleDragMove, this),\n        ondragend: bind(this._onHandleDragEnd, this)\n      });\n      zr.add(handle);\n    }\n    updateMandatoryProps(handle, axisPointerModel, false);\n    // update style\n    handle.setStyle(handleModel.getItemStyle(null, ['color', 'borderColor', 'borderWidth', 'opacity', 'shadowColor', 'shadowBlur', 'shadowOffsetX', 'shadowOffsetY']));\n    // update position\n    var handleSize = handleModel.get('size');\n    if (!zrUtil.isArray(handleSize)) {\n      handleSize = [handleSize, handleSize];\n    }\n    handle.scaleX = handleSize[0] / 2;\n    handle.scaleY = handleSize[1] / 2;\n    throttleUtil.createOrUpdate(this, '_doDispatchAxisPointer', handleModel.get('throttle') || 0, 'fixRate');\n    this._moveHandleToValue(value, isInit);\n  };\n  BaseAxisPointer.prototype._moveHandleToValue = function (value, isInit) {\n    updateProps(this._axisPointerModel, !isInit && this._moveAnimation, this._handle, getHandleTransProps(this.getHandleTransform(value, this._axisModel, this._axisPointerModel)));\n  };\n  BaseAxisPointer.prototype._onHandleDragMove = function (dx, dy) {\n    var handle = this._handle;\n    if (!handle) {\n      return;\n    }\n    this._dragging = true;\n    // Persistent for throttle.\n    var trans = this.updateHandleTransform(getHandleTransProps(handle), [dx, dy], this._axisModel, this._axisPointerModel);\n    this._payloadInfo = trans;\n    handle.stopAnimation();\n    handle.attr(getHandleTransProps(trans));\n    inner(handle).lastProp = null;\n    this._doDispatchAxisPointer();\n  };\n  /**\n   * Throttled method.\n   */\n  BaseAxisPointer.prototype._doDispatchAxisPointer = function () {\n    var handle = this._handle;\n    if (!handle) {\n      return;\n    }\n    var payloadInfo = this._payloadInfo;\n    var axisModel = this._axisModel;\n    this._api.dispatchAction({\n      type: 'updateAxisPointer',\n      x: payloadInfo.cursorPoint[0],\n      y: payloadInfo.cursorPoint[1],\n      tooltipOption: payloadInfo.tooltipOption,\n      axesInfo: [{\n        axisDim: axisModel.axis.dim,\n        axisIndex: axisModel.componentIndex\n      }]\n    });\n  };\n  BaseAxisPointer.prototype._onHandleDragEnd = function () {\n    this._dragging = false;\n    var handle = this._handle;\n    if (!handle) {\n      return;\n    }\n    var value = this._axisPointerModel.get('value');\n    // Consider snap or categroy axis, handle may be not consistent with\n    // axisPointer. So move handle to align the exact value position when\n    // drag ended.\n    this._moveHandleToValue(value);\n    // For the effect: tooltip will be shown when finger holding on handle\n    // button, and will be hidden after finger left handle button.\n    this._api.dispatchAction({\n      type: 'hideTip'\n    });\n  };\n  /**\n   * @private\n   */\n  BaseAxisPointer.prototype.clear = function (api) {\n    this._lastValue = null;\n    this._lastStatus = null;\n    var zr = api.getZr();\n    var group = this._group;\n    var handle = this._handle;\n    if (zr && group) {\n      this._lastGraphicKey = null;\n      group && zr.remove(group);\n      handle && zr.remove(handle);\n      this._group = null;\n      this._handle = null;\n      this._payloadInfo = null;\n    }\n    throttleUtil.clear(this, '_doDispatchAxisPointer');\n  };\n  /**\n   * @protected\n   */\n  BaseAxisPointer.prototype.doClear = function () {\n    // Implemented by sub-class if necessary.\n  };\n  BaseAxisPointer.prototype.buildLabel = function (xy, wh, xDimIndex) {\n    xDimIndex = xDimIndex || 0;\n    return {\n      x: xy[xDimIndex],\n      y: xy[1 - xDimIndex],\n      width: wh[xDimIndex],\n      height: wh[1 - xDimIndex]\n    };\n  };\n  return BaseAxisPointer;\n}();\nfunction updateProps(animationModel, moveAnimation, el, props) {\n  // Animation optimize.\n  if (!propsEqual(inner(el).lastProp, props)) {\n    inner(el).lastProp = props;\n    moveAnimation ? graphic.updateProps(el, props, animationModel) : (el.stopAnimation(), el.attr(props));\n  }\n}\nfunction propsEqual(lastProps, newProps) {\n  if (zrUtil.isObject(lastProps) && zrUtil.isObject(newProps)) {\n    var equals_1 = true;\n    zrUtil.each(newProps, function (item, key) {\n      equals_1 = equals_1 && propsEqual(lastProps[key], item);\n    });\n    return !!equals_1;\n  } else {\n    return lastProps === newProps;\n  }\n}\nfunction updateLabelShowHide(labelEl, axisPointerModel) {\n  labelEl[axisPointerModel.get(['label', 'show']) ? 'show' : 'hide']();\n}\nfunction getHandleTransProps(trans) {\n  return {\n    x: trans.x || 0,\n    y: trans.y || 0,\n    rotation: trans.rotation || 0\n  };\n}\nfunction updateMandatoryProps(group, axisPointerModel, silent) {\n  var z = axisPointerModel.get('z');\n  var zlevel = axisPointerModel.get('zlevel');\n  group && group.traverse(function (el) {\n    if (el.type !== 'group') {\n      z != null && (el.z = z);\n      zlevel != null && (el.zlevel = zlevel);\n      el.silent = silent;\n    }\n  });\n}\nexport default BaseAxisPointer;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as graphic from '../../util/graphic.js';\nimport * as textContain from 'zrender/lib/contain/text.js';\nimport * as formatUtil from '../../util/format.js';\nimport * as matrix from 'zrender/lib/core/matrix.js';\nimport * as axisHelper from '../../coord/axisHelper.js';\nimport AxisBuilder from '../axis/AxisBuilder.js';\nimport { createTextStyle } from '../../label/labelStyle.js';\nexport function buildElStyle(axisPointerModel) {\n  var axisPointerType = axisPointerModel.get('type');\n  var styleModel = axisPointerModel.getModel(axisPointerType + 'Style');\n  var style;\n  if (axisPointerType === 'line') {\n    style = styleModel.getLineStyle();\n    style.fill = null;\n  } else if (axisPointerType === 'shadow') {\n    style = styleModel.getAreaStyle();\n    style.stroke = null;\n  }\n  return style;\n}\n/**\n * @param {Function} labelPos {align, verticalAlign, position}\n */\nexport function buildLabelElOption(elOption, axisModel, axisPointerModel, api, labelPos) {\n  var value = axisPointerModel.get('value');\n  var text = getValueLabel(value, axisModel.axis, axisModel.ecModel, axisPointerModel.get('seriesDataIndices'), {\n    precision: axisPointerModel.get(['label', 'precision']),\n    formatter: axisPointerModel.get(['label', 'formatter'])\n  });\n  var labelModel = axisPointerModel.getModel('label');\n  var paddings = formatUtil.normalizeCssArray(labelModel.get('padding') || 0);\n  var font = labelModel.getFont();\n  var textRect = textContain.getBoundingRect(text, font);\n  var position = labelPos.position;\n  var width = textRect.width + paddings[1] + paddings[3];\n  var height = textRect.height + paddings[0] + paddings[2];\n  // Adjust by align.\n  var align = labelPos.align;\n  align === 'right' && (position[0] -= width);\n  align === 'center' && (position[0] -= width / 2);\n  var verticalAlign = labelPos.verticalAlign;\n  verticalAlign === 'bottom' && (position[1] -= height);\n  verticalAlign === 'middle' && (position[1] -= height / 2);\n  // Not overflow ec container\n  confineInContainer(position, width, height, api);\n  var bgColor = labelModel.get('backgroundColor');\n  if (!bgColor || bgColor === 'auto') {\n    bgColor = axisModel.get(['axisLine', 'lineStyle', 'color']);\n  }\n  elOption.label = {\n    // shape: {x: 0, y: 0, width: width, height: height, r: labelModel.get('borderRadius')},\n    x: position[0],\n    y: position[1],\n    style: createTextStyle(labelModel, {\n      text: text,\n      font: font,\n      fill: labelModel.getTextColor(),\n      padding: paddings,\n      backgroundColor: bgColor\n    }),\n    // Label should be over axisPointer.\n    z2: 10\n  };\n}\n// Do not overflow ec container\nfunction confineInContainer(position, width, height, api) {\n  var viewWidth = api.getWidth();\n  var viewHeight = api.getHeight();\n  position[0] = Math.min(position[0] + width, viewWidth) - width;\n  position[1] = Math.min(position[1] + height, viewHeight) - height;\n  position[0] = Math.max(position[0], 0);\n  position[1] = Math.max(position[1], 0);\n}\nexport function getValueLabel(value, axis, ecModel, seriesDataIndices, opt) {\n  value = axis.scale.parse(value);\n  var text = axis.scale.getLabel({\n    value: value\n  }, {\n    // If `precision` is set, width can be fixed (like '12.00500'), which\n    // helps to debounce when when moving label.\n    precision: opt.precision\n  });\n  var formatter = opt.formatter;\n  if (formatter) {\n    var params_1 = {\n      value: axisHelper.getAxisRawValue(axis, {\n        value: value\n      }),\n      axisDimension: axis.dim,\n      axisIndex: axis.index,\n      seriesData: []\n    };\n    zrUtil.each(seriesDataIndices, function (idxItem) {\n      var series = ecModel.getSeriesByIndex(idxItem.seriesIndex);\n      var dataIndex = idxItem.dataIndexInside;\n      var dataParams = series && series.getDataParams(dataIndex);\n      dataParams && params_1.seriesData.push(dataParams);\n    });\n    if (zrUtil.isString(formatter)) {\n      text = formatter.replace('{value}', text);\n    } else if (zrUtil.isFunction(formatter)) {\n      text = formatter(params_1);\n    }\n  }\n  return text;\n}\nexport function getTransformedPosition(axis, value, layoutInfo) {\n  var transform = matrix.create();\n  matrix.rotate(transform, transform, layoutInfo.rotation);\n  matrix.translate(transform, transform, layoutInfo.position);\n  return graphic.applyTransform([axis.dataToCoord(value), (layoutInfo.labelOffset || 0) + (layoutInfo.labelDirection || 1) * (layoutInfo.labelMargin || 0)], transform);\n}\nexport function buildCartesianSingleLabelElOption(value, elOption, layoutInfo, axisModel, axisPointerModel, api) {\n  var textLayout = AxisBuilder.innerTextLayout(layoutInfo.rotation, 0, layoutInfo.labelDirection);\n  layoutInfo.labelMargin = axisPointerModel.get(['label', 'margin']);\n  buildLabelElOption(elOption, axisModel, axisPointerModel, api, {\n    position: getTransformedPosition(axisModel.axis, value, layoutInfo),\n    align: textLayout.textAlign,\n    verticalAlign: textLayout.textVerticalAlign\n  });\n}\nexport function makeLineShape(p1, p2, xDimIndex) {\n  xDimIndex = xDimIndex || 0;\n  return {\n    x1: p1[xDimIndex],\n    y1: p1[1 - xDimIndex],\n    x2: p2[xDimIndex],\n    y2: p2[1 - xDimIndex]\n  };\n}\nexport function makeRectShape(xy, wh, xDimIndex) {\n  xDimIndex = xDimIndex || 0;\n  return {\n    x: xy[xDimIndex],\n    y: xy[1 - xDimIndex],\n    width: wh[xDimIndex],\n    height: wh[1 - xDimIndex]\n  };\n}\nexport function makeSectorShape(cx, cy, r0, r, startAngle, endAngle) {\n  return {\n    cx: cx,\n    cy: cy,\n    r0: r0,\n    r: r,\n    startAngle: startAngle,\n    endAngle: endAngle,\n    clockwise: true\n  };\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport BaseAxisPointer from './BaseAxisPointer.js';\nimport * as viewHelper from './viewHelper.js';\nimport * as cartesianAxisHelper from '../../coord/cartesian/cartesianAxisHelper.js';\nvar CartesianAxisPointer = /** @class */function (_super) {\n  __extends(CartesianAxisPointer, _super);\n  function CartesianAxisPointer() {\n    return _super !== null && _super.apply(this, arguments) || this;\n  }\n  /**\n   * @override\n   */\n  CartesianAxisPointer.prototype.makeElOption = function (elOption, value, axisModel, axisPointerModel, api) {\n    var axis = axisModel.axis;\n    var grid = axis.grid;\n    var axisPointerType = axisPointerModel.get('type');\n    var otherExtent = getCartesian(grid, axis).getOtherAxis(axis).getGlobalExtent();\n    var pixelValue = axis.toGlobalCoord(axis.dataToCoord(value, true));\n    if (axisPointerType && axisPointerType !== 'none') {\n      var elStyle = viewHelper.buildElStyle(axisPointerModel);\n      var pointerOption = pointerShapeBuilder[axisPointerType](axis, pixelValue, otherExtent);\n      pointerOption.style = elStyle;\n      elOption.graphicKey = pointerOption.type;\n      elOption.pointer = pointerOption;\n    }\n    var layoutInfo = cartesianAxisHelper.layout(grid.getRect(), axisModel);\n    viewHelper.buildCartesianSingleLabelElOption(value, elOption, layoutInfo, axisModel, axisPointerModel, api);\n  };\n  /**\n   * @override\n   */\n  CartesianAxisPointer.prototype.getHandleTransform = function (value, axisModel, axisPointerModel) {\n    var layoutInfo = cartesianAxisHelper.layout(axisModel.axis.grid.getRect(), axisModel, {\n      labelInside: false\n    });\n    layoutInfo.labelMargin = axisPointerModel.get(['handle', 'margin']);\n    var pos = viewHelper.getTransformedPosition(axisModel.axis, value, layoutInfo);\n    return {\n      x: pos[0],\n      y: pos[1],\n      rotation: layoutInfo.rotation + (layoutInfo.labelDirection < 0 ? Math.PI : 0)\n    };\n  };\n  /**\n   * @override\n   */\n  CartesianAxisPointer.prototype.updateHandleTransform = function (transform, delta, axisModel, axisPointerModel) {\n    var axis = axisModel.axis;\n    var grid = axis.grid;\n    var axisExtent = axis.getGlobalExtent(true);\n    var otherExtent = getCartesian(grid, axis).getOtherAxis(axis).getGlobalExtent();\n    var dimIndex = axis.dim === 'x' ? 0 : 1;\n    var currPosition = [transform.x, transform.y];\n    currPosition[dimIndex] += delta[dimIndex];\n    currPosition[dimIndex] = Math.min(axisExtent[1], currPosition[dimIndex]);\n    currPosition[dimIndex] = Math.max(axisExtent[0], currPosition[dimIndex]);\n    var cursorOtherValue = (otherExtent[1] + otherExtent[0]) / 2;\n    var cursorPoint = [cursorOtherValue, cursorOtherValue];\n    cursorPoint[dimIndex] = currPosition[dimIndex];\n    // Make tooltip do not overlap axisPointer and in the middle of the grid.\n    var tooltipOptions = [{\n      verticalAlign: 'middle'\n    }, {\n      align: 'center'\n    }];\n    return {\n      x: currPosition[0],\n      y: currPosition[1],\n      rotation: transform.rotation,\n      cursorPoint: cursorPoint,\n      tooltipOption: tooltipOptions[dimIndex]\n    };\n  };\n  return CartesianAxisPointer;\n}(BaseAxisPointer);\nfunction getCartesian(grid, axis) {\n  var opt = {};\n  opt[axis.dim + 'AxisIndex'] = axis.index;\n  return grid.getCartesian(opt);\n}\nvar pointerShapeBuilder = {\n  line: function (axis, pixelValue, otherExtent) {\n    var targetShape = viewHelper.makeLineShape([pixelValue, otherExtent[0]], [pixelValue, otherExtent[1]], getAxisDimIndex(axis));\n    return {\n      type: 'Line',\n      subPixelOptimize: true,\n      shape: targetShape\n    };\n  },\n  shadow: function (axis, pixelValue, otherExtent) {\n    var bandWidth = Math.max(1, axis.getBandWidth());\n    var span = otherExtent[1] - otherExtent[0];\n    return {\n      type: 'Rect',\n      shape: viewHelper.makeRectShape([pixelValue - bandWidth / 2, otherExtent[0]], [bandWidth, span], getAxisDimIndex(axis))\n    };\n  }\n};\nfunction getAxisDimIndex(axis) {\n  return axis.dim === 'x' ? 0 : 1;\n}\nexport default CartesianAxisPointer;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport ComponentModel from '../../model/Component.js';\nimport tokens from '../../visual/tokens.js';\nvar AxisPointerModel = /** @class */function (_super) {\n  __extends(AxisPointerModel, _super);\n  function AxisPointerModel() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = AxisPointerModel.type;\n    return _this;\n  }\n  AxisPointerModel.type = 'axisPointer';\n  AxisPointerModel.defaultOption = {\n    // 'auto' means that show when triggered by tooltip or handle.\n    show: 'auto',\n    // zlevel: 0,\n    z: 50,\n    type: 'line',\n    // axispointer triggered by tootip determine snap automatically,\n    // see `modelHelper`.\n    snap: false,\n    triggerTooltip: true,\n    triggerEmphasis: true,\n    value: null,\n    status: null,\n    link: [],\n    // Do not set 'auto' here, otherwise global animation: false\n    // will not effect at this axispointer.\n    animation: null,\n    animationDurationUpdate: 200,\n    lineStyle: {\n      color: tokens.color.border,\n      width: 1,\n      type: 'dashed'\n    },\n    shadowStyle: {\n      color: tokens.color.shadowTint\n    },\n    label: {\n      show: true,\n      formatter: null,\n      precision: 'auto',\n      margin: 3,\n      color: tokens.color.neutral00,\n      padding: [5, 7, 5, 7],\n      backgroundColor: tokens.color.accent60,\n      borderColor: null,\n      borderWidth: 0,\n      borderRadius: 3\n    },\n    handle: {\n      show: false,\n      // eslint-disable-next-line\n      icon: 'M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z',\n      size: 45,\n      // handle margin is from symbol center to axis, which is stable when circular move.\n      margin: 50,\n      // color: '#1b8bbd'\n      // color: '#2f4554'\n      color: tokens.color.accent40,\n      // For mobile performance\n      throttle: 40\n    }\n  };\n  return AxisPointerModel;\n}(ComponentModel);\nexport default AxisPointerModel;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport env from 'zrender/lib/core/env.js';\nimport { makeInner } from '../../util/model.js';\nvar inner = makeInner();\nvar each = zrUtil.each;\n/**\n * @param {string} key\n * @param {module:echarts/ExtensionAPI} api\n * @param {Function} handler\n *      param: {string} currTrigger\n *      param: {Array.<number>} point\n */\nexport function register(key, api, handler) {\n  if (env.node) {\n    return;\n  }\n  var zr = api.getZr();\n  inner(zr).records || (inner(zr).records = {});\n  initGlobalListeners(zr, api);\n  var record = inner(zr).records[key] || (inner(zr).records[key] = {});\n  record.handler = handler;\n}\nfunction initGlobalListeners(zr, api) {\n  if (inner(zr).initialized) {\n    return;\n  }\n  inner(zr).initialized = true;\n  useHandler('click', zrUtil.curry(doEnter, 'click'));\n  useHandler('mousemove', zrUtil.curry(doEnter, 'mousemove'));\n  // useHandler('mouseout', onLeave);\n  useHandler('globalout', onLeave);\n  function useHandler(eventType, cb) {\n    zr.on(eventType, function (e) {\n      var dis = makeDispatchAction(api);\n      each(inner(zr).records, function (record) {\n        record && cb(record, e, dis.dispatchAction);\n      });\n      dispatchTooltipFinally(dis.pendings, api);\n    });\n  }\n}\nfunction dispatchTooltipFinally(pendings, api) {\n  var showLen = pendings.showTip.length;\n  var hideLen = pendings.hideTip.length;\n  var actuallyPayload;\n  if (showLen) {\n    actuallyPayload = pendings.showTip[showLen - 1];\n  } else if (hideLen) {\n    actuallyPayload = pendings.hideTip[hideLen - 1];\n  }\n  if (actuallyPayload) {\n    actuallyPayload.dispatchAction = null;\n    api.dispatchAction(actuallyPayload);\n  }\n}\nfunction onLeave(record, e, dispatchAction) {\n  record.handler('leave', null, dispatchAction);\n}\nfunction doEnter(currTrigger, record, e, dispatchAction) {\n  record.handler(currTrigger, e, dispatchAction);\n}\nfunction makeDispatchAction(api) {\n  var pendings = {\n    showTip: [],\n    hideTip: []\n  };\n  // FIXME\n  // better approach?\n  // 'showTip' and 'hideTip' can be triggered by axisPointer and tooltip,\n  // which may be conflict, (axisPointer call showTip but tooltip call hideTip);\n  // So we have to add \"final stage\" to merge those dispatched actions.\n  var dispatchAction = function (payload) {\n    var pendingList = pendings[payload.type];\n    if (pendingList) {\n      pendingList.push(payload);\n    } else {\n      payload.dispatchAction = dispatchAction;\n      api.dispatchAction(payload);\n    }\n  };\n  return {\n    dispatchAction: dispatchAction,\n    pendings: pendings\n  };\n}\nexport function unregister(key, api) {\n  if (env.node) {\n    return;\n  }\n  var zr = api.getZr();\n  var record = (inner(zr).records || {})[key];\n  if (record) {\n    inner(zr).records[key] = null;\n  }\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as globalListener from './globalListener.js';\nimport ComponentView from '../../view/Component.js';\nvar AxisPointerView = /** @class */function (_super) {\n  __extends(AxisPointerView, _super);\n  function AxisPointerView() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = AxisPointerView.type;\n    return _this;\n  }\n  AxisPointerView.prototype.render = function (globalAxisPointerModel, ecModel, api) {\n    var globalTooltipModel = ecModel.getComponent('tooltip');\n    var triggerOn = globalAxisPointerModel.get('triggerOn') || globalTooltipModel && globalTooltipModel.get('triggerOn') || 'mousemove|click';\n    // Register global listener in AxisPointerView to enable\n    // AxisPointerView to be independent to Tooltip.\n    globalListener.register('axisPointer', api, function (currTrigger, e, dispatchAction) {\n      // If 'none', it is not controlled by mouse totally.\n      if (triggerOn !== 'none' && (currTrigger === 'leave' || triggerOn.indexOf(currTrigger) >= 0)) {\n        dispatchAction({\n          type: 'updateAxisPointer',\n          currTrigger: currTrigger,\n          x: e && e.offsetX,\n          y: e && e.offsetY\n        });\n      }\n    });\n  };\n  AxisPointerView.prototype.remove = function (ecModel, api) {\n    globalListener.unregister('axisPointer', api);\n  };\n  AxisPointerView.prototype.dispose = function (ecModel, api) {\n    globalListener.unregister('axisPointer', api);\n  };\n  AxisPointerView.type = 'axisPointer';\n  return AxisPointerView;\n}(ComponentView);\nexport default AxisPointerView;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as modelUtil from '../../util/model.js';\n/**\n * @param finder contains {seriesIndex, dataIndex, dataIndexInside}\n * @param ecModel\n * @return  {point: [x, y], el: ...} point Will not be null.\n */\nexport default function findPointFromSeries(finder, ecModel) {\n  var point = [];\n  var seriesIndex = finder.seriesIndex;\n  var seriesModel;\n  if (seriesIndex == null || !(seriesModel = ecModel.getSeriesByIndex(seriesIndex))) {\n    return {\n      point: []\n    };\n  }\n  var data = seriesModel.getData();\n  var dataIndex = modelUtil.queryDataIndex(data, finder);\n  if (dataIndex == null || dataIndex < 0 || zrUtil.isArray(dataIndex)) {\n    return {\n      point: []\n    };\n  }\n  var el = data.getItemGraphicEl(dataIndex);\n  var coordSys = seriesModel.coordinateSystem;\n  if (seriesModel.getTooltipPosition) {\n    point = seriesModel.getTooltipPosition(dataIndex) || [];\n  } else if (coordSys && coordSys.dataToPoint) {\n    if (finder.isStacked) {\n      var baseAxis = coordSys.getBaseAxis();\n      var valueAxis = coordSys.getOtherAxis(baseAxis);\n      var valueAxisDim = valueAxis.dim;\n      var baseAxisDim = baseAxis.dim;\n      var baseDataOffset = valueAxisDim === 'x' || valueAxisDim === 'radius' ? 1 : 0;\n      var baseDim = data.mapDimension(baseAxisDim);\n      var stackedData = [];\n      stackedData[baseDataOffset] = data.get(baseDim, dataIndex);\n      stackedData[1 - baseDataOffset] = data.get(data.getCalculationInfo('stackResultDimension'), dataIndex);\n      point = coordSys.dataToPoint(stackedData) || [];\n    } else {\n      point = coordSys.dataToPoint(data.getValues(zrUtil.map(coordSys.dimensions, function (dim) {\n        return data.mapDimension(dim);\n      }), dataIndex)) || [];\n    }\n  } else if (el) {\n    // Use graphic bounding rect\n    var rect = el.getBoundingRect().clone();\n    rect.applyTransform(el.transform);\n    point = [rect.x + rect.width / 2, rect.y + rect.height / 2];\n  }\n  return {\n    point: point,\n    el: el\n  };\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { makeInner } from '../../util/model.js';\nimport * as modelHelper from './modelHelper.js';\nimport findPointFromSeries from './findPointFromSeries.js';\nimport { each, curry, bind, extend } from 'zrender/lib/core/util.js';\nvar inner = makeInner();\n/**\n * Basic logic: check all axis, if they do not demand show/highlight,\n * then hide/downplay them.\n *\n * @return content of event obj for echarts.connect.\n */\nexport default function axisTrigger(payload, ecModel, api) {\n  var currTrigger = payload.currTrigger;\n  var point = [payload.x, payload.y];\n  var finder = payload;\n  var dispatchAction = payload.dispatchAction || bind(api.dispatchAction, api);\n  var coordSysAxesInfo = ecModel.getComponent('axisPointer').coordSysAxesInfo;\n  // Pending\n  // See #6121. But we are not able to reproduce it yet.\n  if (!coordSysAxesInfo) {\n    return;\n  }\n  if (illegalPoint(point)) {\n    // Used in the default behavior of `connection`: use the sample seriesIndex\n    // and dataIndex. And also used in the tooltipView trigger.\n    point = findPointFromSeries({\n      seriesIndex: finder.seriesIndex,\n      // Do not use dataIndexInside from other ec instance.\n      // FIXME: auto detect it?\n      dataIndex: finder.dataIndex\n    }, ecModel).point;\n  }\n  var isIllegalPoint = illegalPoint(point);\n  // Axis and value can be specified when calling dispatchAction({type: 'updateAxisPointer'}).\n  // Notice: In this case, it is difficult to get the `point` (which is necessary to show\n  // tooltip, so if point is not given, we just use the point found by sample seriesIndex\n  // and dataIndex.\n  var inputAxesInfo = finder.axesInfo;\n  var axesInfo = coordSysAxesInfo.axesInfo;\n  var shouldHide = currTrigger === 'leave' || illegalPoint(point);\n  var outputPayload = {};\n  var showValueMap = {};\n  var dataByCoordSys = {\n    list: [],\n    map: {}\n  };\n  var updaters = {\n    showPointer: curry(showPointer, showValueMap),\n    showTooltip: curry(showTooltip, dataByCoordSys)\n  };\n  // Process for triggered axes.\n  each(coordSysAxesInfo.coordSysMap, function (coordSys, coordSysKey) {\n    // If a point given, it must be contained by the coordinate system.\n    var coordSysContainsPoint = isIllegalPoint || coordSys.containPoint(point);\n    each(coordSysAxesInfo.coordSysAxesInfo[coordSysKey], function (axisInfo, key) {\n      var axis = axisInfo.axis;\n      var inputAxisInfo = findInputAxisInfo(inputAxesInfo, axisInfo);\n      // If no inputAxesInfo, no axis is restricted.\n      if (!shouldHide && coordSysContainsPoint && (!inputAxesInfo || inputAxisInfo)) {\n        var val = inputAxisInfo && inputAxisInfo.value;\n        if (val == null && !isIllegalPoint) {\n          val = axis.pointToData(point);\n        }\n        val != null && processOnAxis(axisInfo, val, updaters, false, outputPayload);\n      }\n    });\n  });\n  // Process for linked axes.\n  var linkTriggers = {};\n  each(axesInfo, function (tarAxisInfo, tarKey) {\n    var linkGroup = tarAxisInfo.linkGroup;\n    // If axis has been triggered in the previous stage, it should not be triggered by link.\n    if (linkGroup && !showValueMap[tarKey]) {\n      each(linkGroup.axesInfo, function (srcAxisInfo, srcKey) {\n        var srcValItem = showValueMap[srcKey];\n        // If srcValItem exist, source axis is triggered, so link to target axis.\n        if (srcAxisInfo !== tarAxisInfo && srcValItem) {\n          var val = srcValItem.value;\n          linkGroup.mapper && (val = tarAxisInfo.axis.scale.parse(linkGroup.mapper(val, makeMapperParam(srcAxisInfo), makeMapperParam(tarAxisInfo))));\n          linkTriggers[tarAxisInfo.key] = val;\n        }\n      });\n    }\n  });\n  each(linkTriggers, function (val, tarKey) {\n    processOnAxis(axesInfo[tarKey], val, updaters, true, outputPayload);\n  });\n  updateModelActually(showValueMap, axesInfo, outputPayload);\n  dispatchTooltipActually(dataByCoordSys, point, payload, dispatchAction);\n  dispatchHighDownActually(axesInfo, dispatchAction, api);\n  return outputPayload;\n}\nfunction processOnAxis(axisInfo, newValue, updaters, noSnap, outputFinder) {\n  var axis = axisInfo.axis;\n  if (axis.scale.isBlank() || !axis.containData(newValue)) {\n    return;\n  }\n  if (!axisInfo.involveSeries) {\n    updaters.showPointer(axisInfo, newValue);\n    return;\n  }\n  // Heavy calculation. So put it after axis.containData checking.\n  var payloadInfo = buildPayloadsBySeries(newValue, axisInfo);\n  var payloadBatch = payloadInfo.payloadBatch;\n  var snapToValue = payloadInfo.snapToValue;\n  // Fill content of event obj for echarts.connect.\n  // By default use the first involved series data as a sample to connect.\n  if (payloadBatch[0] && outputFinder.seriesIndex == null) {\n    extend(outputFinder, payloadBatch[0]);\n  }\n  // If no linkSource input, this process is for collecting link\n  // target, where snap should not be accepted.\n  if (!noSnap && axisInfo.snap) {\n    if (axis.containData(snapToValue) && snapToValue != null) {\n      newValue = snapToValue;\n    }\n  }\n  updaters.showPointer(axisInfo, newValue, payloadBatch);\n  // Tooltip should always be snapToValue, otherwise there will be\n  // incorrect \"axis value ~ series value\" mapping displayed in tooltip.\n  updaters.showTooltip(axisInfo, payloadInfo, snapToValue);\n}\nfunction buildPayloadsBySeries(value, axisInfo) {\n  var axis = axisInfo.axis;\n  var dim = axis.dim;\n  var snapToValue = value;\n  var payloadBatch = [];\n  var minDist = Number.MAX_VALUE;\n  var minDiff = -1;\n  each(axisInfo.seriesModels, function (series, idx) {\n    var dataDim = series.getData().mapDimensionsAll(dim);\n    var seriesNestestValue;\n    var dataIndices;\n    if (series.getAxisTooltipData) {\n      var result = series.getAxisTooltipData(dataDim, value, axis);\n      dataIndices = result.dataIndices;\n      seriesNestestValue = result.nestestValue;\n    } else {\n      dataIndices = series.indicesOfNearest(dim, dataDim[0], value,\n      // Add a threshold to avoid find the wrong dataIndex\n      // when data length is not same.\n      // false,\n      axis.type === 'category' ? 0.5 : null);\n      if (!dataIndices.length) {\n        return;\n      }\n      seriesNestestValue = series.getData().get(dataDim[0], dataIndices[0]);\n    }\n    if (seriesNestestValue == null || !isFinite(seriesNestestValue)) {\n      return;\n    }\n    var diff = value - seriesNestestValue;\n    var dist = Math.abs(diff);\n    // Consider category case\n    if (dist <= minDist) {\n      if (dist < minDist || diff >= 0 && minDiff < 0) {\n        minDist = dist;\n        minDiff = diff;\n        snapToValue = seriesNestestValue;\n        payloadBatch.length = 0;\n      }\n      each(dataIndices, function (dataIndex) {\n        payloadBatch.push({\n          seriesIndex: series.seriesIndex,\n          dataIndexInside: dataIndex,\n          dataIndex: series.getData().getRawIndex(dataIndex)\n        });\n      });\n    }\n  });\n  return {\n    payloadBatch: payloadBatch,\n    snapToValue: snapToValue\n  };\n}\nfunction showPointer(showValueMap, axisInfo, value, payloadBatch) {\n  showValueMap[axisInfo.key] = {\n    value: value,\n    payloadBatch: payloadBatch\n  };\n}\nfunction showTooltip(dataByCoordSys, axisInfo, payloadInfo, value) {\n  var payloadBatch = payloadInfo.payloadBatch;\n  var axis = axisInfo.axis;\n  var axisModel = axis.model;\n  var axisPointerModel = axisInfo.axisPointerModel;\n  // If no data, do not create anything in dataByCoordSys,\n  // whose length will be used to judge whether dispatch action.\n  if (!axisInfo.triggerTooltip || !payloadBatch.length) {\n    return;\n  }\n  var coordSysModel = axisInfo.coordSys.model;\n  var coordSysKey = modelHelper.makeKey(coordSysModel);\n  var coordSysItem = dataByCoordSys.map[coordSysKey];\n  if (!coordSysItem) {\n    coordSysItem = dataByCoordSys.map[coordSysKey] = {\n      coordSysId: coordSysModel.id,\n      coordSysIndex: coordSysModel.componentIndex,\n      coordSysType: coordSysModel.type,\n      coordSysMainType: coordSysModel.mainType,\n      dataByAxis: []\n    };\n    dataByCoordSys.list.push(coordSysItem);\n  }\n  coordSysItem.dataByAxis.push({\n    axisDim: axis.dim,\n    axisIndex: axisModel.componentIndex,\n    axisType: axisModel.type,\n    axisId: axisModel.id,\n    value: value,\n    // Caustion: viewHelper.getValueLabel is actually on \"view stage\", which\n    // depends that all models have been updated. So it should not be performed\n    // here. Considering axisPointerModel used here is volatile, which is hard\n    // to be retrieve in TooltipView, we prepare parameters here.\n    valueLabelOpt: {\n      precision: axisPointerModel.get(['label', 'precision']),\n      formatter: axisPointerModel.get(['label', 'formatter'])\n    },\n    seriesDataIndices: payloadBatch.slice()\n  });\n}\nfunction updateModelActually(showValueMap, axesInfo, outputPayload) {\n  var outputAxesInfo = outputPayload.axesInfo = [];\n  // Basic logic: If no 'show' required, 'hide' this axisPointer.\n  each(axesInfo, function (axisInfo, key) {\n    var option = axisInfo.axisPointerModel.option;\n    var valItem = showValueMap[key];\n    if (valItem) {\n      !axisInfo.useHandle && (option.status = 'show');\n      option.value = valItem.value;\n      // For label formatter param and highlight.\n      option.seriesDataIndices = (valItem.payloadBatch || []).slice();\n    }\n    // When always show (e.g., handle used), remain\n    // original value and status.\n    else {\n      // If hide, value still need to be set, consider\n      // click legend to toggle axis blank.\n      !axisInfo.useHandle && (option.status = 'hide');\n    }\n    // If status is 'hide', should be no info in payload.\n    option.status === 'show' && outputAxesInfo.push({\n      axisDim: axisInfo.axis.dim,\n      axisIndex: axisInfo.axis.model.componentIndex,\n      value: option.value\n    });\n  });\n}\nfunction dispatchTooltipActually(dataByCoordSys, point, payload, dispatchAction) {\n  // Basic logic: If no showTip required, hideTip will be dispatched.\n  if (illegalPoint(point) || !dataByCoordSys.list.length) {\n    dispatchAction({\n      type: 'hideTip'\n    });\n    return;\n  }\n  // In most case only one axis (or event one series is used). It is\n  // convenient to fetch payload.seriesIndex and payload.dataIndex\n  // directly. So put the first seriesIndex and dataIndex of the first\n  // axis on the payload.\n  var sampleItem = ((dataByCoordSys.list[0].dataByAxis[0] || {}).seriesDataIndices || [])[0] || {};\n  dispatchAction({\n    type: 'showTip',\n    escapeConnect: true,\n    x: point[0],\n    y: point[1],\n    tooltipOption: payload.tooltipOption,\n    position: payload.position,\n    dataIndexInside: sampleItem.dataIndexInside,\n    dataIndex: sampleItem.dataIndex,\n    seriesIndex: sampleItem.seriesIndex,\n    dataByCoordSys: dataByCoordSys.list\n  });\n}\nfunction dispatchHighDownActually(axesInfo, dispatchAction, api) {\n  // FIXME\n  // highlight status modification should be a stage of main process?\n  // (Consider confilct (e.g., legend and axisPointer) and setOption)\n  var zr = api.getZr();\n  var highDownKey = 'axisPointerLastHighlights';\n  var lastHighlights = inner(zr)[highDownKey] || {};\n  var newHighlights = inner(zr)[highDownKey] = {};\n  // Update highlight/downplay status according to axisPointer model.\n  // Build hash map and remove duplicate incidentally.\n  each(axesInfo, function (axisInfo, key) {\n    var option = axisInfo.axisPointerModel.option;\n    option.status === 'show' && axisInfo.triggerEmphasis && each(option.seriesDataIndices, function (batchItem) {\n      var key = batchItem.seriesIndex + ' | ' + batchItem.dataIndex;\n      newHighlights[key] = batchItem;\n    });\n  });\n  // Diff.\n  var toHighlight = [];\n  var toDownplay = [];\n  each(lastHighlights, function (batchItem, key) {\n    !newHighlights[key] && toDownplay.push(batchItem);\n  });\n  each(newHighlights, function (batchItem, key) {\n    !lastHighlights[key] && toHighlight.push(batchItem);\n  });\n  toDownplay.length && api.dispatchAction({\n    type: 'downplay',\n    escapeConnect: true,\n    // Not blur others when highlight in axisPointer.\n    notBlur: true,\n    batch: toDownplay\n  });\n  toHighlight.length && api.dispatchAction({\n    type: 'highlight',\n    escapeConnect: true,\n    // Not blur others when highlight in axisPointer.\n    notBlur: true,\n    batch: toHighlight\n  });\n}\nfunction findInputAxisInfo(inputAxesInfo, axisInfo) {\n  for (var i = 0; i < (inputAxesInfo || []).length; i++) {\n    var inputAxisInfo = inputAxesInfo[i];\n    if (axisInfo.axis.dim === inputAxisInfo.axisDim && axisInfo.axis.model.componentIndex === inputAxisInfo.axisIndex) {\n      return inputAxisInfo;\n    }\n  }\n}\nfunction makeMapperParam(axisInfo) {\n  var axisModel = axisInfo.axis.model;\n  var item = {};\n  var dim = item.axisDim = axisInfo.axis.dim;\n  item.axisIndex = item[dim + 'AxisIndex'] = axisModel.componentIndex;\n  item.axisName = item[dim + 'AxisName'] = axisModel.name;\n  item.axisId = item[dim + 'AxisId'] = axisModel.id;\n  return item;\n}\nfunction illegalPoint(point) {\n  return !point || point[0] == null || isNaN(point[0]) || point[1] == null || isNaN(point[1]);\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport AxisView from '../axis/AxisView.js';\nimport CartesianAxisPointer from './CartesianAxisPointer.js';\nimport AxisPointerModel from './AxisPointerModel.js';\nimport AxisPointerView from './AxisPointerView.js';\nimport { isArray } from 'zrender/lib/core/util.js';\nimport { collect } from './modelHelper.js';\nimport axisTrigger from './axisTrigger.js';\nexport function install(registers) {\n  // CartesianAxisPointer is not supposed to be required here. But consider\n  // echarts.simple.js and online build tooltip, which only require gridSimple,\n  // CartesianAxisPointer should be able to required somewhere.\n  AxisView.registerAxisPointerClass('CartesianAxisPointer', CartesianAxisPointer);\n  registers.registerComponentModel(AxisPointerModel);\n  registers.registerComponentView(AxisPointerView);\n  registers.registerPreprocessor(function (option) {\n    // Always has a global axisPointerModel for default setting.\n    if (option) {\n      (!option.axisPointer || option.axisPointer.length === 0) && (option.axisPointer = {});\n      var link = option.axisPointer.link;\n      // Normalize to array to avoid object mergin. But if link\n      // is not set, remain null/undefined, otherwise it will\n      // override existent link setting.\n      if (link && !isArray(link)) {\n        option.axisPointer.link = [link];\n      }\n    }\n  });\n  // This process should proformed after coordinate systems created\n  // and series data processed. So put it on statistic processing stage.\n  registers.registerProcessor(registers.PRIORITY.PROCESSOR.STATISTIC, function (ecModel, api) {\n    // Build axisPointerModel, mergin tooltip.axisPointer model for each axis.\n    // allAxesInfo should be updated when setOption performed.\n    ecModel.getComponent('axisPointer').coordSysAxesInfo = collect(ecModel, api);\n  });\n  // Broadcast to all views.\n  registers.registerAction({\n    type: 'updateAxisPointer',\n    event: 'updateAxisPointer',\n    update: ':updateAxisPointer'\n  }, axisTrigger);\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { install as installSimple } from './installSimple.js';\nimport { install as installAxisPointer } from '../axisPointer/install.js';\nimport { use } from '../../extension.js';\nexport function install(registers) {\n  use(installSimple);\n  use(installAxisPointer);\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport BaseAxisPointer from './BaseAxisPointer.js';\nimport * as graphic from '../../util/graphic.js';\nimport * as viewHelper from './viewHelper.js';\nimport * as matrix from 'zrender/lib/core/matrix.js';\nimport AxisBuilder from '../axis/AxisBuilder.js';\nvar PolarAxisPointer = /** @class */function (_super) {\n  __extends(PolarAxisPointer, _super);\n  function PolarAxisPointer() {\n    return _super !== null && _super.apply(this, arguments) || this;\n  }\n  /**\n   * @override\n   */\n  PolarAxisPointer.prototype.makeElOption = function (elOption, value, axisModel, axisPointerModel, api) {\n    var axis = axisModel.axis;\n    if (axis.dim === 'angle') {\n      this.animationThreshold = Math.PI / 18;\n    }\n    var polar = axis.polar;\n    var otherAxis = polar.getOtherAxis(axis);\n    var otherExtent = otherAxis.getExtent();\n    var coordValue = axis.dataToCoord(value);\n    var axisPointerType = axisPointerModel.get('type');\n    if (axisPointerType && axisPointerType !== 'none') {\n      var elStyle = viewHelper.buildElStyle(axisPointerModel);\n      var pointerOption = pointerShapeBuilder[axisPointerType](axis, polar, coordValue, otherExtent);\n      pointerOption.style = elStyle;\n      elOption.graphicKey = pointerOption.type;\n      elOption.pointer = pointerOption;\n    }\n    var labelMargin = axisPointerModel.get(['label', 'margin']);\n    var labelPos = getLabelPosition(value, axisModel, axisPointerModel, polar, labelMargin);\n    viewHelper.buildLabelElOption(elOption, axisModel, axisPointerModel, api, labelPos);\n  };\n  return PolarAxisPointer;\n}(BaseAxisPointer);\n;\nfunction getLabelPosition(value, axisModel, axisPointerModel, polar, labelMargin) {\n  var axis = axisModel.axis;\n  var coord = axis.dataToCoord(value);\n  var axisAngle = polar.getAngleAxis().getExtent()[0];\n  axisAngle = axisAngle / 180 * Math.PI;\n  var radiusExtent = polar.getRadiusAxis().getExtent();\n  var position;\n  var align;\n  var verticalAlign;\n  if (axis.dim === 'radius') {\n    var transform = matrix.create();\n    matrix.rotate(transform, transform, axisAngle);\n    matrix.translate(transform, transform, [polar.cx, polar.cy]);\n    position = graphic.applyTransform([coord, -labelMargin], transform);\n    var labelRotation = axisModel.getModel('axisLabel').get('rotate') || 0;\n    // @ts-ignore\n    var labelLayout = AxisBuilder.innerTextLayout(axisAngle, labelRotation * Math.PI / 180, -1);\n    align = labelLayout.textAlign;\n    verticalAlign = labelLayout.textVerticalAlign;\n  } else {\n    // angle axis\n    var r = radiusExtent[1];\n    position = polar.coordToPoint([r + labelMargin, coord]);\n    var cx = polar.cx;\n    var cy = polar.cy;\n    align = Math.abs(position[0] - cx) / r < 0.3 ? 'center' : position[0] > cx ? 'left' : 'right';\n    verticalAlign = Math.abs(position[1] - cy) / r < 0.3 ? 'middle' : position[1] > cy ? 'top' : 'bottom';\n  }\n  return {\n    position: position,\n    align: align,\n    verticalAlign: verticalAlign\n  };\n}\nvar pointerShapeBuilder = {\n  line: function (axis, polar, coordValue, otherExtent) {\n    return axis.dim === 'angle' ? {\n      type: 'Line',\n      shape: viewHelper.makeLineShape(polar.coordToPoint([otherExtent[0], coordValue]), polar.coordToPoint([otherExtent[1], coordValue]))\n    } : {\n      type: 'Circle',\n      shape: {\n        cx: polar.cx,\n        cy: polar.cy,\n        r: coordValue\n      }\n    };\n  },\n  shadow: function (axis, polar, coordValue, otherExtent) {\n    var bandWidth = Math.max(1, axis.getBandWidth());\n    var radian = Math.PI / 180;\n    return axis.dim === 'angle' ? {\n      type: 'Sector',\n      shape: viewHelper.makeSectorShape(polar.cx, polar.cy, otherExtent[0], otherExtent[1],\n      // In ECharts y is negative if angle is positive\n      (-coordValue - bandWidth / 2) * radian, (-coordValue + bandWidth / 2) * radian)\n    } : {\n      type: 'Sector',\n      shape: viewHelper.makeSectorShape(polar.cx, polar.cy, coordValue - bandWidth / 2, coordValue + bandWidth / 2, 0, Math.PI * 2)\n    };\n  }\n};\nexport default PolarAxisPointer;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport ComponentModel from '../../model/Component.js';\nvar PolarModel = /** @class */function (_super) {\n  __extends(PolarModel, _super);\n  function PolarModel() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = PolarModel.type;\n    return _this;\n  }\n  PolarModel.prototype.findAxisModel = function (axisType) {\n    var foundAxisModel;\n    var ecModel = this.ecModel;\n    ecModel.eachComponent(axisType, function (axisModel) {\n      if (axisModel.getCoordSysModel() === this) {\n        foundAxisModel = axisModel;\n      }\n    }, this);\n    return foundAxisModel;\n  };\n  PolarModel.type = 'polar';\n  PolarModel.dependencies = ['radiusAxis', 'angleAxis'];\n  PolarModel.defaultOption = {\n    // zlevel: 0,\n    z: 0,\n    center: ['50%', '50%'],\n    radius: '80%'\n  };\n  return PolarModel;\n}(ComponentModel);\nexport default PolarModel;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport ComponentModel from '../../model/Component.js';\nimport { AxisModelCommonMixin } from '../axisModelCommonMixin.js';\nimport { SINGLE_REFERRING } from '../../util/model.js';\nvar PolarAxisModel = /** @class */function (_super) {\n  __extends(PolarAxisModel, _super);\n  function PolarAxisModel() {\n    return _super !== null && _super.apply(this, arguments) || this;\n  }\n  PolarAxisModel.prototype.getCoordSysModel = function () {\n    return this.getReferringComponents('polar', SINGLE_REFERRING).models[0];\n  };\n  PolarAxisModel.type = 'polarAxis';\n  return PolarAxisModel;\n}(ComponentModel);\nzrUtil.mixin(PolarAxisModel, AxisModelCommonMixin);\nexport { PolarAxisModel };\nvar AngleAxisModel = /** @class */function (_super) {\n  __extends(AngleAxisModel, _super);\n  function AngleAxisModel() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = AngleAxisModel.type;\n    return _this;\n  }\n  AngleAxisModel.type = 'angleAxis';\n  return AngleAxisModel;\n}(PolarAxisModel);\nexport { AngleAxisModel };\nvar RadiusAxisModel = /** @class */function (_super) {\n  __extends(RadiusAxisModel, _super);\n  function RadiusAxisModel() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = RadiusAxisModel.type;\n    return _this;\n  }\n  RadiusAxisModel.type = 'radiusAxis';\n  return RadiusAxisModel;\n}(PolarAxisModel);\nexport { RadiusAxisModel };", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport Axis from '../Axis.js';\nvar RadiusAxis = /** @class */function (_super) {\n  __extends(RadiusAxis, _super);\n  function RadiusAxis(scale, radiusExtent) {\n    return _super.call(this, 'radius', scale, radiusExtent) || this;\n  }\n  RadiusAxis.prototype.pointToData = function (point, clamp) {\n    return this.polar.pointToData(point, clamp)[this.dim === 'radius' ? 0 : 1];\n  };\n  return RadiusAxis;\n}(Axis);\nRadiusAxis.prototype.dataToRadius = Axis.prototype.dataToCoord;\nRadiusAxis.prototype.radiusToData = Axis.prototype.coordToData;\nexport default RadiusAxis;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as textContain from 'zrender/lib/contain/text.js';\nimport Axis from '../Axis.js';\nimport { makeInner } from '../../util/model.js';\nvar inner = makeInner();\nvar AngleAxis = /** @class */function (_super) {\n  __extends(AngleAxis, _super);\n  function AngleAxis(scale, angleExtent) {\n    return _super.call(this, 'angle', scale, angleExtent || [0, 360]) || this;\n  }\n  AngleAxis.prototype.pointToData = function (point, clamp) {\n    return this.polar.pointToData(point, clamp)[this.dim === 'radius' ? 0 : 1];\n  };\n  /**\n   * Only be called in category axis.\n   * Angle axis uses text height to decide interval\n   *\n   * @override\n   * @return {number} Auto interval for cateogry axis tick and label\n   */\n  AngleAxis.prototype.calculateCategoryInterval = function () {\n    var axis = this;\n    var labelModel = axis.getLabelModel();\n    var ordinalScale = axis.scale;\n    var ordinalExtent = ordinalScale.getExtent();\n    // Providing this method is for optimization:\n    // avoid generating a long array by `getTicks`\n    // in large category data case.\n    var tickCount = ordinalScale.count();\n    if (ordinalExtent[1] - ordinalExtent[0] < 1) {\n      return 0;\n    }\n    var tickValue = ordinalExtent[0];\n    var unitSpan = axis.dataToCoord(tickValue + 1) - axis.dataToCoord(tickValue);\n    var unitH = Math.abs(unitSpan);\n    // Not precise, just use height as text width\n    // and each distance from axis line yet.\n    var rect = textContain.getBoundingRect(tickValue == null ? '' : tickValue + '', labelModel.getFont(), 'center', 'top');\n    var maxH = Math.max(rect.height, 7);\n    var dh = maxH / unitH;\n    // 0/0 is NaN, 1/0 is Infinity.\n    isNaN(dh) && (dh = Infinity);\n    var interval = Math.max(0, Math.floor(dh));\n    var cache = inner(axis.model);\n    var lastAutoInterval = cache.lastAutoInterval;\n    var lastTickCount = cache.lastTickCount;\n    // Use cache to keep interval stable while moving zoom window,\n    // otherwise the calculated interval might jitter when the zoom\n    // window size is close to the interval-changing size.\n    if (lastAutoInterval != null && lastTickCount != null && Math.abs(lastAutoInterval - interval) <= 1 && Math.abs(lastTickCount - tickCount) <= 1\n    // Always choose the bigger one, otherwise the critical\n    // point is not the same when zooming in or zooming out.\n    && lastAutoInterval > interval) {\n      interval = lastAutoInterval;\n    }\n    // Only update cache if cache not used, otherwise the\n    // changing of interval is too insensitive.\n    else {\n      cache.lastTickCount = tickCount;\n      cache.lastAutoInterval = interval;\n    }\n    return interval;\n  };\n  return AngleAxis;\n}(Axis);\nAngleAxis.prototype.dataToAngle = Axis.prototype.dataToCoord;\nAngleAxis.prototype.angleToData = Axis.prototype.coordToData;\nexport default AngleAxis;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport RadiusAxis from './RadiusAxis.js';\nimport AngleAxis from './AngleAxis.js';\nexport var polarDimensions = ['radius', 'angle'];\nvar Polar = /** @class */function () {\n  function Polar(name) {\n    this.dimensions = polarDimensions;\n    this.type = 'polar';\n    /**\n     * x of polar center\n     */\n    this.cx = 0;\n    /**\n     * y of polar center\n     */\n    this.cy = 0;\n    this._radiusAxis = new RadiusAxis();\n    this._angleAxis = new AngleAxis();\n    this.axisPointerEnabled = true;\n    this.name = name || '';\n    this._radiusAxis.polar = this._angleAxis.polar = this;\n  }\n  /**\n   * If contain coord\n   */\n  Polar.prototype.containPoint = function (point) {\n    var coord = this.pointToCoord(point);\n    return this._radiusAxis.contain(coord[0]) && this._angleAxis.contain(coord[1]);\n  };\n  /**\n   * If contain data\n   */\n  Polar.prototype.containData = function (data) {\n    return this._radiusAxis.containData(data[0]) && this._angleAxis.containData(data[1]);\n  };\n  Polar.prototype.getAxis = function (dim) {\n    var key = '_' + dim + 'Axis';\n    return this[key];\n  };\n  Polar.prototype.getAxes = function () {\n    return [this._radiusAxis, this._angleAxis];\n  };\n  /**\n   * Get axes by type of scale\n   */\n  Polar.prototype.getAxesByScale = function (scaleType) {\n    var axes = [];\n    var angleAxis = this._angleAxis;\n    var radiusAxis = this._radiusAxis;\n    angleAxis.scale.type === scaleType && axes.push(angleAxis);\n    radiusAxis.scale.type === scaleType && axes.push(radiusAxis);\n    return axes;\n  };\n  Polar.prototype.getAngleAxis = function () {\n    return this._angleAxis;\n  };\n  Polar.prototype.getRadiusAxis = function () {\n    return this._radiusAxis;\n  };\n  Polar.prototype.getOtherAxis = function (axis) {\n    var angleAxis = this._angleAxis;\n    return axis === angleAxis ? this._radiusAxis : angleAxis;\n  };\n  /**\n   * Base axis will be used on stacking.\n   *\n   */\n  Polar.prototype.getBaseAxis = function () {\n    return this.getAxesByScale('ordinal')[0] || this.getAxesByScale('time')[0] || this.getAngleAxis();\n  };\n  Polar.prototype.getTooltipAxes = function (dim) {\n    var baseAxis = dim != null && dim !== 'auto' ? this.getAxis(dim) : this.getBaseAxis();\n    return {\n      baseAxes: [baseAxis],\n      otherAxes: [this.getOtherAxis(baseAxis)]\n    };\n  };\n  /**\n   * Convert a single data item to (x, y) point.\n   * Parameter data is an array which the first element is radius and the second is angle\n   */\n  Polar.prototype.dataToPoint = function (data, clamp, out) {\n    return this.coordToPoint([this._radiusAxis.dataToRadius(data[0], clamp), this._angleAxis.dataToAngle(data[1], clamp)], out);\n  };\n  /**\n   * Convert a (x, y) point to data\n   */\n  Polar.prototype.pointToData = function (point, clamp, out) {\n    out = out || [];\n    var coord = this.pointToCoord(point);\n    out[0] = this._radiusAxis.radiusToData(coord[0], clamp);\n    out[1] = this._angleAxis.angleToData(coord[1], clamp);\n    return out;\n  };\n  /**\n   * Convert a (x, y) point to (radius, angle) coord\n   */\n  Polar.prototype.pointToCoord = function (point) {\n    var dx = point[0] - this.cx;\n    var dy = point[1] - this.cy;\n    var angleAxis = this.getAngleAxis();\n    var extent = angleAxis.getExtent();\n    var minAngle = Math.min(extent[0], extent[1]);\n    var maxAngle = Math.max(extent[0], extent[1]);\n    // Fix fixed extent in polarCreator\n    // FIXME\n    angleAxis.inverse ? minAngle = maxAngle - 360 : maxAngle = minAngle + 360;\n    var radius = Math.sqrt(dx * dx + dy * dy);\n    dx /= radius;\n    dy /= radius;\n    var radian = Math.atan2(-dy, dx) / Math.PI * 180;\n    // move to angleExtent\n    var dir = radian < minAngle ? 1 : -1;\n    while (radian < minAngle || radian > maxAngle) {\n      radian += dir * 360;\n    }\n    return [radius, radian];\n  };\n  /**\n   * Convert a (radius, angle) coord to (x, y) point\n   */\n  Polar.prototype.coordToPoint = function (coord, out) {\n    out = out || [];\n    var radius = coord[0];\n    var radian = coord[1] / 180 * Math.PI;\n    out[0] = Math.cos(radian) * radius + this.cx;\n    // Inverse the y\n    out[1] = -Math.sin(radian) * radius + this.cy;\n    return out;\n  };\n  /**\n   * Get ring area of cartesian.\n   * Area will have a contain function to determine if a point is in the coordinate system.\n   */\n  Polar.prototype.getArea = function () {\n    var angleAxis = this.getAngleAxis();\n    var radiusAxis = this.getRadiusAxis();\n    var radiusExtent = radiusAxis.getExtent().slice();\n    radiusExtent[0] > radiusExtent[1] && radiusExtent.reverse();\n    var angleExtent = angleAxis.getExtent();\n    var RADIAN = Math.PI / 180;\n    var EPSILON = 1e-4;\n    return {\n      cx: this.cx,\n      cy: this.cy,\n      r0: radiusExtent[0],\n      r: radiusExtent[1],\n      startAngle: -angleExtent[0] * RADIAN,\n      endAngle: -angleExtent[1] * RADIAN,\n      clockwise: angleAxis.inverse,\n      contain: function (x, y) {\n        // It's a ring shape.\n        // Start angle and end angle don't matter\n        var dx = x - this.cx;\n        var dy = y - this.cy;\n        var d2 = dx * dx + dy * dy;\n        var r = this.r;\n        var r0 = this.r0;\n        // minus a tiny value 1e-4 in double side to avoid being clipped unexpectedly\n        // r == r0 contain nothing\n        return r !== r0 && d2 - EPSILON <= r * r && d2 + EPSILON >= r0 * r0;\n      },\n      // As the bounding box\n      x: this.cx - radiusExtent[1],\n      y: this.cy - radiusExtent[1],\n      width: radiusExtent[1] * 2,\n      height: radiusExtent[1] * 2\n    };\n  };\n  Polar.prototype.convertToPixel = function (ecModel, finder, value) {\n    var coordSys = getCoordSys(finder);\n    return coordSys === this ? this.dataToPoint(value) : null;\n  };\n  Polar.prototype.convertFromPixel = function (ecModel, finder, pixel) {\n    var coordSys = getCoordSys(finder);\n    return coordSys === this ? this.pointToData(pixel) : null;\n  };\n  return Polar;\n}();\nfunction getCoordSys(finder) {\n  var seriesModel = finder.seriesModel;\n  var polarModel = finder.polarModel;\n  return polarModel && polarModel.coordinateSystem || seriesModel && seriesModel.coordinateSystem;\n}\nexport default Polar;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n// TODO Axis scale\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport Polar, { polarDimensions } from './Polar.js';\nimport { parsePercent } from '../../util/number.js';\nimport { createScaleByModel, niceScaleExtent, getDataDimensionsOnAxis } from '../../coord/axisHelper.js';\nimport { SINGLE_REFERRING } from '../../util/model.js';\nimport { createBoxLayoutReference } from '../../util/layout.js';\n/**\n * Resize method bound to the polar\n */\nfunction resizePolar(polar, polarModel, api) {\n  var center = polarModel.get('center');\n  var refContainer = createBoxLayoutReference(polarModel, api).refContainer;\n  polar.cx = parsePercent(center[0], refContainer.width) + refContainer.x;\n  polar.cy = parsePercent(center[1], refContainer.height) + refContainer.y;\n  var radiusAxis = polar.getRadiusAxis();\n  var size = Math.min(refContainer.width, refContainer.height) / 2;\n  var radius = polarModel.get('radius');\n  if (radius == null) {\n    radius = [0, '100%'];\n  } else if (!zrUtil.isArray(radius)) {\n    // r0 = 0\n    radius = [0, radius];\n  }\n  var parsedRadius = [parsePercent(radius[0], size), parsePercent(radius[1], size)];\n  radiusAxis.inverse ? radiusAxis.setExtent(parsedRadius[1], parsedRadius[0]) : radiusAxis.setExtent(parsedRadius[0], parsedRadius[1]);\n}\n/**\n * Update polar\n */\nfunction updatePolarScale(ecModel, api) {\n  var polar = this;\n  var angleAxis = polar.getAngleAxis();\n  var radiusAxis = polar.getRadiusAxis();\n  // Reset scale\n  angleAxis.scale.setExtent(Infinity, -Infinity);\n  radiusAxis.scale.setExtent(Infinity, -Infinity);\n  ecModel.eachSeries(function (seriesModel) {\n    if (seriesModel.coordinateSystem === polar) {\n      var data_1 = seriesModel.getData();\n      zrUtil.each(getDataDimensionsOnAxis(data_1, 'radius'), function (dim) {\n        radiusAxis.scale.unionExtentFromData(data_1, dim);\n      });\n      zrUtil.each(getDataDimensionsOnAxis(data_1, 'angle'), function (dim) {\n        angleAxis.scale.unionExtentFromData(data_1, dim);\n      });\n    }\n  });\n  niceScaleExtent(angleAxis.scale, angleAxis.model);\n  niceScaleExtent(radiusAxis.scale, radiusAxis.model);\n  // Fix extent of category angle axis\n  if (angleAxis.type === 'category' && !angleAxis.onBand) {\n    var extent = angleAxis.getExtent();\n    var diff = 360 / angleAxis.scale.count();\n    angleAxis.inverse ? extent[1] += diff : extent[1] -= diff;\n    angleAxis.setExtent(extent[0], extent[1]);\n  }\n}\nfunction isAngleAxisModel(axisModel) {\n  return axisModel.mainType === 'angleAxis';\n}\n/**\n * Set common axis properties\n */\nfunction setAxis(axis, axisModel) {\n  var _a;\n  axis.type = axisModel.get('type');\n  axis.scale = createScaleByModel(axisModel);\n  axis.onBand = axisModel.get('boundaryGap') && axis.type === 'category';\n  axis.inverse = axisModel.get('inverse');\n  if (isAngleAxisModel(axisModel)) {\n    axis.inverse = axis.inverse !== axisModel.get('clockwise');\n    var startAngle = axisModel.get('startAngle');\n    var endAngle = (_a = axisModel.get('endAngle')) !== null && _a !== void 0 ? _a : startAngle + (axis.inverse ? -360 : 360);\n    axis.setExtent(startAngle, endAngle);\n  }\n  // Inject axis instance\n  axisModel.axis = axis;\n  axis.model = axisModel;\n}\nvar polarCreator = {\n  dimensions: polarDimensions,\n  create: function (ecModel, api) {\n    var polarList = [];\n    ecModel.eachComponent('polar', function (polarModel, idx) {\n      var polar = new Polar(idx + '');\n      // Inject resize and update method\n      polar.update = updatePolarScale;\n      var radiusAxis = polar.getRadiusAxis();\n      var angleAxis = polar.getAngleAxis();\n      var radiusAxisModel = polarModel.findAxisModel('radiusAxis');\n      var angleAxisModel = polarModel.findAxisModel('angleAxis');\n      setAxis(radiusAxis, radiusAxisModel);\n      setAxis(angleAxis, angleAxisModel);\n      resizePolar(polar, polarModel, api);\n      polarList.push(polar);\n      polarModel.coordinateSystem = polar;\n      polar.model = polarModel;\n    });\n    // Inject coordinateSystem to series\n    ecModel.eachSeries(function (seriesModel) {\n      if (seriesModel.get('coordinateSystem') === 'polar') {\n        var polarModel = seriesModel.getReferringComponents('polar', SINGLE_REFERRING).models[0];\n        if (process.env.NODE_ENV !== 'production') {\n          if (!polarModel) {\n            throw new Error('Polar \"' + zrUtil.retrieve(seriesModel.get('polarIndex'), seriesModel.get('polarId'), 0) + '\" not found');\n          }\n        }\n        seriesModel.coordinateSystem = polarModel.coordinateSystem;\n      }\n    });\n    return polarList;\n  }\n};\nexport default polarCreator;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as graphic from '../../util/graphic.js';\nimport { createTextStyle } from '../../label/labelStyle.js';\nimport Model from '../../model/Model.js';\nimport AxisView from './AxisView.js';\nimport AxisBuilder from './AxisBuilder.js';\nimport { getECData } from '../../util/innerStore.js';\nvar elementList = ['axisLine', 'axisLabel', 'axisTick', 'minorTick', 'splitLine', 'minorSplitLine', 'splitArea'];\nfunction getAxisLineShape(polar, rExtent, angle) {\n  rExtent[1] > rExtent[0] && (rExtent = rExtent.slice().reverse());\n  var start = polar.coordToPoint([rExtent[0], angle]);\n  var end = polar.coordToPoint([rExtent[1], angle]);\n  return {\n    x1: start[0],\n    y1: start[1],\n    x2: end[0],\n    y2: end[1]\n  };\n}\nfunction getRadiusIdx(polar) {\n  var radiusAxis = polar.getRadiusAxis();\n  return radiusAxis.inverse ? 0 : 1;\n}\n// Remove the last tick which will overlap the first tick\nfunction fixAngleOverlap(list) {\n  var firstItem = list[0];\n  var lastItem = list[list.length - 1];\n  if (firstItem && lastItem && Math.abs(Math.abs(firstItem.coord - lastItem.coord) - 360) < 1e-4) {\n    list.pop();\n  }\n}\nvar AngleAxisView = /** @class */function (_super) {\n  __extends(AngleAxisView, _super);\n  function AngleAxisView() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = AngleAxisView.type;\n    _this.axisPointerClass = 'PolarAxisPointer';\n    return _this;\n  }\n  AngleAxisView.prototype.render = function (angleAxisModel, ecModel) {\n    this.group.removeAll();\n    if (!angleAxisModel.get('show')) {\n      return;\n    }\n    var angleAxis = angleAxisModel.axis;\n    var polar = angleAxis.polar;\n    var radiusExtent = polar.getRadiusAxis().getExtent();\n    var ticksAngles = angleAxis.getTicksCoords({\n      breakTicks: 'none'\n    });\n    var minorTickAngles = angleAxis.getMinorTicksCoords();\n    var labels = zrUtil.map(angleAxis.getViewLabels(), function (labelItem) {\n      labelItem = zrUtil.clone(labelItem);\n      var scale = angleAxis.scale;\n      var tickValue = scale.type === 'ordinal' ? scale.getRawOrdinalNumber(labelItem.tickValue) : labelItem.tickValue;\n      labelItem.coord = angleAxis.dataToCoord(tickValue);\n      return labelItem;\n    });\n    fixAngleOverlap(labels);\n    fixAngleOverlap(ticksAngles);\n    zrUtil.each(elementList, function (name) {\n      if (angleAxisModel.get([name, 'show']) && (!angleAxis.scale.isBlank() || name === 'axisLine')) {\n        angelAxisElementsBuilders[name](this.group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent, labels);\n      }\n    }, this);\n  };\n  AngleAxisView.type = 'angleAxis';\n  return AngleAxisView;\n}(AxisView);\nvar angelAxisElementsBuilders = {\n  axisLine: function (group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) {\n    var lineStyleModel = angleAxisModel.getModel(['axisLine', 'lineStyle']);\n    var angleAxis = polar.getAngleAxis();\n    var RADIAN = Math.PI / 180;\n    var angleExtent = angleAxis.getExtent();\n    // extent id of the axis radius (r0 and r)\n    var rId = getRadiusIdx(polar);\n    var r0Id = rId ? 0 : 1;\n    var shape;\n    var shapeType = Math.abs(angleExtent[1] - angleExtent[0]) === 360 ? 'Circle' : 'Arc';\n    if (radiusExtent[r0Id] === 0) {\n      shape = new graphic[shapeType]({\n        shape: {\n          cx: polar.cx,\n          cy: polar.cy,\n          r: radiusExtent[rId],\n          startAngle: -angleExtent[0] * RADIAN,\n          endAngle: -angleExtent[1] * RADIAN,\n          clockwise: angleAxis.inverse\n        },\n        style: lineStyleModel.getLineStyle(),\n        z2: 1,\n        silent: true\n      });\n    } else {\n      shape = new graphic.Ring({\n        shape: {\n          cx: polar.cx,\n          cy: polar.cy,\n          r: radiusExtent[rId],\n          r0: radiusExtent[r0Id]\n        },\n        style: lineStyleModel.getLineStyle(),\n        z2: 1,\n        silent: true\n      });\n    }\n    shape.style.fill = null;\n    group.add(shape);\n  },\n  axisTick: function (group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) {\n    var tickModel = angleAxisModel.getModel('axisTick');\n    var tickLen = (tickModel.get('inside') ? -1 : 1) * tickModel.get('length');\n    var radius = radiusExtent[getRadiusIdx(polar)];\n    var lines = zrUtil.map(ticksAngles, function (tickAngleItem) {\n      return new graphic.Line({\n        shape: getAxisLineShape(polar, [radius, radius + tickLen], tickAngleItem.coord)\n      });\n    });\n    group.add(graphic.mergePath(lines, {\n      style: zrUtil.defaults(tickModel.getModel('lineStyle').getLineStyle(), {\n        stroke: angleAxisModel.get(['axisLine', 'lineStyle', 'color'])\n      })\n    }));\n  },\n  minorTick: function (group, angleAxisModel, polar, tickAngles, minorTickAngles, radiusExtent) {\n    if (!minorTickAngles.length) {\n      return;\n    }\n    var tickModel = angleAxisModel.getModel('axisTick');\n    var minorTickModel = angleAxisModel.getModel('minorTick');\n    var tickLen = (tickModel.get('inside') ? -1 : 1) * minorTickModel.get('length');\n    var radius = radiusExtent[getRadiusIdx(polar)];\n    var lines = [];\n    for (var i = 0; i < minorTickAngles.length; i++) {\n      for (var k = 0; k < minorTickAngles[i].length; k++) {\n        lines.push(new graphic.Line({\n          shape: getAxisLineShape(polar, [radius, radius + tickLen], minorTickAngles[i][k].coord)\n        }));\n      }\n    }\n    group.add(graphic.mergePath(lines, {\n      style: zrUtil.defaults(minorTickModel.getModel('lineStyle').getLineStyle(), zrUtil.defaults(tickModel.getLineStyle(), {\n        stroke: angleAxisModel.get(['axisLine', 'lineStyle', 'color'])\n      }))\n    }));\n  },\n  axisLabel: function (group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent, labels) {\n    var rawCategoryData = angleAxisModel.getCategories(true);\n    var commonLabelModel = angleAxisModel.getModel('axisLabel');\n    var labelMargin = commonLabelModel.get('margin');\n    var triggerEvent = angleAxisModel.get('triggerEvent');\n    // Use length of ticksAngles because it may remove the last tick to avoid overlapping\n    zrUtil.each(labels, function (labelItem, idx) {\n      var labelModel = commonLabelModel;\n      var tickValue = labelItem.tickValue;\n      var r = radiusExtent[getRadiusIdx(polar)];\n      var p = polar.coordToPoint([r + labelMargin, labelItem.coord]);\n      var cx = polar.cx;\n      var cy = polar.cy;\n      var labelTextAlign = Math.abs(p[0] - cx) / r < 0.3 ? 'center' : p[0] > cx ? 'left' : 'right';\n      var labelTextVerticalAlign = Math.abs(p[1] - cy) / r < 0.3 ? 'middle' : p[1] > cy ? 'top' : 'bottom';\n      if (rawCategoryData && rawCategoryData[tickValue]) {\n        var rawCategoryItem = rawCategoryData[tickValue];\n        if (zrUtil.isObject(rawCategoryItem) && rawCategoryItem.textStyle) {\n          labelModel = new Model(rawCategoryItem.textStyle, commonLabelModel, commonLabelModel.ecModel);\n        }\n      }\n      var textEl = new graphic.Text({\n        silent: AxisBuilder.isLabelSilent(angleAxisModel),\n        style: createTextStyle(labelModel, {\n          x: p[0],\n          y: p[1],\n          fill: labelModel.getTextColor() || angleAxisModel.get(['axisLine', 'lineStyle', 'color']),\n          text: labelItem.formattedLabel,\n          align: labelTextAlign,\n          verticalAlign: labelTextVerticalAlign\n        })\n      });\n      group.add(textEl);\n      graphic.setTooltipConfig({\n        el: textEl,\n        componentModel: angleAxisModel,\n        itemName: labelItem.formattedLabel,\n        formatterParamsExtra: {\n          isTruncated: function () {\n            return textEl.isTruncated;\n          },\n          value: labelItem.rawLabel,\n          tickIndex: idx\n        }\n      });\n      // Pack data for mouse event\n      if (triggerEvent) {\n        var eventData = AxisBuilder.makeAxisEventDataBase(angleAxisModel);\n        eventData.targetType = 'axisLabel';\n        eventData.value = labelItem.rawLabel;\n        getECData(textEl).eventData = eventData;\n      }\n    }, this);\n  },\n  splitLine: function (group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) {\n    var splitLineModel = angleAxisModel.getModel('splitLine');\n    var lineStyleModel = splitLineModel.getModel('lineStyle');\n    var lineColors = lineStyleModel.get('color');\n    var lineCount = 0;\n    lineColors = lineColors instanceof Array ? lineColors : [lineColors];\n    var splitLines = [];\n    for (var i = 0; i < ticksAngles.length; i++) {\n      var colorIndex = lineCount++ % lineColors.length;\n      splitLines[colorIndex] = splitLines[colorIndex] || [];\n      splitLines[colorIndex].push(new graphic.Line({\n        shape: getAxisLineShape(polar, radiusExtent, ticksAngles[i].coord)\n      }));\n    }\n    // Simple optimization\n    // Batching the lines if color are the same\n    for (var i = 0; i < splitLines.length; i++) {\n      group.add(graphic.mergePath(splitLines[i], {\n        style: zrUtil.defaults({\n          stroke: lineColors[i % lineColors.length]\n        }, lineStyleModel.getLineStyle()),\n        silent: true,\n        z: angleAxisModel.get('z')\n      }));\n    }\n  },\n  minorSplitLine: function (group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) {\n    if (!minorTickAngles.length) {\n      return;\n    }\n    var minorSplitLineModel = angleAxisModel.getModel('minorSplitLine');\n    var lineStyleModel = minorSplitLineModel.getModel('lineStyle');\n    var lines = [];\n    for (var i = 0; i < minorTickAngles.length; i++) {\n      for (var k = 0; k < minorTickAngles[i].length; k++) {\n        lines.push(new graphic.Line({\n          shape: getAxisLineShape(polar, radiusExtent, minorTickAngles[i][k].coord)\n        }));\n      }\n    }\n    group.add(graphic.mergePath(lines, {\n      style: lineStyleModel.getLineStyle(),\n      silent: true,\n      z: angleAxisModel.get('z')\n    }));\n  },\n  splitArea: function (group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) {\n    if (!ticksAngles.length) {\n      return;\n    }\n    var splitAreaModel = angleAxisModel.getModel('splitArea');\n    var areaStyleModel = splitAreaModel.getModel('areaStyle');\n    var areaColors = areaStyleModel.get('color');\n    var lineCount = 0;\n    areaColors = areaColors instanceof Array ? areaColors : [areaColors];\n    var splitAreas = [];\n    var RADIAN = Math.PI / 180;\n    var prevAngle = -ticksAngles[0].coord * RADIAN;\n    var r0 = Math.min(radiusExtent[0], radiusExtent[1]);\n    var r1 = Math.max(radiusExtent[0], radiusExtent[1]);\n    var clockwise = angleAxisModel.get('clockwise');\n    for (var i = 1, len = ticksAngles.length; i <= len; i++) {\n      var coord = i === len ? ticksAngles[0].coord : ticksAngles[i].coord;\n      var colorIndex = lineCount++ % areaColors.length;\n      splitAreas[colorIndex] = splitAreas[colorIndex] || [];\n      splitAreas[colorIndex].push(new graphic.Sector({\n        shape: {\n          cx: polar.cx,\n          cy: polar.cy,\n          r0: r0,\n          r: r1,\n          startAngle: prevAngle,\n          endAngle: -coord * RADIAN,\n          clockwise: clockwise\n        },\n        silent: true\n      }));\n      prevAngle = -coord * RADIAN;\n    }\n    // Simple optimization\n    // Batching the lines if color are the same\n    for (var i = 0; i < splitAreas.length; i++) {\n      group.add(graphic.mergePath(splitAreas[i], {\n        style: zrUtil.defaults({\n          fill: areaColors[i % areaColors.length]\n        }, areaStyleModel.getAreaStyle()),\n        silent: true\n      }));\n    }\n  }\n};\nexport default AngleAxisView;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as graphic from '../../util/graphic.js';\nimport AxisBuilder from './AxisBuilder.js';\nimport AxisView from './AxisView.js';\nvar selfBuilderAttrs = ['splitLine', 'splitArea', 'minorSplitLine'];\nvar RadiusAxisView = /** @class */function (_super) {\n  __extends(RadiusAxisView, _super);\n  function RadiusAxisView() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = RadiusAxisView.type;\n    _this.axisPointerClass = 'PolarAxisPointer';\n    return _this;\n  }\n  RadiusAxisView.prototype.render = function (radiusAxisModel, ecModel, api) {\n    this.group.removeAll();\n    if (!radiusAxisModel.get('show')) {\n      return;\n    }\n    var oldAxisGroup = this._axisGroup;\n    var newAxisGroup = this._axisGroup = new graphic.Group();\n    this.group.add(newAxisGroup);\n    var radiusAxis = radiusAxisModel.axis;\n    var polar = radiusAxis.polar;\n    var angleAxis = polar.getAngleAxis();\n    var ticksCoords = radiusAxis.getTicksCoords();\n    var minorTicksCoords = radiusAxis.getMinorTicksCoords();\n    var axisAngle = angleAxis.getExtent()[0];\n    var radiusExtent = radiusAxis.getExtent();\n    var layout = layoutAxis(polar, radiusAxisModel, axisAngle);\n    var axisBuilder = new AxisBuilder(radiusAxisModel, api, layout);\n    axisBuilder.build();\n    newAxisGroup.add(axisBuilder.group);\n    graphic.groupTransition(oldAxisGroup, newAxisGroup, radiusAxisModel);\n    zrUtil.each(selfBuilderAttrs, function (name) {\n      if (radiusAxisModel.get([name, 'show']) && !radiusAxis.scale.isBlank()) {\n        axisElementBuilders[name](this.group, radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords, minorTicksCoords);\n      }\n    }, this);\n  };\n  RadiusAxisView.type = 'radiusAxis';\n  return RadiusAxisView;\n}(AxisView);\nvar axisElementBuilders = {\n  splitLine: function (group, radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords) {\n    var splitLineModel = radiusAxisModel.getModel('splitLine');\n    var lineStyleModel = splitLineModel.getModel('lineStyle');\n    var lineColors = lineStyleModel.get('color');\n    var lineCount = 0;\n    var angleAxis = polar.getAngleAxis();\n    var RADIAN = Math.PI / 180;\n    var angleExtent = angleAxis.getExtent();\n    var shapeType = Math.abs(angleExtent[1] - angleExtent[0]) === 360 ? 'Circle' : 'Arc';\n    lineColors = lineColors instanceof Array ? lineColors : [lineColors];\n    var splitLines = [];\n    for (var i = 0; i < ticksCoords.length; i++) {\n      var colorIndex = lineCount++ % lineColors.length;\n      splitLines[colorIndex] = splitLines[colorIndex] || [];\n      splitLines[colorIndex].push(new graphic[shapeType]({\n        shape: {\n          cx: polar.cx,\n          cy: polar.cy,\n          // ensure circle radius >= 0\n          r: Math.max(ticksCoords[i].coord, 0),\n          startAngle: -angleExtent[0] * RADIAN,\n          endAngle: -angleExtent[1] * RADIAN,\n          clockwise: angleAxis.inverse\n        }\n      }));\n    }\n    // Simple optimization\n    // Batching the lines if color are the same\n    for (var i = 0; i < splitLines.length; i++) {\n      group.add(graphic.mergePath(splitLines[i], {\n        style: zrUtil.defaults({\n          stroke: lineColors[i % lineColors.length],\n          fill: null\n        }, lineStyleModel.getLineStyle()),\n        silent: true\n      }));\n    }\n  },\n  minorSplitLine: function (group, radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords, minorTicksCoords) {\n    if (!minorTicksCoords.length) {\n      return;\n    }\n    var minorSplitLineModel = radiusAxisModel.getModel('minorSplitLine');\n    var lineStyleModel = minorSplitLineModel.getModel('lineStyle');\n    var lines = [];\n    for (var i = 0; i < minorTicksCoords.length; i++) {\n      for (var k = 0; k < minorTicksCoords[i].length; k++) {\n        lines.push(new graphic.Circle({\n          shape: {\n            cx: polar.cx,\n            cy: polar.cy,\n            r: minorTicksCoords[i][k].coord\n          }\n        }));\n      }\n    }\n    group.add(graphic.mergePath(lines, {\n      style: zrUtil.defaults({\n        fill: null\n      }, lineStyleModel.getLineStyle()),\n      silent: true\n    }));\n  },\n  splitArea: function (group, radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords) {\n    if (!ticksCoords.length) {\n      return;\n    }\n    var splitAreaModel = radiusAxisModel.getModel('splitArea');\n    var areaStyleModel = splitAreaModel.getModel('areaStyle');\n    var areaColors = areaStyleModel.get('color');\n    var lineCount = 0;\n    areaColors = areaColors instanceof Array ? areaColors : [areaColors];\n    var splitAreas = [];\n    var prevRadius = ticksCoords[0].coord;\n    for (var i = 1; i < ticksCoords.length; i++) {\n      var colorIndex = lineCount++ % areaColors.length;\n      splitAreas[colorIndex] = splitAreas[colorIndex] || [];\n      splitAreas[colorIndex].push(new graphic.Sector({\n        shape: {\n          cx: polar.cx,\n          cy: polar.cy,\n          r0: prevRadius,\n          r: ticksCoords[i].coord,\n          startAngle: 0,\n          endAngle: Math.PI * 2\n        },\n        silent: true\n      }));\n      prevRadius = ticksCoords[i].coord;\n    }\n    // Simple optimization\n    // Batching the lines if color are the same\n    for (var i = 0; i < splitAreas.length; i++) {\n      group.add(graphic.mergePath(splitAreas[i], {\n        style: zrUtil.defaults({\n          fill: areaColors[i % areaColors.length]\n        }, areaStyleModel.getAreaStyle()),\n        silent: true\n      }));\n    }\n  }\n};\n/**\n * @inner\n */\nfunction layoutAxis(polar, radiusAxisModel, axisAngle) {\n  return {\n    position: [polar.cx, polar.cy],\n    rotation: axisAngle / 180 * Math.PI,\n    labelDirection: -1,\n    tickDirection: -1,\n    nameDirection: 1,\n    labelRotate: radiusAxisModel.getModel('axisLabel').get('rotate'),\n    // Over splitLine and splitArea\n    z2: 1\n  };\n}\nexport default RadiusAxisView;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { parsePercent } from '../util/number.js';\nimport { isDimensionStacked } from '../data/helper/dataStackHelper.js';\nfunction getSeriesStackId(seriesModel) {\n  return seriesModel.get('stack') || '__ec_stack_' + seriesModel.seriesIndex;\n}\nfunction getAxisKey(polar, axis) {\n  return axis.dim + polar.model.componentIndex;\n}\nfunction barLayoutPolar(seriesType, ecModel, api) {\n  var lastStackCoords = {};\n  var barWidthAndOffset = calRadialBar(zrUtil.filter(ecModel.getSeriesByType(seriesType), function (seriesModel) {\n    return !ecModel.isSeriesFiltered(seriesModel) && seriesModel.coordinateSystem && seriesModel.coordinateSystem.type === 'polar';\n  }));\n  ecModel.eachSeriesByType(seriesType, function (seriesModel) {\n    // Check series coordinate, do layout for polar only\n    if (seriesModel.coordinateSystem.type !== 'polar') {\n      return;\n    }\n    var data = seriesModel.getData();\n    var polar = seriesModel.coordinateSystem;\n    var baseAxis = polar.getBaseAxis();\n    var axisKey = getAxisKey(polar, baseAxis);\n    var stackId = getSeriesStackId(seriesModel);\n    var columnLayoutInfo = barWidthAndOffset[axisKey][stackId];\n    var columnOffset = columnLayoutInfo.offset;\n    var columnWidth = columnLayoutInfo.width;\n    var valueAxis = polar.getOtherAxis(baseAxis);\n    var cx = seriesModel.coordinateSystem.cx;\n    var cy = seriesModel.coordinateSystem.cy;\n    var barMinHeight = seriesModel.get('barMinHeight') || 0;\n    var barMinAngle = seriesModel.get('barMinAngle') || 0;\n    lastStackCoords[stackId] = lastStackCoords[stackId] || [];\n    var valueDim = data.mapDimension(valueAxis.dim);\n    var baseDim = data.mapDimension(baseAxis.dim);\n    var stacked = isDimensionStacked(data, valueDim /* , baseDim */);\n    var clampLayout = baseAxis.dim !== 'radius' || !seriesModel.get('roundCap', true);\n    var valueAxisModel = valueAxis.model;\n    var startValue = valueAxisModel.get('startValue');\n    var valueAxisStart = valueAxis.dataToCoord(startValue || 0);\n    for (var idx = 0, len = data.count(); idx < len; idx++) {\n      var value = data.get(valueDim, idx);\n      var baseValue = data.get(baseDim, idx);\n      var sign = value >= 0 ? 'p' : 'n';\n      var baseCoord = valueAxisStart;\n      // Because of the barMinHeight, we can not use the value in\n      // stackResultDimension directly.\n      // Only ordinal axis can be stacked.\n      if (stacked) {\n        if (!lastStackCoords[stackId][baseValue]) {\n          lastStackCoords[stackId][baseValue] = {\n            p: valueAxisStart,\n            n: valueAxisStart // Negative stack\n          };\n        }\n        // Should also consider #4243\n        baseCoord = lastStackCoords[stackId][baseValue][sign];\n      }\n      var r0 = void 0;\n      var r = void 0;\n      var startAngle = void 0;\n      var endAngle = void 0;\n      // radial sector\n      if (valueAxis.dim === 'radius') {\n        var radiusSpan = valueAxis.dataToCoord(value) - valueAxisStart;\n        var angle = baseAxis.dataToCoord(baseValue);\n        if (Math.abs(radiusSpan) < barMinHeight) {\n          radiusSpan = (radiusSpan < 0 ? -1 : 1) * barMinHeight;\n        }\n        r0 = baseCoord;\n        r = baseCoord + radiusSpan;\n        startAngle = angle - columnOffset;\n        endAngle = startAngle - columnWidth;\n        stacked && (lastStackCoords[stackId][baseValue][sign] = r);\n      }\n      // tangential sector\n      else {\n        var angleSpan = valueAxis.dataToCoord(value, clampLayout) - valueAxisStart;\n        var radius = baseAxis.dataToCoord(baseValue);\n        if (Math.abs(angleSpan) < barMinAngle) {\n          angleSpan = (angleSpan < 0 ? -1 : 1) * barMinAngle;\n        }\n        r0 = radius + columnOffset;\n        r = r0 + columnWidth;\n        startAngle = baseCoord;\n        endAngle = baseCoord + angleSpan;\n        // if the previous stack is at the end of the ring,\n        // add a round to differentiate it from origin\n        // let extent = angleAxis.getExtent();\n        // let stackCoord = angle;\n        // if (stackCoord === extent[0] && value > 0) {\n        //     stackCoord = extent[1];\n        // }\n        // else if (stackCoord === extent[1] && value < 0) {\n        //     stackCoord = extent[0];\n        // }\n        stacked && (lastStackCoords[stackId][baseValue][sign] = endAngle);\n      }\n      data.setItemLayout(idx, {\n        cx: cx,\n        cy: cy,\n        r0: r0,\n        r: r,\n        // Consider that positive angle is anti-clockwise,\n        // while positive radian of sector is clockwise\n        startAngle: -startAngle * Math.PI / 180,\n        endAngle: -endAngle * Math.PI / 180,\n        /**\n         * Keep the same logic with bar in catesion: use end value to\n         * control direction. Notice that if clockwise is true (by\n         * default), the sector will always draw clockwisely, no matter\n         * whether endAngle is greater or less than startAngle.\n         */\n        clockwise: startAngle >= endAngle\n      });\n    }\n  });\n}\n/**\n * Calculate bar width and offset for radial bar charts\n */\nfunction calRadialBar(barSeries) {\n  // Columns info on each category axis. Key is polar name\n  var columnsMap = {};\n  zrUtil.each(barSeries, function (seriesModel, idx) {\n    var data = seriesModel.getData();\n    var polar = seriesModel.coordinateSystem;\n    var baseAxis = polar.getBaseAxis();\n    var axisKey = getAxisKey(polar, baseAxis);\n    var axisExtent = baseAxis.getExtent();\n    var bandWidth = baseAxis.type === 'category' ? baseAxis.getBandWidth() : Math.abs(axisExtent[1] - axisExtent[0]) / data.count();\n    var columnsOnAxis = columnsMap[axisKey] || {\n      bandWidth: bandWidth,\n      remainedWidth: bandWidth,\n      autoWidthCount: 0,\n      categoryGap: '20%',\n      gap: '30%',\n      stacks: {}\n    };\n    var stacks = columnsOnAxis.stacks;\n    columnsMap[axisKey] = columnsOnAxis;\n    var stackId = getSeriesStackId(seriesModel);\n    if (!stacks[stackId]) {\n      columnsOnAxis.autoWidthCount++;\n    }\n    stacks[stackId] = stacks[stackId] || {\n      width: 0,\n      maxWidth: 0\n    };\n    var barWidth = parsePercent(seriesModel.get('barWidth'), bandWidth);\n    var barMaxWidth = parsePercent(seriesModel.get('barMaxWidth'), bandWidth);\n    var barGap = seriesModel.get('barGap');\n    var barCategoryGap = seriesModel.get('barCategoryGap');\n    if (barWidth && !stacks[stackId].width) {\n      barWidth = Math.min(columnsOnAxis.remainedWidth, barWidth);\n      stacks[stackId].width = barWidth;\n      columnsOnAxis.remainedWidth -= barWidth;\n    }\n    barMaxWidth && (stacks[stackId].maxWidth = barMaxWidth);\n    barGap != null && (columnsOnAxis.gap = barGap);\n    barCategoryGap != null && (columnsOnAxis.categoryGap = barCategoryGap);\n  });\n  var result = {};\n  zrUtil.each(columnsMap, function (columnsOnAxis, coordSysName) {\n    result[coordSysName] = {};\n    var stacks = columnsOnAxis.stacks;\n    var bandWidth = columnsOnAxis.bandWidth;\n    var categoryGap = parsePercent(columnsOnAxis.categoryGap, bandWidth);\n    var barGapPercent = parsePercent(columnsOnAxis.gap, 1);\n    var remainedWidth = columnsOnAxis.remainedWidth;\n    var autoWidthCount = columnsOnAxis.autoWidthCount;\n    var autoWidth = (remainedWidth - categoryGap) / (autoWidthCount + (autoWidthCount - 1) * barGapPercent);\n    autoWidth = Math.max(autoWidth, 0);\n    // Find if any auto calculated bar exceeded maxBarWidth\n    zrUtil.each(stacks, function (column, stack) {\n      var maxWidth = column.maxWidth;\n      if (maxWidth && maxWidth < autoWidth) {\n        maxWidth = Math.min(maxWidth, remainedWidth);\n        if (column.width) {\n          maxWidth = Math.min(maxWidth, column.width);\n        }\n        remainedWidth -= maxWidth;\n        column.width = maxWidth;\n        autoWidthCount--;\n      }\n    });\n    // Recalculate width again\n    autoWidth = (remainedWidth - categoryGap) / (autoWidthCount + (autoWidthCount - 1) * barGapPercent);\n    autoWidth = Math.max(autoWidth, 0);\n    var widthSum = 0;\n    var lastColumn;\n    zrUtil.each(stacks, function (column, idx) {\n      if (!column.width) {\n        column.width = autoWidth;\n      }\n      lastColumn = column;\n      widthSum += column.width * (1 + barGapPercent);\n    });\n    if (lastColumn) {\n      widthSum -= lastColumn.width * barGapPercent;\n    }\n    var offset = -widthSum / 2;\n    zrUtil.each(stacks, function (column, stackId) {\n      result[coordSysName][stackId] = result[coordSysName][stackId] || {\n        offset: offset,\n        width: column.width\n      };\n      offset += column.width * (1 + barGapPercent);\n    });\n  });\n  return result;\n}\nexport default barLayoutPolar;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport { use } from '../../extension.js';\nimport AxisView from '../axis/AxisView.js';\nimport PolarAxisPointer from '../axisPointer/PolarAxisPointer.js';\nimport { install as installAxisPointer } from '../axisPointer/install.js';\nimport PolarModel from '../../coord/polar/PolarModel.js';\nimport axisModelCreator from '../../coord/axisModelCreator.js';\nimport { AngleAxisModel, RadiusAxisModel } from '../../coord/polar/AxisModel.js';\nimport polarCreator from '../../coord/polar/polarCreator.js';\nimport AngleAxisView from '../axis/AngleAxisView.js';\nimport RadiusAxisView from '../axis/RadiusAxisView.js';\nimport ComponentView from '../../view/Component.js';\nimport { curry } from 'zrender/lib/core/util.js';\nimport barLayoutPolar from '../../layout/barPolar.js';\nvar angleAxisExtraOption = {\n  startAngle: 90,\n  clockwise: true,\n  splitNumber: 12,\n  axisLabel: {\n    rotate: 0\n  }\n};\nvar radiusAxisExtraOption = {\n  splitNumber: 5\n};\nvar PolarView = /** @class */function (_super) {\n  __extends(PolarView, _super);\n  function PolarView() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = PolarView.type;\n    return _this;\n  }\n  PolarView.type = 'polar';\n  return PolarView;\n}(ComponentView);\nexport function install(registers) {\n  use(installAxisPointer);\n  AxisView.registerAxisPointerClass('PolarAxisPointer', PolarAxisPointer);\n  registers.registerCoordinateSystem('polar', polarCreator);\n  registers.registerComponentModel(PolarModel);\n  registers.registerComponentView(PolarView);\n  // Model and view for angleAxis and radiusAxis\n  axisModelCreator(registers, 'angle', AngleAxisModel, angleAxisExtraOption);\n  axisModelCreator(registers, 'radius', RadiusAxisModel, radiusAxisExtraOption);\n  registers.registerComponentView(AngleAxisView);\n  registers.registerComponentView(RadiusAxisView);\n  registers.registerLayout(curry(barLayoutPolar, 'bar'));\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nexport function layout(axisModel, opt) {\n  opt = opt || {};\n  var single = axisModel.coordinateSystem;\n  var axis = axisModel.axis;\n  var layout = {};\n  var axisPosition = axis.position;\n  var orient = axis.orient;\n  var rect = single.getRect();\n  var rectBound = [rect.x, rect.x + rect.width, rect.y, rect.y + rect.height];\n  var positionMap = {\n    horizontal: {\n      top: rectBound[2],\n      bottom: rectBound[3]\n    },\n    vertical: {\n      left: rectBound[0],\n      right: rectBound[1]\n    }\n  };\n  layout.position = [orient === 'vertical' ? positionMap.vertical[axisPosition] : rectBound[0], orient === 'horizontal' ? positionMap.horizontal[axisPosition] : rectBound[3]];\n  var r = {\n    horizontal: 0,\n    vertical: 1\n  };\n  layout.rotation = Math.PI / 2 * r[orient];\n  var directionMap = {\n    top: -1,\n    bottom: 1,\n    right: 1,\n    left: -1\n  };\n  layout.labelDirection = layout.tickDirection = layout.nameDirection = directionMap[axisPosition];\n  if (axisModel.get(['axisTick', 'inside'])) {\n    layout.tickDirection = -layout.tickDirection;\n  }\n  if (zrUtil.retrieve(opt.labelInside, axisModel.get(['axisLabel', 'inside']))) {\n    layout.labelDirection = -layout.labelDirection;\n  }\n  var labelRotate = axisModel.get(['axisLabel', 'rotate']);\n  layout.labelRotate = axisPosition === 'top' ? -labelRotate : labelRotate;\n  layout.z2 = 1;\n  return layout;\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport AxisBuilder from './AxisBuilder.js';\nimport * as graphic from '../../util/graphic.js';\nimport * as singleAxisHelper from '../../coord/single/singleAxisHelper.js';\nimport AxisView from './AxisView.js';\nimport { rectCoordAxisBuildSplitArea, rectCoordAxisHandleRemove } from './axisSplitHelper.js';\nimport { getAxisBreakHelper } from './axisBreakHelper.js';\nvar selfBuilderAttrs = ['splitArea', 'splitLine', 'breakArea'];\nvar SingleAxisView = /** @class */function (_super) {\n  __extends(SingleAxisView, _super);\n  function SingleAxisView() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = SingleAxisView.type;\n    _this.axisPointerClass = 'SingleAxisPointer';\n    return _this;\n  }\n  SingleAxisView.prototype.render = function (axisModel, ecModel, api, payload) {\n    var group = this.group;\n    group.removeAll();\n    var oldAxisGroup = this._axisGroup;\n    this._axisGroup = new graphic.Group();\n    var layout = singleAxisHelper.layout(axisModel);\n    var axisBuilder = new AxisBuilder(axisModel, api, layout);\n    axisBuilder.build();\n    group.add(this._axisGroup);\n    group.add(axisBuilder.group);\n    zrUtil.each(selfBuilderAttrs, function (name) {\n      if (axisModel.get([name, 'show'])) {\n        axisElementBuilders[name](this, this.group, this._axisGroup, axisModel, api);\n      }\n    }, this);\n    graphic.groupTransition(oldAxisGroup, this._axisGroup, axisModel);\n    _super.prototype.render.call(this, axisModel, ecModel, api, payload);\n  };\n  SingleAxisView.prototype.remove = function () {\n    rectCoordAxisHandleRemove(this);\n  };\n  SingleAxisView.type = 'singleAxis';\n  return SingleAxisView;\n}(AxisView);\nvar axisElementBuilders = {\n  splitLine: function (axisView, group, axisGroup, axisModel, api) {\n    var axis = axisModel.axis;\n    if (axis.scale.isBlank()) {\n      return;\n    }\n    var splitLineModel = axisModel.getModel('splitLine');\n    var lineStyleModel = splitLineModel.getModel('lineStyle');\n    var lineColors = lineStyleModel.get('color');\n    lineColors = lineColors instanceof Array ? lineColors : [lineColors];\n    var lineWidth = lineStyleModel.get('width');\n    var gridRect = axisModel.coordinateSystem.getRect();\n    var isHorizontal = axis.isHorizontal();\n    var splitLines = [];\n    var lineCount = 0;\n    var ticksCoords = axis.getTicksCoords({\n      tickModel: splitLineModel,\n      breakTicks: 'none',\n      pruneByBreak: 'preserve_extent_bound'\n    });\n    var p1 = [];\n    var p2 = [];\n    for (var i = 0; i < ticksCoords.length; ++i) {\n      var tickCoord = axis.toGlobalCoord(ticksCoords[i].coord);\n      if (isHorizontal) {\n        p1[0] = tickCoord;\n        p1[1] = gridRect.y;\n        p2[0] = tickCoord;\n        p2[1] = gridRect.y + gridRect.height;\n      } else {\n        p1[0] = gridRect.x;\n        p1[1] = tickCoord;\n        p2[0] = gridRect.x + gridRect.width;\n        p2[1] = tickCoord;\n      }\n      var line = new graphic.Line({\n        shape: {\n          x1: p1[0],\n          y1: p1[1],\n          x2: p2[0],\n          y2: p2[1]\n        },\n        silent: true\n      });\n      graphic.subPixelOptimizeLine(line.shape, lineWidth);\n      var colorIndex = lineCount++ % lineColors.length;\n      splitLines[colorIndex] = splitLines[colorIndex] || [];\n      splitLines[colorIndex].push(line);\n    }\n    var lineStyle = lineStyleModel.getLineStyle(['color']);\n    for (var i = 0; i < splitLines.length; ++i) {\n      group.add(graphic.mergePath(splitLines[i], {\n        style: zrUtil.defaults({\n          stroke: lineColors[i % lineColors.length]\n        }, lineStyle),\n        silent: true\n      }));\n    }\n  },\n  splitArea: function (axisView, group, axisGroup, axisModel, api) {\n    rectCoordAxisBuildSplitArea(axisView, axisGroup, axisModel, axisModel);\n  },\n  breakArea: function (axisView, group, axisGroup, axisModel, api) {\n    var axisBreakHelper = getAxisBreakHelper();\n    var scale = axisModel.axis.scale;\n    if (axisBreakHelper && scale.type !== 'ordinal') {\n      axisBreakHelper.rectCoordBuildBreakAxis(group, axisView, axisModel, axisModel.coordinateSystem.getRect(), api);\n    }\n  }\n};\nexport default SingleAxisView;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport ComponentModel from '../../model/Component.js';\nimport { AxisModelCommonMixin } from '../axisModelCommonMixin.js';\nimport { mixin } from 'zrender/lib/core/util.js';\nvar SingleAxisModel = /** @class */function (_super) {\n  __extends(SingleAxisModel, _super);\n  function SingleAxisModel() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = SingleAxisModel.type;\n    return _this;\n  }\n  SingleAxisModel.prototype.getCoordSysModel = function () {\n    return this;\n  };\n  SingleAxisModel.type = 'singleAxis';\n  SingleAxisModel.layoutMode = 'box';\n  SingleAxisModel.defaultOption = {\n    left: '5%',\n    top: '5%',\n    right: '5%',\n    bottom: '5%',\n    type: 'value',\n    position: 'bottom',\n    orient: 'horizontal',\n    axisLine: {\n      show: true,\n      lineStyle: {\n        width: 1,\n        type: 'solid'\n      }\n    },\n    // Single coordinate system and single axis is the,\n    // which is used as the parent tooltip model.\n    // same model, so we set default tooltip show as true.\n    tooltip: {\n      show: true\n    },\n    axisTick: {\n      show: true,\n      length: 6,\n      lineStyle: {\n        width: 1\n      }\n    },\n    axisLabel: {\n      show: true,\n      interval: 'auto'\n    },\n    splitLine: {\n      show: true,\n      lineStyle: {\n        type: 'dashed',\n        opacity: 0.2\n      }\n    },\n    jitter: 0,\n    jitterOverlap: true,\n    jitterMargin: 2\n  };\n  return SingleAxisModel;\n}(ComponentModel);\nmixin(SingleAxisModel, AxisModelCommonMixin.prototype);\nexport default SingleAxisModel;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport Axis from '../Axis.js';\nvar SingleAxis = /** @class */function (_super) {\n  __extends(SingleAxis, _super);\n  function SingleAxis(dim, scale, coordExtent, axisType, position) {\n    var _this = _super.call(this, dim, scale, coordExtent) || this;\n    _this.type = axisType || 'value';\n    _this.position = position || 'bottom';\n    return _this;\n  }\n  /**\n   * Judge the orient of the axis.\n   */\n  SingleAxis.prototype.isHorizontal = function () {\n    var position = this.position;\n    return position === 'top' || position === 'bottom';\n  };\n  SingleAxis.prototype.pointToData = function (point, clamp) {\n    return this.coordinateSystem.pointToData(point)[0];\n  };\n  return SingleAxis;\n}(Axis);\nexport default SingleAxis;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n/**\n * Single coordinates system.\n */\nimport SingleAxis from './SingleAxis.js';\nimport * as axisHelper from '../axisHelper.js';\nimport { createBoxLayoutReference, getLayoutRect } from '../../util/layout.js';\nimport { each } from 'zrender/lib/core/util.js';\nexport var singleDimensions = ['single'];\n/**\n * Create a single coordinates system.\n */\nvar Single = /** @class */function () {\n  function Single(axisModel, ecModel, api) {\n    this.type = 'single';\n    this.dimension = 'single';\n    /**\n     * Add it just for draw tooltip.\n     */\n    this.dimensions = singleDimensions;\n    this.axisPointerEnabled = true;\n    this.model = axisModel;\n    this._init(axisModel, ecModel, api);\n  }\n  /**\n   * Initialize single coordinate system.\n   */\n  Single.prototype._init = function (axisModel, ecModel, api) {\n    var dim = this.dimension;\n    var axis = new SingleAxis(dim, axisHelper.createScaleByModel(axisModel), [0, 0], axisModel.get('type'), axisModel.get('position'));\n    var isCategory = axis.type === 'category';\n    axis.onBand = isCategory && axisModel.get('boundaryGap');\n    axis.inverse = axisModel.get('inverse');\n    axis.orient = axisModel.get('orient');\n    axisModel.axis = axis;\n    axis.model = axisModel;\n    axis.coordinateSystem = this;\n    this._axis = axis;\n  };\n  /**\n   * Update axis scale after data processed\n   */\n  Single.prototype.update = function (ecModel, api) {\n    ecModel.eachSeries(function (seriesModel) {\n      if (seriesModel.coordinateSystem === this) {\n        var data_1 = seriesModel.getData();\n        each(data_1.mapDimensionsAll(this.dimension), function (dim) {\n          this._axis.scale.unionExtentFromData(data_1, dim);\n        }, this);\n        axisHelper.niceScaleExtent(this._axis.scale, this._axis.model);\n      }\n    }, this);\n  };\n  /**\n   * Resize the single coordinate system.\n   */\n  Single.prototype.resize = function (axisModel, api) {\n    var refContainer = createBoxLayoutReference(axisModel, api).refContainer;\n    this._rect = getLayoutRect(axisModel.getBoxLayoutParams(), refContainer);\n    this._adjustAxis();\n  };\n  Single.prototype.getRect = function () {\n    return this._rect;\n  };\n  Single.prototype._adjustAxis = function () {\n    var rect = this._rect;\n    var axis = this._axis;\n    var isHorizontal = axis.isHorizontal();\n    var extent = isHorizontal ? [0, rect.width] : [0, rect.height];\n    var idx = axis.inverse ? 1 : 0;\n    axis.setExtent(extent[idx], extent[1 - idx]);\n    this._updateAxisTransform(axis, isHorizontal ? rect.x : rect.y);\n  };\n  Single.prototype._updateAxisTransform = function (axis, coordBase) {\n    var axisExtent = axis.getExtent();\n    var extentSum = axisExtent[0] + axisExtent[1];\n    var isHorizontal = axis.isHorizontal();\n    axis.toGlobalCoord = isHorizontal ? function (coord) {\n      return coord + coordBase;\n    } : function (coord) {\n      return extentSum - coord + coordBase;\n    };\n    axis.toLocalCoord = isHorizontal ? function (coord) {\n      return coord - coordBase;\n    } : function (coord) {\n      return extentSum - coord + coordBase;\n    };\n  };\n  /**\n   * Get axis.\n   */\n  Single.prototype.getAxis = function () {\n    return this._axis;\n  };\n  /**\n   * Get axis, add it just for draw tooltip.\n   */\n  Single.prototype.getBaseAxis = function () {\n    return this._axis;\n  };\n  Single.prototype.getAxes = function () {\n    return [this._axis];\n  };\n  Single.prototype.getTooltipAxes = function () {\n    return {\n      baseAxes: [this.getAxis()],\n      // Empty otherAxes\n      otherAxes: []\n    };\n  };\n  /**\n   * If contain point.\n   */\n  Single.prototype.containPoint = function (point) {\n    var rect = this.getRect();\n    var axis = this.getAxis();\n    var orient = axis.orient;\n    if (orient === 'horizontal') {\n      return axis.contain(axis.toLocalCoord(point[0])) && point[1] >= rect.y && point[1] <= rect.y + rect.height;\n    } else {\n      return axis.contain(axis.toLocalCoord(point[1])) && point[0] >= rect.y && point[0] <= rect.y + rect.height;\n    }\n  };\n  Single.prototype.pointToData = function (point, reserved, out) {\n    out = out || [];\n    var axis = this.getAxis();\n    out[0] = axis.coordToData(axis.toLocalCoord(point[axis.orient === 'horizontal' ? 0 : 1]));\n    return out;\n  };\n  /**\n   * Convert the series data to concrete point.\n   * Can be [val] | val\n   */\n  Single.prototype.dataToPoint = function (val, reserved, out) {\n    var axis = this.getAxis();\n    var rect = this.getRect();\n    out = out || [];\n    var idx = axis.orient === 'horizontal' ? 0 : 1;\n    if (val instanceof Array) {\n      val = val[0];\n    }\n    out[idx] = axis.toGlobalCoord(axis.dataToCoord(+val));\n    out[1 - idx] = idx === 0 ? rect.y + rect.height / 2 : rect.x + rect.width / 2;\n    return out;\n  };\n  Single.prototype.convertToPixel = function (ecModel, finder, value) {\n    var coordSys = getCoordSys(finder);\n    return coordSys === this ? this.dataToPoint(value) : null;\n  };\n  Single.prototype.convertFromPixel = function (ecModel, finder, pixel) {\n    var coordSys = getCoordSys(finder);\n    return coordSys === this ? this.pointToData(pixel) : null;\n  };\n  return Single;\n}();\nfunction getCoordSys(finder) {\n  var seriesModel = finder.seriesModel;\n  var singleModel = finder.singleAxisModel;\n  return singleModel && singleModel.coordinateSystem || seriesModel && seriesModel.coordinateSystem;\n}\nexport default Single;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n/**\n * Single coordinate system creator.\n */\nimport Single, { singleDimensions } from './Single.js';\nimport { SINGLE_REFERRING } from '../../util/model.js';\n/**\n * Create single coordinate system and inject it into seriesModel.\n */\nfunction create(ecModel, api) {\n  var singles = [];\n  ecModel.eachComponent('singleAxis', function (axisModel, idx) {\n    var single = new Single(axisModel, ecModel, api);\n    single.name = 'single_' + idx;\n    single.resize(axisModel, api);\n    axisModel.coordinateSystem = single;\n    singles.push(single);\n  });\n  ecModel.eachSeries(function (seriesModel) {\n    if (seriesModel.get('coordinateSystem') === 'singleAxis') {\n      var singleAxisModel = seriesModel.getReferringComponents('singleAxis', SINGLE_REFERRING).models[0];\n      seriesModel.coordinateSystem = singleAxisModel && singleAxisModel.coordinateSystem;\n    }\n  });\n  return singles;\n}\nvar singleCreator = {\n  create: create,\n  dimensions: singleDimensions\n};\nexport default singleCreator;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport BaseAxisPointer from './BaseAxisPointer.js';\nimport * as viewHelper from './viewHelper.js';\nimport * as singleAxisHelper from '../../coord/single/singleAxisHelper.js';\nvar XY = ['x', 'y'];\nvar WH = ['width', 'height'];\nvar SingleAxisPointer = /** @class */function (_super) {\n  __extends(SingleAxisPointer, _super);\n  function SingleAxisPointer() {\n    return _super !== null && _super.apply(this, arguments) || this;\n  }\n  /**\n   * @override\n   */\n  SingleAxisPointer.prototype.makeElOption = function (elOption, value, axisModel, axisPointerModel, api) {\n    var axis = axisModel.axis;\n    var coordSys = axis.coordinateSystem;\n    var otherExtent = getGlobalExtent(coordSys, 1 - getPointDimIndex(axis));\n    var pixelValue = coordSys.dataToPoint(value)[0];\n    var axisPointerType = axisPointerModel.get('type');\n    if (axisPointerType && axisPointerType !== 'none') {\n      var elStyle = viewHelper.buildElStyle(axisPointerModel);\n      var pointerOption = pointerShapeBuilder[axisPointerType](axis, pixelValue, otherExtent);\n      pointerOption.style = elStyle;\n      elOption.graphicKey = pointerOption.type;\n      elOption.pointer = pointerOption;\n    }\n    var layoutInfo = singleAxisHelper.layout(axisModel);\n    viewHelper.buildCartesianSingleLabelElOption(value, elOption, layoutInfo, axisModel, axisPointerModel, api);\n  };\n  /**\n   * @override\n   */\n  SingleAxisPointer.prototype.getHandleTransform = function (value, axisModel, axisPointerModel) {\n    var layoutInfo = singleAxisHelper.layout(axisModel, {\n      labelInside: false\n    });\n    layoutInfo.labelMargin = axisPointerModel.get(['handle', 'margin']);\n    var position = viewHelper.getTransformedPosition(axisModel.axis, value, layoutInfo);\n    return {\n      x: position[0],\n      y: position[1],\n      rotation: layoutInfo.rotation + (layoutInfo.labelDirection < 0 ? Math.PI : 0)\n    };\n  };\n  /**\n   * @override\n   */\n  SingleAxisPointer.prototype.updateHandleTransform = function (transform, delta, axisModel, axisPointerModel) {\n    var axis = axisModel.axis;\n    var coordSys = axis.coordinateSystem;\n    var dimIndex = getPointDimIndex(axis);\n    var axisExtent = getGlobalExtent(coordSys, dimIndex);\n    var currPosition = [transform.x, transform.y];\n    currPosition[dimIndex] += delta[dimIndex];\n    currPosition[dimIndex] = Math.min(axisExtent[1], currPosition[dimIndex]);\n    currPosition[dimIndex] = Math.max(axisExtent[0], currPosition[dimIndex]);\n    var otherExtent = getGlobalExtent(coordSys, 1 - dimIndex);\n    var cursorOtherValue = (otherExtent[1] + otherExtent[0]) / 2;\n    var cursorPoint = [cursorOtherValue, cursorOtherValue];\n    cursorPoint[dimIndex] = currPosition[dimIndex];\n    return {\n      x: currPosition[0],\n      y: currPosition[1],\n      rotation: transform.rotation,\n      cursorPoint: cursorPoint,\n      tooltipOption: {\n        verticalAlign: 'middle'\n      }\n    };\n  };\n  return SingleAxisPointer;\n}(BaseAxisPointer);\nvar pointerShapeBuilder = {\n  line: function (axis, pixelValue, otherExtent) {\n    var targetShape = viewHelper.makeLineShape([pixelValue, otherExtent[0]], [pixelValue, otherExtent[1]], getPointDimIndex(axis));\n    return {\n      type: 'Line',\n      subPixelOptimize: true,\n      shape: targetShape\n    };\n  },\n  shadow: function (axis, pixelValue, otherExtent) {\n    var bandWidth = axis.getBandWidth();\n    var span = otherExtent[1] - otherExtent[0];\n    return {\n      type: 'Rect',\n      shape: viewHelper.makeRectShape([pixelValue - bandWidth / 2, otherExtent[0]], [bandWidth, span], getPointDimIndex(axis))\n    };\n  }\n};\nfunction getPointDimIndex(axis) {\n  return axis.isHorizontal() ? 0 : 1;\n}\nfunction getGlobalExtent(coordSys, dimIndex) {\n  var rect = coordSys.getRect();\n  return [rect[XY[dimIndex]], rect[XY[dimIndex]] + rect[WH[dimIndex]]];\n}\nexport default SingleAxisPointer;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport { use } from '../../extension.js';\nimport ComponentView from '../../view/Component.js';\nimport SingleAxisView from '../axis/SingleAxisView.js';\nimport axisModelCreator from '../../coord/axisModelCreator.js';\nimport SingleAxisModel from '../../coord/single/AxisModel.js';\nimport singleCreator from '../../coord/single/singleCreator.js';\nimport { install as installAxisPointer } from '../axisPointer/install.js';\nimport AxisView from '../axis/AxisView.js';\nimport SingleAxisPointer from '../axisPointer/SingleAxisPointer.js';\nvar SingleView = /** @class */function (_super) {\n  __extends(SingleView, _super);\n  function SingleView() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = SingleView.type;\n    return _this;\n  }\n  SingleView.type = 'single';\n  return SingleView;\n}(ComponentView);\nexport function install(registers) {\n  use(installAxisPointer);\n  AxisView.registerAxisPointerClass('SingleAxisPointer', SingleAxisPointer);\n  registers.registerComponentView(SingleView);\n  // Axis\n  registers.registerComponentView(SingleAxisView);\n  registers.registerComponentModel(SingleAxisModel);\n  axisModelCreator(registers, 'single', SingleAxisModel, SingleAxisModel.defaultOption);\n  registers.registerCoordinateSystem('single', singleCreator);\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport ComponentModel from '../../model/Component.js';\nimport { getLayoutParams, sizeCalculable, mergeLayoutParam } from '../../util/layout.js';\nimport tokens from '../../visual/tokens.js';\nvar CalendarModel = /** @class */function (_super) {\n  __extends(CalendarModel, _super);\n  function CalendarModel() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = CalendarModel.type;\n    return _this;\n  }\n  /**\n   * @override\n   */\n  CalendarModel.prototype.init = function (option, parentModel, ecModel) {\n    var inputPositionParams = getLayoutParams(option);\n    _super.prototype.init.apply(this, arguments);\n    mergeAndNormalizeLayoutParams(option, inputPositionParams);\n  };\n  /**\n   * @override\n   */\n  CalendarModel.prototype.mergeOption = function (option) {\n    _super.prototype.mergeOption.apply(this, arguments);\n    mergeAndNormalizeLayoutParams(this.option, option);\n  };\n  CalendarModel.prototype.getCellSize = function () {\n    // Has been normalized\n    return this.option.cellSize;\n  };\n  CalendarModel.type = 'calendar';\n  CalendarModel.layoutMode = 'box';\n  CalendarModel.defaultOption = {\n    // zlevel: 0,\n    // TODO: theoretically, the z of the calendar should be lower\n    // than series, but we don't want the series to be displayed\n    // on top of the borders like month split line. To align with\n    // the effect of previous versions, we set the z to 2 for now\n    // until better solution is found.\n    z: 2,\n    left: 80,\n    top: 60,\n    cellSize: 20,\n    // horizontal vertical\n    orient: 'horizontal',\n    // month separate line style\n    splitLine: {\n      show: true,\n      lineStyle: {\n        color: tokens.color.axisLine,\n        width: 1,\n        type: 'solid'\n      }\n    },\n    // rect style  temporarily unused emphasis\n    itemStyle: {\n      color: tokens.color.neutral00,\n      borderWidth: 1,\n      borderColor: tokens.color.neutral10\n    },\n    // week text style\n    dayLabel: {\n      show: true,\n      firstDay: 0,\n      // start end\n      position: 'start',\n      margin: tokens.size.s,\n      color: tokens.color.secondary\n    },\n    // month text style\n    monthLabel: {\n      show: true,\n      // start end\n      position: 'start',\n      margin: tokens.size.s,\n      // center or left\n      align: 'center',\n      formatter: null,\n      color: tokens.color.secondary\n    },\n    // year text style\n    yearLabel: {\n      show: true,\n      // top bottom left right\n      position: null,\n      margin: tokens.size.xl,\n      formatter: null,\n      color: tokens.color.quaternary,\n      fontFamily: 'sans-serif',\n      fontWeight: 'bolder',\n      fontSize: 20\n    }\n  };\n  return CalendarModel;\n}(ComponentModel);\nfunction mergeAndNormalizeLayoutParams(target, raw) {\n  // Normalize cellSize\n  var cellSize = target.cellSize;\n  var cellSizeArr;\n  if (!zrUtil.isArray(cellSize)) {\n    cellSizeArr = target.cellSize = [cellSize, cellSize];\n  } else {\n    cellSizeArr = cellSize;\n  }\n  if (cellSizeArr.length === 1) {\n    cellSizeArr[1] = cellSizeArr[0];\n  }\n  var ignoreSize = zrUtil.map([0, 1], function (hvIdx) {\n    // If user have set `width` or both `left` and `right`, cellSizeArr\n    // will be automatically set to 'auto', otherwise the default\n    // setting of cellSizeArr will make `width` setting not work.\n    if (sizeCalculable(raw, hvIdx)) {\n      cellSizeArr[hvIdx] = 'auto';\n    }\n    return cellSizeArr[hvIdx] != null && cellSizeArr[hvIdx] !== 'auto';\n  });\n  mergeLayoutParam(target, raw, {\n    type: 'box',\n    ignoreSize: ignoreSize\n  });\n}\nexport default CalendarModel;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport { isString, extend, map, isFunction } from 'zrender/lib/core/util.js';\nimport * as graphic from '../../util/graphic.js';\nimport { createTextStyle } from '../../label/labelStyle.js';\nimport { formatTplSimple } from '../../util/format.js';\nimport { parsePercent } from '../../util/number.js';\nimport ComponentView from '../../view/Component.js';\nimport { getLocaleModel } from '../../core/locale.js';\nvar CalendarView = /** @class */function (_super) {\n  __extends(CalendarView, _super);\n  function CalendarView() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = CalendarView.type;\n    return _this;\n  }\n  CalendarView.prototype.render = function (calendarModel, ecModel, api) {\n    var group = this.group;\n    group.removeAll();\n    var coordSys = calendarModel.coordinateSystem;\n    // range info\n    var rangeData = coordSys.getRangeInfo();\n    var orient = coordSys.getOrient();\n    // locale\n    var localeModel = ecModel.getLocaleModel();\n    this._renderDayRect(calendarModel, rangeData, group);\n    // _renderLines must be called prior to following function\n    this._renderLines(calendarModel, rangeData, orient, group);\n    this._renderYearText(calendarModel, rangeData, orient, group);\n    this._renderMonthText(calendarModel, localeModel, orient, group);\n    this._renderWeekText(calendarModel, localeModel, rangeData, orient, group);\n  };\n  // render day rect\n  CalendarView.prototype._renderDayRect = function (calendarModel, rangeData, group) {\n    var coordSys = calendarModel.coordinateSystem;\n    var itemRectStyleModel = calendarModel.getModel('itemStyle').getItemStyle();\n    var sw = coordSys.getCellWidth();\n    var sh = coordSys.getCellHeight();\n    for (var i = rangeData.start.time; i <= rangeData.end.time; i = coordSys.getNextNDay(i, 1).time) {\n      var point = coordSys.dataToCalendarLayout([i], false).tl;\n      // every rect\n      var rect = new graphic.Rect({\n        shape: {\n          x: point[0],\n          y: point[1],\n          width: sw,\n          height: sh\n        },\n        cursor: 'default',\n        style: itemRectStyleModel\n      });\n      group.add(rect);\n    }\n  };\n  // render separate line\n  CalendarView.prototype._renderLines = function (calendarModel, rangeData, orient, group) {\n    var self = this;\n    var coordSys = calendarModel.coordinateSystem;\n    var lineStyleModel = calendarModel.getModel(['splitLine', 'lineStyle']).getLineStyle();\n    var show = calendarModel.get(['splitLine', 'show']);\n    var lineWidth = lineStyleModel.lineWidth;\n    this._tlpoints = [];\n    this._blpoints = [];\n    this._firstDayOfMonth = [];\n    this._firstDayPoints = [];\n    var firstDay = rangeData.start;\n    for (var i = 0; firstDay.time <= rangeData.end.time; i++) {\n      addPoints(firstDay.formatedDate);\n      if (i === 0) {\n        firstDay = coordSys.getDateInfo(rangeData.start.y + '-' + rangeData.start.m);\n      }\n      var date = firstDay.date;\n      date.setMonth(date.getMonth() + 1);\n      firstDay = coordSys.getDateInfo(date);\n    }\n    addPoints(coordSys.getNextNDay(rangeData.end.time, 1).formatedDate);\n    function addPoints(date) {\n      self._firstDayOfMonth.push(coordSys.getDateInfo(date));\n      self._firstDayPoints.push(coordSys.dataToCalendarLayout([date], false).tl);\n      var points = self._getLinePointsOfOneWeek(calendarModel, date, orient);\n      self._tlpoints.push(points[0]);\n      self._blpoints.push(points[points.length - 1]);\n      show && self._drawSplitline(points, lineStyleModel, group);\n    }\n    // render top/left line\n    show && this._drawSplitline(self._getEdgesPoints(self._tlpoints, lineWidth, orient), lineStyleModel, group);\n    // render bottom/right line\n    show && this._drawSplitline(self._getEdgesPoints(self._blpoints, lineWidth, orient), lineStyleModel, group);\n  };\n  // get points at both ends\n  CalendarView.prototype._getEdgesPoints = function (points, lineWidth, orient) {\n    var rs = [points[0].slice(), points[points.length - 1].slice()];\n    var idx = orient === 'horizontal' ? 0 : 1;\n    // both ends of the line are extend half lineWidth\n    rs[0][idx] = rs[0][idx] - lineWidth / 2;\n    rs[1][idx] = rs[1][idx] + lineWidth / 2;\n    return rs;\n  };\n  // render split line\n  CalendarView.prototype._drawSplitline = function (points, lineStyle, group) {\n    var poyline = new graphic.Polyline({\n      z2: 20,\n      shape: {\n        points: points\n      },\n      style: lineStyle\n    });\n    group.add(poyline);\n  };\n  // render month line of one week points\n  CalendarView.prototype._getLinePointsOfOneWeek = function (calendarModel, date, orient) {\n    var coordSys = calendarModel.coordinateSystem;\n    var parsedDate = coordSys.getDateInfo(date);\n    var points = [];\n    for (var i = 0; i < 7; i++) {\n      var tmpD = coordSys.getNextNDay(parsedDate.time, i);\n      var point = coordSys.dataToCalendarLayout([tmpD.time], false);\n      points[2 * tmpD.day] = point.tl;\n      points[2 * tmpD.day + 1] = point[orient === 'horizontal' ? 'bl' : 'tr'];\n    }\n    return points;\n  };\n  CalendarView.prototype._formatterLabel = function (formatter, params) {\n    if (isString(formatter) && formatter) {\n      return formatTplSimple(formatter, params);\n    }\n    if (isFunction(formatter)) {\n      return formatter(params);\n    }\n    return params.nameMap;\n  };\n  CalendarView.prototype._yearTextPositionControl = function (textEl, point, orient, position, margin) {\n    var x = point[0];\n    var y = point[1];\n    var aligns = ['center', 'bottom'];\n    if (position === 'bottom') {\n      y += margin;\n      aligns = ['center', 'top'];\n    } else if (position === 'left') {\n      x -= margin;\n    } else if (position === 'right') {\n      x += margin;\n      aligns = ['center', 'top'];\n    } else {\n      // top\n      y -= margin;\n    }\n    var rotate = 0;\n    if (position === 'left' || position === 'right') {\n      rotate = Math.PI / 2;\n    }\n    return {\n      rotation: rotate,\n      x: x,\n      y: y,\n      style: {\n        align: aligns[0],\n        verticalAlign: aligns[1]\n      }\n    };\n  };\n  // render year\n  CalendarView.prototype._renderYearText = function (calendarModel, rangeData, orient, group) {\n    var yearLabel = calendarModel.getModel('yearLabel');\n    if (!yearLabel.get('show')) {\n      return;\n    }\n    var margin = yearLabel.get('margin');\n    var pos = yearLabel.get('position');\n    if (!pos) {\n      pos = orient !== 'horizontal' ? 'top' : 'left';\n    }\n    var points = [this._tlpoints[this._tlpoints.length - 1], this._blpoints[0]];\n    var xc = (points[0][0] + points[1][0]) / 2;\n    var yc = (points[0][1] + points[1][1]) / 2;\n    var idx = orient === 'horizontal' ? 0 : 1;\n    var posPoints = {\n      top: [xc, points[idx][1]],\n      bottom: [xc, points[1 - idx][1]],\n      left: [points[1 - idx][0], yc],\n      right: [points[idx][0], yc]\n    };\n    var name = rangeData.start.y;\n    if (+rangeData.end.y > +rangeData.start.y) {\n      name = name + '-' + rangeData.end.y;\n    }\n    var formatter = yearLabel.get('formatter');\n    var params = {\n      start: rangeData.start.y,\n      end: rangeData.end.y,\n      nameMap: name\n    };\n    var content = this._formatterLabel(formatter, params);\n    var yearText = new graphic.Text({\n      z2: 30,\n      style: createTextStyle(yearLabel, {\n        text: content\n      }),\n      silent: yearLabel.get('silent')\n    });\n    yearText.attr(this._yearTextPositionControl(yearText, posPoints[pos], orient, pos, margin));\n    group.add(yearText);\n  };\n  CalendarView.prototype._monthTextPositionControl = function (point, isCenter, orient, position, margin) {\n    var align = 'left';\n    var vAlign = 'top';\n    var x = point[0];\n    var y = point[1];\n    if (orient === 'horizontal') {\n      y = y + margin;\n      if (isCenter) {\n        align = 'center';\n      }\n      if (position === 'start') {\n        vAlign = 'bottom';\n      }\n    } else {\n      x = x + margin;\n      if (isCenter) {\n        vAlign = 'middle';\n      }\n      if (position === 'start') {\n        align = 'right';\n      }\n    }\n    return {\n      x: x,\n      y: y,\n      align: align,\n      verticalAlign: vAlign\n    };\n  };\n  // render month and year text\n  CalendarView.prototype._renderMonthText = function (calendarModel, localeModel, orient, group) {\n    var monthLabel = calendarModel.getModel('monthLabel');\n    if (!monthLabel.get('show')) {\n      return;\n    }\n    var nameMap = monthLabel.get('nameMap');\n    var margin = monthLabel.get('margin');\n    var pos = monthLabel.get('position');\n    var align = monthLabel.get('align');\n    var termPoints = [this._tlpoints, this._blpoints];\n    if (!nameMap || isString(nameMap)) {\n      if (nameMap) {\n        // case-sensitive\n        localeModel = getLocaleModel(nameMap) || localeModel;\n      }\n      // PENDING\n      // for ZH locale, original form is `\u4E00\u6708` but current form is `1\u6708`\n      nameMap = localeModel.get(['time', 'monthAbbr']) || [];\n    }\n    var idx = pos === 'start' ? 0 : 1;\n    var axis = orient === 'horizontal' ? 0 : 1;\n    margin = pos === 'start' ? -margin : margin;\n    var isCenter = align === 'center';\n    var labelSilent = monthLabel.get('silent');\n    for (var i = 0; i < termPoints[idx].length - 1; i++) {\n      var tmp = termPoints[idx][i].slice();\n      var firstDay = this._firstDayOfMonth[i];\n      if (isCenter) {\n        var firstDayPoints = this._firstDayPoints[i];\n        tmp[axis] = (firstDayPoints[axis] + termPoints[0][i + 1][axis]) / 2;\n      }\n      var formatter = monthLabel.get('formatter');\n      var name_1 = nameMap[+firstDay.m - 1];\n      var params = {\n        yyyy: firstDay.y,\n        yy: (firstDay.y + '').slice(2),\n        MM: firstDay.m,\n        M: +firstDay.m,\n        nameMap: name_1\n      };\n      var content = this._formatterLabel(formatter, params);\n      var monthText = new graphic.Text({\n        z2: 30,\n        style: extend(createTextStyle(monthLabel, {\n          text: content\n        }), this._monthTextPositionControl(tmp, isCenter, orient, pos, margin)),\n        silent: labelSilent\n      });\n      group.add(monthText);\n    }\n  };\n  CalendarView.prototype._weekTextPositionControl = function (point, orient, position, margin, cellSize) {\n    var align = 'center';\n    var vAlign = 'middle';\n    var x = point[0];\n    var y = point[1];\n    var isStart = position === 'start';\n    if (orient === 'horizontal') {\n      x = x + margin + (isStart ? 1 : -1) * cellSize[0] / 2;\n      align = isStart ? 'right' : 'left';\n    } else {\n      y = y + margin + (isStart ? 1 : -1) * cellSize[1] / 2;\n      vAlign = isStart ? 'bottom' : 'top';\n    }\n    return {\n      x: x,\n      y: y,\n      align: align,\n      verticalAlign: vAlign\n    };\n  };\n  // render weeks\n  CalendarView.prototype._renderWeekText = function (calendarModel, localeModel, rangeData, orient, group) {\n    var dayLabel = calendarModel.getModel('dayLabel');\n    if (!dayLabel.get('show')) {\n      return;\n    }\n    var coordSys = calendarModel.coordinateSystem;\n    var pos = dayLabel.get('position');\n    var nameMap = dayLabel.get('nameMap');\n    var margin = dayLabel.get('margin');\n    var firstDayOfWeek = coordSys.getFirstDayOfWeek();\n    if (!nameMap || isString(nameMap)) {\n      if (nameMap) {\n        // case-sensitive\n        localeModel = getLocaleModel(nameMap) || localeModel;\n      }\n      // Use the first letter of `dayOfWeekAbbr` if `dayOfWeekShort` doesn't exist in the locale file\n      var dayOfWeekShort = localeModel.get(['time', 'dayOfWeekShort']);\n      nameMap = dayOfWeekShort || map(localeModel.get(['time', 'dayOfWeekAbbr']), function (val) {\n        return val[0];\n      });\n    }\n    var start = coordSys.getNextNDay(rangeData.end.time, 7 - rangeData.lweek).time;\n    var cellSize = [coordSys.getCellWidth(), coordSys.getCellHeight()];\n    margin = parsePercent(margin, Math.min(cellSize[1], cellSize[0]));\n    if (pos === 'start') {\n      start = coordSys.getNextNDay(rangeData.start.time, -(7 + rangeData.fweek)).time;\n      margin = -margin;\n    }\n    var labelSilent = dayLabel.get('silent');\n    for (var i = 0; i < 7; i++) {\n      var tmpD = coordSys.getNextNDay(start, i);\n      var point = coordSys.dataToCalendarLayout([tmpD.time], false).center;\n      var day = i;\n      day = Math.abs((i + firstDayOfWeek) % 7);\n      var weekText = new graphic.Text({\n        z2: 30,\n        style: extend(createTextStyle(dayLabel, {\n          text: nameMap[day]\n        }), this._weekTextPositionControl(point, orient, pos, margin, cellSize)),\n        silent: labelSilent\n      });\n      group.add(weekText);\n    }\n  };\n  CalendarView.type = 'calendar';\n  return CalendarView;\n}(ComponentView);\nexport default CalendarView;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as layout from '../../util/layout.js';\nimport * as numberUtil from '../../util/number.js';\nimport BoundingRect from 'zrender/lib/core/BoundingRect.js';\nimport { expandOrShrinkRect } from '../../util/graphic.js';\nimport { injectCoordSysByOption, simpleCoordSysInjectionProvider } from '../../core/CoordinateSystem.js';\n// (24*60*60*1000)\nvar PROXIMATE_ONE_DAY = 86400000;\nvar Calendar = /** @class */function () {\n  function Calendar(calendarModel, ecModel, api) {\n    this.type = 'calendar';\n    this.dimensions = Calendar.dimensions;\n    // Required in createListFromData\n    this.getDimensionsInfo = Calendar.getDimensionsInfo;\n    this._model = calendarModel;\n    this._update(ecModel, api);\n  }\n  Calendar.getDimensionsInfo = function () {\n    return [{\n      name: 'time',\n      type: 'time'\n    }, 'value'];\n  };\n  Calendar.prototype.getRangeInfo = function () {\n    return this._rangeInfo;\n  };\n  Calendar.prototype.getModel = function () {\n    return this._model;\n  };\n  Calendar.prototype.getRect = function () {\n    return this._rect;\n  };\n  Calendar.prototype.getCellWidth = function () {\n    return this._sw;\n  };\n  Calendar.prototype.getCellHeight = function () {\n    return this._sh;\n  };\n  Calendar.prototype.getOrient = function () {\n    return this._orient;\n  };\n  /**\n   * getFirstDayOfWeek\n   *\n   * @example\n   *     0 : start at Sunday\n   *     1 : start at Monday\n   *\n   * @return {number}\n   */\n  Calendar.prototype.getFirstDayOfWeek = function () {\n    return this._firstDayOfWeek;\n  };\n  /**\n   * get date info\n   * }\n   */\n  Calendar.prototype.getDateInfo = function (date) {\n    date = numberUtil.parseDate(date);\n    var y = date.getFullYear();\n    var m = date.getMonth() + 1;\n    var mStr = m < 10 ? '0' + m : '' + m;\n    var d = date.getDate();\n    var dStr = d < 10 ? '0' + d : '' + d;\n    var day = date.getDay();\n    day = Math.abs((day + 7 - this.getFirstDayOfWeek()) % 7);\n    return {\n      y: y + '',\n      m: mStr,\n      d: dStr,\n      day: day,\n      time: date.getTime(),\n      formatedDate: y + '-' + mStr + '-' + dStr,\n      date: date\n    };\n  };\n  Calendar.prototype.getNextNDay = function (date, n) {\n    n = n || 0;\n    if (n === 0) {\n      return this.getDateInfo(date);\n    }\n    date = new Date(this.getDateInfo(date).time);\n    date.setDate(date.getDate() + n);\n    return this.getDateInfo(date);\n  };\n  Calendar.prototype._update = function (ecModel, api) {\n    this._firstDayOfWeek = +this._model.getModel('dayLabel').get('firstDay');\n    this._orient = this._model.get('orient');\n    this._lineWidth = this._model.getModel('itemStyle').getItemStyle().lineWidth || 0;\n    this._rangeInfo = this._getRangeInfo(this._initRangeOption());\n    var weeks = this._rangeInfo.weeks || 1;\n    var whNames = ['width', 'height'];\n    var cellSize = this._model.getCellSize().slice();\n    var layoutParams = this._model.getBoxLayoutParams();\n    var cellNumbers = this._orient === 'horizontal' ? [weeks, 7] : [7, weeks];\n    zrUtil.each([0, 1], function (idx) {\n      if (cellSizeSpecified(cellSize, idx)) {\n        layoutParams[whNames[idx]] = cellSize[idx] * cellNumbers[idx];\n      }\n    });\n    var whGlobal = {\n      width: api.getWidth(),\n      height: api.getHeight()\n    };\n    var calendarRect = this._rect = layout.getLayoutRect(layoutParams, whGlobal);\n    zrUtil.each([0, 1], function (idx) {\n      if (!cellSizeSpecified(cellSize, idx)) {\n        cellSize[idx] = calendarRect[whNames[idx]] / cellNumbers[idx];\n      }\n    });\n    function cellSizeSpecified(cellSize, idx) {\n      return cellSize[idx] != null && cellSize[idx] !== 'auto';\n    }\n    // Has been calculated out number.\n    this._sw = cellSize[0];\n    this._sh = cellSize[1];\n  };\n  /**\n   * Convert a time data(time, value) item to (x, y) point.\n   */\n  // TODO Clamp of calendar is not same with cartesian coordinate systems.\n  // It will return NaN if data exceeds.\n  Calendar.prototype.dataToPoint = function (data, clamp, out) {\n    out = out || [];\n    zrUtil.isArray(data) && (data = data[0]);\n    clamp == null && (clamp = true);\n    var dayInfo = this.getDateInfo(data);\n    var range = this._rangeInfo;\n    var date = dayInfo.formatedDate;\n    // if not in range return [NaN, NaN]\n    if (clamp && !(dayInfo.time >= range.start.time && dayInfo.time < range.end.time + PROXIMATE_ONE_DAY)) {\n      out[0] = out[1] = NaN;\n      return out;\n    }\n    var week = dayInfo.day;\n    var nthWeek = this._getRangeInfo([range.start.time, date]).nthWeek;\n    if (this._orient === 'vertical') {\n      out[0] = this._rect.x + week * this._sw + this._sw / 2;\n      out[1] = this._rect.y + nthWeek * this._sh + this._sh / 2;\n    } else {\n      out[0] = this._rect.x + nthWeek * this._sw + this._sw / 2;\n      out[1] = this._rect.y + week * this._sh + this._sh / 2;\n    }\n    return out;\n  };\n  /**\n   * Convert a (x, y) point to time data\n   */\n  Calendar.prototype.pointToData = function (point) {\n    var date = this.pointToDate(point);\n    return date && date.time;\n  };\n  Calendar.prototype.dataToLayout = function (data, clamp, out) {\n    out = out || {};\n    var rect = out.rect = out.rect || {};\n    var contentRect = out.contentRect = out.contentRect || {};\n    var point = this.dataToPoint(data, clamp);\n    rect.x = point[0] - this._sw / 2;\n    rect.y = point[1] - this._sh / 2;\n    rect.width = this._sw;\n    rect.height = this._sh;\n    BoundingRect.copy(contentRect, rect);\n    expandOrShrinkRect(contentRect, this._lineWidth / 2, true, true);\n    return out;\n  };\n  /**\n   * Convert a time date item to (x, y) four point.\n   */\n  Calendar.prototype.dataToCalendarLayout = function (data, clamp) {\n    var point = this.dataToPoint(data, clamp);\n    return {\n      center: point,\n      tl: [point[0] - this._sw / 2, point[1] - this._sh / 2],\n      tr: [point[0] + this._sw / 2, point[1] - this._sh / 2],\n      br: [point[0] + this._sw / 2, point[1] + this._sh / 2],\n      bl: [point[0] - this._sw / 2, point[1] + this._sh / 2]\n    };\n  };\n  /**\n   * Convert a (x, y) point to time date\n   *\n   * @param  {Array} point point\n   * @return {Object}       date\n   */\n  Calendar.prototype.pointToDate = function (point) {\n    var nthX = Math.floor((point[0] - this._rect.x) / this._sw) + 1;\n    var nthY = Math.floor((point[1] - this._rect.y) / this._sh) + 1;\n    var range = this._rangeInfo.range;\n    if (this._orient === 'vertical') {\n      return this._getDateByWeeksAndDay(nthY, nthX - 1, range);\n    }\n    return this._getDateByWeeksAndDay(nthX, nthY - 1, range);\n  };\n  Calendar.prototype.convertToPixel = function (ecModel, finder, value) {\n    var coordSys = getCoordSys(finder);\n    return coordSys === this ? coordSys.dataToPoint(value) : null;\n  };\n  Calendar.prototype.convertToLayout = function (ecModel, finder, value) {\n    var coordSys = getCoordSys(finder);\n    return coordSys === this ? coordSys.dataToLayout(value) : null;\n  };\n  Calendar.prototype.convertFromPixel = function (ecModel, finder, pixel) {\n    var coordSys = getCoordSys(finder);\n    return coordSys === this ? coordSys.pointToData(pixel) : null;\n  };\n  Calendar.prototype.containPoint = function (point) {\n    console.warn('Not implemented.');\n    return false;\n  };\n  /**\n   * initRange\n   * Normalize to an [start, end] array\n   */\n  Calendar.prototype._initRangeOption = function () {\n    var range = this._model.get('range');\n    var normalizedRange;\n    // Convert [1990] to 1990\n    if (zrUtil.isArray(range) && range.length === 1) {\n      range = range[0];\n    }\n    if (!zrUtil.isArray(range)) {\n      var rangeStr = range.toString();\n      // One year.\n      if (/^\\d{4}$/.test(rangeStr)) {\n        normalizedRange = [rangeStr + '-01-01', rangeStr + '-12-31'];\n      }\n      // One month\n      if (/^\\d{4}[\\/|-]\\d{1,2}$/.test(rangeStr)) {\n        var start = this.getDateInfo(rangeStr);\n        var firstDay = start.date;\n        firstDay.setMonth(firstDay.getMonth() + 1);\n        var end = this.getNextNDay(firstDay, -1);\n        normalizedRange = [start.formatedDate, end.formatedDate];\n      }\n      // One day\n      if (/^\\d{4}[\\/|-]\\d{1,2}[\\/|-]\\d{1,2}$/.test(rangeStr)) {\n        normalizedRange = [rangeStr, rangeStr];\n      }\n    } else {\n      normalizedRange = range;\n    }\n    if (!normalizedRange) {\n      if (process.env.NODE_ENV !== 'production') {\n        zrUtil.logError('Invalid date range.');\n      }\n      // Not handling it.\n      return range;\n    }\n    var tmp = this._getRangeInfo(normalizedRange);\n    if (tmp.start.time > tmp.end.time) {\n      normalizedRange.reverse();\n    }\n    return normalizedRange;\n  };\n  /**\n   * range info\n   *\n   * @private\n   * @param  {Array} range range ['2017-01-01', '2017-07-08']\n   *  If range[0] > range[1], they will not be reversed.\n   * @return {Object}       obj\n   */\n  Calendar.prototype._getRangeInfo = function (range) {\n    var parsedRange = [this.getDateInfo(range[0]), this.getDateInfo(range[1])];\n    var reversed;\n    if (parsedRange[0].time > parsedRange[1].time) {\n      reversed = true;\n      parsedRange.reverse();\n    }\n    var allDay = Math.floor(parsedRange[1].time / PROXIMATE_ONE_DAY) - Math.floor(parsedRange[0].time / PROXIMATE_ONE_DAY) + 1;\n    // Consider case1 (#11677 #10430):\n    // Set the system timezone as \"UK\", set the range to `['2016-07-01', '2016-12-31']`\n    // Consider case2:\n    // Firstly set system timezone as \"Time Zone: America/Toronto\",\n    // ```\n    // let first = new Date(1478412000000 - 3600 * 1000 * 2.5);\n    // let second = new Date(1478412000000);\n    // let allDays = Math.floor(second / ONE_DAY) - Math.floor(first / ONE_DAY) + 1;\n    // ```\n    // will get wrong result because of DST. So we should fix it.\n    var date = new Date(parsedRange[0].time);\n    var startDateNum = date.getDate();\n    var endDateNum = parsedRange[1].date.getDate();\n    date.setDate(startDateNum + allDay - 1);\n    // The bias can not over a month, so just compare date.\n    var dateNum = date.getDate();\n    if (dateNum !== endDateNum) {\n      var sign = date.getTime() - parsedRange[1].time > 0 ? 1 : -1;\n      while ((dateNum = date.getDate()) !== endDateNum && (date.getTime() - parsedRange[1].time) * sign > 0) {\n        allDay -= sign;\n        date.setDate(dateNum - sign);\n      }\n    }\n    var weeks = Math.floor((allDay + parsedRange[0].day + 6) / 7);\n    var nthWeek = reversed ? -weeks + 1 : weeks - 1;\n    reversed && parsedRange.reverse();\n    return {\n      range: [parsedRange[0].formatedDate, parsedRange[1].formatedDate],\n      start: parsedRange[0],\n      end: parsedRange[1],\n      allDay: allDay,\n      weeks: weeks,\n      // From 0.\n      nthWeek: nthWeek,\n      fweek: parsedRange[0].day,\n      lweek: parsedRange[1].day\n    };\n  };\n  /**\n   * get date by nthWeeks and week day in range\n   *\n   * @private\n   * @param  {number} nthWeek the week\n   * @param  {number} day   the week day\n   * @param  {Array} range [d1, d2]\n   * @return {Object}\n   */\n  Calendar.prototype._getDateByWeeksAndDay = function (nthWeek, day, range) {\n    var rangeInfo = this._getRangeInfo(range);\n    if (nthWeek > rangeInfo.weeks || nthWeek === 0 && day < rangeInfo.fweek || nthWeek === rangeInfo.weeks && day > rangeInfo.lweek) {\n      return null;\n    }\n    var nthDay = (nthWeek - 1) * 7 - rangeInfo.fweek + day;\n    var date = new Date(rangeInfo.start.time);\n    date.setDate(+rangeInfo.start.d + nthDay);\n    return this.getDateInfo(date);\n  };\n  Calendar.create = function (ecModel, api) {\n    var calendarList = [];\n    ecModel.eachComponent('calendar', function (calendarModel) {\n      var calendar = new Calendar(calendarModel, ecModel, api);\n      calendarList.push(calendar);\n      calendarModel.coordinateSystem = calendar;\n    });\n    // Inject coordinate system\n    ecModel.eachComponent(function (mainType, componentModel) {\n      injectCoordSysByOption({\n        targetModel: componentModel,\n        coordSysType: 'calendar',\n        coordSysProvider: simpleCoordSysInjectionProvider\n      });\n    });\n    return calendarList;\n  };\n  Calendar.dimensions = ['time', 'value'];\n  return Calendar;\n}();\nfunction getCoordSys(finder) {\n  var calendarModel = finder.calendarModel;\n  var seriesModel = finder.seriesModel;\n  var coordSys = calendarModel ? calendarModel.coordinateSystem : seriesModel ? seriesModel.coordinateSystem : null;\n  return coordSys;\n}\nexport default Calendar;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport CalendarModel from '../../coord/calendar/CalendarModel.js';\nimport CalendarView from './CalendarView.js';\nimport Calendar from '../../coord/calendar/Calendar.js';\nexport function install(registers) {\n  registers.registerComponentModel(CalendarModel);\n  registers.registerComponentView(CalendarView);\n  registers.registerCoordinateSystem('calendar', Calendar);\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { eqNaN, isArray, isNumber } from 'zrender/lib/core/util.js';\nimport { WH, XY } from '../../util/graphic.js';\nimport { mathMax, mathMin } from '../../util/number.js';\nexport var MatrixCellLayoutInfoType = {\n  level: 1,\n  leaf: 2,\n  nonLeaf: 3\n};\n/**\n * @public Public to users in `chart.convertFromPixel`.\n */\nexport var MatrixClampOption = {\n  // No clamp, be falsy, equals to null/undefined. It means if the input part is\n  // null/undefined/NaN/outOfBoundary, the result part is NaN, rather than clamp to\n  // the boundary of the matrix.\n  none: 0,\n  // Clamp, where null/undefined/NaN/outOfBoundary can be used to cover the entire row/column.\n  all: 1,\n  body: 2,\n  corner: 3\n};\n/**\n * For the x direction,\n *  - find dimension cell from `xMatrixDim`,\n *      - If `xDimCell` or `yDimCell` is not a leaf, return the non-leaf cell itself.\n *  - otherwise find level from `yMatrixDim`.\n *  - otherwise return `NullUndefined`.\n *\n * For the y direction, it's the opposite.\n */\nexport function coordDataToAllCellLevelLayout(coordValue, dims, thisDimIdx // 0 | 1\n) {\n  // Find in body.\n  var result = dims[XY[thisDimIdx]].getCell(coordValue);\n  // Find in corner or dimension area.\n  if (!result && isNumber(coordValue) && coordValue < 0) {\n    result = dims[XY[1 - thisDimIdx]].getUnitLayoutInfo(thisDimIdx, Math.round(coordValue));\n  }\n  return result;\n}\nexport function resetXYLocatorRange(out) {\n  var rg = out || [];\n  rg[0] = rg[0] || [];\n  rg[1] = rg[1] || [];\n  rg[0][0] = rg[0][1] = rg[1][0] = rg[1][1] = NaN;\n  return rg;\n}\n/**\n * If illegal or out of boundary, set NaN to `locOut`. See `isXYLocatorRangeInvalidOnDim`.\n * x dimension and y dimension are calculated separately.\n */\nexport function parseCoordRangeOption(locOut,\n// If illegal input or can not find any target, save reason to it.\n// Do nothing if `NullUndefined`.\nreasonOut, data, dims, clamp) {\n  // x and y are supported to be handled separately - if one dimension is invalid\n  // (may be users do not need that), the other one should also be calculated.\n  parseCoordRangeOptionOnOneDim(locOut[0], reasonOut, clamp, data, dims, 0);\n  parseCoordRangeOptionOnOneDim(locOut[1], reasonOut, clamp, data, dims, 1);\n}\nfunction parseCoordRangeOptionOnOneDim(locDimOut, reasonOut, clamp, data, dims, dimIdx) {\n  locDimOut[0] = Infinity;\n  locDimOut[1] = -Infinity;\n  var dataOnDim = data[dimIdx];\n  var coordValArr = isArray(dataOnDim) ? dataOnDim : [dataOnDim];\n  var len = coordValArr.length;\n  var hasClamp = !!clamp;\n  if (len >= 1) {\n    parseCoordRangeOptionOnOneDimOnePart(locDimOut, reasonOut, coordValArr, hasClamp, dims, dimIdx, 0);\n    if (len > 1) {\n      // Users may intuitively input the coords like `[[x1, x2, x3], ...]`;\n      // consider the range as `[x1, x3]` in this case.\n      parseCoordRangeOptionOnOneDimOnePart(locDimOut, reasonOut, coordValArr, hasClamp, dims, dimIdx, len - 1);\n    }\n  } else {\n    if (process.env.NODE_ENV !== 'production') {\n      if (reasonOut) {\n        reasonOut.push('Should be like [[\"x1\", \"x2\"], [\"y1\", \"y2\"]], or [\"x1\", \"y1\"], rather than empty.');\n      }\n    }\n    locDimOut[0] = locDimOut[1] = NaN;\n  }\n  if (hasClamp) {\n    // null/undefined/NaN or illegal data represents the entire row/column;\n    // Cover the entire locator regardless of body or corner, and confine it later.\n    var locLowerBound = -dims[XY[1 - dimIdx]].getLocatorCount(dimIdx);\n    var locUpperBound = dims[XY[dimIdx]].getLocatorCount(dimIdx) - 1;\n    if (clamp === MatrixClampOption.body) {\n      locLowerBound = mathMax(0, locLowerBound);\n    } else if (clamp === MatrixClampOption.corner) {\n      locUpperBound = mathMin(-1, locUpperBound);\n    }\n    if (locUpperBound < locLowerBound) {\n      // Also considered that both x and y has no cell.\n      locLowerBound = locUpperBound = NaN;\n    }\n    if (eqNaN(locDimOut[0])) {\n      locDimOut[0] = locLowerBound;\n    }\n    if (eqNaN(locDimOut[1])) {\n      locDimOut[1] = locUpperBound;\n    }\n    locDimOut[0] = mathMax(mathMin(locDimOut[0], locUpperBound), locLowerBound);\n    locDimOut[1] = mathMax(mathMin(locDimOut[1], locUpperBound), locLowerBound);\n  }\n}\n// The return val must be finite or NaN.\nfunction parseCoordRangeOptionOnOneDimOnePart(locDimOut, reasonOut, coordValArr, hasClamp, dims, dimIdx, partIdx) {\n  var layout = coordDataToAllCellLevelLayout(coordValArr[partIdx], dims, dimIdx);\n  if (!layout) {\n    if (process.env.NODE_ENV !== 'production') {\n      if (!hasClamp && reasonOut) {\n        reasonOut.push(\"Can not find cell by coord[\" + dimIdx + \"][\" + partIdx + \"].\");\n      }\n    }\n    locDimOut[0] = locDimOut[1] = NaN;\n    return;\n  }\n  var locatorA = layout.id[XY[dimIdx]];\n  var locatorB = locatorA;\n  var dimCell = cellLayoutInfoToDimCell(layout);\n  if (dimCell) {\n    // Handle non-leaf\n    locatorB += dimCell.span[XY[dimIdx]] - 1;\n  }\n  locDimOut[0] = mathMin(locDimOut[0], locatorA, locatorB);\n  locDimOut[1] = mathMax(locDimOut[1], locatorA, locatorB);\n}\n/**\n * @param locatorRange Must be the return of `parseCoordRangeOption`,\n *  where if not NaN, it must be a valid locator.\n */\nexport function isXYLocatorRangeInvalidOnDim(locatorRange, dimIdx) {\n  return eqNaN(locatorRange[dimIdx][0]) || eqNaN(locatorRange[dimIdx][1]);\n}\n// `locatorRange` will be expanded (modified) if an intersection is encountered.\nexport function resolveXYLocatorRangeByCellMerge(inOutLocatorRange,\n// Item indices coorespond to mergeDefList (len: mergeDefListTravelLen).\n// Indicating whether each item has be merged into the `locatorRange`\noutMergedMarkList, mergeDefList, mergeDefListTravelLen) {\n  outMergedMarkList = outMergedMarkList || _tmpOutMergedMarkList;\n  for (var idx = 0; idx < mergeDefListTravelLen; idx++) {\n    outMergedMarkList[idx] = false;\n  }\n  // In most case, cell merging definition list length is smaller than the range extent,\n  // therefore, to detection intersection, travelling cell merging definition list is probably\n  // performant than traveling the four edges of the rect formed by the locator range.\n  while (true) {\n    var expanded = false;\n    for (var idx = 0; idx < mergeDefListTravelLen; idx++) {\n      var mergeDef = mergeDefList[idx];\n      if (!outMergedMarkList[idx] && mergeDef.cellMergeOwner && expandXYLocatorRangeIfIntersect(inOutLocatorRange, mergeDef.locatorRange)) {\n        outMergedMarkList[idx] = true;\n        expanded = true;\n      }\n    }\n    if (!expanded) {\n      break;\n    }\n  }\n}\nvar _tmpOutMergedMarkList = [];\n// Return whether intersect.\n// `thisLocRange` will be expanded (modified) if an intersection is encountered.\nfunction expandXYLocatorRangeIfIntersect(thisLocRange, otherLocRange) {\n  if (!locatorRangeIntersectOneDim(thisLocRange[0], otherLocRange[0]) || !locatorRangeIntersectOneDim(thisLocRange[1], otherLocRange[1])) {\n    return false;\n  }\n  thisLocRange[0][0] = mathMin(thisLocRange[0][0], otherLocRange[0][0]);\n  thisLocRange[0][1] = mathMax(thisLocRange[0][1], otherLocRange[0][1]);\n  thisLocRange[1][0] = mathMin(thisLocRange[1][0], otherLocRange[1][0]);\n  thisLocRange[1][1] = mathMax(thisLocRange[1][1], otherLocRange[1][1]);\n  return true;\n}\n// Notice: If containing NaN, not intersect.\nfunction locatorRangeIntersectOneDim(locRange1OneDim, locRange2OneDim) {\n  return locRange1OneDim[1] >= locRange2OneDim[0] && locRange1OneDim[0] <= locRange2OneDim[1];\n}\nexport function fillIdSpanFromLocatorRange(owner, locatorRange) {\n  owner.id.set(locatorRange[0][0], locatorRange[1][0]);\n  owner.span.set(locatorRange[0][1] - owner.id.x + 1, locatorRange[1][1] - owner.id.y + 1);\n}\nexport function cloneXYLocatorRange(target, source) {\n  target[0][0] = source[0][0];\n  target[0][1] = source[0][1];\n  target[1][0] = source[1][0];\n  target[1][1] = source[1][1];\n}\n/**\n * If illegal, the corresponding x/y/width/height is set to `NaN`.\n * `x/width` or `y/height` is supported to be calculated separately,\n * i.e., one side are NaN, the other side are normal.\n * @param oneDimOut only write to `x/width` or `y/height`, depending on `dimIdx`.\n */\nexport function xyLocatorRangeToRectOneDim(oneDimOut, locRange, dims, dimIdx) {\n  var layoutMin = coordDataToAllCellLevelLayout(locRange[dimIdx][0], dims, dimIdx);\n  var layoutMax = coordDataToAllCellLevelLayout(locRange[dimIdx][1], dims, dimIdx);\n  oneDimOut[XY[dimIdx]] = oneDimOut[WH[dimIdx]] = NaN;\n  if (layoutMin && layoutMax) {\n    oneDimOut[XY[dimIdx]] = layoutMin.xy;\n    oneDimOut[WH[dimIdx]] = layoutMax.xy + layoutMax.wh - layoutMin.xy;\n  }\n}\n// No need currently, since `span` is not allowed to be defined directly by users.\n// /**\n//  * If either span x or y is valid and > 1, return parsed span, otherwise return `NullUndefined`.\n//  */\n// export function parseSpanOption(\n//     spanOptionHost: MatrixCellSpanOptionHost,\n//     dimCellPair: MatrixCellLayoutInfo[]\n// ): Point | NullUndefined {\n//     const spanX = parseSpanOnDim(spanOptionHost.spanX, dimCellPair[0], 0);\n//     const spanY = parseSpanOnDim(spanOptionHost.spanY, dimCellPair[1], 1);\n//     if (!eqNaN(spanX) || !eqNaN(spanY)) {\n//         return new Point(spanX || 1, spanY || 1);\n//     }\n//     function parseSpanOnDim(spanOption: unknown, dimCell: MatrixCellLayoutInfo, dimIdx: number): number {\n//         if (!isNumber(spanOption)) {\n//             return NaN;\n//         }\n//         // Ensure positive integer (not NaN) to avoid dead loop.\n//         const span = mathMax(1, Math.round(spanOption || 1)) || 1;\n//         // Clamp, and consider may also be specified as `Infinity` to span the entire col/row.\n//         return mathMin(span, mathMax(1, dimCell.dim.getLocatorCount(dimIdx) - dimCell.id[XY[dimIdx]]));\n//     }\n// }\n/**\n * @usage To get/set on dimension, use:\n *  `xyVal[XY[dim]] = val;` // set on this dimension.\n *  `xyVal[XY[1 - dim]] = val;` // set on the perpendicular dimension.\n */\nexport function setDimXYValue(out, dimIdx,\n// 0 | 1\nvalueOnThisDim, valueOnOtherDim) {\n  out[XY[dimIdx]] = valueOnThisDim;\n  out[XY[1 - dimIdx]] = valueOnOtherDim;\n  return out;\n}\n/**\n * Return NullUndefined if not dimension cell.\n */\nfunction cellLayoutInfoToDimCell(cellLayoutInfo) {\n  return cellLayoutInfo && (cellLayoutInfo.type === MatrixCellLayoutInfoType.leaf || cellLayoutInfo.type === MatrixCellLayoutInfoType.nonLeaf) ? cellLayoutInfo : null;\n}\nexport function createNaNRectLike() {\n  return {\n    x: NaN,\n    y: NaN,\n    width: NaN,\n    height: NaN\n  };\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { createHashMap, defaults, each, eqNaN, isArray, isObject, isString } from 'zrender/lib/core/util.js';\nimport Point from 'zrender/lib/core/Point.js';\nimport OrdinalMeta from '../../data/OrdinalMeta.js';\nimport Ordinal from '../../scale/Ordinal.js';\nimport { WH, XY } from '../../util/graphic.js';\nimport { ListIterator } from '../../util/model.js';\nimport { createNaNRectLike, setDimXYValue, MatrixCellLayoutInfoType } from './matrixCoordHelper.js';\nimport { error } from '../../util/log.js';\nimport { mathMax } from '../../util/number.js';\n/**\n * Lifetime: the same with `MatrixModel`, but different from `coord/Matrix`.\n */\nvar MatrixDim = /** @class */function () {\n  function MatrixDim(dim, dimModel) {\n    // Under the current definition, every leave corresponds a unit cell,\n    // and leaves can serve as the locator of cells.\n    // Therefore make sure:\n    //  - The first `_leavesCount` elements in `_cells` are leaves.\n    //  - `_cells[leaf.id[XY[this.dimIdx]]]` is the leaf itself.\n    //  - Leaves of each subtree are placed together, that is, the leaves of a dimCell are:\n    //    `this._cells.slice(dimCell.firstLeafLocator, dimCell.span[XY[this.dimIdx]])`\n    this._cells = [];\n    // Can be visited by `_levels[cell.level]` or `_levels[cell.id[1 - dimIdx] + _levels.length]`.\n    // Items are never be null/undefined after initialized.\n    this._levels = [];\n    this.dim = dim;\n    this.dimIdx = dim === 'x' ? 0 : 1;\n    this._model = dimModel;\n    this._uniqueValueGen = createUniqueValueGenerator(dim);\n    var dimModelData = dimModel.get('data', true);\n    if (dimModelData != null && !isArray(dimModelData)) {\n      if (process.env.NODE_ENV !== 'production') {\n        error(\"Illegal echarts option - matrix.\" + this.dim + \".data must be an array if specified.\");\n      }\n      dimModelData = [];\n    }\n    if (dimModelData) {\n      this._initByDimModelData(dimModelData);\n    } else {\n      this._initBySeriesData();\n    }\n  }\n  MatrixDim.prototype._initByDimModelData = function (dimModelData) {\n    var self = this;\n    var _cells = self._cells;\n    var _levels = self._levels;\n    var sameLocatorCellsLists = []; // Save for sorting.\n    var _cellCount = 0;\n    self._leavesCount = traverseInitCells(dimModelData, 0, 0);\n    postInitCells();\n    return;\n    function traverseInitCells(dimModelData, firstLeafLocator, level) {\n      var totalSpan = 0;\n      if (!dimModelData) {\n        return totalSpan;\n      }\n      each(dimModelData, function (option, optionIdx) {\n        var invalidOption = false;\n        var cellOption;\n        if (isString(option)) {\n          cellOption = {\n            value: option\n          };\n        } else if (isObject(option)) {\n          cellOption = option;\n          if (option.value != null && !isString(option.value)) {\n            invalidOption = true;\n            cellOption = {\n              value: null\n            };\n          }\n        } else {\n          cellOption = {\n            value: null\n          };\n          if (option != null) {\n            invalidOption = true;\n          }\n        }\n        if (invalidOption) {\n          if (process.env.NODE_ENV !== 'production') {\n            error(\"Illegal echarts option - matrix.\" + self.dim + \".data[\" + optionIdx + \"]\" + ' must be `string | {value: string}`.');\n          }\n        }\n        var cell = {\n          type: MatrixCellLayoutInfoType.nonLeaf,\n          ordinal: NaN,\n          level: level,\n          firstLeafLocator: firstLeafLocator,\n          id: new Point(),\n          span: setDimXYValue(new Point(), self.dimIdx, 1, 1),\n          option: cellOption,\n          xy: NaN,\n          wh: NaN,\n          dim: self,\n          rect: createNaNRectLike()\n        };\n        _cellCount++;\n        (sameLocatorCellsLists[firstLeafLocator] || (sameLocatorCellsLists[firstLeafLocator] = [])).push(cell);\n        if (!_levels[level]) {\n          // Create a level only if at least one cell exists.\n          _levels[level] = {\n            type: MatrixCellLayoutInfoType.level,\n            xy: NaN,\n            wh: NaN,\n            option: null,\n            id: new Point(),\n            dim: self\n          };\n        }\n        var childrenSpan = traverseInitCells(cellOption.children, firstLeafLocator, level + 1);\n        var subSpan = Math.max(1, childrenSpan);\n        cell.span[XY[self.dimIdx]] = subSpan;\n        totalSpan += subSpan;\n        firstLeafLocator += subSpan;\n      });\n      return totalSpan;\n    }\n    function postInitCells() {\n      // Sort to make sure the leaves are at the beginning, so that\n      // they can be used as the locator of body cells.\n      var categories = [];\n      while (_cells.length < _cellCount) {\n        for (var locator = 0; locator < sameLocatorCellsLists.length; locator++) {\n          var cell = sameLocatorCellsLists[locator].pop();\n          if (cell) {\n            cell.ordinal = categories.length;\n            var val = cell.option.value;\n            categories.push(val);\n            _cells.push(cell);\n            self._uniqueValueGen.calcDupBase(val);\n          }\n        }\n      }\n      self._uniqueValueGen.ensureValueUnique(categories, _cells);\n      var ordinalMeta = self._ordinalMeta = new OrdinalMeta({\n        categories: categories,\n        needCollect: false,\n        deduplication: false\n      });\n      self._scale = new Ordinal({\n        ordinalMeta: ordinalMeta\n      });\n      for (var idx = 0; idx < self._leavesCount; idx++) {\n        var leaf = self._cells[idx];\n        leaf.type = MatrixCellLayoutInfoType.leaf;\n        // Handle the tree level variation: enlarge the span of the leaves to reach the body cells.\n        leaf.span[XY[1 - self.dimIdx]] = self._levels.length - leaf.level;\n      }\n      self._initCellsId();\n      self._initLevelIdOptions();\n    }\n  };\n  MatrixDim.prototype._initBySeriesData = function () {\n    var self = this;\n    self._leavesCount = 0;\n    self._levels = [{\n      type: MatrixCellLayoutInfoType.level,\n      xy: NaN,\n      wh: NaN,\n      option: null,\n      id: new Point(),\n      dim: self\n    }];\n    self._initLevelIdOptions();\n    var ordinalMeta = self._ordinalMeta = new OrdinalMeta({\n      needCollect: true,\n      deduplication: true,\n      onCollect: function (value, ordinalNumber) {\n        var cell = self._cells[ordinalNumber] = {\n          type: MatrixCellLayoutInfoType.leaf,\n          ordinal: ordinalNumber,\n          level: 0,\n          firstLeafLocator: ordinalNumber,\n          id: new Point(),\n          span: setDimXYValue(new Point(), self.dimIdx, 1, 1),\n          // Theoretically `value` is from `dataset` or `series.data`, so it may be any type.\n          // Do not restrict this case for user's convenience, and here simply convert it to\n          // string for display.\n          option: {\n            value: value + ''\n          },\n          xy: NaN,\n          wh: NaN,\n          dim: self,\n          rect: createNaNRectLike()\n        };\n        self._leavesCount++;\n        self._setCellId(cell);\n      }\n    });\n    self._scale = new Ordinal({\n      ordinalMeta: ordinalMeta\n    });\n  };\n  MatrixDim.prototype._setCellId = function (cell) {\n    var levelsLen = this._levels.length;\n    var dimIdx = this.dimIdx;\n    setDimXYValue(cell.id, dimIdx, cell.firstLeafLocator, cell.level - levelsLen);\n  };\n  MatrixDim.prototype._initCellsId = function () {\n    var levelsLen = this._levels.length;\n    var dimIdx = this.dimIdx;\n    each(this._cells, function (cell) {\n      setDimXYValue(cell.id, dimIdx, cell.firstLeafLocator, cell.level - levelsLen);\n    });\n  };\n  MatrixDim.prototype._initLevelIdOptions = function () {\n    var levelsLen = this._levels.length;\n    var dimIdx = this.dimIdx;\n    var levelOptionList = this._model.get('levels', true);\n    levelOptionList = isArray(levelOptionList) ? levelOptionList : [];\n    each(this._levels, function (levelCfg, level) {\n      setDimXYValue(levelCfg.id, dimIdx, 0, level - levelsLen);\n      levelCfg.option = levelOptionList[level];\n    });\n  };\n  MatrixDim.prototype.shouldShow = function () {\n    return !!this._model.getShallow('show', true);\n  };\n  /**\n   * Iterate leaves (they are layout units) if dimIdx === this.dimIdx.\n   * Iterate levels if dimIdx !== this.dimIdx.\n   */\n  MatrixDim.prototype.resetLayoutIterator = function (it, dimIdx, startLocator, count) {\n    it = it || new ListIterator();\n    if (dimIdx === this.dimIdx) {\n      var len = this._leavesCount;\n      var startIdx = startLocator != null ? Math.max(0, startLocator) : 0;\n      count = count != null ? Math.min(count, len) : len;\n      it.reset(this._cells, startIdx, startIdx + count);\n    } else {\n      var len = this._levels.length;\n      // Corner locator is from `-this._levels.length` to `-1`.\n      var startIdx = startLocator != null ? Math.max(0, startLocator + len) : 0;\n      count = count != null ? Math.min(count, len) : len;\n      it.reset(this._levels, startIdx, startIdx + count);\n    }\n    return it;\n  };\n  MatrixDim.prototype.resetCellIterator = function (it) {\n    return (it || new ListIterator()).reset(this._cells, 0);\n  };\n  MatrixDim.prototype.resetLevelIterator = function (it) {\n    return (it || new ListIterator()).reset(this._levels, 0);\n  };\n  MatrixDim.prototype.getLayout = function (outRect, dimIdx, locator) {\n    var layout = this.getUnitLayoutInfo(dimIdx, locator);\n    outRect[XY[dimIdx]] = layout ? layout.xy : NaN;\n    outRect[WH[dimIdx]] = layout ? layout.wh : NaN;\n  };\n  /**\n   * Get leaf cell or get level info.\n   * Should be able to return null/undefined if not found on x or y, thus input `dimIdx` is needed.\n   */\n  MatrixDim.prototype.getUnitLayoutInfo = function (dimIdx, locator) {\n    return dimIdx === this.dimIdx ? locator < this._leavesCount ? this._cells[locator] : undefined : this._levels[locator + this._levels.length];\n  };\n  /**\n   * Get dimension cell by data, including leaves and non-leaves.\n   */\n  MatrixDim.prototype.getCell = function (value) {\n    var ordinal = this._scale.parse(value);\n    return eqNaN(ordinal) ? undefined : this._cells[ordinal];\n  };\n  /**\n   * Get leaf count or get level count.\n   */\n  MatrixDim.prototype.getLocatorCount = function (dimIdx) {\n    return dimIdx === this.dimIdx ? this._leavesCount : this._levels.length;\n  };\n  MatrixDim.prototype.getOrdinalMeta = function () {\n    return this._ordinalMeta;\n  };\n  return MatrixDim;\n}();\nexport { MatrixDim };\nfunction createUniqueValueGenerator(dim) {\n  var dimUpper = dim.toUpperCase();\n  var defaultValReg = new RegExp(\"^\" + dimUpper + \"([0-9]+)$\");\n  var dupBase = 0;\n  function calcDupBase(val) {\n    var matchResult;\n    if (val != null && (matchResult = val.match(defaultValReg))) {\n      dupBase = mathMax(dupBase, +matchResult[1] + 1);\n    }\n  }\n  function makeUniqueValue() {\n    return \"\" + dimUpper + dupBase++;\n  }\n  // Duplicated value is allowed, because the `matrix.x/y.data` can be a tree and it's reasonable\n  // that leaves in different subtrees has the same text. But only the first one is allowed to be\n  // queried by the text, and the other ones can only be queried by index.\n  // Additionally, `matrix.x/y.data: [null, null, ...]` is allowed.\n  function ensureValueUnique(categories, cells) {\n    // A simple way to deduplicate or handle illegal or not specified values to avoid unexpected behaviors.\n    // The tree structure should not be broken even if duplicated.\n    var cateMap = createHashMap();\n    for (var idx = 0; idx < categories.length; idx++) {\n      var value = categories[idx];\n      // value may be set to NullUndefined by users or if illegal.\n      if (value == null || cateMap.get(value) != null) {\n        // Still display the original option.value if duplicated, but loose the ability to query by text.\n        categories[idx] = value = makeUniqueValue();\n        cells[idx].option = defaults({\n          value: value\n        }, cells[idx].option);\n      }\n      cateMap.set(value, true);\n    }\n  }\n  return {\n    calcDupBase: calcDupBase,\n    ensureValueUnique: ensureValueUnique\n  };\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { createHashMap, each, extend, isArray, isObject } from 'zrender/lib/core/util.js';\nimport { error } from '../../util/log.js';\nimport Point from 'zrender/lib/core/Point.js';\nimport { resolveXYLocatorRangeByCellMerge, MatrixClampOption, parseCoordRangeOption, fillIdSpanFromLocatorRange, createNaNRectLike, isXYLocatorRangeInvalidOnDim, resetXYLocatorRange, cloneXYLocatorRange } from './matrixCoordHelper.js';\n/**\n * Lifetime: the same with `MatrixModel`, but different from `coord/Matrix`.\n */\nvar MatrixBodyCorner = /** @class */function () {\n  function MatrixBodyCorner(kind, bodyOrCornerModel, dims) {\n    this._model = bodyOrCornerModel;\n    this._dims = dims;\n    this._kind = kind;\n    this._cellMergeOwnerList = [];\n  }\n  /**\n   * Can not be called before series models initialization finished, since the ordinalMeta may\n   * use collect the values from `series.data` in series initialization.\n   */\n  MatrixBodyCorner.prototype._ensureCellMap = function () {\n    var self = this;\n    var _cellMap = self._cellMap;\n    if (!_cellMap) {\n      _cellMap = self._cellMap = createHashMap();\n      fillCellMap();\n    }\n    return _cellMap;\n    function fillCellMap() {\n      var parsedList = [];\n      var cellOptionList = self._model.getShallow('data');\n      if (cellOptionList && !isArray(cellOptionList)) {\n        if (process.env.NODE_ENV !== 'production') {\n          error(\"matrix.\" + cellOptionList + \".data must be an array if specified.\");\n        }\n        cellOptionList = null;\n      }\n      each(cellOptionList, function (option, idx) {\n        if (!isObject(option) || !isArray(option.coord)) {\n          if (process.env.NODE_ENV !== 'production') {\n            error(\"Illegal matrix.\" + self._kind + \".data[\" + idx + \"], must be a {coord: [...], ...}\");\n          }\n          return;\n        }\n        var locatorRange = resetXYLocatorRange([]);\n        var reasonArr = null;\n        if (process.env.NODE_ENV !== 'production') {\n          reasonArr = [];\n        }\n        parseCoordRangeOption(locatorRange, reasonArr, option.coord, self._dims, option.coordClamp ? MatrixClampOption[self._kind] : MatrixClampOption.none);\n        if (isXYLocatorRangeInvalidOnDim(locatorRange, 0) || isXYLocatorRangeInvalidOnDim(locatorRange, 1)) {\n          if (process.env.NODE_ENV !== 'production') {\n            error(\"Can not determine cells by option matrix.\" + self._kind + \".data[\" + idx + \"]: \" + (\"\" + reasonArr.join(' ')));\n          }\n          return;\n        }\n        var cellMergeOwner = option && option.mergeCells;\n        var parsed = {\n          id: new Point(),\n          span: new Point(),\n          locatorRange: locatorRange,\n          option: option,\n          cellMergeOwner: cellMergeOwner\n        };\n        fillIdSpanFromLocatorRange(parsed, locatorRange);\n        // The order of the `parsedList` determines the precedence of the styles, if there\n        // are overlaps between ranges specified in different items. Preserve the original\n        // order of `matrix.body/corner/data` to make it predictable for users.\n        parsedList.push(parsed);\n      });\n      // Resolve cell merging intersection - union to a larger rect.\n      var mergedMarkList = [];\n      for (var parsedIdx = 0; parsedIdx < parsedList.length; parsedIdx++) {\n        var parsed = parsedList[parsedIdx];\n        if (!parsed.cellMergeOwner) {\n          continue;\n        }\n        var locatorRange = parsed.locatorRange;\n        resolveXYLocatorRangeByCellMerge(locatorRange, mergedMarkList, parsedList, parsedIdx);\n        for (var idx = 0; idx < parsedIdx; idx++) {\n          if (mergedMarkList[idx]) {\n            parsedList[idx].cellMergeOwner = false;\n          }\n        }\n        if (locatorRange[0][0] !== parsed.id.x || locatorRange[1][0] !== parsed.id.y) {\n          // The top-left cell of the unioned locatorRange is not this cell any more.\n          parsed.cellMergeOwner = false;\n          // Reconcile: simply use the last style and value option if multiple styles involved\n          // in a merged area, since there might be no commonly used merge strategy.\n          var newOption = extend({}, parsed.option);\n          newOption.coord = null;\n          var newParsed = {\n            id: new Point(),\n            span: new Point(),\n            locatorRange: locatorRange,\n            option: newOption,\n            cellMergeOwner: true\n          };\n          fillIdSpanFromLocatorRange(newParsed, locatorRange);\n          parsedList.push(newParsed);\n        }\n      }\n      // Assign options to cells.\n      each(parsedList, function (parsed) {\n        var topLeftCell = ensureBodyOrCornerCell(parsed.id.x, parsed.id.y);\n        if (parsed.cellMergeOwner) {\n          topLeftCell.cellMergeOwner = true;\n          topLeftCell.span = parsed.span;\n          topLeftCell.locatorRange = parsed.locatorRange;\n          topLeftCell.spanRect = createNaNRectLike();\n          self._cellMergeOwnerList.push(topLeftCell);\n        }\n        if (!parsed.cellMergeOwner && !parsed.option) {\n          return;\n        }\n        for (var yidx = 0; yidx < parsed.span.y; yidx++) {\n          for (var xidx = 0; xidx < parsed.span.x; xidx++) {\n            var cell = ensureBodyOrCornerCell(parsed.id.x + xidx, parsed.id.y + yidx);\n            // If multiple style options are defined on a cell, the later ones takes precedence.\n            cell.option = parsed.option;\n            if (parsed.cellMergeOwner) {\n              cell.inSpanOf = topLeftCell;\n            }\n          }\n        }\n      });\n    } // End of fillCellMap\n    function ensureBodyOrCornerCell(x, y) {\n      var key = makeCellMapKey(x, y);\n      var cell = _cellMap.get(key);\n      if (!cell) {\n        cell = _cellMap.set(key, {\n          id: new Point(x, y),\n          option: null,\n          inSpanOf: null,\n          span: null,\n          spanRect: null,\n          locatorRange: null,\n          cellMergeOwner: false\n        });\n      }\n      return cell;\n    }\n  };\n  /**\n   * Body cells or corner cell are not commonly defined specifically, especially in a large\n   * table, thus his is a sparse data structure - bodys or corner cells exist only if there\n   * are options specified to it (in `matrix.body.data` or `matrix.corner.data`);\n   * otherwise, return `NullUndefined`.\n   */\n  MatrixBodyCorner.prototype.getCell = function (xy) {\n    // Assert xy do not contain NaN\n    return this._ensureCellMap().get(makeCellMapKey(xy[0], xy[1]));\n  };\n  /**\n   * Only cell existing (has specific definition or props) will be travelled.\n   */\n  MatrixBodyCorner.prototype.travelExistingCells = function (cb) {\n    this._ensureCellMap().each(cb);\n  };\n  /**\n   * @param locatorRange Must be the return of `parseCoordRangeOption`.\n   */\n  MatrixBodyCorner.prototype.expandRangeByCellMerge = function (locatorRange) {\n    if (!isXYLocatorRangeInvalidOnDim(locatorRange, 0) && !isXYLocatorRangeInvalidOnDim(locatorRange, 1) && locatorRange[0][0] === locatorRange[0][1] && locatorRange[1][0] === locatorRange[1][1]) {\n      // If it locates to a single cell, use this quick path to avoid travelling.\n      // It is based on the fact that any cell is not contained by more than one cell merging rect.\n      _tmpERBCMLocator[0] = locatorRange[0][0];\n      _tmpERBCMLocator[1] = locatorRange[1][0];\n      var cell = this.getCell(_tmpERBCMLocator);\n      var inSpanOf = cell && cell.inSpanOf;\n      if (inSpanOf) {\n        cloneXYLocatorRange(locatorRange, inSpanOf.locatorRange);\n        return;\n      }\n    }\n    var list = this._cellMergeOwnerList;\n    resolveXYLocatorRangeByCellMerge(locatorRange, null, list, list.length);\n  };\n  return MatrixBodyCorner;\n}();\nexport { MatrixBodyCorner };\nvar _tmpERBCMLocator = [];\nfunction makeCellMapKey(x, y) {\n  return x + \"|\" + y;\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport ComponentModel from '../../model/Component.js';\nimport Model from '../../model/Model.js';\nimport { MatrixDim } from './MatrixDim.js';\nimport { MatrixBodyCorner } from './MatrixBodyCorner.js';\nimport tokens from '../../visual/tokens.js';\nvar defaultLabelOption = {\n  show: true,\n  color: tokens.color.secondary,\n  // overflow: 'truncate',\n  overflow: 'break',\n  lineOverflow: 'truncate',\n  padding: [2, 3, 2, 3],\n  // Prefer to use `padding`, rather than distance.\n  distance: 0\n};\nfunction makeDefaultCellItemStyleOption(isCorner) {\n  return {\n    color: 'none',\n    borderWidth: 1,\n    borderColor: isCorner ? 'none' : tokens.color.borderTint\n  };\n}\n;\nvar defaultDimOption = {\n  show: true,\n  label: defaultLabelOption,\n  itemStyle: makeDefaultCellItemStyleOption(false),\n  silent: undefined,\n  dividerLineStyle: {\n    width: 1,\n    color: tokens.color.border\n  }\n};\nvar defaultBodyOption = {\n  label: defaultLabelOption,\n  itemStyle: makeDefaultCellItemStyleOption(false),\n  silent: undefined\n};\nvar defaultCornerOption = {\n  label: defaultLabelOption,\n  itemStyle: makeDefaultCellItemStyleOption(true),\n  silent: undefined\n};\nvar defaultMatrixOption = {\n  // As a most basic coord sys, `z` should be lower than\n  // other series and coord sys, such as, grid.\n  z: -50,\n  left: '10%',\n  top: '10%',\n  right: '10%',\n  bottom: '10%',\n  x: defaultDimOption,\n  y: defaultDimOption,\n  body: defaultBodyOption,\n  corner: defaultCornerOption,\n  backgroundStyle: {\n    color: 'none',\n    borderColor: tokens.color.axisLine,\n    borderWidth: 1\n  }\n};\nvar MatrixModel = /** @class */function (_super) {\n  __extends(MatrixModel, _super);\n  function MatrixModel() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = MatrixModel.type;\n    return _this;\n  }\n  MatrixModel.prototype.optionUpdated = function () {\n    // Simply re-create all to follow model changes.\n    var dimModels = this._dimModels = {\n      // Do not use matrixModel as the parent model, for preventing from cascade-fetching options to it.\n      x: new MatrixDimensionModel(this.get('x', true) || {}),\n      y: new MatrixDimensionModel(this.get('y', true) || {})\n    };\n    dimModels.x.option.type = dimModels.y.option.type = 'category';\n    var xDim = dimModels.x.dim = new MatrixDim('x', dimModels.x);\n    var yDim = dimModels.y.dim = new MatrixDim('y', dimModels.y);\n    var dims = {\n      x: xDim,\n      y: yDim\n    };\n    this._body = new MatrixBodyCorner('body', new Model(this.getShallow('body')), dims);\n    this._corner = new MatrixBodyCorner('corner', new Model(this.getShallow('corner')), dims);\n  };\n  MatrixModel.prototype.getDimensionModel = function (dim) {\n    return this._dimModels[dim];\n  };\n  MatrixModel.prototype.getBody = function () {\n    return this._body;\n  };\n  MatrixModel.prototype.getCorner = function () {\n    return this._corner;\n  };\n  MatrixModel.type = 'matrix';\n  MatrixModel.layoutMode = 'box';\n  MatrixModel.defaultOption = defaultMatrixOption;\n  return MatrixModel;\n}(ComponentModel);\nvar MatrixDimensionModel = /** @class */function (_super) {\n  __extends(MatrixDimensionModel, _super);\n  function MatrixDimensionModel() {\n    return _super !== null && _super.apply(this, arguments) || this;\n  }\n  MatrixDimensionModel.prototype.getOrdinalMeta = function () {\n    return this.dim.getOrdinalMeta();\n  };\n  return MatrixDimensionModel;\n}(Model);\nexport { MatrixDimensionModel };\nexport default MatrixModel;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport ComponentView from '../../view/Component.js';\nimport Model from '../../model/Model.js';\nimport BoundingRect from 'zrender/lib/core/BoundingRect.js';\nimport * as vectorUtil from 'zrender/lib/core/vector.js';\nimport { subPixelOptimize } from 'zrender/lib/graphic/helper/subPixelOptimize.js';\nimport { Rect, Line, XY, setTooltipConfig, expandOrShrinkRect } from '../../util/graphic.js';\nimport { clearTmpModel, ListIterator } from '../../util/model.js';\nimport { clone, retrieve2 } from 'zrender/lib/core/util.js';\nimport { invert } from 'zrender/lib/core/matrix.js';\nimport { setLabelStyle } from '../../label/labelStyle.js';\nvar round = Math.round;\nvar Z2_BACKGROUND = 0;\nvar Z2_OUTER_BORDER = 99;\nvar Z2_BODY_CORNER_CELL_DEFAULT = {\n  normal: 25,\n  special: 100\n};\nvar Z2_DIMENSION_CELL_DEFAULT = {\n  normal: 50,\n  special: 125\n};\nvar MatrixView = /** @class */function (_super) {\n  __extends(MatrixView, _super);\n  function MatrixView() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = MatrixView.type;\n    return _this;\n  }\n  MatrixView.prototype.render = function (matrixModel, ecModel) {\n    this.group.removeAll();\n    var group = this.group;\n    var coordSys = matrixModel.coordinateSystem;\n    var rect = coordSys.getRect();\n    var xDimModel = matrixModel.getDimensionModel('x');\n    var yDimModel = matrixModel.getDimensionModel('y');\n    var xDim = xDimModel.dim;\n    var yDim = yDimModel.dim;\n    // PENDING:\n    //  reuse the existing text and rect elements for performance?\n    renderDimensionCells(group, matrixModel, ecModel);\n    createBodyAndCorner(group, matrixModel, xDim, yDim, ecModel);\n    var borderZ2Option = matrixModel.getShallow('borderZ2', true);\n    var outerBorderZ2 = retrieve2(borderZ2Option, Z2_OUTER_BORDER);\n    var dividerLineZ2 = outerBorderZ2 - 1;\n    // Outer border and overall background. Use separate elements because of z-order:\n    // The overall background should appear below any other elements.\n    // But in most cases, the outer border and the divider line should be above the normal cell borders -\n    // especially when cell borders have different colors. But users may highlight some specific cells by\n    // overstirking their border, in which case it should be above the outer border.\n    var bgStyle = matrixModel.getModel('backgroundStyle').getItemStyle(['borderWidth']);\n    bgStyle.lineWidth = 0;\n    var borderStyle = matrixModel.getModel('backgroundStyle').getItemStyle(['color', 'decal', 'shadowColor', 'shadowBlur', 'shadowOffsetX', 'shadowOffsetY']);\n    borderStyle.fill = 'none';\n    var bgRect = createMatrixRect(rect.clone(), bgStyle, Z2_BACKGROUND);\n    var borderRect = createMatrixRect(rect.clone(), borderStyle, outerBorderZ2);\n    bgRect.silent = true;\n    borderRect.silent = true;\n    group.add(bgRect);\n    group.add(borderRect);\n    // Header split line.\n    var xDimCell0 = xDim.getUnitLayoutInfo(0, 0);\n    var yDimCell0 = yDim.getUnitLayoutInfo(1, 0);\n    if (xDimCell0 && yDimCell0) {\n      if (xDim.shouldShow()) {\n        group.add(createMatrixLine({\n          x1: rect.x,\n          y1: yDimCell0.xy,\n          x2: rect.x + rect.width,\n          y2: yDimCell0.xy\n        }, xDimModel.getModel('dividerLineStyle').getLineStyle(), dividerLineZ2));\n      }\n      if (yDim.shouldShow()) {\n        group.add(createMatrixLine({\n          x1: xDimCell0.xy,\n          y1: rect.y,\n          x2: xDimCell0.xy,\n          y2: rect.y + rect.height\n        }, yDimModel.getModel('dividerLineStyle').getLineStyle(), dividerLineZ2));\n      }\n    }\n  };\n  MatrixView.type = 'matrix';\n  return MatrixView;\n}(ComponentView);\nfunction renderDimensionCells(group, matrixModel, ecModel) {\n  renderOnDimension(0);\n  renderOnDimension(1);\n  function renderOnDimension(dimIdx) {\n    var thisDimModel = matrixModel.getDimensionModel(XY[dimIdx]);\n    var thisDim = thisDimModel.dim;\n    if (!thisDim.shouldShow()) {\n      return;\n    }\n    var thisDimBgStyleModel = thisDimModel.getModel('itemStyle');\n    var thisDimLabelModel = thisDimModel.getModel('label');\n    var tooltipOption = matrixModel.getShallow('tooltip', true);\n    var xyLocator = [];\n    for (var it_1 = thisDim.resetCellIterator(); it_1.next();) {\n      var dimCell = it_1.item;\n      var shape = {};\n      BoundingRect.copy(shape, dimCell.rect);\n      vectorUtil.set(xyLocator, dimCell.id.x, dimCell.id.y);\n      createMatrixCell(xyLocator, matrixModel, group, ecModel, dimCell.option, thisDimBgStyleModel, thisDimLabelModel, thisDimModel, shape, dimCell.option.value, Z2_DIMENSION_CELL_DEFAULT, tooltipOption);\n    }\n  }\n}\nfunction createBodyAndCorner(group, matrixModel, xDim, yDim, ecModel) {\n  createBodyOrCornerCells('body', matrixModel.getBody(), xDim, yDim);\n  if (xDim.shouldShow() && yDim.shouldShow()) {\n    createBodyOrCornerCells('corner', matrixModel.getCorner(), yDim, xDim);\n  }\n  function createBodyOrCornerCells(bodyCornerOptionRoot, bodyOrCorner, dimForCoordX,\n  // Can be `matrix.y` (transposed) for corners.\n  dimForCoordY) {\n    // Prevent inheriting from ancestor.\n    var parentCellModel = new Model(matrixModel.getShallow(bodyCornerOptionRoot, true));\n    var parentItemStyleModel = parentCellModel.getModel('itemStyle');\n    var parentLabelModel = parentCellModel.getModel('label');\n    var itx = new ListIterator();\n    var ity = new ListIterator();\n    var xyLocator = [];\n    var tooltipOption = matrixModel.getShallow('tooltip', true);\n    for (dimForCoordY.resetLayoutIterator(ity, 1); ity.next();) {\n      for (dimForCoordX.resetLayoutIterator(itx, 0); itx.next();) {\n        var xLayout = itx.item;\n        var yLayout = ity.item;\n        vectorUtil.set(xyLocator, xLayout.id.x, yLayout.id.y);\n        var bodyCornerCell = bodyOrCorner.getCell(xyLocator);\n        // If in span of an other body or corner cell, never render it.\n        if (bodyCornerCell && bodyCornerCell.inSpanOf && bodyCornerCell.inSpanOf !== bodyCornerCell) {\n          continue;\n        }\n        var shape = {};\n        if (bodyCornerCell && bodyCornerCell.span) {\n          BoundingRect.copy(shape, bodyCornerCell.spanRect);\n        } else {\n          xLayout.dim.getLayout(shape, 0, xyLocator[0]);\n          yLayout.dim.getLayout(shape, 1, xyLocator[1]);\n        }\n        var bodyCornerCellOption = bodyCornerCell ? bodyCornerCell.option : null;\n        createMatrixCell(xyLocator, matrixModel, group, ecModel, bodyCornerCellOption, parentItemStyleModel, parentLabelModel, parentCellModel, shape, bodyCornerCellOption ? bodyCornerCellOption.value : null, Z2_BODY_CORNER_CELL_DEFAULT, tooltipOption);\n      }\n    }\n  } // End of createBodyOrCornerCells\n}\nfunction createMatrixCell(xyLocator, matrixModel, group, ecModel, cellOption, parentItemStyleModel, parentLabelModel, parentCellModel, shape, textValue, zrCellDefault, tooltipOption) {\n  var _a;\n  // Do not use getModel for handy performance optimization.\n  _tmpCellItemStyleModel.option = cellOption ? cellOption.itemStyle : null;\n  _tmpCellItemStyleModel.parentModel = parentItemStyleModel;\n  _tmpCellModel.option = cellOption;\n  _tmpCellModel.parentModel = parentCellModel;\n  // Use different z2 because special border may be defined in itemStyle.\n  var z2 = retrieve2(_tmpCellModel.getShallow('z2'), cellOption && cellOption.itemStyle ? zrCellDefault.special : zrCellDefault.normal);\n  var tooltipOptionShow = tooltipOption && tooltipOption.show;\n  var cellRect = createMatrixRect(shape, _tmpCellItemStyleModel.getItemStyle(), z2);\n  group.add(cellRect);\n  var cursorOption = _tmpCellModel.get('cursor');\n  if (cursorOption != null) {\n    cellRect.attr('cursor', cursorOption);\n  }\n  var cellText;\n  if (textValue != null) {\n    var text = textValue + '';\n    _tmpCellLabelModel.option = cellOption ? cellOption.label : null;\n    _tmpCellLabelModel.parentModel = parentLabelModel;\n    // This is to accept `option.textStyle` as the default.\n    _tmpCellLabelModel.ecModel = ecModel;\n    setLabelStyle(cellRect,\n    // Currently do not support other states (`emphasis`, `select`, `blur`)\n    {\n      normal: _tmpCellLabelModel\n    }, {\n      defaultText: text,\n      autoOverflowArea: true,\n      // By default based on boundingRect. But boundingRect contains borderWidth,\n      // and borderWidth is half outside the cell. Thus specific `layoutRect` explicitly.\n      layoutRect: clone(cellRect.shape)\n    });\n    cellText = cellRect.getTextContent();\n    if (cellText) {\n      cellText.z2 = z2 + 1;\n      var style = cellText.style;\n      if (style && style.overflow && style.overflow !== 'none' && style.lineOverflow) {\n        // `overflow: 'break'/'breakAll'/'truncate'` does not guarantee prevention of overflow\n        // when space is insufficient. Use a `clipPath` in such case.\n        var clipShape = {};\n        BoundingRect.copy(clipShape, shape);\n        // `lineWidth` is half outside half inside the bounding rect.\n        expandOrShrinkRect(clipShape, (((_a = cellRect.style) === null || _a === void 0 ? void 0 : _a.lineWidth) || 0) / 2, true, true);\n        cellRect.updateInnerText();\n        cellText.getLocalTransform(_tmpInnerTextTrans);\n        invert(_tmpInnerTextTrans, _tmpInnerTextTrans);\n        BoundingRect.applyTransform(clipShape, clipShape, _tmpInnerTextTrans);\n        cellText.setClipPath(new Rect({\n          shape: clipShape\n        }));\n      }\n    }\n    setTooltipConfig({\n      el: cellRect,\n      componentModel: matrixModel,\n      itemName: text,\n      itemTooltipOption: tooltipOption,\n      formatterParamsExtra: {\n        xyLocator: xyLocator.slice()\n      }\n    });\n  }\n  // Set silent\n  if (cellText) {\n    var labelSilent = _tmpCellLabelModel.get('silent');\n    // auto, tooltip of text cells need silient: false, but non-text cells\n    // do not need a special cursor in most cases.\n    if (labelSilent == null) {\n      labelSilent = !tooltipOptionShow;\n    }\n    cellText.silent = labelSilent;\n    cellText.ignoreHostSilent = true;\n  }\n  var rectSilent = _tmpCellModel.get('silent');\n  if (rectSilent == null) {\n    rectSilent =\n    // If no background color in cell, set `rect.silent: false` will cause that only\n    // the border response to mouse hovering, which is probably weird.\n    !cellRect.style || cellRect.style.fill === 'none' || !cellRect.style.fill;\n  }\n  cellRect.silent = rectSilent;\n  clearTmpModel(_tmpCellModel);\n  clearTmpModel(_tmpCellItemStyleModel);\n  clearTmpModel(_tmpCellLabelModel);\n}\nvar _tmpCellModel = new Model();\nvar _tmpCellItemStyleModel = new Model();\nvar _tmpCellLabelModel = new Model();\nvar _tmpInnerTextTrans = [];\n// FIXME: move all of the subpixel process to Matrix.ts resize, otherwise the result of\n// `dataToLayout` is not consistent with this rendering, and the caller (like heatmap) can\n// not precisely align with the matrix border.\nfunction createMatrixRect(shape, style, z2) {\n  // Currently `subPixelOptimizeRect` can not be used here because it will break rect alignment.\n  // Optimize line and rect with the same direction.\n  var lineWidth = style.lineWidth;\n  if (lineWidth) {\n    var x2Original = shape.x + shape.width;\n    var y2Original = shape.y + shape.height;\n    shape.x = subPixelOptimize(shape.x, lineWidth, true);\n    shape.y = subPixelOptimize(shape.y, lineWidth, true);\n    shape.width = subPixelOptimize(x2Original, lineWidth, true) - shape.x;\n    shape.height = subPixelOptimize(y2Original, lineWidth, true) - shape.y;\n  }\n  return new Rect({\n    shape: shape,\n    style: style,\n    z2: z2\n  });\n}\nfunction createMatrixLine(shape, style, z2) {\n  var lineWidth = style.lineWidth;\n  if (lineWidth) {\n    if (round(shape.x1 * 2) === round(shape.x2 * 2)) {\n      shape.x1 = shape.x2 = subPixelOptimize(shape.x1, lineWidth, true);\n    }\n    if (round(shape.y1 * 2) === round(shape.y2 * 2)) {\n      shape.y1 = shape.y2 = subPixelOptimize(shape.y1, lineWidth, true);\n    }\n  }\n  return new Line({\n    shape: shape,\n    style: style,\n    silent: true,\n    z2: z2\n  });\n}\nexport default MatrixView;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { getLayoutRect } from '../../util/layout.js';\nimport { ListIterator } from '../../util/model.js';\nimport { eqNaN, isArray, retrieve2 } from 'zrender/lib/core/util.js';\nimport { WH, XY } from '../../util/graphic.js';\nimport Model from '../../model/Model.js';\nimport { mathMax, mathMin, parsePositionSizeOption } from '../../util/number.js';\nimport { createNaNRectLike, MatrixClampOption, MatrixCellLayoutInfoType, parseCoordRangeOption, resetXYLocatorRange, xyLocatorRangeToRectOneDim } from './matrixCoordHelper.js';\nimport { error } from '../../util/log.js';\nimport { injectCoordSysByOption, simpleCoordSysInjectionProvider } from '../../core/CoordinateSystem.js';\nvar Matrix = /** @class */function () {\n  function Matrix(matrixModel, ecModel, api) {\n    this.dimensions = Matrix.dimensions;\n    this.type = 'matrix';\n    this._model = matrixModel;\n    var models = this._dimModels = {\n      x: matrixModel.getDimensionModel('x'),\n      y: matrixModel.getDimensionModel('y')\n    };\n    this._dims = {\n      x: models.x.dim,\n      y: models.y.dim\n    };\n    this._resize(matrixModel, api);\n  }\n  /**\n   * @see fetchers in `model/referHelper.ts`,\n   * which is used to parse data in ordinal way.\n   * In most series only 'x' and 'y' is required,\n   * but some series, such as heatmap, can specify value.\n   */\n  Matrix.getDimensionsInfo = function () {\n    return [{\n      name: 'x',\n      type: 'ordinal'\n    }, {\n      name: 'y',\n      type: 'ordinal'\n    }, {\n      name: 'value'\n    }];\n  };\n  Matrix.create = function (ecModel, api) {\n    var matrixList = [];\n    ecModel.eachComponent('matrix', function (matrixModel) {\n      var matrix = new Matrix(matrixModel, ecModel, api);\n      matrixList.push(matrix);\n      matrixModel.coordinateSystem = matrix;\n    });\n    // Inject coordinate system\n    // PENDING: optimize to not to travel all components?\n    //  (collect relevant components in ecModel only when model update?)\n    ecModel.eachComponent(function (mainType, componentModel) {\n      injectCoordSysByOption({\n        targetModel: componentModel,\n        coordSysType: 'matrix',\n        coordSysProvider: simpleCoordSysInjectionProvider\n      });\n    });\n    return matrixList;\n  };\n  Matrix.prototype.getRect = function () {\n    return this._rect;\n  };\n  Matrix.prototype._resize = function (matrixModel, api) {\n    var dims = this._dims;\n    var dimModels = this._dimModels;\n    var rect = this._rect = getLayoutRect(matrixModel.getBoxLayoutParams(), {\n      width: api.getWidth(),\n      height: api.getHeight()\n    });\n    layOutUnitsOnDimension(dimModels, dims, rect, 0);\n    layOutUnitsOnDimension(dimModels, dims, rect, 1);\n    layOutDimCellsRestInfoByUnit(0, dims);\n    layOutDimCellsRestInfoByUnit(1, dims);\n    layOutBodyCornerCellMerge(this._model.getBody(), dims);\n    layOutBodyCornerCellMerge(this._model.getCorner(), dims);\n  };\n  /**\n   * @implement\n   * - The input is allowed to be `[NaN/null/undefined, xxx]`/`[xxx, NaN/null/undefined]`;\n   *  the return is `[NaN, xxxresult]`/`[xxxresult, NaN]` or clamped boundary value if\n   *  `clamp` passed. This is for the usage that only get coord on single x or y.\n   * - Alwasy return an numeric array, but never be null/undefined.\n   *  If it can not be located or invalid, return `[NaN, NaN]`.\n   */\n  Matrix.prototype.dataToPoint = function (data, opt, out) {\n    out = out || [];\n    this.dataToLayout(data, opt, _dtpOutDataToLayout);\n    out[0] = _dtpOutDataToLayout.rect.x + _dtpOutDataToLayout.rect.width / 2;\n    out[1] = _dtpOutDataToLayout.rect.y + _dtpOutDataToLayout.rect.height / 2;\n    return out;\n  };\n  /**\n   * @implement\n   * - The input is allowed to be `[NaN/null/undefined, xxx]`/`[xxx, NaN/null/undefined]`;\n   *  the return is `{x: NaN, width: NaN, y: xxxresulty, height: xxxresulth}`/\n   *  `{y: NaN, height: NaN, x: xxxresultx, width: xxxresultw}` or clamped boundary value\n   *  if `clamp` passed. This is for the usage that only get coord on single x or y.\n   * - The returned `out.rect` and `out.matrixXYLocatorRange` is always an object or an 2d-array,\n   *  but never be null/undefined. If it cannot be located or invalid, `NaN` is in their\n   *  corresponding number props.\n   * - Do not provide `out.contentRect`, because it's allowed to input non-leaf dimension x/y or\n   *  a range of x/y, which determines a rect covering multiple cells (even not merged), in which\n   *  case the padding and borderWidth can not be determined to make a contentRect. Therefore only\n   *  return `out.rect` in any case for consistency. The caller is responsible for adding space to\n   *  avoid covering cell borders, if necessary.\n   */\n  Matrix.prototype.dataToLayout = function (data, opt, out) {\n    var dims = this._dims;\n    out = out || {};\n    var outRect = out.rect = out.rect || {};\n    outRect.x = outRect.y = outRect.width = outRect.height = NaN;\n    var outLocRange = out.matrixXYLocatorRange = resetXYLocatorRange(out.matrixXYLocatorRange);\n    if (!isArray(data)) {\n      if (process.env.NODE_ENV !== 'production') {\n        error('Input data must be an array in `convertToLayout`, `convertToPixel`');\n      }\n      return out;\n    }\n    parseCoordRangeOption(outLocRange, null, data, dims, retrieve2(opt && opt.clamp, MatrixClampOption.none));\n    if (!opt || !opt.ignoreMergeCells) {\n      if (!opt || opt.clamp !== MatrixClampOption.corner) {\n        this._model.getBody().expandRangeByCellMerge(outLocRange);\n      }\n      if (!opt || opt.clamp !== MatrixClampOption.body) {\n        this._model.getCorner().expandRangeByCellMerge(outLocRange);\n      }\n    }\n    xyLocatorRangeToRectOneDim(outRect, outLocRange, dims, 0);\n    xyLocatorRangeToRectOneDim(outRect, outLocRange, dims, 1);\n    return out;\n  };\n  /**\n   * The returned locator pair can be the input of `dataToPoint` or `dataToLayout`.\n   *\n   * If point[0] is out of the matrix rect,\n   *  the out[0] is NaN;\n   * else if it is on the right of top-left corner of body,\n   *  the out[0] is the oridinal number (>= 0).\n   * else\n   *  out[0] is the locator for corner or header (<= 0).\n   *\n   * The same rule goes for point[1] and out[1].\n   *\n   * But point[0] and point[1] are calculated separately, i.e.,\n   * the reuslt can be `[1, NaN]` or `[NaN, 1]` if only one dimension is out of boundary.\n   *\n   * @implement\n   */\n  Matrix.prototype.pointToData = function (point, opt, out) {\n    var dims = this._dims;\n    pointToDataOneDimPrepareCtx(_tmpCtxPointToData, 0, dims, point, opt && opt.clamp);\n    pointToDataOneDimPrepareCtx(_tmpCtxPointToData, 1, dims, point, opt && opt.clamp);\n    out = out || [];\n    out[0] = out[1] = NaN;\n    if (_tmpCtxPointToData.y === CtxPointToDataAreaType.inCorner && _tmpCtxPointToData.x === CtxPointToDataAreaType.inBody) {\n      pointToDataOnlyHeaderFillOut(_tmpCtxPointToData, out, 0, dims);\n    } else if (_tmpCtxPointToData.x === CtxPointToDataAreaType.inCorner && _tmpCtxPointToData.y === CtxPointToDataAreaType.inBody) {\n      pointToDataOnlyHeaderFillOut(_tmpCtxPointToData, out, 1, dims);\n    } else {\n      pointToDataBodyCornerFillOut(_tmpCtxPointToData, out, 0, dims);\n      pointToDataBodyCornerFillOut(_tmpCtxPointToData, out, 1, dims);\n    }\n    return out;\n  };\n  Matrix.prototype.convertToPixel = function (ecModel, finder, value, opt) {\n    var coordSys = getCoordSys(finder);\n    return coordSys === this ? coordSys.dataToPoint(value, opt) : undefined;\n  };\n  Matrix.prototype.convertToLayout = function (ecModel, finder, value, opt) {\n    var coordSys = getCoordSys(finder);\n    return coordSys === this ? coordSys.dataToLayout(value, opt) : undefined;\n  };\n  Matrix.prototype.convertFromPixel = function (ecModel, finder, pixel, opt) {\n    var coordSys = getCoordSys(finder);\n    return coordSys === this ? coordSys.pointToData(pixel, opt) : undefined;\n  };\n  Matrix.prototype.containPoint = function (point) {\n    return this._rect.contain(point[0], point[1]);\n  };\n  Matrix.dimensions = ['x', 'y', 'value'];\n  return Matrix;\n}();\nvar _dtpOutDataToLayout = {\n  rect: createNaNRectLike()\n};\nvar _ptdLevelIt = new ListIterator();\nvar _ptdDimCellIt = new ListIterator();\nfunction layOutUnitsOnDimension(dimModels, dims, matrixRect, dimIdx) {\n  var otherDimIdx = 1 - dimIdx;\n  var thisDim = dims[XY[dimIdx]];\n  var otherDim = dims[XY[otherDimIdx]];\n  // Notice: If matrix.x/y.show is false, still lay out, to ensure the\n  // consistent return of `dataToLayout`.\n  var otherDimShow = otherDim.shouldShow();\n  // Reset\n  for (var it_1 = thisDim.resetCellIterator(); it_1.next();) {\n    it_1.item.wh = it_1.item.xy = NaN;\n  }\n  for (var it_2 = otherDim.resetLayoutIterator(null, dimIdx); it_2.next();) {\n    it_2.item.wh = it_2.item.xy = NaN;\n  }\n  // Set specified size from option.\n  var restSize = matrixRect[WH[dimIdx]];\n  var restCellsCount = thisDim.getLocatorCount(dimIdx) + otherDim.getLocatorCount(dimIdx);\n  var tmpLevelModel = new Model();\n  for (var it_3 = otherDim.resetLevelIterator(); it_3.next();) {\n    // Consider `matrix.x.levelSize` and `matrix.x.levels[i].levelSize`.\n    tmpLevelModel.option = it_3.item.option;\n    tmpLevelModel.parentModel = dimModels[XY[otherDimIdx]];\n    layOutSpecified(it_3.item, otherDimShow ? tmpLevelModel.get('levelSize') : 0);\n  }\n  var tmpCellModel = new Model();\n  for (var it_4 = thisDim.resetCellIterator(); it_4.next();) {\n    // Only leaf support size specification, to avoid unnecessary complexity.\n    if (it_4.item.type === MatrixCellLayoutInfoType.leaf) {\n      tmpCellModel.option = it_4.item.option;\n      tmpCellModel.parentModel = undefined;\n      layOutSpecified(it_4.item, tmpCellModel.get('size'));\n    }\n  }\n  function layOutSpecified(item, sizeOption) {\n    var size = parseSizeOption(sizeOption, dimIdx, matrixRect);\n    if (!eqNaN(size)) {\n      item.wh = confineSize(size, restSize);\n      restSize = confineSize(restSize - item.wh);\n      restCellsCount--;\n    }\n  }\n  // Set all sizes and positions to levels and leaf cells of which size is unspecified.\n  // Contents lay out based on matrix, rather than inverse; therefore do not support\n  // calculating size based on content, but allocate equally.\n  var computedCellWH = restCellsCount ? restSize / restCellsCount : 0;\n  // If all size specified, but some space remain (may also caused by matrix.x/y.show: false)\n  // do not align to the big most edge.\n  var notAlignToBigmost = !restCellsCount && restSize >= 1; // `1` for cumulative precision error.\n  var currXY = matrixRect[XY[dimIdx]];\n  var maxLocator = thisDim.getLocatorCount(dimIdx) - 1;\n  var it = new ListIterator();\n  // Lay out levels of the perpendicular dim.\n  for (otherDim.resetLayoutIterator(it, dimIdx); it.next();) {\n    layOutUnspecified(it.item);\n  }\n  for (thisDim.resetLayoutIterator(it, dimIdx); it.next();) {\n    layOutUnspecified(it.item);\n  }\n  function layOutUnspecified(item) {\n    if (eqNaN(item.wh)) {\n      item.wh = computedCellWH;\n    }\n    item.xy = currXY;\n    if (item.id[XY[dimIdx]] === maxLocator && !notAlignToBigmost) {\n      // Align to the rightmost border, consider cumulative precision error.\n      item.wh = matrixRect[XY[dimIdx]] + matrixRect[WH[dimIdx]] - item.xy;\n    }\n    currXY += item.wh;\n  }\n}\nfunction layOutDimCellsRestInfoByUnit(dimIdx, dims) {\n  // Finally save layout info based on the unit leaves and levels.\n  for (var it_5 = dims[XY[dimIdx]].resetCellIterator(); it_5.next();) {\n    var dimCell = it_5.item;\n    layOutRectOneDimBasedOnUnit(dimCell.rect, dimIdx, dimCell.id, dimCell.span, dims);\n    // Consider level varitation on tree leaves, should extend the size to touch matrix body\n    // to avoid weird appearance.\n    layOutRectOneDimBasedOnUnit(dimCell.rect, 1 - dimIdx, dimCell.id, dimCell.span, dims);\n    if (dimCell.type === MatrixCellLayoutInfoType.nonLeaf) {\n      // `xy` and `wh` need to be saved in non-leaf since it supports locating by non-leaf\n      // in `dataToPoint` or `dataToLayout`.\n      dimCell.xy = dimCell.rect[XY[dimIdx]];\n      dimCell.wh = dimCell.rect[WH[dimIdx]];\n    }\n  }\n}\nfunction layOutBodyCornerCellMerge(bodyOrCorner, dims) {\n  bodyOrCorner.travelExistingCells(function (cell) {\n    var computedSpan = cell.span;\n    if (computedSpan) {\n      var layoutRect = cell.spanRect;\n      var id = cell.id;\n      layOutRectOneDimBasedOnUnit(layoutRect, 0, id, computedSpan, dims);\n      layOutRectOneDimBasedOnUnit(layoutRect, 1, id, computedSpan, dims);\n    }\n  });\n}\n// Save to rect for rendering.\nfunction layOutRectOneDimBasedOnUnit(outRect, dimIdx, id, span, dims) {\n  outRect[WH[dimIdx]] = 0;\n  var locator = id[XY[dimIdx]];\n  var dim = locator < 0 ? dims[XY[1 - dimIdx]] : dims[XY[dimIdx]];\n  var layoutUnit = dim.getUnitLayoutInfo(dimIdx, id[XY[dimIdx]]);\n  outRect[XY[dimIdx]] = layoutUnit.xy;\n  outRect[WH[dimIdx]] = layoutUnit.wh;\n  if (span[XY[dimIdx]] > 1) {\n    var layoutUnit2 = dim.getUnitLayoutInfo(dimIdx, id[XY[dimIdx]] + span[XY[dimIdx]] - 1);\n    // Be careful the cumulative error - cell must be aligned.\n    outRect[WH[dimIdx]] = layoutUnit2.xy + layoutUnit2.wh - layoutUnit.xy;\n  }\n}\n/**\n * Return NaN if not defined or invalid.\n */\nfunction parseSizeOption(sizeOption, dimIdx, matrixRect) {\n  var sizeNum = parsePositionSizeOption(sizeOption, matrixRect[WH[dimIdx]]);\n  return confineSize(sizeNum, matrixRect[WH[dimIdx]]);\n}\nfunction confineSize(sizeNum, sizeLimit) {\n  return Math.max(Math.min(sizeNum, retrieve2(sizeLimit, Infinity)), 0);\n}\nfunction getCoordSys(finder) {\n  var matrixModel = finder.matrixModel;\n  var seriesModel = finder.seriesModel;\n  var coordSys = matrixModel ? matrixModel.coordinateSystem : seriesModel ? seriesModel.coordinateSystem : null;\n  return coordSys;\n}\nvar CtxPointToDataAreaType = {\n  inBody: 1,\n  inCorner: 2,\n  outside: 3\n};\n// For handy performance optimization in pointToData.\nvar _tmpCtxPointToData = {\n  x: null,\n  y: null,\n  point: []\n};\nfunction pointToDataOneDimPrepareCtx(ctx, dimIdx, dims, point, clamp) {\n  var thisDim = dims[XY[dimIdx]];\n  var otherDim = dims[XY[1 - dimIdx]];\n  // Notice: considered cases: `matrix.x/y.show: false`, `matrix.x/y.data` is empty.\n  // In this cases the `layout.xy` is on the edge and `layout.wh` is `0`; they still can be\n  // use to calculate clampping.\n  var bodyMaxUnit = thisDim.getUnitLayoutInfo(dimIdx, thisDim.getLocatorCount(dimIdx) - 1);\n  var body0Unit = thisDim.getUnitLayoutInfo(dimIdx, 0);\n  var cornerMinUnit = otherDim.getUnitLayoutInfo(dimIdx, -otherDim.getLocatorCount(dimIdx));\n  var cornerMinus1Unit = otherDim.shouldShow() ? otherDim.getUnitLayoutInfo(dimIdx, -1) : null;\n  var coord = ctx.point[dimIdx] = point[dimIdx]; // Transfer the oridinal coord.\n  if (!body0Unit && !cornerMinus1Unit) {\n    ctx[XY[dimIdx]] = CtxPointToDataAreaType.outside;\n    return;\n  }\n  if (clamp === MatrixClampOption.body) {\n    if (body0Unit) {\n      ctx[XY[dimIdx]] = CtxPointToDataAreaType.inBody;\n      coord = mathMin(bodyMaxUnit.xy + bodyMaxUnit.wh, mathMax(body0Unit.xy, coord));\n      ctx.point[dimIdx] = coord;\n    } else {\n      // If clamp to body, the result must not be in header.\n      ctx[XY[dimIdx]] = CtxPointToDataAreaType.outside;\n    }\n    return;\n  } else if (clamp === MatrixClampOption.corner) {\n    if (cornerMinus1Unit) {\n      ctx[XY[dimIdx]] = CtxPointToDataAreaType.inCorner;\n      coord = mathMin(cornerMinus1Unit.xy + cornerMinus1Unit.wh, mathMax(cornerMinUnit.xy, coord));\n      ctx.point[dimIdx] = coord;\n    } else {\n      // If clamp to corner, the result must not be in body.\n      ctx[XY[dimIdx]] = CtxPointToDataAreaType.outside;\n    }\n    return;\n  }\n  var pxLoc0 = body0Unit ? body0Unit.xy : cornerMinus1Unit ? cornerMinus1Unit.xy + cornerMinus1Unit.wh : NaN;\n  var pxMin = cornerMinUnit ? cornerMinUnit.xy : pxLoc0;\n  var pxMax = bodyMaxUnit ? bodyMaxUnit.xy + bodyMaxUnit.wh : pxLoc0;\n  if (coord < pxMin) {\n    if (!clamp) {\n      // Quick pass for later calc, since mouse event on any place will enter this method if use `pointToData`.\n      ctx[XY[dimIdx]] = CtxPointToDataAreaType.outside;\n      return;\n    }\n    coord = pxMin;\n  } else if (coord > pxMax) {\n    if (!clamp) {\n      ctx[XY[dimIdx]] = CtxPointToDataAreaType.outside;\n      return;\n    }\n    coord = pxMax;\n  }\n  ctx.point[dimIdx] = coord; // Save the updated coord.\n  ctx[XY[dimIdx]] = pxLoc0 <= coord && coord <= pxMax ? CtxPointToDataAreaType.inBody : pxMin <= coord && coord <= pxLoc0 ? CtxPointToDataAreaType.inCorner : CtxPointToDataAreaType.outside;\n  // Every props in ctx must be set in every branch of this method.\n}\n// Assume partialOut has been set to NaN outside.\n// This method may fill out[0] and out[1] in one call.\nfunction pointToDataOnlyHeaderFillOut(ctx, partialOut, dimIdx, dims) {\n  var otherDimIdx = 1 - dimIdx;\n  if (ctx[XY[dimIdx]] === CtxPointToDataAreaType.outside) {\n    return;\n  }\n  for (dims[XY[dimIdx]].resetCellIterator(_ptdDimCellIt); _ptdDimCellIt.next();) {\n    var cell = _ptdDimCellIt.item;\n    if (isCoordInRect(ctx.point[dimIdx], cell.rect, dimIdx) && isCoordInRect(ctx.point[otherDimIdx], cell.rect, otherDimIdx)) {\n      // non-leaves are also allowed to be located.\n      // If the point is in x or y dimension cell area, should check both x and y coord to\n      // determine a cell; in this way a non-leaf cell can be determined.\n      partialOut[dimIdx] = cell.ordinal;\n      partialOut[otherDimIdx] = cell.id[XY[otherDimIdx]];\n      return;\n    }\n  }\n}\n// Assume partialOut has been set to NaN outside.\n// This method may fill out[0] and out[1] in one call.\nfunction pointToDataBodyCornerFillOut(ctx, partialOut, dimIdx, dims) {\n  if (ctx[XY[dimIdx]] === CtxPointToDataAreaType.outside) {\n    return;\n  }\n  var dim = ctx[XY[dimIdx]] === CtxPointToDataAreaType.inCorner ? dims[XY[1 - dimIdx]] : dims[XY[dimIdx]];\n  for (dim.resetLayoutIterator(_ptdLevelIt, dimIdx); _ptdLevelIt.next();) {\n    if (isCoordInLayoutInfo(ctx.point[dimIdx], _ptdLevelIt.item)) {\n      partialOut[dimIdx] = _ptdLevelIt.item.id[XY[dimIdx]];\n      return;\n    }\n  }\n}\nfunction isCoordInLayoutInfo(coord, cell) {\n  return cell.xy <= coord && coord <= cell.xy + cell.wh;\n}\nfunction isCoordInRect(coord, rect, dimIdx) {\n  return rect[XY[dimIdx]] <= coord && coord <= rect[XY[dimIdx]] + rect[WH[dimIdx]];\n}\nexport default Matrix;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport MatrixModel from '../../coord/matrix/MatrixModel.js';\nimport MatrixView from './MatrixView.js';\nimport Matrix from '../../coord/matrix/Matrix.js';\nexport function install(registers) {\n  registers.registerComponentModel(MatrixModel);\n  registers.registerComponentView(MatrixView);\n  registers.registerCoordinateSystem('matrix', Matrix);\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as modelUtil from '../../util/model.js';\nimport ComponentModel from '../../model/Component.js';\nimport { copyLayoutParams, mergeLayoutParam } from '../../util/layout.js';\n;\n;\n;\nexport function setKeyInfoToNewElOption(resultItem, newElOption) {\n  var existElOption = resultItem.existing;\n  // Set id and type after id assigned.\n  newElOption.id = resultItem.keyInfo.id;\n  !newElOption.type && existElOption && (newElOption.type = existElOption.type);\n  // Set parent id if not specified\n  if (newElOption.parentId == null) {\n    var newElParentOption = newElOption.parentOption;\n    if (newElParentOption) {\n      newElOption.parentId = newElParentOption.id;\n    } else if (existElOption) {\n      newElOption.parentId = existElOption.parentId;\n    }\n  }\n  // Clear\n  newElOption.parentOption = null;\n}\nfunction isSetLoc(obj, props) {\n  var isSet;\n  zrUtil.each(props, function (prop) {\n    obj[prop] != null && obj[prop] !== 'auto' && (isSet = true);\n  });\n  return isSet;\n}\nfunction mergeNewElOptionToExist(existList, index, newElOption) {\n  // Update existing options, for `getOption` feature.\n  var newElOptCopy = zrUtil.extend({}, newElOption);\n  var existElOption = existList[index];\n  var $action = newElOption.$action || 'merge';\n  if ($action === 'merge') {\n    if (existElOption) {\n      if (process.env.NODE_ENV !== 'production') {\n        var newType = newElOption.type;\n        zrUtil.assert(!newType || existElOption.type === newType, 'Please set $action: \"replace\" to change `type`');\n      }\n      // We can ensure that newElOptCopy and existElOption are not\n      // the same object, so `merge` will not change newElOptCopy.\n      zrUtil.merge(existElOption, newElOptCopy, true);\n      // Rigid body, use ignoreSize.\n      mergeLayoutParam(existElOption, newElOptCopy, {\n        ignoreSize: true\n      });\n      // Will be used in render.\n      copyLayoutParams(newElOption, existElOption);\n      // Copy transition info to new option so it can be used in the transition.\n      // DO IT AFTER merge\n      copyTransitionInfo(newElOption, existElOption);\n      copyTransitionInfo(newElOption, existElOption, 'shape');\n      copyTransitionInfo(newElOption, existElOption, 'style');\n      copyTransitionInfo(newElOption, existElOption, 'extra');\n      // Copy clipPath\n      newElOption.clipPath = existElOption.clipPath;\n    } else {\n      existList[index] = newElOptCopy;\n    }\n  } else if ($action === 'replace') {\n    existList[index] = newElOptCopy;\n  } else if ($action === 'remove') {\n    // null will be cleaned later.\n    existElOption && (existList[index] = null);\n  }\n}\nvar TRANSITION_PROPS_TO_COPY = ['transition', 'enterFrom', 'leaveTo'];\nvar ROOT_TRANSITION_PROPS_TO_COPY = TRANSITION_PROPS_TO_COPY.concat(['enterAnimation', 'updateAnimation', 'leaveAnimation']);\nfunction copyTransitionInfo(target, source, targetProp) {\n  if (targetProp) {\n    if (!target[targetProp] && source[targetProp]) {\n      // TODO avoid creating this empty object when there is no transition configuration.\n      target[targetProp] = {};\n    }\n    target = target[targetProp];\n    source = source[targetProp];\n  }\n  if (!target || !source) {\n    return;\n  }\n  var props = targetProp ? TRANSITION_PROPS_TO_COPY : ROOT_TRANSITION_PROPS_TO_COPY;\n  for (var i = 0; i < props.length; i++) {\n    var prop = props[i];\n    if (target[prop] == null && source[prop] != null) {\n      target[prop] = source[prop];\n    }\n  }\n}\nfunction setLayoutInfoToExist(existItem, newElOption) {\n  if (!existItem) {\n    return;\n  }\n  existItem.hv = newElOption.hv = [\n  // Rigid body, don't care about `width`.\n  isSetLoc(newElOption, ['left', 'right']),\n  // Rigid body, don't care about `height`.\n  isSetLoc(newElOption, ['top', 'bottom'])];\n  // Give default group size. Otherwise layout error may occur.\n  if (existItem.type === 'group') {\n    var existingGroupOpt = existItem;\n    var newGroupOpt = newElOption;\n    existingGroupOpt.width == null && (existingGroupOpt.width = newGroupOpt.width = 0);\n    existingGroupOpt.height == null && (existingGroupOpt.height = newGroupOpt.height = 0);\n  }\n}\nvar GraphicComponentModel = /** @class */function (_super) {\n  __extends(GraphicComponentModel, _super);\n  function GraphicComponentModel() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = GraphicComponentModel.type;\n    _this.preventAutoZ = true;\n    return _this;\n  }\n  GraphicComponentModel.prototype.mergeOption = function (option, ecModel) {\n    // Prevent default merge to elements\n    var elements = this.option.elements;\n    this.option.elements = null;\n    _super.prototype.mergeOption.call(this, option, ecModel);\n    this.option.elements = elements;\n  };\n  GraphicComponentModel.prototype.optionUpdated = function (newOption, isInit) {\n    var thisOption = this.option;\n    var newList = (isInit ? thisOption : newOption).elements;\n    var existList = thisOption.elements = isInit ? [] : thisOption.elements;\n    var flattenedList = [];\n    this._flatten(newList, flattenedList, null);\n    var mappingResult = modelUtil.mappingToExists(existList, flattenedList, 'normalMerge');\n    // Clear elOptionsToUpdate\n    var elOptionsToUpdate = this._elOptionsToUpdate = [];\n    zrUtil.each(mappingResult, function (resultItem, index) {\n      var newElOption = resultItem.newOption;\n      if (process.env.NODE_ENV !== 'production') {\n        zrUtil.assert(zrUtil.isObject(newElOption) || resultItem.existing, 'Empty graphic option definition');\n      }\n      if (!newElOption) {\n        return;\n      }\n      elOptionsToUpdate.push(newElOption);\n      setKeyInfoToNewElOption(resultItem, newElOption);\n      mergeNewElOptionToExist(existList, index, newElOption);\n      setLayoutInfoToExist(existList[index], newElOption);\n    }, this);\n    // Clean\n    thisOption.elements = zrUtil.filter(existList, function (item) {\n      // $action should be volatile, otherwise option gotten from\n      // `getOption` will contain unexpected $action.\n      item && delete item.$action;\n      return item != null;\n    });\n  };\n  /**\n   * Convert\n   * [{\n   *  type: 'group',\n   *  id: 'xx',\n   *  children: [{type: 'circle'}, {type: 'polygon'}]\n   * }]\n   * to\n   * [\n   *  {type: 'group', id: 'xx'},\n   *  {type: 'circle', parentId: 'xx'},\n   *  {type: 'polygon', parentId: 'xx'}\n   * ]\n   */\n  GraphicComponentModel.prototype._flatten = function (optionList, result, parentOption) {\n    zrUtil.each(optionList, function (option) {\n      if (!option) {\n        return;\n      }\n      if (parentOption) {\n        option.parentOption = parentOption;\n      }\n      result.push(option);\n      var children = option.children;\n      // here we don't judge if option.type is `group`\n      // when new option doesn't provide `type`, it will cause that the children can't be updated.\n      if (children && children.length) {\n        this._flatten(children, result, option);\n      }\n      // Deleting for JSON output, and for not affecting group creation.\n      delete option.children;\n    }, this);\n  };\n  // FIXME\n  // Pass to view using payload? setOption has a payload?\n  GraphicComponentModel.prototype.useElOptionsToUpdate = function () {\n    var els = this._elOptionsToUpdate;\n    // Clear to avoid render duplicately when zooming.\n    this._elOptionsToUpdate = null;\n    return els;\n  };\n  GraphicComponentModel.type = 'graphic';\n  GraphicComponentModel.defaultOption = {\n    elements: []\n    // parentId: null\n  };\n  return GraphicComponentModel;\n}(ComponentModel);\nexport { GraphicComponentModel };", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport Displayable from 'zrender/lib/graphic/Displayable.js';\nimport * as modelUtil from '../../util/model.js';\nimport * as graphicUtil from '../../util/graphic.js';\nimport * as layoutUtil from '../../util/layout.js';\nimport { parsePercent } from '../../util/number.js';\nimport ComponentView from '../../view/Component.js';\nimport { getECData } from '../../util/innerStore.js';\nimport { isEC4CompatibleStyle, convertFromEC4CompatibleStyle } from '../../util/styleCompat.js';\nimport { applyLeaveTransition, applyUpdateTransition, isTransitionAll, updateLeaveTo } from '../../animation/customGraphicTransition.js';\nimport { updateProps } from '../../animation/basicTransition.js';\nimport { applyKeyframeAnimation, stopPreviousKeyframeAnimationAndRestore } from '../../animation/customGraphicKeyframeAnimation.js';\nvar nonShapeGraphicElements = {\n  // Reserved but not supported in graphic component.\n  path: null,\n  compoundPath: null,\n  // Supported in graphic component.\n  group: graphicUtil.Group,\n  image: graphicUtil.Image,\n  text: graphicUtil.Text\n};\nexport var inner = modelUtil.makeInner();\n// ------------------------\n// View\n// ------------------------\nvar GraphicComponentView = /** @class */function (_super) {\n  __extends(GraphicComponentView, _super);\n  function GraphicComponentView() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = GraphicComponentView.type;\n    return _this;\n  }\n  GraphicComponentView.prototype.init = function () {\n    this._elMap = zrUtil.createHashMap();\n  };\n  GraphicComponentView.prototype.render = function (graphicModel, ecModel, api) {\n    // Having leveraged between use cases and algorithm complexity, a very\n    // simple layout mechanism is used:\n    // The size(width/height) can be determined by itself or its parent (not\n    // implemented yet), but can not by its children. (Top-down travel)\n    // The location(x/y) can be determined by the bounding rect of itself\n    // (can including its descendants or not) and the size of its parent.\n    // (Bottom-up travel)\n    // When `chart.clear()` or `chart.setOption({...}, true)` with the same id,\n    // view will be reused.\n    if (graphicModel !== this._lastGraphicModel) {\n      this._clear();\n    }\n    this._lastGraphicModel = graphicModel;\n    this._updateElements(graphicModel);\n    this._relocate(graphicModel, api);\n  };\n  /**\n   * Update graphic elements.\n   */\n  GraphicComponentView.prototype._updateElements = function (graphicModel) {\n    var elOptionsToUpdate = graphicModel.useElOptionsToUpdate();\n    if (!elOptionsToUpdate) {\n      return;\n    }\n    var elMap = this._elMap;\n    var rootGroup = this.group;\n    var globalZ = graphicModel.get('z');\n    var globalZLevel = graphicModel.get('zlevel');\n    // Top-down tranverse to assign graphic settings to each elements.\n    zrUtil.each(elOptionsToUpdate, function (elOption) {\n      var id = modelUtil.convertOptionIdName(elOption.id, null);\n      var elExisting = id != null ? elMap.get(id) : null;\n      var parentId = modelUtil.convertOptionIdName(elOption.parentId, null);\n      var targetElParent = parentId != null ? elMap.get(parentId) : rootGroup;\n      var elType = elOption.type;\n      var elOptionStyle = elOption.style;\n      if (elType === 'text' && elOptionStyle) {\n        // In top/bottom mode, textVerticalAlign should not be used, which cause\n        // inaccurately locating.\n        if (elOption.hv && elOption.hv[1]) {\n          elOptionStyle.textVerticalAlign = elOptionStyle.textBaseline = elOptionStyle.verticalAlign = elOptionStyle.align = null;\n        }\n      }\n      var textContentOption = elOption.textContent;\n      var textConfig = elOption.textConfig;\n      if (elOptionStyle && isEC4CompatibleStyle(elOptionStyle, elType, !!textConfig, !!textContentOption)) {\n        var convertResult = convertFromEC4CompatibleStyle(elOptionStyle, elType, true);\n        if (!textConfig && convertResult.textConfig) {\n          textConfig = elOption.textConfig = convertResult.textConfig;\n        }\n        if (!textContentOption && convertResult.textContent) {\n          textContentOption = convertResult.textContent;\n        }\n      }\n      // Remove unnecessary props to avoid potential problems.\n      var elOptionCleaned = getCleanedElOption(elOption);\n      // For simple, do not support parent change, otherwise reorder is needed.\n      if (process.env.NODE_ENV !== 'production') {\n        elExisting && zrUtil.assert(targetElParent === elExisting.parent, 'Changing parent is not supported.');\n      }\n      var $action = elOption.$action || 'merge';\n      var isMerge = $action === 'merge';\n      var isReplace = $action === 'replace';\n      if (isMerge) {\n        var isInit = !elExisting;\n        var el_1 = elExisting;\n        if (isInit) {\n          el_1 = createEl(id, targetElParent, elOption.type, elMap);\n        } else {\n          el_1 && (inner(el_1).isNew = false);\n          // Stop and restore before update any other attributes.\n          stopPreviousKeyframeAnimationAndRestore(el_1);\n        }\n        if (el_1) {\n          applyUpdateTransition(el_1, elOptionCleaned, graphicModel, {\n            isInit: isInit\n          });\n          updateCommonAttrs(el_1, elOption, globalZ, globalZLevel);\n        }\n      } else if (isReplace) {\n        removeEl(elExisting, elOption, elMap, graphicModel);\n        var el_2 = createEl(id, targetElParent, elOption.type, elMap);\n        if (el_2) {\n          applyUpdateTransition(el_2, elOptionCleaned, graphicModel, {\n            isInit: true\n          });\n          updateCommonAttrs(el_2, elOption, globalZ, globalZLevel);\n        }\n      } else if ($action === 'remove') {\n        updateLeaveTo(elExisting, elOption);\n        removeEl(elExisting, elOption, elMap, graphicModel);\n      }\n      var el = elMap.get(id);\n      if (el && textContentOption) {\n        if (isMerge) {\n          var textContentExisting = el.getTextContent();\n          textContentExisting ? textContentExisting.attr(textContentOption) : el.setTextContent(new graphicUtil.Text(textContentOption));\n        } else if (isReplace) {\n          el.setTextContent(new graphicUtil.Text(textContentOption));\n        }\n      }\n      if (el) {\n        var clipPathOption = elOption.clipPath;\n        if (clipPathOption) {\n          var clipPathType = clipPathOption.type;\n          var clipPath = void 0;\n          var isInit = false;\n          if (isMerge) {\n            var oldClipPath = el.getClipPath();\n            isInit = !oldClipPath || inner(oldClipPath).type !== clipPathType;\n            clipPath = isInit ? newEl(clipPathType) : oldClipPath;\n          } else if (isReplace) {\n            isInit = true;\n            clipPath = newEl(clipPathType);\n          }\n          el.setClipPath(clipPath);\n          applyUpdateTransition(clipPath, clipPathOption, graphicModel, {\n            isInit: isInit\n          });\n          applyKeyframeAnimation(clipPath, clipPathOption.keyframeAnimation, graphicModel);\n        }\n        var elInner = inner(el);\n        el.setTextConfig(textConfig);\n        elInner.option = elOption;\n        setEventData(el, graphicModel, elOption);\n        graphicUtil.setTooltipConfig({\n          el: el,\n          componentModel: graphicModel,\n          itemName: el.name,\n          itemTooltipOption: elOption.tooltip\n        });\n        applyKeyframeAnimation(el, elOption.keyframeAnimation, graphicModel);\n      }\n    });\n  };\n  /**\n   * Locate graphic elements.\n   */\n  GraphicComponentView.prototype._relocate = function (graphicModel, api) {\n    var elOptions = graphicModel.option.elements;\n    var rootGroup = this.group;\n    var elMap = this._elMap;\n    var apiWidth = api.getWidth();\n    var apiHeight = api.getHeight();\n    var xy = ['x', 'y'];\n    // Top-down to calculate percentage width/height of group\n    for (var i = 0; i < elOptions.length; i++) {\n      var elOption = elOptions[i];\n      var id = modelUtil.convertOptionIdName(elOption.id, null);\n      var el = id != null ? elMap.get(id) : null;\n      if (!el || !el.isGroup) {\n        continue;\n      }\n      var parentEl = el.parent;\n      var isParentRoot = parentEl === rootGroup;\n      // Like 'position:absolut' in css, default 0.\n      var elInner = inner(el);\n      var parentElInner = inner(parentEl);\n      elInner.width = parsePercent(elInner.option.width, isParentRoot ? apiWidth : parentElInner.width) || 0;\n      elInner.height = parsePercent(elInner.option.height, isParentRoot ? apiHeight : parentElInner.height) || 0;\n    }\n    // Bottom-up tranvese all elements (consider ec resize) to locate elements.\n    for (var i = elOptions.length - 1; i >= 0; i--) {\n      var elOption = elOptions[i];\n      var id = modelUtil.convertOptionIdName(elOption.id, null);\n      var el = id != null ? elMap.get(id) : null;\n      if (!el) {\n        continue;\n      }\n      var parentEl = el.parent;\n      var parentElInner = inner(parentEl);\n      var containerInfo = parentEl === rootGroup ? {\n        width: apiWidth,\n        height: apiHeight\n      } : {\n        width: parentElInner.width,\n        height: parentElInner.height\n      };\n      // PENDING\n      // Currently, when `bounding: 'all'`, the union bounding rect of the group\n      // does not include the rect of [0, 0, group.width, group.height], which\n      // is probably weird for users. Should we make a break change for it?\n      var layoutPos = {};\n      var layouted = layoutUtil.positionElement(el, elOption, containerInfo, null, {\n        hv: elOption.hv,\n        boundingMode: elOption.bounding\n      }, layoutPos);\n      if (!inner(el).isNew && layouted) {\n        var transition = elOption.transition;\n        var animatePos = {};\n        for (var k = 0; k < xy.length; k++) {\n          var key = xy[k];\n          var val = layoutPos[key];\n          if (transition && (isTransitionAll(transition) || zrUtil.indexOf(transition, key) >= 0)) {\n            animatePos[key] = val;\n          } else {\n            el[key] = val;\n          }\n        }\n        updateProps(el, animatePos, graphicModel, 0);\n      } else {\n        el.attr(layoutPos);\n      }\n    }\n  };\n  /**\n   * Clear all elements.\n   */\n  GraphicComponentView.prototype._clear = function () {\n    var _this = this;\n    var elMap = this._elMap;\n    elMap.each(function (el) {\n      removeEl(el, inner(el).option, elMap, _this._lastGraphicModel);\n    });\n    this._elMap = zrUtil.createHashMap();\n  };\n  GraphicComponentView.prototype.dispose = function () {\n    this._clear();\n  };\n  GraphicComponentView.type = 'graphic';\n  return GraphicComponentView;\n}(ComponentView);\nexport { GraphicComponentView };\nfunction newEl(graphicType) {\n  if (process.env.NODE_ENV !== 'production') {\n    zrUtil.assert(graphicType, 'graphic type MUST be set');\n  }\n  var Clz = zrUtil.hasOwn(nonShapeGraphicElements, graphicType)\n  // Those graphic elements are not shapes. They should not be\n  // overwritten by users, so do them first.\n  ? nonShapeGraphicElements[graphicType] : graphicUtil.getShapeClass(graphicType);\n  if (process.env.NODE_ENV !== 'production') {\n    zrUtil.assert(Clz, \"graphic type \" + graphicType + \" can not be found\");\n  }\n  var el = new Clz({});\n  inner(el).type = graphicType;\n  return el;\n}\nfunction createEl(id, targetElParent, graphicType, elMap) {\n  var el = newEl(graphicType);\n  targetElParent.add(el);\n  elMap.set(id, el);\n  inner(el).id = id;\n  inner(el).isNew = true;\n  return el;\n}\nfunction removeEl(elExisting, elOption, elMap, graphicModel) {\n  var existElParent = elExisting && elExisting.parent;\n  if (existElParent) {\n    elExisting.type === 'group' && elExisting.traverse(function (el) {\n      removeEl(el, elOption, elMap, graphicModel);\n    });\n    applyLeaveTransition(elExisting, elOption, graphicModel);\n    elMap.removeKey(inner(elExisting).id);\n  }\n}\nfunction updateCommonAttrs(el, elOption, defaultZ, defaultZlevel) {\n  if (!el.isGroup) {\n    zrUtil.each([['cursor', Displayable.prototype.cursor],\n    // We should not support configure z and zlevel in the element level.\n    // But seems we didn't limit it previously. So here still use it to avoid breaking.\n    ['zlevel', defaultZlevel || 0], ['z', defaultZ || 0],\n    // z2 must not be null/undefined, otherwise sort error may occur.\n    ['z2', 0]], function (item) {\n      var prop = item[0];\n      if (zrUtil.hasOwn(elOption, prop)) {\n        el[prop] = zrUtil.retrieve2(elOption[prop], item[1]);\n      } else if (el[prop] == null) {\n        el[prop] = item[1];\n      }\n    });\n  }\n  zrUtil.each(zrUtil.keys(elOption), function (key) {\n    // Assign event handlers.\n    // PENDING: should enumerate all event names or use pattern matching?\n    if (key.indexOf('on') === 0) {\n      var val = elOption[key];\n      el[key] = zrUtil.isFunction(val) ? val : null;\n    }\n  });\n  if (zrUtil.hasOwn(elOption, 'draggable')) {\n    el.draggable = elOption.draggable;\n  }\n  // Other attributes\n  elOption.name != null && (el.name = elOption.name);\n  elOption.id != null && (el.id = elOption.id);\n}\n// Remove unnecessary props to avoid potential problems.\nfunction getCleanedElOption(elOption) {\n  elOption = zrUtil.extend({}, elOption);\n  zrUtil.each(['id', 'parentId', '$action', 'hv', 'bounding', 'textContent', 'clipPath'].concat(layoutUtil.LOCATION_PARAMS), function (name) {\n    delete elOption[name];\n  });\n  return elOption;\n}\nfunction setEventData(el, graphicModel, elOption) {\n  var eventData = getECData(el).eventData;\n  // Simple optimize for large amount of elements that no need event.\n  if (!el.silent && !el.ignore && !eventData) {\n    eventData = getECData(el).eventData = {\n      componentType: 'graphic',\n      componentIndex: graphicModel.componentIndex,\n      name: el.name\n    };\n  }\n  // `elOption.info` enables user to mount some info on\n  // elements and use them in event handlers.\n  if (eventData) {\n    eventData.info = elOption.info;\n  }\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { isArray } from 'zrender/lib/core/util.js';\nimport { GraphicComponentModel } from './GraphicModel.js';\nimport { GraphicComponentView } from './GraphicView.js';\nexport function install(registers) {\n  registers.registerComponentModel(GraphicComponentModel);\n  registers.registerComponentView(GraphicComponentView);\n  registers.registerPreprocessor(function (option) {\n    var graphicOption = option.graphic;\n    // Convert\n    // {graphic: [{left: 10, type: 'circle'}, ...]}\n    // or\n    // {graphic: {left: 10, type: 'circle'}}\n    // to\n    // {graphic: [{elements: [{left: 10, type: 'circle'}, ...]}]}\n    if (isArray(graphicOption)) {\n      if (!graphicOption[0] || !graphicOption[0].elements) {\n        option.graphic = [{\n          elements: graphicOption\n        }];\n      } else {\n        // Only one graphic instance can be instantiated. (We don't\n        // want that too many views are created in echarts._viewMap.)\n        option.graphic = [option.graphic[0]];\n      }\n    } else if (graphicOption && !graphicOption.elements) {\n      option.graphic = [{\n        elements: [graphicOption]\n      }];\n    }\n  });\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { indexOf, createHashMap, assert } from 'zrender/lib/core/util.js';\nexport var DATA_ZOOM_AXIS_DIMENSIONS = ['x', 'y', 'radius', 'angle', 'single'];\n// Supported coords.\n// FIXME: polar has been broken (but rarely used).\nvar SERIES_COORDS = ['cartesian2d', 'polar', 'singleAxis'];\nexport function isCoordSupported(seriesModel) {\n  var coordType = seriesModel.get('coordinateSystem');\n  return indexOf(SERIES_COORDS, coordType) >= 0;\n}\nexport function getAxisMainType(axisDim) {\n  if (process.env.NODE_ENV !== 'production') {\n    assert(axisDim);\n  }\n  return axisDim + 'Axis';\n}\nexport function getAxisIndexPropName(axisDim) {\n  if (process.env.NODE_ENV !== 'production') {\n    assert(axisDim);\n  }\n  return axisDim + 'AxisIndex';\n}\nexport function getAxisIdPropName(axisDim) {\n  if (process.env.NODE_ENV !== 'production') {\n    assert(axisDim);\n  }\n  return axisDim + 'AxisId';\n}\n/**\n * If two dataZoomModels has the same axis controlled, we say that they are 'linked'.\n * This function finds all linked dataZoomModels start from the given payload.\n */\nexport function findEffectedDataZooms(ecModel, payload) {\n  // Key: `DataZoomAxisDimension`\n  var axisRecords = createHashMap();\n  var effectedModels = [];\n  // Key: uid of dataZoomModel\n  var effectedModelMap = createHashMap();\n  // Find the dataZooms specified by payload.\n  ecModel.eachComponent({\n    mainType: 'dataZoom',\n    query: payload\n  }, function (dataZoomModel) {\n    if (!effectedModelMap.get(dataZoomModel.uid)) {\n      addToEffected(dataZoomModel);\n    }\n  });\n  // Start from the given dataZoomModels, travel the graph to find\n  // all of the linked dataZoom models.\n  var foundNewLink;\n  do {\n    foundNewLink = false;\n    ecModel.eachComponent('dataZoom', processSingle);\n  } while (foundNewLink);\n  function processSingle(dataZoomModel) {\n    if (!effectedModelMap.get(dataZoomModel.uid) && isLinked(dataZoomModel)) {\n      addToEffected(dataZoomModel);\n      foundNewLink = true;\n    }\n  }\n  function addToEffected(dataZoom) {\n    effectedModelMap.set(dataZoom.uid, true);\n    effectedModels.push(dataZoom);\n    markAxisControlled(dataZoom);\n  }\n  function isLinked(dataZoomModel) {\n    var isLink = false;\n    dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\n      var axisIdxArr = axisRecords.get(axisDim);\n      if (axisIdxArr && axisIdxArr[axisIndex]) {\n        isLink = true;\n      }\n    });\n    return isLink;\n  }\n  function markAxisControlled(dataZoomModel) {\n    dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\n      (axisRecords.get(axisDim) || axisRecords.set(axisDim, []))[axisIndex] = true;\n    });\n  }\n  return effectedModels;\n}\n/**\n * Find the first target coordinate system.\n * Available after model built.\n *\n * @return Like {\n *                  grid: [\n *                      {model: coord0, axisModels: [axis1, axis3], coordIndex: 1},\n *                      {model: coord1, axisModels: [axis0, axis2], coordIndex: 0},\n *                      ...\n *                  ],  // cartesians must not be null/undefined.\n *                  polar: [\n *                      {model: coord0, axisModels: [axis4], coordIndex: 0},\n *                      ...\n *                  ],  // polars must not be null/undefined.\n *                  singleAxis: [\n *                      {model: coord0, axisModels: [], coordIndex: 0}\n *                  ]\n *              }\n */\nexport function collectReferCoordSysModelInfo(dataZoomModel) {\n  var ecModel = dataZoomModel.ecModel;\n  var coordSysInfoWrap = {\n    infoList: [],\n    infoMap: createHashMap()\n  };\n  dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\n    var axisModel = ecModel.getComponent(getAxisMainType(axisDim), axisIndex);\n    if (!axisModel) {\n      return;\n    }\n    var coordSysModel = axisModel.getCoordSysModel();\n    if (!coordSysModel) {\n      return;\n    }\n    var coordSysUid = coordSysModel.uid;\n    var coordSysInfo = coordSysInfoWrap.infoMap.get(coordSysUid);\n    if (!coordSysInfo) {\n      coordSysInfo = {\n        model: coordSysModel,\n        axisModels: []\n      };\n      coordSysInfoWrap.infoList.push(coordSysInfo);\n      coordSysInfoWrap.infoMap.set(coordSysUid, coordSysInfo);\n    }\n    coordSysInfo.axisModels.push(axisModel);\n  });\n  return coordSysInfoWrap;\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport { each, createHashMap, merge, assert } from 'zrender/lib/core/util.js';\nimport ComponentModel from '../../model/Component.js';\nimport { getAxisMainType, DATA_ZOOM_AXIS_DIMENSIONS } from './helper.js';\nimport { MULTIPLE_REFERRING, SINGLE_REFERRING } from '../../util/model.js';\nvar DataZoomAxisInfo = /** @class */function () {\n  function DataZoomAxisInfo() {\n    this.indexList = [];\n    this.indexMap = [];\n  }\n  DataZoomAxisInfo.prototype.add = function (axisCmptIdx) {\n    // Remove duplication.\n    if (!this.indexMap[axisCmptIdx]) {\n      this.indexList.push(axisCmptIdx);\n      this.indexMap[axisCmptIdx] = true;\n    }\n  };\n  return DataZoomAxisInfo;\n}();\nvar DataZoomModel = /** @class */function (_super) {\n  __extends(DataZoomModel, _super);\n  function DataZoomModel() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = DataZoomModel.type;\n    _this._autoThrottle = true;\n    _this._noTarget = true;\n    /**\n     * It is `[rangeModeForMin, rangeModeForMax]`.\n     * The optional values for `rangeMode`:\n     * + `'value'` mode: the axis extent will always be determined by\n     *     `dataZoom.startValue` and `dataZoom.endValue`, despite\n     *     how data like and how `axis.min` and `axis.max` are.\n     * + `'percent'` mode: `100` represents 100% of the `[dMin, dMax]`,\n     *     where `dMin` is `axis.min` if `axis.min` specified, otherwise `data.extent[0]`,\n     *     and `dMax` is `axis.max` if `axis.max` specified, otherwise `data.extent[1]`.\n     *     Axis extent will be determined by the result of the percent of `[dMin, dMax]`.\n     *\n     * For example, when users are using dynamic data (update data periodically via `setOption`),\n     * if in `'value`' mode, the window will be kept in a fixed value range despite how\n     * data are appended, while if in `'percent'` mode, whe window range will be changed alone with\n     * the appended data (suppose `axis.min` and `axis.max` are not specified).\n     */\n    _this._rangePropMode = ['percent', 'percent'];\n    return _this;\n  }\n  DataZoomModel.prototype.init = function (option, parentModel, ecModel) {\n    var inputRawOption = retrieveRawOption(option);\n    /**\n     * Suppose a \"main process\" start at the point that model prepared (that is,\n     * model initialized or merged or method called in `action`).\n     * We should keep the `main process` idempotent, that is, given a set of values\n     * on `option`, we get the same result.\n     *\n     * But sometimes, values on `option` will be updated for providing users\n     * a \"final calculated value\" (`dataZoomProcessor` will do that). Those value\n     * should not be the base/input of the `main process`.\n     *\n     * So in that case we should save and keep the input of the `main process`\n     * separately, called `settledOption`.\n     *\n     * For example, consider the case:\n     * (Step_1) brush zoom the grid by `toolbox.dataZoom`,\n     *     where the original input `option.startValue`, `option.endValue` are earsed by\n     *     calculated value.\n     * (Step)2) click the legend to hide and show a series,\n     *     where the new range is calculated by the earsed `startValue` and `endValue`,\n     *     which brings incorrect result.\n     */\n    this.settledOption = inputRawOption;\n    this.mergeDefaultAndTheme(option, ecModel);\n    this._doInit(inputRawOption);\n  };\n  DataZoomModel.prototype.mergeOption = function (newOption) {\n    var inputRawOption = retrieveRawOption(newOption);\n    // FIX #2591\n    merge(this.option, newOption, true);\n    merge(this.settledOption, inputRawOption, true);\n    this._doInit(inputRawOption);\n  };\n  DataZoomModel.prototype._doInit = function (inputRawOption) {\n    var thisOption = this.option;\n    this._setDefaultThrottle(inputRawOption);\n    this._updateRangeUse(inputRawOption);\n    var settledOption = this.settledOption;\n    each([['start', 'startValue'], ['end', 'endValue']], function (names, index) {\n      // start/end has higher priority over startValue/endValue if they\n      // both set, but we should make chart.setOption({endValue: 1000})\n      // effective, rather than chart.setOption({endValue: 1000, end: null}).\n      if (this._rangePropMode[index] === 'value') {\n        thisOption[names[0]] = settledOption[names[0]] = null;\n      }\n      // Otherwise do nothing and use the merge result.\n    }, this);\n    this._resetTarget();\n  };\n  DataZoomModel.prototype._resetTarget = function () {\n    var optionOrient = this.get('orient', true);\n    var targetAxisIndexMap = this._targetAxisInfoMap = createHashMap();\n    var hasAxisSpecified = this._fillSpecifiedTargetAxis(targetAxisIndexMap);\n    if (hasAxisSpecified) {\n      this._orient = optionOrient || this._makeAutoOrientByTargetAxis();\n    } else {\n      this._orient = optionOrient || 'horizontal';\n      this._fillAutoTargetAxisByOrient(targetAxisIndexMap, this._orient);\n    }\n    this._noTarget = true;\n    targetAxisIndexMap.each(function (axisInfo) {\n      if (axisInfo.indexList.length) {\n        this._noTarget = false;\n      }\n    }, this);\n  };\n  DataZoomModel.prototype._fillSpecifiedTargetAxis = function (targetAxisIndexMap) {\n    var hasAxisSpecified = false;\n    each(DATA_ZOOM_AXIS_DIMENSIONS, function (axisDim) {\n      var refering = this.getReferringComponents(getAxisMainType(axisDim), MULTIPLE_REFERRING);\n      // When user set axisIndex as a empty array, we think that user specify axisIndex\n      // but do not want use auto mode. Because empty array may be encountered when\n      // some error occurred.\n      if (!refering.specified) {\n        return;\n      }\n      hasAxisSpecified = true;\n      var axisInfo = new DataZoomAxisInfo();\n      each(refering.models, function (axisModel) {\n        axisInfo.add(axisModel.componentIndex);\n      });\n      targetAxisIndexMap.set(axisDim, axisInfo);\n    }, this);\n    return hasAxisSpecified;\n  };\n  DataZoomModel.prototype._fillAutoTargetAxisByOrient = function (targetAxisIndexMap, orient) {\n    var ecModel = this.ecModel;\n    var needAuto = true;\n    // Find axis that parallel to dataZoom as default.\n    if (needAuto) {\n      var axisDim = orient === 'vertical' ? 'y' : 'x';\n      var axisModels = ecModel.findComponents({\n        mainType: axisDim + 'Axis'\n      });\n      setParallelAxis(axisModels, axisDim);\n    }\n    // Find axis that parallel to dataZoom as default.\n    if (needAuto) {\n      var axisModels = ecModel.findComponents({\n        mainType: 'singleAxis',\n        filter: function (axisModel) {\n          return axisModel.get('orient', true) === orient;\n        }\n      });\n      setParallelAxis(axisModels, 'single');\n    }\n    function setParallelAxis(axisModels, axisDim) {\n      // At least use the first parallel axis as the target axis.\n      var axisModel = axisModels[0];\n      if (!axisModel) {\n        return;\n      }\n      var axisInfo = new DataZoomAxisInfo();\n      axisInfo.add(axisModel.componentIndex);\n      targetAxisIndexMap.set(axisDim, axisInfo);\n      needAuto = false;\n      // Find parallel axes in the same grid.\n      if (axisDim === 'x' || axisDim === 'y') {\n        var gridModel_1 = axisModel.getReferringComponents('grid', SINGLE_REFERRING).models[0];\n        gridModel_1 && each(axisModels, function (axModel) {\n          if (axisModel.componentIndex !== axModel.componentIndex && gridModel_1 === axModel.getReferringComponents('grid', SINGLE_REFERRING).models[0]) {\n            axisInfo.add(axModel.componentIndex);\n          }\n        });\n      }\n    }\n    if (needAuto) {\n      // If no parallel axis, find the first category axis as default. (Also consider polar).\n      each(DATA_ZOOM_AXIS_DIMENSIONS, function (axisDim) {\n        if (!needAuto) {\n          return;\n        }\n        var axisModels = ecModel.findComponents({\n          mainType: getAxisMainType(axisDim),\n          filter: function (axisModel) {\n            return axisModel.get('type', true) === 'category';\n          }\n        });\n        if (axisModels[0]) {\n          var axisInfo = new DataZoomAxisInfo();\n          axisInfo.add(axisModels[0].componentIndex);\n          targetAxisIndexMap.set(axisDim, axisInfo);\n          needAuto = false;\n        }\n      }, this);\n    }\n  };\n  DataZoomModel.prototype._makeAutoOrientByTargetAxis = function () {\n    var dim;\n    // Find the first axis\n    this.eachTargetAxis(function (axisDim) {\n      !dim && (dim = axisDim);\n    }, this);\n    return dim === 'y' ? 'vertical' : 'horizontal';\n  };\n  DataZoomModel.prototype._setDefaultThrottle = function (inputRawOption) {\n    // When first time user set throttle, auto throttle ends.\n    if (inputRawOption.hasOwnProperty('throttle')) {\n      this._autoThrottle = false;\n    }\n    if (this._autoThrottle) {\n      var globalOption = this.ecModel.option;\n      this.option.throttle = globalOption.animation && globalOption.animationDurationUpdate > 0 ? 100 : 20;\n    }\n  };\n  DataZoomModel.prototype._updateRangeUse = function (inputRawOption) {\n    var rangePropMode = this._rangePropMode;\n    var rangeModeInOption = this.get('rangeMode');\n    each([['start', 'startValue'], ['end', 'endValue']], function (names, index) {\n      var percentSpecified = inputRawOption[names[0]] != null;\n      var valueSpecified = inputRawOption[names[1]] != null;\n      if (percentSpecified && !valueSpecified) {\n        rangePropMode[index] = 'percent';\n      } else if (!percentSpecified && valueSpecified) {\n        rangePropMode[index] = 'value';\n      } else if (rangeModeInOption) {\n        rangePropMode[index] = rangeModeInOption[index];\n      } else if (percentSpecified) {\n        // percentSpecified && valueSpecified\n        rangePropMode[index] = 'percent';\n      }\n      // else remain its original setting.\n    });\n  };\n  DataZoomModel.prototype.noTarget = function () {\n    return this._noTarget;\n  };\n  DataZoomModel.prototype.getFirstTargetAxisModel = function () {\n    var firstAxisModel;\n    this.eachTargetAxis(function (axisDim, axisIndex) {\n      if (firstAxisModel == null) {\n        firstAxisModel = this.ecModel.getComponent(getAxisMainType(axisDim), axisIndex);\n      }\n    }, this);\n    return firstAxisModel;\n  };\n  /**\n   * @param {Function} callback param: axisModel, dimNames, axisIndex, dataZoomModel, ecModel\n   */\n  DataZoomModel.prototype.eachTargetAxis = function (callback, context) {\n    this._targetAxisInfoMap.each(function (axisInfo, axisDim) {\n      each(axisInfo.indexList, function (axisIndex) {\n        callback.call(context, axisDim, axisIndex);\n      });\n    });\n  };\n  /**\n   * @return If not found, return null/undefined.\n   */\n  DataZoomModel.prototype.getAxisProxy = function (axisDim, axisIndex) {\n    var axisModel = this.getAxisModel(axisDim, axisIndex);\n    if (axisModel) {\n      return axisModel.__dzAxisProxy;\n    }\n  };\n  /**\n   * @return If not found, return null/undefined.\n   */\n  DataZoomModel.prototype.getAxisModel = function (axisDim, axisIndex) {\n    if (process.env.NODE_ENV !== 'production') {\n      assert(axisDim && axisIndex != null);\n    }\n    var axisInfo = this._targetAxisInfoMap.get(axisDim);\n    if (axisInfo && axisInfo.indexMap[axisIndex]) {\n      return this.ecModel.getComponent(getAxisMainType(axisDim), axisIndex);\n    }\n  };\n  /**\n   * If not specified, set to undefined.\n   */\n  DataZoomModel.prototype.setRawRange = function (opt) {\n    var thisOption = this.option;\n    var settledOption = this.settledOption;\n    each([['start', 'startValue'], ['end', 'endValue']], function (names) {\n      // Consider the pair <start, startValue>:\n      // If one has value and the other one is `null/undefined`, we both set them\n      // to `settledOption`. This strategy enables the feature to clear the original\n      // value in `settledOption` to `null/undefined`.\n      // But if both of them are `null/undefined`, we do not set them to `settledOption`\n      // and keep `settledOption` with the original value. This strategy enables users to\n      // only set <end or endValue> but not set <start or startValue> when calling\n      // `dispatchAction`.\n      // The pair <end, endValue> is treated in the same way.\n      if (opt[names[0]] != null || opt[names[1]] != null) {\n        thisOption[names[0]] = settledOption[names[0]] = opt[names[0]];\n        thisOption[names[1]] = settledOption[names[1]] = opt[names[1]];\n      }\n    }, this);\n    this._updateRangeUse(opt);\n  };\n  DataZoomModel.prototype.setCalculatedRange = function (opt) {\n    var option = this.option;\n    each(['start', 'startValue', 'end', 'endValue'], function (name) {\n      option[name] = opt[name];\n    });\n  };\n  DataZoomModel.prototype.getPercentRange = function () {\n    var axisProxy = this.findRepresentativeAxisProxy();\n    if (axisProxy) {\n      return axisProxy.getDataPercentWindow();\n    }\n  };\n  /**\n   * For example, chart.getModel().getComponent('dataZoom').getValueRange('y', 0);\n   *\n   * @return [startValue, endValue] value can only be '-' or finite number.\n   */\n  DataZoomModel.prototype.getValueRange = function (axisDim, axisIndex) {\n    if (axisDim == null && axisIndex == null) {\n      var axisProxy = this.findRepresentativeAxisProxy();\n      if (axisProxy) {\n        return axisProxy.getDataValueWindow();\n      }\n    } else {\n      return this.getAxisProxy(axisDim, axisIndex).getDataValueWindow();\n    }\n  };\n  /**\n   * @param axisModel If axisModel given, find axisProxy\n   *      corresponding to the axisModel\n   */\n  DataZoomModel.prototype.findRepresentativeAxisProxy = function (axisModel) {\n    if (axisModel) {\n      return axisModel.__dzAxisProxy;\n    }\n    // Find the first hosted axisProxy\n    var firstProxy;\n    var axisDimList = this._targetAxisInfoMap.keys();\n    for (var i = 0; i < axisDimList.length; i++) {\n      var axisDim = axisDimList[i];\n      var axisInfo = this._targetAxisInfoMap.get(axisDim);\n      for (var j = 0; j < axisInfo.indexList.length; j++) {\n        var proxy = this.getAxisProxy(axisDim, axisInfo.indexList[j]);\n        if (proxy.hostedBy(this)) {\n          return proxy;\n        }\n        if (!firstProxy) {\n          firstProxy = proxy;\n        }\n      }\n    }\n    // If no hosted proxy found, still need to return a proxy.\n    // This case always happens in toolbox dataZoom, where axes are all hosted by\n    // other dataZooms.\n    return firstProxy;\n  };\n  DataZoomModel.prototype.getRangePropMode = function () {\n    return this._rangePropMode.slice();\n  };\n  DataZoomModel.prototype.getOrient = function () {\n    if (process.env.NODE_ENV !== 'production') {\n      // Should not be called before initialized.\n      assert(this._orient);\n    }\n    return this._orient;\n  };\n  DataZoomModel.type = 'dataZoom';\n  DataZoomModel.dependencies = ['xAxis', 'yAxis', 'radiusAxis', 'angleAxis', 'singleAxis', 'series', 'toolbox'];\n  DataZoomModel.defaultOption = {\n    // zlevel: 0,\n    z: 4,\n    filterMode: 'filter',\n    start: 0,\n    end: 100\n  };\n  return DataZoomModel;\n}(ComponentModel);\n/**\n * Retrieve those raw params from option, which will be cached separately,\n * because they will be overwritten by normalized/calculated values in the main\n * process.\n */\nfunction retrieveRawOption(option) {\n  var ret = {};\n  each(['start', 'end', 'startValue', 'endValue', 'throttle'], function (name) {\n    option.hasOwnProperty(name) && (ret[name] = option[name]);\n  });\n  return ret;\n}\nexport default DataZoomModel;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport DataZoomModel from './DataZoomModel.js';\nvar SelectDataZoomModel = /** @class */function (_super) {\n  __extends(SelectDataZoomModel, _super);\n  function SelectDataZoomModel() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = SelectDataZoomModel.type;\n    return _this;\n  }\n  SelectDataZoomModel.type = 'dataZoom.select';\n  return SelectDataZoomModel;\n}(DataZoomModel);\nexport default SelectDataZoomModel;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport ComponentView from '../../view/Component.js';\nvar DataZoomView = /** @class */function (_super) {\n  __extends(DataZoomView, _super);\n  function DataZoomView() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = DataZoomView.type;\n    return _this;\n  }\n  DataZoomView.prototype.render = function (dataZoomModel, ecModel, api, payload) {\n    this.dataZoomModel = dataZoomModel;\n    this.ecModel = ecModel;\n    this.api = api;\n  };\n  DataZoomView.type = 'dataZoom';\n  return DataZoomView;\n}(ComponentView);\nexport default DataZoomView;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport DataZoomView from './DataZoomView.js';\nvar SelectDataZoomView = /** @class */function (_super) {\n  __extends(SelectDataZoomView, _super);\n  function SelectDataZoomView() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = SelectDataZoomView.type;\n    return _this;\n  }\n  SelectDataZoomView.type = 'dataZoom.select';\n  return SelectDataZoomView;\n}(DataZoomView);\nexport default SelectDataZoomView;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as numberUtil from '../../util/number.js';\nimport sliderMove from '../helper/sliderMove.js';\nimport { unionAxisExtentFromData } from '../../coord/axisHelper.js';\nimport { ensureScaleRawExtentInfo } from '../../coord/scaleRawExtentInfo.js';\nimport { getAxisMainType, isCoordSupported } from './helper.js';\nimport { SINGLE_REFERRING } from '../../util/model.js';\nvar each = zrUtil.each;\nvar asc = numberUtil.asc;\n/**\n * Operate single axis.\n * One axis can only operated by one axis operator.\n * Different dataZoomModels may be defined to operate the same axis.\n * (i.e. 'inside' data zoom and 'slider' data zoom components)\n * So dataZoomModels share one axisProxy in that case.\n */\nvar AxisProxy = /** @class */function () {\n  function AxisProxy(dimName, axisIndex, dataZoomModel, ecModel) {\n    this._dimName = dimName;\n    this._axisIndex = axisIndex;\n    this.ecModel = ecModel;\n    this._dataZoomModel = dataZoomModel;\n    // /**\n    //  * @readOnly\n    //  * @private\n    //  */\n    // this.hasSeriesStacked;\n  }\n  /**\n   * Whether the axisProxy is hosted by dataZoomModel.\n   */\n  AxisProxy.prototype.hostedBy = function (dataZoomModel) {\n    return this._dataZoomModel === dataZoomModel;\n  };\n  /**\n   * @return Value can only be NaN or finite value.\n   */\n  AxisProxy.prototype.getDataValueWindow = function () {\n    return this._valueWindow.slice();\n  };\n  /**\n   * @return {Array.<number>}\n   */\n  AxisProxy.prototype.getDataPercentWindow = function () {\n    return this._percentWindow.slice();\n  };\n  AxisProxy.prototype.getTargetSeriesModels = function () {\n    var seriesModels = [];\n    this.ecModel.eachSeries(function (seriesModel) {\n      if (isCoordSupported(seriesModel)) {\n        var axisMainType = getAxisMainType(this._dimName);\n        var axisModel = seriesModel.getReferringComponents(axisMainType, SINGLE_REFERRING).models[0];\n        if (axisModel && this._axisIndex === axisModel.componentIndex) {\n          seriesModels.push(seriesModel);\n        }\n      }\n    }, this);\n    return seriesModels;\n  };\n  AxisProxy.prototype.getAxisModel = function () {\n    return this.ecModel.getComponent(this._dimName + 'Axis', this._axisIndex);\n  };\n  AxisProxy.prototype.getMinMaxSpan = function () {\n    return zrUtil.clone(this._minMaxSpan);\n  };\n  /**\n   * Only calculate by given range and this._dataExtent, do not change anything.\n   */\n  AxisProxy.prototype.calculateDataWindow = function (opt) {\n    var dataExtent = this._dataExtent;\n    var axisModel = this.getAxisModel();\n    var scale = axisModel.axis.scale;\n    var rangePropMode = this._dataZoomModel.getRangePropMode();\n    var percentExtent = [0, 100];\n    var percentWindow = [];\n    var valueWindow = [];\n    var hasPropModeValue;\n    each(['start', 'end'], function (prop, idx) {\n      var boundPercent = opt[prop];\n      var boundValue = opt[prop + 'Value'];\n      // Notice: dataZoom is based either on `percentProp` ('start', 'end') or\n      // on `valueProp` ('startValue', 'endValue'). (They are based on the data extent\n      // but not min/max of axis, which will be calculated by data window then).\n      // The former one is suitable for cases that a dataZoom component controls multiple\n      // axes with different unit or extent, and the latter one is suitable for accurate\n      // zoom by pixel (e.g., in dataZoomSelect).\n      // we use `getRangePropMode()` to mark which prop is used. `rangePropMode` is updated\n      // only when setOption or dispatchAction, otherwise it remains its original value.\n      // (Why not only record `percentProp` and always map to `valueProp`? Because\n      // the map `valueProp` -> `percentProp` -> `valueProp` probably not the original\n      // `valueProp`. consider two axes constrolled by one dataZoom. They have different\n      // data extent. All of values that are overflow the `dataExtent` will be calculated\n      // to percent '100%').\n      if (rangePropMode[idx] === 'percent') {\n        boundPercent == null && (boundPercent = percentExtent[idx]);\n        // Use scale.parse to math round for category or time axis.\n        boundValue = scale.parse(numberUtil.linearMap(boundPercent, percentExtent, dataExtent));\n      } else {\n        hasPropModeValue = true;\n        boundValue = boundValue == null ? dataExtent[idx] : scale.parse(boundValue);\n        // Calculating `percent` from `value` may be not accurate, because\n        // This calculation can not be inversed, because all of values that\n        // are overflow the `dataExtent` will be calculated to percent '100%'\n        boundPercent = numberUtil.linearMap(boundValue, dataExtent, percentExtent);\n      }\n      // valueWindow[idx] = round(boundValue);\n      // percentWindow[idx] = round(boundPercent);\n      // fallback to extent start/end when parsed value or percent is invalid\n      valueWindow[idx] = boundValue == null || isNaN(boundValue) ? dataExtent[idx] : boundValue;\n      percentWindow[idx] = boundPercent == null || isNaN(boundPercent) ? percentExtent[idx] : boundPercent;\n    });\n    asc(valueWindow);\n    asc(percentWindow);\n    // The windows from user calling of `dispatchAction` might be out of the extent,\n    // or do not obey the `min/maxSpan`, `min/maxValueSpan`. But we don't restrict window\n    // by `zoomLock` here, because we see `zoomLock` just as a interaction constraint,\n    // where API is able to initialize/modify the window size even though `zoomLock`\n    // specified.\n    var spans = this._minMaxSpan;\n    hasPropModeValue ? restrictSet(valueWindow, percentWindow, dataExtent, percentExtent, false) : restrictSet(percentWindow, valueWindow, percentExtent, dataExtent, true);\n    function restrictSet(fromWindow, toWindow, fromExtent, toExtent, toValue) {\n      var suffix = toValue ? 'Span' : 'ValueSpan';\n      sliderMove(0, fromWindow, fromExtent, 'all', spans['min' + suffix], spans['max' + suffix]);\n      for (var i = 0; i < 2; i++) {\n        toWindow[i] = numberUtil.linearMap(fromWindow[i], fromExtent, toExtent, true);\n        toValue && (toWindow[i] = scale.parse(toWindow[i]));\n      }\n    }\n    return {\n      valueWindow: valueWindow,\n      percentWindow: percentWindow\n    };\n  };\n  /**\n   * Notice: reset should not be called before series.restoreData() is called,\n   * so it is recommended to be called in \"process stage\" but not \"model init\n   * stage\".\n   */\n  AxisProxy.prototype.reset = function (dataZoomModel) {\n    if (dataZoomModel !== this._dataZoomModel) {\n      return;\n    }\n    var targetSeries = this.getTargetSeriesModels();\n    // Culculate data window and data extent, and record them.\n    this._dataExtent = calculateDataExtent(this, this._dimName, targetSeries);\n    // `calculateDataWindow` uses min/maxSpan.\n    this._updateMinMaxSpan();\n    var dataWindow = this.calculateDataWindow(dataZoomModel.settledOption);\n    this._valueWindow = dataWindow.valueWindow;\n    this._percentWindow = dataWindow.percentWindow;\n    // Update axis setting then.\n    this._setAxisModel();\n  };\n  AxisProxy.prototype.filterData = function (dataZoomModel, api) {\n    if (dataZoomModel !== this._dataZoomModel) {\n      return;\n    }\n    var axisDim = this._dimName;\n    var seriesModels = this.getTargetSeriesModels();\n    var filterMode = dataZoomModel.get('filterMode');\n    var valueWindow = this._valueWindow;\n    if (filterMode === 'none') {\n      return;\n    }\n    // FIXME\n    // Toolbox may has dataZoom injected. And if there are stacked bar chart\n    // with NaN data, NaN will be filtered and stack will be wrong.\n    // So we need to force the mode to be set empty.\n    // In fect, it is not a big deal that do not support filterMode-'filter'\n    // when using toolbox#dataZoom, utill tooltip#dataZoom support \"single axis\n    // selection\" some day, which might need \"adapt to data extent on the\n    // otherAxis\", which is disabled by filterMode-'empty'.\n    // But currently, stack has been fixed to based on value but not index,\n    // so this is not an issue any more.\n    // let otherAxisModel = this.getOtherAxisModel();\n    // if (dataZoomModel.get('$fromToolbox')\n    //     && otherAxisModel\n    //     && otherAxisModel.hasSeriesStacked\n    // ) {\n    //     filterMode = 'empty';\n    // }\n    // TODO\n    // filterMode 'weakFilter' and 'empty' is not optimized for huge data yet.\n    each(seriesModels, function (seriesModel) {\n      var seriesData = seriesModel.getData();\n      var dataDims = seriesData.mapDimensionsAll(axisDim);\n      if (!dataDims.length) {\n        return;\n      }\n      if (filterMode === 'weakFilter') {\n        var store_1 = seriesData.getStore();\n        var dataDimIndices_1 = zrUtil.map(dataDims, function (dim) {\n          return seriesData.getDimensionIndex(dim);\n        }, seriesData);\n        seriesData.filterSelf(function (dataIndex) {\n          var leftOut;\n          var rightOut;\n          var hasValue;\n          for (var i = 0; i < dataDims.length; i++) {\n            var value = store_1.get(dataDimIndices_1[i], dataIndex);\n            var thisHasValue = !isNaN(value);\n            var thisLeftOut = value < valueWindow[0];\n            var thisRightOut = value > valueWindow[1];\n            if (thisHasValue && !thisLeftOut && !thisRightOut) {\n              return true;\n            }\n            thisHasValue && (hasValue = true);\n            thisLeftOut && (leftOut = true);\n            thisRightOut && (rightOut = true);\n          }\n          // If both left out and right out, do not filter.\n          return hasValue && leftOut && rightOut;\n        });\n      } else {\n        each(dataDims, function (dim) {\n          if (filterMode === 'empty') {\n            seriesModel.setData(seriesData = seriesData.map(dim, function (value) {\n              return !isInWindow(value) ? NaN : value;\n            }));\n          } else {\n            var range = {};\n            range[dim] = valueWindow;\n            // console.time('select');\n            seriesData.selectRange(range);\n            // console.timeEnd('select');\n          }\n        });\n      }\n      each(dataDims, function (dim) {\n        seriesData.setApproximateExtent(valueWindow, dim);\n      });\n    });\n    function isInWindow(value) {\n      return value >= valueWindow[0] && value <= valueWindow[1];\n    }\n  };\n  AxisProxy.prototype._updateMinMaxSpan = function () {\n    var minMaxSpan = this._minMaxSpan = {};\n    var dataZoomModel = this._dataZoomModel;\n    var dataExtent = this._dataExtent;\n    each(['min', 'max'], function (minMax) {\n      var percentSpan = dataZoomModel.get(minMax + 'Span');\n      var valueSpan = dataZoomModel.get(minMax + 'ValueSpan');\n      valueSpan != null && (valueSpan = this.getAxisModel().axis.scale.parse(valueSpan));\n      // minValueSpan and maxValueSpan has higher priority than minSpan and maxSpan\n      if (valueSpan != null) {\n        percentSpan = numberUtil.linearMap(dataExtent[0] + valueSpan, dataExtent, [0, 100], true);\n      } else if (percentSpan != null) {\n        valueSpan = numberUtil.linearMap(percentSpan, [0, 100], dataExtent, true) - dataExtent[0];\n      }\n      minMaxSpan[minMax + 'Span'] = percentSpan;\n      minMaxSpan[minMax + 'ValueSpan'] = valueSpan;\n    }, this);\n  };\n  AxisProxy.prototype._setAxisModel = function () {\n    var axisModel = this.getAxisModel();\n    var percentWindow = this._percentWindow;\n    var valueWindow = this._valueWindow;\n    if (!percentWindow) {\n      return;\n    }\n    // [0, 500]: arbitrary value, guess axis extent.\n    var precision = numberUtil.getPixelPrecision(valueWindow, [0, 500]);\n    precision = Math.min(precision, 20);\n    // For value axis, if min/max/scale are not set, we just use the extent obtained\n    // by series data, which may be a little different from the extent calculated by\n    // `axisHelper.getScaleExtent`. But the different just affects the experience a\n    // little when zooming. So it will not be fixed until some users require it strongly.\n    var rawExtentInfo = axisModel.axis.scale.rawExtentInfo;\n    if (percentWindow[0] !== 0) {\n      rawExtentInfo.setDeterminedMinMax('min', +valueWindow[0].toFixed(precision));\n    }\n    if (percentWindow[1] !== 100) {\n      rawExtentInfo.setDeterminedMinMax('max', +valueWindow[1].toFixed(precision));\n    }\n    rawExtentInfo.freeze();\n  };\n  return AxisProxy;\n}();\nfunction calculateDataExtent(axisProxy, axisDim, seriesModels) {\n  var dataExtent = [Infinity, -Infinity];\n  each(seriesModels, function (seriesModel) {\n    unionAxisExtentFromData(dataExtent, seriesModel.getData(), axisDim);\n  });\n  // It is important to get \"consistent\" extent when more then one axes is\n  // controlled by a `dataZoom`, otherwise those axes will not be synchronized\n  // when zooming. But it is difficult to know what is \"consistent\", considering\n  // axes have different type or even different meanings (For example, two\n  // time axes are used to compare data of the same date in different years).\n  // So basically dataZoom just obtains extent by series.data (in category axis\n  // extent can be obtained from axis.data).\n  // Nevertheless, user can set min/max/scale on axes to make extent of axes\n  // consistent.\n  var axisModel = axisProxy.getAxisModel();\n  var rawExtentResult = ensureScaleRawExtentInfo(axisModel.axis.scale, axisModel, dataExtent).calculate();\n  return [rawExtentResult.min, rawExtentResult.max];\n}\nexport default AxisProxy;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { createHashMap, each } from 'zrender/lib/core/util.js';\nimport { getAxisMainType } from './helper.js';\nimport AxisProxy from './AxisProxy.js';\nvar dataZoomProcessor = {\n  // `dataZoomProcessor` will only be performed in needed series. Consider if\n  // there is a line series and a pie series, it is better not to update the\n  // line series if only pie series is needed to be updated.\n  getTargetSeries: function (ecModel) {\n    function eachAxisModel(cb) {\n      ecModel.eachComponent('dataZoom', function (dataZoomModel) {\n        dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\n          var axisModel = ecModel.getComponent(getAxisMainType(axisDim), axisIndex);\n          cb(axisDim, axisIndex, axisModel, dataZoomModel);\n        });\n      });\n    }\n    // FIXME: it brings side-effect to `getTargetSeries`.\n    // Prepare axis proxies.\n    eachAxisModel(function (axisDim, axisIndex, axisModel, dataZoomModel) {\n      // dispose all last axis proxy, in case that some axis are deleted.\n      axisModel.__dzAxisProxy = null;\n    });\n    var proxyList = [];\n    eachAxisModel(function (axisDim, axisIndex, axisModel, dataZoomModel) {\n      // Different dataZooms may constrol the same axis. In that case,\n      // an axisProxy serves both of them.\n      if (!axisModel.__dzAxisProxy) {\n        // Use the first dataZoomModel as the main model of axisProxy.\n        axisModel.__dzAxisProxy = new AxisProxy(axisDim, axisIndex, dataZoomModel, ecModel);\n        proxyList.push(axisModel.__dzAxisProxy);\n      }\n    });\n    var seriesModelMap = createHashMap();\n    each(proxyList, function (axisProxy) {\n      each(axisProxy.getTargetSeriesModels(), function (seriesModel) {\n        seriesModelMap.set(seriesModel.uid, seriesModel);\n      });\n    });\n    return seriesModelMap;\n  },\n  // Consider appendData, where filter should be performed. Because data process is\n  // in block mode currently, it is not need to worry about that the overallProgress\n  // execute every frame.\n  overallReset: function (ecModel, api) {\n    ecModel.eachComponent('dataZoom', function (dataZoomModel) {\n      // We calculate window and reset axis here but not in model\n      // init stage and not after action dispatch handler, because\n      // reset should be called after seriesData.restoreData.\n      dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\n        dataZoomModel.getAxisProxy(axisDim, axisIndex).reset(dataZoomModel);\n      });\n      // Caution: data zoom filtering is order sensitive when using\n      // percent range and no min/max/scale set on axis.\n      // For example, we have dataZoom definition:\n      // [\n      //      {xAxisIndex: 0, start: 30, end: 70},\n      //      {yAxisIndex: 0, start: 20, end: 80}\n      // ]\n      // In this case, [20, 80] of y-dataZoom should be based on data\n      // that have filtered by x-dataZoom using range of [30, 70],\n      // but should not be based on full raw data. Thus sliding\n      // x-dataZoom will change both ranges of xAxis and yAxis,\n      // while sliding y-dataZoom will only change the range of yAxis.\n      // So we should filter x-axis after reset x-axis immediately,\n      // and then reset y-axis and filter y-axis.\n      dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\n        dataZoomModel.getAxisProxy(axisDim, axisIndex).filterData(dataZoomModel, api);\n      });\n    });\n    ecModel.eachComponent('dataZoom', function (dataZoomModel) {\n      // Fullfill all of the range props so that user\n      // is able to get them from chart.getOption().\n      var axisProxy = dataZoomModel.findRepresentativeAxisProxy();\n      if (axisProxy) {\n        var percentRange = axisProxy.getDataPercentWindow();\n        var valueRange = axisProxy.getDataValueWindow();\n        dataZoomModel.setCalculatedRange({\n          start: percentRange[0],\n          end: percentRange[1],\n          startValue: valueRange[0],\n          endValue: valueRange[1]\n        });\n      }\n    });\n  }\n};\nexport default dataZoomProcessor;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { findEffectedDataZooms } from './helper.js';\nimport { each } from 'zrender/lib/core/util.js';\nexport default function installDataZoomAction(registers) {\n  registers.registerAction('dataZoom', function (payload, ecModel) {\n    var effectedModels = findEffectedDataZooms(ecModel, payload);\n    each(effectedModels, function (dataZoomModel) {\n      dataZoomModel.setRawRange({\n        start: payload.start,\n        end: payload.end,\n        startValue: payload.startValue,\n        endValue: payload.endValue\n      });\n    });\n  });\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport dataZoomProcessor from './dataZoomProcessor.js';\nimport installDataZoomAction from './dataZoomAction.js';\nvar installed = false;\nexport default function installCommon(registers) {\n  if (installed) {\n    return;\n  }\n  installed = true;\n  registers.registerProcessor(registers.PRIORITY.PROCESSOR.FILTER, dataZoomProcessor);\n  installDataZoomAction(registers);\n  registers.registerSubTypeDefaulter('dataZoom', function () {\n    // Default 'slider' when no type specified.\n    return 'slider';\n  });\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport SelectZoomModel from './SelectZoomModel.js';\nimport SelectZoomView from './SelectZoomView.js';\nimport installCommon from './installCommon.js';\nexport function install(registers) {\n  registers.registerComponentModel(SelectZoomModel);\n  registers.registerComponentView(SelectZoomView);\n  installCommon(registers);\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\nvar ToolboxFeature = /** @class */function () {\n  function ToolboxFeature() {}\n  return ToolboxFeature;\n}();\nexport { ToolboxFeature };\nvar features = {};\nexport function registerFeature(name, ctor) {\n  features[name] = ctor;\n}\nexport function getFeature(name) {\n  return features[name];\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as featureManager from './featureManager.js';\nimport ComponentModel from '../../model/Component.js';\nimport tokens from '../../visual/tokens.js';\nvar ToolboxModel = /** @class */function (_super) {\n  __extends(ToolboxModel, _super);\n  function ToolboxModel() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = ToolboxModel.type;\n    return _this;\n  }\n  ToolboxModel.prototype.optionUpdated = function () {\n    _super.prototype.optionUpdated.apply(this, arguments);\n    var ecModel = this.ecModel;\n    zrUtil.each(this.option.feature, function (featureOpt, featureName) {\n      var Feature = featureManager.getFeature(featureName);\n      if (Feature) {\n        if (Feature.getDefaultOption) {\n          Feature.defaultOption = Feature.getDefaultOption(ecModel);\n        }\n        zrUtil.merge(featureOpt, Feature.defaultOption);\n      }\n    });\n  };\n  ToolboxModel.type = 'toolbox';\n  ToolboxModel.layoutMode = {\n    type: 'box',\n    ignoreSize: true\n  };\n  ToolboxModel.defaultOption = {\n    show: true,\n    z: 6,\n    // zlevel: 0,\n    orient: 'horizontal',\n    left: 'right',\n    top: 'top',\n    // right\n    // bottom\n    backgroundColor: 'transparent',\n    borderColor: tokens.color.border,\n    borderRadius: 0,\n    borderWidth: 0,\n    padding: tokens.size.m,\n    itemSize: 15,\n    itemGap: tokens.size.s,\n    showTitle: true,\n    iconStyle: {\n      borderColor: tokens.color.accent50,\n      color: 'none'\n    },\n    emphasis: {\n      iconStyle: {\n        borderColor: tokens.color.accent50\n      }\n    },\n    // textStyle: {},\n    // feature\n    tooltip: {\n      show: false,\n      position: 'bottom'\n    }\n  };\n  return ToolboxModel;\n}(ComponentModel);\nexport default ToolboxModel;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as formatUtil from '../../util/format.js';\nimport * as graphic from '../../util/graphic.js';\n;\nexport function makeBackground(rect, componentModel) {\n  var padding = formatUtil.normalizeCssArray(componentModel.get('padding'));\n  var style = componentModel.getItemStyle(['color', 'opacity']);\n  style.fill = componentModel.get('backgroundColor');\n  var bgRect = new graphic.Rect({\n    shape: {\n      x: rect.x - padding[3],\n      y: rect.y - padding[0],\n      width: rect.width + padding[1] + padding[3],\n      height: rect.height + padding[0] + padding[2],\n      r: componentModel.get('borderRadius')\n    },\n    style: style,\n    silent: true,\n    z2: -1\n  });\n  // FIXME\n  // `subPixelOptimizeRect` may bring some gap between edge of viewpart\n  // and background rect when setting like `left: 0`, `top: 0`.\n  // graphic.subPixelOptimizeRect(rect);\n  return bgRect;\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as textContain from 'zrender/lib/contain/text.js';\nimport * as graphic from '../../util/graphic.js';\nimport { enterEmphasis, leaveEmphasis } from '../../util/states.js';\nimport Model from '../../model/Model.js';\nimport DataDiffer from '../../data/DataDiffer.js';\nimport * as listComponentHelper from '../helper/listComponent.js';\nimport ComponentView from '../../view/Component.js';\nimport { ToolboxFeature, getFeature } from './featureManager.js';\nimport { getUID } from '../../util/component.js';\nimport ZRText from 'zrender/lib/graphic/Text.js';\nimport { getFont } from '../../label/labelStyle.js';\nimport { box, createBoxLayoutReference, getLayoutRect, positionElement } from '../../util/layout.js';\nimport tokens from '../../visual/tokens.js';\nvar ToolboxView = /** @class */function (_super) {\n  __extends(ToolboxView, _super);\n  function ToolboxView() {\n    return _super !== null && _super.apply(this, arguments) || this;\n  }\n  ToolboxView.prototype.render = function (toolboxModel, ecModel, api, payload) {\n    var group = this.group;\n    group.removeAll();\n    if (!toolboxModel.get('show')) {\n      return;\n    }\n    var itemSize = +toolboxModel.get('itemSize');\n    var isVertical = toolboxModel.get('orient') === 'vertical';\n    var featureOpts = toolboxModel.get('feature') || {};\n    var features = this._features || (this._features = {});\n    var featureNames = [];\n    zrUtil.each(featureOpts, function (opt, name) {\n      featureNames.push(name);\n    });\n    new DataDiffer(this._featureNames || [], featureNames).add(processFeature).update(processFeature).remove(zrUtil.curry(processFeature, null)).execute();\n    // Keep for diff.\n    this._featureNames = featureNames;\n    function processFeature(newIndex, oldIndex) {\n      var featureName = featureNames[newIndex];\n      var oldName = featureNames[oldIndex];\n      var featureOpt = featureOpts[featureName];\n      var featureModel = new Model(featureOpt, toolboxModel, toolboxModel.ecModel);\n      var feature;\n      // FIX#11236, merge feature title from MagicType newOption. TODO: consider seriesIndex ?\n      if (payload && payload.newTitle != null && payload.featureName === featureName) {\n        featureOpt.title = payload.newTitle;\n      }\n      if (featureName && !oldName) {\n        // Create\n        if (isUserFeatureName(featureName)) {\n          feature = {\n            onclick: featureModel.option.onclick,\n            featureName: featureName\n          };\n        } else {\n          var Feature = getFeature(featureName);\n          if (!Feature) {\n            return;\n          }\n          feature = new Feature();\n        }\n        features[featureName] = feature;\n      } else {\n        feature = features[oldName];\n        // If feature does not exist.\n        if (!feature) {\n          return;\n        }\n      }\n      feature.uid = getUID('toolbox-feature');\n      feature.model = featureModel;\n      feature.ecModel = ecModel;\n      feature.api = api;\n      var isToolboxFeature = feature instanceof ToolboxFeature;\n      if (!featureName && oldName) {\n        isToolboxFeature && feature.dispose && feature.dispose(ecModel, api);\n        return;\n      }\n      if (!featureModel.get('show') || isToolboxFeature && feature.unusable) {\n        isToolboxFeature && feature.remove && feature.remove(ecModel, api);\n        return;\n      }\n      createIconPaths(featureModel, feature, featureName);\n      featureModel.setIconStatus = function (iconName, status) {\n        var option = this.option;\n        var iconPaths = this.iconPaths;\n        option.iconStatus = option.iconStatus || {};\n        option.iconStatus[iconName] = status;\n        if (iconPaths[iconName]) {\n          (status === 'emphasis' ? enterEmphasis : leaveEmphasis)(iconPaths[iconName]);\n        }\n      };\n      if (feature instanceof ToolboxFeature) {\n        if (feature.render) {\n          feature.render(featureModel, ecModel, api, payload);\n        }\n      }\n    }\n    function createIconPaths(featureModel, feature, featureName) {\n      var iconStyleModel = featureModel.getModel('iconStyle');\n      var iconStyleEmphasisModel = featureModel.getModel(['emphasis', 'iconStyle']);\n      // If one feature has multiple icons, they are organized as\n      // {\n      //     icon: {\n      //         foo: '',\n      //         bar: ''\n      //     },\n      //     title: {\n      //         foo: '',\n      //         bar: ''\n      //     }\n      // }\n      var icons = feature instanceof ToolboxFeature && feature.getIcons ? feature.getIcons() : featureModel.get('icon');\n      var titles = featureModel.get('title') || {};\n      var iconsMap;\n      var titlesMap;\n      if (zrUtil.isString(icons)) {\n        iconsMap = {};\n        iconsMap[featureName] = icons;\n      } else {\n        iconsMap = icons;\n      }\n      if (zrUtil.isString(titles)) {\n        titlesMap = {};\n        titlesMap[featureName] = titles;\n      } else {\n        titlesMap = titles;\n      }\n      var iconPaths = featureModel.iconPaths = {};\n      zrUtil.each(iconsMap, function (iconStr, iconName) {\n        var path = graphic.createIcon(iconStr, {}, {\n          x: -itemSize / 2,\n          y: -itemSize / 2,\n          width: itemSize,\n          height: itemSize\n        }); // TODO handling image\n        path.setStyle(iconStyleModel.getItemStyle());\n        var pathEmphasisState = path.ensureState('emphasis');\n        pathEmphasisState.style = iconStyleEmphasisModel.getItemStyle();\n        // Text position calculation\n        // TODO: extract `textStyle` from `iconStyle` and use `createTextStyle`\n        var textContent = new ZRText({\n          style: {\n            text: titlesMap[iconName],\n            align: iconStyleEmphasisModel.get('textAlign'),\n            borderRadius: iconStyleEmphasisModel.get('textBorderRadius'),\n            padding: iconStyleEmphasisModel.get('textPadding'),\n            fill: null,\n            font: getFont({\n              fontStyle: iconStyleEmphasisModel.get('textFontStyle'),\n              fontFamily: iconStyleEmphasisModel.get('textFontFamily'),\n              fontSize: iconStyleEmphasisModel.get('textFontSize'),\n              fontWeight: iconStyleEmphasisModel.get('textFontWeight')\n            }, ecModel)\n          },\n          ignore: true\n        });\n        path.setTextContent(textContent);\n        graphic.setTooltipConfig({\n          el: path,\n          componentModel: toolboxModel,\n          itemName: iconName,\n          formatterParamsExtra: {\n            title: titlesMap[iconName]\n          }\n        });\n        path.__title = titlesMap[iconName];\n        path.on('mouseover', function () {\n          // Should not reuse above hoverStyle, which might be modified.\n          var hoverStyle = iconStyleEmphasisModel.getItemStyle();\n          var defaultTextPosition = isVertical ? toolboxModel.get('right') == null && toolboxModel.get('left') !== 'right' ? 'right' : 'left' : toolboxModel.get('bottom') == null && toolboxModel.get('top') !== 'bottom' ? 'bottom' : 'top';\n          textContent.setStyle({\n            fill: iconStyleEmphasisModel.get('textFill') || hoverStyle.fill || hoverStyle.stroke || tokens.color.neutral99,\n            backgroundColor: iconStyleEmphasisModel.get('textBackgroundColor')\n          });\n          path.setTextConfig({\n            position: iconStyleEmphasisModel.get('textPosition') || defaultTextPosition\n          });\n          textContent.ignore = !toolboxModel.get('showTitle');\n          // Use enterEmphasis and leaveEmphasis provide by ec.\n          // There are flags managed by the echarts.\n          api.enterEmphasis(this);\n        }).on('mouseout', function () {\n          if (featureModel.get(['iconStatus', iconName]) !== 'emphasis') {\n            api.leaveEmphasis(this);\n          }\n          textContent.hide();\n        });\n        (featureModel.get(['iconStatus', iconName]) === 'emphasis' ? enterEmphasis : leaveEmphasis)(path);\n        group.add(path);\n        path.on('click', zrUtil.bind(feature.onclick, feature, ecModel, api, iconName));\n        iconPaths[iconName] = path;\n      });\n    }\n    var refContainer = createBoxLayoutReference(toolboxModel, api).refContainer;\n    var boxLayoutParams = toolboxModel.getBoxLayoutParams();\n    var padding = toolboxModel.get('padding');\n    var viewRect = getLayoutRect(boxLayoutParams, refContainer, padding);\n    box(toolboxModel.get('orient'), group, toolboxModel.get('itemGap'), viewRect.width, viewRect.height);\n    positionElement(group, boxLayoutParams, refContainer, padding);\n    // Render background after group is layout\n    // FIXME\n    group.add(listComponentHelper.makeBackground(group.getBoundingRect(), toolboxModel));\n    // Adjust icon title positions to avoid them out of screen\n    isVertical || group.eachChild(function (icon) {\n      var titleText = icon.__title;\n      // const hoverStyle = icon.hoverStyle;\n      // TODO simplify code?\n      var emphasisState = icon.ensureState('emphasis');\n      var emphasisTextConfig = emphasisState.textConfig || (emphasisState.textConfig = {});\n      var textContent = icon.getTextContent();\n      var emphasisTextState = textContent && textContent.ensureState('emphasis');\n      // May be background element\n      if (emphasisTextState && !zrUtil.isFunction(emphasisTextState) && titleText) {\n        var emphasisTextStyle = emphasisTextState.style || (emphasisTextState.style = {});\n        var rect = textContain.getBoundingRect(titleText, ZRText.makeFont(emphasisTextStyle));\n        var offsetX = icon.x + group.x;\n        var offsetY = icon.y + group.y + itemSize;\n        var needPutOnTop = false;\n        if (offsetY + rect.height > api.getHeight()) {\n          emphasisTextConfig.position = 'top';\n          needPutOnTop = true;\n        }\n        var topOffset = needPutOnTop ? -5 - rect.height : itemSize + 10;\n        if (offsetX + rect.width / 2 > api.getWidth()) {\n          emphasisTextConfig.position = ['100%', topOffset];\n          emphasisTextStyle.align = 'right';\n        } else if (offsetX - rect.width / 2 < 0) {\n          emphasisTextConfig.position = [0, topOffset];\n          emphasisTextStyle.align = 'left';\n        }\n      }\n    });\n  };\n  ToolboxView.prototype.updateView = function (toolboxModel, ecModel, api, payload) {\n    zrUtil.each(this._features, function (feature) {\n      feature instanceof ToolboxFeature && feature.updateView && feature.updateView(feature.model, ecModel, api, payload);\n    });\n  };\n  // updateLayout(toolboxModel, ecModel, api, payload) {\n  //     zrUtil.each(this._features, function (feature) {\n  //         feature.updateLayout && feature.updateLayout(feature.model, ecModel, api, payload);\n  //     });\n  // },\n  ToolboxView.prototype.remove = function (ecModel, api) {\n    zrUtil.each(this._features, function (feature) {\n      feature instanceof ToolboxFeature && feature.remove && feature.remove(ecModel, api);\n    });\n    this.group.removeAll();\n  };\n  ToolboxView.prototype.dispose = function (ecModel, api) {\n    zrUtil.each(this._features, function (feature) {\n      feature instanceof ToolboxFeature && feature.dispose && feature.dispose(ecModel, api);\n    });\n  };\n  ToolboxView.type = 'toolbox';\n  return ToolboxView;\n}(ComponentView);\nfunction isUserFeatureName(featureName) {\n  return featureName.indexOf('my') === 0;\n}\nexport default ToolboxView;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\n/* global window, Uint8Array, document */\nimport env from 'zrender/lib/core/env.js';\nimport { ToolboxFeature } from '../featureManager.js';\nimport tokens from '../../../visual/tokens.js';\nvar SaveAsImage = /** @class */function (_super) {\n  __extends(SaveAsImage, _super);\n  function SaveAsImage() {\n    return _super !== null && _super.apply(this, arguments) || this;\n  }\n  SaveAsImage.prototype.onclick = function (ecModel, api) {\n    var model = this.model;\n    var title = model.get('name') || ecModel.get('title.0.text') || 'echarts';\n    var isSvg = api.getZr().painter.getType() === 'svg';\n    var type = isSvg ? 'svg' : model.get('type', true) || 'png';\n    var url = api.getConnectedDataURL({\n      type: type,\n      backgroundColor: model.get('backgroundColor', true) || ecModel.get('backgroundColor') || tokens.color.neutral00,\n      connectedBackgroundColor: model.get('connectedBackgroundColor'),\n      excludeComponents: model.get('excludeComponents'),\n      pixelRatio: model.get('pixelRatio')\n    });\n    var browser = env.browser;\n    // Chrome, Firefox, New Edge\n    if (typeof MouseEvent === 'function' && (browser.newEdge || !browser.ie && !browser.edge)) {\n      var $a = document.createElement('a');\n      $a.download = title + '.' + type;\n      $a.target = '_blank';\n      $a.href = url;\n      var evt = new MouseEvent('click', {\n        // some micro front-end framework\uFF0C window maybe is a Proxy\n        view: document.defaultView,\n        bubbles: true,\n        cancelable: false\n      });\n      $a.dispatchEvent(evt);\n    }\n    // IE or old Edge\n    else {\n      // @ts-ignore\n      if (window.navigator.msSaveOrOpenBlob || isSvg) {\n        var parts = url.split(',');\n        // data:[<mime type>][;charset=<charset>][;base64],<encoded data>\n        var base64Encoded = parts[0].indexOf('base64') > -1;\n        var bstr = isSvg\n        // should decode the svg data uri first\n        ? decodeURIComponent(parts[1]) : parts[1];\n        // only `atob` when the data uri is encoded with base64\n        // otherwise, like `svg` data uri exported by zrender,\n        // there will be an error, for it's not encoded with base64.\n        // (just a url-encoded string through `encodeURIComponent`)\n        base64Encoded && (bstr = window.atob(bstr));\n        var filename = title + '.' + type;\n        // @ts-ignore\n        if (window.navigator.msSaveOrOpenBlob) {\n          var n = bstr.length;\n          var u8arr = new Uint8Array(n);\n          while (n--) {\n            u8arr[n] = bstr.charCodeAt(n);\n          }\n          var blob = new Blob([u8arr]); // @ts-ignore\n          window.navigator.msSaveOrOpenBlob(blob, filename);\n        } else {\n          var frame = document.createElement('iframe');\n          document.body.appendChild(frame);\n          var cw = frame.contentWindow;\n          var doc = cw.document;\n          doc.open('image/svg+xml', 'replace');\n          doc.write(bstr);\n          doc.close();\n          cw.focus();\n          doc.execCommand('SaveAs', true, filename);\n          document.body.removeChild(frame);\n        }\n      } else {\n        var lang = model.get('lang');\n        var html = '' + '<body style=\"margin:0;\">' + '<img src=\"' + url + '\" style=\"max-width:100%;\" title=\"' + (lang && lang[0] || '') + '\" />' + '</body>';\n        var tab = window.open();\n        tab.document.write(html);\n        tab.document.title = title;\n      }\n    }\n  };\n  SaveAsImage.getDefaultOption = function (ecModel) {\n    var defaultOption = {\n      show: true,\n      icon: 'M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0',\n      title: ecModel.getLocaleModel().get(['toolbox', 'saveAsImage', 'title']),\n      type: 'png',\n      // Default use option.backgroundColor\n      // backgroundColor: '#fff',\n      connectedBackgroundColor: tokens.color.neutral00,\n      name: '',\n      excludeComponents: ['toolbox'],\n      // use current pixel ratio of device by default\n      // pixelRatio: 1,\n      lang: ecModel.getLocaleModel().get(['toolbox', 'saveAsImage', 'lang'])\n    };\n    return defaultOption;\n  };\n  return SaveAsImage;\n}(ToolboxFeature);\nexport default SaveAsImage;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as echarts from '../../../core/echarts.js';\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { ToolboxFeature } from '../featureManager.js';\nimport { SINGLE_REFERRING } from '../../../util/model.js';\nvar INNER_STACK_KEYWORD = '__ec_magicType_stack__';\nvar ICON_TYPES = ['line', 'bar', 'stack'];\n// stack and tiled appears in pair for the title\nvar TITLE_TYPES = ['line', 'bar', 'stack', 'tiled'];\nvar radioTypes = [['line', 'bar'], ['stack']];\nvar MagicType = /** @class */function (_super) {\n  __extends(MagicType, _super);\n  function MagicType() {\n    return _super !== null && _super.apply(this, arguments) || this;\n  }\n  MagicType.prototype.getIcons = function () {\n    var model = this.model;\n    var availableIcons = model.get('icon');\n    var icons = {};\n    zrUtil.each(model.get('type'), function (type) {\n      if (availableIcons[type]) {\n        icons[type] = availableIcons[type];\n      }\n    });\n    return icons;\n  };\n  MagicType.getDefaultOption = function (ecModel) {\n    var defaultOption = {\n      show: true,\n      type: [],\n      // Icon group\n      icon: {\n        line: 'M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4',\n        bar: 'M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7',\n        // eslint-disable-next-line\n        stack: 'M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z' // jshint ignore:line\n      },\n      // `line`, `bar`, `stack`, `tiled`\n      title: ecModel.getLocaleModel().get(['toolbox', 'magicType', 'title']),\n      option: {},\n      seriesIndex: {}\n    };\n    return defaultOption;\n  };\n  MagicType.prototype.onclick = function (ecModel, api, type) {\n    var model = this.model;\n    var seriesIndex = model.get(['seriesIndex', type]);\n    // Not supported magicType\n    if (!seriesOptGenreator[type]) {\n      return;\n    }\n    var newOption = {\n      series: []\n    };\n    var generateNewSeriesTypes = function (seriesModel) {\n      var seriesType = seriesModel.subType;\n      var seriesId = seriesModel.id;\n      var newSeriesOpt = seriesOptGenreator[type](seriesType, seriesId, seriesModel, model);\n      if (newSeriesOpt) {\n        // PENDING If merge original option?\n        zrUtil.defaults(newSeriesOpt, seriesModel.option);\n        newOption.series.push(newSeriesOpt);\n      }\n      // Modify boundaryGap\n      var coordSys = seriesModel.coordinateSystem;\n      if (coordSys && coordSys.type === 'cartesian2d' && (type === 'line' || type === 'bar')) {\n        var categoryAxis = coordSys.getAxesByScale('ordinal')[0];\n        if (categoryAxis) {\n          var axisDim = categoryAxis.dim;\n          var axisType = axisDim + 'Axis';\n          var axisModel = seriesModel.getReferringComponents(axisType, SINGLE_REFERRING).models[0];\n          var axisIndex = axisModel.componentIndex;\n          newOption[axisType] = newOption[axisType] || [];\n          for (var i = 0; i <= axisIndex; i++) {\n            newOption[axisType][axisIndex] = newOption[axisType][axisIndex] || {};\n          }\n          newOption[axisType][axisIndex].boundaryGap = type === 'bar';\n        }\n      }\n    };\n    zrUtil.each(radioTypes, function (radio) {\n      if (zrUtil.indexOf(radio, type) >= 0) {\n        zrUtil.each(radio, function (item) {\n          model.setIconStatus(item, 'normal');\n        });\n      }\n    });\n    model.setIconStatus(type, 'emphasis');\n    ecModel.eachComponent({\n      mainType: 'series',\n      query: seriesIndex == null ? null : {\n        seriesIndex: seriesIndex\n      }\n    }, generateNewSeriesTypes);\n    var newTitle;\n    var currentType = type;\n    // Change title of stack\n    if (type === 'stack') {\n      // use titles in model instead of ecModel\n      // as stack and tiled appears in pair, just flip them\n      // no need of checking stack state\n      newTitle = zrUtil.merge({\n        stack: model.option.title.tiled,\n        tiled: model.option.title.stack\n      }, model.option.title);\n      if (model.get(['iconStatus', type]) !== 'emphasis') {\n        currentType = 'tiled';\n      }\n    }\n    api.dispatchAction({\n      type: 'changeMagicType',\n      currentType: currentType,\n      newOption: newOption,\n      newTitle: newTitle,\n      featureName: 'magicType'\n    });\n  };\n  return MagicType;\n}(ToolboxFeature);\nvar seriesOptGenreator = {\n  'line': function (seriesType, seriesId, seriesModel, model) {\n    if (seriesType === 'bar') {\n      return zrUtil.merge({\n        id: seriesId,\n        type: 'line',\n        // Preserve data related option\n        data: seriesModel.get('data'),\n        stack: seriesModel.get('stack'),\n        markPoint: seriesModel.get('markPoint'),\n        markLine: seriesModel.get('markLine')\n      }, model.get(['option', 'line']) || {}, true);\n    }\n  },\n  'bar': function (seriesType, seriesId, seriesModel, model) {\n    if (seriesType === 'line') {\n      return zrUtil.merge({\n        id: seriesId,\n        type: 'bar',\n        // Preserve data related option\n        data: seriesModel.get('data'),\n        stack: seriesModel.get('stack'),\n        markPoint: seriesModel.get('markPoint'),\n        markLine: seriesModel.get('markLine')\n      }, model.get(['option', 'bar']) || {}, true);\n    }\n  },\n  'stack': function (seriesType, seriesId, seriesModel, model) {\n    var isStack = seriesModel.get('stack') === INNER_STACK_KEYWORD;\n    if (seriesType === 'line' || seriesType === 'bar') {\n      model.setIconStatus('stack', isStack ? 'normal' : 'emphasis');\n      return zrUtil.merge({\n        id: seriesId,\n        stack: isStack ? '' : INNER_STACK_KEYWORD\n      }, model.get(['option', 'stack']) || {}, true);\n    }\n  }\n};\n// TODO: SELF REGISTERED.\necharts.registerAction({\n  type: 'changeMagicType',\n  event: 'magicTypeChanged',\n  update: 'prepareAndUpdate'\n}, function (payload, ecModel) {\n  ecModel.mergeOption(payload.newOption);\n});\nexport default MagicType;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\n/* global document */\nimport * as echarts from '../../../core/echarts.js';\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { ToolboxFeature } from '../featureManager.js';\nimport { addEventListener } from 'zrender/lib/core/event.js';\nimport { warn } from '../../../util/log.js';\nimport tokens from '../../../visual/tokens.js';\n/* global document */\nvar BLOCK_SPLITER = new Array(60).join('-');\nvar ITEM_SPLITER = '\\t';\n/**\n * Group series into two types\n *  1. on category axis, like line, bar\n *  2. others, like scatter, pie\n */\nfunction groupSeries(ecModel) {\n  var seriesGroupByCategoryAxis = {};\n  var otherSeries = [];\n  var meta = [];\n  ecModel.eachRawSeries(function (seriesModel) {\n    var coordSys = seriesModel.coordinateSystem;\n    if (coordSys && (coordSys.type === 'cartesian2d' || coordSys.type === 'polar')) {\n      // TODO: TYPE Consider polar? Include polar may increase unecessary bundle size.\n      var baseAxis = coordSys.getBaseAxis();\n      if (baseAxis.type === 'category') {\n        var key = baseAxis.dim + '_' + baseAxis.index;\n        if (!seriesGroupByCategoryAxis[key]) {\n          seriesGroupByCategoryAxis[key] = {\n            categoryAxis: baseAxis,\n            valueAxis: coordSys.getOtherAxis(baseAxis),\n            series: []\n          };\n          meta.push({\n            axisDim: baseAxis.dim,\n            axisIndex: baseAxis.index\n          });\n        }\n        seriesGroupByCategoryAxis[key].series.push(seriesModel);\n      } else {\n        otherSeries.push(seriesModel);\n      }\n    } else {\n      otherSeries.push(seriesModel);\n    }\n  });\n  return {\n    seriesGroupByCategoryAxis: seriesGroupByCategoryAxis,\n    other: otherSeries,\n    meta: meta\n  };\n}\n/**\n * Assemble content of series on cateogory axis\n * @inner\n */\nfunction assembleSeriesWithCategoryAxis(groups) {\n  var tables = [];\n  zrUtil.each(groups, function (group, key) {\n    var categoryAxis = group.categoryAxis;\n    var valueAxis = group.valueAxis;\n    var valueAxisDim = valueAxis.dim;\n    var headers = [' '].concat(zrUtil.map(group.series, function (series) {\n      return series.name;\n    }));\n    // @ts-ignore TODO Polar\n    var columns = [categoryAxis.model.getCategories()];\n    zrUtil.each(group.series, function (series) {\n      var rawData = series.getRawData();\n      columns.push(series.getRawData().mapArray(rawData.mapDimension(valueAxisDim), function (val) {\n        return val;\n      }));\n    });\n    // Assemble table content\n    var lines = [headers.join(ITEM_SPLITER)];\n    for (var i = 0; i < columns[0].length; i++) {\n      var items = [];\n      for (var j = 0; j < columns.length; j++) {\n        items.push(columns[j][i]);\n      }\n      lines.push(items.join(ITEM_SPLITER));\n    }\n    tables.push(lines.join('\\n'));\n  });\n  return tables.join('\\n\\n' + BLOCK_SPLITER + '\\n\\n');\n}\n/**\n * Assemble content of other series\n */\nfunction assembleOtherSeries(series) {\n  return zrUtil.map(series, function (series) {\n    var data = series.getRawData();\n    var lines = [series.name];\n    var vals = [];\n    data.each(data.dimensions, function () {\n      var argLen = arguments.length;\n      var dataIndex = arguments[argLen - 1];\n      var name = data.getName(dataIndex);\n      for (var i = 0; i < argLen - 1; i++) {\n        vals[i] = arguments[i];\n      }\n      lines.push((name ? name + ITEM_SPLITER : '') + vals.join(ITEM_SPLITER));\n    });\n    return lines.join('\\n');\n  }).join('\\n\\n' + BLOCK_SPLITER + '\\n\\n');\n}\nfunction getContentFromModel(ecModel) {\n  var result = groupSeries(ecModel);\n  return {\n    value: zrUtil.filter([assembleSeriesWithCategoryAxis(result.seriesGroupByCategoryAxis), assembleOtherSeries(result.other)], function (str) {\n      return !!str.replace(/[\\n\\t\\s]/g, '');\n    }).join('\\n\\n' + BLOCK_SPLITER + '\\n\\n'),\n    meta: result.meta\n  };\n}\nfunction trim(str) {\n  return str.replace(/^\\s\\s*/, '').replace(/\\s\\s*$/, '');\n}\n/**\n * If a block is tsv format\n */\nfunction isTSVFormat(block) {\n  // Simple method to find out if a block is tsv format\n  var firstLine = block.slice(0, block.indexOf('\\n'));\n  if (firstLine.indexOf(ITEM_SPLITER) >= 0) {\n    return true;\n  }\n}\nvar itemSplitRegex = new RegExp('[' + ITEM_SPLITER + ']+', 'g');\n/**\n * @param {string} tsv\n * @return {Object}\n */\nfunction parseTSVContents(tsv) {\n  var tsvLines = tsv.split(/\\n+/g);\n  var headers = trim(tsvLines.shift()).split(itemSplitRegex);\n  var categories = [];\n  var series = zrUtil.map(headers, function (header) {\n    return {\n      name: header,\n      data: []\n    };\n  });\n  for (var i = 0; i < tsvLines.length; i++) {\n    var items = trim(tsvLines[i]).split(itemSplitRegex);\n    categories.push(items.shift());\n    for (var j = 0; j < items.length; j++) {\n      series[j] && (series[j].data[i] = items[j]);\n    }\n  }\n  return {\n    series: series,\n    categories: categories\n  };\n}\nfunction parseListContents(str) {\n  var lines = str.split(/\\n+/g);\n  var seriesName = trim(lines.shift());\n  var data = [];\n  for (var i = 0; i < lines.length; i++) {\n    // if line is empty, ignore it.\n    // there is a case that a user forgot to delete `\\n`.\n    var line = trim(lines[i]);\n    if (!line) {\n      continue;\n    }\n    var items = line.split(itemSplitRegex);\n    var name_1 = '';\n    var value = void 0;\n    var hasName = false;\n    if (isNaN(items[0])) {\n      // First item is name\n      hasName = true;\n      name_1 = items[0];\n      items = items.slice(1);\n      data[i] = {\n        name: name_1,\n        value: []\n      };\n      value = data[i].value;\n    } else {\n      value = data[i] = [];\n    }\n    for (var j = 0; j < items.length; j++) {\n      value.push(+items[j]);\n    }\n    if (value.length === 1) {\n      hasName ? data[i].value = value[0] : data[i] = value[0];\n    }\n  }\n  return {\n    name: seriesName,\n    data: data\n  };\n}\nfunction parseContents(str, blockMetaList) {\n  var blocks = str.split(new RegExp('\\n*' + BLOCK_SPLITER + '\\n*', 'g'));\n  var newOption = {\n    series: []\n  };\n  zrUtil.each(blocks, function (block, idx) {\n    if (isTSVFormat(block)) {\n      var result = parseTSVContents(block);\n      var blockMeta = blockMetaList[idx];\n      var axisKey = blockMeta.axisDim + 'Axis';\n      if (blockMeta) {\n        newOption[axisKey] = newOption[axisKey] || [];\n        newOption[axisKey][blockMeta.axisIndex] = {\n          data: result.categories\n        };\n        newOption.series = newOption.series.concat(result.series);\n      }\n    } else {\n      var result = parseListContents(block);\n      newOption.series.push(result);\n    }\n  });\n  return newOption;\n}\nvar DataView = /** @class */function (_super) {\n  __extends(DataView, _super);\n  function DataView() {\n    return _super !== null && _super.apply(this, arguments) || this;\n  }\n  DataView.prototype.onclick = function (ecModel, api) {\n    // FIXME: better way?\n    setTimeout(function () {\n      api.dispatchAction({\n        type: 'hideTip'\n      });\n    });\n    var container = api.getDom();\n    var model = this.model;\n    if (this._dom) {\n      container.removeChild(this._dom);\n    }\n    var root = document.createElement('div');\n    // use padding to avoid 5px whitespace\n    root.style.cssText = 'position:absolute;top:0;bottom:0;left:0;right:0;padding:5px';\n    root.style.backgroundColor = model.get('backgroundColor') || tokens.color.neutral00;\n    // Create elements\n    var header = document.createElement('h4');\n    var lang = model.get('lang') || [];\n    header.innerHTML = lang[0] || model.get('title');\n    header.style.cssText = 'margin:10px 20px';\n    header.style.color = model.get('textColor');\n    var viewMain = document.createElement('div');\n    var textarea = document.createElement('textarea');\n    viewMain.style.cssText = 'overflow:auto';\n    var optionToContent = model.get('optionToContent');\n    var contentToOption = model.get('contentToOption');\n    var result = getContentFromModel(ecModel);\n    if (zrUtil.isFunction(optionToContent)) {\n      var htmlOrDom = optionToContent(api.getOption());\n      if (zrUtil.isString(htmlOrDom)) {\n        viewMain.innerHTML = htmlOrDom;\n      } else if (zrUtil.isDom(htmlOrDom)) {\n        viewMain.appendChild(htmlOrDom);\n      }\n    } else {\n      // Use default textarea\n      textarea.readOnly = model.get('readOnly');\n      var style = textarea.style;\n      // eslint-disable-next-line max-len\n      style.cssText = 'display:block;width:100%;height:100%;font-family:monospace;font-size:14px;line-height:1.6rem;resize:none;box-sizing:border-box;outline:none';\n      style.color = model.get('textColor');\n      style.borderColor = model.get('textareaBorderColor');\n      style.backgroundColor = model.get('textareaColor');\n      textarea.value = result.value;\n      viewMain.appendChild(textarea);\n    }\n    var blockMetaList = result.meta;\n    var buttonContainer = document.createElement('div');\n    buttonContainer.style.cssText = 'position:absolute;bottom:5px;left:0;right:0';\n    // eslint-disable-next-line max-len\n    var buttonStyle = 'float:right;margin-right:20px;border:none;cursor:pointer;padding:2px 5px;font-size:12px;border-radius:3px';\n    var closeButton = document.createElement('div');\n    var refreshButton = document.createElement('div');\n    buttonStyle += ';background-color:' + model.get('buttonColor');\n    buttonStyle += ';color:' + model.get('buttonTextColor');\n    var self = this;\n    function close() {\n      container.removeChild(root);\n      self._dom = null;\n    }\n    addEventListener(closeButton, 'click', close);\n    addEventListener(refreshButton, 'click', function () {\n      if (contentToOption == null && optionToContent != null || contentToOption != null && optionToContent == null) {\n        if (process.env.NODE_ENV !== 'production') {\n          // eslint-disable-next-line\n          warn('It seems you have just provided one of `contentToOption` and `optionToContent` functions but missed the other one. Data change is ignored.');\n        }\n        close();\n        return;\n      }\n      var newOption;\n      try {\n        if (zrUtil.isFunction(contentToOption)) {\n          newOption = contentToOption(viewMain, api.getOption());\n        } else {\n          newOption = parseContents(textarea.value, blockMetaList);\n        }\n      } catch (e) {\n        close();\n        throw new Error('Data view format error ' + e);\n      }\n      if (newOption) {\n        api.dispatchAction({\n          type: 'changeDataView',\n          newOption: newOption\n        });\n      }\n      close();\n    });\n    closeButton.innerHTML = lang[1];\n    refreshButton.innerHTML = lang[2];\n    refreshButton.style.cssText = closeButton.style.cssText = buttonStyle;\n    !model.get('readOnly') && buttonContainer.appendChild(refreshButton);\n    buttonContainer.appendChild(closeButton);\n    root.appendChild(header);\n    root.appendChild(viewMain);\n    root.appendChild(buttonContainer);\n    viewMain.style.height = container.clientHeight - 80 + 'px';\n    container.appendChild(root);\n    this._dom = root;\n  };\n  DataView.prototype.remove = function (ecModel, api) {\n    this._dom && api.getDom().removeChild(this._dom);\n  };\n  DataView.prototype.dispose = function (ecModel, api) {\n    this.remove(ecModel, api);\n  };\n  DataView.getDefaultOption = function (ecModel) {\n    var defaultOption = {\n      show: true,\n      readOnly: false,\n      optionToContent: null,\n      contentToOption: null,\n      // eslint-disable-next-line\n      icon: 'M17.5,17.3H33 M17.5,17.3H33 M45.4,29.5h-28 M11.5,2v56H51V14.8L38.4,2H11.5z M38.4,2.2v12.7H51 M45.4,41.7h-28',\n      title: ecModel.getLocaleModel().get(['toolbox', 'dataView', 'title']),\n      lang: ecModel.getLocaleModel().get(['toolbox', 'dataView', 'lang']),\n      backgroundColor: tokens.color.background,\n      textColor: tokens.color.primary,\n      textareaColor: tokens.color.background,\n      textareaBorderColor: tokens.color.border,\n      buttonColor: tokens.color.accent50,\n      buttonTextColor: tokens.color.neutral00\n    };\n    return defaultOption;\n  };\n  return DataView;\n}(ToolboxFeature);\n/**\n * @inner\n */\nfunction tryMergeDataOption(newData, originalData) {\n  return zrUtil.map(newData, function (newVal, idx) {\n    var original = originalData && originalData[idx];\n    if (zrUtil.isObject(original) && !zrUtil.isArray(original)) {\n      var newValIsObject = zrUtil.isObject(newVal) && !zrUtil.isArray(newVal);\n      if (!newValIsObject) {\n        newVal = {\n          value: newVal\n        };\n      }\n      // original data has name but new data has no name\n      var shouldDeleteName = original.name != null && newVal.name == null;\n      // Original data has option\n      newVal = zrUtil.defaults(newVal, original);\n      shouldDeleteName && delete newVal.name;\n      return newVal;\n    } else {\n      return newVal;\n    }\n  });\n}\n// TODO: SELF REGISTERED.\necharts.registerAction({\n  type: 'changeDataView',\n  event: 'dataViewChanged',\n  update: 'prepareAndUpdate'\n}, function (payload, ecModel) {\n  var newSeriesOptList = [];\n  zrUtil.each(payload.newOption.series, function (seriesOpt) {\n    var seriesModel = ecModel.getSeriesByName(seriesOpt.name)[0];\n    if (!seriesModel) {\n      // New created series\n      // Geuss the series type\n      newSeriesOptList.push(zrUtil.extend({\n        // Default is scatter\n        type: 'scatter'\n      }, seriesOpt));\n    } else {\n      var originalData = seriesModel.get('data');\n      newSeriesOptList.push({\n        name: seriesOpt.name,\n        data: tryMergeDataOption(seriesOpt.data, originalData)\n      });\n    }\n  });\n  ecModel.mergeOption(zrUtil.defaults({\n    series: newSeriesOptList\n  }, payload.newOption));\n});\nexport default DataView;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { makeInner } from '../../util/model.js';\nvar each = zrUtil.each;\nvar inner = makeInner();\n/**\n * @param ecModel\n * @param newSnapshot key is dataZoomId\n */\nexport function push(ecModel, newSnapshot) {\n  var storedSnapshots = getStoreSnapshots(ecModel);\n  // If previous dataZoom can not be found,\n  // complete an range with current range.\n  each(newSnapshot, function (batchItem, dataZoomId) {\n    var i = storedSnapshots.length - 1;\n    for (; i >= 0; i--) {\n      var snapshot = storedSnapshots[i];\n      if (snapshot[dataZoomId]) {\n        break;\n      }\n    }\n    if (i < 0) {\n      // No origin range set, create one by current range.\n      var dataZoomModel = ecModel.queryComponents({\n        mainType: 'dataZoom',\n        subType: 'select',\n        id: dataZoomId\n      })[0];\n      if (dataZoomModel) {\n        var percentRange = dataZoomModel.getPercentRange();\n        storedSnapshots[0][dataZoomId] = {\n          dataZoomId: dataZoomId,\n          start: percentRange[0],\n          end: percentRange[1]\n        };\n      }\n    }\n  });\n  storedSnapshots.push(newSnapshot);\n}\nexport function pop(ecModel) {\n  var storedSnapshots = getStoreSnapshots(ecModel);\n  var head = storedSnapshots[storedSnapshots.length - 1];\n  storedSnapshots.length > 1 && storedSnapshots.pop();\n  // Find top for all dataZoom.\n  var snapshot = {};\n  each(head, function (batchItem, dataZoomId) {\n    for (var i = storedSnapshots.length - 1; i >= 0; i--) {\n      batchItem = storedSnapshots[i][dataZoomId];\n      if (batchItem) {\n        snapshot[dataZoomId] = batchItem;\n        break;\n      }\n    }\n  });\n  return snapshot;\n}\nexport function clear(ecModel) {\n  inner(ecModel).snapshots = null;\n}\nexport function count(ecModel) {\n  return getStoreSnapshots(ecModel).length;\n}\n/**\n * History length of each dataZoom may be different.\n * this._history[0] is used to store origin range.\n */\nfunction getStoreSnapshots(ecModel) {\n  var store = inner(ecModel);\n  if (!store.snapshots) {\n    store.snapshots = [{}];\n  }\n  return store.snapshots;\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as echarts from '../../../core/echarts.js';\nimport * as history from '../../dataZoom/history.js';\nimport { ToolboxFeature } from '../featureManager.js';\nvar RestoreOption = /** @class */function (_super) {\n  __extends(RestoreOption, _super);\n  function RestoreOption() {\n    return _super !== null && _super.apply(this, arguments) || this;\n  }\n  RestoreOption.prototype.onclick = function (ecModel, api) {\n    history.clear(ecModel);\n    api.dispatchAction({\n      type: 'restore',\n      from: this.uid\n    });\n  };\n  RestoreOption.getDefaultOption = function (ecModel) {\n    var defaultOption = {\n      show: true,\n      // eslint-disable-next-line\n      icon: 'M3.8,33.4 M47,18.9h9.8V8.7 M56.3,20.1 C52.1,9,40.5,0.6,26.8,2.1C12.6,3.7,1.6,16.2,2.1,30.6 M13,41.1H3.1v10.2 M3.7,39.9c4.2,11.1,15.8,19.5,29.5,18 c14.2-1.6,25.2-14.1,24.7-28.5',\n      title: ecModel.getLocaleModel().get(['toolbox', 'restore', 'title'])\n    };\n    return defaultOption;\n  };\n  return RestoreOption;\n}(ToolboxFeature);\n// TODO: SELF REGISTERED.\necharts.registerAction({\n  type: 'restore',\n  event: 'restore',\n  update: 'prepareAndUpdate'\n}, function (payload, ecModel) {\n  ecModel.resetOption('recreate');\n});\nexport default RestoreOption;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { each, indexOf, curry, assert, map, createHashMap } from 'zrender/lib/core/util.js';\nimport * as graphic from '../../util/graphic.js';\nimport * as brushHelper from './brushHelper.js';\nimport { parseFinder as modelUtilParseFinder } from '../../util/model.js';\n// FIXME\n// how to genarialize to more coordinate systems.\nvar INCLUDE_FINDER_MAIN_TYPES = ['grid', 'xAxis', 'yAxis', 'geo', 'graph', 'polar', 'radiusAxis', 'angleAxis', 'bmap'];\nvar BrushTargetManager = /** @class */function () {\n  /**\n   * @param finder contains Index/Id/Name of xAxis/yAxis/geo/grid\n   *        Each can be {number|Array.<number>}. like: {xAxisIndex: [3, 4]}\n   * @param opt.include include coordinate system types.\n   */\n  function BrushTargetManager(finder, ecModel, opt) {\n    var _this = this;\n    this._targetInfoList = [];\n    var foundCpts = parseFinder(ecModel, finder);\n    each(targetInfoBuilders, function (builder, type) {\n      if (!opt || !opt.include || indexOf(opt.include, type) >= 0) {\n        builder(foundCpts, _this._targetInfoList);\n      }\n    });\n  }\n  BrushTargetManager.prototype.setOutputRanges = function (areas, ecModel) {\n    this.matchOutputRanges(areas, ecModel, function (area, coordRange, coordSys) {\n      (area.coordRanges || (area.coordRanges = [])).push(coordRange);\n      // area.coordRange is the first of area.coordRanges\n      if (!area.coordRange) {\n        area.coordRange = coordRange;\n        // In 'category' axis, coord to pixel is not reversible, so we can not\n        // rebuild range by coordRange accrately, which may bring trouble when\n        // brushing only one item. So we use __rangeOffset to rebuilding range\n        // by coordRange. And this it only used in brush component so it is no\n        // need to be adapted to coordRanges.\n        var result = coordConvert[area.brushType](0, coordSys, coordRange);\n        area.__rangeOffset = {\n          offset: diffProcessor[area.brushType](result.values, area.range, [1, 1]),\n          xyMinMax: result.xyMinMax\n        };\n      }\n    });\n    return areas;\n  };\n  BrushTargetManager.prototype.matchOutputRanges = function (areas, ecModel, cb) {\n    each(areas, function (area) {\n      var targetInfo = this.findTargetInfo(area, ecModel);\n      if (targetInfo && targetInfo !== true) {\n        each(targetInfo.coordSyses, function (coordSys) {\n          var result = coordConvert[area.brushType](1, coordSys, area.range, true);\n          cb(area, result.values, coordSys, ecModel);\n        });\n      }\n    }, this);\n  };\n  /**\n   * the `areas` is `BrushModel.areas`.\n   * Called in layout stage.\n   * convert `area.coordRange` to global range and set panelId to `area.range`.\n   */\n  BrushTargetManager.prototype.setInputRanges = function (areas, ecModel) {\n    each(areas, function (area) {\n      var targetInfo = this.findTargetInfo(area, ecModel);\n      if (process.env.NODE_ENV !== 'production') {\n        assert(!targetInfo || targetInfo === true || area.coordRange, 'coordRange must be specified when coord index specified.');\n        assert(!targetInfo || targetInfo !== true || area.range, 'range must be specified in global brush.');\n      }\n      area.range = area.range || [];\n      // convert coordRange to global range and set panelId.\n      if (targetInfo && targetInfo !== true) {\n        area.panelId = targetInfo.panelId;\n        // (1) area.range should always be calculate from coordRange but does\n        // not keep its original value, for the sake of the dataZoom scenario,\n        // where area.coordRange remains unchanged but area.range may be changed.\n        // (2) Only support converting one coordRange to pixel range in brush\n        // component. So do not consider `coordRanges`.\n        // (3) About __rangeOffset, see comment above.\n        var result = coordConvert[area.brushType](0, targetInfo.coordSys, area.coordRange);\n        var rangeOffset = area.__rangeOffset;\n        area.range = rangeOffset ? diffProcessor[area.brushType](result.values, rangeOffset.offset, getScales(result.xyMinMax, rangeOffset.xyMinMax)) : result.values;\n      }\n    }, this);\n  };\n  BrushTargetManager.prototype.makePanelOpts = function (api, getDefaultBrushType) {\n    return map(this._targetInfoList, function (targetInfo) {\n      var rect = targetInfo.getPanelRect();\n      return {\n        panelId: targetInfo.panelId,\n        defaultBrushType: getDefaultBrushType ? getDefaultBrushType(targetInfo) : null,\n        clipPath: brushHelper.makeRectPanelClipPath(rect),\n        isTargetByCursor: brushHelper.makeRectIsTargetByCursor(rect, api, targetInfo.coordSysModel),\n        getLinearBrushOtherExtent: brushHelper.makeLinearBrushOtherExtent(rect)\n      };\n    });\n  };\n  BrushTargetManager.prototype.controlSeries = function (area, seriesModel, ecModel) {\n    // Check whether area is bound in coord, and series do not belong to that coord.\n    // If do not do this check, some brush (like lineX) will controll all axes.\n    var targetInfo = this.findTargetInfo(area, ecModel);\n    return targetInfo === true || targetInfo && indexOf(targetInfo.coordSyses, seriesModel.coordinateSystem) >= 0;\n  };\n  /**\n   * If return Object, a coord found.\n   * If return true, global found.\n   * Otherwise nothing found.\n   */\n  BrushTargetManager.prototype.findTargetInfo = function (area, ecModel) {\n    var targetInfoList = this._targetInfoList;\n    var foundCpts = parseFinder(ecModel, area);\n    for (var i = 0; i < targetInfoList.length; i++) {\n      var targetInfo = targetInfoList[i];\n      var areaPanelId = area.panelId;\n      if (areaPanelId) {\n        if (targetInfo.panelId === areaPanelId) {\n          return targetInfo;\n        }\n      } else {\n        for (var j = 0; j < targetInfoMatchers.length; j++) {\n          if (targetInfoMatchers[j](foundCpts, targetInfo)) {\n            return targetInfo;\n          }\n        }\n      }\n    }\n    return true;\n  };\n  return BrushTargetManager;\n}();\nfunction formatMinMax(minMax) {\n  minMax[0] > minMax[1] && minMax.reverse();\n  return minMax;\n}\nfunction parseFinder(ecModel, finder) {\n  return modelUtilParseFinder(ecModel, finder, {\n    includeMainTypes: INCLUDE_FINDER_MAIN_TYPES\n  });\n}\nvar targetInfoBuilders = {\n  grid: function (foundCpts, targetInfoList) {\n    var xAxisModels = foundCpts.xAxisModels;\n    var yAxisModels = foundCpts.yAxisModels;\n    var gridModels = foundCpts.gridModels;\n    // Remove duplicated.\n    var gridModelMap = createHashMap();\n    var xAxesHas = {};\n    var yAxesHas = {};\n    if (!xAxisModels && !yAxisModels && !gridModels) {\n      return;\n    }\n    each(xAxisModels, function (axisModel) {\n      var gridModel = axisModel.axis.grid.model;\n      gridModelMap.set(gridModel.id, gridModel);\n      xAxesHas[gridModel.id] = true;\n    });\n    each(yAxisModels, function (axisModel) {\n      var gridModel = axisModel.axis.grid.model;\n      gridModelMap.set(gridModel.id, gridModel);\n      yAxesHas[gridModel.id] = true;\n    });\n    each(gridModels, function (gridModel) {\n      gridModelMap.set(gridModel.id, gridModel);\n      xAxesHas[gridModel.id] = true;\n      yAxesHas[gridModel.id] = true;\n    });\n    gridModelMap.each(function (gridModel) {\n      var grid = gridModel.coordinateSystem;\n      var cartesians = [];\n      each(grid.getCartesians(), function (cartesian, index) {\n        if (indexOf(xAxisModels, cartesian.getAxis('x').model) >= 0 || indexOf(yAxisModels, cartesian.getAxis('y').model) >= 0) {\n          cartesians.push(cartesian);\n        }\n      });\n      targetInfoList.push({\n        panelId: 'grid--' + gridModel.id,\n        gridModel: gridModel,\n        coordSysModel: gridModel,\n        // Use the first one as the representitive coordSys.\n        coordSys: cartesians[0],\n        coordSyses: cartesians,\n        getPanelRect: panelRectBuilders.grid,\n        xAxisDeclared: xAxesHas[gridModel.id],\n        yAxisDeclared: yAxesHas[gridModel.id]\n      });\n    });\n  },\n  geo: function (foundCpts, targetInfoList) {\n    each(foundCpts.geoModels, function (geoModel) {\n      var coordSys = geoModel.coordinateSystem;\n      targetInfoList.push({\n        panelId: 'geo--' + geoModel.id,\n        geoModel: geoModel,\n        coordSysModel: geoModel,\n        coordSys: coordSys,\n        coordSyses: [coordSys],\n        getPanelRect: panelRectBuilders.geo\n      });\n    });\n  }\n};\nvar targetInfoMatchers = [\n// grid\nfunction (foundCpts, targetInfo) {\n  var xAxisModel = foundCpts.xAxisModel;\n  var yAxisModel = foundCpts.yAxisModel;\n  var gridModel = foundCpts.gridModel;\n  !gridModel && xAxisModel && (gridModel = xAxisModel.axis.grid.model);\n  !gridModel && yAxisModel && (gridModel = yAxisModel.axis.grid.model);\n  return gridModel && gridModel === targetInfo.gridModel;\n},\n// geo\nfunction (foundCpts, targetInfo) {\n  var geoModel = foundCpts.geoModel;\n  return geoModel && geoModel === targetInfo.geoModel;\n}];\nvar panelRectBuilders = {\n  grid: function () {\n    // grid is not Transformable.\n    return this.coordSys.master.getRect().clone();\n  },\n  geo: function () {\n    var coordSys = this.coordSys;\n    var rect = coordSys.getBoundingRect().clone();\n    // geo roam and zoom transform\n    rect.applyTransform(graphic.getTransform(coordSys));\n    return rect;\n  }\n};\nvar coordConvert = {\n  lineX: curry(axisConvert, 0),\n  lineY: curry(axisConvert, 1),\n  rect: function (to, coordSys, rangeOrCoordRange, clamp) {\n    var xminymin = to ? coordSys.pointToData([rangeOrCoordRange[0][0], rangeOrCoordRange[1][0]], clamp) : coordSys.dataToPoint([rangeOrCoordRange[0][0], rangeOrCoordRange[1][0]], clamp);\n    var xmaxymax = to ? coordSys.pointToData([rangeOrCoordRange[0][1], rangeOrCoordRange[1][1]], clamp) : coordSys.dataToPoint([rangeOrCoordRange[0][1], rangeOrCoordRange[1][1]], clamp);\n    var values = [formatMinMax([xminymin[0], xmaxymax[0]]), formatMinMax([xminymin[1], xmaxymax[1]])];\n    return {\n      values: values,\n      xyMinMax: values\n    };\n  },\n  polygon: function (to, coordSys, rangeOrCoordRange, clamp) {\n    var xyMinMax = [[Infinity, -Infinity], [Infinity, -Infinity]];\n    var values = map(rangeOrCoordRange, function (item) {\n      var p = to ? coordSys.pointToData(item, clamp) : coordSys.dataToPoint(item, clamp);\n      xyMinMax[0][0] = Math.min(xyMinMax[0][0], p[0]);\n      xyMinMax[1][0] = Math.min(xyMinMax[1][0], p[1]);\n      xyMinMax[0][1] = Math.max(xyMinMax[0][1], p[0]);\n      xyMinMax[1][1] = Math.max(xyMinMax[1][1], p[1]);\n      return p;\n    });\n    return {\n      values: values,\n      xyMinMax: xyMinMax\n    };\n  }\n};\nfunction axisConvert(axisNameIndex, to, coordSys, rangeOrCoordRange) {\n  if (process.env.NODE_ENV !== 'production') {\n    assert(coordSys.type === 'cartesian2d', 'lineX/lineY brush is available only in cartesian2d.');\n  }\n  var axis = coordSys.getAxis(['x', 'y'][axisNameIndex]);\n  var values = formatMinMax(map([0, 1], function (i) {\n    return to ? axis.coordToData(axis.toLocalCoord(rangeOrCoordRange[i]), true) : axis.toGlobalCoord(axis.dataToCoord(rangeOrCoordRange[i]));\n  }));\n  var xyMinMax = [];\n  xyMinMax[axisNameIndex] = values;\n  xyMinMax[1 - axisNameIndex] = [NaN, NaN];\n  return {\n    values: values,\n    xyMinMax: xyMinMax\n  };\n}\nvar diffProcessor = {\n  lineX: curry(axisDiffProcessor, 0),\n  lineY: curry(axisDiffProcessor, 1),\n  rect: function (values, refer, scales) {\n    return [[values[0][0] - scales[0] * refer[0][0], values[0][1] - scales[0] * refer[0][1]], [values[1][0] - scales[1] * refer[1][0], values[1][1] - scales[1] * refer[1][1]]];\n  },\n  polygon: function (values, refer, scales) {\n    return map(values, function (item, idx) {\n      return [item[0] - scales[0] * refer[idx][0], item[1] - scales[1] * refer[idx][1]];\n    });\n  }\n};\nfunction axisDiffProcessor(axisNameIndex, values, refer, scales) {\n  return [values[0] - scales[axisNameIndex] * refer[0], values[1] - scales[axisNameIndex] * refer[1]];\n}\n// We have to process scale caused by dataZoom manually,\n// although it might be not accurate.\n// Return [0~1, 0~1]\nfunction getScales(xyMinMaxCurr, xyMinMaxOrigin) {\n  var sizeCurr = getSize(xyMinMaxCurr);\n  var sizeOrigin = getSize(xyMinMaxOrigin);\n  var scales = [sizeCurr[0] / sizeOrigin[0], sizeCurr[1] / sizeOrigin[1]];\n  isNaN(scales[0]) && (scales[0] = 1);\n  isNaN(scales[1]) && (scales[1] = 1);\n  return scales;\n}\nfunction getSize(xyMinMax) {\n  return xyMinMax ? [xyMinMax[0][1] - xyMinMax[0][0], xyMinMax[1][1] - xyMinMax[1][0]] : [NaN, NaN];\n}\nexport default BrushTargetManager;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\n// TODO depends on DataZoom and Brush\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport BrushController from '../../helper/BrushController.js';\nimport BrushTargetManager from '../../helper/BrushTargetManager.js';\nimport * as history from '../../dataZoom/history.js';\nimport sliderMove from '../../helper/sliderMove.js';\nimport { ToolboxFeature } from '../featureManager.js';\nimport { makeInternalComponentId, parseFinder } from '../../../util/model.js';\nimport { registerInternalOptionCreator } from '../../../model/internalComponentCreator.js';\nimport tokens from '../../../visual/tokens.js';\nvar each = zrUtil.each;\nvar DATA_ZOOM_ID_BASE = makeInternalComponentId('toolbox-dataZoom_');\nvar ICON_TYPES = ['zoom', 'back'];\nvar DataZoomFeature = /** @class */function (_super) {\n  __extends(DataZoomFeature, _super);\n  function DataZoomFeature() {\n    return _super !== null && _super.apply(this, arguments) || this;\n  }\n  DataZoomFeature.prototype.render = function (featureModel, ecModel, api, payload) {\n    if (!this._brushController) {\n      this._brushController = new BrushController(api.getZr());\n      this._brushController.on('brush', zrUtil.bind(this._onBrush, this)).mount();\n    }\n    updateZoomBtnStatus(featureModel, ecModel, this, payload, api);\n    updateBackBtnStatus(featureModel, ecModel);\n  };\n  DataZoomFeature.prototype.onclick = function (ecModel, api, type) {\n    handlers[type].call(this);\n  };\n  DataZoomFeature.prototype.remove = function (ecModel, api) {\n    this._brushController && this._brushController.unmount();\n  };\n  DataZoomFeature.prototype.dispose = function (ecModel, api) {\n    this._brushController && this._brushController.dispose();\n  };\n  DataZoomFeature.prototype._onBrush = function (eventParam) {\n    var areas = eventParam.areas;\n    if (!eventParam.isEnd || !areas.length) {\n      return;\n    }\n    var snapshot = {};\n    var ecModel = this.ecModel;\n    this._brushController.updateCovers([]); // remove cover\n    var brushTargetManager = new BrushTargetManager(makeAxisFinder(this.model), ecModel, {\n      include: ['grid']\n    });\n    brushTargetManager.matchOutputRanges(areas, ecModel, function (area, coordRange, coordSys) {\n      if (coordSys.type !== 'cartesian2d') {\n        return;\n      }\n      var brushType = area.brushType;\n      if (brushType === 'rect') {\n        setBatch('x', coordSys, coordRange[0]);\n        setBatch('y', coordSys, coordRange[1]);\n      } else {\n        setBatch({\n          lineX: 'x',\n          lineY: 'y'\n        }[brushType], coordSys, coordRange);\n      }\n    });\n    history.push(ecModel, snapshot);\n    this._dispatchZoomAction(snapshot);\n    function setBatch(dimName, coordSys, minMax) {\n      var axis = coordSys.getAxis(dimName);\n      var axisModel = axis.model;\n      var dataZoomModel = findDataZoom(dimName, axisModel, ecModel);\n      // Restrict range.\n      var minMaxSpan = dataZoomModel.findRepresentativeAxisProxy(axisModel).getMinMaxSpan();\n      if (minMaxSpan.minValueSpan != null || minMaxSpan.maxValueSpan != null) {\n        minMax = sliderMove(0, minMax.slice(), axis.scale.getExtent(), 0, minMaxSpan.minValueSpan, minMaxSpan.maxValueSpan);\n      }\n      dataZoomModel && (snapshot[dataZoomModel.id] = {\n        dataZoomId: dataZoomModel.id,\n        startValue: minMax[0],\n        endValue: minMax[1]\n      });\n    }\n    function findDataZoom(dimName, axisModel, ecModel) {\n      var found;\n      ecModel.eachComponent({\n        mainType: 'dataZoom',\n        subType: 'select'\n      }, function (dzModel) {\n        var has = dzModel.getAxisModel(dimName, axisModel.componentIndex);\n        has && (found = dzModel);\n      });\n      return found;\n    }\n  };\n  ;\n  DataZoomFeature.prototype._dispatchZoomAction = function (snapshot) {\n    var batch = [];\n    // Convert from hash map to array.\n    each(snapshot, function (batchItem, dataZoomId) {\n      batch.push(zrUtil.clone(batchItem));\n    });\n    batch.length && this.api.dispatchAction({\n      type: 'dataZoom',\n      from: this.uid,\n      batch: batch\n    });\n  };\n  DataZoomFeature.getDefaultOption = function (ecModel) {\n    var defaultOption = {\n      show: true,\n      filterMode: 'filter',\n      // Icon group\n      icon: {\n        zoom: 'M0,13.5h26.9 M13.5,26.9V0 M32.1,13.5H58V58H13.5 V32.1',\n        back: 'M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26'\n      },\n      // `zoom`, `back`\n      title: ecModel.getLocaleModel().get(['toolbox', 'dataZoom', 'title']),\n      brushStyle: {\n        borderWidth: 0,\n        color: tokens.color.backgroundTint\n      }\n    };\n    return defaultOption;\n  };\n  return DataZoomFeature;\n}(ToolboxFeature);\nvar handlers = {\n  zoom: function () {\n    var nextActive = !this._isZoomActive;\n    this.api.dispatchAction({\n      type: 'takeGlobalCursor',\n      key: 'dataZoomSelect',\n      dataZoomSelectActive: nextActive\n    });\n  },\n  back: function () {\n    this._dispatchZoomAction(history.pop(this.ecModel));\n  }\n};\nfunction makeAxisFinder(dzFeatureModel) {\n  var setting = {\n    xAxisIndex: dzFeatureModel.get('xAxisIndex', true),\n    yAxisIndex: dzFeatureModel.get('yAxisIndex', true),\n    xAxisId: dzFeatureModel.get('xAxisId', true),\n    yAxisId: dzFeatureModel.get('yAxisId', true)\n  };\n  // If both `xAxisIndex` `xAxisId` not set, it means 'all'.\n  // If both `yAxisIndex` `yAxisId` not set, it means 'all'.\n  // Some old cases set like this below to close yAxis control but leave xAxis control:\n  // `{ feature: { dataZoom: { yAxisIndex: false } }`.\n  if (setting.xAxisIndex == null && setting.xAxisId == null) {\n    setting.xAxisIndex = 'all';\n  }\n  if (setting.yAxisIndex == null && setting.yAxisId == null) {\n    setting.yAxisIndex = 'all';\n  }\n  return setting;\n}\nfunction updateBackBtnStatus(featureModel, ecModel) {\n  featureModel.setIconStatus('back', history.count(ecModel) > 1 ? 'emphasis' : 'normal');\n}\nfunction updateZoomBtnStatus(featureModel, ecModel, view, payload, api) {\n  var zoomActive = view._isZoomActive;\n  if (payload && payload.type === 'takeGlobalCursor') {\n    zoomActive = payload.key === 'dataZoomSelect' ? payload.dataZoomSelectActive : false;\n  }\n  view._isZoomActive = zoomActive;\n  featureModel.setIconStatus('zoom', zoomActive ? 'emphasis' : 'normal');\n  var brushTargetManager = new BrushTargetManager(makeAxisFinder(featureModel), ecModel, {\n    include: ['grid']\n  });\n  var panels = brushTargetManager.makePanelOpts(api, function (targetInfo) {\n    return targetInfo.xAxisDeclared && !targetInfo.yAxisDeclared ? 'lineX' : !targetInfo.xAxisDeclared && targetInfo.yAxisDeclared ? 'lineY' : 'rect';\n  });\n  view._brushController.setPanels(panels).enableBrush(zoomActive && panels.length ? {\n    brushType: 'auto',\n    brushStyle: featureModel.getModel('brushStyle').getItemStyle()\n  } : false);\n}\nregisterInternalOptionCreator('dataZoom', function (ecModel) {\n  var toolboxModel = ecModel.getComponent('toolbox', 0);\n  var featureDataZoomPath = ['feature', 'dataZoom'];\n  if (!toolboxModel || toolboxModel.get(featureDataZoomPath) == null) {\n    return;\n  }\n  var dzFeatureModel = toolboxModel.getModel(featureDataZoomPath);\n  var dzOptions = [];\n  var finder = makeAxisFinder(dzFeatureModel);\n  var finderResult = parseFinder(ecModel, finder);\n  each(finderResult.xAxisModels, function (axisModel) {\n    return buildInternalOptions(axisModel, 'xAxis', 'xAxisIndex');\n  });\n  each(finderResult.yAxisModels, function (axisModel) {\n    return buildInternalOptions(axisModel, 'yAxis', 'yAxisIndex');\n  });\n  function buildInternalOptions(axisModel, axisMainType, axisIndexPropName) {\n    var axisIndex = axisModel.componentIndex;\n    var newOpt = {\n      type: 'select',\n      $fromToolbox: true,\n      // Default to be filter\n      filterMode: dzFeatureModel.get('filterMode', true) || 'filter',\n      // Id for merge mapping.\n      id: DATA_ZOOM_ID_BASE + axisMainType + axisIndex\n    };\n    newOpt[axisIndexPropName] = axisIndex;\n    dzOptions.push(newOpt);\n  }\n  return dzOptions;\n});\nexport default DataZoomFeature;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { use } from '../../extension.js';\nimport { install as installDataZoomSelect } from '../../component/dataZoom/installDataZoomSelect.js';\nimport ToolboxModel from './ToolboxModel.js';\nimport ToolboxView from './ToolboxView.js';\n// TODOD: REGISTER IN INSTALL\nimport { registerFeature } from './featureManager.js';\nimport SaveAsImage from './feature/SaveAsImage.js';\nimport MagicType from './feature/MagicType.js';\nimport DataView from './feature/DataView.js';\nimport Restore from './feature/Restore.js';\nimport DataZoom from './feature/DataZoom.js';\nexport function install(registers) {\n  registers.registerComponentModel(ToolboxModel);\n  registers.registerComponentView(ToolboxView);\n  registerFeature('saveAsImage', SaveAsImage);\n  registerFeature('magicType', MagicType);\n  registerFeature('dataView', DataView);\n  registerFeature('dataZoom', DataZoom);\n  registerFeature('restore', Restore);\n  use(installDataZoomSelect);\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport ComponentModel from '../../model/Component.js';\nimport tokens from '../../visual/tokens.js';\nvar TooltipModel = /** @class */function (_super) {\n  __extends(TooltipModel, _super);\n  function TooltipModel() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = TooltipModel.type;\n    return _this;\n  }\n  TooltipModel.type = 'tooltip';\n  TooltipModel.dependencies = ['axisPointer'];\n  TooltipModel.defaultOption = {\n    // zlevel: 0,\n    z: 60,\n    show: true,\n    // tooltip main content\n    showContent: true,\n    // 'trigger' only works on coordinate system.\n    // 'item' | 'axis' | 'none'\n    trigger: 'item',\n    // 'click' | 'mousemove' | 'none'\n    triggerOn: 'mousemove|click',\n    alwaysShowContent: false,\n    renderMode: 'auto',\n    // whether restraint content inside viewRect.\n    // If renderMode: 'richText', default true.\n    // If renderMode: 'html', defaults to `false` (for backward compat).\n    confine: null,\n    showDelay: 0,\n    hideDelay: 100,\n    // Animation transition time, unit is second\n    transitionDuration: 0.4,\n    displayTransition: true,\n    enterable: false,\n    backgroundColor: tokens.color.neutral00,\n    // box shadow\n    shadowBlur: 10,\n    shadowColor: 'rgba(0, 0, 0, .2)',\n    shadowOffsetX: 1,\n    shadowOffsetY: 2,\n    // tooltip border radius, unit is px, default is 4\n    borderRadius: 4,\n    // tooltip border width, unit is px, default is 0 (no border)\n    borderWidth: 1,\n    defaultBorderColor: tokens.color.border,\n    // Tooltip inside padding, default is 5 for all direction\n    // Array is allowed to set up, right, bottom, left, same with css\n    // The default value: See `tooltip/tooltipMarkup.ts#getPaddingFromTooltipModel`.\n    padding: null,\n    // Extra css text\n    extraCssText: '',\n    // axis indicator, trigger by axis\n    axisPointer: {\n      // default is line\n      // legal values: 'line' | 'shadow' | 'cross'\n      type: 'line',\n      // Valid when type is line, appoint tooltip line locate on which line. Optional\n      // legal values: 'x' | 'y' | 'angle' | 'radius' | 'auto'\n      // default is 'auto', chose the axis which type is category.\n      // for multiply y axis, cartesian coord chose x axis, polar chose angle axis\n      axis: 'auto',\n      animation: 'auto',\n      animationDurationUpdate: 200,\n      animationEasingUpdate: 'exponentialOut',\n      crossStyle: {\n        color: tokens.color.borderShade,\n        width: 1,\n        type: 'dashed',\n        // TODO formatter\n        textStyle: {}\n      }\n      // lineStyle and shadowStyle should not be specified here,\n      // otherwise it will always override those styles on option.axisPointer.\n    },\n    textStyle: {\n      color: tokens.color.tertiary,\n      fontSize: 14\n    }\n  };\n  return TooltipModel;\n}(ComponentModel);\nexport default TooltipModel;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { toCamelCase } from '../../util/format.js';\nimport env from 'zrender/lib/core/env.js';\n/* global document */\nexport function shouldTooltipConfine(tooltipModel) {\n  var confineOption = tooltipModel.get('confine');\n  return confineOption != null ? !!confineOption\n  // In richText mode, the outside part can not be visible.\n  : tooltipModel.get('renderMode') === 'richText';\n}\nfunction testStyle(styleProps) {\n  if (!env.domSupported) {\n    return;\n  }\n  var style = document.documentElement.style;\n  for (var i = 0, len = styleProps.length; i < len; i++) {\n    if (styleProps[i] in style) {\n      return styleProps[i];\n    }\n  }\n}\nexport var TRANSFORM_VENDOR = testStyle(['transform', 'webkitTransform', 'OTransform', 'MozTransform', 'msTransform']);\nexport var TRANSITION_VENDOR = testStyle(['webkitTransition', 'transition', 'OTransition', 'MozTransition', 'msTransition']);\nexport function toCSSVendorPrefix(styleVendor, styleProp) {\n  if (!styleVendor) {\n    return styleProp;\n  }\n  styleProp = toCamelCase(styleProp, true);\n  var idx = styleVendor.indexOf(styleProp);\n  styleVendor = idx === -1 ? styleProp : \"-\" + styleVendor.slice(0, idx) + \"-\" + styleProp;\n  return styleVendor.toLowerCase();\n}\nexport function getComputedStyle(el, style) {\n  var stl = el.currentStyle || document.defaultView && document.defaultView.getComputedStyle(el);\n  return stl ? style ? stl[style] : stl : null;\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { isString, indexOf, each, bind, isFunction, isArray, isDom, retrieve2 } from 'zrender/lib/core/util.js';\nimport { normalizeEvent } from 'zrender/lib/core/event.js';\nimport { transformLocalCoord, transformLocalCoordClear } from 'zrender/lib/core/dom.js';\nimport env from 'zrender/lib/core/env.js';\nimport { convertToColorString, toCamelCase, normalizeCssArray } from '../../util/format.js';\nimport { shouldTooltipConfine, toCSSVendorPrefix, getComputedStyle, TRANSFORM_VENDOR, TRANSITION_VENDOR } from './helper.js';\nimport { getPaddingFromTooltipModel } from './tooltipMarkup.js';\n/* global document, window */\nvar CSS_TRANSITION_VENDOR = toCSSVendorPrefix(TRANSITION_VENDOR, 'transition');\nvar CSS_TRANSFORM_VENDOR = toCSSVendorPrefix(TRANSFORM_VENDOR, 'transform');\n// eslint-disable-next-line\nvar gCssText = \"position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;\" + (env.transform3dSupported ? 'will-change:transform;' : '');\nfunction mirrorPos(pos) {\n  pos = pos === 'left' ? 'right' : pos === 'right' ? 'left' : pos === 'top' ? 'bottom' : 'top';\n  return pos;\n}\nfunction assembleArrow(tooltipModel, borderColor, arrowPosition) {\n  if (!isString(arrowPosition) || arrowPosition === 'inside') {\n    return '';\n  }\n  var backgroundColor = tooltipModel.get('backgroundColor');\n  var borderWidth = tooltipModel.get('borderWidth');\n  borderColor = convertToColorString(borderColor);\n  var arrowPos = mirrorPos(arrowPosition);\n  var arrowSize = Math.max(Math.round(borderWidth) * 1.5, 6);\n  var positionStyle = '';\n  var transformStyle = CSS_TRANSFORM_VENDOR + ':';\n  var rotateDeg;\n  if (indexOf(['left', 'right'], arrowPos) > -1) {\n    positionStyle += 'top:50%';\n    transformStyle += \"translateY(-50%) rotate(\" + (rotateDeg = arrowPos === 'left' ? -225 : -45) + \"deg)\";\n  } else {\n    positionStyle += 'left:50%';\n    transformStyle += \"translateX(-50%) rotate(\" + (rotateDeg = arrowPos === 'top' ? 225 : 45) + \"deg)\";\n  }\n  var rotateRadian = rotateDeg * Math.PI / 180;\n  var arrowWH = arrowSize + borderWidth;\n  var rotatedWH = arrowWH * Math.abs(Math.cos(rotateRadian)) + arrowWH * Math.abs(Math.sin(rotateRadian));\n  var arrowOffset = Math.round(((rotatedWH - Math.SQRT2 * borderWidth) / 2 + Math.SQRT2 * borderWidth - (rotatedWH - arrowWH) / 2) * 100) / 100;\n  positionStyle += \";\" + arrowPos + \":-\" + arrowOffset + \"px\";\n  var borderStyle = borderColor + \" solid \" + borderWidth + \"px;\";\n  var styleCss = [\"position:absolute;width:\" + arrowSize + \"px;height:\" + arrowSize + \"px;z-index:-1;\", positionStyle + \";\" + transformStyle + \";\", \"border-bottom:\" + borderStyle, \"border-right:\" + borderStyle, \"background-color:\" + backgroundColor + \";\"];\n  return \"<div style=\\\"\" + styleCss.join('') + \"\\\"></div>\";\n}\nfunction assembleTransition(duration, onlyFadeTransition, enableDisplayTransition) {\n  var transitionCurve = 'cubic-bezier(0.23,1,0.32,1)';\n  var transitionOption = '';\n  var transitionText = '';\n  if (enableDisplayTransition) {\n    transitionOption = \" \" + duration / 2 + \"s \" + transitionCurve;\n    transitionText = \"opacity\" + transitionOption + \",visibility\" + transitionOption;\n  }\n  if (!onlyFadeTransition) {\n    transitionOption = \" \" + duration + \"s \" + transitionCurve;\n    transitionText += (transitionText.length ? ',' : '') + (env.transformSupported ? \"\" + CSS_TRANSFORM_VENDOR + transitionOption : \",left\" + transitionOption + \",top\" + transitionOption);\n  }\n  return CSS_TRANSITION_VENDOR + ':' + transitionText;\n}\nfunction assembleTransform(x, y, toString) {\n  // If using float on style, the final width of the dom might\n  // keep changing slightly while mouse move. So `toFixed(0)` them.\n  var x0 = x.toFixed(0) + 'px';\n  var y0 = y.toFixed(0) + 'px';\n  // not support transform, use `left` and `top` instead.\n  if (!env.transformSupported) {\n    return toString ? \"top:\" + y0 + \";left:\" + x0 + \";\" : [['top', y0], ['left', x0]];\n  }\n  // support transform\n  var is3d = env.transform3dSupported;\n  var translate = \"translate\" + (is3d ? '3d' : '') + \"(\" + x0 + \",\" + y0 + (is3d ? ',0' : '') + \")\";\n  return toString ? 'top:0;left:0;' + CSS_TRANSFORM_VENDOR + ':' + translate + ';' : [['top', 0], ['left', 0], [TRANSFORM_VENDOR, translate]];\n}\n/**\n * @param {Object} textStyle\n * @return {string}\n * @inner\n */\nfunction assembleFont(textStyleModel) {\n  var cssText = [];\n  var fontSize = textStyleModel.get('fontSize');\n  var color = textStyleModel.getTextColor();\n  color && cssText.push('color:' + color);\n  cssText.push('font:' + textStyleModel.getFont());\n  // @ts-ignore, leave it to the tooltip refactor.\n  var lineHeight = retrieve2(textStyleModel.get('lineHeight'), Math.round(fontSize * 3 / 2));\n  fontSize && cssText.push('line-height:' + lineHeight + 'px');\n  var shadowColor = textStyleModel.get('textShadowColor');\n  var shadowBlur = textStyleModel.get('textShadowBlur') || 0;\n  var shadowOffsetX = textStyleModel.get('textShadowOffsetX') || 0;\n  var shadowOffsetY = textStyleModel.get('textShadowOffsetY') || 0;\n  shadowColor && shadowBlur && cssText.push('text-shadow:' + shadowOffsetX + 'px ' + shadowOffsetY + 'px ' + shadowBlur + 'px ' + shadowColor);\n  each(['decoration', 'align'], function (name) {\n    var val = textStyleModel.get(name);\n    val && cssText.push('text-' + name + ':' + val);\n  });\n  return cssText.join(';');\n}\nfunction assembleCssText(tooltipModel, enableTransition, onlyFadeTransition, enableDisplayTransition) {\n  var cssText = [];\n  var transitionDuration = tooltipModel.get('transitionDuration');\n  var backgroundColor = tooltipModel.get('backgroundColor');\n  var shadowBlur = tooltipModel.get('shadowBlur');\n  var shadowColor = tooltipModel.get('shadowColor');\n  var shadowOffsetX = tooltipModel.get('shadowOffsetX');\n  var shadowOffsetY = tooltipModel.get('shadowOffsetY');\n  var textStyleModel = tooltipModel.getModel('textStyle');\n  var padding = getPaddingFromTooltipModel(tooltipModel, 'html');\n  var boxShadow = shadowOffsetX + \"px \" + shadowOffsetY + \"px \" + shadowBlur + \"px \" + shadowColor;\n  cssText.push('box-shadow:' + boxShadow);\n  // Animation transition. Do not animate when transitionDuration <= 0.\n  enableTransition && transitionDuration > 0 && cssText.push(assembleTransition(transitionDuration, onlyFadeTransition, enableDisplayTransition));\n  if (backgroundColor) {\n    cssText.push('background-color:' + backgroundColor);\n  }\n  // Border style\n  each(['width', 'color', 'radius'], function (name) {\n    var borderName = 'border-' + name;\n    var camelCase = toCamelCase(borderName);\n    var val = tooltipModel.get(camelCase);\n    val != null && cssText.push(borderName + ':' + val + (name === 'color' ? '' : 'px'));\n  });\n  // Text style\n  cssText.push(assembleFont(textStyleModel));\n  // Padding\n  if (padding != null) {\n    cssText.push('padding:' + normalizeCssArray(padding).join('px ') + 'px');\n  }\n  return cssText.join(';') + ';';\n}\n// If not able to make, do not modify the input `out`.\nfunction makeStyleCoord(out, zr, container, zrX, zrY) {\n  var zrPainter = zr && zr.painter;\n  if (container) {\n    var zrViewportRoot = zrPainter && zrPainter.getViewportRoot();\n    if (zrViewportRoot) {\n      // Some APPs might use scale on body, so we support CSS transform here.\n      transformLocalCoord(out, zrViewportRoot, container, zrX, zrY);\n    }\n  } else {\n    out[0] = zrX;\n    out[1] = zrY;\n    // xy should be based on canvas root. But tooltipContent is\n    // the sibling of canvas root. So padding of ec container\n    // should be considered here.\n    var viewportRootOffset = zrPainter && zrPainter.getViewportRootOffset();\n    if (viewportRootOffset) {\n      out[0] += viewportRootOffset.offsetLeft;\n      out[1] += viewportRootOffset.offsetTop;\n    }\n  }\n  out[2] = out[0] / zr.getWidth();\n  out[3] = out[1] / zr.getHeight();\n}\nvar TooltipHTMLContent = /** @class */function () {\n  function TooltipHTMLContent(api, opt) {\n    this._show = false;\n    this._styleCoord = [0, 0, 0, 0];\n    this._enterable = true;\n    this._alwaysShowContent = false;\n    this._firstShow = true;\n    this._longHide = true;\n    if (env.wxa) {\n      return null;\n    }\n    var el = document.createElement('div');\n    // TODO: TYPE\n    el.domBelongToZr = true;\n    this.el = el;\n    var zr = this._zr = api.getZr();\n    var appendTo = opt.appendTo;\n    var container = appendTo && (isString(appendTo) ? document.querySelector(appendTo) : isDom(appendTo) ? appendTo : isFunction(appendTo) && appendTo(api.getDom()));\n    makeStyleCoord(this._styleCoord, zr, container, api.getWidth() / 2, api.getHeight() / 2);\n    (container || api.getDom()).appendChild(el);\n    this._api = api;\n    this._container = container;\n    // FIXME\n    // Is it needed to trigger zr event manually if\n    // the browser do not support `pointer-events: none`.\n    var self = this;\n    el.onmouseenter = function () {\n      // clear the timeout in hideLater and keep showing tooltip\n      if (self._enterable) {\n        clearTimeout(self._hideTimeout);\n        self._show = true;\n      }\n      self._inContent = true;\n    };\n    el.onmousemove = function (e) {\n      e = e || window.event;\n      if (!self._enterable) {\n        // `pointer-events: none` is set to tooltip content div\n        // if `enterable` is set as `false`, and `el.onmousemove`\n        // can not be triggered. But in browser that do not\n        // support `pointer-events`, we need to do this:\n        // Try trigger zrender event to avoid mouse\n        // in and out shape too frequently\n        var handler = zr.handler;\n        var zrViewportRoot = zr.painter.getViewportRoot();\n        normalizeEvent(zrViewportRoot, e, true);\n        handler.dispatch('mousemove', e);\n      }\n    };\n    el.onmouseleave = function () {\n      // set `_inContent` to `false` before `hideLater`\n      self._inContent = false;\n      if (self._enterable) {\n        if (self._show) {\n          self.hideLater(self._hideDelay);\n        }\n      }\n    };\n  }\n  /**\n   * Update when tooltip is rendered\n   */\n  TooltipHTMLContent.prototype.update = function (tooltipModel) {\n    // FIXME\n    // Move this logic to ec main?\n    if (!this._container) {\n      var container = this._api.getDom();\n      var position = getComputedStyle(container, 'position');\n      var domStyle = container.style;\n      if (domStyle.position !== 'absolute' && position !== 'absolute') {\n        domStyle.position = 'relative';\n      }\n    }\n    // move tooltip if chart resized\n    var alwaysShowContent = tooltipModel.get('alwaysShowContent');\n    alwaysShowContent && this._moveIfResized();\n    // update alwaysShowContent\n    this._alwaysShowContent = alwaysShowContent;\n    this._enableDisplayTransition = tooltipModel.get('displayTransition') && tooltipModel.get('transitionDuration') > 0;\n    // update className\n    this.el.className = tooltipModel.get('className') || '';\n    // Hide the tooltip\n    // PENDING\n    // this.hide();\n  };\n  TooltipHTMLContent.prototype.show = function (tooltipModel, nearPointColor) {\n    clearTimeout(this._hideTimeout);\n    clearTimeout(this._longHideTimeout);\n    var el = this.el;\n    var style = el.style;\n    var styleCoord = this._styleCoord;\n    if (!el.innerHTML) {\n      style.display = 'none';\n    } else {\n      style.cssText = gCssText + assembleCssText(tooltipModel, !this._firstShow, this._longHide, this._enableDisplayTransition)\n      // initial transform\n      + assembleTransform(styleCoord[0], styleCoord[1], true) + (\"border-color:\" + convertToColorString(nearPointColor) + \";\") + (tooltipModel.get('extraCssText') || '')\n      // If mouse occasionally move over the tooltip, a mouseout event will be\n      // triggered by canvas, and cause some unexpectable result like dragging\n      // stop, \"unfocusAdjacency\". Here `pointer-events: none` is used to solve\n      // it. Although it is not supported by IE8~IE10, fortunately it is a rare\n      // scenario.\n      + (\";pointer-events:\" + (this._enterable ? 'auto' : 'none'));\n    }\n    this._show = true;\n    this._firstShow = false;\n    this._longHide = false;\n  };\n  TooltipHTMLContent.prototype.setContent = function (content, markers, tooltipModel, borderColor, arrowPosition) {\n    var el = this.el;\n    if (content == null) {\n      el.innerHTML = '';\n      return;\n    }\n    var arrow = '';\n    if (isString(arrowPosition) && tooltipModel.get('trigger') === 'item' && !shouldTooltipConfine(tooltipModel)) {\n      arrow = assembleArrow(tooltipModel, borderColor, arrowPosition);\n    }\n    if (isString(content)) {\n      el.innerHTML = content + arrow;\n    } else if (content) {\n      // Clear previous\n      el.innerHTML = '';\n      if (!isArray(content)) {\n        content = [content];\n      }\n      for (var i = 0; i < content.length; i++) {\n        if (isDom(content[i]) && content[i].parentNode !== el) {\n          el.appendChild(content[i]);\n        }\n      }\n      // no arrow if empty\n      if (arrow && el.childNodes.length) {\n        // no need to create a new parent element, but it's not supported by IE 10 and older.\n        // const arrowEl = document.createRange().createContextualFragment(arrow);\n        var arrowEl = document.createElement('div');\n        arrowEl.innerHTML = arrow;\n        el.appendChild(arrowEl);\n      }\n    }\n  };\n  TooltipHTMLContent.prototype.setEnterable = function (enterable) {\n    this._enterable = enterable;\n  };\n  TooltipHTMLContent.prototype.getSize = function () {\n    var el = this.el;\n    return el ? [el.offsetWidth, el.offsetHeight] : [0, 0];\n  };\n  TooltipHTMLContent.prototype.moveTo = function (zrX, zrY) {\n    if (!this.el) {\n      return;\n    }\n    var styleCoord = this._styleCoord;\n    makeStyleCoord(styleCoord, this._zr, this._container, zrX, zrY);\n    if (styleCoord[0] != null && styleCoord[1] != null) {\n      var style_1 = this.el.style;\n      var transforms = assembleTransform(styleCoord[0], styleCoord[1]);\n      each(transforms, function (transform) {\n        style_1[transform[0]] = transform[1];\n      });\n    }\n  };\n  /**\n   * when `alwaysShowContent` is true,\n   * move the tooltip after chart resized\n   */\n  TooltipHTMLContent.prototype._moveIfResized = function () {\n    // The ratio of left to width\n    var ratioX = this._styleCoord[2];\n    // The ratio of top to height\n    var ratioY = this._styleCoord[3];\n    this.moveTo(ratioX * this._zr.getWidth(), ratioY * this._zr.getHeight());\n  };\n  TooltipHTMLContent.prototype.hide = function () {\n    var _this = this;\n    var style = this.el.style;\n    if (this._enableDisplayTransition) {\n      style.visibility = 'hidden';\n      style.opacity = '0';\n    } else {\n      style.display = 'none';\n    }\n    env.transform3dSupported && (style.willChange = '');\n    this._show = false;\n    this._longHideTimeout = setTimeout(function () {\n      return _this._longHide = true;\n    }, 500);\n  };\n  TooltipHTMLContent.prototype.hideLater = function (time) {\n    if (this._show && !(this._inContent && this._enterable) && !this._alwaysShowContent) {\n      if (time) {\n        this._hideDelay = time;\n        // Set show false to avoid invoke hideLater multiple times\n        this._show = false;\n        this._hideTimeout = setTimeout(bind(this.hide, this), time);\n      } else {\n        this.hide();\n      }\n    }\n  };\n  TooltipHTMLContent.prototype.isShow = function () {\n    return this._show;\n  };\n  TooltipHTMLContent.prototype.dispose = function () {\n    clearTimeout(this._hideTimeout);\n    clearTimeout(this._longHideTimeout);\n    var zr = this._zr;\n    transformLocalCoordClear(zr && zr.painter && zr.painter.getViewportRoot(), this._container);\n    var el = this.el;\n    if (el) {\n      el.onmouseenter = el.onmousemove = el.onmouseleave = null;\n      var parentNode = el.parentNode;\n      parentNode && parentNode.removeChild(el);\n    }\n    this.el = this._container = null;\n  };\n  return TooltipHTMLContent;\n}();\nexport default TooltipHTMLContent;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport ZRText from 'zrender/lib/graphic/Text.js';\nimport { getPaddingFromTooltipModel } from './tooltipMarkup.js';\nimport { throwError } from '../../util/log.js';\nvar TooltipRichContent = /** @class */function () {\n  function TooltipRichContent(api) {\n    this._show = false;\n    this._styleCoord = [0, 0, 0, 0];\n    this._alwaysShowContent = false;\n    this._enterable = true;\n    this._zr = api.getZr();\n    makeStyleCoord(this._styleCoord, this._zr, api.getWidth() / 2, api.getHeight() / 2);\n  }\n  /**\n   * Update when tooltip is rendered\n   */\n  TooltipRichContent.prototype.update = function (tooltipModel) {\n    var alwaysShowContent = tooltipModel.get('alwaysShowContent');\n    alwaysShowContent && this._moveIfResized();\n    // update alwaysShowContent\n    this._alwaysShowContent = alwaysShowContent;\n  };\n  TooltipRichContent.prototype.show = function () {\n    if (this._hideTimeout) {\n      clearTimeout(this._hideTimeout);\n    }\n    this.el.show();\n    this._show = true;\n  };\n  /**\n   * Set tooltip content\n   */\n  TooltipRichContent.prototype.setContent = function (content, markupStyleCreator, tooltipModel, borderColor, arrowPosition) {\n    var _this = this;\n    if (zrUtil.isObject(content)) {\n      throwError(process.env.NODE_ENV !== 'production' ? 'Passing DOM nodes as content is not supported in richText tooltip!' : '');\n    }\n    if (this.el) {\n      this._zr.remove(this.el);\n    }\n    var textStyleModel = tooltipModel.getModel('textStyle');\n    this.el = new ZRText({\n      style: {\n        rich: markupStyleCreator.richTextStyles,\n        text: content,\n        lineHeight: 22,\n        borderWidth: 1,\n        borderColor: borderColor,\n        textShadowColor: textStyleModel.get('textShadowColor'),\n        fill: tooltipModel.get(['textStyle', 'color']),\n        padding: getPaddingFromTooltipModel(tooltipModel, 'richText'),\n        verticalAlign: 'top',\n        align: 'left'\n      },\n      z: tooltipModel.get('z')\n    });\n    zrUtil.each(['backgroundColor', 'borderRadius', 'shadowColor', 'shadowBlur', 'shadowOffsetX', 'shadowOffsetY'], function (propName) {\n      _this.el.style[propName] = tooltipModel.get(propName);\n    });\n    zrUtil.each(['textShadowBlur', 'textShadowOffsetX', 'textShadowOffsetY'], function (propName) {\n      _this.el.style[propName] = textStyleModel.get(propName) || 0;\n    });\n    this._zr.add(this.el);\n    var self = this;\n    this.el.on('mouseover', function () {\n      // clear the timeout in hideLater and keep showing tooltip\n      if (self._enterable) {\n        clearTimeout(self._hideTimeout);\n        self._show = true;\n      }\n      self._inContent = true;\n    });\n    this.el.on('mouseout', function () {\n      if (self._enterable) {\n        if (self._show) {\n          self.hideLater(self._hideDelay);\n        }\n      }\n      self._inContent = false;\n    });\n  };\n  TooltipRichContent.prototype.setEnterable = function (enterable) {\n    this._enterable = enterable;\n  };\n  TooltipRichContent.prototype.getSize = function () {\n    var el = this.el;\n    var bounding = this.el.getBoundingRect();\n    // bounding rect does not include shadow. For renderMode richText,\n    // if overflow, it will be cut. So calculate them accurately.\n    var shadowOuterSize = calcShadowOuterSize(el.style);\n    return [bounding.width + shadowOuterSize.left + shadowOuterSize.right, bounding.height + shadowOuterSize.top + shadowOuterSize.bottom];\n  };\n  TooltipRichContent.prototype.moveTo = function (x, y) {\n    var el = this.el;\n    if (el) {\n      var styleCoord = this._styleCoord;\n      makeStyleCoord(styleCoord, this._zr, x, y);\n      x = styleCoord[0];\n      y = styleCoord[1];\n      var style = el.style;\n      var borderWidth = mathMaxWith0(style.borderWidth || 0);\n      var shadowOuterSize = calcShadowOuterSize(style);\n      // rich text x, y do not include border.\n      el.x = x + borderWidth + shadowOuterSize.left;\n      el.y = y + borderWidth + shadowOuterSize.top;\n      el.markRedraw();\n    }\n  };\n  /**\n   * when `alwaysShowContent` is true,\n   * move the tooltip after chart resized\n   */\n  TooltipRichContent.prototype._moveIfResized = function () {\n    // The ratio of left to width\n    var ratioX = this._styleCoord[2];\n    // The ratio of top to height\n    var ratioY = this._styleCoord[3];\n    this.moveTo(ratioX * this._zr.getWidth(), ratioY * this._zr.getHeight());\n  };\n  TooltipRichContent.prototype.hide = function () {\n    if (this.el) {\n      this.el.hide();\n    }\n    this._show = false;\n  };\n  TooltipRichContent.prototype.hideLater = function (time) {\n    if (this._show && !(this._inContent && this._enterable) && !this._alwaysShowContent) {\n      if (time) {\n        this._hideDelay = time;\n        // Set show false to avoid invoke hideLater multiple times\n        this._show = false;\n        this._hideTimeout = setTimeout(zrUtil.bind(this.hide, this), time);\n      } else {\n        this.hide();\n      }\n    }\n  };\n  TooltipRichContent.prototype.isShow = function () {\n    return this._show;\n  };\n  TooltipRichContent.prototype.dispose = function () {\n    this._zr.remove(this.el);\n  };\n  return TooltipRichContent;\n}();\nfunction mathMaxWith0(val) {\n  return Math.max(0, val);\n}\nfunction calcShadowOuterSize(style) {\n  var shadowBlur = mathMaxWith0(style.shadowBlur || 0);\n  var shadowOffsetX = mathMaxWith0(style.shadowOffsetX || 0);\n  var shadowOffsetY = mathMaxWith0(style.shadowOffsetY || 0);\n  return {\n    left: mathMaxWith0(shadowBlur - shadowOffsetX),\n    right: mathMaxWith0(shadowBlur + shadowOffsetX),\n    top: mathMaxWith0(shadowBlur - shadowOffsetY),\n    bottom: mathMaxWith0(shadowBlur + shadowOffsetY)\n  };\n}\nfunction makeStyleCoord(out, zr, zrX, zrY) {\n  out[0] = zrX;\n  out[1] = zrY;\n  out[2] = out[0] / zr.getWidth();\n  out[3] = out[1] / zr.getHeight();\n}\nexport default TooltipRichContent;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\nimport { __extends } from \"tslib\";\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { bind, each, clone, trim, isString, isFunction, isArray, isObject, extend } from 'zrender/lib/core/util.js';\nimport env from 'zrender/lib/core/env.js';\nimport TooltipHTMLContent from './TooltipHTMLContent.js';\nimport TooltipRichContent from './TooltipRichContent.js';\nimport { convertToColorString, encodeHTML, formatTpl } from '../../util/format.js';\nimport { parsePercent } from '../../util/number.js';\nimport { Rect } from '../../util/graphic.js';\nimport findPointFromSeries from '../axisPointer/findPointFromSeries.js';\nimport { getLayoutRect } from '../../util/layout.js';\nimport Model from '../../model/Model.js';\nimport * as globalListener from '../axisPointer/globalListener.js';\nimport * as axisHelper from '../../coord/axisHelper.js';\nimport * as axisPointerViewHelper from '../axisPointer/viewHelper.js';\nimport { getTooltipRenderMode, preParseFinder, queryReferringComponents } from '../../util/model.js';\nimport ComponentView from '../../view/Component.js';\nimport { format as timeFormat } from '../../util/time.js';\nimport { getECData } from '../../util/innerStore.js';\nimport { shouldTooltipConfine } from './helper.js';\nimport { normalizeTooltipFormatResult } from '../../model/mixin/dataFormat.js';\nimport { createTooltipMarkup, buildTooltipMarkup, TooltipMarkupStyleCreator } from './tooltipMarkup.js';\nimport { findEventDispatcher } from '../../util/event.js';\nimport { clear, createOrUpdate } from '../../util/throttle.js';\nvar proxyRect = new Rect({\n  shape: {\n    x: -1,\n    y: -1,\n    width: 2,\n    height: 2\n  }\n});\nvar TooltipView = /** @class */function (_super) {\n  __extends(TooltipView, _super);\n  function TooltipView() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = TooltipView.type;\n    return _this;\n  }\n  TooltipView.prototype.init = function (ecModel, api) {\n    if (env.node || !api.getDom()) {\n      return;\n    }\n    var tooltipModel = ecModel.getComponent('tooltip');\n    var renderMode = this._renderMode = getTooltipRenderMode(tooltipModel.get('renderMode'));\n    this._tooltipContent = renderMode === 'richText' ? new TooltipRichContent(api) : new TooltipHTMLContent(api, {\n      appendTo: tooltipModel.get('appendToBody', true) ? 'body' : tooltipModel.get('appendTo', true)\n    });\n  };\n  TooltipView.prototype.render = function (tooltipModel, ecModel, api) {\n    if (env.node || !api.getDom()) {\n      return;\n    }\n    // Reset\n    this.group.removeAll();\n    this._tooltipModel = tooltipModel;\n    this._ecModel = ecModel;\n    this._api = api;\n    var tooltipContent = this._tooltipContent;\n    tooltipContent.update(tooltipModel);\n    tooltipContent.setEnterable(tooltipModel.get('enterable'));\n    this._initGlobalListener();\n    this._keepShow();\n    // PENDING\n    // `mousemove` event will be triggered very frequently when the mouse moves fast,\n    // which causes that the `updatePosition` function was also called frequently.\n    // In Chrome with devtools open and Firefox, tooltip looks laggy and shakes. See #14695 #16101\n    // To avoid frequent triggering,\n    // consider throttling it in 50ms when transition is enabled\n    if (this._renderMode !== 'richText' && tooltipModel.get('transitionDuration')) {\n      createOrUpdate(this, '_updatePosition', 50, 'fixRate');\n    } else {\n      clear(this, '_updatePosition');\n    }\n  };\n  TooltipView.prototype._initGlobalListener = function () {\n    var tooltipModel = this._tooltipModel;\n    var triggerOn = tooltipModel.get('triggerOn');\n    globalListener.register('itemTooltip', this._api, bind(function (currTrigger, e, dispatchAction) {\n      // If 'none', it is not controlled by mouse totally.\n      if (triggerOn !== 'none') {\n        if (triggerOn.indexOf(currTrigger) >= 0) {\n          this._tryShow(e, dispatchAction);\n        } else if (currTrigger === 'leave') {\n          this._hide(dispatchAction);\n        }\n      }\n    }, this));\n  };\n  TooltipView.prototype._keepShow = function () {\n    var tooltipModel = this._tooltipModel;\n    var ecModel = this._ecModel;\n    var api = this._api;\n    var triggerOn = tooltipModel.get('triggerOn');\n    // Try to keep the tooltip show when refreshing\n    if (this._lastX != null && this._lastY != null\n    // When user is willing to control tooltip totally using API,\n    // self.manuallyShowTip({x, y}) might cause tooltip hide,\n    // which is not expected.\n    && triggerOn !== 'none' && triggerOn !== 'click') {\n      var self_1 = this;\n      clearTimeout(this._refreshUpdateTimeout);\n      this._refreshUpdateTimeout = setTimeout(function () {\n        // Show tip next tick after other charts are rendered\n        // In case highlight action has wrong result\n        // FIXME\n        !api.isDisposed() && self_1.manuallyShowTip(tooltipModel, ecModel, api, {\n          x: self_1._lastX,\n          y: self_1._lastY,\n          dataByCoordSys: self_1._lastDataByCoordSys\n        });\n      });\n    }\n  };\n  /**\n   * Show tip manually by\n   * dispatchAction({\n   *     type: 'showTip',\n   *     x: 10,\n   *     y: 10\n   * });\n   * Or\n   * dispatchAction({\n   *      type: 'showTip',\n   *      seriesIndex: 0,\n   *      dataIndex or dataIndexInside or name\n   * });\n   *\n   *  TODO Batch\n   */\n  TooltipView.prototype.manuallyShowTip = function (tooltipModel, ecModel, api, payload) {\n    if (payload.from === this.uid || env.node || !api.getDom()) {\n      return;\n    }\n    var dispatchAction = makeDispatchAction(payload, api);\n    // Reset ticket\n    this._ticket = '';\n    // When triggered from axisPointer.\n    var dataByCoordSys = payload.dataByCoordSys;\n    var cmptRef = findComponentReference(payload, ecModel, api);\n    if (cmptRef) {\n      var rect = cmptRef.el.getBoundingRect().clone();\n      rect.applyTransform(cmptRef.el.transform);\n      this._tryShow({\n        offsetX: rect.x + rect.width / 2,\n        offsetY: rect.y + rect.height / 2,\n        target: cmptRef.el,\n        position: payload.position,\n        // When manully trigger, the mouse is not on the el, so we'd better to\n        // position tooltip on the bottom of the el and display arrow is possible.\n        positionDefault: 'bottom'\n      }, dispatchAction);\n    } else if (payload.tooltip && payload.x != null && payload.y != null) {\n      var el = proxyRect;\n      el.x = payload.x;\n      el.y = payload.y;\n      el.update();\n      getECData(el).tooltipConfig = {\n        name: null,\n        option: payload.tooltip\n      };\n      // Manually show tooltip while view is not using zrender elements.\n      this._tryShow({\n        offsetX: payload.x,\n        offsetY: payload.y,\n        target: el\n      }, dispatchAction);\n    } else if (dataByCoordSys) {\n      this._tryShow({\n        offsetX: payload.x,\n        offsetY: payload.y,\n        position: payload.position,\n        dataByCoordSys: dataByCoordSys,\n        tooltipOption: payload.tooltipOption\n      }, dispatchAction);\n    } else if (payload.seriesIndex != null) {\n      if (this._manuallyAxisShowTip(tooltipModel, ecModel, api, payload)) {\n        return;\n      }\n      var pointInfo = findPointFromSeries(payload, ecModel);\n      var cx = pointInfo.point[0];\n      var cy = pointInfo.point[1];\n      if (cx != null && cy != null) {\n        this._tryShow({\n          offsetX: cx,\n          offsetY: cy,\n          target: pointInfo.el,\n          position: payload.position,\n          // When manully trigger, the mouse is not on the el, so we'd better to\n          // position tooltip on the bottom of the el and display arrow is possible.\n          positionDefault: 'bottom'\n        }, dispatchAction);\n      }\n    } else if (payload.x != null && payload.y != null) {\n      // FIXME\n      // should wrap dispatchAction like `axisPointer/globalListener` ?\n      api.dispatchAction({\n        type: 'updateAxisPointer',\n        x: payload.x,\n        y: payload.y\n      });\n      this._tryShow({\n        offsetX: payload.x,\n        offsetY: payload.y,\n        position: payload.position,\n        target: api.getZr().findHover(payload.x, payload.y).target\n      }, dispatchAction);\n    }\n  };\n  TooltipView.prototype.manuallyHideTip = function (tooltipModel, ecModel, api, payload) {\n    var tooltipContent = this._tooltipContent;\n    if (this._tooltipModel) {\n      tooltipContent.hideLater(this._tooltipModel.get('hideDelay'));\n    }\n    this._lastX = this._lastY = this._lastDataByCoordSys = null;\n    if (payload.from !== this.uid) {\n      this._hide(makeDispatchAction(payload, api));\n    }\n  };\n  // Be compatible with previous design, that is, when tooltip.type is 'axis' and\n  // dispatchAction 'showTip' with seriesIndex and dataIndex will trigger axis pointer\n  // and tooltip.\n  TooltipView.prototype._manuallyAxisShowTip = function (tooltipModel, ecModel, api, payload) {\n    var seriesIndex = payload.seriesIndex;\n    var dataIndex = payload.dataIndex;\n    // @ts-ignore\n    var coordSysAxesInfo = ecModel.getComponent('axisPointer').coordSysAxesInfo;\n    if (seriesIndex == null || dataIndex == null || coordSysAxesInfo == null) {\n      return;\n    }\n    var seriesModel = ecModel.getSeriesByIndex(seriesIndex);\n    if (!seriesModel) {\n      return;\n    }\n    var data = seriesModel.getData();\n    var tooltipCascadedModel = buildTooltipModel([data.getItemModel(dataIndex), seriesModel, (seriesModel.coordinateSystem || {}).model], this._tooltipModel);\n    if (tooltipCascadedModel.get('trigger') !== 'axis') {\n      return;\n    }\n    api.dispatchAction({\n      type: 'updateAxisPointer',\n      seriesIndex: seriesIndex,\n      dataIndex: dataIndex,\n      position: payload.position\n    });\n    return true;\n  };\n  TooltipView.prototype._tryShow = function (e, dispatchAction) {\n    var el = e.target;\n    var tooltipModel = this._tooltipModel;\n    if (!tooltipModel) {\n      return;\n    }\n    // Save mouse x, mouse y. So we can try to keep showing the tip if chart is refreshed\n    this._lastX = e.offsetX;\n    this._lastY = e.offsetY;\n    var dataByCoordSys = e.dataByCoordSys;\n    if (dataByCoordSys && dataByCoordSys.length) {\n      this._showAxisTooltip(dataByCoordSys, e);\n    } else if (el) {\n      var ecData = getECData(el);\n      if (ecData.ssrType === 'legend') {\n        // Don't trigger tooltip for legend tooltip item\n        return;\n      }\n      this._lastDataByCoordSys = null;\n      var seriesDispatcher_1;\n      var cmptDispatcher_1;\n      findEventDispatcher(el, function (target) {\n        if (target.tooltipDisabled) {\n          seriesDispatcher_1 = cmptDispatcher_1 = null;\n          return true;\n        }\n        if (seriesDispatcher_1 || cmptDispatcher_1) {\n          return;\n        }\n        // Always show item tooltip if mouse is on the element with dataIndex\n        if (getECData(target).dataIndex != null) {\n          seriesDispatcher_1 = target;\n        }\n        // Tooltip provided directly. Like legend.\n        else if (getECData(target).tooltipConfig != null) {\n          cmptDispatcher_1 = target;\n        }\n      }, true);\n      if (seriesDispatcher_1) {\n        this._showSeriesItemTooltip(e, seriesDispatcher_1, dispatchAction);\n      } else if (cmptDispatcher_1) {\n        this._showComponentItemTooltip(e, cmptDispatcher_1, dispatchAction);\n      } else {\n        this._hide(dispatchAction);\n      }\n    } else {\n      this._lastDataByCoordSys = null;\n      this._hide(dispatchAction);\n    }\n  };\n  TooltipView.prototype._showOrMove = function (tooltipModel, cb) {\n    // showDelay is used in this case: tooltip.enterable is set\n    // as true. User intent to move mouse into tooltip and click\n    // something. `showDelay` makes it easier to enter the content\n    // but tooltip do not move immediately.\n    var delay = tooltipModel.get('showDelay');\n    cb = bind(cb, this);\n    clearTimeout(this._showTimout);\n    delay > 0 ? this._showTimout = setTimeout(cb, delay) : cb();\n  };\n  TooltipView.prototype._showAxisTooltip = function (dataByCoordSys, e) {\n    var ecModel = this._ecModel;\n    var globalTooltipModel = this._tooltipModel;\n    var point = [e.offsetX, e.offsetY];\n    var singleTooltipModel = buildTooltipModel([e.tooltipOption], globalTooltipModel);\n    var renderMode = this._renderMode;\n    var cbParamsList = [];\n    var articleMarkup = createTooltipMarkup('section', {\n      blocks: [],\n      noHeader: true\n    });\n    // Only for legacy: `Serise['formatTooltip']` returns a string.\n    var markupTextArrLegacy = [];\n    var markupStyleCreator = new TooltipMarkupStyleCreator();\n    each(dataByCoordSys, function (itemCoordSys) {\n      each(itemCoordSys.dataByAxis, function (axisItem) {\n        var axisModel = ecModel.getComponent(axisItem.axisDim + 'Axis', axisItem.axisIndex);\n        var axisValue = axisItem.value;\n        if (!axisModel || axisValue == null) {\n          return;\n        }\n        // FIXME: when using `tooltip.trigger: 'axis'`, the precision of the axis value displayed in tooltip\n        //  should match the original series values rather than using the default stretegy in Interval.ts\n        //  (getPrecision(interval) + 2); otherwise it may cuase confusion.\n        var axisValueLabel = axisPointerViewHelper.getValueLabel(axisValue, axisModel.axis, ecModel, axisItem.seriesDataIndices, axisItem.valueLabelOpt);\n        var axisSectionMarkup = createTooltipMarkup('section', {\n          header: axisValueLabel,\n          noHeader: !trim(axisValueLabel),\n          sortBlocks: true,\n          blocks: []\n        });\n        articleMarkup.blocks.push(axisSectionMarkup);\n        each(axisItem.seriesDataIndices, function (idxItem) {\n          var series = ecModel.getSeriesByIndex(idxItem.seriesIndex);\n          var dataIndex = idxItem.dataIndexInside;\n          var cbParams = series.getDataParams(dataIndex);\n          // Can't find data.\n          if (cbParams.dataIndex < 0) {\n            return;\n          }\n          cbParams.axisDim = axisItem.axisDim;\n          cbParams.axisIndex = axisItem.axisIndex;\n          cbParams.axisType = axisItem.axisType;\n          cbParams.axisId = axisItem.axisId;\n          cbParams.axisValue = axisHelper.getAxisRawValue(axisModel.axis, {\n            value: axisValue\n          });\n          cbParams.axisValueLabel = axisValueLabel;\n          // Pre-create marker style for makers. Users can assemble richText\n          // text in `formatter` callback and use those markers style.\n          cbParams.marker = markupStyleCreator.makeTooltipMarker('item', convertToColorString(cbParams.color), renderMode);\n          var seriesTooltipResult = normalizeTooltipFormatResult(series.formatTooltip(dataIndex, true, null));\n          var frag = seriesTooltipResult.frag;\n          if (frag) {\n            var valueFormatter = buildTooltipModel([series], globalTooltipModel).get('valueFormatter');\n            axisSectionMarkup.blocks.push(valueFormatter ? extend({\n              valueFormatter: valueFormatter\n            }, frag) : frag);\n          }\n          if (seriesTooltipResult.text) {\n            markupTextArrLegacy.push(seriesTooltipResult.text);\n          }\n          cbParamsList.push(cbParams);\n        });\n      });\n    });\n    // In most cases, the second axis is displays upper on the first one.\n    // So we reverse it to look better.\n    articleMarkup.blocks.reverse();\n    markupTextArrLegacy.reverse();\n    var positionExpr = e.position;\n    var orderMode = singleTooltipModel.get('order');\n    var builtMarkupText = buildTooltipMarkup(articleMarkup, markupStyleCreator, renderMode, orderMode, ecModel.get('useUTC'), singleTooltipModel.get('textStyle'));\n    builtMarkupText && markupTextArrLegacy.unshift(builtMarkupText);\n    var blockBreak = renderMode === 'richText' ? '\\n\\n' : '<br/>';\n    var allMarkupText = markupTextArrLegacy.join(blockBreak);\n    this._showOrMove(singleTooltipModel, function () {\n      if (this._updateContentNotChangedOnAxis(dataByCoordSys, cbParamsList)) {\n        this._updatePosition(singleTooltipModel, positionExpr, point[0], point[1], this._tooltipContent, cbParamsList);\n      } else {\n        this._showTooltipContent(singleTooltipModel, allMarkupText, cbParamsList, Math.random() + '', point[0], point[1], positionExpr, null, markupStyleCreator);\n      }\n    });\n    // Do not trigger events here, because this branch only be entered\n    // from dispatchAction.\n  };\n  TooltipView.prototype._showSeriesItemTooltip = function (e, dispatcher, dispatchAction) {\n    var ecModel = this._ecModel;\n    var ecData = getECData(dispatcher);\n    // Use dataModel in element if possible\n    // Used when mouseover on a element like markPoint or edge\n    // In which case, the data is not main data in series.\n    var seriesIndex = ecData.seriesIndex;\n    var seriesModel = ecModel.getSeriesByIndex(seriesIndex);\n    // For example, graph link.\n    var dataModel = ecData.dataModel || seriesModel;\n    var dataIndex = ecData.dataIndex;\n    var dataType = ecData.dataType;\n    var data = dataModel.getData(dataType);\n    var renderMode = this._renderMode;\n    var positionDefault = e.positionDefault;\n    var tooltipModel = buildTooltipModel([data.getItemModel(dataIndex), dataModel, seriesModel && (seriesModel.coordinateSystem || {}).model], this._tooltipModel, positionDefault ? {\n      position: positionDefault\n    } : null);\n    var tooltipTrigger = tooltipModel.get('trigger');\n    if (tooltipTrigger != null && tooltipTrigger !== 'item') {\n      return;\n    }\n    var params = dataModel.getDataParams(dataIndex, dataType);\n    var markupStyleCreator = new TooltipMarkupStyleCreator();\n    // Pre-create marker style for makers. Users can assemble richText\n    // text in `formatter` callback and use those markers style.\n    params.marker = markupStyleCreator.makeTooltipMarker('item', convertToColorString(params.color), renderMode);\n    var seriesTooltipResult = normalizeTooltipFormatResult(dataModel.formatTooltip(dataIndex, false, dataType));\n    var orderMode = tooltipModel.get('order');\n    var valueFormatter = tooltipModel.get('valueFormatter');\n    var frag = seriesTooltipResult.frag;\n    var markupText = frag ? buildTooltipMarkup(valueFormatter ? extend({\n      valueFormatter: valueFormatter\n    }, frag) : frag, markupStyleCreator, renderMode, orderMode, ecModel.get('useUTC'), tooltipModel.get('textStyle')) : seriesTooltipResult.text;\n    var asyncTicket = 'item_' + dataModel.name + '_' + dataIndex;\n    this._showOrMove(tooltipModel, function () {\n      this._showTooltipContent(tooltipModel, markupText, params, asyncTicket, e.offsetX, e.offsetY, e.position, e.target, markupStyleCreator);\n    });\n    // FIXME\n    // duplicated showtip if manuallyShowTip is called from dispatchAction.\n    dispatchAction({\n      type: 'showTip',\n      dataIndexInside: dataIndex,\n      dataIndex: data.getRawIndex(dataIndex),\n      seriesIndex: seriesIndex,\n      from: this.uid\n    });\n  };\n  TooltipView.prototype._showComponentItemTooltip = function (e, el, dispatchAction) {\n    var isHTMLRenderMode = this._renderMode === 'html';\n    var ecData = getECData(el);\n    var tooltipConfig = ecData.tooltipConfig;\n    var tooltipOpt = tooltipConfig.option || {};\n    var encodeHTMLContent = tooltipOpt.encodeHTMLContent;\n    if (isString(tooltipOpt)) {\n      var content = tooltipOpt;\n      tooltipOpt = {\n        content: content,\n        // Fixed formatter\n        formatter: content\n      };\n      // when `tooltipConfig.option` is a string rather than an object,\n      // we can't know if the content needs to be encoded\n      // for the sake of security, encode it by default.\n      encodeHTMLContent = true;\n    }\n    if (encodeHTMLContent && isHTMLRenderMode && tooltipOpt.content) {\n      // clone might be unnecessary?\n      tooltipOpt = clone(tooltipOpt);\n      tooltipOpt.content = encodeHTML(tooltipOpt.content);\n    }\n    var tooltipModelCascade = [tooltipOpt];\n    var cmpt = this._ecModel.getComponent(ecData.componentMainType, ecData.componentIndex);\n    if (cmpt) {\n      tooltipModelCascade.push(cmpt);\n    }\n    // In most cases, component tooltip formatter has different params with series tooltip formatter,\n    // so that they cannot share the same formatter. Since the global tooltip formatter is used for series\n    // by convention, we do not use it as the default formatter for component.\n    tooltipModelCascade.push({\n      formatter: tooltipOpt.content\n    });\n    var positionDefault = e.positionDefault;\n    var subTooltipModel = buildTooltipModel(tooltipModelCascade, this._tooltipModel, positionDefault ? {\n      position: positionDefault\n    } : null);\n    var defaultHtml = subTooltipModel.get('content');\n    var asyncTicket = Math.random() + '';\n    // PENDING: this case do not support richText style yet.\n    var markupStyleCreator = new TooltipMarkupStyleCreator();\n    // Do not check whether `trigger` is 'none' here, because `trigger`\n    // only works on coordinate system. In fact, we have not found case\n    // that requires setting `trigger` nothing on component yet.\n    this._showOrMove(subTooltipModel, function () {\n      // Use formatterParams from element defined in component\n      // Avoid users modify it.\n      var formatterParams = clone(subTooltipModel.get('formatterParams') || {});\n      this._showTooltipContent(subTooltipModel, defaultHtml, formatterParams, asyncTicket, e.offsetX, e.offsetY, e.position, el, markupStyleCreator);\n    });\n    // If not dispatch showTip, tip may be hide triggered by axis.\n    dispatchAction({\n      type: 'showTip',\n      from: this.uid\n    });\n  };\n  TooltipView.prototype._showTooltipContent = function (\n  // Use Model<TooltipOption> insteadof TooltipModel because this model may be from series or other options.\n  // Instead of top level tooltip.\n  tooltipModel, defaultHtml, params, asyncTicket, x, y, positionExpr, el, markupStyleCreator) {\n    // Reset ticket\n    this._ticket = '';\n    if (!tooltipModel.get('showContent') || !tooltipModel.get('show')) {\n      return;\n    }\n    var tooltipContent = this._tooltipContent;\n    tooltipContent.setEnterable(tooltipModel.get('enterable'));\n    var formatter = tooltipModel.get('formatter');\n    positionExpr = positionExpr || tooltipModel.get('position');\n    var html = defaultHtml;\n    var nearPoint = this._getNearestPoint([x, y], params, tooltipModel.get('trigger'), tooltipModel.get('borderColor'), tooltipModel.get('defaultBorderColor', true));\n    var nearPointColor = nearPoint.color;\n    if (formatter) {\n      if (isString(formatter)) {\n        var useUTC = tooltipModel.ecModel.get('useUTC');\n        var params0 = isArray(params) ? params[0] : params;\n        var isTimeAxis = params0 && params0.axisType && params0.axisType.indexOf('time') >= 0;\n        html = formatter;\n        if (isTimeAxis) {\n          html = timeFormat(params0.axisValue, html, useUTC);\n        }\n        html = formatTpl(html, params, true);\n      } else if (isFunction(formatter)) {\n        var callback = bind(function (cbTicket, html) {\n          if (cbTicket === this._ticket) {\n            tooltipContent.setContent(html, markupStyleCreator, tooltipModel, nearPointColor, positionExpr);\n            this._updatePosition(tooltipModel, positionExpr, x, y, tooltipContent, params, el);\n          }\n        }, this);\n        this._ticket = asyncTicket;\n        html = formatter(params, asyncTicket, callback);\n      } else {\n        html = formatter;\n      }\n    }\n    tooltipContent.setContent(html, markupStyleCreator, tooltipModel, nearPointColor, positionExpr);\n    tooltipContent.show(tooltipModel, nearPointColor);\n    this._updatePosition(tooltipModel, positionExpr, x, y, tooltipContent, params, el);\n  };\n  TooltipView.prototype._getNearestPoint = function (point, tooltipDataParams, trigger, borderColor, defaultBorderColor) {\n    if (trigger === 'axis' || isArray(tooltipDataParams)) {\n      return {\n        color: borderColor || defaultBorderColor\n      };\n    }\n    if (!isArray(tooltipDataParams)) {\n      return {\n        color: borderColor || tooltipDataParams.color || tooltipDataParams.borderColor\n      };\n    }\n  };\n  TooltipView.prototype._updatePosition = function (tooltipModel, positionExpr, x,\n  // Mouse x\n  y,\n  // Mouse y\n  content, params, el) {\n    var viewWidth = this._api.getWidth();\n    var viewHeight = this._api.getHeight();\n    positionExpr = positionExpr || tooltipModel.get('position');\n    var contentSize = content.getSize();\n    var align = tooltipModel.get('align');\n    var vAlign = tooltipModel.get('verticalAlign');\n    var rect = el && el.getBoundingRect().clone();\n    el && rect.applyTransform(el.transform);\n    if (isFunction(positionExpr)) {\n      // Callback of position can be an array or a string specify the position\n      positionExpr = positionExpr([x, y], params, content.el, rect, {\n        viewSize: [viewWidth, viewHeight],\n        contentSize: contentSize.slice()\n      });\n    }\n    if (isArray(positionExpr)) {\n      x = parsePercent(positionExpr[0], viewWidth);\n      y = parsePercent(positionExpr[1], viewHeight);\n    } else if (isObject(positionExpr)) {\n      var boxLayoutPosition = positionExpr;\n      boxLayoutPosition.width = contentSize[0];\n      boxLayoutPosition.height = contentSize[1];\n      var layoutRect = getLayoutRect(boxLayoutPosition, {\n        width: viewWidth,\n        height: viewHeight\n      });\n      x = layoutRect.x;\n      y = layoutRect.y;\n      align = null;\n      // When positionExpr is left/top/right/bottom,\n      // align and verticalAlign will not work.\n      vAlign = null;\n    }\n    // Specify tooltip position by string 'top' 'bottom' 'left' 'right' around graphic element\n    else if (isString(positionExpr) && el) {\n      var pos = calcTooltipPosition(positionExpr, rect, contentSize, tooltipModel.get('borderWidth'));\n      x = pos[0];\n      y = pos[1];\n    } else {\n      var pos = refixTooltipPosition(x, y, content, viewWidth, viewHeight, align ? null : 20, vAlign ? null : 20);\n      x = pos[0];\n      y = pos[1];\n    }\n    align && (x -= isCenterAlign(align) ? contentSize[0] / 2 : align === 'right' ? contentSize[0] : 0);\n    vAlign && (y -= isCenterAlign(vAlign) ? contentSize[1] / 2 : vAlign === 'bottom' ? contentSize[1] : 0);\n    if (shouldTooltipConfine(tooltipModel)) {\n      var pos = confineTooltipPosition(x, y, content, viewWidth, viewHeight);\n      x = pos[0];\n      y = pos[1];\n    }\n    content.moveTo(x, y);\n  };\n  // FIXME\n  // Should we remove this but leave this to user?\n  TooltipView.prototype._updateContentNotChangedOnAxis = function (dataByCoordSys, cbParamsList) {\n    var lastCoordSys = this._lastDataByCoordSys;\n    var lastCbParamsList = this._cbParamsList;\n    var contentNotChanged = !!lastCoordSys && lastCoordSys.length === dataByCoordSys.length;\n    contentNotChanged && each(lastCoordSys, function (lastItemCoordSys, indexCoordSys) {\n      var lastDataByAxis = lastItemCoordSys.dataByAxis || [];\n      var thisItemCoordSys = dataByCoordSys[indexCoordSys] || {};\n      var thisDataByAxis = thisItemCoordSys.dataByAxis || [];\n      contentNotChanged = contentNotChanged && lastDataByAxis.length === thisDataByAxis.length;\n      contentNotChanged && each(lastDataByAxis, function (lastItem, indexAxis) {\n        var thisItem = thisDataByAxis[indexAxis] || {};\n        var lastIndices = lastItem.seriesDataIndices || [];\n        var newIndices = thisItem.seriesDataIndices || [];\n        contentNotChanged = contentNotChanged && lastItem.value === thisItem.value && lastItem.axisType === thisItem.axisType && lastItem.axisId === thisItem.axisId && lastIndices.length === newIndices.length;\n        contentNotChanged && each(lastIndices, function (lastIdxItem, j) {\n          var newIdxItem = newIndices[j];\n          contentNotChanged = contentNotChanged && lastIdxItem.seriesIndex === newIdxItem.seriesIndex && lastIdxItem.dataIndex === newIdxItem.dataIndex;\n        });\n        // check is cbParams data value changed\n        lastCbParamsList && each(lastItem.seriesDataIndices, function (idxItem) {\n          var seriesIdx = idxItem.seriesIndex;\n          var cbParams = cbParamsList[seriesIdx];\n          var lastCbParams = lastCbParamsList[seriesIdx];\n          if (cbParams && lastCbParams && lastCbParams.data !== cbParams.data) {\n            contentNotChanged = false;\n          }\n        });\n      });\n    });\n    this._lastDataByCoordSys = dataByCoordSys;\n    this._cbParamsList = cbParamsList;\n    return !!contentNotChanged;\n  };\n  TooltipView.prototype._hide = function (dispatchAction) {\n    // Do not directly hideLater here, because this behavior may be prevented\n    // in dispatchAction when showTip is dispatched.\n    // FIXME\n    // duplicated hideTip if manuallyHideTip is called from dispatchAction.\n    this._lastDataByCoordSys = null;\n    dispatchAction({\n      type: 'hideTip',\n      from: this.uid\n    });\n  };\n  TooltipView.prototype.dispose = function (ecModel, api) {\n    if (env.node || !api.getDom()) {\n      return;\n    }\n    clear(this, '_updatePosition');\n    this._tooltipContent.dispose();\n    globalListener.unregister('itemTooltip', api);\n  };\n  TooltipView.type = 'tooltip';\n  return TooltipView;\n}(ComponentView);\n/**\n * From top to bottom. (the last one should be globalTooltipModel);\n */\nfunction buildTooltipModel(modelCascade, globalTooltipModel, defaultTooltipOption) {\n  // Last is always tooltip model.\n  var ecModel = globalTooltipModel.ecModel;\n  var resultModel;\n  if (defaultTooltipOption) {\n    resultModel = new Model(defaultTooltipOption, ecModel, ecModel);\n    resultModel = new Model(globalTooltipModel.option, resultModel, ecModel);\n  } else {\n    resultModel = globalTooltipModel;\n  }\n  for (var i = modelCascade.length - 1; i >= 0; i--) {\n    var tooltipOpt = modelCascade[i];\n    if (tooltipOpt) {\n      if (tooltipOpt instanceof Model) {\n        tooltipOpt = tooltipOpt.get('tooltip', true);\n      }\n      // In each data item tooltip can be simply write:\n      // {\n      //  value: 10,\n      //  tooltip: 'Something you need to know'\n      // }\n      if (isString(tooltipOpt)) {\n        tooltipOpt = {\n          formatter: tooltipOpt\n        };\n      }\n      if (tooltipOpt) {\n        resultModel = new Model(tooltipOpt, resultModel, ecModel);\n      }\n    }\n  }\n  return resultModel;\n}\nfunction makeDispatchAction(payload, api) {\n  return payload.dispatchAction || bind(api.dispatchAction, api);\n}\nfunction refixTooltipPosition(x, y, content, viewWidth, viewHeight, gapH, gapV) {\n  var size = content.getSize();\n  var width = size[0];\n  var height = size[1];\n  if (gapH != null) {\n    // Add extra 2 pixels for this case:\n    // At present the \"values\" in default tooltip are using CSS `float: right`.\n    // When the right edge of the tooltip box is on the right side of the\n    // viewport, the `float` layout might push the \"values\" to the second line.\n    if (x + width + gapH + 2 > viewWidth) {\n      x -= width + gapH;\n    } else {\n      x += gapH;\n    }\n  }\n  if (gapV != null) {\n    if (y + height + gapV > viewHeight) {\n      y -= height + gapV;\n    } else {\n      y += gapV;\n    }\n  }\n  return [x, y];\n}\nfunction confineTooltipPosition(x, y, content, viewWidth, viewHeight) {\n  var size = content.getSize();\n  var width = size[0];\n  var height = size[1];\n  x = Math.min(x + width, viewWidth) - width;\n  y = Math.min(y + height, viewHeight) - height;\n  x = Math.max(x, 0);\n  y = Math.max(y, 0);\n  return [x, y];\n}\nfunction calcTooltipPosition(position, rect, contentSize, borderWidth) {\n  var domWidth = contentSize[0];\n  var domHeight = contentSize[1];\n  var offset = Math.ceil(Math.SQRT2 * borderWidth) + 8;\n  var x = 0;\n  var y = 0;\n  var rectWidth = rect.width;\n  var rectHeight = rect.height;\n  switch (position) {\n    case 'inside':\n      x = rect.x + rectWidth / 2 - domWidth / 2;\n      y = rect.y + rectHeight / 2 - domHeight / 2;\n      break;\n    case 'top':\n      x = rect.x + rectWidth / 2 - domWidth / 2;\n      y = rect.y - domHeight - offset;\n      break;\n    case 'bottom':\n      x = rect.x + rectWidth / 2 - domWidth / 2;\n      y = rect.y + rectHeight + offset;\n      break;\n    case 'left':\n      x = rect.x - domWidth - offset;\n      y = rect.y + rectHeight / 2 - domHeight / 2;\n      break;\n    case 'right':\n      x = rect.x + rectWidth + offset;\n      y = rect.y + rectHeight / 2 - domHeight / 2;\n  }\n  return [x, y];\n}\nfunction isCenterAlign(align) {\n  return align === 'center' || align === 'middle';\n}\n/**\n * Find target component by payload like:\n * ```js\n * { legendId: 'some_id', name: 'xxx' }\n * { toolboxIndex: 1, name: 'xxx' }\n * { geoName: 'some_name', name: 'xxx' }\n * ```\n * PENDING: at present only\n *\n * If not found, return null/undefined.\n */\nfunction findComponentReference(payload, ecModel, api) {\n  var queryOptionMap = preParseFinder(payload).queryOptionMap;\n  var componentMainType = queryOptionMap.keys()[0];\n  if (!componentMainType || componentMainType === 'series') {\n    return;\n  }\n  var queryResult = queryReferringComponents(ecModel, componentMainType, queryOptionMap.get(componentMainType), {\n    useDefault: false,\n    enableAll: false,\n    enableNone: false\n  });\n  var model = queryResult.models[0];\n  if (!model) {\n    return;\n  }\n  var view = api.getViewOfComponentModel(model);\n  var el;\n  view.group.traverse(function (subEl) {\n    var tooltipConfig = getECData(subEl).tooltipConfig;\n    if (tooltipConfig && tooltipConfig.name === payload.name) {\n      el = subEl;\n      return true; // stop\n    }\n  });\n  if (el) {\n    return {\n      componentMainType: componentMainType,\n      componentIndex: model.componentIndex,\n      el: el\n    };\n  }\n}\nexport default TooltipView;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { install as installAxisPointer } from '../axisPointer/install.js';\nimport { use } from '../../extension.js';\nimport TooltipModel from './TooltipModel.js';\nimport TooltipView from './TooltipView.js';\nimport { noop } from 'zrender/lib/core/util.js';\nexport function install(registers) {\n  use(installAxisPointer);\n  registers.registerComponentModel(TooltipModel);\n  registers.registerComponentView(TooltipView);\n  /**\n   * @action\n   * @property {string} type\n   * @property {number} seriesIndex\n   * @property {number} dataIndex\n   * @property {number} [x]\n   * @property {number} [y]\n   */\n  registers.registerAction({\n    type: 'showTip',\n    event: 'showTip',\n    update: 'tooltip:manuallyShowTip'\n  }, noop);\n  registers.registerAction({\n    type: 'hideTip',\n    event: 'hideTip',\n    update: 'tooltip:manuallyHideTip'\n  }, noop);\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { normalizeToArray } from '../../util/model.js';\nvar DEFAULT_TOOLBOX_BTNS = ['rect', 'polygon', 'keep', 'clear'];\nexport default function brushPreprocessor(option, isNew) {\n  var brushComponents = normalizeToArray(option ? option.brush : []);\n  if (!brushComponents.length) {\n    return;\n  }\n  var brushComponentSpecifiedBtns = [];\n  zrUtil.each(brushComponents, function (brushOpt) {\n    var tbs = brushOpt.hasOwnProperty('toolbox') ? brushOpt.toolbox : [];\n    if (tbs instanceof Array) {\n      brushComponentSpecifiedBtns = brushComponentSpecifiedBtns.concat(tbs);\n    }\n  });\n  var toolbox = option && option.toolbox;\n  if (zrUtil.isArray(toolbox)) {\n    toolbox = toolbox[0];\n  }\n  if (!toolbox) {\n    toolbox = {\n      feature: {}\n    };\n    option.toolbox = [toolbox];\n  }\n  var toolboxFeature = toolbox.feature || (toolbox.feature = {});\n  var toolboxBrush = toolboxFeature.brush || (toolboxFeature.brush = {});\n  var brushTypes = toolboxBrush.type || (toolboxBrush.type = []);\n  brushTypes.push.apply(brushTypes, brushComponentSpecifiedBtns);\n  removeDuplicate(brushTypes);\n  if (isNew && !brushTypes.length) {\n    brushTypes.push.apply(brushTypes, DEFAULT_TOOLBOX_BTNS);\n  }\n}\nfunction removeDuplicate(arr) {\n  var map = {};\n  zrUtil.each(arr, function (val) {\n    map[val] = 1;\n  });\n  arr.length = 0;\n  zrUtil.each(map, function (flag, val) {\n    arr.push(val);\n  });\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n/**\n * @file Visual solution, for consistent option specification.\n */\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport VisualMapping from './VisualMapping.js';\nimport { getItemVisualFromData, setItemVisualFromData } from './helper.js';\nvar each = zrUtil.each;\nfunction hasKeys(obj) {\n  if (obj) {\n    for (var name_1 in obj) {\n      if (obj.hasOwnProperty(name_1)) {\n        return true;\n      }\n    }\n  }\n}\nexport function createVisualMappings(option, stateList, supplementVisualOption) {\n  var visualMappings = {};\n  each(stateList, function (state) {\n    var mappings = visualMappings[state] = createMappings();\n    each(option[state], function (visualData, visualType) {\n      if (!VisualMapping.isValidType(visualType)) {\n        return;\n      }\n      var mappingOption = {\n        type: visualType,\n        visual: visualData\n      };\n      supplementVisualOption && supplementVisualOption(mappingOption, state);\n      mappings[visualType] = new VisualMapping(mappingOption);\n      // Prepare a alpha for opacity, for some case that opacity\n      // is not supported, such as rendering using gradient color.\n      if (visualType === 'opacity') {\n        mappingOption = zrUtil.clone(mappingOption);\n        mappingOption.type = 'colorAlpha';\n        mappings.__hidden.__alphaForOpacity = new VisualMapping(mappingOption);\n      }\n    });\n  });\n  return visualMappings;\n  function createMappings() {\n    var Creater = function () {};\n    // Make sure hidden fields will not be visited by\n    // object iteration (with hasOwnProperty checking).\n    Creater.prototype.__hidden = Creater.prototype;\n    var obj = new Creater();\n    return obj;\n  }\n}\nexport function replaceVisualOption(thisOption, newOption, keys) {\n  // Visual attributes merge is not supported, otherwise it\n  // brings overcomplicated merge logic. See #2853. So if\n  // newOption has anyone of these keys, all of these keys\n  // will be reset. Otherwise, all keys remain.\n  var has;\n  zrUtil.each(keys, function (key) {\n    if (newOption.hasOwnProperty(key) && hasKeys(newOption[key])) {\n      has = true;\n    }\n  });\n  has && zrUtil.each(keys, function (key) {\n    if (newOption.hasOwnProperty(key) && hasKeys(newOption[key])) {\n      thisOption[key] = zrUtil.clone(newOption[key]);\n    } else {\n      delete thisOption[key];\n    }\n  });\n}\n/**\n * @param stateList\n * @param visualMappings\n * @param list\n * @param getValueState param: valueOrIndex, return: state.\n * @param scope Scope for getValueState\n * @param dimension Concrete dimension, if used.\n */\n// ???! handle brush?\nexport function applyVisual(stateList, visualMappings, data, getValueState, scope, dimension) {\n  var visualTypesMap = {};\n  zrUtil.each(stateList, function (state) {\n    var visualTypes = VisualMapping.prepareVisualTypes(visualMappings[state]);\n    visualTypesMap[state] = visualTypes;\n  });\n  var dataIndex;\n  function getVisual(key) {\n    return getItemVisualFromData(data, dataIndex, key);\n  }\n  function setVisual(key, value) {\n    setItemVisualFromData(data, dataIndex, key, value);\n  }\n  if (dimension == null) {\n    data.each(eachItem);\n  } else {\n    data.each([dimension], eachItem);\n  }\n  function eachItem(valueOrIndex, index) {\n    dataIndex = dimension == null ? valueOrIndex // First argument is index\n    : index;\n    var rawDataItem = data.getRawDataItem(dataIndex);\n    // Consider performance\n    // @ts-ignore\n    if (rawDataItem && rawDataItem.visualMap === false) {\n      return;\n    }\n    var valueState = getValueState.call(scope, valueOrIndex);\n    var mappings = visualMappings[valueState];\n    var visualTypes = visualTypesMap[valueState];\n    for (var i = 0, len = visualTypes.length; i < len; i++) {\n      var type = visualTypes[i];\n      mappings[type] && mappings[type].applyVisual(valueOrIndex, getVisual, setVisual);\n    }\n  }\n}\n/**\n * @param data\n * @param stateList\n * @param visualMappings <state, Object.<visualType, module:echarts/visual/VisualMapping>>\n * @param getValueState param: valueOrIndex, return: state.\n * @param dim dimension or dimension index.\n */\nexport function incrementalApplyVisual(stateList, visualMappings, getValueState, dim) {\n  var visualTypesMap = {};\n  zrUtil.each(stateList, function (state) {\n    var visualTypes = VisualMapping.prepareVisualTypes(visualMappings[state]);\n    visualTypesMap[state] = visualTypes;\n  });\n  return {\n    progress: function progress(params, data) {\n      var dimIndex;\n      if (dim != null) {\n        dimIndex = data.getDimensionIndex(dim);\n      }\n      function getVisual(key) {\n        return getItemVisualFromData(data, dataIndex, key);\n      }\n      function setVisual(key, value) {\n        setItemVisualFromData(data, dataIndex, key, value);\n      }\n      var dataIndex;\n      var store = data.getStore();\n      while ((dataIndex = params.next()) != null) {\n        var rawDataItem = data.getRawDataItem(dataIndex);\n        // Consider performance\n        // @ts-ignore\n        if (rawDataItem && rawDataItem.visualMap === false) {\n          continue;\n        }\n        var value = dim != null ? store.get(dimIndex, dataIndex) : dataIndex;\n        var valueState = getValueState(value);\n        var mappings = visualMappings[valueState];\n        var visualTypes = visualTypesMap[valueState];\n        for (var i = 0, len = visualTypes.length; i < len; i++) {\n          var type = visualTypes[i];\n          mappings[type] && mappings[type].applyVisual(value, getVisual, setVisual);\n        }\n      }\n    }\n  };\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as polygonContain from 'zrender/lib/contain/polygon.js';\nimport BoundingRect from 'zrender/lib/core/BoundingRect.js';\nimport { linePolygonIntersect } from '../../util/graphic.js';\nexport function makeBrushCommonSelectorForSeries(area) {\n  var brushType = area.brushType;\n  // Do not use function binding or curry for performance.\n  var selectors = {\n    point: function (itemLayout) {\n      return selector[brushType].point(itemLayout, selectors, area);\n    },\n    rect: function (itemLayout) {\n      return selector[brushType].rect(itemLayout, selectors, area);\n    }\n  };\n  return selectors;\n}\nvar selector = {\n  lineX: getLineSelectors(0),\n  lineY: getLineSelectors(1),\n  rect: {\n    point: function (itemLayout, selectors, area) {\n      return itemLayout && area.boundingRect.contain(itemLayout[0], itemLayout[1]);\n    },\n    rect: function (itemLayout, selectors, area) {\n      return itemLayout && area.boundingRect.intersect(itemLayout);\n    }\n  },\n  polygon: {\n    point: function (itemLayout, selectors, area) {\n      return itemLayout && area.boundingRect.contain(itemLayout[0], itemLayout[1]) && polygonContain.contain(area.range, itemLayout[0], itemLayout[1]);\n    },\n    rect: function (itemLayout, selectors, area) {\n      var points = area.range;\n      if (!itemLayout || points.length <= 1) {\n        return false;\n      }\n      var x = itemLayout.x;\n      var y = itemLayout.y;\n      var width = itemLayout.width;\n      var height = itemLayout.height;\n      var p = points[0];\n      if (polygonContain.contain(points, x, y) || polygonContain.contain(points, x + width, y) || polygonContain.contain(points, x, y + height) || polygonContain.contain(points, x + width, y + height) || BoundingRect.create(itemLayout).contain(p[0], p[1]) || linePolygonIntersect(x, y, x + width, y, points) || linePolygonIntersect(x, y, x, y + height, points) || linePolygonIntersect(x + width, y, x + width, y + height, points) || linePolygonIntersect(x, y + height, x + width, y + height, points)) {\n        return true;\n      }\n    }\n  }\n};\nfunction getLineSelectors(xyIndex) {\n  var xy = ['x', 'y'];\n  var wh = ['width', 'height'];\n  return {\n    point: function (itemLayout, selectors, area) {\n      if (itemLayout) {\n        var range = area.range;\n        var p = itemLayout[xyIndex];\n        return inLineRange(p, range);\n      }\n    },\n    rect: function (itemLayout, selectors, area) {\n      if (itemLayout) {\n        var range = area.range;\n        var layoutRange = [itemLayout[xy[xyIndex]], itemLayout[xy[xyIndex]] + itemLayout[wh[xyIndex]]];\n        layoutRange[1] < layoutRange[0] && layoutRange.reverse();\n        return inLineRange(layoutRange[0], range) || inLineRange(layoutRange[1], range) || inLineRange(range[0], layoutRange) || inLineRange(range[1], layoutRange);\n      }\n    }\n  };\n}\nfunction inLineRange(p, range) {\n  return range[0] <= p && p <= range[1];\n}\nexport default selector;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport BoundingRect from 'zrender/lib/core/BoundingRect.js';\nimport * as visualSolution from '../../visual/visualSolution.js';\nimport { makeBrushCommonSelectorForSeries } from './selector.js';\nimport * as throttleUtil from '../../util/throttle.js';\nimport BrushTargetManager from '../helper/BrushTargetManager.js';\nvar STATE_LIST = ['inBrush', 'outOfBrush'];\nvar DISPATCH_METHOD = '__ecBrushSelect';\nvar DISPATCH_FLAG = '__ecInBrushSelectEvent';\n;\nexport function layoutCovers(ecModel) {\n  ecModel.eachComponent({\n    mainType: 'brush'\n  }, function (brushModel) {\n    var brushTargetManager = brushModel.brushTargetManager = new BrushTargetManager(brushModel.option, ecModel);\n    brushTargetManager.setInputRanges(brushModel.areas, ecModel);\n  });\n}\n/**\n * Register the visual encoding if this modules required.\n */\nexport default function brushVisual(ecModel, api, payload) {\n  var brushSelected = [];\n  var throttleType;\n  var throttleDelay;\n  ecModel.eachComponent({\n    mainType: 'brush'\n  }, function (brushModel) {\n    payload && payload.type === 'takeGlobalCursor' && brushModel.setBrushOption(payload.key === 'brush' ? payload.brushOption : {\n      brushType: false\n    });\n  });\n  layoutCovers(ecModel);\n  ecModel.eachComponent({\n    mainType: 'brush'\n  }, function (brushModel, brushIndex) {\n    var thisBrushSelected = {\n      brushId: brushModel.id,\n      brushIndex: brushIndex,\n      brushName: brushModel.name,\n      areas: zrUtil.clone(brushModel.areas),\n      selected: []\n    };\n    // Every brush component exists in event params, convenient\n    // for user to find by index.\n    brushSelected.push(thisBrushSelected);\n    var brushOption = brushModel.option;\n    var brushLink = brushOption.brushLink;\n    var linkedSeriesMap = [];\n    var selectedDataIndexForLink = [];\n    var rangeInfoBySeries = [];\n    var hasBrushExists = false;\n    if (!brushIndex) {\n      // Only the first throttle setting works.\n      throttleType = brushOption.throttleType;\n      throttleDelay = brushOption.throttleDelay;\n    }\n    // Add boundingRect and selectors to range.\n    var areas = zrUtil.map(brushModel.areas, function (area) {\n      var builder = boundingRectBuilders[area.brushType];\n      var selectableArea = zrUtil.defaults({\n        boundingRect: builder ? builder(area) : void 0\n      }, area);\n      selectableArea.selectors = makeBrushCommonSelectorForSeries(selectableArea);\n      return selectableArea;\n    });\n    var visualMappings = visualSolution.createVisualMappings(brushModel.option, STATE_LIST, function (mappingOption) {\n      mappingOption.mappingMethod = 'fixed';\n    });\n    zrUtil.isArray(brushLink) && zrUtil.each(brushLink, function (seriesIndex) {\n      linkedSeriesMap[seriesIndex] = 1;\n    });\n    function linkOthers(seriesIndex) {\n      return brushLink === 'all' || !!linkedSeriesMap[seriesIndex];\n    }\n    // If no supported brush or no brush on the series,\n    // all visuals should be in original state.\n    function brushed(rangeInfoList) {\n      return !!rangeInfoList.length;\n    }\n    /**\n     * Logic for each series: (If the logic has to be modified one day, do it carefully!)\n     *\n     * ( brushed \u252C && \u252ChasBrushExist \u252C && linkOthers  ) => StepA: \u252Crecord, \u252C StepB: \u252CvisualByRecord.\n     *   !brushed\u2518    \u251ChasBrushExist \u2524                            \u2514nothing,\u2518        \u251CvisualByRecord.\n     *                \u2514!hasBrushExist\u2518                                              \u2514nothing.\n     * ( !brushed  && \u252ChasBrushExist \u252C && linkOthers  ) => StepA:  nothing,  StepB: \u252CvisualByRecord.\n     *                \u2514!hasBrushExist\u2518                                              \u2514nothing.\n     * ( brushed \u252C &&                     !linkOthers ) => StepA:  nothing,  StepB: \u252CvisualByCheck.\n     *   !brushed\u2518                                                                  \u2514nothing.\n     * ( !brushed  &&                     !linkOthers ) => StepA:  nothing,  StepB:  nothing.\n     */\n    // Step A\n    ecModel.eachSeries(function (seriesModel, seriesIndex) {\n      var rangeInfoList = rangeInfoBySeries[seriesIndex] = [];\n      seriesModel.subType === 'parallel' ? stepAParallel(seriesModel, seriesIndex) : stepAOthers(seriesModel, seriesIndex, rangeInfoList);\n    });\n    function stepAParallel(seriesModel, seriesIndex) {\n      var coordSys = seriesModel.coordinateSystem;\n      hasBrushExists = hasBrushExists || coordSys.hasAxisBrushed();\n      linkOthers(seriesIndex) && coordSys.eachActiveState(seriesModel.getData(), function (activeState, dataIndex) {\n        activeState === 'active' && (selectedDataIndexForLink[dataIndex] = 1);\n      });\n    }\n    function stepAOthers(seriesModel, seriesIndex, rangeInfoList) {\n      if (!seriesModel.brushSelector || brushModelNotControll(brushModel, seriesIndex)) {\n        return;\n      }\n      zrUtil.each(areas, function (area) {\n        if (brushModel.brushTargetManager.controlSeries(area, seriesModel, ecModel)) {\n          rangeInfoList.push(area);\n        }\n        hasBrushExists = hasBrushExists || brushed(rangeInfoList);\n      });\n      if (linkOthers(seriesIndex) && brushed(rangeInfoList)) {\n        var data_1 = seriesModel.getData();\n        data_1.each(function (dataIndex) {\n          if (checkInRange(seriesModel, rangeInfoList, data_1, dataIndex)) {\n            selectedDataIndexForLink[dataIndex] = 1;\n          }\n        });\n      }\n    }\n    // Step B\n    ecModel.eachSeries(function (seriesModel, seriesIndex) {\n      var seriesBrushSelected = {\n        seriesId: seriesModel.id,\n        seriesIndex: seriesIndex,\n        seriesName: seriesModel.name,\n        dataIndex: []\n      };\n      // Every series exists in event params, convenient\n      // for user to find series by seriesIndex.\n      thisBrushSelected.selected.push(seriesBrushSelected);\n      var rangeInfoList = rangeInfoBySeries[seriesIndex];\n      var data = seriesModel.getData();\n      var getValueState = linkOthers(seriesIndex) ? function (dataIndex) {\n        return selectedDataIndexForLink[dataIndex] ? (seriesBrushSelected.dataIndex.push(data.getRawIndex(dataIndex)), 'inBrush') : 'outOfBrush';\n      } : function (dataIndex) {\n        return checkInRange(seriesModel, rangeInfoList, data, dataIndex) ? (seriesBrushSelected.dataIndex.push(data.getRawIndex(dataIndex)), 'inBrush') : 'outOfBrush';\n      };\n      // If no supported brush or no brush, all visuals are in original state.\n      (linkOthers(seriesIndex) ? hasBrushExists : brushed(rangeInfoList)) && visualSolution.applyVisual(STATE_LIST, visualMappings, data, getValueState);\n    });\n  });\n  dispatchAction(api, throttleType, throttleDelay, brushSelected, payload);\n}\n;\nfunction dispatchAction(api, throttleType, throttleDelay, brushSelected, payload) {\n  // This event will not be triggered when `setOpion`, otherwise dead lock may\n  // triggered when do `setOption` in event listener, which we do not find\n  // satisfactory way to solve yet. Some considered resolutions:\n  // (a) Diff with prevoius selected data ant only trigger event when changed.\n  // But store previous data and diff precisely (i.e., not only by dataIndex, but\n  // also detect value changes in selected data) might bring complexity or fragility.\n  // (b) Use spectial param like `silent` to suppress event triggering.\n  // But such kind of volatile param may be weird in `setOption`.\n  if (!payload) {\n    return;\n  }\n  var zr = api.getZr();\n  if (zr[DISPATCH_FLAG]) {\n    return;\n  }\n  if (!zr[DISPATCH_METHOD]) {\n    zr[DISPATCH_METHOD] = doDispatch;\n  }\n  var fn = throttleUtil.createOrUpdate(zr, DISPATCH_METHOD, throttleDelay, throttleType);\n  fn(api, brushSelected);\n}\nfunction doDispatch(api, brushSelected) {\n  if (!api.isDisposed()) {\n    var zr = api.getZr();\n    zr[DISPATCH_FLAG] = true;\n    api.dispatchAction({\n      type: 'brushSelect',\n      batch: brushSelected\n    });\n    zr[DISPATCH_FLAG] = false;\n  }\n}\nfunction checkInRange(seriesModel, rangeInfoList, data, dataIndex) {\n  for (var i = 0, len = rangeInfoList.length; i < len; i++) {\n    var area = rangeInfoList[i];\n    if (seriesModel.brushSelector(dataIndex, data, area.selectors, area)) {\n      return true;\n    }\n  }\n}\nfunction brushModelNotControll(brushModel, seriesIndex) {\n  var seriesIndices = brushModel.option.seriesIndex;\n  return seriesIndices != null && seriesIndices !== 'all' && (zrUtil.isArray(seriesIndices) ? zrUtil.indexOf(seriesIndices, seriesIndex) < 0 : seriesIndex !== seriesIndices);\n}\nvar boundingRectBuilders = {\n  rect: function (area) {\n    return getBoundingRectFromMinMax(area.range);\n  },\n  polygon: function (area) {\n    var minMax;\n    var range = area.range;\n    for (var i = 0, len = range.length; i < len; i++) {\n      minMax = minMax || [[Infinity, -Infinity], [Infinity, -Infinity]];\n      var rg = range[i];\n      rg[0] < minMax[0][0] && (minMax[0][0] = rg[0]);\n      rg[0] > minMax[0][1] && (minMax[0][1] = rg[0]);\n      rg[1] < minMax[1][0] && (minMax[1][0] = rg[1]);\n      rg[1] > minMax[1][1] && (minMax[1][1] = rg[1]);\n    }\n    return minMax && getBoundingRectFromMinMax(minMax);\n  }\n};\nfunction getBoundingRectFromMinMax(minMax) {\n  return new BoundingRect(minMax[0][0], minMax[1][0], minMax[0][1] - minMax[0][0], minMax[1][1] - minMax[1][0]);\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport BrushController from '../helper/BrushController.js';\nimport { layoutCovers } from './visualEncoding.js';\nimport ComponentView from '../../view/Component.js';\nvar BrushView = /** @class */function (_super) {\n  __extends(BrushView, _super);\n  function BrushView() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = BrushView.type;\n    return _this;\n  }\n  BrushView.prototype.init = function (ecModel, api) {\n    this.ecModel = ecModel;\n    this.api = api;\n    this.model;\n    (this._brushController = new BrushController(api.getZr())).on('brush', zrUtil.bind(this._onBrush, this)).mount();\n  };\n  BrushView.prototype.render = function (brushModel, ecModel, api, payload) {\n    this.model = brushModel;\n    this._updateController(brushModel, ecModel, api, payload);\n  };\n  BrushView.prototype.updateTransform = function (brushModel, ecModel, api, payload) {\n    // PENDING: `updateTransform` is a little tricky, whose layout need\n    // to be calculate mandatorily and other stages will not be performed.\n    // Take care the correctness of the logic. See #11754 .\n    layoutCovers(ecModel);\n    this._updateController(brushModel, ecModel, api, payload);\n  };\n  BrushView.prototype.updateVisual = function (brushModel, ecModel, api, payload) {\n    this.updateTransform(brushModel, ecModel, api, payload);\n  };\n  BrushView.prototype.updateView = function (brushModel, ecModel, api, payload) {\n    this._updateController(brushModel, ecModel, api, payload);\n  };\n  BrushView.prototype._updateController = function (brushModel, ecModel, api, payload) {\n    // Do not update controller when drawing.\n    (!payload || payload.$from !== brushModel.id) && this._brushController.setPanels(brushModel.brushTargetManager.makePanelOpts(api)).enableBrush(brushModel.brushOption).updateCovers(brushModel.areas.slice());\n  };\n  // updateLayout: updateController,\n  // updateVisual: updateController,\n  BrushView.prototype.dispose = function () {\n    this._brushController.dispose();\n  };\n  BrushView.prototype._onBrush = function (eventParam) {\n    var modelId = this.model.id;\n    var areas = this.model.brushTargetManager.setOutputRanges(eventParam.areas, this.ecModel);\n    // Action is not dispatched on drag end, because the drag end\n    // emits the same params with the last drag move event, and\n    // may have some delay when using touch pad, which makes\n    // animation not smooth (when using debounce).\n    (!eventParam.isEnd || eventParam.removeOnClick) && this.api.dispatchAction({\n      type: 'brush',\n      brushId: modelId,\n      areas: zrUtil.clone(areas),\n      $from: modelId\n    });\n    eventParam.isEnd && this.api.dispatchAction({\n      type: 'brushEnd',\n      brushId: modelId,\n      areas: zrUtil.clone(areas),\n      $from: modelId\n    });\n  };\n  BrushView.type = 'brush';\n  return BrushView;\n}(ComponentView);\nexport default BrushView;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as visualSolution from '../../visual/visualSolution.js';\nimport Model from '../../model/Model.js';\nimport ComponentModel from '../../model/Component.js';\nimport tokens from '../../visual/tokens.js';\nvar BrushModel = /** @class */function (_super) {\n  __extends(BrushModel, _super);\n  function BrushModel() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = BrushModel.type;\n    /**\n     * @readOnly\n     */\n    _this.areas = [];\n    /**\n     * Current brush painting area settings.\n     * @readOnly\n     */\n    _this.brushOption = {};\n    return _this;\n  }\n  BrushModel.prototype.optionUpdated = function (newOption, isInit) {\n    var thisOption = this.option;\n    !isInit && visualSolution.replaceVisualOption(thisOption, newOption, ['inBrush', 'outOfBrush']);\n    var inBrush = thisOption.inBrush = thisOption.inBrush || {};\n    // Always give default visual, consider setOption at the second time.\n    thisOption.outOfBrush = thisOption.outOfBrush || {\n      color: this.option.defaultOutOfBrushColor\n    };\n    if (!inBrush.hasOwnProperty('liftZ')) {\n      // Bigger than the highlight z lift, otherwise it will\n      // be effected by the highlight z when brush.\n      inBrush.liftZ = 5;\n    }\n  };\n  /**\n   * If `areas` is null/undefined, range state remain.\n   */\n  BrushModel.prototype.setAreas = function (areas) {\n    if (process.env.NODE_ENV !== 'production') {\n      zrUtil.assert(zrUtil.isArray(areas));\n      zrUtil.each(areas, function (area) {\n        zrUtil.assert(area.brushType, 'Illegal areas');\n      });\n    }\n    // If areas is null/undefined, range state remain.\n    // This helps user to dispatchAction({type: 'brush'}) with no areas\n    // set but just want to get the current brush select info from a `brush` event.\n    if (!areas) {\n      return;\n    }\n    this.areas = zrUtil.map(areas, function (area) {\n      return generateBrushOption(this.option, area);\n    }, this);\n  };\n  /**\n   * Set the current painting brush option.\n   */\n  BrushModel.prototype.setBrushOption = function (brushOption) {\n    this.brushOption = generateBrushOption(this.option, brushOption);\n    this.brushType = this.brushOption.brushType;\n  };\n  BrushModel.type = 'brush';\n  BrushModel.dependencies = ['geo', 'grid', 'xAxis', 'yAxis', 'parallel', 'series'];\n  BrushModel.defaultOption = {\n    seriesIndex: 'all',\n    brushType: 'rect',\n    brushMode: 'single',\n    transformable: true,\n    brushStyle: {\n      borderWidth: 1,\n      color: tokens.color.backgroundTint,\n      borderColor: tokens.color.borderTint\n    },\n    throttleType: 'fixRate',\n    throttleDelay: 0,\n    removeOnClick: true,\n    z: 10000,\n    defaultOutOfBrushColor: tokens.color.disabled\n  };\n  return BrushModel;\n}(ComponentModel);\nfunction generateBrushOption(option, brushOption) {\n  return zrUtil.merge({\n    brushType: option.brushType,\n    brushMode: option.brushMode,\n    transformable: option.transformable,\n    brushStyle: new Model(option.brushStyle).getItemStyle(),\n    removeOnClick: option.removeOnClick,\n    z: option.z\n  }, brushOption, true);\n}\nexport default BrushModel;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { ToolboxFeature } from '../featureManager.js';\nvar ICON_TYPES = ['rect', 'polygon', 'lineX', 'lineY', 'keep', 'clear'];\nvar BrushFeature = /** @class */function (_super) {\n  __extends(BrushFeature, _super);\n  function BrushFeature() {\n    return _super !== null && _super.apply(this, arguments) || this;\n  }\n  BrushFeature.prototype.render = function (featureModel, ecModel, api) {\n    var brushType;\n    var brushMode;\n    var isBrushed;\n    ecModel.eachComponent({\n      mainType: 'brush'\n    }, function (brushModel) {\n      brushType = brushModel.brushType;\n      brushMode = brushModel.brushOption.brushMode || 'single';\n      isBrushed = isBrushed || !!brushModel.areas.length;\n    });\n    this._brushType = brushType;\n    this._brushMode = brushMode;\n    zrUtil.each(featureModel.get('type', true), function (type) {\n      featureModel.setIconStatus(type, (type === 'keep' ? brushMode === 'multiple' : type === 'clear' ? isBrushed : type === brushType) ? 'emphasis' : 'normal');\n    });\n  };\n  BrushFeature.prototype.updateView = function (featureModel, ecModel, api) {\n    this.render(featureModel, ecModel, api);\n  };\n  BrushFeature.prototype.getIcons = function () {\n    var model = this.model;\n    var availableIcons = model.get('icon', true);\n    var icons = {};\n    zrUtil.each(model.get('type', true), function (type) {\n      if (availableIcons[type]) {\n        icons[type] = availableIcons[type];\n      }\n    });\n    return icons;\n  };\n  ;\n  BrushFeature.prototype.onclick = function (ecModel, api, type) {\n    var brushType = this._brushType;\n    var brushMode = this._brushMode;\n    if (type === 'clear') {\n      // Trigger parallel action firstly\n      api.dispatchAction({\n        type: 'axisAreaSelect',\n        intervals: []\n      });\n      api.dispatchAction({\n        type: 'brush',\n        command: 'clear',\n        // Clear all areas of all brush components.\n        areas: []\n      });\n    } else {\n      api.dispatchAction({\n        type: 'takeGlobalCursor',\n        key: 'brush',\n        brushOption: {\n          brushType: type === 'keep' ? brushType : brushType === type ? false : type,\n          brushMode: type === 'keep' ? brushMode === 'multiple' ? 'single' : 'multiple' : brushMode\n        }\n      });\n    }\n  };\n  ;\n  BrushFeature.getDefaultOption = function (ecModel) {\n    var defaultOption = {\n      show: true,\n      type: ICON_TYPES.slice(),\n      icon: {\n        /* eslint-disable */\n        rect: 'M7.3,34.7 M0.4,10V-0.2h9.8 M89.6,10V-0.2h-9.8 M0.4,60v10.2h9.8 M89.6,60v10.2h-9.8 M12.3,22.4V10.5h13.1 M33.6,10.5h7.8 M49.1,10.5h7.8 M77.5,22.4V10.5h-13 M12.3,31.1v8.2 M77.7,31.1v8.2 M12.3,47.6v11.9h13.1 M33.6,59.5h7.6 M49.1,59.5 h7.7 M77.5,47.6v11.9h-13',\n        polygon: 'M55.2,34.9c1.7,0,3.1,1.4,3.1,3.1s-1.4,3.1-3.1,3.1 s-3.1-1.4-3.1-3.1S53.5,34.9,55.2,34.9z M50.4,51c1.7,0,3.1,1.4,3.1,3.1c0,1.7-1.4,3.1-3.1,3.1c-1.7,0-3.1-1.4-3.1-3.1 C47.3,52.4,48.7,51,50.4,51z M55.6,37.1l1.5-7.8 M60.1,13.5l1.6-8.7l-7.8,4 M59,19l-1,5.3 M24,16.1l6.4,4.9l6.4-3.3 M48.5,11.6 l-5.9,3.1 M19.1,12.8L9.7,5.1l1.1,7.7 M13.4,29.8l1,7.3l6.6,1.6 M11.6,18.4l1,6.1 M32.8,41.9 M26.6,40.4 M27.3,40.2l6.1,1.6 M49.9,52.1l-5.6-7.6l-4.9-1.2',\n        lineX: 'M15.2,30 M19.7,15.6V1.9H29 M34.8,1.9H40.4 M55.3,15.6V1.9H45.9 M19.7,44.4V58.1H29 M34.8,58.1H40.4 M55.3,44.4 V58.1H45.9 M12.5,20.3l-9.4,9.6l9.6,9.8 M3.1,29.9h16.5 M62.5,20.3l9.4,9.6L62.3,39.7 M71.9,29.9H55.4',\n        lineY: 'M38.8,7.7 M52.7,12h13.2v9 M65.9,26.6V32 M52.7,46.3h13.2v-9 M24.9,12H11.8v9 M11.8,26.6V32 M24.9,46.3H11.8v-9 M48.2,5.1l-9.3-9l-9.4,9.2 M38.9-3.9V12 M48.2,53.3l-9.3,9l-9.4-9.2 M38.9,62.3V46.4',\n        keep: 'M4,10.5V1h10.3 M20.7,1h6.1 M33,1h6.1 M55.4,10.5V1H45.2 M4,17.3v6.6 M55.6,17.3v6.6 M4,30.5V40h10.3 M20.7,40 h6.1 M33,40h6.1 M55.4,30.5V40H45.2 M21,18.9h62.9v48.6H21V18.9z',\n        clear: 'M22,14.7l30.9,31 M52.9,14.7L22,45.7 M4.7,16.8V4.2h13.1 M26,4.2h7.8 M41.6,4.2h7.8 M70.3,16.8V4.2H57.2 M4.7,25.9v8.6 M70.3,25.9v8.6 M4.7,43.2v12.6h13.1 M26,55.8h7.8 M41.6,55.8h7.8 M70.3,43.2v12.6H57.2' // jshint ignore:line\n        /* eslint-enable */\n      },\n      // `rect`, `polygon`, `lineX`, `lineY`, `keep`, `clear`\n      title: ecModel.getLocaleModel().get(['toolbox', 'brush', 'title'])\n    };\n    return defaultOption;\n  };\n  return BrushFeature;\n}(ToolboxFeature);\nexport default BrushFeature;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport brushPreprocessor from './preprocessor.js';\nimport BrushView from './BrushView.js';\nimport BrushModel from './BrushModel.js';\nimport brushVisual from './visualEncoding.js';\n// TODO\nimport BrushFeature from '../toolbox/feature/Brush.js';\nimport { registerFeature } from '../toolbox/featureManager.js';\nimport { noop } from 'zrender/lib/core/util.js';\nexport function install(registers) {\n  registers.registerComponentView(BrushView);\n  registers.registerComponentModel(BrushModel);\n  registers.registerPreprocessor(brushPreprocessor);\n  registers.registerVisual(registers.PRIORITY.VISUAL.BRUSH, brushVisual);\n  registers.registerAction({\n    type: 'brush',\n    event: 'brush',\n    update: 'updateVisual'\n  }, function (payload, ecModel) {\n    ecModel.eachComponent({\n      mainType: 'brush',\n      query: payload\n    }, function (brushModel) {\n      brushModel.setAreas(payload.areas);\n    });\n  });\n  /**\n   * payload: {\n   *      brushComponents: [\n   *          {\n   *              brushId,\n   *              brushIndex,\n   *              brushName,\n   *              series: [\n   *                  {\n   *                      seriesId,\n   *                      seriesIndex,\n   *                      seriesName,\n   *                      rawIndices: [21, 34, ...]\n   *                  },\n   *                  ...\n   *              ]\n   *          },\n   *          ...\n   *      ]\n   * }\n   */\n  registers.registerAction({\n    type: 'brushSelect',\n    event: 'brushSelected',\n    update: 'none'\n  }, noop);\n  registers.registerAction({\n    type: 'brushEnd',\n    event: 'brushEnd',\n    update: 'none'\n  }, noop);\n  registerFeature('brush', BrushFeature);\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as graphic from '../../util/graphic.js';\nimport { getECData } from '../../util/innerStore.js';\nimport { createTextStyle } from '../../label/labelStyle.js';\nimport { createBoxLayoutReference, getLayoutRect } from '../../util/layout.js';\nimport ComponentModel from '../../model/Component.js';\nimport ComponentView from '../../view/Component.js';\nimport { windowOpen } from '../../util/format.js';\nimport tokens from '../../visual/tokens.js';\nvar TitleModel = /** @class */function (_super) {\n  __extends(TitleModel, _super);\n  function TitleModel() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = TitleModel.type;\n    _this.layoutMode = {\n      type: 'box',\n      ignoreSize: true\n    };\n    return _this;\n  }\n  TitleModel.type = 'title';\n  TitleModel.defaultOption = {\n    // zlevel: 0,\n    z: 6,\n    show: true,\n    text: '',\n    target: 'blank',\n    subtext: '',\n    subtarget: 'blank',\n    left: 'center',\n    top: tokens.size.m,\n    backgroundColor: tokens.color.transparent,\n    borderColor: tokens.color.primary,\n    borderWidth: 0,\n    padding: 5,\n    itemGap: 10,\n    textStyle: {\n      fontSize: 18,\n      fontWeight: 'bold',\n      color: tokens.color.primary\n    },\n    subtextStyle: {\n      fontSize: 12,\n      color: tokens.color.quaternary\n    }\n  };\n  return TitleModel;\n}(ComponentModel);\n// View\nvar TitleView = /** @class */function (_super) {\n  __extends(TitleView, _super);\n  function TitleView() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = TitleView.type;\n    return _this;\n  }\n  TitleView.prototype.render = function (titleModel, ecModel, api) {\n    this.group.removeAll();\n    if (!titleModel.get('show')) {\n      return;\n    }\n    var group = this.group;\n    var textStyleModel = titleModel.getModel('textStyle');\n    var subtextStyleModel = titleModel.getModel('subtextStyle');\n    var textAlign = titleModel.get('textAlign');\n    var textVerticalAlign = zrUtil.retrieve2(titleModel.get('textBaseline'), titleModel.get('textVerticalAlign'));\n    var textEl = new graphic.Text({\n      style: createTextStyle(textStyleModel, {\n        text: titleModel.get('text'),\n        fill: textStyleModel.getTextColor()\n      }, {\n        disableBox: true\n      }),\n      z2: 10\n    });\n    var textRect = textEl.getBoundingRect();\n    var subText = titleModel.get('subtext');\n    var subTextEl = new graphic.Text({\n      style: createTextStyle(subtextStyleModel, {\n        text: subText,\n        fill: subtextStyleModel.getTextColor(),\n        y: textRect.height + titleModel.get('itemGap'),\n        verticalAlign: 'top'\n      }, {\n        disableBox: true\n      }),\n      z2: 10\n    });\n    var link = titleModel.get('link');\n    var sublink = titleModel.get('sublink');\n    var triggerEvent = titleModel.get('triggerEvent', true);\n    textEl.silent = !link && !triggerEvent;\n    subTextEl.silent = !sublink && !triggerEvent;\n    if (link) {\n      textEl.on('click', function () {\n        windowOpen(link, '_' + titleModel.get('target'));\n      });\n    }\n    if (sublink) {\n      subTextEl.on('click', function () {\n        windowOpen(sublink, '_' + titleModel.get('subtarget'));\n      });\n    }\n    getECData(textEl).eventData = getECData(subTextEl).eventData = triggerEvent ? {\n      componentType: 'title',\n      componentIndex: titleModel.componentIndex\n    } : null;\n    group.add(textEl);\n    subText && group.add(subTextEl);\n    // If no subText, but add subTextEl, there will be an empty line.\n    var groupRect = group.getBoundingRect();\n    var layoutOption = titleModel.getBoxLayoutParams();\n    layoutOption.width = groupRect.width;\n    layoutOption.height = groupRect.height;\n    var layoutRef = createBoxLayoutReference(titleModel, api);\n    var layoutRect = getLayoutRect(layoutOption, layoutRef.refContainer, titleModel.get('padding'));\n    // Adjust text align based on position\n    if (!textAlign) {\n      // Align left if title is on the left. center and right is same\n      textAlign = titleModel.get('left') || titleModel.get('right');\n      // @ts-ignore\n      if (textAlign === 'middle') {\n        textAlign = 'center';\n      }\n      // Adjust layout by text align\n      if (textAlign === 'right') {\n        layoutRect.x += layoutRect.width;\n      } else if (textAlign === 'center') {\n        layoutRect.x += layoutRect.width / 2;\n      }\n    }\n    if (!textVerticalAlign) {\n      textVerticalAlign = titleModel.get('top') || titleModel.get('bottom');\n      // @ts-ignore\n      if (textVerticalAlign === 'center') {\n        textVerticalAlign = 'middle';\n      }\n      if (textVerticalAlign === 'bottom') {\n        layoutRect.y += layoutRect.height;\n      } else if (textVerticalAlign === 'middle') {\n        layoutRect.y += layoutRect.height / 2;\n      }\n      textVerticalAlign = textVerticalAlign || 'top';\n    }\n    group.x = layoutRect.x;\n    group.y = layoutRect.y;\n    group.markRedraw();\n    var alignStyle = {\n      align: textAlign,\n      verticalAlign: textVerticalAlign\n    };\n    textEl.setStyle(alignStyle);\n    subTextEl.setStyle(alignStyle);\n    // Render background\n    // Get groupRect again because textAlign has been changed\n    groupRect = group.getBoundingRect();\n    var padding = layoutRect.margin;\n    var style = titleModel.getItemStyle(['color', 'opacity']);\n    style.fill = titleModel.get('backgroundColor');\n    var rect = new graphic.Rect({\n      shape: {\n        x: groupRect.x - padding[3],\n        y: groupRect.y - padding[0],\n        width: groupRect.width + padding[1] + padding[3],\n        height: groupRect.height + padding[0] + padding[2],\n        r: titleModel.get('borderRadius')\n      },\n      style: style,\n      subPixelOptimize: true,\n      silent: true\n    });\n    group.add(rect);\n  };\n  TitleView.type = 'title';\n  return TitleView;\n}(ComponentView);\nexport function install(registers) {\n  registers.registerComponentModel(TitleModel);\n  registers.registerComponentView(TitleView);\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport ComponentModel from '../../model/Component.js';\nimport SeriesData from '../../data/SeriesData.js';\nimport { each, isObject, clone } from 'zrender/lib/core/util.js';\nimport { convertOptionIdName, getDataItemValue } from '../../util/model.js';\nimport tokens from '../../visual/tokens.js';\nvar TimelineModel = /** @class */function (_super) {\n  __extends(TimelineModel, _super);\n  function TimelineModel() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = TimelineModel.type;\n    _this.layoutMode = 'box';\n    return _this;\n  }\n  /**\n   * @override\n   */\n  TimelineModel.prototype.init = function (option, parentModel, ecModel) {\n    this.mergeDefaultAndTheme(option, ecModel);\n    this._initData();\n  };\n  /**\n   * @override\n   */\n  TimelineModel.prototype.mergeOption = function (option) {\n    _super.prototype.mergeOption.apply(this, arguments);\n    this._initData();\n  };\n  TimelineModel.prototype.setCurrentIndex = function (currentIndex) {\n    if (currentIndex == null) {\n      currentIndex = this.option.currentIndex;\n    }\n    var count = this._data.count();\n    if (this.option.loop) {\n      currentIndex = (currentIndex % count + count) % count;\n    } else {\n      currentIndex >= count && (currentIndex = count - 1);\n      currentIndex < 0 && (currentIndex = 0);\n    }\n    this.option.currentIndex = currentIndex;\n  };\n  /**\n   * @return {number} currentIndex\n   */\n  TimelineModel.prototype.getCurrentIndex = function () {\n    return this.option.currentIndex;\n  };\n  /**\n   * @return {boolean}\n   */\n  TimelineModel.prototype.isIndexMax = function () {\n    return this.getCurrentIndex() >= this._data.count() - 1;\n  };\n  /**\n   * @param {boolean} state true: play, false: stop\n   */\n  TimelineModel.prototype.setPlayState = function (state) {\n    this.option.autoPlay = !!state;\n  };\n  /**\n   * @return {boolean} true: play, false: stop\n   */\n  TimelineModel.prototype.getPlayState = function () {\n    return !!this.option.autoPlay;\n  };\n  /**\n   * @private\n   */\n  TimelineModel.prototype._initData = function () {\n    var thisOption = this.option;\n    var dataArr = thisOption.data || [];\n    var axisType = thisOption.axisType;\n    var names = this._names = [];\n    var processedDataArr;\n    if (axisType === 'category') {\n      processedDataArr = [];\n      each(dataArr, function (item, index) {\n        var value = convertOptionIdName(getDataItemValue(item), '');\n        var newItem;\n        if (isObject(item)) {\n          newItem = clone(item);\n          newItem.value = index;\n        } else {\n          newItem = index;\n        }\n        processedDataArr.push(newItem);\n        names.push(value);\n      });\n    } else {\n      processedDataArr = dataArr;\n    }\n    var dimType = {\n      category: 'ordinal',\n      time: 'time',\n      value: 'number'\n    }[axisType] || 'number';\n    var data = this._data = new SeriesData([{\n      name: 'value',\n      type: dimType\n    }], this);\n    data.initData(processedDataArr, names);\n  };\n  TimelineModel.prototype.getData = function () {\n    return this._data;\n  };\n  /**\n   * @public\n   * @return {Array.<string>} categoreis\n   */\n  TimelineModel.prototype.getCategories = function () {\n    if (this.get('axisType') === 'category') {\n      return this._names.slice();\n    }\n  };\n  TimelineModel.type = 'timeline';\n  /**\n   * @protected\n   */\n  TimelineModel.defaultOption = {\n    // zlevel: 0,                  // \u4E00\u7EA7\u5C42\u53E0\n    z: 4,\n    show: true,\n    axisType: 'time',\n    realtime: true,\n    left: '20%',\n    top: null,\n    right: '20%',\n    bottom: 0,\n    width: null,\n    height: 40,\n    padding: tokens.size.m,\n    controlPosition: 'left',\n    autoPlay: false,\n    rewind: false,\n    loop: true,\n    playInterval: 2000,\n    currentIndex: 0,\n    itemStyle: {},\n    label: {\n      color: tokens.color.secondary\n    },\n    data: []\n  };\n  return TimelineModel;\n}(ComponentModel);\nexport default TimelineModel;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport TimelineModel from './TimelineModel.js';\nimport { DataFormatMixin } from '../../model/mixin/dataFormat.js';\nimport { mixin } from 'zrender/lib/core/util.js';\nimport { inheritDefaultOption } from '../../util/component.js';\nimport tokens from '../../visual/tokens.js';\nvar SliderTimelineModel = /** @class */function (_super) {\n  __extends(SliderTimelineModel, _super);\n  function SliderTimelineModel() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = SliderTimelineModel.type;\n    return _this;\n  }\n  SliderTimelineModel.type = 'timeline.slider';\n  /**\n   * @protected\n   */\n  SliderTimelineModel.defaultOption = inheritDefaultOption(TimelineModel.defaultOption, {\n    backgroundColor: 'rgba(0,0,0,0)',\n    borderColor: tokens.color.border,\n    borderWidth: 0,\n    orient: 'horizontal',\n    inverse: false,\n    tooltip: {\n      trigger: 'item' // data item may also have tootip attr.\n    },\n    symbol: 'circle',\n    symbolSize: 12,\n    lineStyle: {\n      show: true,\n      width: 2,\n      color: tokens.color.accent10\n    },\n    label: {\n      position: 'auto',\n      // When using number, label position is not\n      // restricted by viewRect.\n      // positive: right/bottom, negative: left/top\n      show: true,\n      interval: 'auto',\n      rotate: 0,\n      // formatter: null,\n      // \u5176\u4F59\u5C5E\u6027\u9ED8\u8BA4\u4F7F\u7528\u5168\u5C40\u6587\u672C\u6837\u5F0F\uFF0C\u8BE6\u89C1TEXTSTYLE\n      color: tokens.color.tertiary\n    },\n    itemStyle: {\n      color: tokens.color.accent20,\n      borderWidth: 0\n    },\n    checkpointStyle: {\n      symbol: 'circle',\n      symbolSize: 15,\n      color: tokens.color.accent50,\n      borderColor: tokens.color.accent50,\n      borderWidth: 0,\n      shadowBlur: 0,\n      shadowOffsetX: 0,\n      shadowOffsetY: 0,\n      shadowColor: 'rgba(0, 0, 0, 0)',\n      // borderColor: 'rgba(194,53,49, 0.5)',\n      animation: true,\n      animationDuration: 300,\n      animationEasing: 'quinticInOut'\n    },\n    controlStyle: {\n      show: true,\n      showPlayBtn: true,\n      showPrevBtn: true,\n      showNextBtn: true,\n      itemSize: 24,\n      itemGap: 12,\n      position: 'left',\n      playIcon: 'path://M15 0C23.2843 0 30 6.71573 30 15C30 23.2843 23.2843 30 15 30C6.71573 30 0 23.2843 0 15C0 6.71573 6.71573 0 15 0ZM15 3C8.37258 3 3 8.37258 3 15C3 21.6274 8.37258 27 15 27C21.6274 27 27 21.6274 27 15C27 8.37258 21.6274 3 15 3ZM11.5 10.6699C11.5 9.90014 12.3333 9.41887 13 9.80371L20.5 14.1338C21.1667 14.5187 21.1667 15.4813 20.5 15.8662L13 20.1963C12.3333 20.5811 11.5 20.0999 11.5 19.3301V10.6699Z',\n      stopIcon: 'path://M15 0C23.2843 0 30 6.71573 30 15C30 23.2843 23.2843 30 15 30C6.71573 30 0 23.2843 0 15C0 6.71573 6.71573 0 15 0ZM15 3C8.37258 3 3 8.37258 3 15C3 21.6274 8.37258 27 15 27C21.6274 27 27 21.6274 27 15C27 8.37258 21.6274 3 15 3ZM11.5 10C12.3284 10 13 10.6716 13 11.5V18.5C13 19.3284 12.3284 20 11.5 20C10.6716 20 10 19.3284 10 18.5V11.5C10 10.6716 10.6716 10 11.5 10ZM18.5 10C19.3284 10 20 10.6716 20 11.5V18.5C20 19.3284 19.3284 20 18.5 20C17.6716 20 17 19.3284 17 18.5V11.5C17 10.6716 17.6716 10 18.5 10Z',\n      // eslint-disable-next-line max-len\n      nextIcon: 'path://M0.838834 18.7383C0.253048 18.1525 0.253048 17.2028 0.838834 16.617L7.55635 9.89949L0.838834 3.18198C0.253048 2.59619 0.253048 1.64645 0.838834 1.06066C1.42462 0.474874 2.37437 0.474874 2.96015 1.06066L10.7383 8.83883L10.8412 8.95277C11.2897 9.50267 11.2897 10.2963 10.8412 10.8462L10.7383 10.9602L2.96015 18.7383C2.37437 19.3241 1.42462 19.3241 0.838834 18.7383Z',\n      // eslint-disable-next-line max-len\n      prevIcon: 'path://M10.9602 1.06066C11.5459 1.64645 11.5459 2.59619 10.9602 3.18198L4.24264 9.89949L10.9602 16.617C11.5459 17.2028 11.5459 18.1525 10.9602 18.7383C10.3744 19.3241 9.42462 19.3241 8.83883 18.7383L1.06066 10.9602L0.957771 10.8462C0.509245 10.2963 0.509245 9.50267 0.957771 8.95277L1.06066 8.83883L8.83883 1.06066C9.42462 0.474874 10.3744 0.474874 10.9602 1.06066Z',\n      prevBtnSize: 18,\n      nextBtnSize: 18,\n      color: tokens.color.accent50,\n      borderColor: tokens.color.accent50,\n      borderWidth: 0\n    },\n    emphasis: {\n      label: {\n        show: true,\n        // \u5176\u4F59\u5C5E\u6027\u9ED8\u8BA4\u4F7F\u7528\u5168\u5C40\u6587\u672C\u6837\u5F0F\uFF0C\u8BE6\u89C1TEXTSTYLE\n        color: tokens.color.accent60\n      },\n      itemStyle: {\n        color: tokens.color.accent60,\n        borderColor: tokens.color.accent60\n      },\n      controlStyle: {\n        color: tokens.color.accent70,\n        borderColor: tokens.color.accent70\n      }\n    },\n    progress: {\n      lineStyle: {\n        color: tokens.color.accent30\n      },\n      itemStyle: {\n        color: tokens.color.accent40\n      }\n    },\n    data: []\n  });\n  return SliderTimelineModel;\n}(TimelineModel);\nmixin(SliderTimelineModel, DataFormatMixin.prototype);\nexport default SliderTimelineModel;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport ComponentView from '../../view/Component.js';\nvar TimelineView = /** @class */function (_super) {\n  __extends(TimelineView, _super);\n  function TimelineView() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = TimelineView.type;\n    return _this;\n  }\n  TimelineView.type = 'timeline';\n  return TimelineView;\n}(ComponentView);\nexport default TimelineView;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport Axis from '../../coord/Axis.js';\n/**\n * Extend axis 2d\n */\nvar TimelineAxis = /** @class */function (_super) {\n  __extends(TimelineAxis, _super);\n  function TimelineAxis(dim, scale, coordExtent, axisType) {\n    var _this = _super.call(this, dim, scale, coordExtent) || this;\n    _this.type = axisType || 'value';\n    return _this;\n  }\n  /**\n   * @override\n   */\n  TimelineAxis.prototype.getLabelModel = function () {\n    // Force override\n    return this.model.getModel('label');\n  };\n  /**\n   * @override\n   */\n  TimelineAxis.prototype.isHorizontal = function () {\n    return this.model.get('orient') === 'horizontal';\n  };\n  return TimelineAxis;\n}(Axis);\nexport default TimelineAxis;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport BoundingRect from 'zrender/lib/core/BoundingRect.js';\nimport * as matrix from 'zrender/lib/core/matrix.js';\nimport * as graphic from '../../util/graphic.js';\nimport { createTextStyle } from '../../label/labelStyle.js';\nimport * as layout from '../../util/layout.js';\nimport TimelineView from './TimelineView.js';\nimport TimelineAxis from './TimelineAxis.js';\nimport { createSymbol, normalizeSymbolOffset, normalizeSymbolSize } from '../../util/symbol.js';\nimport * as numberUtil from '../../util/number.js';\nimport { merge, each, extend, isString, bind, defaults, retrieve2 } from 'zrender/lib/core/util.js';\nimport OrdinalScale from '../../scale/Ordinal.js';\nimport TimeScale from '../../scale/Time.js';\nimport IntervalScale from '../../scale/Interval.js';\nimport { parsePercent } from 'zrender/lib/contain/text.js';\nimport { makeInner } from '../../util/model.js';\nimport { getECData } from '../../util/innerStore.js';\nimport { enableHoverEmphasis } from '../../util/states.js';\nimport { createTooltipMarkup } from '../tooltip/tooltipMarkup.js';\nvar PI = Math.PI;\nvar labelDataIndexStore = makeInner();\nvar SliderTimelineView = /** @class */function (_super) {\n  __extends(SliderTimelineView, _super);\n  function SliderTimelineView() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = SliderTimelineView.type;\n    return _this;\n  }\n  SliderTimelineView.prototype.init = function (ecModel, api) {\n    this.api = api;\n  };\n  /**\n   * @override\n   */\n  SliderTimelineView.prototype.render = function (timelineModel, ecModel, api) {\n    this.model = timelineModel;\n    this.api = api;\n    this.ecModel = ecModel;\n    this.group.removeAll();\n    if (timelineModel.get('show', true)) {\n      var layoutInfo_1 = this._layout(timelineModel, api);\n      var mainGroup_1 = this._createGroup('_mainGroup');\n      var labelGroup = this._createGroup('_labelGroup');\n      var axis_1 = this._axis = this._createAxis(layoutInfo_1, timelineModel);\n      timelineModel.formatTooltip = function (dataIndex) {\n        var name = axis_1.scale.getLabel({\n          value: dataIndex\n        });\n        return createTooltipMarkup('nameValue', {\n          noName: true,\n          value: name\n        });\n      };\n      each(['AxisLine', 'AxisTick', 'Control', 'CurrentPointer'], function (name) {\n        this['_render' + name](layoutInfo_1, mainGroup_1, axis_1, timelineModel);\n      }, this);\n      this._renderAxisLabel(layoutInfo_1, labelGroup, axis_1, timelineModel);\n      this._position(layoutInfo_1, timelineModel);\n    }\n    this._doPlayStop();\n    this._updateTicksStatus();\n  };\n  /**\n   * @override\n   */\n  SliderTimelineView.prototype.remove = function () {\n    this._clearTimer();\n    this.group.removeAll();\n  };\n  /**\n   * @override\n   */\n  SliderTimelineView.prototype.dispose = function () {\n    this._clearTimer();\n  };\n  SliderTimelineView.prototype._layout = function (timelineModel, api) {\n    var labelPosOpt = timelineModel.get(['label', 'position']);\n    var orient = timelineModel.get('orient');\n    var viewRect = getViewRect(timelineModel, api);\n    var parsedLabelPos;\n    // Auto label offset.\n    if (labelPosOpt == null || labelPosOpt === 'auto') {\n      parsedLabelPos = orient === 'horizontal' ? viewRect.y + viewRect.height / 2 < api.getHeight() / 2 ? '-' : '+' : viewRect.x + viewRect.width / 2 < api.getWidth() / 2 ? '+' : '-';\n    } else if (isString(labelPosOpt)) {\n      parsedLabelPos = {\n        horizontal: {\n          top: '-',\n          bottom: '+'\n        },\n        vertical: {\n          left: '-',\n          right: '+'\n        }\n      }[orient][labelPosOpt];\n    } else {\n      // is number\n      parsedLabelPos = labelPosOpt;\n    }\n    var labelAlignMap = {\n      horizontal: 'center',\n      vertical: parsedLabelPos >= 0 || parsedLabelPos === '+' ? 'left' : 'right'\n    };\n    var labelBaselineMap = {\n      horizontal: parsedLabelPos >= 0 || parsedLabelPos === '+' ? 'top' : 'bottom',\n      vertical: 'middle'\n    };\n    var rotationMap = {\n      horizontal: 0,\n      vertical: PI / 2\n    };\n    // Position\n    var mainLength = orient === 'vertical' ? viewRect.height : viewRect.width;\n    var controlModel = timelineModel.getModel('controlStyle');\n    var showControl = controlModel.get('show', true);\n    var controlSize = showControl ? controlModel.get('itemSize') : 0;\n    var controlGap = showControl ? controlModel.get('itemGap') : 0;\n    var sizePlusGap = controlSize + controlGap;\n    // Special label rotate.\n    var labelRotation = timelineModel.get(['label', 'rotate']) || 0;\n    labelRotation = labelRotation * PI / 180; // To radian.\n    var playPosition;\n    var prevBtnPosition;\n    var nextBtnPosition;\n    var controlPosition = controlModel.get('position', true);\n    var showPlayBtn = showControl && controlModel.get('showPlayBtn', true);\n    var showPrevBtn = showControl && controlModel.get('showPrevBtn', true);\n    var showNextBtn = showControl && controlModel.get('showNextBtn', true);\n    var xLeft = 0;\n    var xRight = mainLength;\n    // position[0] means left, position[1] means middle.\n    if (controlPosition === 'left' || controlPosition === 'bottom') {\n      showPlayBtn && (playPosition = [0, 0], xLeft += sizePlusGap);\n      showPrevBtn && (prevBtnPosition = [xLeft, 0], xLeft += sizePlusGap);\n      showNextBtn && (nextBtnPosition = [xRight - controlSize, 0], xRight -= sizePlusGap);\n    } else {\n      // 'top' 'right'\n      showPlayBtn && (playPosition = [xRight - controlSize, 0], xRight -= sizePlusGap);\n      showPrevBtn && (prevBtnPosition = [0, 0], xLeft += sizePlusGap);\n      showNextBtn && (nextBtnPosition = [xRight - controlSize, 0], xRight -= sizePlusGap);\n    }\n    var axisExtent = [xLeft, xRight];\n    if (timelineModel.get('inverse')) {\n      axisExtent.reverse();\n    }\n    return {\n      viewRect: viewRect,\n      mainLength: mainLength,\n      orient: orient,\n      rotation: rotationMap[orient],\n      labelRotation: labelRotation,\n      labelPosOpt: parsedLabelPos,\n      labelAlign: timelineModel.get(['label', 'align']) || labelAlignMap[orient],\n      labelBaseline: timelineModel.get(['label', 'verticalAlign']) || timelineModel.get(['label', 'baseline']) || labelBaselineMap[orient],\n      // Based on mainGroup.\n      playPosition: playPosition,\n      prevBtnPosition: prevBtnPosition,\n      nextBtnPosition: nextBtnPosition,\n      axisExtent: axisExtent,\n      controlSize: controlSize,\n      controlGap: controlGap\n    };\n  };\n  SliderTimelineView.prototype._position = function (layoutInfo, timelineModel) {\n    // Position is be called finally, because bounding rect is needed for\n    // adapt content to fill viewRect (auto adapt offset).\n    // Timeline may be not all in the viewRect when 'offset' is specified\n    // as a number, because it is more appropriate that label aligns at\n    // 'offset' but not the other edge defined by viewRect.\n    var mainGroup = this._mainGroup;\n    var labelGroup = this._labelGroup;\n    var viewRect = layoutInfo.viewRect;\n    if (layoutInfo.orient === 'vertical') {\n      // transform to horizontal, inverse rotate by left-top point.\n      var m = matrix.create();\n      var rotateOriginX = viewRect.x;\n      var rotateOriginY = viewRect.y + viewRect.height;\n      matrix.translate(m, m, [-rotateOriginX, -rotateOriginY]);\n      matrix.rotate(m, m, -PI / 2);\n      matrix.translate(m, m, [rotateOriginX, rotateOriginY]);\n      viewRect = viewRect.clone();\n      viewRect.applyTransform(m);\n    }\n    var viewBound = getBound(viewRect);\n    var mainBound = getBound(mainGroup.getBoundingRect());\n    var labelBound = getBound(labelGroup.getBoundingRect());\n    var mainPosition = [mainGroup.x, mainGroup.y];\n    var labelsPosition = [labelGroup.x, labelGroup.y];\n    labelsPosition[0] = mainPosition[0] = viewBound[0][0];\n    var labelPosOpt = layoutInfo.labelPosOpt;\n    if (labelPosOpt == null || isString(labelPosOpt)) {\n      // '+' or '-'\n      var mainBoundIdx = labelPosOpt === '+' ? 0 : 1;\n      toBound(mainPosition, mainBound, viewBound, 1, mainBoundIdx);\n      toBound(labelsPosition, labelBound, viewBound, 1, 1 - mainBoundIdx);\n    } else {\n      var mainBoundIdx = labelPosOpt >= 0 ? 0 : 1;\n      toBound(mainPosition, mainBound, viewBound, 1, mainBoundIdx);\n      labelsPosition[1] = mainPosition[1] + labelPosOpt;\n    }\n    mainGroup.setPosition(mainPosition);\n    labelGroup.setPosition(labelsPosition);\n    mainGroup.rotation = labelGroup.rotation = layoutInfo.rotation;\n    setOrigin(mainGroup);\n    setOrigin(labelGroup);\n    function setOrigin(targetGroup) {\n      targetGroup.originX = viewBound[0][0] - targetGroup.x;\n      targetGroup.originY = viewBound[1][0] - targetGroup.y;\n    }\n    function getBound(rect) {\n      // [[xmin, xmax], [ymin, ymax]]\n      return [[rect.x, rect.x + rect.width], [rect.y, rect.y + rect.height]];\n    }\n    function toBound(fromPos, from, to, dimIdx, boundIdx) {\n      fromPos[dimIdx] += to[dimIdx][boundIdx] - from[dimIdx][boundIdx];\n    }\n  };\n  SliderTimelineView.prototype._createAxis = function (layoutInfo, timelineModel) {\n    var data = timelineModel.getData();\n    var axisType = timelineModel.get('axisType');\n    var scale = createScaleByModel(timelineModel, axisType);\n    // Customize scale. The `tickValue` is `dataIndex`.\n    scale.getTicks = function () {\n      return data.mapArray(['value'], function (value) {\n        return {\n          value: value\n        };\n      });\n    };\n    var dataExtent = data.getDataExtent('value');\n    scale.setExtent(dataExtent[0], dataExtent[1]);\n    scale.calcNiceTicks();\n    var axis = new TimelineAxis('value', scale, layoutInfo.axisExtent, axisType);\n    axis.model = timelineModel;\n    return axis;\n  };\n  SliderTimelineView.prototype._createGroup = function (key) {\n    var newGroup = this[key] = new graphic.Group();\n    this.group.add(newGroup);\n    return newGroup;\n  };\n  SliderTimelineView.prototype._renderAxisLine = function (layoutInfo, group, axis, timelineModel) {\n    var axisExtent = axis.getExtent();\n    if (!timelineModel.get(['lineStyle', 'show'])) {\n      return;\n    }\n    var line = new graphic.Line({\n      shape: {\n        x1: axisExtent[0],\n        y1: 0,\n        x2: axisExtent[1],\n        y2: 0\n      },\n      style: extend({\n        lineCap: 'round'\n      }, timelineModel.getModel('lineStyle').getLineStyle()),\n      silent: true,\n      z2: 1\n    });\n    group.add(line);\n    var progressLine = this._progressLine = new graphic.Line({\n      shape: {\n        x1: axisExtent[0],\n        x2: this._currentPointer ? this._currentPointer.x : axisExtent[0],\n        y1: 0,\n        y2: 0\n      },\n      style: defaults({\n        lineCap: 'round',\n        lineWidth: line.style.lineWidth\n      }, timelineModel.getModel(['progress', 'lineStyle']).getLineStyle()),\n      silent: true,\n      z2: 1\n    });\n    group.add(progressLine);\n  };\n  SliderTimelineView.prototype._renderAxisTick = function (layoutInfo, group, axis, timelineModel) {\n    var _this = this;\n    var data = timelineModel.getData();\n    // Show all ticks, despite ignoring strategy.\n    var ticks = axis.scale.getTicks();\n    this._tickSymbols = [];\n    // The value is dataIndex, see the customized scale.\n    each(ticks, function (tick) {\n      var tickCoord = axis.dataToCoord(tick.value);\n      var itemModel = data.getItemModel(tick.value);\n      var itemStyleModel = itemModel.getModel('itemStyle');\n      var hoverStyleModel = itemModel.getModel(['emphasis', 'itemStyle']);\n      var progressStyleModel = itemModel.getModel(['progress', 'itemStyle']);\n      var symbolOpt = {\n        x: tickCoord,\n        y: 0,\n        onclick: bind(_this._changeTimeline, _this, tick.value)\n      };\n      var el = giveSymbol(itemModel, itemStyleModel, group, symbolOpt);\n      el.ensureState('emphasis').style = hoverStyleModel.getItemStyle();\n      el.ensureState('progress').style = progressStyleModel.getItemStyle();\n      enableHoverEmphasis(el);\n      var ecData = getECData(el);\n      if (itemModel.get('tooltip')) {\n        ecData.dataIndex = tick.value;\n        ecData.dataModel = timelineModel;\n      } else {\n        ecData.dataIndex = ecData.dataModel = null;\n      }\n      _this._tickSymbols.push(el);\n    });\n  };\n  SliderTimelineView.prototype._renderAxisLabel = function (layoutInfo, group, axis, timelineModel) {\n    var _this = this;\n    var labelModel = axis.getLabelModel();\n    if (!labelModel.get('show')) {\n      return;\n    }\n    var data = timelineModel.getData();\n    var labels = axis.getViewLabels();\n    this._tickLabels = [];\n    each(labels, function (labelItem) {\n      // The tickValue is dataIndex, see the customized scale.\n      var dataIndex = labelItem.tickValue;\n      var itemModel = data.getItemModel(dataIndex);\n      var normalLabelModel = itemModel.getModel('label');\n      var hoverLabelModel = itemModel.getModel(['emphasis', 'label']);\n      var progressLabelModel = itemModel.getModel(['progress', 'label']);\n      var tickCoord = axis.dataToCoord(labelItem.tickValue);\n      var textEl = new graphic.Text({\n        x: tickCoord,\n        y: 0,\n        rotation: layoutInfo.labelRotation - layoutInfo.rotation,\n        onclick: bind(_this._changeTimeline, _this, dataIndex),\n        silent: false,\n        style: createTextStyle(normalLabelModel, {\n          text: labelItem.formattedLabel,\n          align: layoutInfo.labelAlign,\n          verticalAlign: layoutInfo.labelBaseline\n        })\n      });\n      textEl.ensureState('emphasis').style = createTextStyle(hoverLabelModel);\n      textEl.ensureState('progress').style = createTextStyle(progressLabelModel);\n      group.add(textEl);\n      enableHoverEmphasis(textEl);\n      labelDataIndexStore(textEl).dataIndex = dataIndex;\n      _this._tickLabels.push(textEl);\n    });\n  };\n  SliderTimelineView.prototype._renderControl = function (layoutInfo, group, axis, timelineModel) {\n    var controlSize = layoutInfo.controlSize;\n    var rotation = layoutInfo.rotation;\n    var itemStyle = timelineModel.getModel('controlStyle').getItemStyle();\n    var hoverStyle = timelineModel.getModel(['emphasis', 'controlStyle']).getItemStyle();\n    var playState = timelineModel.getPlayState();\n    var inverse = timelineModel.get('inverse', true);\n    makeBtn(layoutInfo.nextBtnPosition, 'next', bind(this._changeTimeline, this, inverse ? '-' : '+'));\n    makeBtn(layoutInfo.prevBtnPosition, 'prev', bind(this._changeTimeline, this, inverse ? '+' : '-'));\n    makeBtn(layoutInfo.playPosition, playState ? 'stop' : 'play', bind(this._handlePlayClick, this, !playState), true);\n    function makeBtn(position, iconName, onclick, willRotate) {\n      if (!position) {\n        return;\n      }\n      var iconSize = parsePercent(retrieve2(timelineModel.get(['controlStyle', iconName + 'BtnSize']), controlSize), controlSize);\n      var rect = [0, -iconSize / 2, iconSize, iconSize];\n      var btn = makeControlIcon(timelineModel, iconName + 'Icon', rect, {\n        x: position[0],\n        y: position[1],\n        originX: controlSize / 2,\n        originY: 0,\n        rotation: willRotate ? -rotation : 0,\n        rectHover: true,\n        style: itemStyle,\n        onclick: onclick\n      });\n      btn.ensureState('emphasis').style = hoverStyle;\n      group.add(btn);\n      enableHoverEmphasis(btn);\n    }\n  };\n  SliderTimelineView.prototype._renderCurrentPointer = function (layoutInfo, group, axis, timelineModel) {\n    var data = timelineModel.getData();\n    var currentIndex = timelineModel.getCurrentIndex();\n    var pointerModel = data.getItemModel(currentIndex).getModel('checkpointStyle');\n    var me = this;\n    var callback = {\n      onCreate: function (pointer) {\n        pointer.draggable = true;\n        pointer.drift = bind(me._handlePointerDrag, me);\n        pointer.ondragend = bind(me._handlePointerDragend, me);\n        pointerMoveTo(pointer, me._progressLine, currentIndex, axis, timelineModel, true);\n      },\n      onUpdate: function (pointer) {\n        pointerMoveTo(pointer, me._progressLine, currentIndex, axis, timelineModel);\n      }\n    };\n    // Reuse when exists, for animation and drag.\n    this._currentPointer = giveSymbol(pointerModel, pointerModel, this._mainGroup, {}, this._currentPointer, callback);\n  };\n  SliderTimelineView.prototype._handlePlayClick = function (nextState) {\n    this._clearTimer();\n    this.api.dispatchAction({\n      type: 'timelinePlayChange',\n      playState: nextState,\n      from: this.uid\n    });\n  };\n  SliderTimelineView.prototype._handlePointerDrag = function (dx, dy, e) {\n    this._clearTimer();\n    this._pointerChangeTimeline([e.offsetX, e.offsetY]);\n  };\n  SliderTimelineView.prototype._handlePointerDragend = function (e) {\n    this._pointerChangeTimeline([e.offsetX, e.offsetY], true);\n  };\n  SliderTimelineView.prototype._pointerChangeTimeline = function (mousePos, trigger) {\n    var toCoord = this._toAxisCoord(mousePos)[0];\n    var axis = this._axis;\n    var axisExtent = numberUtil.asc(axis.getExtent().slice());\n    toCoord > axisExtent[1] && (toCoord = axisExtent[1]);\n    toCoord < axisExtent[0] && (toCoord = axisExtent[0]);\n    this._currentPointer.x = toCoord;\n    this._currentPointer.markRedraw();\n    var progressLine = this._progressLine;\n    if (progressLine) {\n      progressLine.shape.x2 = toCoord;\n      progressLine.dirty();\n    }\n    var targetDataIndex = this._findNearestTick(toCoord);\n    var timelineModel = this.model;\n    if (trigger || targetDataIndex !== timelineModel.getCurrentIndex() && timelineModel.get('realtime')) {\n      this._changeTimeline(targetDataIndex);\n    }\n  };\n  SliderTimelineView.prototype._doPlayStop = function () {\n    var _this = this;\n    this._clearTimer();\n    if (this.model.getPlayState()) {\n      this._timer = setTimeout(function () {\n        // Do not cache\n        var timelineModel = _this.model;\n        _this._changeTimeline(timelineModel.getCurrentIndex() + (timelineModel.get('rewind', true) ? -1 : 1));\n      }, this.model.get('playInterval'));\n    }\n  };\n  SliderTimelineView.prototype._toAxisCoord = function (vertex) {\n    var trans = this._mainGroup.getLocalTransform();\n    return graphic.applyTransform(vertex, trans, true);\n  };\n  SliderTimelineView.prototype._findNearestTick = function (axisCoord) {\n    var data = this.model.getData();\n    var dist = Infinity;\n    var targetDataIndex;\n    var axis = this._axis;\n    data.each(['value'], function (value, dataIndex) {\n      var coord = axis.dataToCoord(value);\n      var d = Math.abs(coord - axisCoord);\n      if (d < dist) {\n        dist = d;\n        targetDataIndex = dataIndex;\n      }\n    });\n    return targetDataIndex;\n  };\n  SliderTimelineView.prototype._clearTimer = function () {\n    if (this._timer) {\n      clearTimeout(this._timer);\n      this._timer = null;\n    }\n  };\n  SliderTimelineView.prototype._changeTimeline = function (nextIndex) {\n    var currentIndex = this.model.getCurrentIndex();\n    if (nextIndex === '+') {\n      nextIndex = currentIndex + 1;\n    } else if (nextIndex === '-') {\n      nextIndex = currentIndex - 1;\n    }\n    this.api.dispatchAction({\n      type: 'timelineChange',\n      currentIndex: nextIndex,\n      from: this.uid\n    });\n  };\n  SliderTimelineView.prototype._updateTicksStatus = function () {\n    var currentIndex = this.model.getCurrentIndex();\n    var tickSymbols = this._tickSymbols;\n    var tickLabels = this._tickLabels;\n    if (tickSymbols) {\n      for (var i = 0; i < tickSymbols.length; i++) {\n        tickSymbols && tickSymbols[i] && tickSymbols[i].toggleState('progress', i < currentIndex);\n      }\n    }\n    if (tickLabels) {\n      for (var i = 0; i < tickLabels.length; i++) {\n        tickLabels && tickLabels[i] && tickLabels[i].toggleState('progress', labelDataIndexStore(tickLabels[i]).dataIndex <= currentIndex);\n      }\n    }\n  };\n  SliderTimelineView.type = 'timeline.slider';\n  return SliderTimelineView;\n}(TimelineView);\nfunction createScaleByModel(model, axisType) {\n  axisType = axisType || model.get('type');\n  if (axisType) {\n    switch (axisType) {\n      // Buildin scale\n      case 'category':\n        return new OrdinalScale({\n          ordinalMeta: model.getCategories(),\n          extent: [Infinity, -Infinity]\n        });\n      case 'time':\n        return new TimeScale({\n          locale: model.ecModel.getLocaleModel(),\n          useUTC: model.ecModel.get('useUTC')\n        });\n      default:\n        // default to be value\n        return new IntervalScale();\n    }\n  }\n}\nfunction getViewRect(model, api) {\n  return layout.getLayoutRect(model.getBoxLayoutParams(), layout.createBoxLayoutReference(model, api).refContainer, model.get('padding'));\n}\nfunction makeControlIcon(timelineModel, objPath, rect, opts) {\n  var style = opts.style;\n  var icon = graphic.createIcon(timelineModel.get(['controlStyle', objPath]), opts || {}, new BoundingRect(rect[0], rect[1], rect[2], rect[3]));\n  // TODO createIcon won't use style in opt.\n  if (style) {\n    icon.setStyle(style);\n  }\n  return icon;\n}\n/**\n * Create symbol or update symbol\n * opt: basic position and event handlers\n */\nfunction giveSymbol(hostModel, itemStyleModel, group, opt, symbol, callback) {\n  var color = itemStyleModel.get('color');\n  if (!symbol) {\n    var symbolType = hostModel.get('symbol');\n    symbol = createSymbol(symbolType, -1, -1, 2, 2, color);\n    symbol.setStyle('strokeNoScale', true);\n    group.add(symbol);\n    callback && callback.onCreate(symbol);\n  } else {\n    symbol.setColor(color);\n    group.add(symbol); // Group may be new, also need to add.\n    callback && callback.onUpdate(symbol);\n  }\n  // Style\n  var itemStyle = itemStyleModel.getItemStyle(['color']);\n  symbol.setStyle(itemStyle);\n  // Transform and events.\n  opt = merge({\n    rectHover: true,\n    z2: 100\n  }, opt, true);\n  var symbolSize = normalizeSymbolSize(hostModel.get('symbolSize'));\n  opt.scaleX = symbolSize[0] / 2;\n  opt.scaleY = symbolSize[1] / 2;\n  var symbolOffset = normalizeSymbolOffset(hostModel.get('symbolOffset'), symbolSize);\n  if (symbolOffset) {\n    opt.x = (opt.x || 0) + symbolOffset[0];\n    opt.y = (opt.y || 0) + symbolOffset[1];\n  }\n  var symbolRotate = hostModel.get('symbolRotate');\n  opt.rotation = (symbolRotate || 0) * Math.PI / 180 || 0;\n  symbol.attr(opt);\n  // FIXME\n  // (1) When symbol.style.strokeNoScale is true and updateTransform is not performed,\n  // getBoundingRect will return wrong result.\n  // (This is supposed to be resolved in zrender, but it is a little difficult to\n  // leverage performance and auto updateTransform)\n  // (2) All of ancesters of symbol do not scale, so we can just updateTransform symbol.\n  symbol.updateTransform();\n  return symbol;\n}\nfunction pointerMoveTo(pointer, progressLine, dataIndex, axis, timelineModel, noAnimation) {\n  if (pointer.dragging) {\n    return;\n  }\n  var pointerModel = timelineModel.getModel('checkpointStyle');\n  var toCoord = axis.dataToCoord(timelineModel.getData().get('value', dataIndex));\n  if (noAnimation || !pointerModel.get('animation', true)) {\n    pointer.attr({\n      x: toCoord,\n      y: 0\n    });\n    progressLine && progressLine.attr({\n      shape: {\n        x2: toCoord\n      }\n    });\n  } else {\n    var animationCfg = {\n      duration: pointerModel.get('animationDuration', true),\n      easing: pointerModel.get('animationEasing', true)\n    };\n    pointer.stopAnimation(null, true);\n    pointer.animateTo({\n      x: toCoord,\n      y: 0\n    }, animationCfg);\n    progressLine && progressLine.animateTo({\n      shape: {\n        x2: toCoord\n      }\n    }, animationCfg);\n  }\n}\nexport default SliderTimelineView;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { defaults } from 'zrender/lib/core/util.js';\nexport function installTimelineAction(registers) {\n  registers.registerAction({\n    type: 'timelineChange',\n    event: 'timelineChanged',\n    update: 'prepareAndUpdate'\n  }, function (payload, ecModel, api) {\n    var timelineModel = ecModel.getComponent('timeline');\n    if (timelineModel && payload.currentIndex != null) {\n      timelineModel.setCurrentIndex(payload.currentIndex);\n      if (!timelineModel.get('loop', true) && timelineModel.isIndexMax() && timelineModel.getPlayState()) {\n        timelineModel.setPlayState(false);\n        // The timeline has played to the end, trigger event\n        api.dispatchAction({\n          type: 'timelinePlayChange',\n          playState: false,\n          from: payload.from\n        });\n      }\n    }\n    // Set normalized currentIndex to payload.\n    ecModel.resetOption('timeline', {\n      replaceMerge: timelineModel.get('replaceMerge', true)\n    });\n    return defaults({\n      currentIndex: timelineModel.option.currentIndex\n    }, payload);\n  });\n  registers.registerAction({\n    type: 'timelinePlayChange',\n    event: 'timelinePlayChanged',\n    update: 'update'\n  }, function (payload, ecModel) {\n    var timelineModel = ecModel.getComponent('timeline');\n    if (timelineModel && payload.playState != null) {\n      timelineModel.setPlayState(payload.playState);\n    }\n  });\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n// @ts-nocheck\nimport * as zrUtil from 'zrender/lib/core/util.js';\nexport default function timelinePreprocessor(option) {\n  var timelineOpt = option && option.timeline;\n  if (!zrUtil.isArray(timelineOpt)) {\n    timelineOpt = timelineOpt ? [timelineOpt] : [];\n  }\n  zrUtil.each(timelineOpt, function (opt) {\n    if (!opt) {\n      return;\n    }\n    compatibleEC2(opt);\n  });\n}\nfunction compatibleEC2(opt) {\n  var type = opt.type;\n  var ec2Types = {\n    'number': 'value',\n    'time': 'time'\n  };\n  // Compatible with ec2\n  if (ec2Types[type]) {\n    opt.axisType = ec2Types[type];\n    delete opt.type;\n  }\n  transferItem(opt);\n  if (has(opt, 'controlPosition')) {\n    var controlStyle = opt.controlStyle || (opt.controlStyle = {});\n    if (!has(controlStyle, 'position')) {\n      controlStyle.position = opt.controlPosition;\n    }\n    if (controlStyle.position === 'none' && !has(controlStyle, 'show')) {\n      controlStyle.show = false;\n      delete controlStyle.position;\n    }\n    delete opt.controlPosition;\n  }\n  zrUtil.each(opt.data || [], function (dataItem) {\n    if (zrUtil.isObject(dataItem) && !zrUtil.isArray(dataItem)) {\n      if (!has(dataItem, 'value') && has(dataItem, 'name')) {\n        // In ec2, using name as value.\n        dataItem.value = dataItem.name;\n      }\n      transferItem(dataItem);\n    }\n  });\n}\nfunction transferItem(opt) {\n  var itemStyle = opt.itemStyle || (opt.itemStyle = {});\n  var itemStyleEmphasis = itemStyle.emphasis || (itemStyle.emphasis = {});\n  // Transfer label out\n  var label = opt.label || opt.label || {};\n  var labelNormal = label.normal || (label.normal = {});\n  var excludeLabelAttr = {\n    normal: 1,\n    emphasis: 1\n  };\n  zrUtil.each(label, function (value, name) {\n    if (!excludeLabelAttr[name] && !has(labelNormal, name)) {\n      labelNormal[name] = value;\n    }\n  });\n  if (itemStyleEmphasis.label && !has(label, 'emphasis')) {\n    label.emphasis = itemStyleEmphasis.label;\n    delete itemStyleEmphasis.label;\n  }\n}\nfunction has(obj, attr) {\n  return obj.hasOwnProperty(attr);\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\nimport SliderTimelineModel from './SliderTimelineModel.js';\nimport SliderTimelineView from './SliderTimelineView.js';\nimport { installTimelineAction } from './timelineAction.js';\nimport preprocessor from './preprocessor.js';\nexport function install(registers) {\n  registers.registerComponentModel(SliderTimelineModel);\n  registers.registerComponentView(SliderTimelineView);\n  registers.registerSubTypeDefaulter('timeline', function () {\n    // Only slider now.\n    return 'slider';\n  });\n  installTimelineAction(registers);\n  registers.registerPreprocessor(preprocessor);\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { isArray } from 'zrender/lib/core/util.js';\nexport default function checkMarkerInSeries(seriesOpts, markerType) {\n  if (!seriesOpts) {\n    return false;\n  }\n  var seriesOptArr = isArray(seriesOpts) ? seriesOpts : [seriesOpts];\n  for (var idx = 0; idx < seriesOptArr.length; idx++) {\n    if (seriesOptArr[idx] && seriesOptArr[idx][markerType]) {\n      return true;\n    }\n  }\n  return false;\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport env from 'zrender/lib/core/env.js';\nimport { DataFormatMixin } from '../../model/mixin/dataFormat.js';\nimport ComponentModel from '../../model/Component.js';\nimport { makeInner, defaultEmphasis } from '../../util/model.js';\nimport { createTooltipMarkup } from '../tooltip/tooltipMarkup.js';\nfunction fillLabel(opt) {\n  defaultEmphasis(opt, 'label', ['show']);\n}\n// { [componentType]: MarkerModel }\nvar inner = makeInner();\nvar MarkerModel = /** @class */function (_super) {\n  __extends(MarkerModel, _super);\n  function MarkerModel() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = MarkerModel.type;\n    /**\n     * If marker model is created by self from series\n     */\n    _this.createdBySelf = false;\n    _this.preventAutoZ = true;\n    return _this;\n  }\n  /**\n   * @overrite\n   */\n  MarkerModel.prototype.init = function (option, parentModel, ecModel) {\n    if (process.env.NODE_ENV !== 'production') {\n      if (this.type === 'marker') {\n        throw new Error('Marker component is abstract component. Use markLine, markPoint, markArea instead.');\n      }\n    }\n    this.mergeDefaultAndTheme(option, ecModel);\n    this._mergeOption(option, ecModel, false, true);\n  };\n  MarkerModel.prototype.isAnimationEnabled = function () {\n    if (env.node) {\n      return false;\n    }\n    var hostSeries = this.__hostSeries;\n    return this.getShallow('animation') && hostSeries && hostSeries.isAnimationEnabled();\n  };\n  /**\n   * @overrite\n   */\n  MarkerModel.prototype.mergeOption = function (newOpt, ecModel) {\n    this._mergeOption(newOpt, ecModel, false, false);\n  };\n  MarkerModel.prototype._mergeOption = function (newOpt, ecModel, createdBySelf, isInit) {\n    var componentType = this.mainType;\n    if (!createdBySelf) {\n      ecModel.eachSeries(function (seriesModel) {\n        // mainType can be markPoint, markLine, markArea\n        var markerOpt = seriesModel.get(this.mainType, true);\n        var markerModel = inner(seriesModel)[componentType];\n        if (!markerOpt || !markerOpt.data) {\n          inner(seriesModel)[componentType] = null;\n          return;\n        }\n        if (!markerModel) {\n          if (isInit) {\n            // Default label emphasis `position` and `show`\n            fillLabel(markerOpt);\n          }\n          zrUtil.each(markerOpt.data, function (item) {\n            // FIXME Overwrite fillLabel method ?\n            if (item instanceof Array) {\n              fillLabel(item[0]);\n              fillLabel(item[1]);\n            } else {\n              fillLabel(item);\n            }\n          });\n          markerModel = this.createMarkerModelFromSeries(markerOpt, this, ecModel);\n          // markerModel = new ImplementedMarkerModel(\n          //     markerOpt, this, ecModel\n          // );\n          zrUtil.extend(markerModel, {\n            mainType: this.mainType,\n            // Use the same series index and name\n            seriesIndex: seriesModel.seriesIndex,\n            name: seriesModel.name,\n            createdBySelf: true\n          });\n          markerModel.__hostSeries = seriesModel;\n        } else {\n          markerModel._mergeOption(markerOpt, ecModel, true);\n        }\n        inner(seriesModel)[componentType] = markerModel;\n      }, this);\n    }\n  };\n  MarkerModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\n    var data = this.getData();\n    var value = this.getRawValue(dataIndex);\n    var itemName = data.getName(dataIndex);\n    return createTooltipMarkup('section', {\n      header: this.name,\n      blocks: [createTooltipMarkup('nameValue', {\n        name: itemName,\n        value: value,\n        noName: !itemName,\n        noValue: value == null\n      })]\n    });\n  };\n  MarkerModel.prototype.getData = function () {\n    return this._data;\n  };\n  MarkerModel.prototype.setData = function (data) {\n    this._data = data;\n  };\n  MarkerModel.prototype.getDataParams = function (dataIndex, dataType) {\n    var params = DataFormatMixin.prototype.getDataParams.call(this, dataIndex, dataType);\n    var hostSeries = this.__hostSeries;\n    if (hostSeries) {\n      params.seriesId = hostSeries.id;\n      params.seriesName = hostSeries.name;\n      params.seriesType = hostSeries.subType;\n    }\n    return params;\n  };\n  MarkerModel.getMarkerModelFromSeries = function (seriesModel,\n  // Support three types of markers. Strict check.\n  componentType) {\n    return inner(seriesModel)[componentType];\n  };\n  MarkerModel.type = 'marker';\n  MarkerModel.dependencies = ['series', 'grid', 'polar', 'geo'];\n  return MarkerModel;\n}(ComponentModel);\nzrUtil.mixin(MarkerModel, DataFormatMixin.prototype);\nexport default MarkerModel;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport MarkerModel from './MarkerModel.js';\nvar MarkPointModel = /** @class */function (_super) {\n  __extends(MarkPointModel, _super);\n  function MarkPointModel() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = MarkPointModel.type;\n    return _this;\n  }\n  MarkPointModel.prototype.createMarkerModelFromSeries = function (markerOpt, masterMarkerModel, ecModel) {\n    return new MarkPointModel(markerOpt, masterMarkerModel, ecModel);\n  };\n  MarkPointModel.type = 'markPoint';\n  MarkPointModel.defaultOption = {\n    // zlevel: 0,\n    z: 5,\n    symbol: 'pin',\n    symbolSize: 50,\n    // symbolRotate: 0,\n    // symbolOffset: [0, 0]\n    tooltip: {\n      trigger: 'item'\n    },\n    label: {\n      show: true,\n      position: 'inside'\n    },\n    itemStyle: {\n      borderWidth: 2\n    },\n    emphasis: {\n      label: {\n        show: true\n      }\n    }\n  };\n  return MarkPointModel;\n}(MarkerModel);\nexport default MarkPointModel;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as numberUtil from '../../util/number.js';\nimport { isDimensionStacked } from '../../data/helper/dataStackHelper.js';\nimport { indexOf, curry, clone, isArray } from 'zrender/lib/core/util.js';\nimport { parseDataValue } from '../../data/helper/dataValueHelper.js';\nfunction hasXOrY(item) {\n  return !(isNaN(parseFloat(item.x)) && isNaN(parseFloat(item.y)));\n}\nfunction hasXAndY(item) {\n  return !isNaN(parseFloat(item.x)) && !isNaN(parseFloat(item.y));\n}\nfunction markerTypeCalculatorWithExtent(markerType, data, axisDim, otherDataDim, targetDataDim, otherCoordIndex, targetCoordIndex) {\n  var coordArr = [];\n  var stacked = isDimensionStacked(data, targetDataDim /* , otherDataDim */);\n  var calcDataDim = stacked ? data.getCalculationInfo('stackResultDimension') : targetDataDim;\n  var value = numCalculate(data, calcDataDim, markerType);\n  var seriesModel = data.hostModel;\n  var dataIndex = seriesModel.indicesOfNearest(axisDim, calcDataDim, value)[0];\n  coordArr[otherCoordIndex] = data.get(otherDataDim, dataIndex);\n  coordArr[targetCoordIndex] = data.get(calcDataDim, dataIndex);\n  var coordArrValue = data.get(targetDataDim, dataIndex);\n  // Make it simple, do not visit all stacked value to count precision.\n  var precision = numberUtil.getPrecision(data.get(targetDataDim, dataIndex));\n  precision = Math.min(precision, 20);\n  if (precision >= 0) {\n    coordArr[targetCoordIndex] = +coordArr[targetCoordIndex].toFixed(precision);\n  }\n  return [coordArr, coordArrValue];\n}\n// TODO Specified percent\nvar markerTypeCalculator = {\n  min: curry(markerTypeCalculatorWithExtent, 'min'),\n  max: curry(markerTypeCalculatorWithExtent, 'max'),\n  average: curry(markerTypeCalculatorWithExtent, 'average'),\n  median: curry(markerTypeCalculatorWithExtent, 'median')\n};\n/**\n * Transform markPoint data item to format used in List by do the following\n * 1. Calculate statistic like `max`, `min`, `average`\n * 2. Convert `item.xAxis`, `item.yAxis` to `item.coord` array\n */\nexport function dataTransform(seriesModel, item) {\n  if (!item) {\n    return;\n  }\n  var data = seriesModel.getData();\n  var coordSys = seriesModel.coordinateSystem;\n  var dims = coordSys && coordSys.dimensions;\n  // 1. If not specify the position with pixel directly\n  // 2. If `coord` is not a data array. Which uses `xAxis`,\n  // `yAxis` to specify the coord on each dimension\n  // parseFloat first because item.x and item.y can be percent string like '20%'\n  if (!hasXAndY(item) && !isArray(item.coord) && isArray(dims)) {\n    var axisInfo = getAxisInfo(item, data, coordSys, seriesModel);\n    // Clone the option\n    // Transform the properties xAxis, yAxis, radiusAxis, angleAxis, geoCoord to value\n    item = clone(item);\n    if (item.type && markerTypeCalculator[item.type] && axisInfo.baseAxis && axisInfo.valueAxis) {\n      var otherCoordIndex = indexOf(dims, axisInfo.baseAxis.dim);\n      var targetCoordIndex = indexOf(dims, axisInfo.valueAxis.dim);\n      var coordInfo = markerTypeCalculator[item.type](data, axisInfo.valueAxis.dim, axisInfo.baseDataDim, axisInfo.valueDataDim, otherCoordIndex, targetCoordIndex);\n      item.coord = coordInfo[0];\n      // Force to use the value of calculated value.\n      // let item use the value without stack.\n      item.value = coordInfo[1];\n    } else {\n      // FIXME Only has one of xAxis and yAxis.\n      item.coord = [item.xAxis != null ? item.xAxis : item.radiusAxis, item.yAxis != null ? item.yAxis : item.angleAxis];\n    }\n  }\n  // x y is provided\n  if (item.coord == null || !isArray(dims)) {\n    item.coord = [];\n    var baseAxis = seriesModel.getBaseAxis();\n    if (baseAxis && item.type && markerTypeCalculator[item.type]) {\n      var otherAxis = coordSys.getOtherAxis(baseAxis);\n      if (otherAxis) {\n        item.value = numCalculate(data, data.mapDimension(otherAxis.dim), item.type);\n      }\n    }\n  } else {\n    // Each coord support max, min, average\n    var coord = item.coord;\n    for (var i = 0; i < 2; i++) {\n      if (markerTypeCalculator[coord[i]]) {\n        coord[i] = numCalculate(data, data.mapDimension(dims[i]), coord[i]);\n      }\n    }\n  }\n  return item;\n}\nexport function getAxisInfo(item, data, coordSys, seriesModel) {\n  var ret = {};\n  if (item.valueIndex != null || item.valueDim != null) {\n    ret.valueDataDim = item.valueIndex != null ? data.getDimension(item.valueIndex) : item.valueDim;\n    ret.valueAxis = coordSys.getAxis(dataDimToCoordDim(seriesModel, ret.valueDataDim));\n    ret.baseAxis = coordSys.getOtherAxis(ret.valueAxis);\n    ret.baseDataDim = data.mapDimension(ret.baseAxis.dim);\n  } else {\n    ret.baseAxis = seriesModel.getBaseAxis();\n    ret.valueAxis = coordSys.getOtherAxis(ret.baseAxis);\n    ret.baseDataDim = data.mapDimension(ret.baseAxis.dim);\n    ret.valueDataDim = data.mapDimension(ret.valueAxis.dim);\n  }\n  return ret;\n}\nfunction dataDimToCoordDim(seriesModel, dataDim) {\n  var dimItem = seriesModel.getData().getDimensionInfo(dataDim);\n  return dimItem && dimItem.coordDim;\n}\n/**\n * Filter data which is out of coordinateSystem range\n * [dataFilter description]\n */\nexport function dataFilter(\n// Currently only polar and cartesian has containData.\ncoordSys, item) {\n  // Always return true if there is no coordSys\n  return coordSys && coordSys.containData && item.coord && !hasXOrY(item) ? coordSys.containData(item.coord) : true;\n}\nexport function zoneFilter(\n// Currently only polar and cartesian has containData.\ncoordSys, item1, item2) {\n  // Always return true if there is no coordSys\n  return coordSys && coordSys.containZone && item1.coord && item2.coord && !hasXOrY(item1) && !hasXOrY(item2) ? coordSys.containZone(item1.coord, item2.coord) : true;\n}\nexport function createMarkerDimValueGetter(inCoordSys, dims) {\n  return inCoordSys ? function (item, dimName, dataIndex, dimIndex) {\n    var rawVal = dimIndex < 2\n    // x, y, radius, angle\n    ? item.coord && item.coord[dimIndex] : item.value;\n    return parseDataValue(rawVal, dims[dimIndex]);\n  } : function (item, dimName, dataIndex, dimIndex) {\n    return parseDataValue(item.value, dims[dimIndex]);\n  };\n}\nexport function numCalculate(data, valueDataDim, type) {\n  if (type === 'average') {\n    var sum_1 = 0;\n    var count_1 = 0;\n    data.each(valueDataDim, function (val, idx) {\n      if (!isNaN(val)) {\n        sum_1 += val;\n        count_1++;\n      }\n    });\n    return sum_1 / count_1;\n  } else if (type === 'median') {\n    return data.getMedian(valueDataDim);\n  } else {\n    // max & min\n    return data.getDataExtent(valueDataDim)[type === 'max' ? 1 : 0];\n  }\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport ComponentView from '../../view/Component.js';\nimport { createHashMap, each } from 'zrender/lib/core/util.js';\nimport MarkerModel from './MarkerModel.js';\nimport { makeInner } from '../../util/model.js';\nimport { enterBlur, leaveBlur } from '../../util/states.js';\nimport { traverseUpdateZ, retrieveZInfo } from '../../util/graphic.js';\nvar inner = makeInner();\nvar MarkerView = /** @class */function (_super) {\n  __extends(MarkerView, _super);\n  function MarkerView() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = MarkerView.type;\n    return _this;\n  }\n  MarkerView.prototype.init = function () {\n    this.markerGroupMap = createHashMap();\n  };\n  MarkerView.prototype.render = function (markerModel, ecModel, api) {\n    var _this = this;\n    var markerGroupMap = this.markerGroupMap;\n    markerGroupMap.each(function (item) {\n      inner(item).keep = false;\n    });\n    ecModel.eachSeries(function (seriesModel) {\n      var markerModel = MarkerModel.getMarkerModelFromSeries(seriesModel, _this.type);\n      markerModel && _this.renderSeries(seriesModel, markerModel, ecModel, api);\n    });\n    markerGroupMap.each(function (item) {\n      !inner(item).keep && _this.group.remove(item.group);\n    });\n    updateZ(ecModel, markerGroupMap, this.type);\n  };\n  MarkerView.prototype.markKeep = function (drawGroup) {\n    inner(drawGroup).keep = true;\n  };\n  MarkerView.prototype.toggleBlurSeries = function (seriesModelList, isBlur) {\n    var _this = this;\n    each(seriesModelList, function (seriesModel) {\n      var markerModel = MarkerModel.getMarkerModelFromSeries(seriesModel, _this.type);\n      if (markerModel) {\n        var data = markerModel.getData();\n        data.eachItemGraphicEl(function (el) {\n          if (el) {\n            isBlur ? enterBlur(el) : leaveBlur(el);\n          }\n        });\n      }\n    });\n  };\n  MarkerView.type = 'marker';\n  return MarkerView;\n}(ComponentView);\nfunction updateZ(ecModel, markerGroupMap, type) {\n  ecModel.eachSeries(function (seriesModel) {\n    var markerModel = MarkerModel.getMarkerModelFromSeries(seriesModel, type);\n    var markerDraw = markerGroupMap.get(seriesModel.id);\n    if (markerModel && markerDraw && markerDraw.group) {\n      var _a = retrieveZInfo(markerModel),\n        z = _a.z,\n        zlevel = _a.zlevel;\n      traverseUpdateZ(markerDraw.group, z, zlevel);\n    }\n  });\n}\nexport default MarkerView;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport SymbolDraw from '../../chart/helper/SymbolDraw.js';\nimport * as numberUtil from '../../util/number.js';\nimport SeriesData from '../../data/SeriesData.js';\nimport * as markerHelper from './markerHelper.js';\nimport MarkerView from './MarkerView.js';\nimport MarkerModel from './MarkerModel.js';\nimport { isFunction, map, filter, curry, extend, retrieve2 } from 'zrender/lib/core/util.js';\nimport { getECData } from '../../util/innerStore.js';\nimport { getVisualFromData } from '../../visual/helper.js';\nfunction updateMarkerLayout(mpData, seriesModel, api) {\n  var coordSys = seriesModel.coordinateSystem;\n  var apiWidth = api.getWidth();\n  var apiHeight = api.getHeight();\n  var coordRect = coordSys && coordSys.getArea && coordSys.getArea();\n  mpData.each(function (idx) {\n    var itemModel = mpData.getItemModel(idx);\n    var isRelativeToCoordinate = itemModel.get('relativeTo') === 'coordinate';\n    var width = isRelativeToCoordinate ? coordRect ? coordRect.width : 0 : apiWidth;\n    var height = isRelativeToCoordinate ? coordRect ? coordRect.height : 0 : apiHeight;\n    var left = isRelativeToCoordinate && coordRect ? coordRect.x : 0;\n    var top = isRelativeToCoordinate && coordRect ? coordRect.y : 0;\n    var point;\n    var xPx = numberUtil.parsePercent(itemModel.get('x'), width) + left;\n    var yPx = numberUtil.parsePercent(itemModel.get('y'), height) + top;\n    if (!isNaN(xPx) && !isNaN(yPx)) {\n      point = [xPx, yPx];\n    }\n    // Chart like bar may have there own marker positioning logic\n    else if (seriesModel.getMarkerPosition) {\n      // Use the getMarkerPosition\n      point = seriesModel.getMarkerPosition(mpData.getValues(mpData.dimensions, idx));\n    } else if (coordSys) {\n      var x = mpData.get(coordSys.dimensions[0], idx);\n      var y = mpData.get(coordSys.dimensions[1], idx);\n      point = coordSys.dataToPoint([x, y]);\n    }\n    // Use x, y if has any\n    if (!isNaN(xPx)) {\n      point[0] = xPx;\n    }\n    if (!isNaN(yPx)) {\n      point[1] = yPx;\n    }\n    mpData.setItemLayout(idx, point);\n  });\n}\nvar MarkPointView = /** @class */function (_super) {\n  __extends(MarkPointView, _super);\n  function MarkPointView() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = MarkPointView.type;\n    return _this;\n  }\n  MarkPointView.prototype.updateTransform = function (markPointModel, ecModel, api) {\n    ecModel.eachSeries(function (seriesModel) {\n      var mpModel = MarkerModel.getMarkerModelFromSeries(seriesModel, 'markPoint');\n      if (mpModel) {\n        updateMarkerLayout(mpModel.getData(), seriesModel, api);\n        this.markerGroupMap.get(seriesModel.id).updateLayout();\n      }\n    }, this);\n  };\n  MarkPointView.prototype.renderSeries = function (seriesModel, mpModel, ecModel, api) {\n    var coordSys = seriesModel.coordinateSystem;\n    var seriesId = seriesModel.id;\n    var seriesData = seriesModel.getData();\n    var symbolDrawMap = this.markerGroupMap;\n    var symbolDraw = symbolDrawMap.get(seriesId) || symbolDrawMap.set(seriesId, new SymbolDraw());\n    var mpData = createData(coordSys, seriesModel, mpModel);\n    // FIXME\n    mpModel.setData(mpData);\n    updateMarkerLayout(mpModel.getData(), seriesModel, api);\n    mpData.each(function (idx) {\n      var itemModel = mpData.getItemModel(idx);\n      var symbol = itemModel.getShallow('symbol');\n      var symbolSize = itemModel.getShallow('symbolSize');\n      var symbolRotate = itemModel.getShallow('symbolRotate');\n      var symbolOffset = itemModel.getShallow('symbolOffset');\n      var symbolKeepAspect = itemModel.getShallow('symbolKeepAspect');\n      // TODO: refactor needed: single data item should not support callback function\n      if (isFunction(symbol) || isFunction(symbolSize) || isFunction(symbolRotate) || isFunction(symbolOffset)) {\n        var rawIdx = mpModel.getRawValue(idx);\n        var dataParams = mpModel.getDataParams(idx);\n        if (isFunction(symbol)) {\n          symbol = symbol(rawIdx, dataParams);\n        }\n        if (isFunction(symbolSize)) {\n          // FIXME \u8FD9\u91CC\u4E0D\u517C\u5BB9 ECharts 2.x\uFF0C2.x \u8C8C\u4F3C\u53C2\u6570\u662F\u6574\u4E2A\u6570\u636E\uFF1F\n          symbolSize = symbolSize(rawIdx, dataParams);\n        }\n        if (isFunction(symbolRotate)) {\n          symbolRotate = symbolRotate(rawIdx, dataParams);\n        }\n        if (isFunction(symbolOffset)) {\n          symbolOffset = symbolOffset(rawIdx, dataParams);\n        }\n      }\n      var style = itemModel.getModel('itemStyle').getItemStyle();\n      var z2 = itemModel.get('z2');\n      var color = getVisualFromData(seriesData, 'color');\n      if (!style.fill) {\n        style.fill = color;\n      }\n      mpData.setItemVisual(idx, {\n        z2: retrieve2(z2, 0),\n        symbol: symbol,\n        symbolSize: symbolSize,\n        symbolRotate: symbolRotate,\n        symbolOffset: symbolOffset,\n        symbolKeepAspect: symbolKeepAspect,\n        style: style\n      });\n    });\n    // TODO Text are wrong\n    symbolDraw.updateData(mpData);\n    this.group.add(symbolDraw.group);\n    // Set host model for tooltip\n    // FIXME\n    mpData.eachItemGraphicEl(function (el) {\n      el.traverse(function (child) {\n        getECData(child).dataModel = mpModel;\n      });\n    });\n    this.markKeep(symbolDraw);\n    symbolDraw.group.silent = mpModel.get('silent') || seriesModel.get('silent');\n  };\n  MarkPointView.type = 'markPoint';\n  return MarkPointView;\n}(MarkerView);\nfunction createData(coordSys, seriesModel, mpModel) {\n  var coordDimsInfos;\n  if (coordSys) {\n    coordDimsInfos = map(coordSys && coordSys.dimensions, function (coordDim) {\n      var info = seriesModel.getData().getDimensionInfo(seriesModel.getData().mapDimension(coordDim)) || {};\n      // In map series data don't have lng and lat dimension. Fallback to same with coordSys\n      return extend(extend({}, info), {\n        name: coordDim,\n        // DON'T use ordinalMeta to parse and collect ordinal.\n        ordinalMeta: null\n      });\n    });\n  } else {\n    coordDimsInfos = [{\n      name: 'value',\n      type: 'float'\n    }];\n  }\n  var mpData = new SeriesData(coordDimsInfos, mpModel);\n  var dataOpt = map(mpModel.get('data'), curry(markerHelper.dataTransform, seriesModel));\n  if (coordSys) {\n    dataOpt = filter(dataOpt, curry(markerHelper.dataFilter, coordSys));\n  }\n  var dimValueGetter = markerHelper.createMarkerDimValueGetter(!!coordSys, coordDimsInfos);\n  mpData.initData(dataOpt, null, dimValueGetter);\n  return mpData;\n}\nexport default MarkPointView;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\nimport checkMarkerInSeries from './checkMarkerInSeries.js';\nimport MarkPointModel from './MarkPointModel.js';\nimport MarkPointView from './MarkPointView.js';\nexport function install(registers) {\n  registers.registerComponentModel(MarkPointModel);\n  registers.registerComponentView(MarkPointView);\n  registers.registerPreprocessor(function (opt) {\n    if (checkMarkerInSeries(opt.series, 'markPoint')) {\n      // Make sure markPoint component is enabled\n      opt.markPoint = opt.markPoint || {};\n    }\n  });\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport MarkerModel from './MarkerModel.js';\nvar MarkLineModel = /** @class */function (_super) {\n  __extends(MarkLineModel, _super);\n  function MarkLineModel() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = MarkLineModel.type;\n    return _this;\n  }\n  MarkLineModel.prototype.createMarkerModelFromSeries = function (markerOpt, masterMarkerModel, ecModel) {\n    return new MarkLineModel(markerOpt, masterMarkerModel, ecModel);\n  };\n  MarkLineModel.type = 'markLine';\n  MarkLineModel.defaultOption = {\n    // zlevel: 0,\n    z: 5,\n    symbol: ['circle', 'arrow'],\n    symbolSize: [8, 16],\n    // symbolRotate: 0,\n    symbolOffset: 0,\n    precision: 2,\n    tooltip: {\n      trigger: 'item'\n    },\n    label: {\n      show: true,\n      position: 'end',\n      distance: 5\n    },\n    lineStyle: {\n      type: 'dashed'\n    },\n    emphasis: {\n      label: {\n        show: true\n      },\n      lineStyle: {\n        width: 3\n      }\n    },\n    animationEasing: 'linear'\n  };\n  return MarkLineModel;\n}(MarkerModel);\nexport default MarkLineModel;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport SeriesData from '../../data/SeriesData.js';\nimport * as numberUtil from '../../util/number.js';\nimport * as markerHelper from './markerHelper.js';\nimport LineDraw from '../../chart/helper/LineDraw.js';\nimport MarkerView from './MarkerView.js';\nimport { getStackedDimension } from '../../data/helper/dataStackHelper.js';\nimport { isCoordinateSystemType } from '../../coord/CoordinateSystem.js';\nimport { getECData } from '../../util/innerStore.js';\nimport MarkerModel from './MarkerModel.js';\nimport { isArray, retrieve, retrieve2, clone, extend, logError, merge, map, curry, filter, isNumber } from 'zrender/lib/core/util.js';\nimport { makeInner } from '../../util/model.js';\nimport { getVisualFromData } from '../../visual/helper.js';\nvar inner = makeInner();\nvar markLineTransform = function (seriesModel, coordSys, mlModel, item) {\n  var data = seriesModel.getData();\n  var itemArray;\n  if (!isArray(item)) {\n    // Special type markLine like 'min', 'max', 'average', 'median'\n    var mlType = item.type;\n    if (mlType === 'min' || mlType === 'max' || mlType === 'average' || mlType === 'median'\n    // In case\n    // data: [{\n    //   yAxis: 10\n    // }]\n    || item.xAxis != null || item.yAxis != null) {\n      var valueAxis = void 0;\n      var value = void 0;\n      if (item.yAxis != null || item.xAxis != null) {\n        valueAxis = coordSys.getAxis(item.yAxis != null ? 'y' : 'x');\n        value = retrieve(item.yAxis, item.xAxis);\n      } else {\n        var axisInfo = markerHelper.getAxisInfo(item, data, coordSys, seriesModel);\n        valueAxis = axisInfo.valueAxis;\n        var valueDataDim = getStackedDimension(data, axisInfo.valueDataDim);\n        value = markerHelper.numCalculate(data, valueDataDim, mlType);\n      }\n      var valueIndex = valueAxis.dim === 'x' ? 0 : 1;\n      var baseIndex = 1 - valueIndex;\n      // Normized to 2d data with start and end point\n      var mlFrom = clone(item);\n      var mlTo = {\n        coord: []\n      };\n      mlFrom.type = null;\n      mlFrom.coord = [];\n      mlFrom.coord[baseIndex] = -Infinity;\n      mlTo.coord[baseIndex] = Infinity;\n      var precision = mlModel.get('precision');\n      if (precision >= 0 && isNumber(value)) {\n        value = +value.toFixed(Math.min(precision, 20));\n      }\n      mlFrom.coord[valueIndex] = mlTo.coord[valueIndex] = value;\n      itemArray = [mlFrom, mlTo, {\n        type: mlType,\n        valueIndex: item.valueIndex,\n        // Force to use the value of calculated value.\n        value: value\n      }];\n    } else {\n      // Invalid data\n      if (process.env.NODE_ENV !== 'production') {\n        logError('Invalid markLine data.');\n      }\n      itemArray = [];\n    }\n  } else {\n    itemArray = item;\n  }\n  var normalizedItem = [markerHelper.dataTransform(seriesModel, itemArray[0]), markerHelper.dataTransform(seriesModel, itemArray[1]), extend({}, itemArray[2])];\n  // Avoid line data type is extended by from(to) data type\n  normalizedItem[2].type = normalizedItem[2].type || null;\n  // Merge from option and to option into line option\n  merge(normalizedItem[2], normalizedItem[0]);\n  merge(normalizedItem[2], normalizedItem[1]);\n  return normalizedItem;\n};\nfunction isInfinity(val) {\n  return !isNaN(val) && !isFinite(val);\n}\n// If a markLine has one dim\nfunction ifMarkLineHasOnlyDim(dimIndex, fromCoord, toCoord, coordSys) {\n  var otherDimIndex = 1 - dimIndex;\n  var dimName = coordSys.dimensions[dimIndex];\n  return isInfinity(fromCoord[otherDimIndex]) && isInfinity(toCoord[otherDimIndex]) && fromCoord[dimIndex] === toCoord[dimIndex] && coordSys.getAxis(dimName).containData(fromCoord[dimIndex]);\n}\nfunction markLineFilter(coordSys, item) {\n  if (coordSys.type === 'cartesian2d') {\n    var fromCoord = item[0].coord;\n    var toCoord = item[1].coord;\n    // In case\n    // {\n    //  markLine: {\n    //    data: [{ yAxis: 2 }]\n    //  }\n    // }\n    if (fromCoord && toCoord && (ifMarkLineHasOnlyDim(1, fromCoord, toCoord, coordSys) || ifMarkLineHasOnlyDim(0, fromCoord, toCoord, coordSys))) {\n      return true;\n    }\n  }\n  return markerHelper.dataFilter(coordSys, item[0]) && markerHelper.dataFilter(coordSys, item[1]);\n}\nfunction updateSingleMarkerEndLayout(data, idx, isFrom, seriesModel, api) {\n  var coordSys = seriesModel.coordinateSystem;\n  var itemModel = data.getItemModel(idx);\n  var point;\n  var xPx = numberUtil.parsePercent(itemModel.get('x'), api.getWidth());\n  var yPx = numberUtil.parsePercent(itemModel.get('y'), api.getHeight());\n  if (!isNaN(xPx) && !isNaN(yPx)) {\n    point = [xPx, yPx];\n  } else {\n    // Chart like bar may have there own marker positioning logic\n    if (seriesModel.getMarkerPosition) {\n      // Use the getMarkerPosition\n      point = seriesModel.getMarkerPosition(data.getValues(data.dimensions, idx));\n    } else {\n      var dims = coordSys.dimensions;\n      var x = data.get(dims[0], idx);\n      var y = data.get(dims[1], idx);\n      point = coordSys.dataToPoint([x, y]);\n    }\n    // Expand line to the edge of grid if value on one axis is Inifnity\n    // In case\n    //  markLine: {\n    //    data: [{\n    //      yAxis: 2\n    //      // or\n    //      type: 'average'\n    //    }]\n    //  }\n    if (isCoordinateSystemType(coordSys, 'cartesian2d')) {\n      // TODO: TYPE ts@4.1 may still infer it as Axis instead of Axis2D. Not sure if it's a bug\n      var xAxis = coordSys.getAxis('x');\n      var yAxis = coordSys.getAxis('y');\n      var dims = coordSys.dimensions;\n      if (isInfinity(data.get(dims[0], idx))) {\n        point[0] = xAxis.toGlobalCoord(xAxis.getExtent()[isFrom ? 0 : 1]);\n      } else if (isInfinity(data.get(dims[1], idx))) {\n        point[1] = yAxis.toGlobalCoord(yAxis.getExtent()[isFrom ? 0 : 1]);\n      }\n    }\n    // Use x, y if has any\n    if (!isNaN(xPx)) {\n      point[0] = xPx;\n    }\n    if (!isNaN(yPx)) {\n      point[1] = yPx;\n    }\n  }\n  data.setItemLayout(idx, point);\n}\nvar MarkLineView = /** @class */function (_super) {\n  __extends(MarkLineView, _super);\n  function MarkLineView() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = MarkLineView.type;\n    return _this;\n  }\n  MarkLineView.prototype.updateTransform = function (markLineModel, ecModel, api) {\n    ecModel.eachSeries(function (seriesModel) {\n      var mlModel = MarkerModel.getMarkerModelFromSeries(seriesModel, 'markLine');\n      if (mlModel) {\n        var mlData_1 = mlModel.getData();\n        var fromData_1 = inner(mlModel).from;\n        var toData_1 = inner(mlModel).to;\n        // Update visual and layout of from symbol and to symbol\n        fromData_1.each(function (idx) {\n          updateSingleMarkerEndLayout(fromData_1, idx, true, seriesModel, api);\n          updateSingleMarkerEndLayout(toData_1, idx, false, seriesModel, api);\n        });\n        // Update layout of line\n        mlData_1.each(function (idx) {\n          mlData_1.setItemLayout(idx, [fromData_1.getItemLayout(idx), toData_1.getItemLayout(idx)]);\n        });\n        this.markerGroupMap.get(seriesModel.id).updateLayout();\n      }\n    }, this);\n  };\n  MarkLineView.prototype.renderSeries = function (seriesModel, mlModel, ecModel, api) {\n    var coordSys = seriesModel.coordinateSystem;\n    var seriesId = seriesModel.id;\n    var seriesData = seriesModel.getData();\n    var lineDrawMap = this.markerGroupMap;\n    var lineDraw = lineDrawMap.get(seriesId) || lineDrawMap.set(seriesId, new LineDraw());\n    this.group.add(lineDraw.group);\n    var mlData = createList(coordSys, seriesModel, mlModel);\n    var fromData = mlData.from;\n    var toData = mlData.to;\n    var lineData = mlData.line;\n    inner(mlModel).from = fromData;\n    inner(mlModel).to = toData;\n    // Line data for tooltip and formatter\n    mlModel.setData(lineData);\n    // TODO\n    // Functionally, `symbolSize` & `symbolOffset` can also be 2D array now.\n    // But the related logic and type definition are not finished yet.\n    // Finish it if required\n    var symbolType = mlModel.get('symbol');\n    var symbolSize = mlModel.get('symbolSize');\n    var symbolRotate = mlModel.get('symbolRotate');\n    var symbolOffset = mlModel.get('symbolOffset');\n    // TODO: support callback function like markPoint\n    if (!isArray(symbolType)) {\n      symbolType = [symbolType, symbolType];\n    }\n    if (!isArray(symbolSize)) {\n      symbolSize = [symbolSize, symbolSize];\n    }\n    if (!isArray(symbolRotate)) {\n      symbolRotate = [symbolRotate, symbolRotate];\n    }\n    if (!isArray(symbolOffset)) {\n      symbolOffset = [symbolOffset, symbolOffset];\n    }\n    // Update visual and layout of from symbol and to symbol\n    mlData.from.each(function (idx) {\n      updateDataVisualAndLayout(fromData, idx, true);\n      updateDataVisualAndLayout(toData, idx, false);\n    });\n    // Update visual and layout of line\n    lineData.each(function (idx) {\n      var itemModel = lineData.getItemModel(idx);\n      var lineStyle = itemModel.getModel('lineStyle').getLineStyle();\n      // lineData.setItemVisual(idx, {\n      //     color: lineColor || fromData.getItemVisual(idx, 'color')\n      // });\n      lineData.setItemLayout(idx, [fromData.getItemLayout(idx), toData.getItemLayout(idx)]);\n      var z2 = itemModel.get('z2');\n      if (lineStyle.stroke == null) {\n        lineStyle.stroke = fromData.getItemVisual(idx, 'style').fill;\n      }\n      lineData.setItemVisual(idx, {\n        z2: retrieve2(z2, 0),\n        fromSymbolKeepAspect: fromData.getItemVisual(idx, 'symbolKeepAspect'),\n        fromSymbolOffset: fromData.getItemVisual(idx, 'symbolOffset'),\n        fromSymbolRotate: fromData.getItemVisual(idx, 'symbolRotate'),\n        fromSymbolSize: fromData.getItemVisual(idx, 'symbolSize'),\n        fromSymbol: fromData.getItemVisual(idx, 'symbol'),\n        toSymbolKeepAspect: toData.getItemVisual(idx, 'symbolKeepAspect'),\n        toSymbolOffset: toData.getItemVisual(idx, 'symbolOffset'),\n        toSymbolRotate: toData.getItemVisual(idx, 'symbolRotate'),\n        toSymbolSize: toData.getItemVisual(idx, 'symbolSize'),\n        toSymbol: toData.getItemVisual(idx, 'symbol'),\n        style: lineStyle\n      });\n    });\n    lineDraw.updateData(lineData);\n    // Set host model for tooltip\n    // FIXME\n    mlData.line.eachItemGraphicEl(function (el) {\n      getECData(el).dataModel = mlModel;\n      el.traverse(function (child) {\n        getECData(child).dataModel = mlModel;\n      });\n    });\n    function updateDataVisualAndLayout(data, idx, isFrom) {\n      var itemModel = data.getItemModel(idx);\n      updateSingleMarkerEndLayout(data, idx, isFrom, seriesModel, api);\n      var style = itemModel.getModel('itemStyle').getItemStyle();\n      if (style.fill == null) {\n        style.fill = getVisualFromData(seriesData, 'color');\n      }\n      data.setItemVisual(idx, {\n        symbolKeepAspect: itemModel.get('symbolKeepAspect'),\n        // `0` should be considered as a valid value, so use `retrieve2` instead of `||`\n        symbolOffset: retrieve2(itemModel.get('symbolOffset', true), symbolOffset[isFrom ? 0 : 1]),\n        symbolRotate: retrieve2(itemModel.get('symbolRotate', true), symbolRotate[isFrom ? 0 : 1]),\n        // TODO: when 2d array is supported, it should ignore parent\n        symbolSize: retrieve2(itemModel.get('symbolSize'), symbolSize[isFrom ? 0 : 1]),\n        symbol: retrieve2(itemModel.get('symbol', true), symbolType[isFrom ? 0 : 1]),\n        style: style\n      });\n    }\n    this.markKeep(lineDraw);\n    lineDraw.group.silent = mlModel.get('silent') || seriesModel.get('silent');\n  };\n  MarkLineView.type = 'markLine';\n  return MarkLineView;\n}(MarkerView);\nfunction createList(coordSys, seriesModel, mlModel) {\n  var coordDimsInfos;\n  if (coordSys) {\n    coordDimsInfos = map(coordSys && coordSys.dimensions, function (coordDim) {\n      var info = seriesModel.getData().getDimensionInfo(seriesModel.getData().mapDimension(coordDim)) || {};\n      // In map series data don't have lng and lat dimension. Fallback to same with coordSys\n      return extend(extend({}, info), {\n        name: coordDim,\n        // DON'T use ordinalMeta to parse and collect ordinal.\n        ordinalMeta: null\n      });\n    });\n  } else {\n    coordDimsInfos = [{\n      name: 'value',\n      type: 'float'\n    }];\n  }\n  var fromData = new SeriesData(coordDimsInfos, mlModel);\n  var toData = new SeriesData(coordDimsInfos, mlModel);\n  // No dimensions\n  var lineData = new SeriesData([], mlModel);\n  var optData = map(mlModel.get('data'), curry(markLineTransform, seriesModel, coordSys, mlModel));\n  if (coordSys) {\n    optData = filter(optData, curry(markLineFilter, coordSys));\n  }\n  var dimValueGetter = markerHelper.createMarkerDimValueGetter(!!coordSys, coordDimsInfos);\n  fromData.initData(map(optData, function (item) {\n    return item[0];\n  }), null, dimValueGetter);\n  toData.initData(map(optData, function (item) {\n    return item[1];\n  }), null, dimValueGetter);\n  lineData.initData(map(optData, function (item) {\n    return item[2];\n  }));\n  lineData.hasItemOption = true;\n  return {\n    from: fromData,\n    to: toData,\n    line: lineData\n  };\n}\nexport default MarkLineView;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\nimport checkMarkerInSeries from './checkMarkerInSeries.js';\nimport MarkLineModel from './MarkLineModel.js';\nimport MarkLineView from './MarkLineView.js';\nexport function install(registers) {\n  registers.registerComponentModel(MarkLineModel);\n  registers.registerComponentView(MarkLineView);\n  registers.registerPreprocessor(function (opt) {\n    if (checkMarkerInSeries(opt.series, 'markLine')) {\n      // Make sure markLine component is enabled\n      opt.markLine = opt.markLine || {};\n    }\n  });\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport MarkerModel from './MarkerModel.js';\nvar MarkAreaModel = /** @class */function (_super) {\n  __extends(MarkAreaModel, _super);\n  function MarkAreaModel() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = MarkAreaModel.type;\n    return _this;\n  }\n  MarkAreaModel.prototype.createMarkerModelFromSeries = function (markerOpt, masterMarkerModel, ecModel) {\n    return new MarkAreaModel(markerOpt, masterMarkerModel, ecModel);\n  };\n  MarkAreaModel.type = 'markArea';\n  MarkAreaModel.defaultOption = {\n    // zlevel: 0,\n    // PENDING\n    z: 1,\n    tooltip: {\n      trigger: 'item'\n    },\n    // markArea should fixed on the coordinate system\n    animation: false,\n    label: {\n      show: true,\n      position: 'top'\n    },\n    itemStyle: {\n      // color and borderColor default to use color from series\n      // color: 'auto'\n      // borderColor: 'auto'\n      borderWidth: 0\n    },\n    emphasis: {\n      label: {\n        show: true,\n        position: 'top'\n      }\n    }\n  };\n  return MarkAreaModel;\n}(MarkerModel);\nexport default MarkAreaModel;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\n// TODO Optimize on polar\nimport * as colorUtil from 'zrender/lib/tool/color.js';\nimport SeriesData from '../../data/SeriesData.js';\nimport * as numberUtil from '../../util/number.js';\nimport * as graphic from '../../util/graphic.js';\nimport { toggleHoverEmphasis, setStatesStylesFromModel } from '../../util/states.js';\nimport * as markerHelper from './markerHelper.js';\nimport MarkerView from './MarkerView.js';\nimport { retrieve, mergeAll, map, curry, filter, extend, isString, retrieve2 } from 'zrender/lib/core/util.js';\nimport { isCoordinateSystemType } from '../../coord/CoordinateSystem.js';\nimport MarkerModel from './MarkerModel.js';\nimport { makeInner } from '../../util/model.js';\nimport { getVisualFromData } from '../../visual/helper.js';\nimport { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle.js';\nimport { getECData } from '../../util/innerStore.js';\nimport { parseDataValue } from '../../data/helper/dataValueHelper.js';\nimport tokens from '../../visual/tokens.js';\nvar inner = makeInner();\nvar markAreaTransform = function (seriesModel, coordSys, maModel, item) {\n  // item may be null\n  var item0 = item[0];\n  var item1 = item[1];\n  if (!item0 || !item1) {\n    return;\n  }\n  var lt = markerHelper.dataTransform(seriesModel, item0);\n  var rb = markerHelper.dataTransform(seriesModel, item1);\n  // FIXME make sure lt is less than rb\n  var ltCoord = lt.coord;\n  var rbCoord = rb.coord;\n  ltCoord[0] = retrieve(ltCoord[0], -Infinity);\n  ltCoord[1] = retrieve(ltCoord[1], -Infinity);\n  rbCoord[0] = retrieve(rbCoord[0], Infinity);\n  rbCoord[1] = retrieve(rbCoord[1], Infinity);\n  // Merge option into one\n  var result = mergeAll([{}, lt, rb]);\n  result.coord = [lt.coord, rb.coord];\n  result.x0 = lt.x;\n  result.y0 = lt.y;\n  result.x1 = rb.x;\n  result.y1 = rb.y;\n  return result;\n};\nfunction isInfinity(val) {\n  return !isNaN(val) && !isFinite(val);\n}\n// If a markArea has one dim\nfunction ifMarkAreaHasOnlyDim(dimIndex, fromCoord, toCoord, coordSys) {\n  var otherDimIndex = 1 - dimIndex;\n  return isInfinity(fromCoord[otherDimIndex]) && isInfinity(toCoord[otherDimIndex]);\n}\nfunction markAreaFilter(coordSys, item) {\n  var fromCoord = item.coord[0];\n  var toCoord = item.coord[1];\n  var item0 = {\n    coord: fromCoord,\n    x: item.x0,\n    y: item.y0\n  };\n  var item1 = {\n    coord: toCoord,\n    x: item.x1,\n    y: item.y1\n  };\n  if (isCoordinateSystemType(coordSys, 'cartesian2d')) {\n    // In case\n    // {\n    //  markArea: {\n    //    data: [{ yAxis: 2 }]\n    //  }\n    // }\n    if (fromCoord && toCoord && (ifMarkAreaHasOnlyDim(1, fromCoord, toCoord, coordSys) || ifMarkAreaHasOnlyDim(0, fromCoord, toCoord, coordSys))) {\n      return true;\n    }\n    // Directly returning true may also do the work,\n    // because markArea will not be shown automatically\n    // when it's not included in coordinate system.\n    // But filtering ahead can avoid keeping rendering markArea\n    // when there are too many of them.\n    return markerHelper.zoneFilter(coordSys, item0, item1);\n  }\n  return markerHelper.dataFilter(coordSys, item0) || markerHelper.dataFilter(coordSys, item1);\n}\n// dims can be ['x0', 'y0'], ['x1', 'y1'], ['x0', 'y1'], ['x1', 'y0']\nfunction getSingleMarkerEndPoint(data, idx, dims, seriesModel, api) {\n  var coordSys = seriesModel.coordinateSystem;\n  var itemModel = data.getItemModel(idx);\n  var point;\n  var xPx = numberUtil.parsePercent(itemModel.get(dims[0]), api.getWidth());\n  var yPx = numberUtil.parsePercent(itemModel.get(dims[1]), api.getHeight());\n  if (!isNaN(xPx) && !isNaN(yPx)) {\n    point = [xPx, yPx];\n  } else {\n    // Chart like bar may have there own marker positioning logic\n    if (seriesModel.getMarkerPosition) {\n      // Consider the case that user input the right-bottom point first\n      // Pick the larger x and y as 'x1' and 'y1'\n      var pointValue0 = data.getValues(['x0', 'y0'], idx);\n      var pointValue1 = data.getValues(['x1', 'y1'], idx);\n      var clampPointValue0 = coordSys.clampData(pointValue0);\n      var clampPointValue1 = coordSys.clampData(pointValue1);\n      var pointValue = [];\n      if (dims[0] === 'x0') {\n        pointValue[0] = clampPointValue0[0] > clampPointValue1[0] ? pointValue1[0] : pointValue0[0];\n      } else {\n        pointValue[0] = clampPointValue0[0] > clampPointValue1[0] ? pointValue0[0] : pointValue1[0];\n      }\n      if (dims[1] === 'y0') {\n        pointValue[1] = clampPointValue0[1] > clampPointValue1[1] ? pointValue1[1] : pointValue0[1];\n      } else {\n        pointValue[1] = clampPointValue0[1] > clampPointValue1[1] ? pointValue0[1] : pointValue1[1];\n      }\n      // Use the getMarkerPosition\n      point = seriesModel.getMarkerPosition(pointValue, dims, true);\n    } else {\n      var x = data.get(dims[0], idx);\n      var y = data.get(dims[1], idx);\n      var pt = [x, y];\n      coordSys.clampData && coordSys.clampData(pt, pt);\n      point = coordSys.dataToPoint(pt, true);\n    }\n    if (isCoordinateSystemType(coordSys, 'cartesian2d')) {\n      // TODO: TYPE ts@4.1 may still infer it as Axis instead of Axis2D. Not sure if it's a bug\n      var xAxis = coordSys.getAxis('x');\n      var yAxis = coordSys.getAxis('y');\n      var x = data.get(dims[0], idx);\n      var y = data.get(dims[1], idx);\n      if (isInfinity(x)) {\n        point[0] = xAxis.toGlobalCoord(xAxis.getExtent()[dims[0] === 'x0' ? 0 : 1]);\n      } else if (isInfinity(y)) {\n        point[1] = yAxis.toGlobalCoord(yAxis.getExtent()[dims[1] === 'y0' ? 0 : 1]);\n      }\n    }\n    // Use x, y if has any\n    if (!isNaN(xPx)) {\n      point[0] = xPx;\n    }\n    if (!isNaN(yPx)) {\n      point[1] = yPx;\n    }\n  }\n  return point;\n}\nexport var dimPermutations = [['x0', 'y0'], ['x1', 'y0'], ['x1', 'y1'], ['x0', 'y1']];\nvar MarkAreaView = /** @class */function (_super) {\n  __extends(MarkAreaView, _super);\n  function MarkAreaView() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = MarkAreaView.type;\n    return _this;\n  }\n  MarkAreaView.prototype.updateTransform = function (markAreaModel, ecModel, api) {\n    ecModel.eachSeries(function (seriesModel) {\n      var maModel = MarkerModel.getMarkerModelFromSeries(seriesModel, 'markArea');\n      if (maModel) {\n        var areaData_1 = maModel.getData();\n        areaData_1.each(function (idx) {\n          var points = map(dimPermutations, function (dim) {\n            return getSingleMarkerEndPoint(areaData_1, idx, dim, seriesModel, api);\n          });\n          // Layout\n          areaData_1.setItemLayout(idx, points);\n          var el = areaData_1.getItemGraphicEl(idx);\n          el.setShape('points', points);\n        });\n      }\n    }, this);\n  };\n  MarkAreaView.prototype.renderSeries = function (seriesModel, maModel, ecModel, api) {\n    var coordSys = seriesModel.coordinateSystem;\n    var seriesId = seriesModel.id;\n    var seriesData = seriesModel.getData();\n    var areaGroupMap = this.markerGroupMap;\n    var polygonGroup = areaGroupMap.get(seriesId) || areaGroupMap.set(seriesId, {\n      group: new graphic.Group()\n    });\n    this.group.add(polygonGroup.group);\n    this.markKeep(polygonGroup);\n    var areaData = createList(coordSys, seriesModel, maModel);\n    // Line data for tooltip and formatter\n    maModel.setData(areaData);\n    // Update visual and layout of line\n    areaData.each(function (idx) {\n      // Layout\n      var points = map(dimPermutations, function (dim) {\n        return getSingleMarkerEndPoint(areaData, idx, dim, seriesModel, api);\n      });\n      var xAxisScale = coordSys.getAxis('x').scale;\n      var yAxisScale = coordSys.getAxis('y').scale;\n      var xAxisExtent = xAxisScale.getExtent();\n      var yAxisExtent = yAxisScale.getExtent();\n      var xPointExtent = [xAxisScale.parse(areaData.get('x0', idx)), xAxisScale.parse(areaData.get('x1', idx))];\n      var yPointExtent = [yAxisScale.parse(areaData.get('y0', idx)), yAxisScale.parse(areaData.get('y1', idx))];\n      numberUtil.asc(xPointExtent);\n      numberUtil.asc(yPointExtent);\n      var overlapped = !(xAxisExtent[0] > xPointExtent[1] || xAxisExtent[1] < xPointExtent[0] || yAxisExtent[0] > yPointExtent[1] || yAxisExtent[1] < yPointExtent[0]);\n      // If none of the area is inside coordSys, allClipped is set to be true\n      // in layout so that label will not be displayed. See #12591\n      var allClipped = !overlapped;\n      areaData.setItemLayout(idx, {\n        points: points,\n        allClipped: allClipped\n      });\n      var itemModel = areaData.getItemModel(idx);\n      var style = itemModel.getModel('itemStyle').getItemStyle();\n      var z2 = itemModel.get('z2');\n      var color = getVisualFromData(seriesData, 'color');\n      if (!style.fill) {\n        style.fill = color;\n        if (isString(style.fill)) {\n          style.fill = colorUtil.modifyAlpha(style.fill, 0.4);\n        }\n      }\n      if (!style.stroke) {\n        style.stroke = color;\n      }\n      // Visual\n      areaData.setItemVisual(idx, 'style', style);\n      areaData.setItemVisual(idx, 'z2', retrieve2(z2, 0));\n    });\n    areaData.diff(inner(polygonGroup).data).add(function (idx) {\n      var layout = areaData.getItemLayout(idx);\n      var z2 = areaData.getItemVisual(idx, 'z2');\n      if (!layout.allClipped) {\n        var polygon = new graphic.Polygon({\n          z2: retrieve2(z2, 0),\n          shape: {\n            points: layout.points\n          }\n        });\n        areaData.setItemGraphicEl(idx, polygon);\n        polygonGroup.group.add(polygon);\n      }\n    }).update(function (newIdx, oldIdx) {\n      var polygon = inner(polygonGroup).data.getItemGraphicEl(oldIdx);\n      var layout = areaData.getItemLayout(newIdx);\n      var z2 = areaData.getItemVisual(newIdx, 'z2');\n      if (!layout.allClipped) {\n        if (polygon) {\n          graphic.updateProps(polygon, {\n            z2: retrieve2(z2, 0),\n            shape: {\n              points: layout.points\n            }\n          }, maModel, newIdx);\n        } else {\n          polygon = new graphic.Polygon({\n            shape: {\n              points: layout.points\n            }\n          });\n        }\n        areaData.setItemGraphicEl(newIdx, polygon);\n        polygonGroup.group.add(polygon);\n      } else if (polygon) {\n        polygonGroup.group.remove(polygon);\n      }\n    }).remove(function (idx) {\n      var polygon = inner(polygonGroup).data.getItemGraphicEl(idx);\n      polygonGroup.group.remove(polygon);\n    }).execute();\n    areaData.eachItemGraphicEl(function (polygon, idx) {\n      var itemModel = areaData.getItemModel(idx);\n      var style = areaData.getItemVisual(idx, 'style');\n      polygon.useStyle(areaData.getItemVisual(idx, 'style'));\n      setLabelStyle(polygon, getLabelStatesModels(itemModel), {\n        labelFetcher: maModel,\n        labelDataIndex: idx,\n        defaultText: areaData.getName(idx) || '',\n        inheritColor: isString(style.fill) ? colorUtil.modifyAlpha(style.fill, 1) : tokens.color.neutral99\n      });\n      setStatesStylesFromModel(polygon, itemModel);\n      toggleHoverEmphasis(polygon, null, null, itemModel.get(['emphasis', 'disabled']));\n      getECData(polygon).dataModel = maModel;\n    });\n    inner(polygonGroup).data = areaData;\n    polygonGroup.group.silent = maModel.get('silent') || seriesModel.get('silent');\n  };\n  MarkAreaView.type = 'markArea';\n  return MarkAreaView;\n}(MarkerView);\nfunction createList(coordSys, seriesModel, maModel) {\n  var areaData;\n  var dataDims;\n  var dims = ['x0', 'y0', 'x1', 'y1'];\n  if (coordSys) {\n    var coordDimsInfos_1 = map(coordSys && coordSys.dimensions, function (coordDim) {\n      var data = seriesModel.getData();\n      var info = data.getDimensionInfo(data.mapDimension(coordDim)) || {};\n      // In map series data don't have lng and lat dimension. Fallback to same with coordSys\n      return extend(extend({}, info), {\n        name: coordDim,\n        // DON'T use ordinalMeta to parse and collect ordinal.\n        ordinalMeta: null\n      });\n    });\n    dataDims = map(dims, function (dim, idx) {\n      return {\n        name: dim,\n        type: coordDimsInfos_1[idx % 2].type\n      };\n    });\n    areaData = new SeriesData(dataDims, maModel);\n  } else {\n    dataDims = [{\n      name: 'value',\n      type: 'float'\n    }];\n    areaData = new SeriesData(dataDims, maModel);\n  }\n  var optData = map(maModel.get('data'), curry(markAreaTransform, seriesModel, coordSys, maModel));\n  if (coordSys) {\n    optData = filter(optData, curry(markAreaFilter, coordSys));\n  }\n  var dimValueGetter = coordSys ? function (item, dimName, dataIndex, dimIndex) {\n    // TODO should convert to ParsedValue?\n    var rawVal = item.coord[Math.floor(dimIndex / 2)][dimIndex % 2];\n    return parseDataValue(rawVal, dataDims[dimIndex]);\n  } : function (item, dimName, dataIndex, dimIndex) {\n    return parseDataValue(item.value, dataDims[dimIndex]);\n  };\n  areaData.initData(optData, null, dimValueGetter);\n  areaData.hasItemOption = true;\n  return areaData;\n}\nexport default MarkAreaView;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport checkMarkerInSeries from './checkMarkerInSeries.js';\nimport MarkAreaModel from './MarkAreaModel.js';\nimport MarkAreaView from './MarkAreaView.js';\nexport function install(registers) {\n  registers.registerComponentModel(MarkAreaModel);\n  registers.registerComponentView(MarkAreaView);\n  registers.registerPreprocessor(function (opt) {\n    if (checkMarkerInSeries(opt.series, 'markArea')) {\n      // Make sure markArea component is enabled\n      opt.markArea = opt.markArea || {};\n    }\n  });\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport Model from '../../model/Model.js';\nimport { isNameSpecified } from '../../util/model.js';\nimport ComponentModel from '../../model/Component.js';\nimport tokens from '../../visual/tokens.js';\nvar getDefaultSelectorOptions = function (ecModel, type) {\n  if (type === 'all') {\n    return {\n      type: 'all',\n      title: ecModel.getLocaleModel().get(['legend', 'selector', 'all'])\n    };\n  } else if (type === 'inverse') {\n    return {\n      type: 'inverse',\n      title: ecModel.getLocaleModel().get(['legend', 'selector', 'inverse'])\n    };\n  }\n};\nvar LegendModel = /** @class */function (_super) {\n  __extends(LegendModel, _super);\n  function LegendModel() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = LegendModel.type;\n    _this.layoutMode = {\n      type: 'box',\n      // legend.width/height are maxWidth/maxHeight actually,\n      // whereas real width/height is calculated by its content.\n      // (Setting {left: 10, right: 10} does not make sense).\n      // So consider the case:\n      // `setOption({legend: {left: 10});`\n      // then `setOption({legend: {right: 10});`\n      // The previous `left` should be cleared by setting `ignoreSize`.\n      ignoreSize: true\n    };\n    return _this;\n  }\n  LegendModel.prototype.init = function (option, parentModel, ecModel) {\n    this.mergeDefaultAndTheme(option, ecModel);\n    option.selected = option.selected || {};\n    this._updateSelector(option);\n  };\n  LegendModel.prototype.mergeOption = function (option, ecModel) {\n    _super.prototype.mergeOption.call(this, option, ecModel);\n    this._updateSelector(option);\n  };\n  LegendModel.prototype._updateSelector = function (option) {\n    var selector = option.selector;\n    var ecModel = this.ecModel;\n    if (selector === true) {\n      selector = option.selector = ['all', 'inverse'];\n    }\n    if (zrUtil.isArray(selector)) {\n      zrUtil.each(selector, function (item, index) {\n        zrUtil.isString(item) && (item = {\n          type: item\n        });\n        selector[index] = zrUtil.merge(item, getDefaultSelectorOptions(ecModel, item.type));\n      });\n    }\n  };\n  LegendModel.prototype.optionUpdated = function () {\n    this._updateData(this.ecModel);\n    var legendData = this._data;\n    // If selectedMode is single, try to select one\n    if (legendData[0] && this.get('selectedMode') === 'single') {\n      var hasSelected = false;\n      // If has any selected in option.selected\n      for (var i = 0; i < legendData.length; i++) {\n        var name_1 = legendData[i].get('name');\n        if (this.isSelected(name_1)) {\n          // Force to unselect others\n          this.select(name_1);\n          hasSelected = true;\n          break;\n        }\n      }\n      // Try select the first if selectedMode is single\n      !hasSelected && this.select(legendData[0].get('name'));\n    }\n  };\n  LegendModel.prototype._updateData = function (ecModel) {\n    var potentialData = [];\n    var availableNames = [];\n    ecModel.eachRawSeries(function (seriesModel) {\n      var seriesName = seriesModel.name;\n      availableNames.push(seriesName);\n      var isPotential;\n      if (seriesModel.legendVisualProvider) {\n        var provider = seriesModel.legendVisualProvider;\n        var names = provider.getAllNames();\n        if (!ecModel.isSeriesFiltered(seriesModel)) {\n          availableNames = availableNames.concat(names);\n        }\n        if (names.length) {\n          potentialData = potentialData.concat(names);\n        } else {\n          isPotential = true;\n        }\n      } else {\n        isPotential = true;\n      }\n      if (isPotential && isNameSpecified(seriesModel)) {\n        potentialData.push(seriesModel.name);\n      }\n    });\n    /**\n     * @type {Array.<string>}\n     * @private\n     */\n    this._availableNames = availableNames;\n    // If legend.data is not specified in option, use availableNames as data,\n    // which is convenient for user preparing option.\n    var rawData = this.get('data') || potentialData;\n    var legendNameMap = zrUtil.createHashMap();\n    var legendData = zrUtil.map(rawData, function (dataItem) {\n      // Can be string or number\n      if (zrUtil.isString(dataItem) || zrUtil.isNumber(dataItem)) {\n        dataItem = {\n          name: dataItem\n        };\n      }\n      if (legendNameMap.get(dataItem.name)) {\n        // remove legend name duplicate\n        return null;\n      }\n      legendNameMap.set(dataItem.name, true);\n      return new Model(dataItem, this, this.ecModel);\n    }, this);\n    /**\n     * @type {Array.<module:echarts/model/Model>}\n     * @private\n     */\n    this._data = zrUtil.filter(legendData, function (item) {\n      return !!item;\n    });\n  };\n  LegendModel.prototype.getData = function () {\n    return this._data;\n  };\n  LegendModel.prototype.select = function (name) {\n    var selected = this.option.selected;\n    var selectedMode = this.get('selectedMode');\n    if (selectedMode === 'single') {\n      var data = this._data;\n      zrUtil.each(data, function (dataItem) {\n        selected[dataItem.get('name')] = false;\n      });\n    }\n    selected[name] = true;\n  };\n  LegendModel.prototype.unSelect = function (name) {\n    if (this.get('selectedMode') !== 'single') {\n      this.option.selected[name] = false;\n    }\n  };\n  LegendModel.prototype.toggleSelected = function (name) {\n    var selected = this.option.selected;\n    // Default is true\n    if (!selected.hasOwnProperty(name)) {\n      selected[name] = true;\n    }\n    this[selected[name] ? 'unSelect' : 'select'](name);\n  };\n  LegendModel.prototype.allSelect = function () {\n    var data = this._data;\n    var selected = this.option.selected;\n    zrUtil.each(data, function (dataItem) {\n      selected[dataItem.get('name', true)] = true;\n    });\n  };\n  LegendModel.prototype.inverseSelect = function () {\n    var data = this._data;\n    var selected = this.option.selected;\n    zrUtil.each(data, function (dataItem) {\n      var name = dataItem.get('name', true);\n      // Initially, default value is true\n      if (!selected.hasOwnProperty(name)) {\n        selected[name] = true;\n      }\n      selected[name] = !selected[name];\n    });\n  };\n  LegendModel.prototype.isSelected = function (name) {\n    var selected = this.option.selected;\n    return !(selected.hasOwnProperty(name) && !selected[name]) && zrUtil.indexOf(this._availableNames, name) >= 0;\n  };\n  LegendModel.prototype.getOrient = function () {\n    return this.get('orient') === 'vertical' ? {\n      index: 1,\n      name: 'vertical'\n    } : {\n      index: 0,\n      name: 'horizontal'\n    };\n  };\n  LegendModel.type = 'legend.plain';\n  LegendModel.dependencies = ['series'];\n  LegendModel.defaultOption = {\n    // zlevel: 0,\n    z: 4,\n    show: true,\n    orient: 'horizontal',\n    left: 'center',\n    // right: 'center',\n    // top: 0,\n    bottom: tokens.size.m,\n    align: 'auto',\n    backgroundColor: tokens.color.transparent,\n    borderColor: tokens.color.border,\n    borderRadius: 0,\n    borderWidth: 0,\n    padding: 5,\n    itemGap: 8,\n    itemWidth: 25,\n    itemHeight: 14,\n    symbolRotate: 'inherit',\n    symbolKeepAspect: true,\n    inactiveColor: tokens.color.disabled,\n    inactiveBorderColor: tokens.color.disabled,\n    inactiveBorderWidth: 'auto',\n    itemStyle: {\n      color: 'inherit',\n      opacity: 'inherit',\n      borderColor: 'inherit',\n      borderWidth: 'auto',\n      borderCap: 'inherit',\n      borderJoin: 'inherit',\n      borderDashOffset: 'inherit',\n      borderMiterLimit: 'inherit'\n    },\n    lineStyle: {\n      width: 'auto',\n      color: 'inherit',\n      inactiveColor: tokens.color.disabled,\n      inactiveWidth: 2,\n      opacity: 'inherit',\n      type: 'inherit',\n      cap: 'inherit',\n      join: 'inherit',\n      dashOffset: 'inherit',\n      miterLimit: 'inherit'\n    },\n    textStyle: {\n      color: tokens.color.secondary\n    },\n    selectedMode: true,\n    selector: false,\n    selectorLabel: {\n      show: true,\n      borderRadius: 10,\n      padding: [3, 5, 3, 5],\n      fontSize: 12,\n      fontFamily: 'sans-serif',\n      color: tokens.color.tertiary,\n      borderWidth: 1,\n      borderColor: tokens.color.border\n    },\n    emphasis: {\n      selectorLabel: {\n        show: true,\n        color: tokens.color.quaternary\n      }\n    },\n    selectorPosition: 'auto',\n    selectorItemGap: 7,\n    selectorButtonGap: 10,\n    tooltip: {\n      show: false\n    },\n    triggerEvent: false\n  };\n  return LegendModel;\n}(ComponentModel);\nexport default LegendModel;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { parse, stringify } from 'zrender/lib/tool/color.js';\nimport * as graphic from '../../util/graphic.js';\nimport { enableHoverEmphasis } from '../../util/states.js';\nimport { setLabelStyle, createTextStyle } from '../../label/labelStyle.js';\nimport { makeBackground } from '../helper/listComponent.js';\nimport * as layoutUtil from '../../util/layout.js';\nimport ComponentView from '../../view/Component.js';\nimport { createSymbol } from '../../util/symbol.js';\nimport { createOrUpdatePatternFromDecal } from '../../util/decal.js';\nimport { getECData } from '../../util/innerStore.js';\nimport tokens from '../../visual/tokens.js';\nvar curry = zrUtil.curry;\nvar each = zrUtil.each;\nvar Group = graphic.Group;\nvar LegendView = /** @class */function (_super) {\n  __extends(LegendView, _super);\n  function LegendView() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = LegendView.type;\n    _this.newlineDisabled = false;\n    return _this;\n  }\n  LegendView.prototype.init = function () {\n    this.group.add(this._contentGroup = new Group());\n    this.group.add(this._selectorGroup = new Group());\n    this._isFirstRender = true;\n  };\n  /**\n   * @protected\n   */\n  LegendView.prototype.getContentGroup = function () {\n    return this._contentGroup;\n  };\n  /**\n   * @protected\n   */\n  LegendView.prototype.getSelectorGroup = function () {\n    return this._selectorGroup;\n  };\n  /**\n   * @override\n   */\n  LegendView.prototype.render = function (legendModel, ecModel, api) {\n    var isFirstRender = this._isFirstRender;\n    this._isFirstRender = false;\n    this.resetInner();\n    if (!legendModel.get('show', true)) {\n      return;\n    }\n    var itemAlign = legendModel.get('align');\n    var orient = legendModel.get('orient');\n    if (!itemAlign || itemAlign === 'auto') {\n      itemAlign = legendModel.get('left') === 'right' && orient === 'vertical' ? 'right' : 'left';\n    }\n    // selector has been normalized to an array in model\n    var selector = legendModel.get('selector', true);\n    var selectorPosition = legendModel.get('selectorPosition', true);\n    if (selector && (!selectorPosition || selectorPosition === 'auto')) {\n      selectorPosition = orient === 'horizontal' ? 'end' : 'start';\n    }\n    this.renderInner(itemAlign, legendModel, ecModel, api, selector, orient, selectorPosition);\n    // Perform layout.\n    var refContainer = layoutUtil.createBoxLayoutReference(legendModel, api).refContainer;\n    var positionInfo = legendModel.getBoxLayoutParams();\n    var padding = legendModel.get('padding');\n    var maxSize = layoutUtil.getLayoutRect(positionInfo, refContainer, padding);\n    var mainRect = this.layoutInner(legendModel, itemAlign, maxSize, isFirstRender, selector, selectorPosition);\n    // Place mainGroup, based on the calculated `mainRect`.\n    var layoutRect = layoutUtil.getLayoutRect(zrUtil.defaults({\n      width: mainRect.width,\n      height: mainRect.height\n    }, positionInfo), refContainer, padding);\n    this.group.x = layoutRect.x - mainRect.x;\n    this.group.y = layoutRect.y - mainRect.y;\n    this.group.markRedraw();\n    // Render background after group is layout.\n    this.group.add(this._backgroundEl = makeBackground(mainRect,\n    // FXIME: most itemStyle options does not work in background because inherit is not handled yet.\n    legendModel));\n  };\n  LegendView.prototype.resetInner = function () {\n    this.getContentGroup().removeAll();\n    this._backgroundEl && this.group.remove(this._backgroundEl);\n    this.getSelectorGroup().removeAll();\n  };\n  LegendView.prototype.renderInner = function (itemAlign, legendModel, ecModel, api, selector, orient, selectorPosition) {\n    var contentGroup = this.getContentGroup();\n    var legendDrawnMap = zrUtil.createHashMap();\n    var selectMode = legendModel.get('selectedMode');\n    var triggerEvent = legendModel.get('triggerEvent');\n    var excludeSeriesId = [];\n    ecModel.eachRawSeries(function (seriesModel) {\n      !seriesModel.get('legendHoverLink') && excludeSeriesId.push(seriesModel.id);\n    });\n    each(legendModel.getData(), function (legendItemModel, dataIndex) {\n      var _this = this;\n      var name = legendItemModel.get('name');\n      // Use empty string or \\n as a newline string\n      if (!this.newlineDisabled && (name === '' || name === '\\n')) {\n        var g = new Group();\n        // @ts-ignore\n        g.newline = true;\n        contentGroup.add(g);\n        return;\n      }\n      // Representitive series.\n      var seriesModel = ecModel.getSeriesByName(name)[0];\n      if (legendDrawnMap.get(name)) {\n        // Have been drawn\n        return;\n      }\n      // Legend to control series.\n      if (seriesModel) {\n        var data = seriesModel.getData();\n        var lineVisualStyle = data.getVisual('legendLineStyle') || {};\n        var legendIcon = data.getVisual('legendIcon');\n        /**\n         * `data.getVisual('style')` may be the color from the register\n         * in series. For example, for line series,\n         */\n        var style = data.getVisual('style');\n        var itemGroup = this._createItem(seriesModel, name, dataIndex, legendItemModel, legendModel, itemAlign, lineVisualStyle, style, legendIcon, selectMode, api);\n        itemGroup.on('click', curry(dispatchSelectAction, name, null, api, excludeSeriesId)).on('mouseover', curry(dispatchHighlightAction, seriesModel.name, null, api, excludeSeriesId)).on('mouseout', curry(dispatchDownplayAction, seriesModel.name, null, api, excludeSeriesId));\n        if (ecModel.ssr) {\n          itemGroup.eachChild(function (child) {\n            var ecData = getECData(child);\n            ecData.seriesIndex = seriesModel.seriesIndex;\n            ecData.dataIndex = dataIndex;\n            ecData.ssrType = 'legend';\n          });\n        }\n        if (triggerEvent) {\n          itemGroup.eachChild(function (child) {\n            _this.packEventData(child, legendModel, seriesModel, dataIndex, name);\n          });\n        }\n        legendDrawnMap.set(name, true);\n      } else {\n        // Legend to control data. In pie and funnel.\n        ecModel.eachRawSeries(function (seriesModel) {\n          var _this = this;\n          // In case multiple series has same data name\n          if (legendDrawnMap.get(name)) {\n            return;\n          }\n          if (seriesModel.legendVisualProvider) {\n            var provider = seriesModel.legendVisualProvider;\n            if (!provider.containName(name)) {\n              return;\n            }\n            var idx = provider.indexOfName(name);\n            var style = provider.getItemVisual(idx, 'style');\n            var legendIcon = provider.getItemVisual(idx, 'legendIcon');\n            var colorArr = parse(style.fill);\n            // Color may be set to transparent in visualMap when data is out of range.\n            // Do not show nothing.\n            if (colorArr && colorArr[3] === 0) {\n              colorArr[3] = 0.2;\n              // TODO color is set to 0, 0, 0, 0. Should show correct RGBA\n              style = zrUtil.extend(zrUtil.extend({}, style), {\n                fill: stringify(colorArr, 'rgba')\n              });\n            }\n            var itemGroup = this._createItem(seriesModel, name, dataIndex, legendItemModel, legendModel, itemAlign, {}, style, legendIcon, selectMode, api);\n            // FIXME: consider different series has items with the same name.\n            itemGroup.on('click', curry(dispatchSelectAction, null, name, api, excludeSeriesId))\n            // Should not specify the series name, consider legend controls\n            // more than one pie series.\n            .on('mouseover', curry(dispatchHighlightAction, null, name, api, excludeSeriesId)).on('mouseout', curry(dispatchDownplayAction, null, name, api, excludeSeriesId));\n            if (ecModel.ssr) {\n              itemGroup.eachChild(function (child) {\n                var ecData = getECData(child);\n                ecData.seriesIndex = seriesModel.seriesIndex;\n                ecData.dataIndex = dataIndex;\n                ecData.ssrType = 'legend';\n              });\n            }\n            if (triggerEvent) {\n              itemGroup.eachChild(function (child) {\n                _this.packEventData(child, legendModel, seriesModel, dataIndex, name);\n              });\n            }\n            legendDrawnMap.set(name, true);\n          }\n        }, this);\n      }\n      if (process.env.NODE_ENV !== 'production') {\n        if (!legendDrawnMap.get(name)) {\n          console.warn(name + ' series not exists. Legend data should be same with series name or data name.');\n        }\n      }\n    }, this);\n    if (selector) {\n      this._createSelector(selector, legendModel, api, orient, selectorPosition);\n    }\n  };\n  LegendView.prototype.packEventData = function (el, legendModel, seriesModel, dataIndex, name) {\n    var eventData = {\n      componentType: 'legend',\n      componentIndex: legendModel.componentIndex,\n      dataIndex: dataIndex,\n      value: name,\n      seriesIndex: seriesModel.seriesIndex\n    };\n    getECData(el).eventData = eventData;\n  };\n  ;\n  LegendView.prototype._createSelector = function (selector, legendModel, api, orient, selectorPosition) {\n    var selectorGroup = this.getSelectorGroup();\n    each(selector, function createSelectorButton(selectorItem) {\n      var type = selectorItem.type;\n      var labelText = new graphic.Text({\n        style: {\n          x: 0,\n          y: 0,\n          align: 'center',\n          verticalAlign: 'middle'\n        },\n        onclick: function () {\n          api.dispatchAction({\n            type: type === 'all' ? 'legendAllSelect' : 'legendInverseSelect',\n            legendId: legendModel.id\n          });\n        }\n      });\n      selectorGroup.add(labelText);\n      var labelModel = legendModel.getModel('selectorLabel');\n      var emphasisLabelModel = legendModel.getModel(['emphasis', 'selectorLabel']);\n      setLabelStyle(labelText, {\n        normal: labelModel,\n        emphasis: emphasisLabelModel\n      }, {\n        defaultText: selectorItem.title\n      });\n      enableHoverEmphasis(labelText);\n    });\n  };\n  LegendView.prototype._createItem = function (seriesModel, name, dataIndex, legendItemModel, legendModel, itemAlign, lineVisualStyle, itemVisualStyle, legendIcon, selectMode, api) {\n    var drawType = seriesModel.visualDrawType;\n    var itemWidth = legendModel.get('itemWidth');\n    var itemHeight = legendModel.get('itemHeight');\n    var isSelected = legendModel.isSelected(name);\n    var iconRotate = legendItemModel.get('symbolRotate');\n    var symbolKeepAspect = legendItemModel.get('symbolKeepAspect');\n    var legendIconType = legendItemModel.get('icon');\n    legendIcon = legendIconType || legendIcon || 'roundRect';\n    var style = getLegendStyle(legendIcon, legendItemModel, lineVisualStyle, itemVisualStyle, drawType, isSelected, api);\n    var itemGroup = new Group();\n    var textStyleModel = legendItemModel.getModel('textStyle');\n    if (zrUtil.isFunction(seriesModel.getLegendIcon) && (!legendIconType || legendIconType === 'inherit')) {\n      // Series has specific way to define legend icon\n      itemGroup.add(seriesModel.getLegendIcon({\n        itemWidth: itemWidth,\n        itemHeight: itemHeight,\n        icon: legendIcon,\n        iconRotate: iconRotate,\n        itemStyle: style.itemStyle,\n        lineStyle: style.lineStyle,\n        symbolKeepAspect: symbolKeepAspect\n      }));\n    } else {\n      // Use default legend icon policy for most series\n      var rotate = legendIconType === 'inherit' && seriesModel.getData().getVisual('symbol') ? iconRotate === 'inherit' ? seriesModel.getData().getVisual('symbolRotate') : iconRotate : 0; // No rotation for no icon\n      itemGroup.add(getDefaultLegendIcon({\n        itemWidth: itemWidth,\n        itemHeight: itemHeight,\n        icon: legendIcon,\n        iconRotate: rotate,\n        itemStyle: style.itemStyle,\n        lineStyle: style.lineStyle,\n        symbolKeepAspect: symbolKeepAspect\n      }));\n    }\n    var textX = itemAlign === 'left' ? itemWidth + 5 : -5;\n    var textAlign = itemAlign;\n    var formatter = legendModel.get('formatter');\n    var content = name;\n    if (zrUtil.isString(formatter) && formatter) {\n      content = formatter.replace('{name}', name != null ? name : '');\n    } else if (zrUtil.isFunction(formatter)) {\n      content = formatter(name);\n    }\n    var textColor = isSelected ? textStyleModel.getTextColor() : legendItemModel.get('inactiveColor');\n    itemGroup.add(new graphic.Text({\n      style: createTextStyle(textStyleModel, {\n        text: content,\n        x: textX,\n        y: itemHeight / 2,\n        fill: textColor,\n        align: textAlign,\n        verticalAlign: 'middle'\n      }, {\n        inheritColor: textColor\n      })\n    }));\n    // Add a invisible rect to increase the area of mouse hover\n    var hitRect = new graphic.Rect({\n      shape: itemGroup.getBoundingRect(),\n      style: {\n        // Cannot use 'invisible' because SVG SSR will miss the node\n        fill: 'transparent'\n      }\n    });\n    var tooltipModel = legendItemModel.getModel('tooltip');\n    if (tooltipModel.get('show')) {\n      graphic.setTooltipConfig({\n        el: hitRect,\n        componentModel: legendModel,\n        itemName: name,\n        itemTooltipOption: tooltipModel.option\n      });\n    }\n    itemGroup.add(hitRect);\n    itemGroup.eachChild(function (child) {\n      child.silent = true;\n    });\n    hitRect.silent = !selectMode;\n    this.getContentGroup().add(itemGroup);\n    enableHoverEmphasis(itemGroup);\n    // @ts-ignore\n    itemGroup.__legendDataIndex = dataIndex;\n    return itemGroup;\n  };\n  LegendView.prototype.layoutInner = function (legendModel, itemAlign, maxSize, isFirstRender, selector, selectorPosition) {\n    var contentGroup = this.getContentGroup();\n    var selectorGroup = this.getSelectorGroup();\n    // Place items in contentGroup.\n    layoutUtil.box(legendModel.get('orient'), contentGroup, legendModel.get('itemGap'), maxSize.width, maxSize.height);\n    var contentRect = contentGroup.getBoundingRect();\n    var contentPos = [-contentRect.x, -contentRect.y];\n    selectorGroup.markRedraw();\n    contentGroup.markRedraw();\n    if (selector) {\n      // Place buttons in selectorGroup\n      layoutUtil.box(\n      // Buttons in selectorGroup always layout horizontally\n      'horizontal', selectorGroup, legendModel.get('selectorItemGap', true));\n      var selectorRect = selectorGroup.getBoundingRect();\n      var selectorPos = [-selectorRect.x, -selectorRect.y];\n      var selectorButtonGap = legendModel.get('selectorButtonGap', true);\n      var orientIdx = legendModel.getOrient().index;\n      var wh = orientIdx === 0 ? 'width' : 'height';\n      var hw = orientIdx === 0 ? 'height' : 'width';\n      var yx = orientIdx === 0 ? 'y' : 'x';\n      if (selectorPosition === 'end') {\n        selectorPos[orientIdx] += contentRect[wh] + selectorButtonGap;\n      } else {\n        contentPos[orientIdx] += selectorRect[wh] + selectorButtonGap;\n      }\n      // Always align selector to content as 'middle'\n      selectorPos[1 - orientIdx] += contentRect[hw] / 2 - selectorRect[hw] / 2;\n      selectorGroup.x = selectorPos[0];\n      selectorGroup.y = selectorPos[1];\n      contentGroup.x = contentPos[0];\n      contentGroup.y = contentPos[1];\n      var mainRect = {\n        x: 0,\n        y: 0\n      };\n      mainRect[wh] = contentRect[wh] + selectorButtonGap + selectorRect[wh];\n      mainRect[hw] = Math.max(contentRect[hw], selectorRect[hw]);\n      mainRect[yx] = Math.min(0, selectorRect[yx] + selectorPos[1 - orientIdx]);\n      return mainRect;\n    } else {\n      contentGroup.x = contentPos[0];\n      contentGroup.y = contentPos[1];\n      return this.group.getBoundingRect();\n    }\n  };\n  /**\n   * @protected\n   */\n  LegendView.prototype.remove = function () {\n    this.getContentGroup().removeAll();\n    this._isFirstRender = true;\n  };\n  LegendView.type = 'legend.plain';\n  return LegendView;\n}(ComponentView);\nfunction getLegendStyle(iconType, legendItemModel, lineVisualStyle, itemVisualStyle, drawType, isSelected, api) {\n  /**\n   * Use series style if is inherit;\n   * elsewise, use legend style\n   */\n  function handleCommonProps(style, visualStyle) {\n    // If lineStyle.width is 'auto', it is set to be 2 if series has border\n    if (style.lineWidth === 'auto') {\n      style.lineWidth = visualStyle.lineWidth > 0 ? 2 : 0;\n    }\n    each(style, function (propVal, propName) {\n      style[propName] === 'inherit' && (style[propName] = visualStyle[propName]);\n    });\n  }\n  // itemStyle\n  var itemStyleModel = legendItemModel.getModel('itemStyle');\n  var itemStyle = itemStyleModel.getItemStyle();\n  var iconBrushType = iconType.lastIndexOf('empty', 0) === 0 ? 'fill' : 'stroke';\n  var decalStyle = itemStyleModel.getShallow('decal');\n  itemStyle.decal = !decalStyle || decalStyle === 'inherit' ? itemVisualStyle.decal : createOrUpdatePatternFromDecal(decalStyle, api);\n  if (itemStyle.fill === 'inherit') {\n    /**\n     * Series with visualDrawType as 'stroke' should have\n     * series stroke as legend fill\n     */\n    itemStyle.fill = itemVisualStyle[drawType];\n  }\n  if (itemStyle.stroke === 'inherit') {\n    /**\n     * icon type with \"emptyXXX\" should use fill color\n     * in visual style\n     */\n    itemStyle.stroke = itemVisualStyle[iconBrushType];\n  }\n  if (itemStyle.opacity === 'inherit') {\n    /**\n     * Use lineStyle.opacity if drawType is stroke\n     */\n    itemStyle.opacity = (drawType === 'fill' ? itemVisualStyle : lineVisualStyle).opacity;\n  }\n  handleCommonProps(itemStyle, itemVisualStyle);\n  // lineStyle\n  var legendLineModel = legendItemModel.getModel('lineStyle');\n  var lineStyle = legendLineModel.getLineStyle();\n  handleCommonProps(lineStyle, lineVisualStyle);\n  // Fix auto color to real color\n  itemStyle.fill === 'auto' && (itemStyle.fill = itemVisualStyle.fill);\n  itemStyle.stroke === 'auto' && (itemStyle.stroke = itemVisualStyle.fill);\n  lineStyle.stroke === 'auto' && (lineStyle.stroke = itemVisualStyle.fill);\n  if (!isSelected) {\n    var borderWidth = legendItemModel.get('inactiveBorderWidth');\n    /**\n     * Since stroke is set to be inactiveBorderColor, it may occur that\n     * there is no border in series but border in legend, so we need to\n     * use border only when series has border if is set to be auto\n     */\n    var visualHasBorder = itemStyle[iconBrushType];\n    itemStyle.lineWidth = borderWidth === 'auto' ? itemVisualStyle.lineWidth > 0 && visualHasBorder ? 2 : 0 : itemStyle.lineWidth;\n    itemStyle.fill = legendItemModel.get('inactiveColor');\n    itemStyle.stroke = legendItemModel.get('inactiveBorderColor');\n    lineStyle.stroke = legendLineModel.get('inactiveColor');\n    lineStyle.lineWidth = legendLineModel.get('inactiveWidth');\n  }\n  return {\n    itemStyle: itemStyle,\n    lineStyle: lineStyle\n  };\n}\nfunction getDefaultLegendIcon(opt) {\n  var symboType = opt.icon || 'roundRect';\n  var icon = createSymbol(symboType, 0, 0, opt.itemWidth, opt.itemHeight, opt.itemStyle.fill, opt.symbolKeepAspect);\n  icon.setStyle(opt.itemStyle);\n  icon.rotation = (opt.iconRotate || 0) * Math.PI / 180;\n  icon.setOrigin([opt.itemWidth / 2, opt.itemHeight / 2]);\n  if (symboType.indexOf('empty') > -1) {\n    icon.style.stroke = icon.style.fill;\n    icon.style.fill = tokens.color.neutral00;\n    icon.style.lineWidth = 2;\n  }\n  return icon;\n}\nfunction dispatchSelectAction(seriesName, dataName, api, excludeSeriesId) {\n  // downplay before unselect\n  dispatchDownplayAction(seriesName, dataName, api, excludeSeriesId);\n  api.dispatchAction({\n    type: 'legendToggleSelect',\n    name: seriesName != null ? seriesName : dataName\n  });\n  // highlight after select\n  // TODO highlight immediately may cause animation loss.\n  dispatchHighlightAction(seriesName, dataName, api, excludeSeriesId);\n}\nfunction isUseHoverLayer(api) {\n  var list = api.getZr().storage.getDisplayList();\n  var emphasisState;\n  var i = 0;\n  var len = list.length;\n  while (i < len && !(emphasisState = list[i].states.emphasis)) {\n    i++;\n  }\n  return emphasisState && emphasisState.hoverLayer;\n}\nfunction dispatchHighlightAction(seriesName, dataName, api, excludeSeriesId) {\n  // If element hover will move to a hoverLayer.\n  if (!isUseHoverLayer(api)) {\n    api.dispatchAction({\n      type: 'highlight',\n      seriesName: seriesName,\n      name: dataName,\n      excludeSeriesId: excludeSeriesId\n    });\n  }\n}\nfunction dispatchDownplayAction(seriesName, dataName, api, excludeSeriesId) {\n  // If element hover will move to a hoverLayer.\n  if (!isUseHoverLayer(api)) {\n    api.dispatchAction({\n      type: 'downplay',\n      seriesName: seriesName,\n      name: dataName,\n      excludeSeriesId: excludeSeriesId\n    });\n  }\n}\nexport default LegendView;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nexport default function legendFilter(ecModel) {\n  var legendModels = ecModel.findComponents({\n    mainType: 'legend'\n  });\n  if (legendModels && legendModels.length) {\n    ecModel.filterSeries(function (series) {\n      // If in any legend component the status is not selected.\n      // Because in legend series is assumed selected when it is not in the legend data.\n      for (var i = 0; i < legendModels.length; i++) {\n        if (!legendModels[i].isSelected(series.name)) {\n          return false;\n        }\n      }\n      return true;\n    });\n  }\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { curry, each, hasOwn } from 'zrender/lib/core/util.js';\nfunction legendSelectActionHandler(methodName, payload, ecModel) {\n  var isAllSelect = methodName === 'allSelect' || methodName === 'inverseSelect';\n  var selectedMap = {};\n  var actionLegendIndices = [];\n  ecModel.eachComponent({\n    mainType: 'legend',\n    query: payload\n  }, function (legendModel) {\n    if (isAllSelect) {\n      legendModel[methodName]();\n    } else {\n      legendModel[methodName](payload.name);\n    }\n    makeSelectedMap(legendModel, selectedMap);\n    actionLegendIndices.push(legendModel.componentIndex);\n  });\n  var allSelectedMap = {};\n  // make selectedMap from all legend components\n  ecModel.eachComponent('legend', function (legendModel) {\n    each(selectedMap, function (isSelected, name) {\n      // Force other legend has same selected status\n      // Or the first is toggled to true and other are toggled to false\n      // In the case one legend has some item unSelected in option. And if other legend\n      // doesn't has the item, they will assume it is selected.\n      legendModel[isSelected ? 'select' : 'unSelect'](name);\n    });\n    makeSelectedMap(legendModel, allSelectedMap);\n  });\n  // Return the event explicitly\n  return isAllSelect ? {\n    selected: allSelectedMap,\n    // return legendIndex array to tell the developers which legends are allSelect / inverseSelect\n    legendIndex: actionLegendIndices\n  } : {\n    name: payload.name,\n    selected: allSelectedMap\n  };\n}\nfunction makeSelectedMap(legendModel, out) {\n  var selectedMap = out || {};\n  each(legendModel.getData(), function (model) {\n    var name = model.get('name');\n    // Wrap element\n    if (name === '\\n' || name === '') {\n      return;\n    }\n    var isItemSelected = legendModel.isSelected(name);\n    if (hasOwn(selectedMap, name)) {\n      // Unselected if any legend is unselected\n      selectedMap[name] = selectedMap[name] && isItemSelected;\n    } else {\n      selectedMap[name] = isItemSelected;\n    }\n  });\n  return selectedMap;\n}\nexport function installLegendAction(registers) {\n  /**\n   * @event legendToggleSelect\n   * @type {Object}\n   * @property {string} type 'legendToggleSelect'\n   * @property {string} [from]\n   * @property {string} name Series name or data item name\n   */\n  registers.registerAction('legendToggleSelect', 'legendselectchanged', curry(legendSelectActionHandler, 'toggleSelected'));\n  registers.registerAction('legendAllSelect', 'legendselectall', curry(legendSelectActionHandler, 'allSelect'));\n  registers.registerAction('legendInverseSelect', 'legendinverseselect', curry(legendSelectActionHandler, 'inverseSelect'));\n  /**\n   * @event legendSelect\n   * @type {Object}\n   * @property {string} type 'legendSelect'\n   * @property {string} name Series name or data item name\n   */\n  registers.registerAction('legendSelect', 'legendselected', curry(legendSelectActionHandler, 'select'));\n  /**\n   * @event legendUnSelect\n   * @type {Object}\n   * @property {string} type 'legendUnSelect'\n   * @property {string} name Series name or data item name\n   */\n  registers.registerAction('legendUnSelect', 'legendunselected', curry(legendSelectActionHandler, 'unSelect'));\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport LegendModel from './LegendModel.js';\nimport LegendView from './LegendView.js';\nimport legendFilter from './legendFilter.js';\nimport { installLegendAction } from './legendAction.js';\nexport function install(registers) {\n  registers.registerComponentModel(LegendModel);\n  registers.registerComponentView(LegendView);\n  registers.registerProcessor(registers.PRIORITY.PROCESSOR.SERIES_FILTER, legendFilter);\n  registers.registerSubTypeDefaulter('legend', function () {\n    return 'plain';\n  });\n  installLegendAction(registers);\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport LegendModel from './LegendModel.js';\nimport { mergeLayoutParam, getLayoutParams } from '../../util/layout.js';\nimport { inheritDefaultOption } from '../../util/component.js';\nimport tokens from '../../visual/tokens.js';\nvar ScrollableLegendModel = /** @class */function (_super) {\n  __extends(ScrollableLegendModel, _super);\n  function ScrollableLegendModel() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = ScrollableLegendModel.type;\n    return _this;\n  }\n  /**\n   * @param {number} scrollDataIndex\n   */\n  ScrollableLegendModel.prototype.setScrollDataIndex = function (scrollDataIndex) {\n    this.option.scrollDataIndex = scrollDataIndex;\n  };\n  ScrollableLegendModel.prototype.init = function (option, parentModel, ecModel) {\n    var inputPositionParams = getLayoutParams(option);\n    _super.prototype.init.call(this, option, parentModel, ecModel);\n    mergeAndNormalizeLayoutParams(this, option, inputPositionParams);\n  };\n  /**\n   * @override\n   */\n  ScrollableLegendModel.prototype.mergeOption = function (option, ecModel) {\n    _super.prototype.mergeOption.call(this, option, ecModel);\n    mergeAndNormalizeLayoutParams(this, this.option, option);\n  };\n  ScrollableLegendModel.type = 'legend.scroll';\n  ScrollableLegendModel.defaultOption = inheritDefaultOption(LegendModel.defaultOption, {\n    scrollDataIndex: 0,\n    pageButtonItemGap: 5,\n    pageButtonGap: null,\n    pageButtonPosition: 'end',\n    pageFormatter: '{current}/{total}',\n    pageIcons: {\n      horizontal: ['M0,0L12,-10L12,10z', 'M0,0L-12,-10L-12,10z'],\n      vertical: ['M0,0L20,0L10,-20z', 'M0,0L20,0L10,20z']\n    },\n    pageIconColor: tokens.color.accent50,\n    pageIconInactiveColor: tokens.color.accent10,\n    pageIconSize: 15,\n    pageTextStyle: {\n      color: tokens.color.tertiary\n    },\n    animationDurationUpdate: 800\n  });\n  return ScrollableLegendModel;\n}(LegendModel);\n;\n// Do not `ignoreSize` to enable setting {left: 10, right: 10}.\nfunction mergeAndNormalizeLayoutParams(legendModel, target, raw) {\n  var orient = legendModel.getOrient();\n  var ignoreSize = [1, 1];\n  ignoreSize[orient.index] = 0;\n  mergeLayoutParam(target, raw, {\n    type: 'box',\n    ignoreSize: !!ignoreSize\n  });\n}\nexport default ScrollableLegendModel;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\n/**\n * Separate legend and scrollable legend to reduce package size.\n */\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as graphic from '../../util/graphic.js';\nimport * as layoutUtil from '../../util/layout.js';\nimport LegendView from './LegendView.js';\nvar Group = graphic.Group;\nvar WH = ['width', 'height'];\nvar XY = ['x', 'y'];\nvar ScrollableLegendView = /** @class */function (_super) {\n  __extends(ScrollableLegendView, _super);\n  function ScrollableLegendView() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = ScrollableLegendView.type;\n    _this.newlineDisabled = true;\n    _this._currentIndex = 0;\n    return _this;\n  }\n  ScrollableLegendView.prototype.init = function () {\n    _super.prototype.init.call(this);\n    this.group.add(this._containerGroup = new Group());\n    this._containerGroup.add(this.getContentGroup());\n    this.group.add(this._controllerGroup = new Group());\n  };\n  /**\n   * @override\n   */\n  ScrollableLegendView.prototype.resetInner = function () {\n    _super.prototype.resetInner.call(this);\n    this._controllerGroup.removeAll();\n    this._containerGroup.removeClipPath();\n    this._containerGroup.__rectSize = null;\n  };\n  /**\n   * @override\n   */\n  ScrollableLegendView.prototype.renderInner = function (itemAlign, legendModel, ecModel, api, selector, orient, selectorPosition) {\n    var self = this;\n    // Render content items.\n    _super.prototype.renderInner.call(this, itemAlign, legendModel, ecModel, api, selector, orient, selectorPosition);\n    var controllerGroup = this._controllerGroup;\n    // FIXME: support be 'auto' adapt to size number text length,\n    // e.g., '3/12345' should not overlap with the control arrow button.\n    var pageIconSize = legendModel.get('pageIconSize', true);\n    var pageIconSizeArr = zrUtil.isArray(pageIconSize) ? pageIconSize : [pageIconSize, pageIconSize];\n    createPageButton('pagePrev', 0);\n    var pageTextStyleModel = legendModel.getModel('pageTextStyle');\n    controllerGroup.add(new graphic.Text({\n      name: 'pageText',\n      style: {\n        // Placeholder to calculate a proper layout.\n        text: 'xx/xx',\n        fill: pageTextStyleModel.getTextColor(),\n        font: pageTextStyleModel.getFont(),\n        verticalAlign: 'middle',\n        align: 'center'\n      },\n      silent: true\n    }));\n    createPageButton('pageNext', 1);\n    function createPageButton(name, iconIdx) {\n      var pageDataIndexName = name + 'DataIndex';\n      var icon = graphic.createIcon(legendModel.get('pageIcons', true)[legendModel.getOrient().name][iconIdx], {\n        // Buttons will be created in each render, so we do not need\n        // to worry about avoiding using legendModel kept in scope.\n        onclick: zrUtil.bind(self._pageGo, self, pageDataIndexName, legendModel, api)\n      }, {\n        x: -pageIconSizeArr[0] / 2,\n        y: -pageIconSizeArr[1] / 2,\n        width: pageIconSizeArr[0],\n        height: pageIconSizeArr[1]\n      });\n      icon.name = name;\n      controllerGroup.add(icon);\n    }\n  };\n  /**\n   * @override\n   */\n  ScrollableLegendView.prototype.layoutInner = function (legendModel, itemAlign, maxSize, isFirstRender, selector, selectorPosition) {\n    var selectorGroup = this.getSelectorGroup();\n    var orientIdx = legendModel.getOrient().index;\n    var wh = WH[orientIdx];\n    var xy = XY[orientIdx];\n    var hw = WH[1 - orientIdx];\n    var yx = XY[1 - orientIdx];\n    selector && layoutUtil.box(\n    // Buttons in selectorGroup always layout horizontally\n    'horizontal', selectorGroup, legendModel.get('selectorItemGap', true));\n    var selectorButtonGap = legendModel.get('selectorButtonGap', true);\n    var selectorRect = selectorGroup.getBoundingRect();\n    var selectorPos = [-selectorRect.x, -selectorRect.y];\n    var processMaxSize = zrUtil.clone(maxSize);\n    selector && (processMaxSize[wh] = maxSize[wh] - selectorRect[wh] - selectorButtonGap);\n    var mainRect = this._layoutContentAndController(legendModel, isFirstRender, processMaxSize, orientIdx, wh, hw, yx, xy);\n    if (selector) {\n      if (selectorPosition === 'end') {\n        selectorPos[orientIdx] += mainRect[wh] + selectorButtonGap;\n      } else {\n        var offset = selectorRect[wh] + selectorButtonGap;\n        selectorPos[orientIdx] -= offset;\n        mainRect[xy] -= offset;\n      }\n      mainRect[wh] += selectorRect[wh] + selectorButtonGap;\n      selectorPos[1 - orientIdx] += mainRect[yx] + mainRect[hw] / 2 - selectorRect[hw] / 2;\n      mainRect[hw] = Math.max(mainRect[hw], selectorRect[hw]);\n      mainRect[yx] = Math.min(mainRect[yx], selectorRect[yx] + selectorPos[1 - orientIdx]);\n      selectorGroup.x = selectorPos[0];\n      selectorGroup.y = selectorPos[1];\n      selectorGroup.markRedraw();\n    }\n    return mainRect;\n  };\n  ScrollableLegendView.prototype._layoutContentAndController = function (legendModel, isFirstRender, maxSize, orientIdx, wh, hw, yx, xy) {\n    var contentGroup = this.getContentGroup();\n    var containerGroup = this._containerGroup;\n    var controllerGroup = this._controllerGroup;\n    // Place items in contentGroup.\n    layoutUtil.box(legendModel.get('orient'), contentGroup, legendModel.get('itemGap'), !orientIdx ? null : maxSize.width, orientIdx ? null : maxSize.height);\n    layoutUtil.box(\n    // Buttons in controller are layout always horizontally.\n    'horizontal', controllerGroup, legendModel.get('pageButtonItemGap', true));\n    var contentRect = contentGroup.getBoundingRect();\n    var controllerRect = controllerGroup.getBoundingRect();\n    var showController = this._showController = contentRect[wh] > maxSize[wh];\n    // In case that the inner elements of contentGroup layout do not based on [0, 0]\n    var contentPos = [-contentRect.x, -contentRect.y];\n    // Remain contentPos when scroll animation perfroming.\n    // If first rendering, `contentGroup.position` is [0, 0], which\n    // does not make sense and may cause unexepcted animation if adopted.\n    if (!isFirstRender) {\n      contentPos[orientIdx] = contentGroup[xy];\n    }\n    // Layout container group based on 0.\n    var containerPos = [0, 0];\n    var controllerPos = [-controllerRect.x, -controllerRect.y];\n    var pageButtonGap = zrUtil.retrieve2(legendModel.get('pageButtonGap', true), legendModel.get('itemGap', true));\n    // Place containerGroup and controllerGroup and contentGroup.\n    if (showController) {\n      var pageButtonPosition = legendModel.get('pageButtonPosition', true);\n      // controller is on the right / bottom.\n      if (pageButtonPosition === 'end') {\n        controllerPos[orientIdx] += maxSize[wh] - controllerRect[wh];\n      }\n      // controller is on the left / top.\n      else {\n        containerPos[orientIdx] += controllerRect[wh] + pageButtonGap;\n      }\n    }\n    // Always align controller to content as 'middle'.\n    controllerPos[1 - orientIdx] += contentRect[hw] / 2 - controllerRect[hw] / 2;\n    contentGroup.setPosition(contentPos);\n    containerGroup.setPosition(containerPos);\n    controllerGroup.setPosition(controllerPos);\n    // Calculate `mainRect` and set `clipPath`.\n    // mainRect should not be calculated by `this.group.getBoundingRect()`\n    // for sake of the overflow.\n    var mainRect = {\n      x: 0,\n      y: 0\n    };\n    // Consider content may be overflow (should be clipped).\n    mainRect[wh] = showController ? maxSize[wh] : contentRect[wh];\n    mainRect[hw] = Math.max(contentRect[hw], controllerRect[hw]);\n    // `containerRect[yx] + containerPos[1 - orientIdx]` is 0.\n    mainRect[yx] = Math.min(0, controllerRect[yx] + controllerPos[1 - orientIdx]);\n    containerGroup.__rectSize = maxSize[wh];\n    if (showController) {\n      var clipShape = {\n        x: 0,\n        y: 0\n      };\n      clipShape[wh] = Math.max(maxSize[wh] - controllerRect[wh] - pageButtonGap, 0);\n      clipShape[hw] = mainRect[hw];\n      containerGroup.setClipPath(new graphic.Rect({\n        shape: clipShape\n      }));\n      // Consider content may be larger than container, container rect\n      // can not be obtained from `containerGroup.getBoundingRect()`.\n      containerGroup.__rectSize = clipShape[wh];\n    } else {\n      // Do not remove or ignore controller. Keep them set as placeholders.\n      controllerGroup.eachChild(function (child) {\n        child.attr({\n          invisible: true,\n          silent: true\n        });\n      });\n    }\n    // Content translate animation.\n    var pageInfo = this._getPageInfo(legendModel);\n    pageInfo.pageIndex != null && graphic.updateProps(contentGroup, {\n      x: pageInfo.contentPosition[0],\n      y: pageInfo.contentPosition[1]\n    },\n    // When switch from \"show controller\" to \"not show controller\", view should be\n    // updated immediately without animation, otherwise causes weird effect.\n    showController ? legendModel : null);\n    this._updatePageInfoView(legendModel, pageInfo);\n    return mainRect;\n  };\n  ScrollableLegendView.prototype._pageGo = function (to, legendModel, api) {\n    var scrollDataIndex = this._getPageInfo(legendModel)[to];\n    scrollDataIndex != null && api.dispatchAction({\n      type: 'legendScroll',\n      scrollDataIndex: scrollDataIndex,\n      legendId: legendModel.id\n    });\n  };\n  ScrollableLegendView.prototype._updatePageInfoView = function (legendModel, pageInfo) {\n    var controllerGroup = this._controllerGroup;\n    zrUtil.each(['pagePrev', 'pageNext'], function (name) {\n      var key = name + 'DataIndex';\n      var canJump = pageInfo[key] != null;\n      var icon = controllerGroup.childOfName(name);\n      if (icon) {\n        icon.setStyle('fill', canJump ? legendModel.get('pageIconColor', true) : legendModel.get('pageIconInactiveColor', true));\n        icon.cursor = canJump ? 'pointer' : 'default';\n      }\n    });\n    var pageText = controllerGroup.childOfName('pageText');\n    var pageFormatter = legendModel.get('pageFormatter');\n    var pageIndex = pageInfo.pageIndex;\n    var current = pageIndex != null ? pageIndex + 1 : 0;\n    var total = pageInfo.pageCount;\n    pageText && pageFormatter && pageText.setStyle('text', zrUtil.isString(pageFormatter) ? pageFormatter.replace('{current}', current == null ? '' : current + '').replace('{total}', total == null ? '' : total + '') : pageFormatter({\n      current: current,\n      total: total\n    }));\n  };\n  /**\n   *  contentPosition: Array.<number>, null when data item not found.\n   *  pageIndex: number, null when data item not found.\n   *  pageCount: number, always be a number, can be 0.\n   *  pagePrevDataIndex: number, null when no previous page.\n   *  pageNextDataIndex: number, null when no next page.\n   * }\n   */\n  ScrollableLegendView.prototype._getPageInfo = function (legendModel) {\n    var scrollDataIndex = legendModel.get('scrollDataIndex', true);\n    var contentGroup = this.getContentGroup();\n    var containerRectSize = this._containerGroup.__rectSize;\n    var orientIdx = legendModel.getOrient().index;\n    var wh = WH[orientIdx];\n    var xy = XY[orientIdx];\n    var targetItemIndex = this._findTargetItemIndex(scrollDataIndex);\n    var children = contentGroup.children();\n    var targetItem = children[targetItemIndex];\n    var itemCount = children.length;\n    var pCount = !itemCount ? 0 : 1;\n    var result = {\n      contentPosition: [contentGroup.x, contentGroup.y],\n      pageCount: pCount,\n      pageIndex: pCount - 1,\n      pagePrevDataIndex: null,\n      pageNextDataIndex: null\n    };\n    if (!targetItem) {\n      return result;\n    }\n    var targetItemInfo = getItemInfo(targetItem);\n    result.contentPosition[orientIdx] = -targetItemInfo.s;\n    // Strategy:\n    // (1) Always align based on the left/top most item.\n    // (2) It is user-friendly that the last item shown in the\n    // current window is shown at the begining of next window.\n    // Otherwise if half of the last item is cut by the window,\n    // it will have no chance to display entirely.\n    // (3) Consider that item size probably be different, we\n    // have calculate pageIndex by size rather than item index,\n    // and we can not get page index directly by division.\n    // (4) The window is to narrow to contain more than\n    // one item, we should make sure that the page can be fliped.\n    for (var i = targetItemIndex + 1, winStartItemInfo = targetItemInfo, winEndItemInfo = targetItemInfo, currItemInfo = null; i <= itemCount; ++i) {\n      currItemInfo = getItemInfo(children[i]);\n      if (\n      // Half of the last item is out of the window.\n      !currItemInfo && winEndItemInfo.e > winStartItemInfo.s + containerRectSize\n      // If the current item does not intersect with the window, the new page\n      // can be started at the current item or the last item.\n      || currItemInfo && !intersect(currItemInfo, winStartItemInfo.s)) {\n        if (winEndItemInfo.i > winStartItemInfo.i) {\n          winStartItemInfo = winEndItemInfo;\n        } else {\n          // e.g., when page size is smaller than item size.\n          winStartItemInfo = currItemInfo;\n        }\n        if (winStartItemInfo) {\n          if (result.pageNextDataIndex == null) {\n            result.pageNextDataIndex = winStartItemInfo.i;\n          }\n          ++result.pageCount;\n        }\n      }\n      winEndItemInfo = currItemInfo;\n    }\n    for (var i = targetItemIndex - 1, winStartItemInfo = targetItemInfo, winEndItemInfo = targetItemInfo, currItemInfo = null; i >= -1; --i) {\n      currItemInfo = getItemInfo(children[i]);\n      if (\n      // If the the end item does not intersect with the window started\n      // from the current item, a page can be settled.\n      (!currItemInfo || !intersect(winEndItemInfo, currItemInfo.s)\n      // e.g., when page size is smaller than item size.\n      ) && winStartItemInfo.i < winEndItemInfo.i) {\n        winEndItemInfo = winStartItemInfo;\n        if (result.pagePrevDataIndex == null) {\n          result.pagePrevDataIndex = winStartItemInfo.i;\n        }\n        ++result.pageCount;\n        ++result.pageIndex;\n      }\n      winStartItemInfo = currItemInfo;\n    }\n    return result;\n    function getItemInfo(el) {\n      if (el) {\n        var itemRect = el.getBoundingRect();\n        var start = itemRect[xy] + el[xy];\n        return {\n          s: start,\n          e: start + itemRect[wh],\n          i: el.__legendDataIndex\n        };\n      }\n    }\n    function intersect(itemInfo, winStart) {\n      return itemInfo.e >= winStart && itemInfo.s <= winStart + containerRectSize;\n    }\n  };\n  ScrollableLegendView.prototype._findTargetItemIndex = function (targetDataIndex) {\n    if (!this._showController) {\n      return 0;\n    }\n    var index;\n    var contentGroup = this.getContentGroup();\n    var defaultIndex;\n    contentGroup.eachChild(function (child, idx) {\n      var legendDataIdx = child.__legendDataIndex;\n      // FIXME\n      // If the given targetDataIndex (from model) is illegal,\n      // we use defaultIndex. But the index on the legend model and\n      // action payload is still illegal. That case will not be\n      // changed until some scenario requires.\n      if (defaultIndex == null && legendDataIdx != null) {\n        defaultIndex = idx;\n      }\n      if (legendDataIdx === targetDataIndex) {\n        index = idx;\n      }\n    });\n    return index != null ? index : defaultIndex;\n  };\n  ScrollableLegendView.type = 'legend.scroll';\n  return ScrollableLegendView;\n}(LegendView);\nexport default ScrollableLegendView;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nexport default function installScrollableLegendAction(registers) {\n  /**\n   * @event legendScroll\n   * @type {Object}\n   * @property {string} type 'legendScroll'\n   * @property {string} scrollDataIndex\n   */\n  registers.registerAction('legendScroll', 'legendscroll', function (payload, ecModel) {\n    var scrollDataIndex = payload.scrollDataIndex;\n    scrollDataIndex != null && ecModel.eachComponent({\n      mainType: 'legend',\n      subType: 'scroll',\n      query: payload\n    }, function (legendModel) {\n      legendModel.setScrollDataIndex(scrollDataIndex);\n    });\n  });\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { use } from '../../extension.js';\nimport { install as installLegendPlain } from './installLegendPlain.js';\nimport ScrollableLegendModel from './ScrollableLegendModel.js';\nimport ScrollableLegendView from './ScrollableLegendView.js';\nimport installScrollableLegendAction from './scrollableLegendAction.js';\nexport function install(registers) {\n  use(installLegendPlain);\n  registers.registerComponentModel(ScrollableLegendModel);\n  registers.registerComponentView(ScrollableLegendView);\n  installScrollableLegendAction(registers);\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { use } from '../../extension.js';\nimport { install as installLegendPlain } from './installLegendPlain.js';\nimport { install as installLegendScroll } from './installLegendScroll.js';\nexport function install(registers) {\n  use(installLegendPlain);\n  use(installLegendScroll);\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport DataZoomModel from './DataZoomModel.js';\nimport { inheritDefaultOption } from '../../util/component.js';\nvar InsideZoomModel = /** @class */function (_super) {\n  __extends(InsideZoomModel, _super);\n  function InsideZoomModel() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = InsideZoomModel.type;\n    return _this;\n  }\n  InsideZoomModel.type = 'dataZoom.inside';\n  InsideZoomModel.defaultOption = inheritDefaultOption(DataZoomModel.defaultOption, {\n    disabled: false,\n    zoomLock: false,\n    zoomOnMouseWheel: true,\n    moveOnMouseMove: true,\n    moveOnMouseWheel: false,\n    preventDefaultMouseMove: true\n  });\n  return InsideZoomModel;\n}(DataZoomModel);\nexport default InsideZoomModel;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n// Only create one roam controller for each coordinate system.\n// one roam controller might be refered by two inside data zoom\n// components (for example, one for x and one for y). When user\n// pan or zoom, only dispatch one action for those data zoom\n// components.\nimport RoamController from '../../component/helper/RoamController.js';\nimport * as throttleUtil from '../../util/throttle.js';\nimport { makeInner } from '../../util/model.js';\nimport { each, curry, createHashMap } from 'zrender/lib/core/util.js';\nimport { collectReferCoordSysModelInfo } from './helper.js';\nvar inner = makeInner();\nexport function setViewInfoToCoordSysRecord(api, dataZoomModel, getRange) {\n  inner(api).coordSysRecordMap.each(function (coordSysRecord) {\n    var dzInfo = coordSysRecord.dataZoomInfoMap.get(dataZoomModel.uid);\n    if (dzInfo) {\n      dzInfo.getRange = getRange;\n    }\n  });\n}\nexport function disposeCoordSysRecordIfNeeded(api, dataZoomModel) {\n  var coordSysRecordMap = inner(api).coordSysRecordMap;\n  var coordSysKeyArr = coordSysRecordMap.keys();\n  for (var i = 0; i < coordSysKeyArr.length; i++) {\n    var coordSysKey = coordSysKeyArr[i];\n    var coordSysRecord = coordSysRecordMap.get(coordSysKey);\n    var dataZoomInfoMap = coordSysRecord.dataZoomInfoMap;\n    if (dataZoomInfoMap) {\n      var dzUid = dataZoomModel.uid;\n      var dzInfo = dataZoomInfoMap.get(dzUid);\n      if (dzInfo) {\n        dataZoomInfoMap.removeKey(dzUid);\n        if (!dataZoomInfoMap.keys().length) {\n          disposeCoordSysRecord(coordSysRecordMap, coordSysRecord);\n        }\n      }\n    }\n  }\n}\nfunction disposeCoordSysRecord(coordSysRecordMap, coordSysRecord) {\n  if (coordSysRecord) {\n    coordSysRecordMap.removeKey(coordSysRecord.model.uid);\n    var controller = coordSysRecord.controller;\n    controller && controller.dispose();\n  }\n}\nfunction createCoordSysRecord(api, coordSysModel) {\n  // These init props will never change after record created.\n  var coordSysRecord = {\n    model: coordSysModel,\n    containsPoint: curry(containsPoint, coordSysModel),\n    dispatchAction: curry(dispatchAction, api),\n    dataZoomInfoMap: null,\n    controller: null\n  };\n  // Must not do anything depends on coordSysRecord outside the event handler here,\n  // because coordSysRecord not completed yet.\n  var controller = coordSysRecord.controller = new RoamController(api.getZr());\n  each(['pan', 'zoom', 'scrollMove'], function (eventName) {\n    controller.on(eventName, function (event) {\n      var batch = [];\n      coordSysRecord.dataZoomInfoMap.each(function (dzInfo) {\n        // Check whether the behaviors (zoomOnMouseWheel, moveOnMouseMove,\n        // moveOnMouseWheel, ...) enabled.\n        if (!event.isAvailableBehavior(dzInfo.model.option)) {\n          return;\n        }\n        var method = (dzInfo.getRange || {})[eventName];\n        var range = method && method(dzInfo.dzReferCoordSysInfo, coordSysRecord.model.mainType, coordSysRecord.controller, event);\n        !dzInfo.model.get('disabled', true) && range && batch.push({\n          dataZoomId: dzInfo.model.id,\n          start: range[0],\n          end: range[1]\n        });\n      });\n      batch.length && coordSysRecord.dispatchAction(batch);\n    });\n  });\n  return coordSysRecord;\n}\n/**\n * This action will be throttled.\n */\nfunction dispatchAction(api, batch) {\n  if (!api.isDisposed()) {\n    api.dispatchAction({\n      type: 'dataZoom',\n      animation: {\n        easing: 'cubicOut',\n        duration: 100\n      },\n      batch: batch\n    });\n  }\n}\nfunction containsPoint(coordSysModel, e, x, y) {\n  return coordSysModel.coordinateSystem.containPoint([x, y]);\n}\n/**\n * Merge roamController settings when multiple dataZooms share one roamController.\n */\nfunction mergeControllerParams(dataZoomInfoMap, coordSysRecord, api) {\n  var controlType;\n  // DO NOT use reserved word (true, false, undefined) as key literally. Even if encapsulated\n  // as string, it is probably revert to reserved word by compress tool. See #7411.\n  var prefix = 'type_';\n  var typePriority = {\n    'type_true': 2,\n    'type_move': 1,\n    'type_false': 0,\n    'type_undefined': -1\n  };\n  var preventDefaultMouseMove = true;\n  dataZoomInfoMap.each(function (dataZoomInfo) {\n    var dataZoomModel = dataZoomInfo.model;\n    var oneType = dataZoomModel.get('disabled', true) ? false : dataZoomModel.get('zoomLock', true) ? 'move' : true;\n    if (typePriority[prefix + oneType] > typePriority[prefix + controlType]) {\n      controlType = oneType;\n    }\n    // Prevent default move event by default. If one false, do not prevent. Otherwise\n    // users may be confused why it does not work when multiple insideZooms exist.\n    preventDefaultMouseMove = preventDefaultMouseMove && dataZoomModel.get('preventDefaultMouseMove', true);\n  });\n  return {\n    controlType: controlType,\n    opt: {\n      // RoamController will enable all of these functionalities,\n      // and the final behavior is determined by its event listener\n      // provided by each inside zoom.\n      zoomOnMouseWheel: true,\n      moveOnMouseMove: true,\n      moveOnMouseWheel: true,\n      preventDefaultMouseMove: !!preventDefaultMouseMove,\n      api: api,\n      zInfo: {\n        component: coordSysRecord.model\n      },\n      triggerInfo: {\n        roamTrigger: null,\n        isInSelf: coordSysRecord.containsPoint\n      }\n    }\n  };\n}\nexport function installDataZoomRoamProcessor(registers) {\n  registers.registerProcessor(registers.PRIORITY.PROCESSOR.FILTER, function (ecModel, api) {\n    var apiInner = inner(api);\n    var coordSysRecordMap = apiInner.coordSysRecordMap || (apiInner.coordSysRecordMap = createHashMap());\n    coordSysRecordMap.each(function (coordSysRecord) {\n      // `coordSysRecordMap` always exists (because it holds the `roam controller`, which should\n      // better not re-create each time), but clear `dataZoomInfoMap` each round of the workflow.\n      coordSysRecord.dataZoomInfoMap = null;\n    });\n    ecModel.eachComponent({\n      mainType: 'dataZoom',\n      subType: 'inside'\n    }, function (dataZoomModel) {\n      var dzReferCoordSysWrap = collectReferCoordSysModelInfo(dataZoomModel);\n      each(dzReferCoordSysWrap.infoList, function (dzCoordSysInfo) {\n        var coordSysUid = dzCoordSysInfo.model.uid;\n        var coordSysRecord = coordSysRecordMap.get(coordSysUid) || coordSysRecordMap.set(coordSysUid, createCoordSysRecord(api, dzCoordSysInfo.model));\n        var dataZoomInfoMap = coordSysRecord.dataZoomInfoMap || (coordSysRecord.dataZoomInfoMap = createHashMap());\n        // Notice these props might be changed each time for a single dataZoomModel.\n        dataZoomInfoMap.set(dataZoomModel.uid, {\n          dzReferCoordSysInfo: dzCoordSysInfo,\n          model: dataZoomModel,\n          getRange: null\n        });\n      });\n    });\n    // (1) Merge dataZoom settings for each coord sys and set to the roam controller.\n    // (2) Clear coord sys if not refered by any dataZoom.\n    coordSysRecordMap.each(function (coordSysRecord) {\n      var controller = coordSysRecord.controller;\n      var firstDzInfo;\n      var dataZoomInfoMap = coordSysRecord.dataZoomInfoMap;\n      if (dataZoomInfoMap) {\n        var firstDzKey = dataZoomInfoMap.keys()[0];\n        if (firstDzKey != null) {\n          firstDzInfo = dataZoomInfoMap.get(firstDzKey);\n        }\n      }\n      if (!firstDzInfo) {\n        disposeCoordSysRecord(coordSysRecordMap, coordSysRecord);\n        return;\n      }\n      var controllerParams = mergeControllerParams(dataZoomInfoMap, coordSysRecord, api);\n      controller.enable(controllerParams.controlType, controllerParams.opt);\n      throttleUtil.createOrUpdate(coordSysRecord, 'dispatchAction', firstDzInfo.model.get('throttle', true), 'fixRate');\n    });\n  });\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport DataZoomView from './DataZoomView.js';\nimport sliderMove from '../helper/sliderMove.js';\nimport * as roams from './roams.js';\nimport { bind } from 'zrender/lib/core/util.js';\nvar InsideZoomView = /** @class */function (_super) {\n  __extends(InsideZoomView, _super);\n  function InsideZoomView() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = 'dataZoom.inside';\n    return _this;\n  }\n  InsideZoomView.prototype.render = function (dataZoomModel, ecModel, api) {\n    _super.prototype.render.apply(this, arguments);\n    if (dataZoomModel.noTarget()) {\n      this._clear();\n      return;\n    }\n    // Hence the `throttle` util ensures to preserve command order,\n    // here simply updating range all the time will not cause missing\n    // any of the the roam change.\n    this.range = dataZoomModel.getPercentRange();\n    // Reset controllers.\n    roams.setViewInfoToCoordSysRecord(api, dataZoomModel, {\n      pan: bind(getRangeHandlers.pan, this),\n      zoom: bind(getRangeHandlers.zoom, this),\n      scrollMove: bind(getRangeHandlers.scrollMove, this)\n    });\n  };\n  InsideZoomView.prototype.dispose = function () {\n    this._clear();\n    _super.prototype.dispose.apply(this, arguments);\n  };\n  InsideZoomView.prototype._clear = function () {\n    roams.disposeCoordSysRecordIfNeeded(this.api, this.dataZoomModel);\n    this.range = null;\n  };\n  InsideZoomView.type = 'dataZoom.inside';\n  return InsideZoomView;\n}(DataZoomView);\nvar getRangeHandlers = {\n  zoom: function (coordSysInfo, coordSysMainType, controller, e) {\n    var lastRange = this.range;\n    var range = lastRange.slice();\n    // Calculate transform by the first axis.\n    var axisModel = coordSysInfo.axisModels[0];\n    if (!axisModel) {\n      return;\n    }\n    var directionInfo = getDirectionInfo[coordSysMainType](null, [e.originX, e.originY], axisModel, controller, coordSysInfo);\n    var percentPoint = (directionInfo.signal > 0 ? directionInfo.pixelStart + directionInfo.pixelLength - directionInfo.pixel : directionInfo.pixel - directionInfo.pixelStart) / directionInfo.pixelLength * (range[1] - range[0]) + range[0];\n    var scale = Math.max(1 / e.scale, 0);\n    range[0] = (range[0] - percentPoint) * scale + percentPoint;\n    range[1] = (range[1] - percentPoint) * scale + percentPoint;\n    // Restrict range.\n    var minMaxSpan = this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();\n    sliderMove(0, range, [0, 100], 0, minMaxSpan.minSpan, minMaxSpan.maxSpan);\n    this.range = range;\n    if (lastRange[0] !== range[0] || lastRange[1] !== range[1]) {\n      return range;\n    }\n  },\n  pan: makeMover(function (range, axisModel, coordSysInfo, coordSysMainType, controller, e) {\n    var directionInfo = getDirectionInfo[coordSysMainType]([e.oldX, e.oldY], [e.newX, e.newY], axisModel, controller, coordSysInfo);\n    return directionInfo.signal * (range[1] - range[0]) * directionInfo.pixel / directionInfo.pixelLength;\n  }),\n  scrollMove: makeMover(function (range, axisModel, coordSysInfo, coordSysMainType, controller, e) {\n    var directionInfo = getDirectionInfo[coordSysMainType]([0, 0], [e.scrollDelta, e.scrollDelta], axisModel, controller, coordSysInfo);\n    return directionInfo.signal * (range[1] - range[0]) * e.scrollDelta;\n  })\n};\nfunction makeMover(getPercentDelta) {\n  return function (coordSysInfo, coordSysMainType, controller, e) {\n    var lastRange = this.range;\n    var range = lastRange.slice();\n    // Calculate transform by the first axis.\n    var axisModel = coordSysInfo.axisModels[0];\n    if (!axisModel) {\n      return;\n    }\n    var percentDelta = getPercentDelta(range, axisModel, coordSysInfo, coordSysMainType, controller, e);\n    sliderMove(percentDelta, range, [0, 100], 'all');\n    this.range = range;\n    if (lastRange[0] !== range[0] || lastRange[1] !== range[1]) {\n      return range;\n    }\n  };\n}\nvar getDirectionInfo = {\n  grid: function (oldPoint, newPoint, axisModel, controller, coordSysInfo) {\n    var axis = axisModel.axis;\n    var ret = {};\n    var rect = coordSysInfo.model.coordinateSystem.getRect();\n    oldPoint = oldPoint || [0, 0];\n    if (axis.dim === 'x') {\n      ret.pixel = newPoint[0] - oldPoint[0];\n      ret.pixelLength = rect.width;\n      ret.pixelStart = rect.x;\n      ret.signal = axis.inverse ? 1 : -1;\n    } else {\n      // axis.dim === 'y'\n      ret.pixel = newPoint[1] - oldPoint[1];\n      ret.pixelLength = rect.height;\n      ret.pixelStart = rect.y;\n      ret.signal = axis.inverse ? -1 : 1;\n    }\n    return ret;\n  },\n  polar: function (oldPoint, newPoint, axisModel, controller, coordSysInfo) {\n    var axis = axisModel.axis;\n    var ret = {};\n    var polar = coordSysInfo.model.coordinateSystem;\n    var radiusExtent = polar.getRadiusAxis().getExtent();\n    var angleExtent = polar.getAngleAxis().getExtent();\n    oldPoint = oldPoint ? polar.pointToCoord(oldPoint) : [0, 0];\n    newPoint = polar.pointToCoord(newPoint);\n    if (axisModel.mainType === 'radiusAxis') {\n      ret.pixel = newPoint[0] - oldPoint[0];\n      // ret.pixelLength = Math.abs(radiusExtent[1] - radiusExtent[0]);\n      // ret.pixelStart = Math.min(radiusExtent[0], radiusExtent[1]);\n      ret.pixelLength = radiusExtent[1] - radiusExtent[0];\n      ret.pixelStart = radiusExtent[0];\n      ret.signal = axis.inverse ? 1 : -1;\n    } else {\n      // 'angleAxis'\n      ret.pixel = newPoint[1] - oldPoint[1];\n      // ret.pixelLength = Math.abs(angleExtent[1] - angleExtent[0]);\n      // ret.pixelStart = Math.min(angleExtent[0], angleExtent[1]);\n      ret.pixelLength = angleExtent[1] - angleExtent[0];\n      ret.pixelStart = angleExtent[0];\n      ret.signal = axis.inverse ? -1 : 1;\n    }\n    return ret;\n  },\n  singleAxis: function (oldPoint, newPoint, axisModel, controller, coordSysInfo) {\n    var axis = axisModel.axis;\n    var rect = coordSysInfo.model.coordinateSystem.getRect();\n    var ret = {};\n    oldPoint = oldPoint || [0, 0];\n    if (axis.orient === 'horizontal') {\n      ret.pixel = newPoint[0] - oldPoint[0];\n      ret.pixelLength = rect.width;\n      ret.pixelStart = rect.x;\n      ret.signal = axis.inverse ? 1 : -1;\n    } else {\n      // 'vertical'\n      ret.pixel = newPoint[1] - oldPoint[1];\n      ret.pixelLength = rect.height;\n      ret.pixelStart = rect.y;\n      ret.signal = axis.inverse ? -1 : 1;\n    }\n    return ret;\n  }\n};\nexport default InsideZoomView;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport InsideZoomModel from './InsideZoomModel.js';\nimport InsideZoomView from './InsideZoomView.js';\nimport { installDataZoomRoamProcessor } from './roams.js';\nimport installCommon from './installCommon.js';\nexport function install(registers) {\n  installCommon(registers);\n  registers.registerComponentModel(InsideZoomModel);\n  registers.registerComponentView(InsideZoomView);\n  installDataZoomRoamProcessor(registers);\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport DataZoomModel from './DataZoomModel.js';\nimport { inheritDefaultOption } from '../../util/component.js';\nimport tokens from '../../visual/tokens.js';\nvar SliderZoomModel = /** @class */function (_super) {\n  __extends(SliderZoomModel, _super);\n  function SliderZoomModel() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = SliderZoomModel.type;\n    return _this;\n  }\n  SliderZoomModel.type = 'dataZoom.slider';\n  SliderZoomModel.layoutMode = 'box';\n  SliderZoomModel.defaultOption = inheritDefaultOption(DataZoomModel.defaultOption, {\n    show: true,\n    // deault value can only be drived in view stage.\n    right: 'ph',\n    top: 'ph',\n    width: 'ph',\n    height: 'ph',\n    left: null,\n    bottom: null,\n    borderColor: tokens.color.accent10,\n    borderRadius: 0,\n    backgroundColor: tokens.color.transparent,\n    // dataBackgroundColor: '#ddd',\n    dataBackground: {\n      lineStyle: {\n        color: tokens.color.accent30,\n        width: 0.5\n      },\n      areaStyle: {\n        color: tokens.color.accent20,\n        opacity: 0.2\n      }\n    },\n    selectedDataBackground: {\n      lineStyle: {\n        color: tokens.color.accent40,\n        width: 0.5\n      },\n      areaStyle: {\n        color: tokens.color.accent20,\n        opacity: 0.3\n      }\n    },\n    // Color of selected window.\n    fillerColor: 'rgba(135,175,274,0.2)',\n    handleIcon: 'path://M-9.35,34.56V42m0-40V9.5m-2,0h4a2,2,0,0,1,2,2v21a2,2,0,0,1-2,2h-4a2,2,0,0,1-2-2v-21A2,2,0,0,1-11.35,9.5Z',\n    // Percent of the slider height\n    handleSize: '100%',\n    handleStyle: {\n      color: tokens.color.neutral00,\n      borderColor: tokens.color.accent20\n    },\n    moveHandleSize: 7,\n    moveHandleIcon: 'path://M-320.9-50L-320.9-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-348-41-339-50-320.9-50z M-212.3-50L-212.3-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-239.4-41-230.4-50-212.3-50z M-103.7-50L-103.7-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-130.9-41-121.8-50-103.7-50z',\n    moveHandleStyle: {\n      color: tokens.color.accent40,\n      opacity: 0.5\n    },\n    showDetail: true,\n    showDataShadow: 'auto',\n    realtime: true,\n    zoomLock: false,\n    textStyle: {\n      color: tokens.color.tertiary\n    },\n    brushSelect: true,\n    brushStyle: {\n      color: tokens.color.accent30,\n      opacity: 0.3\n    },\n    emphasis: {\n      handleLabel: {\n        show: true\n      },\n      handleStyle: {\n        borderColor: tokens.color.accent40\n      },\n      moveHandleStyle: {\n        opacity: 0.8\n      }\n    },\n    defaultLocationEdgeGap: 15\n  });\n  return SliderZoomModel;\n}(DataZoomModel);\nexport default SliderZoomModel;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport { bind, each, isFunction, isString, indexOf } from 'zrender/lib/core/util.js';\nimport * as eventTool from 'zrender/lib/core/event.js';\nimport * as graphic from '../../util/graphic.js';\nimport * as throttle from '../../util/throttle.js';\nimport DataZoomView from './DataZoomView.js';\nimport { linearMap, asc, parsePercent } from '../../util/number.js';\nimport * as layout from '../../util/layout.js';\nimport sliderMove from '../helper/sliderMove.js';\nimport { getAxisMainType, collectReferCoordSysModelInfo } from './helper.js';\nimport { enableHoverEmphasis } from '../../util/states.js';\nimport { createSymbol, symbolBuildProxies } from '../../util/symbol.js';\nimport { deprecateLog } from '../../util/log.js';\nimport { createTextStyle } from '../../label/labelStyle.js';\nimport tokens from '../../visual/tokens.js';\nvar Rect = graphic.Rect;\n// Constants\nvar DEFAULT_FRAME_BORDER_WIDTH = 1;\nvar DEFAULT_FILLER_SIZE = 30;\nvar DEFAULT_MOVE_HANDLE_SIZE = 7;\nvar HORIZONTAL = 'horizontal';\nvar VERTICAL = 'vertical';\nvar LABEL_GAP = 5;\nvar SHOW_DATA_SHADOW_SERIES_TYPE = ['line', 'bar', 'candlestick', 'scatter'];\nvar REALTIME_ANIMATION_CONFIG = {\n  easing: 'cubicOut',\n  duration: 100,\n  delay: 0\n};\nvar SliderZoomView = /** @class */function (_super) {\n  __extends(SliderZoomView, _super);\n  function SliderZoomView() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = SliderZoomView.type;\n    _this._displayables = {};\n    return _this;\n  }\n  SliderZoomView.prototype.init = function (ecModel, api) {\n    this.api = api;\n    // A unique handler for each dataZoom component\n    this._onBrush = bind(this._onBrush, this);\n    this._onBrushEnd = bind(this._onBrushEnd, this);\n  };\n  SliderZoomView.prototype.render = function (dataZoomModel, ecModel, api, payload) {\n    _super.prototype.render.apply(this, arguments);\n    throttle.createOrUpdate(this, '_dispatchZoomAction', dataZoomModel.get('throttle'), 'fixRate');\n    this._orient = dataZoomModel.getOrient();\n    if (dataZoomModel.get('show') === false) {\n      this.group.removeAll();\n      return;\n    }\n    if (dataZoomModel.noTarget()) {\n      this._clear();\n      this.group.removeAll();\n      return;\n    }\n    // Notice: this._resetInterval() should not be executed when payload.type\n    // is 'dataZoom', origin this._range should be maintained, otherwise 'pan'\n    // or 'zoom' info will be missed because of 'throttle' of this.dispatchAction,\n    if (!payload || payload.type !== 'dataZoom' || payload.from !== this.uid) {\n      this._buildView();\n    }\n    this._updateView();\n  };\n  SliderZoomView.prototype.dispose = function () {\n    this._clear();\n    _super.prototype.dispose.apply(this, arguments);\n  };\n  SliderZoomView.prototype._clear = function () {\n    throttle.clear(this, '_dispatchZoomAction');\n    var zr = this.api.getZr();\n    zr.off('mousemove', this._onBrush);\n    zr.off('mouseup', this._onBrushEnd);\n  };\n  SliderZoomView.prototype._buildView = function () {\n    var thisGroup = this.group;\n    thisGroup.removeAll();\n    this._brushing = false;\n    this._displayables.brushRect = null;\n    this._resetLocation();\n    this._resetInterval();\n    var barGroup = this._displayables.sliderGroup = new graphic.Group();\n    this._renderBackground();\n    this._renderHandle();\n    this._renderDataShadow();\n    thisGroup.add(barGroup);\n    this._positionGroup();\n  };\n  SliderZoomView.prototype._resetLocation = function () {\n    var dataZoomModel = this.dataZoomModel;\n    var api = this.api;\n    var showMoveHandle = dataZoomModel.get('brushSelect');\n    var moveHandleSize = showMoveHandle ? DEFAULT_MOVE_HANDLE_SIZE : 0;\n    var refContainer = layout.createBoxLayoutReference(dataZoomModel, api).refContainer;\n    // If some of x/y/width/height are not specified,\n    // auto-adapt according to target grid.\n    var coordRect = this._findCoordRect();\n    var edgeGap = dataZoomModel.get('defaultLocationEdgeGap', true) || 0;\n    // Default align by coordinate system rect.\n    var positionInfo = this._orient === HORIZONTAL ? {\n      // Why using 'right', because right should be used in vertical,\n      // and it is better to be consistent for dealing with position param merge.\n      right: refContainer.width - coordRect.x - coordRect.width,\n      top: refContainer.height - DEFAULT_FILLER_SIZE - edgeGap - moveHandleSize,\n      width: coordRect.width,\n      height: DEFAULT_FILLER_SIZE\n    } : {\n      right: edgeGap,\n      top: coordRect.y,\n      width: DEFAULT_FILLER_SIZE,\n      height: coordRect.height\n    };\n    // Do not write back to option and replace value 'ph', because\n    // the 'ph' value should be recalculated when resize.\n    var layoutParams = layout.getLayoutParams(dataZoomModel.option);\n    // Replace the placeholder value.\n    each(['right', 'top', 'width', 'height'], function (name) {\n      if (layoutParams[name] === 'ph') {\n        layoutParams[name] = positionInfo[name];\n      }\n    });\n    var layoutRect = layout.getLayoutRect(layoutParams, refContainer);\n    this._location = {\n      x: layoutRect.x,\n      y: layoutRect.y\n    };\n    this._size = [layoutRect.width, layoutRect.height];\n    this._orient === VERTICAL && this._size.reverse();\n  };\n  SliderZoomView.prototype._positionGroup = function () {\n    var thisGroup = this.group;\n    var location = this._location;\n    var orient = this._orient;\n    // Just use the first axis to determine mapping.\n    var targetAxisModel = this.dataZoomModel.getFirstTargetAxisModel();\n    var inverse = targetAxisModel && targetAxisModel.get('inverse');\n    var sliderGroup = this._displayables.sliderGroup;\n    var otherAxisInverse = (this._dataShadowInfo || {}).otherAxisInverse;\n    // Transform barGroup.\n    sliderGroup.attr(orient === HORIZONTAL && !inverse ? {\n      scaleY: otherAxisInverse ? 1 : -1,\n      scaleX: 1\n    } : orient === HORIZONTAL && inverse ? {\n      scaleY: otherAxisInverse ? 1 : -1,\n      scaleX: -1\n    } : orient === VERTICAL && !inverse ? {\n      scaleY: otherAxisInverse ? -1 : 1,\n      scaleX: 1,\n      rotation: Math.PI / 2\n    }\n    // Don't use Math.PI, considering shadow direction.\n    : {\n      scaleY: otherAxisInverse ? -1 : 1,\n      scaleX: -1,\n      rotation: Math.PI / 2\n    });\n    // Position barGroup\n    var rect = thisGroup.getBoundingRect([sliderGroup]);\n    thisGroup.x = location.x - rect.x;\n    thisGroup.y = location.y - rect.y;\n    thisGroup.markRedraw();\n  };\n  SliderZoomView.prototype._getViewExtent = function () {\n    return [0, this._size[0]];\n  };\n  SliderZoomView.prototype._renderBackground = function () {\n    var dataZoomModel = this.dataZoomModel;\n    var size = this._size;\n    var barGroup = this._displayables.sliderGroup;\n    var brushSelect = dataZoomModel.get('brushSelect');\n    barGroup.add(new Rect({\n      silent: true,\n      shape: {\n        x: 0,\n        y: 0,\n        width: size[0],\n        height: size[1]\n      },\n      style: {\n        fill: dataZoomModel.get('backgroundColor')\n      },\n      z2: -40\n    }));\n    // Click panel, over shadow, below handles.\n    var clickPanel = new Rect({\n      shape: {\n        x: 0,\n        y: 0,\n        width: size[0],\n        height: size[1]\n      },\n      style: {\n        fill: 'transparent'\n      },\n      z2: 0,\n      onclick: bind(this._onClickPanel, this)\n    });\n    var zr = this.api.getZr();\n    if (brushSelect) {\n      clickPanel.on('mousedown', this._onBrushStart, this);\n      clickPanel.cursor = 'crosshair';\n      zr.on('mousemove', this._onBrush);\n      zr.on('mouseup', this._onBrushEnd);\n    } else {\n      zr.off('mousemove', this._onBrush);\n      zr.off('mouseup', this._onBrushEnd);\n    }\n    barGroup.add(clickPanel);\n  };\n  SliderZoomView.prototype._renderDataShadow = function () {\n    var info = this._dataShadowInfo = this._prepareDataShadowInfo();\n    this._displayables.dataShadowSegs = [];\n    if (!info) {\n      return;\n    }\n    var size = this._size;\n    var oldSize = this._shadowSize || [];\n    var seriesModel = info.series;\n    var data = seriesModel.getRawData();\n    var candlestickDim = seriesModel.getShadowDim && seriesModel.getShadowDim();\n    var otherDim = candlestickDim && data.getDimensionInfo(candlestickDim) ? seriesModel.getShadowDim() // @see candlestick\n    : info.otherDim;\n    if (otherDim == null) {\n      return;\n    }\n    var polygonPts = this._shadowPolygonPts;\n    var polylinePts = this._shadowPolylinePts;\n    // Not re-render if data doesn't change.\n    if (data !== this._shadowData || otherDim !== this._shadowDim || size[0] !== oldSize[0] || size[1] !== oldSize[1]) {\n      var thisDataExtent_1 = data.getDataExtent(info.thisDim);\n      var otherDataExtent_1 = data.getDataExtent(otherDim);\n      // Nice extent.\n      var otherOffset = (otherDataExtent_1[1] - otherDataExtent_1[0]) * 0.3;\n      otherDataExtent_1 = [otherDataExtent_1[0] - otherOffset, otherDataExtent_1[1] + otherOffset];\n      var otherShadowExtent_1 = [0, size[1]];\n      var thisShadowExtent = [0, size[0]];\n      var areaPoints_1 = [[size[0], 0], [0, 0]];\n      var linePoints_1 = [];\n      var step_1 = thisShadowExtent[1] / Math.max(1, data.count() - 1);\n      var normalizationConstant_1 = size[0] / (thisDataExtent_1[1] - thisDataExtent_1[0]);\n      var isTimeAxis_1 = info.thisAxis.type === 'time';\n      var thisCoord_1 = -step_1;\n      // Optimize for large data shadow\n      var stride_1 = Math.round(data.count() / size[0]);\n      var lastIsEmpty_1;\n      data.each([info.thisDim, otherDim], function (thisValue, otherValue, index) {\n        if (stride_1 > 0 && index % stride_1) {\n          if (!isTimeAxis_1) {\n            thisCoord_1 += step_1;\n          }\n          return;\n        }\n        thisCoord_1 = isTimeAxis_1 ? (+thisValue - thisDataExtent_1[0]) * normalizationConstant_1 : thisCoord_1 + step_1;\n        // FIXME\n        // Should consider axis.min/axis.max when drawing dataShadow.\n        // FIXME\n        // \u5E94\u8BE5\u4F7F\u7528\u7EDF\u4E00\u7684\u7A7A\u5224\u65AD\uFF1F\u8FD8\u662F\u5728list\u91CC\u8FDB\u884C\u7A7A\u5224\u65AD\uFF1F\n        var isEmpty = otherValue == null || isNaN(otherValue) || otherValue === '';\n        // See #4235.\n        var otherCoord = isEmpty ? 0 : linearMap(otherValue, otherDataExtent_1, otherShadowExtent_1, true);\n        // Attempt to draw data shadow precisely when there are empty value.\n        if (isEmpty && !lastIsEmpty_1 && index) {\n          areaPoints_1.push([areaPoints_1[areaPoints_1.length - 1][0], 0]);\n          linePoints_1.push([linePoints_1[linePoints_1.length - 1][0], 0]);\n        } else if (!isEmpty && lastIsEmpty_1) {\n          areaPoints_1.push([thisCoord_1, 0]);\n          linePoints_1.push([thisCoord_1, 0]);\n        }\n        if (!isEmpty) {\n          areaPoints_1.push([thisCoord_1, otherCoord]);\n          linePoints_1.push([thisCoord_1, otherCoord]);\n        }\n        lastIsEmpty_1 = isEmpty;\n      });\n      polygonPts = this._shadowPolygonPts = areaPoints_1;\n      polylinePts = this._shadowPolylinePts = linePoints_1;\n    }\n    this._shadowData = data;\n    this._shadowDim = otherDim;\n    this._shadowSize = [size[0], size[1]];\n    var dataZoomModel = this.dataZoomModel;\n    function createDataShadowGroup(isSelectedArea) {\n      var model = dataZoomModel.getModel(isSelectedArea ? 'selectedDataBackground' : 'dataBackground');\n      var group = new graphic.Group();\n      var polygon = new graphic.Polygon({\n        shape: {\n          points: polygonPts\n        },\n        segmentIgnoreThreshold: 1,\n        style: model.getModel('areaStyle').getAreaStyle(),\n        silent: true,\n        z2: -20\n      });\n      var polyline = new graphic.Polyline({\n        shape: {\n          points: polylinePts\n        },\n        segmentIgnoreThreshold: 1,\n        style: model.getModel('lineStyle').getLineStyle(),\n        silent: true,\n        z2: -19\n      });\n      group.add(polygon);\n      group.add(polyline);\n      return group;\n    }\n    // let dataBackgroundModel = dataZoomModel.getModel('dataBackground');\n    for (var i = 0; i < 3; i++) {\n      var group = createDataShadowGroup(i === 1);\n      this._displayables.sliderGroup.add(group);\n      this._displayables.dataShadowSegs.push(group);\n    }\n  };\n  SliderZoomView.prototype._prepareDataShadowInfo = function () {\n    var dataZoomModel = this.dataZoomModel;\n    var showDataShadow = dataZoomModel.get('showDataShadow');\n    if (showDataShadow === false) {\n      return;\n    }\n    // Find a representative series.\n    var result;\n    var ecModel = this.ecModel;\n    dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\n      var seriesModels = dataZoomModel.getAxisProxy(axisDim, axisIndex).getTargetSeriesModels();\n      each(seriesModels, function (seriesModel) {\n        if (result) {\n          return;\n        }\n        if (showDataShadow !== true && indexOf(SHOW_DATA_SHADOW_SERIES_TYPE, seriesModel.get('type')) < 0) {\n          return;\n        }\n        var thisAxis = ecModel.getComponent(getAxisMainType(axisDim), axisIndex).axis;\n        var otherDim = getOtherDim(axisDim);\n        var otherAxisInverse;\n        var coordSys = seriesModel.coordinateSystem;\n        if (otherDim != null && coordSys.getOtherAxis) {\n          otherAxisInverse = coordSys.getOtherAxis(thisAxis).inverse;\n        }\n        otherDim = seriesModel.getData().mapDimension(otherDim);\n        var thisDim = seriesModel.getData().mapDimension(axisDim);\n        result = {\n          thisAxis: thisAxis,\n          series: seriesModel,\n          thisDim: thisDim,\n          otherDim: otherDim,\n          otherAxisInverse: otherAxisInverse\n        };\n      }, this);\n    }, this);\n    return result;\n  };\n  SliderZoomView.prototype._renderHandle = function () {\n    var thisGroup = this.group;\n    var displayables = this._displayables;\n    var handles = displayables.handles = [null, null];\n    var handleLabels = displayables.handleLabels = [null, null];\n    var sliderGroup = this._displayables.sliderGroup;\n    var size = this._size;\n    var dataZoomModel = this.dataZoomModel;\n    var api = this.api;\n    var borderRadius = dataZoomModel.get('borderRadius') || 0;\n    var brushSelect = dataZoomModel.get('brushSelect');\n    var filler = displayables.filler = new Rect({\n      silent: brushSelect,\n      style: {\n        fill: dataZoomModel.get('fillerColor')\n      },\n      textConfig: {\n        position: 'inside'\n      }\n    });\n    sliderGroup.add(filler);\n    // Frame border.\n    sliderGroup.add(new Rect({\n      silent: true,\n      subPixelOptimize: true,\n      shape: {\n        x: 0,\n        y: 0,\n        width: size[0],\n        height: size[1],\n        r: borderRadius\n      },\n      style: {\n        // deprecated option\n        stroke: dataZoomModel.get('dataBackgroundColor') || dataZoomModel.get('borderColor'),\n        lineWidth: DEFAULT_FRAME_BORDER_WIDTH,\n        fill: tokens.color.transparent\n      }\n    }));\n    // Left and right handle to resize\n    each([0, 1], function (handleIndex) {\n      var iconStr = dataZoomModel.get('handleIcon');\n      if (!symbolBuildProxies[iconStr] && iconStr.indexOf('path://') < 0 && iconStr.indexOf('image://') < 0) {\n        // Compatitable with the old icon parsers. Which can use a path string without path://\n        iconStr = 'path://' + iconStr;\n        if (process.env.NODE_ENV !== 'production') {\n          deprecateLog('handleIcon now needs \\'path://\\' prefix when using a path string');\n        }\n      }\n      var path = createSymbol(iconStr, -1, 0, 2, 2, null, true);\n      path.attr({\n        cursor: getCursor(this._orient),\n        draggable: true,\n        drift: bind(this._onDragMove, this, handleIndex),\n        ondragend: bind(this._onDragEnd, this),\n        onmouseover: bind(this._showDataInfo, this, true),\n        onmouseout: bind(this._showDataInfo, this, false),\n        z2: 5\n      });\n      var bRect = path.getBoundingRect();\n      var handleSize = dataZoomModel.get('handleSize');\n      this._handleHeight = parsePercent(handleSize, this._size[1]);\n      this._handleWidth = bRect.width / bRect.height * this._handleHeight;\n      path.setStyle(dataZoomModel.getModel('handleStyle').getItemStyle());\n      path.style.strokeNoScale = true;\n      path.rectHover = true;\n      path.ensureState('emphasis').style = dataZoomModel.getModel(['emphasis', 'handleStyle']).getItemStyle();\n      enableHoverEmphasis(path);\n      var handleColor = dataZoomModel.get('handleColor'); // deprecated option\n      // Compatitable with previous version\n      if (handleColor != null) {\n        path.style.fill = handleColor;\n      }\n      sliderGroup.add(handles[handleIndex] = path);\n      var textStyleModel = dataZoomModel.getModel('textStyle');\n      var handleLabel = dataZoomModel.get('handleLabel') || {};\n      var handleLabelShow = handleLabel.show || false;\n      thisGroup.add(handleLabels[handleIndex] = new graphic.Text({\n        silent: true,\n        invisible: !handleLabelShow,\n        style: createTextStyle(textStyleModel, {\n          x: 0,\n          y: 0,\n          text: '',\n          verticalAlign: 'middle',\n          align: 'center',\n          fill: textStyleModel.getTextColor(),\n          font: textStyleModel.getFont()\n        }),\n        z2: 10\n      }));\n    }, this);\n    // Handle to move. Only visible when brushSelect is set true.\n    var actualMoveZone = filler;\n    if (brushSelect) {\n      var moveHandleHeight = parsePercent(dataZoomModel.get('moveHandleSize'), size[1]);\n      var moveHandle_1 = displayables.moveHandle = new graphic.Rect({\n        style: dataZoomModel.getModel('moveHandleStyle').getItemStyle(),\n        silent: true,\n        shape: {\n          r: [0, 0, 2, 2],\n          y: size[1] - 0.5,\n          height: moveHandleHeight\n        }\n      });\n      var iconSize = moveHandleHeight * 0.8;\n      var moveHandleIcon = displayables.moveHandleIcon = createSymbol(dataZoomModel.get('moveHandleIcon'), -iconSize / 2, -iconSize / 2, iconSize, iconSize, tokens.color.neutral00, true);\n      moveHandleIcon.silent = true;\n      moveHandleIcon.y = size[1] + moveHandleHeight / 2 - 0.5;\n      moveHandle_1.ensureState('emphasis').style = dataZoomModel.getModel(['emphasis', 'moveHandleStyle']).getItemStyle();\n      var moveZoneExpandSize = Math.min(size[1] / 2, Math.max(moveHandleHeight, 10));\n      actualMoveZone = displayables.moveZone = new graphic.Rect({\n        invisible: true,\n        shape: {\n          y: size[1] - moveZoneExpandSize,\n          height: moveHandleHeight + moveZoneExpandSize\n        }\n      });\n      actualMoveZone.on('mouseover', function () {\n        api.enterEmphasis(moveHandle_1);\n      }).on('mouseout', function () {\n        api.leaveEmphasis(moveHandle_1);\n      });\n      sliderGroup.add(moveHandle_1);\n      sliderGroup.add(moveHandleIcon);\n      sliderGroup.add(actualMoveZone);\n    }\n    actualMoveZone.attr({\n      draggable: true,\n      cursor: 'default',\n      drift: bind(this._onDragMove, this, 'all'),\n      ondragstart: bind(this._showDataInfo, this, true),\n      ondragend: bind(this._onDragEnd, this),\n      onmouseover: bind(this._showDataInfo, this, true),\n      onmouseout: bind(this._showDataInfo, this, false)\n    });\n  };\n  SliderZoomView.prototype._resetInterval = function () {\n    var range = this._range = this.dataZoomModel.getPercentRange();\n    var viewExtent = this._getViewExtent();\n    this._handleEnds = [linearMap(range[0], [0, 100], viewExtent, true), linearMap(range[1], [0, 100], viewExtent, true)];\n  };\n  SliderZoomView.prototype._updateInterval = function (handleIndex, delta) {\n    var dataZoomModel = this.dataZoomModel;\n    var handleEnds = this._handleEnds;\n    var viewExtend = this._getViewExtent();\n    var minMaxSpan = dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();\n    var percentExtent = [0, 100];\n    sliderMove(delta, handleEnds, viewExtend, dataZoomModel.get('zoomLock') ? 'all' : handleIndex, minMaxSpan.minSpan != null ? linearMap(minMaxSpan.minSpan, percentExtent, viewExtend, true) : null, minMaxSpan.maxSpan != null ? linearMap(minMaxSpan.maxSpan, percentExtent, viewExtend, true) : null);\n    var lastRange = this._range;\n    var range = this._range = asc([linearMap(handleEnds[0], viewExtend, percentExtent, true), linearMap(handleEnds[1], viewExtend, percentExtent, true)]);\n    return !lastRange || lastRange[0] !== range[0] || lastRange[1] !== range[1];\n  };\n  SliderZoomView.prototype._updateView = function (nonRealtime) {\n    var displaybles = this._displayables;\n    var handleEnds = this._handleEnds;\n    var handleInterval = asc(handleEnds.slice());\n    var size = this._size;\n    each([0, 1], function (handleIndex) {\n      // Handles\n      var handle = displaybles.handles[handleIndex];\n      var handleHeight = this._handleHeight;\n      handle.attr({\n        scaleX: handleHeight / 2,\n        scaleY: handleHeight / 2,\n        // This is a trick, by adding an extra tiny offset to let the default handle's end point align to the drag window.\n        // NOTE: It may affect some custom shapes a bit. But we prefer to have better result by default.\n        x: handleEnds[handleIndex] + (handleIndex ? -1 : 1),\n        y: size[1] / 2 - handleHeight / 2\n      });\n    }, this);\n    // Filler\n    displaybles.filler.setShape({\n      x: handleInterval[0],\n      y: 0,\n      width: handleInterval[1] - handleInterval[0],\n      height: size[1]\n    });\n    var viewExtent = {\n      x: handleInterval[0],\n      width: handleInterval[1] - handleInterval[0]\n    };\n    // Move handle\n    if (displaybles.moveHandle) {\n      displaybles.moveHandle.setShape(viewExtent);\n      displaybles.moveZone.setShape(viewExtent);\n      // Force update path on the invisible object\n      displaybles.moveZone.getBoundingRect();\n      displaybles.moveHandleIcon && displaybles.moveHandleIcon.attr('x', viewExtent.x + viewExtent.width / 2);\n    }\n    // update clip path of shadow.\n    var dataShadowSegs = displaybles.dataShadowSegs;\n    var segIntervals = [0, handleInterval[0], handleInterval[1], size[0]];\n    for (var i = 0; i < dataShadowSegs.length; i++) {\n      var segGroup = dataShadowSegs[i];\n      var clipPath = segGroup.getClipPath();\n      if (!clipPath) {\n        clipPath = new graphic.Rect();\n        segGroup.setClipPath(clipPath);\n      }\n      clipPath.setShape({\n        x: segIntervals[i],\n        y: 0,\n        width: segIntervals[i + 1] - segIntervals[i],\n        height: size[1]\n      });\n    }\n    this._updateDataInfo(nonRealtime);\n  };\n  SliderZoomView.prototype._updateDataInfo = function (nonRealtime) {\n    var dataZoomModel = this.dataZoomModel;\n    var displaybles = this._displayables;\n    var handleLabels = displaybles.handleLabels;\n    var orient = this._orient;\n    var labelTexts = ['', ''];\n    // FIXME\n    // date\u578B\uFF0C\u652F\u6301formatter\uFF0Cautoformatter\uFF08ec2 date.getAutoFormatter\uFF09\n    if (dataZoomModel.get('showDetail')) {\n      var axisProxy = dataZoomModel.findRepresentativeAxisProxy();\n      if (axisProxy) {\n        var axis = axisProxy.getAxisModel().axis;\n        var range = this._range;\n        var dataInterval = nonRealtime\n        // See #4434, data and axis are not processed and reset yet in non-realtime mode.\n        ? axisProxy.calculateDataWindow({\n          start: range[0],\n          end: range[1]\n        }).valueWindow : axisProxy.getDataValueWindow();\n        labelTexts = [this._formatLabel(dataInterval[0], axis), this._formatLabel(dataInterval[1], axis)];\n      }\n    }\n    var orderedHandleEnds = asc(this._handleEnds.slice());\n    setLabel.call(this, 0);\n    setLabel.call(this, 1);\n    function setLabel(handleIndex) {\n      // Label\n      // Text should not transform by barGroup.\n      // Ignore handlers transform\n      var barTransform = graphic.getTransform(displaybles.handles[handleIndex].parent, this.group);\n      var direction = graphic.transformDirection(handleIndex === 0 ? 'right' : 'left', barTransform);\n      var offset = this._handleWidth / 2 + LABEL_GAP;\n      var textPoint = graphic.applyTransform([orderedHandleEnds[handleIndex] + (handleIndex === 0 ? -offset : offset), this._size[1] / 2], barTransform);\n      handleLabels[handleIndex].setStyle({\n        x: textPoint[0],\n        y: textPoint[1],\n        verticalAlign: orient === HORIZONTAL ? 'middle' : direction,\n        align: orient === HORIZONTAL ? direction : 'center',\n        text: labelTexts[handleIndex]\n      });\n    }\n  };\n  SliderZoomView.prototype._formatLabel = function (value, axis) {\n    var dataZoomModel = this.dataZoomModel;\n    var labelFormatter = dataZoomModel.get('labelFormatter');\n    var labelPrecision = dataZoomModel.get('labelPrecision');\n    if (labelPrecision == null || labelPrecision === 'auto') {\n      labelPrecision = axis.getPixelPrecision();\n    }\n    var valueStr = value == null || isNaN(value) ? ''\n    // FIXME Glue code\n    : axis.type === 'category' || axis.type === 'time' ? axis.scale.getLabel({\n      value: Math.round(value)\n    })\n    // param of toFixed should less then 20.\n    : value.toFixed(Math.min(labelPrecision, 20));\n    return isFunction(labelFormatter) ? labelFormatter(value, valueStr) : isString(labelFormatter) ? labelFormatter.replace('{value}', valueStr) : valueStr;\n  };\n  /**\n   * @param isEmphasis true: show, false: hide\n   */\n  SliderZoomView.prototype._showDataInfo = function (isEmphasis) {\n    var handleLabel = this.dataZoomModel.get('handleLabel') || {};\n    var normalShow = handleLabel.show || false;\n    var emphasisHandleLabel = this.dataZoomModel.getModel(['emphasis', 'handleLabel']);\n    var emphasisShow = emphasisHandleLabel.get('show') || false;\n    // Dragging is considered as emphasis, unless emphasisShow is false\n    var toShow = isEmphasis || this._dragging ? emphasisShow : normalShow;\n    var displayables = this._displayables;\n    var handleLabels = displayables.handleLabels;\n    handleLabels[0].attr('invisible', !toShow);\n    handleLabels[1].attr('invisible', !toShow);\n    // Highlight move handle\n    displayables.moveHandle && this.api[toShow ? 'enterEmphasis' : 'leaveEmphasis'](displayables.moveHandle, 1);\n  };\n  SliderZoomView.prototype._onDragMove = function (handleIndex, dx, dy, event) {\n    this._dragging = true;\n    // For mobile device, prevent screen slider on the button.\n    eventTool.stop(event.event);\n    // Transform dx, dy to bar coordination.\n    var barTransform = this._displayables.sliderGroup.getLocalTransform();\n    var vertex = graphic.applyTransform([dx, dy], barTransform, true);\n    var changed = this._updateInterval(handleIndex, vertex[0]);\n    var realtime = this.dataZoomModel.get('realtime');\n    this._updateView(!realtime);\n    // Avoid dispatch dataZoom repeatly but range not changed,\n    // which cause bad visual effect when progressive enabled.\n    changed && realtime && this._dispatchZoomAction(true);\n  };\n  SliderZoomView.prototype._onDragEnd = function () {\n    this._dragging = false;\n    this._showDataInfo(false);\n    // While in realtime mode and stream mode, dispatch action when\n    // drag end will cause the whole view rerender, which is unnecessary.\n    var realtime = this.dataZoomModel.get('realtime');\n    !realtime && this._dispatchZoomAction(false);\n  };\n  SliderZoomView.prototype._onClickPanel = function (e) {\n    var size = this._size;\n    var localPoint = this._displayables.sliderGroup.transformCoordToLocal(e.offsetX, e.offsetY);\n    if (localPoint[0] < 0 || localPoint[0] > size[0] || localPoint[1] < 0 || localPoint[1] > size[1]) {\n      return;\n    }\n    var handleEnds = this._handleEnds;\n    var center = (handleEnds[0] + handleEnds[1]) / 2;\n    var changed = this._updateInterval('all', localPoint[0] - center);\n    this._updateView();\n    changed && this._dispatchZoomAction(false);\n  };\n  SliderZoomView.prototype._onBrushStart = function (e) {\n    var x = e.offsetX;\n    var y = e.offsetY;\n    this._brushStart = new graphic.Point(x, y);\n    this._brushing = true;\n    this._brushStartTime = +new Date();\n    // this._updateBrushRect(x, y);\n  };\n  SliderZoomView.prototype._onBrushEnd = function (e) {\n    if (!this._brushing) {\n      return;\n    }\n    var brushRect = this._displayables.brushRect;\n    this._brushing = false;\n    if (!brushRect) {\n      return;\n    }\n    brushRect.attr('ignore', true);\n    var brushShape = brushRect.shape;\n    var brushEndTime = +new Date();\n    // console.log(brushEndTime - this._brushStartTime);\n    if (brushEndTime - this._brushStartTime < 200 && Math.abs(brushShape.width) < 5) {\n      // Will treat it as a click\n      return;\n    }\n    var viewExtend = this._getViewExtent();\n    var percentExtent = [0, 100];\n    var handleEnds = this._handleEnds = [brushShape.x, brushShape.x + brushShape.width];\n    var minMaxSpan = this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();\n    // Restrict range.\n    sliderMove(0, handleEnds, viewExtend, 0, minMaxSpan.minSpan != null ? linearMap(minMaxSpan.minSpan, percentExtent, viewExtend, true) : null, minMaxSpan.maxSpan != null ? linearMap(minMaxSpan.maxSpan, percentExtent, viewExtend, true) : null);\n    this._range = asc([linearMap(handleEnds[0], viewExtend, percentExtent, true), linearMap(handleEnds[1], viewExtend, percentExtent, true)]);\n    this._updateView();\n    this._dispatchZoomAction(false);\n  };\n  SliderZoomView.prototype._onBrush = function (e) {\n    if (this._brushing) {\n      // For mobile device, prevent screen slider on the button.\n      eventTool.stop(e.event);\n      this._updateBrushRect(e.offsetX, e.offsetY);\n    }\n  };\n  SliderZoomView.prototype._updateBrushRect = function (mouseX, mouseY) {\n    var displayables = this._displayables;\n    var dataZoomModel = this.dataZoomModel;\n    var brushRect = displayables.brushRect;\n    if (!brushRect) {\n      brushRect = displayables.brushRect = new Rect({\n        silent: true,\n        style: dataZoomModel.getModel('brushStyle').getItemStyle()\n      });\n      displayables.sliderGroup.add(brushRect);\n    }\n    brushRect.attr('ignore', false);\n    var brushStart = this._brushStart;\n    var sliderGroup = this._displayables.sliderGroup;\n    var endPoint = sliderGroup.transformCoordToLocal(mouseX, mouseY);\n    var startPoint = sliderGroup.transformCoordToLocal(brushStart.x, brushStart.y);\n    var size = this._size;\n    endPoint[0] = Math.max(Math.min(size[0], endPoint[0]), 0);\n    brushRect.setShape({\n      x: startPoint[0],\n      y: 0,\n      width: endPoint[0] - startPoint[0],\n      height: size[1]\n    });\n  };\n  /**\n   * This action will be throttled.\n   */\n  SliderZoomView.prototype._dispatchZoomAction = function (realtime) {\n    var range = this._range;\n    this.api.dispatchAction({\n      type: 'dataZoom',\n      from: this.uid,\n      dataZoomId: this.dataZoomModel.id,\n      animation: realtime ? REALTIME_ANIMATION_CONFIG : null,\n      start: range[0],\n      end: range[1]\n    });\n  };\n  SliderZoomView.prototype._findCoordRect = function () {\n    // Find the grid corresponding to the first axis referred by dataZoom.\n    var rect;\n    var coordSysInfoList = collectReferCoordSysModelInfo(this.dataZoomModel).infoList;\n    if (!rect && coordSysInfoList.length) {\n      var coordSys = coordSysInfoList[0].model.coordinateSystem;\n      rect = coordSys.getRect && coordSys.getRect();\n    }\n    if (!rect) {\n      var width = this.api.getWidth();\n      var height = this.api.getHeight();\n      rect = {\n        x: width * 0.2,\n        y: height * 0.2,\n        width: width * 0.6,\n        height: height * 0.6\n      };\n    }\n    return rect;\n  };\n  SliderZoomView.type = 'dataZoom.slider';\n  return SliderZoomView;\n}(DataZoomView);\nfunction getOtherDim(thisDim) {\n  // FIXME\n  // \u8FD9\u4E2A\u903B\u8F91\u548CgetOtherAxis\u91CC\u4E00\u81F4\uFF0C\u4F46\u662F\u5199\u5728\u8FD9\u91CC\u662F\u5426\u4E0D\u597D\n  var map = {\n    x: 'y',\n    y: 'x',\n    radius: 'angle',\n    angle: 'radius'\n  };\n  return map[thisDim];\n}\nfunction getCursor(orient) {\n  return orient === 'vertical' ? 'ns-resize' : 'ew-resize';\n}\nexport default SliderZoomView;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport SliderZoomModel from './SliderZoomModel.js';\nimport SliderZoomView from './SliderZoomView.js';\nimport installCommon from './installCommon.js';\nexport function install(registers) {\n  registers.registerComponentModel(SliderZoomModel);\n  registers.registerComponentView(SliderZoomView);\n  installCommon(registers);\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { use } from '../../extension.js';\nimport { install as installDataZoomInside } from './installDataZoomInside.js';\nimport { install as installDataZoomSlider } from './installDataZoomSlider.js';\nexport function install(registers) {\n  use(installDataZoomInside);\n  use(installDataZoomSlider);\n  // Do not install './dataZoomSelect',\n  // since it only work for toolbox dataZoom.\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n/**\n * @file Visual mapping.\n */\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport tokens from './tokens.js';\nvar visualDefault = {\n  /**\n   * @public\n   */\n  get: function (visualType, key, isCategory) {\n    var value = zrUtil.clone((defaultOption[visualType] || {})[key]);\n    return isCategory ? zrUtil.isArray(value) ? value[value.length - 1] : value : value;\n  }\n};\nvar defaultOption = {\n  color: {\n    active: ['#006edd', '#e0ffff'],\n    inactive: [tokens.color.transparent]\n  },\n  colorHue: {\n    active: [0, 360],\n    inactive: [0, 0]\n  },\n  colorSaturation: {\n    active: [0.3, 1],\n    inactive: [0, 0]\n  },\n  colorLightness: {\n    active: [0.9, 0.5],\n    inactive: [0, 0]\n  },\n  colorAlpha: {\n    active: [0.3, 1],\n    inactive: [0, 0]\n  },\n  opacity: {\n    active: [0.3, 1],\n    inactive: [0, 0]\n  },\n  symbol: {\n    active: ['circle', 'roundRect', 'diamond'],\n    inactive: ['none']\n  },\n  symbolSize: {\n    active: [10, 50],\n    inactive: [0, 0]\n  }\n};\nexport default visualDefault;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport visualDefault from '../../visual/visualDefault.js';\nimport VisualMapping from '../../visual/VisualMapping.js';\nimport * as visualSolution from '../../visual/visualSolution.js';\nimport * as modelUtil from '../../util/model.js';\nimport * as numberUtil from '../../util/number.js';\nimport ComponentModel from '../../model/Component.js';\nimport tokens from '../../visual/tokens.js';\nvar mapVisual = VisualMapping.mapVisual;\nvar eachVisual = VisualMapping.eachVisual;\nvar isArray = zrUtil.isArray;\nvar each = zrUtil.each;\nvar asc = numberUtil.asc;\nvar linearMap = numberUtil.linearMap;\nvar VisualMapModel = /** @class */function (_super) {\n  __extends(VisualMapModel, _super);\n  function VisualMapModel() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = VisualMapModel.type;\n    _this.stateList = ['inRange', 'outOfRange'];\n    _this.replacableOptionKeys = ['inRange', 'outOfRange', 'target', 'controller', 'color'];\n    _this.layoutMode = {\n      type: 'box',\n      ignoreSize: true\n    };\n    /**\n     * [lowerBound, upperBound]\n     */\n    _this.dataBound = [-Infinity, Infinity];\n    _this.targetVisuals = {};\n    _this.controllerVisuals = {};\n    return _this;\n  }\n  VisualMapModel.prototype.init = function (option, parentModel, ecModel) {\n    this.mergeDefaultAndTheme(option, ecModel);\n  };\n  /**\n   * @protected\n   */\n  VisualMapModel.prototype.optionUpdated = function (newOption, isInit) {\n    var thisOption = this.option;\n    !isInit && visualSolution.replaceVisualOption(thisOption, newOption, this.replacableOptionKeys);\n    this.textStyleModel = this.getModel('textStyle');\n    this.resetItemSize();\n    this.completeVisualOption();\n  };\n  /**\n   * @protected\n   */\n  VisualMapModel.prototype.resetVisual = function (supplementVisualOption) {\n    var stateList = this.stateList;\n    supplementVisualOption = zrUtil.bind(supplementVisualOption, this);\n    this.controllerVisuals = visualSolution.createVisualMappings(this.option.controller, stateList, supplementVisualOption);\n    this.targetVisuals = visualSolution.createVisualMappings(this.option.target, stateList, supplementVisualOption);\n  };\n  /**\n   * @public\n   */\n  VisualMapModel.prototype.getItemSymbol = function () {\n    return null;\n  };\n  /**\n   * @return An array of series indices.\n   */\n  VisualMapModel.prototype.getTargetSeriesIndices = function () {\n    var optionSeriesId = this.option.seriesId;\n    var optionSeriesIndex = this.option.seriesIndex;\n    if (optionSeriesIndex == null && optionSeriesId == null) {\n      optionSeriesIndex = 'all';\n    }\n    var seriesModels = modelUtil.queryReferringComponents(this.ecModel, 'series', {\n      index: optionSeriesIndex,\n      id: optionSeriesId\n    }, {\n      useDefault: false,\n      enableAll: true,\n      enableNone: false\n    }).models;\n    return zrUtil.map(seriesModels, function (seriesModel) {\n      return seriesModel.componentIndex;\n    });\n  };\n  /**\n   * @public\n   */\n  VisualMapModel.prototype.eachTargetSeries = function (callback, context) {\n    zrUtil.each(this.getTargetSeriesIndices(), function (seriesIndex) {\n      var seriesModel = this.ecModel.getSeriesByIndex(seriesIndex);\n      if (seriesModel) {\n        callback.call(context, seriesModel);\n      }\n    }, this);\n  };\n  /**\n   * @pubilc\n   */\n  VisualMapModel.prototype.isTargetSeries = function (seriesModel) {\n    var is = false;\n    this.eachTargetSeries(function (model) {\n      model === seriesModel && (is = true);\n    });\n    return is;\n  };\n  /**\n   * @example\n   * this.formatValueText(someVal); // format single numeric value to text.\n   * this.formatValueText(someVal, true); // format single category value to text.\n   * this.formatValueText([min, max]); // format numeric min-max to text.\n   * this.formatValueText([this.dataBound[0], max]); // using data lower bound.\n   * this.formatValueText([min, this.dataBound[1]]); // using data upper bound.\n   *\n   * @param value Real value, or this.dataBound[0 or 1].\n   * @param isCategory Only available when value is number.\n   * @param edgeSymbols Open-close symbol when value is interval.\n   * @protected\n   */\n  VisualMapModel.prototype.formatValueText = function (value, isCategory, edgeSymbols) {\n    var option = this.option;\n    var precision = option.precision;\n    var dataBound = this.dataBound;\n    var formatter = option.formatter;\n    var isMinMax;\n    edgeSymbols = edgeSymbols || ['<', '>'];\n    if (zrUtil.isArray(value)) {\n      value = value.slice();\n      isMinMax = true;\n    }\n    var textValue = isCategory ? value // Value is string when isCategory\n    : isMinMax ? [toFixed(value[0]), toFixed(value[1])] : toFixed(value);\n    if (zrUtil.isString(formatter)) {\n      return formatter.replace('{value}', isMinMax ? textValue[0] : textValue).replace('{value2}', isMinMax ? textValue[1] : textValue);\n    } else if (zrUtil.isFunction(formatter)) {\n      return isMinMax ? formatter(value[0], value[1]) : formatter(value);\n    }\n    if (isMinMax) {\n      if (value[0] === dataBound[0]) {\n        return edgeSymbols[0] + ' ' + textValue[1];\n      } else if (value[1] === dataBound[1]) {\n        return edgeSymbols[1] + ' ' + textValue[0];\n      } else {\n        return textValue[0] + ' - ' + textValue[1];\n      }\n    } else {\n      // Format single value (includes category case).\n      return textValue;\n    }\n    function toFixed(val) {\n      return val === dataBound[0] ? 'min' : val === dataBound[1] ? 'max' : (+val).toFixed(Math.min(precision, 20));\n    }\n  };\n  /**\n   * @protected\n   */\n  VisualMapModel.prototype.resetExtent = function () {\n    var thisOption = this.option;\n    // Can not calculate data extent by data here.\n    // Because series and data may be modified in processing stage.\n    // So we do not support the feature \"auto min/max\".\n    var extent = asc([thisOption.min, thisOption.max]);\n    this._dataExtent = extent;\n  };\n  /**\n   * PENDING:\n   * delete this method if no outer usage.\n   *\n   * Return  Concrete dimension. If null/undefined is returned, no dimension is used.\n   */\n  // getDataDimension(data: SeriesData) {\n  //     const optDim = this.option.dimension;\n  //     if (optDim != null) {\n  //         return data.getDimension(optDim);\n  //     }\n  //     const dimNames = data.dimensions;\n  //     for (let i = dimNames.length - 1; i >= 0; i--) {\n  //         const dimName = dimNames[i];\n  //         const dimInfo = data.getDimensionInfo(dimName);\n  //         if (!dimInfo.isCalculationCoord) {\n  //             return dimName;\n  //         }\n  //     }\n  // }\n  VisualMapModel.prototype.getDataDimensionIndex = function (data) {\n    var optDim = this.option.dimension;\n    if (optDim != null) {\n      return data.getDimensionIndex(optDim);\n    }\n    var dimNames = data.dimensions;\n    for (var i = dimNames.length - 1; i >= 0; i--) {\n      var dimName = dimNames[i];\n      var dimInfo = data.getDimensionInfo(dimName);\n      if (!dimInfo.isCalculationCoord) {\n        return dimInfo.storeDimIndex;\n      }\n    }\n  };\n  VisualMapModel.prototype.getExtent = function () {\n    return this._dataExtent.slice();\n  };\n  VisualMapModel.prototype.completeVisualOption = function () {\n    var ecModel = this.ecModel;\n    var thisOption = this.option;\n    var base = {\n      inRange: thisOption.inRange,\n      outOfRange: thisOption.outOfRange\n    };\n    var target = thisOption.target || (thisOption.target = {});\n    var controller = thisOption.controller || (thisOption.controller = {});\n    zrUtil.merge(target, base); // Do not override\n    zrUtil.merge(controller, base); // Do not override\n    var isCategory = this.isCategory();\n    completeSingle.call(this, target);\n    completeSingle.call(this, controller);\n    completeInactive.call(this, target, 'inRange', 'outOfRange');\n    // completeInactive.call(this, target, 'outOfRange', 'inRange');\n    completeController.call(this, controller);\n    function completeSingle(base) {\n      // Compatible with ec2 dataRange.color.\n      // The mapping order of dataRange.color is: [high value, ..., low value]\n      // whereas inRange.color and outOfRange.color is [low value, ..., high value]\n      // Notice: ec2 has no inverse.\n      if (isArray(thisOption.color)\n      // If there has been inRange: {symbol: ...}, adding color is a mistake.\n      // So adding color only when no inRange defined.\n      && !base.inRange) {\n        base.inRange = {\n          color: thisOption.color.slice().reverse()\n        };\n      }\n      // Compatible with previous logic, always give a default color, otherwise\n      // simple config with no inRange and outOfRange will not work.\n      // Originally we use visualMap.color as the default color, but setOption at\n      // the second time the default color will be erased. So we change to use\n      // constant DEFAULT_COLOR.\n      // If user do not want the default color, set inRange: {color: null}.\n      base.inRange = base.inRange || {\n        color: ecModel.get('gradientColor')\n      };\n    }\n    function completeInactive(base, stateExist, stateAbsent) {\n      var optExist = base[stateExist];\n      var optAbsent = base[stateAbsent];\n      if (optExist && !optAbsent) {\n        optAbsent = base[stateAbsent] = {};\n        each(optExist, function (visualData, visualType) {\n          if (!VisualMapping.isValidType(visualType)) {\n            return;\n          }\n          var defa = visualDefault.get(visualType, 'inactive', isCategory);\n          if (defa != null) {\n            optAbsent[visualType] = defa;\n            // Compatibable with ec2:\n            // Only inactive color to rgba(0,0,0,0) can not\n            // make label transparent, so use opacity also.\n            if (visualType === 'color' && !optAbsent.hasOwnProperty('opacity') && !optAbsent.hasOwnProperty('colorAlpha')) {\n              optAbsent.opacity = [0, 0];\n            }\n          }\n        });\n      }\n    }\n    function completeController(controller) {\n      var symbolExists = (controller.inRange || {}).symbol || (controller.outOfRange || {}).symbol;\n      var symbolSizeExists = (controller.inRange || {}).symbolSize || (controller.outOfRange || {}).symbolSize;\n      var inactiveColor = this.get('inactiveColor');\n      var itemSymbol = this.getItemSymbol();\n      var defaultSymbol = itemSymbol || 'roundRect';\n      each(this.stateList, function (state) {\n        var itemSize = this.itemSize;\n        var visuals = controller[state];\n        // Set inactive color for controller if no other color\n        // attr (like colorAlpha) specified.\n        if (!visuals) {\n          visuals = controller[state] = {\n            color: isCategory ? inactiveColor : [inactiveColor]\n          };\n        }\n        // Consistent symbol and symbolSize if not specified.\n        if (visuals.symbol == null) {\n          visuals.symbol = symbolExists && zrUtil.clone(symbolExists) || (isCategory ? defaultSymbol : [defaultSymbol]);\n        }\n        if (visuals.symbolSize == null) {\n          visuals.symbolSize = symbolSizeExists && zrUtil.clone(symbolSizeExists) || (isCategory ? itemSize[0] : [itemSize[0], itemSize[0]]);\n        }\n        // Filter none\n        visuals.symbol = mapVisual(visuals.symbol, function (symbol) {\n          return symbol === 'none' ? defaultSymbol : symbol;\n        });\n        // Normalize symbolSize\n        var symbolSize = visuals.symbolSize;\n        if (symbolSize != null) {\n          var max_1 = -Infinity;\n          // symbolSize can be object when categories defined.\n          eachVisual(symbolSize, function (value) {\n            value > max_1 && (max_1 = value);\n          });\n          visuals.symbolSize = mapVisual(symbolSize, function (value) {\n            return linearMap(value, [0, max_1], [0, itemSize[0]], true);\n          });\n        }\n      }, this);\n    }\n  };\n  VisualMapModel.prototype.resetItemSize = function () {\n    this.itemSize = [parseFloat(this.get('itemWidth')), parseFloat(this.get('itemHeight'))];\n  };\n  VisualMapModel.prototype.isCategory = function () {\n    return !!this.option.categories;\n  };\n  /**\n   * @public\n   * @abstract\n   */\n  VisualMapModel.prototype.setSelected = function (selected) {};\n  VisualMapModel.prototype.getSelected = function () {\n    return null;\n  };\n  /**\n   * @public\n   * @abstract\n   */\n  VisualMapModel.prototype.getValueState = function (value) {\n    return null;\n  };\n  /**\n   * FIXME\n   * Do not publish to thirt-part-dev temporarily\n   * util the interface is stable. (Should it return\n   * a function but not visual meta?)\n   *\n   * @pubilc\n   * @abstract\n   * @param getColorVisual\n   *        params: value, valueState\n   *        return: color\n   * @return {Object} visualMeta\n   *        should includes {stops, outerColors}\n   *        outerColor means [colorBeyondMinValue, colorBeyondMaxValue]\n   */\n  VisualMapModel.prototype.getVisualMeta = function (getColorVisual) {\n    return null;\n  };\n  VisualMapModel.type = 'visualMap';\n  VisualMapModel.dependencies = ['series'];\n  VisualMapModel.defaultOption = {\n    show: true,\n    // zlevel: 0,\n    z: 4,\n    // seriesIndex: 'all',\n    min: 0,\n    max: 200,\n    left: 0,\n    right: null,\n    top: null,\n    bottom: 0,\n    itemWidth: null,\n    itemHeight: null,\n    inverse: false,\n    orient: 'vertical',\n    backgroundColor: tokens.color.transparent,\n    borderColor: tokens.color.borderTint,\n    contentColor: tokens.color.theme[0],\n    inactiveColor: tokens.color.disabled,\n    borderWidth: 0,\n    padding: tokens.size.m,\n    // \u63A5\u53D7\u6570\u7EC4\u5206\u522B\u8BBE\u5B9A\u4E0A\u53F3\u4E0B\u5DE6\u8FB9\u8DDD\uFF0C\u540Ccss\n    textGap: 10,\n    precision: 0,\n    textStyle: {\n      color: tokens.color.secondary // \u503C\u57DF\u6587\u5B57\u989C\u8272\n    }\n  };\n  return VisualMapModel;\n}(ComponentModel);\nexport default VisualMapModel;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport VisualMapModel from './VisualMapModel.js';\nimport * as numberUtil from '../../util/number.js';\nimport { inheritDefaultOption } from '../../util/component.js';\nimport tokens from '../../visual/tokens.js';\n// Constant\nvar DEFAULT_BAR_BOUND = [20, 140];\nvar ContinuousModel = /** @class */function (_super) {\n  __extends(ContinuousModel, _super);\n  function ContinuousModel() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = ContinuousModel.type;\n    return _this;\n  }\n  /**\n   * @override\n   */\n  ContinuousModel.prototype.optionUpdated = function (newOption, isInit) {\n    _super.prototype.optionUpdated.apply(this, arguments);\n    this.resetExtent();\n    this.resetVisual(function (mappingOption) {\n      mappingOption.mappingMethod = 'linear';\n      mappingOption.dataExtent = this.getExtent();\n    });\n    this._resetRange();\n  };\n  /**\n   * @protected\n   * @override\n   */\n  ContinuousModel.prototype.resetItemSize = function () {\n    _super.prototype.resetItemSize.apply(this, arguments);\n    var itemSize = this.itemSize;\n    (itemSize[0] == null || isNaN(itemSize[0])) && (itemSize[0] = DEFAULT_BAR_BOUND[0]);\n    (itemSize[1] == null || isNaN(itemSize[1])) && (itemSize[1] = DEFAULT_BAR_BOUND[1]);\n  };\n  /**\n   * @private\n   */\n  ContinuousModel.prototype._resetRange = function () {\n    var dataExtent = this.getExtent();\n    var range = this.option.range;\n    if (!range || range.auto) {\n      // `range` should always be array (so we don't use other\n      // value like 'auto') for user-friend. (consider getOption).\n      dataExtent.auto = 1;\n      this.option.range = dataExtent;\n    } else if (zrUtil.isArray(range)) {\n      if (range[0] > range[1]) {\n        range.reverse();\n      }\n      range[0] = Math.max(range[0], dataExtent[0]);\n      range[1] = Math.min(range[1], dataExtent[1]);\n    }\n  };\n  /**\n   * @protected\n   * @override\n   */\n  ContinuousModel.prototype.completeVisualOption = function () {\n    _super.prototype.completeVisualOption.apply(this, arguments);\n    zrUtil.each(this.stateList, function (state) {\n      var symbolSize = this.option.controller[state].symbolSize;\n      if (symbolSize && symbolSize[0] !== symbolSize[1]) {\n        symbolSize[0] = symbolSize[1] / 3; // For good looking.\n      }\n    }, this);\n  };\n  /**\n   * @override\n   */\n  ContinuousModel.prototype.setSelected = function (selected) {\n    this.option.range = selected.slice();\n    this._resetRange();\n  };\n  /**\n   * @public\n   */\n  ContinuousModel.prototype.getSelected = function () {\n    var dataExtent = this.getExtent();\n    var dataInterval = numberUtil.asc((this.get('range') || []).slice());\n    // Clamp\n    dataInterval[0] > dataExtent[1] && (dataInterval[0] = dataExtent[1]);\n    dataInterval[1] > dataExtent[1] && (dataInterval[1] = dataExtent[1]);\n    dataInterval[0] < dataExtent[0] && (dataInterval[0] = dataExtent[0]);\n    dataInterval[1] < dataExtent[0] && (dataInterval[1] = dataExtent[0]);\n    return dataInterval;\n  };\n  /**\n   * @override\n   */\n  ContinuousModel.prototype.getValueState = function (value) {\n    var range = this.option.range;\n    var dataExtent = this.getExtent();\n    var unboundedRange = zrUtil.retrieve2(this.option.unboundedRange, true);\n    return (unboundedRange && range[0] <= dataExtent[0] || range[0] <= value) && (unboundedRange && range[1] >= dataExtent[1] || value <= range[1]) ? 'inRange' : 'outOfRange';\n  };\n  ContinuousModel.prototype.findTargetDataIndices = function (range) {\n    var result = [];\n    this.eachTargetSeries(function (seriesModel) {\n      var dataIndices = [];\n      var data = seriesModel.getData();\n      data.each(this.getDataDimensionIndex(data), function (value, dataIndex) {\n        range[0] <= value && value <= range[1] && dataIndices.push(dataIndex);\n      }, this);\n      result.push({\n        seriesId: seriesModel.id,\n        dataIndex: dataIndices\n      });\n    }, this);\n    return result;\n  };\n  /**\n   * @implement\n   */\n  ContinuousModel.prototype.getVisualMeta = function (getColorVisual) {\n    var oVals = getColorStopValues(this, 'outOfRange', this.getExtent());\n    var iVals = getColorStopValues(this, 'inRange', this.option.range.slice());\n    var stops = [];\n    function setStop(value, valueState) {\n      stops.push({\n        value: value,\n        color: getColorVisual(value, valueState)\n      });\n    }\n    // Format to: outOfRange -- inRange -- outOfRange.\n    var iIdx = 0;\n    var oIdx = 0;\n    var iLen = iVals.length;\n    var oLen = oVals.length;\n    for (; oIdx < oLen && (!iVals.length || oVals[oIdx] <= iVals[0]); oIdx++) {\n      // If oVal[oIdx] === iVals[iIdx], oVal[oIdx] should be ignored.\n      if (oVals[oIdx] < iVals[iIdx]) {\n        setStop(oVals[oIdx], 'outOfRange');\n      }\n    }\n    for (var first = 1; iIdx < iLen; iIdx++, first = 0) {\n      // If range is full, value beyond min, max will be clamped.\n      // make a singularity\n      first && stops.length && setStop(iVals[iIdx], 'outOfRange');\n      setStop(iVals[iIdx], 'inRange');\n    }\n    for (var first = 1; oIdx < oLen; oIdx++) {\n      if (!iVals.length || iVals[iVals.length - 1] < oVals[oIdx]) {\n        // make a singularity\n        if (first) {\n          stops.length && setStop(stops[stops.length - 1].value, 'outOfRange');\n          first = 0;\n        }\n        setStop(oVals[oIdx], 'outOfRange');\n      }\n    }\n    var stopsLen = stops.length;\n    return {\n      stops: stops,\n      outerColors: [stopsLen ? stops[0].color : 'transparent', stopsLen ? stops[stopsLen - 1].color : 'transparent']\n    };\n  };\n  ContinuousModel.type = 'visualMap.continuous';\n  ContinuousModel.defaultOption = inheritDefaultOption(VisualMapModel.defaultOption, {\n    align: 'auto',\n    calculable: false,\n    hoverLink: true,\n    realtime: true,\n    handleIcon: 'path://M-11.39,9.77h0a3.5,3.5,0,0,1-3.5,3.5h-22a3.5,3.5,0,0,1-3.5-3.5h0a3.5,3.5,0,0,1,3.5-3.5h22A3.5,3.5,0,0,1-11.39,9.77Z',\n    handleSize: '120%',\n    handleStyle: {\n      borderColor: tokens.color.neutral00,\n      borderWidth: 1\n    },\n    indicatorIcon: 'circle',\n    indicatorSize: '50%',\n    indicatorStyle: {\n      borderColor: tokens.color.neutral00,\n      borderWidth: 2,\n      shadowBlur: 2,\n      shadowOffsetX: 1,\n      shadowOffsetY: 1,\n      shadowColor: tokens.color.shadow\n    }\n    // emphasis: {\n    //     handleStyle: {\n    //         shadowBlur: 3,\n    //         shadowOffsetX: 1,\n    //         shadowOffsetY: 1,\n    //         shadowColor: tokens.color.shadow\n    //     }\n    // }\n  });\n  return ContinuousModel;\n}(VisualMapModel);\nfunction getColorStopValues(visualMapModel, valueState, dataExtent) {\n  if (dataExtent[0] === dataExtent[1]) {\n    return dataExtent.slice();\n  }\n  // When using colorHue mapping, it is not linear color any more.\n  // Moreover, canvas gradient seems not to be accurate linear.\n  // FIXME\n  // Should be arbitrary value 100? or based on pixel size?\n  var count = 200;\n  var step = (dataExtent[1] - dataExtent[0]) / count;\n  var value = dataExtent[0];\n  var stopValues = [];\n  for (var i = 0; i <= count && value < dataExtent[1]; i++) {\n    stopValues.push(value);\n    value += step;\n  }\n  stopValues.push(dataExtent[1]);\n  return stopValues;\n}\nexport default ContinuousModel;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { Rect } from '../../util/graphic.js';\nimport * as formatUtil from '../../util/format.js';\nimport * as layout from '../../util/layout.js';\nimport VisualMapping from '../../visual/VisualMapping.js';\nimport ComponentView from '../../view/Component.js';\nvar VisualMapView = /** @class */function (_super) {\n  __extends(VisualMapView, _super);\n  function VisualMapView() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = VisualMapView.type;\n    _this.autoPositionValues = {\n      left: 1,\n      right: 1,\n      top: 1,\n      bottom: 1\n    };\n    return _this;\n  }\n  VisualMapView.prototype.init = function (ecModel, api) {\n    this.ecModel = ecModel;\n    this.api = api;\n  };\n  /**\n   * @protected\n   */\n  VisualMapView.prototype.render = function (visualMapModel, ecModel, api, payload // TODO: TYPE\n  ) {\n    this.visualMapModel = visualMapModel;\n    if (visualMapModel.get('show') === false) {\n      this.group.removeAll();\n      return;\n    }\n    this.doRender(visualMapModel, ecModel, api, payload);\n  };\n  /**\n   * @protected\n   */\n  VisualMapView.prototype.renderBackground = function (group) {\n    var visualMapModel = this.visualMapModel;\n    var padding = formatUtil.normalizeCssArray(visualMapModel.get('padding') || 0);\n    var rect = group.getBoundingRect();\n    group.add(new Rect({\n      z2: -1,\n      silent: true,\n      shape: {\n        x: rect.x - padding[3],\n        y: rect.y - padding[0],\n        width: rect.width + padding[3] + padding[1],\n        height: rect.height + padding[0] + padding[2]\n      },\n      style: {\n        fill: visualMapModel.get('backgroundColor'),\n        stroke: visualMapModel.get('borderColor'),\n        lineWidth: visualMapModel.get('borderWidth')\n      }\n    }));\n  };\n  /**\n   * @protected\n   * @param targetValue can be Infinity or -Infinity\n   * @param visualCluster Only can be 'color' 'opacity' 'symbol' 'symbolSize'\n   * @param opts\n   * @param opts.forceState Specify state, instead of using getValueState method.\n   * @param opts.convertOpacityToAlpha For color gradient in controller widget.\n   * @return {*} Visual value.\n   */\n  VisualMapView.prototype.getControllerVisual = function (targetValue, visualCluster, opts) {\n    opts = opts || {};\n    var forceState = opts.forceState;\n    var visualMapModel = this.visualMapModel;\n    var visualObj = {};\n    // Default values.\n    if (visualCluster === 'color') {\n      var defaultColor = visualMapModel.get('contentColor');\n      visualObj.color = defaultColor;\n    }\n    function getter(key) {\n      return visualObj[key];\n    }\n    function setter(key, value) {\n      visualObj[key] = value;\n    }\n    var mappings = visualMapModel.controllerVisuals[forceState || visualMapModel.getValueState(targetValue)];\n    var visualTypes = VisualMapping.prepareVisualTypes(mappings);\n    zrUtil.each(visualTypes, function (type) {\n      var visualMapping = mappings[type];\n      if (opts.convertOpacityToAlpha && type === 'opacity') {\n        type = 'colorAlpha';\n        visualMapping = mappings.__alphaForOpacity;\n      }\n      if (VisualMapping.dependsOn(type, visualCluster)) {\n        visualMapping && visualMapping.applyVisual(targetValue, getter, setter);\n      }\n    });\n    return visualObj[visualCluster];\n  };\n  VisualMapView.prototype.positionGroup = function (group) {\n    var model = this.visualMapModel;\n    var api = this.api;\n    var refContainer = layout.createBoxLayoutReference(model, api).refContainer;\n    layout.positionElement(group, model.getBoxLayoutParams(), refContainer);\n  };\n  VisualMapView.prototype.doRender = function (visualMapModel, ecModel, api, payload) {};\n  VisualMapView.type = 'visualMap';\n  return VisualMapView;\n}(ComponentView);\nexport default VisualMapView;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { getLayoutRect } from '../../util/layout.js';\nvar paramsSet = [['left', 'right', 'width'], ['top', 'bottom', 'height']];\n/**\n * @param visualMapModel\n * @param api\n * @param itemSize always [short, long]\n * @return {string} 'left' or 'right' or 'top' or 'bottom'\n */\nexport function getItemAlign(visualMapModel, api, itemSize) {\n  var modelOption = visualMapModel.option;\n  var itemAlign = modelOption.align;\n  if (itemAlign != null && itemAlign !== 'auto') {\n    return itemAlign;\n  }\n  // Auto decision align.\n  var ecSize = {\n    width: api.getWidth(),\n    height: api.getHeight()\n  };\n  var realIndex = modelOption.orient === 'horizontal' ? 1 : 0;\n  var reals = paramsSet[realIndex];\n  var fakeValue = [0, null, 10];\n  var layoutInput = {};\n  for (var i = 0; i < 3; i++) {\n    layoutInput[paramsSet[1 - realIndex][i]] = fakeValue[i];\n    layoutInput[reals[i]] = i === 2 ? itemSize[0] : modelOption[reals[i]];\n  }\n  var rParam = [['x', 'width', 3], ['y', 'height', 0]][realIndex];\n  var rect = getLayoutRect(layoutInput, ecSize, modelOption.padding);\n  return reals[(rect.margin[rParam[2]] || 0) + rect[rParam[0]] + rect[rParam[1]] * 0.5 < ecSize[rParam[1]] * 0.5 ? 0 : 1];\n}\n/**\n * Prepare dataIndex for outside usage, where dataIndex means rawIndex, and\n * dataIndexInside means filtered index.\n */\n// TODO: TYPE more specified payload types.\nexport function makeHighDownBatch(batch, visualMapModel) {\n  zrUtil.each(batch || [], function (batchItem) {\n    if (batchItem.dataIndex != null) {\n      batchItem.dataIndexInside = batchItem.dataIndex;\n      batchItem.dataIndex = null;\n    }\n    batchItem.highlightKey = 'visualMap' + (visualMapModel ? visualMapModel.componentIndex : '');\n  });\n  return batch;\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport LinearGradient from 'zrender/lib/graphic/LinearGradient.js';\nimport * as eventTool from 'zrender/lib/core/event.js';\nimport VisualMapView from './VisualMapView.js';\nimport * as graphic from '../../util/graphic.js';\nimport * as numberUtil from '../../util/number.js';\nimport sliderMove from '../helper/sliderMove.js';\nimport * as helper from './helper.js';\nimport * as modelUtil from '../../util/model.js';\nimport { parsePercent } from 'zrender/lib/contain/text.js';\nimport { setAsHighDownDispatcher } from '../../util/states.js';\nimport { createSymbol } from '../../util/symbol.js';\nimport ZRImage from 'zrender/lib/graphic/Image.js';\nimport { getECData } from '../../util/innerStore.js';\nimport { createTextStyle } from '../../label/labelStyle.js';\nimport { findEventDispatcher } from '../../util/event.js';\nvar linearMap = numberUtil.linearMap;\nvar each = zrUtil.each;\nvar mathMin = Math.min;\nvar mathMax = Math.max;\n// Arbitrary value\nvar HOVER_LINK_SIZE = 12;\nvar HOVER_LINK_OUT = 6;\n// Notice:\n// Any \"interval\" should be by the order of [low, high].\n// \"handle0\" (handleIndex === 0) maps to\n// low data value: this._dataInterval[0] and has low coord.\n// \"handle1\" (handleIndex === 1) maps to\n// high data value: this._dataInterval[1] and has high coord.\n// The logic of transform is implemented in this._createBarGroup.\nvar ContinuousView = /** @class */function (_super) {\n  __extends(ContinuousView, _super);\n  function ContinuousView() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = ContinuousView.type;\n    _this._shapes = {};\n    _this._dataInterval = [];\n    _this._handleEnds = [];\n    _this._hoverLinkDataIndices = [];\n    return _this;\n  }\n  ContinuousView.prototype.init = function (ecModel, api) {\n    _super.prototype.init.call(this, ecModel, api);\n    this._hoverLinkFromSeriesMouseOver = zrUtil.bind(this._hoverLinkFromSeriesMouseOver, this);\n    this._hideIndicator = zrUtil.bind(this._hideIndicator, this);\n  };\n  ContinuousView.prototype.doRender = function (visualMapModel, ecModel, api, payload) {\n    if (!payload || payload.type !== 'selectDataRange' || payload.from !== this.uid) {\n      this._buildView();\n    }\n  };\n  ContinuousView.prototype._buildView = function () {\n    this.group.removeAll();\n    var visualMapModel = this.visualMapModel;\n    var thisGroup = this.group;\n    this._orient = visualMapModel.get('orient');\n    this._useHandle = visualMapModel.get('calculable');\n    this._resetInterval();\n    this._renderBar(thisGroup);\n    var dataRangeText = visualMapModel.get('text');\n    this._renderEndsText(thisGroup, dataRangeText, 0);\n    this._renderEndsText(thisGroup, dataRangeText, 1);\n    // Do this for background size calculation.\n    this._updateView(true);\n    // After updating view, inner shapes is built completely,\n    // and then background can be rendered.\n    this.renderBackground(thisGroup);\n    // Real update view\n    this._updateView();\n    this._enableHoverLinkToSeries();\n    this._enableHoverLinkFromSeries();\n    this.positionGroup(thisGroup);\n  };\n  ContinuousView.prototype._renderEndsText = function (group, dataRangeText, endsIndex) {\n    if (!dataRangeText) {\n      return;\n    }\n    // Compatible with ec2, text[0] map to high value, text[1] map low value.\n    var text = dataRangeText[1 - endsIndex];\n    text = text != null ? text + '' : '';\n    var visualMapModel = this.visualMapModel;\n    var textGap = visualMapModel.get('textGap');\n    var itemSize = visualMapModel.itemSize;\n    var barGroup = this._shapes.mainGroup;\n    var position = this._applyTransform([itemSize[0] / 2, endsIndex === 0 ? -textGap : itemSize[1] + textGap], barGroup);\n    var align = this._applyTransform(endsIndex === 0 ? 'bottom' : 'top', barGroup);\n    var orient = this._orient;\n    var textStyleModel = this.visualMapModel.textStyleModel;\n    this.group.add(new graphic.Text({\n      style: createTextStyle(textStyleModel, {\n        x: position[0],\n        y: position[1],\n        verticalAlign: textStyleModel.get('verticalAlign') || (orient === 'horizontal' ? 'middle' : align),\n        align: textStyleModel.get('align') || (orient === 'horizontal' ? align : 'center'),\n        text: text\n      })\n    }));\n  };\n  ContinuousView.prototype._renderBar = function (targetGroup) {\n    var visualMapModel = this.visualMapModel;\n    var shapes = this._shapes;\n    var itemSize = visualMapModel.itemSize;\n    var orient = this._orient;\n    var useHandle = this._useHandle;\n    var itemAlign = helper.getItemAlign(visualMapModel, this.api, itemSize);\n    var mainGroup = shapes.mainGroup = this._createBarGroup(itemAlign);\n    var gradientBarGroup = new graphic.Group();\n    mainGroup.add(gradientBarGroup);\n    // Bar\n    gradientBarGroup.add(shapes.outOfRange = createPolygon());\n    gradientBarGroup.add(shapes.inRange = createPolygon(null, useHandle ? getCursor(this._orient) : null, zrUtil.bind(this._dragHandle, this, 'all', false), zrUtil.bind(this._dragHandle, this, 'all', true)));\n    // A border radius clip.\n    gradientBarGroup.setClipPath(new graphic.Rect({\n      shape: {\n        x: 0,\n        y: 0,\n        width: itemSize[0],\n        height: itemSize[1],\n        r: 3\n      }\n    }));\n    var textRect = visualMapModel.textStyleModel.getTextRect('\u56FD');\n    var textSize = mathMax(textRect.width, textRect.height);\n    // Handle\n    if (useHandle) {\n      shapes.handleThumbs = [];\n      shapes.handleLabels = [];\n      shapes.handleLabelPoints = [];\n      this._createHandle(visualMapModel, mainGroup, 0, itemSize, textSize, orient);\n      this._createHandle(visualMapModel, mainGroup, 1, itemSize, textSize, orient);\n    }\n    this._createIndicator(visualMapModel, mainGroup, itemSize, textSize, orient);\n    targetGroup.add(mainGroup);\n  };\n  ContinuousView.prototype._createHandle = function (visualMapModel, mainGroup, handleIndex, itemSize, textSize, orient) {\n    var onDrift = zrUtil.bind(this._dragHandle, this, handleIndex, false);\n    var onDragEnd = zrUtil.bind(this._dragHandle, this, handleIndex, true);\n    var handleSize = parsePercent(visualMapModel.get('handleSize'), itemSize[0]);\n    var handleThumb = createSymbol(visualMapModel.get('handleIcon'), -handleSize / 2, -handleSize / 2, handleSize, handleSize, null, true);\n    var cursor = getCursor(this._orient);\n    handleThumb.attr({\n      cursor: cursor,\n      draggable: true,\n      drift: onDrift,\n      ondragend: onDragEnd,\n      onmousemove: function (e) {\n        eventTool.stop(e.event);\n      }\n    });\n    handleThumb.x = itemSize[0] / 2;\n    handleThumb.useStyle(visualMapModel.getModel('handleStyle').getItemStyle());\n    handleThumb.setStyle({\n      strokeNoScale: true,\n      strokeFirst: true\n    });\n    handleThumb.style.lineWidth *= 2;\n    handleThumb.ensureState('emphasis').style = visualMapModel.getModel(['emphasis', 'handleStyle']).getItemStyle();\n    setAsHighDownDispatcher(handleThumb, true);\n    mainGroup.add(handleThumb);\n    // Text is always horizontal layout but should not be effected by\n    // transform (orient/inverse). So label is built separately but not\n    // use zrender/graphic/helper/RectText, and is located based on view\n    // group (according to handleLabelPoint) but not barGroup.\n    var textStyleModel = this.visualMapModel.textStyleModel;\n    var handleLabel = new graphic.Text({\n      cursor: cursor,\n      draggable: true,\n      drift: onDrift,\n      onmousemove: function (e) {\n        // For mobile device, prevent screen slider on the button.\n        eventTool.stop(e.event);\n      },\n      ondragend: onDragEnd,\n      style: createTextStyle(textStyleModel, {\n        x: 0,\n        y: 0,\n        text: ''\n      })\n    });\n    handleLabel.ensureState('blur').style = {\n      opacity: 0.1\n    };\n    handleLabel.stateTransition = {\n      duration: 200\n    };\n    this.group.add(handleLabel);\n    var handleLabelPoint = [handleSize, 0];\n    var shapes = this._shapes;\n    shapes.handleThumbs[handleIndex] = handleThumb;\n    shapes.handleLabelPoints[handleIndex] = handleLabelPoint;\n    shapes.handleLabels[handleIndex] = handleLabel;\n  };\n  ContinuousView.prototype._createIndicator = function (visualMapModel, mainGroup, itemSize, textSize, orient) {\n    var scale = parsePercent(visualMapModel.get('indicatorSize'), itemSize[0]);\n    var indicator = createSymbol(visualMapModel.get('indicatorIcon'), -scale / 2, -scale / 2, scale, scale, null, true);\n    indicator.attr({\n      cursor: 'move',\n      invisible: true,\n      silent: true,\n      x: itemSize[0] / 2\n    });\n    var indicatorStyle = visualMapModel.getModel('indicatorStyle').getItemStyle();\n    if (indicator instanceof ZRImage) {\n      var pathStyle = indicator.style;\n      indicator.useStyle(zrUtil.extend({\n        // TODO other properties like x, y ?\n        image: pathStyle.image,\n        x: pathStyle.x,\n        y: pathStyle.y,\n        width: pathStyle.width,\n        height: pathStyle.height\n      }, indicatorStyle));\n    } else {\n      indicator.useStyle(indicatorStyle);\n    }\n    mainGroup.add(indicator);\n    var textStyleModel = this.visualMapModel.textStyleModel;\n    var indicatorLabel = new graphic.Text({\n      silent: true,\n      invisible: true,\n      style: createTextStyle(textStyleModel, {\n        x: 0,\n        y: 0,\n        text: ''\n      })\n    });\n    this.group.add(indicatorLabel);\n    var indicatorLabelPoint = [(orient === 'horizontal' ? textSize / 2 : HOVER_LINK_OUT) + itemSize[0] / 2, 0];\n    var shapes = this._shapes;\n    shapes.indicator = indicator;\n    shapes.indicatorLabel = indicatorLabel;\n    shapes.indicatorLabelPoint = indicatorLabelPoint;\n    this._firstShowIndicator = true;\n  };\n  ContinuousView.prototype._dragHandle = function (handleIndex, isEnd,\n  // dx is event from ondragend if isEnd is true. It's not used\n  dx, dy) {\n    if (!this._useHandle) {\n      return;\n    }\n    this._dragging = !isEnd;\n    if (!isEnd) {\n      // Transform dx, dy to bar coordination.\n      var vertex = this._applyTransform([dx, dy], this._shapes.mainGroup, true);\n      this._updateInterval(handleIndex, vertex[1]);\n      this._hideIndicator();\n      // Considering realtime, update view should be executed\n      // before dispatch action.\n      this._updateView();\n    }\n    // dragEnd do not dispatch action when realtime.\n    if (isEnd === !this.visualMapModel.get('realtime')) {\n      // jshint ignore:line\n      this.api.dispatchAction({\n        type: 'selectDataRange',\n        from: this.uid,\n        visualMapId: this.visualMapModel.id,\n        selected: this._dataInterval.slice()\n      });\n    }\n    if (isEnd) {\n      !this._hovering && this._clearHoverLinkToSeries();\n    } else if (useHoverLinkOnHandle(this.visualMapModel)) {\n      this._doHoverLinkToSeries(this._handleEnds[handleIndex], false);\n    }\n  };\n  ContinuousView.prototype._resetInterval = function () {\n    var visualMapModel = this.visualMapModel;\n    var dataInterval = this._dataInterval = visualMapModel.getSelected();\n    var dataExtent = visualMapModel.getExtent();\n    var sizeExtent = [0, visualMapModel.itemSize[1]];\n    this._handleEnds = [linearMap(dataInterval[0], dataExtent, sizeExtent, true), linearMap(dataInterval[1], dataExtent, sizeExtent, true)];\n  };\n  /**\n   * @private\n   * @param {(number|string)} handleIndex 0 or 1 or 'all'\n   * @param {number} dx\n   * @param {number} dy\n   */\n  ContinuousView.prototype._updateInterval = function (handleIndex, delta) {\n    delta = delta || 0;\n    var visualMapModel = this.visualMapModel;\n    var handleEnds = this._handleEnds;\n    var sizeExtent = [0, visualMapModel.itemSize[1]];\n    sliderMove(delta, handleEnds, sizeExtent, handleIndex,\n    // cross is forbidden\n    0);\n    var dataExtent = visualMapModel.getExtent();\n    // Update data interval.\n    this._dataInterval = [linearMap(handleEnds[0], sizeExtent, dataExtent, true), linearMap(handleEnds[1], sizeExtent, dataExtent, true)];\n  };\n  ContinuousView.prototype._updateView = function (forSketch) {\n    var visualMapModel = this.visualMapModel;\n    var dataExtent = visualMapModel.getExtent();\n    var shapes = this._shapes;\n    var outOfRangeHandleEnds = [0, visualMapModel.itemSize[1]];\n    var inRangeHandleEnds = forSketch ? outOfRangeHandleEnds : this._handleEnds;\n    var visualInRange = this._createBarVisual(this._dataInterval, dataExtent, inRangeHandleEnds, 'inRange');\n    var visualOutOfRange = this._createBarVisual(dataExtent, dataExtent, outOfRangeHandleEnds, 'outOfRange');\n    shapes.inRange.setStyle({\n      fill: visualInRange.barColor\n      // opacity: visualInRange.opacity\n    }).setShape('points', visualInRange.barPoints);\n    shapes.outOfRange.setStyle({\n      fill: visualOutOfRange.barColor\n      // opacity: visualOutOfRange.opacity\n    }).setShape('points', visualOutOfRange.barPoints);\n    this._updateHandle(inRangeHandleEnds, visualInRange);\n  };\n  ContinuousView.prototype._createBarVisual = function (dataInterval, dataExtent, handleEnds, forceState) {\n    var opts = {\n      forceState: forceState,\n      convertOpacityToAlpha: true\n    };\n    var colorStops = this._makeColorGradient(dataInterval, opts);\n    var symbolSizes = [this.getControllerVisual(dataInterval[0], 'symbolSize', opts), this.getControllerVisual(dataInterval[1], 'symbolSize', opts)];\n    var barPoints = this._createBarPoints(handleEnds, symbolSizes);\n    return {\n      barColor: new LinearGradient(0, 0, 0, 1, colorStops),\n      barPoints: barPoints,\n      handlesColor: [colorStops[0].color, colorStops[colorStops.length - 1].color]\n    };\n  };\n  ContinuousView.prototype._makeColorGradient = function (dataInterval, opts) {\n    // Considering colorHue, which is not linear, so we have to sample\n    // to calculate gradient color stops, but not only calculate head\n    // and tail.\n    var sampleNumber = 100; // Arbitrary value.\n    var colorStops = [];\n    var step = (dataInterval[1] - dataInterval[0]) / sampleNumber;\n    colorStops.push({\n      color: this.getControllerVisual(dataInterval[0], 'color', opts),\n      offset: 0\n    });\n    for (var i = 1; i < sampleNumber; i++) {\n      var currValue = dataInterval[0] + step * i;\n      if (currValue > dataInterval[1]) {\n        break;\n      }\n      colorStops.push({\n        color: this.getControllerVisual(currValue, 'color', opts),\n        offset: i / sampleNumber\n      });\n    }\n    colorStops.push({\n      color: this.getControllerVisual(dataInterval[1], 'color', opts),\n      offset: 1\n    });\n    return colorStops;\n  };\n  ContinuousView.prototype._createBarPoints = function (handleEnds, symbolSizes) {\n    var itemSize = this.visualMapModel.itemSize;\n    return [[itemSize[0] - symbolSizes[0], handleEnds[0]], [itemSize[0], handleEnds[0]], [itemSize[0], handleEnds[1]], [itemSize[0] - symbolSizes[1], handleEnds[1]]];\n  };\n  ContinuousView.prototype._createBarGroup = function (itemAlign) {\n    var orient = this._orient;\n    var inverse = this.visualMapModel.get('inverse');\n    return new graphic.Group(orient === 'horizontal' && !inverse ? {\n      scaleX: itemAlign === 'bottom' ? 1 : -1,\n      rotation: Math.PI / 2\n    } : orient === 'horizontal' && inverse ? {\n      scaleX: itemAlign === 'bottom' ? -1 : 1,\n      rotation: -Math.PI / 2\n    } : orient === 'vertical' && !inverse ? {\n      scaleX: itemAlign === 'left' ? 1 : -1,\n      scaleY: -1\n    } : {\n      scaleX: itemAlign === 'left' ? 1 : -1\n    });\n  };\n  ContinuousView.prototype._updateHandle = function (handleEnds, visualInRange) {\n    if (!this._useHandle) {\n      return;\n    }\n    var shapes = this._shapes;\n    var visualMapModel = this.visualMapModel;\n    var handleThumbs = shapes.handleThumbs;\n    var handleLabels = shapes.handleLabels;\n    var itemSize = visualMapModel.itemSize;\n    var dataExtent = visualMapModel.getExtent();\n    var align = this._applyTransform('left', shapes.mainGroup);\n    each([0, 1], function (handleIndex) {\n      var handleThumb = handleThumbs[handleIndex];\n      handleThumb.setStyle('fill', visualInRange.handlesColor[handleIndex]);\n      handleThumb.y = handleEnds[handleIndex];\n      var val = linearMap(handleEnds[handleIndex], [0, itemSize[1]], dataExtent, true);\n      var symbolSize = this.getControllerVisual(val, 'symbolSize');\n      handleThumb.scaleX = handleThumb.scaleY = symbolSize / itemSize[0];\n      handleThumb.x = itemSize[0] - symbolSize / 2;\n      // Update handle label position.\n      var textPoint = graphic.applyTransform(shapes.handleLabelPoints[handleIndex], graphic.getTransform(handleThumb, this.group));\n      if (this._orient === 'horizontal') {\n        // If visualMap controls symbol size, an additional offset needs to be added to labels to avoid collision at minimum size.\n        // Offset reaches value of 0 at \"maximum\" position, so maximum position is not altered at all.\n        var minimumOffset = align === 'left' || align === 'top' ? (itemSize[0] - symbolSize) / 2 : (itemSize[0] - symbolSize) / -2;\n        textPoint[1] += minimumOffset;\n      }\n      handleLabels[handleIndex].setStyle({\n        x: textPoint[0],\n        y: textPoint[1],\n        text: visualMapModel.formatValueText(this._dataInterval[handleIndex]),\n        verticalAlign: 'middle',\n        align: this._orient === 'vertical' ? this._applyTransform('left', shapes.mainGroup) : 'center'\n      });\n    }, this);\n  };\n  ContinuousView.prototype._showIndicator = function (cursorValue, textValue, rangeSymbol, halfHoverLinkSize) {\n    var visualMapModel = this.visualMapModel;\n    var dataExtent = visualMapModel.getExtent();\n    var itemSize = visualMapModel.itemSize;\n    var sizeExtent = [0, itemSize[1]];\n    var shapes = this._shapes;\n    var indicator = shapes.indicator;\n    if (!indicator) {\n      return;\n    }\n    indicator.attr('invisible', false);\n    var opts = {\n      convertOpacityToAlpha: true\n    };\n    var color = this.getControllerVisual(cursorValue, 'color', opts);\n    var symbolSize = this.getControllerVisual(cursorValue, 'symbolSize');\n    var y = linearMap(cursorValue, dataExtent, sizeExtent, true);\n    var x = itemSize[0] - symbolSize / 2;\n    var oldIndicatorPos = {\n      x: indicator.x,\n      y: indicator.y\n    };\n    // Update handle label position.\n    indicator.y = y;\n    indicator.x = x;\n    var textPoint = graphic.applyTransform(shapes.indicatorLabelPoint, graphic.getTransform(indicator, this.group));\n    var indicatorLabel = shapes.indicatorLabel;\n    indicatorLabel.attr('invisible', false);\n    var align = this._applyTransform('left', shapes.mainGroup);\n    var orient = this._orient;\n    var isHorizontal = orient === 'horizontal';\n    indicatorLabel.setStyle({\n      text: (rangeSymbol ? rangeSymbol : '') + visualMapModel.formatValueText(textValue),\n      verticalAlign: isHorizontal ? align : 'middle',\n      align: isHorizontal ? 'center' : align\n    });\n    var indicatorNewProps = {\n      x: x,\n      y: y,\n      style: {\n        fill: color\n      }\n    };\n    var labelNewProps = {\n      style: {\n        x: textPoint[0],\n        y: textPoint[1]\n      }\n    };\n    if (visualMapModel.ecModel.isAnimationEnabled() && !this._firstShowIndicator) {\n      var animationCfg = {\n        duration: 100,\n        easing: 'cubicInOut',\n        additive: true\n      };\n      indicator.x = oldIndicatorPos.x;\n      indicator.y = oldIndicatorPos.y;\n      indicator.animateTo(indicatorNewProps, animationCfg);\n      indicatorLabel.animateTo(labelNewProps, animationCfg);\n    } else {\n      indicator.attr(indicatorNewProps);\n      indicatorLabel.attr(labelNewProps);\n    }\n    this._firstShowIndicator = false;\n    var handleLabels = this._shapes.handleLabels;\n    if (handleLabels) {\n      for (var i = 0; i < handleLabels.length; i++) {\n        // Fade out handle labels.\n        // NOTE: Must use api enter/leave on emphasis/blur/select state. Or the global states manager will change it.\n        this.api.enterBlur(handleLabels[i]);\n      }\n    }\n  };\n  ContinuousView.prototype._enableHoverLinkToSeries = function () {\n    var self = this;\n    this._shapes.mainGroup.on('mousemove', function (e) {\n      self._hovering = true;\n      if (!self._dragging) {\n        var itemSize = self.visualMapModel.itemSize;\n        var pos = self._applyTransform([e.offsetX, e.offsetY], self._shapes.mainGroup, true, true);\n        // For hover link show when hover handle, which might be\n        // below or upper than sizeExtent.\n        pos[1] = mathMin(mathMax(0, pos[1]), itemSize[1]);\n        self._doHoverLinkToSeries(pos[1], 0 <= pos[0] && pos[0] <= itemSize[0]);\n      }\n    }).on('mouseout', function () {\n      // When mouse is out of handle, hoverLink still need\n      // to be displayed when realtime is set as false.\n      self._hovering = false;\n      !self._dragging && self._clearHoverLinkToSeries();\n    });\n  };\n  ContinuousView.prototype._enableHoverLinkFromSeries = function () {\n    var zr = this.api.getZr();\n    if (this.visualMapModel.option.hoverLink) {\n      zr.on('mouseover', this._hoverLinkFromSeriesMouseOver, this);\n      zr.on('mouseout', this._hideIndicator, this);\n    } else {\n      this._clearHoverLinkFromSeries();\n    }\n  };\n  ContinuousView.prototype._doHoverLinkToSeries = function (cursorPos, hoverOnBar) {\n    var visualMapModel = this.visualMapModel;\n    var itemSize = visualMapModel.itemSize;\n    if (!visualMapModel.option.hoverLink) {\n      return;\n    }\n    var sizeExtent = [0, itemSize[1]];\n    var dataExtent = visualMapModel.getExtent();\n    // For hover link show when hover handle, which might be below or upper than sizeExtent.\n    cursorPos = mathMin(mathMax(sizeExtent[0], cursorPos), sizeExtent[1]);\n    var halfHoverLinkSize = getHalfHoverLinkSize(visualMapModel, dataExtent, sizeExtent);\n    var hoverRange = [cursorPos - halfHoverLinkSize, cursorPos + halfHoverLinkSize];\n    var cursorValue = linearMap(cursorPos, sizeExtent, dataExtent, true);\n    var valueRange = [linearMap(hoverRange[0], sizeExtent, dataExtent, true), linearMap(hoverRange[1], sizeExtent, dataExtent, true)];\n    // Consider data range is out of visualMap range, see test/visualMap-continuous.html,\n    // where china and india has very large population.\n    hoverRange[0] < sizeExtent[0] && (valueRange[0] = -Infinity);\n    hoverRange[1] > sizeExtent[1] && (valueRange[1] = Infinity);\n    // Do not show indicator when mouse is over handle,\n    // otherwise labels overlap, especially when dragging.\n    if (hoverOnBar) {\n      if (valueRange[0] === -Infinity) {\n        this._showIndicator(cursorValue, valueRange[1], '< ', halfHoverLinkSize);\n      } else if (valueRange[1] === Infinity) {\n        this._showIndicator(cursorValue, valueRange[0], '> ', halfHoverLinkSize);\n      } else {\n        this._showIndicator(cursorValue, cursorValue, '\u2248 ', halfHoverLinkSize);\n      }\n    }\n    // When realtime is set as false, handles, which are in barGroup,\n    // also trigger hoverLink, which help user to realize where they\n    // focus on when dragging. (see test/heatmap-large.html)\n    // When realtime is set as true, highlight will not show when hover\n    // handle, because the label on handle, which displays a exact value\n    // but not range, might mislead users.\n    var oldBatch = this._hoverLinkDataIndices;\n    var newBatch = [];\n    if (hoverOnBar || useHoverLinkOnHandle(visualMapModel)) {\n      newBatch = this._hoverLinkDataIndices = visualMapModel.findTargetDataIndices(valueRange);\n    }\n    var resultBatches = modelUtil.compressBatches(oldBatch, newBatch);\n    this._dispatchHighDown('downplay', helper.makeHighDownBatch(resultBatches[0], visualMapModel));\n    this._dispatchHighDown('highlight', helper.makeHighDownBatch(resultBatches[1], visualMapModel));\n  };\n  ContinuousView.prototype._hoverLinkFromSeriesMouseOver = function (e) {\n    var ecData;\n    findEventDispatcher(e.target, function (target) {\n      var currECData = getECData(target);\n      if (currECData.dataIndex != null) {\n        ecData = currECData;\n        return true;\n      }\n    }, true);\n    if (!ecData) {\n      return;\n    }\n    var dataModel = this.ecModel.getSeriesByIndex(ecData.seriesIndex);\n    var visualMapModel = this.visualMapModel;\n    if (!visualMapModel.isTargetSeries(dataModel)) {\n      return;\n    }\n    var data = dataModel.getData(ecData.dataType);\n    var value = data.getStore().get(visualMapModel.getDataDimensionIndex(data), ecData.dataIndex);\n    if (!isNaN(value)) {\n      this._showIndicator(value, value);\n    }\n  };\n  ContinuousView.prototype._hideIndicator = function () {\n    var shapes = this._shapes;\n    shapes.indicator && shapes.indicator.attr('invisible', true);\n    shapes.indicatorLabel && shapes.indicatorLabel.attr('invisible', true);\n    var handleLabels = this._shapes.handleLabels;\n    if (handleLabels) {\n      for (var i = 0; i < handleLabels.length; i++) {\n        // Fade out handle labels.\n        // NOTE: Must use api enter/leave on emphasis/blur/select state. Or the global states manager will change it.\n        this.api.leaveBlur(handleLabels[i]);\n      }\n    }\n  };\n  ContinuousView.prototype._clearHoverLinkToSeries = function () {\n    this._hideIndicator();\n    var indices = this._hoverLinkDataIndices;\n    this._dispatchHighDown('downplay', helper.makeHighDownBatch(indices, this.visualMapModel));\n    indices.length = 0;\n  };\n  ContinuousView.prototype._clearHoverLinkFromSeries = function () {\n    this._hideIndicator();\n    var zr = this.api.getZr();\n    zr.off('mouseover', this._hoverLinkFromSeriesMouseOver);\n    zr.off('mouseout', this._hideIndicator);\n  };\n  ContinuousView.prototype._applyTransform = function (vertex, element, inverse, global) {\n    var transform = graphic.getTransform(element, global ? null : this.group);\n    return zrUtil.isArray(vertex) ? graphic.applyTransform(vertex, transform, inverse) : graphic.transformDirection(vertex, transform, inverse);\n  };\n  // TODO: TYPE more specified payload types.\n  ContinuousView.prototype._dispatchHighDown = function (type, batch) {\n    batch && batch.length && this.api.dispatchAction({\n      type: type,\n      batch: batch\n    });\n  };\n  /**\n   * @override\n   */\n  ContinuousView.prototype.dispose = function () {\n    this._clearHoverLinkFromSeries();\n    this._clearHoverLinkToSeries();\n  };\n  ContinuousView.type = 'visualMap.continuous';\n  return ContinuousView;\n}(VisualMapView);\nfunction createPolygon(points, cursor, onDrift, onDragEnd) {\n  return new graphic.Polygon({\n    shape: {\n      points: points\n    },\n    draggable: !!onDrift,\n    cursor: cursor,\n    drift: onDrift,\n    onmousemove: function (e) {\n      // For mobile device, prevent screen slider on the button.\n      eventTool.stop(e.event);\n    },\n    ondragend: onDragEnd\n  });\n}\nfunction getHalfHoverLinkSize(visualMapModel, dataExtent, sizeExtent) {\n  var halfHoverLinkSize = HOVER_LINK_SIZE / 2;\n  var hoverLinkDataSize = visualMapModel.get('hoverLinkDataSize');\n  if (hoverLinkDataSize) {\n    halfHoverLinkSize = linearMap(hoverLinkDataSize, dataExtent, sizeExtent, true) / 2;\n  }\n  return halfHoverLinkSize;\n}\nfunction useHoverLinkOnHandle(visualMapModel) {\n  var hoverLinkOnHandle = visualMapModel.get('hoverLinkOnHandle');\n  return !!(hoverLinkOnHandle == null ? visualMapModel.get('realtime') : hoverLinkOnHandle);\n}\nfunction getCursor(orient) {\n  return orient === 'vertical' ? 'ns-resize' : 'ew-resize';\n}\nexport default ContinuousView;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nexport var visualMapActionInfo = {\n  type: 'selectDataRange',\n  event: 'dataRangeSelected',\n  // FIXME use updateView appears wrong\n  update: 'update'\n};\nexport var visualMapActionHander = function (payload, ecModel) {\n  ecModel.eachComponent({\n    mainType: 'visualMap',\n    query: payload\n  }, function (model) {\n    model.setSelected(payload.selected);\n  });\n};", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as visualSolution from '../../visual/visualSolution.js';\nimport VisualMapping from '../../visual/VisualMapping.js';\nimport { getVisualFromData } from '../../visual/helper.js';\nexport var visualMapEncodingHandlers = [{\n  createOnAllSeries: true,\n  reset: function (seriesModel, ecModel) {\n    var resetDefines = [];\n    ecModel.eachComponent('visualMap', function (visualMapModel) {\n      var pipelineContext = seriesModel.pipelineContext;\n      if (!visualMapModel.isTargetSeries(seriesModel) || pipelineContext && pipelineContext.large) {\n        return;\n      }\n      resetDefines.push(visualSolution.incrementalApplyVisual(visualMapModel.stateList, visualMapModel.targetVisuals, zrUtil.bind(visualMapModel.getValueState, visualMapModel), visualMapModel.getDataDimensionIndex(seriesModel.getData())));\n    });\n    return resetDefines;\n  }\n},\n// Only support color.\n{\n  createOnAllSeries: true,\n  reset: function (seriesModel, ecModel) {\n    var data = seriesModel.getData();\n    var visualMetaList = [];\n    ecModel.eachComponent('visualMap', function (visualMapModel) {\n      if (visualMapModel.isTargetSeries(seriesModel)) {\n        var visualMeta = visualMapModel.getVisualMeta(zrUtil.bind(getColorVisual, null, seriesModel, visualMapModel)) || {\n          stops: [],\n          outerColors: []\n        };\n        var dimIdx = visualMapModel.getDataDimensionIndex(data);\n        if (dimIdx >= 0) {\n          // visualMeta.dimension should be dimension index, but not concrete dimension.\n          visualMeta.dimension = dimIdx;\n          visualMetaList.push(visualMeta);\n        }\n      }\n    });\n    // console.log(JSON.stringify(visualMetaList.map(a => a.stops)));\n    seriesModel.getData().setVisual('visualMeta', visualMetaList);\n  }\n}];\n// FIXME\n// performance and export for heatmap?\n// value can be Infinity or -Infinity\nfunction getColorVisual(seriesModel, visualMapModel, value, valueState) {\n  var mappings = visualMapModel.targetVisuals[valueState];\n  var visualTypes = VisualMapping.prepareVisualTypes(mappings);\n  var resultVisual = {\n    color: getVisualFromData(seriesModel.getData(), 'color') // default color.\n  };\n  for (var i = 0, len = visualTypes.length; i < len; i++) {\n    var type = visualTypes[i];\n    var mapping = mappings[type === 'opacity' ? '__alphaForOpacity' : type];\n    mapping && mapping.applyVisual(value, getVisual, setVisual);\n  }\n  return resultVisual.color;\n  function getVisual(key) {\n    return resultVisual[key];\n  }\n  function setVisual(key, value) {\n    resultVisual[key] = value;\n  }\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n// @ts-nocheck\nimport * as zrUtil from 'zrender/lib/core/util.js';\nvar each = zrUtil.each;\nexport default function visualMapPreprocessor(option) {\n  var visualMap = option && option.visualMap;\n  if (!zrUtil.isArray(visualMap)) {\n    visualMap = visualMap ? [visualMap] : [];\n  }\n  each(visualMap, function (opt) {\n    if (!opt) {\n      return;\n    }\n    // rename splitList to pieces\n    if (has(opt, 'splitList') && !has(opt, 'pieces')) {\n      opt.pieces = opt.splitList;\n      delete opt.splitList;\n    }\n    var pieces = opt.pieces;\n    if (pieces && zrUtil.isArray(pieces)) {\n      each(pieces, function (piece) {\n        if (zrUtil.isObject(piece)) {\n          if (has(piece, 'start') && !has(piece, 'min')) {\n            piece.min = piece.start;\n          }\n          if (has(piece, 'end') && !has(piece, 'max')) {\n            piece.max = piece.end;\n          }\n        }\n      });\n    }\n  });\n}\nfunction has(obj, name) {\n  return obj && obj.hasOwnProperty && obj.hasOwnProperty(name);\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { visualMapActionInfo, visualMapActionHander } from './visualMapAction.js';\nimport { visualMapEncodingHandlers } from './visualEncoding.js';\nimport { each } from 'zrender/lib/core/util.js';\nimport preprocessor from './preprocessor.js';\nvar installed = false;\nexport default function installCommon(registers) {\n  if (installed) {\n    return;\n  }\n  installed = true;\n  registers.registerSubTypeDefaulter('visualMap', function (option) {\n    // Compatible with ec2, when splitNumber === 0, continuous visualMap will be used.\n    return !option.categories && (!(option.pieces ? option.pieces.length > 0 : option.splitNumber > 0) || option.calculable) ? 'continuous' : 'piecewise';\n  });\n  registers.registerAction(visualMapActionInfo, visualMapActionHander);\n  each(visualMapEncodingHandlers, function (handler) {\n    registers.registerVisual(registers.PRIORITY.VISUAL.COMPONENT, handler);\n  });\n  registers.registerPreprocessor(preprocessor);\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport ContinuousModel from './ContinuousModel.js';\nimport ContinuousView from './ContinuousView.js';\nimport installCommon from './installCommon.js';\nexport function install(registers) {\n  registers.registerComponentModel(ContinuousModel);\n  registers.registerComponentView(ContinuousView);\n  installCommon(registers);\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport VisualMapModel from './VisualMapModel.js';\nimport VisualMapping from '../../visual/VisualMapping.js';\nimport visualDefault from '../../visual/visualDefault.js';\nimport { reformIntervals } from '../../util/number.js';\nimport { inheritDefaultOption } from '../../util/component.js';\nvar PiecewiseModel = /** @class */function (_super) {\n  __extends(PiecewiseModel, _super);\n  function PiecewiseModel() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = PiecewiseModel.type;\n    /**\n     * The order is always [low, ..., high].\n     * [{text: string, interval: Array.<number>}, ...]\n     */\n    _this._pieceList = [];\n    return _this;\n  }\n  PiecewiseModel.prototype.optionUpdated = function (newOption, isInit) {\n    _super.prototype.optionUpdated.apply(this, arguments);\n    this.resetExtent();\n    var mode = this._mode = this._determineMode();\n    this._pieceList = [];\n    resetMethods[this._mode].call(this, this._pieceList);\n    this._resetSelected(newOption, isInit);\n    var categories = this.option.categories;\n    this.resetVisual(function (mappingOption, state) {\n      if (mode === 'categories') {\n        mappingOption.mappingMethod = 'category';\n        mappingOption.categories = zrUtil.clone(categories);\n      } else {\n        mappingOption.dataExtent = this.getExtent();\n        mappingOption.mappingMethod = 'piecewise';\n        mappingOption.pieceList = zrUtil.map(this._pieceList, function (piece) {\n          piece = zrUtil.clone(piece);\n          if (state !== 'inRange') {\n            // FIXME\n            // outOfRange do not support special visual in pieces.\n            piece.visual = null;\n          }\n          return piece;\n        });\n      }\n    });\n  };\n  /**\n   * @protected\n   * @override\n   */\n  PiecewiseModel.prototype.completeVisualOption = function () {\n    // Consider this case:\n    // visualMap: {\n    //      pieces: [{symbol: 'circle', lt: 0}, {symbol: 'rect', gte: 0}]\n    // }\n    // where no inRange/outOfRange set but only pieces. So we should make\n    // default inRange/outOfRange for this case, otherwise visuals that only\n    // appear in `pieces` will not be taken into account in visual encoding.\n    var option = this.option;\n    var visualTypesInPieces = {};\n    var visualTypes = VisualMapping.listVisualTypes();\n    var isCategory = this.isCategory();\n    zrUtil.each(option.pieces, function (piece) {\n      zrUtil.each(visualTypes, function (visualType) {\n        if (piece.hasOwnProperty(visualType)) {\n          visualTypesInPieces[visualType] = 1;\n        }\n      });\n    });\n    zrUtil.each(visualTypesInPieces, function (v, visualType) {\n      var exists = false;\n      zrUtil.each(this.stateList, function (state) {\n        exists = exists || has(option, state, visualType) || has(option.target, state, visualType);\n      }, this);\n      !exists && zrUtil.each(this.stateList, function (state) {\n        (option[state] || (option[state] = {}))[visualType] = visualDefault.get(visualType, state === 'inRange' ? 'active' : 'inactive', isCategory);\n      });\n    }, this);\n    function has(obj, state, visualType) {\n      return obj && obj[state] && obj[state].hasOwnProperty(visualType);\n    }\n    _super.prototype.completeVisualOption.apply(this, arguments);\n  };\n  PiecewiseModel.prototype._resetSelected = function (newOption, isInit) {\n    var thisOption = this.option;\n    var pieceList = this._pieceList;\n    // Selected do not merge but all override.\n    var selected = (isInit ? thisOption : newOption).selected || {};\n    thisOption.selected = selected;\n    // Consider 'not specified' means true.\n    zrUtil.each(pieceList, function (piece, index) {\n      var key = this.getSelectedMapKey(piece);\n      if (!selected.hasOwnProperty(key)) {\n        selected[key] = true;\n      }\n    }, this);\n    if (thisOption.selectedMode === 'single') {\n      // Ensure there is only one selected.\n      var hasSel_1 = false;\n      zrUtil.each(pieceList, function (piece, index) {\n        var key = this.getSelectedMapKey(piece);\n        if (selected[key]) {\n          hasSel_1 ? selected[key] = false : hasSel_1 = true;\n        }\n      }, this);\n    }\n    // thisOption.selectedMode === 'multiple', default: all selected.\n  };\n  /**\n   * @public\n   */\n  PiecewiseModel.prototype.getItemSymbol = function () {\n    return this.get('itemSymbol');\n  };\n  /**\n   * @public\n   */\n  PiecewiseModel.prototype.getSelectedMapKey = function (piece) {\n    return this._mode === 'categories' ? piece.value + '' : piece.index + '';\n  };\n  /**\n   * @public\n   */\n  PiecewiseModel.prototype.getPieceList = function () {\n    return this._pieceList;\n  };\n  /**\n   * @return {string}\n   */\n  PiecewiseModel.prototype._determineMode = function () {\n    var option = this.option;\n    return option.pieces && option.pieces.length > 0 ? 'pieces' : this.option.categories ? 'categories' : 'splitNumber';\n  };\n  /**\n   * @override\n   */\n  PiecewiseModel.prototype.setSelected = function (selected) {\n    this.option.selected = zrUtil.clone(selected);\n  };\n  /**\n   * @override\n   */\n  PiecewiseModel.prototype.getValueState = function (value) {\n    var index = VisualMapping.findPieceIndex(value, this._pieceList);\n    return index != null ? this.option.selected[this.getSelectedMapKey(this._pieceList[index])] ? 'inRange' : 'outOfRange' : 'outOfRange';\n  };\n  /**\n   * @public\n   * @param pieceIndex piece index in visualMapModel.getPieceList()\n   */\n  PiecewiseModel.prototype.findTargetDataIndices = function (pieceIndex) {\n    var result = [];\n    var pieceList = this._pieceList;\n    this.eachTargetSeries(function (seriesModel) {\n      var dataIndices = [];\n      var data = seriesModel.getData();\n      data.each(this.getDataDimensionIndex(data), function (value, dataIndex) {\n        // Should always base on model pieceList, because it is order sensitive.\n        var pIdx = VisualMapping.findPieceIndex(value, pieceList);\n        pIdx === pieceIndex && dataIndices.push(dataIndex);\n      }, this);\n      result.push({\n        seriesId: seriesModel.id,\n        dataIndex: dataIndices\n      });\n    }, this);\n    return result;\n  };\n  /**\n   * @private\n   * @param piece piece.value or piece.interval is required.\n   * @return  Can be Infinity or -Infinity\n   */\n  PiecewiseModel.prototype.getRepresentValue = function (piece) {\n    var representValue;\n    if (this.isCategory()) {\n      representValue = piece.value;\n    } else {\n      if (piece.value != null) {\n        representValue = piece.value;\n      } else {\n        var pieceInterval = piece.interval || [];\n        representValue = pieceInterval[0] === -Infinity && pieceInterval[1] === Infinity ? 0 : (pieceInterval[0] + pieceInterval[1]) / 2;\n      }\n    }\n    return representValue;\n  };\n  PiecewiseModel.prototype.getVisualMeta = function (getColorVisual) {\n    // Do not support category. (category axis is ordinal, numerical)\n    if (this.isCategory()) {\n      return;\n    }\n    var stops = [];\n    var outerColors = ['', ''];\n    var visualMapModel = this;\n    function setStop(interval, valueState) {\n      var representValue = visualMapModel.getRepresentValue({\n        interval: interval\n      }); // Not category\n      if (!valueState) {\n        valueState = visualMapModel.getValueState(representValue);\n      }\n      var color = getColorVisual(representValue, valueState);\n      if (interval[0] === -Infinity) {\n        outerColors[0] = color;\n      } else if (interval[1] === Infinity) {\n        outerColors[1] = color;\n      } else {\n        stops.push({\n          value: interval[0],\n          color: color\n        }, {\n          value: interval[1],\n          color: color\n        });\n      }\n    }\n    // Suplement\n    var pieceList = this._pieceList.slice();\n    if (!pieceList.length) {\n      pieceList.push({\n        interval: [-Infinity, Infinity]\n      });\n    } else {\n      var edge = pieceList[0].interval[0];\n      edge !== -Infinity && pieceList.unshift({\n        interval: [-Infinity, edge]\n      });\n      edge = pieceList[pieceList.length - 1].interval[1];\n      edge !== Infinity && pieceList.push({\n        interval: [edge, Infinity]\n      });\n    }\n    var curr = -Infinity;\n    zrUtil.each(pieceList, function (piece) {\n      var interval = piece.interval;\n      if (interval) {\n        // Fulfill gap.\n        interval[0] > curr && setStop([curr, interval[0]], 'outOfRange');\n        setStop(interval.slice());\n        curr = interval[1];\n      }\n    }, this);\n    return {\n      stops: stops,\n      outerColors: outerColors\n    };\n  };\n  PiecewiseModel.type = 'visualMap.piecewise';\n  PiecewiseModel.defaultOption = inheritDefaultOption(VisualMapModel.defaultOption, {\n    selected: null,\n    minOpen: false,\n    maxOpen: false,\n    align: 'auto',\n    itemWidth: 20,\n    itemHeight: 14,\n    itemSymbol: 'roundRect',\n    pieces: null,\n    categories: null,\n    splitNumber: 5,\n    selectedMode: 'multiple',\n    itemGap: 10,\n    hoverLink: true // Enable hover highlight.\n  });\n  return PiecewiseModel;\n}(VisualMapModel);\n;\n/**\n * Key is this._mode\n * @type {Object}\n * @this {module:echarts/component/viusalMap/PiecewiseMode}\n */\nvar resetMethods = {\n  splitNumber: function (outPieceList) {\n    var thisOption = this.option;\n    var precision = Math.min(thisOption.precision, 20);\n    var dataExtent = this.getExtent();\n    var splitNumber = thisOption.splitNumber;\n    splitNumber = Math.max(parseInt(splitNumber, 10), 1);\n    thisOption.splitNumber = splitNumber;\n    var splitStep = (dataExtent[1] - dataExtent[0]) / splitNumber;\n    // Precision auto-adaption\n    while (+splitStep.toFixed(precision) !== splitStep && precision < 5) {\n      precision++;\n    }\n    thisOption.precision = precision;\n    splitStep = +splitStep.toFixed(precision);\n    if (thisOption.minOpen) {\n      outPieceList.push({\n        interval: [-Infinity, dataExtent[0]],\n        close: [0, 0]\n      });\n    }\n    for (var index = 0, curr = dataExtent[0]; index < splitNumber; curr += splitStep, index++) {\n      var max = index === splitNumber - 1 ? dataExtent[1] : curr + splitStep;\n      outPieceList.push({\n        interval: [curr, max],\n        close: [1, 1]\n      });\n    }\n    if (thisOption.maxOpen) {\n      outPieceList.push({\n        interval: [dataExtent[1], Infinity],\n        close: [0, 0]\n      });\n    }\n    reformIntervals(outPieceList);\n    zrUtil.each(outPieceList, function (piece, index) {\n      piece.index = index;\n      piece.text = this.formatValueText(piece.interval);\n    }, this);\n  },\n  categories: function (outPieceList) {\n    var thisOption = this.option;\n    zrUtil.each(thisOption.categories, function (cate) {\n      // FIXME category\u6A21\u5F0F\u4E5F\u4F7F\u7528pieceList\uFF0C\u4F46\u5728visualMapping\u4E2D\u4E0D\u662F\u4F7F\u7528pieceList\u3002\n      // \u662F\u5426\u6539\u4E00\u81F4\u3002\n      outPieceList.push({\n        text: this.formatValueText(cate, true),\n        value: cate\n      });\n    }, this);\n    // See \"Order Rule\".\n    normalizeReverse(thisOption, outPieceList);\n  },\n  pieces: function (outPieceList) {\n    var thisOption = this.option;\n    zrUtil.each(thisOption.pieces, function (pieceListItem, index) {\n      if (!zrUtil.isObject(pieceListItem)) {\n        pieceListItem = {\n          value: pieceListItem\n        };\n      }\n      var item = {\n        text: '',\n        index: index\n      };\n      if (pieceListItem.label != null) {\n        item.text = pieceListItem.label;\n      }\n      if (pieceListItem.hasOwnProperty('value')) {\n        var value = item.value = pieceListItem.value;\n        item.interval = [value, value];\n        item.close = [1, 1];\n      } else {\n        // `min` `max` is legacy option.\n        // `lt` `gt` `lte` `gte` is recommended.\n        var interval = item.interval = [];\n        var close_1 = item.close = [0, 0];\n        var closeList = [1, 0, 1];\n        var infinityList = [-Infinity, Infinity];\n        var useMinMax = [];\n        for (var lg = 0; lg < 2; lg++) {\n          var names = [['gte', 'gt', 'min'], ['lte', 'lt', 'max']][lg];\n          for (var i = 0; i < 3 && interval[lg] == null; i++) {\n            interval[lg] = pieceListItem[names[i]];\n            close_1[lg] = closeList[i];\n            useMinMax[lg] = i === 2;\n          }\n          interval[lg] == null && (interval[lg] = infinityList[lg]);\n        }\n        useMinMax[0] && interval[1] === Infinity && (close_1[0] = 0);\n        useMinMax[1] && interval[0] === -Infinity && (close_1[1] = 0);\n        if (process.env.NODE_ENV !== 'production') {\n          if (interval[0] > interval[1]) {\n            console.warn('Piece ' + index + 'is illegal: ' + interval + ' lower bound should not greater then uppper bound.');\n          }\n        }\n        if (interval[0] === interval[1] && close_1[0] && close_1[1]) {\n          // Consider: [{min: 5, max: 5, visual: {...}}, {min: 0, max: 5}],\n          // we use value to lift the priority when min === max\n          item.value = interval[0];\n        }\n      }\n      item.visual = VisualMapping.retrieveVisuals(pieceListItem);\n      outPieceList.push(item);\n    }, this);\n    // See \"Order Rule\".\n    normalizeReverse(thisOption, outPieceList);\n    // Only pieces\n    reformIntervals(outPieceList);\n    zrUtil.each(outPieceList, function (piece) {\n      var close = piece.close;\n      var edgeSymbols = [['<', '\u2264'][close[1]], ['>', '\u2265'][close[0]]];\n      piece.text = piece.text || this.formatValueText(piece.value != null ? piece.value : piece.interval, false, edgeSymbols);\n    }, this);\n  }\n};\nfunction normalizeReverse(thisOption, pieceList) {\n  var inverse = thisOption.inverse;\n  if (thisOption.orient === 'vertical' ? !inverse : inverse) {\n    pieceList.reverse();\n  }\n}\nexport default PiecewiseModel;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport VisualMapView from './VisualMapView.js';\nimport * as graphic from '../../util/graphic.js';\nimport { createSymbol } from '../../util/symbol.js';\nimport * as layout from '../../util/layout.js';\nimport * as helper from './helper.js';\nimport { createTextStyle } from '../../label/labelStyle.js';\nvar PiecewiseVisualMapView = /** @class */function (_super) {\n  __extends(PiecewiseVisualMapView, _super);\n  function PiecewiseVisualMapView() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = PiecewiseVisualMapView.type;\n    return _this;\n  }\n  PiecewiseVisualMapView.prototype.doRender = function () {\n    var thisGroup = this.group;\n    thisGroup.removeAll();\n    var visualMapModel = this.visualMapModel;\n    var textGap = visualMapModel.get('textGap');\n    var textStyleModel = visualMapModel.textStyleModel;\n    var itemAlign = this._getItemAlign();\n    var itemSize = visualMapModel.itemSize;\n    var viewData = this._getViewData();\n    var endsText = viewData.endsText;\n    var showLabel = zrUtil.retrieve(visualMapModel.get('showLabel', true), !endsText);\n    var silent = !visualMapModel.get('selectedMode');\n    endsText && this._renderEndsText(thisGroup, endsText[0], itemSize, showLabel, itemAlign);\n    zrUtil.each(viewData.viewPieceList, function (item) {\n      var piece = item.piece;\n      var itemGroup = new graphic.Group();\n      itemGroup.onclick = zrUtil.bind(this._onItemClick, this, piece);\n      this._enableHoverLink(itemGroup, item.indexInModelPieceList);\n      // TODO Category\n      var representValue = visualMapModel.getRepresentValue(piece);\n      this._createItemSymbol(itemGroup, representValue, [0, 0, itemSize[0], itemSize[1]], silent);\n      if (showLabel) {\n        var visualState = this.visualMapModel.getValueState(representValue);\n        var align = textStyleModel.get('align') || itemAlign;\n        itemGroup.add(new graphic.Text({\n          style: createTextStyle(textStyleModel, {\n            x: align === 'right' ? -textGap : itemSize[0] + textGap,\n            y: itemSize[1] / 2,\n            text: piece.text,\n            verticalAlign: textStyleModel.get('verticalAlign') || 'middle',\n            align: align,\n            opacity: zrUtil.retrieve2(textStyleModel.get('opacity'), visualState === 'outOfRange' ? 0.5 : 1)\n          }),\n          silent: silent\n        }));\n      }\n      thisGroup.add(itemGroup);\n    }, this);\n    endsText && this._renderEndsText(thisGroup, endsText[1], itemSize, showLabel, itemAlign);\n    layout.box(visualMapModel.get('orient'), thisGroup, visualMapModel.get('itemGap'));\n    this.renderBackground(thisGroup);\n    this.positionGroup(thisGroup);\n  };\n  PiecewiseVisualMapView.prototype._enableHoverLink = function (itemGroup, pieceIndex) {\n    var _this = this;\n    itemGroup.on('mouseover', function () {\n      return onHoverLink('highlight');\n    }).on('mouseout', function () {\n      return onHoverLink('downplay');\n    });\n    var onHoverLink = function (method) {\n      var visualMapModel = _this.visualMapModel;\n      // TODO: TYPE More detailed action types\n      visualMapModel.option.hoverLink && _this.api.dispatchAction({\n        type: method,\n        batch: helper.makeHighDownBatch(visualMapModel.findTargetDataIndices(pieceIndex), visualMapModel)\n      });\n    };\n  };\n  PiecewiseVisualMapView.prototype._getItemAlign = function () {\n    var visualMapModel = this.visualMapModel;\n    var modelOption = visualMapModel.option;\n    if (modelOption.orient === 'vertical') {\n      return helper.getItemAlign(visualMapModel, this.api, visualMapModel.itemSize);\n    } else {\n      // horizontal, most case left unless specifying right.\n      var align = modelOption.align;\n      if (!align || align === 'auto') {\n        align = 'left';\n      }\n      return align;\n    }\n  };\n  PiecewiseVisualMapView.prototype._renderEndsText = function (group, text, itemSize, showLabel, itemAlign) {\n    if (!text) {\n      return;\n    }\n    var itemGroup = new graphic.Group();\n    var textStyleModel = this.visualMapModel.textStyleModel;\n    itemGroup.add(new graphic.Text({\n      style: createTextStyle(textStyleModel, {\n        x: showLabel ? itemAlign === 'right' ? itemSize[0] : 0 : itemSize[0] / 2,\n        y: itemSize[1] / 2,\n        verticalAlign: 'middle',\n        align: showLabel ? itemAlign : 'center',\n        text: text\n      })\n    }));\n    group.add(itemGroup);\n  };\n  /**\n   * @private\n   * @return {Object} {peiceList, endsText} The order is the same as screen pixel order.\n   */\n  PiecewiseVisualMapView.prototype._getViewData = function () {\n    var visualMapModel = this.visualMapModel;\n    var viewPieceList = zrUtil.map(visualMapModel.getPieceList(), function (piece, index) {\n      return {\n        piece: piece,\n        indexInModelPieceList: index\n      };\n    });\n    var endsText = visualMapModel.get('text');\n    // Consider orient and inverse.\n    var orient = visualMapModel.get('orient');\n    var inverse = visualMapModel.get('inverse');\n    // Order of model pieceList is always [low, ..., high]\n    if (orient === 'horizontal' ? inverse : !inverse) {\n      viewPieceList.reverse();\n    }\n    // Origin order of endsText is [high, low]\n    else if (endsText) {\n      endsText = endsText.slice().reverse();\n    }\n    return {\n      viewPieceList: viewPieceList,\n      endsText: endsText\n    };\n  };\n  PiecewiseVisualMapView.prototype._createItemSymbol = function (group, representValue, shapeParam, silent) {\n    var itemSymbol = createSymbol(\n    // symbol will be string\n    this.getControllerVisual(representValue, 'symbol'), shapeParam[0], shapeParam[1], shapeParam[2], shapeParam[3],\n    // color will be string\n    this.getControllerVisual(representValue, 'color'));\n    itemSymbol.silent = silent;\n    group.add(itemSymbol);\n  };\n  PiecewiseVisualMapView.prototype._onItemClick = function (piece) {\n    var visualMapModel = this.visualMapModel;\n    var option = visualMapModel.option;\n    var selectedMode = option.selectedMode;\n    if (!selectedMode) {\n      return;\n    }\n    var selected = zrUtil.clone(option.selected);\n    var newKey = visualMapModel.getSelectedMapKey(piece);\n    if (selectedMode === 'single' || selectedMode === true) {\n      selected[newKey] = true;\n      zrUtil.each(selected, function (o, key) {\n        selected[key] = key === newKey;\n      });\n    } else {\n      selected[newKey] = !selected[newKey];\n    }\n    this.api.dispatchAction({\n      type: 'selectDataRange',\n      from: this.uid,\n      visualMapId: this.visualMapModel.id,\n      selected: selected\n    });\n  };\n  PiecewiseVisualMapView.type = 'visualMap.piecewise';\n  return PiecewiseVisualMapView;\n}(VisualMapView);\nexport default PiecewiseVisualMapView;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport PiecewiseModel from './PiecewiseModel.js';\nimport PiecewiseView from './PiecewiseView.js';\nimport installCommon from './installCommon.js';\nexport function install(registers) {\n  registers.registerComponentModel(PiecewiseModel);\n  registers.registerComponentView(PiecewiseView);\n  installCommon(registers);\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { use } from '../../extension.js';\nimport { install as installVisualMapContinuous } from './installVisualMapContinuous.js';\nimport { install as installVisualMapPiecewise } from './installVisualMapPiecewise.js';\nexport function install(registers) {\n  use(installVisualMapContinuous);\n  use(installVisualMapPiecewise);\n  // Do not install './dataZoomSelect',\n  // since it only work for toolbox dataZoom.\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { calcZ2Range } from '../../util/graphic.js';\n/**\n * [CAVEAT]: the call order of `ThumbnailView['render']` and other\n *  `ChartView['render']/ComponentView['render']` is not guaranteed.\n */\nvar ThumbnailBridgeImpl = /** @class */function () {\n  function ThumbnailBridgeImpl(thumbnailModel) {\n    this._thumbnailModel = thumbnailModel;\n  }\n  ThumbnailBridgeImpl.prototype.reset = function (api) {\n    this._renderVersion = api.getMainProcessVersion();\n  };\n  ThumbnailBridgeImpl.prototype.renderContent = function (opt) {\n    var thumbnailView = opt.api.getViewOfComponentModel(this._thumbnailModel);\n    if (!thumbnailView) {\n      return;\n    }\n    opt.group.silent = true;\n    thumbnailView.renderContent({\n      group: opt.group,\n      targetTrans: opt.targetTrans,\n      z2Range: calcZ2Range(opt.group),\n      roamType: opt.roamType,\n      viewportRect: opt.viewportRect,\n      renderVersion: this._renderVersion\n    });\n  };\n  ThumbnailBridgeImpl.prototype.updateWindow = function (targetTrans, api) {\n    var thumbnailView = api.getViewOfComponentModel(this._thumbnailModel);\n    if (!thumbnailView) {\n      return;\n    }\n    thumbnailView.updateWindow({\n      targetTrans: targetTrans,\n      renderVersion: this._renderVersion\n    });\n  };\n  return ThumbnailBridgeImpl;\n}();\nexport { ThumbnailBridgeImpl };", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport ComponentModel from '../../model/Component.js';\nimport { error } from '../../util/log.js';\nimport tokens from '../../visual/tokens.js';\nimport { injectThumbnailBridge } from '../helper/thumbnailBridge.js';\nimport { ThumbnailBridgeImpl } from './ThumbnailBridgeImpl.js';\nvar ThumbnailModel = /** @class */function (_super) {\n  __extends(ThumbnailModel, _super);\n  function ThumbnailModel() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = ThumbnailModel.type;\n    _this.preventAutoZ = true;\n    return _this;\n  }\n  ThumbnailModel.prototype.optionUpdated = function (newCptOption, isInit) {\n    this._updateBridge();\n  };\n  ThumbnailModel.prototype._updateBridge = function () {\n    var bridge = this._birdge = this._birdge || new ThumbnailBridgeImpl(this);\n    // Clear all, in case of option changed.\n    this._target = null;\n    this.ecModel.eachSeries(function (series) {\n      injectThumbnailBridge(series, null);\n    });\n    if (this.shouldShow()) {\n      var target = this.getTarget();\n      // If a component is targeted by more than one thumbnails, simply only the last one works.\n      injectThumbnailBridge(target.baseMapProvider, bridge);\n    }\n  };\n  ThumbnailModel.prototype.shouldShow = function () {\n    return this.getShallow('show', true);\n  };\n  ThumbnailModel.prototype.getBridge = function () {\n    return this._birdge;\n  };\n  ThumbnailModel.prototype.getTarget = function () {\n    if (this._target) {\n      return this._target;\n    }\n    // Find by `seriesId`/`seriesIndex`.\n    var series = this.getReferringComponents('series', {\n      useDefault: false,\n      enableAll: false,\n      enableNone: false\n    }).models[0];\n    if (series) {\n      if (series.subType !== 'graph') {\n        series = null;\n        if (process.env.NODE_ENV !== 'production') {\n          error(\"series.\" + series.subType + \" is not supported in thumbnail.\", true);\n        }\n      }\n    } else {\n      // If no xxxId and xxxIndex specified, find the first series.graph. If other components,\n      // such as geo, is supported in future, the default stretagy may be extended.\n      series = this.ecModel.queryComponents({\n        mainType: 'series',\n        subType: 'graph'\n      })[0];\n    }\n    this._target = {\n      baseMapProvider: series\n    };\n    return this._target;\n  };\n  ThumbnailModel.type = 'thumbnail';\n  ThumbnailModel.layoutMode = 'box';\n  // All the supported components should be added here.\n  ThumbnailModel.dependencies = ['series', 'geo'];\n  ThumbnailModel.defaultOption = {\n    show: true,\n    right: 1,\n    bottom: 1,\n    height: '25%',\n    width: '25%',\n    itemStyle: {\n      // Use echarts option.backgorundColor by default.\n      borderColor: tokens.color.border,\n      borderWidth: 2\n    },\n    windowStyle: {\n      borderWidth: 1,\n      color: tokens.color.neutral30,\n      borderColor: tokens.color.neutral40,\n      opacity: 0.3\n    },\n    z: 10\n  };\n  return ThumbnailModel;\n}(ComponentModel);\nexport { ThumbnailModel };", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport ComponentView from '../../view/Component.js';\nimport BoundingRect from 'zrender/lib/core/BoundingRect.js';\nimport * as matrix from 'zrender/lib/core/matrix.js';\nimport RoamController from '../helper/RoamController.js';\nimport tokens from '../../visual/tokens.js';\nimport { createBoxLayoutReference, getBoxLayoutParams, getLayoutRect } from '../../util/layout.js';\nimport { expandOrShrinkRect, Rect, Group, traverseUpdateZ, retrieveZInfo } from '../../util/graphic.js';\nimport { applyTransform } from 'zrender/lib/core/vector.js';\nimport View from '../../coord/View.js';\nimport { bind, defaults, extend } from 'zrender/lib/core/util.js';\nvar ThumbnailView = /** @class */function (_super) {\n  __extends(ThumbnailView, _super);\n  function ThumbnailView() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = ThumbnailView.type;\n    return _this;\n  }\n  ThumbnailView.prototype.render = function (thumbnailModel, ecModel, api) {\n    this._api = api;\n    this._model = thumbnailModel;\n    if (!this._coordSys) {\n      this._coordSys = new View();\n    }\n    if (!this._isEnabled()) {\n      this._clear();\n      return;\n    }\n    this._renderVersion = api.getMainProcessVersion();\n    var group = this.group;\n    group.removeAll();\n    var itemStyleModel = thumbnailModel.getModel('itemStyle');\n    var itemStyle = itemStyleModel.getItemStyle();\n    if (itemStyle.fill == null) {\n      itemStyle.fill = ecModel.get('backgroundColor') || tokens.color.neutral00;\n    }\n    var refContainer = createBoxLayoutReference(thumbnailModel, api).refContainer;\n    var boxRect = getLayoutRect(getBoxLayoutParams(thumbnailModel, true), refContainer);\n    var boxBorderWidth = itemStyle.lineWidth || 0;\n    var contentRect = this._contentRect = expandOrShrinkRect(boxRect.clone(), boxBorderWidth / 2, true, true);\n    var contentGroup = new Group();\n    group.add(contentGroup);\n    contentGroup.setClipPath(new Rect({\n      shape: contentRect.plain()\n    }));\n    var targetGroup = this._targetGroup = new Group();\n    contentGroup.add(targetGroup);\n    // Draw border and background and shadow of thumbnail box.\n    var borderShape = boxRect.plain();\n    borderShape.r = itemStyleModel.getShallow('borderRadius', true);\n    group.add(this._bgRect = new Rect({\n      style: itemStyle,\n      shape: borderShape,\n      silent: false,\n      cursor: 'grab'\n    }));\n    var windowStyleModel = thumbnailModel.getModel('windowStyle');\n    var windowR = windowStyleModel.getShallow('borderRadius', true);\n    contentGroup.add(this._windowRect = new Rect({\n      shape: {\n        x: 0,\n        y: 0,\n        width: 0,\n        height: 0,\n        r: windowR\n      },\n      style: windowStyleModel.getItemStyle(),\n      silent: false,\n      cursor: 'grab'\n    }));\n    this._dealRenderContent();\n    this._dealUpdateWindow();\n    updateZ(thumbnailModel, this);\n  };\n  /**\n   * Can be called asynchronously directly.\n   * This method should be idempotent.\n   */\n  ThumbnailView.prototype.renderContent = function (bridgeRendered) {\n    this._bridgeRendered = bridgeRendered;\n    if (this._isEnabled()) {\n      this._dealRenderContent();\n      this._dealUpdateWindow();\n      updateZ(this._model, this);\n    }\n  };\n  ThumbnailView.prototype._dealRenderContent = function () {\n    var bridgeRendered = this._bridgeRendered;\n    if (!bridgeRendered || bridgeRendered.renderVersion !== this._renderVersion) {\n      return;\n    }\n    var targetGroup = this._targetGroup;\n    var coordSys = this._coordSys;\n    var contentRect = this._contentRect;\n    targetGroup.removeAll();\n    if (!bridgeRendered) {\n      return;\n    }\n    var bridgeGroup = bridgeRendered.group;\n    var bridgeRect = bridgeGroup.getBoundingRect();\n    targetGroup.add(bridgeGroup);\n    this._bgRect.z2 = bridgeRendered.z2Range.min - 10;\n    coordSys.setBoundingRect(bridgeRect.x, bridgeRect.y, bridgeRect.width, bridgeRect.height);\n    // Use `getLayoutRect` is just to find an approperiate rect in thumbnail.\n    var viewRect = getLayoutRect({\n      left: 'center',\n      top: 'center',\n      aspect: bridgeRect.width / bridgeRect.height\n    }, contentRect);\n    coordSys.setViewRect(viewRect.x, viewRect.y, viewRect.width, viewRect.height);\n    bridgeGroup.attr(coordSys.getTransformInfo().raw);\n    this._windowRect.z2 = bridgeRendered.z2Range.max + 10;\n    this._resetRoamController(bridgeRendered.roamType);\n  };\n  /**\n   * Can be called from action handler directly.\n   * This method should be idempotent.\n   */\n  ThumbnailView.prototype.updateWindow = function (param) {\n    var bridgeRendered = this._bridgeRendered;\n    if (bridgeRendered && bridgeRendered.renderVersion === param.renderVersion) {\n      bridgeRendered.targetTrans = param.targetTrans;\n    }\n    if (this._isEnabled()) {\n      this._dealUpdateWindow();\n    }\n  };\n  ThumbnailView.prototype._dealUpdateWindow = function () {\n    var bridgeRendered = this._bridgeRendered;\n    if (!bridgeRendered || bridgeRendered.renderVersion !== this._renderVersion) {\n      return;\n    }\n    var invTargetTrans = matrix.invert([], bridgeRendered.targetTrans);\n    var transTargetToThis = matrix.mul([], this._coordSys.transform, invTargetTrans);\n    this._transThisToTarget = matrix.invert([], transTargetToThis);\n    var viewportRect = bridgeRendered.viewportRect;\n    if (!viewportRect) {\n      viewportRect = new BoundingRect(0, 0, this._api.getWidth(), this._api.getHeight());\n    } else {\n      viewportRect = viewportRect.clone();\n    }\n    viewportRect.applyTransform(transTargetToThis);\n    var windowRect = this._windowRect;\n    var r = windowRect.shape.r;\n    windowRect.setShape(defaults({\n      r: r\n    }, viewportRect));\n  };\n  ThumbnailView.prototype._resetRoamController = function (roamType) {\n    var _this = this;\n    var api = this._api;\n    var roamController = this._roamController;\n    if (!roamController) {\n      roamController = this._roamController = new RoamController(api.getZr());\n    }\n    if (!roamType || !this._isEnabled()) {\n      roamController.disable();\n      return;\n    }\n    roamController.enable(roamType, {\n      api: api,\n      zInfo: {\n        component: this._model\n      },\n      triggerInfo: {\n        roamTrigger: null,\n        isInSelf: function (e, x, y) {\n          return _this._contentRect.contain(x, y);\n        }\n      }\n    });\n    roamController.off('pan').off('zoom').on('pan', bind(this._onPan, this)).on('zoom', bind(this._onZoom, this));\n  };\n  ThumbnailView.prototype._onPan = function (event) {\n    var trans = this._transThisToTarget;\n    if (!this._isEnabled() || !trans) {\n      return;\n    }\n    var oldOffset = applyTransform([], [event.oldX, event.oldY], trans);\n    var newOffset = applyTransform([], [event.oldX - event.dx, event.oldY - event.dy], trans);\n    this._api.dispatchAction(makeRoamPayload(this._model.getTarget().baseMapProvider, {\n      dx: newOffset[0] - oldOffset[0],\n      dy: newOffset[1] - oldOffset[1]\n    }));\n  };\n  ThumbnailView.prototype._onZoom = function (event) {\n    var trans = this._transThisToTarget;\n    if (!this._isEnabled() || !trans) {\n      return;\n    }\n    var offset = applyTransform([], [event.originX, event.originY], trans);\n    this._api.dispatchAction(makeRoamPayload(this._model.getTarget().baseMapProvider, {\n      zoom: 1 / event.scale,\n      originX: offset[0],\n      originY: offset[1]\n    }));\n  };\n  /**\n   * This method is also responsible for check enable in asynchronous situation,\n   * e.g., in event listeners that is supposed to be outdated but not be removed.\n   */\n  ThumbnailView.prototype._isEnabled = function () {\n    var thumbnailModel = this._model;\n    if (!thumbnailModel || !thumbnailModel.shouldShow()) {\n      return false;\n    }\n    var baseMapProvider = thumbnailModel.getTarget().baseMapProvider;\n    if (!baseMapProvider) {\n      return false;\n    }\n    return true;\n  };\n  ThumbnailView.prototype._clear = function () {\n    this.group.removeAll();\n    this._bridgeRendered = null;\n    if (this._roamController) {\n      this._roamController.disable();\n    }\n  };\n  ThumbnailView.prototype.remove = function () {\n    this._clear();\n  };\n  ThumbnailView.prototype.dispose = function () {\n    this._clear();\n  };\n  ThumbnailView.type = 'thumbnail';\n  return ThumbnailView;\n}(ComponentView);\nexport { ThumbnailView };\nfunction makeRoamPayload(baseMapProvider, params) {\n  var type = baseMapProvider.mainType === 'series' ? baseMapProvider.subType + \"Roam\" // e.g. 'graphRoam'\n  : baseMapProvider.mainType + \"Roam\"; // e.g., 'geoRoam'\n  var payload = {\n    type: type\n  };\n  payload[baseMapProvider.mainType + \"Id\"] = baseMapProvider.id;\n  extend(payload, params);\n  return payload;\n}\nfunction updateZ(thumbnailModel, thumbnailView) {\n  var zInfo = retrieveZInfo(thumbnailModel);\n  traverseUpdateZ(thumbnailView.group, zInfo.z, zInfo.zlevel);\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { ThumbnailModel } from './ThumbnailModel.js';\nimport { ThumbnailView } from './ThumbnailView.js';\nexport function install(registers) {\n  registers.registerComponentModel(ThumbnailModel);\n  registers.registerComponentView(ThumbnailView);\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { makeInner } from '../util/model.js';\nimport { getDecalFromPalette } from '../model/mixin/palette.js';\nvar DEFAULT_OPTION = {\n  label: {\n    enabled: true\n  },\n  decal: {\n    show: false\n  }\n};\nvar inner = makeInner();\nvar decalPaletteScope = {};\nexport default function ariaVisual(ecModel, api) {\n  var ariaModel = ecModel.getModel('aria');\n  // See \"area enabled\" detection code in `GlobalModel.ts`.\n  if (!ariaModel.get('enabled')) {\n    return;\n  }\n  var defaultOption = zrUtil.clone(DEFAULT_OPTION);\n  zrUtil.merge(defaultOption.label, ecModel.getLocaleModel().get('aria'), false);\n  zrUtil.merge(ariaModel.option, defaultOption, false);\n  setDecal();\n  setLabel();\n  function setDecal() {\n    var decalModel = ariaModel.getModel('decal');\n    var useDecal = decalModel.get('show');\n    if (useDecal) {\n      // Each type of series use one scope.\n      // Pie and funnel are using different scopes.\n      var paletteScopeGroupByType_1 = zrUtil.createHashMap();\n      ecModel.eachSeries(function (seriesModel) {\n        if (seriesModel.isColorBySeries()) {\n          return;\n        }\n        var decalScope = paletteScopeGroupByType_1.get(seriesModel.type);\n        if (!decalScope) {\n          decalScope = {};\n          paletteScopeGroupByType_1.set(seriesModel.type, decalScope);\n        }\n        inner(seriesModel).scope = decalScope;\n      });\n      ecModel.eachRawSeries(function (seriesModel) {\n        if (ecModel.isSeriesFiltered(seriesModel)) {\n          return;\n        }\n        if (zrUtil.isFunction(seriesModel.enableAriaDecal)) {\n          // Let series define how to use decal palette on data\n          seriesModel.enableAriaDecal();\n          return;\n        }\n        var data = seriesModel.getData();\n        if (!seriesModel.isColorBySeries()) {\n          var dataAll_1 = seriesModel.getRawData();\n          var idxMap_1 = {};\n          var decalScope_1 = inner(seriesModel).scope;\n          data.each(function (idx) {\n            var rawIdx = data.getRawIndex(idx);\n            idxMap_1[rawIdx] = idx;\n          });\n          var dataCount_1 = dataAll_1.count();\n          dataAll_1.each(function (rawIdx) {\n            var idx = idxMap_1[rawIdx];\n            var name = dataAll_1.getName(rawIdx) || rawIdx + '';\n            var paletteDecal = getDecalFromPalette(seriesModel.ecModel, name, decalScope_1, dataCount_1);\n            var specifiedDecal = data.getItemVisual(idx, 'decal');\n            data.setItemVisual(idx, 'decal', mergeDecal(specifiedDecal, paletteDecal));\n          });\n        } else {\n          var paletteDecal = getDecalFromPalette(seriesModel.ecModel, seriesModel.name, decalPaletteScope, ecModel.getSeriesCount());\n          var specifiedDecal = data.getVisual('decal');\n          data.setVisual('decal', mergeDecal(specifiedDecal, paletteDecal));\n        }\n        function mergeDecal(specifiedDecal, paletteDecal) {\n          // Merge decal from palette to decal from itemStyle.\n          // User do not need to specify all of the decal props.\n          var resultDecal = specifiedDecal ? zrUtil.extend(zrUtil.extend({}, paletteDecal), specifiedDecal) : paletteDecal;\n          resultDecal.dirty = true;\n          return resultDecal;\n        }\n      });\n    }\n  }\n  function setLabel() {\n    var dom = api.getZr().dom;\n    // TODO: support for SSR\n    if (!dom) {\n      return;\n    }\n    var labelLocale = ecModel.getLocaleModel().get('aria');\n    var labelModel = ariaModel.getModel('label');\n    labelModel.option = zrUtil.defaults(labelModel.option, labelLocale);\n    if (!labelModel.get('enabled')) {\n      return;\n    }\n    dom.setAttribute('role', 'img');\n    if (labelModel.get('description')) {\n      dom.setAttribute('aria-label', labelModel.get('description'));\n      return;\n    }\n    var seriesCnt = ecModel.getSeriesCount();\n    var maxDataCnt = labelModel.get(['data', 'maxCount']) || 10;\n    var maxSeriesCnt = labelModel.get(['series', 'maxCount']) || 10;\n    var displaySeriesCnt = Math.min(seriesCnt, maxSeriesCnt);\n    var ariaLabel;\n    if (seriesCnt < 1) {\n      // No series, no aria label\n      return;\n    } else {\n      var title = getTitle();\n      if (title) {\n        var withTitle = labelModel.get(['general', 'withTitle']);\n        ariaLabel = replace(withTitle, {\n          title: title\n        });\n      } else {\n        ariaLabel = labelModel.get(['general', 'withoutTitle']);\n      }\n      var seriesLabels_1 = [];\n      var prefix = seriesCnt > 1 ? labelModel.get(['series', 'multiple', 'prefix']) : labelModel.get(['series', 'single', 'prefix']);\n      ariaLabel += replace(prefix, {\n        seriesCount: seriesCnt\n      });\n      ecModel.eachSeries(function (seriesModel, idx) {\n        if (idx < displaySeriesCnt) {\n          var seriesLabel = void 0;\n          var seriesName = seriesModel.get('name');\n          var withName = seriesName ? 'withName' : 'withoutName';\n          seriesLabel = seriesCnt > 1 ? labelModel.get(['series', 'multiple', withName]) : labelModel.get(['series', 'single', withName]);\n          seriesLabel = replace(seriesLabel, {\n            seriesId: seriesModel.seriesIndex,\n            seriesName: seriesModel.get('name'),\n            seriesType: getSeriesTypeName(seriesModel.subType)\n          });\n          var data = seriesModel.getData();\n          if (data.count() > maxDataCnt) {\n            // Show part of data\n            var partialLabel = labelModel.get(['data', 'partialData']);\n            seriesLabel += replace(partialLabel, {\n              displayCnt: maxDataCnt\n            });\n          } else {\n            seriesLabel += labelModel.get(['data', 'allData']);\n          }\n          var middleSeparator_1 = labelModel.get(['data', 'separator', 'middle']);\n          var endSeparator_1 = labelModel.get(['data', 'separator', 'end']);\n          var excludeDimensionId_1 = labelModel.get(['data', 'excludeDimensionId']);\n          var dataLabels = [];\n          for (var i = 0; i < data.count(); i++) {\n            if (i < maxDataCnt) {\n              var name_1 = data.getName(i);\n              var value = !excludeDimensionId_1 ? data.getValues(i) : zrUtil.filter(data.getValues(i), function (v, j) {\n                return zrUtil.indexOf(excludeDimensionId_1, j) === -1;\n              });\n              var dataLabel = labelModel.get(['data', name_1 ? 'withName' : 'withoutName']);\n              dataLabels.push(replace(dataLabel, {\n                name: name_1,\n                value: value.join(middleSeparator_1)\n              }));\n            }\n          }\n          seriesLabel += dataLabels.join(middleSeparator_1) + endSeparator_1;\n          seriesLabels_1.push(seriesLabel);\n        }\n      });\n      var separatorModel = labelModel.getModel(['series', 'multiple', 'separator']);\n      var middleSeparator = separatorModel.get('middle');\n      var endSeparator = separatorModel.get('end');\n      ariaLabel += seriesLabels_1.join(middleSeparator) + endSeparator;\n      dom.setAttribute('aria-label', ariaLabel);\n    }\n  }\n  function replace(str, keyValues) {\n    if (!zrUtil.isString(str)) {\n      return str;\n    }\n    var result = str;\n    zrUtil.each(keyValues, function (value, key) {\n      result = result.replace(new RegExp('\\\\{\\\\s*' + key + '\\\\s*\\\\}', 'g'), value);\n    });\n    return result;\n  }\n  function getTitle() {\n    var title = ecModel.get('title');\n    if (title && title.length) {\n      title = title[0];\n    }\n    return title && title.text;\n  }\n  function getSeriesTypeName(type) {\n    var typeNames = ecModel.getLocaleModel().get(['series', 'typeNames']);\n    return typeNames[type] || typeNames.chart;\n  }\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nexport default function ariaPreprocessor(option) {\n  if (!option || !option.aria) {\n    return;\n  }\n  var aria = option.aria;\n  // aria.show is deprecated and should use aria.enabled instead\n  if (aria.show != null) {\n    aria.enabled = aria.show;\n  }\n  aria.label = aria.label || {};\n  // move description, general, series, data to be under aria.label\n  zrUtil.each(['description', 'general', 'series', 'data'], function (name) {\n    if (aria[name] != null) {\n      aria.label[name] = aria[name];\n    }\n  });\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport ariaVisual from '../../visual/aria.js';\nimport ariaPreprocessor from './preprocessor.js';\nexport function install(registers) {\n  registers.registerPreprocessor(ariaPreprocessor);\n  registers.registerVisual(registers.PRIORITY.VISUAL.ARIA, ariaVisual);\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { keys, isArray, map, isObject, isString, isRegExp, isArrayLike, hasOwn, isNumber } from 'zrender/lib/core/util.js';\nimport { throwError, makePrintable } from './log.js';\nimport { getRawValueParser, createFilterComparator } from '../data/helper/dataValueHelper.js';\n;\nvar RELATIONAL_EXPRESSION_OP_ALIAS_MAP = {\n  value: 'eq',\n  // PENDING: not good for literal semantic?\n  '<': 'lt',\n  '<=': 'lte',\n  '>': 'gt',\n  '>=': 'gte',\n  '=': 'eq',\n  '!=': 'ne',\n  '<>': 'ne'\n  // Might be misleading for sake of the difference between '==' and '===',\n  // so don't support them.\n  // '==': 'eq',\n  // '===': 'seq',\n  // '!==': 'sne'\n  // PENDING: Whether support some common alias \"ge\", \"le\", \"neq\"?\n  // ge: 'gte',\n  // le: 'lte',\n  // neq: 'ne',\n};\n// type RelationalExpressionOpEvaluate = (tarVal: unknown, condVal: unknown) => boolean;\nvar RegExpEvaluator = /** @class */function () {\n  function RegExpEvaluator(rVal) {\n    // Support condVal: RegExp | string\n    var condValue = this._condVal = isString(rVal) ? new RegExp(rVal) : isRegExp(rVal) ? rVal : null;\n    if (condValue == null) {\n      var errMsg = '';\n      if (process.env.NODE_ENV !== 'production') {\n        errMsg = makePrintable('Illegal regexp', rVal, 'in');\n      }\n      throwError(errMsg);\n    }\n  }\n  RegExpEvaluator.prototype.evaluate = function (lVal) {\n    var type = typeof lVal;\n    return isString(type) ? this._condVal.test(lVal) : isNumber(type) ? this._condVal.test(lVal + '') : false;\n  };\n  return RegExpEvaluator;\n}();\nvar ConstConditionInternal = /** @class */function () {\n  function ConstConditionInternal() {}\n  ConstConditionInternal.prototype.evaluate = function () {\n    return this.value;\n  };\n  return ConstConditionInternal;\n}();\nvar AndConditionInternal = /** @class */function () {\n  function AndConditionInternal() {}\n  AndConditionInternal.prototype.evaluate = function () {\n    var children = this.children;\n    for (var i = 0; i < children.length; i++) {\n      if (!children[i].evaluate()) {\n        return false;\n      }\n    }\n    return true;\n  };\n  return AndConditionInternal;\n}();\nvar OrConditionInternal = /** @class */function () {\n  function OrConditionInternal() {}\n  OrConditionInternal.prototype.evaluate = function () {\n    var children = this.children;\n    for (var i = 0; i < children.length; i++) {\n      if (children[i].evaluate()) {\n        return true;\n      }\n    }\n    return false;\n  };\n  return OrConditionInternal;\n}();\nvar NotConditionInternal = /** @class */function () {\n  function NotConditionInternal() {}\n  NotConditionInternal.prototype.evaluate = function () {\n    return !this.child.evaluate();\n  };\n  return NotConditionInternal;\n}();\nvar RelationalConditionInternal = /** @class */function () {\n  function RelationalConditionInternal() {}\n  RelationalConditionInternal.prototype.evaluate = function () {\n    var needParse = !!this.valueParser;\n    // Call getValue with no `this`.\n    var getValue = this.getValue;\n    var tarValRaw = getValue(this.valueGetterParam);\n    var tarValParsed = needParse ? this.valueParser(tarValRaw) : null;\n    // Relational cond follow \"and\" logic internally.\n    for (var i = 0; i < this.subCondList.length; i++) {\n      if (!this.subCondList[i].evaluate(needParse ? tarValParsed : tarValRaw)) {\n        return false;\n      }\n    }\n    return true;\n  };\n  return RelationalConditionInternal;\n}();\nfunction parseOption(exprOption, getters) {\n  if (exprOption === true || exprOption === false) {\n    var cond = new ConstConditionInternal();\n    cond.value = exprOption;\n    return cond;\n  }\n  var errMsg = '';\n  if (!isObjectNotArray(exprOption)) {\n    if (process.env.NODE_ENV !== 'production') {\n      errMsg = makePrintable('Illegal config. Expect a plain object but actually', exprOption);\n    }\n    throwError(errMsg);\n  }\n  if (exprOption.and) {\n    return parseAndOrOption('and', exprOption, getters);\n  } else if (exprOption.or) {\n    return parseAndOrOption('or', exprOption, getters);\n  } else if (exprOption.not) {\n    return parseNotOption(exprOption, getters);\n  }\n  return parseRelationalOption(exprOption, getters);\n}\nfunction parseAndOrOption(op, exprOption, getters) {\n  var subOptionArr = exprOption[op];\n  var errMsg = '';\n  if (process.env.NODE_ENV !== 'production') {\n    errMsg = makePrintable('\"and\"/\"or\" condition should only be `' + op + ': [...]` and must not be empty array.', 'Illegal condition:', exprOption);\n  }\n  if (!isArray(subOptionArr)) {\n    throwError(errMsg);\n  }\n  if (!subOptionArr.length) {\n    throwError(errMsg);\n  }\n  var cond = op === 'and' ? new AndConditionInternal() : new OrConditionInternal();\n  cond.children = map(subOptionArr, function (subOption) {\n    return parseOption(subOption, getters);\n  });\n  if (!cond.children.length) {\n    throwError(errMsg);\n  }\n  return cond;\n}\nfunction parseNotOption(exprOption, getters) {\n  var subOption = exprOption.not;\n  var errMsg = '';\n  if (process.env.NODE_ENV !== 'production') {\n    errMsg = makePrintable('\"not\" condition should only be `not: {}`.', 'Illegal condition:', exprOption);\n  }\n  if (!isObjectNotArray(subOption)) {\n    throwError(errMsg);\n  }\n  var cond = new NotConditionInternal();\n  cond.child = parseOption(subOption, getters);\n  if (!cond.child) {\n    throwError(errMsg);\n  }\n  return cond;\n}\nfunction parseRelationalOption(exprOption, getters) {\n  var errMsg = '';\n  var valueGetterParam = getters.prepareGetValue(exprOption);\n  var subCondList = [];\n  var exprKeys = keys(exprOption);\n  var parserName = exprOption.parser;\n  var valueParser = parserName ? getRawValueParser(parserName) : null;\n  for (var i = 0; i < exprKeys.length; i++) {\n    var keyRaw = exprKeys[i];\n    if (keyRaw === 'parser' || getters.valueGetterAttrMap.get(keyRaw)) {\n      continue;\n    }\n    var op = hasOwn(RELATIONAL_EXPRESSION_OP_ALIAS_MAP, keyRaw) ? RELATIONAL_EXPRESSION_OP_ALIAS_MAP[keyRaw] : keyRaw;\n    var condValueRaw = exprOption[keyRaw];\n    var condValueParsed = valueParser ? valueParser(condValueRaw) : condValueRaw;\n    var evaluator = createFilterComparator(op, condValueParsed) || op === 'reg' && new RegExpEvaluator(condValueParsed);\n    if (!evaluator) {\n      if (process.env.NODE_ENV !== 'production') {\n        errMsg = makePrintable('Illegal relational operation: \"' + keyRaw + '\" in condition:', exprOption);\n      }\n      throwError(errMsg);\n    }\n    subCondList.push(evaluator);\n  }\n  if (!subCondList.length) {\n    if (process.env.NODE_ENV !== 'production') {\n      errMsg = makePrintable('Relational condition must have at least one operator.', 'Illegal condition:', exprOption);\n    }\n    // No relational operator always disabled in case of dangers result.\n    throwError(errMsg);\n  }\n  var cond = new RelationalConditionInternal();\n  cond.valueGetterParam = valueGetterParam;\n  cond.valueParser = valueParser;\n  cond.getValue = getters.getValue;\n  cond.subCondList = subCondList;\n  return cond;\n}\nfunction isObjectNotArray(val) {\n  return isObject(val) && !isArrayLike(val);\n}\nvar ConditionalExpressionParsed = /** @class */function () {\n  function ConditionalExpressionParsed(exprOption, getters) {\n    this._cond = parseOption(exprOption, getters);\n  }\n  ConditionalExpressionParsed.prototype.evaluate = function () {\n    return this._cond.evaluate();\n  };\n  return ConditionalExpressionParsed;\n}();\n;\nexport function parseConditionalExpression(exprOption, getters) {\n  return new ConditionalExpressionParsed(exprOption, getters);\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { parseConditionalExpression } from '../../util/conditionalExpression.js';\nimport { hasOwn, createHashMap } from 'zrender/lib/core/util.js';\nimport { makePrintable, throwError } from '../../util/log.js';\nexport var filterTransform = {\n  type: 'echarts:filter',\n  // PENDING: enhance to filter by index rather than create new data\n  transform: function (params) {\n    // [Caveat] Fail-Fast:\n    // Do not return the whole dataset unless user config indicates it explicitly.\n    // For example, if no condition is specified by mistake, returning an empty result\n    // is better than returning the entire raw source for the user to find the mistake.\n    var upstream = params.upstream;\n    var rawItem;\n    var condition = parseConditionalExpression(params.config, {\n      valueGetterAttrMap: createHashMap({\n        dimension: true\n      }),\n      prepareGetValue: function (exprOption) {\n        var errMsg = '';\n        var dimLoose = exprOption.dimension;\n        if (!hasOwn(exprOption, 'dimension')) {\n          if (process.env.NODE_ENV !== 'production') {\n            errMsg = makePrintable('Relation condition must has prop \"dimension\" specified.', 'Illegal condition:', exprOption);\n          }\n          throwError(errMsg);\n        }\n        var dimInfo = upstream.getDimensionInfo(dimLoose);\n        if (!dimInfo) {\n          if (process.env.NODE_ENV !== 'production') {\n            errMsg = makePrintable('Can not find dimension info via: ' + dimLoose + '.\\n', 'Existing dimensions: ', upstream.cloneAllDimensionInfo(), '.\\n', 'Illegal condition:', exprOption, '.\\n');\n          }\n          throwError(errMsg);\n        }\n        return {\n          dimIdx: dimInfo.index\n        };\n      },\n      getValue: function (param) {\n        return upstream.retrieveValueFromItem(rawItem, param.dimIdx);\n      }\n    });\n    var resultData = [];\n    for (var i = 0, len = upstream.count(); i < len; i++) {\n      rawItem = upstream.getRawDataItem(i);\n      if (condition.evaluate()) {\n        resultData.push(rawItem);\n      }\n    }\n    return {\n      data: resultData\n    };\n  }\n};", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { SOURCE_FORMAT_ARRAY_ROWS, SOURCE_FORMAT_OBJECT_ROWS } from '../../util/types.js';\nimport { makePrintable, throwError } from '../../util/log.js';\nimport { each } from 'zrender/lib/core/util.js';\nimport { normalizeToArray } from '../../util/model.js';\nimport { getRawValueParser, SortOrderComparator } from '../../data/helper/dataValueHelper.js';\nvar sampleLog = '';\nif (process.env.NODE_ENV !== 'production') {\n  sampleLog = ['Valid config is like:', '{ dimension: \"age\", order: \"asc\" }', 'or [{ dimension: \"age\", order: \"asc\"], { dimension: \"date\", order: \"desc\" }]'].join(' ');\n}\nexport var sortTransform = {\n  type: 'echarts:sort',\n  transform: function (params) {\n    var upstream = params.upstream;\n    var config = params.config;\n    var errMsg = '';\n    // Normalize\n    // const orderExprList: OrderExpression[] = isArray(config[0])\n    //     ? config as OrderExpression[]\n    //     : [config as OrderExpression];\n    var orderExprList = normalizeToArray(config);\n    if (!orderExprList.length) {\n      if (process.env.NODE_ENV !== 'production') {\n        errMsg = 'Empty `config` in sort transform.';\n      }\n      throwError(errMsg);\n    }\n    var orderDefList = [];\n    each(orderExprList, function (orderExpr) {\n      var dimLoose = orderExpr.dimension;\n      var order = orderExpr.order;\n      var parserName = orderExpr.parser;\n      var incomparable = orderExpr.incomparable;\n      if (dimLoose == null) {\n        if (process.env.NODE_ENV !== 'production') {\n          errMsg = 'Sort transform config must has \"dimension\" specified.' + sampleLog;\n        }\n        throwError(errMsg);\n      }\n      if (order !== 'asc' && order !== 'desc') {\n        if (process.env.NODE_ENV !== 'production') {\n          errMsg = 'Sort transform config must has \"order\" specified.' + sampleLog;\n        }\n        throwError(errMsg);\n      }\n      if (incomparable && incomparable !== 'min' && incomparable !== 'max') {\n        var errMsg_1 = '';\n        if (process.env.NODE_ENV !== 'production') {\n          errMsg_1 = 'incomparable must be \"min\" or \"max\" rather than \"' + incomparable + '\".';\n        }\n        throwError(errMsg_1);\n      }\n      if (order !== 'asc' && order !== 'desc') {\n        var errMsg_2 = '';\n        if (process.env.NODE_ENV !== 'production') {\n          errMsg_2 = 'order must be \"asc\" or \"desc\" rather than \"' + order + '\".';\n        }\n        throwError(errMsg_2);\n      }\n      var dimInfo = upstream.getDimensionInfo(dimLoose);\n      if (!dimInfo) {\n        if (process.env.NODE_ENV !== 'production') {\n          errMsg = makePrintable('Can not find dimension info via: ' + dimLoose + '.\\n', 'Existing dimensions: ', upstream.cloneAllDimensionInfo(), '.\\n', 'Illegal config:', orderExpr, '.\\n');\n        }\n        throwError(errMsg);\n      }\n      var parser = parserName ? getRawValueParser(parserName) : null;\n      if (parserName && !parser) {\n        if (process.env.NODE_ENV !== 'production') {\n          errMsg = makePrintable('Invalid parser name ' + parserName + '.\\n', 'Illegal config:', orderExpr, '.\\n');\n        }\n        throwError(errMsg);\n      }\n      orderDefList.push({\n        dimIdx: dimInfo.index,\n        parser: parser,\n        comparator: new SortOrderComparator(order, incomparable)\n      });\n    });\n    // TODO: support it?\n    var sourceFormat = upstream.sourceFormat;\n    if (sourceFormat !== SOURCE_FORMAT_ARRAY_ROWS && sourceFormat !== SOURCE_FORMAT_OBJECT_ROWS) {\n      if (process.env.NODE_ENV !== 'production') {\n        errMsg = 'sourceFormat \"' + sourceFormat + '\" is not supported yet';\n      }\n      throwError(errMsg);\n    }\n    // Other upstream format are all array.\n    var resultData = [];\n    for (var i = 0, len = upstream.count(); i < len; i++) {\n      resultData.push(upstream.getRawDataItem(i));\n    }\n    resultData.sort(function (item0, item1) {\n      for (var i = 0; i < orderDefList.length; i++) {\n        var orderDef = orderDefList[i];\n        var val0 = upstream.retrieveValueFromItem(item0, orderDef.dimIdx);\n        var val1 = upstream.retrieveValueFromItem(item1, orderDef.dimIdx);\n        if (orderDef.parser) {\n          val0 = orderDef.parser(val0);\n          val1 = orderDef.parser(val1);\n        }\n        var result = orderDef.comparator.evaluate(val0, val1);\n        if (result !== 0) {\n          return result;\n        }\n      }\n      return 0;\n    });\n    return {\n      data: resultData\n    };\n  }\n};", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { filterTransform } from './filterTransform.js';\nimport { sortTransform } from './sortTransform.js';\nexport function install(registers) {\n  registers.registerTransform(filterTransform);\n  registers.registerTransform(sortTransform);\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\n/**\n * This module is imported by echarts directly.\n *\n * Notice:\n * Always keep this file exists for backward compatibility.\n * Because before 4.1.0, dataset is an optional component,\n * some users may import this module manually.\n */\nimport ComponentModel from '../../model/Component.js';\nimport ComponentView from '../../view/Component.js';\nimport { SERIES_LAYOUT_BY_COLUMN } from '../../util/types.js';\nimport { disableTransformOptionMerge, SourceManager } from '../../data/helper/sourceManager.js';\nvar DatasetModel = /** @class */function (_super) {\n  __extends(DatasetModel, _super);\n  function DatasetModel() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = 'dataset';\n    return _this;\n  }\n  DatasetModel.prototype.init = function (option, parentModel, ecModel) {\n    _super.prototype.init.call(this, option, parentModel, ecModel);\n    this._sourceManager = new SourceManager(this);\n    disableTransformOptionMerge(this);\n  };\n  DatasetModel.prototype.mergeOption = function (newOption, ecModel) {\n    _super.prototype.mergeOption.call(this, newOption, ecModel);\n    disableTransformOptionMerge(this);\n  };\n  DatasetModel.prototype.optionUpdated = function () {\n    this._sourceManager.dirty();\n  };\n  DatasetModel.prototype.getSourceManager = function () {\n    return this._sourceManager;\n  };\n  DatasetModel.type = 'dataset';\n  DatasetModel.defaultOption = {\n    seriesLayoutBy: SERIES_LAYOUT_BY_COLUMN\n  };\n  return DatasetModel;\n}(ComponentModel);\nexport { DatasetModel };\nvar DatasetView = /** @class */function (_super) {\n  __extends(DatasetView, _super);\n  function DatasetView() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this.type = 'dataset';\n    return _this;\n  }\n  DatasetView.type = 'dataset';\n  return DatasetView;\n}(ComponentView);\nexport function install(registers) {\n  registers.registerComponentModel(DatasetModel);\n  registers.registerComponentView(DatasetView);\n}", "import { isAroundZero } from './helper.js';\nvar mathSin = Math.sin;\nvar mathCos = Math.cos;\nvar PI = Math.PI;\nvar PI2 = Math.PI * 2;\nvar degree = 180 / PI;\nvar SVGPathRebuilder = (function () {\n    function SVGPathRebuilder() {\n    }\n    SVGPathRebuilder.prototype.reset = function (precision) {\n        this._start = true;\n        this._d = [];\n        this._str = '';\n        this._p = Math.pow(10, precision || 4);\n    };\n    SVGPathRebuilder.prototype.moveTo = function (x, y) {\n        this._add('M', x, y);\n    };\n    SVGPathRebuilder.prototype.lineTo = function (x, y) {\n        this._add('L', x, y);\n    };\n    SVGPathRebuilder.prototype.bezierCurveTo = function (x, y, x2, y2, x3, y3) {\n        this._add('C', x, y, x2, y2, x3, y3);\n    };\n    SVGPathRebuilder.prototype.quadraticCurveTo = function (x, y, x2, y2) {\n        this._add('Q', x, y, x2, y2);\n    };\n    SVGPathRebuilder.prototype.arc = function (cx, cy, r, startAngle, endAngle, anticlockwise) {\n        this.ellipse(cx, cy, r, r, 0, startAngle, endAngle, anticlockwise);\n    };\n    SVGPathRebuilder.prototype.ellipse = function (cx, cy, rx, ry, psi, startAngle, endAngle, anticlockwise) {\n        var dTheta = endAngle - startAngle;\n        var clockwise = !anticlockwise;\n        var dThetaPositive = Math.abs(dTheta);\n        var isCircle = isAroundZero(dThetaPositive - PI2)\n            || (clockwise ? dTheta >= PI2 : -dTheta >= PI2);\n        var unifiedTheta = dTheta > 0 ? dTheta % PI2 : (dTheta % PI2 + PI2);\n        var large = false;\n        if (isCircle) {\n            large = true;\n        }\n        else if (isAroundZero(dThetaPositive)) {\n            large = false;\n        }\n        else {\n            large = (unifiedTheta >= PI) === !!clockwise;\n        }\n        var x0 = cx + rx * mathCos(startAngle);\n        var y0 = cy + ry * mathSin(startAngle);\n        if (this._start) {\n            this._add('M', x0, y0);\n        }\n        var xRot = Math.round(psi * degree);\n        if (isCircle) {\n            var p = 1 / this._p;\n            var dTheta_1 = (clockwise ? 1 : -1) * (PI2 - p);\n            this._add('A', rx, ry, xRot, 1, +clockwise, cx + rx * mathCos(startAngle + dTheta_1), cy + ry * mathSin(startAngle + dTheta_1));\n            if (p > 1e-2) {\n                this._add('A', rx, ry, xRot, 0, +clockwise, x0, y0);\n            }\n        }\n        else {\n            var x = cx + rx * mathCos(endAngle);\n            var y = cy + ry * mathSin(endAngle);\n            this._add('A', rx, ry, xRot, +large, +clockwise, x, y);\n        }\n    };\n    SVGPathRebuilder.prototype.rect = function (x, y, w, h) {\n        this._add('M', x, y);\n        this._add('l', w, 0);\n        this._add('l', 0, h);\n        this._add('l', -w, 0);\n        this._add('Z');\n    };\n    SVGPathRebuilder.prototype.closePath = function () {\n        if (this._d.length > 0) {\n            this._add('Z');\n        }\n    };\n    SVGPathRebuilder.prototype._add = function (cmd, a, b, c, d, e, f, g, h) {\n        var vals = [];\n        var p = this._p;\n        for (var i = 1; i < arguments.length; i++) {\n            var val = arguments[i];\n            if (isNaN(val)) {\n                this._invalid = true;\n                return;\n            }\n            vals.push(Math.round(val * p) / p);\n        }\n        this._d.push(cmd + vals.join(' '));\n        this._start = cmd === 'Z';\n    };\n    SVGPathRebuilder.prototype.generateStr = function () {\n        this._str = this._invalid ? '' : this._d.join('');\n        this._d = [];\n    };\n    SVGPathRebuilder.prototype.getStr = function () {\n        return this._str;\n    };\n    return SVGPathRebuilder;\n}());\nexport default SVGPathRebuilder;\n", "import { DEFAULT_PATH_STYLE } from '../graphic/Path.js';\nimport ZRImage from '../graphic/Image.js';\nimport { getLineDash } from '../canvas/dashStyle.js';\nimport { map } from '../core/util.js';\nimport { normalizeColor } from './helper.js';\nvar NONE = 'none';\nvar mathRound = Math.round;\nfunction pathHasFill(style) {\n    var fill = style.fill;\n    return fill != null && fill !== NONE;\n}\nfunction pathHasStroke(style) {\n    var stroke = style.stroke;\n    return stroke != null && stroke !== NONE;\n}\nvar strokeProps = ['lineCap', 'miterLimit', 'lineJoin'];\nvar svgStrokeProps = map(strokeProps, function (prop) { return \"stroke-\" + prop.toLowerCase(); });\nexport default function mapStyleToAttrs(updateAttr, style, el, forceUpdate) {\n    var opacity = style.opacity == null ? 1 : style.opacity;\n    if (el instanceof ZRImage) {\n        updateAttr('opacity', opacity);\n        return;\n    }\n    if (pathHasFill(style)) {\n        var fill = normalizeColor(style.fill);\n        updateAttr('fill', fill.color);\n        var fillOpacity = style.fillOpacity != null\n            ? style.fillOpacity * fill.opacity * opacity\n            : fill.opacity * opacity;\n        if (forceUpdate || fillOpacity < 1) {\n            updateAttr('fill-opacity', fillOpacity);\n        }\n    }\n    else {\n        updateAttr('fill', NONE);\n    }\n    if (pathHasStroke(style)) {\n        var stroke = normalizeColor(style.stroke);\n        updateAttr('stroke', stroke.color);\n        var strokeScale = style.strokeNoScale\n            ? el.getLineScale()\n            : 1;\n        var strokeWidth = (strokeScale ? (style.lineWidth || 0) / strokeScale : 0);\n        var strokeOpacity = style.strokeOpacity != null\n            ? style.strokeOpacity * stroke.opacity * opacity\n            : stroke.opacity * opacity;\n        var strokeFirst = style.strokeFirst;\n        if (forceUpdate || strokeWidth !== 1) {\n            updateAttr('stroke-width', strokeWidth);\n        }\n        if (forceUpdate || strokeFirst) {\n            updateAttr('paint-order', strokeFirst ? 'stroke' : 'fill');\n        }\n        if (forceUpdate || strokeOpacity < 1) {\n            updateAttr('stroke-opacity', strokeOpacity);\n        }\n        if (style.lineDash) {\n            var _a = getLineDash(el), lineDash = _a[0], lineDashOffset = _a[1];\n            if (lineDash) {\n                lineDashOffset = mathRound(lineDashOffset || 0);\n                updateAttr('stroke-dasharray', lineDash.join(','));\n                if (lineDashOffset || forceUpdate) {\n                    updateAttr('stroke-dashoffset', lineDashOffset);\n                }\n            }\n        }\n        else if (forceUpdate) {\n            updateAttr('stroke-dasharray', NONE);\n        }\n        for (var i = 0; i < strokeProps.length; i++) {\n            var propName = strokeProps[i];\n            if (forceUpdate || style[propName] !== DEFAULT_PATH_STYLE[propName]) {\n                var val = style[propName] || DEFAULT_PATH_STYLE[propName];\n                val && updateAttr(svgStrokeProps[i], val);\n            }\n        }\n    }\n    else if (forceUpdate) {\n        updateAttr('stroke', NONE);\n    }\n}\n", "import { keys, map } from '../core/util.js';\nimport { encodeHTML } from '../core/dom.js';\nexport var SVGNS = 'http://www.w3.org/2000/svg';\nexport var XLINKNS = 'http://www.w3.org/1999/xlink';\nexport var XMLNS = 'http://www.w3.org/2000/xmlns/';\nexport var XML_NAMESPACE = 'http://www.w3.org/XML/1998/namespace';\nexport var META_DATA_PREFIX = 'ecmeta_';\nexport function createElement(name) {\n    return document.createElementNS(SVGNS, name);\n}\n;\nexport function createVNode(tag, key, attrs, children, text) {\n    return {\n        tag: tag,\n        attrs: attrs || {},\n        children: children,\n        text: text,\n        key: key\n    };\n}\nfunction createElementOpen(name, attrs) {\n    var attrsStr = [];\n    if (attrs) {\n        for (var key in attrs) {\n            var val = attrs[key];\n            var part = key;\n            if (val === false) {\n                continue;\n            }\n            else if (val !== true && val != null) {\n                part += \"=\\\"\" + val + \"\\\"\";\n            }\n            attrsStr.push(part);\n        }\n    }\n    return \"<\" + name + \" \" + attrsStr.join(' ') + \">\";\n}\nfunction createElementClose(name) {\n    return \"</\" + name + \">\";\n}\nexport function vNodeToString(el, opts) {\n    opts = opts || {};\n    var S = opts.newline ? '\\n' : '';\n    function convertElToString(el) {\n        var children = el.children, tag = el.tag, attrs = el.attrs, text = el.text;\n        return createElementOpen(tag, attrs)\n            + (tag !== 'style' ? encodeHTML(text) : text || '')\n            + (children ? \"\" + S + map(children, function (child) { return convertElToString(child); }).join(S) + S : '')\n            + createElementClose(tag);\n    }\n    return convertElToString(el);\n}\nexport function getCssString(selectorNodes, animationNodes, opts) {\n    opts = opts || {};\n    var S = opts.newline ? '\\n' : '';\n    var bracketBegin = \" {\" + S;\n    var bracketEnd = S + \"}\";\n    var selectors = map(keys(selectorNodes), function (className) {\n        return className + bracketBegin + map(keys(selectorNodes[className]), function (attrName) {\n            return attrName + \":\" + selectorNodes[className][attrName] + \";\";\n        }).join(S) + bracketEnd;\n    }).join(S);\n    var animations = map(keys(animationNodes), function (animationName) {\n        return \"@keyframes \" + animationName + bracketBegin + map(keys(animationNodes[animationName]), function (percent) {\n            return percent + bracketBegin + map(keys(animationNodes[animationName][percent]), function (attrName) {\n                var val = animationNodes[animationName][percent][attrName];\n                if (attrName === 'd') {\n                    val = \"path(\\\"\" + val + \"\\\")\";\n                }\n                return attrName + \":\" + val + \";\";\n            }).join(S) + bracketEnd;\n        }).join(S) + bracketEnd;\n    }).join(S);\n    if (!selectors && !animations) {\n        return '';\n    }\n    return ['<![CDATA[', selectors, animations, ']]>'].join(S);\n}\nexport function createBrushScope(zrId) {\n    return {\n        zrId: zrId,\n        shadowCache: {},\n        patternCache: {},\n        gradientCache: {},\n        clipPathCache: {},\n        defs: {},\n        cssNodes: {},\n        cssAnims: {},\n        cssStyleCache: {},\n        cssAnimIdx: 0,\n        shadowIdx: 0,\n        gradientIdx: 0,\n        patternIdx: 0,\n        clipPathIdx: 0\n    };\n}\nexport function createSVGVNode(width, height, children, useViewBox) {\n    return createVNode('svg', 'root', {\n        'width': width,\n        'height': height,\n        'xmlns': SVGNS,\n        'xmlns:xlink': XLINKNS,\n        'version': '1.1',\n        'baseProfile': 'full',\n        'viewBox': useViewBox ? \"0 0 \" + width + \" \" + height : false\n    }, children);\n}\n", "var cssClassIdx = 0;\nexport function getClassId() {\n    return cssClassIdx++;\n}\n", "import { copyTransform } from '../core/Transformable.js';\nimport { createBrushScope } from './core.js';\nimport SVGPathRebuilder from './SVGPathRebuilder.js';\nimport PathProxy from '../core/PathProxy.js';\nimport { getPathPrecision, getSRTTransformString } from './helper.js';\nimport { each, extend, filter, isNumber, isString, keys } from '../core/util.js';\nimport CompoundPath from '../graphic/CompoundPath.js';\nimport { createCubicEasingFunc } from '../animation/cubicEasing.js';\nimport { getClassId } from './cssClassId.js';\nexport var EASING_MAP = {\n    cubicIn: '0.32,0,0.67,0',\n    cubicOut: '0.33,1,0.68,1',\n    cubicInOut: '0.65,0,0.35,1',\n    quadraticIn: '0.11,0,0.5,0',\n    quadraticOut: '0.5,1,0.89,1',\n    quadraticInOut: '0.45,0,0.55,1',\n    quarticIn: '0.5,0,0.75,0',\n    quarticOut: '0.25,1,0.5,1',\n    quarticInOut: '0.76,0,0.24,1',\n    quinticIn: '0.64,0,0.78,0',\n    quinticOut: '0.22,1,0.36,1',\n    quinticInOut: '0.83,0,0.17,1',\n    sinusoidalIn: '0.12,0,0.39,0',\n    sinusoidalOut: '0.61,1,0.88,1',\n    sinusoidalInOut: '0.37,0,0.63,1',\n    exponentialIn: '0.7,0,0.84,0',\n    exponentialOut: '0.16,1,0.3,1',\n    exponentialInOut: '0.87,0,0.13,1',\n    circularIn: '0.55,0,1,0.45',\n    circularOut: '0,0.55,0.45,1',\n    circularInOut: '0.85,0,0.15,1'\n};\nvar transformOriginKey = 'transform-origin';\nfunction buildPathString(el, kfShape, path) {\n    var shape = extend({}, el.shape);\n    extend(shape, kfShape);\n    el.buildPath(path, shape);\n    var svgPathBuilder = new SVGPathRebuilder();\n    svgPathBuilder.reset(getPathPrecision(el));\n    path.rebuildPath(svgPathBuilder, 1);\n    svgPathBuilder.generateStr();\n    return svgPathBuilder.getStr();\n}\nfunction setTransformOrigin(target, transform) {\n    var originX = transform.originX, originY = transform.originY;\n    if (originX || originY) {\n        target[transformOriginKey] = originX + \"px \" + originY + \"px\";\n    }\n}\nexport var ANIMATE_STYLE_MAP = {\n    fill: 'fill',\n    opacity: 'opacity',\n    lineWidth: 'stroke-width',\n    lineDashOffset: 'stroke-dashoffset'\n};\nfunction addAnimation(cssAnim, scope) {\n    var animationName = scope.zrId + '-ani-' + scope.cssAnimIdx++;\n    scope.cssAnims[animationName] = cssAnim;\n    return animationName;\n}\nfunction createCompoundPathCSSAnimation(el, attrs, scope) {\n    var paths = el.shape.paths;\n    var composedAnim = {};\n    var cssAnimationCfg;\n    var cssAnimationName;\n    each(paths, function (path) {\n        var subScope = createBrushScope(scope.zrId);\n        subScope.animation = true;\n        createCSSAnimation(path, {}, subScope, true);\n        var cssAnims = subScope.cssAnims;\n        var cssNodes = subScope.cssNodes;\n        var animNames = keys(cssAnims);\n        var len = animNames.length;\n        if (!len) {\n            return;\n        }\n        cssAnimationName = animNames[len - 1];\n        var lastAnim = cssAnims[cssAnimationName];\n        for (var percent in lastAnim) {\n            var kf = lastAnim[percent];\n            composedAnim[percent] = composedAnim[percent] || { d: '' };\n            composedAnim[percent].d += kf.d || '';\n        }\n        for (var className in cssNodes) {\n            var val = cssNodes[className].animation;\n            if (val.indexOf(cssAnimationName) >= 0) {\n                cssAnimationCfg = val;\n            }\n        }\n    });\n    if (!cssAnimationCfg) {\n        return;\n    }\n    attrs.d = false;\n    var animationName = addAnimation(composedAnim, scope);\n    return cssAnimationCfg.replace(cssAnimationName, animationName);\n}\nfunction getEasingFunc(easing) {\n    return isString(easing)\n        ? EASING_MAP[easing]\n            ? \"cubic-bezier(\" + EASING_MAP[easing] + \")\"\n            : createCubicEasingFunc(easing) ? easing : ''\n        : '';\n}\nexport function createCSSAnimation(el, attrs, scope, onlyShape) {\n    var animators = el.animators;\n    var len = animators.length;\n    var cssAnimations = [];\n    if (el instanceof CompoundPath) {\n        var animationCfg = createCompoundPathCSSAnimation(el, attrs, scope);\n        if (animationCfg) {\n            cssAnimations.push(animationCfg);\n        }\n        else if (!len) {\n            return;\n        }\n    }\n    else if (!len) {\n        return;\n    }\n    var groupAnimators = {};\n    for (var i = 0; i < len; i++) {\n        var animator = animators[i];\n        var cfgArr = [animator.getMaxTime() / 1000 + 's'];\n        var easing = getEasingFunc(animator.getClip().easing);\n        var delay = animator.getDelay();\n        if (easing) {\n            cfgArr.push(easing);\n        }\n        else {\n            cfgArr.push('linear');\n        }\n        if (delay) {\n            cfgArr.push(delay / 1000 + 's');\n        }\n        if (animator.getLoop()) {\n            cfgArr.push('infinite');\n        }\n        var cfg = cfgArr.join(' ');\n        groupAnimators[cfg] = groupAnimators[cfg] || [cfg, []];\n        groupAnimators[cfg][1].push(animator);\n    }\n    function createSingleCSSAnimation(groupAnimator) {\n        var animators = groupAnimator[1];\n        var len = animators.length;\n        var transformKfs = {};\n        var shapeKfs = {};\n        var finalKfs = {};\n        var animationTimingFunctionAttrName = 'animation-timing-function';\n        function saveAnimatorTrackToCssKfs(animator, cssKfs, toCssAttrName) {\n            var tracks = animator.getTracks();\n            var maxTime = animator.getMaxTime();\n            for (var k = 0; k < tracks.length; k++) {\n                var track = tracks[k];\n                if (track.needsAnimate()) {\n                    var kfs = track.keyframes;\n                    var attrName = track.propName;\n                    toCssAttrName && (attrName = toCssAttrName(attrName));\n                    if (attrName) {\n                        for (var i = 0; i < kfs.length; i++) {\n                            var kf = kfs[i];\n                            var percent = Math.round(kf.time / maxTime * 100) + '%';\n                            var kfEasing = getEasingFunc(kf.easing);\n                            var rawValue = kf.rawValue;\n                            if (isString(rawValue) || isNumber(rawValue)) {\n                                cssKfs[percent] = cssKfs[percent] || {};\n                                cssKfs[percent][attrName] = kf.rawValue;\n                                if (kfEasing) {\n                                    cssKfs[percent][animationTimingFunctionAttrName] = kfEasing;\n                                }\n                            }\n                        }\n                    }\n                }\n            }\n        }\n        for (var i = 0; i < len; i++) {\n            var animator = animators[i];\n            var targetProp = animator.targetName;\n            if (!targetProp) {\n                !onlyShape && saveAnimatorTrackToCssKfs(animator, transformKfs);\n            }\n            else if (targetProp === 'shape') {\n                saveAnimatorTrackToCssKfs(animator, shapeKfs);\n            }\n        }\n        for (var percent in transformKfs) {\n            var transform = {};\n            copyTransform(transform, el);\n            extend(transform, transformKfs[percent]);\n            var str = getSRTTransformString(transform);\n            var timingFunction = transformKfs[percent][animationTimingFunctionAttrName];\n            finalKfs[percent] = str ? {\n                transform: str\n            } : {};\n            setTransformOrigin(finalKfs[percent], transform);\n            if (timingFunction) {\n                finalKfs[percent][animationTimingFunctionAttrName] = timingFunction;\n            }\n        }\n        ;\n        var path;\n        var canAnimateShape = true;\n        for (var percent in shapeKfs) {\n            finalKfs[percent] = finalKfs[percent] || {};\n            var isFirst = !path;\n            var timingFunction = shapeKfs[percent][animationTimingFunctionAttrName];\n            if (isFirst) {\n                path = new PathProxy();\n            }\n            var len_1 = path.len();\n            path.reset();\n            finalKfs[percent].d = buildPathString(el, shapeKfs[percent], path);\n            var newLen = path.len();\n            if (!isFirst && len_1 !== newLen) {\n                canAnimateShape = false;\n                break;\n            }\n            if (timingFunction) {\n                finalKfs[percent][animationTimingFunctionAttrName] = timingFunction;\n            }\n        }\n        ;\n        if (!canAnimateShape) {\n            for (var percent in finalKfs) {\n                delete finalKfs[percent].d;\n            }\n        }\n        if (!onlyShape) {\n            for (var i = 0; i < len; i++) {\n                var animator = animators[i];\n                var targetProp = animator.targetName;\n                if (targetProp === 'style') {\n                    saveAnimatorTrackToCssKfs(animator, finalKfs, function (propName) { return ANIMATE_STYLE_MAP[propName]; });\n                }\n            }\n        }\n        var percents = keys(finalKfs);\n        var allTransformOriginSame = true;\n        var transformOrigin;\n        for (var i = 1; i < percents.length; i++) {\n            var p0 = percents[i - 1];\n            var p1 = percents[i];\n            if (finalKfs[p0][transformOriginKey] !== finalKfs[p1][transformOriginKey]) {\n                allTransformOriginSame = false;\n                break;\n            }\n            transformOrigin = finalKfs[p0][transformOriginKey];\n        }\n        if (allTransformOriginSame && transformOrigin) {\n            for (var percent in finalKfs) {\n                if (finalKfs[percent][transformOriginKey]) {\n                    delete finalKfs[percent][transformOriginKey];\n                }\n            }\n            attrs[transformOriginKey] = transformOrigin;\n        }\n        if (filter(percents, function (percent) { return keys(finalKfs[percent]).length > 0; }).length) {\n            var animationName = addAnimation(finalKfs, scope);\n            return animationName + \" \" + groupAnimator[0] + \" both\";\n        }\n    }\n    for (var key in groupAnimators) {\n        var animationCfg = createSingleCSSAnimation(groupAnimators[key]);\n        if (animationCfg) {\n            cssAnimations.push(animationCfg);\n        }\n    }\n    if (cssAnimations.length) {\n        var className = scope.zrId + '-cls-' + getClassId();\n        scope.cssNodes['.' + className] = {\n            animation: cssAnimations.join(',')\n        };\n        attrs[\"class\"] = className;\n    }\n}\n", "import { liftColor } from '../tool/color.js';\nimport { getClassId } from './cssClassId.js';\nexport function createCSSEmphasis(el, attrs, scope) {\n    if (!el.ignore) {\n        if (el.isSilent()) {\n            var style = {\n                'pointer-events': 'none'\n            };\n            setClassAttribute(style, attrs, scope, true);\n        }\n        else {\n            var emphasisStyle = el.states.emphasis && el.states.emphasis.style\n                ? el.states.emphasis.style\n                : {};\n            var fill = emphasisStyle.fill;\n            if (!fill) {\n                var normalFill = el.style && el.style.fill;\n                var selectFill = el.states.select\n                    && el.states.select.style\n                    && el.states.select.style.fill;\n                var fromFill = el.currentStates.indexOf('select') >= 0\n                    ? (selectFill || normalFill)\n                    : normalFill;\n                if (fromFill) {\n                    fill = liftColor(fromFill);\n                }\n            }\n            var lineWidth = emphasisStyle.lineWidth;\n            if (lineWidth) {\n                var scaleX = (!emphasisStyle.strokeNoScale && el.transform)\n                    ? el.transform[0]\n                    : 1;\n                lineWidth = lineWidth / scaleX;\n            }\n            var style = {\n                cursor: 'pointer'\n            };\n            if (fill) {\n                style.fill = fill;\n            }\n            if (emphasisStyle.stroke) {\n                style.stroke = emphasisStyle.stroke;\n            }\n            if (lineWidth) {\n                style['stroke-width'] = lineWidth;\n            }\n            setClassAttribute(style, attrs, scope, true);\n        }\n    }\n}\nfunction setClassAttribute(style, attrs, scope, withHover) {\n    var styleKey = JSON.stringify(style);\n    var className = scope.cssStyleCache[styleKey];\n    if (!className) {\n        className = scope.zrId + '-cls-' + getClassId();\n        scope.cssStyleCache[styleKey] = className;\n        scope.cssNodes['.' + className + (withHover ? ':hover' : '')] = style;\n    }\n    attrs[\"class\"] = attrs[\"class\"] ? (attrs[\"class\"] + ' ' + className) : className;\n}\n", "import { adjustTextY, getIdURL, getMatrixStr, getPathPrecision, getShadowKey, getSRTTransformString, hasShadow, isAroundZero, isGradient, isImagePattern, isLinearGradient, isPattern, isRadialGradient, normalizeColor, round4, TEXT_ALIGN_TO_ANCHOR } from './helper.js';\nimport Path from '../graphic/Path.js';\nimport ZRImage from '../graphic/Image.js';\nimport { getLineHeight } from '../contain/text.js';\nimport TSpan from '../graphic/TSpan.js';\nimport SVGPathRebuilder from './SVGPathRebuilder.js';\nimport mapStyleToAttrs from './mapStyleToAttrs.js';\nimport { createVNode, vNodeToString, META_DATA_PREFIX } from './core.js';\nimport { assert, clone, isFunction, isString, logError, map, retrieve2 } from '../core/util.js';\nimport { createOrUpdateImage } from '../graphic/helper/image.js';\nimport { createCSSAnimation } from './cssAnimation.js';\nimport { hasSeparateFont, parseFontSize } from '../graphic/Text.js';\nimport { DEFAULT_FONT, DEFAULT_FONT_FAMILY } from '../core/platform.js';\nimport { createCSSEmphasis } from './cssEmphasis.js';\nimport { getElementSSRData } from '../zrender.js';\nvar round = Math.round;\nfunction isImageLike(val) {\n    return val && isString(val.src);\n}\nfunction isCanvasLike(val) {\n    return val && isFunction(val.toDataURL);\n}\nfunction setStyleAttrs(attrs, style, el, scope) {\n    mapStyleToAttrs(function (key, val) {\n        var isFillStroke = key === 'fill' || key === 'stroke';\n        if (isFillStroke && isGradient(val)) {\n            setGradient(style, attrs, key, scope);\n        }\n        else if (isFillStroke && isPattern(val)) {\n            setPattern(el, attrs, key, scope);\n        }\n        else {\n            attrs[key] = val;\n        }\n        if (isFillStroke && scope.ssr && val === 'none') {\n            attrs['pointer-events'] = 'visible';\n        }\n    }, style, el, false);\n    setShadow(el, attrs, scope);\n}\nfunction setMetaData(attrs, el) {\n    var metaData = getElementSSRData(el);\n    if (metaData) {\n        metaData.each(function (val, key) {\n            val != null && (attrs[(META_DATA_PREFIX + key).toLowerCase()] = val + '');\n        });\n        if (el.isSilent()) {\n            attrs[META_DATA_PREFIX + 'silent'] = 'true';\n        }\n    }\n}\nfunction noRotateScale(m) {\n    return isAroundZero(m[0] - 1)\n        && isAroundZero(m[1])\n        && isAroundZero(m[2])\n        && isAroundZero(m[3] - 1);\n}\nfunction noTranslate(m) {\n    return isAroundZero(m[4]) && isAroundZero(m[5]);\n}\nfunction setTransform(attrs, m, compress) {\n    if (m && !(noTranslate(m) && noRotateScale(m))) {\n        var mul = compress ? 10 : 1e4;\n        attrs.transform = noRotateScale(m)\n            ? \"translate(\" + round(m[4] * mul) / mul + \" \" + round(m[5] * mul) / mul + \")\" : getMatrixStr(m);\n    }\n}\nfunction convertPolyShape(shape, attrs, mul) {\n    var points = shape.points;\n    var strArr = [];\n    for (var i = 0; i < points.length; i++) {\n        strArr.push(round(points[i][0] * mul) / mul);\n        strArr.push(round(points[i][1] * mul) / mul);\n    }\n    attrs.points = strArr.join(' ');\n}\nfunction validatePolyShape(shape) {\n    return !shape.smooth;\n}\nfunction createAttrsConvert(desc) {\n    var normalizedDesc = map(desc, function (item) {\n        return (typeof item === 'string' ? [item, item] : item);\n    });\n    return function (shape, attrs, mul) {\n        for (var i = 0; i < normalizedDesc.length; i++) {\n            var item = normalizedDesc[i];\n            var val = shape[item[0]];\n            if (val != null) {\n                attrs[item[1]] = round(val * mul) / mul;\n            }\n        }\n    };\n}\nvar builtinShapesDef = {\n    circle: [createAttrsConvert(['cx', 'cy', 'r'])],\n    polyline: [convertPolyShape, validatePolyShape],\n    polygon: [convertPolyShape, validatePolyShape]\n};\nfunction hasShapeAnimation(el) {\n    var animators = el.animators;\n    for (var i = 0; i < animators.length; i++) {\n        if (animators[i].targetName === 'shape') {\n            return true;\n        }\n    }\n    return false;\n}\nexport function brushSVGPath(el, scope) {\n    var style = el.style;\n    var shape = el.shape;\n    var builtinShpDef = builtinShapesDef[el.type];\n    var attrs = {};\n    var needsAnimate = scope.animation;\n    var svgElType = 'path';\n    var strokePercent = el.style.strokePercent;\n    var precision = (scope.compress && getPathPrecision(el)) || 4;\n    if (builtinShpDef\n        && !scope.willUpdate\n        && !(builtinShpDef[1] && !builtinShpDef[1](shape))\n        && !(needsAnimate && hasShapeAnimation(el))\n        && !(strokePercent < 1)) {\n        svgElType = el.type;\n        var mul = Math.pow(10, precision);\n        builtinShpDef[0](shape, attrs, mul);\n    }\n    else {\n        var needBuildPath = !el.path || el.shapeChanged();\n        if (!el.path) {\n            el.createPathProxy();\n        }\n        var path = el.path;\n        if (needBuildPath) {\n            path.beginPath();\n            el.buildPath(path, el.shape);\n            el.pathUpdated();\n        }\n        var pathVersion = path.getVersion();\n        var elExt = el;\n        var svgPathBuilder = elExt.__svgPathBuilder;\n        if (elExt.__svgPathVersion !== pathVersion\n            || !svgPathBuilder\n            || strokePercent !== elExt.__svgPathStrokePercent) {\n            if (!svgPathBuilder) {\n                svgPathBuilder = elExt.__svgPathBuilder = new SVGPathRebuilder();\n            }\n            svgPathBuilder.reset(precision);\n            path.rebuildPath(svgPathBuilder, strokePercent);\n            svgPathBuilder.generateStr();\n            elExt.__svgPathVersion = pathVersion;\n            elExt.__svgPathStrokePercent = strokePercent;\n        }\n        attrs.d = svgPathBuilder.getStr();\n    }\n    setTransform(attrs, el.transform);\n    setStyleAttrs(attrs, style, el, scope);\n    setMetaData(attrs, el);\n    scope.animation && createCSSAnimation(el, attrs, scope);\n    scope.emphasis && createCSSEmphasis(el, attrs, scope);\n    return createVNode(svgElType, el.id + '', attrs);\n}\nexport function brushSVGImage(el, scope) {\n    var style = el.style;\n    var image = style.image;\n    if (image && !isString(image)) {\n        if (isImageLike(image)) {\n            image = image.src;\n        }\n        else if (isCanvasLike(image)) {\n            image = image.toDataURL();\n        }\n    }\n    if (!image) {\n        return;\n    }\n    var x = style.x || 0;\n    var y = style.y || 0;\n    var dw = style.width;\n    var dh = style.height;\n    var attrs = {\n        href: image,\n        width: dw,\n        height: dh\n    };\n    if (x) {\n        attrs.x = x;\n    }\n    if (y) {\n        attrs.y = y;\n    }\n    setTransform(attrs, el.transform);\n    setStyleAttrs(attrs, style, el, scope);\n    setMetaData(attrs, el);\n    scope.animation && createCSSAnimation(el, attrs, scope);\n    return createVNode('image', el.id + '', attrs);\n}\n;\nexport function brushSVGTSpan(el, scope) {\n    var style = el.style;\n    var text = style.text;\n    text != null && (text += '');\n    if (!text || isNaN(style.x) || isNaN(style.y)) {\n        return;\n    }\n    var font = style.font || DEFAULT_FONT;\n    var x = style.x || 0;\n    var y = adjustTextY(style.y || 0, getLineHeight(font), style.textBaseline);\n    var textAlign = TEXT_ALIGN_TO_ANCHOR[style.textAlign]\n        || style.textAlign;\n    var attrs = {\n        'dominant-baseline': 'central',\n        'text-anchor': textAlign\n    };\n    if (hasSeparateFont(style)) {\n        var separatedFontStr = '';\n        var fontStyle = style.fontStyle;\n        var fontSize = parseFontSize(style.fontSize);\n        if (!parseFloat(fontSize)) {\n            return;\n        }\n        var fontFamily = style.fontFamily || DEFAULT_FONT_FAMILY;\n        var fontWeight = style.fontWeight;\n        separatedFontStr += \"font-size:\" + fontSize + \";font-family:\" + fontFamily + \";\";\n        if (fontStyle && fontStyle !== 'normal') {\n            separatedFontStr += \"font-style:\" + fontStyle + \";\";\n        }\n        if (fontWeight && fontWeight !== 'normal') {\n            separatedFontStr += \"font-weight:\" + fontWeight + \";\";\n        }\n        attrs.style = separatedFontStr;\n    }\n    else {\n        attrs.style = \"font: \" + font;\n    }\n    if (text.match(/\\s/)) {\n        attrs['xml:space'] = 'preserve';\n    }\n    if (x) {\n        attrs.x = x;\n    }\n    if (y) {\n        attrs.y = y;\n    }\n    setTransform(attrs, el.transform);\n    setStyleAttrs(attrs, style, el, scope);\n    setMetaData(attrs, el);\n    scope.animation && createCSSAnimation(el, attrs, scope);\n    return createVNode('text', el.id + '', attrs, undefined, text);\n}\nexport function brush(el, scope) {\n    if (el instanceof Path) {\n        return brushSVGPath(el, scope);\n    }\n    else if (el instanceof ZRImage) {\n        return brushSVGImage(el, scope);\n    }\n    else if (el instanceof TSpan) {\n        return brushSVGTSpan(el, scope);\n    }\n}\nfunction setShadow(el, attrs, scope) {\n    var style = el.style;\n    if (hasShadow(style)) {\n        var shadowKey = getShadowKey(el);\n        var shadowCache = scope.shadowCache;\n        var shadowId = shadowCache[shadowKey];\n        if (!shadowId) {\n            var globalScale = el.getGlobalScale();\n            var scaleX = globalScale[0];\n            var scaleY = globalScale[1];\n            if (!scaleX || !scaleY) {\n                return;\n            }\n            var offsetX = style.shadowOffsetX || 0;\n            var offsetY = style.shadowOffsetY || 0;\n            var blur_1 = style.shadowBlur;\n            var _a = normalizeColor(style.shadowColor), opacity = _a.opacity, color = _a.color;\n            var stdDx = blur_1 / 2 / scaleX;\n            var stdDy = blur_1 / 2 / scaleY;\n            var stdDeviation = stdDx + ' ' + stdDy;\n            shadowId = scope.zrId + '-s' + scope.shadowIdx++;\n            scope.defs[shadowId] = createVNode('filter', shadowId, {\n                'id': shadowId,\n                'x': '-100%',\n                'y': '-100%',\n                'width': '300%',\n                'height': '300%'\n            }, [\n                createVNode('feDropShadow', '', {\n                    'dx': offsetX / scaleX,\n                    'dy': offsetY / scaleY,\n                    'stdDeviation': stdDeviation,\n                    'flood-color': color,\n                    'flood-opacity': opacity\n                })\n            ]);\n            shadowCache[shadowKey] = shadowId;\n        }\n        attrs.filter = getIdURL(shadowId);\n    }\n}\nexport function setGradient(style, attrs, target, scope) {\n    var val = style[target];\n    var gradientTag;\n    var gradientAttrs = {\n        'gradientUnits': val.global\n            ? 'userSpaceOnUse'\n            : 'objectBoundingBox'\n    };\n    if (isLinearGradient(val)) {\n        gradientTag = 'linearGradient';\n        gradientAttrs.x1 = val.x;\n        gradientAttrs.y1 = val.y;\n        gradientAttrs.x2 = val.x2;\n        gradientAttrs.y2 = val.y2;\n    }\n    else if (isRadialGradient(val)) {\n        gradientTag = 'radialGradient';\n        gradientAttrs.cx = retrieve2(val.x, 0.5);\n        gradientAttrs.cy = retrieve2(val.y, 0.5);\n        gradientAttrs.r = retrieve2(val.r, 0.5);\n    }\n    else {\n        if (process.env.NODE_ENV !== 'production') {\n            logError('Illegal gradient type.');\n        }\n        return;\n    }\n    var colors = val.colorStops;\n    var colorStops = [];\n    for (var i = 0, len = colors.length; i < len; ++i) {\n        var offset = round4(colors[i].offset) * 100 + '%';\n        var stopColor = colors[i].color;\n        var _a = normalizeColor(stopColor), color = _a.color, opacity = _a.opacity;\n        var stopsAttrs = {\n            'offset': offset\n        };\n        stopsAttrs['stop-color'] = color;\n        if (opacity < 1) {\n            stopsAttrs['stop-opacity'] = opacity;\n        }\n        colorStops.push(createVNode('stop', i + '', stopsAttrs));\n    }\n    var gradientVNode = createVNode(gradientTag, '', gradientAttrs, colorStops);\n    var gradientKey = vNodeToString(gradientVNode);\n    var gradientCache = scope.gradientCache;\n    var gradientId = gradientCache[gradientKey];\n    if (!gradientId) {\n        gradientId = scope.zrId + '-g' + scope.gradientIdx++;\n        gradientCache[gradientKey] = gradientId;\n        gradientAttrs.id = gradientId;\n        scope.defs[gradientId] = createVNode(gradientTag, gradientId, gradientAttrs, colorStops);\n    }\n    attrs[target] = getIdURL(gradientId);\n}\nexport function setPattern(el, attrs, target, scope) {\n    var val = el.style[target];\n    var boundingRect = el.getBoundingRect();\n    var patternAttrs = {};\n    var repeat = val.repeat;\n    var noRepeat = repeat === 'no-repeat';\n    var repeatX = repeat === 'repeat-x';\n    var repeatY = repeat === 'repeat-y';\n    var child;\n    if (isImagePattern(val)) {\n        var imageWidth_1 = val.imageWidth;\n        var imageHeight_1 = val.imageHeight;\n        var imageSrc = void 0;\n        var patternImage = val.image;\n        if (isString(patternImage)) {\n            imageSrc = patternImage;\n        }\n        else if (isImageLike(patternImage)) {\n            imageSrc = patternImage.src;\n        }\n        else if (isCanvasLike(patternImage)) {\n            imageSrc = patternImage.toDataURL();\n        }\n        if (typeof Image === 'undefined') {\n            var errMsg = 'Image width/height must been given explictly in svg-ssr renderer.';\n            assert(imageWidth_1, errMsg);\n            assert(imageHeight_1, errMsg);\n        }\n        else if (imageWidth_1 == null || imageHeight_1 == null) {\n            var setSizeToVNode_1 = function (vNode, img) {\n                if (vNode) {\n                    var svgEl = vNode.elm;\n                    var width = imageWidth_1 || img.width;\n                    var height = imageHeight_1 || img.height;\n                    if (vNode.tag === 'pattern') {\n                        if (repeatX) {\n                            height = 1;\n                            width /= boundingRect.width;\n                        }\n                        else if (repeatY) {\n                            width = 1;\n                            height /= boundingRect.height;\n                        }\n                    }\n                    vNode.attrs.width = width;\n                    vNode.attrs.height = height;\n                    if (svgEl) {\n                        svgEl.setAttribute('width', width);\n                        svgEl.setAttribute('height', height);\n                    }\n                }\n            };\n            var createdImage = createOrUpdateImage(imageSrc, null, el, function (img) {\n                noRepeat || setSizeToVNode_1(patternVNode, img);\n                setSizeToVNode_1(child, img);\n            });\n            if (createdImage && createdImage.width && createdImage.height) {\n                imageWidth_1 = imageWidth_1 || createdImage.width;\n                imageHeight_1 = imageHeight_1 || createdImage.height;\n            }\n        }\n        child = createVNode('image', 'img', {\n            href: imageSrc,\n            width: imageWidth_1,\n            height: imageHeight_1\n        });\n        patternAttrs.width = imageWidth_1;\n        patternAttrs.height = imageHeight_1;\n    }\n    else if (val.svgElement) {\n        child = clone(val.svgElement);\n        patternAttrs.width = val.svgWidth;\n        patternAttrs.height = val.svgHeight;\n    }\n    if (!child) {\n        return;\n    }\n    var patternWidth;\n    var patternHeight;\n    if (noRepeat) {\n        patternWidth = patternHeight = 1;\n    }\n    else if (repeatX) {\n        patternHeight = 1;\n        patternWidth = patternAttrs.width / boundingRect.width;\n    }\n    else if (repeatY) {\n        patternWidth = 1;\n        patternHeight = patternAttrs.height / boundingRect.height;\n    }\n    else {\n        patternAttrs.patternUnits = 'userSpaceOnUse';\n    }\n    if (patternWidth != null && !isNaN(patternWidth)) {\n        patternAttrs.width = patternWidth;\n    }\n    if (patternHeight != null && !isNaN(patternHeight)) {\n        patternAttrs.height = patternHeight;\n    }\n    var patternTransform = getSRTTransformString(val);\n    patternTransform && (patternAttrs.patternTransform = patternTransform);\n    var patternVNode = createVNode('pattern', '', patternAttrs, [child]);\n    var patternKey = vNodeToString(patternVNode);\n    var patternCache = scope.patternCache;\n    var patternId = patternCache[patternKey];\n    if (!patternId) {\n        patternId = scope.zrId + '-p' + scope.patternIdx++;\n        patternCache[patternKey] = patternId;\n        patternAttrs.id = patternId;\n        patternVNode = scope.defs[patternId] = createVNode('pattern', patternId, patternAttrs, [child]);\n    }\n    attrs[target] = getIdURL(patternId);\n}\nexport function setClipPath(clipPath, attrs, scope) {\n    var clipPathCache = scope.clipPathCache, defs = scope.defs;\n    var clipPathId = clipPathCache[clipPath.id];\n    if (!clipPathId) {\n        clipPathId = scope.zrId + '-c' + scope.clipPathIdx++;\n        var clipPathAttrs = {\n            id: clipPathId\n        };\n        clipPathCache[clipPath.id] = clipPathId;\n        defs[clipPathId] = createVNode('clipPath', clipPathId, clipPathAttrs, [brushSVGPath(clipPath, scope)]);\n    }\n    attrs['clip-path'] = getIdURL(clipPathId);\n}\n", "export function createTextNode(text) {\n    return document.createTextNode(text);\n}\nexport function createComment(text) {\n    return document.createComment(text);\n}\nexport function insertBefore(parentNode, newNode, referenceNode) {\n    parentNode.insertBefore(newNode, referenceNode);\n}\nexport function removeChild(node, child) {\n    node.removeChild(child);\n}\nexport function appendChild(node, child) {\n    node.appendChild(child);\n}\nexport function parentNode(node) {\n    return node.parentNode;\n}\nexport function nextSibling(node) {\n    return node.nextSibling;\n}\nexport function tagName(elm) {\n    return elm.tagName;\n}\nexport function setTextContent(node, text) {\n    node.textContent = text;\n}\nexport function getTextContent(node) {\n    return node.textContent;\n}\nexport function isElement(node) {\n    return node.nodeType === 1;\n}\nexport function isText(node) {\n    return node.nodeType === 3;\n}\nexport function isComment(node) {\n    return node.nodeType === 8;\n}\n", "import { isArray, isObject } from '../core/util.js';\nimport { createElement, createVNode, XMLNS, XML_NAMESPACE, XLINKNS } from './core.js';\nimport * as api from './domapi.js';\nvar colonChar = 58;\nvar xChar = 120;\nvar emptyNode = createVNode('', '');\nfunction isUndef(s) {\n    return s === undefined;\n}\nfunction isDef(s) {\n    return s !== undefined;\n}\nfunction createKeyToOldIdx(children, beginIdx, endIdx) {\n    var map = {};\n    for (var i = beginIdx; i <= endIdx; ++i) {\n        var key = children[i].key;\n        if (key !== undefined) {\n            if (process.env.NODE_ENV !== 'production') {\n                if (map[key] != null) {\n                    console.error(\"Duplicate key \" + key);\n                }\n            }\n            map[key] = i;\n        }\n    }\n    return map;\n}\nfunction sameVnode(vnode1, vnode2) {\n    var isSameKey = vnode1.key === vnode2.key;\n    var isSameTag = vnode1.tag === vnode2.tag;\n    return isSameTag && isSameKey;\n}\nfunction createElm(vnode) {\n    var i;\n    var children = vnode.children;\n    var tag = vnode.tag;\n    if (isDef(tag)) {\n        var elm = (vnode.elm = createElement(tag));\n        updateAttrs(emptyNode, vnode);\n        if (isArray(children)) {\n            for (i = 0; i < children.length; ++i) {\n                var ch = children[i];\n                if (ch != null) {\n                    api.appendChild(elm, createElm(ch));\n                }\n            }\n        }\n        else if (isDef(vnode.text) && !isObject(vnode.text)) {\n            api.appendChild(elm, api.createTextNode(vnode.text));\n        }\n    }\n    else {\n        vnode.elm = api.createTextNode(vnode.text);\n    }\n    return vnode.elm;\n}\nfunction addVnodes(parentElm, before, vnodes, startIdx, endIdx) {\n    for (; startIdx <= endIdx; ++startIdx) {\n        var ch = vnodes[startIdx];\n        if (ch != null) {\n            api.insertBefore(parentElm, createElm(ch), before);\n        }\n    }\n}\nfunction removeVnodes(parentElm, vnodes, startIdx, endIdx) {\n    for (; startIdx <= endIdx; ++startIdx) {\n        var ch = vnodes[startIdx];\n        if (ch != null) {\n            if (isDef(ch.tag)) {\n                var parent_1 = api.parentNode(ch.elm);\n                api.removeChild(parent_1, ch.elm);\n            }\n            else {\n                api.removeChild(parentElm, ch.elm);\n            }\n        }\n    }\n}\nexport function updateAttrs(oldVnode, vnode) {\n    var key;\n    var elm = vnode.elm;\n    var oldAttrs = oldVnode && oldVnode.attrs || {};\n    var attrs = vnode.attrs || {};\n    if (oldAttrs === attrs) {\n        return;\n    }\n    for (key in attrs) {\n        var cur = attrs[key];\n        var old = oldAttrs[key];\n        if (old !== cur) {\n            if (cur === true) {\n                elm.setAttribute(key, '');\n            }\n            else if (cur === false) {\n                elm.removeAttribute(key);\n            }\n            else {\n                if (key === 'style') {\n                    elm.style.cssText = cur;\n                }\n                else if (key.charCodeAt(0) !== xChar) {\n                    elm.setAttribute(key, cur);\n                }\n                else if (key === 'xmlns:xlink' || key === 'xmlns') {\n                    elm.setAttributeNS(XMLNS, key, cur);\n                }\n                else if (key.charCodeAt(3) === colonChar) {\n                    elm.setAttributeNS(XML_NAMESPACE, key, cur);\n                }\n                else if (key.charCodeAt(5) === colonChar) {\n                    elm.setAttributeNS(XLINKNS, key, cur);\n                }\n                else {\n                    elm.setAttribute(key, cur);\n                }\n            }\n        }\n    }\n    for (key in oldAttrs) {\n        if (!(key in attrs)) {\n            elm.removeAttribute(key);\n        }\n    }\n}\nfunction updateChildren(parentElm, oldCh, newCh) {\n    var oldStartIdx = 0;\n    var newStartIdx = 0;\n    var oldEndIdx = oldCh.length - 1;\n    var oldStartVnode = oldCh[0];\n    var oldEndVnode = oldCh[oldEndIdx];\n    var newEndIdx = newCh.length - 1;\n    var newStartVnode = newCh[0];\n    var newEndVnode = newCh[newEndIdx];\n    var oldKeyToIdx;\n    var idxInOld;\n    var elmToMove;\n    var before;\n    while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {\n        if (oldStartVnode == null) {\n            oldStartVnode = oldCh[++oldStartIdx];\n        }\n        else if (oldEndVnode == null) {\n            oldEndVnode = oldCh[--oldEndIdx];\n        }\n        else if (newStartVnode == null) {\n            newStartVnode = newCh[++newStartIdx];\n        }\n        else if (newEndVnode == null) {\n            newEndVnode = newCh[--newEndIdx];\n        }\n        else if (sameVnode(oldStartVnode, newStartVnode)) {\n            patchVnode(oldStartVnode, newStartVnode);\n            oldStartVnode = oldCh[++oldStartIdx];\n            newStartVnode = newCh[++newStartIdx];\n        }\n        else if (sameVnode(oldEndVnode, newEndVnode)) {\n            patchVnode(oldEndVnode, newEndVnode);\n            oldEndVnode = oldCh[--oldEndIdx];\n            newEndVnode = newCh[--newEndIdx];\n        }\n        else if (sameVnode(oldStartVnode, newEndVnode)) {\n            patchVnode(oldStartVnode, newEndVnode);\n            api.insertBefore(parentElm, oldStartVnode.elm, api.nextSibling(oldEndVnode.elm));\n            oldStartVnode = oldCh[++oldStartIdx];\n            newEndVnode = newCh[--newEndIdx];\n        }\n        else if (sameVnode(oldEndVnode, newStartVnode)) {\n            patchVnode(oldEndVnode, newStartVnode);\n            api.insertBefore(parentElm, oldEndVnode.elm, oldStartVnode.elm);\n            oldEndVnode = oldCh[--oldEndIdx];\n            newStartVnode = newCh[++newStartIdx];\n        }\n        else {\n            if (isUndef(oldKeyToIdx)) {\n                oldKeyToIdx = createKeyToOldIdx(oldCh, oldStartIdx, oldEndIdx);\n            }\n            idxInOld = oldKeyToIdx[newStartVnode.key];\n            if (isUndef(idxInOld)) {\n                api.insertBefore(parentElm, createElm(newStartVnode), oldStartVnode.elm);\n            }\n            else {\n                elmToMove = oldCh[idxInOld];\n                if (elmToMove.tag !== newStartVnode.tag) {\n                    api.insertBefore(parentElm, createElm(newStartVnode), oldStartVnode.elm);\n                }\n                else {\n                    patchVnode(elmToMove, newStartVnode);\n                    oldCh[idxInOld] = undefined;\n                    api.insertBefore(parentElm, elmToMove.elm, oldStartVnode.elm);\n                }\n            }\n            newStartVnode = newCh[++newStartIdx];\n        }\n    }\n    if (oldStartIdx <= oldEndIdx || newStartIdx <= newEndIdx) {\n        if (oldStartIdx > oldEndIdx) {\n            before = newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].elm;\n            addVnodes(parentElm, before, newCh, newStartIdx, newEndIdx);\n        }\n        else {\n            removeVnodes(parentElm, oldCh, oldStartIdx, oldEndIdx);\n        }\n    }\n}\nfunction patchVnode(oldVnode, vnode) {\n    var elm = (vnode.elm = oldVnode.elm);\n    var oldCh = oldVnode.children;\n    var ch = vnode.children;\n    if (oldVnode === vnode) {\n        return;\n    }\n    updateAttrs(oldVnode, vnode);\n    if (isUndef(vnode.text)) {\n        if (isDef(oldCh) && isDef(ch)) {\n            if (oldCh !== ch) {\n                updateChildren(elm, oldCh, ch);\n            }\n        }\n        else if (isDef(ch)) {\n            if (isDef(oldVnode.text)) {\n                api.setTextContent(elm, '');\n            }\n            addVnodes(elm, null, ch, 0, ch.length - 1);\n        }\n        else if (isDef(oldCh)) {\n            removeVnodes(elm, oldCh, 0, oldCh.length - 1);\n        }\n        else if (isDef(oldVnode.text)) {\n            api.setTextContent(elm, '');\n        }\n    }\n    else if (oldVnode.text !== vnode.text) {\n        if (isDef(oldCh)) {\n            removeVnodes(elm, oldCh, 0, oldCh.length - 1);\n        }\n        api.setTextContent(elm, vnode.text);\n    }\n}\nexport default function patch(oldVnode, vnode) {\n    if (sameVnode(oldVnode, vnode)) {\n        patchVnode(oldVnode, vnode);\n    }\n    else {\n        var elm = oldVnode.elm;\n        var parent_2 = api.parentNode(elm);\n        createElm(vnode);\n        if (parent_2 !== null) {\n            api.insertBefore(parent_2, vnode.elm, api.nextSibling(elm));\n            removeVnodes(parent_2, [oldVnode], 0, 0);\n        }\n    }\n    return vnode;\n}\n", "import { brush, setClipPath, setGradient, setPattern } from './graphic.js';\nimport { createElement, createVNode, vNodeToString, getCssString, createBrushScope, createSVGVNode } from './core.js';\nimport { normalizeColor, encodeBase64, isGradient, isPattern } from './helper.js';\nimport { extend, keys, logError, map, noop, retrieve2 } from '../core/util.js';\nimport patch, { updateAttrs } from './patch.js';\nimport { getSize } from '../canvas/helper.js';\nvar svgId = 0;\nvar SVGPainter = (function () {\n    function SVGPainter(root, storage, opts) {\n        this.type = 'svg';\n        this.refreshHover = createMethodNotSupport('refreshHover');\n        this.configLayer = createMethodNotSupport('configLayer');\n        this.storage = storage;\n        this._opts = opts = extend({}, opts);\n        this.root = root;\n        this._id = 'zr' + svgId++;\n        this._oldVNode = createSVGVNode(opts.width, opts.height);\n        if (root && !opts.ssr) {\n            var viewport = this._viewport = document.createElement('div');\n            viewport.style.cssText = 'position:relative;overflow:hidden';\n            var svgDom = this._svgDom = this._oldVNode.elm = createElement('svg');\n            updateAttrs(null, this._oldVNode);\n            viewport.appendChild(svgDom);\n            root.appendChild(viewport);\n        }\n        this.resize(opts.width, opts.height);\n    }\n    SVGPainter.prototype.getType = function () {\n        return this.type;\n    };\n    SVGPainter.prototype.getViewportRoot = function () {\n        return this._viewport;\n    };\n    SVGPainter.prototype.getViewportRootOffset = function () {\n        var viewportRoot = this.getViewportRoot();\n        if (viewportRoot) {\n            return {\n                offsetLeft: viewportRoot.offsetLeft || 0,\n                offsetTop: viewportRoot.offsetTop || 0\n            };\n        }\n    };\n    SVGPainter.prototype.getSvgDom = function () {\n        return this._svgDom;\n    };\n    SVGPainter.prototype.refresh = function () {\n        if (this.root) {\n            var vnode = this.renderToVNode({\n                willUpdate: true\n            });\n            vnode.attrs.style = 'position:absolute;left:0;top:0;user-select:none';\n            patch(this._oldVNode, vnode);\n            this._oldVNode = vnode;\n        }\n    };\n    SVGPainter.prototype.renderOneToVNode = function (el) {\n        return brush(el, createBrushScope(this._id));\n    };\n    SVGPainter.prototype.renderToVNode = function (opts) {\n        opts = opts || {};\n        var list = this.storage.getDisplayList(true);\n        var width = this._width;\n        var height = this._height;\n        var scope = createBrushScope(this._id);\n        scope.animation = opts.animation;\n        scope.willUpdate = opts.willUpdate;\n        scope.compress = opts.compress;\n        scope.emphasis = opts.emphasis;\n        scope.ssr = this._opts.ssr;\n        var children = [];\n        var bgVNode = this._bgVNode = createBackgroundVNode(width, height, this._backgroundColor, scope);\n        bgVNode && children.push(bgVNode);\n        var mainVNode = !opts.compress\n            ? (this._mainVNode = createVNode('g', 'main', {}, [])) : null;\n        this._paintList(list, scope, mainVNode ? mainVNode.children : children);\n        mainVNode && children.push(mainVNode);\n        var defs = map(keys(scope.defs), function (id) { return scope.defs[id]; });\n        if (defs.length) {\n            children.push(createVNode('defs', 'defs', {}, defs));\n        }\n        if (opts.animation) {\n            var animationCssStr = getCssString(scope.cssNodes, scope.cssAnims, { newline: true });\n            if (animationCssStr) {\n                var styleNode = createVNode('style', 'stl', {}, [], animationCssStr);\n                children.push(styleNode);\n            }\n        }\n        return createSVGVNode(width, height, children, opts.useViewBox);\n    };\n    SVGPainter.prototype.renderToString = function (opts) {\n        opts = opts || {};\n        return vNodeToString(this.renderToVNode({\n            animation: retrieve2(opts.cssAnimation, true),\n            emphasis: retrieve2(opts.cssEmphasis, true),\n            willUpdate: false,\n            compress: true,\n            useViewBox: retrieve2(opts.useViewBox, true)\n        }), { newline: true });\n    };\n    SVGPainter.prototype.setBackgroundColor = function (backgroundColor) {\n        this._backgroundColor = backgroundColor;\n    };\n    SVGPainter.prototype.getSvgRoot = function () {\n        return this._mainVNode && this._mainVNode.elm;\n    };\n    SVGPainter.prototype._paintList = function (list, scope, out) {\n        var listLen = list.length;\n        var clipPathsGroupsStack = [];\n        var clipPathsGroupsStackDepth = 0;\n        var currentClipPathGroup;\n        var prevClipPaths;\n        var clipGroupNodeIdx = 0;\n        for (var i = 0; i < listLen; i++) {\n            var displayable = list[i];\n            if (!displayable.invisible) {\n                var clipPaths = displayable.__clipPaths;\n                var len = clipPaths && clipPaths.length || 0;\n                var prevLen = prevClipPaths && prevClipPaths.length || 0;\n                var lca = void 0;\n                for (lca = Math.max(len - 1, prevLen - 1); lca >= 0; lca--) {\n                    if (clipPaths && prevClipPaths\n                        && clipPaths[lca] === prevClipPaths[lca]) {\n                        break;\n                    }\n                }\n                for (var i_1 = prevLen - 1; i_1 > lca; i_1--) {\n                    clipPathsGroupsStackDepth--;\n                    currentClipPathGroup = clipPathsGroupsStack[clipPathsGroupsStackDepth - 1];\n                }\n                for (var i_2 = lca + 1; i_2 < len; i_2++) {\n                    var groupAttrs = {};\n                    setClipPath(clipPaths[i_2], groupAttrs, scope);\n                    var g = createVNode('g', 'clip-g-' + clipGroupNodeIdx++, groupAttrs, []);\n                    (currentClipPathGroup ? currentClipPathGroup.children : out).push(g);\n                    clipPathsGroupsStack[clipPathsGroupsStackDepth++] = g;\n                    currentClipPathGroup = g;\n                }\n                prevClipPaths = clipPaths;\n                var ret = brush(displayable, scope);\n                if (ret) {\n                    (currentClipPathGroup ? currentClipPathGroup.children : out).push(ret);\n                }\n            }\n        }\n    };\n    SVGPainter.prototype.resize = function (width, height) {\n        var opts = this._opts;\n        var root = this.root;\n        var viewport = this._viewport;\n        width != null && (opts.width = width);\n        height != null && (opts.height = height);\n        if (root && viewport) {\n            viewport.style.display = 'none';\n            width = getSize(root, 0, opts);\n            height = getSize(root, 1, opts);\n            viewport.style.display = '';\n        }\n        if (this._width !== width || this._height !== height) {\n            this._width = width;\n            this._height = height;\n            if (viewport) {\n                var viewportStyle = viewport.style;\n                viewportStyle.width = width + 'px';\n                viewportStyle.height = height + 'px';\n            }\n            if (!isPattern(this._backgroundColor)) {\n                var svgDom = this._svgDom;\n                if (svgDom) {\n                    svgDom.setAttribute('width', width);\n                    svgDom.setAttribute('height', height);\n                }\n                var bgEl = this._bgVNode && this._bgVNode.elm;\n                if (bgEl) {\n                    bgEl.setAttribute('width', width);\n                    bgEl.setAttribute('height', height);\n                }\n            }\n            else {\n                this.refresh();\n            }\n        }\n    };\n    SVGPainter.prototype.getWidth = function () {\n        return this._width;\n    };\n    SVGPainter.prototype.getHeight = function () {\n        return this._height;\n    };\n    SVGPainter.prototype.dispose = function () {\n        if (this.root) {\n            this.root.innerHTML = '';\n        }\n        this._svgDom =\n            this._viewport =\n                this.storage =\n                    this._oldVNode =\n                        this._bgVNode =\n                            this._mainVNode = null;\n    };\n    SVGPainter.prototype.clear = function () {\n        if (this._svgDom) {\n            this._svgDom.innerHTML = null;\n        }\n        this._oldVNode = null;\n    };\n    SVGPainter.prototype.toDataURL = function (base64) {\n        var str = this.renderToString();\n        var prefix = 'data:image/svg+xml;';\n        if (base64) {\n            str = encodeBase64(str);\n            return str && prefix + 'base64,' + str;\n        }\n        return prefix + 'charset=UTF-8,' + encodeURIComponent(str);\n    };\n    return SVGPainter;\n}());\nfunction createMethodNotSupport(method) {\n    return function () {\n        if (process.env.NODE_ENV !== 'production') {\n            logError('In SVG mode painter not support method \"' + method + '\"');\n        }\n    };\n}\nfunction createBackgroundVNode(width, height, backgroundColor, scope) {\n    var bgVNode;\n    if (backgroundColor && backgroundColor !== 'none') {\n        bgVNode = createVNode('rect', 'bg', {\n            width: width,\n            height: height,\n            x: '0',\n            y: '0'\n        });\n        if (isGradient(backgroundColor)) {\n            setGradient({ fill: backgroundColor }, bgVNode.attrs, 'fill', scope);\n        }\n        else if (isPattern(backgroundColor)) {\n            setPattern({\n                style: {\n                    fill: backgroundColor\n                },\n                dirty: noop,\n                getBoundingRect: function () { return ({ width: width, height: height }); }\n            }, bgVNode.attrs, 'fill', scope);\n        }\n        else {\n            var _a = normalizeColor(backgroundColor), color = _a.color, opacity = _a.opacity;\n            bgVNode.attrs.fill = color;\n            opacity < 1 && (bgVNode.attrs['fill-opacity'] = opacity);\n        }\n    }\n    return bgVNode;\n}\nexport default SVGPainter;\n", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport SVGPainter from 'zrender/lib/svg/Painter.js';\nexport function install(registers) {\n  registers.registerPainter('svg', SVGPainter);\n}", "import { __extends } from \"tslib\";\nimport * as util from '../core/util.js';\nimport { devicePixelRatio } from '../config.js';\nimport Eventful from '../core/Eventful.js';\nimport { getCanvasGradient } from './helper.js';\nimport { createCanvasPattern } from './graphic.js';\nimport BoundingRect from '../core/BoundingRect.js';\nimport { REDRAW_BIT } from '../graphic/constants.js';\nimport { platformApi } from '../core/platform.js';\nfunction createDom(id, painter, dpr) {\n    var newDom = platformApi.createCanvas();\n    var width = painter.getWidth();\n    var height = painter.getHeight();\n    var newDomStyle = newDom.style;\n    if (newDomStyle) {\n        newDomStyle.position = 'absolute';\n        newDomStyle.left = '0';\n        newDomStyle.top = '0';\n        newDomStyle.width = width + 'px';\n        newDomStyle.height = height + 'px';\n        newDom.setAttribute('data-zr-dom-id', id);\n    }\n    newDom.width = width * dpr;\n    newDom.height = height * dpr;\n    return newDom;\n}\n;\nvar Layer = (function (_super) {\n    __extends(Layer, _super);\n    function Layer(id, painter, dpr) {\n        var _this = _super.call(this) || this;\n        _this.motionBlur = false;\n        _this.lastFrameAlpha = 0.7;\n        _this.dpr = 1;\n        _this.virtual = false;\n        _this.config = {};\n        _this.incremental = false;\n        _this.zlevel = 0;\n        _this.maxRepaintRectCount = 5;\n        _this.__dirty = true;\n        _this.__firstTimePaint = true;\n        _this.__used = false;\n        _this.__drawIndex = 0;\n        _this.__startIndex = 0;\n        _this.__endIndex = 0;\n        _this.__prevStartIndex = null;\n        _this.__prevEndIndex = null;\n        var dom;\n        dpr = dpr || devicePixelRatio;\n        if (typeof id === 'string') {\n            dom = createDom(id, painter, dpr);\n        }\n        else if (util.isObject(id)) {\n            dom = id;\n            id = dom.id;\n        }\n        _this.id = id;\n        _this.dom = dom;\n        var domStyle = dom.style;\n        if (domStyle) {\n            util.disableUserSelect(dom);\n            dom.onselectstart = function () { return false; };\n            domStyle.padding = '0';\n            domStyle.margin = '0';\n            domStyle.borderWidth = '0';\n        }\n        _this.painter = painter;\n        _this.dpr = dpr;\n        return _this;\n    }\n    Layer.prototype.getElementCount = function () {\n        return this.__endIndex - this.__startIndex;\n    };\n    Layer.prototype.afterBrush = function () {\n        this.__prevStartIndex = this.__startIndex;\n        this.__prevEndIndex = this.__endIndex;\n    };\n    Layer.prototype.initContext = function () {\n        this.ctx = this.dom.getContext('2d');\n        this.ctx.dpr = this.dpr;\n    };\n    Layer.prototype.setUnpainted = function () {\n        this.__firstTimePaint = true;\n    };\n    Layer.prototype.createBackBuffer = function () {\n        var dpr = this.dpr;\n        this.domBack = createDom('back-' + this.id, this.painter, dpr);\n        this.ctxBack = this.domBack.getContext('2d');\n        if (dpr !== 1) {\n            this.ctxBack.scale(dpr, dpr);\n        }\n    };\n    Layer.prototype.createRepaintRects = function (displayList, prevList, viewWidth, viewHeight) {\n        if (this.__firstTimePaint) {\n            this.__firstTimePaint = false;\n            return null;\n        }\n        var mergedRepaintRects = [];\n        var maxRepaintRectCount = this.maxRepaintRectCount;\n        var full = false;\n        var pendingRect = new BoundingRect(0, 0, 0, 0);\n        function addRectToMergePool(rect) {\n            if (!rect.isFinite() || rect.isZero()) {\n                return;\n            }\n            if (mergedRepaintRects.length === 0) {\n                var boundingRect = new BoundingRect(0, 0, 0, 0);\n                boundingRect.copy(rect);\n                mergedRepaintRects.push(boundingRect);\n            }\n            else {\n                var isMerged = false;\n                var minDeltaArea = Infinity;\n                var bestRectToMergeIdx = 0;\n                for (var i = 0; i < mergedRepaintRects.length; ++i) {\n                    var mergedRect = mergedRepaintRects[i];\n                    if (mergedRect.intersect(rect)) {\n                        var pendingRect_1 = new BoundingRect(0, 0, 0, 0);\n                        pendingRect_1.copy(mergedRect);\n                        pendingRect_1.union(rect);\n                        mergedRepaintRects[i] = pendingRect_1;\n                        isMerged = true;\n                        break;\n                    }\n                    else if (full) {\n                        pendingRect.copy(rect);\n                        pendingRect.union(mergedRect);\n                        var aArea = rect.width * rect.height;\n                        var bArea = mergedRect.width * mergedRect.height;\n                        var pendingArea = pendingRect.width * pendingRect.height;\n                        var deltaArea = pendingArea - aArea - bArea;\n                        if (deltaArea < minDeltaArea) {\n                            minDeltaArea = deltaArea;\n                            bestRectToMergeIdx = i;\n                        }\n                    }\n                }\n                if (full) {\n                    mergedRepaintRects[bestRectToMergeIdx].union(rect);\n                    isMerged = true;\n                }\n                if (!isMerged) {\n                    var boundingRect = new BoundingRect(0, 0, 0, 0);\n                    boundingRect.copy(rect);\n                    mergedRepaintRects.push(boundingRect);\n                }\n                if (!full) {\n                    full = mergedRepaintRects.length >= maxRepaintRectCount;\n                }\n            }\n        }\n        for (var i = this.__startIndex; i < this.__endIndex; ++i) {\n            var el = displayList[i];\n            if (el) {\n                var shouldPaint = el.shouldBePainted(viewWidth, viewHeight, true, true);\n                var prevRect = el.__isRendered && ((el.__dirty & REDRAW_BIT) || !shouldPaint)\n                    ? el.getPrevPaintRect()\n                    : null;\n                if (prevRect) {\n                    addRectToMergePool(prevRect);\n                }\n                var curRect = shouldPaint && ((el.__dirty & REDRAW_BIT) || !el.__isRendered)\n                    ? el.getPaintRect()\n                    : null;\n                if (curRect) {\n                    addRectToMergePool(curRect);\n                }\n            }\n        }\n        for (var i = this.__prevStartIndex; i < this.__prevEndIndex; ++i) {\n            var el = prevList[i];\n            var shouldPaint = el && el.shouldBePainted(viewWidth, viewHeight, true, true);\n            if (el && (!shouldPaint || !el.__zr) && el.__isRendered) {\n                var prevRect = el.getPrevPaintRect();\n                if (prevRect) {\n                    addRectToMergePool(prevRect);\n                }\n            }\n        }\n        var hasIntersections;\n        do {\n            hasIntersections = false;\n            for (var i = 0; i < mergedRepaintRects.length;) {\n                if (mergedRepaintRects[i].isZero()) {\n                    mergedRepaintRects.splice(i, 1);\n                    continue;\n                }\n                for (var j = i + 1; j < mergedRepaintRects.length;) {\n                    if (mergedRepaintRects[i].intersect(mergedRepaintRects[j])) {\n                        hasIntersections = true;\n                        mergedRepaintRects[i].union(mergedRepaintRects[j]);\n                        mergedRepaintRects.splice(j, 1);\n                    }\n                    else {\n                        j++;\n                    }\n                }\n                i++;\n            }\n        } while (hasIntersections);\n        this._paintRects = mergedRepaintRects;\n        return mergedRepaintRects;\n    };\n    Layer.prototype.debugGetPaintRects = function () {\n        return (this._paintRects || []).slice();\n    };\n    Layer.prototype.resize = function (width, height) {\n        var dpr = this.dpr;\n        var dom = this.dom;\n        var domStyle = dom.style;\n        var domBack = this.domBack;\n        if (domStyle) {\n            domStyle.width = width + 'px';\n            domStyle.height = height + 'px';\n        }\n        dom.width = width * dpr;\n        dom.height = height * dpr;\n        if (domBack) {\n            domBack.width = width * dpr;\n            domBack.height = height * dpr;\n            if (dpr !== 1) {\n                this.ctxBack.scale(dpr, dpr);\n            }\n        }\n    };\n    Layer.prototype.clear = function (clearAll, clearColor, repaintRects) {\n        var dom = this.dom;\n        var ctx = this.ctx;\n        var width = dom.width;\n        var height = dom.height;\n        clearColor = clearColor || this.clearColor;\n        var haveMotionBLur = this.motionBlur && !clearAll;\n        var lastFrameAlpha = this.lastFrameAlpha;\n        var dpr = this.dpr;\n        var self = this;\n        if (haveMotionBLur) {\n            if (!this.domBack) {\n                this.createBackBuffer();\n            }\n            this.ctxBack.globalCompositeOperation = 'copy';\n            this.ctxBack.drawImage(dom, 0, 0, width / dpr, height / dpr);\n        }\n        var domBack = this.domBack;\n        function doClear(x, y, width, height) {\n            ctx.clearRect(x, y, width, height);\n            if (clearColor && clearColor !== 'transparent') {\n                var clearColorGradientOrPattern = void 0;\n                if (util.isGradientObject(clearColor)) {\n                    var shouldCache = clearColor.global || (clearColor.__width === width\n                        && clearColor.__height === height);\n                    clearColorGradientOrPattern = shouldCache\n                        && clearColor.__canvasGradient\n                        || getCanvasGradient(ctx, clearColor, {\n                            x: 0,\n                            y: 0,\n                            width: width,\n                            height: height\n                        });\n                    clearColor.__canvasGradient = clearColorGradientOrPattern;\n                    clearColor.__width = width;\n                    clearColor.__height = height;\n                }\n                else if (util.isImagePatternObject(clearColor)) {\n                    clearColor.scaleX = clearColor.scaleX || dpr;\n                    clearColor.scaleY = clearColor.scaleY || dpr;\n                    clearColorGradientOrPattern = createCanvasPattern(ctx, clearColor, {\n                        dirty: function () {\n                            self.setUnpainted();\n                            self.painter.refresh();\n                        }\n                    });\n                }\n                ctx.save();\n                ctx.fillStyle = clearColorGradientOrPattern || clearColor;\n                ctx.fillRect(x, y, width, height);\n                ctx.restore();\n            }\n            if (haveMotionBLur) {\n                ctx.save();\n                ctx.globalAlpha = lastFrameAlpha;\n                ctx.drawImage(domBack, x, y, width, height);\n                ctx.restore();\n            }\n        }\n        ;\n        if (!repaintRects || haveMotionBLur) {\n            doClear(0, 0, width, height);\n        }\n        else if (repaintRects.length) {\n            util.each(repaintRects, function (rect) {\n                doClear(rect.x * dpr, rect.y * dpr, rect.width * dpr, rect.height * dpr);\n            });\n        }\n    };\n    return Layer;\n}(Eventful));\nexport default Layer;\n", "import { devicePixelRatio } from '../config.js';\nimport * as util from '../core/util.js';\nimport Layer from './Layer.js';\nimport requestAnimationFrame from '../animation/requestAnimationFrame.js';\nimport env from '../core/env.js';\nimport { brush, brushSingle } from './graphic.js';\nimport { REDRAW_BIT } from '../graphic/constants.js';\nimport { getSize } from './helper.js';\nvar HOVER_LAYER_ZLEVEL = 1e5;\nvar CANVAS_ZLEVEL = 314159;\nvar EL_AFTER_INCREMENTAL_INC = 0.01;\nvar INCREMENTAL_INC = 0.001;\nfunction isLayerValid(layer) {\n    if (!layer) {\n        return false;\n    }\n    if (layer.__builtin__) {\n        return true;\n    }\n    if (typeof (layer.resize) !== 'function'\n        || typeof (layer.refresh) !== 'function') {\n        return false;\n    }\n    return true;\n}\nfunction createRoot(width, height) {\n    var domRoot = document.createElement('div');\n    domRoot.style.cssText = [\n        'position:relative',\n        'width:' + width + 'px',\n        'height:' + height + 'px',\n        'padding:0',\n        'margin:0',\n        'border-width:0'\n    ].join(';') + ';';\n    return domRoot;\n}\nvar CanvasPainter = (function () {\n    function CanvasPainter(root, storage, opts, id) {\n        this.type = 'canvas';\n        this._zlevelList = [];\n        this._prevDisplayList = [];\n        this._layers = {};\n        this._layerConfig = {};\n        this._needsManuallyCompositing = false;\n        this.type = 'canvas';\n        var singleCanvas = !root.nodeName\n            || root.nodeName.toUpperCase() === 'CANVAS';\n        this._opts = opts = util.extend({}, opts || {});\n        this.dpr = opts.devicePixelRatio || devicePixelRatio;\n        this._singleCanvas = singleCanvas;\n        this.root = root;\n        var rootStyle = root.style;\n        if (rootStyle) {\n            util.disableUserSelect(root);\n            root.innerHTML = '';\n        }\n        this.storage = storage;\n        var zlevelList = this._zlevelList;\n        this._prevDisplayList = [];\n        var layers = this._layers;\n        if (!singleCanvas) {\n            this._width = getSize(root, 0, opts);\n            this._height = getSize(root, 1, opts);\n            var domRoot = this._domRoot = createRoot(this._width, this._height);\n            root.appendChild(domRoot);\n        }\n        else {\n            var rootCanvas = root;\n            var width = rootCanvas.width;\n            var height = rootCanvas.height;\n            if (opts.width != null) {\n                width = opts.width;\n            }\n            if (opts.height != null) {\n                height = opts.height;\n            }\n            this.dpr = opts.devicePixelRatio || 1;\n            rootCanvas.width = width * this.dpr;\n            rootCanvas.height = height * this.dpr;\n            this._width = width;\n            this._height = height;\n            var mainLayer = new Layer(rootCanvas, this, this.dpr);\n            mainLayer.__builtin__ = true;\n            mainLayer.initContext();\n            layers[CANVAS_ZLEVEL] = mainLayer;\n            mainLayer.zlevel = CANVAS_ZLEVEL;\n            zlevelList.push(CANVAS_ZLEVEL);\n            this._domRoot = root;\n        }\n    }\n    CanvasPainter.prototype.getType = function () {\n        return 'canvas';\n    };\n    CanvasPainter.prototype.isSingleCanvas = function () {\n        return this._singleCanvas;\n    };\n    CanvasPainter.prototype.getViewportRoot = function () {\n        return this._domRoot;\n    };\n    CanvasPainter.prototype.getViewportRootOffset = function () {\n        var viewportRoot = this.getViewportRoot();\n        if (viewportRoot) {\n            return {\n                offsetLeft: viewportRoot.offsetLeft || 0,\n                offsetTop: viewportRoot.offsetTop || 0\n            };\n        }\n    };\n    CanvasPainter.prototype.refresh = function (paintAll) {\n        var list = this.storage.getDisplayList(true);\n        var prevList = this._prevDisplayList;\n        var zlevelList = this._zlevelList;\n        this._redrawId = Math.random();\n        this._paintList(list, prevList, paintAll, this._redrawId);\n        for (var i = 0; i < zlevelList.length; i++) {\n            var z = zlevelList[i];\n            var layer = this._layers[z];\n            if (!layer.__builtin__ && layer.refresh) {\n                var clearColor = i === 0 ? this._backgroundColor : null;\n                layer.refresh(clearColor);\n            }\n        }\n        if (this._opts.useDirtyRect) {\n            this._prevDisplayList = list.slice();\n        }\n        return this;\n    };\n    CanvasPainter.prototype.refreshHover = function () {\n        this._paintHoverList(this.storage.getDisplayList(false));\n    };\n    CanvasPainter.prototype._paintHoverList = function (list) {\n        var len = list.length;\n        var hoverLayer = this._hoverlayer;\n        hoverLayer && hoverLayer.clear();\n        if (!len) {\n            return;\n        }\n        var scope = {\n            inHover: true,\n            viewWidth: this._width,\n            viewHeight: this._height\n        };\n        var ctx;\n        for (var i = 0; i < len; i++) {\n            var el = list[i];\n            if (el.__inHover) {\n                if (!hoverLayer) {\n                    hoverLayer = this._hoverlayer = this.getLayer(HOVER_LAYER_ZLEVEL);\n                }\n                if (!ctx) {\n                    ctx = hoverLayer.ctx;\n                    ctx.save();\n                }\n                brush(ctx, el, scope, i === len - 1);\n            }\n        }\n        if (ctx) {\n            ctx.restore();\n        }\n    };\n    CanvasPainter.prototype.getHoverLayer = function () {\n        return this.getLayer(HOVER_LAYER_ZLEVEL);\n    };\n    CanvasPainter.prototype.paintOne = function (ctx, el) {\n        brushSingle(ctx, el);\n    };\n    CanvasPainter.prototype._paintList = function (list, prevList, paintAll, redrawId) {\n        if (this._redrawId !== redrawId) {\n            return;\n        }\n        paintAll = paintAll || false;\n        this._updateLayerStatus(list);\n        var _a = this._doPaintList(list, prevList, paintAll), finished = _a.finished, needsRefreshHover = _a.needsRefreshHover;\n        if (this._needsManuallyCompositing) {\n            this._compositeManually();\n        }\n        if (needsRefreshHover) {\n            this._paintHoverList(list);\n        }\n        if (!finished) {\n            var self_1 = this;\n            requestAnimationFrame(function () {\n                self_1._paintList(list, prevList, paintAll, redrawId);\n            });\n        }\n        else {\n            this.eachLayer(function (layer) {\n                layer.afterBrush && layer.afterBrush();\n            });\n        }\n    };\n    CanvasPainter.prototype._compositeManually = function () {\n        var ctx = this.getLayer(CANVAS_ZLEVEL).ctx;\n        var width = this._domRoot.width;\n        var height = this._domRoot.height;\n        ctx.clearRect(0, 0, width, height);\n        this.eachBuiltinLayer(function (layer) {\n            if (layer.virtual) {\n                ctx.drawImage(layer.dom, 0, 0, width, height);\n            }\n        });\n    };\n    CanvasPainter.prototype._doPaintList = function (list, prevList, paintAll) {\n        var _this = this;\n        var layerList = [];\n        var useDirtyRect = this._opts.useDirtyRect;\n        for (var zi = 0; zi < this._zlevelList.length; zi++) {\n            var zlevel = this._zlevelList[zi];\n            var layer = this._layers[zlevel];\n            if (layer.__builtin__\n                && layer !== this._hoverlayer\n                && (layer.__dirty || paintAll)) {\n                layerList.push(layer);\n            }\n        }\n        var finished = true;\n        var needsRefreshHover = false;\n        var _loop_1 = function (k) {\n            var layer = layerList[k];\n            var ctx = layer.ctx;\n            var repaintRects = useDirtyRect\n                && layer.createRepaintRects(list, prevList, this_1._width, this_1._height);\n            var start = paintAll ? layer.__startIndex : layer.__drawIndex;\n            var useTimer = !paintAll && layer.incremental && Date.now;\n            var startTime = useTimer && Date.now();\n            var clearColor = layer.zlevel === this_1._zlevelList[0]\n                ? this_1._backgroundColor : null;\n            if (layer.__startIndex === layer.__endIndex) {\n                layer.clear(false, clearColor, repaintRects);\n            }\n            else if (start === layer.__startIndex) {\n                var firstEl = list[start];\n                if (!firstEl.incremental || !firstEl.notClear || paintAll) {\n                    layer.clear(false, clearColor, repaintRects);\n                }\n            }\n            if (start === -1) {\n                console.error('For some unknown reason. drawIndex is -1');\n                start = layer.__startIndex;\n            }\n            var i;\n            var repaint = function (repaintRect) {\n                var scope = {\n                    inHover: false,\n                    allClipped: false,\n                    prevEl: null,\n                    viewWidth: _this._width,\n                    viewHeight: _this._height\n                };\n                for (i = start; i < layer.__endIndex; i++) {\n                    var el = list[i];\n                    if (el.__inHover) {\n                        needsRefreshHover = true;\n                    }\n                    _this._doPaintEl(el, layer, useDirtyRect, repaintRect, scope, i === layer.__endIndex - 1);\n                    if (useTimer) {\n                        var dTime = Date.now() - startTime;\n                        if (dTime > 15) {\n                            break;\n                        }\n                    }\n                }\n                if (scope.prevElClipPaths) {\n                    ctx.restore();\n                }\n            };\n            if (repaintRects) {\n                if (repaintRects.length === 0) {\n                    i = layer.__endIndex;\n                }\n                else {\n                    var dpr = this_1.dpr;\n                    for (var r = 0; r < repaintRects.length; ++r) {\n                        var rect = repaintRects[r];\n                        ctx.save();\n                        ctx.beginPath();\n                        ctx.rect(rect.x * dpr, rect.y * dpr, rect.width * dpr, rect.height * dpr);\n                        ctx.clip();\n                        repaint(rect);\n                        ctx.restore();\n                    }\n                }\n            }\n            else {\n                ctx.save();\n                repaint();\n                ctx.restore();\n            }\n            layer.__drawIndex = i;\n            if (layer.__drawIndex < layer.__endIndex) {\n                finished = false;\n            }\n        };\n        var this_1 = this;\n        for (var k = 0; k < layerList.length; k++) {\n            _loop_1(k);\n        }\n        if (env.wxa) {\n            util.each(this._layers, function (layer) {\n                if (layer && layer.ctx && layer.ctx.draw) {\n                    layer.ctx.draw();\n                }\n            });\n        }\n        return {\n            finished: finished,\n            needsRefreshHover: needsRefreshHover\n        };\n    };\n    CanvasPainter.prototype._doPaintEl = function (el, currentLayer, useDirtyRect, repaintRect, scope, isLast) {\n        var ctx = currentLayer.ctx;\n        if (useDirtyRect) {\n            var paintRect = el.getPaintRect();\n            if (!repaintRect || paintRect && paintRect.intersect(repaintRect)) {\n                brush(ctx, el, scope, isLast);\n                el.setPrevPaintRect(paintRect);\n            }\n        }\n        else {\n            brush(ctx, el, scope, isLast);\n        }\n    };\n    CanvasPainter.prototype.getLayer = function (zlevel, virtual) {\n        if (this._singleCanvas && !this._needsManuallyCompositing) {\n            zlevel = CANVAS_ZLEVEL;\n        }\n        var layer = this._layers[zlevel];\n        if (!layer) {\n            layer = new Layer('zr_' + zlevel, this, this.dpr);\n            layer.zlevel = zlevel;\n            layer.__builtin__ = true;\n            if (this._layerConfig[zlevel]) {\n                util.merge(layer, this._layerConfig[zlevel], true);\n            }\n            else if (this._layerConfig[zlevel - EL_AFTER_INCREMENTAL_INC]) {\n                util.merge(layer, this._layerConfig[zlevel - EL_AFTER_INCREMENTAL_INC], true);\n            }\n            if (virtual) {\n                layer.virtual = virtual;\n            }\n            this.insertLayer(zlevel, layer);\n            layer.initContext();\n        }\n        return layer;\n    };\n    CanvasPainter.prototype.insertLayer = function (zlevel, layer) {\n        var layersMap = this._layers;\n        var zlevelList = this._zlevelList;\n        var len = zlevelList.length;\n        var domRoot = this._domRoot;\n        var prevLayer = null;\n        var i = -1;\n        if (layersMap[zlevel]) {\n            if (process.env.NODE_ENV !== 'production') {\n                util.logError('ZLevel ' + zlevel + ' has been used already');\n            }\n            return;\n        }\n        if (!isLayerValid(layer)) {\n            if (process.env.NODE_ENV !== 'production') {\n                util.logError('Layer of zlevel ' + zlevel + ' is not valid');\n            }\n            return;\n        }\n        if (len > 0 && zlevel > zlevelList[0]) {\n            for (i = 0; i < len - 1; i++) {\n                if (zlevelList[i] < zlevel\n                    && zlevelList[i + 1] > zlevel) {\n                    break;\n                }\n            }\n            prevLayer = layersMap[zlevelList[i]];\n        }\n        zlevelList.splice(i + 1, 0, zlevel);\n        layersMap[zlevel] = layer;\n        if (!layer.virtual) {\n            if (prevLayer) {\n                var prevDom = prevLayer.dom;\n                if (prevDom.nextSibling) {\n                    domRoot.insertBefore(layer.dom, prevDom.nextSibling);\n                }\n                else {\n                    domRoot.appendChild(layer.dom);\n                }\n            }\n            else {\n                if (domRoot.firstChild) {\n                    domRoot.insertBefore(layer.dom, domRoot.firstChild);\n                }\n                else {\n                    domRoot.appendChild(layer.dom);\n                }\n            }\n        }\n        layer.painter || (layer.painter = this);\n    };\n    CanvasPainter.prototype.eachLayer = function (cb, context) {\n        var zlevelList = this._zlevelList;\n        for (var i = 0; i < zlevelList.length; i++) {\n            var z = zlevelList[i];\n            cb.call(context, this._layers[z], z);\n        }\n    };\n    CanvasPainter.prototype.eachBuiltinLayer = function (cb, context) {\n        var zlevelList = this._zlevelList;\n        for (var i = 0; i < zlevelList.length; i++) {\n            var z = zlevelList[i];\n            var layer = this._layers[z];\n            if (layer.__builtin__) {\n                cb.call(context, layer, z);\n            }\n        }\n    };\n    CanvasPainter.prototype.eachOtherLayer = function (cb, context) {\n        var zlevelList = this._zlevelList;\n        for (var i = 0; i < zlevelList.length; i++) {\n            var z = zlevelList[i];\n            var layer = this._layers[z];\n            if (!layer.__builtin__) {\n                cb.call(context, layer, z);\n            }\n        }\n    };\n    CanvasPainter.prototype.getLayers = function () {\n        return this._layers;\n    };\n    CanvasPainter.prototype._updateLayerStatus = function (list) {\n        this.eachBuiltinLayer(function (layer, z) {\n            layer.__dirty = layer.__used = false;\n        });\n        function updatePrevLayer(idx) {\n            if (prevLayer) {\n                if (prevLayer.__endIndex !== idx) {\n                    prevLayer.__dirty = true;\n                }\n                prevLayer.__endIndex = idx;\n            }\n        }\n        if (this._singleCanvas) {\n            for (var i_1 = 1; i_1 < list.length; i_1++) {\n                var el = list[i_1];\n                if (el.zlevel !== list[i_1 - 1].zlevel || el.incremental) {\n                    this._needsManuallyCompositing = true;\n                    break;\n                }\n            }\n        }\n        var prevLayer = null;\n        var incrementalLayerCount = 0;\n        var prevZlevel;\n        var i;\n        for (i = 0; i < list.length; i++) {\n            var el = list[i];\n            var zlevel = el.zlevel;\n            var layer = void 0;\n            if (prevZlevel !== zlevel) {\n                prevZlevel = zlevel;\n                incrementalLayerCount = 0;\n            }\n            if (el.incremental) {\n                layer = this.getLayer(zlevel + INCREMENTAL_INC, this._needsManuallyCompositing);\n                layer.incremental = true;\n                incrementalLayerCount = 1;\n            }\n            else {\n                layer = this.getLayer(zlevel + (incrementalLayerCount > 0 ? EL_AFTER_INCREMENTAL_INC : 0), this._needsManuallyCompositing);\n            }\n            if (!layer.__builtin__) {\n                util.logError('ZLevel ' + zlevel + ' has been used by unkown layer ' + layer.id);\n            }\n            if (layer !== prevLayer) {\n                layer.__used = true;\n                if (layer.__startIndex !== i) {\n                    layer.__dirty = true;\n                }\n                layer.__startIndex = i;\n                if (!layer.incremental) {\n                    layer.__drawIndex = i;\n                }\n                else {\n                    layer.__drawIndex = -1;\n                }\n                updatePrevLayer(i);\n                prevLayer = layer;\n            }\n            if ((el.__dirty & REDRAW_BIT) && !el.__inHover) {\n                layer.__dirty = true;\n                if (layer.incremental && layer.__drawIndex < 0) {\n                    layer.__drawIndex = i;\n                }\n            }\n        }\n        updatePrevLayer(i);\n        this.eachBuiltinLayer(function (layer, z) {\n            if (!layer.__used && layer.getElementCount() > 0) {\n                layer.__dirty = true;\n                layer.__startIndex = layer.__endIndex = layer.__drawIndex = 0;\n            }\n            if (layer.__dirty && layer.__drawIndex < 0) {\n                layer.__drawIndex = layer.__startIndex;\n            }\n        });\n    };\n    CanvasPainter.prototype.clear = function () {\n        this.eachBuiltinLayer(this._clearLayer);\n        return this;\n    };\n    CanvasPainter.prototype._clearLayer = function (layer) {\n        layer.clear();\n    };\n    CanvasPainter.prototype.setBackgroundColor = function (backgroundColor) {\n        this._backgroundColor = backgroundColor;\n        util.each(this._layers, function (layer) {\n            layer.setUnpainted();\n        });\n    };\n    CanvasPainter.prototype.configLayer = function (zlevel, config) {\n        if (config) {\n            var layerConfig = this._layerConfig;\n            if (!layerConfig[zlevel]) {\n                layerConfig[zlevel] = config;\n            }\n            else {\n                util.merge(layerConfig[zlevel], config, true);\n            }\n            for (var i = 0; i < this._zlevelList.length; i++) {\n                var _zlevel = this._zlevelList[i];\n                if (_zlevel === zlevel || _zlevel === zlevel + EL_AFTER_INCREMENTAL_INC) {\n                    var layer = this._layers[_zlevel];\n                    util.merge(layer, layerConfig[zlevel], true);\n                }\n            }\n        }\n    };\n    CanvasPainter.prototype.delLayer = function (zlevel) {\n        var layers = this._layers;\n        var zlevelList = this._zlevelList;\n        var layer = layers[zlevel];\n        if (!layer) {\n            return;\n        }\n        layer.dom.parentNode.removeChild(layer.dom);\n        delete layers[zlevel];\n        zlevelList.splice(util.indexOf(zlevelList, zlevel), 1);\n    };\n    CanvasPainter.prototype.resize = function (width, height) {\n        if (!this._domRoot.style) {\n            if (width == null || height == null) {\n                return;\n            }\n            this._width = width;\n            this._height = height;\n            this.getLayer(CANVAS_ZLEVEL).resize(width, height);\n        }\n        else {\n            var domRoot = this._domRoot;\n            domRoot.style.display = 'none';\n            var opts = this._opts;\n            var root = this.root;\n            width != null && (opts.width = width);\n            height != null && (opts.height = height);\n            width = getSize(root, 0, opts);\n            height = getSize(root, 1, opts);\n            domRoot.style.display = '';\n            if (this._width !== width || height !== this._height) {\n                domRoot.style.width = width + 'px';\n                domRoot.style.height = height + 'px';\n                for (var id in this._layers) {\n                    if (this._layers.hasOwnProperty(id)) {\n                        this._layers[id].resize(width, height);\n                    }\n                }\n                this.refresh(true);\n            }\n            this._width = width;\n            this._height = height;\n        }\n        return this;\n    };\n    CanvasPainter.prototype.clearLayer = function (zlevel) {\n        var layer = this._layers[zlevel];\n        if (layer) {\n            layer.clear();\n        }\n    };\n    CanvasPainter.prototype.dispose = function () {\n        this.root.innerHTML = '';\n        this.root =\n            this.storage =\n                this._domRoot =\n                    this._layers = null;\n    };\n    CanvasPainter.prototype.getRenderedCanvas = function (opts) {\n        opts = opts || {};\n        if (this._singleCanvas && !this._compositeManually) {\n            return this._layers[CANVAS_ZLEVEL].dom;\n        }\n        var imageLayer = new Layer('image', this, opts.pixelRatio || this.dpr);\n        imageLayer.initContext();\n        imageLayer.clear(false, opts.backgroundColor || this._backgroundColor);\n        var ctx = imageLayer.ctx;\n        if (opts.pixelRatio <= this.dpr) {\n            this.refresh();\n            var width_1 = imageLayer.dom.width;\n            var height_1 = imageLayer.dom.height;\n            this.eachLayer(function (layer) {\n                if (layer.__builtin__) {\n                    ctx.drawImage(layer.dom, 0, 0, width_1, height_1);\n                }\n                else if (layer.renderToCanvas) {\n                    ctx.save();\n                    layer.renderToCanvas(ctx);\n                    ctx.restore();\n                }\n            });\n        }\n        else {\n            var scope = {\n                inHover: false,\n                viewWidth: this._width,\n                viewHeight: this._height\n            };\n            var displayList = this.storage.getDisplayList(true);\n            for (var i = 0, len = displayList.length; i < len; i++) {\n                var el = displayList[i];\n                brush(ctx, el, scope, i === len - 1);\n            }\n        }\n        return imageLayer.dom;\n    };\n    CanvasPainter.prototype.getWidth = function () {\n        return this._width;\n    };\n    CanvasPainter.prototype.getHeight = function () {\n        return this._height;\n    };\n    return CanvasPainter;\n}());\nexport default CanvasPainter;\n;\n", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport CanvasPainter from 'zrender/lib/canvas/Painter.js';\nexport function install(registers) {\n  registers.registerPainter('canvas', CanvasPainter);\n}", "// Centralizza la palette dei grafici per mantenerla coerente tra controller diversi.\nexport const CHART_COLORS = Object.freeze([\n  \"#2E75B6\",\n  \"#367C4B\",\n  \"#F5803E\",\n  \"#C31F33\",\n  \"#0095C4\",\n  \"#748194\"\n])\n", "import { Controller } from \"@hotwired/stimulus\"\nimport { getInstanceByDom, init, use } from \"echarts/core\"\nimport { BarChart, LineChart } from \"echarts/charts\"\nimport { GridComponent, LegendComponent, TooltipComponent } from \"echarts/components\"\nimport { CanvasRenderer } from \"echarts/renderers\"\nimport { CHART_COLORS } from \"../custom/chart_colors\"\n\nuse([BarChart, LineChart, GridComponent, LegendComponent, TooltipComponent, CanvasRenderer])\n\nexport default class extends Controller {\n  static targets = [\n    \"canvas\",\n    \"chartMode\",\n    \"drilldownBody\",\n    \"drilldownPanel\",\n    \"drilldownTitle\",\n    \"emptyState\",\n    \"kpiPercentuale\",\n    \"kpiSchede\",\n    \"kpiValore\",\n    \"metric\",\n    \"piano\",\n    \"piani\",\n    \"yearFrom\",\n    \"yearTo\"\n  ]\n  static values = {\n    chart: Object,\n    metric: { type: String, default: \"numero\" },\n    chartMode: { type: String, default: \"grouped\" },\n    yearFrom: Number,\n    yearTo: Number\n  }\n\n  // Inizializza il grafico ECharts e sincronizza i controlli con il periodo disponibile.\n  connect() {\n    if (this.turboPreview()) return\n\n    this.setInitialYears()\n    this.beforeCacheHandler = () => this.disposeChartInstances()\n    this.resizeHandler = () => {\n      this.resizeOrInitializeChart()\n    }\n    document.addEventListener(\"turbo:before-cache\", this.beforeCacheHandler)\n    document.addEventListener(\"shown.bs.tab\", this.resizeHandler)\n    window.addEventListener(\"resize\", this.resizeHandler)\n    this.initializeChart()\n  }\n\n  // Rilascia l'istanza ECharts quando Stimulus scollega il controller dalla pagina.\n  disconnect() {\n    if (this.resizeHandler) window.removeEventListener(\"resize\", this.resizeHandler)\n    if (this.resizeHandler) document.removeEventListener(\"shown.bs.tab\", this.resizeHandler)\n    if (this.beforeCacheHandler) document.removeEventListener(\"turbo:before-cache\", this.beforeCacheHandler)\n    this.disposeChartInstances()\n  }\n\n  // Aggiorna la metrica selezionata e ricalcola grafici, KPI e dettaglio.\n  changeMetric(event) {\n    this.metricValue = event.target.value\n    this.render()\n  }\n\n  // Aggiorna la modalita di visualizzazione tra barre affiancate e impilate.\n  changeChartMode(event) {\n    this.chartModeValue = event.target.value\n    this.render()\n  }\n\n  // Filtra i piani visibili e ricalcola le viste aggregate.\n  changePiani() {\n    this.clearDrilldown()\n    this.render()\n  }\n\n  // Seleziona tutti i piani disponibili e aggiorna il grafico con il perimetro completo.\n  selectAllPiani() {\n    this.pianoTargets.forEach(target => {\n      target.checked = true\n    })\n    this.changePiani()\n  }\n\n  // Deseleziona tutti i piani e aggiorna il grafico mostrando lo stato senza dati.\n  clearPiani() {\n    this.pianoTargets.forEach(target => {\n      target.checked = false\n    })\n    this.changePiani()\n  }\n\n  // Mantiene coerente il range anni e aggiorna le viste quando cambia un estremo.\n  changeYearRange() {\n    this.yearFromValue = Number(this.yearFromTarget.value)\n    this.yearToValue = Number(this.yearToTarget.value)\n\n    if (this.yearFromValue > this.yearToValue) {\n      this.yearToValue = this.yearFromValue\n      this.yearToTarget.value = this.yearToValue\n    }\n\n    this.clearDrilldown()\n    this.render()\n  }\n\n  // Ridisegna il grafico principale e i KPI con i filtri correnti.\n  render() {\n    const metric = this.metricValue\n    const chartMode = this.currentChartMode()\n    const visibleYears = this.visibleYears()\n    const visiblePiani = this.visiblePiani()\n    const metricLabels = this.metricLabels()\n    const labels = {\n      numero: metricLabels.numero,\n      percentuale: metricLabels.percentuale,\n      valore: metricLabels.valore\n    }\n    const visibleRows = this.visibleRows(visiblePiani, visibleYears)\n    const hasData = visibleRows.some(row => this.metricKeys().some(metricKey => Number(row[metricKey] || 0) > 0))\n    const colors = this.chartColors()\n\n    this.chartInstance.setOption({\n      color: colors,\n      tooltip: {\n        trigger: \"axis\",\n        formatter: params => this.tooltipFormatter(params)\n      },\n      legend: {\n        type: \"scroll\",\n        bottom: 0\n      },\n      grid: {\n        left: 45,\n        right: 36,\n        top: 24,\n        bottom: 72\n      },\n      xAxis: {\n        type: \"category\",\n        data: visibleYears\n      },\n      yAxis: {\n        type: \"value\",\n        name: labels[metric],\n        axisLabel: {\n          formatter: value => this.formatValue(value, this.metricValueType(metric))\n        }\n      },\n      series: visiblePiani.map((piano, index) => ({\n        name: piano.nome,\n        type: \"bar\",\n        stack: chartMode === \"stacked\" ? \"liberalizzazioni\" : `piano-${piano.id}`,\n        itemStyle: this.barItemStyle(colors[index % colors.length]),\n        emphasis: { focus: \"series\" },\n        data: piano.dati\n          .filter(dato => visibleYears.includes(dato.anno))\n          .map(dato => dato[metric])\n      }))\n    }, true)\n\n    this.updateKpis(visiblePiani, visibleYears)\n    this.emptyStateTarget.classList.toggle(\"d-none\", hasData)\n  }\n\n  // Restituisce la palette condivisa dai grafici per tenere coerenti legenda, bordi e riempimenti.\n  chartColors() {\n    return CHART_COLORS\n  }\n\n  // Restituisce le etichette metriche del payload mantenendo i testi liberalizzazioni come default.\n  metricLabels() {\n    return {\n      numero: this.chartValue.labels?.numero || \"Schede\",\n      percentuale: this.chartValue.labels?.percentuale || \"Percentuale\",\n      valore: this.chartValue.labels?.valore || \"Totale corrispettivo\",\n      totale: this.chartValue.labels?.totale || \"Totale piano\"\n    }\n  }\n\n  // Restituisce le metriche fisse supportate dal grafico, lasciando al payload il significato delle etichette.\n  metricKeys() {\n    return [\"numero\", \"valore\", \"percentuale\"]\n  }\n\n  // Recupera il tipo di formattazione della metrica, usando i default storici del grafico liberalizzazioni.\n  metricValueType(metric) {\n    return this.chartValue.value_types?.[metric] || metric\n  }\n\n  // Prepara lo stile delle barre con bordo pieno e riempimento parzialmente trasparente.\n  barItemStyle(color) {\n    return {\n      color: this.translucentColor(color, 0.52),\n      borderColor: color,\n      borderWidth: 1\n    }\n  }\n\n  // Converte un colore esadecimale in rgba mantenendo il canale alpha configurabile.\n  translucentColor(color, alpha) {\n    const hex = color.replace(\"#\", \"\")\n    const red = parseInt(hex.slice(0, 2), 16)\n    const green = parseInt(hex.slice(2, 4), 16)\n    const blue = parseInt(hex.slice(4, 6), 16)\n\n    return `rgba(${red}, ${green}, ${blue}, ${alpha})`\n  }\n\n  // Imposta come periodo iniziale tutto l'intervallo anni disponibile nel payload.\n  setInitialYears() {\n    const years = this.chartValue.anni\n    this.yearFromValue = years[0]\n    this.yearToValue = years[years.length - 1]\n    this.yearFromTarget.value = this.yearFromValue\n    this.yearToTarget.value = this.yearToValue\n  }\n\n  // Restituisce gli anni compresi nel range selezionato.\n  visibleYears() {\n    return this.chartValue.anni.filter(anno => anno >= this.yearFromValue && anno <= this.yearToValue)\n  }\n\n  // Restituisce i piani selezionati dai checkbox, mantenendo tutti i piani solo se il filtro non e presente.\n  visiblePiani() {\n    if (!this.hasPianoTarget) return this.chartValue.piani\n\n    const selectedIds = this.pianoTargets\n      .filter(target => target.checked)\n      .map(target => Number(target.value))\n\n    return this.chartValue.piani.filter(piano => selectedIds.includes(Number(piano.id)))\n  }\n\n  // Riconosce le preview di Turbo Drive per evitare il render animato della copia cache della pagina.\n  turboPreview() {\n    return document.documentElement.hasAttribute(\"data-turbo-preview\")\n  }\n\n  // Smonta eventuali istanze ECharts gia associate al canvas prima di cache, disconnect o nuova init.\n  disposeChartInstances() {\n    const chart = this.hasCanvasTarget ? getInstanceByDom(this.canvasTarget) : this.chartInstance\n\n    if (chart) chart.dispose()\n    this.chartInstance = null\n  }\n\n  // Inizializza ECharts solo quando il canvas ha dimensioni reali, evitando i warning nelle tab nascoste.\n  initializeChart() {\n    if (!this.canvasHasSize()) return\n\n    this.disposeChartInstances()\n    this.chartInstance = init(this.canvasTarget)\n    this.chartInstance.on(\"click\", event => this.showDrilldown(event))\n    this.render()\n  }\n\n  // Ridimensiona il grafico se esiste, altrimenti prova a inizializzarlo quando diventa visibile.\n  resizeOrInitializeChart() {\n    if (!this.canvasHasSize()) return\n\n    if (this.chartInstance) {\n      this.chartInstance.resize()\n    } else {\n      this.initializeChart()\n    }\n  }\n\n  // Verifica che il canvas non sia dentro una tab nascosta o un contenitore ancora senza layout.\n  canvasHasSize() {\n    const bounds = this.canvasTarget.getBoundingClientRect()\n\n    return bounds.width > 0 && bounds.height > 0\n  }\n\n  // Legge la vista selezionata dai radio button per evitare stati Stimulus disallineati dopo il render.\n  currentChartMode() {\n    return this.chartModeTargets.find(target => target.checked)?.value || this.chartModeValue\n  }\n\n  // Raccoglie le righe annuali dei piani visibili nel periodo selezionato.\n  visibleRows(piani, years) {\n    return piani.flatMap(piano => piano.dati.filter(dato => years.includes(dato.anno)))\n  }\n\n  // Aggrega i dati del periodo per piano e li ordina per la metrica selezionata.\n  summaryRows(piani, years) {\n    return piani\n      .map(piano => {\n        const dati = piano.dati.filter(dato => years.includes(dato.anno))\n        const totals = this.metricKeys().reduce((values, metricKey) => {\n          values[metricKey] = dati.reduce((somma, dato) => somma + Number(dato[metricKey] || 0), 0)\n          return values\n        }, {})\n\n        return {\n          id: piano.id,\n          nome: piano.nome,\n          numero: Number(totals.numero.toFixed(2)),\n          percentuale: Number(this.summaryPercentualeValue(totals, piano).toFixed(2)),\n          valore: Number(totals.valore.toFixed(2)),\n          schede: dati.flatMap(dato => dato.schede || [])\n        }\n      })\n      .sort((a, b) => b[this.metricValue] - a[this.metricValue])\n  }\n\n  // Calcola il riepilogo della terza metrica come somma monetaria quando configurata, altrimenti come percentuale storica.\n  summaryPercentualeValue(totals, piano) {\n    if (this.metricValueType(\"percentuale\") === \"valore\") return totals.percentuale\n\n    return piano.totale_schede > 0 ? (totals.numero / piano.totale_schede) * 100 : 0\n  }\n\n  // Aggiorna i quattro indicatori sintetici in base a range anni e piani visibili.\n  updateKpis(piani, years) {\n    const rows = this.summaryRows(piani, years)\n    const totals = this.metricKeys().reduce((values, metricKey) => {\n      values[metricKey] = rows.reduce((somma, row) => somma + Number(row[metricKey] || 0), 0)\n      return values\n    }, {})\n\n    this.kpiSchedeTarget.textContent = this.formatValue(totals.numero, this.metricValueType(\"numero\"))\n    this.kpiValoreTarget.textContent = this.formatValue(totals.valore, this.metricValueType(\"valore\"))\n    this.kpiPercentualeTarget.textContent = this.formatValue(this.kpiPercentualeValue(totals, piani), this.metricValueType(\"percentuale\"))\n  }\n\n  // Restituisce il valore del terzo KPI come importo monetario configurato o come percentuale media storica.\n  kpiPercentualeValue(totals, piani) {\n    if (this.metricValueType(\"percentuale\") === \"valore\") return totals.percentuale\n\n    const totalePianiSchede = piani.reduce((somma, piano) => somma + Number(piano.totale_schede || 0), 0)\n    return totalePianiSchede > 0 ? (totals.numero / totalePianiSchede) * 100 : 0\n  }\n\n  // Mostra le schede legate alla barra anno/piano selezionata nel grafico principale.\n  showDrilldown(event) {\n    if (event.seriesType !== \"bar\") return\n\n    const piano = this.visiblePiani().find(record => record.nome === event.seriesName)\n    const dato = piano?.dati.find(record => record.anno === Number(event.name))\n    this.renderDrilldown(`${event.seriesName} - ${event.name}`, dato?.schede || [])\n  }\n\n  // Svuota e nasconde il dettaglio schede.\n  clearDrilldown() {\n    this.drilldownBodyTarget.innerHTML = \"\"\n    this.drilldownPanelTarget.classList.add(\"d-none\")\n  }\n\n  // Renderizza le righe della tabella dettaglio usando solo contenuti escapati.\n  renderDrilldown(title, schede) {\n    this.drilldownTitleTarget.textContent = `${title}: ${schede.length} richieste`\n    this.drilldownBodyTarget.innerHTML = schede.map(scheda => `\n      <tr>\n        <td class=\"fs--1\"><a class=\"eln-regular-text\" href=\"/vincoli/scheda/${scheda.id}?tab=generali\">${this.escapeHtml(scheda.nominativo)}</a></td>\n        <td class=\"fs--1\">${this.escapeHtml(scheda.comparto || \"-\")}</td>\n        <td class=\"fs--1\">${this.escapeHtml(scheda.gruppo || \"-\")}</td>\n        <td class=\"fs--1\">${this.escapeHtml(scheda.indirizzo || \"-\")}</td>\n        <td class=\"fs--1 text-end\">${this.formatDate(scheda.data)}</td>\n        <td class=\"fs--1 text-end\">${this.formatValue(scheda.valore, \"valore\")}</td>\n      </tr>\n    `).join(\"\")\n    this.drilldownPanelTarget.classList.remove(\"d-none\")\n  }\n\n  // Costruisce un tooltip completo usando etichette e formati definiti dal payload del grafico.\n  tooltipFormatter(params) {\n    const rows = Array.isArray(params) ? params : [params]\n    const anno = Number(rows[0]?.name)\n    const labels = this.metricLabels()\n    const righe = rows.map(row => {\n      const piano = this.chartValue.piani.find(record => record.nome === row.seriesName)\n      const dato = piano?.dati.find(record => record.anno === anno)\n      if (!dato) return \"\"\n\n      return [\n        `${row.marker} ${this.escapeHtml(row.seriesName)}`,\n        `${labels.numero}: ${this.formatValue(dato.numero, this.metricValueType(\"numero\"))}`,\n        `${labels.valore}: ${this.formatValue(dato.valore, this.metricValueType(\"valore\"))}`,\n        `${labels.percentuale}: ${this.formatValue(dato.percentuale, this.metricValueType(\"percentuale\"))}`,\n        `${labels.totale}: ${this.formatValue(this.totalePianoTooltip(piano), this.metricValueType(\"totale\"))}`\n      ].join(\"<br>\")\n    }).filter(Boolean)\n\n    return [`<strong>${anno}</strong>`, ...righe].join(\"<br>\")\n  }\n\n  // Restituisce il totale piano coerente con il tipo configurato dal payload.\n  totalePianoTooltip(piano) {\n    if (this.metricValueType(\"totale\") === \"valore\") {\n      return (piano.dati || []).reduce((somma, dato) => somma + Number(dato.percentuale || 0), 0)\n    }\n\n    return piano.totale_schede\n  }\n\n  // Formatta date ISO nel formato italiano usato nelle tabelle.\n  formatDate(value) {\n    if (!value) return \"-\"\n\n    return new Date(value).toLocaleDateString(\"it-IT\")\n  }\n\n  // Escapa i valori testuali inseriti via template HTML nel dettaglio e nel tooltip.\n  escapeHtml(value) {\n    const element = document.createElement(\"div\")\n    element.textContent = value\n\n    return element.innerHTML\n  }\n\n  // Formatta i valori numerici secondo la metrica richiesta.\n  formatValue(value, metric) {\n    if (metric === \"percentuale\") return `${Number(value).toLocaleString(\"it-IT\")} %`\n    if (metric === \"valore\") {\n      return Number(value).toLocaleString(\"it-IT\", { style: \"currency\", currency: \"EUR\" })\n    }\n\n    return Number(value).toLocaleString(\"it-IT\")\n  }\n}\n", "import { Controller } from \"@hotwired/stimulus\"\nimport { getInstanceByDom, init, use } from \"echarts/core\"\nimport { BarChart, LineChart, PieChart } from \"echarts/charts\"\nimport { GridComponent, LegendComponent, TooltipComponent } from \"echarts/components\"\nimport { CanvasRenderer } from \"echarts/renderers\"\nimport { CHART_COLORS } from \"../custom/chart_colors\"\n\nuse([BarChart, LineChart, PieChart, GridComponent, LegendComponent, TooltipComponent, CanvasRenderer])\n\nexport default class extends Controller {\n  static targets = [\"canvas\", \"emptyState\", \"pianoSelect\", \"total\", \"timeViewSelect\", \"monthStartSelect\", \"monthStartWrapper\"]\n  static values = {\n    chart: Object\n  }\n\n  // Inizializza il grafico generico evitando il rendering delle preview Turbo.\n  connect() {\n    if (this.turboPreview()) return\n\n    this.beforeCacheHandler = () => this.disposeChartInstance()\n    this.resizeHandler = () => {\n      this.resizeOrInitializeChart()\n    }\n    this.themeChangeHandler = ({ detail }) => {\n      if (detail.control === \"theme\") this.renderOrInitializeChart()\n    }\n    document.addEventListener(\"turbo:before-cache\", this.beforeCacheHandler)\n    document.addEventListener(\"shown.bs.tab\", this.resizeHandler)\n    document.body.addEventListener(\"clickControl\", this.themeChangeHandler)\n    window.addEventListener(\"resize\", this.resizeHandler)\n    this.initializeChart()\n  }\n\n  // Rilascia l'istanza ECharts e gli handler quando Stimulus scollega il controller.\n  disconnect() {\n    if (this.resizeHandler) window.removeEventListener(\"resize\", this.resizeHandler)\n    if (this.resizeHandler) document.removeEventListener(\"shown.bs.tab\", this.resizeHandler)\n    if (this.beforeCacheHandler) document.removeEventListener(\"turbo:before-cache\", this.beforeCacheHandler)\n    if (this.themeChangeHandler) document.body.removeEventListener(\"clickControl\", this.themeChangeHandler)\n    this.disposeChartInstance()\n  }\n\n  // Aggiorna il doughnut quando l'utente seleziona un piano diverso.\n  changePiano() {\n    this.render()\n  }\n\n  // Aggiorna il trend quando l'utente passa dalla vista mensile a quella annuale.\n  changeTimeView() {\n    this.render()\n  }\n\n  // Aggiorna la finestra mobile mensile quando cambia il mese iniziale.\n  changeMonthStart() {\n    this.render()\n  }\n\n  // Renderizza un grafico bar/line/pie partendo dal payload server-side.\n  render() {\n    const chart = this.currentChart()\n    const hasData = this.chartHasData(chart)\n    if (chart.chart_type === \"pie\") {\n      this.renderPieChart(chart, hasData)\n      return\n    }\n\n    const horizontal = chart.horizontal === true\n    const axes = this.axesOptions(chart, horizontal)\n    const colors = this.chartColors()\n\n    this.chartInstance.setOption({\n      color: colors,\n      tooltip: {\n        trigger: \"axis\",\n        formatter: params => this.tooltipFormatter(params, chart)\n      },\n      legend: {\n        type: \"scroll\",\n        bottom: 0\n      },\n      grid: {\n        left: horizontal ? this.horizontalGridLeft(chart) : 56,\n        right: this.hasSecondaryAxis(chart) ? 72 : 28,\n        top: 28,\n        bottom: horizontal ? 82 : this.bottomGridSpacing(chart)\n      },\n      ...axes,\n      series: this.seriesOptions(chart, colors, horizontal)\n    }, true)\n\n    this.updateEmptyState(chart, hasData)\n  }\n\n  // Restituisce il payload corrente, adattando il trend alla vista temporale scelta dall'utente.\n  currentChart() {\n    const chart = this.chartValue\n    if (!chart.time_views) return chart\n\n    const timeView = this.hasTimeViewSelectTarget ? this.timeViewSelectTarget.value : \"monthly\"\n    const monthly = chart.time_views.monthly\n    const yearly = chart.time_views.yearly\n\n    if (this.hasMonthStartWrapperTarget) {\n      this.monthStartWrapperTarget.classList.toggle(\"d-none\", timeView === \"yearly\")\n    }\n\n    if (timeView === \"yearly\") {\n      return { ...chart, categories: yearly.categories, series: yearly.series }\n    }\n\n    const start = this.hasMonthStartSelectTarget ? this.monthStartSelectTarget.value : monthly.default_start\n    return {\n      ...chart,\n      categories: monthly.categories_by_start[start] || [],\n      series: monthly.series_by_start[start] || []\n    }\n  }\n\n  // Renderizza un doughnut/pie con bordi arrotondati e tooltip coerente con i valori del payload.\n  renderPieChart(chart, hasData) {\n    const colors = this.chartColors()\n\n    this.chartInstance.setOption({\n      color: colors,\n      tooltip: {\n        trigger: \"item\",\n        formatter: params => this.pieTooltipFormatter(params, chart)\n      },\n      legend: {\n        type: \"scroll\",\n        orient: \"vertical\",\n        left: 0,\n        top: 0,\n        bottom: 0,\n        itemStyle: this.pieLegendItemStyle(chart)\n      },\n      series: this.pieSeriesOptions(chart, colors)\n    }, true)\n\n    this.updateEmptyState(chart, hasData)\n\n    this.updatePieTotal(chart)\n  }\n\n  // Mostra lo stato vuoto senza lasciare assi o serie visibili sotto al messaggio.\n  updateEmptyState(chart, hasData) {\n    if (this.hasCanvasTarget) this.canvasTarget.classList.toggle(\"invisible\", !hasData)\n    if (!this.hasEmptyStateTarget) return\n\n    this.emptyStateTarget.textContent = chart.empty_message || \"Nessun dato disponibile\"\n    this.emptyStateTarget.classList.toggle(\"d-none\", hasData)\n  }\n\n  // Aggiorna il riepilogo testuale sotto al doughnut usando i segmenti del piano selezionato.\n  updatePieTotal(chart) {\n    if (!this.hasTotalTarget) return\n\n    const segmenti = this.seriesData(chart, chart.series?.[0] || {})\n    const totaleValore = segmenti.reduce((somma, segmento) => somma + Number(segmento.value || 0), 0)\n    const totaleSchede = segmenti.reduce((somma, segmento) => somma + Number(segmento.count || 0), 0)\n\n    this.totalTarget.textContent = `Totale: ${this.formatValue(totaleValore, \"currency\")} in ${this.formatValue(totaleSchede, \"number\")} schede`\n  }\n\n  // Verifica se almeno una serie contiene un valore positivo, gestendo sia dati numerici sia oggetti pie.\n  chartHasData(chart) {\n    return (chart.series || []).some(serie => {\n      return this.seriesData(chart, serie).some(item => {\n        const value = typeof item === \"object\" ? item.value : item\n\n        return Number(value) > 0\n      })\n    })\n  }\n\n  // Costruisce gli assi corretti in base all'orientamento del grafico.\n  axesOptions(chart, horizontal) {\n    const valueAxis = {\n      type: \"value\",\n      name: horizontal ? \"\" : chart.y_axis_name,\n      axisLabel: {\n        formatter: value => this.formatValue(value, chart.value_type)\n      }\n    }\n    const categoryAxis = {\n      type: \"category\",\n      name: \"\",\n      data: chart.categories || [],\n      axisLabel: this.categoryAxisLabelOptions(horizontal)\n    }\n\n    if (horizontal) {\n      return {\n        xAxis: this.valueAxes(chart, valueAxis),\n        yAxis: categoryAxis\n      }\n    }\n\n    return {\n      xAxis: categoryAxis,\n      yAxis: this.valueAxes(chart, valueAxis)\n    }\n  }\n\n  // Mostra tutte le etichette delle categorie e adatta i nomi lunghi dei piani allo spazio disponibile.\n  categoryAxisLabelOptions(horizontal) {\n    if (horizontal) {\n      return {\n        interval: 0,\n        width: 132,\n        overflow: \"break\",\n        formatter: value => this.wrapCategoryLabel(value, 18)\n      }\n    }\n\n    return {\n      interval: 0,\n      hideOverlap: false,\n      margin: 14,\n      formatter: value => this.wrapCategoryLabel(value, 16)\n    }\n  }\n\n  // Aumenta lo spazio inferiore quando le categorie hanno nomi lunghi su piu righe.\n  bottomGridSpacing(chart) {\n    const maxLength = Math.max(...(chart.categories || [\"\"]).map(category => String(category).length))\n    if (maxLength > 32) return 142\n    if (maxLength > 18) return 120\n\n    return 92\n  }\n\n  // Calcola il margine sinistro dei grafici orizzontali in base alla label piu lunga, evitando spazio morto.\n  horizontalGridLeft(chart) {\n    const maxLength = Math.max(...(chart.categories || [\"\"]).map(category => String(category).length))\n    const visibleLineLength = Math.min(maxLength, 18)\n    const estimatedWidth = (visibleLineLength * 6) + 28\n\n    return Math.min(Math.max(estimatedWidth, 92), 156)\n  }\n\n  // Spezza le label lunghe su piu righe invece di lasciarle tagliare dall'asse.\n  wrapCategoryLabel(value, maxLineLength) {\n    const words = String(value).split(\" \")\n    const lines = []\n    let line = \"\"\n\n    words.forEach(word => {\n      const candidate = line ? `${line} ${word}` : word\n      if (candidate.length <= maxLineLength) {\n        line = candidate\n      } else {\n        if (line) lines.push(line)\n        line = word\n      }\n    })\n\n    if (line) lines.push(line)\n\n    return lines.join(\"\\n\")\n  }\n\n  // Prepara uno o due assi valori quando il payload contiene una seconda metrica.\n  valueAxes(chart, valueAxis) {\n    if (!this.hasSecondaryAxis(chart)) return valueAxis\n\n    return [\n      valueAxis,\n      {\n        type: \"value\",\n        name: chart.secondary_axis_name || \"\",\n        axisLabel: {\n          formatter: value => this.formatValue(value, chart.secondary_value_type || chart.value_type)\n        }\n      }\n    ]\n  }\n\n  // Traduce le serie del payload nella configurazione ECharts mantenendo stack, asse secondario e stile barre.\n  seriesOptions(chart, colors, horizontal) {\n    return (chart.series || []).map((serie, index) => {\n      const type = serie.type || chart.chart_type || \"bar\"\n      const color = colors[index % colors.length]\n\n      return {\n        name: serie.name,\n        type,\n        stack: chart.stacked ? \"totale\" : undefined,\n        xAxisIndex: horizontal ? serie.yAxisIndex : undefined,\n        yAxisIndex: horizontal ? undefined : serie.yAxisIndex,\n        smooth: type === \"line\",\n        symbolSize: type === \"line\" ? 7 : undefined,\n        valueType: serie.value_type,\n        itemStyle: type === \"bar\" ? this.barItemStyle(color) : undefined,\n        emphasis: { focus: \"series\" },\n        data: serie.data || []\n      }\n    })\n  }\n\n  // Traduce il payload pie nella configurazione ECharts del doughnut rounded.\n  pieSeriesOptions(chart, colors) {\n    const borderColor = this.pieBorderColor(chart)\n\n    return (chart.series || []).map((serie, index) => ({\n      name: serie.name,\n      type: \"pie\",\n      radius: chart.doughnut ? [\"42%\", \"70%\"] : \"70%\",\n      center: [\"58%\", \"52%\"],\n      avoidLabelOverlap: true,\n      itemStyle: {\n        borderRadius: chart.rounded ? 10 : 0,\n        borderColor,\n        borderWidth: 2\n      },\n      label: {\n        show: false,\n        position: \"center\"\n      },\n      labelLine: {\n        show: false\n      },\n      data: this.seriesData(chart, serie).map((item, itemIndex) => ({\n        ...item,\n        itemStyle: {\n          color: colors[(index + itemIndex) % colors.length],\n          borderColor,\n          borderWidth: 2\n        }\n      }))\n    }))\n  }\n\n  // Restituisce lo stile dei marker legenda usando il bordo nero solo sui pie configurati in tema scuro.\n  pieLegendItemStyle(chart) {\n    if (!this.darkPieBorderEnabled(chart)) return {}\n\n    return {\n      borderColor: \"#000\",\n      borderWidth: 1\n    }\n  }\n\n  // Sceglie il colore del bordo delle fette pie in base al tema e al flag del payload.\n  pieBorderColor(chart) {\n    return this.darkPieBorderEnabled(chart) ? \"#000\" : \"#fff\"\n  }\n\n  // Verifica se il grafico pie corrente deve usare bordi neri nel tema scuro.\n  darkPieBorderEnabled(chart) {\n    return chart.dark_border === true && document.documentElement.classList.contains(\"dark\")\n  }\n\n  // Restituisce i dati della serie filtrandoli sul piano selezionato quando il payload lo prevede.\n  seriesData(chart, serie) {\n    if (chart.selectable_piani && Array.isArray(chart.piani)) {\n      const selectedId = this.hasPianoSelectTarget ? Number(this.pianoSelectTarget.value) : Number(chart.piani[0]?.id)\n      const piano = chart.piani.find(item => Number(item.id) === selectedId)\n\n      return piano?.segmenti || []\n    }\n\n    return serie.data || []\n  }\n\n  // Restituisce la palette condivisa dai grafici per tenere coerenti legenda, bordi e riempimenti.\n  chartColors() {\n    return CHART_COLORS\n  }\n\n  // Prepara lo stile delle barre con bordo pieno e riempimento parzialmente trasparente.\n  barItemStyle(color) {\n    return {\n      color: this.translucentColor(color, 0.52),\n      borderColor: color,\n      borderWidth: 1\n    }\n  }\n\n  // Converte un colore esadecimale in rgba mantenendo il canale alpha configurabile.\n  translucentColor(color, alpha) {\n    const hex = color.replace(\"#\", \"\")\n    const red = parseInt(hex.slice(0, 2), 16)\n    const green = parseInt(hex.slice(2, 4), 16)\n    const blue = parseInt(hex.slice(4, 6), 16)\n\n    return `rgba(${red}, ${green}, ${blue}, ${alpha})`\n  }\n\n  // Costruisce un tooltip coerente anche quando il grafico usa metriche diverse tra asse principale e secondario.\n  tooltipFormatter(params, chart) {\n    const rows = Array.isArray(params) ? params : [params]\n    const title = rows[0]?.axisValueLabel || rows[0]?.name || \"\"\n    const lines = rows.map(row => {\n      const series = (chart.series || []).find(item => item.name === row.seriesName) || {}\n      const valueType = series.value_type || (Number(series.yAxisIndex) === 1 ? chart.secondary_value_type : chart.value_type)\n\n      return `${row.marker} ${row.seriesName}: ${this.formatValue(row.value, valueType)}`\n    })\n\n    return [`<strong>${title}</strong>`, ...lines].join(\"<br>\")\n  }\n\n  // Costruisce il tooltip del doughnut includendo valore economico e numero schede quando disponibile.\n  pieTooltipFormatter(params, chart) {\n    const count = params.data?.count\n    const lines = [\n      `<strong>${params.name}</strong>`,\n      `${params.marker} Valore: ${this.formatValue(params.value, chart.value_type)}`\n    ]\n\n    if (count !== undefined) lines.push(`Schede: ${this.formatValue(count, \"number\")}`)\n\n    return lines.join(\"<br>\")\n  }\n\n  // Riconosce i payload con una serie agganciata all'asse secondario.\n  hasSecondaryAxis(chart) {\n    return (chart.series || []).some(serie => Number(serie.yAxisIndex) === 1)\n  }\n\n  // Riconosce le preview di Turbo Drive per evitare il render della copia cache della pagina.\n  turboPreview() {\n    return document.documentElement.hasAttribute(\"data-turbo-preview\")\n  }\n\n  // Smonta eventuali istanze ECharts gia associate al canvas prima di cache, disconnect o nuova init.\n  disposeChartInstance() {\n    const chart = this.hasCanvasTarget ? getInstanceByDom(this.canvasTarget) : this.chartInstance\n\n    if (chart) chart.dispose()\n    this.chartInstance = null\n  }\n\n  // Inizializza ECharts solo quando il canvas ha dimensioni reali, evitando i warning nelle tab nascoste.\n  initializeChart() {\n    if (!this.canvasHasSize()) return\n\n    this.disposeChartInstance()\n    this.chartInstance = init(this.canvasTarget)\n    this.render()\n  }\n\n  // Ridimensiona il grafico se esiste, altrimenti prova a inizializzarlo quando diventa visibile.\n  resizeOrInitializeChart() {\n    if (!this.canvasHasSize()) return\n\n    if (this.chartInstance) {\n      this.chartInstance.resize()\n    } else {\n      this.initializeChart()\n    }\n  }\n\n  // Applica il render del tema solo su grafici gia inizializzati, inizializzandoli se ora visibili.\n  renderOrInitializeChart() {\n    if (this.chartInstance) {\n      this.render()\n    } else {\n      this.initializeChart()\n    }\n  }\n\n  // Verifica che il canvas non sia dentro una tab nascosta o un contenitore ancora senza layout.\n  canvasHasSize() {\n    const bounds = this.canvasTarget.getBoundingClientRect()\n\n    return bounds.width > 0 && bounds.height > 0\n  }\n\n  // Formatta i valori numerici con convenzioni italiane e valuta quando richiesto.\n  formatValue(value, valueType) {\n    if (valueType === \"currency\") {\n      return Number(value).toLocaleString(\"it-IT\", { style: \"currency\", currency: \"EUR\" })\n    }\n\n    if (valueType === \"percent\") return `${Number(value).toLocaleString(\"it-IT\")} %`\n\n    return Number(value).toLocaleString(\"it-IT\")\n  }\n}\n", "// This file is auto-generated by ./bin/rails stimulus:manifest:update\n// Run that command whenever you add a new controller or create them with\n// ./bin/rails generate stimulus controllerName\n\nimport { application } from \"./application\"\n\nimport HelloController from \"./hello_controller\"\napplication.register(\"hello\", HelloController)\n\nimport EchartsChartController from \"./echarts_chart_controller\"\napplication.register(\"echarts-chart\", EchartsChartController)\n\nimport SimpleEchartsChartController from \"./simple_echarts_chart_controller\"\napplication.register(\"simple-echarts-chart\", SimpleEchartsChartController)\n", "export * from \"./enums.js\";\nexport * from \"./modifiers/index.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport { popperGenerator, detectOverflow, createPopper as createPopperBase } from \"./createPopper.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport { createPopper } from \"./popper.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport { createPopper as createPopperLite } from \"./popper-lite.js\";", "export var top = 'top';\nexport var bottom = 'bottom';\nexport var right = 'right';\nexport var left = 'left';\nexport var auto = 'auto';\nexport var basePlacements = [top, bottom, right, left];\nexport var start = 'start';\nexport var end = 'end';\nexport var clippingParents = 'clippingParents';\nexport var viewport = 'viewport';\nexport var popper = 'popper';\nexport var reference = 'reference';\nexport var variationPlacements = /*#__PURE__*/basePlacements.reduce(function (acc, placement) {\n  return acc.concat([placement + \"-\" + start, placement + \"-\" + end]);\n}, []);\nexport var placements = /*#__PURE__*/[].concat(basePlacements, [auto]).reduce(function (acc, placement) {\n  return acc.concat([placement, placement + \"-\" + start, placement + \"-\" + end]);\n}, []); // modifiers that need to read the DOM\n\nexport var beforeRead = 'beforeRead';\nexport var read = 'read';\nexport var afterRead = 'afterRead'; // pure-logic modifiers\n\nexport var beforeMain = 'beforeMain';\nexport var main = 'main';\nexport var afterMain = 'afterMain'; // modifier with the purpose to write to the DOM (or write into a framework state)\n\nexport var beforeWrite = 'beforeWrite';\nexport var write = 'write';\nexport var afterWrite = 'afterWrite';\nexport var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];", "export default function getNodeName(element) {\n  return element ? (element.nodeName || '').toLowerCase() : null;\n}", "export default function getWindow(node) {\n  if (node == null) {\n    return window;\n  }\n\n  if (node.toString() !== '[object Window]') {\n    var ownerDocument = node.ownerDocument;\n    return ownerDocument ? ownerDocument.defaultView || window : window;\n  }\n\n  return node;\n}", "import getWindow from \"./getWindow.js\";\n\nfunction isElement(node) {\n  var OwnElement = getWindow(node).Element;\n  return node instanceof OwnElement || node instanceof Element;\n}\n\nfunction isHTMLElement(node) {\n  var OwnElement = getWindow(node).HTMLElement;\n  return node instanceof OwnElement || node instanceof HTMLElement;\n}\n\nfunction isShadowRoot(node) {\n  // IE 11 has no ShadowRoot\n  if (typeof ShadowRoot === 'undefined') {\n    return false;\n  }\n\n  var OwnElement = getWindow(node).ShadowRoot;\n  return node instanceof OwnElement || node instanceof ShadowRoot;\n}\n\nexport { isElement, isHTMLElement, isShadowRoot };", "import getNodeName from \"../dom-utils/getNodeName.js\";\nimport { isHTMLElement } from \"../dom-utils/instanceOf.js\"; // This modifier takes the styles prepared by the `computeStyles` modifier\n// and applies them to the HTMLElements such as popper and arrow\n\nfunction applyStyles(_ref) {\n  var state = _ref.state;\n  Object.keys(state.elements).forEach(function (name) {\n    var style = state.styles[name] || {};\n    var attributes = state.attributes[name] || {};\n    var element = state.elements[name]; // arrow is optional + virtual elements\n\n    if (!isHTMLElement(element) || !getNodeName(element)) {\n      return;\n    } // Flow doesn't support to extend this property, but it's the most\n    // effective way to apply styles to an HTMLElement\n    // $FlowFixMe[cannot-write]\n\n\n    Object.assign(element.style, style);\n    Object.keys(attributes).forEach(function (name) {\n      var value = attributes[name];\n\n      if (value === false) {\n        element.removeAttribute(name);\n      } else {\n        element.setAttribute(name, value === true ? '' : value);\n      }\n    });\n  });\n}\n\nfunction effect(_ref2) {\n  var state = _ref2.state;\n  var initialStyles = {\n    popper: {\n      position: state.options.strategy,\n      left: '0',\n      top: '0',\n      margin: '0'\n    },\n    arrow: {\n      position: 'absolute'\n    },\n    reference: {}\n  };\n  Object.assign(state.elements.popper.style, initialStyles.popper);\n  state.styles = initialStyles;\n\n  if (state.elements.arrow) {\n    Object.assign(state.elements.arrow.style, initialStyles.arrow);\n  }\n\n  return function () {\n    Object.keys(state.elements).forEach(function (name) {\n      var element = state.elements[name];\n      var attributes = state.attributes[name] || {};\n      var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]); // Set all values to an empty string to unset them\n\n      var style = styleProperties.reduce(function (style, property) {\n        style[property] = '';\n        return style;\n      }, {}); // arrow is optional + virtual elements\n\n      if (!isHTMLElement(element) || !getNodeName(element)) {\n        return;\n      }\n\n      Object.assign(element.style, style);\n      Object.keys(attributes).forEach(function (attribute) {\n        element.removeAttribute(attribute);\n      });\n    });\n  };\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n  name: 'applyStyles',\n  enabled: true,\n  phase: 'write',\n  fn: applyStyles,\n  effect: effect,\n  requires: ['computeStyles']\n};", "import { auto } from \"../enums.js\";\nexport default function getBasePlacement(placement) {\n  return placement.split('-')[0];\n}", "export var max = Math.max;\nexport var min = Math.min;\nexport var round = Math.round;", "export default function getUAString() {\n  var uaData = navigator.userAgentData;\n\n  if (uaData != null && uaData.brands && Array.isArray(uaData.brands)) {\n    return uaData.brands.map(function (item) {\n      return item.brand + \"/\" + item.version;\n    }).join(' ');\n  }\n\n  return navigator.userAgent;\n}", "import getUAString from \"../utils/userAgent.js\";\nexport default function isLayoutViewport() {\n  return !/^((?!chrome|android).)*safari/i.test(getUAString());\n}", "import { isElement, isHTMLElement } from \"./instanceOf.js\";\nimport { round } from \"../utils/math.js\";\nimport getWindow from \"./getWindow.js\";\nimport isLayoutViewport from \"./isLayoutViewport.js\";\nexport default function getBoundingClientRect(element, includeScale, isFixedStrategy) {\n  if (includeScale === void 0) {\n    includeScale = false;\n  }\n\n  if (isFixedStrategy === void 0) {\n    isFixedStrategy = false;\n  }\n\n  var clientRect = element.getBoundingClientRect();\n  var scaleX = 1;\n  var scaleY = 1;\n\n  if (includeScale && isHTMLElement(element)) {\n    scaleX = element.offsetWidth > 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1;\n    scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1;\n  }\n\n  var _ref = isElement(element) ? getWindow(element) : window,\n      visualViewport = _ref.visualViewport;\n\n  var addVisualOffsets = !isLayoutViewport() && isFixedStrategy;\n  var x = (clientRect.left + (addVisualOffsets && visualViewport ? visualViewport.offsetLeft : 0)) / scaleX;\n  var y = (clientRect.top + (addVisualOffsets && visualViewport ? visualViewport.offsetTop : 0)) / scaleY;\n  var width = clientRect.width / scaleX;\n  var height = clientRect.height / scaleY;\n  return {\n    width: width,\n    height: height,\n    top: y,\n    right: x + width,\n    bottom: y + height,\n    left: x,\n    x: x,\n    y: y\n  };\n}", "import getBoundingClientRect from \"./getBoundingClientRect.js\"; // Returns the layout rect of an element relative to its offsetParent. Layout\n// means it doesn't take into account transforms.\n\nexport default function getLayoutRect(element) {\n  var clientRect = getBoundingClientRect(element); // Use the clientRect sizes if it's not been transformed.\n  // Fixes https://github.com/popperjs/popper-core/issues/1223\n\n  var width = element.offsetWidth;\n  var height = element.offsetHeight;\n\n  if (Math.abs(clientRect.width - width) <= 1) {\n    width = clientRect.width;\n  }\n\n  if (Math.abs(clientRect.height - height) <= 1) {\n    height = clientRect.height;\n  }\n\n  return {\n    x: element.offsetLeft,\n    y: element.offsetTop,\n    width: width,\n    height: height\n  };\n}", "import { isShadowRoot } from \"./instanceOf.js\";\nexport default function contains(parent, child) {\n  var rootNode = child.getRootNode && child.getRootNode(); // First, attempt with faster native method\n\n  if (parent.contains(child)) {\n    return true;\n  } // then fallback to custom implementation with Shadow DOM support\n  else if (rootNode && isShadowRoot(rootNode)) {\n      var next = child;\n\n      do {\n        if (next && parent.isSameNode(next)) {\n          return true;\n        } // $FlowFixMe[prop-missing]: need a better way to handle this...\n\n\n        next = next.parentNode || next.host;\n      } while (next);\n    } // Give up, the result is false\n\n\n  return false;\n}", "import getWindow from \"./getWindow.js\";\nexport default function getComputedStyle(element) {\n  return getWindow(element).getComputedStyle(element);\n}", "import getNodeName from \"./getNodeName.js\";\nexport default function isTableElement(element) {\n  return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0;\n}", "import { isElement } from \"./instanceOf.js\";\nexport default function getDocumentElement(element) {\n  // $FlowFixMe[incompatible-return]: assume body is always available\n  return ((isElement(element) ? element.ownerDocument : // $FlowFixMe[prop-missing]\n  element.document) || window.document).documentElement;\n}", "import getNodeName from \"./getNodeName.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport { isShadowRoot } from \"./instanceOf.js\";\nexport default function getParentNode(element) {\n  if (getNodeName(element) === 'html') {\n    return element;\n  }\n\n  return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle\n    // $FlowFixMe[incompatible-return]\n    // $FlowFixMe[prop-missing]\n    element.assignedSlot || // step into the shadow DOM of the parent of a slotted node\n    element.parentNode || ( // DOM Element detected\n    isShadowRoot(element) ? element.host : null) || // ShadowRoot detected\n    // $FlowFixMe[incompatible-call]: HTMLElement is a Node\n    getDocumentElement(element) // fallback\n\n  );\n}", "import getWindow from \"./getWindow.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport { isHTMLElement, isShadowRoot } from \"./instanceOf.js\";\nimport isTableElement from \"./isTableElement.js\";\nimport getParentNode from \"./getParentNode.js\";\nimport getUAString from \"../utils/userAgent.js\";\n\nfunction getTrueOffsetParent(element) {\n  if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837\n  getComputedStyle(element).position === 'fixed') {\n    return null;\n  }\n\n  return element.offsetParent;\n} // `.offsetParent` reports `null` for fixed elements, while absolute elements\n// return the containing block\n\n\nfunction getContainingBlock(element) {\n  var isFirefox = /firefox/i.test(getUAString());\n  var isIE = /Trident/i.test(getUAString());\n\n  if (isIE && isHTMLElement(element)) {\n    // In IE 9, 10 and 11 fixed elements containing block is always established by the viewport\n    var elementCss = getComputedStyle(element);\n\n    if (elementCss.position === 'fixed') {\n      return null;\n    }\n  }\n\n  var currentNode = getParentNode(element);\n\n  if (isShadowRoot(currentNode)) {\n    currentNode = currentNode.host;\n  }\n\n  while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) {\n    var css = getComputedStyle(currentNode); // This is non-exhaustive but covers the most common CSS properties that\n    // create a containing block.\n    // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n\n    if (css.transform !== 'none' || css.perspective !== 'none' || css.contain === 'paint' || ['transform', 'perspective'].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === 'filter' || isFirefox && css.filter && css.filter !== 'none') {\n      return currentNode;\n    } else {\n      currentNode = currentNode.parentNode;\n    }\n  }\n\n  return null;\n} // Gets the closest ancestor positioned element. Handles some edge cases,\n// such as table ancestors and cross browser bugs.\n\n\nexport default function getOffsetParent(element) {\n  var window = getWindow(element);\n  var offsetParent = getTrueOffsetParent(element);\n\n  while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') {\n    offsetParent = getTrueOffsetParent(offsetParent);\n  }\n\n  if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static')) {\n    return window;\n  }\n\n  return offsetParent || getContainingBlock(element) || window;\n}", "export default function getMainAxisFromPlacement(placement) {\n  return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';\n}", "import { max as mathMax, min as mathMin } from \"./math.js\";\nexport function within(min, value, max) {\n  return mathMax(min, mathMin(value, max));\n}\nexport function withinMaxClamp(min, value, max) {\n  var v = within(min, value, max);\n  return v > max ? max : v;\n}", "export default function getFreshSideObject() {\n  return {\n    top: 0,\n    right: 0,\n    bottom: 0,\n    left: 0\n  };\n}", "import getFreshSideObject from \"./getFreshSideObject.js\";\nexport default function mergePaddingObject(paddingObject) {\n  return Object.assign({}, getFreshSideObject(), paddingObject);\n}", "export default function expandToHashMap(value, keys) {\n  return keys.reduce(function (hashMap, key) {\n    hashMap[key] = value;\n    return hashMap;\n  }, {});\n}", "import getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getLayoutRect from \"../dom-utils/getLayoutRect.js\";\nimport contains from \"../dom-utils/contains.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport getMainAxisFromPlacement from \"../utils/getMainAxisFromPlacement.js\";\nimport { within } from \"../utils/within.js\";\nimport mergePaddingObject from \"../utils/mergePaddingObject.js\";\nimport expandToHashMap from \"../utils/expandToHashMap.js\";\nimport { left, right, basePlacements, top, bottom } from \"../enums.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar toPaddingObject = function toPaddingObject(padding, state) {\n  padding = typeof padding === 'function' ? padding(Object.assign({}, state.rects, {\n    placement: state.placement\n  })) : padding;\n  return mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));\n};\n\nfunction arrow(_ref) {\n  var _state$modifiersData$;\n\n  var state = _ref.state,\n      name = _ref.name,\n      options = _ref.options;\n  var arrowElement = state.elements.arrow;\n  var popperOffsets = state.modifiersData.popperOffsets;\n  var basePlacement = getBasePlacement(state.placement);\n  var axis = getMainAxisFromPlacement(basePlacement);\n  var isVertical = [left, right].indexOf(basePlacement) >= 0;\n  var len = isVertical ? 'height' : 'width';\n\n  if (!arrowElement || !popperOffsets) {\n    return;\n  }\n\n  var paddingObject = toPaddingObject(options.padding, state);\n  var arrowRect = getLayoutRect(arrowElement);\n  var minProp = axis === 'y' ? top : left;\n  var maxProp = axis === 'y' ? bottom : right;\n  var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len];\n  var startDiff = popperOffsets[axis] - state.rects.reference[axis];\n  var arrowOffsetParent = getOffsetParent(arrowElement);\n  var clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;\n  var centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the popper if the center point is\n  // outside of the popper bounds\n\n  var min = paddingObject[minProp];\n  var max = clientSize - arrowRect[len] - paddingObject[maxProp];\n  var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;\n  var offset = within(min, center, max); // Prevents breaking syntax highlighting...\n\n  var axisProp = axis;\n  state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset, _state$modifiersData$.centerOffset = offset - center, _state$modifiersData$);\n}\n\nfunction effect(_ref2) {\n  var state = _ref2.state,\n      options = _ref2.options;\n  var _options$element = options.element,\n      arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element;\n\n  if (arrowElement == null) {\n    return;\n  } // CSS selector\n\n\n  if (typeof arrowElement === 'string') {\n    arrowElement = state.elements.popper.querySelector(arrowElement);\n\n    if (!arrowElement) {\n      return;\n    }\n  }\n\n  if (!contains(state.elements.popper, arrowElement)) {\n    return;\n  }\n\n  state.elements.arrow = arrowElement;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n  name: 'arrow',\n  enabled: true,\n  phase: 'main',\n  fn: arrow,\n  effect: effect,\n  requires: ['popperOffsets'],\n  requiresIfExists: ['preventOverflow']\n};", "export default function getVariation(placement) {\n  return placement.split('-')[1];\n}", "import { top, left, right, bottom, end } from \"../enums.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport getWindow from \"../dom-utils/getWindow.js\";\nimport getDocumentElement from \"../dom-utils/getDocumentElement.js\";\nimport getComputedStyle from \"../dom-utils/getComputedStyle.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getVariation from \"../utils/getVariation.js\";\nimport { round } from \"../utils/math.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar unsetSides = {\n  top: 'auto',\n  right: 'auto',\n  bottom: 'auto',\n  left: 'auto'\n}; // Round the offsets to the nearest suitable subpixel based on the DPR.\n// Zooming can change the DPR, but it seems to report a value that will\n// cleanly divide the values into the appropriate subpixels.\n\nfunction roundOffsetsByDPR(_ref, win) {\n  var x = _ref.x,\n      y = _ref.y;\n  var dpr = win.devicePixelRatio || 1;\n  return {\n    x: round(x * dpr) / dpr || 0,\n    y: round(y * dpr) / dpr || 0\n  };\n}\n\nexport function mapToStyles(_ref2) {\n  var _Object$assign2;\n\n  var popper = _ref2.popper,\n      popperRect = _ref2.popperRect,\n      placement = _ref2.placement,\n      variation = _ref2.variation,\n      offsets = _ref2.offsets,\n      position = _ref2.position,\n      gpuAcceleration = _ref2.gpuAcceleration,\n      adaptive = _ref2.adaptive,\n      roundOffsets = _ref2.roundOffsets,\n      isFixed = _ref2.isFixed;\n  var _offsets$x = offsets.x,\n      x = _offsets$x === void 0 ? 0 : _offsets$x,\n      _offsets$y = offsets.y,\n      y = _offsets$y === void 0 ? 0 : _offsets$y;\n\n  var _ref3 = typeof roundOffsets === 'function' ? roundOffsets({\n    x: x,\n    y: y\n  }) : {\n    x: x,\n    y: y\n  };\n\n  x = _ref3.x;\n  y = _ref3.y;\n  var hasX = offsets.hasOwnProperty('x');\n  var hasY = offsets.hasOwnProperty('y');\n  var sideX = left;\n  var sideY = top;\n  var win = window;\n\n  if (adaptive) {\n    var offsetParent = getOffsetParent(popper);\n    var heightProp = 'clientHeight';\n    var widthProp = 'clientWidth';\n\n    if (offsetParent === getWindow(popper)) {\n      offsetParent = getDocumentElement(popper);\n\n      if (getComputedStyle(offsetParent).position !== 'static' && position === 'absolute') {\n        heightProp = 'scrollHeight';\n        widthProp = 'scrollWidth';\n      }\n    } // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it\n\n\n    offsetParent = offsetParent;\n\n    if (placement === top || (placement === left || placement === right) && variation === end) {\n      sideY = bottom;\n      var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing]\n      offsetParent[heightProp];\n      y -= offsetY - popperRect.height;\n      y *= gpuAcceleration ? 1 : -1;\n    }\n\n    if (placement === left || (placement === top || placement === bottom) && variation === end) {\n      sideX = right;\n      var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing]\n      offsetParent[widthProp];\n      x -= offsetX - popperRect.width;\n      x *= gpuAcceleration ? 1 : -1;\n    }\n  }\n\n  var commonStyles = Object.assign({\n    position: position\n  }, adaptive && unsetSides);\n\n  var _ref4 = roundOffsets === true ? roundOffsetsByDPR({\n    x: x,\n    y: y\n  }, getWindow(popper)) : {\n    x: x,\n    y: y\n  };\n\n  x = _ref4.x;\n  y = _ref4.y;\n\n  if (gpuAcceleration) {\n    var _Object$assign;\n\n    return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? \"translate(\" + x + \"px, \" + y + \"px)\" : \"translate3d(\" + x + \"px, \" + y + \"px, 0)\", _Object$assign));\n  }\n\n  return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + \"px\" : '', _Object$assign2[sideX] = hasX ? x + \"px\" : '', _Object$assign2.transform = '', _Object$assign2));\n}\n\nfunction computeStyles(_ref5) {\n  var state = _ref5.state,\n      options = _ref5.options;\n  var _options$gpuAccelerat = options.gpuAcceleration,\n      gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat,\n      _options$adaptive = options.adaptive,\n      adaptive = _options$adaptive === void 0 ? true : _options$adaptive,\n      _options$roundOffsets = options.roundOffsets,\n      roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;\n  var commonStyles = {\n    placement: getBasePlacement(state.placement),\n    variation: getVariation(state.placement),\n    popper: state.elements.popper,\n    popperRect: state.rects.popper,\n    gpuAcceleration: gpuAcceleration,\n    isFixed: state.options.strategy === 'fixed'\n  };\n\n  if (state.modifiersData.popperOffsets != null) {\n    state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, {\n      offsets: state.modifiersData.popperOffsets,\n      position: state.options.strategy,\n      adaptive: adaptive,\n      roundOffsets: roundOffsets\n    })));\n  }\n\n  if (state.modifiersData.arrow != null) {\n    state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, {\n      offsets: state.modifiersData.arrow,\n      position: 'absolute',\n      adaptive: false,\n      roundOffsets: roundOffsets\n    })));\n  }\n\n  state.attributes.popper = Object.assign({}, state.attributes.popper, {\n    'data-popper-placement': state.placement\n  });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n  name: 'computeStyles',\n  enabled: true,\n  phase: 'beforeWrite',\n  fn: computeStyles,\n  data: {}\n};", "import getWindow from \"../dom-utils/getWindow.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar passive = {\n  passive: true\n};\n\nfunction effect(_ref) {\n  var state = _ref.state,\n      instance = _ref.instance,\n      options = _ref.options;\n  var _options$scroll = options.scroll,\n      scroll = _options$scroll === void 0 ? true : _options$scroll,\n      _options$resize = options.resize,\n      resize = _options$resize === void 0 ? true : _options$resize;\n  var window = getWindow(state.elements.popper);\n  var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);\n\n  if (scroll) {\n    scrollParents.forEach(function (scrollParent) {\n      scrollParent.addEventListener('scroll', instance.update, passive);\n    });\n  }\n\n  if (resize) {\n    window.addEventListener('resize', instance.update, passive);\n  }\n\n  return function () {\n    if (scroll) {\n      scrollParents.forEach(function (scrollParent) {\n        scrollParent.removeEventListener('scroll', instance.update, passive);\n      });\n    }\n\n    if (resize) {\n      window.removeEventListener('resize', instance.update, passive);\n    }\n  };\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n  name: 'eventListeners',\n  enabled: true,\n  phase: 'write',\n  fn: function fn() {},\n  effect: effect,\n  data: {}\n};", "var hash = {\n  left: 'right',\n  right: 'left',\n  bottom: 'top',\n  top: 'bottom'\n};\nexport default function getOppositePlacement(placement) {\n  return placement.replace(/left|right|bottom|top/g, function (matched) {\n    return hash[matched];\n  });\n}", "var hash = {\n  start: 'end',\n  end: 'start'\n};\nexport default function getOppositeVariationPlacement(placement) {\n  return placement.replace(/start|end/g, function (matched) {\n    return hash[matched];\n  });\n}", "import getWindow from \"./getWindow.js\";\nexport default function getWindowScroll(node) {\n  var win = getWindow(node);\n  var scrollLeft = win.pageXOffset;\n  var scrollTop = win.pageYOffset;\n  return {\n    scrollLeft: scrollLeft,\n    scrollTop: scrollTop\n  };\n}", "import getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getWindowScroll from \"./getWindowScroll.js\";\nexport default function getWindowScrollBarX(element) {\n  // If <html> has a CSS width greater than the viewport, then this will be\n  // incorrect for RTL.\n  // Popper 1 is broken in this case and never had a bug report so let's assume\n  // it's not an issue. I don't think anyone ever specifies width on <html>\n  // anyway.\n  // Browsers where the left scrollbar doesn't cause an issue report `0` for\n  // this (e.g. Edge 2019, IE11, Safari)\n  return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;\n}", "import getWindow from \"./getWindow.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nimport isLayoutViewport from \"./isLayoutViewport.js\";\nexport default function getViewportRect(element, strategy) {\n  var win = getWindow(element);\n  var html = getDocumentElement(element);\n  var visualViewport = win.visualViewport;\n  var width = html.clientWidth;\n  var height = html.clientHeight;\n  var x = 0;\n  var y = 0;\n\n  if (visualViewport) {\n    width = visualViewport.width;\n    height = visualViewport.height;\n    var layoutViewport = isLayoutViewport();\n\n    if (layoutViewport || !layoutViewport && strategy === 'fixed') {\n      x = visualViewport.offsetLeft;\n      y = visualViewport.offsetTop;\n    }\n  }\n\n  return {\n    width: width,\n    height: height,\n    x: x + getWindowScrollBarX(element),\n    y: y\n  };\n}", "import getDocumentElement from \"./getDocumentElement.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nimport getWindowScroll from \"./getWindowScroll.js\";\nimport { max } from \"../utils/math.js\"; // Gets the entire size of the scrollable document area, even extending outside\n// of the `<html>` and `<body>` rect bounds if horizontally scrollable\n\nexport default function getDocumentRect(element) {\n  var _element$ownerDocumen;\n\n  var html = getDocumentElement(element);\n  var winScroll = getWindowScroll(element);\n  var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;\n  var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);\n  var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);\n  var x = -winScroll.scrollLeft + getWindowScrollBarX(element);\n  var y = -winScroll.scrollTop;\n\n  if (getComputedStyle(body || html).direction === 'rtl') {\n    x += max(html.clientWidth, body ? body.clientWidth : 0) - width;\n  }\n\n  return {\n    width: width,\n    height: height,\n    x: x,\n    y: y\n  };\n}", "import getComputedStyle from \"./getComputedStyle.js\";\nexport default function isScrollParent(element) {\n  // Firefox wants us to check `-x` and `-y` variations as well\n  var _getComputedStyle = getComputedStyle(element),\n      overflow = _getComputedStyle.overflow,\n      overflowX = _getComputedStyle.overflowX,\n      overflowY = _getComputedStyle.overflowY;\n\n  return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);\n}", "import getParentNode from \"./getParentNode.js\";\nimport isScrollParent from \"./isScrollParent.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nexport default function getScrollParent(node) {\n  if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) {\n    // $FlowFixMe[incompatible-return]: assume body is always available\n    return node.ownerDocument.body;\n  }\n\n  if (isHTMLElement(node) && isScrollParent(node)) {\n    return node;\n  }\n\n  return getScrollParent(getParentNode(node));\n}", "import getScrollParent from \"./getScrollParent.js\";\nimport getParentNode from \"./getParentNode.js\";\nimport getWindow from \"./getWindow.js\";\nimport isScrollParent from \"./isScrollParent.js\";\n/*\ngiven a DOM element, return the list of all scroll parents, up the list of ancesors\nuntil we get to the top window object. This list is what we attach scroll listeners\nto, because if any of these parent elements scroll, we'll need to re-calculate the\nreference element's position.\n*/\n\nexport default function listScrollParents(element, list) {\n  var _element$ownerDocumen;\n\n  if (list === void 0) {\n    list = [];\n  }\n\n  var scrollParent = getScrollParent(element);\n  var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);\n  var win = getWindow(scrollParent);\n  var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;\n  var updatedList = list.concat(target);\n  return isBody ? updatedList : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here\n  updatedList.concat(listScrollParents(getParentNode(target)));\n}", "export default function rectToClientRect(rect) {\n  return Object.assign({}, rect, {\n    left: rect.x,\n    top: rect.y,\n    right: rect.x + rect.width,\n    bottom: rect.y + rect.height\n  });\n}", "import { viewport } from \"../enums.js\";\nimport getViewportRect from \"./getViewportRect.js\";\nimport getDocumentRect from \"./getDocumentRect.js\";\nimport listScrollParents from \"./listScrollParents.js\";\nimport getOffsetParent from \"./getOffsetParent.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport { isElement, isHTMLElement } from \"./instanceOf.js\";\nimport getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getParentNode from \"./getParentNode.js\";\nimport contains from \"./contains.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport rectToClientRect from \"../utils/rectToClientRect.js\";\nimport { max, min } from \"../utils/math.js\";\n\nfunction getInnerBoundingClientRect(element, strategy) {\n  var rect = getBoundingClientRect(element, false, strategy === 'fixed');\n  rect.top = rect.top + element.clientTop;\n  rect.left = rect.left + element.clientLeft;\n  rect.bottom = rect.top + element.clientHeight;\n  rect.right = rect.left + element.clientWidth;\n  rect.width = element.clientWidth;\n  rect.height = element.clientHeight;\n  rect.x = rect.left;\n  rect.y = rect.top;\n  return rect;\n}\n\nfunction getClientRectFromMixedType(element, clippingParent, strategy) {\n  return clippingParent === viewport ? rectToClientRect(getViewportRect(element, strategy)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent, strategy) : rectToClientRect(getDocumentRect(getDocumentElement(element)));\n} // A \"clipping parent\" is an overflowable container with the characteristic of\n// clipping (or hiding) overflowing elements with a position different from\n// `initial`\n\n\nfunction getClippingParents(element) {\n  var clippingParents = listScrollParents(getParentNode(element));\n  var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle(element).position) >= 0;\n  var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;\n\n  if (!isElement(clipperElement)) {\n    return [];\n  } // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414\n\n\n  return clippingParents.filter(function (clippingParent) {\n    return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body';\n  });\n} // Gets the maximum area that the element is visible in due to any number of\n// clipping parents\n\n\nexport default function getClippingRect(element, boundary, rootBoundary, strategy) {\n  var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary);\n  var clippingParents = [].concat(mainClippingParents, [rootBoundary]);\n  var firstClippingParent = clippingParents[0];\n  var clippingRect = clippingParents.reduce(function (accRect, clippingParent) {\n    var rect = getClientRectFromMixedType(element, clippingParent, strategy);\n    accRect.top = max(rect.top, accRect.top);\n    accRect.right = min(rect.right, accRect.right);\n    accRect.bottom = min(rect.bottom, accRect.bottom);\n    accRect.left = max(rect.left, accRect.left);\n    return accRect;\n  }, getClientRectFromMixedType(element, firstClippingParent, strategy));\n  clippingRect.width = clippingRect.right - clippingRect.left;\n  clippingRect.height = clippingRect.bottom - clippingRect.top;\n  clippingRect.x = clippingRect.left;\n  clippingRect.y = clippingRect.top;\n  return clippingRect;\n}", "import getBasePlacement from \"./getBasePlacement.js\";\nimport getVariation from \"./getVariation.js\";\nimport getMainAxisFromPlacement from \"./getMainAxisFromPlacement.js\";\nimport { top, right, bottom, left, start, end } from \"../enums.js\";\nexport default function computeOffsets(_ref) {\n  var reference = _ref.reference,\n      element = _ref.element,\n      placement = _ref.placement;\n  var basePlacement = placement ? getBasePlacement(placement) : null;\n  var variation = placement ? getVariation(placement) : null;\n  var commonX = reference.x + reference.width / 2 - element.width / 2;\n  var commonY = reference.y + reference.height / 2 - element.height / 2;\n  var offsets;\n\n  switch (basePlacement) {\n    case top:\n      offsets = {\n        x: commonX,\n        y: reference.y - element.height\n      };\n      break;\n\n    case bottom:\n      offsets = {\n        x: commonX,\n        y: reference.y + reference.height\n      };\n      break;\n\n    case right:\n      offsets = {\n        x: reference.x + reference.width,\n        y: commonY\n      };\n      break;\n\n    case left:\n      offsets = {\n        x: reference.x - element.width,\n        y: commonY\n      };\n      break;\n\n    default:\n      offsets = {\n        x: reference.x,\n        y: reference.y\n      };\n  }\n\n  var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;\n\n  if (mainAxis != null) {\n    var len = mainAxis === 'y' ? 'height' : 'width';\n\n    switch (variation) {\n      case start:\n        offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2);\n        break;\n\n      case end:\n        offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2);\n        break;\n\n      default:\n    }\n  }\n\n  return offsets;\n}", "import getClippingRect from \"../dom-utils/getClippingRect.js\";\nimport getDocumentElement from \"../dom-utils/getDocumentElement.js\";\nimport getBoundingClientRect from \"../dom-utils/getBoundingClientRect.js\";\nimport computeOffsets from \"./computeOffsets.js\";\nimport rectToClientRect from \"./rectToClientRect.js\";\nimport { clippingParents, reference, popper, bottom, top, right, basePlacements, viewport } from \"../enums.js\";\nimport { isElement } from \"../dom-utils/instanceOf.js\";\nimport mergePaddingObject from \"./mergePaddingObject.js\";\nimport expandToHashMap from \"./expandToHashMap.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport default function detectOverflow(state, options) {\n  if (options === void 0) {\n    options = {};\n  }\n\n  var _options = options,\n      _options$placement = _options.placement,\n      placement = _options$placement === void 0 ? state.placement : _options$placement,\n      _options$strategy = _options.strategy,\n      strategy = _options$strategy === void 0 ? state.strategy : _options$strategy,\n      _options$boundary = _options.boundary,\n      boundary = _options$boundary === void 0 ? clippingParents : _options$boundary,\n      _options$rootBoundary = _options.rootBoundary,\n      rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary,\n      _options$elementConte = _options.elementContext,\n      elementContext = _options$elementConte === void 0 ? popper : _options$elementConte,\n      _options$altBoundary = _options.altBoundary,\n      altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary,\n      _options$padding = _options.padding,\n      padding = _options$padding === void 0 ? 0 : _options$padding;\n  var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));\n  var altContext = elementContext === popper ? reference : popper;\n  var popperRect = state.rects.popper;\n  var element = state.elements[altBoundary ? altContext : elementContext];\n  var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary, strategy);\n  var referenceClientRect = getBoundingClientRect(state.elements.reference);\n  var popperOffsets = computeOffsets({\n    reference: referenceClientRect,\n    element: popperRect,\n    strategy: 'absolute',\n    placement: placement\n  });\n  var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets));\n  var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect\n  // 0 or negative = within the clipping rect\n\n  var overflowOffsets = {\n    top: clippingClientRect.top - elementClientRect.top + paddingObject.top,\n    bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,\n    left: clippingClientRect.left - elementClientRect.left + paddingObject.left,\n    right: elementClientRect.right - clippingClientRect.right + paddingObject.right\n  };\n  var offsetData = state.modifiersData.offset; // Offsets can be applied only to the popper element\n\n  if (elementContext === popper && offsetData) {\n    var offset = offsetData[placement];\n    Object.keys(overflowOffsets).forEach(function (key) {\n      var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1;\n      var axis = [top, bottom].indexOf(key) >= 0 ? 'y' : 'x';\n      overflowOffsets[key] += offset[axis] * multiply;\n    });\n  }\n\n  return overflowOffsets;\n}", "import getVariation from \"./getVariation.js\";\nimport { variationPlacements, basePlacements, placements as allPlacements } from \"../enums.js\";\nimport detectOverflow from \"./detectOverflow.js\";\nimport getBasePlacement from \"./getBasePlacement.js\";\nexport default function computeAutoPlacement(state, options) {\n  if (options === void 0) {\n    options = {};\n  }\n\n  var _options = options,\n      placement = _options.placement,\n      boundary = _options.boundary,\n      rootBoundary = _options.rootBoundary,\n      padding = _options.padding,\n      flipVariations = _options.flipVariations,\n      _options$allowedAutoP = _options.allowedAutoPlacements,\n      allowedAutoPlacements = _options$allowedAutoP === void 0 ? allPlacements : _options$allowedAutoP;\n  var variation = getVariation(placement);\n  var placements = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function (placement) {\n    return getVariation(placement) === variation;\n  }) : basePlacements;\n  var allowedPlacements = placements.filter(function (placement) {\n    return allowedAutoPlacements.indexOf(placement) >= 0;\n  });\n\n  if (allowedPlacements.length === 0) {\n    allowedPlacements = placements;\n  } // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions...\n\n\n  var overflows = allowedPlacements.reduce(function (acc, placement) {\n    acc[placement] = detectOverflow(state, {\n      placement: placement,\n      boundary: boundary,\n      rootBoundary: rootBoundary,\n      padding: padding\n    })[getBasePlacement(placement)];\n    return acc;\n  }, {});\n  return Object.keys(overflows).sort(function (a, b) {\n    return overflows[a] - overflows[b];\n  });\n}", "import getOppositePlacement from \"../utils/getOppositePlacement.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getOppositeVariationPlacement from \"../utils/getOppositeVariationPlacement.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\nimport computeAutoPlacement from \"../utils/computeAutoPlacement.js\";\nimport { bottom, top, start, right, left, auto } from \"../enums.js\";\nimport getVariation from \"../utils/getVariation.js\"; // eslint-disable-next-line import/no-unused-modules\n\nfunction getExpandedFallbackPlacements(placement) {\n  if (getBasePlacement(placement) === auto) {\n    return [];\n  }\n\n  var oppositePlacement = getOppositePlacement(placement);\n  return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)];\n}\n\nfunction flip(_ref) {\n  var state = _ref.state,\n      options = _ref.options,\n      name = _ref.name;\n\n  if (state.modifiersData[name]._skip) {\n    return;\n  }\n\n  var _options$mainAxis = options.mainAxis,\n      checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,\n      _options$altAxis = options.altAxis,\n      checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis,\n      specifiedFallbackPlacements = options.fallbackPlacements,\n      padding = options.padding,\n      boundary = options.boundary,\n      rootBoundary = options.rootBoundary,\n      altBoundary = options.altBoundary,\n      _options$flipVariatio = options.flipVariations,\n      flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio,\n      allowedAutoPlacements = options.allowedAutoPlacements;\n  var preferredPlacement = state.options.placement;\n  var basePlacement = getBasePlacement(preferredPlacement);\n  var isBasePlacement = basePlacement === preferredPlacement;\n  var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement));\n  var placements = [preferredPlacement].concat(fallbackPlacements).reduce(function (acc, placement) {\n    return acc.concat(getBasePlacement(placement) === auto ? computeAutoPlacement(state, {\n      placement: placement,\n      boundary: boundary,\n      rootBoundary: rootBoundary,\n      padding: padding,\n      flipVariations: flipVariations,\n      allowedAutoPlacements: allowedAutoPlacements\n    }) : placement);\n  }, []);\n  var referenceRect = state.rects.reference;\n  var popperRect = state.rects.popper;\n  var checksMap = new Map();\n  var makeFallbackChecks = true;\n  var firstFittingPlacement = placements[0];\n\n  for (var i = 0; i < placements.length; i++) {\n    var placement = placements[i];\n\n    var _basePlacement = getBasePlacement(placement);\n\n    var isStartVariation = getVariation(placement) === start;\n    var isVertical = [top, bottom].indexOf(_basePlacement) >= 0;\n    var len = isVertical ? 'width' : 'height';\n    var overflow = detectOverflow(state, {\n      placement: placement,\n      boundary: boundary,\n      rootBoundary: rootBoundary,\n      altBoundary: altBoundary,\n      padding: padding\n    });\n    var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top;\n\n    if (referenceRect[len] > popperRect[len]) {\n      mainVariationSide = getOppositePlacement(mainVariationSide);\n    }\n\n    var altVariationSide = getOppositePlacement(mainVariationSide);\n    var checks = [];\n\n    if (checkMainAxis) {\n      checks.push(overflow[_basePlacement] <= 0);\n    }\n\n    if (checkAltAxis) {\n      checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0);\n    }\n\n    if (checks.every(function (check) {\n      return check;\n    })) {\n      firstFittingPlacement = placement;\n      makeFallbackChecks = false;\n      break;\n    }\n\n    checksMap.set(placement, checks);\n  }\n\n  if (makeFallbackChecks) {\n    // `2` may be desired in some cases \u2013 research later\n    var numberOfChecks = flipVariations ? 3 : 1;\n\n    var _loop = function _loop(_i) {\n      var fittingPlacement = placements.find(function (placement) {\n        var checks = checksMap.get(placement);\n\n        if (checks) {\n          return checks.slice(0, _i).every(function (check) {\n            return check;\n          });\n        }\n      });\n\n      if (fittingPlacement) {\n        firstFittingPlacement = fittingPlacement;\n        return \"break\";\n      }\n    };\n\n    for (var _i = numberOfChecks; _i > 0; _i--) {\n      var _ret = _loop(_i);\n\n      if (_ret === \"break\") break;\n    }\n  }\n\n  if (state.placement !== firstFittingPlacement) {\n    state.modifiersData[name]._skip = true;\n    state.placement = firstFittingPlacement;\n    state.reset = true;\n  }\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n  name: 'flip',\n  enabled: true,\n  phase: 'main',\n  fn: flip,\n  requiresIfExists: ['offset'],\n  data: {\n    _skip: false\n  }\n};", "import { top, bottom, left, right } from \"../enums.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\n\nfunction getSideOffsets(overflow, rect, preventedOffsets) {\n  if (preventedOffsets === void 0) {\n    preventedOffsets = {\n      x: 0,\n      y: 0\n    };\n  }\n\n  return {\n    top: overflow.top - rect.height - preventedOffsets.y,\n    right: overflow.right - rect.width + preventedOffsets.x,\n    bottom: overflow.bottom - rect.height + preventedOffsets.y,\n    left: overflow.left - rect.width - preventedOffsets.x\n  };\n}\n\nfunction isAnySideFullyClipped(overflow) {\n  return [top, right, bottom, left].some(function (side) {\n    return overflow[side] >= 0;\n  });\n}\n\nfunction hide(_ref) {\n  var state = _ref.state,\n      name = _ref.name;\n  var referenceRect = state.rects.reference;\n  var popperRect = state.rects.popper;\n  var preventedOffsets = state.modifiersData.preventOverflow;\n  var referenceOverflow = detectOverflow(state, {\n    elementContext: 'reference'\n  });\n  var popperAltOverflow = detectOverflow(state, {\n    altBoundary: true\n  });\n  var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect);\n  var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets);\n  var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);\n  var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);\n  state.modifiersData[name] = {\n    referenceClippingOffsets: referenceClippingOffsets,\n    popperEscapeOffsets: popperEscapeOffsets,\n    isReferenceHidden: isReferenceHidden,\n    hasPopperEscaped: hasPopperEscaped\n  };\n  state.attributes.popper = Object.assign({}, state.attributes.popper, {\n    'data-popper-reference-hidden': isReferenceHidden,\n    'data-popper-escaped': hasPopperEscaped\n  });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n  name: 'hide',\n  enabled: true,\n  phase: 'main',\n  requiresIfExists: ['preventOverflow'],\n  fn: hide\n};", "import getBasePlacement from \"../utils/getBasePlacement.js\";\nimport { top, left, right, placements } from \"../enums.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport function distanceAndSkiddingToXY(placement, rects, offset) {\n  var basePlacement = getBasePlacement(placement);\n  var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1;\n\n  var _ref = typeof offset === 'function' ? offset(Object.assign({}, rects, {\n    placement: placement\n  })) : offset,\n      skidding = _ref[0],\n      distance = _ref[1];\n\n  skidding = skidding || 0;\n  distance = (distance || 0) * invertDistance;\n  return [left, right].indexOf(basePlacement) >= 0 ? {\n    x: distance,\n    y: skidding\n  } : {\n    x: skidding,\n    y: distance\n  };\n}\n\nfunction offset(_ref2) {\n  var state = _ref2.state,\n      options = _ref2.options,\n      name = _ref2.name;\n  var _options$offset = options.offset,\n      offset = _options$offset === void 0 ? [0, 0] : _options$offset;\n  var data = placements.reduce(function (acc, placement) {\n    acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset);\n    return acc;\n  }, {});\n  var _data$state$placement = data[state.placement],\n      x = _data$state$placement.x,\n      y = _data$state$placement.y;\n\n  if (state.modifiersData.popperOffsets != null) {\n    state.modifiersData.popperOffsets.x += x;\n    state.modifiersData.popperOffsets.y += y;\n  }\n\n  state.modifiersData[name] = data;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n  name: 'offset',\n  enabled: true,\n  phase: 'main',\n  requires: ['popperOffsets'],\n  fn: offset\n};", "import computeOffsets from \"../utils/computeOffsets.js\";\n\nfunction popperOffsets(_ref) {\n  var state = _ref.state,\n      name = _ref.name;\n  // Offsets are the actual position the popper needs to have to be\n  // properly positioned near its reference element\n  // This is the most basic placement, and will be adjusted by\n  // the modifiers in the next step\n  state.modifiersData[name] = computeOffsets({\n    reference: state.rects.reference,\n    element: state.rects.popper,\n    strategy: 'absolute',\n    placement: state.placement\n  });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n  name: 'popperOffsets',\n  enabled: true,\n  phase: 'read',\n  fn: popperOffsets,\n  data: {}\n};", "export default function getAltAxis(axis) {\n  return axis === 'x' ? 'y' : 'x';\n}", "import { top, left, right, bottom, start } from \"../enums.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getMainAxisFromPlacement from \"../utils/getMainAxisFromPlacement.js\";\nimport getAltAxis from \"../utils/getAltAxis.js\";\nimport { within, withinMaxClamp } from \"../utils/within.js\";\nimport getLayoutRect from \"../dom-utils/getLayoutRect.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\nimport getVariation from \"../utils/getVariation.js\";\nimport getFreshSideObject from \"../utils/getFreshSideObject.js\";\nimport { min as mathMin, max as mathMax } from \"../utils/math.js\";\n\nfunction preventOverflow(_ref) {\n  var state = _ref.state,\n      options = _ref.options,\n      name = _ref.name;\n  var _options$mainAxis = options.mainAxis,\n      checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,\n      _options$altAxis = options.altAxis,\n      checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis,\n      boundary = options.boundary,\n      rootBoundary = options.rootBoundary,\n      altBoundary = options.altBoundary,\n      padding = options.padding,\n      _options$tether = options.tether,\n      tether = _options$tether === void 0 ? true : _options$tether,\n      _options$tetherOffset = options.tetherOffset,\n      tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset;\n  var overflow = detectOverflow(state, {\n    boundary: boundary,\n    rootBoundary: rootBoundary,\n    padding: padding,\n    altBoundary: altBoundary\n  });\n  var basePlacement = getBasePlacement(state.placement);\n  var variation = getVariation(state.placement);\n  var isBasePlacement = !variation;\n  var mainAxis = getMainAxisFromPlacement(basePlacement);\n  var altAxis = getAltAxis(mainAxis);\n  var popperOffsets = state.modifiersData.popperOffsets;\n  var referenceRect = state.rects.reference;\n  var popperRect = state.rects.popper;\n  var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, {\n    placement: state.placement\n  })) : tetherOffset;\n  var normalizedTetherOffsetValue = typeof tetherOffsetValue === 'number' ? {\n    mainAxis: tetherOffsetValue,\n    altAxis: tetherOffsetValue\n  } : Object.assign({\n    mainAxis: 0,\n    altAxis: 0\n  }, tetherOffsetValue);\n  var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null;\n  var data = {\n    x: 0,\n    y: 0\n  };\n\n  if (!popperOffsets) {\n    return;\n  }\n\n  if (checkMainAxis) {\n    var _offsetModifierState$;\n\n    var mainSide = mainAxis === 'y' ? top : left;\n    var altSide = mainAxis === 'y' ? bottom : right;\n    var len = mainAxis === 'y' ? 'height' : 'width';\n    var offset = popperOffsets[mainAxis];\n    var min = offset + overflow[mainSide];\n    var max = offset - overflow[altSide];\n    var additive = tether ? -popperRect[len] / 2 : 0;\n    var minLen = variation === start ? referenceRect[len] : popperRect[len];\n    var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go\n    // outside the reference bounds\n\n    var arrowElement = state.elements.arrow;\n    var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : {\n      width: 0,\n      height: 0\n    };\n    var arrowPaddingObject = state.modifiersData['arrow#persistent'] ? state.modifiersData['arrow#persistent'].padding : getFreshSideObject();\n    var arrowPaddingMin = arrowPaddingObject[mainSide];\n    var arrowPaddingMax = arrowPaddingObject[altSide]; // If the reference length is smaller than the arrow length, we don't want\n    // to include its full size in the calculation. If the reference is small\n    // and near the edge of a boundary, the popper can overflow even if the\n    // reference is not overflowing as well (e.g. virtual elements with no\n    // width or height)\n\n    var arrowLen = within(0, referenceRect[len], arrowRect[len]);\n    var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis;\n    var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis;\n    var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);\n    var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;\n    var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0;\n    var tetherMin = offset + minOffset - offsetModifierValue - clientOffset;\n    var tetherMax = offset + maxOffset - offsetModifierValue;\n    var preventedOffset = within(tether ? mathMin(min, tetherMin) : min, offset, tether ? mathMax(max, tetherMax) : max);\n    popperOffsets[mainAxis] = preventedOffset;\n    data[mainAxis] = preventedOffset - offset;\n  }\n\n  if (checkAltAxis) {\n    var _offsetModifierState$2;\n\n    var _mainSide = mainAxis === 'x' ? top : left;\n\n    var _altSide = mainAxis === 'x' ? bottom : right;\n\n    var _offset = popperOffsets[altAxis];\n\n    var _len = altAxis === 'y' ? 'height' : 'width';\n\n    var _min = _offset + overflow[_mainSide];\n\n    var _max = _offset - overflow[_altSide];\n\n    var isOriginSide = [top, left].indexOf(basePlacement) !== -1;\n\n    var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0;\n\n    var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis;\n\n    var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max;\n\n    var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max);\n\n    popperOffsets[altAxis] = _preventedOffset;\n    data[altAxis] = _preventedOffset - _offset;\n  }\n\n  state.modifiersData[name] = data;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n  name: 'preventOverflow',\n  enabled: true,\n  phase: 'main',\n  fn: preventOverflow,\n  requiresIfExists: ['offset']\n};", "export default function getHTMLElementScroll(element) {\n  return {\n    scrollLeft: element.scrollLeft,\n    scrollTop: element.scrollTop\n  };\n}", "import getWindowScroll from \"./getWindowScroll.js\";\nimport getWindow from \"./getWindow.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nimport getHTMLElementScroll from \"./getHTMLElementScroll.js\";\nexport default function getNodeScroll(node) {\n  if (node === getWindow(node) || !isHTMLElement(node)) {\n    return getWindowScroll(node);\n  } else {\n    return getHTMLElementScroll(node);\n  }\n}", "import getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getNodeScroll from \"./getNodeScroll.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport isScrollParent from \"./isScrollParent.js\";\nimport { round } from \"../utils/math.js\";\n\nfunction isElementScaled(element) {\n  var rect = element.getBoundingClientRect();\n  var scaleX = round(rect.width) / element.offsetWidth || 1;\n  var scaleY = round(rect.height) / element.offsetHeight || 1;\n  return scaleX !== 1 || scaleY !== 1;\n} // Returns the composite rect of an element relative to its offsetParent.\n// Composite means it takes into account transforms as well as layout.\n\n\nexport default function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {\n  if (isFixed === void 0) {\n    isFixed = false;\n  }\n\n  var isOffsetParentAnElement = isHTMLElement(offsetParent);\n  var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent);\n  var documentElement = getDocumentElement(offsetParent);\n  var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled, isFixed);\n  var scroll = {\n    scrollLeft: 0,\n    scrollTop: 0\n  };\n  var offsets = {\n    x: 0,\n    y: 0\n  };\n\n  if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n    if (getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078\n    isScrollParent(documentElement)) {\n      scroll = getNodeScroll(offsetParent);\n    }\n\n    if (isHTMLElement(offsetParent)) {\n      offsets = getBoundingClientRect(offsetParent, true);\n      offsets.x += offsetParent.clientLeft;\n      offsets.y += offsetParent.clientTop;\n    } else if (documentElement) {\n      offsets.x = getWindowScrollBarX(documentElement);\n    }\n  }\n\n  return {\n    x: rect.left + scroll.scrollLeft - offsets.x,\n    y: rect.top + scroll.scrollTop - offsets.y,\n    width: rect.width,\n    height: rect.height\n  };\n}", "import { modifierPhases } from \"../enums.js\"; // source: https://stackoverflow.com/questions/49875255\n\nfunction order(modifiers) {\n  var map = new Map();\n  var visited = new Set();\n  var result = [];\n  modifiers.forEach(function (modifier) {\n    map.set(modifier.name, modifier);\n  }); // On visiting object, check for its dependencies and visit them recursively\n\n  function sort(modifier) {\n    visited.add(modifier.name);\n    var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);\n    requires.forEach(function (dep) {\n      if (!visited.has(dep)) {\n        var depModifier = map.get(dep);\n\n        if (depModifier) {\n          sort(depModifier);\n        }\n      }\n    });\n    result.push(modifier);\n  }\n\n  modifiers.forEach(function (modifier) {\n    if (!visited.has(modifier.name)) {\n      // check for visited object\n      sort(modifier);\n    }\n  });\n  return result;\n}\n\nexport default function orderModifiers(modifiers) {\n  // order based on dependencies\n  var orderedModifiers = order(modifiers); // order based on phase\n\n  return modifierPhases.reduce(function (acc, phase) {\n    return acc.concat(orderedModifiers.filter(function (modifier) {\n      return modifier.phase === phase;\n    }));\n  }, []);\n}", "export default function debounce(fn) {\n  var pending;\n  return function () {\n    if (!pending) {\n      pending = new Promise(function (resolve) {\n        Promise.resolve().then(function () {\n          pending = undefined;\n          resolve(fn());\n        });\n      });\n    }\n\n    return pending;\n  };\n}", "export default function mergeByName(modifiers) {\n  var merged = modifiers.reduce(function (merged, current) {\n    var existing = merged[current.name];\n    merged[current.name] = existing ? Object.assign({}, existing, current, {\n      options: Object.assign({}, existing.options, current.options),\n      data: Object.assign({}, existing.data, current.data)\n    }) : current;\n    return merged;\n  }, {}); // IE11 does not support Object.values\n\n  return Object.keys(merged).map(function (key) {\n    return merged[key];\n  });\n}", "import getCompositeRect from \"./dom-utils/getCompositeRect.js\";\nimport getLayoutRect from \"./dom-utils/getLayoutRect.js\";\nimport listScrollParents from \"./dom-utils/listScrollParents.js\";\nimport getOffsetParent from \"./dom-utils/getOffsetParent.js\";\nimport orderModifiers from \"./utils/orderModifiers.js\";\nimport debounce from \"./utils/debounce.js\";\nimport mergeByName from \"./utils/mergeByName.js\";\nimport detectOverflow from \"./utils/detectOverflow.js\";\nimport { isElement } from \"./dom-utils/instanceOf.js\";\nvar DEFAULT_OPTIONS = {\n  placement: 'bottom',\n  modifiers: [],\n  strategy: 'absolute'\n};\n\nfunction areValidElements() {\n  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n    args[_key] = arguments[_key];\n  }\n\n  return !args.some(function (element) {\n    return !(element && typeof element.getBoundingClientRect === 'function');\n  });\n}\n\nexport function popperGenerator(generatorOptions) {\n  if (generatorOptions === void 0) {\n    generatorOptions = {};\n  }\n\n  var _generatorOptions = generatorOptions,\n      _generatorOptions$def = _generatorOptions.defaultModifiers,\n      defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def,\n      _generatorOptions$def2 = _generatorOptions.defaultOptions,\n      defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2;\n  return function createPopper(reference, popper, options) {\n    if (options === void 0) {\n      options = defaultOptions;\n    }\n\n    var state = {\n      placement: 'bottom',\n      orderedModifiers: [],\n      options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions),\n      modifiersData: {},\n      elements: {\n        reference: reference,\n        popper: popper\n      },\n      attributes: {},\n      styles: {}\n    };\n    var effectCleanupFns = [];\n    var isDestroyed = false;\n    var instance = {\n      state: state,\n      setOptions: function setOptions(setOptionsAction) {\n        var options = typeof setOptionsAction === 'function' ? setOptionsAction(state.options) : setOptionsAction;\n        cleanupModifierEffects();\n        state.options = Object.assign({}, defaultOptions, state.options, options);\n        state.scrollParents = {\n          reference: isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [],\n          popper: listScrollParents(popper)\n        }; // Orders the modifiers based on their dependencies and `phase`\n        // properties\n\n        var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers, state.options.modifiers))); // Strip out disabled modifiers\n\n        state.orderedModifiers = orderedModifiers.filter(function (m) {\n          return m.enabled;\n        });\n        runModifierEffects();\n        return instance.update();\n      },\n      // Sync update \u2013 it will always be executed, even if not necessary. This\n      // is useful for low frequency updates where sync behavior simplifies the\n      // logic.\n      // For high frequency updates (e.g. `resize` and `scroll` events), always\n      // prefer the async Popper#update method\n      forceUpdate: function forceUpdate() {\n        if (isDestroyed) {\n          return;\n        }\n\n        var _state$elements = state.elements,\n            reference = _state$elements.reference,\n            popper = _state$elements.popper; // Don't proceed if `reference` or `popper` are not valid elements\n        // anymore\n\n        if (!areValidElements(reference, popper)) {\n          return;\n        } // Store the reference and popper rects to be read by modifiers\n\n\n        state.rects = {\n          reference: getCompositeRect(reference, getOffsetParent(popper), state.options.strategy === 'fixed'),\n          popper: getLayoutRect(popper)\n        }; // Modifiers have the ability to reset the current update cycle. The\n        // most common use case for this is the `flip` modifier changing the\n        // placement, which then needs to re-run all the modifiers, because the\n        // logic was previously ran for the previous placement and is therefore\n        // stale/incorrect\n\n        state.reset = false;\n        state.placement = state.options.placement; // On each update cycle, the `modifiersData` property for each modifier\n        // is filled with the initial data specified by the modifier. This means\n        // it doesn't persist and is fresh on each update.\n        // To ensure persistent data, use `${name}#persistent`\n\n        state.orderedModifiers.forEach(function (modifier) {\n          return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);\n        });\n\n        for (var index = 0; index < state.orderedModifiers.length; index++) {\n          if (state.reset === true) {\n            state.reset = false;\n            index = -1;\n            continue;\n          }\n\n          var _state$orderedModifie = state.orderedModifiers[index],\n              fn = _state$orderedModifie.fn,\n              _state$orderedModifie2 = _state$orderedModifie.options,\n              _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2,\n              name = _state$orderedModifie.name;\n\n          if (typeof fn === 'function') {\n            state = fn({\n              state: state,\n              options: _options,\n              name: name,\n              instance: instance\n            }) || state;\n          }\n        }\n      },\n      // Async and optimistically optimized update \u2013 it will not be executed if\n      // not necessary (debounced to run at most once-per-tick)\n      update: debounce(function () {\n        return new Promise(function (resolve) {\n          instance.forceUpdate();\n          resolve(state);\n        });\n      }),\n      destroy: function destroy() {\n        cleanupModifierEffects();\n        isDestroyed = true;\n      }\n    };\n\n    if (!areValidElements(reference, popper)) {\n      return instance;\n    }\n\n    instance.setOptions(options).then(function (state) {\n      if (!isDestroyed && options.onFirstUpdate) {\n        options.onFirstUpdate(state);\n      }\n    }); // Modifiers have the ability to execute arbitrary code before the first\n    // update cycle runs. They will be executed in the same order as the update\n    // cycle. This is useful when a modifier adds some persistent data that\n    // other modifiers need to use, but the modifier is run after the dependent\n    // one.\n\n    function runModifierEffects() {\n      state.orderedModifiers.forEach(function (_ref) {\n        var name = _ref.name,\n            _ref$options = _ref.options,\n            options = _ref$options === void 0 ? {} : _ref$options,\n            effect = _ref.effect;\n\n        if (typeof effect === 'function') {\n          var cleanupFn = effect({\n            state: state,\n            name: name,\n            instance: instance,\n            options: options\n          });\n\n          var noopFn = function noopFn() {};\n\n          effectCleanupFns.push(cleanupFn || noopFn);\n        }\n      });\n    }\n\n    function cleanupModifierEffects() {\n      effectCleanupFns.forEach(function (fn) {\n        return fn();\n      });\n      effectCleanupFns = [];\n    }\n\n    return instance;\n  };\n}\nexport var createPopper = /*#__PURE__*/popperGenerator(); // eslint-disable-next-line import/no-unused-modules\n\nexport { detectOverflow };", "import { popperGenerator, detectOverflow } from \"./createPopper.js\";\nimport eventListeners from \"./modifiers/eventListeners.js\";\nimport popperOffsets from \"./modifiers/popperOffsets.js\";\nimport computeStyles from \"./modifiers/computeStyles.js\";\nimport applyStyles from \"./modifiers/applyStyles.js\";\nvar defaultModifiers = [eventListeners, popperOffsets, computeStyles, applyStyles];\nvar createPopper = /*#__PURE__*/popperGenerator({\n  defaultModifiers: defaultModifiers\n}); // eslint-disable-next-line import/no-unused-modules\n\nexport { createPopper, popperGenerator, defaultModifiers, detectOverflow };", "import { popperGenerator, detectOverflow } from \"./createPopper.js\";\nimport eventListeners from \"./modifiers/eventListeners.js\";\nimport popperOffsets from \"./modifiers/popperOffsets.js\";\nimport computeStyles from \"./modifiers/computeStyles.js\";\nimport applyStyles from \"./modifiers/applyStyles.js\";\nimport offset from \"./modifiers/offset.js\";\nimport flip from \"./modifiers/flip.js\";\nimport preventOverflow from \"./modifiers/preventOverflow.js\";\nimport arrow from \"./modifiers/arrow.js\";\nimport hide from \"./modifiers/hide.js\";\nvar defaultModifiers = [eventListeners, popperOffsets, computeStyles, applyStyles, offset, flip, preventOverflow, arrow, hide];\nvar createPopper = /*#__PURE__*/popperGenerator({\n  defaultModifiers: defaultModifiers\n}); // eslint-disable-next-line import/no-unused-modules\n\nexport { createPopper, popperGenerator, defaultModifiers, detectOverflow }; // eslint-disable-next-line import/no-unused-modules\n\nexport { createPopper as createPopperLite } from \"./popper-lite.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport * from \"./modifiers/index.js\";", "/**\n * --------------------------------------------------------------------------\n * Bootstrap dom/data.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n/**\n * Constants\n */\n\nconst elementMap = new Map()\n\nexport default {\n  set(element, key, instance) {\n    if (!elementMap.has(element)) {\n      elementMap.set(element, new Map())\n    }\n\n    const instanceMap = elementMap.get(element)\n\n    // make it clear we only want one instance per element\n    // can be removed later when multiple key/instances are fine to be used\n    if (!instanceMap.has(key) && instanceMap.size !== 0) {\n      // eslint-disable-next-line no-console\n      console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(instanceMap.keys())[0]}.`)\n      return\n    }\n\n    instanceMap.set(key, instance)\n  },\n\n  get(element, key) {\n    if (elementMap.has(element)) {\n      return elementMap.get(element).get(key) || null\n    }\n\n    return null\n  },\n\n  remove(element, key) {\n    if (!elementMap.has(element)) {\n      return\n    }\n\n    const instanceMap = elementMap.get(element)\n\n    instanceMap.delete(key)\n\n    // free up element references if there are no instances left for an element\n    if (instanceMap.size === 0) {\n      elementMap.delete(element)\n    }\n  }\n}\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap util/index.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst MAX_UID = 1_000_000\nconst MILLISECONDS_MULTIPLIER = 1000\nconst TRANSITION_END = 'transitionend'\n\n/**\n * Properly escape IDs selectors to handle weird IDs\n * @param {string} selector\n * @returns {string}\n */\nconst parseSelector = selector => {\n  if (selector && window.CSS && window.CSS.escape) {\n    // document.querySelector needs escaping to handle IDs (html5+) containing for instance /\n    selector = selector.replace(/#([^\\s\"#']+)/g, (match, id) => `#${CSS.escape(id)}`)\n  }\n\n  return selector\n}\n\n// Shout-out Angus Croll (https://goo.gl/pxwQGp)\nconst toType = object => {\n  if (object === null || object === undefined) {\n    return `${object}`\n  }\n\n  return Object.prototype.toString.call(object).match(/\\s([a-z]+)/i)[1].toLowerCase()\n}\n\n/**\n * Public Util API\n */\n\nconst getUID = prefix => {\n  do {\n    prefix += Math.floor(Math.random() * MAX_UID)\n  } while (document.getElementById(prefix))\n\n  return prefix\n}\n\nconst getTransitionDurationFromElement = element => {\n  if (!element) {\n    return 0\n  }\n\n  // Get transition-duration of the element\n  let { transitionDuration, transitionDelay } = window.getComputedStyle(element)\n\n  const floatTransitionDuration = Number.parseFloat(transitionDuration)\n  const floatTransitionDelay = Number.parseFloat(transitionDelay)\n\n  // Return 0 if element or transition duration is not found\n  if (!floatTransitionDuration && !floatTransitionDelay) {\n    return 0\n  }\n\n  // If multiple durations are defined, take the first\n  transitionDuration = transitionDuration.split(',')[0]\n  transitionDelay = transitionDelay.split(',')[0]\n\n  return (Number.parseFloat(transitionDuration) + Number.parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER\n}\n\nconst triggerTransitionEnd = element => {\n  element.dispatchEvent(new Event(TRANSITION_END))\n}\n\nconst isElement = object => {\n  if (!object || typeof object !== 'object') {\n    return false\n  }\n\n  if (typeof object.jquery !== 'undefined') {\n    object = object[0]\n  }\n\n  return typeof object.nodeType !== 'undefined'\n}\n\nconst getElement = object => {\n  // it's a jQuery object or a node element\n  if (isElement(object)) {\n    return object.jquery ? object[0] : object\n  }\n\n  if (typeof object === 'string' && object.length > 0) {\n    return document.querySelector(parseSelector(object))\n  }\n\n  return null\n}\n\nconst isVisible = element => {\n  if (!isElement(element) || element.getClientRects().length === 0) {\n    return false\n  }\n\n  const elementIsVisible = getComputedStyle(element).getPropertyValue('visibility') === 'visible'\n  // Handle `details` element as its content may falsie appear visible when it is closed\n  const closedDetails = element.closest('details:not([open])')\n\n  if (!closedDetails) {\n    return elementIsVisible\n  }\n\n  if (closedDetails !== element) {\n    const summary = element.closest('summary')\n    if (summary && summary.parentNode !== closedDetails) {\n      return false\n    }\n\n    if (summary === null) {\n      return false\n    }\n  }\n\n  return elementIsVisible\n}\n\nconst isDisabled = element => {\n  if (!element || element.nodeType !== Node.ELEMENT_NODE) {\n    return true\n  }\n\n  if (element.classList.contains('disabled')) {\n    return true\n  }\n\n  if (typeof element.disabled !== 'undefined') {\n    return element.disabled\n  }\n\n  return element.hasAttribute('disabled') && element.getAttribute('disabled') !== 'false'\n}\n\nconst findShadowRoot = element => {\n  if (!document.documentElement.attachShadow) {\n    return null\n  }\n\n  // Can find the shadow root otherwise it'll return the document\n  if (typeof element.getRootNode === 'function') {\n    const root = element.getRootNode()\n    return root instanceof ShadowRoot ? root : null\n  }\n\n  if (element instanceof ShadowRoot) {\n    return element\n  }\n\n  // when we don't find a shadow root\n  if (!element.parentNode) {\n    return null\n  }\n\n  return findShadowRoot(element.parentNode)\n}\n\nconst noop = () => {}\n\n/**\n * Trick to restart an element's animation\n *\n * @param {HTMLElement} element\n * @return void\n *\n * @see https://www.harrytheo.com/blog/2021/02/restart-a-css-animation-with-javascript/#restarting-a-css-animation\n */\nconst reflow = element => {\n  element.offsetHeight // eslint-disable-line no-unused-expressions\n}\n\nconst getjQuery = () => {\n  if (window.jQuery && !document.body.hasAttribute('data-bs-no-jquery')) {\n    return window.jQuery\n  }\n\n  return null\n}\n\nconst DOMContentLoadedCallbacks = []\n\nconst onDOMContentLoaded = callback => {\n  if (document.readyState === 'loading') {\n    // add listener on the first call when the document is in loading state\n    if (!DOMContentLoadedCallbacks.length) {\n      document.addEventListener('DOMContentLoaded', () => {\n        for (const callback of DOMContentLoadedCallbacks) {\n          callback()\n        }\n      })\n    }\n\n    DOMContentLoadedCallbacks.push(callback)\n  } else {\n    callback()\n  }\n}\n\nconst isRTL = () => document.documentElement.dir === 'rtl'\n\nconst defineJQueryPlugin = plugin => {\n  onDOMContentLoaded(() => {\n    const $ = getjQuery()\n    /* istanbul ignore if */\n    if ($) {\n      const name = plugin.NAME\n      const JQUERY_NO_CONFLICT = $.fn[name]\n      $.fn[name] = plugin.jQueryInterface\n      $.fn[name].Constructor = plugin\n      $.fn[name].noConflict = () => {\n        $.fn[name] = JQUERY_NO_CONFLICT\n        return plugin.jQueryInterface\n      }\n    }\n  })\n}\n\nconst execute = (possibleCallback, args = [], defaultValue = possibleCallback) => {\n  return typeof possibleCallback === 'function' ? possibleCallback.call(...args) : defaultValue\n}\n\nconst executeAfterTransition = (callback, transitionElement, waitForTransition = true) => {\n  if (!waitForTransition) {\n    execute(callback)\n    return\n  }\n\n  const durationPadding = 5\n  const emulatedDuration = getTransitionDurationFromElement(transitionElement) + durationPadding\n\n  let called = false\n\n  const handler = ({ target }) => {\n    if (target !== transitionElement) {\n      return\n    }\n\n    called = true\n    transitionElement.removeEventListener(TRANSITION_END, handler)\n    execute(callback)\n  }\n\n  transitionElement.addEventListener(TRANSITION_END, handler)\n  setTimeout(() => {\n    if (!called) {\n      triggerTransitionEnd(transitionElement)\n    }\n  }, emulatedDuration)\n}\n\n/**\n * Return the previous/next element of a list.\n *\n * @param {array} list    The list of elements\n * @param activeElement   The active element\n * @param shouldGetNext   Choose to get next or previous element\n * @param isCycleAllowed\n * @return {Element|elem} The proper element\n */\nconst getNextActiveElement = (list, activeElement, shouldGetNext, isCycleAllowed) => {\n  const listLength = list.length\n  let index = list.indexOf(activeElement)\n\n  // if the element does not exist in the list return an element\n  // depending on the direction and if cycle is allowed\n  if (index === -1) {\n    return !shouldGetNext && isCycleAllowed ? list[listLength - 1] : list[0]\n  }\n\n  index += shouldGetNext ? 1 : -1\n\n  if (isCycleAllowed) {\n    index = (index + listLength) % listLength\n  }\n\n  return list[Math.max(0, Math.min(index, listLength - 1))]\n}\n\nexport {\n  defineJQueryPlugin,\n  execute,\n  executeAfterTransition,\n  findShadowRoot,\n  getElement,\n  getjQuery,\n  getNextActiveElement,\n  getTransitionDurationFromElement,\n  getUID,\n  isDisabled,\n  isElement,\n  isRTL,\n  isVisible,\n  noop,\n  onDOMContentLoaded,\n  parseSelector,\n  reflow,\n  triggerTransitionEnd,\n  toType\n}\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap dom/event-handler.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport { getjQuery } from '../util/index.js'\n\n/**\n * Constants\n */\n\nconst namespaceRegex = /[^.]*(?=\\..*)\\.|.*/\nconst stripNameRegex = /\\..*/\nconst stripUidRegex = /::\\d+$/\nconst eventRegistry = {} // Events storage\nlet uidEvent = 1\nconst customEvents = {\n  mouseenter: 'mouseover',\n  mouseleave: 'mouseout'\n}\n\nconst nativeEvents = new Set([\n  'click',\n  'dblclick',\n  'mouseup',\n  'mousedown',\n  'contextmenu',\n  'mousewheel',\n  'DOMMouseScroll',\n  'mouseover',\n  'mouseout',\n  'mousemove',\n  'selectstart',\n  'selectend',\n  'keydown',\n  'keypress',\n  'keyup',\n  'orientationchange',\n  'touchstart',\n  'touchmove',\n  'touchend',\n  'touchcancel',\n  'pointerdown',\n  'pointermove',\n  'pointerup',\n  'pointerleave',\n  'pointercancel',\n  'gesturestart',\n  'gesturechange',\n  'gestureend',\n  'focus',\n  'blur',\n  'change',\n  'reset',\n  'select',\n  'submit',\n  'focusin',\n  'focusout',\n  'load',\n  'unload',\n  'beforeunload',\n  'resize',\n  'move',\n  'DOMContentLoaded',\n  'readystatechange',\n  'error',\n  'abort',\n  'scroll'\n])\n\n/**\n * Private methods\n */\n\nfunction makeEventUid(element, uid) {\n  return (uid && `${uid}::${uidEvent++}`) || element.uidEvent || uidEvent++\n}\n\nfunction getElementEvents(element) {\n  const uid = makeEventUid(element)\n\n  element.uidEvent = uid\n  eventRegistry[uid] = eventRegistry[uid] || {}\n\n  return eventRegistry[uid]\n}\n\nfunction bootstrapHandler(element, fn) {\n  return function handler(event) {\n    hydrateObj(event, { delegateTarget: element })\n\n    if (handler.oneOff) {\n      EventHandler.off(element, event.type, fn)\n    }\n\n    return fn.apply(element, [event])\n  }\n}\n\nfunction bootstrapDelegationHandler(element, selector, fn) {\n  return function handler(event) {\n    const domElements = element.querySelectorAll(selector)\n\n    for (let { target } = event; target && target !== this; target = target.parentNode) {\n      for (const domElement of domElements) {\n        if (domElement !== target) {\n          continue\n        }\n\n        hydrateObj(event, { delegateTarget: target })\n\n        if (handler.oneOff) {\n          EventHandler.off(element, event.type, selector, fn)\n        }\n\n        return fn.apply(target, [event])\n      }\n    }\n  }\n}\n\nfunction findHandler(events, callable, delegationSelector = null) {\n  return Object.values(events)\n    .find(event => event.callable === callable && event.delegationSelector === delegationSelector)\n}\n\nfunction normalizeParameters(originalTypeEvent, handler, delegationFunction) {\n  const isDelegated = typeof handler === 'string'\n  // TODO: tooltip passes `false` instead of selector, so we need to check\n  const callable = isDelegated ? delegationFunction : (handler || delegationFunction)\n  let typeEvent = getTypeEvent(originalTypeEvent)\n\n  if (!nativeEvents.has(typeEvent)) {\n    typeEvent = originalTypeEvent\n  }\n\n  return [isDelegated, callable, typeEvent]\n}\n\nfunction addHandler(element, originalTypeEvent, handler, delegationFunction, oneOff) {\n  if (typeof originalTypeEvent !== 'string' || !element) {\n    return\n  }\n\n  let [isDelegated, callable, typeEvent] = normalizeParameters(originalTypeEvent, handler, delegationFunction)\n\n  // in case of mouseenter or mouseleave wrap the handler within a function that checks for its DOM position\n  // this prevents the handler from being dispatched the same way as mouseover or mouseout does\n  if (originalTypeEvent in customEvents) {\n    const wrapFunction = fn => {\n      return function (event) {\n        if (!event.relatedTarget || (event.relatedTarget !== event.delegateTarget && !event.delegateTarget.contains(event.relatedTarget))) {\n          return fn.call(this, event)\n        }\n      }\n    }\n\n    callable = wrapFunction(callable)\n  }\n\n  const events = getElementEvents(element)\n  const handlers = events[typeEvent] || (events[typeEvent] = {})\n  const previousFunction = findHandler(handlers, callable, isDelegated ? handler : null)\n\n  if (previousFunction) {\n    previousFunction.oneOff = previousFunction.oneOff && oneOff\n\n    return\n  }\n\n  const uid = makeEventUid(callable, originalTypeEvent.replace(namespaceRegex, ''))\n  const fn = isDelegated ?\n    bootstrapDelegationHandler(element, handler, callable) :\n    bootstrapHandler(element, callable)\n\n  fn.delegationSelector = isDelegated ? handler : null\n  fn.callable = callable\n  fn.oneOff = oneOff\n  fn.uidEvent = uid\n  handlers[uid] = fn\n\n  element.addEventListener(typeEvent, fn, isDelegated)\n}\n\nfunction removeHandler(element, events, typeEvent, handler, delegationSelector) {\n  const fn = findHandler(events[typeEvent], handler, delegationSelector)\n\n  if (!fn) {\n    return\n  }\n\n  element.removeEventListener(typeEvent, fn, Boolean(delegationSelector))\n  delete events[typeEvent][fn.uidEvent]\n}\n\nfunction removeNamespacedHandlers(element, events, typeEvent, namespace) {\n  const storeElementEvent = events[typeEvent] || {}\n\n  for (const [handlerKey, event] of Object.entries(storeElementEvent)) {\n    if (handlerKey.includes(namespace)) {\n      removeHandler(element, events, typeEvent, event.callable, event.delegationSelector)\n    }\n  }\n}\n\nfunction getTypeEvent(event) {\n  // allow to get the native events from namespaced events ('click.bs.button' --> 'click')\n  event = event.replace(stripNameRegex, '')\n  return customEvents[event] || event\n}\n\nconst EventHandler = {\n  on(element, event, handler, delegationFunction) {\n    addHandler(element, event, handler, delegationFunction, false)\n  },\n\n  one(element, event, handler, delegationFunction) {\n    addHandler(element, event, handler, delegationFunction, true)\n  },\n\n  off(element, originalTypeEvent, handler, delegationFunction) {\n    if (typeof originalTypeEvent !== 'string' || !element) {\n      return\n    }\n\n    const [isDelegated, callable, typeEvent] = normalizeParameters(originalTypeEvent, handler, delegationFunction)\n    const inNamespace = typeEvent !== originalTypeEvent\n    const events = getElementEvents(element)\n    const storeElementEvent = events[typeEvent] || {}\n    const isNamespace = originalTypeEvent.startsWith('.')\n\n    if (typeof callable !== 'undefined') {\n      // Simplest case: handler is passed, remove that listener ONLY.\n      if (!Object.keys(storeElementEvent).length) {\n        return\n      }\n\n      removeHandler(element, events, typeEvent, callable, isDelegated ? handler : null)\n      return\n    }\n\n    if (isNamespace) {\n      for (const elementEvent of Object.keys(events)) {\n        removeNamespacedHandlers(element, events, elementEvent, originalTypeEvent.slice(1))\n      }\n    }\n\n    for (const [keyHandlers, event] of Object.entries(storeElementEvent)) {\n      const handlerKey = keyHandlers.replace(stripUidRegex, '')\n\n      if (!inNamespace || originalTypeEvent.includes(handlerKey)) {\n        removeHandler(element, events, typeEvent, event.callable, event.delegationSelector)\n      }\n    }\n  },\n\n  trigger(element, event, args) {\n    if (typeof event !== 'string' || !element) {\n      return null\n    }\n\n    const $ = getjQuery()\n    const typeEvent = getTypeEvent(event)\n    const inNamespace = event !== typeEvent\n\n    let jQueryEvent = null\n    let bubbles = true\n    let nativeDispatch = true\n    let defaultPrevented = false\n\n    if (inNamespace && $) {\n      jQueryEvent = $.Event(event, args)\n\n      $(element).trigger(jQueryEvent)\n      bubbles = !jQueryEvent.isPropagationStopped()\n      nativeDispatch = !jQueryEvent.isImmediatePropagationStopped()\n      defaultPrevented = jQueryEvent.isDefaultPrevented()\n    }\n\n    const evt = hydrateObj(new Event(event, { bubbles, cancelable: true }), args)\n\n    if (defaultPrevented) {\n      evt.preventDefault()\n    }\n\n    if (nativeDispatch) {\n      element.dispatchEvent(evt)\n    }\n\n    if (evt.defaultPrevented && jQueryEvent) {\n      jQueryEvent.preventDefault()\n    }\n\n    return evt\n  }\n}\n\nfunction hydrateObj(obj, meta = {}) {\n  for (const [key, value] of Object.entries(meta)) {\n    try {\n      obj[key] = value\n    } catch {\n      Object.defineProperty(obj, key, {\n        configurable: true,\n        get() {\n          return value\n        }\n      })\n    }\n  }\n\n  return obj\n}\n\nexport default EventHandler\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap dom/manipulator.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nfunction normalizeData(value) {\n  if (value === 'true') {\n    return true\n  }\n\n  if (value === 'false') {\n    return false\n  }\n\n  if (value === Number(value).toString()) {\n    return Number(value)\n  }\n\n  if (value === '' || value === 'null') {\n    return null\n  }\n\n  if (typeof value !== 'string') {\n    return value\n  }\n\n  try {\n    return JSON.parse(decodeURIComponent(value))\n  } catch {\n    return value\n  }\n}\n\nfunction normalizeDataKey(key) {\n  return key.replace(/[A-Z]/g, chr => `-${chr.toLowerCase()}`)\n}\n\nconst Manipulator = {\n  setDataAttribute(element, key, value) {\n    element.setAttribute(`data-bs-${normalizeDataKey(key)}`, value)\n  },\n\n  removeDataAttribute(element, key) {\n    element.removeAttribute(`data-bs-${normalizeDataKey(key)}`)\n  },\n\n  getDataAttributes(element) {\n    if (!element) {\n      return {}\n    }\n\n    const attributes = {}\n    const bsKeys = Object.keys(element.dataset).filter(key => key.startsWith('bs') && !key.startsWith('bsConfig'))\n\n    for (const key of bsKeys) {\n      let pureKey = key.replace(/^bs/, '')\n      pureKey = pureKey.charAt(0).toLowerCase() + pureKey.slice(1)\n      attributes[pureKey] = normalizeData(element.dataset[key])\n    }\n\n    return attributes\n  },\n\n  getDataAttribute(element, key) {\n    return normalizeData(element.getAttribute(`data-bs-${normalizeDataKey(key)}`))\n  }\n}\n\nexport default Manipulator\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap util/config.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport Manipulator from '../dom/manipulator.js'\nimport { isElement, toType } from './index.js'\n\n/**\n * Class definition\n */\n\nclass Config {\n  // Getters\n  static get Default() {\n    return {}\n  }\n\n  static get DefaultType() {\n    return {}\n  }\n\n  static get NAME() {\n    throw new Error('You have to implement the static method \"NAME\", for each component!')\n  }\n\n  _getConfig(config) {\n    config = this._mergeConfigObj(config)\n    config = this._configAfterMerge(config)\n    this._typeCheckConfig(config)\n    return config\n  }\n\n  _configAfterMerge(config) {\n    return config\n  }\n\n  _mergeConfigObj(config, element) {\n    const jsonConfig = isElement(element) ? Manipulator.getDataAttribute(element, 'config') : {} // try to parse\n\n    return {\n      ...this.constructor.Default,\n      ...(typeof jsonConfig === 'object' ? jsonConfig : {}),\n      ...(isElement(element) ? Manipulator.getDataAttributes(element) : {}),\n      ...(typeof config === 'object' ? config : {})\n    }\n  }\n\n  _typeCheckConfig(config, configTypes = this.constructor.DefaultType) {\n    for (const [property, expectedTypes] of Object.entries(configTypes)) {\n      const value = config[property]\n      const valueType = isElement(value) ? 'element' : toType(value)\n\n      if (!new RegExp(expectedTypes).test(valueType)) {\n        throw new TypeError(\n          `${this.constructor.NAME.toUpperCase()}: Option \"${property}\" provided type \"${valueType}\" but expected type \"${expectedTypes}\".`\n        )\n      }\n    }\n  }\n}\n\nexport default Config\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap base-component.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport Data from './dom/data.js'\nimport EventHandler from './dom/event-handler.js'\nimport Config from './util/config.js'\nimport { executeAfterTransition, getElement } from './util/index.js'\n\n/**\n * Constants\n */\n\nconst VERSION = '5.3.7'\n\n/**\n * Class definition\n */\n\nclass BaseComponent extends Config {\n  constructor(element, config) {\n    super()\n\n    element = getElement(element)\n    if (!element) {\n      return\n    }\n\n    this._element = element\n    this._config = this._getConfig(config)\n\n    Data.set(this._element, this.constructor.DATA_KEY, this)\n  }\n\n  // Public\n  dispose() {\n    Data.remove(this._element, this.constructor.DATA_KEY)\n    EventHandler.off(this._element, this.constructor.EVENT_KEY)\n\n    for (const propertyName of Object.getOwnPropertyNames(this)) {\n      this[propertyName] = null\n    }\n  }\n\n  // Private\n  _queueCallback(callback, element, isAnimated = true) {\n    executeAfterTransition(callback, element, isAnimated)\n  }\n\n  _getConfig(config) {\n    config = this._mergeConfigObj(config, this._element)\n    config = this._configAfterMerge(config)\n    this._typeCheckConfig(config)\n    return config\n  }\n\n  // Static\n  static getInstance(element) {\n    return Data.get(getElement(element), this.DATA_KEY)\n  }\n\n  static getOrCreateInstance(element, config = {}) {\n    return this.getInstance(element) || new this(element, typeof config === 'object' ? config : null)\n  }\n\n  static get VERSION() {\n    return VERSION\n  }\n\n  static get DATA_KEY() {\n    return `bs.${this.NAME}`\n  }\n\n  static get EVENT_KEY() {\n    return `.${this.DATA_KEY}`\n  }\n\n  static eventName(name) {\n    return `${name}${this.EVENT_KEY}`\n  }\n}\n\nexport default BaseComponent\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap dom/selector-engine.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport { isDisabled, isVisible, parseSelector } from '../util/index.js'\n\nconst getSelector = element => {\n  let selector = element.getAttribute('data-bs-target')\n\n  if (!selector || selector === '#') {\n    let hrefAttribute = element.getAttribute('href')\n\n    // The only valid content that could double as a selector are IDs or classes,\n    // so everything starting with `#` or `.`. If a \"real\" URL is used as the selector,\n    // `document.querySelector` will rightfully complain it is invalid.\n    // See https://github.com/twbs/bootstrap/issues/32273\n    if (!hrefAttribute || (!hrefAttribute.includes('#') && !hrefAttribute.startsWith('.'))) {\n      return null\n    }\n\n    // Just in case some CMS puts out a full URL with the anchor appended\n    if (hrefAttribute.includes('#') && !hrefAttribute.startsWith('#')) {\n      hrefAttribute = `#${hrefAttribute.split('#')[1]}`\n    }\n\n    selector = hrefAttribute && hrefAttribute !== '#' ? hrefAttribute.trim() : null\n  }\n\n  return selector ? selector.split(',').map(sel => parseSelector(sel)).join(',') : null\n}\n\nconst SelectorEngine = {\n  find(selector, element = document.documentElement) {\n    return [].concat(...Element.prototype.querySelectorAll.call(element, selector))\n  },\n\n  findOne(selector, element = document.documentElement) {\n    return Element.prototype.querySelector.call(element, selector)\n  },\n\n  children(element, selector) {\n    return [].concat(...element.children).filter(child => child.matches(selector))\n  },\n\n  parents(element, selector) {\n    const parents = []\n    let ancestor = element.parentNode.closest(selector)\n\n    while (ancestor) {\n      parents.push(ancestor)\n      ancestor = ancestor.parentNode.closest(selector)\n    }\n\n    return parents\n  },\n\n  prev(element, selector) {\n    let previous = element.previousElementSibling\n\n    while (previous) {\n      if (previous.matches(selector)) {\n        return [previous]\n      }\n\n      previous = previous.previousElementSibling\n    }\n\n    return []\n  },\n  // TODO: this is now unused; remove later along with prev()\n  next(element, selector) {\n    let next = element.nextElementSibling\n\n    while (next) {\n      if (next.matches(selector)) {\n        return [next]\n      }\n\n      next = next.nextElementSibling\n    }\n\n    return []\n  },\n\n  focusableChildren(element) {\n    const focusables = [\n      'a',\n      'button',\n      'input',\n      'textarea',\n      'select',\n      'details',\n      '[tabindex]',\n      '[contenteditable=\"true\"]'\n    ].map(selector => `${selector}:not([tabindex^=\"-\"])`).join(',')\n\n    return this.find(focusables, element).filter(el => !isDisabled(el) && isVisible(el))\n  },\n\n  getSelectorFromElement(element) {\n    const selector = getSelector(element)\n\n    if (selector) {\n      return SelectorEngine.findOne(selector) ? selector : null\n    }\n\n    return null\n  },\n\n  getElementFromSelector(element) {\n    const selector = getSelector(element)\n\n    return selector ? SelectorEngine.findOne(selector) : null\n  },\n\n  getMultipleElementsFromSelector(element) {\n    const selector = getSelector(element)\n\n    return selector ? SelectorEngine.find(selector) : []\n  }\n}\n\nexport default SelectorEngine\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap util/component-functions.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport EventHandler from '../dom/event-handler.js'\nimport SelectorEngine from '../dom/selector-engine.js'\nimport { isDisabled } from './index.js'\n\nconst enableDismissTrigger = (component, method = 'hide') => {\n  const clickEvent = `click.dismiss${component.EVENT_KEY}`\n  const name = component.NAME\n\n  EventHandler.on(document, clickEvent, `[data-bs-dismiss=\"${name}\"]`, function (event) {\n    if (['A', 'AREA'].includes(this.tagName)) {\n      event.preventDefault()\n    }\n\n    if (isDisabled(this)) {\n      return\n    }\n\n    const target = SelectorEngine.getElementFromSelector(this) || this.closest(`.${name}`)\n    const instance = component.getOrCreateInstance(target)\n\n    // Method argument is left, for Alert and only, as it doesn't implement the 'hide' method\n    instance[method]()\n  })\n}\n\nexport {\n  enableDismissTrigger\n}\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap alert.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport BaseComponent from './base-component.js'\nimport EventHandler from './dom/event-handler.js'\nimport { enableDismissTrigger } from './util/component-functions.js'\nimport { defineJQueryPlugin } from './util/index.js'\n\n/**\n * Constants\n */\n\nconst NAME = 'alert'\nconst DATA_KEY = 'bs.alert'\nconst EVENT_KEY = `.${DATA_KEY}`\n\nconst EVENT_CLOSE = `close${EVENT_KEY}`\nconst EVENT_CLOSED = `closed${EVENT_KEY}`\nconst CLASS_NAME_FADE = 'fade'\nconst CLASS_NAME_SHOW = 'show'\n\n/**\n * Class definition\n */\n\nclass Alert extends BaseComponent {\n  // Getters\n  static get NAME() {\n    return NAME\n  }\n\n  // Public\n  close() {\n    const closeEvent = EventHandler.trigger(this._element, EVENT_CLOSE)\n\n    if (closeEvent.defaultPrevented) {\n      return\n    }\n\n    this._element.classList.remove(CLASS_NAME_SHOW)\n\n    const isAnimated = this._element.classList.contains(CLASS_NAME_FADE)\n    this._queueCallback(() => this._destroyElement(), this._element, isAnimated)\n  }\n\n  // Private\n  _destroyElement() {\n    this._element.remove()\n    EventHandler.trigger(this._element, EVENT_CLOSED)\n    this.dispose()\n  }\n\n  // Static\n  static jQueryInterface(config) {\n    return this.each(function () {\n      const data = Alert.getOrCreateInstance(this)\n\n      if (typeof config !== 'string') {\n        return\n      }\n\n      if (data[config] === undefined || config.startsWith('_') || config === 'constructor') {\n        throw new TypeError(`No method named \"${config}\"`)\n      }\n\n      data[config](this)\n    })\n  }\n}\n\n/**\n * Data API implementation\n */\n\nenableDismissTrigger(Alert, 'close')\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Alert)\n\nexport default Alert\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap button.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport BaseComponent from './base-component.js'\nimport EventHandler from './dom/event-handler.js'\nimport { defineJQueryPlugin } from './util/index.js'\n\n/**\n * Constants\n */\n\nconst NAME = 'button'\nconst DATA_KEY = 'bs.button'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst DATA_API_KEY = '.data-api'\n\nconst CLASS_NAME_ACTIVE = 'active'\nconst SELECTOR_DATA_TOGGLE = '[data-bs-toggle=\"button\"]'\nconst EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`\n\n/**\n * Class definition\n */\n\nclass Button extends BaseComponent {\n  // Getters\n  static get NAME() {\n    return NAME\n  }\n\n  // Public\n  toggle() {\n    // Toggle class and sync the `aria-pressed` attribute with the return value of the `.toggle()` method\n    this._element.setAttribute('aria-pressed', this._element.classList.toggle(CLASS_NAME_ACTIVE))\n  }\n\n  // Static\n  static jQueryInterface(config) {\n    return this.each(function () {\n      const data = Button.getOrCreateInstance(this)\n\n      if (config === 'toggle') {\n        data[config]()\n      }\n    })\n  }\n}\n\n/**\n * Data API implementation\n */\n\nEventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, event => {\n  event.preventDefault()\n\n  const button = event.target.closest(SELECTOR_DATA_TOGGLE)\n  const data = Button.getOrCreateInstance(button)\n\n  data.toggle()\n})\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Button)\n\nexport default Button\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap util/swipe.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport EventHandler from '../dom/event-handler.js'\nimport Config from './config.js'\nimport { execute } from './index.js'\n\n/**\n * Constants\n */\n\nconst NAME = 'swipe'\nconst EVENT_KEY = '.bs.swipe'\nconst EVENT_TOUCHSTART = `touchstart${EVENT_KEY}`\nconst EVENT_TOUCHMOVE = `touchmove${EVENT_KEY}`\nconst EVENT_TOUCHEND = `touchend${EVENT_KEY}`\nconst EVENT_POINTERDOWN = `pointerdown${EVENT_KEY}`\nconst EVENT_POINTERUP = `pointerup${EVENT_KEY}`\nconst POINTER_TYPE_TOUCH = 'touch'\nconst POINTER_TYPE_PEN = 'pen'\nconst CLASS_NAME_POINTER_EVENT = 'pointer-event'\nconst SWIPE_THRESHOLD = 40\n\nconst Default = {\n  endCallback: null,\n  leftCallback: null,\n  rightCallback: null\n}\n\nconst DefaultType = {\n  endCallback: '(function|null)',\n  leftCallback: '(function|null)',\n  rightCallback: '(function|null)'\n}\n\n/**\n * Class definition\n */\n\nclass Swipe extends Config {\n  constructor(element, config) {\n    super()\n    this._element = element\n\n    if (!element || !Swipe.isSupported()) {\n      return\n    }\n\n    this._config = this._getConfig(config)\n    this._deltaX = 0\n    this._supportPointerEvents = Boolean(window.PointerEvent)\n    this._initEvents()\n  }\n\n  // Getters\n  static get Default() {\n    return Default\n  }\n\n  static get DefaultType() {\n    return DefaultType\n  }\n\n  static get NAME() {\n    return NAME\n  }\n\n  // Public\n  dispose() {\n    EventHandler.off(this._element, EVENT_KEY)\n  }\n\n  // Private\n  _start(event) {\n    if (!this._supportPointerEvents) {\n      this._deltaX = event.touches[0].clientX\n\n      return\n    }\n\n    if (this._eventIsPointerPenTouch(event)) {\n      this._deltaX = event.clientX\n    }\n  }\n\n  _end(event) {\n    if (this._eventIsPointerPenTouch(event)) {\n      this._deltaX = event.clientX - this._deltaX\n    }\n\n    this._handleSwipe()\n    execute(this._config.endCallback)\n  }\n\n  _move(event) {\n    this._deltaX = event.touches && event.touches.length > 1 ?\n      0 :\n      event.touches[0].clientX - this._deltaX\n  }\n\n  _handleSwipe() {\n    const absDeltaX = Math.abs(this._deltaX)\n\n    if (absDeltaX <= SWIPE_THRESHOLD) {\n      return\n    }\n\n    const direction = absDeltaX / this._deltaX\n\n    this._deltaX = 0\n\n    if (!direction) {\n      return\n    }\n\n    execute(direction > 0 ? this._config.rightCallback : this._config.leftCallback)\n  }\n\n  _initEvents() {\n    if (this._supportPointerEvents) {\n      EventHandler.on(this._element, EVENT_POINTERDOWN, event => this._start(event))\n      EventHandler.on(this._element, EVENT_POINTERUP, event => this._end(event))\n\n      this._element.classList.add(CLASS_NAME_POINTER_EVENT)\n    } else {\n      EventHandler.on(this._element, EVENT_TOUCHSTART, event => this._start(event))\n      EventHandler.on(this._element, EVENT_TOUCHMOVE, event => this._move(event))\n      EventHandler.on(this._element, EVENT_TOUCHEND, event => this._end(event))\n    }\n  }\n\n  _eventIsPointerPenTouch(event) {\n    return this._supportPointerEvents && (event.pointerType === POINTER_TYPE_PEN || event.pointerType === POINTER_TYPE_TOUCH)\n  }\n\n  // Static\n  static isSupported() {\n    return 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0\n  }\n}\n\nexport default Swipe\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap carousel.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport BaseComponent from './base-component.js'\nimport EventHandler from './dom/event-handler.js'\nimport Manipulator from './dom/manipulator.js'\nimport SelectorEngine from './dom/selector-engine.js'\nimport {\n  defineJQueryPlugin,\n  getNextActiveElement,\n  isRTL,\n  isVisible,\n  reflow,\n  triggerTransitionEnd\n} from './util/index.js'\nimport Swipe from './util/swipe.js'\n\n/**\n * Constants\n */\n\nconst NAME = 'carousel'\nconst DATA_KEY = 'bs.carousel'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst DATA_API_KEY = '.data-api'\n\nconst ARROW_LEFT_KEY = 'ArrowLeft'\nconst ARROW_RIGHT_KEY = 'ArrowRight'\nconst TOUCHEVENT_COMPAT_WAIT = 500 // Time for mouse compat events to fire after touch\n\nconst ORDER_NEXT = 'next'\nconst ORDER_PREV = 'prev'\nconst DIRECTION_LEFT = 'left'\nconst DIRECTION_RIGHT = 'right'\n\nconst EVENT_SLIDE = `slide${EVENT_KEY}`\nconst EVENT_SLID = `slid${EVENT_KEY}`\nconst EVENT_KEYDOWN = `keydown${EVENT_KEY}`\nconst EVENT_MOUSEENTER = `mouseenter${EVENT_KEY}`\nconst EVENT_MOUSELEAVE = `mouseleave${EVENT_KEY}`\nconst EVENT_DRAG_START = `dragstart${EVENT_KEY}`\nconst EVENT_LOAD_DATA_API = `load${EVENT_KEY}${DATA_API_KEY}`\nconst EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`\n\nconst CLASS_NAME_CAROUSEL = 'carousel'\nconst CLASS_NAME_ACTIVE = 'active'\nconst CLASS_NAME_SLIDE = 'slide'\nconst CLASS_NAME_END = 'carousel-item-end'\nconst CLASS_NAME_START = 'carousel-item-start'\nconst CLASS_NAME_NEXT = 'carousel-item-next'\nconst CLASS_NAME_PREV = 'carousel-item-prev'\n\nconst SELECTOR_ACTIVE = '.active'\nconst SELECTOR_ITEM = '.carousel-item'\nconst SELECTOR_ACTIVE_ITEM = SELECTOR_ACTIVE + SELECTOR_ITEM\nconst SELECTOR_ITEM_IMG = '.carousel-item img'\nconst SELECTOR_INDICATORS = '.carousel-indicators'\nconst SELECTOR_DATA_SLIDE = '[data-bs-slide], [data-bs-slide-to]'\nconst SELECTOR_DATA_RIDE = '[data-bs-ride=\"carousel\"]'\n\nconst KEY_TO_DIRECTION = {\n  [ARROW_LEFT_KEY]: DIRECTION_RIGHT,\n  [ARROW_RIGHT_KEY]: DIRECTION_LEFT\n}\n\nconst Default = {\n  interval: 5000,\n  keyboard: true,\n  pause: 'hover',\n  ride: false,\n  touch: true,\n  wrap: true\n}\n\nconst DefaultType = {\n  interval: '(number|boolean)', // TODO:v6 remove boolean support\n  keyboard: 'boolean',\n  pause: '(string|boolean)',\n  ride: '(boolean|string)',\n  touch: 'boolean',\n  wrap: 'boolean'\n}\n\n/**\n * Class definition\n */\n\nclass Carousel extends BaseComponent {\n  constructor(element, config) {\n    super(element, config)\n\n    this._interval = null\n    this._activeElement = null\n    this._isSliding = false\n    this.touchTimeout = null\n    this._swipeHelper = null\n\n    this._indicatorsElement = SelectorEngine.findOne(SELECTOR_INDICATORS, this._element)\n    this._addEventListeners()\n\n    if (this._config.ride === CLASS_NAME_CAROUSEL) {\n      this.cycle()\n    }\n  }\n\n  // Getters\n  static get Default() {\n    return Default\n  }\n\n  static get DefaultType() {\n    return DefaultType\n  }\n\n  static get NAME() {\n    return NAME\n  }\n\n  // Public\n  next() {\n    this._slide(ORDER_NEXT)\n  }\n\n  nextWhenVisible() {\n    // FIXME TODO use `document.visibilityState`\n    // Don't call next when the page isn't visible\n    // or the carousel or its parent isn't visible\n    if (!document.hidden && isVisible(this._element)) {\n      this.next()\n    }\n  }\n\n  prev() {\n    this._slide(ORDER_PREV)\n  }\n\n  pause() {\n    if (this._isSliding) {\n      triggerTransitionEnd(this._element)\n    }\n\n    this._clearInterval()\n  }\n\n  cycle() {\n    this._clearInterval()\n    this._updateInterval()\n\n    this._interval = setInterval(() => this.nextWhenVisible(), this._config.interval)\n  }\n\n  _maybeEnableCycle() {\n    if (!this._config.ride) {\n      return\n    }\n\n    if (this._isSliding) {\n      EventHandler.one(this._element, EVENT_SLID, () => this.cycle())\n      return\n    }\n\n    this.cycle()\n  }\n\n  to(index) {\n    const items = this._getItems()\n    if (index > items.length - 1 || index < 0) {\n      return\n    }\n\n    if (this._isSliding) {\n      EventHandler.one(this._element, EVENT_SLID, () => this.to(index))\n      return\n    }\n\n    const activeIndex = this._getItemIndex(this._getActive())\n    if (activeIndex === index) {\n      return\n    }\n\n    const order = index > activeIndex ? ORDER_NEXT : ORDER_PREV\n\n    this._slide(order, items[index])\n  }\n\n  dispose() {\n    if (this._swipeHelper) {\n      this._swipeHelper.dispose()\n    }\n\n    super.dispose()\n  }\n\n  // Private\n  _configAfterMerge(config) {\n    config.defaultInterval = config.interval\n    return config\n  }\n\n  _addEventListeners() {\n    if (this._config.keyboard) {\n      EventHandler.on(this._element, EVENT_KEYDOWN, event => this._keydown(event))\n    }\n\n    if (this._config.pause === 'hover') {\n      EventHandler.on(this._element, EVENT_MOUSEENTER, () => this.pause())\n      EventHandler.on(this._element, EVENT_MOUSELEAVE, () => this._maybeEnableCycle())\n    }\n\n    if (this._config.touch && Swipe.isSupported()) {\n      this._addTouchEventListeners()\n    }\n  }\n\n  _addTouchEventListeners() {\n    for (const img of SelectorEngine.find(SELECTOR_ITEM_IMG, this._element)) {\n      EventHandler.on(img, EVENT_DRAG_START, event => event.preventDefault())\n    }\n\n    const endCallBack = () => {\n      if (this._config.pause !== 'hover') {\n        return\n      }\n\n      // If it's a touch-enabled device, mouseenter/leave are fired as\n      // part of the mouse compatibility events on first tap - the carousel\n      // would stop cycling until user tapped out of it;\n      // here, we listen for touchend, explicitly pause the carousel\n      // (as if it's the second time we tap on it, mouseenter compat event\n      // is NOT fired) and after a timeout (to allow for mouse compatibility\n      // events to fire) we explicitly restart cycling\n\n      this.pause()\n      if (this.touchTimeout) {\n        clearTimeout(this.touchTimeout)\n      }\n\n      this.touchTimeout = setTimeout(() => this._maybeEnableCycle(), TOUCHEVENT_COMPAT_WAIT + this._config.interval)\n    }\n\n    const swipeConfig = {\n      leftCallback: () => this._slide(this._directionToOrder(DIRECTION_LEFT)),\n      rightCallback: () => this._slide(this._directionToOrder(DIRECTION_RIGHT)),\n      endCallback: endCallBack\n    }\n\n    this._swipeHelper = new Swipe(this._element, swipeConfig)\n  }\n\n  _keydown(event) {\n    if (/input|textarea/i.test(event.target.tagName)) {\n      return\n    }\n\n    const direction = KEY_TO_DIRECTION[event.key]\n    if (direction) {\n      event.preventDefault()\n      this._slide(this._directionToOrder(direction))\n    }\n  }\n\n  _getItemIndex(element) {\n    return this._getItems().indexOf(element)\n  }\n\n  _setActiveIndicatorElement(index) {\n    if (!this._indicatorsElement) {\n      return\n    }\n\n    const activeIndicator = SelectorEngine.findOne(SELECTOR_ACTIVE, this._indicatorsElement)\n\n    activeIndicator.classList.remove(CLASS_NAME_ACTIVE)\n    activeIndicator.removeAttribute('aria-current')\n\n    const newActiveIndicator = SelectorEngine.findOne(`[data-bs-slide-to=\"${index}\"]`, this._indicatorsElement)\n\n    if (newActiveIndicator) {\n      newActiveIndicator.classList.add(CLASS_NAME_ACTIVE)\n      newActiveIndicator.setAttribute('aria-current', 'true')\n    }\n  }\n\n  _updateInterval() {\n    const element = this._activeElement || this._getActive()\n\n    if (!element) {\n      return\n    }\n\n    const elementInterval = Number.parseInt(element.getAttribute('data-bs-interval'), 10)\n\n    this._config.interval = elementInterval || this._config.defaultInterval\n  }\n\n  _slide(order, element = null) {\n    if (this._isSliding) {\n      return\n    }\n\n    const activeElement = this._getActive()\n    const isNext = order === ORDER_NEXT\n    const nextElement = element || getNextActiveElement(this._getItems(), activeElement, isNext, this._config.wrap)\n\n    if (nextElement === activeElement) {\n      return\n    }\n\n    const nextElementIndex = this._getItemIndex(nextElement)\n\n    const triggerEvent = eventName => {\n      return EventHandler.trigger(this._element, eventName, {\n        relatedTarget: nextElement,\n        direction: this._orderToDirection(order),\n        from: this._getItemIndex(activeElement),\n        to: nextElementIndex\n      })\n    }\n\n    const slideEvent = triggerEvent(EVENT_SLIDE)\n\n    if (slideEvent.defaultPrevented) {\n      return\n    }\n\n    if (!activeElement || !nextElement) {\n      // Some weirdness is happening, so we bail\n      // TODO: change tests that use empty divs to avoid this check\n      return\n    }\n\n    const isCycling = Boolean(this._interval)\n    this.pause()\n\n    this._isSliding = true\n\n    this._setActiveIndicatorElement(nextElementIndex)\n    this._activeElement = nextElement\n\n    const directionalClassName = isNext ? CLASS_NAME_START : CLASS_NAME_END\n    const orderClassName = isNext ? CLASS_NAME_NEXT : CLASS_NAME_PREV\n\n    nextElement.classList.add(orderClassName)\n\n    reflow(nextElement)\n\n    activeElement.classList.add(directionalClassName)\n    nextElement.classList.add(directionalClassName)\n\n    const completeCallBack = () => {\n      nextElement.classList.remove(directionalClassName, orderClassName)\n      nextElement.classList.add(CLASS_NAME_ACTIVE)\n\n      activeElement.classList.remove(CLASS_NAME_ACTIVE, orderClassName, directionalClassName)\n\n      this._isSliding = false\n\n      triggerEvent(EVENT_SLID)\n    }\n\n    this._queueCallback(completeCallBack, activeElement, this._isAnimated())\n\n    if (isCycling) {\n      this.cycle()\n    }\n  }\n\n  _isAnimated() {\n    return this._element.classList.contains(CLASS_NAME_SLIDE)\n  }\n\n  _getActive() {\n    return SelectorEngine.findOne(SELECTOR_ACTIVE_ITEM, this._element)\n  }\n\n  _getItems() {\n    return SelectorEngine.find(SELECTOR_ITEM, this._element)\n  }\n\n  _clearInterval() {\n    if (this._interval) {\n      clearInterval(this._interval)\n      this._interval = null\n    }\n  }\n\n  _directionToOrder(direction) {\n    if (isRTL()) {\n      return direction === DIRECTION_LEFT ? ORDER_PREV : ORDER_NEXT\n    }\n\n    return direction === DIRECTION_LEFT ? ORDER_NEXT : ORDER_PREV\n  }\n\n  _orderToDirection(order) {\n    if (isRTL()) {\n      return order === ORDER_PREV ? DIRECTION_LEFT : DIRECTION_RIGHT\n    }\n\n    return order === ORDER_PREV ? DIRECTION_RIGHT : DIRECTION_LEFT\n  }\n\n  // Static\n  static jQueryInterface(config) {\n    return this.each(function () {\n      const data = Carousel.getOrCreateInstance(this, config)\n\n      if (typeof config === 'number') {\n        data.to(config)\n        return\n      }\n\n      if (typeof config === 'string') {\n        if (data[config] === undefined || config.startsWith('_') || config === 'constructor') {\n          throw new TypeError(`No method named \"${config}\"`)\n        }\n\n        data[config]()\n      }\n    })\n  }\n}\n\n/**\n * Data API implementation\n */\n\nEventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_SLIDE, function (event) {\n  const target = SelectorEngine.getElementFromSelector(this)\n\n  if (!target || !target.classList.contains(CLASS_NAME_CAROUSEL)) {\n    return\n  }\n\n  event.preventDefault()\n\n  const carousel = Carousel.getOrCreateInstance(target)\n  const slideIndex = this.getAttribute('data-bs-slide-to')\n\n  if (slideIndex) {\n    carousel.to(slideIndex)\n    carousel._maybeEnableCycle()\n    return\n  }\n\n  if (Manipulator.getDataAttribute(this, 'slide') === 'next') {\n    carousel.next()\n    carousel._maybeEnableCycle()\n    return\n  }\n\n  carousel.prev()\n  carousel._maybeEnableCycle()\n})\n\nEventHandler.on(window, EVENT_LOAD_DATA_API, () => {\n  const carousels = SelectorEngine.find(SELECTOR_DATA_RIDE)\n\n  for (const carousel of carousels) {\n    Carousel.getOrCreateInstance(carousel)\n  }\n})\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Carousel)\n\nexport default Carousel\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap collapse.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport BaseComponent from './base-component.js'\nimport EventHandler from './dom/event-handler.js'\nimport SelectorEngine from './dom/selector-engine.js'\nimport {\n  defineJQueryPlugin,\n  getElement,\n  reflow\n} from './util/index.js'\n\n/**\n * Constants\n */\n\nconst NAME = 'collapse'\nconst DATA_KEY = 'bs.collapse'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst DATA_API_KEY = '.data-api'\n\nconst EVENT_SHOW = `show${EVENT_KEY}`\nconst EVENT_SHOWN = `shown${EVENT_KEY}`\nconst EVENT_HIDE = `hide${EVENT_KEY}`\nconst EVENT_HIDDEN = `hidden${EVENT_KEY}`\nconst EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`\n\nconst CLASS_NAME_SHOW = 'show'\nconst CLASS_NAME_COLLAPSE = 'collapse'\nconst CLASS_NAME_COLLAPSING = 'collapsing'\nconst CLASS_NAME_COLLAPSED = 'collapsed'\nconst CLASS_NAME_DEEPER_CHILDREN = `:scope .${CLASS_NAME_COLLAPSE} .${CLASS_NAME_COLLAPSE}`\nconst CLASS_NAME_HORIZONTAL = 'collapse-horizontal'\n\nconst WIDTH = 'width'\nconst HEIGHT = 'height'\n\nconst SELECTOR_ACTIVES = '.collapse.show, .collapse.collapsing'\nconst SELECTOR_DATA_TOGGLE = '[data-bs-toggle=\"collapse\"]'\n\nconst Default = {\n  parent: null,\n  toggle: true\n}\n\nconst DefaultType = {\n  parent: '(null|element)',\n  toggle: 'boolean'\n}\n\n/**\n * Class definition\n */\n\nclass Collapse extends BaseComponent {\n  constructor(element, config) {\n    super(element, config)\n\n    this._isTransitioning = false\n    this._triggerArray = []\n\n    const toggleList = SelectorEngine.find(SELECTOR_DATA_TOGGLE)\n\n    for (const elem of toggleList) {\n      const selector = SelectorEngine.getSelectorFromElement(elem)\n      const filterElement = SelectorEngine.find(selector)\n        .filter(foundElement => foundElement === this._element)\n\n      if (selector !== null && filterElement.length) {\n        this._triggerArray.push(elem)\n      }\n    }\n\n    this._initializeChildren()\n\n    if (!this._config.parent) {\n      this._addAriaAndCollapsedClass(this._triggerArray, this._isShown())\n    }\n\n    if (this._config.toggle) {\n      this.toggle()\n    }\n  }\n\n  // Getters\n  static get Default() {\n    return Default\n  }\n\n  static get DefaultType() {\n    return DefaultType\n  }\n\n  static get NAME() {\n    return NAME\n  }\n\n  // Public\n  toggle() {\n    if (this._isShown()) {\n      this.hide()\n    } else {\n      this.show()\n    }\n  }\n\n  show() {\n    if (this._isTransitioning || this._isShown()) {\n      return\n    }\n\n    let activeChildren = []\n\n    // find active children\n    if (this._config.parent) {\n      activeChildren = this._getFirstLevelChildren(SELECTOR_ACTIVES)\n        .filter(element => element !== this._element)\n        .map(element => Collapse.getOrCreateInstance(element, { toggle: false }))\n    }\n\n    if (activeChildren.length && activeChildren[0]._isTransitioning) {\n      return\n    }\n\n    const startEvent = EventHandler.trigger(this._element, EVENT_SHOW)\n    if (startEvent.defaultPrevented) {\n      return\n    }\n\n    for (const activeInstance of activeChildren) {\n      activeInstance.hide()\n    }\n\n    const dimension = this._getDimension()\n\n    this._element.classList.remove(CLASS_NAME_COLLAPSE)\n    this._element.classList.add(CLASS_NAME_COLLAPSING)\n\n    this._element.style[dimension] = 0\n\n    this._addAriaAndCollapsedClass(this._triggerArray, true)\n    this._isTransitioning = true\n\n    const complete = () => {\n      this._isTransitioning = false\n\n      this._element.classList.remove(CLASS_NAME_COLLAPSING)\n      this._element.classList.add(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW)\n\n      this._element.style[dimension] = ''\n\n      EventHandler.trigger(this._element, EVENT_SHOWN)\n    }\n\n    const capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1)\n    const scrollSize = `scroll${capitalizedDimension}`\n\n    this._queueCallback(complete, this._element, true)\n    this._element.style[dimension] = `${this._element[scrollSize]}px`\n  }\n\n  hide() {\n    if (this._isTransitioning || !this._isShown()) {\n      return\n    }\n\n    const startEvent = EventHandler.trigger(this._element, EVENT_HIDE)\n    if (startEvent.defaultPrevented) {\n      return\n    }\n\n    const dimension = this._getDimension()\n\n    this._element.style[dimension] = `${this._element.getBoundingClientRect()[dimension]}px`\n\n    reflow(this._element)\n\n    this._element.classList.add(CLASS_NAME_COLLAPSING)\n    this._element.classList.remove(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW)\n\n    for (const trigger of this._triggerArray) {\n      const element = SelectorEngine.getElementFromSelector(trigger)\n\n      if (element && !this._isShown(element)) {\n        this._addAriaAndCollapsedClass([trigger], false)\n      }\n    }\n\n    this._isTransitioning = true\n\n    const complete = () => {\n      this._isTransitioning = false\n      this._element.classList.remove(CLASS_NAME_COLLAPSING)\n      this._element.classList.add(CLASS_NAME_COLLAPSE)\n      EventHandler.trigger(this._element, EVENT_HIDDEN)\n    }\n\n    this._element.style[dimension] = ''\n\n    this._queueCallback(complete, this._element, true)\n  }\n\n  // Private\n  _isShown(element = this._element) {\n    return element.classList.contains(CLASS_NAME_SHOW)\n  }\n\n  _configAfterMerge(config) {\n    config.toggle = Boolean(config.toggle) // Coerce string values\n    config.parent = getElement(config.parent)\n    return config\n  }\n\n  _getDimension() {\n    return this._element.classList.contains(CLASS_NAME_HORIZONTAL) ? WIDTH : HEIGHT\n  }\n\n  _initializeChildren() {\n    if (!this._config.parent) {\n      return\n    }\n\n    const children = this._getFirstLevelChildren(SELECTOR_DATA_TOGGLE)\n\n    for (const element of children) {\n      const selected = SelectorEngine.getElementFromSelector(element)\n\n      if (selected) {\n        this._addAriaAndCollapsedClass([element], this._isShown(selected))\n      }\n    }\n  }\n\n  _getFirstLevelChildren(selector) {\n    const children = SelectorEngine.find(CLASS_NAME_DEEPER_CHILDREN, this._config.parent)\n    // remove children if greater depth\n    return SelectorEngine.find(selector, this._config.parent).filter(element => !children.includes(element))\n  }\n\n  _addAriaAndCollapsedClass(triggerArray, isOpen) {\n    if (!triggerArray.length) {\n      return\n    }\n\n    for (const element of triggerArray) {\n      element.classList.toggle(CLASS_NAME_COLLAPSED, !isOpen)\n      element.setAttribute('aria-expanded', isOpen)\n    }\n  }\n\n  // Static\n  static jQueryInterface(config) {\n    const _config = {}\n    if (typeof config === 'string' && /show|hide/.test(config)) {\n      _config.toggle = false\n    }\n\n    return this.each(function () {\n      const data = Collapse.getOrCreateInstance(this, _config)\n\n      if (typeof config === 'string') {\n        if (typeof data[config] === 'undefined') {\n          throw new TypeError(`No method named \"${config}\"`)\n        }\n\n        data[config]()\n      }\n    })\n  }\n}\n\n/**\n * Data API implementation\n */\n\nEventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {\n  // preventDefault only for <a> elements (which change the URL) not inside the collapsible element\n  if (event.target.tagName === 'A' || (event.delegateTarget && event.delegateTarget.tagName === 'A')) {\n    event.preventDefault()\n  }\n\n  for (const element of SelectorEngine.getMultipleElementsFromSelector(this)) {\n    Collapse.getOrCreateInstance(element, { toggle: false }).toggle()\n  }\n})\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Collapse)\n\nexport default Collapse\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap dropdown.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport * as Popper from '@popperjs/core'\nimport BaseComponent from './base-component.js'\nimport EventHandler from './dom/event-handler.js'\nimport Manipulator from './dom/manipulator.js'\nimport SelectorEngine from './dom/selector-engine.js'\nimport {\n  defineJQueryPlugin,\n  execute,\n  getElement,\n  getNextActiveElement,\n  isDisabled,\n  isElement,\n  isRTL,\n  isVisible,\n  noop\n} from './util/index.js'\n\n/**\n * Constants\n */\n\nconst NAME = 'dropdown'\nconst DATA_KEY = 'bs.dropdown'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst DATA_API_KEY = '.data-api'\n\nconst ESCAPE_KEY = 'Escape'\nconst TAB_KEY = 'Tab'\nconst ARROW_UP_KEY = 'ArrowUp'\nconst ARROW_DOWN_KEY = 'ArrowDown'\nconst RIGHT_MOUSE_BUTTON = 2 // MouseEvent.button value for the secondary button, usually the right button\n\nconst EVENT_HIDE = `hide${EVENT_KEY}`\nconst EVENT_HIDDEN = `hidden${EVENT_KEY}`\nconst EVENT_SHOW = `show${EVENT_KEY}`\nconst EVENT_SHOWN = `shown${EVENT_KEY}`\nconst EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`\nconst EVENT_KEYDOWN_DATA_API = `keydown${EVENT_KEY}${DATA_API_KEY}`\nconst EVENT_KEYUP_DATA_API = `keyup${EVENT_KEY}${DATA_API_KEY}`\n\nconst CLASS_NAME_SHOW = 'show'\nconst CLASS_NAME_DROPUP = 'dropup'\nconst CLASS_NAME_DROPEND = 'dropend'\nconst CLASS_NAME_DROPSTART = 'dropstart'\nconst CLASS_NAME_DROPUP_CENTER = 'dropup-center'\nconst CLASS_NAME_DROPDOWN_CENTER = 'dropdown-center'\n\nconst SELECTOR_DATA_TOGGLE = '[data-bs-toggle=\"dropdown\"]:not(.disabled):not(:disabled)'\nconst SELECTOR_DATA_TOGGLE_SHOWN = `${SELECTOR_DATA_TOGGLE}.${CLASS_NAME_SHOW}`\nconst SELECTOR_MENU = '.dropdown-menu'\nconst SELECTOR_NAVBAR = '.navbar'\nconst SELECTOR_NAVBAR_NAV = '.navbar-nav'\nconst SELECTOR_VISIBLE_ITEMS = '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)'\n\nconst PLACEMENT_TOP = isRTL() ? 'top-end' : 'top-start'\nconst PLACEMENT_TOPEND = isRTL() ? 'top-start' : 'top-end'\nconst PLACEMENT_BOTTOM = isRTL() ? 'bottom-end' : 'bottom-start'\nconst PLACEMENT_BOTTOMEND = isRTL() ? 'bottom-start' : 'bottom-end'\nconst PLACEMENT_RIGHT = isRTL() ? 'left-start' : 'right-start'\nconst PLACEMENT_LEFT = isRTL() ? 'right-start' : 'left-start'\nconst PLACEMENT_TOPCENTER = 'top'\nconst PLACEMENT_BOTTOMCENTER = 'bottom'\n\nconst Default = {\n  autoClose: true,\n  boundary: 'clippingParents',\n  display: 'dynamic',\n  offset: [0, 2],\n  popperConfig: null,\n  reference: 'toggle'\n}\n\nconst DefaultType = {\n  autoClose: '(boolean|string)',\n  boundary: '(string|element)',\n  display: 'string',\n  offset: '(array|string|function)',\n  popperConfig: '(null|object|function)',\n  reference: '(string|element|object)'\n}\n\n/**\n * Class definition\n */\n\nclass Dropdown extends BaseComponent {\n  constructor(element, config) {\n    super(element, config)\n\n    this._popper = null\n    this._parent = this._element.parentNode // dropdown wrapper\n    // TODO: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.3/forms/input-group/\n    this._menu = SelectorEngine.next(this._element, SELECTOR_MENU)[0] ||\n      SelectorEngine.prev(this._element, SELECTOR_MENU)[0] ||\n      SelectorEngine.findOne(SELECTOR_MENU, this._parent)\n    this._inNavbar = this._detectNavbar()\n  }\n\n  // Getters\n  static get Default() {\n    return Default\n  }\n\n  static get DefaultType() {\n    return DefaultType\n  }\n\n  static get NAME() {\n    return NAME\n  }\n\n  // Public\n  toggle() {\n    return this._isShown() ? this.hide() : this.show()\n  }\n\n  show() {\n    if (isDisabled(this._element) || this._isShown()) {\n      return\n    }\n\n    const relatedTarget = {\n      relatedTarget: this._element\n    }\n\n    const showEvent = EventHandler.trigger(this._element, EVENT_SHOW, relatedTarget)\n\n    if (showEvent.defaultPrevented) {\n      return\n    }\n\n    this._createPopper()\n\n    // If this is a touch-enabled device we add extra\n    // empty mouseover listeners to the body's immediate children;\n    // only needed because of broken event delegation on iOS\n    // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html\n    if ('ontouchstart' in document.documentElement && !this._parent.closest(SELECTOR_NAVBAR_NAV)) {\n      for (const element of [].concat(...document.body.children)) {\n        EventHandler.on(element, 'mouseover', noop)\n      }\n    }\n\n    this._element.focus()\n    this._element.setAttribute('aria-expanded', true)\n\n    this._menu.classList.add(CLASS_NAME_SHOW)\n    this._element.classList.add(CLASS_NAME_SHOW)\n    EventHandler.trigger(this._element, EVENT_SHOWN, relatedTarget)\n  }\n\n  hide() {\n    if (isDisabled(this._element) || !this._isShown()) {\n      return\n    }\n\n    const relatedTarget = {\n      relatedTarget: this._element\n    }\n\n    this._completeHide(relatedTarget)\n  }\n\n  dispose() {\n    if (this._popper) {\n      this._popper.destroy()\n    }\n\n    super.dispose()\n  }\n\n  update() {\n    this._inNavbar = this._detectNavbar()\n    if (this._popper) {\n      this._popper.update()\n    }\n  }\n\n  // Private\n  _completeHide(relatedTarget) {\n    const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE, relatedTarget)\n    if (hideEvent.defaultPrevented) {\n      return\n    }\n\n    // If this is a touch-enabled device we remove the extra\n    // empty mouseover listeners we added for iOS support\n    if ('ontouchstart' in document.documentElement) {\n      for (const element of [].concat(...document.body.children)) {\n        EventHandler.off(element, 'mouseover', noop)\n      }\n    }\n\n    if (this._popper) {\n      this._popper.destroy()\n    }\n\n    this._menu.classList.remove(CLASS_NAME_SHOW)\n    this._element.classList.remove(CLASS_NAME_SHOW)\n    this._element.setAttribute('aria-expanded', 'false')\n    Manipulator.removeDataAttribute(this._menu, 'popper')\n    EventHandler.trigger(this._element, EVENT_HIDDEN, relatedTarget)\n\n    // Explicitly return focus to the trigger element\n    this._element.focus()\n  }\n\n  _getConfig(config) {\n    config = super._getConfig(config)\n\n    if (typeof config.reference === 'object' && !isElement(config.reference) &&\n      typeof config.reference.getBoundingClientRect !== 'function'\n    ) {\n      // Popper virtual elements require a getBoundingClientRect method\n      throw new TypeError(`${NAME.toUpperCase()}: Option \"reference\" provided type \"object\" without a required \"getBoundingClientRect\" method.`)\n    }\n\n    return config\n  }\n\n  _createPopper() {\n    if (typeof Popper === 'undefined') {\n      throw new TypeError('Bootstrap\\'s dropdowns require Popper (https://popper.js.org/docs/v2/)')\n    }\n\n    let referenceElement = this._element\n\n    if (this._config.reference === 'parent') {\n      referenceElement = this._parent\n    } else if (isElement(this._config.reference)) {\n      referenceElement = getElement(this._config.reference)\n    } else if (typeof this._config.reference === 'object') {\n      referenceElement = this._config.reference\n    }\n\n    const popperConfig = this._getPopperConfig()\n    this._popper = Popper.createPopper(referenceElement, this._menu, popperConfig)\n  }\n\n  _isShown() {\n    return this._menu.classList.contains(CLASS_NAME_SHOW)\n  }\n\n  _getPlacement() {\n    const parentDropdown = this._parent\n\n    if (parentDropdown.classList.contains(CLASS_NAME_DROPEND)) {\n      return PLACEMENT_RIGHT\n    }\n\n    if (parentDropdown.classList.contains(CLASS_NAME_DROPSTART)) {\n      return PLACEMENT_LEFT\n    }\n\n    if (parentDropdown.classList.contains(CLASS_NAME_DROPUP_CENTER)) {\n      return PLACEMENT_TOPCENTER\n    }\n\n    if (parentDropdown.classList.contains(CLASS_NAME_DROPDOWN_CENTER)) {\n      return PLACEMENT_BOTTOMCENTER\n    }\n\n    // We need to trim the value because custom properties can also include spaces\n    const isEnd = getComputedStyle(this._menu).getPropertyValue('--bs-position').trim() === 'end'\n\n    if (parentDropdown.classList.contains(CLASS_NAME_DROPUP)) {\n      return isEnd ? PLACEMENT_TOPEND : PLACEMENT_TOP\n    }\n\n    return isEnd ? PLACEMENT_BOTTOMEND : PLACEMENT_BOTTOM\n  }\n\n  _detectNavbar() {\n    return this._element.closest(SELECTOR_NAVBAR) !== null\n  }\n\n  _getOffset() {\n    const { offset } = this._config\n\n    if (typeof offset === 'string') {\n      return offset.split(',').map(value => Number.parseInt(value, 10))\n    }\n\n    if (typeof offset === 'function') {\n      return popperData => offset(popperData, this._element)\n    }\n\n    return offset\n  }\n\n  _getPopperConfig() {\n    const defaultBsPopperConfig = {\n      placement: this._getPlacement(),\n      modifiers: [{\n        name: 'preventOverflow',\n        options: {\n          boundary: this._config.boundary\n        }\n      },\n      {\n        name: 'offset',\n        options: {\n          offset: this._getOffset()\n        }\n      }]\n    }\n\n    // Disable Popper if we have a static display or Dropdown is in Navbar\n    if (this._inNavbar || this._config.display === 'static') {\n      Manipulator.setDataAttribute(this._menu, 'popper', 'static') // TODO: v6 remove\n      defaultBsPopperConfig.modifiers = [{\n        name: 'applyStyles',\n        enabled: false\n      }]\n    }\n\n    return {\n      ...defaultBsPopperConfig,\n      ...execute(this._config.popperConfig, [undefined, defaultBsPopperConfig])\n    }\n  }\n\n  _selectMenuItem({ key, target }) {\n    const items = SelectorEngine.find(SELECTOR_VISIBLE_ITEMS, this._menu).filter(element => isVisible(element))\n\n    if (!items.length) {\n      return\n    }\n\n    // if target isn't included in items (e.g. when expanding the dropdown)\n    // allow cycling to get the last item in case key equals ARROW_UP_KEY\n    getNextActiveElement(items, target, key === ARROW_DOWN_KEY, !items.includes(target)).focus()\n  }\n\n  // Static\n  static jQueryInterface(config) {\n    return this.each(function () {\n      const data = Dropdown.getOrCreateInstance(this, config)\n\n      if (typeof config !== 'string') {\n        return\n      }\n\n      if (typeof data[config] === 'undefined') {\n        throw new TypeError(`No method named \"${config}\"`)\n      }\n\n      data[config]()\n    })\n  }\n\n  static clearMenus(event) {\n    if (event.button === RIGHT_MOUSE_BUTTON || (event.type === 'keyup' && event.key !== TAB_KEY)) {\n      return\n    }\n\n    const openToggles = SelectorEngine.find(SELECTOR_DATA_TOGGLE_SHOWN)\n\n    for (const toggle of openToggles) {\n      const context = Dropdown.getInstance(toggle)\n      if (!context || context._config.autoClose === false) {\n        continue\n      }\n\n      const composedPath = event.composedPath()\n      const isMenuTarget = composedPath.includes(context._menu)\n      if (\n        composedPath.includes(context._element) ||\n        (context._config.autoClose === 'inside' && !isMenuTarget) ||\n        (context._config.autoClose === 'outside' && isMenuTarget)\n      ) {\n        continue\n      }\n\n      // Tab navigation through the dropdown menu or events from contained inputs shouldn't close the menu\n      if (context._menu.contains(event.target) && ((event.type === 'keyup' && event.key === TAB_KEY) || /input|select|option|textarea|form/i.test(event.target.tagName))) {\n        continue\n      }\n\n      const relatedTarget = { relatedTarget: context._element }\n\n      if (event.type === 'click') {\n        relatedTarget.clickEvent = event\n      }\n\n      context._completeHide(relatedTarget)\n    }\n  }\n\n  static dataApiKeydownHandler(event) {\n    // If not an UP | DOWN | ESCAPE key => not a dropdown command\n    // If input/textarea && if key is other than ESCAPE => not a dropdown command\n\n    const isInput = /input|textarea/i.test(event.target.tagName)\n    const isEscapeEvent = event.key === ESCAPE_KEY\n    const isUpOrDownEvent = [ARROW_UP_KEY, ARROW_DOWN_KEY].includes(event.key)\n\n    if (!isUpOrDownEvent && !isEscapeEvent) {\n      return\n    }\n\n    if (isInput && !isEscapeEvent) {\n      return\n    }\n\n    event.preventDefault()\n\n    // TODO: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.3/forms/input-group/\n    const getToggleButton = this.matches(SELECTOR_DATA_TOGGLE) ?\n      this :\n      (SelectorEngine.prev(this, SELECTOR_DATA_TOGGLE)[0] ||\n        SelectorEngine.next(this, SELECTOR_DATA_TOGGLE)[0] ||\n        SelectorEngine.findOne(SELECTOR_DATA_TOGGLE, event.delegateTarget.parentNode))\n\n    const instance = Dropdown.getOrCreateInstance(getToggleButton)\n\n    if (isUpOrDownEvent) {\n      event.stopPropagation()\n      instance.show()\n      instance._selectMenuItem(event)\n      return\n    }\n\n    if (instance._isShown()) { // else is escape and we check if it is shown\n      event.stopPropagation()\n      instance.hide()\n      getToggleButton.focus()\n    }\n  }\n}\n\n/**\n * Data API implementation\n */\n\nEventHandler.on(document, EVENT_KEYDOWN_DATA_API, SELECTOR_DATA_TOGGLE, Dropdown.dataApiKeydownHandler)\nEventHandler.on(document, EVENT_KEYDOWN_DATA_API, SELECTOR_MENU, Dropdown.dataApiKeydownHandler)\nEventHandler.on(document, EVENT_CLICK_DATA_API, Dropdown.clearMenus)\nEventHandler.on(document, EVENT_KEYUP_DATA_API, Dropdown.clearMenus)\nEventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {\n  event.preventDefault()\n  Dropdown.getOrCreateInstance(this).toggle()\n})\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Dropdown)\n\nexport default Dropdown\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap util/backdrop.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport EventHandler from '../dom/event-handler.js'\nimport Config from './config.js'\nimport {\n  execute, executeAfterTransition, getElement, reflow\n} from './index.js'\n\n/**\n * Constants\n */\n\nconst NAME = 'backdrop'\nconst CLASS_NAME_FADE = 'fade'\nconst CLASS_NAME_SHOW = 'show'\nconst EVENT_MOUSEDOWN = `mousedown.bs.${NAME}`\n\nconst Default = {\n  className: 'modal-backdrop',\n  clickCallback: null,\n  isAnimated: false,\n  isVisible: true, // if false, we use the backdrop helper without adding any element to the dom\n  rootElement: 'body' // give the choice to place backdrop under different elements\n}\n\nconst DefaultType = {\n  className: 'string',\n  clickCallback: '(function|null)',\n  isAnimated: 'boolean',\n  isVisible: 'boolean',\n  rootElement: '(element|string)'\n}\n\n/**\n * Class definition\n */\n\nclass Backdrop extends Config {\n  constructor(config) {\n    super()\n    this._config = this._getConfig(config)\n    this._isAppended = false\n    this._element = null\n  }\n\n  // Getters\n  static get Default() {\n    return Default\n  }\n\n  static get DefaultType() {\n    return DefaultType\n  }\n\n  static get NAME() {\n    return NAME\n  }\n\n  // Public\n  show(callback) {\n    if (!this._config.isVisible) {\n      execute(callback)\n      return\n    }\n\n    this._append()\n\n    const element = this._getElement()\n    if (this._config.isAnimated) {\n      reflow(element)\n    }\n\n    element.classList.add(CLASS_NAME_SHOW)\n\n    this._emulateAnimation(() => {\n      execute(callback)\n    })\n  }\n\n  hide(callback) {\n    if (!this._config.isVisible) {\n      execute(callback)\n      return\n    }\n\n    this._getElement().classList.remove(CLASS_NAME_SHOW)\n\n    this._emulateAnimation(() => {\n      this.dispose()\n      execute(callback)\n    })\n  }\n\n  dispose() {\n    if (!this._isAppended) {\n      return\n    }\n\n    EventHandler.off(this._element, EVENT_MOUSEDOWN)\n\n    this._element.remove()\n    this._isAppended = false\n  }\n\n  // Private\n  _getElement() {\n    if (!this._element) {\n      const backdrop = document.createElement('div')\n      backdrop.className = this._config.className\n      if (this._config.isAnimated) {\n        backdrop.classList.add(CLASS_NAME_FADE)\n      }\n\n      this._element = backdrop\n    }\n\n    return this._element\n  }\n\n  _configAfterMerge(config) {\n    // use getElement() with the default \"body\" to get a fresh Element on each instantiation\n    config.rootElement = getElement(config.rootElement)\n    return config\n  }\n\n  _append() {\n    if (this._isAppended) {\n      return\n    }\n\n    const element = this._getElement()\n    this._config.rootElement.append(element)\n\n    EventHandler.on(element, EVENT_MOUSEDOWN, () => {\n      execute(this._config.clickCallback)\n    })\n\n    this._isAppended = true\n  }\n\n  _emulateAnimation(callback) {\n    executeAfterTransition(callback, this._getElement(), this._config.isAnimated)\n  }\n}\n\nexport default Backdrop\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap util/focustrap.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport EventHandler from '../dom/event-handler.js'\nimport SelectorEngine from '../dom/selector-engine.js'\nimport Config from './config.js'\n\n/**\n * Constants\n */\n\nconst NAME = 'focustrap'\nconst DATA_KEY = 'bs.focustrap'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst EVENT_FOCUSIN = `focusin${EVENT_KEY}`\nconst EVENT_KEYDOWN_TAB = `keydown.tab${EVENT_KEY}`\n\nconst TAB_KEY = 'Tab'\nconst TAB_NAV_FORWARD = 'forward'\nconst TAB_NAV_BACKWARD = 'backward'\n\nconst Default = {\n  autofocus: true,\n  trapElement: null // The element to trap focus inside of\n}\n\nconst DefaultType = {\n  autofocus: 'boolean',\n  trapElement: 'element'\n}\n\n/**\n * Class definition\n */\n\nclass FocusTrap extends Config {\n  constructor(config) {\n    super()\n    this._config = this._getConfig(config)\n    this._isActive = false\n    this._lastTabNavDirection = null\n  }\n\n  // Getters\n  static get Default() {\n    return Default\n  }\n\n  static get DefaultType() {\n    return DefaultType\n  }\n\n  static get NAME() {\n    return NAME\n  }\n\n  // Public\n  activate() {\n    if (this._isActive) {\n      return\n    }\n\n    if (this._config.autofocus) {\n      this._config.trapElement.focus()\n    }\n\n    EventHandler.off(document, EVENT_KEY) // guard against infinite focus loop\n    EventHandler.on(document, EVENT_FOCUSIN, event => this._handleFocusin(event))\n    EventHandler.on(document, EVENT_KEYDOWN_TAB, event => this._handleKeydown(event))\n\n    this._isActive = true\n  }\n\n  deactivate() {\n    if (!this._isActive) {\n      return\n    }\n\n    this._isActive = false\n    EventHandler.off(document, EVENT_KEY)\n  }\n\n  // Private\n  _handleFocusin(event) {\n    const { trapElement } = this._config\n\n    if (event.target === document || event.target === trapElement || trapElement.contains(event.target)) {\n      return\n    }\n\n    const elements = SelectorEngine.focusableChildren(trapElement)\n\n    if (elements.length === 0) {\n      trapElement.focus()\n    } else if (this._lastTabNavDirection === TAB_NAV_BACKWARD) {\n      elements[elements.length - 1].focus()\n    } else {\n      elements[0].focus()\n    }\n  }\n\n  _handleKeydown(event) {\n    if (event.key !== TAB_KEY) {\n      return\n    }\n\n    this._lastTabNavDirection = event.shiftKey ? TAB_NAV_BACKWARD : TAB_NAV_FORWARD\n  }\n}\n\nexport default FocusTrap\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap util/scrollBar.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport Manipulator from '../dom/manipulator.js'\nimport SelectorEngine from '../dom/selector-engine.js'\nimport { isElement } from './index.js'\n\n/**\n * Constants\n */\n\nconst SELECTOR_FIXED_CONTENT = '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top'\nconst SELECTOR_STICKY_CONTENT = '.sticky-top'\nconst PROPERTY_PADDING = 'padding-right'\nconst PROPERTY_MARGIN = 'margin-right'\n\n/**\n * Class definition\n */\n\nclass ScrollBarHelper {\n  constructor() {\n    this._element = document.body\n  }\n\n  // Public\n  getWidth() {\n    // https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth#usage_notes\n    const documentWidth = document.documentElement.clientWidth\n    return Math.abs(window.innerWidth - documentWidth)\n  }\n\n  hide() {\n    const width = this.getWidth()\n    this._disableOverFlow()\n    // give padding to element to balance the hidden scrollbar width\n    this._setElementAttributes(this._element, PROPERTY_PADDING, calculatedValue => calculatedValue + width)\n    // trick: We adjust positive paddingRight and negative marginRight to sticky-top elements to keep showing fullwidth\n    this._setElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING, calculatedValue => calculatedValue + width)\n    this._setElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN, calculatedValue => calculatedValue - width)\n  }\n\n  reset() {\n    this._resetElementAttributes(this._element, 'overflow')\n    this._resetElementAttributes(this._element, PROPERTY_PADDING)\n    this._resetElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING)\n    this._resetElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN)\n  }\n\n  isOverflowing() {\n    return this.getWidth() > 0\n  }\n\n  // Private\n  _disableOverFlow() {\n    this._saveInitialAttribute(this._element, 'overflow')\n    this._element.style.overflow = 'hidden'\n  }\n\n  _setElementAttributes(selector, styleProperty, callback) {\n    const scrollbarWidth = this.getWidth()\n    const manipulationCallBack = element => {\n      if (element !== this._element && window.innerWidth > element.clientWidth + scrollbarWidth) {\n        return\n      }\n\n      this._saveInitialAttribute(element, styleProperty)\n      const calculatedValue = window.getComputedStyle(element).getPropertyValue(styleProperty)\n      element.style.setProperty(styleProperty, `${callback(Number.parseFloat(calculatedValue))}px`)\n    }\n\n    this._applyManipulationCallback(selector, manipulationCallBack)\n  }\n\n  _saveInitialAttribute(element, styleProperty) {\n    const actualValue = element.style.getPropertyValue(styleProperty)\n    if (actualValue) {\n      Manipulator.setDataAttribute(element, styleProperty, actualValue)\n    }\n  }\n\n  _resetElementAttributes(selector, styleProperty) {\n    const manipulationCallBack = element => {\n      const value = Manipulator.getDataAttribute(element, styleProperty)\n      // We only want to remove the property if the value is `null`; the value can also be zero\n      if (value === null) {\n        element.style.removeProperty(styleProperty)\n        return\n      }\n\n      Manipulator.removeDataAttribute(element, styleProperty)\n      element.style.setProperty(styleProperty, value)\n    }\n\n    this._applyManipulationCallback(selector, manipulationCallBack)\n  }\n\n  _applyManipulationCallback(selector, callBack) {\n    if (isElement(selector)) {\n      callBack(selector)\n      return\n    }\n\n    for (const sel of SelectorEngine.find(selector, this._element)) {\n      callBack(sel)\n    }\n  }\n}\n\nexport default ScrollBarHelper\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap modal.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport BaseComponent from './base-component.js'\nimport EventHandler from './dom/event-handler.js'\nimport SelectorEngine from './dom/selector-engine.js'\nimport Backdrop from './util/backdrop.js'\nimport { enableDismissTrigger } from './util/component-functions.js'\nimport FocusTrap from './util/focustrap.js'\nimport {\n  defineJQueryPlugin, isRTL, isVisible, reflow\n} from './util/index.js'\nimport ScrollBarHelper from './util/scrollbar.js'\n\n/**\n * Constants\n */\n\nconst NAME = 'modal'\nconst DATA_KEY = 'bs.modal'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst DATA_API_KEY = '.data-api'\nconst ESCAPE_KEY = 'Escape'\n\nconst EVENT_HIDE = `hide${EVENT_KEY}`\nconst EVENT_HIDE_PREVENTED = `hidePrevented${EVENT_KEY}`\nconst EVENT_HIDDEN = `hidden${EVENT_KEY}`\nconst EVENT_SHOW = `show${EVENT_KEY}`\nconst EVENT_SHOWN = `shown${EVENT_KEY}`\nconst EVENT_RESIZE = `resize${EVENT_KEY}`\nconst EVENT_CLICK_DISMISS = `click.dismiss${EVENT_KEY}`\nconst EVENT_MOUSEDOWN_DISMISS = `mousedown.dismiss${EVENT_KEY}`\nconst EVENT_KEYDOWN_DISMISS = `keydown.dismiss${EVENT_KEY}`\nconst EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`\n\nconst CLASS_NAME_OPEN = 'modal-open'\nconst CLASS_NAME_FADE = 'fade'\nconst CLASS_NAME_SHOW = 'show'\nconst CLASS_NAME_STATIC = 'modal-static'\n\nconst OPEN_SELECTOR = '.modal.show'\nconst SELECTOR_DIALOG = '.modal-dialog'\nconst SELECTOR_MODAL_BODY = '.modal-body'\nconst SELECTOR_DATA_TOGGLE = '[data-bs-toggle=\"modal\"]'\n\nconst Default = {\n  backdrop: true,\n  focus: true,\n  keyboard: true\n}\n\nconst DefaultType = {\n  backdrop: '(boolean|string)',\n  focus: 'boolean',\n  keyboard: 'boolean'\n}\n\n/**\n * Class definition\n */\n\nclass Modal extends BaseComponent {\n  constructor(element, config) {\n    super(element, config)\n\n    this._dialog = SelectorEngine.findOne(SELECTOR_DIALOG, this._element)\n    this._backdrop = this._initializeBackDrop()\n    this._focustrap = this._initializeFocusTrap()\n    this._isShown = false\n    this._isTransitioning = false\n    this._scrollBar = new ScrollBarHelper()\n\n    this._addEventListeners()\n  }\n\n  // Getters\n  static get Default() {\n    return Default\n  }\n\n  static get DefaultType() {\n    return DefaultType\n  }\n\n  static get NAME() {\n    return NAME\n  }\n\n  // Public\n  toggle(relatedTarget) {\n    return this._isShown ? this.hide() : this.show(relatedTarget)\n  }\n\n  show(relatedTarget) {\n    if (this._isShown || this._isTransitioning) {\n      return\n    }\n\n    const showEvent = EventHandler.trigger(this._element, EVENT_SHOW, {\n      relatedTarget\n    })\n\n    if (showEvent.defaultPrevented) {\n      return\n    }\n\n    this._isShown = true\n    this._isTransitioning = true\n\n    this._scrollBar.hide()\n\n    document.body.classList.add(CLASS_NAME_OPEN)\n\n    this._adjustDialog()\n\n    this._backdrop.show(() => this._showElement(relatedTarget))\n  }\n\n  hide() {\n    if (!this._isShown || this._isTransitioning) {\n      return\n    }\n\n    const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE)\n\n    if (hideEvent.defaultPrevented) {\n      return\n    }\n\n    this._isShown = false\n    this._isTransitioning = true\n    this._focustrap.deactivate()\n\n    this._element.classList.remove(CLASS_NAME_SHOW)\n\n    this._queueCallback(() => this._hideModal(), this._element, this._isAnimated())\n  }\n\n  dispose() {\n    EventHandler.off(window, EVENT_KEY)\n    EventHandler.off(this._dialog, EVENT_KEY)\n\n    this._backdrop.dispose()\n    this._focustrap.deactivate()\n\n    super.dispose()\n  }\n\n  handleUpdate() {\n    this._adjustDialog()\n  }\n\n  // Private\n  _initializeBackDrop() {\n    return new Backdrop({\n      isVisible: Boolean(this._config.backdrop), // 'static' option will be translated to true, and booleans will keep their value,\n      isAnimated: this._isAnimated()\n    })\n  }\n\n  _initializeFocusTrap() {\n    return new FocusTrap({\n      trapElement: this._element\n    })\n  }\n\n  _showElement(relatedTarget) {\n    // try to append dynamic modal\n    if (!document.body.contains(this._element)) {\n      document.body.append(this._element)\n    }\n\n    this._element.style.display = 'block'\n    this._element.removeAttribute('aria-hidden')\n    this._element.setAttribute('aria-modal', true)\n    this._element.setAttribute('role', 'dialog')\n    this._element.scrollTop = 0\n\n    const modalBody = SelectorEngine.findOne(SELECTOR_MODAL_BODY, this._dialog)\n    if (modalBody) {\n      modalBody.scrollTop = 0\n    }\n\n    reflow(this._element)\n\n    this._element.classList.add(CLASS_NAME_SHOW)\n\n    const transitionComplete = () => {\n      if (this._config.focus) {\n        this._focustrap.activate()\n      }\n\n      this._isTransitioning = false\n      EventHandler.trigger(this._element, EVENT_SHOWN, {\n        relatedTarget\n      })\n    }\n\n    this._queueCallback(transitionComplete, this._dialog, this._isAnimated())\n  }\n\n  _addEventListeners() {\n    EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS, event => {\n      if (event.key !== ESCAPE_KEY) {\n        return\n      }\n\n      if (this._config.keyboard) {\n        this.hide()\n        return\n      }\n\n      this._triggerBackdropTransition()\n    })\n\n    EventHandler.on(window, EVENT_RESIZE, () => {\n      if (this._isShown && !this._isTransitioning) {\n        this._adjustDialog()\n      }\n    })\n\n    EventHandler.on(this._element, EVENT_MOUSEDOWN_DISMISS, event => {\n      // a bad trick to segregate clicks that may start inside dialog but end outside, and avoid listen to scrollbar clicks\n      EventHandler.one(this._element, EVENT_CLICK_DISMISS, event2 => {\n        if (this._element !== event.target || this._element !== event2.target) {\n          return\n        }\n\n        if (this._config.backdrop === 'static') {\n          this._triggerBackdropTransition()\n          return\n        }\n\n        if (this._config.backdrop) {\n          this.hide()\n        }\n      })\n    })\n  }\n\n  _hideModal() {\n    this._element.style.display = 'none'\n    this._element.setAttribute('aria-hidden', true)\n    this._element.removeAttribute('aria-modal')\n    this._element.removeAttribute('role')\n    this._isTransitioning = false\n\n    this._backdrop.hide(() => {\n      document.body.classList.remove(CLASS_NAME_OPEN)\n      this._resetAdjustments()\n      this._scrollBar.reset()\n      EventHandler.trigger(this._element, EVENT_HIDDEN)\n    })\n  }\n\n  _isAnimated() {\n    return this._element.classList.contains(CLASS_NAME_FADE)\n  }\n\n  _triggerBackdropTransition() {\n    const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED)\n    if (hideEvent.defaultPrevented) {\n      return\n    }\n\n    const isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight\n    const initialOverflowY = this._element.style.overflowY\n    // return if the following background transition hasn't yet completed\n    if (initialOverflowY === 'hidden' || this._element.classList.contains(CLASS_NAME_STATIC)) {\n      return\n    }\n\n    if (!isModalOverflowing) {\n      this._element.style.overflowY = 'hidden'\n    }\n\n    this._element.classList.add(CLASS_NAME_STATIC)\n    this._queueCallback(() => {\n      this._element.classList.remove(CLASS_NAME_STATIC)\n      this._queueCallback(() => {\n        this._element.style.overflowY = initialOverflowY\n      }, this._dialog)\n    }, this._dialog)\n\n    this._element.focus()\n  }\n\n  /**\n   * The following methods are used to handle overflowing modals\n   */\n\n  _adjustDialog() {\n    const isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight\n    const scrollbarWidth = this._scrollBar.getWidth()\n    const isBodyOverflowing = scrollbarWidth > 0\n\n    if (isBodyOverflowing && !isModalOverflowing) {\n      const property = isRTL() ? 'paddingLeft' : 'paddingRight'\n      this._element.style[property] = `${scrollbarWidth}px`\n    }\n\n    if (!isBodyOverflowing && isModalOverflowing) {\n      const property = isRTL() ? 'paddingRight' : 'paddingLeft'\n      this._element.style[property] = `${scrollbarWidth}px`\n    }\n  }\n\n  _resetAdjustments() {\n    this._element.style.paddingLeft = ''\n    this._element.style.paddingRight = ''\n  }\n\n  // Static\n  static jQueryInterface(config, relatedTarget) {\n    return this.each(function () {\n      const data = Modal.getOrCreateInstance(this, config)\n\n      if (typeof config !== 'string') {\n        return\n      }\n\n      if (typeof data[config] === 'undefined') {\n        throw new TypeError(`No method named \"${config}\"`)\n      }\n\n      data[config](relatedTarget)\n    })\n  }\n}\n\n/**\n * Data API implementation\n */\n\nEventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {\n  const target = SelectorEngine.getElementFromSelector(this)\n\n  if (['A', 'AREA'].includes(this.tagName)) {\n    event.preventDefault()\n  }\n\n  EventHandler.one(target, EVENT_SHOW, showEvent => {\n    if (showEvent.defaultPrevented) {\n      // only register focus restorer if modal will actually get shown\n      return\n    }\n\n    EventHandler.one(target, EVENT_HIDDEN, () => {\n      if (isVisible(this)) {\n        this.focus()\n      }\n    })\n  })\n\n  // avoid conflict when clicking modal toggler while another one is open\n  const alreadyOpen = SelectorEngine.findOne(OPEN_SELECTOR)\n  if (alreadyOpen) {\n    Modal.getInstance(alreadyOpen).hide()\n  }\n\n  const data = Modal.getOrCreateInstance(target)\n\n  data.toggle(this)\n})\n\nenableDismissTrigger(Modal)\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Modal)\n\nexport default Modal\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap offcanvas.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport BaseComponent from './base-component.js'\nimport EventHandler from './dom/event-handler.js'\nimport SelectorEngine from './dom/selector-engine.js'\nimport Backdrop from './util/backdrop.js'\nimport { enableDismissTrigger } from './util/component-functions.js'\nimport FocusTrap from './util/focustrap.js'\nimport {\n  defineJQueryPlugin,\n  isDisabled,\n  isVisible\n} from './util/index.js'\nimport ScrollBarHelper from './util/scrollbar.js'\n\n/**\n * Constants\n */\n\nconst NAME = 'offcanvas'\nconst DATA_KEY = 'bs.offcanvas'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst DATA_API_KEY = '.data-api'\nconst EVENT_LOAD_DATA_API = `load${EVENT_KEY}${DATA_API_KEY}`\nconst ESCAPE_KEY = 'Escape'\n\nconst CLASS_NAME_SHOW = 'show'\nconst CLASS_NAME_SHOWING = 'showing'\nconst CLASS_NAME_HIDING = 'hiding'\nconst CLASS_NAME_BACKDROP = 'offcanvas-backdrop'\nconst OPEN_SELECTOR = '.offcanvas.show'\n\nconst EVENT_SHOW = `show${EVENT_KEY}`\nconst EVENT_SHOWN = `shown${EVENT_KEY}`\nconst EVENT_HIDE = `hide${EVENT_KEY}`\nconst EVENT_HIDE_PREVENTED = `hidePrevented${EVENT_KEY}`\nconst EVENT_HIDDEN = `hidden${EVENT_KEY}`\nconst EVENT_RESIZE = `resize${EVENT_KEY}`\nconst EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`\nconst EVENT_KEYDOWN_DISMISS = `keydown.dismiss${EVENT_KEY}`\n\nconst SELECTOR_DATA_TOGGLE = '[data-bs-toggle=\"offcanvas\"]'\n\nconst Default = {\n  backdrop: true,\n  keyboard: true,\n  scroll: false\n}\n\nconst DefaultType = {\n  backdrop: '(boolean|string)',\n  keyboard: 'boolean',\n  scroll: 'boolean'\n}\n\n/**\n * Class definition\n */\n\nclass Offcanvas extends BaseComponent {\n  constructor(element, config) {\n    super(element, config)\n\n    this._isShown = false\n    this._backdrop = this._initializeBackDrop()\n    this._focustrap = this._initializeFocusTrap()\n    this._addEventListeners()\n  }\n\n  // Getters\n  static get Default() {\n    return Default\n  }\n\n  static get DefaultType() {\n    return DefaultType\n  }\n\n  static get NAME() {\n    return NAME\n  }\n\n  // Public\n  toggle(relatedTarget) {\n    return this._isShown ? this.hide() : this.show(relatedTarget)\n  }\n\n  show(relatedTarget) {\n    if (this._isShown) {\n      return\n    }\n\n    const showEvent = EventHandler.trigger(this._element, EVENT_SHOW, { relatedTarget })\n\n    if (showEvent.defaultPrevented) {\n      return\n    }\n\n    this._isShown = true\n    this._backdrop.show()\n\n    if (!this._config.scroll) {\n      new ScrollBarHelper().hide()\n    }\n\n    this._element.setAttribute('aria-modal', true)\n    this._element.setAttribute('role', 'dialog')\n    this._element.classList.add(CLASS_NAME_SHOWING)\n\n    const completeCallBack = () => {\n      if (!this._config.scroll || this._config.backdrop) {\n        this._focustrap.activate()\n      }\n\n      this._element.classList.add(CLASS_NAME_SHOW)\n      this._element.classList.remove(CLASS_NAME_SHOWING)\n      EventHandler.trigger(this._element, EVENT_SHOWN, { relatedTarget })\n    }\n\n    this._queueCallback(completeCallBack, this._element, true)\n  }\n\n  hide() {\n    if (!this._isShown) {\n      return\n    }\n\n    const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE)\n\n    if (hideEvent.defaultPrevented) {\n      return\n    }\n\n    this._focustrap.deactivate()\n    this._element.blur()\n    this._isShown = false\n    this._element.classList.add(CLASS_NAME_HIDING)\n    this._backdrop.hide()\n\n    const completeCallback = () => {\n      this._element.classList.remove(CLASS_NAME_SHOW, CLASS_NAME_HIDING)\n      this._element.removeAttribute('aria-modal')\n      this._element.removeAttribute('role')\n\n      if (!this._config.scroll) {\n        new ScrollBarHelper().reset()\n      }\n\n      EventHandler.trigger(this._element, EVENT_HIDDEN)\n    }\n\n    this._queueCallback(completeCallback, this._element, true)\n  }\n\n  dispose() {\n    this._backdrop.dispose()\n    this._focustrap.deactivate()\n    super.dispose()\n  }\n\n  // Private\n  _initializeBackDrop() {\n    const clickCallback = () => {\n      if (this._config.backdrop === 'static') {\n        EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED)\n        return\n      }\n\n      this.hide()\n    }\n\n    // 'static' option will be translated to true, and booleans will keep their value\n    const isVisible = Boolean(this._config.backdrop)\n\n    return new Backdrop({\n      className: CLASS_NAME_BACKDROP,\n      isVisible,\n      isAnimated: true,\n      rootElement: this._element.parentNode,\n      clickCallback: isVisible ? clickCallback : null\n    })\n  }\n\n  _initializeFocusTrap() {\n    return new FocusTrap({\n      trapElement: this._element\n    })\n  }\n\n  _addEventListeners() {\n    EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS, event => {\n      if (event.key !== ESCAPE_KEY) {\n        return\n      }\n\n      if (this._config.keyboard) {\n        this.hide()\n        return\n      }\n\n      EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED)\n    })\n  }\n\n  // Static\n  static jQueryInterface(config) {\n    return this.each(function () {\n      const data = Offcanvas.getOrCreateInstance(this, config)\n\n      if (typeof config !== 'string') {\n        return\n      }\n\n      if (data[config] === undefined || config.startsWith('_') || config === 'constructor') {\n        throw new TypeError(`No method named \"${config}\"`)\n      }\n\n      data[config](this)\n    })\n  }\n}\n\n/**\n * Data API implementation\n */\n\nEventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {\n  const target = SelectorEngine.getElementFromSelector(this)\n\n  if (['A', 'AREA'].includes(this.tagName)) {\n    event.preventDefault()\n  }\n\n  if (isDisabled(this)) {\n    return\n  }\n\n  EventHandler.one(target, EVENT_HIDDEN, () => {\n    // focus on trigger when it is closed\n    if (isVisible(this)) {\n      this.focus()\n    }\n  })\n\n  // avoid conflict when clicking a toggler of an offcanvas, while another is open\n  const alreadyOpen = SelectorEngine.findOne(OPEN_SELECTOR)\n  if (alreadyOpen && alreadyOpen !== target) {\n    Offcanvas.getInstance(alreadyOpen).hide()\n  }\n\n  const data = Offcanvas.getOrCreateInstance(target)\n  data.toggle(this)\n})\n\nEventHandler.on(window, EVENT_LOAD_DATA_API, () => {\n  for (const selector of SelectorEngine.find(OPEN_SELECTOR)) {\n    Offcanvas.getOrCreateInstance(selector).show()\n  }\n})\n\nEventHandler.on(window, EVENT_RESIZE, () => {\n  for (const element of SelectorEngine.find('[aria-modal][class*=show][class*=offcanvas-]')) {\n    if (getComputedStyle(element).position !== 'fixed') {\n      Offcanvas.getOrCreateInstance(element).hide()\n    }\n  }\n})\n\nenableDismissTrigger(Offcanvas)\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Offcanvas)\n\nexport default Offcanvas\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap util/sanitizer.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n// js-docs-start allow-list\nconst ARIA_ATTRIBUTE_PATTERN = /^aria-[\\w-]*$/i\n\nexport const DefaultAllowlist = {\n  // Global attributes allowed on any supplied element below.\n  '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN],\n  a: ['target', 'href', 'title', 'rel'],\n  area: [],\n  b: [],\n  br: [],\n  col: [],\n  code: [],\n  dd: [],\n  div: [],\n  dl: [],\n  dt: [],\n  em: [],\n  hr: [],\n  h1: [],\n  h2: [],\n  h3: [],\n  h4: [],\n  h5: [],\n  h6: [],\n  i: [],\n  img: ['src', 'srcset', 'alt', 'title', 'width', 'height'],\n  li: [],\n  ol: [],\n  p: [],\n  pre: [],\n  s: [],\n  small: [],\n  span: [],\n  sub: [],\n  sup: [],\n  strong: [],\n  u: [],\n  ul: []\n}\n// js-docs-end allow-list\n\nconst uriAttributes = new Set([\n  'background',\n  'cite',\n  'href',\n  'itemtype',\n  'longdesc',\n  'poster',\n  'src',\n  'xlink:href'\n])\n\n/**\n * A pattern that recognizes URLs that are safe wrt. XSS in URL navigation\n * contexts.\n *\n * Shout-out to Angular https://github.com/angular/angular/blob/15.2.8/packages/core/src/sanitization/url_sanitizer.ts#L38\n */\nconst SAFE_URL_PATTERN = /^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i\n\nconst allowedAttribute = (attribute, allowedAttributeList) => {\n  const attributeName = attribute.nodeName.toLowerCase()\n\n  if (allowedAttributeList.includes(attributeName)) {\n    if (uriAttributes.has(attributeName)) {\n      return Boolean(SAFE_URL_PATTERN.test(attribute.nodeValue))\n    }\n\n    return true\n  }\n\n  // Check if a regular expression validates the attribute.\n  return allowedAttributeList.filter(attributeRegex => attributeRegex instanceof RegExp)\n    .some(regex => regex.test(attributeName))\n}\n\nexport function sanitizeHtml(unsafeHtml, allowList, sanitizeFunction) {\n  if (!unsafeHtml.length) {\n    return unsafeHtml\n  }\n\n  if (sanitizeFunction && typeof sanitizeFunction === 'function') {\n    return sanitizeFunction(unsafeHtml)\n  }\n\n  const domParser = new window.DOMParser()\n  const createdDocument = domParser.parseFromString(unsafeHtml, 'text/html')\n  const elements = [].concat(...createdDocument.body.querySelectorAll('*'))\n\n  for (const element of elements) {\n    const elementName = element.nodeName.toLowerCase()\n\n    if (!Object.keys(allowList).includes(elementName)) {\n      element.remove()\n      continue\n    }\n\n    const attributeList = [].concat(...element.attributes)\n    const allowedAttributes = [].concat(allowList['*'] || [], allowList[elementName] || [])\n\n    for (const attribute of attributeList) {\n      if (!allowedAttribute(attribute, allowedAttributes)) {\n        element.removeAttribute(attribute.nodeName)\n      }\n    }\n  }\n\n  return createdDocument.body.innerHTML\n}\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap util/template-factory.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport SelectorEngine from '../dom/selector-engine.js'\nimport Config from './config.js'\nimport { DefaultAllowlist, sanitizeHtml } from './sanitizer.js'\nimport { execute, getElement, isElement } from './index.js'\n\n/**\n * Constants\n */\n\nconst NAME = 'TemplateFactory'\n\nconst Default = {\n  allowList: DefaultAllowlist,\n  content: {}, // { selector : text ,  selector2 : text2 , }\n  extraClass: '',\n  html: false,\n  sanitize: true,\n  sanitizeFn: null,\n  template: '<div></div>'\n}\n\nconst DefaultType = {\n  allowList: 'object',\n  content: 'object',\n  extraClass: '(string|function)',\n  html: 'boolean',\n  sanitize: 'boolean',\n  sanitizeFn: '(null|function)',\n  template: 'string'\n}\n\nconst DefaultContentType = {\n  entry: '(string|element|function|null)',\n  selector: '(string|element)'\n}\n\n/**\n * Class definition\n */\n\nclass TemplateFactory extends Config {\n  constructor(config) {\n    super()\n    this._config = this._getConfig(config)\n  }\n\n  // Getters\n  static get Default() {\n    return Default\n  }\n\n  static get DefaultType() {\n    return DefaultType\n  }\n\n  static get NAME() {\n    return NAME\n  }\n\n  // Public\n  getContent() {\n    return Object.values(this._config.content)\n      .map(config => this._resolvePossibleFunction(config))\n      .filter(Boolean)\n  }\n\n  hasContent() {\n    return this.getContent().length > 0\n  }\n\n  changeContent(content) {\n    this._checkContent(content)\n    this._config.content = { ...this._config.content, ...content }\n    return this\n  }\n\n  toHtml() {\n    const templateWrapper = document.createElement('div')\n    templateWrapper.innerHTML = this._maybeSanitize(this._config.template)\n\n    for (const [selector, text] of Object.entries(this._config.content)) {\n      this._setContent(templateWrapper, text, selector)\n    }\n\n    const template = templateWrapper.children[0]\n    const extraClass = this._resolvePossibleFunction(this._config.extraClass)\n\n    if (extraClass) {\n      template.classList.add(...extraClass.split(' '))\n    }\n\n    return template\n  }\n\n  // Private\n  _typeCheckConfig(config) {\n    super._typeCheckConfig(config)\n    this._checkContent(config.content)\n  }\n\n  _checkContent(arg) {\n    for (const [selector, content] of Object.entries(arg)) {\n      super._typeCheckConfig({ selector, entry: content }, DefaultContentType)\n    }\n  }\n\n  _setContent(template, content, selector) {\n    const templateElement = SelectorEngine.findOne(selector, template)\n\n    if (!templateElement) {\n      return\n    }\n\n    content = this._resolvePossibleFunction(content)\n\n    if (!content) {\n      templateElement.remove()\n      return\n    }\n\n    if (isElement(content)) {\n      this._putElementInTemplate(getElement(content), templateElement)\n      return\n    }\n\n    if (this._config.html) {\n      templateElement.innerHTML = this._maybeSanitize(content)\n      return\n    }\n\n    templateElement.textContent = content\n  }\n\n  _maybeSanitize(arg) {\n    return this._config.sanitize ? sanitizeHtml(arg, this._config.allowList, this._config.sanitizeFn) : arg\n  }\n\n  _resolvePossibleFunction(arg) {\n    return execute(arg, [undefined, this])\n  }\n\n  _putElementInTemplate(element, templateElement) {\n    if (this._config.html) {\n      templateElement.innerHTML = ''\n      templateElement.append(element)\n      return\n    }\n\n    templateElement.textContent = element.textContent\n  }\n}\n\nexport default TemplateFactory\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap tooltip.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport * as Popper from '@popperjs/core'\nimport BaseComponent from './base-component.js'\nimport EventHandler from './dom/event-handler.js'\nimport Manipulator from './dom/manipulator.js'\nimport {\n  defineJQueryPlugin, execute, findShadowRoot, getElement, getUID, isRTL, noop\n} from './util/index.js'\nimport { DefaultAllowlist } from './util/sanitizer.js'\nimport TemplateFactory from './util/template-factory.js'\n\n/**\n * Constants\n */\n\nconst NAME = 'tooltip'\nconst DISALLOWED_ATTRIBUTES = new Set(['sanitize', 'allowList', 'sanitizeFn'])\n\nconst CLASS_NAME_FADE = 'fade'\nconst CLASS_NAME_MODAL = 'modal'\nconst CLASS_NAME_SHOW = 'show'\n\nconst SELECTOR_TOOLTIP_INNER = '.tooltip-inner'\nconst SELECTOR_MODAL = `.${CLASS_NAME_MODAL}`\n\nconst EVENT_MODAL_HIDE = 'hide.bs.modal'\n\nconst TRIGGER_HOVER = 'hover'\nconst TRIGGER_FOCUS = 'focus'\nconst TRIGGER_CLICK = 'click'\nconst TRIGGER_MANUAL = 'manual'\n\nconst EVENT_HIDE = 'hide'\nconst EVENT_HIDDEN = 'hidden'\nconst EVENT_SHOW = 'show'\nconst EVENT_SHOWN = 'shown'\nconst EVENT_INSERTED = 'inserted'\nconst EVENT_CLICK = 'click'\nconst EVENT_FOCUSIN = 'focusin'\nconst EVENT_FOCUSOUT = 'focusout'\nconst EVENT_MOUSEENTER = 'mouseenter'\nconst EVENT_MOUSELEAVE = 'mouseleave'\n\nconst AttachmentMap = {\n  AUTO: 'auto',\n  TOP: 'top',\n  RIGHT: isRTL() ? 'left' : 'right',\n  BOTTOM: 'bottom',\n  LEFT: isRTL() ? 'right' : 'left'\n}\n\nconst Default = {\n  allowList: DefaultAllowlist,\n  animation: true,\n  boundary: 'clippingParents',\n  container: false,\n  customClass: '',\n  delay: 0,\n  fallbackPlacements: ['top', 'right', 'bottom', 'left'],\n  html: false,\n  offset: [0, 6],\n  placement: 'top',\n  popperConfig: null,\n  sanitize: true,\n  sanitizeFn: null,\n  selector: false,\n  template: '<div class=\"tooltip\" role=\"tooltip\">' +\n            '<div class=\"tooltip-arrow\"></div>' +\n            '<div class=\"tooltip-inner\"></div>' +\n            '</div>',\n  title: '',\n  trigger: 'hover focus'\n}\n\nconst DefaultType = {\n  allowList: 'object',\n  animation: 'boolean',\n  boundary: '(string|element)',\n  container: '(string|element|boolean)',\n  customClass: '(string|function)',\n  delay: '(number|object)',\n  fallbackPlacements: 'array',\n  html: 'boolean',\n  offset: '(array|string|function)',\n  placement: '(string|function)',\n  popperConfig: '(null|object|function)',\n  sanitize: 'boolean',\n  sanitizeFn: '(null|function)',\n  selector: '(string|boolean)',\n  template: 'string',\n  title: '(string|element|function)',\n  trigger: 'string'\n}\n\n/**\n * Class definition\n */\n\nclass Tooltip extends BaseComponent {\n  constructor(element, config) {\n    if (typeof Popper === 'undefined') {\n      throw new TypeError('Bootstrap\\'s tooltips require Popper (https://popper.js.org/docs/v2/)')\n    }\n\n    super(element, config)\n\n    // Private\n    this._isEnabled = true\n    this._timeout = 0\n    this._isHovered = null\n    this._activeTrigger = {}\n    this._popper = null\n    this._templateFactory = null\n    this._newContent = null\n\n    // Protected\n    this.tip = null\n\n    this._setListeners()\n\n    if (!this._config.selector) {\n      this._fixTitle()\n    }\n  }\n\n  // Getters\n  static get Default() {\n    return Default\n  }\n\n  static get DefaultType() {\n    return DefaultType\n  }\n\n  static get NAME() {\n    return NAME\n  }\n\n  // Public\n  enable() {\n    this._isEnabled = true\n  }\n\n  disable() {\n    this._isEnabled = false\n  }\n\n  toggleEnabled() {\n    this._isEnabled = !this._isEnabled\n  }\n\n  toggle() {\n    if (!this._isEnabled) {\n      return\n    }\n\n    if (this._isShown()) {\n      this._leave()\n      return\n    }\n\n    this._enter()\n  }\n\n  dispose() {\n    clearTimeout(this._timeout)\n\n    EventHandler.off(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE, this._hideModalHandler)\n\n    if (this._element.getAttribute('data-bs-original-title')) {\n      this._element.setAttribute('title', this._element.getAttribute('data-bs-original-title'))\n    }\n\n    this._disposePopper()\n    super.dispose()\n  }\n\n  show() {\n    if (this._element.style.display === 'none') {\n      throw new Error('Please use show on visible elements')\n    }\n\n    if (!(this._isWithContent() && this._isEnabled)) {\n      return\n    }\n\n    const showEvent = EventHandler.trigger(this._element, this.constructor.eventName(EVENT_SHOW))\n    const shadowRoot = findShadowRoot(this._element)\n    const isInTheDom = (shadowRoot || this._element.ownerDocument.documentElement).contains(this._element)\n\n    if (showEvent.defaultPrevented || !isInTheDom) {\n      return\n    }\n\n    // TODO: v6 remove this or make it optional\n    this._disposePopper()\n\n    const tip = this._getTipElement()\n\n    this._element.setAttribute('aria-describedby', tip.getAttribute('id'))\n\n    const { container } = this._config\n\n    if (!this._element.ownerDocument.documentElement.contains(this.tip)) {\n      container.append(tip)\n      EventHandler.trigger(this._element, this.constructor.eventName(EVENT_INSERTED))\n    }\n\n    this._popper = this._createPopper(tip)\n\n    tip.classList.add(CLASS_NAME_SHOW)\n\n    // If this is a touch-enabled device we add extra\n    // empty mouseover listeners to the body's immediate children;\n    // only needed because of broken event delegation on iOS\n    // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html\n    if ('ontouchstart' in document.documentElement) {\n      for (const element of [].concat(...document.body.children)) {\n        EventHandler.on(element, 'mouseover', noop)\n      }\n    }\n\n    const complete = () => {\n      EventHandler.trigger(this._element, this.constructor.eventName(EVENT_SHOWN))\n\n      if (this._isHovered === false) {\n        this._leave()\n      }\n\n      this._isHovered = false\n    }\n\n    this._queueCallback(complete, this.tip, this._isAnimated())\n  }\n\n  hide() {\n    if (!this._isShown()) {\n      return\n    }\n\n    const hideEvent = EventHandler.trigger(this._element, this.constructor.eventName(EVENT_HIDE))\n    if (hideEvent.defaultPrevented) {\n      return\n    }\n\n    const tip = this._getTipElement()\n    tip.classList.remove(CLASS_NAME_SHOW)\n\n    // If this is a touch-enabled device we remove the extra\n    // empty mouseover listeners we added for iOS support\n    if ('ontouchstart' in document.documentElement) {\n      for (const element of [].concat(...document.body.children)) {\n        EventHandler.off(element, 'mouseover', noop)\n      }\n    }\n\n    this._activeTrigger[TRIGGER_CLICK] = false\n    this._activeTrigger[TRIGGER_FOCUS] = false\n    this._activeTrigger[TRIGGER_HOVER] = false\n    this._isHovered = null // it is a trick to support manual triggering\n\n    const complete = () => {\n      if (this._isWithActiveTrigger()) {\n        return\n      }\n\n      if (!this._isHovered) {\n        this._disposePopper()\n      }\n\n      this._element.removeAttribute('aria-describedby')\n      EventHandler.trigger(this._element, this.constructor.eventName(EVENT_HIDDEN))\n    }\n\n    this._queueCallback(complete, this.tip, this._isAnimated())\n  }\n\n  update() {\n    if (this._popper) {\n      this._popper.update()\n    }\n  }\n\n  // Protected\n  _isWithContent() {\n    return Boolean(this._getTitle())\n  }\n\n  _getTipElement() {\n    if (!this.tip) {\n      this.tip = this._createTipElement(this._newContent || this._getContentForTemplate())\n    }\n\n    return this.tip\n  }\n\n  _createTipElement(content) {\n    const tip = this._getTemplateFactory(content).toHtml()\n\n    // TODO: remove this check in v6\n    if (!tip) {\n      return null\n    }\n\n    tip.classList.remove(CLASS_NAME_FADE, CLASS_NAME_SHOW)\n    // TODO: v6 the following can be achieved with CSS only\n    tip.classList.add(`bs-${this.constructor.NAME}-auto`)\n\n    const tipId = getUID(this.constructor.NAME).toString()\n\n    tip.setAttribute('id', tipId)\n\n    if (this._isAnimated()) {\n      tip.classList.add(CLASS_NAME_FADE)\n    }\n\n    return tip\n  }\n\n  setContent(content) {\n    this._newContent = content\n    if (this._isShown()) {\n      this._disposePopper()\n      this.show()\n    }\n  }\n\n  _getTemplateFactory(content) {\n    if (this._templateFactory) {\n      this._templateFactory.changeContent(content)\n    } else {\n      this._templateFactory = new TemplateFactory({\n        ...this._config,\n        // the `content` var has to be after `this._config`\n        // to override config.content in case of popover\n        content,\n        extraClass: this._resolvePossibleFunction(this._config.customClass)\n      })\n    }\n\n    return this._templateFactory\n  }\n\n  _getContentForTemplate() {\n    return {\n      [SELECTOR_TOOLTIP_INNER]: this._getTitle()\n    }\n  }\n\n  _getTitle() {\n    return this._resolvePossibleFunction(this._config.title) || this._element.getAttribute('data-bs-original-title')\n  }\n\n  // Private\n  _initializeOnDelegatedTarget(event) {\n    return this.constructor.getOrCreateInstance(event.delegateTarget, this._getDelegateConfig())\n  }\n\n  _isAnimated() {\n    return this._config.animation || (this.tip && this.tip.classList.contains(CLASS_NAME_FADE))\n  }\n\n  _isShown() {\n    return this.tip && this.tip.classList.contains(CLASS_NAME_SHOW)\n  }\n\n  _createPopper(tip) {\n    const placement = execute(this._config.placement, [this, tip, this._element])\n    const attachment = AttachmentMap[placement.toUpperCase()]\n    return Popper.createPopper(this._element, tip, this._getPopperConfig(attachment))\n  }\n\n  _getOffset() {\n    const { offset } = this._config\n\n    if (typeof offset === 'string') {\n      return offset.split(',').map(value => Number.parseInt(value, 10))\n    }\n\n    if (typeof offset === 'function') {\n      return popperData => offset(popperData, this._element)\n    }\n\n    return offset\n  }\n\n  _resolvePossibleFunction(arg) {\n    return execute(arg, [this._element, this._element])\n  }\n\n  _getPopperConfig(attachment) {\n    const defaultBsPopperConfig = {\n      placement: attachment,\n      modifiers: [\n        {\n          name: 'flip',\n          options: {\n            fallbackPlacements: this._config.fallbackPlacements\n          }\n        },\n        {\n          name: 'offset',\n          options: {\n            offset: this._getOffset()\n          }\n        },\n        {\n          name: 'preventOverflow',\n          options: {\n            boundary: this._config.boundary\n          }\n        },\n        {\n          name: 'arrow',\n          options: {\n            element: `.${this.constructor.NAME}-arrow`\n          }\n        },\n        {\n          name: 'preSetPlacement',\n          enabled: true,\n          phase: 'beforeMain',\n          fn: data => {\n            // Pre-set Popper's placement attribute in order to read the arrow sizes properly.\n            // Otherwise, Popper mixes up the width and height dimensions since the initial arrow style is for top placement\n            this._getTipElement().setAttribute('data-popper-placement', data.state.placement)\n          }\n        }\n      ]\n    }\n\n    return {\n      ...defaultBsPopperConfig,\n      ...execute(this._config.popperConfig, [undefined, defaultBsPopperConfig])\n    }\n  }\n\n  _setListeners() {\n    const triggers = this._config.trigger.split(' ')\n\n    for (const trigger of triggers) {\n      if (trigger === 'click') {\n        EventHandler.on(this._element, this.constructor.eventName(EVENT_CLICK), this._config.selector, event => {\n          const context = this._initializeOnDelegatedTarget(event)\n          context._activeTrigger[TRIGGER_CLICK] = !(context._isShown() && context._activeTrigger[TRIGGER_CLICK])\n          context.toggle()\n        })\n      } else if (trigger !== TRIGGER_MANUAL) {\n        const eventIn = trigger === TRIGGER_HOVER ?\n          this.constructor.eventName(EVENT_MOUSEENTER) :\n          this.constructor.eventName(EVENT_FOCUSIN)\n        const eventOut = trigger === TRIGGER_HOVER ?\n          this.constructor.eventName(EVENT_MOUSELEAVE) :\n          this.constructor.eventName(EVENT_FOCUSOUT)\n\n        EventHandler.on(this._element, eventIn, this._config.selector, event => {\n          const context = this._initializeOnDelegatedTarget(event)\n          context._activeTrigger[event.type === 'focusin' ? TRIGGER_FOCUS : TRIGGER_HOVER] = true\n          context._enter()\n        })\n        EventHandler.on(this._element, eventOut, this._config.selector, event => {\n          const context = this._initializeOnDelegatedTarget(event)\n          context._activeTrigger[event.type === 'focusout' ? TRIGGER_FOCUS : TRIGGER_HOVER] =\n            context._element.contains(event.relatedTarget)\n\n          context._leave()\n        })\n      }\n    }\n\n    this._hideModalHandler = () => {\n      if (this._element) {\n        this.hide()\n      }\n    }\n\n    EventHandler.on(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE, this._hideModalHandler)\n  }\n\n  _fixTitle() {\n    const title = this._element.getAttribute('title')\n\n    if (!title) {\n      return\n    }\n\n    if (!this._element.getAttribute('aria-label') && !this._element.textContent.trim()) {\n      this._element.setAttribute('aria-label', title)\n    }\n\n    this._element.setAttribute('data-bs-original-title', title) // DO NOT USE IT. Is only for backwards compatibility\n    this._element.removeAttribute('title')\n  }\n\n  _enter() {\n    if (this._isShown() || this._isHovered) {\n      this._isHovered = true\n      return\n    }\n\n    this._isHovered = true\n\n    this._setTimeout(() => {\n      if (this._isHovered) {\n        this.show()\n      }\n    }, this._config.delay.show)\n  }\n\n  _leave() {\n    if (this._isWithActiveTrigger()) {\n      return\n    }\n\n    this._isHovered = false\n\n    this._setTimeout(() => {\n      if (!this._isHovered) {\n        this.hide()\n      }\n    }, this._config.delay.hide)\n  }\n\n  _setTimeout(handler, timeout) {\n    clearTimeout(this._timeout)\n    this._timeout = setTimeout(handler, timeout)\n  }\n\n  _isWithActiveTrigger() {\n    return Object.values(this._activeTrigger).includes(true)\n  }\n\n  _getConfig(config) {\n    const dataAttributes = Manipulator.getDataAttributes(this._element)\n\n    for (const dataAttribute of Object.keys(dataAttributes)) {\n      if (DISALLOWED_ATTRIBUTES.has(dataAttribute)) {\n        delete dataAttributes[dataAttribute]\n      }\n    }\n\n    config = {\n      ...dataAttributes,\n      ...(typeof config === 'object' && config ? config : {})\n    }\n    config = this._mergeConfigObj(config)\n    config = this._configAfterMerge(config)\n    this._typeCheckConfig(config)\n    return config\n  }\n\n  _configAfterMerge(config) {\n    config.container = config.container === false ? document.body : getElement(config.container)\n\n    if (typeof config.delay === 'number') {\n      config.delay = {\n        show: config.delay,\n        hide: config.delay\n      }\n    }\n\n    if (typeof config.title === 'number') {\n      config.title = config.title.toString()\n    }\n\n    if (typeof config.content === 'number') {\n      config.content = config.content.toString()\n    }\n\n    return config\n  }\n\n  _getDelegateConfig() {\n    const config = {}\n\n    for (const [key, value] of Object.entries(this._config)) {\n      if (this.constructor.Default[key] !== value) {\n        config[key] = value\n      }\n    }\n\n    config.selector = false\n    config.trigger = 'manual'\n\n    // In the future can be replaced with:\n    // const keysWithDifferentValues = Object.entries(this._config).filter(entry => this.constructor.Default[entry[0]] !== this._config[entry[0]])\n    // `Object.fromEntries(keysWithDifferentValues)`\n    return config\n  }\n\n  _disposePopper() {\n    if (this._popper) {\n      this._popper.destroy()\n      this._popper = null\n    }\n\n    if (this.tip) {\n      this.tip.remove()\n      this.tip = null\n    }\n  }\n\n  // Static\n  static jQueryInterface(config) {\n    return this.each(function () {\n      const data = Tooltip.getOrCreateInstance(this, config)\n\n      if (typeof config !== 'string') {\n        return\n      }\n\n      if (typeof data[config] === 'undefined') {\n        throw new TypeError(`No method named \"${config}\"`)\n      }\n\n      data[config]()\n    })\n  }\n}\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Tooltip)\n\nexport default Tooltip\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap popover.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport Tooltip from './tooltip.js'\nimport { defineJQueryPlugin } from './util/index.js'\n\n/**\n * Constants\n */\n\nconst NAME = 'popover'\n\nconst SELECTOR_TITLE = '.popover-header'\nconst SELECTOR_CONTENT = '.popover-body'\n\nconst Default = {\n  ...Tooltip.Default,\n  content: '',\n  offset: [0, 8],\n  placement: 'right',\n  template: '<div class=\"popover\" role=\"tooltip\">' +\n    '<div class=\"popover-arrow\"></div>' +\n    '<h3 class=\"popover-header\"></h3>' +\n    '<div class=\"popover-body\"></div>' +\n    '</div>',\n  trigger: 'click'\n}\n\nconst DefaultType = {\n  ...Tooltip.DefaultType,\n  content: '(null|string|element|function)'\n}\n\n/**\n * Class definition\n */\n\nclass Popover extends Tooltip {\n  // Getters\n  static get Default() {\n    return Default\n  }\n\n  static get DefaultType() {\n    return DefaultType\n  }\n\n  static get NAME() {\n    return NAME\n  }\n\n  // Overrides\n  _isWithContent() {\n    return this._getTitle() || this._getContent()\n  }\n\n  // Private\n  _getContentForTemplate() {\n    return {\n      [SELECTOR_TITLE]: this._getTitle(),\n      [SELECTOR_CONTENT]: this._getContent()\n    }\n  }\n\n  _getContent() {\n    return this._resolvePossibleFunction(this._config.content)\n  }\n\n  // Static\n  static jQueryInterface(config) {\n    return this.each(function () {\n      const data = Popover.getOrCreateInstance(this, config)\n\n      if (typeof config !== 'string') {\n        return\n      }\n\n      if (typeof data[config] === 'undefined') {\n        throw new TypeError(`No method named \"${config}\"`)\n      }\n\n      data[config]()\n    })\n  }\n}\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Popover)\n\nexport default Popover\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap scrollspy.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport BaseComponent from './base-component.js'\nimport EventHandler from './dom/event-handler.js'\nimport SelectorEngine from './dom/selector-engine.js'\nimport {\n  defineJQueryPlugin, getElement, isDisabled, isVisible\n} from './util/index.js'\n\n/**\n * Constants\n */\n\nconst NAME = 'scrollspy'\nconst DATA_KEY = 'bs.scrollspy'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst DATA_API_KEY = '.data-api'\n\nconst EVENT_ACTIVATE = `activate${EVENT_KEY}`\nconst EVENT_CLICK = `click${EVENT_KEY}`\nconst EVENT_LOAD_DATA_API = `load${EVENT_KEY}${DATA_API_KEY}`\n\nconst CLASS_NAME_DROPDOWN_ITEM = 'dropdown-item'\nconst CLASS_NAME_ACTIVE = 'active'\n\nconst SELECTOR_DATA_SPY = '[data-bs-spy=\"scroll\"]'\nconst SELECTOR_TARGET_LINKS = '[href]'\nconst SELECTOR_NAV_LIST_GROUP = '.nav, .list-group'\nconst SELECTOR_NAV_LINKS = '.nav-link'\nconst SELECTOR_NAV_ITEMS = '.nav-item'\nconst SELECTOR_LIST_ITEMS = '.list-group-item'\nconst SELECTOR_LINK_ITEMS = `${SELECTOR_NAV_LINKS}, ${SELECTOR_NAV_ITEMS} > ${SELECTOR_NAV_LINKS}, ${SELECTOR_LIST_ITEMS}`\nconst SELECTOR_DROPDOWN = '.dropdown'\nconst SELECTOR_DROPDOWN_TOGGLE = '.dropdown-toggle'\n\nconst Default = {\n  offset: null, // TODO: v6 @deprecated, keep it for backwards compatibility reasons\n  rootMargin: '0px 0px -25%',\n  smoothScroll: false,\n  target: null,\n  threshold: [0.1, 0.5, 1]\n}\n\nconst DefaultType = {\n  offset: '(number|null)', // TODO v6 @deprecated, keep it for backwards compatibility reasons\n  rootMargin: 'string',\n  smoothScroll: 'boolean',\n  target: 'element',\n  threshold: 'array'\n}\n\n/**\n * Class definition\n */\n\nclass ScrollSpy extends BaseComponent {\n  constructor(element, config) {\n    super(element, config)\n\n    // this._element is the observablesContainer and config.target the menu links wrapper\n    this._targetLinks = new Map()\n    this._observableSections = new Map()\n    this._rootElement = getComputedStyle(this._element).overflowY === 'visible' ? null : this._element\n    this._activeTarget = null\n    this._observer = null\n    this._previousScrollData = {\n      visibleEntryTop: 0,\n      parentScrollTop: 0\n    }\n    this.refresh() // initialize\n  }\n\n  // Getters\n  static get Default() {\n    return Default\n  }\n\n  static get DefaultType() {\n    return DefaultType\n  }\n\n  static get NAME() {\n    return NAME\n  }\n\n  // Public\n  refresh() {\n    this._initializeTargetsAndObservables()\n    this._maybeEnableSmoothScroll()\n\n    if (this._observer) {\n      this._observer.disconnect()\n    } else {\n      this._observer = this._getNewObserver()\n    }\n\n    for (const section of this._observableSections.values()) {\n      this._observer.observe(section)\n    }\n  }\n\n  dispose() {\n    this._observer.disconnect()\n    super.dispose()\n  }\n\n  // Private\n  _configAfterMerge(config) {\n    // TODO: on v6 target should be given explicitly & remove the {target: 'ss-target'} case\n    config.target = getElement(config.target) || document.body\n\n    // TODO: v6 Only for backwards compatibility reasons. Use rootMargin only\n    config.rootMargin = config.offset ? `${config.offset}px 0px -30%` : config.rootMargin\n\n    if (typeof config.threshold === 'string') {\n      config.threshold = config.threshold.split(',').map(value => Number.parseFloat(value))\n    }\n\n    return config\n  }\n\n  _maybeEnableSmoothScroll() {\n    if (!this._config.smoothScroll) {\n      return\n    }\n\n    // unregister any previous listeners\n    EventHandler.off(this._config.target, EVENT_CLICK)\n\n    EventHandler.on(this._config.target, EVENT_CLICK, SELECTOR_TARGET_LINKS, event => {\n      const observableSection = this._observableSections.get(event.target.hash)\n      if (observableSection) {\n        event.preventDefault()\n        const root = this._rootElement || window\n        const height = observableSection.offsetTop - this._element.offsetTop\n        if (root.scrollTo) {\n          root.scrollTo({ top: height, behavior: 'smooth' })\n          return\n        }\n\n        // Chrome 60 doesn't support `scrollTo`\n        root.scrollTop = height\n      }\n    })\n  }\n\n  _getNewObserver() {\n    const options = {\n      root: this._rootElement,\n      threshold: this._config.threshold,\n      rootMargin: this._config.rootMargin\n    }\n\n    return new IntersectionObserver(entries => this._observerCallback(entries), options)\n  }\n\n  // The logic of selection\n  _observerCallback(entries) {\n    const targetElement = entry => this._targetLinks.get(`#${entry.target.id}`)\n    const activate = entry => {\n      this._previousScrollData.visibleEntryTop = entry.target.offsetTop\n      this._process(targetElement(entry))\n    }\n\n    const parentScrollTop = (this._rootElement || document.documentElement).scrollTop\n    const userScrollsDown = parentScrollTop >= this._previousScrollData.parentScrollTop\n    this._previousScrollData.parentScrollTop = parentScrollTop\n\n    for (const entry of entries) {\n      if (!entry.isIntersecting) {\n        this._activeTarget = null\n        this._clearActiveClass(targetElement(entry))\n\n        continue\n      }\n\n      const entryIsLowerThanPrevious = entry.target.offsetTop >= this._previousScrollData.visibleEntryTop\n      // if we are scrolling down, pick the bigger offsetTop\n      if (userScrollsDown && entryIsLowerThanPrevious) {\n        activate(entry)\n        // if parent isn't scrolled, let's keep the first visible item, breaking the iteration\n        if (!parentScrollTop) {\n          return\n        }\n\n        continue\n      }\n\n      // if we are scrolling up, pick the smallest offsetTop\n      if (!userScrollsDown && !entryIsLowerThanPrevious) {\n        activate(entry)\n      }\n    }\n  }\n\n  _initializeTargetsAndObservables() {\n    this._targetLinks = new Map()\n    this._observableSections = new Map()\n\n    const targetLinks = SelectorEngine.find(SELECTOR_TARGET_LINKS, this._config.target)\n\n    for (const anchor of targetLinks) {\n      // ensure that the anchor has an id and is not disabled\n      if (!anchor.hash || isDisabled(anchor)) {\n        continue\n      }\n\n      const observableSection = SelectorEngine.findOne(decodeURI(anchor.hash), this._element)\n\n      // ensure that the observableSection exists & is visible\n      if (isVisible(observableSection)) {\n        this._targetLinks.set(decodeURI(anchor.hash), anchor)\n        this._observableSections.set(anchor.hash, observableSection)\n      }\n    }\n  }\n\n  _process(target) {\n    if (this._activeTarget === target) {\n      return\n    }\n\n    this._clearActiveClass(this._config.target)\n    this._activeTarget = target\n    target.classList.add(CLASS_NAME_ACTIVE)\n    this._activateParents(target)\n\n    EventHandler.trigger(this._element, EVENT_ACTIVATE, { relatedTarget: target })\n  }\n\n  _activateParents(target) {\n    // Activate dropdown parents\n    if (target.classList.contains(CLASS_NAME_DROPDOWN_ITEM)) {\n      SelectorEngine.findOne(SELECTOR_DROPDOWN_TOGGLE, target.closest(SELECTOR_DROPDOWN))\n        .classList.add(CLASS_NAME_ACTIVE)\n      return\n    }\n\n    for (const listGroup of SelectorEngine.parents(target, SELECTOR_NAV_LIST_GROUP)) {\n      // Set triggered links parents as active\n      // With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor\n      for (const item of SelectorEngine.prev(listGroup, SELECTOR_LINK_ITEMS)) {\n        item.classList.add(CLASS_NAME_ACTIVE)\n      }\n    }\n  }\n\n  _clearActiveClass(parent) {\n    parent.classList.remove(CLASS_NAME_ACTIVE)\n\n    const activeNodes = SelectorEngine.find(`${SELECTOR_TARGET_LINKS}.${CLASS_NAME_ACTIVE}`, parent)\n    for (const node of activeNodes) {\n      node.classList.remove(CLASS_NAME_ACTIVE)\n    }\n  }\n\n  // Static\n  static jQueryInterface(config) {\n    return this.each(function () {\n      const data = ScrollSpy.getOrCreateInstance(this, config)\n\n      if (typeof config !== 'string') {\n        return\n      }\n\n      if (data[config] === undefined || config.startsWith('_') || config === 'constructor') {\n        throw new TypeError(`No method named \"${config}\"`)\n      }\n\n      data[config]()\n    })\n  }\n}\n\n/**\n * Data API implementation\n */\n\nEventHandler.on(window, EVENT_LOAD_DATA_API, () => {\n  for (const spy of SelectorEngine.find(SELECTOR_DATA_SPY)) {\n    ScrollSpy.getOrCreateInstance(spy)\n  }\n})\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(ScrollSpy)\n\nexport default ScrollSpy\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap tab.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport BaseComponent from './base-component.js'\nimport EventHandler from './dom/event-handler.js'\nimport SelectorEngine from './dom/selector-engine.js'\nimport { defineJQueryPlugin, getNextActiveElement, isDisabled } from './util/index.js'\n\n/**\n * Constants\n */\n\nconst NAME = 'tab'\nconst DATA_KEY = 'bs.tab'\nconst EVENT_KEY = `.${DATA_KEY}`\n\nconst EVENT_HIDE = `hide${EVENT_KEY}`\nconst EVENT_HIDDEN = `hidden${EVENT_KEY}`\nconst EVENT_SHOW = `show${EVENT_KEY}`\nconst EVENT_SHOWN = `shown${EVENT_KEY}`\nconst EVENT_CLICK_DATA_API = `click${EVENT_KEY}`\nconst EVENT_KEYDOWN = `keydown${EVENT_KEY}`\nconst EVENT_LOAD_DATA_API = `load${EVENT_KEY}`\n\nconst ARROW_LEFT_KEY = 'ArrowLeft'\nconst ARROW_RIGHT_KEY = 'ArrowRight'\nconst ARROW_UP_KEY = 'ArrowUp'\nconst ARROW_DOWN_KEY = 'ArrowDown'\nconst HOME_KEY = 'Home'\nconst END_KEY = 'End'\n\nconst CLASS_NAME_ACTIVE = 'active'\nconst CLASS_NAME_FADE = 'fade'\nconst CLASS_NAME_SHOW = 'show'\nconst CLASS_DROPDOWN = 'dropdown'\n\nconst SELECTOR_DROPDOWN_TOGGLE = '.dropdown-toggle'\nconst SELECTOR_DROPDOWN_MENU = '.dropdown-menu'\nconst NOT_SELECTOR_DROPDOWN_TOGGLE = `:not(${SELECTOR_DROPDOWN_TOGGLE})`\n\nconst SELECTOR_TAB_PANEL = '.list-group, .nav, [role=\"tablist\"]'\nconst SELECTOR_OUTER = '.nav-item, .list-group-item'\nconst SELECTOR_INNER = `.nav-link${NOT_SELECTOR_DROPDOWN_TOGGLE}, .list-group-item${NOT_SELECTOR_DROPDOWN_TOGGLE}, [role=\"tab\"]${NOT_SELECTOR_DROPDOWN_TOGGLE}`\nconst SELECTOR_DATA_TOGGLE = '[data-bs-toggle=\"tab\"], [data-bs-toggle=\"pill\"], [data-bs-toggle=\"list\"]' // TODO: could only be `tab` in v6\nconst SELECTOR_INNER_ELEM = `${SELECTOR_INNER}, ${SELECTOR_DATA_TOGGLE}`\n\nconst SELECTOR_DATA_TOGGLE_ACTIVE = `.${CLASS_NAME_ACTIVE}[data-bs-toggle=\"tab\"], .${CLASS_NAME_ACTIVE}[data-bs-toggle=\"pill\"], .${CLASS_NAME_ACTIVE}[data-bs-toggle=\"list\"]`\n\n/**\n * Class definition\n */\n\nclass Tab extends BaseComponent {\n  constructor(element) {\n    super(element)\n    this._parent = this._element.closest(SELECTOR_TAB_PANEL)\n\n    if (!this._parent) {\n      return\n      // TODO: should throw exception in v6\n      // throw new TypeError(`${element.outerHTML} has not a valid parent ${SELECTOR_INNER_ELEM}`)\n    }\n\n    // Set up initial aria attributes\n    this._setInitialAttributes(this._parent, this._getChildren())\n\n    EventHandler.on(this._element, EVENT_KEYDOWN, event => this._keydown(event))\n  }\n\n  // Getters\n  static get NAME() {\n    return NAME\n  }\n\n  // Public\n  show() { // Shows this elem and deactivate the active sibling if exists\n    const innerElem = this._element\n    if (this._elemIsActive(innerElem)) {\n      return\n    }\n\n    // Search for active tab on same parent to deactivate it\n    const active = this._getActiveElem()\n\n    const hideEvent = active ?\n      EventHandler.trigger(active, EVENT_HIDE, { relatedTarget: innerElem }) :\n      null\n\n    const showEvent = EventHandler.trigger(innerElem, EVENT_SHOW, { relatedTarget: active })\n\n    if (showEvent.defaultPrevented || (hideEvent && hideEvent.defaultPrevented)) {\n      return\n    }\n\n    this._deactivate(active, innerElem)\n    this._activate(innerElem, active)\n  }\n\n  // Private\n  _activate(element, relatedElem) {\n    if (!element) {\n      return\n    }\n\n    element.classList.add(CLASS_NAME_ACTIVE)\n\n    this._activate(SelectorEngine.getElementFromSelector(element)) // Search and activate/show the proper section\n\n    const complete = () => {\n      if (element.getAttribute('role') !== 'tab') {\n        element.classList.add(CLASS_NAME_SHOW)\n        return\n      }\n\n      element.removeAttribute('tabindex')\n      element.setAttribute('aria-selected', true)\n      this._toggleDropDown(element, true)\n      EventHandler.trigger(element, EVENT_SHOWN, {\n        relatedTarget: relatedElem\n      })\n    }\n\n    this._queueCallback(complete, element, element.classList.contains(CLASS_NAME_FADE))\n  }\n\n  _deactivate(element, relatedElem) {\n    if (!element) {\n      return\n    }\n\n    element.classList.remove(CLASS_NAME_ACTIVE)\n    element.blur()\n\n    this._deactivate(SelectorEngine.getElementFromSelector(element)) // Search and deactivate the shown section too\n\n    const complete = () => {\n      if (element.getAttribute('role') !== 'tab') {\n        element.classList.remove(CLASS_NAME_SHOW)\n        return\n      }\n\n      element.setAttribute('aria-selected', false)\n      element.setAttribute('tabindex', '-1')\n      this._toggleDropDown(element, false)\n      EventHandler.trigger(element, EVENT_HIDDEN, { relatedTarget: relatedElem })\n    }\n\n    this._queueCallback(complete, element, element.classList.contains(CLASS_NAME_FADE))\n  }\n\n  _keydown(event) {\n    if (!([ARROW_LEFT_KEY, ARROW_RIGHT_KEY, ARROW_UP_KEY, ARROW_DOWN_KEY, HOME_KEY, END_KEY].includes(event.key))) {\n      return\n    }\n\n    event.stopPropagation()// stopPropagation/preventDefault both added to support up/down keys without scrolling the page\n    event.preventDefault()\n\n    const children = this._getChildren().filter(element => !isDisabled(element))\n    let nextActiveElement\n\n    if ([HOME_KEY, END_KEY].includes(event.key)) {\n      nextActiveElement = children[event.key === HOME_KEY ? 0 : children.length - 1]\n    } else {\n      const isNext = [ARROW_RIGHT_KEY, ARROW_DOWN_KEY].includes(event.key)\n      nextActiveElement = getNextActiveElement(children, event.target, isNext, true)\n    }\n\n    if (nextActiveElement) {\n      nextActiveElement.focus({ preventScroll: true })\n      Tab.getOrCreateInstance(nextActiveElement).show()\n    }\n  }\n\n  _getChildren() { // collection of inner elements\n    return SelectorEngine.find(SELECTOR_INNER_ELEM, this._parent)\n  }\n\n  _getActiveElem() {\n    return this._getChildren().find(child => this._elemIsActive(child)) || null\n  }\n\n  _setInitialAttributes(parent, children) {\n    this._setAttributeIfNotExists(parent, 'role', 'tablist')\n\n    for (const child of children) {\n      this._setInitialAttributesOnChild(child)\n    }\n  }\n\n  _setInitialAttributesOnChild(child) {\n    child = this._getInnerElement(child)\n    const isActive = this._elemIsActive(child)\n    const outerElem = this._getOuterElement(child)\n    child.setAttribute('aria-selected', isActive)\n\n    if (outerElem !== child) {\n      this._setAttributeIfNotExists(outerElem, 'role', 'presentation')\n    }\n\n    if (!isActive) {\n      child.setAttribute('tabindex', '-1')\n    }\n\n    this._setAttributeIfNotExists(child, 'role', 'tab')\n\n    // set attributes to the related panel too\n    this._setInitialAttributesOnTargetPanel(child)\n  }\n\n  _setInitialAttributesOnTargetPanel(child) {\n    const target = SelectorEngine.getElementFromSelector(child)\n\n    if (!target) {\n      return\n    }\n\n    this._setAttributeIfNotExists(target, 'role', 'tabpanel')\n\n    if (child.id) {\n      this._setAttributeIfNotExists(target, 'aria-labelledby', `${child.id}`)\n    }\n  }\n\n  _toggleDropDown(element, open) {\n    const outerElem = this._getOuterElement(element)\n    if (!outerElem.classList.contains(CLASS_DROPDOWN)) {\n      return\n    }\n\n    const toggle = (selector, className) => {\n      const element = SelectorEngine.findOne(selector, outerElem)\n      if (element) {\n        element.classList.toggle(className, open)\n      }\n    }\n\n    toggle(SELECTOR_DROPDOWN_TOGGLE, CLASS_NAME_ACTIVE)\n    toggle(SELECTOR_DROPDOWN_MENU, CLASS_NAME_SHOW)\n    outerElem.setAttribute('aria-expanded', open)\n  }\n\n  _setAttributeIfNotExists(element, attribute, value) {\n    if (!element.hasAttribute(attribute)) {\n      element.setAttribute(attribute, value)\n    }\n  }\n\n  _elemIsActive(elem) {\n    return elem.classList.contains(CLASS_NAME_ACTIVE)\n  }\n\n  // Try to get the inner element (usually the .nav-link)\n  _getInnerElement(elem) {\n    return elem.matches(SELECTOR_INNER_ELEM) ? elem : SelectorEngine.findOne(SELECTOR_INNER_ELEM, elem)\n  }\n\n  // Try to get the outer element (usually the .nav-item)\n  _getOuterElement(elem) {\n    return elem.closest(SELECTOR_OUTER) || elem\n  }\n\n  // Static\n  static jQueryInterface(config) {\n    return this.each(function () {\n      const data = Tab.getOrCreateInstance(this)\n\n      if (typeof config !== 'string') {\n        return\n      }\n\n      if (data[config] === undefined || config.startsWith('_') || config === 'constructor') {\n        throw new TypeError(`No method named \"${config}\"`)\n      }\n\n      data[config]()\n    })\n  }\n}\n\n/**\n * Data API implementation\n */\n\nEventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {\n  if (['A', 'AREA'].includes(this.tagName)) {\n    event.preventDefault()\n  }\n\n  if (isDisabled(this)) {\n    return\n  }\n\n  Tab.getOrCreateInstance(this).show()\n})\n\n/**\n * Initialize on focus\n */\nEventHandler.on(window, EVENT_LOAD_DATA_API, () => {\n  for (const element of SelectorEngine.find(SELECTOR_DATA_TOGGLE_ACTIVE)) {\n    Tab.getOrCreateInstance(element)\n  }\n})\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Tab)\n\nexport default Tab\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap toast.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport BaseComponent from './base-component.js'\nimport EventHandler from './dom/event-handler.js'\nimport { enableDismissTrigger } from './util/component-functions.js'\nimport { defineJQueryPlugin, reflow } from './util/index.js'\n\n/**\n * Constants\n */\n\nconst NAME = 'toast'\nconst DATA_KEY = 'bs.toast'\nconst EVENT_KEY = `.${DATA_KEY}`\n\nconst EVENT_MOUSEOVER = `mouseover${EVENT_KEY}`\nconst EVENT_MOUSEOUT = `mouseout${EVENT_KEY}`\nconst EVENT_FOCUSIN = `focusin${EVENT_KEY}`\nconst EVENT_FOCUSOUT = `focusout${EVENT_KEY}`\nconst EVENT_HIDE = `hide${EVENT_KEY}`\nconst EVENT_HIDDEN = `hidden${EVENT_KEY}`\nconst EVENT_SHOW = `show${EVENT_KEY}`\nconst EVENT_SHOWN = `shown${EVENT_KEY}`\n\nconst CLASS_NAME_FADE = 'fade'\nconst CLASS_NAME_HIDE = 'hide' // @deprecated - kept here only for backwards compatibility\nconst CLASS_NAME_SHOW = 'show'\nconst CLASS_NAME_SHOWING = 'showing'\n\nconst DefaultType = {\n  animation: 'boolean',\n  autohide: 'boolean',\n  delay: 'number'\n}\n\nconst Default = {\n  animation: true,\n  autohide: true,\n  delay: 5000\n}\n\n/**\n * Class definition\n */\n\nclass Toast extends BaseComponent {\n  constructor(element, config) {\n    super(element, config)\n\n    this._timeout = null\n    this._hasMouseInteraction = false\n    this._hasKeyboardInteraction = false\n    this._setListeners()\n  }\n\n  // Getters\n  static get Default() {\n    return Default\n  }\n\n  static get DefaultType() {\n    return DefaultType\n  }\n\n  static get NAME() {\n    return NAME\n  }\n\n  // Public\n  show() {\n    const showEvent = EventHandler.trigger(this._element, EVENT_SHOW)\n\n    if (showEvent.defaultPrevented) {\n      return\n    }\n\n    this._clearTimeout()\n\n    if (this._config.animation) {\n      this._element.classList.add(CLASS_NAME_FADE)\n    }\n\n    const complete = () => {\n      this._element.classList.remove(CLASS_NAME_SHOWING)\n      EventHandler.trigger(this._element, EVENT_SHOWN)\n\n      this._maybeScheduleHide()\n    }\n\n    this._element.classList.remove(CLASS_NAME_HIDE) // @deprecated\n    reflow(this._element)\n    this._element.classList.add(CLASS_NAME_SHOW, CLASS_NAME_SHOWING)\n\n    this._queueCallback(complete, this._element, this._config.animation)\n  }\n\n  hide() {\n    if (!this.isShown()) {\n      return\n    }\n\n    const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE)\n\n    if (hideEvent.defaultPrevented) {\n      return\n    }\n\n    const complete = () => {\n      this._element.classList.add(CLASS_NAME_HIDE) // @deprecated\n      this._element.classList.remove(CLASS_NAME_SHOWING, CLASS_NAME_SHOW)\n      EventHandler.trigger(this._element, EVENT_HIDDEN)\n    }\n\n    this._element.classList.add(CLASS_NAME_SHOWING)\n    this._queueCallback(complete, this._element, this._config.animation)\n  }\n\n  dispose() {\n    this._clearTimeout()\n\n    if (this.isShown()) {\n      this._element.classList.remove(CLASS_NAME_SHOW)\n    }\n\n    super.dispose()\n  }\n\n  isShown() {\n    return this._element.classList.contains(CLASS_NAME_SHOW)\n  }\n\n  // Private\n  _maybeScheduleHide() {\n    if (!this._config.autohide) {\n      return\n    }\n\n    if (this._hasMouseInteraction || this._hasKeyboardInteraction) {\n      return\n    }\n\n    this._timeout = setTimeout(() => {\n      this.hide()\n    }, this._config.delay)\n  }\n\n  _onInteraction(event, isInteracting) {\n    switch (event.type) {\n      case 'mouseover':\n      case 'mouseout': {\n        this._hasMouseInteraction = isInteracting\n        break\n      }\n\n      case 'focusin':\n      case 'focusout': {\n        this._hasKeyboardInteraction = isInteracting\n        break\n      }\n\n      default: {\n        break\n      }\n    }\n\n    if (isInteracting) {\n      this._clearTimeout()\n      return\n    }\n\n    const nextElement = event.relatedTarget\n    if (this._element === nextElement || this._element.contains(nextElement)) {\n      return\n    }\n\n    this._maybeScheduleHide()\n  }\n\n  _setListeners() {\n    EventHandler.on(this._element, EVENT_MOUSEOVER, event => this._onInteraction(event, true))\n    EventHandler.on(this._element, EVENT_MOUSEOUT, event => this._onInteraction(event, false))\n    EventHandler.on(this._element, EVENT_FOCUSIN, event => this._onInteraction(event, true))\n    EventHandler.on(this._element, EVENT_FOCUSOUT, event => this._onInteraction(event, false))\n  }\n\n  _clearTimeout() {\n    clearTimeout(this._timeout)\n    this._timeout = null\n  }\n\n  // Static\n  static jQueryInterface(config) {\n    return this.each(function () {\n      const data = Toast.getOrCreateInstance(this, config)\n\n      if (typeof config === 'string') {\n        if (typeof data[config] === 'undefined') {\n          throw new TypeError(`No method named \"${config}\"`)\n        }\n\n        data[config](this)\n      }\n    })\n  }\n}\n\n/**\n * Data API implementation\n */\n\nenableDismissTrigger(Toast)\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Toast)\n\nexport default Toast\n", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { use } from './lib/extension.js';\nexport * from './lib/export/core.js';\n// ----------------------------------------------\n// All of the modules that are allowed to be\n// imported are listed below.\n//\n// Users MUST NOT import other modules that are\n// not included in this list.\n// ----------------------------------------------\nimport { SVGRenderer, CanvasRenderer } from './lib/export/renderers.js';\nimport { LineChart, BarChart, PieChart, ScatterChart, RadarChart, MapChart, TreeChart, TreemapChart, GraphChart, ChordChart, GaugeChart, FunnelChart, ParallelChart, SankeyChart, BoxplotChart, CandlestickChart, EffectScatterChart, LinesChart, HeatmapChart, PictorialBarChart, ThemeRiverChart, SunburstChart, CustomChart } from './lib/export/charts.js';\nimport { GridComponent, PolarComponent, GeoComponent, SingleAxisComponent, ParallelComponent, CalendarComponent, MatrixComponent, GraphicComponent, ToolboxComponent, TooltipComponent, AxisPointerComponent, BrushComponent, TitleComponent, TimelineComponent, MarkPointComponent, MarkLineComponent, MarkAreaComponent, LegendComponent, DataZoomComponent, DataZoomInsideComponent, DataZoomSliderComponent, VisualMapComponent, VisualMapContinuousComponent, VisualMapPiecewiseComponent, ThumbnailComponent, AriaComponent, DatasetComponent, TransformComponent } from './lib/export/components.js';\nimport { UniversalTransition, LabelLayout, AxisBreak, LegacyGridContainLabel, ScatterJitter } from './lib/export/features.js';\n// -----------------\n// Render engines\n// -----------------\n// Render via Canvas.\n// echarts.init(dom, null, { renderer: 'canvas' })\nuse([CanvasRenderer]);\n// Render via SVG.\n// echarts.init(dom, null, { renderer: 'svg' })\nuse([SVGRenderer]);\n// ----------------\n// Charts (series)\n// ----------------\n// All of the series types, for example:\n// chart.setOption({\n//     series: [{\n//         type: 'line' // or 'bar', 'pie', ...\n//     }]\n// });\nuse([LineChart, BarChart, PieChart, ScatterChart, RadarChart, MapChart, TreeChart, TreemapChart, GraphChart, ChordChart, GaugeChart, FunnelChart, ParallelChart, SankeyChart, BoxplotChart, CandlestickChart, EffectScatterChart, LinesChart, HeatmapChart, PictorialBarChart, ThemeRiverChart, SunburstChart, CustomChart]);\n// -------------------\n// Coordinate systems\n// -------------------\n// All of the axis modules have been included in the\n// coordinate system module below, do not need to\n// make extra import.\n// `cartesian` coordinate system. For some historical\n// reasons, it is named as grid, for example:\n// chart.setOption({\n//     grid: {...},\n//     xAxis: {...},\n//     yAxis: {...},\n//     series: [{...}]\n// });\nuse(GridComponent);\n// `polar` coordinate system, for example:\n// chart.setOption({\n//     polar: {...},\n//     radiusAxis: {...},\n//     angleAxis: {...},\n//     series: [{\n//         coordinateSystem: 'polar'\n//     }]\n// });\nuse(PolarComponent);\n// `geo` coordinate system, for example:\n// chart.setOption({\n//     geo: {...},\n//     series: [{\n//         coordinateSystem: 'geo'\n//     }]\n// });\nuse(GeoComponent);\n// `singleAxis` coordinate system (notice, it is a coordinate system\n// with only one axis, work for chart like theme river), for example:\n// chart.setOption({\n//     singleAxis: {...}\n//     series: [{type: 'themeRiver', ...}]\n// });\nuse(SingleAxisComponent);\n// `parallel` coordinate system, only work for parallel series, for example:\n// chart.setOption({\n//     parallel: {...},\n//     parallelAxis: [{...}, ...],\n//     series: [{\n//         type: 'parallel'\n//     }]\n// });\nuse(ParallelComponent);\n// `calendar` coordinate system. for example,\n// chart.setOption({\n//     calendar: {...},\n//     series: [{\n//         coordinateSystem: 'calendar'\n//     }]\n// );\nuse(CalendarComponent);\n// `matrix` coordinate system. for example,\n// chart.setOption({\n//     matrix: {...},\n//     series: [{\n//         coordinateSystem: 'matrix'\n//     }]\n// );\nuse(MatrixComponent);\n// ------------------\n// Other components\n// ------------------\n// `graphic` component, for example:\n// chart.setOption({\n//     graphic: {...}\n// });\nuse(GraphicComponent);\n// `toolbox` component, for example:\n// chart.setOption({\n//     toolbox: {...}\n// });\nuse(ToolboxComponent);\n// `tooltip` component, for example:\n// chart.setOption({\n//     tooltip: {...}\n// });\nuse(TooltipComponent);\n// `axisPointer` component, for example:\n// chart.setOption({\n//     tooltip: {axisPointer: {...}, ...}\n// });\n// Or\n// chart.setOption({\n//     axisPointer: {...}\n// });\nuse(AxisPointerComponent);\n// `brush` component, for example:\n// chart.setOption({\n//     brush: {...}\n// });\n// Or\n// chart.setOption({\n//     tooltip: {feature: {brush: {...}}\n// })\nuse(BrushComponent);\n// `title` component, for example:\n// chart.setOption({\n//     title: {...}\n// });\nuse(TitleComponent);\n// `timeline` component, for example:\n// chart.setOption({\n//     timeline: {...}\n// });\nuse(TimelineComponent);\n// `markPoint` component, for example:\n// chart.setOption({\n//     series: [{markPoint: {...}}]\n// });\nuse(MarkPointComponent);\n// `markLine` component, for example:\n// chart.setOption({\n//     series: [{markLine: {...}}]\n// });\nuse(MarkLineComponent);\n// `markArea` component, for example:\n// chart.setOption({\n//     series: [{markArea: {...}}]\n// });\nuse(MarkAreaComponent);\n// `legend` component not scrollable. for example:\n// chart.setOption({\n//     legend: {...}\n// });\nuse(LegendComponent);\n// `dataZoom` component including both `dataZoomInside` and `dataZoomSlider`.\nuse(DataZoomComponent);\n// `dataZoom` component providing drag, pinch, wheel behaviors\n// inside coordinate system, for example:\n// chart.setOption({\n//     dataZoom: {type: 'inside'}\n// });\nuse(DataZoomInsideComponent);\n// `dataZoom` component providing a slider bar, for example:\n// chart.setOption({\n//     dataZoom: {type: 'slider'}\n// });\nuse(DataZoomSliderComponent);\n// `visualMap` component including both `visualMapContinuous` and `visualMapPiecewise`.\nuse(VisualMapComponent);\n// `visualMap` component providing continuous bar, for example:\n// chart.setOption({\n//     visualMap: {type: 'continuous'}\n// });\nuse(VisualMapContinuousComponent);\n// `visualMap` component providing pieces bar, for example:\n// chart.setOption({\n//     visualMap: {type: 'piecewise'}\n// });\nuse(VisualMapPiecewiseComponent);\nuse(ThumbnailComponent);\n// `aria` component providing aria, for example:\n// chart.setOption({\n//     aria: {...}\n// });\nuse(AriaComponent);\n// dataset transform\n// chart.setOption({\n//     dataset: {\n//          transform: []\n//     }\n// });\nuse(TransformComponent);\nuse(DatasetComponent);\n// universal transition\n// chart.setOption({\n//     series: {\n//         universalTransition: { enabled: true }\n//     }\n// })\nuse(UniversalTransition);\n// label layout\n// chart.setOption({\n//     series: {\n//         labelLayout: { hideOverlap: true }\n//     }\n// })\nuse(LabelLayout);\nuse(AxisBreak);\nuse(LegacyGridContainLabel);\nuse(ScatterJitter);", "import { cubicSubdivide } from '../core/curve.js';\nimport PathProxy from '../core/PathProxy.js';\nvar CMD = PathProxy.CMD;\nfunction aroundEqual(a, b) {\n    return Math.abs(a - b) < 1e-5;\n}\nexport function pathToBezierCurves(path) {\n    var data = path.data;\n    var len = path.len();\n    var bezierArrayGroups = [];\n    var currentSubpath;\n    var xi = 0;\n    var yi = 0;\n    var x0 = 0;\n    var y0 = 0;\n    function createNewSubpath(x, y) {\n        if (currentSubpath && currentSubpath.length > 2) {\n            bezierArrayGroups.push(currentSubpath);\n        }\n        currentSubpath = [x, y];\n    }\n    function addLine(x0, y0, x1, y1) {\n        if (!(aroundEqual(x0, x1) && aroundEqual(y0, y1))) {\n            currentSubpath.push(x0, y0, x1, y1, x1, y1);\n        }\n    }\n    function addArc(startAngle, endAngle, cx, cy, rx, ry) {\n        var delta = Math.abs(endAngle - startAngle);\n        var len = Math.tan(delta / 4) * 4 / 3;\n        var dir = endAngle < startAngle ? -1 : 1;\n        var c1 = Math.cos(startAngle);\n        var s1 = Math.sin(startAngle);\n        var c2 = Math.cos(endAngle);\n        var s2 = Math.sin(endAngle);\n        var x1 = c1 * rx + cx;\n        var y1 = s1 * ry + cy;\n        var x4 = c2 * rx + cx;\n        var y4 = s2 * ry + cy;\n        var hx = rx * len * dir;\n        var hy = ry * len * dir;\n        currentSubpath.push(x1 - hx * s1, y1 + hy * c1, x4 + hx * s2, y4 - hy * c2, x4, y4);\n    }\n    var x1;\n    var y1;\n    var x2;\n    var y2;\n    for (var i = 0; i < len;) {\n        var cmd = data[i++];\n        var isFirst = i === 1;\n        if (isFirst) {\n            xi = data[i];\n            yi = data[i + 1];\n            x0 = xi;\n            y0 = yi;\n            if (cmd === CMD.L || cmd === CMD.C || cmd === CMD.Q) {\n                currentSubpath = [x0, y0];\n            }\n        }\n        switch (cmd) {\n            case CMD.M:\n                xi = x0 = data[i++];\n                yi = y0 = data[i++];\n                createNewSubpath(x0, y0);\n                break;\n            case CMD.L:\n                x1 = data[i++];\n                y1 = data[i++];\n                addLine(xi, yi, x1, y1);\n                xi = x1;\n                yi = y1;\n                break;\n            case CMD.C:\n                currentSubpath.push(data[i++], data[i++], data[i++], data[i++], xi = data[i++], yi = data[i++]);\n                break;\n            case CMD.Q:\n                x1 = data[i++];\n                y1 = data[i++];\n                x2 = data[i++];\n                y2 = data[i++];\n                currentSubpath.push(xi + 2 / 3 * (x1 - xi), yi + 2 / 3 * (y1 - yi), x2 + 2 / 3 * (x1 - x2), y2 + 2 / 3 * (y1 - y2), x2, y2);\n                xi = x2;\n                yi = y2;\n                break;\n            case CMD.A:\n                var cx = data[i++];\n                var cy = data[i++];\n                var rx = data[i++];\n                var ry = data[i++];\n                var startAngle = data[i++];\n                var endAngle = data[i++] + startAngle;\n                i += 1;\n                var anticlockwise = !data[i++];\n                x1 = Math.cos(startAngle) * rx + cx;\n                y1 = Math.sin(startAngle) * ry + cy;\n                if (isFirst) {\n                    x0 = x1;\n                    y0 = y1;\n                    createNewSubpath(x0, y0);\n                }\n                else {\n                    addLine(xi, yi, x1, y1);\n                }\n                xi = Math.cos(endAngle) * rx + cx;\n                yi = Math.sin(endAngle) * ry + cy;\n                var step = (anticlockwise ? -1 : 1) * Math.PI / 2;\n                for (var angle = startAngle; anticlockwise ? angle > endAngle : angle < endAngle; angle += step) {\n                    var nextAngle = anticlockwise ? Math.max(angle + step, endAngle)\n                        : Math.min(angle + step, endAngle);\n                    addArc(angle, nextAngle, cx, cy, rx, ry);\n                }\n                break;\n            case CMD.R:\n                x0 = xi = data[i++];\n                y0 = yi = data[i++];\n                x1 = x0 + data[i++];\n                y1 = y0 + data[i++];\n                createNewSubpath(x1, y0);\n                addLine(x1, y0, x1, y1);\n                addLine(x1, y1, x0, y1);\n                addLine(x0, y1, x0, y0);\n                addLine(x0, y0, x1, y0);\n                break;\n            case CMD.Z:\n                currentSubpath && addLine(xi, yi, x0, y0);\n                xi = x0;\n                yi = y0;\n                break;\n        }\n    }\n    if (currentSubpath && currentSubpath.length > 2) {\n        bezierArrayGroups.push(currentSubpath);\n    }\n    return bezierArrayGroups;\n}\nfunction adpativeBezier(x0, y0, x1, y1, x2, y2, x3, y3, out, scale) {\n    if (aroundEqual(x0, x1) && aroundEqual(y0, y1) && aroundEqual(x2, x3) && aroundEqual(y2, y3)) {\n        out.push(x3, y3);\n        return;\n    }\n    var PIXEL_DISTANCE = 2 / scale;\n    var PIXEL_DISTANCE_SQR = PIXEL_DISTANCE * PIXEL_DISTANCE;\n    var dx = x3 - x0;\n    var dy = y3 - y0;\n    var d = Math.sqrt(dx * dx + dy * dy);\n    dx /= d;\n    dy /= d;\n    var dx1 = x1 - x0;\n    var dy1 = y1 - y0;\n    var dx2 = x2 - x3;\n    var dy2 = y2 - y3;\n    var cp1LenSqr = dx1 * dx1 + dy1 * dy1;\n    var cp2LenSqr = dx2 * dx2 + dy2 * dy2;\n    if (cp1LenSqr < PIXEL_DISTANCE_SQR && cp2LenSqr < PIXEL_DISTANCE_SQR) {\n        out.push(x3, y3);\n        return;\n    }\n    var projLen1 = dx * dx1 + dy * dy1;\n    var projLen2 = -dx * dx2 - dy * dy2;\n    var d1Sqr = cp1LenSqr - projLen1 * projLen1;\n    var d2Sqr = cp2LenSqr - projLen2 * projLen2;\n    if (d1Sqr < PIXEL_DISTANCE_SQR && projLen1 >= 0\n        && d2Sqr < PIXEL_DISTANCE_SQR && projLen2 >= 0) {\n        out.push(x3, y3);\n        return;\n    }\n    var tmpSegX = [];\n    var tmpSegY = [];\n    cubicSubdivide(x0, x1, x2, x3, 0.5, tmpSegX);\n    cubicSubdivide(y0, y1, y2, y3, 0.5, tmpSegY);\n    adpativeBezier(tmpSegX[0], tmpSegY[0], tmpSegX[1], tmpSegY[1], tmpSegX[2], tmpSegY[2], tmpSegX[3], tmpSegY[3], out, scale);\n    adpativeBezier(tmpSegX[4], tmpSegY[4], tmpSegX[5], tmpSegY[5], tmpSegX[6], tmpSegY[6], tmpSegX[7], tmpSegY[7], out, scale);\n}\nexport function pathToPolygons(path, scale) {\n    var bezierArrayGroups = pathToBezierCurves(path);\n    var polygons = [];\n    scale = scale || 1;\n    for (var i = 0; i < bezierArrayGroups.length; i++) {\n        var beziers = bezierArrayGroups[i];\n        var polygon = [];\n        var x0 = beziers[0];\n        var y0 = beziers[1];\n        polygon.push(x0, y0);\n        for (var k = 2; k < beziers.length;) {\n            var x1 = beziers[k++];\n            var y1 = beziers[k++];\n            var x2 = beziers[k++];\n            var y2 = beziers[k++];\n            var x3 = beziers[k++];\n            var y3 = beziers[k++];\n            adpativeBezier(x0, y0, x1, y1, x2, y2, x3, y3, polygon, scale);\n            x0 = x3;\n            y0 = y3;\n        }\n        polygons.push(polygon);\n    }\n    return polygons;\n}\n", "import { fromPoints } from '../core/bbox.js';\nimport BoundingRect from '../core/BoundingRect.js';\nimport Point from '../core/Point.js';\nimport { map } from '../core/util.js';\nimport Polygon from '../graphic/shape/Polygon.js';\nimport Rect from '../graphic/shape/Rect.js';\nimport Sector from '../graphic/shape/Sector.js';\nimport { pathToPolygons } from './convertPath.js';\nimport { clonePath } from './path.js';\nfunction getDividingGrids(dimSize, rowDim, count) {\n    var rowSize = dimSize[rowDim];\n    var columnSize = dimSize[1 - rowDim];\n    var ratio = Math.abs(rowSize / columnSize);\n    var rowCount = Math.ceil(Math.sqrt(ratio * count));\n    var columnCount = Math.floor(count / rowCount);\n    if (columnCount === 0) {\n        columnCount = 1;\n        rowCount = count;\n    }\n    var grids = [];\n    for (var i = 0; i < rowCount; i++) {\n        grids.push(columnCount);\n    }\n    var currentCount = rowCount * columnCount;\n    var remained = count - currentCount;\n    if (remained > 0) {\n        for (var i = 0; i < remained; i++) {\n            grids[i % rowCount] += 1;\n        }\n    }\n    return grids;\n}\nfunction divideSector(sectorShape, count, outShapes) {\n    var r0 = sectorShape.r0;\n    var r = sectorShape.r;\n    var startAngle = sectorShape.startAngle;\n    var endAngle = sectorShape.endAngle;\n    var angle = Math.abs(endAngle - startAngle);\n    var arcLen = angle * r;\n    var deltaR = r - r0;\n    var isAngleRow = arcLen > Math.abs(deltaR);\n    var grids = getDividingGrids([arcLen, deltaR], isAngleRow ? 0 : 1, count);\n    var rowSize = (isAngleRow ? angle : deltaR) / grids.length;\n    for (var row = 0; row < grids.length; row++) {\n        var columnSize = (isAngleRow ? deltaR : angle) / grids[row];\n        for (var column = 0; column < grids[row]; column++) {\n            var newShape = {};\n            if (isAngleRow) {\n                newShape.startAngle = startAngle + rowSize * row;\n                newShape.endAngle = startAngle + rowSize * (row + 1);\n                newShape.r0 = r0 + columnSize * column;\n                newShape.r = r0 + columnSize * (column + 1);\n            }\n            else {\n                newShape.startAngle = startAngle + columnSize * column;\n                newShape.endAngle = startAngle + columnSize * (column + 1);\n                newShape.r0 = r0 + rowSize * row;\n                newShape.r = r0 + rowSize * (row + 1);\n            }\n            newShape.clockwise = sectorShape.clockwise;\n            newShape.cx = sectorShape.cx;\n            newShape.cy = sectorShape.cy;\n            outShapes.push(newShape);\n        }\n    }\n}\nfunction divideRect(rectShape, count, outShapes) {\n    var width = rectShape.width;\n    var height = rectShape.height;\n    var isHorizontalRow = width > height;\n    var grids = getDividingGrids([width, height], isHorizontalRow ? 0 : 1, count);\n    var rowSizeDim = isHorizontalRow ? 'width' : 'height';\n    var columnSizeDim = isHorizontalRow ? 'height' : 'width';\n    var rowDim = isHorizontalRow ? 'x' : 'y';\n    var columnDim = isHorizontalRow ? 'y' : 'x';\n    var rowSize = rectShape[rowSizeDim] / grids.length;\n    for (var row = 0; row < grids.length; row++) {\n        var columnSize = rectShape[columnSizeDim] / grids[row];\n        for (var column = 0; column < grids[row]; column++) {\n            var newShape = {};\n            newShape[rowDim] = row * rowSize;\n            newShape[columnDim] = column * columnSize;\n            newShape[rowSizeDim] = rowSize;\n            newShape[columnSizeDim] = columnSize;\n            newShape.x += rectShape.x;\n            newShape.y += rectShape.y;\n            outShapes.push(newShape);\n        }\n    }\n}\nfunction crossProduct2d(x1, y1, x2, y2) {\n    return x1 * y2 - x2 * y1;\n}\nfunction lineLineIntersect(a1x, a1y, a2x, a2y, b1x, b1y, b2x, b2y) {\n    var mx = a2x - a1x;\n    var my = a2y - a1y;\n    var nx = b2x - b1x;\n    var ny = b2y - b1y;\n    var nmCrossProduct = crossProduct2d(nx, ny, mx, my);\n    if (Math.abs(nmCrossProduct) < 1e-6) {\n        return null;\n    }\n    var b1a1x = a1x - b1x;\n    var b1a1y = a1y - b1y;\n    var p = crossProduct2d(b1a1x, b1a1y, nx, ny) / nmCrossProduct;\n    if (p < 0 || p > 1) {\n        return null;\n    }\n    return new Point(p * mx + a1x, p * my + a1y);\n}\nfunction projPtOnLine(pt, lineA, lineB) {\n    var dir = new Point();\n    Point.sub(dir, lineB, lineA);\n    dir.normalize();\n    var dir2 = new Point();\n    Point.sub(dir2, pt, lineA);\n    var len = dir2.dot(dir);\n    return len;\n}\nfunction addToPoly(poly, pt) {\n    var last = poly[poly.length - 1];\n    if (last && last[0] === pt[0] && last[1] === pt[1]) {\n        return;\n    }\n    poly.push(pt);\n}\nfunction splitPolygonByLine(points, lineA, lineB) {\n    var len = points.length;\n    var intersections = [];\n    for (var i = 0; i < len; i++) {\n        var p0 = points[i];\n        var p1 = points[(i + 1) % len];\n        var intersectionPt = lineLineIntersect(p0[0], p0[1], p1[0], p1[1], lineA.x, lineA.y, lineB.x, lineB.y);\n        if (intersectionPt) {\n            intersections.push({\n                projPt: projPtOnLine(intersectionPt, lineA, lineB),\n                pt: intersectionPt,\n                idx: i\n            });\n        }\n    }\n    if (intersections.length < 2) {\n        return [{ points: points }, { points: points }];\n    }\n    intersections.sort(function (a, b) {\n        return a.projPt - b.projPt;\n    });\n    var splitPt0 = intersections[0];\n    var splitPt1 = intersections[intersections.length - 1];\n    if (splitPt1.idx < splitPt0.idx) {\n        var tmp = splitPt0;\n        splitPt0 = splitPt1;\n        splitPt1 = tmp;\n    }\n    var splitPt0Arr = [splitPt0.pt.x, splitPt0.pt.y];\n    var splitPt1Arr = [splitPt1.pt.x, splitPt1.pt.y];\n    var newPolyA = [splitPt0Arr];\n    var newPolyB = [splitPt1Arr];\n    for (var i = splitPt0.idx + 1; i <= splitPt1.idx; i++) {\n        addToPoly(newPolyA, points[i].slice());\n    }\n    addToPoly(newPolyA, splitPt1Arr);\n    addToPoly(newPolyA, splitPt0Arr);\n    for (var i = splitPt1.idx + 1; i <= splitPt0.idx + len; i++) {\n        addToPoly(newPolyB, points[i % len].slice());\n    }\n    addToPoly(newPolyB, splitPt0Arr);\n    addToPoly(newPolyB, splitPt1Arr);\n    return [{\n            points: newPolyA\n        }, {\n            points: newPolyB\n        }];\n}\nfunction binaryDividePolygon(polygonShape) {\n    var points = polygonShape.points;\n    var min = [];\n    var max = [];\n    fromPoints(points, min, max);\n    var boundingRect = new BoundingRect(min[0], min[1], max[0] - min[0], max[1] - min[1]);\n    var width = boundingRect.width;\n    var height = boundingRect.height;\n    var x = boundingRect.x;\n    var y = boundingRect.y;\n    var pt0 = new Point();\n    var pt1 = new Point();\n    if (width > height) {\n        pt0.x = pt1.x = x + width / 2;\n        pt0.y = y;\n        pt1.y = y + height;\n    }\n    else {\n        pt0.y = pt1.y = y + height / 2;\n        pt0.x = x;\n        pt1.x = x + width;\n    }\n    return splitPolygonByLine(points, pt0, pt1);\n}\nfunction binaryDivideRecursive(divider, shape, count, out) {\n    if (count === 1) {\n        out.push(shape);\n    }\n    else {\n        var mid = Math.floor(count / 2);\n        var sub = divider(shape);\n        binaryDivideRecursive(divider, sub[0], mid, out);\n        binaryDivideRecursive(divider, sub[1], count - mid, out);\n    }\n    return out;\n}\nexport function clone(path, count) {\n    var paths = [];\n    for (var i = 0; i < count; i++) {\n        paths.push(clonePath(path));\n    }\n    return paths;\n}\nfunction copyPathProps(source, target) {\n    target.setStyle(source.style);\n    target.z = source.z;\n    target.z2 = source.z2;\n    target.zlevel = source.zlevel;\n}\nfunction polygonConvert(points) {\n    var out = [];\n    for (var i = 0; i < points.length;) {\n        out.push([points[i++], points[i++]]);\n    }\n    return out;\n}\nexport function split(path, count) {\n    var outShapes = [];\n    var shape = path.shape;\n    var OutShapeCtor;\n    switch (path.type) {\n        case 'rect':\n            divideRect(shape, count, outShapes);\n            OutShapeCtor = Rect;\n            break;\n        case 'sector':\n            divideSector(shape, count, outShapes);\n            OutShapeCtor = Sector;\n            break;\n        case 'circle':\n            divideSector({\n                r0: 0, r: shape.r, startAngle: 0, endAngle: Math.PI * 2,\n                cx: shape.cx, cy: shape.cy\n            }, count, outShapes);\n            OutShapeCtor = Sector;\n            break;\n        default:\n            var m = path.getComputedTransform();\n            var scale = m ? Math.sqrt(Math.max(m[0] * m[0] + m[1] * m[1], m[2] * m[2] + m[3] * m[3])) : 1;\n            var polygons = map(pathToPolygons(path.getUpdatedPathProxy(), scale), function (poly) { return polygonConvert(poly); });\n            var polygonCount = polygons.length;\n            if (polygonCount === 0) {\n                binaryDivideRecursive(binaryDividePolygon, {\n                    points: polygons[0]\n                }, count, outShapes);\n            }\n            else if (polygonCount === count) {\n                for (var i = 0; i < polygonCount; i++) {\n                    outShapes.push({\n                        points: polygons[i]\n                    });\n                }\n            }\n            else {\n                var totalArea_1 = 0;\n                var items = map(polygons, function (poly) {\n                    var min = [];\n                    var max = [];\n                    fromPoints(poly, min, max);\n                    var area = (max[1] - min[1]) * (max[0] - min[0]);\n                    totalArea_1 += area;\n                    return { poly: poly, area: area };\n                });\n                items.sort(function (a, b) { return b.area - a.area; });\n                var left = count;\n                for (var i = 0; i < polygonCount; i++) {\n                    var item = items[i];\n                    if (left <= 0) {\n                        break;\n                    }\n                    var selfCount = i === polygonCount - 1\n                        ? left\n                        : Math.ceil(item.area / totalArea_1 * count);\n                    if (selfCount < 0) {\n                        continue;\n                    }\n                    binaryDivideRecursive(binaryDividePolygon, {\n                        points: item.poly\n                    }, selfCount, outShapes);\n                    left -= selfCount;\n                }\n                ;\n            }\n            OutShapeCtor = Polygon;\n            break;\n    }\n    if (!OutShapeCtor) {\n        return clone(path, count);\n    }\n    var out = [];\n    for (var i = 0; i < outShapes.length; i++) {\n        var subPath = new OutShapeCtor();\n        subPath.setShape(outShapes[i]);\n        copyPathProps(path, subPath);\n        out.push(subPath);\n    }\n    return out;\n}\n", "import { cubicSubdivide } from '../core/curve.js';\nimport Path from '../graphic/Path.js';\nimport { defaults, map } from '../core/util.js';\nimport { lerp } from '../core/vector.js';\nimport { clonePath } from './path.js';\nimport Transformable from '../core/Transformable.js';\nimport { split } from './dividePath.js';\nimport { pathToBezierCurves } from './convertPath.js';\nfunction alignSubpath(subpath1, subpath2) {\n    var len1 = subpath1.length;\n    var len2 = subpath2.length;\n    if (len1 === len2) {\n        return [subpath1, subpath2];\n    }\n    var tmpSegX = [];\n    var tmpSegY = [];\n    var shorterPath = len1 < len2 ? subpath1 : subpath2;\n    var shorterLen = Math.min(len1, len2);\n    var diff = Math.abs(len2 - len1) / 6;\n    var shorterBezierCount = (shorterLen - 2) / 6;\n    var eachCurveSubDivCount = Math.ceil(diff / shorterBezierCount) + 1;\n    var newSubpath = [shorterPath[0], shorterPath[1]];\n    var remained = diff;\n    for (var i = 2; i < shorterLen;) {\n        var x0 = shorterPath[i - 2];\n        var y0 = shorterPath[i - 1];\n        var x1 = shorterPath[i++];\n        var y1 = shorterPath[i++];\n        var x2 = shorterPath[i++];\n        var y2 = shorterPath[i++];\n        var x3 = shorterPath[i++];\n        var y3 = shorterPath[i++];\n        if (remained <= 0) {\n            newSubpath.push(x1, y1, x2, y2, x3, y3);\n            continue;\n        }\n        var actualSubDivCount = Math.min(remained, eachCurveSubDivCount - 1) + 1;\n        for (var k = 1; k <= actualSubDivCount; k++) {\n            var p = k / actualSubDivCount;\n            cubicSubdivide(x0, x1, x2, x3, p, tmpSegX);\n            cubicSubdivide(y0, y1, y2, y3, p, tmpSegY);\n            x0 = tmpSegX[3];\n            y0 = tmpSegY[3];\n            newSubpath.push(tmpSegX[1], tmpSegY[1], tmpSegX[2], tmpSegY[2], x0, y0);\n            x1 = tmpSegX[5];\n            y1 = tmpSegY[5];\n            x2 = tmpSegX[6];\n            y2 = tmpSegY[6];\n        }\n        remained -= actualSubDivCount - 1;\n    }\n    return shorterPath === subpath1 ? [newSubpath, subpath2] : [subpath1, newSubpath];\n}\nfunction createSubpath(lastSubpathSubpath, otherSubpath) {\n    var len = lastSubpathSubpath.length;\n    var lastX = lastSubpathSubpath[len - 2];\n    var lastY = lastSubpathSubpath[len - 1];\n    var newSubpath = [];\n    for (var i = 0; i < otherSubpath.length;) {\n        newSubpath[i++] = lastX;\n        newSubpath[i++] = lastY;\n    }\n    return newSubpath;\n}\nexport function alignBezierCurves(array1, array2) {\n    var _a;\n    var lastSubpath1;\n    var lastSubpath2;\n    var newArray1 = [];\n    var newArray2 = [];\n    for (var i = 0; i < Math.max(array1.length, array2.length); i++) {\n        var subpath1 = array1[i];\n        var subpath2 = array2[i];\n        var newSubpath1 = void 0;\n        var newSubpath2 = void 0;\n        if (!subpath1) {\n            newSubpath1 = createSubpath(lastSubpath1 || subpath2, subpath2);\n            newSubpath2 = subpath2;\n        }\n        else if (!subpath2) {\n            newSubpath2 = createSubpath(lastSubpath2 || subpath1, subpath1);\n            newSubpath1 = subpath1;\n        }\n        else {\n            _a = alignSubpath(subpath1, subpath2), newSubpath1 = _a[0], newSubpath2 = _a[1];\n            lastSubpath1 = newSubpath1;\n            lastSubpath2 = newSubpath2;\n        }\n        newArray1.push(newSubpath1);\n        newArray2.push(newSubpath2);\n    }\n    return [newArray1, newArray2];\n}\nexport function centroid(array) {\n    var signedArea = 0;\n    var cx = 0;\n    var cy = 0;\n    var len = array.length;\n    for (var i = 0, j = len - 2; i < len; j = i, i += 2) {\n        var x0 = array[j];\n        var y0 = array[j + 1];\n        var x1 = array[i];\n        var y1 = array[i + 1];\n        var a = x0 * y1 - x1 * y0;\n        signedArea += a;\n        cx += (x0 + x1) * a;\n        cy += (y0 + y1) * a;\n    }\n    if (signedArea === 0) {\n        return [array[0] || 0, array[1] || 0];\n    }\n    return [cx / signedArea / 3, cy / signedArea / 3, signedArea];\n}\nfunction findBestRingOffset(fromSubBeziers, toSubBeziers, fromCp, toCp) {\n    var bezierCount = (fromSubBeziers.length - 2) / 6;\n    var bestScore = Infinity;\n    var bestOffset = 0;\n    var len = fromSubBeziers.length;\n    var len2 = len - 2;\n    for (var offset = 0; offset < bezierCount; offset++) {\n        var cursorOffset = offset * 6;\n        var score = 0;\n        for (var k = 0; k < len; k += 2) {\n            var idx = k === 0 ? cursorOffset : ((cursorOffset + k - 2) % len2 + 2);\n            var x0 = fromSubBeziers[idx] - fromCp[0];\n            var y0 = fromSubBeziers[idx + 1] - fromCp[1];\n            var x1 = toSubBeziers[k] - toCp[0];\n            var y1 = toSubBeziers[k + 1] - toCp[1];\n            var dx = x1 - x0;\n            var dy = y1 - y0;\n            score += dx * dx + dy * dy;\n        }\n        if (score < bestScore) {\n            bestScore = score;\n            bestOffset = offset;\n        }\n    }\n    return bestOffset;\n}\nfunction reverse(array) {\n    var newArr = [];\n    var len = array.length;\n    for (var i = 0; i < len; i += 2) {\n        newArr[i] = array[len - i - 2];\n        newArr[i + 1] = array[len - i - 1];\n    }\n    return newArr;\n}\nfunction findBestMorphingRotation(fromArr, toArr, searchAngleIteration, searchAngleRange) {\n    var result = [];\n    var fromNeedsReverse;\n    for (var i = 0; i < fromArr.length; i++) {\n        var fromSubpathBezier = fromArr[i];\n        var toSubpathBezier = toArr[i];\n        var fromCp = centroid(fromSubpathBezier);\n        var toCp = centroid(toSubpathBezier);\n        if (fromNeedsReverse == null) {\n            fromNeedsReverse = fromCp[2] < 0 !== toCp[2] < 0;\n        }\n        var newFromSubpathBezier = [];\n        var newToSubpathBezier = [];\n        var bestAngle = 0;\n        var bestScore = Infinity;\n        var tmpArr = [];\n        var len = fromSubpathBezier.length;\n        if (fromNeedsReverse) {\n            fromSubpathBezier = reverse(fromSubpathBezier);\n        }\n        var offset = findBestRingOffset(fromSubpathBezier, toSubpathBezier, fromCp, toCp) * 6;\n        var len2 = len - 2;\n        for (var k = 0; k < len2; k += 2) {\n            var idx = (offset + k) % len2 + 2;\n            newFromSubpathBezier[k + 2] = fromSubpathBezier[idx] - fromCp[0];\n            newFromSubpathBezier[k + 3] = fromSubpathBezier[idx + 1] - fromCp[1];\n        }\n        newFromSubpathBezier[0] = fromSubpathBezier[offset] - fromCp[0];\n        newFromSubpathBezier[1] = fromSubpathBezier[offset + 1] - fromCp[1];\n        if (searchAngleIteration > 0) {\n            var step = searchAngleRange / searchAngleIteration;\n            for (var angle = -searchAngleRange / 2; angle <= searchAngleRange / 2; angle += step) {\n                var sa = Math.sin(angle);\n                var ca = Math.cos(angle);\n                var score = 0;\n                for (var k = 0; k < fromSubpathBezier.length; k += 2) {\n                    var x0 = newFromSubpathBezier[k];\n                    var y0 = newFromSubpathBezier[k + 1];\n                    var x1 = toSubpathBezier[k] - toCp[0];\n                    var y1 = toSubpathBezier[k + 1] - toCp[1];\n                    var newX1 = x1 * ca - y1 * sa;\n                    var newY1 = x1 * sa + y1 * ca;\n                    tmpArr[k] = newX1;\n                    tmpArr[k + 1] = newY1;\n                    var dx = newX1 - x0;\n                    var dy = newY1 - y0;\n                    score += dx * dx + dy * dy;\n                }\n                if (score < bestScore) {\n                    bestScore = score;\n                    bestAngle = angle;\n                    for (var m = 0; m < tmpArr.length; m++) {\n                        newToSubpathBezier[m] = tmpArr[m];\n                    }\n                }\n            }\n        }\n        else {\n            for (var i_1 = 0; i_1 < len; i_1 += 2) {\n                newToSubpathBezier[i_1] = toSubpathBezier[i_1] - toCp[0];\n                newToSubpathBezier[i_1 + 1] = toSubpathBezier[i_1 + 1] - toCp[1];\n            }\n        }\n        result.push({\n            from: newFromSubpathBezier,\n            to: newToSubpathBezier,\n            fromCp: fromCp,\n            toCp: toCp,\n            rotation: -bestAngle\n        });\n    }\n    return result;\n}\nexport function isCombineMorphing(path) {\n    return path.__isCombineMorphing;\n}\nexport function isMorphing(el) {\n    return el.__morphT >= 0;\n}\nvar SAVED_METHOD_PREFIX = '__mOriginal_';\nfunction saveAndModifyMethod(obj, methodName, modifiers) {\n    var savedMethodName = SAVED_METHOD_PREFIX + methodName;\n    var originalMethod = obj[savedMethodName] || obj[methodName];\n    if (!obj[savedMethodName]) {\n        obj[savedMethodName] = obj[methodName];\n    }\n    var replace = modifiers.replace;\n    var after = modifiers.after;\n    var before = modifiers.before;\n    obj[methodName] = function () {\n        var args = arguments;\n        var res;\n        before && before.apply(this, args);\n        if (replace) {\n            res = replace.apply(this, args);\n        }\n        else {\n            res = originalMethod.apply(this, args);\n        }\n        after && after.apply(this, args);\n        return res;\n    };\n}\nfunction restoreMethod(obj, methodName) {\n    var savedMethodName = SAVED_METHOD_PREFIX + methodName;\n    if (obj[savedMethodName]) {\n        obj[methodName] = obj[savedMethodName];\n        obj[savedMethodName] = null;\n    }\n}\nfunction applyTransformOnBeziers(bezierCurves, mm) {\n    for (var i = 0; i < bezierCurves.length; i++) {\n        var subBeziers = bezierCurves[i];\n        for (var k = 0; k < subBeziers.length;) {\n            var x = subBeziers[k];\n            var y = subBeziers[k + 1];\n            subBeziers[k++] = mm[0] * x + mm[2] * y + mm[4];\n            subBeziers[k++] = mm[1] * x + mm[3] * y + mm[5];\n        }\n    }\n}\nfunction prepareMorphPath(fromPath, toPath) {\n    var fromPathProxy = fromPath.getUpdatedPathProxy();\n    var toPathProxy = toPath.getUpdatedPathProxy();\n    var _a = alignBezierCurves(pathToBezierCurves(fromPathProxy), pathToBezierCurves(toPathProxy)), fromBezierCurves = _a[0], toBezierCurves = _a[1];\n    var fromPathTransform = fromPath.getComputedTransform();\n    var toPathTransform = toPath.getComputedTransform();\n    function updateIdentityTransform() {\n        this.transform = null;\n    }\n    fromPathTransform && applyTransformOnBeziers(fromBezierCurves, fromPathTransform);\n    toPathTransform && applyTransformOnBeziers(toBezierCurves, toPathTransform);\n    saveAndModifyMethod(toPath, 'updateTransform', { replace: updateIdentityTransform });\n    toPath.transform = null;\n    var morphingData = findBestMorphingRotation(fromBezierCurves, toBezierCurves, 10, Math.PI);\n    var tmpArr = [];\n    saveAndModifyMethod(toPath, 'buildPath', { replace: function (path) {\n            var t = toPath.__morphT;\n            var onet = 1 - t;\n            var newCp = [];\n            for (var i = 0; i < morphingData.length; i++) {\n                var item = morphingData[i];\n                var from = item.from;\n                var to = item.to;\n                var angle = item.rotation * t;\n                var fromCp = item.fromCp;\n                var toCp = item.toCp;\n                var sa = Math.sin(angle);\n                var ca = Math.cos(angle);\n                lerp(newCp, fromCp, toCp, t);\n                for (var m = 0; m < from.length; m += 2) {\n                    var x0_1 = from[m];\n                    var y0_1 = from[m + 1];\n                    var x1 = to[m];\n                    var y1 = to[m + 1];\n                    var x = x0_1 * onet + x1 * t;\n                    var y = y0_1 * onet + y1 * t;\n                    tmpArr[m] = (x * ca - y * sa) + newCp[0];\n                    tmpArr[m + 1] = (x * sa + y * ca) + newCp[1];\n                }\n                var x0 = tmpArr[0];\n                var y0 = tmpArr[1];\n                path.moveTo(x0, y0);\n                for (var m = 2; m < from.length;) {\n                    var x1 = tmpArr[m++];\n                    var y1 = tmpArr[m++];\n                    var x2 = tmpArr[m++];\n                    var y2 = tmpArr[m++];\n                    var x3 = tmpArr[m++];\n                    var y3 = tmpArr[m++];\n                    if (x0 === x1 && y0 === y1 && x2 === x3 && y2 === y3) {\n                        path.lineTo(x3, y3);\n                    }\n                    else {\n                        path.bezierCurveTo(x1, y1, x2, y2, x3, y3);\n                    }\n                    x0 = x3;\n                    y0 = y3;\n                }\n            }\n        } });\n}\nexport function morphPath(fromPath, toPath, animationOpts) {\n    if (!fromPath || !toPath) {\n        return toPath;\n    }\n    var oldDone = animationOpts.done;\n    var oldDuring = animationOpts.during;\n    prepareMorphPath(fromPath, toPath);\n    toPath.__morphT = 0;\n    function restoreToPath() {\n        restoreMethod(toPath, 'buildPath');\n        restoreMethod(toPath, 'updateTransform');\n        toPath.__morphT = -1;\n        toPath.createPathProxy();\n        toPath.dirtyShape();\n    }\n    toPath.animateTo({\n        __morphT: 1\n    }, defaults({\n        during: function (p) {\n            toPath.dirtyShape();\n            oldDuring && oldDuring(p);\n        },\n        done: function () {\n            restoreToPath();\n            oldDone && oldDone();\n        }\n    }, animationOpts));\n    return toPath;\n}\nfunction hilbert(x, y, minX, minY, maxX, maxY) {\n    var bits = 16;\n    x = (maxX === minX) ? 0 : Math.round(32767 * (x - minX) / (maxX - minX));\n    y = (maxY === minY) ? 0 : Math.round(32767 * (y - minY) / (maxY - minY));\n    var d = 0;\n    var tmp;\n    for (var s = (1 << bits) / 2; s > 0; s /= 2) {\n        var rx = 0;\n        var ry = 0;\n        if ((x & s) > 0) {\n            rx = 1;\n        }\n        if ((y & s) > 0) {\n            ry = 1;\n        }\n        d += s * s * ((3 * rx) ^ ry);\n        if (ry === 0) {\n            if (rx === 1) {\n                x = s - 1 - x;\n                y = s - 1 - y;\n            }\n            tmp = x;\n            x = y;\n            y = tmp;\n        }\n    }\n    return d;\n}\nfunction sortPaths(pathList) {\n    var xMin = Infinity;\n    var yMin = Infinity;\n    var xMax = -Infinity;\n    var yMax = -Infinity;\n    var cps = map(pathList, function (path) {\n        var rect = path.getBoundingRect();\n        var m = path.getComputedTransform();\n        var x = rect.x + rect.width / 2 + (m ? m[4] : 0);\n        var y = rect.y + rect.height / 2 + (m ? m[5] : 0);\n        xMin = Math.min(x, xMin);\n        yMin = Math.min(y, yMin);\n        xMax = Math.max(x, xMax);\n        yMax = Math.max(y, yMax);\n        return [x, y];\n    });\n    var items = map(cps, function (cp, idx) {\n        return {\n            cp: cp,\n            z: hilbert(cp[0], cp[1], xMin, yMin, xMax, yMax),\n            path: pathList[idx]\n        };\n    });\n    return items.sort(function (a, b) { return a.z - b.z; }).map(function (item) { return item.path; });\n}\n;\nfunction defaultDividePath(param) {\n    return split(param.path, param.count);\n}\nfunction createEmptyReturn() {\n    return {\n        fromIndividuals: [],\n        toIndividuals: [],\n        count: 0\n    };\n}\nexport function combineMorph(fromList, toPath, animationOpts) {\n    var fromPathList = [];\n    function addFromPath(fromList) {\n        for (var i = 0; i < fromList.length; i++) {\n            var from = fromList[i];\n            if (isCombineMorphing(from)) {\n                addFromPath(from.childrenRef());\n            }\n            else if (from instanceof Path) {\n                fromPathList.push(from);\n            }\n        }\n    }\n    addFromPath(fromList);\n    var separateCount = fromPathList.length;\n    if (!separateCount) {\n        return createEmptyReturn();\n    }\n    var dividePath = animationOpts.dividePath || defaultDividePath;\n    var toSubPathList = dividePath({\n        path: toPath, count: separateCount\n    });\n    if (toSubPathList.length !== separateCount) {\n        console.error('Invalid morphing: unmatched splitted path');\n        return createEmptyReturn();\n    }\n    fromPathList = sortPaths(fromPathList);\n    toSubPathList = sortPaths(toSubPathList);\n    var oldDone = animationOpts.done;\n    var oldDuring = animationOpts.during;\n    var individualDelay = animationOpts.individualDelay;\n    var identityTransform = new Transformable();\n    for (var i = 0; i < separateCount; i++) {\n        var from = fromPathList[i];\n        var to = toSubPathList[i];\n        to.parent = toPath;\n        to.copyTransform(identityTransform);\n        if (!individualDelay) {\n            prepareMorphPath(from, to);\n        }\n    }\n    toPath.__isCombineMorphing = true;\n    toPath.childrenRef = function () {\n        return toSubPathList;\n    };\n    function addToSubPathListToZr(zr) {\n        for (var i = 0; i < toSubPathList.length; i++) {\n            toSubPathList[i].addSelfToZr(zr);\n        }\n    }\n    saveAndModifyMethod(toPath, 'addSelfToZr', {\n        after: function (zr) {\n            addToSubPathListToZr(zr);\n        }\n    });\n    saveAndModifyMethod(toPath, 'removeSelfFromZr', {\n        after: function (zr) {\n            for (var i = 0; i < toSubPathList.length; i++) {\n                toSubPathList[i].removeSelfFromZr(zr);\n            }\n        }\n    });\n    function restoreToPath() {\n        toPath.__isCombineMorphing = false;\n        toPath.__morphT = -1;\n        toPath.childrenRef = null;\n        restoreMethod(toPath, 'addSelfToZr');\n        restoreMethod(toPath, 'removeSelfFromZr');\n    }\n    var toLen = toSubPathList.length;\n    if (individualDelay) {\n        var animating_1 = toLen;\n        var eachDone = function () {\n            animating_1--;\n            if (animating_1 === 0) {\n                restoreToPath();\n                oldDone && oldDone();\n            }\n        };\n        for (var i = 0; i < toLen; i++) {\n            var indivdualAnimationOpts = individualDelay ? defaults({\n                delay: (animationOpts.delay || 0) + individualDelay(i, toLen, fromPathList[i], toSubPathList[i]),\n                done: eachDone\n            }, animationOpts) : animationOpts;\n            morphPath(fromPathList[i], toSubPathList[i], indivdualAnimationOpts);\n        }\n    }\n    else {\n        toPath.__morphT = 0;\n        toPath.animateTo({\n            __morphT: 1\n        }, defaults({\n            during: function (p) {\n                for (var i = 0; i < toLen; i++) {\n                    var child = toSubPathList[i];\n                    child.__morphT = toPath.__morphT;\n                    child.dirtyShape();\n                }\n                oldDuring && oldDuring(p);\n            },\n            done: function () {\n                restoreToPath();\n                for (var i = 0; i < fromList.length; i++) {\n                    restoreMethod(fromList[i], 'updateTransform');\n                }\n                oldDone && oldDone();\n            }\n        }, animationOpts));\n    }\n    if (toPath.__zr) {\n        addToSubPathListToZr(toPath.__zr);\n    }\n    return {\n        fromIndividuals: fromPathList,\n        toIndividuals: toSubPathList,\n        count: toLen\n    };\n}\nexport function separateMorph(fromPath, toPathList, animationOpts) {\n    var toLen = toPathList.length;\n    var fromPathList = [];\n    var dividePath = animationOpts.dividePath || defaultDividePath;\n    function addFromPath(fromList) {\n        for (var i = 0; i < fromList.length; i++) {\n            var from = fromList[i];\n            if (isCombineMorphing(from)) {\n                addFromPath(from.childrenRef());\n            }\n            else if (from instanceof Path) {\n                fromPathList.push(from);\n            }\n        }\n    }\n    if (isCombineMorphing(fromPath)) {\n        addFromPath(fromPath.childrenRef());\n        var fromLen = fromPathList.length;\n        if (fromLen < toLen) {\n            var k = 0;\n            for (var i = fromLen; i < toLen; i++) {\n                fromPathList.push(clonePath(fromPathList[k++ % fromLen]));\n            }\n        }\n        fromPathList.length = toLen;\n    }\n    else {\n        fromPathList = dividePath({ path: fromPath, count: toLen });\n        var fromPathTransform = fromPath.getComputedTransform();\n        for (var i = 0; i < fromPathList.length; i++) {\n            fromPathList[i].setLocalTransform(fromPathTransform);\n        }\n        if (fromPathList.length !== toLen) {\n            console.error('Invalid morphing: unmatched splitted path');\n            return createEmptyReturn();\n        }\n    }\n    fromPathList = sortPaths(fromPathList);\n    toPathList = sortPaths(toPathList);\n    var individualDelay = animationOpts.individualDelay;\n    for (var i = 0; i < toLen; i++) {\n        var indivdualAnimationOpts = individualDelay ? defaults({\n            delay: (animationOpts.delay || 0) + individualDelay(i, toLen, fromPathList[i], toPathList[i])\n        }, animationOpts) : animationOpts;\n        morphPath(fromPathList[i], toPathList[i], indivdualAnimationOpts);\n    }\n    return {\n        fromIndividuals: fromPathList,\n        toIndividuals: toPathList,\n        count: toPathList.length\n    };\n}\nexport { split as defaultDividePath };\n", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { separateMorph, combineMorph, morphPath, isCombineMorphing } from 'zrender/lib/tool/morphPath.js';\nimport { Path } from '../util/graphic.js';\nimport { defaults, isArray } from 'zrender/lib/core/util.js';\nimport { getAnimationConfig } from './basicTransition.js';\nimport { clonePath } from 'zrender/lib/tool/path.js';\nfunction isMultiple(elements) {\n  return isArray(elements[0]);\n}\nfunction prepareMorphBatches(one, many) {\n  var batches = [];\n  var batchCount = one.length;\n  for (var i = 0; i < batchCount; i++) {\n    batches.push({\n      one: one[i],\n      many: []\n    });\n  }\n  for (var i = 0; i < many.length; i++) {\n    var len = many[i].length;\n    var k = void 0;\n    for (k = 0; k < len; k++) {\n      batches[k % batchCount].many.push(many[i][k]);\n    }\n  }\n  var off = 0;\n  // If one has more paths than each one of many. average them.\n  for (var i = batchCount - 1; i >= 0; i--) {\n    if (!batches[i].many.length) {\n      var moveFrom = batches[off].many;\n      if (moveFrom.length <= 1) {\n        // Not enough\n        // Start from the first one.\n        if (off) {\n          off = 0;\n        } else {\n          return batches;\n        }\n      }\n      var len = moveFrom.length;\n      var mid = Math.ceil(len / 2);\n      batches[i].many = moveFrom.slice(mid, len);\n      batches[off].many = moveFrom.slice(0, mid);\n      off++;\n    }\n  }\n  return batches;\n}\nvar pathDividers = {\n  clone: function (params) {\n    var ret = [];\n    // Fitting the alpha\n    var approxOpacity = 1 - Math.pow(1 - params.path.style.opacity, 1 / params.count);\n    for (var i = 0; i < params.count; i++) {\n      var cloned = clonePath(params.path);\n      cloned.setStyle('opacity', approxOpacity);\n      ret.push(cloned);\n    }\n    return ret;\n  },\n  // Use the default divider\n  split: null\n};\nexport function applyMorphAnimation(from, to, divideShape, seriesModel, dataIndex, animateOtherProps) {\n  if (!from.length || !to.length) {\n    return;\n  }\n  var updateAnimationCfg = getAnimationConfig('update', seriesModel, dataIndex);\n  if (!(updateAnimationCfg && updateAnimationCfg.duration > 0)) {\n    return;\n  }\n  var animationDelay = seriesModel.getModel('universalTransition').get('delay');\n  var animationCfg = Object.assign({\n    // Need to setToFinal so the further calculation based on the style can be correct.\n    // Like emphasis color.\n    setToFinal: true\n  }, updateAnimationCfg);\n  var many;\n  var one;\n  if (isMultiple(from)) {\n    // manyToOne\n    many = from;\n    one = to;\n  }\n  if (isMultiple(to)) {\n    // oneToMany\n    many = to;\n    one = from;\n  }\n  function morphOneBatch(batch, fromIsMany, animateIndex, animateCount, forceManyOne) {\n    var batchMany = batch.many;\n    var batchOne = batch.one;\n    if (batchMany.length === 1 && !forceManyOne) {\n      // Is one to one\n      var batchFrom = fromIsMany ? batchMany[0] : batchOne;\n      var batchTo = fromIsMany ? batchOne : batchMany[0];\n      if (isCombineMorphing(batchFrom)) {\n        // Keep doing combine animation.\n        morphOneBatch({\n          many: [batchFrom],\n          one: batchTo\n        }, true, animateIndex, animateCount, true);\n      } else {\n        var individualAnimationCfg = animationDelay ? defaults({\n          delay: animationDelay(animateIndex, animateCount)\n        }, animationCfg) : animationCfg;\n        morphPath(batchFrom, batchTo, individualAnimationCfg);\n        animateOtherProps(batchFrom, batchTo, batchFrom, batchTo, individualAnimationCfg);\n      }\n    } else {\n      var separateAnimationCfg = defaults({\n        dividePath: pathDividers[divideShape],\n        individualDelay: animationDelay && function (idx, count, fromPath, toPath) {\n          return animationDelay(idx + animateIndex, animateCount);\n        }\n      }, animationCfg);\n      var _a = fromIsMany ? combineMorph(batchMany, batchOne, separateAnimationCfg) : separateMorph(batchOne, batchMany, separateAnimationCfg),\n        fromIndividuals = _a.fromIndividuals,\n        toIndividuals = _a.toIndividuals;\n      var count = fromIndividuals.length;\n      for (var k = 0; k < count; k++) {\n        var individualAnimationCfg = animationDelay ? defaults({\n          delay: animationDelay(k, count)\n        }, animationCfg) : animationCfg;\n        animateOtherProps(fromIndividuals[k], toIndividuals[k], fromIsMany ? batchMany[k] : batch.one, fromIsMany ? batch.one : batchMany[k], individualAnimationCfg);\n      }\n    }\n  }\n  var fromIsMany = many ? many === from\n  // Is one to one. If the path number not match. also needs do merge and separate morphing.\n  : from.length > to.length;\n  var morphBatches = many ? prepareMorphBatches(one, many) : prepareMorphBatches(fromIsMany ? to : from, [fromIsMany ? from : to]);\n  var animateCount = 0;\n  for (var i = 0; i < morphBatches.length; i++) {\n    animateCount += morphBatches[i].many.length;\n  }\n  var animateIndex = 0;\n  for (var i = 0; i < morphBatches.length; i++) {\n    morphOneBatch(morphBatches[i], fromIsMany, animateIndex, animateCount);\n    animateIndex += morphBatches[i].many.length;\n  }\n}\nexport function getPathList(elements) {\n  if (!elements) {\n    return [];\n  }\n  if (isArray(elements)) {\n    var pathList_1 = [];\n    for (var i = 0; i < elements.length; i++) {\n      pathList_1.push(getPathList(elements[i]));\n    }\n    return pathList_1;\n  }\n  var pathList = [];\n  elements.traverse(function (el) {\n    if (el instanceof Path && !el.disableMorphing && !el.invisible && !el.ignore) {\n      pathList.push(el);\n    }\n  });\n  return pathList;\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n// Universal transitions that can animate between any shapes(series) and any properties in any amounts.\nimport { SERIES_UNIVERSAL_TRANSITION_PROP } from '../model/Series.js';\nimport { createHashMap, each, map, filter, isArray, extend } from 'zrender/lib/core/util.js';\nimport { applyMorphAnimation, getPathList } from './morphTransitionHelper.js';\nimport Path from 'zrender/lib/graphic/Path.js';\nimport { initProps } from '../util/graphic.js';\nimport DataDiffer from '../data/DataDiffer.js';\nimport { makeInner, normalizeToArray } from '../util/model.js';\nimport { warn } from '../util/log.js';\nimport { getAnimationConfig, getOldStyle } from './basicTransition.js';\nimport Displayable from 'zrender/lib/graphic/Displayable.js';\nvar DATA_COUNT_THRESHOLD = 1e4;\nvar TRANSITION_NONE = 0;\nvar TRANSITION_P2C = 1;\nvar TRANSITION_C2P = 2;\n;\nvar getUniversalTransitionGlobalStore = makeInner();\nfunction getDimension(data, visualDimension) {\n  var dimensions = data.dimensions;\n  for (var i = 0; i < dimensions.length; i++) {\n    var dimInfo = data.getDimensionInfo(dimensions[i]);\n    if (dimInfo && dimInfo.otherDims[visualDimension] === 0) {\n      return dimensions[i];\n    }\n  }\n}\n// get value by dimension. (only get value of itemGroupId or childGroupId, so convert it to string)\nfunction getValueByDimension(data, dataIndex, dimension) {\n  var dimInfo = data.getDimensionInfo(dimension);\n  var dimOrdinalMeta = dimInfo && dimInfo.ordinalMeta;\n  if (dimInfo) {\n    var value = data.get(dimInfo.name, dataIndex);\n    if (dimOrdinalMeta) {\n      return dimOrdinalMeta.categories[value] || value + '';\n    }\n    return value + '';\n  }\n}\nfunction getGroupId(data, dataIndex, dataGroupId, isChild) {\n  // try to get groupId from encode\n  var visualDimension = isChild ? 'itemChildGroupId' : 'itemGroupId';\n  var groupIdDim = getDimension(data, visualDimension);\n  if (groupIdDim) {\n    var groupId = getValueByDimension(data, dataIndex, groupIdDim);\n    return groupId;\n  }\n  // try to get groupId from raw data item\n  var rawDataItem = data.getRawDataItem(dataIndex);\n  var property = isChild ? 'childGroupId' : 'groupId';\n  if (rawDataItem && rawDataItem[property]) {\n    return rawDataItem[property] + '';\n  }\n  // fallback\n  if (isChild) {\n    return;\n  }\n  // try to use series.dataGroupId as groupId, otherwise use dataItem's id as groupId\n  return dataGroupId || data.getId(dataIndex);\n}\n// flatten all data items from different serieses into one arrary\nfunction flattenDataDiffItems(list) {\n  var items = [];\n  each(list, function (seriesInfo) {\n    var data = seriesInfo.data;\n    var dataGroupId = seriesInfo.dataGroupId;\n    if (data.count() > DATA_COUNT_THRESHOLD) {\n      if (process.env.NODE_ENV !== 'production') {\n        warn('Universal transition is disabled on large data > 10k.');\n      }\n      return;\n    }\n    var indices = data.getIndices();\n    for (var dataIndex = 0; dataIndex < indices.length; dataIndex++) {\n      items.push({\n        data: data,\n        groupId: getGroupId(data, dataIndex, dataGroupId, false),\n        childGroupId: getGroupId(data, dataIndex, dataGroupId, true),\n        divide: seriesInfo.divide,\n        dataIndex: dataIndex\n      });\n    }\n  });\n  return items;\n}\nfunction fadeInElement(newEl, newSeries, newIndex) {\n  newEl.traverse(function (el) {\n    if (el instanceof Path) {\n      // TODO use fade in animation for target element.\n      initProps(el, {\n        style: {\n          opacity: 0\n        }\n      }, newSeries, {\n        dataIndex: newIndex,\n        isFrom: true\n      });\n    }\n  });\n}\nfunction removeEl(el) {\n  if (el.parent) {\n    // Bake parent transform to element.\n    // So it can still have proper transform to transition after it's removed.\n    var computedTransform = el.getComputedTransform();\n    el.setLocalTransform(computedTransform);\n    el.parent.remove(el);\n  }\n}\nfunction stopAnimation(el) {\n  el.stopAnimation();\n  if (el.isGroup) {\n    el.traverse(function (child) {\n      child.stopAnimation();\n    });\n  }\n}\nfunction animateElementStyles(el, dataIndex, seriesModel) {\n  var animationConfig = getAnimationConfig('update', seriesModel, dataIndex);\n  animationConfig && el.traverse(function (child) {\n    if (child instanceof Displayable) {\n      var oldStyle = getOldStyle(child);\n      if (oldStyle) {\n        child.animateFrom({\n          style: oldStyle\n        }, animationConfig);\n      }\n    }\n  });\n}\nfunction isAllIdSame(oldDiffItems, newDiffItems) {\n  var len = oldDiffItems.length;\n  if (len !== newDiffItems.length) {\n    return false;\n  }\n  for (var i = 0; i < len; i++) {\n    var oldItem = oldDiffItems[i];\n    var newItem = newDiffItems[i];\n    if (oldItem.data.getId(oldItem.dataIndex) !== newItem.data.getId(newItem.dataIndex)) {\n      return false;\n    }\n  }\n  return true;\n}\nfunction transitionBetween(oldList, newList, api) {\n  var oldDiffItems = flattenDataDiffItems(oldList);\n  var newDiffItems = flattenDataDiffItems(newList);\n  function updateMorphingPathProps(from, to, rawFrom, rawTo, animationCfg) {\n    if (rawFrom || from) {\n      to.animateFrom({\n        style: rawFrom && rawFrom !== from\n        // dividingMethod like clone may override the style(opacity)\n        // So extend it to raw style.\n        ? extend(extend({}, rawFrom.style), from.style) : from.style\n      }, animationCfg);\n    }\n  }\n  var hasMorphAnimation = false;\n  /**\n   * With groupId and childGroupId, we can build parent-child relationships between dataItems.\n   * However, we should mind the parent-child \"direction\" between old and new options.\n   *\n   * For example, suppose we have two dataItems from two series.data:\n   *\n   * dataA: [                          dataB: [\n   *   {                                 {\n   *     value: 5,                         value: 3,\n   *     groupId: 'creatures',             groupId: 'animals',\n   *     childGroupId: 'animals'           childGroupId: 'dogs'\n   *   },                                },\n   *   ...                               ...\n   * ]                                 ]\n   *\n   * where dataA is belong to optionA and dataB is belong to optionB.\n   *\n   * When we `setOption(optionB)` from optionA, we choose childGroupId of dataItemA and groupId of\n   * dataItemB as keys so the two keys are matched (both are 'animals'), then universalTransition\n   * will work. This derection is \"parent -> child\".\n   *\n   * If we `setOption(optionA)` from optionB, we also choose groupId of dataItemB and childGroupId\n   * of dataItemA as keys and universalTransition will work. This derection is \"child -> parent\".\n   *\n   * If there is no childGroupId specified, which means no multiLevelDrillDown/Up is needed and no\n   * parent-child relationship exists. This direction is \"none\".\n   *\n   * So we need to know whether to use groupId or childGroupId as the key when we call the keyGetter\n   * functions. Thus, we need to decide the direction first.\n   *\n   * The rule is:\n   *\n   * if (all childGroupIds in oldDiffItems and all groupIds in newDiffItems have common value) {\n   *   direction = 'parent -> child';\n   * } else if (all groupIds in oldDiffItems and all childGroupIds in newDiffItems have common value) {\n   *   direction = 'child -> parent';\n   * } else {\n   *   direction = 'none';\n   * }\n   */\n  var direction = TRANSITION_NONE;\n  // find all groupIds and childGroupIds from oldDiffItems\n  var oldGroupIds = createHashMap();\n  var oldChildGroupIds = createHashMap();\n  oldDiffItems.forEach(function (item) {\n    item.groupId && oldGroupIds.set(item.groupId, true);\n    item.childGroupId && oldChildGroupIds.set(item.childGroupId, true);\n  });\n  // traverse newDiffItems and decide the direction according to the rule\n  for (var i = 0; i < newDiffItems.length; i++) {\n    var newGroupId = newDiffItems[i].groupId;\n    if (oldChildGroupIds.get(newGroupId)) {\n      direction = TRANSITION_P2C;\n      break;\n    }\n    var newChildGroupId = newDiffItems[i].childGroupId;\n    if (newChildGroupId && oldGroupIds.get(newChildGroupId)) {\n      direction = TRANSITION_C2P;\n      break;\n    }\n  }\n  function createKeyGetter(isOld, onlyGetId) {\n    return function (diffItem) {\n      var data = diffItem.data;\n      var dataIndex = diffItem.dataIndex;\n      // TODO if specified dim\n      if (onlyGetId) {\n        return data.getId(dataIndex);\n      }\n      if (isOld) {\n        return direction === TRANSITION_P2C ? diffItem.childGroupId : diffItem.groupId;\n      } else {\n        return direction === TRANSITION_C2P ? diffItem.childGroupId : diffItem.groupId;\n      }\n    };\n  }\n  // Use id if it's very likely to be an one to one animation\n  // It's more robust than groupId\n  // TODO Check if key dimension is specified.\n  var useId = isAllIdSame(oldDiffItems, newDiffItems);\n  var isElementStillInChart = {};\n  if (!useId) {\n    // We may have different diff strategy with basicTransition if we use other dimension as key.\n    // If so, we can't simply check if oldEl is same with newEl. We need a map to check if oldEl is still being used in the new chart.\n    // We can't use the elements that already being morphed. Let it keep it's original basic transition.\n    for (var i = 0; i < newDiffItems.length; i++) {\n      var newItem = newDiffItems[i];\n      var el = newItem.data.getItemGraphicEl(newItem.dataIndex);\n      if (el) {\n        isElementStillInChart[el.id] = true;\n      }\n    }\n  }\n  function updateOneToOne(newIndex, oldIndex) {\n    var oldItem = oldDiffItems[oldIndex];\n    var newItem = newDiffItems[newIndex];\n    var newSeries = newItem.data.hostModel;\n    // TODO Mark this elements is morphed and don't morph them anymore\n    var oldEl = oldItem.data.getItemGraphicEl(oldItem.dataIndex);\n    var newEl = newItem.data.getItemGraphicEl(newItem.dataIndex);\n    // Can't handle same elements.\n    if (oldEl === newEl) {\n      newEl && animateElementStyles(newEl, newItem.dataIndex, newSeries);\n      return;\n    }\n    if (\n    // We can't use the elements that already being morphed\n    oldEl && isElementStillInChart[oldEl.id]) {\n      return;\n    }\n    if (newEl) {\n      // TODO: If keep animating the group in case\n      // some of the elements don't want to be morphed.\n      // TODO Label?\n      stopAnimation(newEl);\n      if (oldEl) {\n        stopAnimation(oldEl);\n        // If old element is doing leaving animation. stop it and remove it immediately.\n        removeEl(oldEl);\n        hasMorphAnimation = true;\n        applyMorphAnimation(getPathList(oldEl), getPathList(newEl), newItem.divide, newSeries, newIndex, updateMorphingPathProps);\n      } else {\n        fadeInElement(newEl, newSeries, newIndex);\n      }\n    }\n    // else keep oldEl leaving animation.\n  }\n  new DataDiffer(oldDiffItems, newDiffItems, createKeyGetter(true, useId), createKeyGetter(false, useId), null, 'multiple').update(updateOneToOne).updateManyToOne(function (newIndex, oldIndices) {\n    var newItem = newDiffItems[newIndex];\n    var newData = newItem.data;\n    var newSeries = newData.hostModel;\n    var newEl = newData.getItemGraphicEl(newItem.dataIndex);\n    var oldElsList = filter(map(oldIndices, function (idx) {\n      return oldDiffItems[idx].data.getItemGraphicEl(oldDiffItems[idx].dataIndex);\n    }), function (oldEl) {\n      return oldEl && oldEl !== newEl && !isElementStillInChart[oldEl.id];\n    });\n    if (newEl) {\n      stopAnimation(newEl);\n      if (oldElsList.length) {\n        // If old element is doing leaving animation. stop it and remove it immediately.\n        each(oldElsList, function (oldEl) {\n          stopAnimation(oldEl);\n          removeEl(oldEl);\n        });\n        hasMorphAnimation = true;\n        applyMorphAnimation(getPathList(oldElsList), getPathList(newEl), newItem.divide, newSeries, newIndex, updateMorphingPathProps);\n      } else {\n        fadeInElement(newEl, newSeries, newItem.dataIndex);\n      }\n    }\n    // else keep oldEl leaving animation.\n  }).updateOneToMany(function (newIndices, oldIndex) {\n    var oldItem = oldDiffItems[oldIndex];\n    var oldEl = oldItem.data.getItemGraphicEl(oldItem.dataIndex);\n    // We can't use the elements that already being morphed\n    if (oldEl && isElementStillInChart[oldEl.id]) {\n      return;\n    }\n    var newElsList = filter(map(newIndices, function (idx) {\n      return newDiffItems[idx].data.getItemGraphicEl(newDiffItems[idx].dataIndex);\n    }), function (el) {\n      return el && el !== oldEl;\n    });\n    var newSeris = newDiffItems[newIndices[0]].data.hostModel;\n    if (newElsList.length) {\n      each(newElsList, function (newEl) {\n        return stopAnimation(newEl);\n      });\n      if (oldEl) {\n        stopAnimation(oldEl);\n        // If old element is doing leaving animation. stop it and remove it immediately.\n        removeEl(oldEl);\n        hasMorphAnimation = true;\n        applyMorphAnimation(getPathList(oldEl), getPathList(newElsList), oldItem.divide,\n        // Use divide on old.\n        newSeris, newIndices[0], updateMorphingPathProps);\n      } else {\n        each(newElsList, function (newEl) {\n          return fadeInElement(newEl, newSeris, newIndices[0]);\n        });\n      }\n    }\n    // else keep oldEl leaving animation.\n  }).updateManyToMany(function (newIndices, oldIndices) {\n    // If two data are same and both have groupId.\n    // Normally they should be diff by id.\n    new DataDiffer(oldIndices, newIndices, function (rawIdx) {\n      return oldDiffItems[rawIdx].data.getId(oldDiffItems[rawIdx].dataIndex);\n    }, function (rawIdx) {\n      return newDiffItems[rawIdx].data.getId(newDiffItems[rawIdx].dataIndex);\n    }).update(function (newIndex, oldIndex) {\n      // Use the original index\n      updateOneToOne(newIndices[newIndex], oldIndices[oldIndex]);\n    }).execute();\n  }).execute();\n  if (hasMorphAnimation) {\n    each(newList, function (_a) {\n      var data = _a.data;\n      var seriesModel = data.hostModel;\n      var view = seriesModel && api.getViewOfSeriesModel(seriesModel);\n      var animationCfg = getAnimationConfig('update', seriesModel, 0); // use 0 index.\n      if (view && seriesModel.isAnimationEnabled() && animationCfg && animationCfg.duration > 0) {\n        view.group.traverse(function (el) {\n          if (el instanceof Path && !el.animators.length) {\n            // We can't accept there still exists element that has no animation\n            // if universalTransition is enabled\n            el.animateFrom({\n              style: {\n                opacity: 0\n              }\n            }, animationCfg);\n          }\n        });\n      }\n    });\n  }\n}\nfunction getSeriesTransitionKey(series) {\n  var seriesKey = series.getModel('universalTransition').get('seriesKey');\n  if (!seriesKey) {\n    // Use series id by default.\n    return series.id;\n  }\n  return seriesKey;\n}\nfunction convertArraySeriesKeyToString(seriesKey) {\n  if (isArray(seriesKey)) {\n    // Order independent.\n    return seriesKey.sort().join(',');\n  }\n  return seriesKey;\n}\nfunction getDivideShapeFromData(data) {\n  if (data.hostModel) {\n    return data.hostModel.getModel('universalTransition').get('divideShape');\n  }\n}\nfunction findTransitionSeriesBatches(globalStore, params) {\n  var updateBatches = createHashMap();\n  var oldDataMap = createHashMap();\n  // Map that only store key in array seriesKey.\n  // Which is used to query the old data when transition from one to multiple series.\n  var oldDataMapForSplit = createHashMap();\n  each(globalStore.oldSeries, function (series, idx) {\n    var oldDataGroupId = globalStore.oldDataGroupIds[idx];\n    var oldData = globalStore.oldData[idx];\n    var transitionKey = getSeriesTransitionKey(series);\n    var transitionKeyStr = convertArraySeriesKeyToString(transitionKey);\n    oldDataMap.set(transitionKeyStr, {\n      dataGroupId: oldDataGroupId,\n      data: oldData\n    });\n    if (isArray(transitionKey)) {\n      // Same key can't in different array seriesKey.\n      each(transitionKey, function (key) {\n        oldDataMapForSplit.set(key, {\n          key: transitionKeyStr,\n          dataGroupId: oldDataGroupId,\n          data: oldData\n        });\n      });\n    }\n  });\n  function checkTransitionSeriesKeyDuplicated(transitionKeyStr) {\n    if (updateBatches.get(transitionKeyStr)) {\n      warn(\"Duplicated seriesKey in universalTransition \" + transitionKeyStr);\n    }\n  }\n  each(params.updatedSeries, function (series) {\n    if (series.isUniversalTransitionEnabled() && series.isAnimationEnabled()) {\n      var newDataGroupId = series.get('dataGroupId');\n      var newData = series.getData();\n      var transitionKey = getSeriesTransitionKey(series);\n      var transitionKeyStr = convertArraySeriesKeyToString(transitionKey);\n      // Only transition between series with same id.\n      var oldData = oldDataMap.get(transitionKeyStr);\n      // string transition key is the best match.\n      if (oldData) {\n        if (process.env.NODE_ENV !== 'production') {\n          checkTransitionSeriesKeyDuplicated(transitionKeyStr);\n        }\n        // TODO check if data is same?\n        updateBatches.set(transitionKeyStr, {\n          oldSeries: [{\n            dataGroupId: oldData.dataGroupId,\n            divide: getDivideShapeFromData(oldData.data),\n            data: oldData.data\n          }],\n          newSeries: [{\n            dataGroupId: newDataGroupId,\n            divide: getDivideShapeFromData(newData),\n            data: newData\n          }]\n        });\n      } else {\n        // Transition from multiple series.\n        // e.g. 'female', 'male' -> ['female', 'male']\n        if (isArray(transitionKey)) {\n          if (process.env.NODE_ENV !== 'production') {\n            checkTransitionSeriesKeyDuplicated(transitionKeyStr);\n          }\n          var oldSeries_1 = [];\n          each(transitionKey, function (key) {\n            var oldData = oldDataMap.get(key);\n            if (oldData.data) {\n              oldSeries_1.push({\n                dataGroupId: oldData.dataGroupId,\n                divide: getDivideShapeFromData(oldData.data),\n                data: oldData.data\n              });\n            }\n          });\n          if (oldSeries_1.length) {\n            updateBatches.set(transitionKeyStr, {\n              oldSeries: oldSeries_1,\n              newSeries: [{\n                dataGroupId: newDataGroupId,\n                data: newData,\n                divide: getDivideShapeFromData(newData)\n              }]\n            });\n          }\n        } else {\n          // Try transition to multiple series.\n          // e.g. ['female', 'male'] -> 'female', 'male'\n          var oldData_1 = oldDataMapForSplit.get(transitionKey);\n          if (oldData_1) {\n            var batch = updateBatches.get(oldData_1.key);\n            if (!batch) {\n              batch = {\n                oldSeries: [{\n                  dataGroupId: oldData_1.dataGroupId,\n                  data: oldData_1.data,\n                  divide: getDivideShapeFromData(oldData_1.data)\n                }],\n                newSeries: []\n              };\n              updateBatches.set(oldData_1.key, batch);\n            }\n            batch.newSeries.push({\n              dataGroupId: newDataGroupId,\n              data: newData,\n              divide: getDivideShapeFromData(newData)\n            });\n          }\n        }\n      }\n    }\n  });\n  return updateBatches;\n}\nfunction querySeries(series, finder) {\n  for (var i = 0; i < series.length; i++) {\n    var found = finder.seriesIndex != null && finder.seriesIndex === series[i].seriesIndex || finder.seriesId != null && finder.seriesId === series[i].id;\n    if (found) {\n      return i;\n    }\n  }\n}\nfunction transitionSeriesFromOpt(transitionOpt, globalStore, params, api) {\n  var from = [];\n  var to = [];\n  each(normalizeToArray(transitionOpt.from), function (finder) {\n    var idx = querySeries(globalStore.oldSeries, finder);\n    if (idx >= 0) {\n      from.push({\n        dataGroupId: globalStore.oldDataGroupIds[idx],\n        data: globalStore.oldData[idx],\n        // TODO can specify divideShape in transition.\n        divide: getDivideShapeFromData(globalStore.oldData[idx]),\n        groupIdDim: finder.dimension\n      });\n    }\n  });\n  each(normalizeToArray(transitionOpt.to), function (finder) {\n    var idx = querySeries(params.updatedSeries, finder);\n    if (idx >= 0) {\n      var data = params.updatedSeries[idx].getData();\n      to.push({\n        dataGroupId: globalStore.oldDataGroupIds[idx],\n        data: data,\n        divide: getDivideShapeFromData(data),\n        groupIdDim: finder.dimension\n      });\n    }\n  });\n  if (from.length > 0 && to.length > 0) {\n    transitionBetween(from, to, api);\n  }\n}\nexport function installUniversalTransition(registers) {\n  registers.registerUpdateLifecycle('series:beforeupdate', function (ecMOdel, api, params) {\n    each(normalizeToArray(params.seriesTransition), function (transOpt) {\n      each(normalizeToArray(transOpt.to), function (finder) {\n        var series = params.updatedSeries;\n        for (var i = 0; i < series.length; i++) {\n          if (finder.seriesIndex != null && finder.seriesIndex === series[i].seriesIndex || finder.seriesId != null && finder.seriesId === series[i].id) {\n            series[i][SERIES_UNIVERSAL_TRANSITION_PROP] = true;\n          }\n        }\n      });\n    });\n  });\n  registers.registerUpdateLifecycle('series:transition', function (ecModel, api, params) {\n    // TODO api provide an namespace that can save stuff per instance\n    var globalStore = getUniversalTransitionGlobalStore(api);\n    // TODO multiple to multiple series.\n    if (globalStore.oldSeries && params.updatedSeries && params.optionChanged) {\n      // TODO transitionOpt was used in an old implementation and can be removed now\n      // Use give transition config if its' give;\n      var transitionOpt = params.seriesTransition;\n      if (transitionOpt) {\n        each(normalizeToArray(transitionOpt), function (opt) {\n          transitionSeriesFromOpt(opt, globalStore, params, api);\n        });\n      } else {\n        // Else guess from series based on transition series key.\n        var updateBatches_1 = findTransitionSeriesBatches(globalStore, params);\n        each(updateBatches_1.keys(), function (key) {\n          var batch = updateBatches_1.get(key);\n          transitionBetween(batch.oldSeries, batch.newSeries, api);\n        });\n      }\n      // Reset\n      each(params.updatedSeries, function (series) {\n        // Reset;\n        if (series[SERIES_UNIVERSAL_TRANSITION_PROP]) {\n          series[SERIES_UNIVERSAL_TRANSITION_PROP] = false;\n        }\n      });\n    }\n    // Save all series of current update. Not only the updated one.\n    var allSeries = ecModel.getSeries();\n    var savedSeries = globalStore.oldSeries = [];\n    var savedDataGroupIds = globalStore.oldDataGroupIds = [];\n    var savedData = globalStore.oldData = [];\n    for (var i = 0; i < allSeries.length; i++) {\n      var data = allSeries[i].getData();\n      // Only save the data that can have transition.\n      // Avoid large data costing too much extra memory\n      if (data.count() < DATA_COUNT_THRESHOLD) {\n        savedSeries.push(allSeries[i]);\n        savedDataGroupIds.push(allSeries[i].get('dataGroupId'));\n        savedData.push(data);\n      }\n    }\n  });\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { assert, clone, each, find, isString, map, trim } from 'zrender/lib/core/util.js';\nimport { error } from '../util/log.js';\nimport { registerScaleBreakHelperImpl } from './break.js';\nimport { round as fixRound } from '../util/number.js';\n/**\n * @caution\n *  Must not export anything except `installScaleBreakHelper`\n */\nvar ScaleBreakContextImpl = /** @class */function () {\n  function ScaleBreakContextImpl() {\n    // [CAVEAT]: Should set only by `ScaleBreakContext#setBreaks`!\n    this.breaks = [];\n    // [CAVEAT]: Should update only by `ScaleBreakContext#update`!\n    // They are the values that scaleExtent[0] and scaleExtent[1] are mapped to a numeric axis\n    // that breaks are applied, primarily for optimization of `Scale#normalize`.\n    this._elapsedExtent = [Infinity, -Infinity];\n  }\n  ScaleBreakContextImpl.prototype.setBreaks = function (parsed) {\n    // @ts-ignore\n    this.breaks = parsed.breaks;\n  };\n  /**\n   * [CAVEAT]: Must be called immediately each time scale extent and breaks are updated!\n   */\n  ScaleBreakContextImpl.prototype.update = function (scaleExtent) {\n    updateAxisBreakGapReal(this, scaleExtent);\n    var elapsedExtent = this._elapsedExtent;\n    elapsedExtent[0] = this.elapse(scaleExtent[0]);\n    elapsedExtent[1] = this.elapse(scaleExtent[1]);\n  };\n  ScaleBreakContextImpl.prototype.hasBreaks = function () {\n    return !!this.breaks.length;\n  };\n  /**\n   * When iteratively generating ticks by nice interval, currently the `interval`, which is\n   * calculated by break-elapsed extent span, is probably very small comparing to the original\n   * extent, leading to a large number of iteration and tick generation, even over `safeLimit`.\n   * Thus stepping over breaks is necessary in that loop.\n   *\n   * \"Nice\" should be ensured on ticks when step over the breaks. Thus this method returns\n   * a integer multiple of the \"nice tick interval\".\n   *\n   * This method does little work; it is just for unifying and restricting the behavior.\n   */\n  ScaleBreakContextImpl.prototype.calcNiceTickMultiple = function (tickVal, estimateNiceMultiple) {\n    for (var idx = 0; idx < this.breaks.length; idx++) {\n      var brk = this.breaks[idx];\n      if (brk.vmin < tickVal && tickVal < brk.vmax) {\n        var multiple = estimateNiceMultiple(tickVal, brk.vmax);\n        if (process.env.NODE_ENV !== 'production') {\n          // If not, it may cause dead loop or not nice tick.\n          assert(multiple >= 0 && Math.round(multiple) === multiple);\n        }\n        return multiple;\n      }\n    }\n    return 0;\n  };\n  ScaleBreakContextImpl.prototype.getExtentSpan = function () {\n    return this._elapsedExtent[1] - this._elapsedExtent[0];\n  };\n  ScaleBreakContextImpl.prototype.normalize = function (val) {\n    var elapsedSpan = this._elapsedExtent[1] - this._elapsedExtent[0];\n    // The same logic as `Scale#normalize`.\n    if (elapsedSpan === 0) {\n      return 0.5;\n    }\n    return (this.elapse(val) - this._elapsedExtent[0]) / elapsedSpan;\n  };\n  ScaleBreakContextImpl.prototype.scale = function (val) {\n    return this.unelapse(val * (this._elapsedExtent[1] - this._elapsedExtent[0]) + this._elapsedExtent[0]);\n  };\n  /**\n   * Suppose:\n   *    AXIS_BREAK_LAST_BREAK_END_BASE: 0\n   *    AXIS_BREAK_ELAPSED_BASE: 0\n   *    breaks: [\n   *        {start: -400, end: -300, gap: 27},\n   *        {start: -100, end: 100, gap: 10},\n   *        {start: 200, end: 400, gap: 300},\n   *    ]\n   * The mapping will be:\n   *        |        |\n   *    400 +   ->   +  237\n   *     |  |        |   |  (gap: 300)\n   *    200 +   ->   + -63\n   *        |        |\n   *    100 +   ->   + -163\n   *     |  |        |   |  (gap: 10)\n   *   -100 +   ->   + -173\n   *        |        |\n   *   -300 +   ->   + -373\n   *     |  |        |   |  (gap: 27)\n   *   -400 +   ->   + -400\n   *        |        |\n   *   origianl     elapsed\n   *\n   * Note:\n   *   The mapping has nothing to do with \"scale extent\".\n   */\n  ScaleBreakContextImpl.prototype.elapse = function (val) {\n    // If the value is in the break, return the normalized value in the break\n    var elapsedVal = AXIS_BREAK_ELAPSED_BASE;\n    var lastBreakEnd = AXIS_BREAK_LAST_BREAK_END_BASE;\n    var stillOver = true;\n    for (var i = 0; i < this.breaks.length; i++) {\n      var brk = this.breaks[i];\n      if (val <= brk.vmax) {\n        if (val > brk.vmin) {\n          elapsedVal += brk.vmin - lastBreakEnd + (val - brk.vmin) / (brk.vmax - brk.vmin) * brk.gapReal;\n        } else {\n          elapsedVal += val - lastBreakEnd;\n        }\n        lastBreakEnd = brk.vmax;\n        stillOver = false;\n        break;\n      }\n      elapsedVal += brk.vmin - lastBreakEnd + brk.gapReal;\n      lastBreakEnd = brk.vmax;\n    }\n    if (stillOver) {\n      elapsedVal += val - lastBreakEnd;\n    }\n    return elapsedVal;\n  };\n  ScaleBreakContextImpl.prototype.unelapse = function (elapsedVal) {\n    var lastElapsedEnd = AXIS_BREAK_ELAPSED_BASE;\n    var lastBreakEnd = AXIS_BREAK_LAST_BREAK_END_BASE;\n    var stillOver = true;\n    var unelapsedVal = 0;\n    for (var i = 0; i < this.breaks.length; i++) {\n      var brk = this.breaks[i];\n      var elapsedStart = lastElapsedEnd + brk.vmin - lastBreakEnd;\n      var elapsedEnd = elapsedStart + brk.gapReal;\n      if (elapsedVal <= elapsedEnd) {\n        if (elapsedVal > elapsedStart) {\n          unelapsedVal = brk.vmin + (elapsedVal - elapsedStart) / (elapsedEnd - elapsedStart) * (brk.vmax - brk.vmin);\n        } else {\n          unelapsedVal = lastBreakEnd + elapsedVal - lastElapsedEnd;\n        }\n        lastBreakEnd = brk.vmax;\n        stillOver = false;\n        break;\n      }\n      lastElapsedEnd = elapsedEnd;\n      lastBreakEnd = brk.vmax;\n    }\n    if (stillOver) {\n      unelapsedVal = lastBreakEnd + elapsedVal - lastElapsedEnd;\n    }\n    return unelapsedVal;\n  };\n  return ScaleBreakContextImpl;\n}();\n;\nfunction createScaleBreakContext() {\n  return new ScaleBreakContextImpl();\n}\n// Both can start with any finite value, and are not necessaryily equal. But they need to\n// be the same in `axisBreakElapse` and `axisBreakUnelapse` respectively.\nvar AXIS_BREAK_ELAPSED_BASE = 0;\nvar AXIS_BREAK_LAST_BREAK_END_BASE = 0;\n/**\n * `gapReal` in brkCtx.breaks will be calculated.\n */\nfunction updateAxisBreakGapReal(brkCtx, scaleExtent) {\n  // Considered the effect:\n  //  - Use dataZoom to move some of the breaks outside the extent.\n  //  - Some scenarios that `series.clip: false`.\n  //\n  // How to calculate `prctBrksGapRealSum`:\n  //  Based on the formula:\n  //      xxx.span = brk.vmax - brk.vmin\n  //      xxx.tpPrct.val / xxx.tpAbs.val means ParsedAxisBreak['gapParsed']['val']\n  //      .S/.E means a break that is semi in scaleExtent[0] or scaleExtent[1]\n  //      valP = (\n  //          + (fullyInExtBrksSum.tpAbs.gapReal - fullyInExtBrksSum.tpAbs.span)\n  //          + (semiInExtBrk.S.tpAbs.gapReal - semiInExtBrk.S.tpAbs.span) * semiInExtBrk.S.tpAbs.inExtFrac\n  //          + (semiInExtBrk.E.tpAbs.gapReal - semiInExtBrk.E.tpAbs.span) * semiInExtBrk.E.tpAbs.inExtFrac\n  //      )\n  //      valQ = (\n  //          - fullyInExtBrksSum.tpPrct.span\n  //          - semiInExtBrk.S.tpPrct.span * semiInExtBrk.S.tpPrct.inExtFrac\n  //          - semiInExtBrk.E.tpPrct.span * semiInExtBrk.E.tpPrct.inExtFrac\n  //      )\n  //      gapPrctSum = sum(xxx.tpPrct.val)\n  //      gapPrctSum = prctBrksGapRealSum / (\n  //          + (scaleExtent[1] - scaleExtent[0]) + valP + valQ\n  //          + fullyInExtBrksSum.tpPrct.gapReal\n  //          + semiInExtBrk.S.tpPrct.gapReal * semiInExtBrk.S.tpPrct.inExtFrac\n  //          + semiInExtBrk.E.tpPrct.gapReal * semiInExtBrk.E.tpPrct.inExtFrac\n  //      )\n  //  Assume:\n  //      xxx.tpPrct.gapReal = xxx.tpPrct.val / gapPrctSum * prctBrksGapRealSum\n  //         (NOTE: This is not accurate when semi-in-extent break exist because its\n  //         proportion is not linear, but this assumption approximately works.)\n  //  Derived as follows:\n  //      prctBrksGapRealSum = gapPrctSum * ( (scaleExtent[1] - scaleExtent[0]) + valP + valQ )\n  //          / (1\n  //              - fullyInExtBrksSum.tpPrct.val\n  //              - semiInExtBrk.S.tpPrct.val * semiInExtBrk.S.tpPrct.inExtFrac\n  //              - semiInExtBrk.E.tpPrct.val * semiInExtBrk.E.tpPrct.inExtFrac\n  //          )\n  var gapPrctSum = 0;\n  var fullyInExtBrksSum = {\n    tpAbs: {\n      span: 0,\n      val: 0\n    },\n    tpPrct: {\n      span: 0,\n      val: 0\n    }\n  };\n  var init = function () {\n    return {\n      has: false,\n      span: NaN,\n      inExtFrac: NaN,\n      val: NaN\n    };\n  };\n  var semiInExtBrk = {\n    S: {\n      tpAbs: init(),\n      tpPrct: init()\n    },\n    E: {\n      tpAbs: init(),\n      tpPrct: init()\n    }\n  };\n  each(brkCtx.breaks, function (brk) {\n    var gapParsed = brk.gapParsed;\n    if (gapParsed.type === 'tpPrct') {\n      gapPrctSum += gapParsed.val;\n    }\n    var clampedBrk = clampBreakByExtent(brk, scaleExtent);\n    if (clampedBrk) {\n      var vminClamped = clampedBrk.vmin !== brk.vmin;\n      var vmaxClamped = clampedBrk.vmax !== brk.vmax;\n      var clampedSpan = clampedBrk.vmax - clampedBrk.vmin;\n      if (vminClamped && vmaxClamped) {\n        // Do nothing, which simply makes the result `gapReal` cover the entire scaleExtent.\n        // This transform is not consistent with the other cases but practically works.\n      } else if (vminClamped || vmaxClamped) {\n        var sOrE = vminClamped ? 'S' : 'E';\n        semiInExtBrk[sOrE][gapParsed.type].has = true;\n        semiInExtBrk[sOrE][gapParsed.type].span = clampedSpan;\n        semiInExtBrk[sOrE][gapParsed.type].inExtFrac = clampedSpan / (brk.vmax - brk.vmin);\n        semiInExtBrk[sOrE][gapParsed.type].val = gapParsed.val;\n      } else {\n        fullyInExtBrksSum[gapParsed.type].span += clampedSpan;\n        fullyInExtBrksSum[gapParsed.type].val += gapParsed.val;\n      }\n    }\n  });\n  var prctBrksGapRealSum = gapPrctSum * (0 + (scaleExtent[1] - scaleExtent[0]) + (fullyInExtBrksSum.tpAbs.val - fullyInExtBrksSum.tpAbs.span) + (semiInExtBrk.S.tpAbs.has ? (semiInExtBrk.S.tpAbs.val - semiInExtBrk.S.tpAbs.span) * semiInExtBrk.S.tpAbs.inExtFrac : 0) + (semiInExtBrk.E.tpAbs.has ? (semiInExtBrk.E.tpAbs.val - semiInExtBrk.E.tpAbs.span) * semiInExtBrk.E.tpAbs.inExtFrac : 0) - fullyInExtBrksSum.tpPrct.span - (semiInExtBrk.S.tpPrct.has ? semiInExtBrk.S.tpPrct.span * semiInExtBrk.S.tpPrct.inExtFrac : 0) - (semiInExtBrk.E.tpPrct.has ? semiInExtBrk.E.tpPrct.span * semiInExtBrk.E.tpPrct.inExtFrac : 0)) / (1 - fullyInExtBrksSum.tpPrct.val - (semiInExtBrk.S.tpPrct.has ? semiInExtBrk.S.tpPrct.val * semiInExtBrk.S.tpPrct.inExtFrac : 0) - (semiInExtBrk.E.tpPrct.has ? semiInExtBrk.E.tpPrct.val * semiInExtBrk.E.tpPrct.inExtFrac : 0));\n  each(brkCtx.breaks, function (brk) {\n    var gapParsed = brk.gapParsed;\n    if (gapParsed.type === 'tpPrct') {\n      brk.gapReal = gapPrctSum !== 0\n      // prctBrksGapRealSum is supposed to be non-negative but add a safe guard\n      ? Math.max(prctBrksGapRealSum, 0) * gapParsed.val / gapPrctSum : 0;\n    }\n    if (gapParsed.type === 'tpAbs') {\n      brk.gapReal = gapParsed.val;\n    }\n    if (brk.gapReal == null) {\n      brk.gapReal = 0;\n    }\n  });\n}\nfunction pruneTicksByBreak(pruneByBreak, ticks, breaks, getValue, interval, scaleExtent) {\n  if (pruneByBreak === 'no') {\n    return;\n  }\n  each(breaks, function (brk) {\n    // break.vmin/vmax that out of extent must not impact the visible of\n    // normal ticks and labels.\n    var clampedBrk = clampBreakByExtent(brk, scaleExtent);\n    if (!clampedBrk) {\n      return;\n    }\n    // Remove some normal ticks to avoid zigzag shapes overlapping with split lines\n    // and to avoid break labels overlapping with normal tick labels (thouth it can\n    // also be avoided by `axisLabel.hideOverlap`).\n    // It's OK to O(n^2) since the number of `ticks` are small.\n    for (var j = ticks.length - 1; j >= 0; j--) {\n      var tick = ticks[j];\n      var val = getValue(tick);\n      // 1. Ensure there is no ticks inside `break.vmin` and `break.vmax`.\n      // 2. Use an empirically gap value here. Theoritically `zigzagAmplitude` is\n      //  supposed to be involved to provide better precision but it will brings\n      //  more complexity. The empirically gap value is conservative because break\n      //  labels and normal tick lables are prone to overlapping.\n      var gap = interval * 3 / 4;\n      if (val > clampedBrk.vmin - gap && val < clampedBrk.vmax + gap && (pruneByBreak !== 'preserve_extent_bound' || val !== scaleExtent[0] && val !== scaleExtent[1])) {\n        ticks.splice(j, 1);\n      }\n    }\n  });\n}\nfunction addBreaksToTicks(\n// The input ticks should be in accending order.\nticks, breaks, scaleExtent,\n// Keep the break ends at the same level to avoid an awkward appearance.\ngetTimeProps) {\n  each(breaks, function (brk) {\n    var clampedBrk = clampBreakByExtent(brk, scaleExtent);\n    if (!clampedBrk) {\n      return;\n    }\n    // - When neight `break.vmin` nor `break.vmax` is in scale extent,\n    //  break label should not be displayed and we do not add them to the result.\n    // - When only one of `break.vmin` and `break.vmax` is inside the extent and the\n    //  other is outsite, we comply with the extent and display only part of the breaks area,\n    //  because the extent might be determined by user settings (such as `axis.min/max`)\n    ticks.push({\n      value: clampedBrk.vmin,\n      \"break\": {\n        type: 'vmin',\n        parsedBreak: clampedBrk\n      },\n      time: getTimeProps ? getTimeProps(clampedBrk) : undefined\n    });\n    // When gap is 0, start tick overlap with end tick, but we still count both of them. Break\n    // area shape can address that overlapping. `axisLabel` need draw both start and end separately,\n    // otherwise it brings complexity to the logic of label overlapping resolving (e.g., when label\n    // rotated), and introduces inconsistency to users in `axisLabel.formatter` between gap is 0 or not.\n    ticks.push({\n      value: clampedBrk.vmax,\n      \"break\": {\n        type: 'vmax',\n        parsedBreak: clampedBrk\n      },\n      time: getTimeProps ? getTimeProps(clampedBrk) : undefined\n    });\n  });\n  if (breaks.length) {\n    ticks.sort(function (a, b) {\n      return a.value - b.value;\n    });\n  }\n}\n/**\n * If break and extent does not intersect, return null/undefined.\n * If the intersection is only a point at scaleExtent[0] or scaleExtent[1], return null/undefined.\n */\nfunction clampBreakByExtent(brk, scaleExtent) {\n  var vmin = Math.max(brk.vmin, scaleExtent[0]);\n  var vmax = Math.min(brk.vmax, scaleExtent[1]);\n  return vmin < vmax || vmin === vmax && vmin > scaleExtent[0] && vmin < scaleExtent[1] ? {\n    vmin: vmin,\n    vmax: vmax,\n    breakOption: brk.breakOption,\n    gapParsed: brk.gapParsed,\n    gapReal: brk.gapReal\n  } : null;\n}\nfunction parseAxisBreakOption(\n// raw user input breaks, retrieved from axis model.\nbreakOptionList, parse, opt) {\n  var parsedBreaks = [];\n  if (!breakOptionList) {\n    return {\n      breaks: parsedBreaks\n    };\n  }\n  function validatePercent(normalizedPercent, msg) {\n    if (normalizedPercent >= 0 && normalizedPercent < 1 - 1e-5) {\n      // Avoid division error.\n      return true;\n    }\n    if (process.env.NODE_ENV !== 'production') {\n      error(msg + \" must be >= 0 and < 1, rather than \" + normalizedPercent + \" .\");\n    }\n    return false;\n  }\n  each(breakOptionList, function (brkOption) {\n    if (!brkOption || brkOption.start == null || brkOption.end == null) {\n      if (process.env.NODE_ENV !== 'production') {\n        error('The input axis breaks start/end should not be empty.');\n      }\n      return;\n    }\n    if (brkOption.isExpanded) {\n      return;\n    }\n    var parsedBrk = {\n      breakOption: clone(brkOption),\n      vmin: parse(brkOption.start),\n      vmax: parse(brkOption.end),\n      gapParsed: {\n        type: 'tpAbs',\n        val: 0\n      },\n      gapReal: null\n    };\n    if (brkOption.gap != null) {\n      var isPrct = false;\n      if (isString(brkOption.gap)) {\n        var trimmedGap = trim(brkOption.gap);\n        if (trimmedGap.match(/%$/)) {\n          var normalizedPercent = parseFloat(trimmedGap) / 100;\n          if (!validatePercent(normalizedPercent, 'Percent gap')) {\n            normalizedPercent = 0;\n          }\n          parsedBrk.gapParsed.type = 'tpPrct';\n          parsedBrk.gapParsed.val = normalizedPercent;\n          isPrct = true;\n        }\n      }\n      if (!isPrct) {\n        var absolute = parse(brkOption.gap);\n        if (!isFinite(absolute) || absolute < 0) {\n          if (process.env.NODE_ENV !== 'production') {\n            error(\"Axis breaks gap must positive finite rather than (\" + brkOption.gap + \").\");\n          }\n          absolute = 0;\n        }\n        parsedBrk.gapParsed.type = 'tpAbs';\n        parsedBrk.gapParsed.val = absolute;\n      }\n    }\n    if (parsedBrk.vmin === parsedBrk.vmax) {\n      parsedBrk.gapParsed.type = 'tpAbs';\n      parsedBrk.gapParsed.val = 0;\n    }\n    if (opt && opt.noNegative) {\n      each(['vmin', 'vmax'], function (se) {\n        if (parsedBrk[se] < 0) {\n          if (process.env.NODE_ENV !== 'production') {\n            error(\"Axis break.\" + se + \" must not be negative.\");\n          }\n          parsedBrk[se] = 0;\n        }\n      });\n    }\n    // Ascending numerical order is the prerequisite of the calculation in Scale#normalize.\n    // User are allowed to input desending vmin/vmax for simplifying the usage.\n    if (parsedBrk.vmin > parsedBrk.vmax) {\n      var tmp = parsedBrk.vmax;\n      parsedBrk.vmax = parsedBrk.vmin;\n      parsedBrk.vmin = tmp;\n    }\n    parsedBreaks.push(parsedBrk);\n  });\n  // Ascending numerical order is the prerequisite of the calculation in Scale#normalize.\n  parsedBreaks.sort(function (item1, item2) {\n    return item1.vmin - item2.vmin;\n  });\n  // Make sure that the intervals in breaks are not overlap.\n  var lastEnd = -Infinity;\n  each(parsedBreaks, function (brk, idx) {\n    if (lastEnd > brk.vmin) {\n      if (process.env.NODE_ENV !== 'production') {\n        error('Axis breaks must not overlap.');\n      }\n      parsedBreaks[idx] = null;\n    }\n    lastEnd = brk.vmax;\n  });\n  return {\n    breaks: parsedBreaks.filter(function (brk) {\n      return !!brk;\n    })\n  };\n}\nfunction identifyAxisBreak(brk, identifier) {\n  return serializeAxisBreakIdentifier(identifier) === serializeAxisBreakIdentifier(brk);\n}\nfunction serializeAxisBreakIdentifier(identifier) {\n  // We use user input start/end to identify break. Considered cases like `start: new Date(xxx)`,\n  // Theoretically `Scale#parse` should be used here, but not used currently to reduce dependencies,\n  // since simply converting to string happens to be correct.\n  return identifier.start + '_\\0_' + identifier.end;\n}\n/**\n * - A break pair represents `[vmin, vmax]`,\n * - Only both vmin and vmax item exist, they are counted as a pair.\n */\nfunction retrieveAxisBreakPairs(itemList, getVisualAxisBreak, returnIdx) {\n  var idxPairList = [];\n  each(itemList, function (el, idx) {\n    var vBreak = getVisualAxisBreak(el);\n    if (vBreak && vBreak.type === 'vmin') {\n      idxPairList.push([idx]);\n    }\n  });\n  each(itemList, function (el, idx) {\n    var vBreak = getVisualAxisBreak(el);\n    if (vBreak && vBreak.type === 'vmax') {\n      var idxPair = find(idxPairList,\n      // parsedBreak may be changed, can only use breakOption to match them.\n      function (pr) {\n        return identifyAxisBreak(getVisualAxisBreak(itemList[pr[0]]).parsedBreak.breakOption, vBreak.parsedBreak.breakOption);\n      });\n      idxPair && idxPair.push(idx);\n    }\n  });\n  var result = [];\n  each(idxPairList, function (idxPair) {\n    if (idxPair.length === 2) {\n      result.push(returnIdx ? idxPair : [itemList[idxPair[0]], itemList[idxPair[1]]]);\n    }\n  });\n  return result;\n}\nfunction getTicksLogTransformBreak(tick, logBase, logOriginalBreaks, fixRoundingError) {\n  var vBreak;\n  var brkRoundingCriterion;\n  if (tick[\"break\"]) {\n    var brk = tick[\"break\"].parsedBreak;\n    var originalBreak = find(logOriginalBreaks, function (brk) {\n      return identifyAxisBreak(brk.breakOption, tick[\"break\"].parsedBreak.breakOption);\n    });\n    var vmin = fixRoundingError(Math.pow(logBase, brk.vmin), originalBreak.vmin);\n    var vmax = fixRoundingError(Math.pow(logBase, brk.vmax), originalBreak.vmax);\n    var gapParsed = {\n      type: brk.gapParsed.type,\n      val: brk.gapParsed.type === 'tpAbs' ? fixRound(Math.pow(logBase, brk.vmin + brk.gapParsed.val)) - vmin : brk.gapParsed.val\n    };\n    vBreak = {\n      type: tick[\"break\"].type,\n      parsedBreak: {\n        breakOption: brk.breakOption,\n        vmin: vmin,\n        vmax: vmax,\n        gapParsed: gapParsed,\n        gapReal: brk.gapReal\n      }\n    };\n    brkRoundingCriterion = originalBreak[tick[\"break\"].type];\n  }\n  return {\n    brkRoundingCriterion: brkRoundingCriterion,\n    vBreak: vBreak\n  };\n}\nfunction logarithmicParseBreaksFromOption(breakOptionList, logBase, parse) {\n  var opt = {\n    noNegative: true\n  };\n  var parsedOriginal = parseAxisBreakOption(breakOptionList, parse, opt);\n  var parsedLogged = parseAxisBreakOption(breakOptionList, parse, opt);\n  var loggedBase = Math.log(logBase);\n  parsedLogged.breaks = map(parsedLogged.breaks, function (brk) {\n    var vmin = Math.log(brk.vmin) / loggedBase;\n    var vmax = Math.log(brk.vmax) / loggedBase;\n    var gapParsed = {\n      type: brk.gapParsed.type,\n      val: brk.gapParsed.type === 'tpAbs' ? Math.log(brk.vmin + brk.gapParsed.val) / loggedBase - vmin : brk.gapParsed.val\n    };\n    return {\n      vmin: vmin,\n      vmax: vmax,\n      gapParsed: gapParsed,\n      gapReal: brk.gapReal,\n      breakOption: brk.breakOption\n    };\n  });\n  return {\n    parsedOriginal: parsedOriginal,\n    parsedLogged: parsedLogged\n  };\n}\nvar BREAK_MIN_MAX_TO_PARAM = {\n  vmin: 'start',\n  vmax: 'end'\n};\nfunction makeAxisLabelFormatterParamBreak(extraParam, vBreak) {\n  if (vBreak) {\n    extraParam = extraParam || {};\n    extraParam[\"break\"] = {\n      type: BREAK_MIN_MAX_TO_PARAM[vBreak.type],\n      start: vBreak.parsedBreak.vmin,\n      end: vBreak.parsedBreak.vmax\n    };\n  }\n  return extraParam;\n}\nexport function installScaleBreakHelper() {\n  registerScaleBreakHelperImpl({\n    createScaleBreakContext: createScaleBreakContext,\n    pruneTicksByBreak: pruneTicksByBreak,\n    addBreaksToTicks: addBreaksToTicks,\n    parseAxisBreakOption: parseAxisBreakOption,\n    identifyAxisBreak: identifyAxisBreak,\n    serializeAxisBreakIdentifier: serializeAxisBreakIdentifier,\n    retrieveAxisBreakPairs: retrieveAxisBreakPairs,\n    getTicksLogTransformBreak: getTicksLogTransformBreak,\n    logarithmicParseBreaksFromOption: logarithmicParseBreaksFromOption,\n    makeAxisLabelFormatterParamBreak: makeAxisLabelFormatterParamBreak\n  });\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { makeInner } from '../../util/model.js';\nimport { assert, each, extend, find, map } from 'zrender/lib/core/util.js';\nimport { getScaleBreakHelper } from '../../scale/break.js';\nimport { subPixelOptimizeLine } from 'zrender/lib/graphic/helper/subPixelOptimize.js';\nimport { applyTransform } from 'zrender/lib/core/vector.js';\nimport * as matrixUtil from 'zrender/lib/core/matrix.js';\nimport { AXIS_BREAK_COLLAPSE_ACTION_TYPE, AXIS_BREAK_EXPAND_ACTION_TYPE, AXIS_BREAK_TOGGLE_ACTION_TYPE } from './axisAction.js';\nimport { labelIntersect, labelLayoutApplyTranslation } from '../../label/labelLayoutHelper.js';\nimport { registerAxisBreakHelperImpl } from './axisBreakHelper.js';\nimport { warn } from '../../util/log.js';\nimport { Group, Line, Point, Polygon, Polyline, WH, XY } from '../../util/graphic.js';\n/**\n * @caution\n *  Must not export anything except `installAxisBreakHelper`\n */\n/**\n * The zigzag shapes for axis breaks are generated according to some random\n * factors. It should persist as much as possible to avoid constantly\n * changing by every user operation.\n */\nvar viewCache = makeInner();\nfunction ensureVisualInCache(visualList, targetBreak) {\n  var visual = find(visualList, function (item) {\n    return getScaleBreakHelper().identifyAxisBreak(item.parsedBreak.breakOption, targetBreak.breakOption);\n  });\n  if (!visual) {\n    visualList.push(visual = {\n      zigzagRandomList: [],\n      parsedBreak: targetBreak,\n      shouldRemove: false\n    });\n  }\n  return visual;\n}\nfunction resetCacheVisualRemoveFlag(visualList) {\n  each(visualList, function (item) {\n    return item.shouldRemove = true;\n  });\n}\nfunction removeUnusedCacheVisual(visualList) {\n  for (var i = visualList.length - 1; i >= 0; i--) {\n    if (visualList[i].shouldRemove) {\n      visualList.splice(i, 1);\n    }\n  }\n}\nfunction rectCoordBuildBreakAxis(axisGroup, axisView, axisModel, coordSysRect, api) {\n  var axis = axisModel.axis;\n  if (axis.scale.isBlank() || !getScaleBreakHelper()) {\n    return;\n  }\n  var breakPairs = getScaleBreakHelper().retrieveAxisBreakPairs(axis.scale.getTicks({\n    breakTicks: 'only_break'\n  }), function (tick) {\n    return tick[\"break\"];\n  }, false);\n  if (!breakPairs.length) {\n    return;\n  }\n  var breakAreaModel = axisModel.getModel('breakArea');\n  var zigzagAmplitude = breakAreaModel.get('zigzagAmplitude');\n  var zigzagMinSpan = breakAreaModel.get('zigzagMinSpan');\n  var zigzagMaxSpan = breakAreaModel.get('zigzagMaxSpan');\n  // Use arbitrary value to avoid dead loop if user gives inappropriate settings.\n  zigzagMinSpan = Math.max(2, zigzagMinSpan || 0);\n  zigzagMaxSpan = Math.max(zigzagMinSpan, zigzagMaxSpan || 0);\n  var expandOnClick = breakAreaModel.get('expandOnClick');\n  var zigzagZ = breakAreaModel.get('zigzagZ');\n  var itemStyleModel = breakAreaModel.getModel('itemStyle');\n  var itemStyle = itemStyleModel.getItemStyle();\n  var borderColor = itemStyle.stroke;\n  var borderWidth = itemStyle.lineWidth;\n  var borderType = itemStyle.lineDash;\n  var color = itemStyle.fill;\n  var group = new Group({\n    ignoreModelZ: true\n  });\n  var isAxisHorizontal = axis.isHorizontal();\n  var cachedVisualList = viewCache(axisView).visualList || (viewCache(axisView).visualList = []);\n  resetCacheVisualRemoveFlag(cachedVisualList);\n  var _loop_1 = function (i) {\n    var parsedBreak = breakPairs[i][0][\"break\"].parsedBreak;\n    // Even if brk.gap is 0, we should also draw the breakArea because\n    // border is sometimes required to be visible (as a line)\n    var coords = [];\n    coords[0] = axis.toGlobalCoord(axis.dataToCoord(parsedBreak.vmin, true));\n    coords[1] = axis.toGlobalCoord(axis.dataToCoord(parsedBreak.vmax, true));\n    if (coords[1] < coords[0]) {\n      coords.reverse();\n    }\n    var cachedVisual = ensureVisualInCache(cachedVisualList, parsedBreak);\n    cachedVisual.shouldRemove = false;\n    var breakGroup = new Group();\n    addZigzagShapes(cachedVisual.zigzagRandomList, breakGroup, coords[0], coords[1], isAxisHorizontal, parsedBreak);\n    if (expandOnClick) {\n      breakGroup.on('click', function () {\n        var payload = {\n          type: AXIS_BREAK_EXPAND_ACTION_TYPE,\n          breaks: [{\n            start: parsedBreak.breakOption.start,\n            end: parsedBreak.breakOption.end\n          }]\n        };\n        payload[axis.dim + \"AxisIndex\"] = axisModel.componentIndex;\n        api.dispatchAction(payload);\n      });\n    }\n    breakGroup.silent = !expandOnClick;\n    group.add(breakGroup);\n  };\n  for (var i = 0; i < breakPairs.length; i++) {\n    _loop_1(i);\n  }\n  axisGroup.add(group);\n  removeUnusedCacheVisual(cachedVisualList);\n  function addZigzagShapes(zigzagRandomList, breakGroup, startCoord, endCoord, isAxisHorizontal, trimmedBreak) {\n    var polylineStyle = {\n      stroke: borderColor,\n      lineWidth: borderWidth,\n      lineDash: borderType,\n      fill: 'none'\n    };\n    var dimBrk = isAxisHorizontal ? 0 : 1;\n    var dimZigzag = 1 - dimBrk;\n    var zigzagCoordMax = coordSysRect[XY[dimZigzag]] + coordSysRect[WH[dimZigzag]];\n    // Apply `subPixelOptimizeLine` for alignning with break ticks.\n    function subPixelOpt(brkCoord) {\n      var pBrk = [];\n      var dummyP = [];\n      pBrk[dimBrk] = dummyP[dimBrk] = brkCoord;\n      pBrk[dimZigzag] = coordSysRect[XY[dimZigzag]];\n      dummyP[dimZigzag] = zigzagCoordMax;\n      var dummyShape = {\n        x1: pBrk[0],\n        y1: pBrk[1],\n        x2: dummyP[0],\n        y2: dummyP[1]\n      };\n      subPixelOptimizeLine(dummyShape, dummyShape, {\n        lineWidth: 1\n      });\n      pBrk[0] = dummyShape.x1;\n      pBrk[1] = dummyShape.y1;\n      return pBrk[dimBrk];\n    }\n    startCoord = subPixelOpt(startCoord);\n    endCoord = subPixelOpt(endCoord);\n    var pointsA = [];\n    var pointsB = [];\n    var isSwap = true;\n    var current = coordSysRect[XY[dimZigzag]];\n    for (var idx = 0;; idx++) {\n      // Use `isFirstPoint` `isLastPoint` to ensure the intersections between zigzag\n      // and axis are precise, thus it can join its axis tick correctly.\n      var isFirstPoint = current === coordSysRect[XY[dimZigzag]];\n      var isLastPoint = current >= zigzagCoordMax;\n      if (isLastPoint) {\n        current = zigzagCoordMax;\n      }\n      var pA = [];\n      var pB = [];\n      pA[dimBrk] = startCoord;\n      pB[dimBrk] = endCoord;\n      if (!isFirstPoint && !isLastPoint) {\n        pA[dimBrk] += isSwap ? -zigzagAmplitude : zigzagAmplitude;\n        pB[dimBrk] -= !isSwap ? -zigzagAmplitude : zigzagAmplitude;\n      }\n      pA[dimZigzag] = current;\n      pB[dimZigzag] = current;\n      pointsA.push(pA);\n      pointsB.push(pB);\n      var randomVal = void 0;\n      if (idx < zigzagRandomList.length) {\n        randomVal = zigzagRandomList[idx];\n      } else {\n        randomVal = Math.random();\n        zigzagRandomList.push(randomVal);\n      }\n      current += randomVal * (zigzagMaxSpan - zigzagMinSpan) + zigzagMinSpan;\n      isSwap = !isSwap;\n      if (isLastPoint) {\n        break;\n      }\n    }\n    var anidSuffix = getScaleBreakHelper().serializeAxisBreakIdentifier(trimmedBreak.breakOption);\n    // Create two polylines and add them to the breakGroup\n    breakGroup.add(new Polyline({\n      anid: \"break_a_\" + anidSuffix,\n      shape: {\n        points: pointsA\n      },\n      style: polylineStyle,\n      z: zigzagZ\n    }));\n    /* Add the second polyline and a polygon only if the gap is not zero\n     * Otherwise if the polyline is with dashed line or being opaque,\n     * it may not be constant with breaks with non-zero gaps. */\n    if (trimmedBreak.gapReal !== 0) {\n      breakGroup.add(new Polyline({\n        anid: \"break_b_\" + anidSuffix,\n        shape: {\n          // Not reverse to keep the dash stable when dragging resizing.\n          points: pointsB\n        },\n        style: polylineStyle,\n        z: zigzagZ\n      }));\n      // Creating the polygon that fills the area between the polylines\n      // From end to start for polygon.\n      var pointsB2 = pointsB.slice();\n      pointsB2.reverse();\n      var polygonPoints = pointsA.concat(pointsB2);\n      breakGroup.add(new Polygon({\n        anid: \"break_c_\" + anidSuffix,\n        shape: {\n          points: polygonPoints\n        },\n        style: {\n          fill: color,\n          opacity: itemStyle.opacity\n        },\n        z: zigzagZ\n      }));\n    }\n  }\n}\nfunction buildAxisBreakLine(axisModel, group, transformGroup, pathBaseProp) {\n  var axis = axisModel.axis;\n  var transform = transformGroup.transform;\n  assert(pathBaseProp.style);\n  var extent = axis.getExtent();\n  if (axis.inverse) {\n    extent = extent.slice();\n    extent.reverse();\n  }\n  var breakPairs = getScaleBreakHelper().retrieveAxisBreakPairs(axis.scale.getTicks({\n    breakTicks: 'only_break'\n  }), function (tick) {\n    return tick[\"break\"];\n  }, false);\n  var brkLayoutList = map(breakPairs, function (breakPair) {\n    var parsedBreak = breakPair[0][\"break\"].parsedBreak;\n    var coordPair = [axis.dataToCoord(parsedBreak.vmin, true), axis.dataToCoord(parsedBreak.vmax, true)];\n    coordPair[0] > coordPair[1] && coordPair.reverse();\n    return {\n      coordPair: coordPair,\n      brkId: getScaleBreakHelper().serializeAxisBreakIdentifier(parsedBreak.breakOption)\n    };\n  });\n  brkLayoutList.sort(function (layout1, layout2) {\n    return layout1.coordPair[0] - layout2.coordPair[0];\n  });\n  var ySegMin = extent[0];\n  var lastLayout = null;\n  for (var idx = 0; idx < brkLayoutList.length; idx++) {\n    var layout = brkLayoutList[idx];\n    var brkTirmmedMin = Math.max(layout.coordPair[0], extent[0]);\n    var brkTirmmedMax = Math.min(layout.coordPair[1], extent[1]);\n    if (ySegMin <= brkTirmmedMin) {\n      addSeg(ySegMin, brkTirmmedMin, lastLayout, layout);\n    }\n    ySegMin = brkTirmmedMax;\n    lastLayout = layout;\n  }\n  if (ySegMin <= extent[1]) {\n    addSeg(ySegMin, extent[1], lastLayout, null);\n  }\n  function addSeg(min, max, layout1, layout2) {\n    function trans(p1, p2) {\n      if (transform) {\n        applyTransform(p1, p1, transform);\n        applyTransform(p2, p2, transform);\n      }\n    }\n    function subPixelOptimizePP(p1, p2) {\n      var shape = {\n        x1: p1[0],\n        y1: p1[1],\n        x2: p2[0],\n        y2: p2[1]\n      };\n      subPixelOptimizeLine(shape, shape, pathBaseProp.style);\n      p1[0] = shape.x1;\n      p1[1] = shape.y1;\n      p2[0] = shape.x2;\n      p2[1] = shape.y2;\n    }\n    var lineP1 = [min, 0];\n    var lineP2 = [max, 0];\n    // dummy tick is used to align the line segment ends with axis ticks\n    // after `subPixelOptimizeLine` being applied.\n    var dummyTickEnd1 = [min, 5];\n    var dummyTickEnd2 = [max, 5];\n    trans(lineP1, dummyTickEnd1);\n    subPixelOptimizePP(lineP1, dummyTickEnd1);\n    trans(lineP2, dummyTickEnd2);\n    subPixelOptimizePP(lineP2, dummyTickEnd2);\n    // Apply it keeping the same as the normal axis line.\n    subPixelOptimizePP(lineP1, lineP2);\n    var seg = new Line(extend({\n      shape: {\n        x1: lineP1[0],\n        y1: lineP1[1],\n        x2: lineP2[0],\n        y2: lineP2[1]\n      }\n    }, pathBaseProp));\n    group.add(seg);\n    // Animation should be precise to be consistent with tick and split line animation.\n    seg.anid = \"breakLine_\" + (layout1 ? layout1.brkId : '\\0') + \"_\\0_\" + (layout2 ? layout2.brkId : '\\0');\n  }\n}\n/**\n * Resolve the overlap of a pair of labels.\n *\n * [CAUTION] Only label.x/y are allowed to change.\n */\nfunction adjustBreakLabelPair(axisInverse, axisRotation, layoutPair) {\n  if (find(layoutPair, function (item) {\n    return !item;\n  })) {\n    return;\n  }\n  var mtv = new Point();\n  if (!labelIntersect(layoutPair[0], layoutPair[1], mtv, {\n    // Assert `labelPair` is `[break_min, break_max]`.\n    // `axis.inverse: true` means a smaller scale value corresponds to a bigger value in axis.extent.\n    // The axisRotation indicates mtv direction of OBB intersecting.\n    direction: -(axisInverse ? axisRotation + Math.PI : axisRotation),\n    touchThreshold: 0,\n    // If need to resovle intersection align axis by moving labels according to MTV,\n    // the direction must not be opposite, otherwise cause misleading.\n    bidirectional: false\n  })) {\n    return;\n  }\n  // Rotate axis back to (1, 0) direction, to be a standard axis.\n  var axisStTrans = matrixUtil.create();\n  matrixUtil.rotate(axisStTrans, axisStTrans, -axisRotation);\n  var labelPairStTrans = map(layoutPair, function (layout) {\n    return layout.transform ? matrixUtil.mul(matrixUtil.create(), axisStTrans, layout.transform) : axisStTrans;\n  });\n  function isParallelToAxis(whIdx) {\n    // Assert label[0] and label[1] has the same rotation, so only use [0].\n    var localRect = layoutPair[0].localRect;\n    var labelVec0 = new Point(localRect[WH[whIdx]] * labelPairStTrans[0][0], localRect[WH[whIdx]] * labelPairStTrans[0][1]);\n    return Math.abs(labelVec0.y) < 1e-5;\n  }\n  // If overlapping, move pair[0] pair[1] apart a little. We need to calculate a ratio k to\n  // distribute mtv to pair[0] and pair[1]. This is to place the text gap as close as possible\n  // to the center of the break ticks, otherwise it might looks weird or misleading.\n  // - When labels' width/height are not parallel to axis (usually by rotation),\n  //  we can simply treat the k as `0.5`.\n  var k = 0.5;\n  // - When labels' width/height are parallel to axis, the width/height need to be considered,\n  //  since they may differ significantly. In this case we keep textAlign as 'center' rather\n  //  than 'left'/'right', due to considerations of space utilization for wide break.gap.\n  //  A sample case: break on xAxis(no inverse) is [200, 300000].\n  //  We calculate k based on the formula below:\n  //      Rotated axis and labels to the direction of (1, 0).\n  //      uval = ( (pair[0].insidePt - mtv*k) + (pair[1].insidePt + mtv*(1-k)) ) / 2 - brkCenter\n  //      0 <= k <= 1\n  //      |uval| should be as small as possible.\n  //  Derived as follows:\n  //      qval = (pair[0].insidePt + pair[1].insidePt + mtv) / 2 - brkCenter\n  //      k = (qval - uval) / mtv\n  //      min(qval, qval-mtv) <= uval <= max(qval, qval-mtv)\n  if (isParallelToAxis(0) || isParallelToAxis(1)) {\n    var rectSt = map(layoutPair, function (layout, idx) {\n      var rect = layout.localRect.clone();\n      rect.applyTransform(labelPairStTrans[idx]);\n      return rect;\n    });\n    var brkCenterSt = new Point();\n    brkCenterSt.copy(layoutPair[0].label).add(layoutPair[1].label).scale(0.5);\n    brkCenterSt.transform(axisStTrans);\n    var mtvSt = mtv.clone().transform(axisStTrans);\n    var insidePtSum = rectSt[0].x + rectSt[1].x + (mtvSt.x >= 0 ? rectSt[0].width : rectSt[1].width);\n    var qval = (insidePtSum + mtvSt.x) / 2 - brkCenterSt.x;\n    var uvalMin = Math.min(qval, qval - mtvSt.x);\n    var uvalMax = Math.max(qval, qval - mtvSt.x);\n    var uval = uvalMax < 0 ? uvalMax : uvalMin > 0 ? uvalMin : 0;\n    k = (qval - uval) / mtvSt.x;\n  }\n  var delta0 = new Point();\n  var delta1 = new Point();\n  Point.scale(delta0, mtv, -k);\n  Point.scale(delta1, mtv, 1 - k);\n  labelLayoutApplyTranslation(layoutPair[0], delta0);\n  labelLayoutApplyTranslation(layoutPair[1], delta1);\n}\nfunction updateModelAxisBreak(model, payload) {\n  var result = {\n    breaks: []\n  };\n  each(payload.breaks, function (inputBrk) {\n    if (!inputBrk) {\n      return;\n    }\n    var breakOption = find(model.get('breaks', true), function (brkOption) {\n      return getScaleBreakHelper().identifyAxisBreak(brkOption, inputBrk);\n    });\n    if (!breakOption) {\n      if (process.env.NODE_ENV !== 'production') {\n        warn(\"Can not find axis break by start: \" + inputBrk.start + \", end: \" + inputBrk.end);\n      }\n      return;\n    }\n    var actionType = payload.type;\n    var old = {\n      isExpanded: !!breakOption.isExpanded\n    };\n    breakOption.isExpanded = actionType === AXIS_BREAK_EXPAND_ACTION_TYPE ? true : actionType === AXIS_BREAK_COLLAPSE_ACTION_TYPE ? false : actionType === AXIS_BREAK_TOGGLE_ACTION_TYPE ? !breakOption.isExpanded : breakOption.isExpanded;\n    result.breaks.push({\n      start: breakOption.start,\n      end: breakOption.end,\n      isExpanded: !!breakOption.isExpanded,\n      old: old\n    });\n  });\n  return result;\n}\nexport function installAxisBreakHelper() {\n  registerAxisBreakHelperImpl({\n    adjustBreakLabelPair: adjustBreakLabelPair,\n    buildAxisBreakLine: buildAxisBreakLine,\n    rectCoordBuildBreakAxis: rectCoordBuildBreakAxis,\n    updateModelAxisBreak: updateModelAxisBreak\n  });\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { installScaleBreakHelper } from '../../scale/breakImpl.js';\nimport { registerAction } from './axisAction.js';\nimport { installAxisBreakHelper } from './axisBreakHelperImpl.js';\nexport function installAxisBreak(registers) {\n  registerAction(registers);\n  installScaleBreakHelper();\n  installAxisBreakHelper();\n}", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements.  See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership.  The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License.  You may obtain a copy of the License at\n*\n*   http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied.  See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport BoundingRect from 'zrender/lib/core/BoundingRect.js';\nimport { each } from 'zrender/lib/core/util.js';\nimport { registerLegacyGridContainLabelImpl } from './Grid.js';\nimport OrdinalScale from '../../scale/Ordinal.js';\nimport { makeLabelFormatter } from '../axisHelper.js';\n/**\n * [CAUTION] Never export methods other than `installLegacyGridContainLabel`.\n */\nexport function installLegacyGridContainLabel() {\n  registerLegacyGridContainLabelImpl(legacyLayOutGridByContained);\n}\n/**\n * The input gridRect and axes will be modified.\n */\nfunction legacyLayOutGridByContained(axesList, gridRect) {\n  each(axesList, function (axis) {\n    if (!axis.model.get(['axisLabel', 'inside'])) {\n      var labelUnionRect = estimateLabelUnionRect(axis);\n      if (labelUnionRect) {\n        var dim = axis.isHorizontal() ? 'height' : 'width';\n        var margin = axis.model.get(['axisLabel', 'margin']);\n        gridRect[dim] -= labelUnionRect[dim] + margin;\n        if (axis.position === 'top') {\n          gridRect.y += labelUnionRect.height + margin;\n        } else if (axis.position === 'left') {\n          gridRect.x += labelUnionRect.width + margin;\n        }\n      }\n    }\n  });\n}\n/**\n * @return Be null/undefined if no labels.\n */\nfunction estimateLabelUnionRect(axis) {\n  var axisModel = axis.model;\n  var scale = axis.scale;\n  if (!axisModel.get(['axisLabel', 'show']) || scale.isBlank()) {\n    return;\n  }\n  var realNumberScaleTicks;\n  var tickCount;\n  var categoryScaleExtent = scale.getExtent();\n  // Optimize for large category data, avoid call `getTicks()`.\n  if (scale instanceof OrdinalScale) {\n    tickCount = scale.count();\n  } else {\n    realNumberScaleTicks = scale.getTicks();\n    tickCount = realNumberScaleTicks.length;\n  }\n  var axisLabelModel = axis.getLabelModel();\n  var labelFormatter = makeLabelFormatter(axis);\n  var rect;\n  var step = 1;\n  // Simple optimization for large amount of category labels\n  if (tickCount > 40) {\n    step = Math.ceil(tickCount / 40);\n  }\n  for (var i = 0; i < tickCount; i += step) {\n    var tick = realNumberScaleTicks ? realNumberScaleTicks[i] : {\n      value: categoryScaleExtent[0] + i\n    };\n    var label = labelFormatter(tick, i);\n    var unrotatedSingleRect = axisLabelModel.getTextRect(label);\n    var singleRect = rotateTextRect(unrotatedSingleRect, axisLabelModel.get('rotate') || 0);\n    rect ? rect.union(singleRect) : rect = singleRect;\n  }\n  return rect;\n  function rotateTextRect(textRect, rotate) {\n    var rotateRadians = rotate * Math.PI / 180;\n    var beforeWidth = textRect.width;\n    var beforeHeight = textRect.height;\n    var afterWidth = beforeWidth * Math.abs(Math.cos(rotateRadians)) + Math.abs(beforeHeight * Math.sin(rotateRadians));\n    var afterHeight = beforeWidth * Math.abs(Math.sin(rotateRadians)) + Math.abs(beforeHeight * Math.cos(rotateRadians));\n    var rotatedRect = new BoundingRect(textRect.x, textRect.y, afterWidth, afterHeight);\n    return rotatedRect;\n  }\n}", "// Entry point for the build script in your package.json\nimport \"@hotwired/turbo-rails\"\nimport \"./controllers\"\nimport * as bootstrap from \"bootstrap\"\nimport * as echarts from \"echarts\"\nimport L from \"leaflet\"\nimport maplibregl from \"maplibre-gl\"\nimport \"./custom/add_jquery\"\nimport \"./falcon/theme\"\nimport \"./custom/general_jquery\"\nimport \"./custom/vincoli_jquery\"\nimport \"./custom/catasto_jquery\"\nimport \"./jquery/flexdatalist/jquery.flexdatalist.min.js\"\n\nwindow.bootstrap = bootstrap\nwindow.echarts = echarts\nwindow.L = L\nwindow.maplibregl = maplibregl\n\nimport(\"./custom/mappe_jquery\")\n", "import jquery from 'jquery'\nwindow.jQuery = jquery\nwindow.$ = jquery\n", "/* -------------------------------------------------------------------------- */\r\n/*                                    Utils                                   */\r\n/* -------------------------------------------------------------------------- */\r\nconst docReady = fn => {\r\n  // see if DOM is already available\r\n  if (document.readyState === 'loading') {\r\n    document.addEventListener('DOMContentLoaded', fn);\r\n  } else {\r\n    setTimeout(fn, 1);\r\n  }\r\n};\r\n\r\nconst resize = fn => window.addEventListener('resize', fn);\r\n\r\nconst isIterableArray = array => Array.isArray(array) && !!array.length;\r\n\r\nconst camelize = str => {\r\n  const text = str.replace(/[-_\\s.]+(.)?/g, (_, c) => (c ? c.toUpperCase() : ''));\r\n  return `${text.substr(0, 1).toLowerCase()}${text.substr(1)}`;\r\n};\r\n\r\nconst getData = (el, data) => {\r\n  try {\r\n    return JSON.parse(el.dataset[camelize(data)]);\r\n  } catch (e) {\r\n    return el.dataset[camelize(data)];\r\n  }\r\n};\r\n\r\n/* ----------------------------- Colors function ---------------------------- */\r\n\r\nconst hexToRgb = hexValue => {\r\n  let hex;\r\n  hexValue.indexOf('#') === 0 ? (hex = hexValue.substring(1)) : (hex = hexValue);\r\n  // Expand shorthand form (e.g. \"03F\") to full form (e.g. \"0033FF\")\r\n  const shorthandRegex = /^#?([a-f\\d])([a-f\\d])([a-f\\d])$/i;\r\n  const result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(\r\n    hex.replace(shorthandRegex, (m, r, g, b) => r + r + g + g + b + b)\r\n  );\r\n  return result\r\n    ? [parseInt(result[1], 16), parseInt(result[2], 16), parseInt(result[3], 16)]\r\n    : null;\r\n};\r\n\r\nconst rgbaColor = (color = '#fff', alpha = 0.5) => `rgba(${hexToRgb(color)}, ${alpha})`;\r\n\r\n/* --------------------------------- Colors --------------------------------- */\r\n\r\nconst getColor = (name, dom = document.documentElement) =>\r\n  getComputedStyle(dom).getPropertyValue(`--falcon-${name}`).trim();\r\n\r\nconst getColors = dom => ({\r\n  primary: getColor('primary', dom),\r\n  secondary: getColor('secondary', dom),\r\n  success: getColor('success', dom),\r\n  info: getColor('info', dom),\r\n  warning: getColor('warning', dom),\r\n  danger: getColor('danger', dom),\r\n  light: getColor('light', dom),\r\n  dark: getColor('dark', dom)\r\n});\r\n\r\nconst getSoftColors = dom => ({\r\n  primary: getColor('soft-primary', dom),\r\n  secondary: getColor('soft-secondary', dom),\r\n  success: getColor('soft-success', dom),\r\n  info: getColor('soft-info', dom),\r\n  warning: getColor('soft-warning', dom),\r\n  danger: getColor('soft-danger', dom),\r\n  light: getColor('soft-light', dom),\r\n  dark: getColor('soft-dark', dom)\r\n});\r\n\r\nconst getGrays = dom => ({\r\n  white: getColor('white', dom),\r\n  100: getColor('100', dom),\r\n  200: getColor('200', dom),\r\n  300: getColor('300', dom),\r\n  400: getColor('400', dom),\r\n  500: getColor('500', dom),\r\n  600: getColor('600', dom),\r\n  700: getColor('700', dom),\r\n  800: getColor('800', dom),\r\n  900: getColor('900', dom),\r\n  1000: getColor('1000', dom),\r\n  1100: getColor('1100', dom),\r\n  black: getColor('black', dom)\r\n});\r\n\r\nconst hasClass = (el, className) => {\r\n  !el && false;\r\n  return el.classList.value.includes(className);\r\n};\r\n\r\nconst addClass = (el, className) => {\r\n  el.classList.add(className);\r\n};\r\n\r\nconst getOffset = el => {\r\n  const rect = el.getBoundingClientRect();\r\n  const scrollLeft = window.pageXOffset || document.documentElement.scrollLeft;\r\n  const scrollTop = window.pageYOffset || document.documentElement.scrollTop;\r\n  return { top: rect.top + scrollTop, left: rect.left + scrollLeft };\r\n};\r\n\r\nfunction isScrolledIntoView(el) {\r\n  const rect = el.getBoundingClientRect();\r\n  const windowHeight = window.innerHeight || document.documentElement.clientHeight;\r\n  const windowWidth = window.innerWidth || document.documentElement.clientWidth;\r\n\r\n  const vertInView = rect.top <= windowHeight && rect.top + rect.height >= 0;\r\n  const horInView = rect.left <= windowWidth && rect.left + rect.width >= 0;\r\n\r\n  return vertInView && horInView;\r\n}\r\n\r\nconst breakpoints = {\r\n  xs: 0,\r\n  sm: 576,\r\n  md: 768,\r\n  lg: 992,\r\n  xl: 1200,\r\n  xxl: 1540\r\n};\r\n\r\nconst getBreakpoint = el => {\r\n  const classes = el && el.classList.value;\r\n  let breakpoint;\r\n  if (classes) {\r\n    breakpoint =\r\n      breakpoints[\r\n        classes\r\n          .split(' ')\r\n          .filter(cls => cls.includes('navbar-expand-'))\r\n          .pop()\r\n          .split('-')\r\n          .pop()\r\n      ];\r\n  }\r\n  return breakpoint;\r\n};\r\n\r\n/* --------------------------------- Cookie --------------------------------- */\r\n\r\nconst setCookie = (name, value, expire) => {\r\n  const expires = new Date();\r\n  expires.setTime(expires.getTime() + expire);\r\n  document.cookie = name + '=' + value + ';expires=' + expires.toUTCString();\r\n};\r\n\r\nconst getCookie = name => {\r\n  var keyValue = document.cookie.match('(^|;) ?' + name + '=([^;]*)(;|$)');\r\n  return keyValue ? keyValue[2] : keyValue;\r\n};\r\n\r\nconst settings = {\r\n  tinymce: {\r\n    theme: 'oxide'\r\n  },\r\n  chart: {\r\n    borderColor: 'rgba(255, 255, 255, 0.8)'\r\n  }\r\n};\r\n\r\n/* -------------------------- Chart Initialization -------------------------- */\r\n\r\nconst newChart = (chart, config) => {\r\n  const ctx = chart.getContext('2d');\r\n  return new window.Chart(ctx, config);\r\n};\r\n\r\n/* ---------------------------------- Store --------------------------------- */\r\n\r\nconst getItemFromStore = (key, defaultValue, store = localStorage) => {\r\n  try {\r\n    return JSON.parse(store.getItem(key)) || defaultValue;\r\n  } catch {\r\n    return store.getItem(key) || defaultValue;\r\n  }\r\n};\r\n\r\nconst setItemToStore = (key, payload, store = localStorage) => store.setItem(key, payload);\r\nconst getStoreSpace = (store = localStorage) =>\r\n  parseFloat((escape(encodeURIComponent(JSON.stringify(store))).length / (1024 * 1024)).toFixed(2));\r\n\r\n/* get Dates between */\r\n\r\nconst getDates = (startDate, endDate, interval = 1000 * 60 * 60 * 24) => {\r\n  const duration = endDate - startDate;\r\n  const steps = duration / interval;\r\n  return Array.from({ length: steps + 1 }, (v, i) => new Date(startDate.valueOf() + interval * i));\r\n};\r\n\r\nconst getPastDates = duration => {\r\n  let days;\r\n\r\n  switch (duration) {\r\n    case 'week':\r\n      days = 7;\r\n      break;\r\n    case 'month':\r\n      days = 30;\r\n      break;\r\n    case 'year':\r\n      days = 365;\r\n      break;\r\n\r\n    default:\r\n      days = duration;\r\n  }\r\n\r\n  const date = new Date();\r\n  const endDate = date;\r\n  const startDate = new Date(new Date().setDate(date.getDate() - (days - 1)));\r\n  return getDates(startDate, endDate);\r\n};\r\n\r\n/* Get Random Number */\r\nconst getRandomNumber = (min, max) => {\r\n  return Math.floor(Math.random() * (max - min) + min);\r\n};\r\n\r\nconst utils = {\r\n  docReady,\r\n  resize,\r\n  isIterableArray,\r\n  camelize,\r\n  getData,\r\n  hasClass,\r\n  addClass,\r\n  hexToRgb,\r\n  rgbaColor,\r\n  getColor,\r\n  getColors,\r\n  getSoftColors,\r\n  getGrays,\r\n  getOffset,\r\n  isScrolledIntoView,\r\n  getBreakpoint,\r\n  setCookie,\r\n  getCookie,\r\n  newChart,\r\n  settings,\r\n  getItemFromStore,\r\n  setItemToStore,\r\n  getStoreSpace,\r\n  getDates,\r\n  getPastDates,\r\n  getRandomNumber\r\n};\r\n\r\nexport {\r\n  docReady,\r\n  resize,\r\n  isIterableArray,\r\n  camelize,\r\n  getData,\r\n  hasClass,\r\n  addClass,\r\n  hexToRgb,\r\n  rgbaColor,\r\n  getColor,\r\n  getColors,\r\n  getSoftColors,\r\n  getGrays,\r\n  getOffset,\r\n  isScrolledIntoView,\r\n  getBreakpoint,\r\n  setCookie,\r\n  getCookie,\r\n  newChart,\r\n  settings,\r\n  getItemFromStore,\r\n  setItemToStore,\r\n  getStoreSpace,\r\n  getDates,\r\n  getPastDates,\r\n  getRandomNumber\r\n};\r\n\r\nexport default utils;\r\n", "import utils from './utils';\r\n\r\n/* -------------------------------------------------------------------------- */\r\n/*                               Navbar Vertical                              */\r\n/* -------------------------------------------------------------------------- */\r\n\r\nconst handleNavbarVerticalCollapsed = () => {\r\n  const Selector = {\r\n    HTML: 'html',\r\n    NAVBAR_VERTICAL_TOGGLE: '.navbar-vertical-toggle',\r\n    NAVBAR_VERTICAL_COLLAPSE: '.navbar-vertical .navbar-collapse',\r\n    ECHART_RESPONSIVE: '[data-echart-responsive]',\r\n  };\r\n\r\n  const Events = {\r\n    CLICK: 'click',\r\n    MOUSE_OVER: 'mouseover',\r\n    MOUSE_LEAVE: 'mouseleave',\r\n    NAVBAR_VERTICAL_TOGGLE: 'navbar.vertical.toggle',\r\n  };\r\n  const ClassNames = {\r\n    NAVBAR_VERTICAL_COLLAPSED: 'navbar-vertical-collapsed',\r\n    NAVBAR_VERTICAL_COLLAPSED_HOVER: 'navbar-vertical-collapsed-hover',\r\n  };\r\n  const navbarVerticalToggle = document.querySelector(\r\n    Selector.NAVBAR_VERTICAL_TOGGLE\r\n  );\r\n  const html = document.querySelector(Selector.HTML);\r\n  const navbarVerticalCollapse = document.querySelector(\r\n    Selector.NAVBAR_VERTICAL_COLLAPSE\r\n  );\r\n\r\n  if (navbarVerticalToggle) {\r\n    navbarVerticalToggle.addEventListener(Events.CLICK, (e) => {\r\n      navbarVerticalToggle.blur();\r\n      html.classList.toggle(ClassNames.NAVBAR_VERTICAL_COLLAPSED);\r\n\r\n      // Set collapse state on localStorage\r\n      const isNavbarVerticalCollapsed = utils.getItemFromStore(\r\n        'isNavbarVerticalCollapsed'\r\n      );\r\n      utils.setItemToStore(\r\n        'isNavbarVerticalCollapsed',\r\n        !isNavbarVerticalCollapsed\r\n      );\r\n\r\n      const event = new CustomEvent(Events.NAVBAR_VERTICAL_TOGGLE);\r\n      e.currentTarget.dispatchEvent(event);\r\n    });\r\n  }\r\n  if (navbarVerticalCollapse) {\r\n    navbarVerticalCollapse.addEventListener(Events.MOUSE_OVER, () => {\r\n      if (utils.hasClass(html, ClassNames.NAVBAR_VERTICAL_COLLAPSED)) {\r\n        html.classList.add(ClassNames.NAVBAR_VERTICAL_COLLAPSED_HOVER);\r\n      }\r\n    });\r\n    navbarVerticalCollapse.addEventListener(Events.MOUSE_LEAVE, () => {\r\n      if (utils.hasClass(html, ClassNames.NAVBAR_VERTICAL_COLLAPSED_HOVER)) {\r\n        html.classList.remove(ClassNames.NAVBAR_VERTICAL_COLLAPSED_HOVER);\r\n      }\r\n    });\r\n  }\r\n};\r\n\r\nexport default handleNavbarVerticalCollapsed;\r\n", "import { addClass } from './utils';\r\n/* -------------------------------------------------------------------------- */\r\n/*                                  Detector                                  */\r\n/* -------------------------------------------------------------------------- */\r\n\r\nconst detectorInit = () => {\r\n  const is = window;\r\n  const html = document.querySelector('html');\r\n\r\n  //window.opera() && addClass(html, 'opera');\r\n  //window.mobile() && addClass(html, 'mobile');\r\n  //window.firefox() && addClass(html, 'firefox');\r\n  //window.safari() && addClass(html, 'safari');\r\n  //window.ios() && addClass(html, 'ios');\r\n  //window.iphone() && addClass(html, 'iphone');\r\n  //window.ipad() && addClass(html, 'ipad');\r\n  //window.ie() && addClass(html, 'ie');\r\n  //window.edge() && addClass(html, 'edge');\r\n  //window.chrome() && addClass(html, 'chrome');\r\n  //window.mac() && addClass(html, 'osx');\r\n  //window.windows() && addClass(html, 'windows');\r\n  //navigator.userAgent.match('CriOS') && addClass(html, 'chrome');\r\n};\r\n\r\nexport default detectorInit;\r\n", "/* -------------------------------------------------------------------------- */\r\n/*                                   Tooltip                                  */\r\n/* -------------------------------------------------------------------------- */\r\nwindow.bootstrap = require('bootstrap/dist/js/bootstrap.bundle.js');\r\n\r\nconst tooltipInit = () => {\r\n  const tooltipTriggerList = [].slice.call(\r\n    document.querySelectorAll('[data-bs-toggle=\"tooltip\"]')\r\n  );\r\n\r\n  tooltipTriggerList.map(\r\n    (tooltipTriggerEl) => new window.bootstrap.Tooltip(tooltipTriggerEl,{\r\n      trigger:'hover'\r\n    })\r\n  );\r\n};\r\n\r\nexport default tooltipInit;\r\n", "/* -------------------------------------------------------------------------- */\r\n/*                                   Popover                                  */\r\n/* -------------------------------------------------------------------------- */\r\n\r\nconst popoverInit = () => {\r\n  const popoverTriggerList = [].slice.call(\r\n    document.querySelectorAll('[data-bs-toggle=\"popover\"]')\r\n  );\r\n  popoverTriggerList.map(popoverTriggerEl => {\r\n    return new window.bootstrap.Popover(popoverTriggerEl);\r\n  });\r\n};\r\n\r\nexport default popoverInit;\r\n", "import utils from './utils';\r\n\r\n/* -------------------------------------------------------------------------- */\r\n/*                                 Navbar Top                                 */\r\n/* -------------------------------------------------------------------------- */\r\n\r\nconst navbarTopDropShadow = () => {\r\n  const Selector = {\r\n    NAVBAR: '.navbar:not(.navbar-vertical)',\r\n    NAVBAR_VERTICAL: '.navbar-vertical',\r\n    NAVBAR_VERTICAL_CONTENT: '.navbar-vertical-content',\r\n    NAVBAR_VERTICAL_COLLAPSE: 'navbarVerticalCollapse',\r\n  };\r\n\r\n  const ClassNames = {\r\n    NAVBAR_GLASS_SHADOW: 'navbar-glass-shadow',\r\n    SHOW: 'show',\r\n  };\r\n\r\n  const Events = {\r\n    SCROLL: 'scroll',\r\n    SHOW_BS_COLLAPSE: 'show.bs.collapse',\r\n    HIDDEN_BS_COLLAPSE: 'hidden.bs.collapse',\r\n  };\r\n  let navDropShadowFlag = true;\r\n\r\n  const $navbar = document.querySelector(Selector.NAVBAR);\r\n  const $navbarVertical = document.querySelector(Selector.NAVBAR_VERTICAL);\r\n  const $navbarVerticalContent = document.querySelector(\r\n    Selector.NAVBAR_VERTICAL_CONTENT\r\n  );\r\n  const $navbarVerticalCollapse = document.getElementById(\r\n    Selector.NAVBAR_VERTICAL_COLLAPSE\r\n  );\r\n  const html = document.documentElement;\r\n  const breakPoint = utils.getBreakpoint($navbarVertical);\r\n  const setDropShadow = ($elem) => {\r\n    if ($elem.scrollTop > 0 && navDropShadowFlag) {\r\n      $navbar && $navbar.classList.add(ClassNames.NAVBAR_GLASS_SHADOW);\r\n    } else {\r\n      $navbar && $navbar.classList.remove(ClassNames.NAVBAR_GLASS_SHADOW);\r\n    }\r\n  };\r\n\r\n  window.addEventListener(Events.SCROLL, () => {\r\n    setDropShadow(html);\r\n  });\r\n\r\n  if ($navbarVerticalContent) {\r\n    $navbarVerticalContent.addEventListener(Events.SCROLL, () => {\r\n      if (window.outerWidth < breakPoint) {\r\n        navDropShadowFlag = true;\r\n        setDropShadow($navbarVerticalContent);\r\n      }\r\n    });\r\n  }\r\n  if ($navbarVerticalCollapse) {\r\n    $navbarVerticalCollapse.addEventListener(Events.SHOW_BS_COLLAPSE, () => {\r\n      if (window.outerWidth < breakPoint) {\r\n        navDropShadowFlag = false;\r\n        setDropShadow(html);\r\n      }\r\n    });\r\n  }\r\n  if ($navbarVerticalCollapse) {\r\n    $navbarVerticalCollapse.addEventListener(Events.HIDDEN_BS_COLLAPSE, () => {\r\n      if (\r\n        utils.hasClass($navbarVerticalCollapse, ClassNames.SHOW) &&\r\n        window.outerWidth < breakPoint\r\n      ) {\r\n        navDropShadowFlag = false;\r\n      } else {\r\n        navDropShadowFlag = true;\r\n      }\r\n      setDropShadow(html);\r\n    });\r\n  }\r\n};\r\n\r\nexport default navbarTopDropShadow;\r\n", "/* -------------------------------------------------------------------------- */\r\n/*                                    Toast                                   */\r\n/* -------------------------------------------------------------------------- */\r\n\r\nconst toastInit = () => {\r\n  const toastElList = [].slice.call(document.querySelectorAll('.toast'));\r\n  toastElList.map((toastEl) => new window.bootstrap.Toast(toastEl));\r\n\r\n\r\n  const liveToastBtn = document.getElementById('liveToastBtn');\r\n\r\n  if (liveToastBtn) {\r\n    const liveToast = new window.bootstrap.Toast(document.getElementById('liveToast'));\r\n\r\n    liveToastBtn.addEventListener('click', () => {\r\n      liveToast && liveToast.show();\r\n    })\r\n  }\r\n};\r\n\r\n\r\nexport default toastInit;\r\n", "import utils from './utils';\r\n\r\n/* -------------------------------------------------------------------------- */\r\n/*                         Bootstrap Animated Progress                        */\r\n/* -------------------------------------------------------------------------- */\r\n\r\nconst progressAnimationToggle = () => {\r\n  const animatedProgress = document.querySelectorAll(\r\n    '[data-progress-animation]'\r\n  );\r\n\r\n  animatedProgress.forEach((progress) => {\r\n    progress.addEventListener('click', (e) => {\r\n      const progressID = utils.getData(e.currentTarget, 'progressAnimation');\r\n      const $progress = document.getElementById(progressID);\r\n      $progress.classList.toggle('progress-bar-animated');\r\n    });\r\n  });\r\n};\r\n\r\nexport default progressAnimationToggle;\r\n", "/* -------------------------------------------------------------------------- */\r\n/*                                 Glightbox                                */\r\n/* -------------------------------------------------------------------------- */\r\n\r\nconst glightboxInit = () => {\r\n  if (window.GLightbox) {\r\n    window.GLightbox({\r\n      selector: '[data-gallery]',\r\n    });\r\n  }\r\n};\r\nexport default glightboxInit;\r\n", "import utils from \"./utils\";\r\n/*-----------------------------------------------\r\n|   Inline Player [plyr]\r\n-----------------------------------------------*/\r\n\r\nconst plyrInit = () => {\r\n  if (window.Plyr) {\r\n    const plyrs = document.querySelectorAll(\".player\");\r\n    plyrs.forEach((plyr) => {\r\n      const userOptions = utils.getData(plyr, \"options\");\r\n      const defaultOptions = { captions: { active: true } };\r\n      const options = window._.merge(defaultOptions, userOptions);\r\n      return new window.Plyr(plyr, options);\r\n    });\r\n  }\r\n};\r\n\r\nexport default plyrInit;\r\n", "import utils from \"./utils\";\r\n/*-----------------------------------------------\r\n|   Gooogle Map\r\n-----------------------------------------------*/\r\n\r\nfunction initMap() {\r\n  const themeController = document.body;\r\n  const $googlemaps = document.querySelectorAll(\".googlemap\");\r\n\r\n  if ($googlemaps.length && window.google) {\r\n    // Visit https://snazzymaps.com/ for more themes\r\n    const mapStyles = {\r\n      Default: [\r\n        {\r\n          featureType: \"water\",\r\n          elementType: \"geometry\",\r\n          stylers: [{ color: \"#e9e9e9\" }, { lightness: 17 }],\r\n        },\r\n        {\r\n          featureType: \"landscape\",\r\n          elementType: \"geometry\",\r\n          stylers: [{ color: \"#f5f5f5\" }, { lightness: 20 }],\r\n        },\r\n        {\r\n          featureType: \"road.highway\",\r\n          elementType: \"geometry.fill\",\r\n          stylers: [{ color: \"#ffffff\" }, { lightness: 17 }],\r\n        },\r\n        {\r\n          featureType: \"road.highway\",\r\n          elementType: \"geometry.stroke\",\r\n          stylers: [{ color: \"#ffffff\" }, { lightness: 29 }, { weight: 0.2 }],\r\n        },\r\n        {\r\n          featureType: \"road.arterial\",\r\n          elementType: \"geometry\",\r\n          stylers: [{ color: \"#ffffff\" }, { lightness: 18 }],\r\n        },\r\n        {\r\n          featureType: \"road.local\",\r\n          elementType: \"geometry\",\r\n          stylers: [{ color: \"#ffffff\" }, { lightness: 16 }],\r\n        },\r\n        {\r\n          featureType: \"poi\",\r\n          elementType: \"geometry\",\r\n          stylers: [{ color: \"#f5f5f5\" }, { lightness: 21 }],\r\n        },\r\n        {\r\n          featureType: \"poi.park\",\r\n          elementType: \"geometry\",\r\n          stylers: [{ color: \"#dedede\" }, { lightness: 21 }],\r\n        },\r\n        {\r\n          elementType: \"labels.text.stroke\",\r\n          stylers: [\r\n            { visibility: \"on\" },\r\n            { color: \"#ffffff\" },\r\n            { lightness: 16 },\r\n          ],\r\n        },\r\n        {\r\n          elementType: \"labels.text.fill\",\r\n          stylers: [\r\n            { saturation: 36 },\r\n            { color: \"#333333\" },\r\n            { lightness: 40 },\r\n          ],\r\n        },\r\n        { elementType: \"labels.icon\", stylers: [{ visibility: \"off\" }] },\r\n        {\r\n          featureType: \"transit\",\r\n          elementType: \"geometry\",\r\n          stylers: [{ color: \"#f2f2f2\" }, { lightness: 19 }],\r\n        },\r\n        {\r\n          featureType: \"administrative\",\r\n          elementType: \"geometry.fill\",\r\n          stylers: [{ color: \"#fefefe\" }, { lightness: 20 }],\r\n        },\r\n        {\r\n          featureType: \"administrative\",\r\n          elementType: \"geometry.stroke\",\r\n          stylers: [{ color: \"#fefefe\" }, { lightness: 17 }, { weight: 1.2 }],\r\n        },\r\n      ],\r\n      Gray: [\r\n        {\r\n          featureType: \"all\",\r\n          elementType: \"labels.text.fill\",\r\n          stylers: [\r\n            { saturation: 36 },\r\n            { color: \"#000000\" },\r\n            { lightness: 40 },\r\n          ],\r\n        },\r\n        {\r\n          featureType: \"all\",\r\n          elementType: \"labels.text.stroke\",\r\n          stylers: [\r\n            { visibility: \"on\" },\r\n            { color: \"#000000\" },\r\n            { lightness: 16 },\r\n          ],\r\n        },\r\n        {\r\n          featureType: \"all\",\r\n          elementType: \"labels.icon\",\r\n          stylers: [{ visibility: \"off\" }],\r\n        },\r\n        {\r\n          featureType: \"administrative\",\r\n          elementType: \"geometry.fill\",\r\n          stylers: [{ color: \"#000000\" }, { lightness: 20 }],\r\n        },\r\n        {\r\n          featureType: \"administrative\",\r\n          elementType: \"geometry.stroke\",\r\n          stylers: [{ color: \"#000000\" }, { lightness: 17 }, { weight: 1.2 }],\r\n        },\r\n        {\r\n          featureType: \"landscape\",\r\n          elementType: \"geometry\",\r\n          stylers: [{ color: \"#000000\" }, { lightness: 20 }],\r\n        },\r\n        {\r\n          featureType: \"poi\",\r\n          elementType: \"geometry\",\r\n          stylers: [{ color: \"#000000\" }, { lightness: 21 }],\r\n        },\r\n        {\r\n          featureType: \"road.highway\",\r\n          elementType: \"geometry.fill\",\r\n          stylers: [{ color: \"#000000\" }, { lightness: 17 }],\r\n        },\r\n        {\r\n          featureType: \"road.highway\",\r\n          elementType: \"geometry.stroke\",\r\n          stylers: [{ color: \"#000000\" }, { lightness: 29 }, { weight: 0.2 }],\r\n        },\r\n        {\r\n          featureType: \"road.arterial\",\r\n          elementType: \"geometry\",\r\n          stylers: [{ color: \"#000000\" }, { lightness: 18 }],\r\n        },\r\n        {\r\n          featureType: \"road.local\",\r\n          elementType: \"geometry\",\r\n          stylers: [{ color: \"#000000\" }, { lightness: 16 }],\r\n        },\r\n        {\r\n          featureType: \"transit\",\r\n          elementType: \"geometry\",\r\n          stylers: [{ color: \"#000000\" }, { lightness: 19 }],\r\n        },\r\n        {\r\n          featureType: \"water\",\r\n          elementType: \"geometry\",\r\n          stylers: [{ color: \"#000000\" }, { lightness: 17 }],\r\n        },\r\n      ],\r\n      Midnight: [\r\n        {\r\n          featureType: \"all\",\r\n          elementType: \"labels.text.fill\",\r\n          stylers: [{ color: \"#ffffff\" }],\r\n        },\r\n        {\r\n          featureType: \"all\",\r\n          elementType: \"labels.text.stroke\",\r\n          stylers: [{ color: \"#000000\" }, { lightness: 13 }],\r\n        },\r\n        {\r\n          featureType: \"administrative\",\r\n          elementType: \"geometry.fill\",\r\n          stylers: [{ color: \"#000000\" }],\r\n        },\r\n        {\r\n          featureType: \"administrative\",\r\n          elementType: \"geometry.stroke\",\r\n          stylers: [{ color: \"#144b53\" }, { lightness: 14 }, { weight: 1.4 }],\r\n        },\r\n        {\r\n          featureType: \"landscape\",\r\n          elementType: \"all\",\r\n          stylers: [{ color: \"#08304b\" }],\r\n        },\r\n        {\r\n          featureType: \"poi\",\r\n          elementType: \"geometry\",\r\n          stylers: [{ color: \"#0c4152\" }, { lightness: 5 }],\r\n        },\r\n        {\r\n          featureType: \"road.highway\",\r\n          elementType: \"geometry.fill\",\r\n          stylers: [{ color: \"#000000\" }],\r\n        },\r\n        {\r\n          featureType: \"road.highway\",\r\n          elementType: \"geometry.stroke\",\r\n          stylers: [{ color: \"#0b434f\" }, { lightness: 25 }],\r\n        },\r\n        {\r\n          featureType: \"road.arterial\",\r\n          elementType: \"geometry.fill\",\r\n          stylers: [{ color: \"#000000\" }],\r\n        },\r\n        {\r\n          featureType: \"road.arterial\",\r\n          elementType: \"geometry.stroke\",\r\n          stylers: [{ color: \"#0b3d51\" }, { lightness: 16 }],\r\n        },\r\n        {\r\n          featureType: \"road.local\",\r\n          elementType: \"geometry\",\r\n          stylers: [{ color: \"#000000\" }],\r\n        },\r\n        {\r\n          featureType: \"transit\",\r\n          elementType: \"all\",\r\n          stylers: [{ color: \"#146474\" }],\r\n        },\r\n        {\r\n          featureType: \"water\",\r\n          elementType: \"all\",\r\n          stylers: [{ color: \"#021019\" }],\r\n        },\r\n      ],\r\n      Hopper: [\r\n        {\r\n          featureType: \"water\",\r\n          elementType: \"geometry\",\r\n          stylers: [\r\n            { hue: \"#165c64\" },\r\n            { saturation: 34 },\r\n            { lightness: -69 },\r\n            { visibility: \"on\" },\r\n          ],\r\n        },\r\n        {\r\n          featureType: \"landscape\",\r\n          elementType: \"geometry\",\r\n          stylers: [\r\n            { hue: \"#b7caaa\" },\r\n            { saturation: -14 },\r\n            { lightness: -18 },\r\n            { visibility: \"on\" },\r\n          ],\r\n        },\r\n        {\r\n          featureType: \"landscape.man_made\",\r\n          elementType: \"all\",\r\n          stylers: [\r\n            { hue: \"#cbdac1\" },\r\n            { saturation: -6 },\r\n            { lightness: -9 },\r\n            { visibility: \"on\" },\r\n          ],\r\n        },\r\n        {\r\n          featureType: \"road\",\r\n          elementType: \"geometry\",\r\n          stylers: [\r\n            { hue: \"#8d9b83\" },\r\n            { saturation: -89 },\r\n            { lightness: -12 },\r\n            { visibility: \"on\" },\r\n          ],\r\n        },\r\n        {\r\n          featureType: \"road.highway\",\r\n          elementType: \"geometry\",\r\n          stylers: [\r\n            { hue: \"#d4dad0\" },\r\n            { saturation: -88 },\r\n            { lightness: 54 },\r\n            { visibility: \"simplified\" },\r\n          ],\r\n        },\r\n        {\r\n          featureType: \"road.arterial\",\r\n          elementType: \"geometry\",\r\n          stylers: [\r\n            { hue: \"#bdc5b6\" },\r\n            { saturation: -89 },\r\n            { lightness: -3 },\r\n            { visibility: \"simplified\" },\r\n          ],\r\n        },\r\n        {\r\n          featureType: \"road.local\",\r\n          elementType: \"geometry\",\r\n          stylers: [\r\n            { hue: \"#bdc5b6\" },\r\n            { saturation: -89 },\r\n            { lightness: -26 },\r\n            { visibility: \"on\" },\r\n          ],\r\n        },\r\n        {\r\n          featureType: \"poi\",\r\n          elementType: \"geometry\",\r\n          stylers: [\r\n            { hue: \"#c17118\" },\r\n            { saturation: 61 },\r\n            { lightness: -45 },\r\n            { visibility: \"on\" },\r\n          ],\r\n        },\r\n        {\r\n          featureType: \"poi.park\",\r\n          elementType: \"all\",\r\n          stylers: [\r\n            { hue: \"#8ba975\" },\r\n            { saturation: -46 },\r\n            { lightness: -28 },\r\n            { visibility: \"on\" },\r\n          ],\r\n        },\r\n        {\r\n          featureType: \"transit\",\r\n          elementType: \"geometry\",\r\n          stylers: [\r\n            { hue: \"#a43218\" },\r\n            { saturation: 74 },\r\n            { lightness: -51 },\r\n            { visibility: \"simplified\" },\r\n          ],\r\n        },\r\n        {\r\n          featureType: \"administrative.province\",\r\n          elementType: \"all\",\r\n          stylers: [\r\n            { hue: \"#ffffff\" },\r\n            { saturation: 0 },\r\n            { lightness: 100 },\r\n            { visibility: \"simplified\" },\r\n          ],\r\n        },\r\n        {\r\n          featureType: \"administrative.neighborhood\",\r\n          elementType: \"all\",\r\n          stylers: [\r\n            { hue: \"#ffffff\" },\r\n            { saturation: 0 },\r\n            { lightness: 100 },\r\n            { visibility: \"off\" },\r\n          ],\r\n        },\r\n        {\r\n          featureType: \"administrative.locality\",\r\n          elementType: \"labels\",\r\n          stylers: [\r\n            { hue: \"#ffffff\" },\r\n            { saturation: 0 },\r\n            { lightness: 100 },\r\n            { visibility: \"off\" },\r\n          ],\r\n        },\r\n        {\r\n          featureType: \"administrative.land_parcel\",\r\n          elementType: \"all\",\r\n          stylers: [\r\n            { hue: \"#ffffff\" },\r\n            { saturation: 0 },\r\n            { lightness: 100 },\r\n            { visibility: \"off\" },\r\n          ],\r\n        },\r\n        {\r\n          featureType: \"administrative\",\r\n          elementType: \"all\",\r\n          stylers: [\r\n            { hue: \"#3a3935\" },\r\n            { saturation: 5 },\r\n            { lightness: -57 },\r\n            { visibility: \"off\" },\r\n          ],\r\n        },\r\n        {\r\n          featureType: \"poi.medical\",\r\n          elementType: \"geometry\",\r\n          stylers: [\r\n            { hue: \"#cba923\" },\r\n            { saturation: 50 },\r\n            { lightness: -46 },\r\n            { visibility: \"on\" },\r\n          ],\r\n        },\r\n      ],\r\n      Beard: [\r\n        {\r\n          featureType: \"poi.business\",\r\n          elementType: \"labels.text\",\r\n          stylers: [{ visibility: \"on\" }, { color: \"#333333\" }],\r\n        },\r\n      ],\r\n      AssassianCreed: [\r\n        {\r\n          featureType: \"all\",\r\n          elementType: \"all\",\r\n          stylers: [{ visibility: \"on\" }],\r\n        },\r\n        {\r\n          featureType: \"all\",\r\n          elementType: \"labels\",\r\n          stylers: [{ visibility: \"off\" }, { saturation: \"-100\" }],\r\n        },\r\n        {\r\n          featureType: \"all\",\r\n          elementType: \"labels.text.fill\",\r\n          stylers: [\r\n            { saturation: 36 },\r\n            { color: \"#000000\" },\r\n            { lightness: 40 },\r\n            { visibility: \"off\" },\r\n          ],\r\n        },\r\n        {\r\n          featureType: \"all\",\r\n          elementType: \"labels.text.stroke\",\r\n          stylers: [\r\n            { visibility: \"off\" },\r\n            { color: \"#000000\" },\r\n            { lightness: 16 },\r\n          ],\r\n        },\r\n        {\r\n          featureType: \"all\",\r\n          elementType: \"labels.icon\",\r\n          stylers: [{ visibility: \"off\" }],\r\n        },\r\n        {\r\n          featureType: \"administrative\",\r\n          elementType: \"geometry.fill\",\r\n          stylers: [{ color: \"#000000\" }, { lightness: 20 }],\r\n        },\r\n        {\r\n          featureType: \"administrative\",\r\n          elementType: \"geometry.stroke\",\r\n          stylers: [{ color: \"#000000\" }, { lightness: 17 }, { weight: 1.2 }],\r\n        },\r\n        {\r\n          featureType: \"landscape\",\r\n          elementType: \"geometry\",\r\n          stylers: [{ color: \"#000000\" }, { lightness: 20 }],\r\n        },\r\n        {\r\n          featureType: \"landscape\",\r\n          elementType: \"geometry.fill\",\r\n          stylers: [{ color: \"#4d6059\" }],\r\n        },\r\n        {\r\n          featureType: \"landscape\",\r\n          elementType: \"geometry.stroke\",\r\n          stylers: [{ color: \"#4d6059\" }],\r\n        },\r\n        {\r\n          featureType: \"landscape.natural\",\r\n          elementType: \"geometry.fill\",\r\n          stylers: [{ color: \"#4d6059\" }],\r\n        },\r\n        {\r\n          featureType: \"poi\",\r\n          elementType: \"geometry\",\r\n          stylers: [{ lightness: 21 }],\r\n        },\r\n        {\r\n          featureType: \"poi\",\r\n          elementType: \"geometry.fill\",\r\n          stylers: [{ color: \"#4d6059\" }],\r\n        },\r\n        {\r\n          featureType: \"poi\",\r\n          elementType: \"geometry.stroke\",\r\n          stylers: [{ color: \"#4d6059\" }],\r\n        },\r\n        {\r\n          featureType: \"road\",\r\n          elementType: \"geometry\",\r\n          stylers: [{ visibility: \"on\" }, { color: \"#7f8d89\" }],\r\n        },\r\n        {\r\n          featureType: \"road\",\r\n          elementType: \"geometry.fill\",\r\n          stylers: [{ color: \"#7f8d89\" }],\r\n        },\r\n        {\r\n          featureType: \"road.highway\",\r\n          elementType: \"geometry.fill\",\r\n          stylers: [{ color: \"#7f8d89\" }, { lightness: 17 }],\r\n        },\r\n        {\r\n          featureType: \"road.highway\",\r\n          elementType: \"geometry.stroke\",\r\n          stylers: [{ color: \"#7f8d89\" }, { lightness: 29 }, { weight: 0.2 }],\r\n        },\r\n        {\r\n          featureType: \"road.arterial\",\r\n          elementType: \"geometry\",\r\n          stylers: [{ color: \"#000000\" }, { lightness: 18 }],\r\n        },\r\n        {\r\n          featureType: \"road.arterial\",\r\n          elementType: \"geometry.fill\",\r\n          stylers: [{ color: \"#7f8d89\" }],\r\n        },\r\n        {\r\n          featureType: \"road.arterial\",\r\n          elementType: \"geometry.stroke\",\r\n          stylers: [{ color: \"#7f8d89\" }],\r\n        },\r\n        {\r\n          featureType: \"road.local\",\r\n          elementType: \"geometry\",\r\n          stylers: [{ color: \"#000000\" }, { lightness: 16 }],\r\n        },\r\n        {\r\n          featureType: \"road.local\",\r\n          elementType: \"geometry.fill\",\r\n          stylers: [{ color: \"#7f8d89\" }],\r\n        },\r\n        {\r\n          featureType: \"road.local\",\r\n          elementType: \"geometry.stroke\",\r\n          stylers: [{ color: \"#7f8d89\" }],\r\n        },\r\n        {\r\n          featureType: \"transit\",\r\n          elementType: \"geometry\",\r\n          stylers: [{ color: \"#000000\" }, { lightness: 19 }],\r\n        },\r\n        {\r\n          featureType: \"water\",\r\n          elementType: \"all\",\r\n          stylers: [{ color: \"#2b3638\" }, { visibility: \"on\" }],\r\n        },\r\n        {\r\n          featureType: \"water\",\r\n          elementType: \"geometry\",\r\n          stylers: [{ color: \"#2b3638\" }, { lightness: 17 }],\r\n        },\r\n        {\r\n          featureType: \"water\",\r\n          elementType: \"geometry.fill\",\r\n          stylers: [{ color: \"#24282b\" }],\r\n        },\r\n        {\r\n          featureType: \"water\",\r\n          elementType: \"geometry.stroke\",\r\n          stylers: [{ color: \"#24282b\" }],\r\n        },\r\n        {\r\n          featureType: \"water\",\r\n          elementType: \"labels\",\r\n          stylers: [{ visibility: \"off\" }],\r\n        },\r\n        {\r\n          featureType: \"water\",\r\n          elementType: \"labels.text\",\r\n          stylers: [{ visibility: \"off \" }],\r\n        },\r\n        {\r\n          featureType: \"water\",\r\n          elementType: \"labels.text.fill\",\r\n          stylers: [{ visibility: \"off\" }],\r\n        },\r\n        {\r\n          featureType: \"water\",\r\n          elementType: \"labels.text.stroke\",\r\n          stylers: [{ visibility: \"off\" }],\r\n        },\r\n        {\r\n          featureType: \"water\",\r\n          elementType: \"labels.icon\",\r\n          stylers: [{ visibility: \"off\" }],\r\n        },\r\n      ],\r\n      SubtleGray: [\r\n        {\r\n          featureType: \"administrative\",\r\n          elementType: \"all\",\r\n          stylers: [{ saturation: \"-100\" }],\r\n        },\r\n        {\r\n          featureType: \"administrative.province\",\r\n          elementType: \"all\",\r\n          stylers: [{ visibility: \"off\" }],\r\n        },\r\n        {\r\n          featureType: \"landscape\",\r\n          elementType: \"all\",\r\n          stylers: [\r\n            { saturation: -100 },\r\n            { lightness: 65 },\r\n            { visibility: \"on\" },\r\n          ],\r\n        },\r\n        {\r\n          featureType: \"poi\",\r\n          elementType: \"all\",\r\n          stylers: [\r\n            { saturation: -100 },\r\n            { lightness: \"50\" },\r\n            { visibility: \"simplified\" },\r\n          ],\r\n        },\r\n        {\r\n          featureType: \"road\",\r\n          elementType: \"all\",\r\n          stylers: [{ saturation: -100 }],\r\n        },\r\n        {\r\n          featureType: \"road.highway\",\r\n          elementType: \"all\",\r\n          stylers: [{ visibility: \"simplified\" }],\r\n        },\r\n        {\r\n          featureType: \"road.arterial\",\r\n          elementType: \"all\",\r\n          stylers: [{ lightness: \"30\" }],\r\n        },\r\n        {\r\n          featureType: \"road.local\",\r\n          elementType: \"all\",\r\n          stylers: [{ lightness: \"40\" }],\r\n        },\r\n        {\r\n          featureType: \"transit\",\r\n          elementType: \"all\",\r\n          stylers: [{ saturation: -100 }, { visibility: \"simplified\" }],\r\n        },\r\n        {\r\n          featureType: \"water\",\r\n          elementType: \"geometry\",\r\n          stylers: [\r\n            { hue: \"#ffff00\" },\r\n            { lightness: -25 },\r\n            { saturation: -97 },\r\n          ],\r\n        },\r\n        {\r\n          featureType: \"water\",\r\n          elementType: \"labels\",\r\n          stylers: [{ lightness: -25 }, { saturation: -100 }],\r\n        },\r\n      ],\r\n      Tripitty: [\r\n        {\r\n          featureType: \"all\",\r\n          elementType: \"labels\",\r\n          stylers: [{ visibility: \"off\" }],\r\n        },\r\n        {\r\n          featureType: \"administrative\",\r\n          elementType: \"all\",\r\n          stylers: [{ visibility: \"off\" }],\r\n        },\r\n        {\r\n          featureType: \"landscape\",\r\n          elementType: \"all\",\r\n          stylers: [{ color: \"#2c5ca5\" }],\r\n        },\r\n        {\r\n          featureType: \"poi\",\r\n          elementType: \"all\",\r\n          stylers: [{ color: \"#2c5ca5\" }],\r\n        },\r\n        {\r\n          featureType: \"road\",\r\n          elementType: \"all\",\r\n          stylers: [{ visibility: \"off\" }],\r\n        },\r\n        {\r\n          featureType: \"transit\",\r\n          elementType: \"all\",\r\n          stylers: [{ visibility: \"off\" }],\r\n        },\r\n        {\r\n          featureType: \"water\",\r\n          elementType: \"all\",\r\n          stylers: [{ color: \"#193a70\" }, { visibility: \"on\" }],\r\n        },\r\n      ],\r\n      Cobalt: [\r\n        {\r\n          \"featureType\": \"all\",\r\n          \"elementType\": \"all\",\r\n          \"stylers\": [\r\n            {\r\n              \"invert_lightness\": true\r\n            },\r\n            {\r\n              \"saturation\": 10\r\n            },\r\n            {\r\n              \"lightness\": 30\r\n            },\r\n            {\r\n              \"gamma\": 0.5\r\n            },\r\n            {\r\n              \"hue\": \"#435158\"\r\n            }\r\n          ]\r\n        }\r\n      ]\r\n\r\n    };\r\n\r\n    $googlemaps.forEach((itm) => {\r\n      const latLng = utils.getData(itm, \"latlng\").split(\",\");\r\n      const markerPopup = itm.innerHTML;\r\n      const icon = utils.getData(itm, \"icon\")\r\n        ? utils.getData(itm, \"icon\")\r\n        : \"https://maps.gstatic.com/mapfiles/api-3/images/spotlight-poi.png\";\r\n      const zoom = utils.getData(itm, \"zoom\");\r\n      const mapElement = itm;\r\n      const mapStyle = utils.getData(itm, \"theme\");\r\n\r\n      if (utils.getData(itm, \"theme\") === \"streetview\") {\r\n        const pov = utils.getData(itm, \"pov\");\r\n        const mapOptions = {\r\n          position: { lat: Number(latLng[0]), lng: Number(latLng[1]) },\r\n          pov,\r\n          zoom,\r\n          gestureHandling: \"none\",\r\n          scrollwheel: false,\r\n        };\r\n\r\n        return new window.google.maps.StreetViewPanorama(\r\n          mapElement,\r\n          mapOptions\r\n        );\r\n      }\r\n\r\n      const mapOptions = {\r\n        zoom,\r\n        scrollwheel: utils.getData(itm, \"scrollwheel\"),\r\n        center: new window.google.maps.LatLng(latLng[0], latLng[1]),\r\n        styles:\r\n          localStorage.getItem(\"theme\") === \"dark\"\r\n            ? mapStyles.Cobalt\r\n            : mapStyles[mapStyle],\r\n      };\r\n\r\n      const map = new window.google.maps.Map(mapElement, mapOptions);\r\n      const infowindow = new window.google.maps.InfoWindow({\r\n        content: markerPopup,\r\n      });\r\n      const marker = new window.google.maps.Marker({\r\n        position: new window.google.maps.LatLng(latLng[0], latLng[1]),\r\n        icon,\r\n        map,\r\n      });\r\n\r\n      marker.addListener(\"click\", () => {\r\n        infowindow.open(map, marker);\r\n      });\r\n\r\n      themeController &&\r\n        themeController.addEventListener(\r\n          \"clickControl\",\r\n          ({ detail: { control, value } }) => {\r\n            if (control === \"theme\") {\r\n              map.set(\r\n                \"styles\",\r\n                value === \"dark\" ? mapStyles.Cobalt : mapStyles[mapStyle]\r\n              );\r\n            }\r\n          }\r\n        );\r\n      return null;\r\n    });\r\n  }\r\n}\r\n\r\nexport default initMap;\r\n", "/* eslint-disable */\r\nimport utils from './utils';\r\n\r\n/*-----------------------------------------------\r\n|   Dropzone\r\n-----------------------------------------------*/\r\n\r\nwindow.Dropzone ? (window.Dropzone.autoDiscover = false) : '';\r\n\r\nconst dropzoneInit = () => {\r\n  const { merge } = window._;\r\n\r\n  const Selector = {\r\n    DROPZONE: '[data-dropzone]',\r\n    DZ_ERROR_MESSAGE: '.dz-error-message',\r\n    DZ_PREVIEW: '.dz-preview',\r\n    DZ_PROGRESS: '.dz-preview .dz-preview-cover .dz-progress',\r\n    DZ_PREVIEW_COVER: '.dz-preview .dz-preview-cover'\r\n  };\r\n\r\n  const ClassName = {\r\n    DZ_FILE_PROCESSING: 'dz-file-processing',\r\n    DZ_FILE_COMPLETE: 'dz-file-complete',\r\n    DZ_COMPLETE: 'dz-complete',\r\n    DZ_PROCESSING: 'dz-processing'\r\n  };\r\n\r\n  const DATA_KEY = {\r\n    OPTIONS: 'options'\r\n  };\r\n\r\n  const Events = {\r\n    ADDED_FILE: 'addedfile',\r\n    REMOVED_FILE: 'removedfile',\r\n    COMPLETE: 'complete'\r\n  };\r\n\r\n  const dropzones = document.querySelectorAll(Selector.DROPZONE);\r\n\r\n  !!dropzones.length &&\r\n    dropzones.forEach(item => {\r\n      let userOptions = utils.getData(item, DATA_KEY.OPTIONS);\r\n      userOptions = userOptions ? userOptions : {};\r\n      const data = userOptions.data ? userOptions.data : {};\r\n      const options = merge(\r\n        {\r\n          url: '/assets/php/',\r\n          addRemoveLinks: false,\r\n          previewsContainer: item.querySelector(Selector.DZ_PREVIEW),\r\n          previewTemplate: item.querySelector(Selector.DZ_PREVIEW).innerHTML,\r\n          thumbnailWidth: null,\r\n          thumbnailHeight: null,\r\n          maxFilesize: 20,\r\n          autoProcessQueue: false,\r\n          filesizeBase: 1000,\r\n          init: function init() {\r\n            const thisDropzone = this;\r\n\r\n            if (data.length) {\r\n              data.forEach(v => {\r\n                const mockFile = { name: v.name, size: v.size };\r\n                thisDropzone.options.addedfile.call(thisDropzone, mockFile);\r\n                thisDropzone.options.thumbnail.call(thisDropzone, mockFile, `${v.url}/${v.name}`);\r\n              });\r\n            }\r\n\r\n            thisDropzone.on(Events.ADDED_FILE, function addedfile() {\r\n              if ('maxFiles' in userOptions) {\r\n                if (\r\n                  userOptions.maxFiles === 1 &&\r\n                  item.querySelectorAll(Selector.DZ_PREVIEW_COVER).length > 1\r\n                ) {\r\n                  item.querySelector(Selector.DZ_PREVIEW_COVER).remove();\r\n                }\r\n                if (userOptions.maxFiles === 1 && this.files.length > 1) {\r\n                  this.removeFile(this.files[0]);\r\n                }\r\n              }\r\n            });\r\n          },\r\n          error(file, message) {\r\n            if (file.previewElement) {\r\n              file.previewElement.classList.add('dz-error');\r\n              if (typeof message !== 'string' && message.error) {\r\n                message = message.error;\r\n              }\r\n              for (let node of file.previewElement.querySelectorAll('[data-dz-errormessage]')) {\r\n                node.textContent = message;\r\n              }\r\n            }\r\n          }\r\n        },\r\n        userOptions\r\n      );\r\n      // eslint-disable-next-line\r\n      item.querySelector(Selector.DZ_PREVIEW).innerHTML = '';\r\n\r\n      const dropzone = new window.Dropzone(item, options);\r\n\r\n      dropzone.on(Events.ADDED_FILE, () => {\r\n        if (item.querySelector(Selector.DZ_PREVIEW_COVER)) {\r\n          item\r\n            .querySelector(Selector.DZ_PREVIEW_COVER)\r\n            .classList.remove(ClassName.DZ_FILE_COMPLETE);\r\n        }\r\n        item.classList.add(ClassName.DZ_FILE_PROCESSING);\r\n      });\r\n      dropzone.on(Events.REMOVED_FILE, () => {\r\n        if (item.querySelector(Selector.DZ_PREVIEW_COVER)) {\r\n          item.querySelector(Selector.DZ_PREVIEW_COVER).classList.remove(ClassName.DZ_PROCESSING);\r\n        }\r\n        item.classList.add(ClassName.DZ_FILE_COMPLETE);\r\n      });\r\n      dropzone.on(Events.COMPLETE, () => {\r\n        if (item.querySelector(Selector.DZ_PREVIEW_COVER)) {\r\n          item.querySelector(Selector.DZ_PREVIEW_COVER).classList.remove(ClassName.DZ_PROCESSING);\r\n        }\r\n\r\n        item.classList.add(ClassName.DZ_FILE_COMPLETE);\r\n      });\r\n    });\r\n};\r\n\r\nexport default dropzoneInit;\r\n", "import utils from './utils';\r\n\r\n/* -------------------------------------------------------------------------- */\r\n/*                                   choices                                   */\r\n/* -------------------------------------------------------------------------- */\r\nconst choicesInit = () => {\r\n  if (window.Choices) {\r\n    const elements = document.querySelectorAll('.js-choice');\r\n    elements.forEach((item) => {\r\n      const userOptions = utils.getData(item, 'options');\r\n      const choices = new window.Choices(item, {\r\n        itemSelectText: '',\r\n        ...userOptions,\r\n      });\r\n\r\n      const needsValidation = document.querySelectorAll('.needs-validation');\r\n\r\n      needsValidation.forEach((validationItem) => {\r\n        const selectFormValidation = () => {\r\n          validationItem.querySelectorAll('.choices').forEach((choicesItem) => {\r\n            const singleSelect = choicesItem.querySelector(\r\n              '.choices__list--single'\r\n            );\r\n            const multipleSelect = choicesItem.querySelector(\r\n              '.choices__list--multiple'\r\n            );\r\n\r\n            if (choicesItem.querySelector('[required]')) {\r\n              if (singleSelect) {\r\n                if (\r\n                  singleSelect\r\n                    .querySelector('.choices__item--selectable')\r\n                    ?.getAttribute('data-value') !== ''\r\n                ) {\r\n                  choicesItem.classList.remove('invalid');\r\n                  choicesItem.classList.add('valid');\r\n                } else {\r\n                  choicesItem.classList.remove('valid');\r\n                  choicesItem.classList.add('invalid');\r\n                }\r\n              }\r\n              //----- for multiple select only ----------\r\n              if (multipleSelect) {\r\n                if (choicesItem.getElementsByTagName('option').length) {\r\n                  choicesItem.classList.remove('invalid');\r\n                  choicesItem.classList.add('valid');\r\n                } else {\r\n                  choicesItem.classList.remove('valid');\r\n                  choicesItem.classList.add('invalid');\r\n                }\r\n              }\r\n\r\n              //------ select end ---------------\r\n            }\r\n          });\r\n        };\r\n\r\n        validationItem.addEventListener('submit', () => {\r\n          selectFormValidation();\r\n        });\r\n\r\n        item.addEventListener('change', () => {\r\n          selectFormValidation();\r\n        });\r\n      });\r\n\r\n      return choices;\r\n    });\r\n  }\r\n};\r\n\r\nexport default choicesInit;\r\n", "import utils from '../../utils';\r\n\r\n/* -------------------------------------------------------------------------- */\r\n/*                            ChartJs Initialization                          */\r\n/* -------------------------------------------------------------------------- */\r\n\r\nconst chartJsInit = (chartEl, config) => {\r\n  if (!chartEl) return;\r\n\r\n  const ctx = chartEl.getContext('2d');\r\n  let chart = new window.Chart(ctx, config());\r\n\r\n  const themeController = document.body;\r\n  themeController.addEventListener('clickControl', ({ detail: { control } }) => {\r\n    if (control === 'theme') {\r\n      chart.destroy();\r\n      chart = new window.Chart(ctx, config());\r\n    }\r\n    return null;\r\n  });\r\n};\r\n\r\nconst chartJsDefaultTooltip = () => ({\r\n  backgroundColor: utils.getGrays()['100'],\r\n  borderColor: utils.getGrays()['300'],\r\n  borderWidth: 1,\r\n  titleColor: utils.getGrays()['black'],\r\n  callbacks: {\r\n    labelTextColor() {\r\n      return utils.getGrays()['black'];\r\n    }\r\n  }\r\n});\r\n\r\nconst getBubbleDataset = (count, rmin, rmax, min, max) => {\r\n  const arr = Array.from(Array(count).keys());\r\n  return arr.map(() => ({\r\n    x: utils.getRandomNumber(min, max),\r\n    y: utils.getRandomNumber(min, max),\r\n    r: utils.getRandomNumber(rmin, rmax)\r\n  }));\r\n};\r\n\r\nexport { chartJsDefaultTooltip, chartJsInit, getBubbleDataset };\r\n", "import utils from '../../utils';\r\nimport { chartJsDefaultTooltip, chartJsInit } from './chartjs-utils';\r\n\r\n/* -------------------------------------------------------------------------- */\r\n/*                                  bar-chart                                 */\r\n/* -------------------------------------------------------------------------- */\r\n\r\nconst barChartInit = () => {\r\n  const barChartElement = document.getElementById('chartjs-bar-chart');\r\n\r\n  const getOptions = () => ({\r\n    type: 'bar',\r\n    data: {\r\n      labels: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun'],\r\n      datasets: [\r\n        {\r\n          label: '# of Votes',\r\n          data: [12, 19, 3, 5, 6, 3],\r\n          backgroundColor: [\r\n            utils.rgbaColor(utils.getColor('secondary'), 0.2),\r\n            utils.rgbaColor(utils.getColor('warning'), 0.2),\r\n            utils.rgbaColor(utils.getColor('info'), 0.2),\r\n            utils.rgbaColor(utils.getColor('success'), 0.2),\r\n            utils.rgbaColor(utils.getColor('info'), 0.2),\r\n            utils.rgbaColor(utils.getColor('primary'), 0.2)\r\n          ],\r\n          borderColor: [\r\n            utils.getColor('secondary'),\r\n            utils.getColor('warning'),\r\n            utils.getColor('info'),\r\n            utils.getColor('success'),\r\n            utils.getColor('info'),\r\n            utils.getColor('primary')\r\n          ],\r\n          borderWidth: 1\r\n        }\r\n      ]\r\n    },\r\n    options: {\r\n      plugins: {\r\n        tooltip: chartJsDefaultTooltip()\r\n      },\r\n      scales: {\r\n        x: {\r\n          grid: {\r\n            color: utils.rgbaColor(utils.getGrays()['black'], 0.1)\r\n          }\r\n        },\r\n        y: {\r\n          grid: {\r\n            color: utils.rgbaColor(utils.getGrays()['black'], 0.1),\r\n            drawBorder: true\r\n          }\r\n        }\r\n      }\r\n    }\r\n  });\r\n\r\n  chartJsInit(barChartElement, getOptions);\r\n};\r\n\r\nexport default barChartInit;\r\n", "/* -------------------------------------------------------------------------- */\r\n/*                               from-validation                              */\r\n/* -------------------------------------------------------------------------- */\r\n\r\nconst formValidationInit = () => {\r\n  // Example starter JavaScript for disabling form submissions if there are invalid fields\r\n  \"use strict\";\r\n\r\n  // Fetch all the forms we want to apply custom Bootstrap validation styles to\r\n  var forms = document.querySelectorAll(\".needs-validation\");\r\n\r\n  // Loop over them and prevent submission\r\n  Array.prototype.slice.call(forms).forEach(function (form) {\r\n    form.addEventListener(\r\n      \"submit\",\r\n      function (event) {\r\n        if (!form.checkValidity()) {\r\n          event.preventDefault();\r\n          event.stopPropagation();\r\n        }\r\n\r\n        form.classList.add(\"was-validated\");\r\n      },\r\n      false\r\n    );\r\n  });\r\n};\r\n\r\nexport default formValidationInit;\r\n", "/* -------------------------------------------------------------------------- */\r\n/*                                   leaflet                                  */\r\n/* -------------------------------------------------------------------------- */\r\n\r\nconst leafletActiveUserInit = () => {\r\n  const points = [\r\n    {\r\n      lat: 53.958332,\r\n      long: -1.080278,\r\n      name: \"Diana Meyer\",\r\n      street: \"Slude Strand 27\",\r\n      location: \"1130 Kobenhavn\",\r\n    },\r\n    {\r\n      lat: 52.958332,\r\n      long: -1.080278,\r\n      name: \"Diana Meyer\",\r\n      street: \"Slude Strand 27\",\r\n      location: \"1130 Kobenhavn\",\r\n    },\r\n    {\r\n      lat: 51.958332,\r\n      long: -1.080278,\r\n      name: \"Diana Meyer\",\r\n      street: \"Slude Strand 27\",\r\n      location: \"1130 Kobenhavn\",\r\n    },\r\n    {\r\n      lat: 53.958332,\r\n      long: -1.080278,\r\n      name: \"Diana Meyer\",\r\n      street: \"Slude Strand 27\",\r\n      location: \"1130 Kobenhavn\",\r\n    },\r\n    {\r\n      lat: 54.958332,\r\n      long: -1.080278,\r\n      name: \"Diana Meyer\",\r\n      street: \"Slude Strand 27\",\r\n      location: \"1130 Kobenhavn\",\r\n    },\r\n    {\r\n      lat: 55.958332,\r\n      long: -1.080278,\r\n      name: \"Diana Meyer\",\r\n      street: \"Slude Strand 27\",\r\n      location: \"1130 Kobenhavn\",\r\n    },\r\n    {\r\n      lat: 53.908332,\r\n      long: -1.080278,\r\n      name: \"Diana Meyer\",\r\n      street: \"Slude Strand 27\",\r\n      location: \"1130 Kobenhavn\",\r\n    },\r\n    {\r\n      lat: 53.008332,\r\n      long: -1.080278,\r\n      name: \"Diana Meyer\",\r\n      street: \"Slude Strand 27\",\r\n      location: \"1130 Kobenhavn\",\r\n    },\r\n    {\r\n      lat: 53.158332,\r\n      long: -1.080278,\r\n      name: \"Diana Meyer\",\r\n      street: \"Slude Strand 27\",\r\n      location: \"1130 Kobenhavn\",\r\n    },\r\n    {\r\n      lat: 53.000032,\r\n      long: -1.080278,\r\n      name: \"Diana Meyer\",\r\n      street: \"Slude Strand 27\",\r\n      location: \"1130 Kobenhavn\",\r\n    },\r\n    {\r\n      lat: 52.292001,\r\n      long: -2.22,\r\n      name: \"Anke Schroder\",\r\n      street: \"Industrivej 54\",\r\n      location: \"4140 Borup\",\r\n    },\r\n    {\r\n      lat: 52.392001,\r\n      long: -2.22,\r\n      name: \"Anke Schroder\",\r\n      street: \"Industrivej 54\",\r\n      location: \"4140 Borup\",\r\n    },\r\n    {\r\n      lat: 51.492001,\r\n      long: -2.22,\r\n      name: \"Anke Schroder\",\r\n      street: \"Industrivej 54\",\r\n      location: \"4140 Borup\",\r\n    },\r\n    {\r\n      lat: 51.192001,\r\n      long: -2.22,\r\n      name: \"Anke Schroder\",\r\n      street: \"Industrivej 54\",\r\n      location: \"4140 Borup\",\r\n    },\r\n    {\r\n      lat: 52.292001,\r\n      long: -2.22,\r\n      name: \"Anke Schroder\",\r\n      street: \"Industrivej 54\",\r\n      location: \"4140 Borup\",\r\n    },\r\n    {\r\n      lat: 54.392001,\r\n      long: -2.22,\r\n      name: \"Anke Schroder\",\r\n      street: \"Industrivej 54\",\r\n      location: \"4140 Borup\",\r\n    },\r\n    {\r\n      lat: 51.292001,\r\n      long: -2.22,\r\n      name: \"Anke Schroder\",\r\n      street: \"Industrivej 54\",\r\n      location: \"4140 Borup\",\r\n    },\r\n    {\r\n      lat: 52.102001,\r\n      long: -2.22,\r\n      name: \"Anke Schroder\",\r\n      street: \"Industrivej 54\",\r\n      location: \"4140 Borup\",\r\n    },\r\n    {\r\n      lat: 52.202001,\r\n      long: -2.22,\r\n      name: \"Anke Schroder\",\r\n      street: \"Industrivej 54\",\r\n      location: \"4140 Borup\",\r\n    },\r\n    {\r\n      lat: 51.063202,\r\n      long: -1.308,\r\n      name: \"Tobias Vogel\",\r\n      street: \"Mollebakken 33\",\r\n      location: \"3650 Olstykke\",\r\n    },\r\n    {\r\n      lat: 51.363202,\r\n      long: -1.308,\r\n      name: \"Tobias Vogel\",\r\n      street: \"Mollebakken 33\",\r\n      location: \"3650 Olstykke\",\r\n    },\r\n    {\r\n      lat: 51.463202,\r\n      long: -1.308,\r\n      name: \"Tobias Vogel\",\r\n      street: \"Mollebakken 33\",\r\n      location: \"3650 Olstykke\",\r\n    },\r\n    {\r\n      lat: 51.563202,\r\n      long: -1.308,\r\n      name: \"Tobias Vogel\",\r\n      street: \"Mollebakken 33\",\r\n      location: \"3650 Olstykke\",\r\n    },\r\n    {\r\n      lat: 51.763202,\r\n      long: -1.308,\r\n      name: \"Tobias Vogel\",\r\n      street: \"Mollebakken 33\",\r\n      location: \"3650 Olstykke\",\r\n    },\r\n    {\r\n      lat: 51.863202,\r\n      long: -1.308,\r\n      name: \"Tobias Vogel\",\r\n      street: \"Mollebakken 33\",\r\n      location: \"3650 Olstykke\",\r\n    },\r\n    {\r\n      lat: 51.963202,\r\n      long: -1.308,\r\n      name: \"Tobias Vogel\",\r\n      street: \"Mollebakken 33\",\r\n      location: \"3650 Olstykke\",\r\n    },\r\n    {\r\n      lat: 51.000202,\r\n      long: -1.308,\r\n      name: \"Tobias Vogel\",\r\n      street: \"Mollebakken 33\",\r\n      location: \"3650 Olstykke\",\r\n    },\r\n    {\r\n      lat: 51.000202,\r\n      long: -1.308,\r\n      name: \"Tobias Vogel\",\r\n      street: \"Mollebakken 33\",\r\n      location: \"3650 Olstykke\",\r\n    },\r\n    {\r\n      lat: 51.163202,\r\n      long: -1.308,\r\n      name: \"Tobias Vogel\",\r\n      street: \"Mollebakken 33\",\r\n      location: \"3650 Olstykke\",\r\n    },\r\n    {\r\n      lat: 52.263202,\r\n      long: -1.308,\r\n      name: \"Tobias Vogel\",\r\n      street: \"Mollebakken 33\",\r\n      location: \"3650 Olstykke\",\r\n    },\r\n    {\r\n      lat: 53.463202,\r\n      long: -1.308,\r\n      name: \"Tobias Vogel\",\r\n      street: \"Mollebakken 33\",\r\n      location: \"3650 Olstykke\",\r\n    },\r\n    {\r\n      lat: 55.163202,\r\n      long: -1.308,\r\n      name: \"Tobias Vogel\",\r\n      street: \"Mollebakken 33\",\r\n      location: \"3650 Olstykke\",\r\n    },\r\n    {\r\n      lat: 56.263202,\r\n      long: -1.308,\r\n      name: \"Tobias Vogel\",\r\n      street: \"Mollebakken 33\",\r\n      location: \"3650 Olstykke\",\r\n    },\r\n    {\r\n      lat: 56.463202,\r\n      long: -1.308,\r\n      name: \"Tobias Vogel\",\r\n      street: \"Mollebakken 33\",\r\n      location: \"3650 Olstykke\",\r\n    },\r\n    {\r\n      lat: 56.563202,\r\n      long: -1.308,\r\n      name: \"Tobias Vogel\",\r\n      street: \"Mollebakken 33\",\r\n      location: \"3650 Olstykke\",\r\n    },\r\n    {\r\n      lat: 56.663202,\r\n      long: -1.308,\r\n      name: \"Tobias Vogel\",\r\n      street: \"Mollebakken 33\",\r\n      location: \"3650 Olstykke\",\r\n    },\r\n    {\r\n      lat: 56.763202,\r\n      long: -1.308,\r\n      name: \"Tobias Vogel\",\r\n      street: \"Mollebakken 33\",\r\n      location: \"3650 Olstykke\",\r\n    },\r\n    {\r\n      lat: 56.863202,\r\n      long: -1.308,\r\n      name: \"Tobias Vogel\",\r\n      street: \"Mollebakken 33\",\r\n      location: \"3650 Olstykke\",\r\n    },\r\n    {\r\n      lat: 56.963202,\r\n      long: -1.308,\r\n      name: \"Tobias Vogel\",\r\n      street: \"Mollebakken 33\",\r\n      location: \"3650 Olstykke\",\r\n    },\r\n    {\r\n      lat: 57.973202,\r\n      long: -1.308,\r\n      name: \"Tobias Vogel\",\r\n      street: \"Mollebakken 33\",\r\n      location: \"3650 Olstykke\",\r\n    },\r\n    {\r\n      lat: 57.163202,\r\n      long: -1.308,\r\n      name: \"Tobias Vogel\",\r\n      street: \"Mollebakken 33\",\r\n      location: \"3650 Olstykke\",\r\n    },\r\n    {\r\n      lat: 51.163202,\r\n      long: -1.308,\r\n      name: \"Tobias Vogel\",\r\n      street: \"Mollebakken 33\",\r\n      location: \"3650 Olstykke\",\r\n    },\r\n    {\r\n      lat: 51.263202,\r\n      long: -1.308,\r\n      name: \"Tobias Vogel\",\r\n      street: \"Mollebakken 33\",\r\n      location: \"3650 Olstykke\",\r\n    },\r\n    {\r\n      lat: 51.363202,\r\n      long: -1.308,\r\n      name: \"Tobias Vogel\",\r\n      street: \"Mollebakken 33\",\r\n      location: \"3650 Olstykke\",\r\n    },\r\n    {\r\n      lat: 51.409,\r\n      long: -2.647,\r\n      name: \"Richard Hendricks\",\r\n      street: \"37 Seafield Place\",\r\n      location: \"London\",\r\n    },\r\n    {\r\n      lat: 53.68,\r\n      long: -1.49,\r\n      name: \"Richard Hendricks\",\r\n      street: \"37 Seafield Place\",\r\n      location: \"London\",\r\n    },\r\n    {\r\n      lat: 50.259998,\r\n      long: -5.051,\r\n      name: \"Richard Hendricks\",\r\n      street: \"37 Seafield Place\",\r\n      location: \"London\",\r\n    },\r\n    {\r\n      lat: 54.906101,\r\n      long: -1.38113,\r\n      name: \"Richard Hendricks\",\r\n      street: \"37 Seafield Place\",\r\n      location: \"London\",\r\n    },\r\n    {\r\n      lat: 53.383331,\r\n      long: -1.466667,\r\n      name: \"Richard Hendricks\",\r\n      street: \"37 Seafield Place\",\r\n      location: \"London\",\r\n    },\r\n    {\r\n      lat: 53.483002,\r\n      long: -2.2931,\r\n      name: \"Richard Hendricks\",\r\n      street: \"37 Seafield Place\",\r\n      location: \"London\",\r\n    },\r\n    {\r\n      lat: 51.509865,\r\n      long: -0.118092,\r\n      name: \"Richard Hendricks\",\r\n      street: \"37 Seafield Place\",\r\n      location: \"London\",\r\n    },\r\n    {\r\n      lat: 51.109865,\r\n      long: -0.118092,\r\n      name: \"Richard Hendricks\",\r\n      street: \"37 Seafield Place\",\r\n      location: \"London\",\r\n    },\r\n    {\r\n      lat: 51.209865,\r\n      long: -0.118092,\r\n      name: \"Richard Hendricks\",\r\n      street: \"37 Seafield Place\",\r\n      location: \"London\",\r\n    },\r\n    {\r\n      lat: 51.309865,\r\n      long: -0.118092,\r\n      name: \"Richard Hendricks\",\r\n      street: \"37 Seafield Place\",\r\n      location: \"London\",\r\n    },\r\n    {\r\n      lat: 51.409865,\r\n      long: -0.118092,\r\n      name: \"Richard Hendricks\",\r\n      street: \"37 Seafield Place\",\r\n      location: \"London\",\r\n    },\r\n    {\r\n      lat: 51.609865,\r\n      long: -0.118092,\r\n      name: \"Richard Hendricks\",\r\n      street: \"37 Seafield Place\",\r\n      location: \"London\",\r\n    },\r\n    {\r\n      lat: 51.709865,\r\n      long: -0.118092,\r\n      name: \"Richard Hendricks\",\r\n      street: \"37 Seafield Place\",\r\n      location: \"London\",\r\n    },\r\n    {\r\n      lat: 51.809865,\r\n      long: -0.118092,\r\n      name: \"Richard Hendricks\",\r\n      street: \"37 Seafield Place\",\r\n      location: \"London\",\r\n    },\r\n    {\r\n      lat: 51.909865,\r\n      long: -0.118092,\r\n      name: \"Richard Hendricks\",\r\n      street: \"37 Seafield Place\",\r\n      location: \"London\",\r\n    },\r\n    {\r\n      lat: 52.109865,\r\n      long: -0.118092,\r\n      name: \"Richard Hendricks\",\r\n      street: \"37 Seafield Place\",\r\n      location: \"London\",\r\n    },\r\n    {\r\n      lat: 52.209865,\r\n      long: -0.118092,\r\n      name: \"Richard Hendricks\",\r\n      street: \"37 Seafield Place\",\r\n      location: \"London\",\r\n    },\r\n    {\r\n      lat: 52.309865,\r\n      long: -0.118092,\r\n      name: \"Richard Hendricks\",\r\n      street: \"37 Seafield Place\",\r\n      location: \"London\",\r\n    },\r\n    {\r\n      lat: 52.409865,\r\n      long: -0.118092,\r\n      name: \"Richard Hendricks\",\r\n      street: \"37 Seafield Place\",\r\n      location: \"London\",\r\n    },\r\n    {\r\n      lat: 52.509865,\r\n      long: -0.118092,\r\n      name: \"Richard Hendricks\",\r\n      street: \"37 Seafield Place\",\r\n      location: \"London\",\r\n    },\r\n    {\r\n      lat: 52.609865,\r\n      long: -0.118092,\r\n      name: \"Richard Hendricks\",\r\n      street: \"37 Seafield Place\",\r\n      location: \"London\",\r\n    },\r\n    {\r\n      lat: 52.709865,\r\n      long: -0.118092,\r\n      name: \"Richard Hendricks\",\r\n      street: \"37 Seafield Place\",\r\n      location: \"London\",\r\n    },\r\n    {\r\n      lat: 52.809865,\r\n      long: -0.118092,\r\n      name: \"Richard Hendricks\",\r\n      street: \"37 Seafield Place\",\r\n      location: \"London\",\r\n    },\r\n    {\r\n      lat: 52.909865,\r\n      long: -0.118092,\r\n      name: \"Richard Hendricks\",\r\n      street: \"37 Seafield Place\",\r\n      location: \"London\",\r\n    },\r\n    {\r\n      lat: 52.519865,\r\n      long: -0.118092,\r\n      name: \"Richard Hendricks\",\r\n      street: \"37 Seafield Place\",\r\n      location: \"London\",\r\n    },\r\n    {\r\n      lat: 52.529865,\r\n      long: -0.118092,\r\n      name: \"Richard Hendricks\",\r\n      street: \"37 Seafield Place\",\r\n      location: \"London\",\r\n    },\r\n    {\r\n      lat: 52.539865,\r\n      long: -0.118092,\r\n      name: \"Richard Hendricks\",\r\n      street: \"37 Seafield Place\",\r\n      location: \"London\",\r\n    },\r\n    {\r\n      lat: 53.549865,\r\n      long: -0.118092,\r\n      name: \"Richard Hendricks\",\r\n      street: \"37 Seafield Place\",\r\n      location: \"London\",\r\n    },\r\n    {\r\n      lat: 52.549865,\r\n      long: -0.118092,\r\n      name: \"Richard Hendricks\",\r\n      street: \"37 Seafield Place\",\r\n      location: \"London\",\r\n    },\r\n    {\r\n      lat: 53.109865,\r\n      long: -0.118092,\r\n      name: \"Richard Hendricks\",\r\n      street: \"37 Seafield Place\",\r\n      location: \"London\",\r\n    },\r\n    {\r\n      lat: 53.209865,\r\n      long: -0.118092,\r\n      name: \"Richard Hendricks\",\r\n      street: \"37 Seafield Place\",\r\n      location: \"London\",\r\n    },\r\n    {\r\n      lat: 53.319865,\r\n      long: -0.118092,\r\n      name: \"Richard Hendricks\",\r\n      street: \"37 Seafield Place\",\r\n      location: \"London\",\r\n    },\r\n    {\r\n      lat: 53.329865,\r\n      long: -0.118092,\r\n      name: \"Richard Hendricks\",\r\n      street: \"37 Seafield Place\",\r\n      location: \"London\",\r\n    },\r\n    {\r\n      lat: 53.409865,\r\n      long: -0.118092,\r\n      name: \"Richard Hendricks\",\r\n      street: \"37 Seafield Place\",\r\n      location: \"London\",\r\n    },\r\n    {\r\n      lat: 53.559865,\r\n      long: -0.118092,\r\n      name: \"Richard Hendricks\",\r\n      street: \"37 Seafield Place\",\r\n      location: \"London\",\r\n    },\r\n    {\r\n      lat: 53.619865,\r\n      long: -0.118092,\r\n      name: \"Richard Hendricks\",\r\n      street: \"37 Seafield Place\",\r\n      location: \"London\",\r\n    },\r\n    {\r\n      lat: 53.629865,\r\n      long: -0.118092,\r\n      name: \"Richard Hendricks\",\r\n      street: \"37 Seafield Place\",\r\n      location: \"London\",\r\n    },\r\n    {\r\n      lat: 53.639865,\r\n      long: -0.118092,\r\n      name: \"Richard Hendricks\",\r\n      street: \"37 Seafield Place\",\r\n      location: \"London\",\r\n    },\r\n    {\r\n      lat: 53.649865,\r\n      long: -0.118092,\r\n      name: \"Richard Hendricks\",\r\n      street: \"37 Seafield Place\",\r\n      location: \"London\",\r\n    },\r\n    {\r\n      lat: 53.669865,\r\n      long: -0.118092,\r\n      name: \"Richard Hendricks\",\r\n      street: \"37 Seafield Place\",\r\n      location: \"London\",\r\n    },\r\n    {\r\n      lat: 53.669865,\r\n      long: -0.118092,\r\n      name: \"Richard Hendricks\",\r\n      street: \"37 Seafield Place\",\r\n      location: \"London\",\r\n    },\r\n    {\r\n      lat: 53.719865,\r\n      long: -0.118092,\r\n      name: \"Richard Hendricks\",\r\n      street: \"37 Seafield Place\",\r\n      location: \"London\",\r\n    },\r\n    {\r\n      lat: 53.739865,\r\n      long: -0.118092,\r\n      name: \"Richard Hendricks\",\r\n      street: \"37 Seafield Place\",\r\n      location: \"London\",\r\n    },\r\n    {\r\n      lat: 53.749865,\r\n      long: -0.118092,\r\n      name: \"Richard Hendricks\",\r\n      street: \"37 Seafield Place\",\r\n      location: \"London\",\r\n    },\r\n    {\r\n      lat: 53.759865,\r\n      long: -0.118092,\r\n      name: \"Richard Hendricks\",\r\n      street: \"37 Seafield Place\",\r\n      location: \"London\",\r\n    },\r\n    {\r\n      lat: 53.769865,\r\n      long: -0.118092,\r\n      name: \"Richard Hendricks\",\r\n      street: \"37 Seafield Place\",\r\n      location: \"London\",\r\n    },\r\n    {\r\n      lat: 53.769865,\r\n      long: -0.118092,\r\n      name: \"Richard Hendricks\",\r\n      street: \"37 Seafield Place\",\r\n      location: \"London\",\r\n    },\r\n    {\r\n      lat: 53.819865,\r\n      long: -0.118092,\r\n      name: \"Richard Hendricks\",\r\n      street: \"37 Seafield Place\",\r\n      location: \"London\",\r\n    },\r\n    {\r\n      lat: 53.829865,\r\n      long: -0.118092,\r\n      name: \"Richard Hendricks\",\r\n      street: \"37 Seafield Place\",\r\n      location: \"London\",\r\n    },\r\n    {\r\n      lat: 53.483959,\r\n      long: -2.244644,\r\n      name: \"Ethel B. Brooks\",\r\n      street: \"2576 Sun Valley Road\",\r\n    },\r\n    {\r\n      lat: 40.737,\r\n      long: -73.923,\r\n      name: \"Marshall D. Lewis\",\r\n      street: \"1489 Michigan Avenue\",\r\n      location: \"Michigan\",\r\n    },\r\n    {\r\n      lat: 39.737,\r\n      long: -73.923,\r\n      name: \"Marshall D. Lewis\",\r\n      street: \"1489 Michigan Avenue\",\r\n      location: \"Michigan\",\r\n    },\r\n    {\r\n      lat: 38.737,\r\n      long: -73.923,\r\n      name: \"Marshall D. Lewis\",\r\n      street: \"1489 Michigan Avenue\",\r\n      location: \"Michigan\",\r\n    },\r\n    {\r\n      lat: 37.737,\r\n      long: -73.923,\r\n      name: \"Marshall D. Lewis\",\r\n      street: \"1489 Michigan Avenue\",\r\n      location: \"Michigan\",\r\n    },\r\n    {\r\n      lat: 40.737,\r\n      long: -73.923,\r\n      name: \"Marshall D. Lewis\",\r\n      street: \"1489 Michigan Avenue\",\r\n      location: \"Michigan\",\r\n    },\r\n    {\r\n      lat: 41.737,\r\n      long: -73.923,\r\n      name: \"Marshall D. Lewis\",\r\n      street: \"1489 Michigan Avenue\",\r\n      location: \"Michigan\",\r\n    },\r\n    {\r\n      lat: 42.737,\r\n      long: -73.923,\r\n      name: \"Marshall D. Lewis\",\r\n      street: \"1489 Michigan Avenue\",\r\n      location: \"Michigan\",\r\n    },\r\n    {\r\n      lat: 43.737,\r\n      long: -73.923,\r\n      name: \"Marshall D. Lewis\",\r\n      street: \"1489 Michigan Avenue\",\r\n      location: \"Michigan\",\r\n    },\r\n    {\r\n      lat: 44.737,\r\n      long: -73.923,\r\n      name: \"Marshall D. Lewis\",\r\n      street: \"1489 Michigan Avenue\",\r\n      location: \"Michigan\",\r\n    },\r\n    {\r\n      lat: 45.737,\r\n      long: -73.923,\r\n      name: \"Marshall D. Lewis\",\r\n      street: \"1489 Michigan Avenue\",\r\n      location: \"Michigan\",\r\n    },\r\n    {\r\n      lat: 46.7128,\r\n      long: 74.006,\r\n      name: \"Elizabeth C. Lyons\",\r\n      street: \"4553 Kenwood Place\",\r\n      location: \"Fort Lauderdale\",\r\n    },\r\n    {\r\n      lat: 40.7128,\r\n      long: 74.1181,\r\n      name: \"Elizabeth C. Lyons\",\r\n      street: \"4553 Kenwood Place\",\r\n      location: \"Fort Lauderdale\",\r\n    },\r\n    {\r\n      lat: 14.235,\r\n      long: 51.9253,\r\n      name: \"Ralph D. Wylie\",\r\n      street: \"3186 Levy Court\",\r\n      location: \"North Reading\",\r\n    },\r\n    {\r\n      lat: 15.235,\r\n      long: 51.9253,\r\n      name: \"Ralph D. Wylie\",\r\n      street: \"3186 Levy Court\",\r\n      location: \"North Reading\",\r\n    },\r\n    {\r\n      lat: 16.235,\r\n      long: 51.9253,\r\n      name: \"Ralph D. Wylie\",\r\n      street: \"3186 Levy Court\",\r\n      location: \"North Reading\",\r\n    },\r\n    {\r\n      lat: 14.235,\r\n      long: 51.9253,\r\n      name: \"Ralph D. Wylie\",\r\n      street: \"3186 Levy Court\",\r\n      location: \"North Reading\",\r\n    },\r\n    {\r\n      lat: 15.8267,\r\n      long: 47.9218,\r\n      name: \"Hope A. Atkins\",\r\n      street: \"3715 Hillcrest Drive\",\r\n      location: \"Seattle\",\r\n    },\r\n    {\r\n      lat: 15.9267,\r\n      long: 47.9218,\r\n      name: \"Hope A. Atkins\",\r\n      street: \"3715 Hillcrest Drive\",\r\n      location: \"Seattle\",\r\n    },\r\n    {\r\n      lat: 23.4425,\r\n      long: 58.4438,\r\n      name: \"Samuel R. Bailey\",\r\n      street: \"2883 Raoul Wallenberg Place\",\r\n      location: \"Cheshire\",\r\n    },\r\n    {\r\n      lat: 23.5425,\r\n      long: 58.3438,\r\n      name: \"Samuel R. Bailey\",\r\n      street: \"2883 Raoul Wallenberg Place\",\r\n      location: \"Cheshire\",\r\n    },\r\n    {\r\n      lat: -37.8927369333,\r\n      long: 175.4087452333,\r\n      name: \"Samuel R. Bailey\",\r\n      street: \"3228 Glory Road\",\r\n      location: \"Nashville\",\r\n    },\r\n    {\r\n      lat: -38.9064188833,\r\n      long: 175.4441556833,\r\n      name: \"Samuel R. Bailey\",\r\n      street: \"3228 Glory Road\",\r\n      location: \"Nashville\",\r\n    },\r\n    {\r\n      lat: -12.409874,\r\n      long: -65.596832,\r\n      name: \"Ann J. Perdue\",\r\n      street: \"921 Ella Street\",\r\n      location: \"Dublin\",\r\n    },\r\n    {\r\n      lat: -22.090887,\r\n      long: -57.411827,\r\n      name: \"Jorge C. Woods\",\r\n      street: \"4800 North Bend River Road\",\r\n      location: \"Allen\",\r\n    },\r\n    {\r\n      lat: -19.019585,\r\n      long: -65.261963,\r\n      name: \"Russ E. Panek\",\r\n      street: \"4068 Hartland Avenue\",\r\n      location: \"Appleton\",\r\n    },\r\n    {\r\n      lat: -16.500093,\r\n      long: -68.214684,\r\n      name: \"Russ E. Panek\",\r\n      street: \"4068 Hartland Avenue\",\r\n      location: \"Appleton\",\r\n    },\r\n    {\r\n      lat: -17.413977,\r\n      long: -66.165321,\r\n      name: \"Russ E. Panek\",\r\n      street: \"4068 Hartland Avenue\",\r\n      location: \"Appleton\",\r\n    },\r\n    {\r\n      lat: -16.489689,\r\n      long: -68.119293,\r\n      name: \"Russ E. Panek\",\r\n      street: \"4068 Hartland Avenue\",\r\n      location: \"Appleton\",\r\n    },\r\n    {\r\n      lat: 54.766323,\r\n      long: 3.08603729,\r\n      name: \"Russ E. Panek\",\r\n      street: \"4068 Hartland Avenue\",\r\n      location: \"Appleton\",\r\n    },\r\n    {\r\n      lat: 54.866323,\r\n      long: 3.08603729,\r\n      name: \"Russ E. Panek\",\r\n      street: \"4068 Hartland Avenue\",\r\n      location: \"Appleton\",\r\n    },\r\n    {\r\n      lat: 49.537685,\r\n      long: 3.08603729,\r\n      name: \"Russ E. Panek\",\r\n      street: \"4068 Hartland Avenue\",\r\n      location: \"Appleton\",\r\n    },\r\n    {\r\n      lat: 54.715424,\r\n      long: 0.509207,\r\n      name: \"Russ E. Panek\",\r\n      street: \"4068 Hartland Avenue\",\r\n      location: \"Appleton\",\r\n    },\r\n    {\r\n      lat: 44.891666,\r\n      long: 10.136665,\r\n      name: \"Russ E. Panek\",\r\n      street: \"4068 Hartland Avenue\",\r\n      location: \"Appleton\",\r\n    },\r\n    {\r\n      lat: 48.078335,\r\n      long: 14.535004,\r\n      name: \"Russ E. Panek\",\r\n      street: \"4068 Hartland Avenue\",\r\n      location: \"Appleton\",\r\n    },\r\n    {\r\n      lat: -26.358055,\r\n      long: 27.398056,\r\n      name: \"Russ E. Panek\",\r\n      street: \"4068 Hartland Avenue\",\r\n      location: \"Appleton\",\r\n    },\r\n    {\r\n      lat: -29.1,\r\n      long: 26.2167,\r\n      name: \"Wilbur J. Dry\",\r\n      street: \"2043 Jadewood Drive\",\r\n      location: \"Northbrook\",\r\n    },\r\n    {\r\n      lat: -29.883333,\r\n      long: 31.049999,\r\n      name: \"Wilbur J. Dry\",\r\n      street: \"2043 Jadewood Drive\",\r\n      location: \"Northbrook\",\r\n    },\r\n    {\r\n      lat: -26.266111,\r\n      long: 27.865833,\r\n      name: \"Wilbur J. Dry\",\r\n      street: \"2043 Jadewood Drive\",\r\n      location: \"Northbrook\",\r\n    },\r\n    {\r\n      lat: -29.087217,\r\n      long: 26.154898,\r\n      name: \"Wilbur J. Dry\",\r\n      street: \"2043 Jadewood Drive\",\r\n      location: \"Northbrook\",\r\n    },\r\n    {\r\n      lat: -33.958252,\r\n      long: 25.619022,\r\n      name: \"Wilbur J. Dry\",\r\n      street: \"2043 Jadewood Drive\",\r\n      location: \"Northbrook\",\r\n    },\r\n    {\r\n      lat: -33.977074,\r\n      long: 22.457581,\r\n      name: \"Wilbur J. Dry\",\r\n      street: \"2043 Jadewood Drive\",\r\n      location: \"Northbrook\",\r\n    },\r\n    {\r\n      lat: -26.563404,\r\n      long: 27.844164,\r\n      name: \"Wilbur J. Dry\",\r\n      street: \"2043 Jadewood Drive\",\r\n      location: \"Northbrook\",\r\n    },\r\n    {\r\n      lat: 51.21389,\r\n      long: -102.462776,\r\n      name: \"Joseph B. Poole\",\r\n      street: \"3364 Lunetta Street\",\r\n      location: \"Wichita Falls\",\r\n    },\r\n    {\r\n      lat: 52.321945,\r\n      long: -106.584167,\r\n      name: \"Joseph B. Poole\",\r\n      street: \"3364 Lunetta Street\",\r\n      location: \"Wichita Falls\",\r\n    },\r\n    {\r\n      lat: 50.288055,\r\n      long: -107.793892,\r\n      name: \"Joseph B. Poole\",\r\n      street: \"3364 Lunetta Street\",\r\n      location: \"Wichita Falls\",\r\n    },\r\n    {\r\n      lat: 52.7575,\r\n      long: -108.28611,\r\n      name: \"Joseph B. Poole\",\r\n      street: \"3364 Lunetta Street\",\r\n      location: \"Wichita Falls\",\r\n    },\r\n    {\r\n      lat: 50.393333,\r\n      long: -105.551941,\r\n      name: \"Joseph B. Poole\",\r\n      street: \"3364 Lunetta Street\",\r\n      location: \"Wichita Falls\",\r\n    },\r\n    {\r\n      lat: 50.930557,\r\n      long: -102.807777,\r\n      name: \"Joseph B. Poole\",\r\n      street: \"3364 Lunetta Street\",\r\n      location: \"Wichita Falls\",\r\n    },\r\n    {\r\n      lat: 52.856388,\r\n      long: -104.610001,\r\n      name: \"Joseph B. Poole\",\r\n      street: \"3364 Lunetta Street\",\r\n      location: \"Wichita Falls\",\r\n    },\r\n    {\r\n      lat: 52.289722,\r\n      long: -106.666664,\r\n      name: \"Joseph B. Poole\",\r\n      street: \"3364 Lunetta Street\",\r\n      location: \"Wichita Falls\",\r\n    },\r\n    {\r\n      lat: 52.201942,\r\n      long: -105.123055,\r\n      name: \"Joseph B. Poole\",\r\n      street: \"3364 Lunetta Street\",\r\n      location: \"Wichita Falls\",\r\n    },\r\n    {\r\n      lat: 53.278046,\r\n      long: -110.00547,\r\n      name: \"Joseph B. Poole\",\r\n      street: \"3364 Lunetta Street\",\r\n      location: \"Wichita Falls\",\r\n    },\r\n    {\r\n      lat: 49.13673,\r\n      long: -102.990959,\r\n      name: \"Joseph B. Poole\",\r\n      street: \"3364 Lunetta Street\",\r\n      location: \"Wichita Falls\",\r\n    },\r\n    {\r\n      lat: 45.484531,\r\n      long: -73.597023,\r\n      name: \"Claudette D. Nowakowski\",\r\n      street: \"3742 Farland Avenue\",\r\n      location: \"San Antonio\",\r\n    },\r\n    {\r\n      lat: 45.266666,\r\n      long: -71.900002,\r\n      name: \"Claudette D. Nowakowski\",\r\n      street: \"3742 Farland Avenue\",\r\n      location: \"San Antonio\",\r\n    },\r\n    {\r\n      lat: 45.349998,\r\n      long: -72.51667,\r\n      name: \"Claudette D. Nowakowski\",\r\n      street: \"3742 Farland Avenue\",\r\n      location: \"San Antonio\",\r\n    },\r\n    {\r\n      lat: 47.333332,\r\n      long: -79.433334,\r\n      name: \"Claudette D. Nowakowski\",\r\n      street: \"3742 Farland Avenue\",\r\n      location: \"San Antonio\",\r\n    },\r\n    {\r\n      lat: 45.400002,\r\n      long: -74.033333,\r\n      name: \"Claudette D. Nowakowski\",\r\n      street: \"3742 Farland Avenue\",\r\n      location: \"San Antonio\",\r\n    },\r\n    {\r\n      lat: 45.683334,\r\n      long: -73.433334,\r\n      name: \"Claudette D. Nowakowski\",\r\n      street: \"3742 Farland Avenue\",\r\n      location: \"San Antonio\",\r\n    },\r\n    {\r\n      lat: 48.099998,\r\n      long: -77.783333,\r\n      name: \"Claudette D. Nowakowski\",\r\n      street: \"3742 Farland Avenue\",\r\n      location: \"San Antonio\",\r\n    },\r\n    {\r\n      lat: 45.5,\r\n      long: -72.316666,\r\n      name: \"Claudette D. Nowakowski\",\r\n      street: \"3742 Farland Avenue\",\r\n      location: \"San Antonio\",\r\n    },\r\n    {\r\n      lat: 46.349998,\r\n      long: -72.550003,\r\n      name: \"Claudette D. Nowakowski\",\r\n      street: \"3742 Farland Avenue\",\r\n      location: \"San Antonio\",\r\n    },\r\n    {\r\n      lat: 48.119999,\r\n      long: -69.18,\r\n      name: \"Claudette D. Nowakowski\",\r\n      street: \"3742 Farland Avenue\",\r\n      location: \"San Antonio\",\r\n    },\r\n    {\r\n      lat: 45.599998,\r\n      long: -75.25,\r\n      name: \"Claudette D. Nowakowski\",\r\n      street: \"3742 Farland Avenue\",\r\n      location: \"San Antonio\",\r\n    },\r\n    {\r\n      lat: 46.099998,\r\n      long: -71.300003,\r\n      name: \"Claudette D. Nowakowski\",\r\n      street: \"3742 Farland Avenue\",\r\n      location: \"San Antonio\",\r\n    },\r\n    {\r\n      lat: 45.700001,\r\n      long: -73.633331,\r\n      name: \"Claudette D. Nowakowski\",\r\n      street: \"3742 Farland Avenue\",\r\n      location: \"San Antonio\",\r\n    },\r\n    {\r\n      lat: 47.68,\r\n      long: -68.879997,\r\n      name: \"Claudette D. Nowakowski\",\r\n      street: \"3742 Farland Avenue\",\r\n      location: \"San Antonio\",\r\n    },\r\n    {\r\n      lat: 46.716667,\r\n      long: -79.099998,\r\n      name: \"299\",\r\n    },\r\n    {\r\n      lat: 45.016666,\r\n      long: -72.099998,\r\n      name: \"299\",\r\n    },\r\n  ];\r\n\r\n  const { L } = window;\r\n  const mapContainer = document.getElementById(\"map\");\r\n  if (L && mapContainer) {\r\n    let getFilterColor = () => {\r\n      return localStorage.getItem(\"theme\") === \"dark\"\r\n        ? [\r\n            \"invert:98%\",\r\n            \"grayscale:69%\",\r\n            \"bright:89%\",\r\n            \"contrast:111%\",\r\n            \"hue:205deg\",\r\n            \"saturate:1000%\",\r\n          ]\r\n        : [\"bright:101%\", \"contrast:101%\", \"hue:23deg\", \"saturate:225%\"];\r\n    };\r\n\r\n    let tileLayerTheme =\r\n      \"https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}{r}.png\";\r\n\r\n    let tiles = L.tileLayer.colorFilter(tileLayerTheme, {\r\n      attribution: null,\r\n      transparent: true,\r\n      filter: getFilterColor(),\r\n    });\r\n\r\n    let map = L.map(\"map\", {\r\n      center: L.latLng(10.737, 0),\r\n      zoom: 0,\r\n      layers: [tiles],\r\n      minZoom: 1.3,\r\n      zoomSnap: 0.5,\r\n      dragging: !L.Browser.mobile,\r\n      tap: !L.Browser.mobile,\r\n    });\r\n\r\n    let mcg = L.markerClusterGroup({\r\n      chunkedLoading: false,\r\n      spiderfyOnMaxZoom: false,\r\n    });\r\n\r\n    points.map((point) => {\r\n      const { name, location, street } = point;\r\n      const icon = L.icon({\r\n        iconUrl: `data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAACXBIWXMAAAFgAAABYAEg2RPaAAADpElEQVRYCZ1XS1LbQBBtybIdiMEJKSpUqihgEW/xDdARyAnirOIl3MBH8NK7mBvkBpFv4Gy9IRSpFIQiRPyNfqkeZkY9HwmFt7Lm06+7p/vN2MmyDIrQ6QebALAHAD4AbFuWfQeAAACGs5H/w5jlsJJw4wMA+GhMFuMA99jIDJJOP+ihZwDQFmNuowWO1wS3viDXpdEdZPEc0odruj0EgN5s5H8tJOEEX8R3rbkMtcU34NTqhe5nSQTJ7Tkk80s6/Gk28scGiULguFBffgdufdEwWoQ0uoXo8hdAlooVH0REjISfwZSlyHGh0V5n6aHAtKTxXI5g6nQnMH0P4bEgwtR18Yw8Pj8QZ4ARUAI0Hl+fQZZGisGEBVwHr7XKzox57DXZ/ij8Cdwe2u057z9/wygOxRl4S2vSUHx1oucaMQGAHTrgtdag9mK5aN+Wx/uAAQ9Zenp/SRce4TpaNbQK4+sTcGqeTB/aIXv3XN5oj2VKqii++U0JunpZ8urxee4hvjqVc2hHpBDXuKKT9XMgVYJ1/1fPGSeaikzgmWWkMIi9bVf8UhotXxzORn5gWFchI8QyttlzjS0qpsaIGY2MMsujV/AUSdcY0dDpB6/EiOPYzclR1CI5mOez3ekHvrFLxa7cR5pTscfrXjk0Vhm5V2PqLUWnH3R5GbPGpMVD7E1ckXesKBQ7AS/vmQ1c0+kHuxpBj98lTCm8pbc5QRJRdZ6qHb/wGryXq3Lxszv+5gySuwvxueXySwYvHEjuQ9ofTGKYlrmK1EsCHMd5SoD7mZ1HHFCBHLNbMEshvrugqWLn01hpVVJhFgVGkDvK7hR6n2B+d9C7xsqWsbkqHv4cCsWezEb+o2SR+SFweUBxfA5wH7kShjKt2vWL57Px3GhIFEezkb8pxvUWHYhotAfCk2AtkEcxoOttrxUWDR5svb1emSQKj0WXK1HYIgFREbiBqmoZcB2RkbE+byMZiosorVgAZF1ID7yQhEs38wa7nUqNDezdlavC2HbBGSQkGgZ8uJVBmzeiKCRRpEa9ilWghORVeGB7BxeSKF5xqbFBkxBrFKUk/JHA7ppENQaCnCjthK+3opCEYyANztXmZN858cDYWSUSHk3A311GAZDvo6deNKUk1EsqnJoQlkYBNlmxQZeaMgmxoUokICoHDce351RCCiuKoirJWEgNOYvQplM2VCLhUqF7jf94rW9kHVUjQeheV4riv0i4ZOzzz/2y/+0KAOAfr4EE4HpCFhwAAAAASUVORK5CYII=`,\r\n      });\r\n      const marker = L.marker(\r\n        new L.LatLng(point.lat, point.long),\r\n        { icon },\r\n        {\r\n          name: name,\r\n          location: location,\r\n        }\r\n      );\r\n      const popupContent = `\r\n        <h6 class=\"mb-1\">${name}</h6>\r\n        <p class=\"m-0 text-500\">${street}, ${location}</p>\r\n      `;\r\n      const popup = L.popup({ minWidth: 180 }).setContent(popupContent);\r\n      marker.bindPopup(popup);\r\n      mcg.addLayer(marker);\r\n      return true;\r\n    });\r\n    map.addLayer(mcg);\r\n    const themeController = document.body;\r\n\r\n    themeController.addEventListener(\r\n      \"clickControl\",\r\n      ({ detail: { control, value } }) => {\r\n        if (control === \"theme\") {\r\n          tiles.updateFilter(\r\n            value === \"dark\"\r\n              ? [\r\n                  \"invert:98%\",\r\n                  \"grayscale:69%\",\r\n                  \"bright:89%\",\r\n                  \"contrast:111%\",\r\n                  \"hue:205deg\",\r\n                  \"saturate:1000%\",\r\n                ]\r\n              : [\"bright:101%\", \"contrast:101%\", \"hue:23deg\", \"saturate:225%\"]\r\n          );\r\n        }\r\n      }\r\n    );\r\n  }\r\n};\r\n\r\nexport default leafletActiveUserInit;\r\n", "import utils from './utils';\r\n\r\n/* -------------------------------------------------------------------------- */\r\n/*                                  Count Up                                  */\r\n/* -------------------------------------------------------------------------- */\r\n\r\nconst countupInit = () => {\r\n  if (window.countUp) {\r\n    const countups = document.querySelectorAll('[data-countup]');\r\n    countups.forEach((node) => {\r\n      const { endValue, ...options } = utils.getData(node, 'countup');\r\n      const countUp = new window.countUp.CountUp(node, endValue, {\r\n        duration: 5,\r\n        ...options,\r\n      });\r\n      if (!countUp.error) {\r\n        countUp.start();\r\n      } else {\r\n        console.error(countUp.error);\r\n      }\r\n    });\r\n  }\r\n};\r\n\r\nexport default countupInit;\r\n", "import utils from './utils';\r\n\r\n/* -------------------------------------------------------------------------- */\r\n/*                                  Copy LinK                                 */\r\n/* -------------------------------------------------------------------------- */\r\n\r\nconst copyLink = () => {\r\n  const copyLinkModal = document.getElementById('copyLinkModal');\r\n  copyLinkModal &&\r\n    copyLinkModal.addEventListener('shown.bs.modal', () => {\r\n      const invitationLink = document.querySelector('.invitation-link');\r\n      invitationLink.select();\r\n    });\r\n\r\n  const copyButtons = document.querySelectorAll('[data-copy]');\r\n  copyButtons &&\r\n    copyButtons.forEach((button) => {\r\n      const tooltip = new window.bootstrap.Tooltip(button);\r\n\r\n      button.addEventListener('mouseover', () => tooltip.show());\r\n      button.addEventListener('mouseleave', () => tooltip.hide());\r\n\r\n      button.addEventListener('click', (e) => {\r\n        e.stopPropagation();\r\n        const el = e.target;\r\n        el.setAttribute('data-original-title', 'Copied');\r\n        tooltip.show();\r\n        el.setAttribute('data-original-title', 'Copy to clipboard');\r\n        tooltip.update();\r\n        const inputID = utils.getData(el, 'copy');\r\n        const input = document.querySelector(inputID);\r\n        input.select();\r\n        document.execCommand('copy');\r\n      });\r\n    });\r\n};\r\n\r\nexport default copyLink;\r\n", "import utils from './utils';\r\n\r\n/* -------------------------------------------------------------------------- */\r\n/*                                 Typed Text                                 */\r\n/* -------------------------------------------------------------------------- */\r\n\r\nconst typedTextInit = () => {\r\n  const typedTexts = document.querySelectorAll('.typed-text');\r\n  if (typedTexts.length && window.Typed) {\r\n    typedTexts.forEach((typedText) => {\r\n      return new window.Typed(typedText, {\r\n        strings: utils.getData(typedText, 'typedText'),\r\n        typeSpeed: 100,\r\n        loop: true,\r\n        backDelay: 1500,\r\n      });\r\n    });\r\n  }\r\n};\r\n\r\nexport default typedTextInit;\r\n", "import utils from './utils';\r\n\r\n/* -------------------------------------------------------------------------- */\r\n/*                         Navbar Darken on scroll                        */\r\n/* -------------------------------------------------------------------------- */\r\nconst navbarDarkenOnScroll = () => {\r\n  const Selector = {\r\n    NAVBAR: '[data-navbar-darken-on-scroll]',\r\n    NAVBAR_COLLAPSE: '.navbar-collapse',\r\n    NAVBAR_TOGGLER: '.navbar-toggler',\r\n  };\r\n\r\n  const ClassNames = {\r\n    COLLAPSED: 'collapsed',\r\n  };\r\n\r\n  const Events = {\r\n    SCROLL: 'scroll',\r\n    SHOW_BS_COLLAPSE: 'show.bs.collapse',\r\n    HIDE_BS_COLLAPSE: 'hide.bs.collapse',\r\n    HIDDEN_BS_COLLAPSE: 'hidden.bs.collapse',\r\n  };\r\n\r\n  const DataKey = {\r\n    NAVBAR_DARKEN_ON_SCROLL: 'navbar-darken-on-scroll',\r\n  };\r\n\r\n  const navbar = document.querySelector(Selector.NAVBAR);\r\n\r\n  function removeNavbarBgClass() {\r\n    navbar.classList.remove('bg-dark');\r\n    navbar.classList.remove('bg-100');\r\n  }\r\n\r\n  const toggleThemeClass = (theme) => {\r\n    if (theme === 'dark') {\r\n      navbar.classList.remove('navbar-dark');\r\n      navbar.classList.add('navbar-light');\r\n    } else {\r\n      navbar.classList.remove('navbar-light');\r\n      navbar.classList.add('navbar-dark');\r\n    }\r\n  };\r\n\r\n  function getBgClassName(name, defaultColorName) {\r\n    const parent = document.documentElement;\r\n    const allColors = {\r\n      ...utils.getColors(parent),\r\n      ...utils.getGrays(parent),\r\n    };\r\n\r\n    const colorName = Object.keys(allColors).includes(name)\r\n      ? name\r\n      : defaultColorName;\r\n    const color = allColors[colorName];\r\n    const bgClassName = `bg-${colorName}`;\r\n    return { color, bgClassName };\r\n  }\r\n\r\n  if (navbar) {\r\n    const theme = localStorage.getItem('theme');\r\n    let defaultColorName = theme === 'dark' ? '100' : 'dark';\r\n    const name = utils.getData(navbar, DataKey.NAVBAR_DARKEN_ON_SCROLL);\r\n\r\n    toggleThemeClass(theme);\r\n    const themeController = document.body;\r\n    themeController.addEventListener(\r\n      'clickControl',\r\n      ({ detail: { control, value } }) => {\r\n        if (control === 'theme') {\r\n          toggleThemeClass(value);\r\n          defaultColorName = value === 'dark' ? '100' : 'dark';\r\n          if (\r\n            navbar.classList.contains('bg-dark') ||\r\n            navbar.classList.contains('bg-100')\r\n          ) {\r\n            removeNavbarBgClass();\r\n            navbar.classList.add(\r\n              getBgClassName(name, defaultColorName).bgClassName\r\n            );\r\n          }\r\n        }\r\n      }\r\n    );\r\n\r\n    const windowHeight = window.innerHeight;\r\n    const html = document.documentElement;\r\n    const navbarCollapse = navbar.querySelector(Selector.NAVBAR_COLLAPSE);\r\n    const colorRgb = utils.hexToRgb(\r\n      getBgClassName(name, defaultColorName).color\r\n    );\r\n    const { backgroundImage } = window.getComputedStyle(navbar);\r\n    const transition = 'background-color 0.35s ease';\r\n\r\n    navbar.style.backgroundImage = 'none';\r\n    // Change navbar background color on scroll\r\n    window.addEventListener(Events.SCROLL, () => {\r\n      const { scrollTop } = html;\r\n      let alpha = (scrollTop / windowHeight) * 2;\r\n      alpha >= 1 && (alpha = 1);\r\n      navbar.style.backgroundColor = `rgba(${colorRgb[0]}, ${colorRgb[1]}, ${colorRgb[2]}, ${alpha})`;\r\n      navbar.style.backgroundImage =\r\n        alpha > 0 || utils.hasClass(navbarCollapse, 'show')\r\n          ? backgroundImage\r\n          : 'none';\r\n    });\r\n\r\n    // Toggle bg class on window resize\r\n    utils.resize(() => {\r\n      const breakPoint = utils.getBreakpoint(navbar);\r\n      if (window.innerWidth > breakPoint) {\r\n        removeNavbarBgClass();\r\n        navbar.style.backgroundImage = html.scrollTop\r\n          ? backgroundImage\r\n          : 'none';\r\n        navbar.style.transition = 'none';\r\n      } else if (\r\n        !utils.hasClass(\r\n          navbar.querySelector(Selector.NAVBAR_TOGGLER),\r\n          ClassNames.COLLAPSED\r\n        )\r\n      ) {\r\n        removeNavbarBgClass();\r\n        navbar.style.backgroundImage = backgroundImage;\r\n      }\r\n\r\n      if (window.innerWidth <= breakPoint) {\r\n        navbar.style.transition = utils.hasClass(navbarCollapse, 'show')\r\n          ? transition\r\n          : 'none';\r\n      }\r\n    });\r\n\r\n    navbarCollapse.addEventListener(Events.SHOW_BS_COLLAPSE, () => {\r\n      navbar.classList.add(getBgClassName(name, defaultColorName).bgClassName);\r\n      navbar.style.backgroundImage = backgroundImage;\r\n      navbar.style.transition = transition;\r\n    });\r\n\r\n    navbarCollapse.addEventListener(Events.HIDE_BS_COLLAPSE, () => {\r\n      removeNavbarBgClass();\r\n      !html.scrollTop && (navbar.style.backgroundImage = 'none');\r\n    });\r\n\r\n    navbarCollapse.addEventListener(Events.HIDDEN_BS_COLLAPSE, () => {\r\n      navbar.style.transition = 'none';\r\n    });\r\n  }\r\n};\r\n\r\nexport default navbarDarkenOnScroll;\r\n", "import utils from './utils';\r\n\r\n/* -------------------------------------------------------------------------- */\r\n/*                                Scroll To Top                               */\r\n/* -------------------------------------------------------------------------- */\r\n\r\nconst scrollToTop = () => {\r\n  document\r\n    .querySelectorAll('[data-anchor] > a, [data-scroll-to]')\r\n    .forEach((anchor) => {\r\n      anchor.addEventListener('click', (e) => {\r\n        e.preventDefault();\r\n        const el = e.target;\r\n        const id = utils.getData(el, 'scroll-to') || el.getAttribute('href');\r\n        window.scroll({\r\n          top:\r\n            utils.getData(el, 'offset-top') ??\r\n            utils.getOffset(document.querySelector(id)).top - 100,\r\n          left: 0,\r\n          behavior: 'smooth',\r\n        });\r\n        window.location.hash = id;\r\n      });\r\n    });\r\n};\r\n\r\nexport default scrollToTop;\r\n", "import utils from './utils';\r\n\r\n/* -------------------------------------------------------------------------- */\r\n/*                                   Tinymce                                  */\r\n/* -------------------------------------------------------------------------- */\r\n\r\nconst tinymceInit = () => {\r\n  if (window.tinymce) {\r\n    const tinymces = document.querySelectorAll('.tinymce');\r\n    if (tinymces.length) {\r\n      window.tinymce.init({\r\n        selector: '.tinymce',\r\n        height: '50vh',\r\n        menubar: false,\r\n        skin: utils.settings.tinymce.theme,\r\n        content_style: `.mce-content-body { color: ${utils.getGrays().black} }`,\r\n        mobile: {\r\n          theme: 'mobile',\r\n          toolbar: ['undo', 'bold']\r\n        },\r\n        statusbar: false,\r\n        plugins: 'link,image,lists,table,media',\r\n        toolbar:\r\n          'styleselect | bold italic link bullist numlist image blockquote table media undo redo',\r\n        directionality: utils.getItemFromStore('isRTL') ? 'rtl' : 'ltr',\r\n        theme_advanced_toolbar_align: 'center'\r\n      });\r\n    }\r\n\r\n    const themeController = document.body;\r\n    themeController &&\r\n      themeController.addEventListener('clickControl', ({ detail: { control } }) => {\r\n        if (control === 'theme') {\r\n          window.tinyMCE.editors.forEach(el => {\r\n            el.dom.addStyle(`.mce-content-body{color: ${utils.getGrays().black} !important;}`);\r\n          });\r\n        }\r\n      });\r\n  }\r\n};\r\n\r\nexport default tinymceInit;\r\n", "/*-----------------------------------------------\r\n|   DomNode\r\n-----------------------------------------------*/\r\nclass DomNode {\r\n  constructor(node) {\r\n    this.node = node;\r\n  }\r\n\r\n  addClass(className) {\r\n    this.isValidNode() && this.node.classList.add(className);\r\n  }\r\n\r\n  removeClass(className) {\r\n    this.isValidNode() && this.node.classList.remove(className);\r\n  }\r\n\r\n  toggleClass(className) {\r\n    this.isValidNode() && this.node.classList.toggle(className);\r\n  }\r\n\r\n  hasClass(className) {\r\n    this.isValidNode() && this.node.classList.contains(className);\r\n  }\r\n\r\n  data(key) {\r\n    if (this.isValidNode()) {\r\n      try {\r\n        return JSON.parse(this.node.dataset[this.camelize(key)]);\r\n      } catch (e) {\r\n        return this.node.dataset[this.camelize(key)];\r\n      }\r\n    }\r\n    return null;\r\n  }\r\n\r\n  attr(name) {\r\n    return this.isValidNode() && this.node[name];\r\n  }\r\n\r\n  setAttribute(name, value) {\r\n    this.isValidNode() && this.node.setAttribute(name, value);\r\n  }\r\n\r\n  removeAttribute(name) {\r\n    this.isValidNode() && this.node.removeAttribute(name);\r\n  }\r\n\r\n  setProp(name, value) {\r\n    this.isValidNode() && (this.node[name] = value);\r\n  }\r\n\r\n  on(event, cb) {\r\n    this.isValidNode() && this.node.addEventListener(event, cb);\r\n  }\r\n\r\n  isValidNode() {\r\n    return !!this.node;\r\n  }\r\n\r\n  // eslint-disable-next-line class-methods-use-this\r\n  camelize(str) {\r\n    const text = str.replace(/[-_\\s.]+(.)?/g, (_, c) => (c ? c.toUpperCase() : ''));\r\n    return `${text.substr(0, 1).toLowerCase()}${text.substr(1)}`;\r\n  }\r\n}\r\n\r\nexport default DomNode;\r\n", "import DomNode from './node';\r\n\r\n/*-----------------------------------------------\r\n|   Bulk Select\r\n-----------------------------------------------*/\r\nclass BulkSelect {\r\n  constructor(element, option) {\r\n    this.element = new DomNode(element);\r\n    this.option = {\r\n      displayNoneClassName: 'd-none',\r\n      ...option,\r\n    };\r\n  }\r\n\r\n  init() {\r\n    this.attachNodes();\r\n    this.clickBulkCheckbox();\r\n    this.clickRowCheckbox();\r\n  }\r\n\r\n  attachNodes() {\r\n    const { body, actions, replacedElement } = this.element.data('bulk-select');\r\n    this.actions = new DomNode(document.getElementById(actions));\r\n    this.replacedElement = new DomNode(document.getElementById(replacedElement));\r\n    this.bulkSelectRows = document\r\n      .getElementById(body)\r\n      .querySelectorAll('[data-bulk-select-row]');\r\n  }\r\n\r\n  clickBulkCheckbox() {\r\n    // Handle click event in bulk checkbox\r\n    this.element.on('click', () => {\r\n      if (this.element.attr('indeterminate') === 'indeterminate') {\r\n        this.actions.addClass(this.option.displayNoneClassName);\r\n        this.replacedElement.removeClass(this.option.displayNoneClassName);\r\n\r\n        this.removeBulkCheck();\r\n\r\n        this.bulkSelectRows.forEach((el) => {\r\n          const rowCheck = new DomNode(el);\r\n          rowCheck.setProp('checked', false);\r\n          rowCheck.setAttribute('checked', false);\r\n        });\r\n        return;\r\n      }\r\n\r\n      this.toggleDisplay();\r\n      this.bulkSelectRows.forEach((el) => {\r\n        const rowCheck = new DomNode(el);\r\n        rowCheck.setProp('checked', this.element.attr('checked'));\r\n        rowCheck.setAttribute('checked', this.element.attr('checked'));\r\n      });\r\n    });\r\n  }\r\n\r\n  clickRowCheckbox() {\r\n    // Handle click event in checkbox of each row\r\n    this.bulkSelectRows.forEach((el) => {\r\n      const rowCheck = new DomNode(el);\r\n      rowCheck.on('click', () => {\r\n        if (this.element.attr('indeterminate') !== 'indeterminate') {\r\n          this.element.setProp('indeterminate', true);\r\n          this.element.setAttribute('indeterminate', 'indeterminate');\r\n          this.element.setProp('checked', true);\r\n          this.element.setAttribute('checked', true);\r\n\r\n          this.actions.removeClass(this.option.displayNoneClassName);\r\n          this.replacedElement.addClass(this.option.displayNoneClassName);\r\n        }\r\n\r\n        if ([...this.bulkSelectRows].every((element) => element.checked)) {\r\n          this.element.setProp('indeterminate', false);\r\n          this.element.setAttribute('indeterminate', false);\r\n        }\r\n\r\n        if ([...this.bulkSelectRows].every((element) => !element.checked)) {\r\n          this.removeBulkCheck();\r\n          this.toggleDisplay();\r\n        }\r\n      });\r\n    });\r\n  }\r\n\r\n  removeBulkCheck() {\r\n    this.element.setProp('indeterminate', false);\r\n    this.element.removeAttribute('indeterminate');\r\n    this.element.setProp('checked', false);\r\n    this.element.setAttribute('checked', false);\r\n  }\r\n\r\n  toggleDisplay() {\r\n    this.actions.toggleClass(this.option.displayNoneClassName);\r\n    this.replacedElement.toggleClass(this.option.displayNoneClassName);\r\n  }\r\n}\r\n\r\nfunction bulkSelectInit() {\r\n  const bulkSelects = document.querySelectorAll('[data-bulk-select');\r\n\r\n  if (bulkSelects.length) {\r\n    bulkSelects.forEach((el) => {\r\n      const bulkSelect = new BulkSelect(el);\r\n      bulkSelect.init();\r\n    });\r\n  }\r\n}\r\n\r\nexport default bulkSelectInit;\r\n", "import utils from './utils';\r\n\r\n/*-----------------------------------------------\r\n|  Quantity\r\n-----------------------------------------------*/\r\nconst quantityInit = () => {\r\n  const Selector = {\r\n    DATA_QUANTITY_BTN: '[data-quantity] [data-type]',\r\n    DATA_QUANTITY: '[data-quantity]',\r\n    DATA_QUANTITY_INPUT: '[data-quantity] input[type=\"number\"]',\r\n  };\r\n\r\n  const Events = {\r\n    CLICK: 'click',\r\n  };\r\n\r\n  const Attributes = {\r\n    MIN: 'min',\r\n  };\r\n\r\n  const DataKey = {\r\n    TYPE: 'type',\r\n  };\r\n\r\n  const quantities = document.querySelectorAll(Selector.DATA_QUANTITY_BTN);\r\n\r\n  quantities.forEach((quantity) => {\r\n    quantity.addEventListener(Events.CLICK, (e) => {\r\n      const el = e.currentTarget;\r\n      const type = utils.getData(el, DataKey.TYPE);\r\n      const numberInput = el\r\n        .closest(Selector.DATA_QUANTITY)\r\n        .querySelector(Selector.DATA_QUANTITY_INPUT);\r\n\r\n      const min = numberInput.getAttribute(Attributes.MIN);\r\n      let value = parseInt(numberInput.value, 10);\r\n\r\n      if (type === 'plus') {\r\n        value += 1;\r\n      } else {\r\n        value = value > min ? (value -= 1) : value;\r\n      }\r\n      numberInput.value = value;\r\n    });\r\n  });\r\n};\r\n\r\nexport default quantityInit;\r\n", "import utils from './utils';\r\n\r\n/* -------------------------------------------------------------------------- */\r\n/*                             Navbar Combo Layout                            */\r\n/* -------------------------------------------------------------------------- */\r\n\r\nconst navbarComboInit = () => {\r\n  const Selector = {\r\n    NAVBAR_VERTICAL: '.navbar-vertical',\r\n    NAVBAR_TOP_COMBO: '[data-navbar-top=\"combo\"]',\r\n    COLLAPSE: '.collapse',\r\n    DATA_MOVE_CONTAINER: '[data-move-container]',\r\n    NAVBAR_NAV: '.navbar-nav',\r\n    NAVBAR_VERTICAL_DIVIDER: '.navbar-vertical-divider',\r\n  };\r\n\r\n  const ClassName = {\r\n    FLEX_COLUMN: 'flex-column',\r\n  };\r\n\r\n  const navbarVertical = document.querySelector(Selector.NAVBAR_VERTICAL);\r\n  const navbarTopCombo = document.querySelector(Selector.NAVBAR_TOP_COMBO);\r\n\r\n  const moveNavContent = (windowWidth) => {\r\n    const navbarVerticalBreakpoint = utils.getBreakpoint(navbarVertical);\r\n    const navbarTopBreakpoint = utils.getBreakpoint(navbarTopCombo);\r\n\r\n    if (windowWidth < navbarTopBreakpoint) {\r\n      const navbarCollapse = navbarTopCombo.querySelector(Selector.COLLAPSE);\r\n      const navbarTopContent = navbarCollapse.innerHTML;\r\n\r\n      if (navbarTopContent) {\r\n        const targetID = utils.getData(navbarTopCombo, 'move-target');\r\n        const targetElement = document.querySelector(targetID);\r\n\r\n        navbarCollapse.innerHTML = '';\r\n        targetElement.insertAdjacentHTML(\r\n          'afterend',\r\n          `\r\n            <div data-move-container>\r\n              <div class='navbar-vertical-divider'>\r\n                <hr class='navbar-vertical-hr' />\r\n              </div>\r\n              ${navbarTopContent}\r\n            </div>\r\n          `\r\n        );\r\n\r\n        if (navbarVerticalBreakpoint < navbarTopBreakpoint) {\r\n          const navbarNav = document\r\n            .querySelector(Selector.DATA_MOVE_CONTAINER)\r\n            .querySelector(Selector.NAVBAR_NAV);\r\n          utils.addClass(navbarNav, ClassName.FLEX_COLUMN);\r\n        }\r\n      }\r\n    } else {\r\n      const moveableContainer = document.querySelector(\r\n        Selector.DATA_MOVE_CONTAINER\r\n      );\r\n      if (moveableContainer) {\r\n        const navbarNav = moveableContainer.querySelector(Selector.NAVBAR_NAV);\r\n        utils.hasClass(navbarNav, ClassName.FLEX_COLUMN) &&\r\n          navbarNav.classList.remove(ClassName.FLEX_COLUMN);\r\n        moveableContainer\r\n          .querySelector(Selector.NAVBAR_VERTICAL_DIVIDER)\r\n          .remove();\r\n        navbarTopCombo.querySelector(Selector.COLLAPSE).innerHTML =\r\n          moveableContainer.innerHTML;\r\n        moveableContainer.remove();\r\n      }\r\n    }\r\n  };\r\n\r\n  moveNavContent(window.innerWidth);\r\n\r\n  utils.resize(() => moveNavContent(window.innerWidth));\r\n};\r\n\r\nexport default navbarComboInit;\r\n", "import utils from './utils';\r\n\r\n/* -------------------------------------------------------------------------- */\r\n/*                                 Data Table                                 */\r\n/* -------------------------------------------------------------------------- */\r\n/* eslint-disable no-param-reassign */\r\n\r\nconst togglePaginationButtonDisable = (button, disabled) => {\r\n  button.disabled = disabled;\r\n  button.classList[disabled ? 'add' : 'remove']('disabled');\r\n};\r\n\r\nconst listInit = () => {\r\n  if (window.List) {\r\n    const lists = document.querySelectorAll('[data-list]');\r\n\r\n    if (lists.length) {\r\n      lists.forEach((el) => {\r\n        let options = utils.getData(el, 'list');\r\n\r\n        if (options.pagination) {\r\n          options = {\r\n            ...options,\r\n            pagination: {\r\n              item: `<li><button class='page' type='button'></button></li>`,\r\n              ...options.pagination,\r\n            },\r\n          };\r\n        }\r\n\r\n        const paginationButtonNext = el.querySelector(\r\n          '[data-list-pagination=\"next\"]'\r\n        );\r\n        const paginationButtonPrev = el.querySelector(\r\n          '[data-list-pagination=\"prev\"]'\r\n        );\r\n        const viewAll = el.querySelector('[data-list-view=\"*\"]');\r\n        const viewLess = el.querySelector('[data-list-view=\"less\"]');\r\n        const listInfo = el.querySelector('[data-list-info]');\r\n        const listFilter = document.querySelector('[data-list-filter]');\r\n        const list = new window.List(el, options);\r\n\r\n        //-------fallback-----------\r\n\r\n        list.on('updated', function (item) {\r\n          const fallback =\r\n            el.querySelector('.fallback') ||\r\n            document.getElementById(options.fallback);\r\n\r\n          if (fallback) {\r\n            if (item.matchingItems.length === 0) {\r\n              fallback.classList.remove('d-none');\r\n            } else {\r\n              fallback.classList.add('d-none');\r\n            }\r\n          }\r\n        });\r\n\r\n        // ---------------------------------------\r\n\r\n        const totalItem = list.items.length;\r\n        const itemsPerPage = list.page;\r\n        const btnDropdownClose = list.listContainer.querySelector('.btn-close');\r\n        let pageQuantity = Math.ceil(totalItem / itemsPerPage);\r\n        let numberOfcurrentItems = list.visibleItems.length;\r\n        let pageCount = 1;\r\n\r\n        btnDropdownClose &&\r\n          btnDropdownClose.addEventListener('search.close', () => {\r\n            list.fuzzySearch('');\r\n          });\r\n\r\n        const updateListControls = () => {\r\n          listInfo &&\r\n            (listInfo.innerHTML = `${list.i} to ${numberOfcurrentItems} of ${totalItem}`);\r\n          paginationButtonPrev &&\r\n            togglePaginationButtonDisable(\r\n              paginationButtonPrev,\r\n              pageCount === 1\r\n            );\r\n          paginationButtonNext &&\r\n            togglePaginationButtonDisable(\r\n              paginationButtonNext,\r\n              pageCount === pageQuantity\r\n            );\r\n\r\n          if (pageCount > 1 && pageCount < pageQuantity) {\r\n            togglePaginationButtonDisable(paginationButtonNext, false);\r\n            togglePaginationButtonDisable(paginationButtonPrev, false);\r\n          }\r\n        };\r\n\r\n        // List info\r\n        updateListControls();\r\n\r\n        if (paginationButtonNext) {\r\n          paginationButtonNext.addEventListener('click', (e) => {\r\n            e.preventDefault();\r\n            pageCount = pageCount + 1;\r\n\r\n            const nextInitialIndex = list.i + itemsPerPage;\r\n            nextInitialIndex <= list.size() &&\r\n              list.show(nextInitialIndex, itemsPerPage);\r\n            numberOfcurrentItems += list.visibleItems.length;\r\n            updateListControls();\r\n          });\r\n        }\r\n\r\n        if (paginationButtonPrev) {\r\n          paginationButtonPrev.addEventListener('click', (e) => {\r\n            e.preventDefault();\r\n            pageCount = pageCount - 1;\r\n\r\n            numberOfcurrentItems =\r\n              numberOfcurrentItems - list.visibleItems.length;\r\n            const prevItem = list.i - itemsPerPage;\r\n            prevItem > 0 && list.show(prevItem, itemsPerPage);\r\n            updateListControls();\r\n          });\r\n        }\r\n\r\n        const toggleViewBtn = () => {\r\n          viewLess.classList.toggle('d-none');\r\n          viewAll.classList.toggle('d-none');\r\n        };\r\n\r\n        if (viewAll) {\r\n          viewAll.addEventListener('click', () => {\r\n            list.show(1, totalItem);\r\n            pageQuantity = 1;\r\n            pageCount = 1;\r\n            numberOfcurrentItems = totalItem;\r\n            updateListControls();\r\n            toggleViewBtn();\r\n          });\r\n        }\r\n        if (viewLess) {\r\n          viewLess.addEventListener('click', () => {\r\n            list.show(1, itemsPerPage);\r\n            pageQuantity = Math.ceil(totalItem / itemsPerPage);\r\n            pageCount = 1;\r\n            numberOfcurrentItems = list.visibleItems.length;\r\n            updateListControls();\r\n            toggleViewBtn();\r\n          });\r\n        }\r\n        // numbering pagination\r\n        if (options.pagination) {\r\n          el.querySelector('.pagination').addEventListener('click', (e) => {\r\n            if (e.target.classList[0] === 'page') {\r\n              pageCount = Number(e.target.innerText);\r\n              updateListControls();\r\n            }\r\n          });\r\n        }\r\n        if (options.filter) {\r\n          listFilter.addEventListener('change', (e) => {\r\n            list.filter((item) => {\r\n              if (e.target.value === '') {\r\n                return true;\r\n              } else\r\n                return item\r\n                  .values()\r\n                  .payment.toLowerCase()\r\n                  .includes(e.target.value.toLowerCase());\r\n            });\r\n          });\r\n        }\r\n      });\r\n    }\r\n  }\r\n};\r\n\r\nexport default listInit;\r\n", "import utils from './utils';\r\n\r\n/*-----------------------------------------------\r\n|   Chat\r\n-----------------------------------------------*/\r\nconst chatInit = () => {\r\n  const Events = {\r\n    CLICK: 'click',\r\n    SHOWN_BS_TAB: 'shown.bs.tab',\r\n    KEYUP: 'keyup',\r\n    EMOJI: 'emoji',\r\n  };\r\n\r\n  const Selector = {\r\n    CHAT_SIDEBAR: '.chat-sidebar',\r\n    CHAT_CONTACT: '.chat-contact',\r\n    CHAT_CONTENT_SCROLL_AREA: '.chat-content-scroll-area',\r\n    CHAT_CONTENT_SCROLL_AREA_ACTIVE:\r\n      '.card-chat-pane.active .chat-content-scroll-area',\r\n    CHAT_EMOJIAREA: '.chat-editor-area .emojiarea-editor',\r\n    BTN_SEND: '.btn-send',\r\n    EMOJIEAREA_EDITOR: '.emojiarea-editor',\r\n    BTN_INFO: '.btn-info',\r\n    CONVERSATION_INFO: '.conversation-info',\r\n    CONTACTS_LIST_SHOW: '.contacts-list-show',\r\n  };\r\n\r\n  const ClassName = {\r\n    UNREAD_MESSAGE: 'unread-message',\r\n    TEXT_PRIMARY: 'text-primary',\r\n    SHOW: 'show',\r\n  };\r\n\r\n  const DATA_KEY = {\r\n    INDEX: 'index',\r\n  };\r\n\r\n  const $chatSidebar = document.querySelector(Selector.CHAT_SIDEBAR);\r\n  const $chatContact = document.querySelectorAll(Selector.CHAT_CONTACT);\r\n  const $chatEmojiarea = document.querySelector(Selector.CHAT_EMOJIAREA);\r\n  const $btnSend = document.querySelector(Selector.BTN_SEND);\r\n  const $currentChatArea = document.querySelector(\r\n    Selector.CHAT_CONTENT_SCROLL_AREA\r\n  );\r\n\r\n  // Set scrollbar position\r\n  const setScrollbarPosition = $chatArea => {\r\n    if ($chatArea) {\r\n      const scrollArea = $chatArea;\r\n      scrollArea.scrollTop = $chatArea.scrollHeight;\r\n    }\r\n  };\r\n\r\n  setTimeout(() => {\r\n    setScrollbarPosition($currentChatArea);\r\n  }, 700);\r\n\r\n  document.querySelectorAll(Selector.CHAT_CONTACT).forEach(el => {\r\n    el.addEventListener(Events.CLICK, e => {\r\n      const $this = e.currentTarget;\r\n      $this.classList.add('active');\r\n      // Hide contact list sidebar on responsive\r\n      window.innerWidth < 768 &&\r\n        !e.target.classList.contains('hover-actions') &&\r\n        ($chatSidebar.style.left = '-100%');\r\n\r\n      // Remove unread-message class when read\r\n      $this.classList.contains(ClassName.UNREAD_MESSAGE) &&\r\n        $this.classList.remove(ClassName.UNREAD_MESSAGE);\r\n    });\r\n  });\r\n\r\n  $chatContact.forEach(el => {\r\n    el.addEventListener(Events.SHOWN_BS_TAB, () => {\r\n      $chatEmojiarea.innerHTML = '';\r\n      $btnSend.classList.remove(ClassName.TEXT_PRIMARY);\r\n      const TargetChatArea = document.querySelector(\r\n        Selector.CHAT_CONTENT_SCROLL_AREA_ACTIVE\r\n      );\r\n      setScrollbarPosition(TargetChatArea);\r\n    });\r\n  });\r\n\r\n  // change send button color on\r\n\r\n  if ($chatEmojiarea) {\r\n    $chatEmojiarea.setAttribute('placeholder', 'Type your message');\r\n    $chatEmojiarea.addEventListener(Events.KEYUP, e => {\r\n      if (e.target.textContent.length <= 0) {\r\n        $btnSend.classList.remove(ClassName.TEXT_PRIMARY);\r\n        if (e.target.innerHTML === '<br>') {\r\n          e.target.innerHTML = '';\r\n        }\r\n      } else {\r\n        $btnSend.classList.add(ClassName.TEXT_PRIMARY);\r\n      }\r\n\r\n      const TargetChatArea = document.querySelector(\r\n        Selector.CHAT_CONTENT_SCROLL_AREA_ACTIVE\r\n      );\r\n      setScrollbarPosition(TargetChatArea);\r\n    });\r\n  }\r\n  // Open conversation info sidebar\r\n  $chatEmojiarea &&\r\n    document.querySelectorAll(Selector.BTN_INFO).forEach(el => {\r\n      el.addEventListener(Events.CLICK, e => {\r\n        const $this = e.currentTarget;\r\n        const dataIndex = utils.getData($this, DATA_KEY.INDEX);\r\n        const $info = document.querySelector(\r\n          `${Selector.CONVERSATION_INFO}[data-${DATA_KEY.INDEX}='${dataIndex}']`\r\n        );\r\n        $info.classList.toggle(ClassName.SHOW);\r\n      });\r\n    });\r\n\r\n  // Show contact list sidebar on responsive\r\n  document.querySelectorAll(Selector.CONTACTS_LIST_SHOW).forEach(el => {\r\n    el.addEventListener(Events.CLICK, function () {\r\n      $chatSidebar.style.left = 0;\r\n    });\r\n  });\r\n\r\n  // Set scrollbar area height on resize\r\n  utils.resize(() => {\r\n    const TargetChatArea = document.querySelector(\r\n      Selector.CHAT_CONTENT_SCROLL_AREA_ACTIVE\r\n    );\r\n    setScrollbarPosition(TargetChatArea);\r\n  });\r\n\r\n  // Emoji append in message text\r\n  $chatEmojiarea &&\r\n    window.picker.on(Events.EMOJI, selection => {\r\n      document.querySelector(Selector.EMOJIEAREA_EDITOR).innerHTML +=\r\n        selection.emoji;\r\n    });\r\n};\r\n\r\nexport default chatInit;\r\n", "/* -------------------------------------------------------------------------- */\r\n/*                                  Draggable                                 */\r\n/* -------------------------------------------------------------------------- */\r\n\r\nimport utils from './utils';\r\n\r\nconst draggableInit = () => {\r\n  const Selectors = {\r\n    BODY: 'body',\r\n    KANBAN_CONTAINER: '.kanban-container',\r\n    KABNBAN_COLUMN: '.kanban-column',\r\n    KANBAN_ITEMS_CONTAINER: '.kanban-items-container',\r\n    KANBAN_ITEM: '.kanban-item',\r\n    ADD_CARD_FORM: '.add-card-form',\r\n  };\r\n\r\n  const Events = {\r\n    DRAG_START: 'drag:start',\r\n    DRAG_STOP: 'drag:stop',\r\n  };\r\n\r\n  const ClassNames = {\r\n    FORM_ADDED: 'form-added',\r\n  };\r\n\r\n  const columns = document.querySelectorAll(Selectors.KABNBAN_COLUMN);\r\n  const columnContainers = document.querySelectorAll(\r\n    Selectors.KANBAN_ITEMS_CONTAINER\r\n  );\r\n  const container = document.querySelector(Selectors.KANBAN_CONTAINER);\r\n\r\n  if (!!columnContainers.length) {\r\n    // Initialize Sortable\r\n    const sortable = new window.Draggable.Sortable(columnContainers, {\r\n      draggable: Selectors.KANBAN_ITEM,\r\n      delay: 200,\r\n      mirror: {\r\n        appendTo: Selectors.BODY,\r\n        constrainDimensions: true,\r\n      },\r\n      scrollable: {\r\n        draggable: Selectors.KANBAN_ITEM,\r\n        scrollableElements: [...columnContainers, container],\r\n      },\r\n    });\r\n\r\n    // Hide form when drag start\r\n    sortable.on(Events.DRAG_START, () => {\r\n      columns.forEach((column) => {\r\n        utils.hasClass(column, ClassNames.FORM_ADDED) &&\r\n          column.classList.remove(ClassNames.FORM_ADDED);\r\n      });\r\n    });\r\n\r\n    // Place forms and other contents bottom of the sortable container\r\n    sortable.on(Events.DRAG_STOP, ({ data: { source: el } }) => {\r\n      const columnContainer = el.closest(Selectors.KANBAN_ITEMS_CONTAINER);\r\n      const form = columnContainer.querySelector(Selectors.ADD_CARD_FORM);\r\n\r\n      !el.nextElementSibling && columnContainer.appendChild(form);\r\n    });\r\n  }\r\n};\r\n\r\nexport default draggableInit;\r\n", "/* -------------------------------------------------------------------------- */\r\n/*                                   Kanbah                                   */\r\n/* -------------------------------------------------------------------------- */\r\n\r\nimport utils from './utils';\r\n\r\nconst kanbanInit = () => {\r\n  const Selectors = {\r\n    KANBAN_COLUMN: '.kanban-column',\r\n    KANBAN_ITEMS_CONTAINER: '.kanban-items-container',\r\n    BTN_ADD_CARD: '.btn-add-card',\r\n    COLLAPSE: '.collapse',\r\n    ADD_LIST_FORM: '#addListForm',\r\n    BTN_COLLAPSE_DISMISS: '[data-dismiss=\"collapse\"]',\r\n    BTN_FORM_HIDE: '[data-btn-form=\"hide\"]',\r\n    INPUT_ADD_CARD: '[data-input=\"add-card\"]',\r\n    INPUT_ADD_LIST: '[data-input=\"add-list\"]',\r\n  };\r\n\r\n  const ClassNames = {\r\n    FORM_ADDED: 'form-added',\r\n    D_NONE: 'd-none',\r\n  };\r\n\r\n  const Events = {\r\n    CLICK: 'click',\r\n    SHOW_BS_COLLAPSE: 'show.bs.collapse',\r\n    SHOWN_BS_COLLAPSE: 'shown.bs.collapse',\r\n  };\r\n\r\n  const addCardButtons = document.querySelectorAll(Selectors.BTN_ADD_CARD);\r\n  const formHideButtons = document.querySelectorAll(Selectors.BTN_FORM_HIDE);\r\n  const addListForm = document.querySelector(Selectors.ADD_LIST_FORM);\r\n  const collapseDismissButtons = document.querySelectorAll(\r\n    Selectors.BTN_COLLAPSE_DISMISS\r\n  );\r\n\r\n  // Show add card form and place scrollbar bottom of the list\r\n  addCardButtons &&\r\n    addCardButtons.forEach((button) => {\r\n      button.addEventListener(Events.CLICK, ({ currentTarget: el }) => {\r\n        const column = el.closest(Selectors.KANBAN_COLUMN);\r\n        const container = column.querySelector(\r\n          Selectors.KANBAN_ITEMS_CONTAINER\r\n        );\r\n        const scrollHeight = container.scrollHeight;\r\n\r\n        column.classList.add(ClassNames.FORM_ADDED);\r\n        container.querySelector(Selectors.INPUT_ADD_CARD).focus();\r\n        container.scrollTo({ top: scrollHeight });\r\n      });\r\n    });\r\n\r\n  // Remove add card form\r\n  formHideButtons.forEach((button) => {\r\n    button.addEventListener(Events.CLICK, ({ currentTarget: el }) => {\r\n      el.closest(Selectors.KANBAN_COLUMN).classList.remove(\r\n        ClassNames.FORM_ADDED\r\n      );\r\n    });\r\n  });\r\n\r\n  if (addListForm) {\r\n    // Hide add list button when the form is going to show\r\n    addListForm.addEventListener(\r\n      Events.SHOW_BS_COLLAPSE,\r\n      ({ currentTarget: el }) => {\r\n        const nextElement = el.nextElementSibling;\r\n        nextElement && nextElement.classList.add(ClassNames.D_NONE);\r\n      }\r\n    );\r\n\r\n    // Focus input field when the form is shown\r\n    addListForm.addEventListener(\r\n      Events.SHOWN_BS_COLLAPSE,\r\n      ({ currentTarget: el }) => {\r\n        el.querySelector(Selectors.INPUT_ADD_LIST).focus();\r\n      }\r\n    );\r\n  }\r\n\r\n  // Hide add list form when the dismiss button is clicked\r\n  collapseDismissButtons.forEach((button) => {\r\n    button.addEventListener(Events.CLICK, ({ currentTarget: el }) => {\r\n      const collapseElement = el.closest(Selectors.COLLAPSE);\r\n      const collapse = window.bootstrap.Collapse.getInstance(collapseElement);\r\n\r\n      utils.hasClass(collapseElement.nextElementSibling, ClassNames.D_NONE) &&\r\n        collapseElement.nextElementSibling.classList.remove(ClassNames.D_NONE);\r\n      collapse.hide();\r\n    });\r\n  });\r\n};\r\n\r\nexport default kanbanInit;\r\n", "/* -------------------------------------------------------------------------- */\r\n/*                                 step wizard                                */\r\n/* -------------------------------------------------------------------------- */\r\nconst wizardInit = () => {\r\n  // Corregge data-bs-target per tutti gli step, se errati\r\n  document.querySelectorAll('.theme-wizard [data-wizard-step]').forEach((el, i) => {\r\n    el.setAttribute('data-bs-target', `#bootstrap-wizard-tab${i + 1}`);\r\n  });\r\n\r\n\r\n  const wizards = document.querySelectorAll('.theme-wizard');\r\n\r\n  wizards.forEach(wizard => {\r\n    let tabToggleButtonEl = wizard.querySelectorAll('[data-wizard-step]');\r\n    let form = wizard.querySelector('[novalidate]');\r\n    let elementi_input = form.querySelectorAll('input[validate=true]');\r\n    let nextButton = wizard.querySelector('.next button');\r\n    let prevButton = wizard.querySelector('.previous button');\r\n    let cardFooter = wizard.querySelector('.theme-wizard .card-footer');\r\n    let count = 0;\r\n\r\n    prevButton.classList.add('d-none');\r\n\r\n    // on button click tab change\r\n    nextButton.addEventListener('click', () => {\r\n      let flg = false\r\n      if(form.getAttribute(\"tabnumber\") == (count+1)){\r\n        var i;\r\n        for (i = 0; i < elementi_input.length; i++) {\r\n          if(!elementi_input[i].value){\r\n            flg = true;\r\n          }\r\n        }\r\n        form.classList.add('was-validated');\r\n        if(!flg){\r\n          count = count + 1;\r\n          const tab = new window.bootstrap.Tab(tabToggleButtonEl[count]);\r\n          tab.show();\r\n        }\r\n\r\n      }\r\n      else{\r\n        count = count + 1;\r\n        const tab = new window.bootstrap.Tab(tabToggleButtonEl[count]);\r\n        tab.show();\r\n      }\r\n\r\n    });\r\n\r\n    prevButton.addEventListener('click', () => {\r\n      count = count - 1;\r\n      const tab = new window.bootstrap.Tab(tabToggleButtonEl[count]);\r\n      tab.show();\r\n    });\r\n    if (tabToggleButtonEl.length) {\r\n      tabToggleButtonEl.forEach((item, index) => {\r\n        /* eslint-disable */\r\n        item.addEventListener('show.bs.tab', e => {\r\n          let actual_pos = count;\r\n          count = index;\r\n          let flg = false;\r\n          if(count >= Number(form.getAttribute(\"tabnumber\"))){\r\n            var i;\r\n            for (i = 0; i < elementi_input.length; i++) {\r\n              if(!elementi_input[i].value){\r\n                flg = true;\r\n              }\r\n            }\r\n            if(actual_pos == (Number(form.getAttribute(\"tabnumber\")) - 1))\n              form.classList.add('was-validated');\n            if (flg) {\n              console.warn('Blocco cambio tab: almeno un campo \u00E8 vuoto');\n              e.preventDefault();\n              count = actual_pos;\n            }\n\r\n          }\r\n          if(!flg){\r\n\r\n            //add done class\r\n            for (let i = 0; i < count; i = i + 1) {\r\n              tabToggleButtonEl[i].classList.add('done');\r\n            }\r\n            //remove done class\r\n            for (let j = count; j < tabToggleButtonEl.length; j = j + 1) {\r\n              tabToggleButtonEl[j].classList.remove('done');\r\n            }\r\n            // card footer remove at last step\r\n            if (count > tabToggleButtonEl.length - 2) {\r\n              item.classList.add('done');\r\n              cardFooter.classList.add('d-none');\r\n            } else {\r\n              cardFooter.classList.remove('d-none');\r\n            }\r\n            // prev-button removing\r\n            if (count > 0) {\r\n              prevButton.classList.remove('d-none');\r\n            } else {\r\n              prevButton.classList.add('d-none');\r\n            }\r\n          }\r\n        });\r\n      });\r\n    }\r\n  });\r\n};\r\n\r\nexport default wizardInit;\r\n", "import utils from './utils';\r\n\r\n/*-----------------------------------------------\r\n|  Swiper\r\n-----------------------------------------------*/\r\nconst swiperInit = () => {\r\n  const swipers = document.querySelectorAll('[data-swiper]');\r\n  const navbarVerticalToggle = document.querySelector(\r\n    '.navbar-vertical-toggle'\r\n  );\r\n  swipers.forEach((swiper) => {\r\n    const options = utils.getData(swiper, 'swiper');\r\n    const thumbsOptions = options.thumb;\r\n    let thumbsInit;\r\n    if (thumbsOptions) {\r\n      const thumbImages = swiper.querySelectorAll('img');\r\n      let slides = '';\r\n      thumbImages.forEach((img) => {\r\n        slides += `\r\n          <div class='swiper-slide '>\r\n            <img class='img-fluid rounded mt-1' src=${img.src} alt=''/>\r\n          </div>\r\n        `;\r\n      });\r\n\r\n      const thumbs = document.createElement('div');\r\n      thumbs.setAttribute('class', 'swiper-container thumb');\r\n      thumbs.innerHTML = `<div class='swiper-wrapper'>${slides}</div>`;\r\n\r\n      if (thumbsOptions.parent) {\r\n        const parent = document.querySelector(thumbsOptions.parent);\r\n        parent.parentNode.appendChild(thumbs);\r\n      } else {\r\n        swiper.parentNode.appendChild(thumbs);\r\n      }\r\n\r\n      thumbsInit = new window.Swiper(thumbs, thumbsOptions);\r\n    }\r\n\r\n    const swiperNav = swiper.querySelector('.swiper-nav');\r\n    const newSwiper = new window.Swiper(swiper, {\r\n      ...options,\r\n      navigation: {\r\n        nextEl: swiperNav?.querySelector('.swiper-button-next'),\r\n        prevEl: swiperNav?.querySelector('.swiper-button-prev'),\r\n      },\r\n      thumbs: {\r\n        swiper: thumbsInit,\r\n      },\r\n    });\r\n    if( navbarVerticalToggle){\r\n      navbarVerticalToggle.addEventListener('navbar.vertical.toggle', () => {\r\n        newSwiper.update();\r\n      });\r\n    }\r\n   \r\n  });\r\n};\r\n\r\nexport default swiperInit;\r\n", "import utils from \"./utils\";\r\n/* -------------------------------------------------------------------------- */\r\n\r\n/*                               Ratings                               */\r\n\r\n/* -------------------------------------------------------------------------- */\r\n\r\nconst ratingInit = () => {\r\n  const raters = document.querySelectorAll(\"[data-rater]\");\r\n\r\n  raters.forEach((rater) => {\r\n    let options = {\r\n      reverse:utils.getItemFromStore('isRTL'),\r\n      starSize: 32,\r\n      step: 0.5,\r\n      element: rater,\r\n      rateCallback(rating, done) {\r\n        this.setRating(rating);\r\n        done();\r\n      },\r\n      ...utils.getData(rater, \"rater\"),\r\n    };\r\n\r\n    return window.raterJs(options);\r\n  });\r\n\r\n\r\n\r\n};\r\nexport default ratingInit;\r\n", "const searchInit = () => {\r\n  const Selectors = {\r\n    SEARCH_DISMISS: '[data-bs-dismiss=\"search\"]',\r\n    DROPDOWN_TOGGLE: '[data-bs-toggle=\"dropdown\"]',\r\n    DROPDOWN_MENU: '.dropdown-menu',\r\n    SEARCH_BOX: '.search-box',\r\n    SEARCH_INPUT: '.search-input',\r\n    SEARCH_TOGGLE: '[data-bs-toggle=\"search\"]',\r\n  };\r\n\r\n  const ClassName = {\r\n    SHOW: 'show',\r\n  };\r\n\r\n  const Attribute = {\r\n    ARIA_EXPANDED: 'aria-expanded',\r\n  };\r\n\r\n  const Events = {\r\n    CLICK: 'click',\r\n    FOCUS: 'focus',\r\n    SHOW_BS_DROPDOWN: 'show.bs.dropdown',\r\n    SEARCH_CLOSE: 'search.close',\r\n  };\r\n\r\n  const hideSearchSuggestion = searchArea => {\r\n    const el = searchArea.querySelector(Selectors.SEARCH_TOGGLE);\r\n    const dropdownMenu = searchArea.querySelector(Selectors.DROPDOWN_MENU);\r\n    el.setAttribute(Attribute.ARIA_EXPANDED, 'false');\r\n    el.classList.remove(ClassName.SHOW);\r\n    dropdownMenu.classList.remove(ClassName.SHOW);\r\n  };\r\n\r\n  const searchAreas = document.querySelectorAll(Selectors.SEARCH_BOX);\r\n\r\n  const hideAllSearchAreas = () => {\r\n    searchAreas.forEach(hideSearchSuggestion);\r\n  };\r\n\r\n  searchAreas.forEach(searchArea => {\r\n    const input = searchArea.querySelector(Selectors.SEARCH_INPUT);\r\n    const btnDropdownClose = searchArea.querySelector(Selectors.SEARCH_DISMISS);\r\n    const dropdownMenu = searchArea.querySelector(Selectors.DROPDOWN_MENU);\r\n\r\n    if (input) {\r\n      input.addEventListener(Events.FOCUS, () => {\r\n        hideAllSearchAreas();\r\n        const el = searchArea.querySelector(Selectors.SEARCH_TOGGLE);\r\n        el.setAttribute(Attribute.ARIA_EXPANDED, 'true');\r\n        el.classList.add(ClassName.SHOW);\r\n        dropdownMenu.classList.add(ClassName.SHOW);\r\n      });\r\n    }\r\n\r\n    document.addEventListener(Events.CLICK, ({ target }) => {\r\n      !searchArea.contains(target) && hideSearchSuggestion(searchArea);\r\n    });\r\n\r\n    btnDropdownClose &&\r\n      btnDropdownClose.addEventListener(Events.CLICK, e => {\r\n        hideSearchSuggestion(searchArea);\r\n        input.value = '';\r\n        const event = new CustomEvent(Events.SEARCH_CLOSE);\r\n        e.currentTarget.dispatchEvent(event);\r\n      });\r\n  });\r\n\r\n  document.querySelectorAll(Selectors.DROPDOWN_TOGGLE).forEach(dropdown => {\r\n    dropdown.addEventListener(Events.SHOW_BS_DROPDOWN, () => {\r\n      hideAllSearchAreas();\r\n    });\r\n  });\r\n};\r\n\r\nexport default searchInit;\r\n", "import utils from './utils';\r\n\r\n/*-----------------------------------------------\r\n|   Cookie notice\r\n-----------------------------------------------*/\r\nconst cookieNoticeInit = () => {\r\n  const Selector = {\r\n    NOTICE: '.notice',\r\n    DATA_TOGGLE_Notice: '[data-bs-toggle=\"notice\"]',\r\n  };\r\n\r\n  const Events = {\r\n    CLICK: 'click',\r\n    HIDDEN_BS_TOAST: 'hidden.bs.toast',\r\n  };\r\n\r\n  const DataKeys = {\r\n    OPTIONS: 'options',\r\n  };\r\n\r\n  const ClassNames = {\r\n    HIDE: 'hide',\r\n  };\r\n\r\n  const notices = document.querySelectorAll(Selector.NOTICE);\r\n  let showNotice = true;\r\n  notices.forEach((item) => {\r\n    const notice = new window.bootstrap.Toast(item);\r\n    const options = {\r\n      autoShow: false,\r\n      autoShowDelay: 0,\r\n      showOnce: false,\r\n      cookieExpireTime: 3600000,\r\n      ...utils.getData(item, DataKeys.OPTIONS),\r\n    };\r\n    const { showOnce, autoShow, autoShowDelay } = options;\r\n\r\n    if (showOnce) {\r\n      const hasNotice = utils.getCookie('notice');\r\n      showNotice = hasNotice === null;\r\n    }\r\n\r\n    if (autoShow && showNotice) {\r\n      setTimeout(() => {\r\n        notice.show();\r\n      }, autoShowDelay);\r\n    }\r\n\r\n    item.addEventListener(Events.HIDDEN_BS_TOAST, function (e) {\r\n      const el = e.currentTarget;\r\n      const toastOptions = {\r\n        cookieExpireTime: 3600000,\r\n        showOnce: false,\r\n        ...utils.getData(el, DataKeys.OPTIONS),\r\n      };\r\n      toastOptions.showOnce &&\r\n        utils.setCookie('notice', false, toastOptions.cookieExpireTime);\r\n    });\r\n  });\r\n\r\n  const btnNoticeToggle = document.querySelector(Selector.DATA_TOGGLE_Notice);\r\n  btnNoticeToggle &&\r\n    btnNoticeToggle.addEventListener(Events.CLICK, ({ currentTarget }) => {\r\n      const id = currentTarget.getAttribute('href');\r\n      const notice = new window.bootstrap.Toast(document.querySelector(id));\r\n\r\n      /*eslint-disable-next-line*/\r\n      const el = notice._element;\r\n      utils.hasClass(el, ClassNames.HIDE) ? notice.show() : notice.hide();\r\n    });\r\n};\r\n\r\nexport default cookieNoticeInit;\r\n", "/* -------------------------------------------------------------------------- */\r\n/*                              Config                                        */\r\n/* -------------------------------------------------------------------------- */\r\nconst CONFIG = {\n\tisNavbarVerticalCollapsed: false,\n\ttheme: 'light',\n\tisRTL: false,\r\n\tisFluid: false,\r\n\tnavbarStyle: 'transparent',\r\n\tnavbarPosition: 'vertical'\n};\n\n// Verifica se l'utente corrente pu\u00F2 usare il tema scuro prima di applicare la preferenza salvata nel browser.\nconst isDarkThemeAllowed = () => document.body?.dataset.darkThemeAllowed === 'true';\n\nObject.keys(CONFIG).forEach(key => {\n\tif (localStorage.getItem(key) === null) {\n\t\tlocalStorage.setItem(key, CONFIG[key]);\n\t}\n});\n\r\nif (!!JSON.parse(localStorage.getItem('isNavbarVerticalCollapsed'))) {\r\n\tdocument.documentElement.classList.add('navbar-vertical-collapsed');\r\n}\r\n\r\nif (!isDarkThemeAllowed() && localStorage.getItem('theme') === 'dark') {\n\tlocalStorage.setItem('theme', 'light');\n}\n\nif (isDarkThemeAllowed() && localStorage.getItem('theme') === 'dark') {\n\tdocument.documentElement.classList.add('dark');\n}\n\r\nexport default CONFIG;\r\n", "import { setItemToStore, getData, getItemFromStore } from './utils';\r\nimport DomNode from './node';\r\n\r\n/* -------------------------------------------------------------------------- */\r\n/*                                Theme Control                               */\r\n/* -------------------------------------------------------------------------- */\r\n/* eslint-disable no-param-reassign */\r\n/* eslint-disable */\r\nimport CONFIG from './config';\n\n// Legge dal layout Rails se l'utente corrente pu\u00F2 vedere e attivare il tema scuro.\nconst isDarkThemeAllowed = () => document.body?.dataset.darkThemeAllowed === 'true';\n\nconst initialDomSetup = element => {\n\tif (!element) return;\n\tconst dataUrlDom = element.querySelector('[data-theme-control = \"navbarPosition\"]');\n\tconst hasDataUrl = dataUrlDom ? getData(dataUrlDom, 'page-url') : null;\r\n\r\n\telement.querySelectorAll('[data-theme-control]').forEach(el => {\r\n\t\tconst inputDataAttributeValue = getData(el, 'theme-control');\r\n\t\tconst localStorageValue = getItemFromStore(inputDataAttributeValue);\r\n\t\tif (\r\n\t\t\tinputDataAttributeValue === 'navbarStyle' &&\r\n\t\t\t!hasDataUrl &&\r\n\t\t\tgetItemFromStore('navbarPosition') === 'top'\r\n\t\t) {\r\n\t\t\tel.setAttribute('disabled', true);\r\n\t\t}\r\n\t\tif (el.type === 'checkbox') {\n\t\t\tif (inputDataAttributeValue === 'theme') {\n\t\t\t\tlocalStorageValue === 'dark' && isDarkThemeAllowed() && el.setAttribute('checked', true);\n\t\t\t} else {\n\t\t\t\tlocalStorageValue && el.setAttribute('checked', true);\n\t\t\t}\n\t\t} else {\r\n\t\t\tconst isChecked = localStorageValue === el.value;\r\n\t\t\tisChecked && el.setAttribute('checked', true);\r\n\t\t}\r\n\t});\r\n};\r\n\r\nconst changeTheme = element => {\r\n\telement.querySelectorAll('[data-theme-control = \"theme\"]').forEach(el => {\r\n\t\tconst inputDataAttributeValue = getData(el, 'theme-control');\r\n\t\tconst localStorageValue = getItemFromStore(inputDataAttributeValue);\r\n\r\n\t\tif (el.type === 'checkbox') {\r\n\t\t\tlocalStorageValue === 'dark' ? (el.checked = true) : (el.checked = false);\r\n\t\t} else {\r\n\t\t\tlocalStorageValue === el.value ? (el.checked = true) : (el.checked = false);\r\n\t\t}\r\n\t});\r\n};\r\n\r\nconst themeControl = () => {\r\n\tconst themeController = new DomNode(document.body);\r\n\r\n\tconst navbarVertical = document.querySelector('.navbar-vertical');\r\n\tinitialDomSetup(themeController.node);\r\n\r\n\tthemeController.on('click', e => {\r\n\t\tconst target = new DomNode(e.target);\r\n\r\n\t\tif (target.data('theme-control')) {\r\n\t\t\tconst control = target.data('theme-control');\r\n\t\t\tlet value = e.target[e.target.type === 'radio' ? 'value' : 'checked'];\r\n\t\t\tif (control === 'theme') {\n\t\t\t\ttypeof value === 'boolean' && (value = value ? 'dark' : 'light');\n\t\t\t\tif (value === 'dark' && !isDarkThemeAllowed()) {\n\t\t\t\t\tvalue = 'light';\n\t\t\t\t}\n\t\t\t}\n\t\t\tsetItemToStore(control, value);\r\n\t\t\tswitch (control) {\r\n\t\t\t\tcase 'theme': {\r\n\t\t\t\t\tdocument.documentElement.classList[value === 'dark' ? 'add' : 'remove']('dark');\r\n\t\t\t\t\tconst clickControl = new CustomEvent('clickControl', {\r\n\t\t\t\t\t\tdetail: { control, value }\r\n\t\t\t\t\t});\r\n\t\t\t\t\te.currentTarget.dispatchEvent(clickControl);\r\n\t\t\t\t\tchangeTheme(themeController.node);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tcase 'navbarStyle': {\r\n\t\t\t\t\tnavbarVertical.classList.remove('navbar-card');\r\n\t\t\t\t\tnavbarVertical.classList.remove('navbar-inverted');\r\n\t\t\t\t\tnavbarVertical.classList.remove('navbar-vibrant');\r\n\t\t\t\t\tif (value !== 'transparent') {\r\n\t\t\t\t\t\tnavbarVertical.classList.add(`navbar-${value}`);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tcase 'navbarPosition': {\r\n\t\t\t\t\tconst pageUrl = getData(target.node, 'page-url');\r\n\t\t\t\t\t!!pageUrl ? window.location.replace(pageUrl) : window.location.reload();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcase 'reset': {\r\n\t\t\t\t\tObject.keys(CONFIG).forEach(key => {\r\n\t\t\t\t\t\tlocalStorage.setItem(key, CONFIG[key]);\r\n\t\t\t\t\t});\r\n\t\t\t\t\twindow.location.reload();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tdefault:\r\n\t\t\t\t\twindow.location.reload();\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n};\r\n\r\nexport default themeControl;\r\n", "/* -------------------------------------------------------------------------- */\r\n/*                           Open dropdown on hover                           */\r\n/* -------------------------------------------------------------------------- */\r\n\r\nconst dropdownOnHover = () => {\r\n  const navbarArea = document.querySelector(\"[data-top-nav-dropdowns]\");\r\n\r\n  if (navbarArea) {\r\n    navbarArea.addEventListener(\"mouseover\", (e) => {\r\n      if (\r\n        e.target.className.includes(\"dropdown-toggle\") &&\r\n        window.innerWidth > 992\r\n      ) {\r\n        const dropdownInstance = new window.bootstrap.Dropdown(e.target);\r\n        \r\n        /* eslint-disable no-underscore-dangle */\r\n        dropdownInstance._element.classList.add('show')\r\n        dropdownInstance._menu.classList.add('show')\r\n        dropdownInstance._menu.setAttribute('data-bs-popper', 'none')\r\n        \r\n        e.target.parentNode.addEventListener(\"mouseleave\", () => {\r\n          dropdownInstance.hide();\r\n        });\r\n      }\r\n    });\r\n  }\r\n};\r\n\r\nexport default dropdownOnHover;\r\n", "/* eslint-disable */\r\nimport utils from '../../utils';\r\nimport { chartJsDefaultTooltip, chartJsInit } from './chartjs-utils';\r\n\r\n/* -------------------------------------------------------------------------- */\r\n/*                            Chart Scatter                                   */\r\n/* -------------------------------------------------------------------------- */\r\nconst productShareDoughnutInit = () => {\r\n  const marketShareDoughnutElement = document.getElementById(\r\n    'marketShareDoughnut'\r\n  );\r\n\r\n  const getOptions = () => ({\r\n    type: 'doughnut',\r\n    data: {\r\n      labels: ['Flacon', 'Sparrow'],\r\n      datasets: [\r\n        {\r\n          data: [50, 88],\r\n          backgroundColor: [utils.getColor('primary'), utils.getColor('300')],\r\n          borderColor: [utils.getColor('primary'), utils.getColor('300')],\r\n        },\r\n      ],\r\n    },\r\n    options: {\r\n      tooltips: chartJsDefaultTooltip(),\r\n      rotation: -90,\r\n      circumference: '180',\r\n      cutout: '80%',\r\n      plugins: {\r\n        legend: {\r\n          display: false,\r\n        },\r\n      },\r\n    },\r\n  });\r\n\r\n  chartJsInit(marketShareDoughnutElement, getOptions);\r\n};\r\n\r\nexport default productShareDoughnutInit;\r\n", "/* eslint-disable */\r\nconst getPosition = (pos, params, dom, rect, size) => ({\r\n  top: pos[1] - size.contentSize[1] - 10,\r\n  left: pos[0] - size.contentSize[0] / 2\r\n});\r\n\r\nconst echartSetOption = (chart, userOptions, getDefaultOptions) => {\r\n  const themeController = document.body;\r\n  // Merge user options with lodash\r\n  chart.setOption(window._.merge(getDefaultOptions(), userOptions));\r\n\r\n  themeController.addEventListener('clickControl', ({ detail: { control } }) => {\r\n    if (control === 'theme') {\r\n      chart.setOption(window._.merge(getDefaultOptions(), userOptions));\r\n    }\r\n  });\r\n};\r\n\r\nconst tooltipFormatter = params => {\r\n  let tooltipItem = ``;\r\n  params.forEach(el => {\r\n    tooltipItem =\r\n      tooltipItem +\r\n      `<div class='ms-1'> \r\n        <h6 class=\"text-700\"><span class=\"fas fa-circle me-1 fs--2\" style=\"color:${\r\n          el.borderColor ? el.borderColor : el.color\r\n        }\"></span>\r\n          ${el.seriesName} : ${typeof el.value === 'object' ? el.value[1] : el.value}\r\n        </h6>\r\n      </div>`;\r\n  });\r\n  return `<div>\r\n            <p class='mb-2 text-600'>\r\n              ${\r\n                window.dayjs(params[0].axisValue).isValid()\r\n                  ? window.dayjs(params[0].axisValue).format('MMMM DD')\r\n                  : params[0].axisValue\r\n              }\r\n            </p>\r\n            ${tooltipItem}\r\n          </div>`;\r\n};\r\n\r\nexport { getPosition, echartSetOption, tooltipFormatter };\r\n", "import utils from \"../../utils\";\r\nimport { getPosition, echartSetOption } from \"./echarts-utils\";\r\n\r\n/* -------------------------------------------------------------------------- */\r\n/*                      Echarts Total Sales E-commerce                        */\r\n/* -------------------------------------------------------------------------- */\r\n\r\nconst totalSalesEcommerce = () => {\r\n  const ECHART_LINE_TOTAL_SALES_ECOMM = \".echart-line-total-sales-ecommerce\";\r\n  const $echartsLineTotalSalesEcomm = document.querySelector(\r\n    ECHART_LINE_TOTAL_SALES_ECOMM\r\n  );\r\n  const months = [\r\n    \"Jan\",\r\n    \"Feb\",\r\n    \"Mar\",\r\n    \"Apr\",\r\n    \"May\",\r\n    \"Jun\",\r\n    \"Jul\",\r\n    \"Aug\",\r\n    \"Sep\",\r\n    \"Oct\",\r\n    \"Nov\",\r\n    \"Dec\",\r\n  ];\r\n\r\n  function getFormatter(params) {\r\n    return params.map(({value, borderColor }, index) => `<span class= \"fas fa-circle\" style=\"color: ${borderColor}\"></span>\r\n    <span class='text-600'>${index === 0 ?'Last Month':'Previous Year'}: ${value}</span>`).join('<br/>');\r\n  }\r\n  if ($echartsLineTotalSalesEcomm) {\r\n    // Get options from data attribute\r\n    const userOptions = utils.getData($echartsLineTotalSalesEcomm, \"options\");\r\n    const TOTAL_SALES_LAST_MONTH = `#${userOptions.optionOne}`;\r\n    const TOTAL_SALES_PREVIOUS_YEAR =  `#${userOptions.optionTwo}`;\r\n    const totalSalesLastMonth =  document.querySelector(\r\n    TOTAL_SALES_LAST_MONTH\r\n    );\r\n    const totalSalesPreviousYear =  document.querySelector(\r\n      TOTAL_SALES_PREVIOUS_YEAR\r\n    );\r\n\r\n    const chart = window.echarts.init($echartsLineTotalSalesEcomm);\r\n    const getDefaultOptions = () => ({\r\n      color: utils.getGrays()['100'],\r\n      tooltip: {\r\n        trigger: \"axis\",\r\n        padding: [7, 10],\r\n        backgroundColor: utils.getGrays()['100'],\r\n        borderColor: utils.getGrays()[\"300\"],\r\n        textStyle: { color: utils.getColors().dark },\r\n        borderWidth: 1,\r\n        formatter(params) {\r\n          return getFormatter(params);\r\n        },\r\n        transitionDuration: 0,\r\n        position(pos, params, dom, rect, size) {\r\n          return getPosition(pos, params, dom, rect, size);\r\n        },\r\n      },\r\n      legend: {\r\n        data:['lastMonth','previousYear'],\r\n        show:false\r\n      },\r\n      xAxis: {\r\n        type: \"category\",\r\n        data: [\r\n          \"2019-01-05\",\r\n          \"2019-01-06\",\r\n          \"2019-01-07\",\r\n          \"2019-01-08\",\r\n          \"2019-01-09\",\r\n          \"2019-01-10\",\r\n          \"2019-01-11\",\r\n          \"2019-01-12\",\r\n          \"2019-01-13\",\r\n          \"2019-01-14\",\r\n          \"2019-01-15\",\r\n          \"2019-01-16\",\r\n        ],\r\n        boundaryGap: false,\r\n        axisPointer: {\r\n          lineStyle: {\r\n            color: utils.getColor('300'),\r\n            type: \"dashed\",\r\n          },\r\n        },\r\n        splitLine: { show: false },\r\n        axisLine: {\r\n          lineStyle: {\r\n            // color: utils.getGrays()['300'],\r\n            color: utils.rgbaColor(\"#000\", 0.01),\r\n            type: \"dashed\",\r\n          },\r\n        },\r\n        \r\n        axisTick: { show: false },\r\n        axisLabel: {\r\n          color: utils.getColor('400'),\r\n          formatter: function (value) {\r\n            var date = new Date(value);\r\n            return `${months[date.getMonth()]} ${date.getDate()}`;\r\n          },\r\n          margin: 15,\r\n          // showMaxLabel: false\r\n        },\r\n      },\r\n      yAxis: {\r\n        type: \"value\",\r\n        axisPointer: { show: false },\r\n        splitLine: {\r\n          lineStyle: {\r\n            color: utils.getColor('300'),\r\n            type: \"dashed\",\r\n          },\r\n        },\r\n        boundaryGap: false,\r\n        axisLabel: {\r\n          show: true,\r\n          color:utils.getColor('400'),\r\n          margin: 15,\r\n        },\r\n        axisTick: { show: false },\r\n        axisLine: { show: false },\r\n      },\r\n\r\n      series: [\r\n        {\r\n          name:\"lastMonth\",\r\n          type: \"line\",\r\n          data: [50, 80, 60, 80, 65, 90, 130, 90, 30, 40, 30, 70],\r\n          lineStyle: { color: utils.getColor('primary') },\r\n          itemStyle: {\r\n            borderColor: utils.getColor('primary'),\r\n            borderWidth: 2,\r\n          },\r\n          symbol: \"circle\",\r\n          symbolSize: 10,\r\n          hoverAnimation: true,\r\n          areaStyle: {\r\n            color: {\r\n              type: \"linear\",\r\n              x: 0,\r\n              y: 0,\r\n              x2: 0,\r\n              y2: 1,\r\n              colorStops: [\r\n                {\r\n                  offset: 0,\r\n                  color: utils.rgbaColor(utils.getColor('primary'), 0.2),\r\n                },\r\n                {\r\n                  offset: 1,\r\n                  color: utils.rgbaColor(utils.getColor('primary'), 0),\r\n                },\r\n              ],\r\n            },\r\n          },\r\n        },\r\n\r\n        {\r\n          name:\"previousYear\",\r\n          type: \"line\",\r\n          data: [110, 30,40, 50, 80, 70, 50, 40, 110, 90, 60, 60],\r\n          lineStyle: { color: utils.rgbaColor(utils.getColor('warning'), 0.3) },\r\n          itemStyle: {\r\n            borderColor: utils.rgbaColor(utils.getColor('warning'), 0.6),\r\n            borderWidth: 2,\r\n          },\r\n          symbol: \"circle\",\r\n          symbolSize: 10,\r\n          hoverAnimation: true,\r\n        },\r\n      ],\r\n      grid: { right: \"18px\", left: \"40px\", bottom: \"15%\", top: \"5%\" },\r\n\r\n    });\r\n\r\n    echartSetOption(chart, userOptions, getDefaultOptions);\r\n\r\n    totalSalesLastMonth.addEventListener(\"click\", () => {\r\n      chart.dispatchAction({\r\n        type: 'legendToggleSelect',\r\n        name: 'lastMonth'\r\n      })\r\n    });\r\n\r\n    totalSalesPreviousYear.addEventListener(\"click\", () => {\r\n      chart.dispatchAction({\r\n        type: 'legendToggleSelect',\r\n        name: 'previousYear'\r\n      })\r\n    });\r\n\r\n  }\r\n};\r\n\r\nexport default totalSalesEcommerce;\r\n", "import utils from '../../utils';\r\nimport { echartSetOption } from './echarts-utils';\r\n\r\n/* -------------------------------------------------------------------------- */\r\n/*                          Echarts Sales Pos Location                        */\r\n/* -------------------------------------------------------------------------- */\r\n\r\nconst salesByPosLocationInit = () => {\r\n  const ECHART_RADAR_SALES_BY_POS_LOCATION = '.echart-radar-sales-by-pos-location';\r\n\r\n  const $echartsRadarSalesByPosLocation = document.querySelector(\r\n    ECHART_RADAR_SALES_BY_POS_LOCATION\r\n  );\r\n  function getformatter(params) {\r\n    //const indicators = ['Marketing','Sales', 'Dev', 'Support', 'Tech', 'Admin']\r\n    return `<strong > ${params.name} </strong>\r\n    <div class=\"fs--1 text-600\">\r\n      <strong >Marketing</strong>: ${params.value[0]}  <br>\r\n      <strong>Sales</strong>: ${params.value[1]}  <br>\r\n      <strong>Dev</strong>: ${params.value[2]}  <br>\r\n      <strong>Support</strong>: ${params.value[3]}  <br>\r\n      <strong>Tech</strong>: ${params.value[4]}  <br>\r\n      <strong>Admin</strong>: ${params.value[5]}  <br>\r\n    </div>`;\r\n  }\r\n\r\n  if ($echartsRadarSalesByPosLocation) {\r\n    // Get options from data attribute\r\n    const userOptions = utils.getData($echartsRadarSalesByPosLocation, 'options');\r\n    const chart = window.echarts.init($echartsRadarSalesByPosLocation);\r\n    const getDefaultOptions = () => ({\r\n      tooltip: {\r\n        trigger: 'item',\r\n        padding: [7, 10],\r\n        backgroundColor: utils.getColor('100'),\r\n        borderColor: utils.getColor('300'),\r\n        textStyle: { color: utils.getColors().dark },\r\n        borderWidth: 1,\r\n        transitionDuration: 0,\r\n        formatter: getformatter\r\n      },\r\n      radar: {\r\n        splitNumber: 7,\r\n        radius: '75%',\r\n        axisLine: {\r\n          show: true,\r\n          symbol: 'circle',\r\n          symbolSize: [13, 13],\r\n          lineStyle: {\r\n            color: {\r\n              type: 'radial',\r\n              x: 0.5,\r\n              y: 0.5,\r\n              r: 0.5,\r\n              colorStops: [\r\n                {\r\n                  offset: 0.7,\r\n                  color: utils.getColor('100')\r\n                },\r\n                {\r\n                  offset: 1,\r\n                  color: utils.getColor('400')\r\n                }\r\n              ]\r\n            }\r\n          }\r\n        },\r\n        splitArea: {\r\n          show: false\r\n        },\r\n        splitLine: {\r\n          lineStyle: {\r\n            color: utils.getColor('300')\r\n          }\r\n        },\r\n        name: {\r\n          textStyle: {\r\n            color: utils.getColor('600'),\r\n            fontWeight: 500\r\n          }\r\n        },\r\n        indicator: [\r\n          { name: 'Marketing', max: 70 },\r\n          { name: 'Admin', max: 70 },\r\n          { name: 'Tech', max: 70 },\r\n          { name: 'Support', max: 70 },\r\n          { name: 'Dev', max: 70 },\r\n          { name: 'Sales', max: 70 }\r\n        ]\r\n      },\r\n      series: [\r\n        {\r\n          name: 'Budget vs spending',\r\n          type: 'radar',\r\n          symbol: 'pin',\r\n          data: [\r\n            {\r\n              value: [20, 50, 60, 50, 60, 60],\r\n              name: 'Budget',\r\n              itemStyle: {\r\n                color: utils.rgbaColor(utils.getColors().warning, 0.5)\r\n              },\r\n              areaStyle: {\r\n                color: utils.rgbaColor(utils.getColors().warning, 0.24)\r\n              },\r\n              symbol: 'circle',\r\n              symbolSize: 8\r\n            },\r\n            {\r\n              value: [40, 60, 30, 15, 60, 35],\r\n              name: 'Spending',\r\n              areaStyle: {\r\n                color: [utils.rgbaColor(utils.getColors().primary, 0.24)]\r\n              },\r\n              symbol: 'circle',\r\n              symbolSize: 8,\r\n              itemStyle: {\r\n                color: utils.rgbaColor(utils.getColors().primary)\r\n              }\r\n            }\r\n          ]\r\n        }\r\n      ],\r\n      grid: {\r\n        top: 0,\r\n        bottom: '100px'\r\n      }\r\n    });\r\n\r\n    echartSetOption(chart, userOptions, getDefaultOptions);\r\n  }\r\n};\r\n\r\nexport default salesByPosLocationInit;\r\n", "import utils from '../../utils';\r\nimport { getPosition, echartSetOption, tooltipFormatter } from './echarts-utils';\r\n/* -------------------------------------------------------------------------- */\r\n/*                     Echarts Line Returing Customer Rate                    */\r\n/* -------------------------------------------------------------------------- */\r\nconst returningCustomerRateInit = () => {\r\n  const ECHART_LINE_RETURNING_CUSTOMER_RATE = '.echart-line-returning-customer-rate';\r\n  const $echartsLineReturningCustomerRate = document.querySelector(\r\n    ECHART_LINE_RETURNING_CUSTOMER_RATE\r\n  );\r\n  const months = [\r\n    'Jan',\r\n    'Feb',\r\n    'Mar',\r\n    'Apr',\r\n    'May',\r\n    'Jun',\r\n    'Jul',\r\n    'Aug',\r\n    'Sep',\r\n    'Oct',\r\n    'Nov',\r\n    'Dec'\r\n  ];\r\n\r\n  if ($echartsLineReturningCustomerRate) {\r\n    // Get options from data attribute\r\n    const userOptions = utils.getData($echartsLineReturningCustomerRate, 'options');\r\n    const LEGEND_MONTH_TARGET = userOptions.target;\r\n    const SELECT_MONTH = `#${userOptions.monthSelect}`;\r\n    const LEGEND_NEW_MONTH = `#${userOptions.optionOne}`;\r\n    const LEGEND_RETURNING_MONTH = `#${userOptions.optionTwo}`;\r\n    const $legendNewMonth = document\r\n      .getElementById(LEGEND_MONTH_TARGET)\r\n      .querySelector(LEGEND_NEW_MONTH);\r\n    const $legendReturningMonth = document\r\n      .getElementById(LEGEND_MONTH_TARGET)\r\n      .querySelector(LEGEND_RETURNING_MONTH);\r\n    const chart = window.echarts.init($echartsLineReturningCustomerRate);\r\n\r\n    const monthNumbers = [\r\n      [20, 40, 20, 80, 50, 80, 120, 80, 50, 120, 110, 110],\r\n      [60, 80, 60, 80, 65, 130, 120, 100, 30, 40, 30, 70],\r\n      [100, 70, 80, 50, 120, 100, 130, 140, 90, 100, 40, 50],\r\n      [80, 50, 60, 40, 60, 120, 100, 130, 60, 80, 50, 60],\r\n      [70, 80, 100, 70, 90, 60, 80, 130, 40, 60, 50, 80],\r\n      [90, 40, 80, 80, 100, 140, 100, 130, 90, 60, 70, 50],\r\n      [80, 60, 80, 60, 40, 100, 120, 100, 30, 40, 30, 70],\r\n      [20, 40, 20, 50, 70, 60, 110, 80, 90, 30, 50, 50],\r\n      [60, 70, 30, 40, 80, 140, 80, 140, 120, 130, 100, 110],\r\n      [90, 90, 40, 60, 40, 110, 90, 110, 60, 80, 60, 70],\r\n      [50, 80, 50, 80, 50, 80, 120, 80, 50, 120, 110, 110],\r\n      [60, 90, 60, 70, 40, 70, 100, 140, 30, 40, 30, 70],\r\n      [20, 40, 20, 50, 30, 80, 120, 100, 30, 40, 30, 70]\r\n    ];\r\n    const dates = month => {\r\n      return utils.getDates(\r\n        window.dayjs().month(month).date(1),\r\n        window\r\n          .dayjs()\r\n          .month(Number(month) + 1)\r\n          .date(0),\r\n        1000 * 60 * 60 * 24 * 3\r\n      );\r\n    };\r\n    const getDefaultOptions = () => ({\r\n      title: {\r\n        text: 'Customers',\r\n        textStyle: {\r\n          fontWeight: 500,\r\n          fontSize: 13,\r\n          fontFamily: 'poppins',\r\n          color: utils.getColor('900')\r\n        }\r\n      },\r\n      legend: {\r\n        show: false,\r\n        data: ['New', 'Returning']\r\n      },\r\n      tooltip: {\r\n        trigger: 'axis',\r\n        padding: [7, 10],\r\n        backgroundColor: utils.getGrays()['100'],\r\n        borderColor: utils.getGrays()['300'],\r\n        textStyle: { color: utils.getColors().dark },\r\n        borderWidth: 1,\r\n        transitionDuration: 0,\r\n        position(pos, params, dom, rect, size) {\r\n          return getPosition(pos, params, dom, rect, size);\r\n        },\r\n        formatter: tooltipFormatter\r\n      },\r\n      xAxis: {\r\n        type: 'category',\r\n        data: dates(0),\r\n        boundaryGap: false,\r\n        axisPointer: {\r\n          lineStyle: {\r\n            color: utils.getColor('300'),\r\n            type: 'dashed'\r\n          }\r\n        },\r\n        axisLine: {\r\n          lineStyle: {\r\n            color: utils.getColor('300'),\r\n            type: 'solid'\r\n          }\r\n        },\r\n        axisTick: { show: false },\r\n        axisLabel: {\r\n          color: utils.getColor('400'),\r\n          formatter(value) {\r\n            const date = new Date(value);\r\n            if (date.getDate() === 1) {\r\n              return `${months[date.getMonth()].substring(0, 3)} ${date.getDate()}`;\r\n            }\r\n            return `${date.getDate()}`;\r\n          },\r\n          margin: 15\r\n        },\r\n        splitLine: {\r\n          show: true,\r\n          lineStyle: {\r\n            color: utils.getGrays()['300'],\r\n            type: 'dashed'\r\n          }\r\n        }\r\n      },\r\n      yAxis: {\r\n        type: 'value',\r\n        axisPointer: { show: false },\r\n        splitLine: {\r\n          lineStyle: {\r\n            color: utils.getGrays()['300']\r\n          }\r\n        },\r\n        boundaryGap: false,\r\n        axisLabel: {\r\n          show: true,\r\n          color: utils.getGrays()['400'],\r\n          margin: 15\r\n        },\r\n        axisTick: { show: false },\r\n        axisLine: { show: false }\r\n      },\r\n      series: [\r\n        {\r\n          name: 'New',\r\n          type: 'line',\r\n          data: monthNumbers[1],\r\n          lineStyle: { color: utils.getColors().primary },\r\n          itemStyle: {\r\n            borderColor: utils.getColors().primary,\r\n            borderWidth: 2\r\n          },\r\n          areaStyle: {\r\n            color: {\r\n              type: 'linear',\r\n              x: 0,\r\n              y: 0,\r\n              x2: 0,\r\n              y2: 1,\r\n              colorStops: [\r\n                {\r\n                  offset: 0,\r\n                  color: utils.rgbaColor(utils.getColor('primary'), 0.2)\r\n                },\r\n                {\r\n                  offset: 1,\r\n                  color: utils.rgbaColor(utils.getColor('primary'), 0.01)\r\n                }\r\n              ]\r\n            }\r\n          },\r\n          symbol: 'none',\r\n          smooth: false,\r\n          hoverAnimation: true\r\n        },\r\n        {\r\n          name: 'Returning',\r\n          type: 'line',\r\n          data: monthNumbers[0],\r\n          lineStyle: { color: utils.getColor('warning') },\r\n          itemStyle: {\r\n            borderColor: utils.getColor('warning'),\r\n            borderWidth: 2\r\n          },\r\n          areaStyle: {\r\n            color: {\r\n              type: 'linear',\r\n              x: 0,\r\n              y: 0,\r\n              x2: 0,\r\n              y2: 1,\r\n              colorStops: [\r\n                {\r\n                  offset: 0,\r\n                  color: utils.rgbaColor(utils.getColor('warning'), 0.2)\r\n                },\r\n                {\r\n                  offset: 1,\r\n                  color: utils.rgbaColor(utils.getColor('warning'), 0.01)\r\n                }\r\n              ]\r\n            }\r\n          },\r\n          symbol: 'none',\r\n          smooth: false,\r\n          hoverAnimation: true\r\n        }\r\n      ],\r\n      grid: { right: '7px', left: '35px', bottom: '8%', top: '15%' }\r\n    });\r\n    echartSetOption(chart, userOptions, getDefaultOptions);\r\n\r\n    // Change chart options accordiong to the selected month\r\n    const monthSelect = document.querySelector(SELECT_MONTH);\r\n\r\n    monthSelect.addEventListener('change', e => {\r\n      const month = e.currentTarget.value;\r\n      const dataNewMonth = monthNumbers[Number(month) + 1];\r\n      const dataReturningMonth = monthNumbers[month];\r\n      chart.setOption({\r\n        xAxis: {\r\n          data: dates(month)\r\n        },\r\n        series: [\r\n          {\r\n            data: dataNewMonth\r\n          },\r\n          {\r\n            data: dataReturningMonth\r\n          }\r\n        ]\r\n      });\r\n    });\r\n    $legendNewMonth.addEventListener('click', () => {\r\n      $legendNewMonth.classList.toggle('opacity-50');\r\n      chart.dispatchAction({\r\n        type: 'legendToggleSelect',\r\n        name: 'New'\r\n      });\r\n    });\r\n    $legendReturningMonth.addEventListener('click', () => {\r\n      $legendReturningMonth.classList.toggle('opacity-50');\r\n      chart.dispatchAction({\r\n        type: 'legendToggleSelect',\r\n        name: 'Returning'\r\n      });\r\n    });\r\n  }\r\n};\r\nexport default returningCustomerRateInit;\r\n", "import utils from \"../../utils\";\r\nimport { getPosition, echartSetOption } from \"./echarts-utils\";\r\n\r\n/* -------------------------------------------------------------------------- */\r\n/*                                Top Products                                */\r\n/* -------------------------------------------------------------------------- */\r\n\r\nconst topProductsInit = () => {\r\n  const ECHART_BAR_TOP_PRODUCTS = \".echart-bar-top-products\";\r\n  const $echartBarTopProducts = document.querySelector(ECHART_BAR_TOP_PRODUCTS);\r\n\r\n  if ($echartBarTopProducts) {\r\n    const data = [\r\n      [\"product\", \"2019\", \"2018\"],\r\n      [\"Boots4\", 43, 85],\r\n      [\"Reign Pro\", 83, 73],\r\n      [\"Slick\", 86, 62],\r\n      [\"Falcon\", 72, 53],\r\n      [\"Sparrow\", 80, 50],\r\n      [\"Hideway\", 50, 70],\r\n      [\"Freya\", 80, 90],\r\n    ];\r\n    const userOptions = utils.getData($echartBarTopProducts, \"options\");\r\n    const chart = window.echarts.init($echartBarTopProducts);\r\n\r\n    const getDefaultOptions = () => ({\r\n      color: [utils.getColors().primary, utils.getGrays()[\"300\"]],\r\n      dataset: { source: data },\r\n      tooltip: {\r\n        trigger: \"item\",\r\n        padding: [7, 10],\r\n        backgroundColor: utils.getGrays()['100'],\r\n        borderColor: utils.getGrays()[\"300\"],\r\n        textStyle: { color: utils.getColors().dark },\r\n        borderWidth: 1,\r\n        transitionDuration: 0,\r\n        position(pos, params, dom, rect, size) {\r\n          return getPosition(pos, params, dom, rect, size);\r\n        },\r\n        formatter: function (params) {\r\n          return `<div class=\"font-weight-semi-bold\">${\r\n            params.seriesName\r\n          }</div><div class=\"fs--1 text-600\"><strong>${params.name}:</strong> ${\r\n            params.value[params.componentIndex + 1]\r\n          }</div>`;\r\n        },\r\n      },\r\n      legend: {\r\n        data: [\"2019\", \"2018\"],\r\n        left: \"left\",\r\n        itemWidth: 10,\r\n        itemHeight: 10,\r\n        borderRadius: 0,\r\n        icon: \"circle\",\r\n        inactiveColor: utils.getGrays()[\"400\"],\r\n        textStyle: { color: utils.getGrays()[\"700\"] },\r\n      },\r\n      xAxis: {\r\n        type: \"category\",\r\n        axisLabel: { color: utils.getGrays()[\"400\"] },\r\n        axisLine: {\r\n          lineStyle: {\r\n            color: utils.getGrays()[\"300\"],\r\n            type: \"dashed\",\r\n          },\r\n        },\r\n        axisTick: false,\r\n        boundaryGap: true,\r\n      },\r\n      yAxis: {\r\n        axisPointer: { type: \"none\" },\r\n        axisTick: \"none\",\r\n        splitLine: {\r\n          lineStyle: {\r\n            color: utils.getGrays()[\"300\"],\r\n            type: \"dashed\",\r\n          },\r\n        },\r\n        axisLine: { show: false },\r\n        axisLabel: { color: utils.getGrays()[\"400\"] },\r\n      },\r\n      series: [\r\n        {\r\n          type: \"bar\",\r\n          barWidth: \"10px\",\r\n          barGap: \"30%\",\r\n          label: { normal: { show: false } },\r\n          z: 10,\r\n          itemStyle: {\r\n            normal: {\r\n              barBorderRadius: [10, 10, 0, 0],\r\n              color: utils.getColors().primary,\r\n            },\r\n          },\r\n        },\r\n        {\r\n          type: \"bar\",\r\n          barWidth: \"10px\",\r\n          barGap: \"30%\",\r\n          label: { normal: { show: false } },\r\n          itemStyle: {\r\n            normal: {\r\n              barBorderRadius: [4, 4, 0, 0],\r\n              color: utils.getGrays()[300],\r\n            },\r\n          },\r\n        },\r\n      ],\r\n      grid: { right: \"0\", left: \"30px\", bottom: \"10%\", top: \"20%\" },\r\n    });\r\n\r\n    echartSetOption(chart, userOptions, getDefaultOptions);\r\n  }\r\n};\r\n\r\nexport default topProductsInit;\r\n", "import utils from \"../../utils\";\r\nimport { getPosition, echartSetOption } from \"./echarts-utils\";\r\n/* -------------------------------------------------------------------------- */\r\n/*                                Product Share                               */\r\n/* -------------------------------------------------------------------------- */\r\n\r\nconst marketShareEcommerceInit = () => {\r\n  const ECHART_PRODUCT_SHARE = \".echart-product-share\";\r\n  const $echartProductShare = document.querySelector(ECHART_PRODUCT_SHARE);\r\n\r\n  if ($echartProductShare) {\r\n    const userOptions = utils.getData($echartProductShare, \"options\");\r\n    const chart = window.echarts.init($echartProductShare);\r\n\r\n    const getDefaultOptions = () => ({\r\n      color: [\r\n        utils.getColors().primary,\r\n        utils.getColors().info,\r\n        utils.getColors().warning,\r\n      ],\r\n      tooltip: {\r\n        trigger: \"item\",\r\n        padding: [7, 10],\r\n        backgroundColor: utils.getGrays()['100'],\r\n        borderColor: utils.getGrays()[\"300\"],\r\n        textStyle: { color: utils.getColors().dark },\r\n        borderWidth: 1,\r\n        transitionDuration: 0,\r\n        formatter: function (params) {\r\n          return `<strong>${params.data.name}:</strong> ${params.percent}%`;\r\n        },\r\n      },\r\n      position(pos, params, dom, rect, size) {\r\n        return getPosition(pos, params, dom, rect, size);\r\n      },\r\n      legend: { show: false },\r\n      series: [\r\n        {\r\n          type: \"pie\",\r\n          radius: [\"100%\", \"80%\"],\r\n          avoidLabelOverlap: false,\r\n          hoverAnimation: false,\r\n          itemStyle: {\r\n            borderWidth: 2,\r\n            borderColor: utils.getColor('card-bg'),\r\n          },\r\n          label: {\r\n            normal: {\r\n              show: false,\r\n              position: \"center\",\r\n              textStyle: {\r\n                fontSize: \"20\",\r\n                fontWeight: \"500\",\r\n                color: utils.getGrays()[\"700\"],\r\n              },\r\n            },\r\n            emphasis: {\r\n              show: false,\r\n            },\r\n          },\r\n          labelLine: { normal: { show: false } },\r\n          data: [\r\n            { value: 5300000, name: \"Falcon\" },\r\n            { value: 1900000, name: \"Sparrow\" },\r\n            { value: 2000000, name: \"Phoenix\" },\r\n          ],\r\n        },\r\n      ],\r\n    });\r\n\r\n    echartSetOption(chart, userOptions, getDefaultOptions);\r\n  }\r\n};\r\n\r\nexport default marketShareEcommerceInit;\r\n", "import utils from \"../../utils\";\r\nimport { getPosition, echartSetOption } from \"./echarts-utils\";\r\n\r\n/* -------------------------------------------------------------------------- */\r\n/*                             Echarts Total Sales                            */\r\n/* -------------------------------------------------------------------------- */\r\n\r\nconst totalSalesInit = () => {\r\n  const ECHART_LINE_TOTAL_SALES = \".echart-line-total-sales\";\r\n  const SELECT_MONTH = \".select-month\";\r\n\r\n  const $echartsLineTotalSales = document.querySelector(\r\n    ECHART_LINE_TOTAL_SALES\r\n  );\r\n  const months = [\r\n    \"Jan\",\r\n    \"Feb\",\r\n    \"Mar\",\r\n    \"Apr\",\r\n    \"May\",\r\n    \"Jun\",\r\n    \"Jul\",\r\n    \"Aug\",\r\n    \"Sep\",\r\n    \"Oct\",\r\n    \"Nov\",\r\n    \"Dec\",\r\n  ];\r\n  function getFormatter(params) {\r\n    const { name, value } = params[0];\r\n    var date = new Date(name);\r\n    return `${months[0]} ${date.getDate()}, ${value}`;\r\n  }\r\n  if ($echartsLineTotalSales) {\r\n    // Get options from data attribute\r\n    const userOptions = utils.getData($echartsLineTotalSales, \"options\");\r\n    const chart = window.echarts.init($echartsLineTotalSales);\r\n    const monthsnumber = [\r\n      [60, 80, 60, 80, 65, 130, 120, 100, 30, 40, 30, 70],\r\n      [100, 70, 80, 50, 120, 100, 130, 140, 90, 100, 40, 50],\r\n      [80, 50, 60, 40, 60, 120, 100, 130, 60, 80, 50, 60],\r\n      [70, 80, 100, 70, 90, 60, 80, 130, 40, 60, 50, 80],\r\n      [90, 40, 80, 80, 100, 140, 100, 130, 90, 60, 70, 50],\r\n      [80, 60, 80, 60, 40, 100, 120, 100, 30, 40, 30, 70],\r\n      [20, 40, 20, 50, 70, 60, 110, 80, 90, 30, 50, 50],\r\n      [60, 70, 30, 40, 80, 140, 80, 140, 120, 130, 100, 110],\r\n      [90, 90, 40, 60, 40, 110, 90, 110, 60, 80, 60, 70],\r\n      [50, 80, 50, 80, 50, 80, 120, 80, 50, 120, 110, 110],\r\n      [60, 90, 60, 70, 40, 70, 100, 140, 30, 40, 30, 70],\r\n      [20, 40, 20, 50, 30, 80, 120, 100, 30, 40, 30, 70],\r\n    ];\r\n    const getDefaultOptions = () => ({\r\n      color: utils.getGrays()['100'],\r\n      tooltip: {\r\n        trigger: \"axis\",\r\n        padding: [7, 10],\r\n        backgroundColor: utils.getGrays()['100'],\r\n        borderColor: utils.getGrays()[\"300\"],\r\n        textStyle: { color: utils.getColors().dark },\r\n        borderWidth: 1,\r\n        formatter(params) {\r\n          return getFormatter(params);\r\n        },\r\n        transitionDuration: 0,\r\n        position(pos, params, dom, rect, size) {\r\n          return getPosition(pos, params, dom, rect, size);\r\n        },\r\n      },\r\n      xAxis: {\r\n        type: \"category\",\r\n        data: [\r\n          \"2019-01-05\",\r\n          \"2019-01-06\",\r\n          \"2019-01-07\",\r\n          \"2019-01-08\",\r\n          \"2019-01-09\",\r\n          \"2019-01-10\",\r\n          \"2019-01-11\",\r\n          \"2019-01-12\",\r\n          \"2019-01-13\",\r\n          \"2019-01-14\",\r\n          \"2019-01-15\",\r\n          \"2019-01-16\",\r\n        ],\r\n        boundaryGap: false,\r\n        axisPointer: {\r\n          lineStyle: {\r\n            color: utils.getGrays()[\"300\"],\r\n            type: \"dashed\",\r\n          },\r\n        },\r\n        splitLine: { show: false },\r\n        axisLine: {\r\n          lineStyle: {\r\n            // color: utils.getGrays()['300'],\r\n            color: utils.rgbaColor(\"#000\", 0.01),\r\n            type: \"dashed\",\r\n          },\r\n        },\r\n        axisTick: { show: false },\r\n        axisLabel: {\r\n          color: utils.getGrays()[\"400\"],\r\n          formatter: function (value) {\r\n            var date = new Date(value);\r\n            return `${months[date.getMonth()]} ${date.getDate()}`;\r\n          },\r\n          margin: 15,\r\n        },\r\n      },\r\n      yAxis: {\r\n        type: \"value\",\r\n        axisPointer: { show: false },\r\n        splitLine: {\r\n          lineStyle: {\r\n            color: utils.getGrays()[\"300\"],\r\n            type: \"dashed\",\r\n          },\r\n        },\r\n        boundaryGap: false,\r\n        axisLabel: {\r\n          show: true,\r\n          color: utils.getGrays()[\"400\"],\r\n          margin: 15,\r\n        },\r\n        axisTick: { show: false },\r\n        axisLine: { show: false },\r\n      },\r\n      series: [\r\n        {\r\n          type: \"line\",\r\n          data: monthsnumber[0],\r\n          lineStyle: { color: utils.getColors().primary },\r\n          itemStyle: {\r\n            borderColor: utils.getColors().primary,\r\n            borderWidth: 2,\r\n          },\r\n          symbol: \"circle\",\r\n          symbolSize: 10,\r\n          smooth: false,\r\n          hoverAnimation: true,\r\n          areaStyle: {\r\n            color: {\r\n              type: \"linear\",\r\n              x: 0,\r\n              y: 0,\r\n              x2: 0,\r\n              y2: 1,\r\n              colorStops: [\r\n                {\r\n                  offset: 0,\r\n                  color: utils.rgbaColor(utils.getColors().primary, 0.2),\r\n                },\r\n                {\r\n                  offset: 1,\r\n                  color: utils.rgbaColor(utils.getColors().primary, 0),\r\n                },\r\n              ],\r\n            },\r\n          },\r\n        },\r\n      ],\r\n      grid: { right: \"28px\", left: \"40px\", bottom: \"15%\", top: \"5%\" },\r\n    });\r\n\r\n    echartSetOption(chart, userOptions, getDefaultOptions);\r\n\r\n    // Change chart options accordiong to the selected month\r\n    const monthSelect = document.querySelector(SELECT_MONTH);\r\n\r\n    if (monthSelect) {\r\n\r\n      monthSelect.addEventListener(\"change\", (e) => {\r\n        const month = e.currentTarget.value;\r\n        const data = monthsnumber[month];\r\n\r\n        chart.setOption({\r\n          tooltip: {\r\n            formatter: function (params) {\r\n              const { name, value } = params[0];\r\n              var date = new Date(name);\r\n              return `${months[month]} ${date.getDate()}, ${value}`;\r\n            },\r\n          },\r\n          xAxis: {\r\n            axisLabel: {\r\n              formatter: function (value) {\r\n                var date = new Date(value);\r\n                return `${months[month]} ${date.getDate()}`;\r\n              },\r\n              margin: 15,\r\n            },\r\n          },\r\n          series: [{ data }],\r\n        });\r\n      });\r\n    }\r\n  }\r\n};\r\n\r\nexport default totalSalesInit;\r\n", "/* eslint-disable */\r\nimport utils from '../../utils';\r\nimport { getPosition, echartSetOption } from './echarts-utils';\r\n\r\n/* -------------------------------------------------------------------------- */\r\n/*                                Weekly Sales                                */\r\n/* -------------------------------------------------------------------------- */\r\n\r\nconst weeklySalesInit = () => {\r\n  const ECHART_BAR_WEEKLY_SALES = '.echart-bar-weekly-sales';\r\n  const $echartBarWeeklySales = document.querySelector(ECHART_BAR_WEEKLY_SALES);\r\n\r\n  if ($echartBarWeeklySales) {\r\n    // Get options from data attribute\r\n    const userOptions = utils.getData($echartBarWeeklySales, 'options');\r\n\r\n    const data = [120, 200, 150, 80, 70, 110, 120];\r\n\r\n    // Max value of data\r\n    const yMax = Math.max(...data);\r\n\r\n    // const dataBackground = data.map(() => yMax);\r\n    const chart = window.echarts.init($echartBarWeeklySales);\r\n\r\n    // Default options\r\n    const getDefaultOptions = () => ({\r\n      tooltip: {\r\n        trigger: 'axis',\r\n        padding: [7, 10],\r\n        formatter: '{b0} : {c0}',\r\n        transitionDuration: 0,\r\n        backgroundColor: utils.getGrays()['100'],\r\n        borderColor: utils.getGrays()['300'],\r\n        textStyle: { color: utils.getColors().dark },\r\n        borderWidth: 1,\r\n        position(pos, params, dom, rect, size) {\r\n          return getPosition(pos, params, dom, rect, size);\r\n        }\r\n      },\r\n      xAxis: {\r\n        type: 'category',\r\n        data: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],\r\n        boundaryGap: false,\r\n        axisLine: { show: false },\r\n        axisLabel: { show: false },\r\n        axisTick: { show: false },\r\n        axisPointer: { type: 'none' }\r\n      },\r\n      yAxis: {\r\n        type: 'value',\r\n        splitLine: { show: false },\r\n        axisLine: { show: false },\r\n        axisLabel: { show: false },\r\n        axisTick: { show: false },\r\n        axisPointer: { type: 'none' }\r\n      },\r\n      series: [\r\n        {\r\n          type: 'bar',\r\n          showBackground: true,\r\n          backgroundStyle: {\r\n            borderRadius: 10\r\n          },\r\n          barWidth: '5px',\r\n          itemStyle: {\r\n            barBorderRadius: 10,\r\n            color: utils.getColors().primary\r\n          },\r\n          data,\r\n          z: 10,\r\n          emphasis: { itemStyle: { color: utils.getColors().primary } }\r\n        }\r\n      ],\r\n      grid: { right: 5, left: 10, top: 0, bottom: 0 }\r\n    });\r\n\r\n    echartSetOption(chart, userOptions, getDefaultOptions);\r\n  }\r\n};\r\n\r\nexport default weeklySalesInit;\r\n", "import utils from \"../../utils\";\r\nimport { getPosition, echartSetOption } from \"./echarts-utils\";\r\n\r\n/* -------------------------------------------------------------------------- */\r\n/*                                Market Share                                */\r\n/* -------------------------------------------------------------------------- */\r\n\r\nconst marketShareInit = () => {\r\n  const ECHART_MARKET_SHARE = \".echart-market-share\";\r\n  const $echartMarketShare = document.querySelector(ECHART_MARKET_SHARE);\r\n\r\n  if ($echartMarketShare) {\r\n    const userOptions = utils.getData($echartMarketShare, \"options\");\r\n    const chart = window.echarts.init($echartMarketShare);\r\n\r\n    const getDefaultOptions = () => ({\r\n      color: [\r\n        utils.getColors().primary,\r\n        utils.getColors().info,\r\n        utils.getGrays()[300],\r\n      ],\r\n      tooltip: {\r\n        trigger: \"item\",\r\n        padding: [7, 10],\r\n        backgroundColor: utils.getGrays()['100'],\r\n        borderColor: utils.getGrays()[\"300\"],\r\n        textStyle: { color: utils.getColors().dark },\r\n        borderWidth: 1,\r\n        transitionDuration: 0,\r\n        formatter: function (params) {\r\n          return `<strong>${params.data.name}:</strong> ${params.percent}%`;\r\n        },\r\n      },\r\n      position(pos, params, dom, rect, size) {\r\n        return getPosition(pos, params, dom, rect, size);\r\n      },\r\n      legend: { show: false },\r\n      series: [\r\n        {\r\n          type: \"pie\",\r\n          radius: [\"100%\", \"87%\"],\r\n          avoidLabelOverlap: false,\r\n          hoverAnimation: false,\r\n          itemStyle: {\r\n            borderWidth: 2,\r\n            borderColor: utils.getColor('card-bg'),\r\n          },\r\n          label: {\r\n            normal: {\r\n              show: false,\r\n              position: \"center\",\r\n              textStyle: {\r\n                fontSize: \"20\",\r\n                fontWeight: \"500\",\r\n                color: utils.getGrays()[\"700\"],\r\n              },\r\n            },\r\n            emphasis: {\r\n              show: false,\r\n            },\r\n          },\r\n          labelLine: { normal: { show: false } },\r\n          data: [\r\n            { value: 5300000, name: \"Samsung\" },\r\n            { value: 1900000, name: \"Huawei\" },\r\n            { value: 2000000, name: \"Apple\" },\r\n          ],\r\n        },\r\n      ],\r\n    });\r\n\r\n    echartSetOption(chart, userOptions, getDefaultOptions);\r\n  }\r\n};\r\n\r\nexport default marketShareInit;\r\n", "import utils from '../../utils';\r\nimport { getPosition, echartSetOption } from './echarts-utils';\r\n\r\n/* -------------------------------------------------------------------------- */\r\n/*                                Total Order                                 */\r\n/* -------------------------------------------------------------------------- */\r\n\r\nconst totalOrderInit = () => {\r\n\tconst ECHART_LINE_TOTAL_ORDER = '.echart-line-total-order';\r\n\r\n\t//\r\n\t// \u2500\u2500\u2500 TOTAL ORDER CHART \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\r\n\t//\r\n\tconst $echartLineTotalOrder = document.querySelector(ECHART_LINE_TOTAL_ORDER);\r\n\tif ($echartLineTotalOrder) {\r\n\t\t// Get options from data attribute\r\n\t\tconst userOptions = utils.getData($echartLineTotalOrder, 'options');\r\n\t\tconst chart = window.echarts.init($echartLineTotalOrder);\r\n\r\n\t\t// Default options\r\n\t\tconst getDefaultOptions = () => ({\r\n\t\t\ttooltip: {\r\n\t\t\t\ttriggerOn: 'mousemove',\r\n\t\t\t\ttrigger: 'axis',\r\n\t\t\t\tpadding: [7, 10],\r\n\t\t\t\tformatter: '{b0}: {c0}',\r\n\t\t\t\tbackgroundColor: utils.getGrays()['100'],\r\n\t\t\t\tborderColor: utils.getGrays()['300'],\r\n\t\t\t\ttextStyle: { color: utils.getColors().dark },\r\n\t\t\t\tborderWidth: 1,\r\n\t\t\t\ttransitionDuration: 0,\r\n\t\t\t\tposition(pos, params, dom, rect, size) {\r\n\t\t\t\t\treturn getPosition(pos, params, dom, rect, size);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\txAxis: {\r\n\t\t\t\ttype: 'category',\r\n\t\t\t\tdata: ['Week 4', 'Week 5', 'Week 6', 'Week 7'],\r\n\t\t\t\tboundaryGap: false,\r\n\t\t\t\tsplitLine: { show: false },\r\n\t\t\t\taxisLine: {\r\n\t\t\t\t\tshow: false,\r\n\t\t\t\t\tlineStyle: {\r\n\t\t\t\t\t\tcolor: utils.getGrays()['300'],\r\n\t\t\t\t\t\ttype: 'dashed'\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\taxisLabel: { show: false },\r\n\t\t\t\taxisTick: { show: false },\r\n\t\t\t\taxisPointer: { type: 'none' }\r\n\t\t\t},\r\n\t\t\tyAxis: {\r\n\t\t\t\ttype: 'value',\r\n\t\t\t\tsplitLine: { show: false },\r\n\t\t\t\taxisLine: { show: false },\r\n\t\t\t\taxisLabel: { show: false },\r\n\t\t\t\taxisTick: { show: false },\r\n\t\t\t\taxisPointer: { show: false }\r\n\t\t\t},\r\n\t\t\tseries: [\r\n\t\t\t\t{\r\n\t\t\t\t\ttype: 'line',\r\n\t\t\t\t\tlineStyle: {\r\n\t\t\t\t\t\tcolor: utils.getColors().primary,\r\n\t\t\t\t\t\twidth: 3\r\n\t\t\t\t\t},\r\n\t\t\t\t\titemStyle: {\r\n\t\t\t\t\t\tcolor: utils.getGrays().white,\r\n\t\t\t\t\t\tborderColor: utils.getColors().primary,\r\n\t\t\t\t\t\tborderWidth: 2\r\n\t\t\t\t\t},\r\n\t\t\t\t\thoverAnimation: true,\r\n\t\t\t\t\tdata: [20, 40, 100, 120],\r\n\t\t\t\t\t// connectNulls: true,\r\n\t\t\t\t\tsmooth: 0.6,\r\n\t\t\t\t\tsmoothMonotone: 'x',\r\n\t\t\t\t\tshowSymbol: false,\r\n\t\t\t\t\tsymbol: 'circle',\r\n\t\t\t\t\tsymbolSize: 8,\r\n\t\t\t\t\tareaStyle: {\r\n\t\t\t\t\t\tcolor: {\r\n\t\t\t\t\t\t\ttype: 'linear',\r\n\t\t\t\t\t\t\tx: 0,\r\n\t\t\t\t\t\t\ty: 0,\r\n\t\t\t\t\t\t\tx2: 0,\r\n\t\t\t\t\t\t\ty2: 1,\r\n\t\t\t\t\t\t\tcolorStops: [\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\toffset: 0,\r\n\t\t\t\t\t\t\t\t\tcolor: utils.rgbaColor(utils.getColors().primary, 0.25)\r\n\t\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\toffset: 1,\r\n\t\t\t\t\t\t\t\t\tcolor: utils.rgbaColor(utils.getColors().primary, 0)\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t]\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t],\r\n\t\t\tgrid: {\r\n\t\t\t\tbottom: '2%',\r\n\t\t\t\ttop: '0%',\r\n\t\t\t\tright: '10px',\r\n\t\t\t\tleft: '10px'\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\techartSetOption(chart, userOptions, getDefaultOptions);\r\n\t}\r\n};\r\n\r\nexport default totalOrderInit;\r\n", "import utils from \"../../utils\";\r\nimport { getPosition, echartSetOption } from \"./echarts-utils\";\r\n\r\n/* -------------------------------------------------------------------------- */\r\n/*                             Echarts Candle Chart                           */\r\n/* -------------------------------------------------------------------------- */\r\n\r\nconst candleChartInit = () => {\r\n  const ECHART_CANDLE_CHART = \".echart-candle-chart\";\r\n  const ECHART_ZOOM_IN = \"[data-zoom='in']\";\r\n  const ECHART_ZOOM_OUT = \"[data-zoom='out']\";\r\n\r\n  const $echartsCandleChart = document.querySelector(ECHART_CANDLE_CHART);\r\n\r\n\r\n\r\n  if ($echartsCandleChart) {\r\n    const userOptions = utils.getData($echartsCandleChart, \"options\");\r\n    const chart = window.echarts.init($echartsCandleChart);\r\n\r\n    const $echartsZoomIn = document\r\n      .getElementById($echartsCandleChart.dataset.actionTarget)\r\n      .querySelector(ECHART_ZOOM_IN);\r\n    const $echartsZoomOut = document\r\n      .getElementById($echartsCandleChart.dataset.actionTarget)\r\n      .querySelector(ECHART_ZOOM_OUT);\r\n\r\n    let warning = utils.getColors()[\"warning\"];\r\n    let primary = utils.getColors()[\"primary\"];\r\n\r\n    const splitData = (rawData) => {\r\n      let categoryData = [];\r\n      let values = [];\r\n\r\n      rawData.forEach((item) => {\r\n        categoryData.push(item.splice(0, 1)[0]);\r\n        values.push(item);\r\n      });\r\n      return { categoryData, values };\r\n    };\r\n\r\n    const data = splitData([\r\n      [\"2013/1/24\", 2320.26, 2320.26, 2287.3, 2362.94],\r\n      [\"2013/1/25\", 2300, 2291.3, 2288.26, 2308.38],\r\n      [\"2013/1/28\", 2295.35, 2346.5, 2295.35, 2346.92],\r\n      [\"2013/1/29\", 2347.22, 2358.98, 2337.35, 2363.8],\r\n      [\"2013/1/30\", 2360.75, 2382.48, 2347.89, 2383.76],\r\n      [\"2013/1/31\", 2383.43, 2385.42, 2371.23, 2391.82],\r\n      [\"2013/2/1\", 2377.41, 2419.02, 2369.57, 2421.15],\r\n      [\"2013/2/4\", 2425.92, 2428.15, 2417.58, 2440.38],\r\n      [\"2013/2/5\", 2411, 2433.13, 2403.3, 2437.42],\r\n      [\"2013/2/6\", 2432.68, 2434.48, 2427.7, 2441.73],\r\n      [\"2013/2/7\", 2430.69, 2418.53, 2394.22, 2433.89],\r\n      [\"2013/2/8\", 2416.62, 2432.4, 2414.4, 2443.03],\r\n      [\"2013/2/18\", 2441.91, 2421.56, 2415.43, 2444.8],\r\n      [\"2013/2/19\", 2420.26, 2382.91, 2373.53, 2427.07],\r\n      [\"2013/2/20\", 2383.49, 2397.18, 2370.61, 2397.94],\r\n      [\"2013/2/21\", 2378.82, 2325.95, 2309.17, 2378.82],\r\n      [\"2013/2/22\", 2322.94, 2314.16, 2308.76, 2330.88],\r\n      [\"2013/2/25\", 2320.62, 2325.82, 2315.01, 2338.78],\r\n      [\"2013/2/26\", 2313.74, 2293.34, 2289.89, 2340.71],\r\n      [\"2013/2/27\", 2297.77, 2313.22, 2292.03, 2324.63],\r\n      [\"2013/2/28\", 2322.32, 2365.59, 2308.92, 2366.16],\r\n      [\"2013/3/1\", 2364.54, 2359.51, 2330.86, 2369.65],\r\n      [\"2013/3/4\", 2332.08, 2273.4, 2259.25, 2333.54],\r\n      [\"2013/3/5\", 2274.81, 2326.31, 2270.1, 2328.14],\r\n      [\"2013/3/6\", 2333.61, 2347.18, 2321.6, 2351.44],\r\n      [\"2013/3/7\", 2340.44, 2324.29, 2304.27, 2352.02],\r\n      [\"2013/3/8\", 2326.42, 2318.61, 2314.59, 2333.67],\r\n      [\"2013/3/11\", 2314.68, 2310.59, 2296.58, 2320.96],\r\n      [\"2013/3/12\", 2309.16, 2286.6, 2264.83, 2333.29],\r\n      [\"2013/3/13\", 2282.17, 2263.97, 2253.25, 2286.33],\r\n      [\"2013/3/14\", 2255.77, 2270.28, 2253.31, 2276.22],\r\n      [\"2013/3/15\", 2269.31, 2278.4, 2250, 2312.08],\r\n      [\"2013/3/18\", 2267.29, 2240.02, 2239.21, 2276.05],\r\n      [\"2013/3/19\", 2244.26, 2257.43, 2232.02, 2261.31],\r\n      [\"2013/3/20\", 2257.74, 2317.37, 2257.42, 2317.86],\r\n      [\"2013/3/21\", 2318.21, 2324.24, 2311.6, 2330.81],\r\n      [\"2013/3/22\", 2321.4, 2328.28, 2314.97, 2332],\r\n      [\"2013/3/25\", 2334.74, 2326.72, 2319.91, 2344.89],\r\n      [\"2013/3/26\", 2318.58, 2297.67, 2281.12, 2319.99],\r\n      [\"2013/3/27\", 2299.38, 2301.26, 2289, 2323.48],\r\n      [\"2013/3/28\", 2273.55, 2236.3, 2232.91, 2273.55],\r\n      [\"2013/3/29\", 2238.49, 2236.62, 2228.81, 2246.87],\r\n      [\"2013/4/1\", 2229.46, 2234.4, 2227.31, 2243.95],\r\n      [\"2013/4/2\", 2234.9, 2227.74, 2220.44, 2253.42],\r\n      [\"2013/4/3\", 2232.69, 2225.29, 2217.25, 2241.34],\r\n      [\"2013/4/8\", 2196.24, 2211.59, 2180.67, 2212.59],\r\n      [\"2013/4/9\", 2215.47, 2225.77, 2215.47, 2234.73],\r\n      [\"2013/4/10\", 2224.93, 2226.13, 2212.56, 2233.04],\r\n      [\"2013/4/11\", 2236.98, 2219.55, 2217.26, 2242.48],\r\n      [\"2013/4/12\", 2218.09, 2206.78, 2204.44, 2226.26],\r\n    ]);\r\n\r\n    let zoomStart = 0;\r\n    let zoomEnd = 70;\r\n\r\n    const getDefaultOptions = () => ({\r\n      tooltip: {\r\n        trigger: \"axis\",\r\n        // axisPointer: {\r\n        //   type: \"cross\",\r\n        // },\r\n        padding: [7, 10],\r\n        backgroundColor: utils.getGrays()[\"100\"],\r\n        borderColor: utils.getGrays()[\"300\"],\r\n        textStyle: { color: utils.getColors().dark },\r\n        borderWidth: 1,\r\n        position(pos, params, dom, rect, size) {\r\n          return getPosition(pos, params, dom, rect, size);\r\n        },\r\n      },\r\n      xAxis: {\r\n        type: \"category\",\r\n        data: data.categoryData,\r\n        scale: true,\r\n        splitLine: { show: false },\r\n        splitNumber: 10,\r\n        min: \"dataMin\",\r\n        max: \"dataMax\",\r\n        boundaryGap: true,\r\n        axisPointer: {\r\n          lineStyle: {\r\n            color: utils.getGrays()[\"300\"],\r\n            type: \"dashed\",\r\n          },\r\n        },\r\n        axisLine: {\r\n          lineStyle: {\r\n            color: utils.getGrays()[\"300\"],\r\n            type: \"solid\",\r\n          },\r\n        },\r\n        axisTick: { show: false },\r\n        axisLabel: {\r\n          color: utils.getGrays()[\"600\"],\r\n          formatter: function (value) {\r\n            return new Date(value).toLocaleString(\"en-US\", {\r\n              month: \"short\",\r\n              day: \"numeric\",\r\n            });\r\n          },\r\n          margin: 15,\r\n          fontWeight: 500,\r\n        },\r\n      },\r\n      yAxis: {\r\n        scale: true,\r\n        position: \"right\",\r\n        axisPointer: { show: false },\r\n        splitLine: {\r\n          lineStyle: {\r\n            color: utils.getGrays()[\"200\"],\r\n            type: \"dashed\",\r\n          },\r\n        },\r\n        boundaryGap: false,\r\n        axisLabel: {\r\n          show: true,\r\n          color: utils.getGrays()[\"600\"],\r\n          margin: 15,\r\n          fontWeight: 500,\r\n        },\r\n        axisTick: { show: false },\r\n        axisLine: { show: false },\r\n      },\r\n      dataZoom: [\r\n        {\r\n          type: \"inside\",\r\n          start: zoomStart,\r\n          end: zoomEnd,\r\n        },\r\n      ],\r\n\r\n      series: [\r\n        {\r\n          name: \"candlestick\",\r\n          type: \"candlestick\",\r\n          data: data.values,\r\n          itemStyle: {\r\n            color: warning,\r\n            color0: primary,\r\n            borderColor: warning,\r\n            borderColor0: primary,\r\n          },\r\n        },\r\n      ],\r\n      grid: { right: \"70px\", left: \"20px\", bottom: \"15%\", top: \"20px\" },\r\n    });\r\n\r\n    echartSetOption(chart, userOptions, getDefaultOptions);\r\n\r\n    const dispatchZoomAction = () => {\r\n      chart.dispatchAction({\r\n        type: \"dataZoom\",\r\n        start: zoomStart,\r\n        end: zoomEnd,\r\n      });\r\n    };\r\n\r\n    $echartsZoomIn.addEventListener(\"click\", () => {\r\n      if (zoomEnd > 10) {\r\n        zoomEnd -= 10;\r\n      }\r\n\r\n      if (zoomEnd <= 10) {\r\n        $echartsZoomIn.disabled = true;\r\n      }\r\n\r\n      if (zoomEnd > 0) {\r\n        $echartsZoomOut.disabled = false;\r\n        dispatchZoomAction();\r\n      }\r\n    });\r\n\r\n    $echartsZoomOut.addEventListener(\"click\", () => {\r\n      if (zoomEnd < 100) {\r\n        zoomEnd += 10;\r\n      }\r\n\r\n      if (zoomEnd >= 100) {\r\n        $echartsZoomOut.disabled = true;\r\n      }\r\n\r\n      if (zoomEnd > 0) {\r\n        $echartsZoomIn.disabled = false;\r\n        dispatchZoomAction();\r\n      }\r\n    });\r\n\r\n    chart.on(\"dataZoom\", function (params) {\r\n      if (params.batch) {\r\n        zoomStart = params.batch[0].start;\r\n        zoomEnd = params.batch[0].end;\r\n      }\r\n    });\r\n  }\r\n};\r\n\r\nexport default candleChartInit;\r\n", "import utils from '../../utils';\r\nimport { getPosition, echartSetOption } from './echarts-utils';\r\n\r\n/* -------------------------------------------------------------------------- */\r\n/*                             Echarts Gross Revenue                          */\r\n/* -------------------------------------------------------------------------- */\r\n\r\nconst grossRevenueChartInit = () => {\r\n  const ECHART_GROSS_REVENUE = '.echart-gross-revenue-chart';\r\n\r\n  const $echartsGrossRevenue = document.querySelector(ECHART_GROSS_REVENUE);\r\n\r\n  const months = [\r\n    'Jan',\r\n    'Feb',\r\n    'Mar',\r\n    'Apr',\r\n    'May',\r\n    'Jun',\r\n    'Jul',\r\n    'Aug',\r\n    'Sep',\r\n    'Oct',\r\n    'Nov',\r\n    'Dec',\r\n  ];\r\n\r\n  if ($echartsGrossRevenue) {\r\n    // Get options from data attribute\r\n    const userOptions = utils.getData($echartsGrossRevenue, 'options');\r\n    const chart = window.echarts.init($echartsGrossRevenue);\r\n\r\n\r\n    const SELECT_MONTH = `#${userOptions.monthSelect}`;\r\n    const LEGEND_MONTH_TARGET = userOptions.target;\r\n    const LEGEND_CURRENT_MONTH = `#${userOptions.optionOne}`;\r\n    const LEGEND_PREV_MONTH = `#${userOptions.optionTwo}`;\r\n\r\n    const $legendCurrentMonth = document\r\n      .getElementById(LEGEND_MONTH_TARGET)\r\n      .querySelector(LEGEND_CURRENT_MONTH);\r\n    const $legendPrevMonth = document\r\n      .getElementById(LEGEND_MONTH_TARGET)\r\n      .querySelector(LEGEND_PREV_MONTH);\r\n\r\n    const dates = month => {\r\n      return utils.getDates(\r\n        window.dayjs().month(month).date(1), \r\n        window.dayjs().month(Number(month) + 1).date(0),\r\n        1000 * 60 * 60 * 24 * 3\r\n      );\r\n    }\r\n\r\n    const monthsnumber = [\r\n      [20, 40, 20, 80, 50, 80, 120, 80, 50, 120, 110, 110],\r\n      [60, 80, 60, 80, 65, 130, 120, 100, 30, 40, 30, 70],\r\n      [100, 70, 80, 50, 120, 100, 130, 140, 90, 100, 40, 50],\r\n      [80, 50, 60, 40, 60, 120, 100, 130, 60, 80, 50, 60],\r\n      [70, 80, 100, 70, 90, 60, 80, 130, 40, 60, 50, 80],\r\n      [90, 40, 80, 80, 100, 140, 100, 130, 90, 60, 70, 50],\r\n      [80, 60, 80, 60, 40, 100, 120, 100, 30, 40, 30, 70],\r\n      [20, 40, 20, 50, 70, 60, 110, 80, 90, 30, 50, 50],\r\n      [60, 70, 30, 40, 80, 140, 80, 140, 120, 130, 100, 110],\r\n      [90, 90, 40, 60, 40, 110, 90, 110, 60, 80, 60, 70],\r\n      [50, 80, 50, 80, 50, 80, 120, 80, 50, 120, 110, 110],\r\n      [60, 90, 60, 70, 40, 70, 100, 140, 30, 40, 30, 70],\r\n      [20, 40, 20, 50, 30, 80, 120, 100, 30, 40, 30, 70],\r\n    ];\r\n\r\n    const tooltipFormatter = params => {\r\n      const currentDate = window.dayjs(params[0].axisValue);\r\n      let tooltipItem = ``\r\n      params.forEach(el => {\r\n        tooltipItem = tooltipItem +`<h6 class=\"fs--1 text-700\"><span class=\"fas fa-circle me-2\" style=\"color:${el.borderColor}\"></span>\r\n        ${currentDate.format('MMM DD')} : ${el.value}\r\n      </h6>`\r\n      });\r\n      return `<div class='ms-1'>\r\n                ${tooltipItem}\r\n              </div>`;\r\n    };\r\n    const getDefaultOptions = () => ({\r\n      title: {\r\n        text: 'Sales over time',\r\n        textStyle: {\r\n          fontWeight: 500,\r\n          fontSize: 13,\r\n          fontFamily: 'poppins',\r\n        },\r\n      },\r\n      legend: {\r\n        show: false,\r\n        data: ['currentMonth', 'prevMonth'],\r\n      },\r\n      color: utils.getGrays().white,\r\n      tooltip: {\r\n        trigger: 'axis',\r\n        padding: [7, 10],\r\n        backgroundColor: utils.getGrays()['100'],\r\n        borderColor: utils.getGrays()['300'],\r\n        textStyle: { color: utils.getColors().dark },\r\n        borderWidth: 1,\r\n        formatter: tooltipFormatter,\r\n        transitionDuration: 0,\r\n        position(pos, params, dom, rect, size) {\r\n          return getPosition(pos, params, dom, rect, size);\r\n        },\r\n      },\r\n      xAxis: {\r\n        type: 'category',\r\n        data: dates(0),\r\n        boundaryGap: false,\r\n        axisPointer: {\r\n          lineStyle: {\r\n            color: utils.getGrays()['300'],\r\n            type: 'dashed',\r\n          },\r\n        },\r\n        axisLine: {\r\n          lineStyle: {\r\n            color: utils.getGrays()['300'],\r\n            type: 'solid',\r\n          },\r\n        },\r\n        axisTick: { show: false },\r\n        axisLabel: {\r\n          color: utils.getGrays()['400'],\r\n          formatter: function (value) {\r\n            var date = new Date(value);\r\n            return `${months[date.getMonth()].substring(\r\n              0,\r\n              3\r\n            )} ${date.getDate()}`;\r\n          },\r\n          margin: 15,\r\n        },\r\n        splitLine: {\r\n          show: true,\r\n          lineStyle: {\r\n            color: utils.getGrays()['300'],\r\n            type: 'dashed',\r\n          },\r\n        },\r\n      },\r\n      yAxis: {\r\n        type: 'value',\r\n        axisPointer: { show: false },\r\n        splitLine: {\r\n          lineStyle: {\r\n            color: utils.getGrays()['300'],\r\n          },\r\n        },\r\n        boundaryGap: false,\r\n        axisLabel: {\r\n          show: true,\r\n          color: utils.getGrays()['400'],\r\n          margin: 15,\r\n        },\r\n        axisTick: { show: false },\r\n        axisLine: { show: false },\r\n      },\r\n      series: [\r\n        {\r\n          name: 'prevMonth',\r\n          type: 'line',\r\n          data: monthsnumber[0],\r\n          lineStyle: { color: utils.getGrays()['300'] },\r\n          itemStyle: {\r\n            borderColor: utils.getGrays()['300'],\r\n            borderWidth: 2,\r\n          },\r\n          symbol: 'none',\r\n          smooth: false,\r\n          hoverAnimation: true,\r\n        },\r\n        {\r\n          name: 'currentMonth',\r\n          type: 'line',\r\n          data: monthsnumber[1],\r\n          lineStyle: { color: utils.getColors().primary },\r\n          itemStyle: {\r\n            borderColor: utils.getColors().primary,\r\n            borderWidth: 2,\r\n          },\r\n          symbol: 'none',\r\n          smooth: false,\r\n          hoverAnimation: true,\r\n        },\r\n      ],\r\n      grid: { right: '8px', left: '40px', bottom: '15%', top: '20%' },\r\n    });\r\n\r\n    echartSetOption(chart, userOptions, getDefaultOptions);\r\n\r\n    // Change chart options accordiong to the selected month\r\n    const monthSelect = document.querySelector(SELECT_MONTH);\r\n\r\n    let month = 0;\r\n    let currentMonthData = monthsnumber[Number(month) + 1];\r\n    let prevMonthData = monthsnumber[monthSelect.selectedIndex];\r\n\r\n    monthSelect.addEventListener('change', (e) => {\r\n      month = e.currentTarget.value;\r\n      currentMonthData = monthsnumber[Number(month) + 1];\r\n      prevMonthData = monthsnumber[month];\r\n\r\n      $legendCurrentMonth.querySelector('.text').innerText = months[month];\r\n      $legendPrevMonth.querySelector('.text').innerText = months[month - 1]\r\n        ? months[month - 1]\r\n        : 'Dec';\r\n\r\n      chart.setOption({\r\n        xAxis: {\r\n          data: dates(month)\r\n        },\r\n        series: [\r\n          {\r\n            data: currentMonthData,\r\n          },\r\n          {\r\n            data: prevMonthData,\r\n          },\r\n        ],\r\n      });\r\n    });\r\n\r\n    $legendCurrentMonth.addEventListener('click', () => {\r\n      $legendCurrentMonth.classList.toggle('opacity-50');\r\n\r\n      chart.dispatchAction({\r\n        type: 'legendToggleSelect',\r\n        name: 'currentMonth',\r\n      });\r\n    });\r\n\r\n    $legendPrevMonth.addEventListener('click', () => {\r\n      $legendPrevMonth.classList.toggle('opacity-50');\r\n\r\n      chart.dispatchAction({\r\n        type: 'legendToggleSelect',\r\n        name: 'prevMonth',\r\n      });\r\n    });\r\n  }\r\n};\r\n\r\nexport default grossRevenueChartInit;\r\n", "/* -------------------------------------------------------------------------- */\r\n/*                                 Scrollbars                                 */\r\n/* -------------------------------------------------------------------------- */\r\n\r\nconst scrollbarInit = () => {\r\n  Array.prototype.forEach.call(\r\n    document.querySelectorAll(\".scrollbar-overlay\"),\r\n    (el) => new window.OverlayScrollbars(el, {\r\n      scrollbars: {\r\n        autoHide: \"leave\",\r\n        autoHideDelay: 200\r\n      },\r\n    })\r\n  );\r\n};\r\n\r\nexport default scrollbarInit;\r\n", "/* -------------------------------------------------------------------------- */\r\n/*                           Icon copy to clipboard                           */\r\n/* -------------------------------------------------------------------------- */\r\n\r\nconst iconCopiedInit = () => {\r\n  const iconList = document.getElementById(\"icon-list\");\r\n  const iconCopiedToast = document.getElementById(\"icon-copied-toast\");\r\n  const iconCopiedToastInstance = new window.bootstrap.Toast(iconCopiedToast);\r\n\r\n  if (iconList) {\r\n    iconList.addEventListener(\"click\", (e) => {\r\n      const el = e.target;\r\n      if (el.tagName === \"INPUT\") {\r\n        el.select();\r\n        el.setSelectionRange(0, 99999);\r\n        document.execCommand(\"copy\");\r\n        iconCopiedToast.querySelector(\r\n          \".toast-body\"\r\n        ).innerHTML = `<span class=\"fw-black\">Copied:</span> <code>${el.value}</code>`;\r\n        iconCopiedToastInstance.show();\r\n      }\r\n    });\r\n  }\r\n};\r\n\r\nexport default iconCopiedInit;\r\n", "import utils from \"../../utils\";\r\nimport { getPosition, echartSetOption } from \"./echarts-utils\";\r\n\r\n/* -------------------------------------------------------------------------- */\r\n/*                     Echart Bar Report For This Week                        */\r\n/* -------------------------------------------------------------------------- */\r\n\r\nconst reportForThisWeekInit = () => {\r\n  const ECHART_BAR_REPORT_FOR_THIS_WEEK = \".echart-bar-report-for-this-week\";\r\n  const $echartBarReportForThisWeek = document.querySelector(\r\n    ECHART_BAR_REPORT_FOR_THIS_WEEK\r\n  );\r\n\r\n  if ($echartBarReportForThisWeek) {\r\n    const selectChart = utils.getData($echartBarReportForThisWeek, \"chart\");\r\n    const legendLastWeek = document.getElementById(selectChart?.option1);\r\n    const legendThisWeek = document.getElementById(selectChart?.option2);\r\n  \r\n    const data = [\r\n      [\"product\", \"This Week\", \"Last Week\"],\r\n      [\"Sun\", 43, 85],\r\n      [\"Mon\", 83, 73],\r\n      [\"Tue\", 86, 62],\r\n      [\"Wed\", 72, 53],\r\n      [\"Thu\", 80, 50],\r\n      [\"Fri\", 50, 70],\r\n      [\"Sat\", 80, 90],\r\n    ];\r\n    const userOptions = utils.getData($echartBarReportForThisWeek, \"options\");\r\n    const chart = window.echarts.init($echartBarReportForThisWeek);\r\n\r\n    const getDefaultOptions = () => ({\r\n      color: [utils.getColors().primary, utils.getGrays()[\"300\"]],\r\n      dataset: { source: data },\r\n      tooltip: {\r\n        trigger: \"item\",\r\n        padding: [7, 10],\r\n        backgroundColor: utils.getGrays()[\"100\"],\r\n        borderColor: utils.getGrays()[\"300\"],\r\n        textStyle: { color: utils.getColors().dark },\r\n        borderWidth: 1,\r\n        transitionDuration: 0,\r\n        position(pos, params, dom, rect, size) {\r\n          return getPosition(pos, params, dom, rect, size);\r\n        },\r\n        formatter: function (params) {\r\n          return `<div class=\"font-weight-semi-bold\">${\r\n            params.seriesName\r\n          }</div><div class=\"fs--1 text-600\"><strong>${params.name}:</strong> ${\r\n            params.value[params.componentIndex + 1]\r\n          }</div>`;\r\n        },\r\n      },\r\n      legend: {\r\n        show: false,\r\n      },\r\n      xAxis: {\r\n        type: \"category\",\r\n        axisLabel: { color: utils.getGrays()[\"400\"] },\r\n        axisLine: {\r\n          lineStyle: {\r\n            color: utils.getGrays()[\"300\"],\r\n            type: \"dashed\",\r\n          },\r\n        },\r\n        axisTick: false,\r\n        boundaryGap: true,\r\n      },\r\n      yAxis: {\r\n        axisPointer: { type: \"none\" },\r\n        axisTick: \"none\",\r\n        splitLine: {\r\n          lineStyle: {\r\n            color: utils.getGrays()[\"300\"],\r\n            type: \"dashed\",\r\n          },\r\n        },\r\n        axisLine: { show: false },\r\n\r\n        axisLabel: {\r\n          color: utils.getGrays()[\"400\"],\r\n          formatter: (value) => `${value} hr`,\r\n        },\r\n      },\r\n      series: [\r\n        {\r\n          type: \"bar\",\r\n          name: \"\",\r\n          barWidth: \"12%\",\r\n          barGap: \"30%\",\r\n          label: { normal: { show: false } },\r\n          z: 10,\r\n          itemStyle: {\r\n            normal: {\r\n              barBorderRadius: [10, 10, 0, 0],\r\n              color: utils.getColors().primary,\r\n            },\r\n          },\r\n        },\r\n        {\r\n          type: \"bar\",\r\n          barWidth: \"12%\",\r\n          barGap: \"30%\",\r\n          label: { normal: { show: false } },\r\n          itemStyle: {\r\n            normal: {\r\n              barBorderRadius: [4, 4, 0, 0],\r\n              color: utils.getGrays()[300],\r\n            },\r\n          },\r\n        },\r\n      ],\r\n      grid: { right: \"0\", left: \"40px\", bottom: \"10%\", top: \"15%\" },\r\n    });\r\n\r\n    legendLastWeek && legendLastWeek.addEventListener(\"click\", () => {\r\n      legendLastWeek.classList.toggle(\"opacity-50\");\r\n      chart.dispatchAction({\r\n        type: \"legendToggleSelect\",\r\n        name: \"Last Week\",\r\n      });\r\n    });\r\n\r\n    legendThisWeek && legendThisWeek.addEventListener(\"click\", () => {\r\n      legendThisWeek.classList.toggle(\"opacity-50\");\r\n      chart.dispatchAction({\r\n        type: \"legendToggleSelect\",\r\n        name: \"This Week\",\r\n      });\r\n    });\r\n\r\n    echartSetOption(chart, userOptions, getDefaultOptions);\r\n  }\r\n};\r\n\r\nexport default reportForThisWeekInit;\r\n", "import utils from '../../utils';\r\nimport { getPosition, echartSetOption } from './echarts-utils';\r\n\r\n/* -------------------------------------------------------------------------- */\r\n/*                     Echart Bar Member info                                 */\r\n/* -------------------------------------------------------------------------- */\r\n\r\nconst basicEchartsInit = () => {\r\n  const $echartBasicCharts = document.querySelectorAll('[data-echarts]');\r\n\r\n  $echartBasicCharts.forEach($echartBasicChart => {\r\n    const userOptions = utils.getData($echartBasicChart, 'echarts');\r\n    const chart = window.echarts.init($echartBasicChart);\r\n    const getDefaultOptions = () => ({\r\n      color: utils.getColors().primary,\r\n      tooltip: {\r\n        trigger: 'item',\r\n        axisPointer: {\r\n          type: 'none'\r\n        },\r\n        padding: [7, 10],\r\n        backgroundColor: utils.getGrays()['100'],\r\n        borderColor: utils.getGrays()['300'],\r\n        textStyle: { color: utils.getColors().dark },\r\n        borderWidth: 1,\r\n        transitionDuration: 0,\r\n        position(pos, params, dom, rect, size) {\r\n          return getPosition(pos, params, dom, rect, size);\r\n        }\r\n      },\r\n      xAxis: {\r\n        type: 'category',\r\n        show: false,\r\n        boundaryGap: false\r\n      },\r\n      yAxis: {\r\n        show: false,\r\n        type: 'value',\r\n        boundaryGap: false\r\n      },\r\n      series: [\r\n        {\r\n          type: 'bar',\r\n          symbol: 'none',\r\n          areaStyle: {\r\n            color: {\r\n              type: 'linear',\r\n              x: 0,\r\n              y: 0,\r\n              x2: 0,\r\n              y2: 1,\r\n              colorStops: [\r\n                {\r\n                  offset: 0,\r\n                  color: utils.rgbaColor(utils.getColor('primary'), 0.25)\r\n                },\r\n                {\r\n                  offset: 1,\r\n                  color: utils.rgbaColor(utils.getColor('primary'), 0)\r\n                }\r\n              ]\r\n            }\r\n          }\r\n        }\r\n      ],\r\n      grid: { right: '0', left: '0', bottom: '0', top: '0' }\r\n    });\r\n    echartSetOption(chart, userOptions, getDefaultOptions);\r\n  });\r\n};\r\n\r\nexport default basicEchartsInit;\r\n", "import utils from '../../utils';\r\nimport { chartJsDefaultTooltip, chartJsInit } from './chartjs-utils';\r\n\r\n/* -------------------------------------------------------------------------- */\r\n/*                            Chart Scatter                                   */\r\n/* -------------------------------------------------------------------------- */\r\nconst chartScatter = () => {\r\n  const scatter = document.getElementById('chartjs-scatter-chart');\r\n\r\n  const getOptions = () => ({\r\n    type: 'scatter',\r\n    data: {\r\n      datasets: [\r\n        {\r\n          label: 'Dataset one',\r\n          data: [\r\n            {\r\n              x: -98,\r\n              y: 42\r\n            },\r\n            {\r\n              x: -85,\r\n              y: -29\r\n            },\r\n            {\r\n              x: -87,\r\n              y: -70\r\n            },\r\n            {\r\n              x: -53,\r\n              y: 28\r\n            },\r\n            {\r\n              x: -29,\r\n              y: 4\r\n            },\r\n            {\r\n              x: -2,\r\n              y: -42\r\n            },\r\n            {\r\n              x: 5,\r\n              y: 3\r\n            },\r\n            {\r\n              x: 39,\r\n              y: 19\r\n            },\r\n            {\r\n              x: 49,\r\n              y: 79\r\n            },\r\n            {\r\n              x: 83,\r\n              y: -9\r\n            },\r\n            {\r\n              x: 93,\r\n              y: 12\r\n            }\r\n          ],\r\n          pointBackgroundColor: utils.getColor('primary'),\r\n          borderColor: utils.getColor('primary'),\r\n          borderWidth: 1\r\n        },\r\n        {\r\n          label: 'Dataset Two',\r\n          data: [\r\n            {\r\n              x: 53,\r\n              y: 12\r\n            },\r\n            {\r\n              x: -78,\r\n              y: 42\r\n            },\r\n            {\r\n              x: -65,\r\n              y: -39\r\n            },\r\n            {\r\n              x: -57,\r\n              y: -20\r\n            },\r\n            {\r\n              x: 57,\r\n              y: 28\r\n            },\r\n            {\r\n              x: -35,\r\n              y: 75\r\n            },\r\n            {\r\n              x: -29,\r\n              y: -43\r\n            },\r\n            {\r\n              x: 15,\r\n              y: 31\r\n            },\r\n            {\r\n              x: 97,\r\n              y: 19\r\n            },\r\n            {\r\n              x: 49,\r\n              y: 69\r\n            },\r\n            {\r\n              x: 33,\r\n              y: -57\r\n            }\r\n          ],\r\n          pointBackgroundColor: utils.getColor('warning'),\r\n          borderColor: utils.getColor('warning'),\r\n          borderWidth: 1,\r\n          borderRadius: '50%'\r\n        }\r\n      ]\r\n    },\r\n    options: {\r\n      plugins: {\r\n        tooltip: chartJsDefaultTooltip()\r\n      },\r\n      scales: {\r\n        x: {\r\n          grid: {\r\n            color: utils.rgbaColor(utils.getGrays()['black'], 0.1)\r\n          }\r\n        },\r\n        y: {\r\n          grid: {\r\n            color: utils.rgbaColor(utils.getGrays()['black'], 0.1)\r\n          }\r\n        }\r\n      },\r\n      animation: {\r\n        duration: 2000\r\n      }\r\n    }\r\n  });\r\n\r\n  chartJsInit(scatter, getOptions);\r\n};\r\n\r\nexport default chartScatter;\r\n", "import utils from '../../utils';\r\nimport { chartJsDefaultTooltip, chartJsInit } from './chartjs-utils';\r\n\r\n/* -------------------------------------------------------------------------- */\r\n/*                            Chart Doughnut                                  */\r\n/* -------------------------------------------------------------------------- */\r\nconst chartDoughnut = () => {\r\n  const doughnut = document.getElementById('chartjs-doughnut-chart');\r\n\r\n  const getOptions = () => ({\r\n    type: 'doughnut',\r\n    data: {\r\n      datasets: [\r\n        {\r\n          data: [5, 3, 2, 1, 1],\r\n          backgroundColor: [\r\n            utils.rgbaColor(utils.getColor('facebook'), 0.2),\r\n            utils.rgbaColor(utils.getColor('youtube'), 0.2),\r\n            utils.rgbaColor(utils.getColor('twitter'), 0.2),\r\n            utils.rgbaColor(utils.getColor('linkedin'), 0.2),\r\n            utils.rgbaColor(utils.getColor('github'), 0.2)\r\n          ],\r\n          borderWidth: 1,\r\n          borderColor: [\r\n            utils.getColor('facebook'),\r\n            utils.getColor('youtube'),\r\n            utils.getColor('twitter'),\r\n            utils.getColor('linkedin'),\r\n            utils.getColor('github')\r\n          ]\r\n        }\r\n      ],\r\n\r\n      labels: ['Facebook', 'Youtube', 'Twitter', 'Linkedin', 'GitHub']\r\n    },\r\n    options: {\r\n      plugins: {\r\n        tooltip: chartJsDefaultTooltip()\r\n      },\r\n      maintainAspectRatio: false\r\n    }\r\n  });\r\n\r\n  chartJsInit(doughnut, getOptions);\r\n};\r\n\r\nexport default chartDoughnut;\r\n", "import utils from '../../utils';\r\nimport { chartJsDefaultTooltip, chartJsInit } from './chartjs-utils';\r\n\r\n/* -------------------------------------------------------------------------- */\r\n/*                            Chart Pie                                  */\r\n/* -------------------------------------------------------------------------- */\r\nconst chartPie = () => {\r\n  const pie = document.getElementById('chartjs-pie-chart');\r\n  const getOptions = () => ({\r\n    type: 'pie',\r\n    data: {\r\n      datasets: [\r\n        {\r\n          data: [5, 3, 2, 1, 1],\r\n          backgroundColor: [\r\n            utils.rgbaColor(utils.getColor('facebook'), 0.75),\r\n            utils.rgbaColor(utils.getColor('youtube'), 0.75),\r\n            utils.rgbaColor(utils.getColor('twitter'), 0.75),\r\n            utils.rgbaColor(utils.getColor('linkedin'), 0.75),\r\n            utils.rgbaColor(utils.getColor('github'), 0.75)\r\n          ],\r\n          borderWidth: 1,\r\n          borderColor: utils.getGrays()['100']\r\n        }\r\n      ],\r\n\r\n      labels: ['Facebook', 'Youtube', 'Twitter', 'Linkedin', 'GitHub']\r\n    },\r\n    options: {\r\n      plugins: {\r\n        tooltip: chartJsDefaultTooltip()\r\n      },\r\n      maintainAspectRatio: false\r\n    }\r\n  });\r\n\r\n  chartJsInit(pie, getOptions);\r\n};\r\n\r\nexport default chartPie;\r\n", "import utils from '../../utils';\r\nimport { chartJsDefaultTooltip, chartJsInit } from './chartjs-utils';\r\n\r\n/* -------------------------------------------------------------------------- */\r\n/*                            Chart Polar                                  */\r\n/* -------------------------------------------------------------------------- */\r\nconst chartPolar = () => {\r\n  const polar = document.getElementById('chartjs-polar-chart');\r\n\r\n  const getOptions = () => ({\r\n    type: 'polarArea',\r\n    data: {\r\n      datasets: [\r\n        {\r\n          data: [10, 20, 50, 40, 30],\r\n          backgroundColor: [\r\n            utils.rgbaColor(utils.getColor('facebook'), 0.5),\r\n            utils.rgbaColor(utils.getColor('youtube'), 0.5),\r\n            utils.rgbaColor(utils.getColor('twitter'), 0.5),\r\n            utils.rgbaColor(utils.getColor('linkedin'), 0.5),\r\n            utils.rgbaColor(utils.getColor('success'), 0.5)\r\n          ],\r\n          borderWidth: 1,\r\n          borderColor: utils.getGrays()['400']\r\n        }\r\n      ],\r\n\r\n      labels: ['Facebook', 'Youtube', 'Twitter', 'Linkedin', 'Medium']\r\n    },\r\n    options: {\r\n      plugins: {\r\n        tooltip: chartJsDefaultTooltip()\r\n      },\r\n      maintainAspectRatio: false,\r\n      scales: {\r\n        r: {\r\n          grid: {\r\n            color: utils.rgbaColor(utils.getGrays()['black'], 0.1)\r\n          }\r\n        }\r\n      }\r\n    }\r\n  });\r\n\r\n  chartJsInit(polar, getOptions);\r\n};\r\n\r\nexport default chartPolar;\r\n", "import utils from '../../utils';\r\nimport { chartJsDefaultTooltip, chartJsInit } from './chartjs-utils';\r\n\r\n/* -------------------------------------------------------------------------- */\r\n/*                            Chart Radar                                  */\r\n/* -------------------------------------------------------------------------- */\r\nconst chartRadar = () => {\r\n  const radar = document.getElementById('chartjs-radar-chart');\r\n\r\n  const getOptions = () => ({\r\n    type: 'radar',\r\n    data: {\r\n      labels: ['English', 'Maths', 'Physics', 'Chemistry', 'Biology', 'History'],\r\n      datasets: [\r\n        {\r\n          label: 'Student A',\r\n          backgroundColor: utils.rgbaColor(utils.getColor('success'), 0.5),\r\n          data: [65, 75, 70, 80, 60, 80],\r\n          borderWidth: 1\r\n        },\r\n        {\r\n          label: 'Student B',\r\n          backgroundColor: utils.rgbaColor(utils.getColor('primary'), 0.5),\r\n          data: [54, 65, 60, 70, 70, 75],\r\n          borderWidth: 1\r\n        }\r\n      ]\r\n    },\r\n    options: {\r\n      plugins: {\r\n        tooltip: chartJsDefaultTooltip()\r\n      },\r\n      maintainAspectRatio: false,\r\n      scales: {\r\n        r: {\r\n          grid: {\r\n            color: utils.rgbaColor(utils.getGrays()['black'], 0.1)\r\n          }\r\n        }\r\n      }\r\n    }\r\n  });\r\n\r\n  chartJsInit(radar, getOptions);\r\n};\r\n\r\nexport default chartRadar;\r\n", "import utils from '../../utils';\r\nimport { chartJsDefaultTooltip, chartJsInit } from './chartjs-utils';\r\n\r\n/* -------------------------------------------------------------------------- */\r\n/*                            Chart Combo                                  */\r\n/* -------------------------------------------------------------------------- */\r\nconst chartCombo = () => {\r\n  const combo = document.getElementById('chartjs-combo-chart');\r\n\r\n  const getOptions = () => ({\r\n    type: 'bar',\r\n    data: {\r\n      labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],\r\n      datasets: [\r\n        {\r\n          type: 'line',\r\n          label: 'Dataset 1',\r\n          borderColor: utils.getColor('primary'),\r\n          borderWidth: 2,\r\n          fill: false,\r\n          data: [55, 80, -60, -22, -50, 40, 90]\r\n        },\r\n        {\r\n          type: 'bar',\r\n          label: 'Dataset 2',\r\n          backgroundColor: utils.getSoftColors()['danger'],\r\n          data: [4, -80, 90, -22, 70, 35, -50],\r\n          borderWidth: 1\r\n        },\r\n        {\r\n          type: 'bar',\r\n          label: 'Dataset 3',\r\n          backgroundColor: utils.getSoftColors()['primary'],\r\n          data: [-30, 30, -18, 100, -45, -25, -50],\r\n          borderWidth: 1\r\n        }\r\n      ]\r\n    },\r\n    options: {\r\n      maintainAspectRatio: false,\r\n      plugins: {\r\n        tooltip: chartJsDefaultTooltip()\r\n      },\r\n      scales: {\r\n        x: {\r\n          grid: {\r\n            color: utils.rgbaColor(utils.getGrays()['black'], 0.1)\r\n          }\r\n        },\r\n        y: {\r\n          grid: {\r\n            color: utils.rgbaColor(utils.getGrays()['black'], 0.1)\r\n          }\r\n        }\r\n      }\r\n    }\r\n  });\r\n\r\n  chartJsInit(combo, getOptions);\r\n};\r\n\r\nexport default chartCombo;\r\n", "/* eslint-disable */\r\nimport utils from '../../utils';\r\nimport { chartJsDefaultTooltip, chartJsInit, getBubbleDataset } from './chartjs-utils';\r\n/* -------------------------------------------------------------------------- */\r\n/*                            Chart Bubble                                    */\r\n/* -------------------------------------------------------------------------- */\r\n\r\nconst chartBubble = () => {\r\n  const pie = document.getElementById('chartjs-bubble-chart');\r\n  const getOptions = () => ({\r\n    type: 'bubble',\r\n    data: {\r\n      datasets: [\r\n        {\r\n          label: 'Dataset 1',\r\n          data: getBubbleDataset(5, 5, 15, 0, 100),\r\n          backgroundColor: utils.getSoftColors()['primary'],\r\n          hoverBackgroundColor: utils.getColors()['primary']\r\n        },\r\n        {\r\n          label: 'Dataset 2',\r\n          data: getBubbleDataset(5, 5, 15, 0, 100),\r\n          backgroundColor: utils.getSoftColors()['success'],\r\n          hoverBackgroundColor: utils.getColors()['success']\r\n        },\r\n        {\r\n          label: 'Dataset 3',\r\n          data: getBubbleDataset(5, 5, 15, 0, 100),\r\n          backgroundColor: utils.getSoftColors()['danger'],\r\n          hoverBackgroundColor: utils.getColors()['danger']\r\n        }\r\n      ]\r\n    },\r\n    options: {\r\n      plugins: {\r\n        legend: {\r\n          position: 'top'\r\n        },\r\n        tooltip: chartJsDefaultTooltip()\r\n      },\r\n      scales: {\r\n        x: {\r\n          grid: {\r\n            color: utils.rgbaColor(utils.getGrays()['black'], 0.1)\r\n          }\r\n        },\r\n        y: {\r\n          grid: {\r\n            color: utils.rgbaColor(utils.getGrays()['black'], 0.1)\r\n          }\r\n        }\r\n      }\r\n    }\r\n  });\r\n\r\n  chartJsInit(pie, getOptions);\r\n};\r\n\r\nexport default chartBubble;\r\n", "/*-----------------------------------------------\r\n|   Dashboard Table dropdown\r\n-----------------------------------------------*/\r\nconst dropdownMenuInit = () => {\r\n  // Only for ios\r\n  /*\r\n  if (window.is.ios()) {\r\n    const Event = {\r\n      SHOWN_BS_DROPDOWN: 'shown.bs.dropdown',\r\n      HIDDEN_BS_DROPDOWN: 'hidden.bs.dropdown',\r\n    };\r\n    const Selector = {\r\n      TABLE_RESPONSIVE: '.table-responsive',\r\n      DROPDOWN_MENU: '.dropdown-menu',\r\n    };\r\n    document.querySelectorAll(Selector.TABLE_RESPONSIVE).forEach(table => {\r\n      table.addEventListener(Event.SHOWN_BS_DROPDOWN, e => {\r\n        const t = e.currentTarget;\r\n        if (t.scrollWidth > t.clientWidth) {\r\n          t.style.paddingBottom = e.target.nextElementSibling.clientHeight + 'px';\r\n        }\r\n      })\r\n      table.addEventListener(Event.HIDDEN_BS_DROPDOWN, e => {\r\n        e.currentTarget.style.paddingBottom = '';\r\n      })\r\n\r\n    })\r\n  }\r\n  */\r\n}\r\n\r\n// Reference\r\n// https://github.com/twbs/bootstrap/issues/11037#issuecomment-274870381\r\n\r\nexport default dropdownMenuInit;\r\n", "import utils from '../../utils';\r\nimport { getPosition, echartSetOption } from './echarts-utils';\r\n\r\n/* -------------------------------------------------------------------------- */\r\n/*                                Audience Chart                              */\r\n/* -------------------------------------------------------------------------- */\r\n\r\nconst audienceChartInit = () => {\r\n  const data = {\r\n    dates: utils.getPastDates(7),\r\n    dataset: {\r\n      users: [\r\n        [504, 333, 400, 606, 451, 685, 404],\r\n        [237, 229, 707, 575, 420, 536, 258],\r\n      ],\r\n      sessions: [\r\n        [322, 694, 235, 537, 791, 292, 806],\r\n        [584, 661, 214, 286, 526, 707, 627],\r\n      ],\r\n      rate: [\r\n        [789, 749, 412, 697, 633, 254, 472],\r\n        [276, 739, 525, 394, 643, 653, 719],\r\n      ],\r\n      duration: [\r\n        [625, 269, 479, 654, 549, 305, 671],\r\n        [499, 670, 550, 222, 696, 695, 469],\r\n      ],\r\n    },\r\n  };\r\n  const tooltipFormatter = params => {\r\n    const percentage =\r\n      ((params[0].value - params[1].value) / params[1].value) * 100;\r\n    const perTemp = `\r\n      <div class=\"d-flex align-items-center ms-2\">\r\n        <span class=\"fas fa-caret-${percentage < 0 ? 'down' : 'up'} text-${\r\n      percentage < 0 ? 'danger' : 'success'\r\n    }\"></span>\r\n        <h6 class=\"fs--2 mb-0 ms-1 fw-semi-bold\">${Math.abs(percentage).toFixed(\r\n          2\r\n        )} %</h6>\r\n      </div>\r\n    `;\r\n    const currentDate = new Date(params[0].axisValue);\r\n    const prevDate = new Date(new Date().setDate(currentDate.getDate() - 7));\r\n    return `<div>\r\n          <p class='mb-0 fs--2 text-600'>${window\r\n            .dayjs(params[0].axisValue)\r\n            .format('MMM DD')} vs ${window.dayjs(prevDate).format('MMM DD')}</p>\r\n          <div class=\"d-flex align-items-center\">\r\n            <p class='mb-0 text-600 fs--1'>\r\n              Users: <span class='text-800 fw-semi-bold fs--1'>${\r\n                params[0].data\r\n              }</span>\r\n            </p>\r\n            ${perTemp}\r\n          </div>\r\n        </div>`;\r\n  };\r\n\r\n  const getDefaultOptions = (data1, data2) => () => ({\r\n    color: utils.getGrays().white,\r\n    tooltip: {\r\n      trigger: 'axis',\r\n      padding: [7, 10],\r\n      backgroundColor: utils.getGrays()['100'],\r\n      borderColor: utils.getGrays()['300'],\r\n      textStyle: { color: utils.getColors().dark },\r\n      borderWidth: 1,\r\n      transitionDuration: 0,\r\n      position(pos, params, dom, rect, size) {\r\n        return getPosition(pos, params, dom, rect, size);\r\n      },\r\n      axisPointer: {\r\n        type: 'none',\r\n      },\r\n      formatter: tooltipFormatter,\r\n    },\r\n    xAxis: {\r\n      type: 'category',\r\n      data: data.dates,\r\n      axisLabel: {\r\n        color: utils.getGrays()['600'],\r\n        formatter: value => window.dayjs(value).format('MMM DD'),\r\n        align: 'left',\r\n        fontSize: 11,\r\n        padding: [0, 0, 0, 5],\r\n        showMaxLabel: false,\r\n      },\r\n      axisLine: {\r\n        lineStyle: {\r\n          color: utils.getGrays()['200'],\r\n        },\r\n      },\r\n      axisTick: {\r\n        show: true,\r\n        length: 20,\r\n        lineStyle: {\r\n          color: utils.getGrays()['200'],\r\n        },\r\n      },\r\n      boundaryGap: false,\r\n    },\r\n    yAxis: {\r\n      position: 'right',\r\n      axisPointer: { type: 'none' },\r\n      axisTick: 'none',\r\n      splitLine: {\r\n        lineStyle: {\r\n          color: utils.getGrays()['200'],\r\n        },\r\n      },\r\n      axisLine: { show: false },\r\n      axisLabel: { color: utils.getGrays()['600'] },\r\n    },\r\n    series: [\r\n      {\r\n        type: 'line',\r\n        data: data1,\r\n        showSymbol: false,\r\n        symbol: 'circle',\r\n        itemStyle: {\r\n          borderColor: utils.getColors().primary,\r\n          borderWidth: 2,\r\n        },\r\n        lineStyle: {\r\n          color: utils.getColor('primary'),\r\n        },\r\n        areaStyle: {\r\n          color: {\r\n            type: 'linear',\r\n            x: 0,\r\n            y: 0,\r\n            x2: 0,\r\n            y2: 1,\r\n            colorStops: [\r\n              {\r\n                offset: 0,\r\n                color: utils.rgbaColor(utils.getColors().primary, 0.2),\r\n              },\r\n              {\r\n                offset: 1,\r\n                color: utils.rgbaColor(utils.getColors().primary, 0),\r\n              },\r\n            ],\r\n          },\r\n        },\r\n      },\r\n      {\r\n        type: 'line',\r\n        data: data2,\r\n        symbol: 'none',\r\n        lineStyle: {\r\n          type: 'dashed',\r\n          width: 1,\r\n          color: utils.getColor('info'),\r\n        },\r\n      },\r\n    ],\r\n    grid: { right: '40px', left: '5px', bottom: '10%', top: '3%' },\r\n  });\r\n\r\n  const initChart = (el, options) => {\r\n    const userOptions = utils.getData(el, 'options');\r\n    const chart = window.echarts.init(el);\r\n    echartSetOption(chart, userOptions, options);\r\n  };\r\n\r\n  const tab = document.querySelector('#audience-chart-tab');\r\n\r\n  if (tab) {\r\n    initChart(\r\n      document.querySelector('.echart-audience'),\r\n      getDefaultOptions(data.dataset.users[0], data.dataset.users[1])\r\n    );\r\n\r\n    const triggerTabList = Array.from(\r\n      tab.querySelectorAll('[data-bs-toggle=\"tab\"]')\r\n    );\r\n    triggerTabList.forEach(function (triggerEl) {\r\n      triggerEl.addEventListener('shown.bs.tab', function () {\r\n        const key = triggerEl.href.split('#').pop();\r\n        const $echartAudience = document\r\n          .getElementById(key)\r\n          .querySelector('.echart-audience');\r\n\r\n        initChart(\r\n          $echartAudience,\r\n          getDefaultOptions(data.dataset[key][0], data.dataset[key][1])\r\n        );\r\n      });\r\n    });\r\n  }\r\n};\r\n\r\nexport default audienceChartInit;\r\n", "import utils from '../../utils';\r\nimport { getPosition, echartSetOption } from './echarts-utils';\r\n\r\n/* -------------------------------------------------------------------------- */\r\n/*                                Session By Device                           */\r\n/* -------------------------------------------------------------------------- */\r\n\r\nconst sessionByBrowserChartInit = () => {\r\n  const $sessionByBroswser = document.querySelector(\r\n    '.echart-session-by-browser'\r\n  );\r\n\r\n  if ($sessionByBroswser) {\r\n    const userOptions = utils.getData($sessionByBroswser, 'options');\r\n    const chart = window.echarts.init($sessionByBroswser);\r\n\r\n    const dataset = {\r\n      week: [\r\n        { value: 50.3, name: 'Chrome' },\r\n        { value: 20.6, name: 'Safari' },\r\n        { value: 30.1, name: 'Mozilla' },\r\n      ],\r\n      month: [\r\n        { value: 35.1, name: 'Chrome' },\r\n        { value: 25.6, name: 'Safari' },\r\n        { value: 40.3, name: 'Mozilla' },\r\n      ],\r\n      year: [\r\n        { value: 26.1, name: 'Chrome' },\r\n        { value: 10.6, name: 'Safari' },\r\n        { value: 64.3, name: 'Mozilla' },\r\n      ],\r\n    };\r\n\r\n    const getDefaultOptions = () => ({\r\n      color: [\r\n        utils.getColors().primary,\r\n        utils.getColors().success,\r\n        utils.getColors().info,\r\n      ],\r\n      tooltip: {\r\n        trigger: 'item',\r\n        padding: [7, 10],\r\n        backgroundColor: utils.getGrays()['100'],\r\n        borderColor: utils.getGrays()['300'],\r\n        textStyle: { color: utils.getColors().dark },\r\n        borderWidth: 1,\r\n        transitionDuration: 0,\r\n        formatter: params =>\r\n          `<strong>${params.data.name}:</strong> ${params.data.value}%`,\r\n        position(pos, params, dom, rect, size) {\r\n          return getPosition(pos, params, dom, rect, size);\r\n        },\r\n      },\r\n\r\n      legend: { show: false },\r\n      series: [\r\n        {\r\n          type: 'pie',\r\n          radius: ['100%', '65%'],\r\n          avoidLabelOverlap: false,\r\n          hoverAnimation: false,\r\n          itemStyle: {\r\n            borderWidth: 2,\r\n            borderColor: utils.getColor('card-bg'),\r\n          },\r\n          label: {\r\n            normal: {\r\n              show: false,\r\n            },\r\n            emphasis: {\r\n              show: false,\r\n            },\r\n          },\r\n          labelLine: { normal: { show: false } },\r\n          data: dataset.week,\r\n        },\r\n      ],\r\n    });\r\n\r\n    echartSetOption(chart, userOptions, getDefaultOptions);\r\n\r\n    const selectMenu = document.querySelector(\r\n      \"[data-target='.echart-session-by-browser']\"\r\n    );\r\n\r\n    if (selectMenu) {\r\n      selectMenu.addEventListener('change', e => {\r\n        const value = e.currentTarget.value;\r\n        chart.setOption({\r\n          series: [{ data: dataset[value] }],\r\n        });\r\n      });\r\n    }\r\n  }\r\n};\r\n\r\nexport default sessionByBrowserChartInit;\r\n", "import utils from '../../utils';\r\nimport { getPosition, echartSetOption } from './echarts-utils';\r\n\r\n/* -------------------------------------------------------------------------- */\r\n/*                                Session By Country                          */\r\n/* -------------------------------------------------------------------------- */\r\n\r\nconst sessionByCountryChartInit = () => {\r\n  const $sessionByCountry = document.querySelector(\r\n    '.echart-session-by-country'\r\n  );\r\n\r\n  const data = [\r\n    ['CHINA', 'INDIA', 'USA', 'IRAN', 'BRAZIL', 'PAKISTAN'],\r\n    [19.53, 17.32, 4.49, 3.46, 2.8, 1.7],\r\n  ];\r\n\r\n  if ($sessionByCountry) {\r\n    const userOptions = utils.getData($sessionByCountry, 'options');\r\n    const chart = window.echarts.init($sessionByCountry);\r\n\r\n    const getDefaultOptions = () => ({\r\n      tooltip: {\r\n        trigger: 'axis',\r\n        padding: [7, 10],\r\n        axisPointer: {\r\n          type: 'none',\r\n        },\r\n        backgroundColor: utils.getGrays()['100'],\r\n        borderColor: utils.getGrays()['300'],\r\n        textStyle: { color: utils.getColors().dark },\r\n        borderWidth: 1,\r\n        transitionDuration: 0,\r\n        position(pos, params, dom, rect, size) {\r\n          return getPosition(pos, params, dom, rect, size);\r\n        },\r\n        // formatter: tooltipFormatter\r\n      },\r\n      xAxis: {\r\n        type: 'category',\r\n        data: data[0],\r\n        axisLabel: {\r\n          color: utils.getGrays()['600'],\r\n          formatter: value => value.substring(0, 3),\r\n        },\r\n        axisLine: {\r\n          lineStyle: {\r\n            color: utils.getGrays()['400'],\r\n          },\r\n        },\r\n        axisTick: {\r\n          show: true,\r\n          // length: 8,\r\n          alignWithLabel: true,\r\n          lineStyle: {\r\n            color: utils.getGrays()['200'],\r\n          },\r\n        },\r\n      },\r\n      yAxis: {\r\n        type: 'value',\r\n        // inverse: true,\r\n        axisTick: {\r\n          show: false,\r\n        },\r\n        splitLine: {\r\n          lineStyle: {\r\n            color: utils.getGrays()['300'],\r\n            type: 'dashed',\r\n          },\r\n        },\r\n        axisLabel: {\r\n          color: utils.getGrays()['600'],\r\n          formatter: value => `${value}%`,\r\n          fontWeight: 500,\r\n          padding: [3, 0, 0, 0],\r\n          margin: 12,\r\n        },\r\n        axisLine: {\r\n          show: false,\r\n        },\r\n      },\r\n      series: [\r\n        {\r\n          type: 'bar',\r\n          data: data[1],\r\n          itemStyle: {\r\n            barBorderRadius: [3, 3, 0, 0],\r\n            color: utils.getColors().primary,\r\n          },\r\n          barWidth: 15,\r\n        },\r\n      ],\r\n      grid: { right: '12px', left: '40px', bottom: '10%', top: '16px' },\r\n    });\r\n\r\n    echartSetOption(chart, userOptions, getDefaultOptions);\r\n  }\r\n};\r\n\r\nexport default sessionByCountryChartInit;\r\n", "import utils from '../../utils';\r\nimport { getPosition, echartSetOption } from './echarts-utils';\r\n\r\n/* -------------------------------------------------------------------------- */\r\n/*                             Echarts Active Users                           */\r\n/* -------------------------------------------------------------------------- */\r\n\r\nconst activeUsersChartReportInit = () => {\r\n  const $echartsActiveUsersChart = document.querySelector(\r\n    '.echart-active-users-report'\r\n  );\r\n\r\n  if ($echartsActiveUsersChart) {\r\n    const userOptions = utils.getData($echartsActiveUsersChart, 'options');\r\n    const chart = window.echarts.init($echartsActiveUsersChart);\r\n\r\n    const tooltipFormatter = params => {\r\n      return `\r\n      <div>\r\n        <p class='mb-2 text-600'>${window\r\n          .dayjs(params[0].axisValue)\r\n          .format('MMM DD, YYYY')}</p>\r\n        <div class='ms-1'>\r\n          <h6 class=\"fs--1 text-700\"><span class=\"fas fa-circle text-primary me-2\"></span>${\r\n            params[0].value\r\n          }</h6>\r\n          <h6 class=\"fs--1 text-700\"><span class=\"fas fa-circle text-success me-2\"></span>${\r\n            params[1].value\r\n          }</h6>\r\n          <h6 class=\"fs--1 text-700\"><span class=\"fas fa-circle text-info me-2\"></span>${\r\n            params[2].value\r\n          }</h6>\r\n        </div>\r\n      </div>\r\n      `;\r\n    };\r\n    const getDefaultOptions = () => ({\r\n      color: [\r\n        utils.getColor('primary'),\r\n        utils.getColor('success'),\r\n        utils.getColor('info'),\r\n      ],\r\n      tooltip: {\r\n        trigger: 'axis',\r\n        padding: [7, 10],\r\n        backgroundColor: utils.getGrays()['100'],\r\n        borderColor: utils.getGrays()['300'],\r\n        textStyle: { color: utils.getColors().dark },\r\n        borderWidth: 1,\r\n        transitionDuration: 0,\r\n        position(pos, params, dom, rect, size) {\r\n          return getPosition(pos, params, dom, rect, size);\r\n        },\r\n        formatter: tooltipFormatter,\r\n      },\r\n      xAxis: {\r\n        type: 'category',\r\n        data: utils\r\n          .getPastDates(30)\r\n          .map(date => window.dayjs(date).format('DD MMM, YYYY')),\r\n        boundaryGap: false,\r\n        silent: true,\r\n        axisPointer: {\r\n          lineStyle: {\r\n            color: utils.getGrays()['300'],\r\n          },\r\n        },\r\n        splitLine: { show: false },\r\n        axisLine: {\r\n          lineStyle: {\r\n            color: utils.getGrays()['300'],\r\n          },\r\n        },\r\n        axisTick: {\r\n          show: true,\r\n          length: 20,\r\n          lineStyle: {\r\n            color: utils.getGrays()['200'],\r\n          },\r\n\r\n          interval: 5,\r\n        },\r\n        axisLabel: {\r\n          color: utils.getGrays()['600'],\r\n          formatter: value => window.dayjs(value).format('MMM DD'),\r\n          align: 'left',\r\n          fontSize: 11,\r\n          padding: [0, 0, 0, 5],\r\n          interval: 5,\r\n        },\r\n      },\r\n      yAxis: {\r\n        type: 'value',\r\n        position: 'right',\r\n        axisPointer: { show: false },\r\n        splitLine: {\r\n          lineStyle: {\r\n            color: utils.getGrays()['200'],\r\n          },\r\n        },\r\n        axisLabel: {\r\n          show: true,\r\n          color: utils.getGrays()['600'],\r\n          formatter: value => `${Math.round((value / 1000) * 10) / 10}k`,\r\n        },\r\n        axisTick: { show: false },\r\n        axisLine: { show: false },\r\n      },\r\n      series: [\r\n        {\r\n          type: 'line',\r\n          data: [\r\n            4164, 4652, 4817, 4841, 4920, 5439, 5486, 5498, 5512, 5538, 5841,\r\n            5877, 6086, 6146, 6199, 6431, 6704, 7939, 8127, 8296, 8322, 8389,\r\n            8411, 8502, 8868, 8977, 9273, 9325, 9345, 9430,\r\n          ],\r\n          showSymbol: false,\r\n          symbol: 'circle',\r\n          itemStyle: {\r\n            borderColor: utils.getColors().primary,\r\n            borderWidth: 2,\r\n          },\r\n          lineStyle: {\r\n            color: utils.getColor('primary'),\r\n          },\r\n          symbolSize: 2,\r\n        },\r\n        {\r\n          type: 'line',\r\n          data: [\r\n            2164, 2292, 2386, 2430, 2528, 3045, 3255, 3295, 3481, 3604, 3688,\r\n            3840, 3932, 3949, 4003, 4298, 4424, 4869, 4922, 4973, 5155, 5267,\r\n            5566, 5689, 5692, 5758, 5773, 5799, 5960, 6000,\r\n          ],\r\n          showSymbol: false,\r\n          symbol: 'circle',\r\n          itemStyle: {\r\n            borderColor: utils.getColors().success,\r\n            borderWidth: 2,\r\n          },\r\n          lineStyle: {\r\n            color: utils.getColor('success'),\r\n          },\r\n          symbolSize: 2,\r\n        },\r\n        {\r\n          type: 'line',\r\n          data: [\r\n            1069, 1089, 1125, 1141, 1162, 1179, 1185, 1216, 1274, 1322, 1346,\r\n            1395, 1439, 1564, 1581, 1590, 1656, 1815, 1868, 2010, 2133, 2179,\r\n            2264, 2265, 2278, 2343, 2354, 2456, 2472, 2480,\r\n          ],\r\n          showSymbol: false,\r\n          symbol: 'circle',\r\n          itemStyle: {\r\n            borderColor: utils.getColors().info,\r\n            borderWidth: 2,\r\n          },\r\n          lineStyle: {\r\n            color: utils.getColor('info'),\r\n          },\r\n          symbolSize: 2,\r\n        },\r\n      ],\r\n      grid: { right: '30px', left: '5px', bottom: '20px', top: '20px' },\r\n    });\r\n\r\n    echartSetOption(chart, userOptions, getDefaultOptions);\r\n  }\r\n};\r\n\r\nexport default activeUsersChartReportInit;\r\n", "import utils from '../../utils';\r\nimport { getPosition, echartSetOption, tooltipFormatter } from './echarts-utils';\r\n\r\n/* -------------------------------------------------------------------------- */\r\n/*                                Traffic Channels                           */\r\n/* -------------------------------------------------------------------------- */\r\n\r\nconst trafficChannelChartInit = () => {\r\n  const $trafficChannels = document.querySelector('.echart-traffic-channels');\r\n\r\n  if ($trafficChannels) {\r\n    const userOptions = utils.getData($trafficChannels, 'options');\r\n    const chart = window.echarts.init($trafficChannels);\r\n\r\n    const getDefaultOptions = () => ({\r\n      color: [\r\n        utils.getColors().primary,\r\n        utils.rgbaColor(utils.getColors().primary, 0.8),\r\n        utils.rgbaColor(utils.getColors().primary, 0.6),\r\n        utils.rgbaColor(utils.getColors().primary, 0.4),\r\n        utils.rgbaColor(utils.getColors().primary, 0.2)\r\n      ],\r\n      legend: {\r\n        data: ['Display', 'Direct', 'Organic Search', 'Paid Search', 'Other'],\r\n        left: 5,\r\n        // bottom: 10,\r\n        itemWidth: 10,\r\n        itemHeight: 10,\r\n        borderRadius: 0,\r\n        icon: 'circle',\r\n        inactiveColor: utils.getGrays()['400'],\r\n        textStyle: { color: utils.getGrays()['700'] },\r\n        itemGap: 20\r\n      },\r\n      xAxis: {\r\n        type: 'category',\r\n        data: utils.getPastDates(7).map(date => window.dayjs(date).format('DD MMM, YYYY')),\r\n        axisLine: {\r\n          show: false\r\n        },\r\n        splitLine: {\r\n          lineStyle: {\r\n            color: utils.getGrays()['200']\r\n          }\r\n        },\r\n        axisTick: {\r\n          show: false\r\n        },\r\n        axisLabel: {\r\n          color: utils.getGrays()['600'],\r\n          formatter: value => window.dayjs(value).format('ddd')\r\n        }\r\n      },\r\n      yAxis: {\r\n        type: 'value',\r\n        position: 'right',\r\n        splitLine: {\r\n          lineStyle: {\r\n            color: utils.getGrays()['200']\r\n          }\r\n        },\r\n        axisLine: {\r\n          show: false\r\n        },\r\n        axisTick: {\r\n          show: false\r\n        },\r\n        axisLabel: {\r\n          show: true,\r\n          color: utils.getGrays()['600'],\r\n          margin: 15\r\n        }\r\n      },\r\n      tooltip: {\r\n        trigger: 'axis',\r\n        padding: [7, 10],\r\n        axisPointer: {\r\n          type: 'none'\r\n        },\r\n        backgroundColor: utils.getGrays()['100'],\r\n        borderColor: utils.getGrays()['300'],\r\n        textStyle: { color: utils.getColors().dark },\r\n        borderWidth: 1,\r\n        transitionDuration: 0,\r\n        position(pos, params, dom, rect, size) {\r\n          return getPosition(pos, params, dom, rect, size);\r\n        },\r\n        formatter: tooltipFormatter\r\n      },\r\n\r\n      series: [\r\n        {\r\n          name: 'Display',\r\n          type: 'bar',\r\n          stack: 'total',\r\n          data: [320, 302, 301, 334, 390, 330, 320]\r\n        },\r\n        {\r\n          name: 'Direct',\r\n          type: 'bar',\r\n          stack: 'total',\r\n          data: [120, 132, 101, 134, 90, 230, 210]\r\n        },\r\n        {\r\n          name: 'Organic Search',\r\n          type: 'bar',\r\n          stack: 'total',\r\n          data: [220, 182, 191, 234, 290, 330, 310]\r\n        },\r\n        {\r\n          name: 'Paid Search',\r\n          type: 'bar',\r\n          stack: 'total',\r\n          data: [150, 212, 201, 154, 190, 330, 410]\r\n        },\r\n        {\r\n          name: 'Other',\r\n          type: 'bar',\r\n          stack: 'total',\r\n          data: [820, 832, 901, 934, 1290, 1330, 1320],\r\n          itemStyle: {\r\n            barBorderRadius: [5, 5, 0, 0]\r\n          }\r\n        }\r\n      ],\r\n\r\n      grid: {\r\n        right: '50px',\r\n        left: '0px',\r\n        bottom: '10%',\r\n        top: '15%'\r\n      }\r\n    });\r\n\r\n    echartSetOption(chart, userOptions, getDefaultOptions);\r\n  }\r\n};\r\n\r\nexport default trafficChannelChartInit;\r\n", "import utils from '../../utils';\r\nimport { getPosition, echartSetOption } from './echarts-utils';\r\n\r\n/* -------------------------------------------------------------------------- */\r\n/*                             Echarts Bounce Rate                            */\r\n/* -------------------------------------------------------------------------- */\r\n\r\nconst bounceRateChartInit = () => {\r\n  const $echartsBounceRateChart = document.querySelector('.echart-bounce-rate');\r\n\r\n  const tooltipFormatter = params => {\r\n    return `<div>\r\n          <p class='mb-0 text-600'>${window\r\n            .dayjs(params[0].axisValue)\r\n            .format('DD, MMMM')}</p>\r\n          <div class=\"d-flex align-items-center\">\r\n            <p class=\"mb-0 text-600\">\r\n              Rate : <span class='text-800'>${params[0].value}%</span>\r\n            </p>\r\n          </div>\r\n        </div>`;\r\n  };\r\n\r\n  const dataset = {\r\n    week: [41, 45, 37, 44, 35, 39, 43],\r\n    month: [\r\n      40, 37, 42, 44, 36, 39, 37, 43, 38, 35, 43, 39, 42, 36, 37, 36, 42, 44,\r\n      34, 41, 37, 41, 40, 40, 43, 34, 41, 35, 44, 41, 40,\r\n    ],\r\n  };\r\n\r\n  if ($echartsBounceRateChart) {\r\n    const userOptions = utils.getData($echartsBounceRateChart, 'options');\r\n    const chart = window.echarts.init($echartsBounceRateChart);\r\n\r\n    const getDefaultOptions = () => ({\r\n      color: utils.getGrays().white,\r\n      title: {\r\n        text: 'Bounce Rate',\r\n        padding: [5, 0, 0, 0],\r\n        textStyle: {\r\n          color: utils.getGrays()['900'],\r\n          fontSize: 13,\r\n          fontWeight: 600,\r\n        },\r\n      },\r\n      tooltip: {\r\n        trigger: 'axis',\r\n        axisPointer: {\r\n          type: 'none',\r\n        },\r\n        padding: [7, 10],\r\n        backgroundColor: utils.getGrays()['100'],\r\n        borderColor: utils.getGrays()['300'],\r\n        textStyle: { color: utils.getColors().dark },\r\n        borderWidth: 1,\r\n        transitionDuration: 0,\r\n        position(pos, params, dom, rect, size) {\r\n          return getPosition(pos, params, dom, rect, size);\r\n        },\r\n        formatter: tooltipFormatter,\r\n      },\r\n      xAxis: {\r\n        type: 'category',\r\n        data: utils\r\n          .getPastDates(30)\r\n          .map(date => window.dayjs(date).format('DD MMM, YYYY')),\r\n        axisPointer: {\r\n          lineStyle: {\r\n            color: utils.getGrays()['300'],\r\n          },\r\n        },\r\n        splitLine: { show: false },\r\n        axisLine: {\r\n          lineStyle: {\r\n            color: utils.getGrays()['400'],\r\n          },\r\n        },\r\n        axisTick: {\r\n          show: false,\r\n        },\r\n        axisLabel: {\r\n          color: utils.getGrays()['600'],\r\n          formatter: value => window.dayjs(value).format('MMM DD'),\r\n          fontSize: 11,\r\n        },\r\n      },\r\n      yAxis: {\r\n        type: 'value',\r\n        axisPointer: { show: false },\r\n        splitLine: {\r\n          lineStyle: {\r\n            color: utils.getGrays()['200'],\r\n          },\r\n        },\r\n        axisLabel: {\r\n          show: true,\r\n          color: utils.getGrays()['600'],\r\n          formatter: value => `${value}%`,\r\n          margin: 15,\r\n        },\r\n        axisTick: { show: false },\r\n        axisLine: { show: false },\r\n      },\r\n      series: [\r\n        {\r\n          type: 'line',\r\n          data: [\r\n            40, 37, 42, 44, 36, 39, 37, 43, 38, 35, 43, 39, 42, 36, 37, 36, 42,\r\n            44, 34, 41, 37, 41, 40, 40, 43, 34, 41, 35, 44, 41, 40,\r\n          ],\r\n          showSymbol: false,\r\n          symbol: 'circle',\r\n          itemStyle: {\r\n            borderColor: utils.getColors().primary,\r\n            borderWidth: 2,\r\n          },\r\n          lineStyle: {\r\n            color: utils.getColor('primary'),\r\n          },\r\n          symbolSize: 2,\r\n        },\r\n      ],\r\n      grid: { right: '10px', left: '40px', bottom: '10%', top: '13%' },\r\n    });\r\n\r\n    echartSetOption(chart, userOptions, getDefaultOptions);\r\n\r\n    const selectMenu = document.querySelector(\r\n      \"[data-target='.echart-bounce-rate']\"\r\n    );\r\n\r\n    if (selectMenu) {\r\n      selectMenu.addEventListener('change', e => {\r\n        const value = e.currentTarget.value;\r\n        chart.setOption({\r\n          xAxis: {\r\n            data: utils\r\n              .getPastDates(value)\r\n              .map(date => window.dayjs(date).format('DD MMM, YYYY')),\r\n          },\r\n          series: [{ data: dataset[value] }],\r\n        });\r\n      });\r\n    }\r\n  }\r\n};\r\n\r\nexport default bounceRateChartInit;\r\n", "import utils from '../../utils';\r\nimport { echartSetOption } from './echarts-utils';\r\n\r\n/* -------------------------------------------------------------------------- */\r\n/*                             Echarts Users By Time                          */\r\n/* -------------------------------------------------------------------------- */\r\n\r\nconst usersByTimeChartInit = () => {\r\n  const $echartUsersByTimeChart = document.querySelector(\r\n    '.echart-users-by-time'\r\n  );\r\n\r\n  const hours = [\r\n    '12 AM',\r\n    '1 AM',\r\n    '2 AM',\r\n    '3 AM',\r\n    '4 AM',\r\n    '5 AM',\r\n    '6 AM',\r\n    '7 AM',\r\n    '8 AM',\r\n    '9 AM',\r\n    '10 AM',\r\n    '11 AM',\r\n    '12 PM',\r\n    '1 PM',\r\n    '2 PM',\r\n    '3 PM',\r\n    '4 PM',\r\n    '5 PM',\r\n    '6 PM',\r\n    '7 PM',\r\n    '8 PM',\r\n    '9 PM',\r\n    '10 PM',\r\n    '11 PM',\r\n  ];\r\n\r\n  const data = [];\r\n  for (let i = 0; i < 24; i += 1) {\r\n    for (let j = 0; j < 7; j += 1) {\r\n      data.push([j, i, utils.getRandomNumber(20, 300)]);\r\n    }\r\n  }\r\n\r\n  const tooltipFormatter = params => {\r\n    return `<div>\r\n          <p class='mb-0 text-600'>${window\r\n            .dayjs(params.name)\r\n            .format('MMM DD, YYYY')}</p>\r\n          <div class=\"d-flex align-items-center\">\r\n            <p class=\"mb-0 text-600\">\r\n              ${window\r\n                .dayjs()\r\n                .hour(params.data[1])\r\n                .format('hA')} : <span class='text-800 fw-semi-bold'>${\r\n      params.data[2]\r\n    }</span>\r\n            </p>\r\n          </div>\r\n        </div>`;\r\n  };\r\n\r\n  if ($echartUsersByTimeChart) {\r\n    const userOptions = utils.getData($echartUsersByTimeChart, 'options');\r\n    const chart = window.echarts.init($echartUsersByTimeChart);\r\n\r\n    const getDefaultOptions = () => ({\r\n      gradientColor: [utils.getColor('info'), utils.getColor('primary')],\r\n      tooltip: {\r\n        position: 'top',\r\n        padding: [7, 10],\r\n        backgroundColor: utils.getGrays()['100'],\r\n        borderColor: utils.getGrays()['300'],\r\n        textStyle: { color: utils.getColors().dark },\r\n        borderWidth: 1,\r\n        formatter: tooltipFormatter,\r\n      },\r\n      xAxis: {\r\n        type: 'category',\r\n        data: utils.getPastDates(7),\r\n        splitArea: {\r\n          show: true,\r\n        },\r\n        axisTick: { show: false },\r\n        axisLabel: {\r\n          color: utils.getGrays()['600'],\r\n          formatter: value => window.dayjs(value).format('ddd'),\r\n        },\r\n        axisLine: {\r\n          lineStyle: {\r\n            color: utils.getGrays()['400'],\r\n          },\r\n        },\r\n      },\r\n      yAxis: {\r\n        position: 'right',\r\n        type: 'category',\r\n        inverse: true,\r\n        data: hours,\r\n        splitArea: {\r\n          show: true,\r\n        },\r\n        axisTick: { show: false },\r\n        axisLabel: {\r\n          color: utils.getGrays()['600'],\r\n          margin: 20,\r\n          padding: [10, 0, 0, 0],\r\n        },\r\n        axisLine: {\r\n          lineStyle: {\r\n            color: utils.getGrays()['400'],\r\n          },\r\n        },\r\n      },\r\n      visualMap: {\r\n        type: 'piecewise',\r\n        orient: 'horizontal',\r\n        left: 'left',\r\n        bottom: '3%',\r\n        itemSymbol: 'diamond',\r\n        itemWidth: '10px',\r\n        itemHeight: '10px',\r\n        min: 20,\r\n        max: 300,\r\n        splitNumber: 4,\r\n        textGap: 5,\r\n        textStyle: {\r\n          color: utils.getGrays()['600'],\r\n          fontWeight: 500,\r\n        },\r\n      },\r\n      series: [\r\n        {\r\n          name: 'Users By Time',\r\n          type: 'heatmap',\r\n          data: data,\r\n          label: {\r\n            show: false,\r\n          },\r\n          itemStyle: {\r\n            borderColor: utils.getColor('white'),\r\n            borderWidth: 3,\r\n          },\r\n          emphasis: {\r\n            itemStyle: {\r\n              shadowBlur: 3,\r\n              shadowColor: utils.rgbaColor(utils.getGrays()['black'], 0.5),\r\n            },\r\n          },\r\n        },\r\n      ],\r\n      grid: { right: '60px', left: '0px', bottom: '20%', top: '0%' },\r\n    });\r\n\r\n    echartSetOption(chart, userOptions, getDefaultOptions);\r\n  }\r\n};\r\n\r\nexport default usersByTimeChartInit;\r\n", "import utils from '../../utils';\r\nimport { echartSetOption } from './echarts-utils';\r\n\r\n/* -------------------------------------------------------------------------- */\r\n/*                                Session By Country Map                      */\r\n/* -------------------------------------------------------------------------- */\r\n\r\nconst sessionByCountryMapInit = () => {\r\n  const $sessionByCountryMap = document.querySelector('.echart-session-by-country-map');\r\n\r\n  const data = [\r\n    { name: 'Afghanistan', value: 28397.812 },\r\n    { name: 'Angola', value: 19549.124 },\r\n    { name: 'Albania', value: 3150.143 },\r\n    { name: 'United Arab Emirates', value: 8441.537 },\r\n    { name: 'Argentina', value: 40374.224 },\r\n    { name: 'Armenia', value: 2963.496 },\r\n    { name: 'French Southern and Antarctic Lands', value: 268.065 },\r\n    { name: 'Australia', value: 22404.488 },\r\n    { name: 'Austria', value: 8401.924 },\r\n    { name: 'Azerbaijan', value: 9094.718 },\r\n    { name: 'Burundi', value: 9232.753 },\r\n    { name: 'Belgium', value: 10941.288 },\r\n    { name: 'Benin', value: 9509.798 },\r\n    { name: 'Burkina Faso', value: 15540.284 },\r\n    { name: 'Bangladesh', value: 151125.475 },\r\n    { name: 'Bulgaria', value: 7389.175 },\r\n    { name: 'The Bahamas', value: 66402.316 },\r\n    { name: 'Bosnia and Herzegovina', value: 3845.929 },\r\n    { name: 'Belarus', value: 9491.07 },\r\n    { name: 'Belize', value: 308.595 },\r\n    { name: 'Bermuda', value: 64.951 },\r\n    { name: 'Bolivia', value: 716.939 },\r\n    { name: 'Brazil', value: 195210.154 },\r\n    { name: 'Brunei', value: 27.223 },\r\n    { name: 'Bhutan', value: 716.939 },\r\n    { name: 'Botswana', value: 1969.341 },\r\n    { name: 'Central African Rep.', value: 4349.921 },\r\n    { name: 'Canada', value: 34126.24 },\r\n    { name: 'Switzerland', value: 7830.534 },\r\n    { name: 'Chile', value: 17150.76 },\r\n    { name: 'China', value: 1359821.465 },\r\n    { name: \"C\u00F4te d'Ivoire\", value: 60508.978 },\r\n    { name: 'Cameroon', value: 20624.343 },\r\n    { name: 'Dem. Rep. Congo', value: 62191.161 },\r\n    { name: 'Congo', value: 3573.024 },\r\n    { name: 'Colombia', value: 46444.798 },\r\n    { name: 'Costa Rica', value: 4669.685 },\r\n    { name: 'Cuba', value: 11281.768 },\r\n    { name: 'Northern Cyprus', value: 1.468 },\r\n    { name: 'Cyprus', value: 1103.685 },\r\n    { name: 'Czech Republic', value: 10553.701 },\r\n    { name: 'Germany', value: 83017.404 },\r\n    { name: 'Djibouti', value: 834.036 },\r\n    { name: 'Denmark', value: 5550.959 },\r\n    { name: 'Dominican Republic', value: 10016.797 },\r\n    { name: 'Algeria', value: 37062.82 },\r\n    { name: 'Ecuador', value: 15001.072 },\r\n    { name: 'Egypt', value: 78075.705 },\r\n    { name: 'Eritrea', value: 5741.159 },\r\n    { name: 'Spain', value: 46182.038 },\r\n    { name: 'Estonia', value: 1298.533 },\r\n    { name: 'Ethiopia', value: 87095.281 },\r\n    { name: 'Finland', value: 5367.693 },\r\n    { name: 'Fiji', value: 860.559 },\r\n    { name: 'Falkland Islands', value: 49.581 },\r\n    { name: 'France', value: 63230.866 },\r\n    { name: 'Gabon', value: 1556.222 },\r\n    { name: 'United Kingdom', value: 62066.35 },\r\n    { name: 'Georgia', value: 4388.674 },\r\n    { name: 'Ghana', value: 24262.901 },\r\n    { name: 'Eq. Guinea', value: 10876.033 },\r\n    { name: 'Guinea', value: 10876.033 },\r\n    { name: 'Gambia', value: 1680.64 },\r\n    { name: 'Guinea Bissau', value: 10876.033 },\r\n    { name: 'Equatorial Guinea', value: 696.167 },\r\n    { name: 'Greece', value: 11109.999 },\r\n    { name: 'Greenland', value: 56.546 },\r\n    { name: 'Guatemala', value: 14341.576 },\r\n    { name: 'French Guiana', value: 231.169 },\r\n    { name: 'Guyana', value: 786.126 },\r\n    { name: 'Honduras', value: 7621.204 },\r\n    { name: 'Croatia', value: 4338.027 },\r\n    { name: 'Haiti', value: 9896.4 },\r\n    { name: 'Hungary', value: 10014.633 },\r\n    { name: 'Indonesia', value: 240676.485 },\r\n    { name: 'India', value: 1205624.648 },\r\n    { name: 'Ireland', value: 4467.561 },\r\n    { name: 'Iran', value: 240676.485 },\r\n    { name: 'Iraq', value: 30962.38 },\r\n    { name: 'Iceland', value: 318.042 },\r\n    { name: 'Israel', value: 7420.368 },\r\n    { name: 'Italy', value: 60508.978 },\r\n    { name: 'Jamaica', value: 2741.485 },\r\n    { name: 'Jordan', value: 6454.554 },\r\n    { name: 'Japan', value: 127352.833 },\r\n    { name: 'Kazakhstan', value: 15921.127 },\r\n    { name: 'Kenya', value: 40909.194 },\r\n    { name: 'Kyrgyzstan', value: 5334.223 },\r\n    { name: 'Cambodia', value: 14364.931 },\r\n    { name: 'South Korea', value: 51452.352 },\r\n    { name: 'Kosovo', value: 97.743 },\r\n    { name: 'Kuwait', value: 2991.58 },\r\n    { name: 'Laos', value: 6395.713 },\r\n    { name: 'Lebanon', value: 4341.092 },\r\n    { name: 'Liberia', value: 3957.99 },\r\n    { name: 'Libya', value: 6040.612 },\r\n    { name: 'Sri Lanka', value: 20758.779 },\r\n    { name: 'Lesotho', value: 2008.921 },\r\n    { name: 'Lithuania', value: 3068.457 },\r\n    { name: 'Luxembourg', value: 507.885 },\r\n    { name: 'Latvia', value: 2090.519 },\r\n    { name: 'Morocco', value: 31642.36 },\r\n    { name: 'Moldova', value: 103.619 },\r\n    { name: 'Madagascar', value: 21079.532 },\r\n    { name: 'Mexico', value: 117886.404 },\r\n    { name: 'Macedonia', value: 507.885 },\r\n    { name: 'Mali', value: 13985.961 },\r\n    { name: 'Myanmar', value: 51931.231 },\r\n    { name: 'Montenegro', value: 620.078 },\r\n    { name: 'Mongolia', value: 2712.738 },\r\n    { name: 'Mozambique', value: 23967.265 },\r\n    { name: 'Mauritania', value: 3609.42 },\r\n    { name: 'Malawi', value: 15013.694 },\r\n    { name: 'Malaysia', value: 28275.835 },\r\n    { name: 'Namibia', value: 2178.967 },\r\n    { name: 'New Caledonia', value: 246.379 },\r\n    { name: 'Niger', value: 15893.746 },\r\n    { name: 'Nigeria', value: 159707.78 },\r\n    { name: 'Nicaragua', value: 5822.209 },\r\n    { name: 'Netherlands', value: 16615.243 },\r\n    { name: 'Norway', value: 4891.251 },\r\n    { name: 'Nepal', value: 26846.016 },\r\n    { name: 'New Zealand', value: 4368.136 },\r\n    { name: 'Oman', value: 2802.768 },\r\n    { name: 'Pakistan', value: 173149.306 },\r\n    { name: 'Panama', value: 3678.128 },\r\n    { name: 'Peru', value: 29262.83 },\r\n    { name: 'Philippines', value: 93444.322 },\r\n    { name: 'Papua New Guinea', value: 6858.945 },\r\n    { name: 'Poland', value: 38198.754 },\r\n    { name: 'Puerto Rico', value: 3709.671 },\r\n    { name: 'North Korea', value: 1.468 },\r\n    { name: 'Portugal', value: 10589.792 },\r\n    { name: 'Paraguay', value: 6459.721 },\r\n    { name: 'Qatar', value: 1749.713 },\r\n    { name: 'Romania', value: 21861.476 },\r\n    { name: 'Russia', value: 21861.476 },\r\n    { name: 'Rwanda', value: 10836.732 },\r\n    { name: 'Western Sahara', value: 514.648 },\r\n    { name: 'Saudi Arabia', value: 27258.387 },\r\n    { name: 'Sudan', value: 35652.002 },\r\n    { name: 'S. Sudan', value: 9940.929 },\r\n    { name: 'Senegal', value: 12950.564 },\r\n    { name: 'Solomon Islands', value: 526.447 },\r\n    { name: 'Sierra Leone', value: 5751.976 },\r\n    { name: 'El Salvador', value: 6218.195 },\r\n    { name: 'Somaliland', value: 9636.173 },\r\n    { name: 'Somalia', value: 9636.173 },\r\n    { name: 'Republic of Serbia', value: 3573.024 },\r\n    { name: 'Suriname', value: 524.96 },\r\n    { name: 'Slovakia', value: 5433.437 },\r\n    { name: 'Slovenia', value: 2054.232 },\r\n    { name: 'Sweden', value: 9382.297 },\r\n    { name: 'Swaziland', value: 1193.148 },\r\n    { name: 'Syria', value: 7830.534 },\r\n    { name: 'Chad', value: 11720.781 },\r\n    { name: 'Togo', value: 6306.014 },\r\n    { name: 'Thailand', value: 66402.316 },\r\n    { name: 'Tajikistan', value: 7627.326 },\r\n    { name: 'Turkmenistan', value: 5041.995 },\r\n    { name: 'East Timor', value: 10016.797 },\r\n    { name: 'Trinidad and Tobago', value: 1328.095 },\r\n    { name: 'Tunisia', value: 10631.83 },\r\n    { name: 'Turkey', value: 72137.546 },\r\n    { name: 'Tanzania', value: 44973.33 },\r\n    { name: 'Uganda', value: 33987.213 },\r\n    { name: 'Ukraine', value: 46050.22 },\r\n    { name: 'Uruguay', value: 3371.982 },\r\n    { name: 'United States', value: 312247.116 },\r\n    { name: 'Uzbekistan', value: 27769.27 },\r\n    { name: 'Venezuela', value: 236.299 },\r\n    { name: 'Vietnam', value: 89047.397 },\r\n    { name: 'Vanuatu', value: 236.299 },\r\n    { name: 'West Bank', value: 13.565 },\r\n    { name: 'Yemen', value: 22763.008 },\r\n    { name: 'South Africa', value: 51452.352 },\r\n    { name: 'Zambia', value: 13216.985 },\r\n    { name: 'Zimbabwe', value: 13076.978 }\r\n  ];\r\n\r\n  const total = 6961500;\r\n\r\n  if ($sessionByCountryMap) {\r\n    const userOptions = utils.getData($sessionByCountryMap, 'options');\r\n    const chart = window.echarts.init($sessionByCountryMap);\r\n\r\n    const getDefaultOptions = () => ({\r\n      tooltip: {\r\n        trigger: 'item',\r\n        padding: [7, 10],\r\n        backgroundColor: utils.getGrays()['100'],\r\n        borderColor: utils.getGrays()['300'],\r\n        textStyle: { color: utils.getColors().dark },\r\n        borderWidth: 1,\r\n        transitionDuration: 0,\r\n        formatter: params =>\r\n          `<strong>${params.data?.name} :</strong> ${((params.data?.value / total) * 100).toFixed(\r\n            2\r\n          )}%`\r\n      },\r\n      toolbox: {\r\n        show: false,\r\n        feature: {\r\n          restore: {}\r\n        }\r\n      },\r\n      visualMap: {\r\n        show: false,\r\n        min: 800,\r\n        max: 50000,\r\n        inRange: {\r\n          color: [\r\n            utils.getColors().primary,\r\n            utils.rgbaColor(utils.getColors().primary, 0.8),\r\n            utils.rgbaColor(utils.getColors().primary, 0.6),\r\n            utils.rgbaColor(utils.getColors().primary, 0.4),\r\n            utils.rgbaColor(utils.getColors().primary, 0.2)\r\n          ].reverse()\r\n        }\r\n      },\r\n      series: [\r\n        {\r\n          type: 'map',\r\n          map: 'world',\r\n          data,\r\n          roam: true,\r\n          scaleLimit: {\r\n            min: 1,\r\n            max: 5\r\n          },\r\n          left: 0,\r\n          right: 0,\r\n          label: {\r\n            show: false\r\n          },\r\n          itemStyle: {\r\n            borderColor: utils.getGrays()['300']\r\n          },\r\n          emphasis: {\r\n            label: {\r\n              show: false\r\n            },\r\n            itemStyle: {\r\n              areaColor: utils.getColor('warning')\r\n            }\r\n          }\r\n        }\r\n      ]\r\n    });\r\n\r\n    echartSetOption(chart, userOptions, getDefaultOptions);\r\n\r\n    document.querySelector('.session-by-country-map-reset')?.addEventListener('click', () => {\r\n      chart.dispatchAction({\r\n        type: 'restore'\r\n      });\r\n    });\r\n  }\r\n};\r\n\r\nexport default sessionByCountryMapInit;\r\n", "import utils from \"../../utils\";\r\nimport { getPosition, echartSetOption } from \"./echarts-utils\";\r\n\r\n/* -------------------------------------------------------------------------- */\r\n/*                                Market Share                                */\r\n/* -------------------------------------------------------------------------- */\r\n\r\nconst mostLeadsInit = () => {\r\n  const ECHART_MOST_LEADS = \".echart-most-leads\";\r\n  const $echartMostLeads = document.querySelector(ECHART_MOST_LEADS);\r\n\r\n  if ($echartMostLeads) {\r\n    const userOptions = utils.getData($echartMostLeads, \"options\");\r\n    const chart = window.echarts.init($echartMostLeads);\r\n\r\n    const getDefaultOptions = () => ({\r\n      color: [\r\n        utils.getColors().primary,\r\n        utils.getColors().info,\r\n        utils.getColors().warning,\r\n        utils.getColors().info,\r\n        // utils.getGrays()[300],\r\n      ],\r\n      tooltip: {\r\n        trigger: \"item\",\r\n        padding: [7, 10],\r\n        backgroundColor: utils.getGrays()['100'],\r\n        borderColor: utils.getGrays()[\"300\"],\r\n        textStyle: { color: utils.getColors().dark },\r\n        borderWidth: 1,\r\n        transitionDuration: 0,\r\n        formatter: function (params) {\r\n          return `<strong>${params.data.name}:</strong> ${params.percent}%`;\r\n        },\r\n      },\r\n      position(pos, params, dom, rect, size) {\r\n        return getPosition(pos, params, dom, rect, size);\r\n      },\r\n      legend: { show: false },\r\n      series: [\r\n        {\r\n          type: \"pie\",\r\n          radius: [\"100%\", \"67%\"],\r\n          avoidLabelOverlap: false,\r\n          hoverAnimation: false,\r\n          itemStyle: {\r\n            borderWidth: 2,\r\n            borderColor: utils.getColor('card-bg'),\r\n          },\r\n          label: {\r\n            normal: {\r\n              show: false,\r\n              position: \"center\",\r\n              textStyle: {\r\n                fontSize: \"20\",\r\n                fontWeight: \"500\",\r\n                color: utils.getGrays()[\"700\"],\r\n              },\r\n            },\r\n            emphasis: {\r\n              show: false,\r\n            },\r\n          },\r\n          labelLine: { normal: { show: false } },\r\n          data: [\r\n            { value: 60, name: \"Email\" },\r\n            { value: 30, name: \"Social\" },\r\n            { value: 10, name: \"Call\" },\r\n            { value: 120, name: \"Other\" },\r\n          ],\r\n        },\r\n      ],\r\n    });\r\n\r\n    echartSetOption(chart, userOptions, getDefaultOptions);\r\n  }\r\n};\r\n\r\nexport default mostLeadsInit;\r\n", "import utils from '../../utils';\r\nimport { getPosition, echartSetOption, tooltipFormatter } from './echarts-utils';\r\n\r\n/* -------------------------------------------------------------------------- */\r\n/*                             Echarts Total Sales                            */\r\n/* -------------------------------------------------------------------------- */\r\n\r\nconst closedVsGoalInit = () => {\r\n  const ECHART_LINE_TOTAL_SALES = '.echart-closed-vs-goal';\r\n\r\n  const $echartsLineTotalSales = document.querySelector(ECHART_LINE_TOTAL_SALES);\r\n  const months = [\r\n    'Jan',\r\n    'Feb',\r\n    'Mar',\r\n    'Apr',\r\n    'May',\r\n    'Jun',\r\n    'Jul',\r\n    'Aug',\r\n    'Sep',\r\n    'Oct',\r\n    'Nov',\r\n    'Dec'\r\n  ];\r\n\r\n  if ($echartsLineTotalSales) {\r\n    // Get options from data attribute\r\n    const userOptions = utils.getData($echartsLineTotalSales, 'options');\r\n    const chart = window.echarts.init($echartsLineTotalSales);\r\n\r\n    const getDefaultOptions = () => ({\r\n      color: [utils.getColors().primary, utils.getColors().warning],\r\n      tooltip: {\r\n        trigger: 'axis',\r\n        padding: [7, 10],\r\n        backgroundColor: utils.getGrays()['100'],\r\n        borderColor: utils.getGrays()['300'],\r\n        textStyle: { color: utils.getColors().dark },\r\n        borderWidth: 1,\r\n        formatter: tooltipFormatter,\r\n        transitionDuration: 0,\r\n        position(pos, params, dom, rect, size) {\r\n          return getPosition(pos, params, dom, rect, size);\r\n        }\r\n      },\r\n\r\n      legend: {\r\n        left: 'left',\r\n        data: ['Closed Amount', 'Revenue Date'],\r\n        itemWidth: 10,\r\n        itemHeight: 10,\r\n        borderRadius: 0,\r\n        icon: 'circle',\r\n        inactiveColor: utils.getGrays()['400'],\r\n        textStyle: { color: utils.getGrays()['700'] },\r\n        itemGap: 20\r\n      },\r\n      xAxis: {\r\n        type: 'category',\r\n        name: 'Closed Date',\r\n        nameGap: 50,\r\n        nameLocation: 'center',\r\n        offset: 0,\r\n        nameTextStyle: {\r\n          color: utils.getGrays()['700']\r\n        },\r\n        data: [\r\n          '2019-06-15',\r\n          '2019-06-22',\r\n          '2019-06-29',\r\n          '2019-07-06',\r\n          '2019-07-13',\r\n          '2019-07-20',\r\n          '2019-07-27',\r\n          '2019-07-12',\r\n          '2019-07-03'\r\n        ],\r\n        boundaryGap: false,\r\n        axisPointer: {\r\n          lineStyle: {\r\n            color: utils.getGrays()['300'],\r\n            type: 'dashed'\r\n          }\r\n        },\r\n        splitLine: { show: false },\r\n        axisLine: {\r\n          lineStyle: {\r\n            color: utils.rgbaColor('#000', 0.01),\r\n            type: 'dashed'\r\n          }\r\n        },\r\n        axisTick: { show: false },\r\n        axisLabel: {\r\n          color: utils.getGrays()['400'],\r\n          formatter: function (value) {\r\n            var date = new Date(value);\r\n            return `${date.getDate()} ${months[date.getMonth()]} , 21`;\r\n          },\r\n          margin: 20\r\n        }\r\n      },\r\n      yAxis: {\r\n        type: 'value',\r\n        name: 'Closed Amount',\r\n        nameGap: 85,\r\n        nameLocation: 'middle',\r\n        nameTextStyle: {\r\n          color: utils.getGrays()['700']\r\n        },\r\n        splitNumber: 3,\r\n        axisPointer: { show: false },\r\n        splitLine: {\r\n          lineStyle: {\r\n            color: utils.getGrays()['200']\r\n          }\r\n        },\r\n        boundaryGap: false,\r\n        axisLabel: {\r\n          show: true,\r\n          color: utils.getGrays()['400'],\r\n          formatter: function (value) {\r\n            return `$${value}`;\r\n          },\r\n          margin: 15\r\n        },\r\n        axisTick: { show: false },\r\n        axisLine: { show: false }\r\n      },\r\n      series: [\r\n        {\r\n          type: 'line',\r\n          name: 'Closed Amount',\r\n          data: [0, 5000, 18000, 40000, 58000, 65000, 90000, 110000, 140000],\r\n          symbolSize: 5,\r\n          symbol: 'circle',\r\n          smooth: false,\r\n          hoverAnimation: true,\r\n          lineStyle: { color: utils.rgbaColor(utils.getColor('primary')) },\r\n          itemStyle: {\r\n            borderColor: utils.rgbaColor(utils.getColor('primary'), 0.6),\r\n            borderWidth: 2\r\n          }\r\n        },\r\n        {\r\n          type: 'line',\r\n          name: 'Revenue Date',\r\n          data: [0, 10000, 24000, 35000, 45000, 53000, 57000, 68000, 79000],\r\n          symbolSize: 5,\r\n          symbol: 'circle',\r\n          smooth: false,\r\n          hoverAnimation: true,\r\n          lineStyle: { color: utils.rgbaColor(utils.getColor('warning')) },\r\n          itemStyle: {\r\n            borderColor: utils.rgbaColor(utils.getColor('warning'), 0.6),\r\n            borderWidth: 2\r\n          }\r\n        }\r\n      ],\r\n      grid: { right: '25px', left: '100px', bottom: '60px', top: '35px' }\r\n    });\r\n\r\n    echartSetOption(chart, userOptions, getDefaultOptions);\r\n  }\r\n};\r\n\r\nexport default closedVsGoalInit;\r\n", "import utils from '../../utils';\r\nimport { getPosition, echartSetOption, tooltipFormatter } from './echarts-utils';\r\n\r\n/* -------------------------------------------------------------------------- */\r\n/*                                Traffic Channels                           */\r\n/* -------------------------------------------------------------------------- */\r\n\r\nconst leadConversionInit = () => {\r\n  const $leadConversion = document.querySelector('.echart-lead-conversion');\r\n\r\n  if ($leadConversion) {\r\n    const userOptions = utils.getData($leadConversion, 'options');\r\n    const chart = window.echarts.init($leadConversion);\r\n\r\n    const getDefaultOptions = () => ({\r\n      color: [\r\n        utils.rgbaColor(utils.getColors().primary, 0.7),\r\n        utils.rgbaColor(utils.getColors().info, 0.6),\r\n        utils.rgbaColor(utils.getColors().secondary, 0.2),\r\n        utils.rgbaColor(utils.getColors().warning, 0.6)\r\n      ],\r\n      legend: {\r\n        data: ['Campaigns', 'Lead', 'Opportunity', 'Deal'],\r\n        left: '0%',\r\n        icon: 'circle',\r\n        inactiveColor: utils.getGrays()['400'],\r\n        textStyle: { color: utils.getGrays()['700'] },\r\n        itemGap: 10\r\n      },\r\n      yAxis: {\r\n        type: 'category',\r\n        data: [\r\n          'kerry Ingram',\r\n          'Bradie Pitter',\r\n          'Harrington',\r\n          'Ashley Shaw',\r\n          'Jenny Horas',\r\n          'Chris Pratt'\r\n        ],\r\n        axisLine: {\r\n          show: false,\r\n        },\r\n        boundaryGap: false,\r\n        splitLine: {\r\n          lineStyle: {\r\n            color: utils.getGrays()['200']\r\n          }\r\n        },\r\n        axisTick: {\r\n          show: false\r\n        },\r\n        axisLabel: {\r\n          color: utils.getGrays()['600']\r\n        }\r\n      },\r\n      xAxis: {\r\n        type: 'value',\r\n        splitLine: {\r\n          lineStyle: {\r\n            color: utils.getGrays()['200']\r\n          }\r\n        },\r\n        axisLine: {\r\n          show: false\r\n        },\r\n        axisTick: {\r\n          show: false\r\n        },\r\n        axisLabel: {\r\n          show: false\r\n        }\r\n      },\r\n      tooltip: {\r\n        trigger: 'axis',\r\n        padding: [7,10],\r\n        axisPointer: {\r\n          type: 'none'\r\n        },\r\n        backgroundColor: utils.getGrays()['100'],\r\n        borderColor: utils.getGrays()['300'],\r\n        textStyle: { color: utils.getColors().dark },\r\n        borderWidth: 1,\r\n        transitionDuration: 0,\r\n        position(pos, params, dom, rect, size) {\r\n          return getPosition(pos, params, dom, rect, size);\r\n        },\r\n        formatter: tooltipFormatter\r\n      },\r\n\r\n      series: [\r\n        {\r\n          name: 'Campaigns',\r\n          type: 'bar',\r\n          stack: 'total',\r\n          data: [1405, 1300, 1620, 1430, 1500, 1520],\r\n          barWidth: '20%'\r\n        },\r\n        {\r\n          name: 'Lead',\r\n          type: 'bar',\r\n          stack: 'total',\r\n          data: [320, 302, 301, 334, 340, 390],\r\n          barWidth: '20%'\r\n        },\r\n        {\r\n          name: 'Opportunity',\r\n          type: 'bar',\r\n          stack: 'total',\r\n          data: [220, 182, 351, 234, 290, 300],\r\n          barWidth: '20%'\r\n        },\r\n        {\r\n          name: 'Deal',\r\n          type: 'bar',\r\n          stack: 'total',\r\n          data: [120, 182, 191, 134, 190, 170],\r\n          barWidth: '20%'\r\n        }\r\n      ],\r\n      grid: {\r\n        right: 5,\r\n        left: 5,\r\n        bottom: 8,\r\n        top: 60,\r\n        containLabel: true\r\n      }\r\n    });\r\n\r\n    echartSetOption(chart, userOptions, getDefaultOptions);\r\n  }\r\n};\r\n\r\nexport default leadConversionInit;\r\n", "import utils from '../../utils';\r\nimport { echartSetOption } from './echarts-utils';\r\n\r\n/* -------------------------------------------------------------------------- */\r\n/*                             Echarts Bounce Rate                            */\r\n/* -------------------------------------------------------------------------- */\r\n\r\nconst dealStorageFunnelInit = () => {\r\n  const $echartDealStorageFunnel = document.querySelector('.echart-deal-storage-funnel');\r\n \r\n  if ($echartDealStorageFunnel) {\r\n    const userOptions = utils.getData($echartDealStorageFunnel, 'options');\r\n    const { data, dataAxis1, dataAxis2 } = userOptions; \r\n    const chart = window.echarts.init($echartDealStorageFunnel);\r\n\r\n    const getDefaultOptions = () => ({\r\n      yAxis: [\r\n        {\r\n          data: dataAxis1,\r\n          axisLabel: {\r\n            inside: true,\r\n            textStyle: {\r\n              color: utils.getGrays()['700'],\r\n              fontWeight: 500,\r\n              fontSize: 11,\r\n              fontFamily: 'poppins',\r\n            },  \r\n          },\r\n          axisTick: {\r\n            show: false\r\n          },\r\n          axisLine: {\r\n            show: false\r\n          },\r\n          z: 10\r\n        },\r\n        {\r\n          data: dataAxis2,\r\n          axisLabel: {\r\n            inside: false,\r\n            textStyle: {\r\n              color: utils.getColors().primary,\r\n              fontWeight: 500,\r\n              fontSize: 11,\r\n              fontFamily: 'poppins',\r\n              \r\n            },\r\n            borderRadius: 5,\r\n            backgroundColor:  utils.getSoftColors().primary,\r\n            padding: [6,16,6,16],\r\n            width: 115\r\n            },\r\n            axisTick: {\r\n              show: false\r\n            },\r\n            axisLine: {\r\n              show: false\r\n            },\r\n            z: 10\r\n        },\r\n      ],\r\n    xAxis: {\r\n      type: 'value',\r\n      min: 0,\r\n      max: 35,\r\n      axisLine: {\r\n        show: false\r\n      },\r\n      splitLine: {\r\n        show: false\r\n      },\r\n      inverse: true,\r\n      axisTick: {\r\n        show: false\r\n      },\r\n      axisLabel: {\r\n        show: false,\r\n      }\r\n    },\r\n\r\n    series: [\r\n      {\r\n        type: 'bar',\r\n        showBackground: true,\r\n        barWidth: 25,\r\n        label: {\r\n          show: true,\r\n          formatter: '{c} ',\r\n          position: 'insideLeft',\r\n        },\r\n        backgroundStyle: {\r\n          color: utils.getGrays()['200'],\r\n          borderRadius: 5\r\n        },\r\n        itemStyle: {\r\n          color: utils.getColors().primary,\r\n          borderRadius: 5 \r\n        },\r\n        data: data\r\n      }\r\n    ],\r\n      grid: { right: '65px', left: '0', bottom: '0', top: '0' },\r\n    });\r\n    echartSetOption(chart, userOptions, getDefaultOptions);\r\n\r\n  }\r\n};\r\n\r\nexport default dealStorageFunnelInit;\r\n", "import utils from '../../utils';\r\nimport { getPosition, echartSetOption } from './echarts-utils';\r\n\r\n/* -------------------------------------------------------------------------- */\r\n/*                                Audience Chart                              */\r\n/* -------------------------------------------------------------------------- */\r\n\r\nconst revenueChartInit = () => {\r\n  const data = {\r\n    dates: utils.getDates(\r\n      new Date('5-6-2019'),\r\n      new Date('5-6-2021'),\r\n      1000 * 60 * 60 * 24 * 30\r\n    ),\r\n    dataset: {\r\n      revenue: [\r\n        [\r\n          645, 500, 550, 550, 473, 405, 286, 601, 743, 450, 604, 815, 855, 722,\r\n          700, 896, 866, 952, 719, 558, 737, 885, 972, 650, 600,\r\n        ],\r\n        [\r\n          440, 250, 270, 400,  175, 180, 200, 400,  600, 380, 340, 550,  650, 450,\r\n          400, 688,  650, 721, 500, 300, 445, 680, 568, 400, 371,\r\n        ],\r\n      ],\r\n      users: [\r\n        [\r\n          545, 500, 650, 727, 773, 705, 686, 501, 643, 580, 604, 615, 755, 722,\r\n          727, 816, 836, 952, 719, 758, 937, 785, 872, 850, 800,\r\n        ],\r\n        [\r\n          340, 360, 230, 250, 410, 430, 450, 200, 220, 540, 500, 250, 355, 320,\r\n          500, 630, 680, 500, 520, 550, 750, 720, 700, 780, 750,\r\n        ],\r\n      ],\r\n      deals: [\r\n        [\r\n          545, 400, 450, 627, 473, 450, 460, 780, 770, 800, 504, 550, 500, 530,\r\n          727, 716, 736, 820, 719, 758, 737, 885, 872, 850, 800,\r\n        ],\r\n        [\r\n          245, 300, 450, 427, 273, 250, 260, 580, 570, 500, 402, 450, 400, 330,\r\n          527, 516, 536, 620, 519, 558, 537, 483, 472, 250, 300,\r\n        ],\r\n      ],\r\n      profit: [\r\n        [\r\n          545, 400, 450, 627, 673, 605, 686, 501, 843, 518, 504, 715, 955, 622,\r\n          627, 716, 736, 952, 619, 558, 937, 785, 872, 550, 400,\r\n        ],\r\n        [\r\n          340, 360, 330, 300, 410, 380, 450, 400, 420, 240, 200, 250, 355, 320,\r\n          500, 630, 680, 400, 420, 450, 650, 620, 700, 450, 340,\r\n        ],\r\n      ],\r\n    },\r\n  };\r\n\r\n  const tooltipFormatter = params => {\r\n    return `<div class=\"card\">\r\n                <div class=\"card-header bg-light py-2\">\r\n                  <h6 class=\"text-600 mb-0\">${params[0].axisValue}</h6>\r\n                </div>\r\n              <div class=\"card-body py-2\">\r\n                <h6 class=\"text-600 fw-normal\">\r\n                  <span class=\"fas fa-circle text-primary me-2\"></span>Revenue: \r\n                  <span class=\"fw-medium\">$${params[0].data}</span></h6>\r\n                <h6 class=\"text-600 mb-0 fw-normal\"> \r\n                  <span class=\"fas fa-circle text-warning me-2\"></span>Revenue Goal: \r\n                  <span class=\"fw-medium\">$${params[1].data}</span></h6>\r\n              </div>\r\n            </div>`;\r\n  };\r\n\r\n  const getDefaultOptions = (data1, data2) => () => ({\r\n    color: utils.getGrays().white,\r\n    tooltip: {\r\n      trigger: 'axis',\r\n      padding: 0,\r\n      backgroundColor: 'transparent',\r\n      borderWidth: 0,\r\n      transitionDuration: 0,\r\n      position(pos, params, dom, rect, size) {\r\n        return getPosition(pos, params, dom, rect, size);\r\n      },\r\n      axisPointer: {\r\n        type: 'none',\r\n      },\r\n      formatter: tooltipFormatter,\r\n    },\r\n    xAxis: {\r\n      type: 'category',\r\n      data: utils.getPastDates(25).map(date => window.dayjs(date).format('DD MMM, YYYY')),\r\n      axisLabel: {\r\n        color: utils.getGrays()['600'],\r\n        formatter: value => window.dayjs(value).format('MMM DD'),\r\n        align: 'left',\r\n        fontSize: 11,\r\n        padding: [0, 0, 0, 5],\r\n        showMaxLabel: false,\r\n      },\r\n      axisLine: {\r\n        show: false,\r\n      },\r\n      axisTick: {\r\n        show: false,\r\n      },\r\n      boundaryGap: true,\r\n    },\r\n    yAxis: {\r\n      position: 'right',\r\n      axisPointer: { type: 'none' },\r\n      axisTick: 'none',\r\n      splitLine: {\r\n        show: false,\r\n      },\r\n      axisLine: {\r\n        show: false,\r\n      },\r\n      axisLabel: {\r\n        show: false,\r\n      },\r\n    },\r\n    series: [\r\n      {\r\n        type: 'bar',\r\n        name: 'Revenue',\r\n        data: data1,\r\n        lineStyle: {\r\n          color: utils.getColor('primary'),\r\n        },\r\n        itemStyle: {\r\n          barBorderRadius: [4, 4, 0, 0],\r\n          color: utils.getGrays()['100'],\r\n          borderColor: utils.getGrays()['300'],\r\n          borderWidth: 1,\r\n        },\r\n        emphasis: {\r\n          itemStyle: {\r\n            color: utils.getColor('primary'),\r\n          },\r\n        },\r\n      },\r\n      {\r\n        type: 'line',\r\n        name: 'Revenue Goal',\r\n        data: data2,\r\n        symbol: 'circle',\r\n        symbolSize: 6,\r\n        animation: false,\r\n        itemStyle: {\r\n          color: utils.getColor('warning'),\r\n        },\r\n        lineStyle: {\r\n          type: 'dashed',\r\n          width: 2,\r\n          color: utils.getColor('warning'),\r\n        },\r\n      },\r\n    ],\r\n    grid: { right: 5, left: 5, bottom: '8%', top: '5%' },\r\n  });\r\n  const initChart = (el, options) => {\r\n    const userOptions = utils.getData(el, 'options');\r\n    const chart = window.echarts.init(el);\r\n    echartSetOption(chart, userOptions, options);\r\n  };\r\n  const chartKeys = ['revenue', 'users', 'deals', 'profit'];\r\n  chartKeys.forEach(key => {\r\n    const el = document.querySelector(`.echart-crm-${key}`);\r\n    el && \r\n      initChart(\r\n        el, \r\n        getDefaultOptions(data.dataset[key][0], data.dataset[key][1])\r\n      );\r\n  });\r\n};\r\n\r\nexport default revenueChartInit;", "import utils from '../../utils';\r\nimport { echartSetOption } from './echarts-utils';\r\n\r\n/* -------------------------------------------------------------------------- */\r\n/*                                Session By Country Map                      */\r\n/* -------------------------------------------------------------------------- */\r\n\r\nconst locationBySessionInit = () => {\r\n  const $locationBySessionMap = document.querySelector('.echart-location-by-session-map');\r\n\r\n  const data = [\r\n    { name: 'Afghanistan', value: 28397.812 },\r\n    { name: 'Angola', value: 19549.124 },\r\n    { name: 'Albania', value: 3150.143 },\r\n    { name: 'United Arab Emirates', value: 8441.537 },\r\n    { name: 'Argentina', value: 40374.224 },\r\n    { name: 'Armenia', value: 2963.496 },\r\n    { name: 'French Southern and Antarctic Lands', value: 268.065 },\r\n    { name: 'Australia', value: 22404.488 },\r\n    { name: 'Austria', value: 8401.924 },\r\n    { name: 'Azerbaijan', value: 9094.718 },\r\n    { name: 'Burundi', value: 9232.753 },\r\n    { name: 'Belgium', value: 10941.288 },\r\n    { name: 'Benin', value: 9509.798 },\r\n    { name: 'Burkina Faso', value: 15540.284 },\r\n    { name: 'Bangladesh', value: 151125.475 },\r\n    { name: 'Bulgaria', value: 7389.175 },\r\n    { name: 'The Bahamas', value: 66402.316 },\r\n    { name: 'Bosnia and Herzegovina', value: 3845.929 },\r\n    { name: 'Belarus', value: 9491.07 },\r\n    { name: 'Belize', value: 308.595 },\r\n    { name: 'Bermuda', value: 64.951 },\r\n    { name: 'Bolivia', value: 716.939 },\r\n    { name: 'Brazil', value: 195210.154 },\r\n    { name: 'Brunei', value: 27.223 },\r\n    { name: 'Bhutan', value: 716.939 },\r\n    { name: 'Botswana', value: 1969.341 },\r\n    { name: 'Central African Rep.', value: 4349.921 },\r\n    { name: 'Canada', value: 34126.24 },\r\n    { name: 'Switzerland', value: 7830.534 },\r\n    { name: 'Chile', value: 17150.76 },\r\n    { name: 'China', value: 1359821.465 },\r\n    { name: \"C\u00F4te d'Ivoire\", value: 60508.978 },\r\n    { name: 'Cameroon', value: 20624.343 },\r\n    { name: 'Dem. Rep. Congo', value: 62191.161 },\r\n    { name: 'Congo', value: 3573.024 },\r\n    { name: 'Colombia', value: 46444.798 },\r\n    { name: 'Costa Rica', value: 4669.685 },\r\n    { name: 'Cuba', value: 11281.768 },\r\n    { name: 'Northern Cyprus', value: 1.468 },\r\n    { name: 'Cyprus', value: 1103.685 },\r\n    { name: 'Czech Republic', value: 10553.701 },\r\n    { name: 'Germany', value: 83017.404 },\r\n    { name: 'Djibouti', value: 834.036 },\r\n    { name: 'Denmark', value: 5550.959 },\r\n    { name: 'Dominican Republic', value: 10016.797 },\r\n    { name: 'Algeria', value: 37062.82 },\r\n    { name: 'Ecuador', value: 15001.072 },\r\n    { name: 'Egypt', value: 78075.705 },\r\n    { name: 'Eritrea', value: 5741.159 },\r\n    { name: 'Spain', value: 46182.038 },\r\n    { name: 'Estonia', value: 1298.533 },\r\n    { name: 'Ethiopia', value: 87095.281 },\r\n    { name: 'Finland', value: 5367.693 },\r\n    { name: 'Fiji', value: 860.559 },\r\n    { name: 'Falkland Islands', value: 49.581 },\r\n    { name: 'France', value: 63230.866 },\r\n    { name: 'Gabon', value: 1556.222 },\r\n    { name: 'United Kingdom', value: 62066.35 },\r\n    { name: 'Georgia', value: 4388.674 },\r\n    { name: 'Ghana', value: 24262.901 },\r\n    { name: 'Eq. Guinea', value: 10876.033 },\r\n    { name: 'Guinea', value: 10876.033 },\r\n    { name: 'Gambia', value: 1680.64 },\r\n    { name: 'Guinea Bissau', value: 10876.033 },\r\n    { name: 'Equatorial Guinea', value: 696.167 },\r\n    { name: 'Greece', value: 11109.999 },\r\n    { name: 'Greenland', value: 56.546 },\r\n    { name: 'Guatemala', value: 14341.576 },\r\n    { name: 'French Guiana', value: 231.169 },\r\n    { name: 'Guyana', value: 786.126 },\r\n    { name: 'Honduras', value: 7621.204 },\r\n    { name: 'Croatia', value: 4338.027 },\r\n    { name: 'Haiti', value: 9896.4 },\r\n    { name: 'Hungary', value: 10014.633 },\r\n    { name: 'Indonesia', value: 240676.485 },\r\n    { name: 'India', value: 1205624.648 },\r\n    { name: 'Ireland', value: 4467.561 },\r\n    { name: 'Iran', value: 240676.485 },\r\n    { name: 'Iraq', value: 30962.38 },\r\n    { name: 'Iceland', value: 318.042 },\r\n    { name: 'Israel', value: 7420.368 },\r\n    { name: 'Italy', value: 60508.978 },\r\n    { name: 'Jamaica', value: 2741.485 },\r\n    { name: 'Jordan', value: 6454.554 },\r\n    { name: 'Japan', value: 127352.833 },\r\n    { name: 'Kazakhstan', value: 15921.127 },\r\n    { name: 'Kenya', value: 40909.194 },\r\n    { name: 'Kyrgyzstan', value: 5334.223 },\r\n    { name: 'Cambodia', value: 14364.931 },\r\n    { name: 'South Korea', value: 51452.352 },\r\n    { name: 'Kosovo', value: 97.743 },\r\n    { name: 'Kuwait', value: 2991.58 },\r\n    { name: 'Laos', value: 6395.713 },\r\n    { name: 'Lebanon', value: 4341.092 },\r\n    { name: 'Liberia', value: 3957.99 },\r\n    { name: 'Libya', value: 6040.612 },\r\n    { name: 'Sri Lanka', value: 20758.779 },\r\n    { name: 'Lesotho', value: 2008.921 },\r\n    { name: 'Lithuania', value: 3068.457 },\r\n    { name: 'Luxembourg', value: 507.885 },\r\n    { name: 'Latvia', value: 2090.519 },\r\n    { name: 'Morocco', value: 31642.36 },\r\n    { name: 'Moldova', value: 103.619 },\r\n    { name: 'Madagascar', value: 21079.532 },\r\n    { name: 'Mexico', value: 117886.404 },\r\n    { name: 'Macedonia', value: 507.885 },\r\n    { name: 'Mali', value: 13985.961 },\r\n    { name: 'Myanmar', value: 51931.231 },\r\n    { name: 'Montenegro', value: 620.078 },\r\n    { name: 'Mongolia', value: 2712.738 },\r\n    { name: 'Mozambique', value: 23967.265 },\r\n    { name: 'Mauritania', value: 3609.42 },\r\n    { name: 'Malawi', value: 15013.694 },\r\n    { name: 'Malaysia', value: 28275.835 },\r\n    { name: 'Namibia', value: 2178.967 },\r\n    { name: 'New Caledonia', value: 246.379 },\r\n    { name: 'Niger', value: 15893.746 },\r\n    { name: 'Nigeria', value: 159707.78 },\r\n    { name: 'Nicaragua', value: 5822.209 },\r\n    { name: 'Netherlands', value: 16615.243 },\r\n    { name: 'Norway', value: 4891.251 },\r\n    { name: 'Nepal', value: 26846.016 },\r\n    { name: 'New Zealand', value: 4368.136 },\r\n    { name: 'Oman', value: 2802.768 },\r\n    { name: 'Pakistan', value: 173149.306 },\r\n    { name: 'Panama', value: 3678.128 },\r\n    { name: 'Peru', value: 29262.83 },\r\n    { name: 'Philippines', value: 93444.322 },\r\n    { name: 'Papua New Guinea', value: 6858.945 },\r\n    { name: 'Poland', value: 38198.754 },\r\n    { name: 'Puerto Rico', value: 3709.671 },\r\n    { name: 'North Korea', value: 1.468 },\r\n    { name: 'Portugal', value: 10589.792 },\r\n    { name: 'Paraguay', value: 6459.721 },\r\n    { name: 'Qatar', value: 1749.713 },\r\n    { name: 'Romania', value: 21861.476 },\r\n    { name: 'Russia', value: 21861.476 },\r\n    { name: 'Rwanda', value: 10836.732 },\r\n    { name: 'Western Sahara', value: 514.648 },\r\n    { name: 'Saudi Arabia', value: 27258.387 },\r\n    { name: 'Sudan', value: 35652.002 },\r\n    { name: 'S. Sudan', value: 9940.929 },\r\n    { name: 'Senegal', value: 12950.564 },\r\n    { name: 'Solomon Islands', value: 526.447 },\r\n    { name: 'Sierra Leone', value: 5751.976 },\r\n    { name: 'El Salvador', value: 6218.195 },\r\n    { name: 'Somaliland', value: 9636.173 },\r\n    { name: 'Somalia', value: 9636.173 },\r\n    { name: 'Republic of Serbia', value: 3573.024 },\r\n    { name: 'Suriname', value: 524.96 },\r\n    { name: 'Slovakia', value: 5433.437 },\r\n    { name: 'Slovenia', value: 2054.232 },\r\n    { name: 'Sweden', value: 9382.297 },\r\n    { name: 'Swaziland', value: 1193.148 },\r\n    { name: 'Syria', value: 7830.534 },\r\n    { name: 'Chad', value: 11720.781 },\r\n    { name: 'Togo', value: 6306.014 },\r\n    { name: 'Thailand', value: 66402.316 },\r\n    { name: 'Tajikistan', value: 7627.326 },\r\n    { name: 'Turkmenistan', value: 5041.995 },\r\n    { name: 'East Timor', value: 10016.797 },\r\n    { name: 'Trinidad and Tobago', value: 1328.095 },\r\n    { name: 'Tunisia', value: 10631.83 },\r\n    { name: 'Turkey', value: 72137.546 },\r\n    { name: 'Tanzania', value: 44973.33 },\r\n    { name: 'Uganda', value: 33987.213 },\r\n    { name: 'Ukraine', value: 46050.22 },\r\n    { name: 'Uruguay', value: 3371.982 },\r\n    { name: 'United States', value: 312247.116 },\r\n    { name: 'Uzbekistan', value: 27769.27 },\r\n    { name: 'Venezuela', value: 236.299 },\r\n    { name: 'Vietnam', value: 89047.397 },\r\n    { name: 'Vanuatu', value: 236.299 },\r\n    { name: 'West Bank', value: 13.565 },\r\n    { name: 'Yemen', value: 22763.008 },\r\n    { name: 'South Africa', value: 51452.352 },\r\n    { name: 'Zambia', value: 13216.985 },\r\n    { name: 'Zimbabwe', value: 13076.978 }\r\n  ];\r\n\r\n  const total = 6961500;\r\n\r\n  const maxZoomLevel = 5;\r\n  const minZoomLevel = 1;\r\n\r\n  if ($locationBySessionMap) {\r\n    const userOptions = utils.getData($locationBySessionMap, 'options');\r\n    const chart = window.echarts.init($locationBySessionMap);\r\n\r\n    const getDefaultOptions = () => ({\r\n      tooltip: {\r\n        trigger: 'item',\r\n        padding: [7, 10],\r\n        backgroundColor: utils.getGrays()['100'],\r\n        borderColor: utils.getGrays()['300'],\r\n        textStyle: { color: utils.getColors().dark },\r\n        borderWidth: 1,\r\n        transitionDuration: 0,\r\n        formatter: params =>\r\n          `<strong>${params.data?.name} :</strong> ${((params.data?.value / total) * 100).toFixed(\r\n            2\r\n          )}%`\r\n      },\r\n\r\n      visualMap: {\r\n        show: false,\r\n        min: 800,\r\n        max: 50000,\r\n        inRange: {\r\n          color: [\r\n            utils.getColors().primary,\r\n            utils.rgbaColor(utils.getColors().primary, 0.8),\r\n            utils.rgbaColor(utils.getColors().primary, 0.6),\r\n            utils.rgbaColor(utils.getColors().primary, 0.4),\r\n            utils.rgbaColor(utils.getColors().primary, 0.2)\r\n          ].reverse()\r\n        }\r\n      },\r\n      series: [\r\n        {\r\n          type: 'map',\r\n          map: 'world',\r\n          data,\r\n          roam: 'move',\r\n\r\n          scaleLimit: {\r\n            min: minZoomLevel,\r\n            max: maxZoomLevel\r\n          },\r\n          left: 0,\r\n          right: 0,\r\n          label: {\r\n            show: false\r\n          },\r\n          itemStyle: {\r\n            borderColor: utils.getGrays()['300']\r\n          },\r\n          emphasis: {\r\n            label: {\r\n              show: false\r\n            },\r\n            itemStyle: {\r\n              areaColor: utils.getColor('warning')\r\n            }\r\n          }\r\n        }\r\n      ]\r\n    });\r\n\r\n    echartSetOption(chart, userOptions, getDefaultOptions);\r\n\r\n    let zoomLevel = 1;\r\n\r\n    document.querySelector('.location-by-session-map-reset')?.addEventListener('click', () => {\r\n      zoomLevel = 1;\r\n      chart.dispatchAction({\r\n        type: 'restore'\r\n      });\r\n      chart.setOption({\r\n        series: {\r\n          zoom: 1\r\n        }\r\n      });\r\n    });\r\n\r\n    document.querySelector('.location-by-session-map-zoom')?.addEventListener('click', () => {\r\n      if (zoomLevel < maxZoomLevel) {\r\n        zoomLevel = zoomLevel + 1;\r\n      }\r\n      chart.setOption({\r\n        series: {\r\n          zoom: zoomLevel\r\n        }\r\n      });\r\n    });\r\n\r\n    document.querySelector('.location-by-session-map-zoomOut')?.addEventListener('click', () => {\r\n      if (zoomLevel > minZoomLevel) {\r\n        zoomLevel = zoomLevel - 1;\r\n      }\r\n      chart.setOption({\r\n        series: {\r\n          zoom: zoomLevel\r\n        }\r\n      });\r\n    });\r\n  }\r\n};\r\n\r\nexport default locationBySessionInit;\r\n", "import utils from '../../utils';\r\nimport { getPosition, echartSetOption } from './echarts-utils';\r\n\r\n/* -------------------------------------------------------------------------- */\r\n/*                             Echarts Real Time Users                        */\r\n/* -------------------------------------------------------------------------- */\r\n\r\nconst realTimeUsersChartInit = () => {\r\n  const $echartsRealTimeUsers = document.querySelector(\r\n    '.echart-real-time-users'\r\n  );\r\n\r\n  if ($echartsRealTimeUsers) {\r\n    const userOptions = utils.getData($echartsRealTimeUsers, 'options');\r\n    const chart = window.echarts.init($echartsRealTimeUsers);\r\n\r\n    const data = [\r\n      921, 950, 916, 913, 909, 962, 926, 936, 977, 976, 999, 981, 998, 1000,\r\n      900, 906, 973, 911, 994, 982, 917, 972, 952, 963, 991,\r\n    ];\r\n    const axisData = [\r\n      1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,\r\n      22, 23, 24, 25,\r\n    ];\r\n\r\n    const tooltipFormatter = params => {\r\n      return `\r\n      <div>\r\n          <h6 class=\"fs--1 text-700 mb-0\"><span class=\"fas fa-circle me-1 text-info\"></span>\r\n            Users : ${params[0].value}\r\n          </h6>\r\n      </div>\r\n      `;\r\n    };\r\n\r\n    const getDefaultOptions = () => ({\r\n      tooltip: {\r\n        trigger: 'axis',\r\n        padding: [7, 10],\r\n        axisPointer: {\r\n          type: 'none',\r\n        },\r\n        backgroundColor: utils.getGrays()['100'],\r\n        borderColor: utils.getGrays()['300'],\r\n        textStyle: { color: utils.getColors().dark },\r\n        borderWidth: 1,\r\n        transitionDuration: 0,\r\n        position(pos, params, dom, rect, size) {\r\n          return getPosition(pos, params, dom, rect, size);\r\n        },\r\n        formatter: tooltipFormatter,\r\n      },\r\n      xAxis: {\r\n        type: 'category',\r\n\r\n        axisLabel: {\r\n          show: false,\r\n        },\r\n        axisTick: {\r\n          show: false,\r\n        },\r\n        axisLine: {\r\n          show: false,\r\n        },\r\n        boundaryGap: [0.2, 0.2],\r\n        data: axisData,\r\n      },\r\n      yAxis: {\r\n        type: 'value',\r\n        scale: true,\r\n        boundaryGap: false,\r\n        axisLabel: {\r\n          show: false,\r\n        },\r\n        splitLine: {\r\n          show: false,\r\n        },\r\n        min: 500,\r\n        max: 1100,\r\n      },\r\n      series: [\r\n        {\r\n          type: 'bar',\r\n          barCategoryGap: '12%',\r\n          data,\r\n          itemStyle: {\r\n            color: utils.rgbaColor('#fff', 0.3),\r\n          },\r\n        },\r\n      ],\r\n      grid: { right: '0px', left: '0px', bottom: 0, top: 0 },\r\n    });\r\n\r\n    echartSetOption(chart, userOptions, getDefaultOptions);\r\n\r\n    const userCounterDom = document.querySelector('.real-time-user');\r\n\r\n    setInterval(() => {\r\n      const rndData = utils.getRandomNumber(900, 1000);\r\n      data.shift();\r\n      data.push(rndData);\r\n      axisData.shift();\r\n      axisData.push(utils.getRandomNumber(100, 500));\r\n      userCounterDom.innerHTML = rndData;\r\n\r\n      chart.setOption({\r\n        xAxis: {\r\n          data: axisData,\r\n        },\r\n        series: [\r\n          {\r\n            data,\r\n          },\r\n        ],\r\n      });\r\n    }, 2000);\r\n  }\r\n};\r\n\r\nexport default realTimeUsersChartInit;\r\n", "import utils from '../../utils';\r\nimport { echartSetOption } from './echarts-utils';\r\n\r\n/* -------------------------------------------------------------------------- */\r\n/*                             Echarts Line Payment                           */\r\n/* -------------------------------------------------------------------------- */\r\n\r\nconst linePaymentChartInit = () => {\r\n  const $echartsLinePaymentChart = document.querySelector(\r\n    '.echart-line-payment'\r\n  );\r\n\r\n  const dataset = {\r\n    all: [4, 1, 6, 2, 7, 12, 4, 6, 5, 4, 5, 10],\r\n    successful: [3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5, 8],\r\n    failed: [1, 0, 2, 1, 2, 1, 1, 0, 0, 1, 0, 2],\r\n  };\r\n  const labels = [\r\n    '9:00 AM',\r\n    '10:00 AM',\r\n    '11:00 AM',\r\n    '12:00 PM',\r\n    '1:00 PM',\r\n    '2:00 PM',\r\n    '3:00 PM',\r\n    '4:00 PM',\r\n    '5:00 PM',\r\n    '6:00 PM',\r\n    '7:00 PM',\r\n    '8:00 PM',\r\n  ];\r\n\r\n  if ($echartsLinePaymentChart) {\r\n    const userOptions = utils.getData($echartsLinePaymentChart, 'options');\r\n    const chart = window.echarts.init($echartsLinePaymentChart);\r\n\r\n    const getDefaultOptions = () => ({\r\n      tooltip: {\r\n        trigger: 'axis',\r\n        axisPointer: {\r\n          type: 'none',\r\n        },\r\n        padding: [7, 10],\r\n        backgroundColor: utils.getGrays()['100'],\r\n        borderColor: utils.getGrays()['300'],\r\n        borderWidth: 1,\r\n        transitionDuration: 0,\r\n        formatter: params => `${params[0].axisValue} - ${params[0].value} USD`,\r\n        textStyle: {\r\n          fontWeight: 500,\r\n          fontSize: 12,\r\n          color: utils.getColors().dark,\r\n        },\r\n      },\r\n      xAxis: {\r\n        type: 'category',\r\n        data: labels,\r\n        splitLine: {\r\n          show: true,\r\n          lineStyle: {\r\n            color: utils.rgbaColor('#fff', 0.1),\r\n          },\r\n          interval: 0,\r\n        },\r\n        axisLine: {\r\n          lineStyle: {\r\n            color: utils.rgbaColor('#fff', 0.1),\r\n          },\r\n        },\r\n        axisTick: {\r\n          show: true,\r\n          length: 10,\r\n          lineStyle: {\r\n            color: utils.rgbaColor('#fff', 0.1),\r\n          },\r\n        },\r\n        axisLabel: {\r\n          color: utils.getGrays()['400'],\r\n          fontWeight: 600,\r\n          formatter: value => value.substring(0, value.length - 3),\r\n          fontSize: 12,\r\n          interval: window.innerWidth < 768 ? 'auto' : 0,\r\n          margin: 15,\r\n        },\r\n        boundaryGap: false,\r\n      },\r\n      yAxis: {\r\n        type: 'value',\r\n        axisPointer: { show: false },\r\n        splitLine: {\r\n          show: false,\r\n        },\r\n        axisLabel: {\r\n          show: false,\r\n        },\r\n        axisTick: { show: false },\r\n        axisLine: { show: false },\r\n      },\r\n      series: [\r\n        {\r\n          type: 'line',\r\n          smooth: true,\r\n          data: dataset.successful.map(d => (d * 3.14).toFixed(2)),\r\n          symbol: 'emptyCircle',\r\n          itemStyle: {\r\n            color:\r\n              localStorage.getItem('theme') === 'light'\r\n                ? utils.getGrays()['white']\r\n                : utils.getColors().primary,\r\n          },\r\n          lineStyle: {\r\n            color:\r\n              localStorage.getItem('theme') === 'light'\r\n                ? utils.rgbaColor(utils.getGrays()['white'], 0.8)\r\n                : utils.getColors().primary,\r\n          },\r\n          areaStyle: {\r\n            color: {\r\n              type: 'linear',\r\n              x: 0,\r\n              y: 0,\r\n              x2: 0,\r\n              y2: 1,\r\n              colorStops: [\r\n                {\r\n                  offset: 0,\r\n                  color:\r\n                    localStorage.getItem('theme') === 'light'\r\n                      ? 'rgba(255, 255, 255, 0.5)'\r\n                      : utils.rgbaColor(utils.getColors().primary, 0.5),\r\n                },\r\n                {\r\n                  offset: 1,\r\n                  color:\r\n                    localStorage.getItem('theme') === 'light'\r\n                      ? 'rgba(255, 255, 255, 0)'\r\n                      : utils.rgbaColor(utils.getColors().primary, 0),\r\n                },\r\n              ],\r\n            },\r\n          },\r\n          emphasis: {\r\n            lineStyle: {\r\n              width: 2,\r\n            },\r\n          },\r\n        },\r\n      ],\r\n      grid: { right: 15, left: 15, bottom: '15%', top: 0 },\r\n    });\r\n\r\n    echartSetOption(chart, userOptions, getDefaultOptions);\r\n\r\n    utils.resize(() => {\r\n      if (window.innerWidth < 768) {\r\n        chart.setOption({\r\n          xAxis: {\r\n            axisLabel: {\r\n              interval: 'auto',\r\n            },\r\n          },\r\n        });\r\n      }\r\n    });\r\n\r\n    const selectMenu = document.querySelector('#dashboard-chart-select');\r\n\r\n    if (selectMenu) {\r\n      selectMenu.addEventListener('change', e => {\r\n        const value = e.currentTarget.value;\r\n        chart.setOption({\r\n          series: [{ data: dataset[value].map(d => (d * 3.14).toFixed(2)) }],\r\n        });\r\n      });\r\n    }\r\n  }\r\n};\r\n\r\nexport default linePaymentChartInit;\r\n", "import utils from '../../utils';\r\nimport { chartJsDefaultTooltip, chartJsInit } from './chartjs-utils';\r\n\r\n/* -------------------------------------------------------------------------- */\r\n/*                            Chart Line                                  */\r\n/* -------------------------------------------------------------------------- */\r\nconst chartLine = () => {\r\n  const line = document.getElementById('chartjs-line-chart');\r\n\r\n  const getOptions = () => ({\r\n    type: 'bar',\r\n    data: {\r\n      labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],\r\n      datasets: [\r\n        {\r\n          type: 'line',\r\n          label: 'Dataset 1',\r\n          borderColor: utils.getColor('primary'),\r\n          borderWidth: 2,\r\n          fill: false,\r\n          data: [55, 80, 60, 22, 50, 40, 90],\r\n          tension: 0.3\r\n        }\r\n      ]\r\n    },\r\n    options: {\r\n      plugins: {\r\n        tooltip: chartJsDefaultTooltip()\r\n      },\r\n      scales: {\r\n        x: {\r\n          grid: {\r\n            color: utils.rgbaColor(utils.getGrays()['black'], 0.1)\r\n          }\r\n        },\r\n        y: {\r\n          grid: {\r\n            color: utils.rgbaColor(utils.getGrays()['black'], 0.1)\r\n          }\r\n        }\r\n      }\r\n    }\r\n  });\r\n\r\n  chartJsInit(line, getOptions);\r\n};\r\n\r\nexport default chartLine;\r\n", "import utils from '../../utils';\r\nimport { echartSetOption } from './echarts-utils';\r\n\r\n/* -------------------------------------------------------------------------- */\r\n/*                            Bandwidth Saved                                 */\r\n/* -------------------------------------------------------------------------- */\r\n\r\nconst bandwidthSavedInit = () => {\r\n  const $echartsBandwidthSaved = document.querySelector('.echart-bandwidth-saved');\r\n\r\n  if ($echartsBandwidthSaved) {\r\n    const userOptions = utils.getData($echartsBandwidthSaved, 'options');\r\n    const chart = window.echarts.init($echartsBandwidthSaved);\r\n\r\n    const getDefaultOptions = () => ({\r\n      series: [\r\n        {\r\n          type: 'gauge',\r\n          startAngle: 90,\r\n          endAngle: -270,\r\n          radius: '90%',\r\n          pointer: {\r\n            show: false\r\n          },\r\n          progress: {\r\n            show: true,\r\n            overlap: false,\r\n            roundCap: true,\r\n            clip: false,\r\n            itemStyle: {\r\n              color: {\r\n                type: 'linear',\r\n                x: 0,\r\n                y: 0,\r\n                x2: 1,\r\n                y2: 0,\r\n                colorStops: [\r\n                  {\r\n                    offset: 0,\r\n                    color: '#1970e2'\r\n                  },\r\n                  {\r\n                    offset: 1,\r\n                    color: '#4695ff'\r\n                  }\r\n                ]\r\n              }\r\n            }\r\n          },\r\n          axisLine: {\r\n            lineStyle: {\r\n              width: 8,\r\n              color: [[1, utils.getColor('200')]]\r\n            }\r\n          },\r\n          splitLine: {\r\n            show: false\r\n          },\r\n          axisTick: {\r\n            show: false\r\n          },\r\n          axisLabel: {\r\n            show: false\r\n          },\r\n          data: [\r\n            {\r\n              value: 93,\r\n              detail: {\r\n                offsetCenter: ['7%', '4%']\r\n              }\r\n            }\r\n          ],\r\n          detail: {\r\n            width: 50,\r\n            height: 14,\r\n            fontSize: 28,\r\n            fontWeight: 500,\r\n            fontFamily: 'poppins',\r\n            color: utils.getColor('500'),\r\n            formatter: '{value}%',\r\n            valueAnimation: true\r\n          },\r\n          animationDuration: 3000\r\n        }\r\n      ]\r\n    });\r\n\r\n    const initChart = () => {\r\n      if (utils.isScrolledIntoView($echartsBandwidthSaved)) {\r\n        echartSetOption(chart, userOptions, getDefaultOptions);\r\n        window.removeEventListener('scroll', initChart);\r\n      }\r\n    };\r\n\r\n    window.addEventListener('scroll', initChart);\r\n  }\r\n};\r\n\r\nexport default bandwidthSavedInit;\r\n", "/* eslint-disable no-param-reassign */\r\nimport utils from './utils';\r\n\r\n/* -------------------------------------------------------------------------- */\r\n/*                                   Treeview                                   */\r\n/* -------------------------------------------------------------------------- */\r\nconst treeviewInit = () => {\r\n  const Events = {\r\n    CHANGE: 'change',\r\n    SHOW_BS_COLLAPSE: 'show.bs.collapse',\r\n    HIDE_BS_COLLAPSE: 'hide.bs.collapse'\r\n  };\r\n\r\n  const Selector = {\r\n    TREEVIEW_ROW:\r\n      '.treeview > li > .treeview-row,.treeview-list.collapse-show > li > .treeview-row',\r\n    TREEVIEW: '.treeview',\r\n    TREEVIEW_LIST: '.treeview-list',\r\n    TOGGLE_ELEMENT: \"[data-bs-toggle='collapse']\",\r\n    INPUT: 'input',\r\n    TREEVIEW_LIST_ITEM: '.treeview-list-item',\r\n    CHILD_SELECTOR: ':scope > li > .collapse.collapse-show'\r\n  };\r\n\r\n  const ClassName = {\r\n    TREEVIEW: 'treeview',\r\n    TREEVIEW_LIST: 'treeview-list',\r\n    TREEVIEW_BORDER: 'treeview-border',\r\n    TREEVIEW_BORDER_TRANSPARENT: 'treeview-border-transparent',\r\n    COLLAPSE_SHOW: 'collapse-show',\r\n    COLLAPSE_HIDDEN: 'collapse-hidden',\r\n    TREEVIEW_ROW: 'treeview-row',\r\n    TREEVIEW_ROW_ODD: 'treeview-row-odd',\r\n    TREEVIEW_ROW_EVEN: 'treeview-row-even'\r\n  };\r\n\r\n  const treeviews = document.querySelectorAll(Selector.TREEVIEW);\r\n\r\n  const makeStriped = treeview => {\r\n    const tags = Array.from(treeview.querySelectorAll(Selector.TREEVIEW_ROW));\r\n\r\n    const uTags = tags.filter(tag => {\r\n      let result = true;\r\n      while (tag.parentElement) {\r\n        if (tag.parentElement.classList.contains(ClassName.COLLAPSE_HIDDEN)) {\r\n          result = false;\r\n          break;\r\n        }\r\n        tag = tag.parentElement;\r\n      }\r\n      return result;\r\n    });\r\n    uTags.forEach((tag, index) => {\r\n      if (index % 2 === 0) {\r\n        tag.classList.add(ClassName.TREEVIEW_ROW_EVEN);\r\n        tag.classList.remove(ClassName.TREEVIEW_ROW_ODD);\r\n      } else {\r\n        tag.classList.add(ClassName.TREEVIEW_ROW_ODD);\r\n        tag.classList.remove(ClassName.TREEVIEW_ROW_EVEN);\r\n      }\r\n    });\r\n  };\r\n\r\n  if (treeviews.length) {\r\n    treeviews.forEach(treeview => {\r\n      const options = utils.getData(treeview, 'options');\r\n      const striped = options?.striped;\r\n      const select = options?.select;\r\n\r\n      if (striped) {\r\n        makeStriped(treeview);\r\n      }\r\n\r\n      const collapseElementList = Array.from(treeview.querySelectorAll(Selector.TREEVIEW_LIST));\r\n      const collapseListItem = Array.from(treeview.querySelectorAll(Selector.TREEVIEW_LIST_ITEM));\r\n\r\n      collapseListItem.forEach(item => {\r\n        const wholeRow = document.createElement('div');\r\n        wholeRow.setAttribute('class', ClassName.TREEVIEW_ROW);\r\n        item.prepend(wholeRow);\r\n      });\r\n      collapseElementList.forEach(collapse => {\r\n        const collapseId = collapse.id;\r\n        if (!striped) {\r\n          collapse.classList.add(ClassName.TREEVIEW_BORDER);\r\n        }\r\n        collapse.addEventListener(Events.SHOW_BS_COLLAPSE, e => {\r\n          e.target.classList.remove(ClassName.COLLAPSE_HIDDEN);\r\n          e.target.classList.add(ClassName.COLLAPSE_SHOW);\r\n          if (striped) {\r\n            makeStriped(treeview);\r\n          } else {\r\n            e.path[2].classList.add(ClassName.TREEVIEW_BORDER_TRANSPARENT);\r\n          }\r\n        });\r\n\r\n        collapse.addEventListener(Events.HIDE_BS_COLLAPSE, e => {\r\n          e.target.classList.add(ClassName.COLLAPSE_HIDDEN);\r\n          e.target.classList.remove(ClassName.COLLAPSE_SHOW);\r\n\r\n          if (striped) {\r\n            makeStriped(treeview);\r\n          } else {\r\n            const childs = e.path[2].querySelectorAll(Selector.CHILD_SELECTOR);\r\n            if (!e.path[2].classList.contains(ClassName.TREEVIEW) && childs.length === 0) {\r\n              e.path[2].classList.remove(ClassName.TREEVIEW_BORDER_TRANSPARENT);\r\n            }\r\n          }\r\n        });\r\n\r\n        if (collapse.dataset.show === 'true') {\r\n          const parents = [collapse];\r\n          while (collapse.parentElement) {\r\n            if (collapse.parentElement.classList.contains(ClassName.TREEVIEW_LIST)) {\r\n              parents.unshift(collapse.parentElement);\r\n            }\r\n            collapse = collapse.parentElement;\r\n          }\r\n          parents.forEach(collapseEl => {\r\n            // eslint-disable-next-line no-new\r\n            new window.bootstrap.Collapse(collapseEl, {\r\n              show: true\r\n            });\r\n          });\r\n        }\r\n\r\n        if (select) {\r\n          const inputElement = treeview.querySelector(`input[data-target='#${collapseId}']`);\r\n          inputElement.addEventListener(Events.CHANGE, e => {\r\n            const childInputElements = Array.from(\r\n              treeview.querySelector(`#${collapseId}`).querySelectorAll(Selector.INPUT)\r\n            );\r\n            childInputElements.forEach(input => {\r\n              input.checked = e.target.checked;\r\n            });\r\n          });\r\n        }\r\n      });\r\n    });\r\n  }\r\n};\r\n\r\nexport default treeviewInit;\r\n", "/* -------------------------------------------------------------------------- */\r\n/*                                 Scrollbars                                 */\r\n/* -------------------------------------------------------------------------- */\r\n// import utils from './utils';\r\n\r\nconst scrollInit = () => {\r\n\tconst dropdownElements = Array.from(document.querySelectorAll('[data-hide-on-body-scroll]'));\r\n\r\n\tif (window.innerWidth < 1200) {\r\n\t\twindow.addEventListener('scroll', () => {\r\n\t\t\tdropdownElements.forEach(dropdownElement => {\r\n\t\t\t\tconst instanceEl = window.bootstrap.Dropdown.getInstance(dropdownElement);\r\n\t\t\t\tinstanceEl && instanceEl.hide();\r\n\t\t\t});\r\n\t\t});\r\n\t}\r\n};\r\nexport default scrollInit;\r\n", "import { docReady } from './utils';\r\nimport handleNavbarVerticalCollapsed from './navbar-vertical';\r\nimport detectorInit from './detector';\r\nimport tooltipInit from './tooltip';\r\nimport popoverInit from './popover';\r\nimport navbarTopDropShadow from './navbar-top';\r\nimport toastInit from './toast';\r\nimport progressAnimationToggle from './progress';\r\nimport glightboxInit from './glightbox';\r\nimport plyrInit from './plyr';\r\nimport initMap from './googleMap';\r\nimport dropzoneInit from './dropzone';\r\nimport choicesInit from './choices';\r\nimport barChartInit from './charts/chartjs/chart-bar';\r\nimport formValidationInit from './form-validation';\r\nimport leafletActiveUserInit from './leaflet-active-user';\r\nimport countupInit from './countup';\r\nimport copyLink from './copy-link';\r\nimport typedTextInit from './typed';\r\nimport navbarDarkenOnScroll from './navbar-darken-on-scroll';\r\nimport scrollToTop from './scroll-to-top';\r\nimport tinymceInit from './tinymce';\r\nimport bulkSelectInit from './bulk-select';\r\nimport quantityInit from './quantity';\r\nimport navbarComboInit from './navbar-combo';\r\nimport listInit from './list';\r\nimport chatInit from './chat';\r\nimport draggableInit from './draggable';\r\nimport kanbanInit from './kanban';\r\nimport lottieInit from './lottie';\r\nimport wizardInit from './wizard';\r\nimport swiperInit from './swiper';\r\nimport ratingInit from './rater';\r\nimport searchInit from './search';\r\nimport cookieNoticeInit from './cookie-notice';\r\nimport themeControl from './theme-control';\r\nimport dropdownOnHover from './dropdown-on-hover';\r\nimport productShareDoughnutInit from './charts/chartjs/product-share-doughnut';\r\nimport totalSalesEcommerce from './charts/echarts/total-sales-ecommerce';\r\nimport salesByPosLocationInit from './charts/echarts/sales-by-pos-location';\r\nimport returningCustomerRateInit from './charts/echarts/returning-customer-rate';\r\nimport topProductsInit from './charts/echarts/top-products';\r\nimport marketShareEcommerceInit from './charts/echarts/market-share-ecommerce';\r\nimport totalSalesInit from './charts/echarts/total-sales';\r\nimport weeklySalesInit from './charts/echarts/weekly-sales';\r\nimport marketShareInit from './charts/echarts/market-share';\r\nimport totalOrderInit from './charts/echarts/total-order';\r\nimport candleChartInit from './charts/echarts/candle-chart';\r\nimport grossRevenueChartInit from './charts/echarts/gross-revenue';\r\nimport scrollbarInit from './scrollbar';\r\nimport iconCopiedInit from './icons';\r\nimport reportForThisWeekInit from './charts/echarts/report-for-this-week';\r\nimport basicEchartsInit from './charts/echarts/basic-echarts';\r\nimport chartScatter from './charts/chartjs/chart-scatter';\r\nimport chartDoughnut from './charts/chartjs/chart-doughnut';\r\nimport chartPie from './charts/chartjs/chart-pie';\r\nimport chartPolar from './charts/chartjs/chart-polar';\r\nimport chartRadar from './charts/chartjs/chart-radar';\r\nimport chartCombo from './charts/chartjs/chart-combo';\r\nimport chartBubble from './charts/chartjs/chart-bubble';\r\nimport dropdownMenuInit from './dropdown-menu';\r\nimport audienceChartInit from './charts/echarts/audience';\r\nimport sessionByBrowserChartInit from './charts/echarts/session-by-browser';\r\nimport sessionByCountryChartInit from './charts/echarts/session-by-country';\r\nimport activeUsersChartReportInit from './charts/echarts/active-users-report';\r\nimport trafficChannelChartInit from './charts/echarts/traffic-channels';\r\nimport bounceRateChartInit from './charts/echarts/bounce-rate';\r\nimport usersByTimeChartInit from './charts/echarts/users-by-time';\r\nimport sessionByCountryMapInit from './charts/echarts/session-by-country-map';\r\nimport mostLeadsInit from './charts/echarts/most-leads';\r\nimport closedVsGoalInit from './charts/echarts/closed-vs-goal';\r\nimport leadConversionInit from './charts/echarts/lead-conversion';\r\nimport dealStorageFunnelInit from './charts/echarts/deal-storage-funnel';\r\nimport revenueChartInit from './charts/echarts/crm-revenue';\r\nimport locationBySessionInit from './charts/echarts/location-by-session-crm';\r\nimport realTimeUsersChartInit from './charts/echarts/real-time-users';\r\nimport linePaymentChartInit from './charts/echarts/line-payment';\r\nimport chartLine from './charts/chartjs/chart-line';\r\nimport bandwidthSavedInit from './charts/echarts/bandwidth-saved';\r\nimport treeviewInit from './treeview';\r\nimport scrollInit from './scroll';\r\n\r\n/* -------------------------------------------------------------------------- */\r\n/*                            Theme Initialization                            */\r\n/* -------------------------------------------------------------------------- */\r\n$(document).on(\"turbo:load\", () => {\r\n\tdocReady(detectorInit);\r\n\tdocReady(handleNavbarVerticalCollapsed);\r\n\tdocReady(totalOrderInit);\r\n\tdocReady(weeklySalesInit);\r\n\tdocReady(marketShareInit);\r\n\tdocReady(totalSalesInit);\r\n\tdocReady(topProductsInit);\r\n\tdocReady(navbarTopDropShadow);\r\n\tdocReady(tooltipInit);\r\n\tdocReady(popoverInit);\r\n\tdocReady(toastInit);\r\n\tdocReady(progressAnimationToggle);\r\n\tdocReady(glightboxInit);\r\n\tdocReady(plyrInit);\r\n\tdocReady(initMap);\r\n\t//\tdocReady(dropzoneInit);\r\n\tdocReady(choicesInit);\r\n\tdocReady(formValidationInit);\r\n\tdocReady(barChartInit);\r\n\tdocReady(leafletActiveUserInit);\r\n\tdocReady(countupInit);\r\n\tdocReady(copyLink);\r\n\tdocReady(navbarDarkenOnScroll);\r\n\tdocReady(typedTextInit);\r\n\tdocReady(scrollToTop);\r\n\tdocReady(tinymceInit);\r\n\tdocReady(bulkSelectInit);\r\n\tdocReady(chatInit);\r\n\tdocReady(quantityInit);\r\n\tdocReady(navbarComboInit);\r\n\tdocReady(listInit);\r\n\tdocReady(swiperInit);\r\n\tdocReady(ratingInit);\r\n\tdocReady(draggableInit);\r\n\tdocReady(kanbanInit);\r\n\t//docReady(lottieInit);\r\n\tdocReady(wizardInit);\r\n\tdocReady(searchInit);\r\n\tdocReady(cookieNoticeInit);\r\n\tdocReady(themeControl);\r\n\tdocReady(dropdownOnHover);\r\n\tdocReady(marketShareEcommerceInit);\r\n\tdocReady(productShareDoughnutInit);\r\n\tdocReady(totalSalesEcommerce);\r\n\tdocReady(bandwidthSavedInit);\r\n\tdocReady(salesByPosLocationInit);\r\n\tdocReady(returningCustomerRateInit);\r\n\tdocReady(candleChartInit);\r\n\tdocReady(grossRevenueChartInit);\r\n\tdocReady(scrollbarInit);\r\n\tdocReady(iconCopiedInit);\r\n\tdocReady(reportForThisWeekInit);\r\n\tdocReady(basicEchartsInit);\r\n\tdocReady(chartScatter);\r\n\tdocReady(chartDoughnut);\r\n\tdocReady(chartPie);\r\n\tdocReady(chartPolar);\r\n\tdocReady(chartRadar);\r\n\tdocReady(chartCombo);\r\n\tdocReady(dropdownMenuInit);\r\n\tdocReady(audienceChartInit);\r\n\tdocReady(sessionByBrowserChartInit);\r\n\tdocReady(sessionByCountryChartInit);\r\n\tdocReady(activeUsersChartReportInit);\r\n\tdocReady(trafficChannelChartInit);\r\n\tdocReady(bounceRateChartInit);\r\n\tdocReady(usersByTimeChartInit);\r\n\tdocReady(sessionByCountryMapInit);\r\n\tdocReady(mostLeadsInit);\r\n\tdocReady(closedVsGoalInit);\r\n\tdocReady(leadConversionInit);\r\n\tdocReady(dealStorageFunnelInit);\r\n\tdocReady(revenueChartInit);\r\n\tdocReady(locationBySessionInit);\r\n\tdocReady(realTimeUsersChartInit);\r\n\tdocReady(linePaymentChartInit);\r\n\tdocReady(chartBubble);\r\n\tdocReady(chartLine);\r\n\tdocReady(treeviewInit);\r\n\tdocReady(scrollInit);\r\n});\r\n", "$(document).on(\"turbo:load\", () => {\n  function managerEditEnabled() {\n    return $(\"#utente-container\").data(\"manager-edit\") === true || $(\"#utente-container\").data(\"manager-edit\") === \"true\";\n  }\n\n  function isTipoComune() {\n    return $(\"#utente_tipo_utente\").val() === \"2\";\n  }\n\n  function hasSezioniMultiple() {\n    return $(\"#utente-container\").data(\"sezioni-multiple\") === true || $(\"#utente-container\").data(\"sezioni-multiple\") === \"true\";\n  }\n\n  function setSezioniMultiple(value) {\n    $(\"#utente-container\").data(\"sezioni-multiple\", value);\n  }\n\n  function resetCatastoRow(row, markDestroy) {\n    row.find(\".catasto-sezione-select\").val(\"\");\n    row.find(\".catasto-livello-select\").val(\"\");\n    row.find(\"input[type='date']\").val(\"\");\n    row.find(\".permesso-catasto\").prop(\"checked\", false);\n    row.find(\".catasto-destroy-flag\").prop(\"checked\", markDestroy);\n    togglePermessoCatastoRow(row);\n  }\n\n  function syncCatastoButtons() {\n    if (!hasSezioniMultiple()) {\n      $(\".nuova-catasto-riga, .elimina-catasto-riga\").addClass(\"visually-hidden\");\n      return;\n    }\n\n    var visibleRows = $(\".catasto-autorizzazione-row\").not(\".visually-hidden\");\n    var hiddenRows = $(\".catasto-autorizzazione-row.visually-hidden\");\n\n    $(\".nuova-catasto-riga\").addClass(\"visually-hidden\");\n    $(\".elimina-catasto-riga\").addClass(\"visually-hidden\");\n\n    if (visibleRows.length > 0) {\n      visibleRows.last().find(\".nuova-catasto-riga\").toggleClass(\"visually-hidden\", hiddenRows.length === 0 || !isTipoComune());\n    }\n\n    visibleRows.each(function(index) {\n      $(this).find(\".elimina-catasto-riga\").toggleClass(\"visually-hidden\", index === 0);\n    });\n  }\n\n  function updateCatastoSezioniOptions(sezioni) {\n    var multiple = sezioni.length > 1;\n    setSezioniMultiple(multiple);\n    $(\".catasto-sezione-header, .catasto-sezione-wrapper, .catasto-opzioni-header, .catasto-opzioni-wrapper\").toggleClass(\"visually-hidden\", !multiple);\n    $(\".catasto-livello-wrapper\").removeClass(\"col-2 col-4\").addClass(multiple ? \"col-2\" : \"col-4\");\n    $(\".catasto-livello-header\").removeClass(\"col-2 col-4\").addClass(multiple ? \"col-2\" : \"col-4\");\n\n    $(\".catasto-sezione-select\").each(function() {\n      var select = $(this);\n      var currentValue = select.val();\n\n      select.empty();\n      select.append('<option value=\"\">Seleziona una sezione</option>');\n\n      $.each(sezioni, function(_, sezione) {\n        select.append('<option value=\"' + sezione.sezione + '\">' + sezione.descrizione + '</option>');\n      });\n\n      if (currentValue) {\n        select.val(currentValue);\n      }\n\n      select.prop(\"disabled\", !isTipoComune() || !multiple);\n    });\n\n    if (!multiple) {\n      $(\".catasto-sezione-select\").val(\"\");\n    }\n  }\n\n  function resetCatastoRows(preserveFirstRow) {\n    $(\".catasto-autorizzazione-row\").each(function(index) {\n      resetCatastoRow($(this), index !== 0 || !preserveFirstRow);\n      $(this).toggleClass(\"visually-hidden\", preserveFirstRow ? index !== 0 || (!hasSezioniMultiple() && index > 0) : true);\n    });\n\n    if (preserveFirstRow) {\n      $(\".catasto-autorizzazione-row\").first().removeClass(\"visually-hidden\");\n      $(\".catasto-autorizzazione-row\").first().find(\".catasto-destroy-flag\").prop(\"checked\", false);\n    }\n\n    syncCatastoButtons();\n  }\n\n  function toggleTipoUtente() {\n    if (!managerEditEnabled()) {\n      return;\n    }\n\n    var comune = isTipoComune();\n    $(\"#utente-comune-wrapper, #utente-provincia-wrapper, #utente-codice-wrapper, #utente-permessi-wrapper\").toggleClass(\"visually-hidden\", !comune);\n\n    if (!comune) {\n      $(\"#utente_comune\").val(\"\");\n      $(\"#provincia\").html(\"\");\n      $(\"#codice\").html(\"\");\n      setSezioniMultiple(false);\n      resetCatastoRows(true);\n      updateCatastoSezioniOptions([]);\n    }\n\n    togglePermessiVincoli();\n    syncCatastoButtons();\n  }\n\n  function togglePermessoCatastoRow(row) {\n    var livello = Number(row.find(\".catasto-livello-select\").val() || 0);\n    var hasSezione = !hasSezioniMultiple() || row.find(\".catasto-sezione-select\").val() !== \"\";\n    var checkbox = row.find(\".permesso-catasto\");\n    var enabled = isTipoComune() && hasSezione && livello >= 2 && !row.hasClass(\"visually-hidden\");\n\n    checkbox.prop(\"disabled\", !enabled);\n    if (!enabled) {\n      checkbox.prop(\"checked\", false);\n    }\n  }\n\n  function togglePermessiCatasto() {\n    $(\".catasto-autorizzazione-row\").each(function() {\n      togglePermessoCatastoRow($(this));\n    });\n  }\n\n  function livelloVincoliCorrente() {\n    return Number($(\".vincoli-livello\").val() || 0);\n  }\n\n  function togglePermessiVincoli() {\n    var enabledScrittura = managerEditEnabled() && isTipoComune() && livelloVincoliCorrente() >= 2;\n    var enabledLettura = managerEditEnabled() && isTipoComune() && livelloVincoliCorrente() >= 1;\n\n    $(\"#permessi-vincoli-container\").toggleClass(\"visually-hidden\", !managerEditEnabled() || !isTipoComune());\n    $(\".permesso-vincoli-scrittura\").prop(\"disabled\", !enabledScrittura);\n    $(\".permesso-vincoli-lettura\").prop(\"disabled\", !enabledLettura);\n    if (!enabledScrittura) {\n      $(\".permesso-vincoli-scrittura\").prop(\"checked\", false);\n    }\n    if (!enabledLettura) {\n      $(\".permesso-vincoli-lettura\").prop(\"checked\", false);\n    }\n\n    toggleDipendenzePermessiVincoli();\n  }\n\n  function toggleDipendenzePermessiVincoli() {\n    var accessoAffrancazione = $(\"#utente_permessi_vincoli_attributes_accesso_affrancazione\").is(\":checked\");\n    var accessoCalcoloUi = $(\"#utente_permessi_vincoli_attributes_accesso_calcolo_ui\").is(\":checked\");\n    var baseEnabled = !$(\".permesso-vincoli-scrittura\").first().prop(\"disabled\");\n\n    $(\".permesso-vincoli-affrancazione\").prop(\"disabled\", !baseEnabled || !accessoAffrancazione);\n    $(\".permesso-vincoli-calcolo-ui\").prop(\"disabled\", !baseEnabled || !accessoCalcoloUi);\n\n    if (!accessoAffrancazione) {\n      $(\".permesso-vincoli-affrancazione\").prop(\"checked\", false);\n    }\n\n    if (!accessoCalcoloUi) {\n      $(\".permesso-vincoli-calcolo-ui\").prop(\"checked\", false);\n    }\n  }\n\n  // apre la modal all'apertura della pagina\n  $('#new-modal').modal('show');\n  $('#edit-modal').modal('show');\n\n  // regola il funzionamento delle form con campi disabilitati e pulsante modifica/conferma\n  $(\"#edit\").click(function(){\n    $(\"#edit\").hide();\n    $(\"#confirm\").removeClass(\"visually-hidden\");\n    $(\"#comune_logo\").removeClass(\"visually-hidden\");\n    $(\"#annulla\").removeClass(\"d-none\");\n    $(\"input\").prop(\"disabled\", false);\n    $(\"select\").prop(\"disabled\", false);\n  });\n\n  // regola il cambio di logo nella funzione \"cambia comune\"\n  $(\"#comune_id\").change(function(){\n    $(\".login-icon\").addClass(\"visually-hidden\");\n    $(\"#\" + this.value + \"_logo\").removeClass(\"visually-hidden\");\n  });\n\n  // aggiorna anteprima e nome file quando viene scelto un nuovo stemma del Comune\n  function aggiornaAnteprimaStemmaComune() {\n    var input = $(\"#file-input\").get(0);\n    var filename = $(\"#comune_logo_filename\");\n    var preview = $(\"#comune_logo_preview\");\n\n    if (!input || !input.files || input.files.length === 0 || filename.length === 0 || preview.length === 0) {\n      return;\n    }\n\n    var file = input.files[0];\n    filename.text(file.name).removeClass(\"visually-hidden\");\n\n    if (!file.type.match(/^image\\//)) {\n      return;\n    }\n\n    var reader = new FileReader();\n    reader.onload = function(event) {\n      preview.attr(\"src\", event.target.result);\n    };\n    reader.readAsDataURL(file);\n  }\n\n  $(\"#file-input\").change(aggiornaAnteprimaStemmaComune);\n\n  function setPasswordRequirement(name, valid, active) {\n    var requirement = $('[data-password-requirement=\"' + name + '\"]');\n    var icon = requirement.find('.password-requirement-icon');\n\n    requirement.toggleClass('eln-green-text', active && valid);\n    requirement.toggleClass('eln-red-text', active && !valid);\n    icon.toggleClass('bi-check-circle-fill', active && valid);\n    icon.toggleClass('bi-x-circle-fill', !active || !valid);\n  }\n\n  function syncPasswordFields() {\n    var passwordField = $('#password-edit');\n    var confirmField = $('#confirm_password');\n    var confirmWrapper = $('#password_edit_confirm');\n    var requirements = $('#password-requirements');\n    var message = $('#message');\n\n    if (passwordField.length === 0 || confirmField.length === 0) {\n      return;\n    }\n\n    var password = passwordField.val();\n    var confirmPassword = confirmField.val();\n    var hasPassword = password.length > 0;\n    var validMinLength = password.length >= 8;\n    var validMaxLength = password.length <= 128;\n    var validUppercase = /[A-Z]/.test(password);\n    var validLowercase = /[a-z]/.test(password);\n    var validNumber = /\\d/.test(password);\n    var validSpecial = /[^A-Za-z0-9]/.test(password);\n    var validPassword = validMinLength && validMaxLength && validUppercase && validLowercase && validNumber && validSpecial;\n\n    confirmWrapper.toggleClass('visually-hidden', !hasPassword);\n    requirements.toggleClass('visually-hidden', !hasPassword);\n\n    setPasswordRequirement('min-length', validMinLength, hasPassword);\n    setPasswordRequirement('max-length', validMaxLength, hasPassword);\n    setPasswordRequirement('uppercase', validUppercase, hasPassword);\n    setPasswordRequirement('lowercase', validLowercase, hasPassword);\n    setPasswordRequirement('number', validNumber, hasPassword);\n    setPasswordRequirement('special', validSpecial, hasPassword);\n\n    if (!hasPassword) {\n      passwordField.get(0).setCustomValidity('');\n      confirmField.val('');\n      confirmField.get(0).setCustomValidity('');\n      message.html('');\n      return;\n    }\n\n    passwordField.get(0).setCustomValidity(validPassword ? '' : 'La password non rispetta tutti i requisiti');\n\n    if (confirmPassword.length === 0) {\n      confirmField.get(0).setCustomValidity('Ripeti la password');\n      message.html('');\n      return;\n    }\n\n    if (password === confirmPassword) {\n      message.html('Corrisponde').css('color', 'green');\n      confirmField.get(0).setCustomValidity('');\n    } else {\n      message.html('Non Corrisponde').css('color', 'red');\n      confirmField.get(0).setCustomValidity('Le password non corrispondono');\n    }\n  }\n\n  // quando viene creato/modificato un utente, controlla requisiti e corrispondenza password\n  syncPasswordFields();\n  $('#password-edit, #confirm_password').on('input keyup', syncPasswordFields);\n\n  // aggiunge una riga vuota per inserire una nuova autorizzazione in fase di creazione/modifica di un utente\n  $(\".nuova-catasto-riga\").click(function(){\n    var currentRow = $(this).closest(\".catasto-autorizzazione-row\");\n    var nextRow = currentRow.nextAll(\".catasto-autorizzazione-row.visually-hidden\").first();\n    if (nextRow.length === 0) {\n      return;\n    }\n\n    nextRow.removeClass(\"visually-hidden\");\n    nextRow.find(\".catasto-destroy-flag\").prop(\"checked\", false);\n    syncCatastoButtons();\n    togglePermessiCatasto();\n  });\n\n  // rimuove un'autorizzazione in fase di creazione/modifica di un utente\n  $(\".elimina-catasto-riga\").click(function(){\n    var row = $(this).closest(\".catasto-autorizzazione-row\");\n    row.addClass(\"visually-hidden\");\n    $(this).children().tooltip('hide');\n    resetCatastoRow(row, true);\n    syncCatastoButtons();\n  });\n\n  $(\"#utente_tipo_utente\").change(function() {\n    toggleTipoUtente();\n  });\n\n  $(\"#utente_permessi_vincoli_attributes_accesso_affrancazione, #utente_permessi_vincoli_attributes_accesso_calcolo_ui\").change(function() {\n    toggleDipendenzePermessiVincoli();\n  });\n\n  $(\".vincoli-livello\").change(function() {\n    togglePermessiVincoli();\n  });\n\n  $(\".catasto-livello-select, .catasto-sezione-select\").change(function() {\n    togglePermessiCatasto();\n  });\n\n  // quando si cambia il comune nella creazione/modifica di un utente\n  // vengono richiesti la provincia ed il codice ente\n  $(\"[name='utente[comune]']\").change(function(){\n    var id = Number($(this).val());\n    if(id == ''){\n      $(\"#provincia\").html(\"\");\n      $(\"#codice\").html(\"\");\n      updateCatastoSezioniOptions([]);\n      resetCatastoRows(true);\n    }\n    else{\n      $.ajax({\n        url: \"/dati_comune\",\n        method: \"GET\",\n        dataType: \"json\",\n        data: {comune: id},\n        error: function (xhr, status, error) {\n            console.error('AJAX Error: ' + status + \" \" + error);\n        },\n        success: function (dati_comune) {\n          var sezioni = dati_comune[\"sezione\"] || dati_comune[\"sezione_catastale\"] || [];\n          $(\"#provincia\").html(dati_comune[\"provincia\"]);\n          $(\"#codice\").html(dati_comune[\"codice\"]);\n          updateCatastoSezioniOptions(sezioni);\n          resetCatastoRows(true);\n        }\n      });\n    }\n  });\n\n  // toggle password\n  $(\"#toggle-password, #toggle-password-confirm, #toggle-password-edit\").click(function(){\n    var password = \"\";\n    switch($(this).attr('id')){\n      case \"toggle-password\":\n        password = $(\"#password\");\n        break;\n      case \"toggle-password-confirm\":\n        password = $(\"#confirm_password\");\n        break;\n      case \"toggle-password-edit\":\n        password = $(\"#password-edit\");\n        break;\n    }\n    const type = password.attr('type') === 'password' ? 'text' : 'password';\n    password.attr('type', type);\n    this.classList.toggle('bi-eye');\n  });\n\n  // rende un oggetto cliccabile e apre il link contenuto in data-href\n  $(\".clickable-row\").click(function() {\n    window.location = $(this).data(\"href\");\n  });\n\n  toggleTipoUtente();\n  togglePermessiVincoli();\n  togglePermessiCatasto();\n  syncCatastoButtons();\n\n  // per quei link che espandono un contenuto, regola la freccia\n  $(\"button\").click(function(){\n    var element = $(this).children('i.bi').first();\n    element.toggleClass('bi-caret-down-fill bi-caret-up-fill');\n  });\n\n  // corregge il funzionamento delle dropdown\n  $(\"[data-bs-toggle='dropdown']\").click(function(){\n    var id = $(this).attr('id');\n    $('[aria-labelledby=\"' + id + '\"]').toggleClass( \"show\" );\n  });\n\n  var accountDropdown = document.getElementById(\"accountDropdown\");\n  if (accountDropdown && accountDropdown.dataset.blurOnDropdownHidden !== \"true\") {\n    accountDropdown.dataset.blurOnDropdownHidden = \"true\";\n    accountDropdown.addEventListener(\"hidden.bs.dropdown\", function(){\n      this.blur();\n    });\n  }\n\n  $(document).off(\"click.accountDropdownBlur\").on(\"click.accountDropdownBlur\", function(event){\n    var accountDropdownContainer = $(\"#accountDropdown\").closest(\".dropdown\");\n    if (accountDropdownContainer.length > 0 && !accountDropdownContainer.is(event.target) && accountDropdownContainer.has(event.target).length === 0) {\n      $(\"#accountDropdown\").trigger(\"blur\");\n    }\n  });\n\n  // sostituto di collapse\n  $(\".collapsible\").on(\"click\", function(){\n    var href = $(this).attr('href');\n    var content = document.getElementById(href)\n    if (content.style.maxHeight){\n      content.style.maxHeight = null;\n      content.addEventListener(\"transitionend\", function removeOpenClass(event){\n        if (event.propertyName === \"max-height\") {\n          content.classList.remove(\"collapsible-content-open\");\n          content.removeEventListener(\"transitionend\", removeOpenClass);\n        }\n      });\n    } else {\n      content.classList.add(\"collapsible-content-open\");\n      content.style.maxHeight = content.scrollHeight + \"px\";\n    }\n  });\n\n  // per quei link che espandono un contenuto in una treeview, regola la freccia\n  $(\".collapsible-treeview\").click(function(){\n    var element = $(this).children('span.bi').first();\n    element.toggleClass('bi-caret-right bi-caret-down');\n    var treeview = $(\"#\" + $(this).attr('href'));\n    treeview.toggleClass('collapsible-treeview-hide collapsible-treeview-show');\n  });\n\n  // regola gli switch a 3 stati\n  $(\".toggle_option\").change(function(){\n    var indice = $(this).attr(\"id\").split(\"_\")[2];\n    var stato = $(\"[name$='stato_\" + indice + \"']:checked\").attr(\"id\").split(\"_\")[0];\n    if(stato == \"true\")\n      $(\"#requisito_slider_\" + indice).removeClass( \"toggle_option_slider_false toggle_option_slider_nil\" ).addClass( \"toggle_option_slider_true\" );\n    else if (stato == \"nil\")\n      $(\"#requisito_slider_\" + indice).removeClass( \"toggle_option_slider_false toggle_option_slider_true\" ).addClass( \"toggle_option_slider_nil\" );\n    else if (stato == \"false\")\n      $(\"#requisito_slider_\" + indice).removeClass( \"toggle_option_slider_true toggle_option_slider_nil\" ).addClass( \"toggle_option_slider_false\" );\n  });\n\n  $(\"a[class*='close_modal']\").on(\"click\", function(event){\n    const message = $(this).data(\"confirm\");\n    if (message && !confirm(message)) {\n      event.preventDefault();\n      return false;\n    }\n    $(\"#new-modal\").modal(\"toggle\");\n  });\n});\n\nwindow.elinkSidebarTreeview = {\n  clearHighlights() {\n    $(\".navbar-vertical .treeview-current\").removeClass(\"treeview-current\");\n    $(\".navbar-vertical .nav-link-text.fw-bold\").removeClass(\"fw-bold\");\n  },\n\n  findNodeButton(node) {\n    return node.children(\"button.collapsible-treeview\").first()\n      .add(node.children(\".treeview-item-header\").find(\"> button.collapsible-treeview\").first())\n      .first();\n  },\n\n  findParentButton(listElement) {\n    return listElement.siblings(\"button.collapsible-treeview\").first()\n      .add(listElement.siblings(\".treeview-item-header\").find(\"> button.collapsible-treeview\").first())\n      .first();\n  },\n\n  highlightNode(node) {\n    node.addClass(\"treeview-current\");\n    node.find(\"> a .nav-link-text, > button .nav-link-text, > .treeview-item-header .nav-link-text\").addClass(\"fw-bold\");\n  },\n\n  expandButton(button) {\n    if (!button.length)\n      return;\n\n    const treeviewId = button.attr(\"href\");\n    const treeview = $(\"#\" + treeviewId);\n    if (treeview.length && treeview.hasClass(\"collapsible-treeview-hide\"))\n      button.trigger(\"click\");\n  },\n\n  openAncestors(node) {\n    if (!node.length)\n      return;\n\n    this.highlightNode(node);\n\n    const listElement = node.parent(\"ul\");\n    if (!listElement.length)\n      return;\n\n    const parentItem = listElement.parent(\"li\");\n    if (!parentItem.length)\n      return;\n\n    const parentButton = this.findParentButton(listElement);\n    if (parentButton.length)\n      this.expandButton(parentButton);\n\n    this.openAncestors(parentItem);\n  }\n};\n\n// quando parte una richiesta ajax aggiunge la gif di loading e la rimuove quando termina\n$(document).on({\n    ajaxStart: function(){\n        $(\"body\").addClass(\"loading\");\n    },\n    ajaxStop: function(){\n        $(\"body\").removeClass(\"loading\");\n    }\n});\n\n$(document).on('input', '.uppercase-input', function() {\n  this.value = this.value.toUpperCase();\n});\n", "\n$(document).on(\"turbo:load\", () => {\n  const treeview = window.elinkSidebarTreeview;\n\n  // quando apro un piano/comparto/gruppo/scheda, mi apre la treeview nel punto corretto\n  var url = document.URL;\n  var tokens = url.split(\"/\");\n  var modulo = tokens[3];\n  if(modulo == 'vincoli' && treeview){\n    treeview.clearHighlights();\n    var posizione_attuale = tokens[4];\n    // se sono nel piano/comparto/gruppo/scheda apro la treeview partendo da quel livello e risalendo\n    if(['piano', 'comparto', 'gruppo', 'scheda'].includes(posizione_attuale) && typeof tokens[5] !== 'undefined'){\n      var id_attuale = tokens[5].split(\"?\")[0];\n      let element = $(\"li[id^='vincoli-piani'][id$='\" + posizione_attuale + \"_\" + id_attuale + \"']\");\n      if(element.length)\n        treeview.openAncestors(element);\n      // apro anche la treeview un livello sotto\n      const currentButton = treeview.findNodeButton(element);\n      if(posizione_attuale !== 'scheda' && currentButton.length){\n        treeview.expandButton(currentButton);\n      }\n    }\n    else{\n      const selettore_elemento = posizione_attuale === 'dashboard' ? '#vincoli-dashboard' : \"li[id^='vincoli'][id$='\" + posizione_attuale.split(\"?\")[0] + \"']\";\n      let element = $(selettore_elemento);\n      if(element.length)\n        treeview.openAncestors(element);\n      const currentButton = treeview.findNodeButton(element);\n      if(currentButton.length)\n        treeview.expandButton(currentButton);\n    }\n  }\n  // riordina un array di oggetti sulla base di una loro propriet\u00E0\n  function dynamicSort(property) {\n    var sortOrder = 1;\n    if(property[0] === \"-\") {\n      sortOrder = -1;\n      property = property.substr(1);\n    }\n    return function (a,b) {\n      /* next line works with strings and numbers,\n       * and you may want to customize it to your needs\n       */\n      var result = (a[property] < b[property]) ? -1 : (a[property] > b[property]) ? 1 : 0;\n      return result * sortOrder;\n    }\n  }\n\n  // dato il numero di mensilit\u00E0 in un anno, ricava il tipo di rateizzazione\n  function tipo_rate_text(tipo_rate) {\n    switch (Number(tipo_rate)) {\n      case 1:\n        return \"Annuali\";\n        break;\n      case 2:\n        return \"Semestrali\";\n        break;\n      case 3:\n        return \"Quadrimestrali\";\n        break;\n      case 4:\n        return \"Trimestrali\";\n        break;\n      case 6:\n        return \"Bimestrali\";\n        break;\n      case 12:\n        return \"Mensili\";\n        break;\n      default:\n        return '';\n    }\n  }\n\n  // formatta un numero col formato italiano (ex.: 10.000,00)\n  function number_format(number) {\n    if (typeof number === 'undefined' || number === null)\n      return \"0,00\";\n    if (typeof number === 'string') {\n      number = number.replace(/\\./g, '').replace(',', '.');\n      if(number === '')\n        return \"0,00\";\n    }\n    number = Number(number);\n    if(Number.isNaN(number))\n      return \"0,00\";\n\n    let decimals = 2;\n    let dec_point = ',';\n    let thousands_sep = '.';\n    number = number.toFixed(decimals);\n\n    var nstr = number.toString();\n    nstr += '';\n    x = nstr.split('.');\n    x1 = x[0];\n    x2 = x.length > 1 ? dec_point + x[1] : '';\n    var rgx = /(\\d+)(\\d{3})/;\n\n    while (rgx.test(x1))\n        x1 = x1.replace(rgx, '$1' + thousands_sep + '$2');\n\n    return x1 + x2;\n  }\n\n  // aggiunge uno 0 se la il giorno/mese ha un solo digit\n  function padTo2Digits(num) {\n    return num.toString().padStart(2, '0');\n  }\n\n  // formatta la data col formato dd-mm-yyyy\n  function formatDate(date) {\n    return [\n      padTo2Digits(date.getDate()),\n      padTo2Digits(date.getMonth() + 1),\n      date.getFullYear(),\n    ].join('/');\n  }\n\n  function updateGruppoTipologiaSchedeWarning() {\n    const gruppoContainer = $(\"#gruppo-container\");\n    const warningBox = $(\"#gruppo-tipologia-schede-warning\");\n    if (!gruppoContainer.length || !warningBox.length)\n      return;\n\n    const originalValue = gruppoContainer.data(\"originalTipologiaSchede\")?.toString();\n    const currentValue = $(\"input[name='gruppo[tipologia_schede]']:checked\").val();\n    warningBox.toggleClass(\"d-none\", !currentValue || currentValue.toString() === originalValue);\n  }\n\n  // aggiunge 'days' giorni ad una data\n  Date.prototype.addDays = function(days) {\n    var date = new Date(this.valueOf());\n    date.setDate(date.getDate() + days);\n    return date;\n  }\n\n  Date.prototype.addMonths = function(months) {\n    var date = new Date(this.valueOf());\n    date.setMonth(date.getMonth() + months);\n    return date;\n  }\n\n  Date.prototype.addYears = function(years) {\n    var date = new Date(this.valueOf());\n    date.setFullYear(date.getFullYear() + years);\n    return date;\n  }\n\n  const _MS_PER_DAY = 1000 * 60 * 60 * 24;\n\n  // a and b are javascript Date objects\n  function dateDiffInDays(a, b) {\n    // Discard the time and time-zone information.\n    const utc1 = Date.UTC(a.getFullYear(), a.getMonth(), a.getDate());\n    const utc2 = Date.UTC(b.getFullYear(), b.getMonth(), b.getDate());\n\n    return Math.floor((utc2 - utc1) / _MS_PER_DAY);\n  }\n\n  // a and b are javascript Date objects\n  function dateDiffInYears(dt1, dt2) {\n    // Discard the time and time-zone information.\n    var ageDifMs = dt1 - dt2;\n    var ageDate = new Date(ageDifMs); // miliseconds from epoch\n    return Math.abs(ageDate.getUTCFullYear() - 1970);\n  }\n\n  // nel PIP separo il minimo al mq dal minimo fisso, nel PEEP resta un solo minimo\n  $(\"#piano_tipologia\").on('change', function(){\n    if($(this).val() == '0'){\n      $(\"#valore_minimo_peep_row\").removeClass('d-none').prop('disabled', false);\n      $(\"#valore_minimo_mq_row\").addClass('d-none').prop('disabled', true);\n      $(\"#valore_minimo_fisso_row\").addClass('d-none').prop('disabled', true);\n      $(\"[name$='pip']\").addClass(\"d-none\");\n      $(\"[name$='pip'] select\").prop('required', false);\n      $(\"[name$='peep']\").removeClass(\"d-none\");\n      $(\"[name$='peep'] select\").prop('required', true);\n      $(\"#valore_massimo_row\").removeClass(\"d-none\");\n    }\n    else if($(this).val() == '1'){\n      $(\"#valore_minimo_peep_row\").addClass('d-none').prop('disabled', true);\n      $(\"#valore_minimo_mq_row\").removeClass('d-none').prop('disabled', false);\n      $(\"#valore_minimo_fisso_row\").removeClass('d-none').prop('disabled', false);\n      $(\"[name$='pip']\").removeClass(\"d-none\");\n      $(\"[name$='pip'] select\").prop('required', true);\n      $(\"[name$='peep']\").addClass(\"d-none\");\n      $(\"[name$='peep'] select\").prop('required', false);\n      $(\"#valore_massimo_row\").addClass(\"d-none\");\n    }\n  }).trigger('change');\n\n  // abilita/disabilita la selezione di piani/comparti/gruppi per la copia\n  $(\"#abilita-copia\").on('click', function(){\n    if(this.checked){\n      $(\"#import_piano\").prop(\"disabled\", false);\n    }\n    else{\n      $(\"#import_piano\").prop(\"disabled\", true);\n    }\n  });\n\n  // abilita/disabilita la selezione degli elementi da copiare per i piani\n  $(\"#import_piano\").on('change', function(){\n    let id = $(\"#import_piano\").val();\n    let filtro = $(\"#import_piano\").attr('filtro');\n\n    if(this.value != ''){\n      $(\"[name='copia-piano']\").prop(\"disabled\", false);\n      $(\"#import_piano_button\").prop(\"disabled\", false);\n      $(\"#import_piano_button\").addClass(\"eln-full-green-button\");\n    }\n    else{\n      $(\"[name='copia-piano']\").prop(\"disabled\", true);\n      $(\"#import_piano_button\").prop(\"disabled\", true);\n      $(\"#import_piano_button\").removeClass(\"eln-full-green-button\");\n      $(\"#import_comparto\").empty();\n      $(\"#import_comparto\").append('<option value=\"\">Seleziona un Comparto</option>');\n      $(\"#import_comparto\").prop(\"disabled\", true);\n      $(\"#import_gruppo\").empty();\n      $(\"#import_gruppo\").append('<option value=\"\">Seleziona un Gruppo</option>');\n      $(\"#import_gruppo\").prop(\"disabled\", true);\n      $(\"#import_gruppo_button\").prop(\"disabled\", true);\n      return;\n    }\n\n    $.ajax({\n      url: \"/comparti\",\n      method: \"GET\",\n      dataType: \"json\",\n      data: {piano_id: id, filtro: filtro},\n      error: function (xhr, status, error) {\n          console.error('AJAX Error: ' + status + \" \" + error);\n      },\n      success: function (comparti) {\n        if ($(\"#import_piano\").val() !== id)\n          return;\n\n        $(\"#import_comparto\").empty();\n        $(\"#import_comparto\").append('<option value=\"\">Seleziona un Comparto</option>');\n        for(var comparto of comparti)\n          $(\"#import_comparto\").append('<option value=\"'+comparto.id+'\">'+comparto.denominazione+'</option>');\n        $('#import_comparto').prop(\"disabled\", false);\n        $(\"#import_gruppo\").empty();\n        $(\"#import_gruppo\").append('<option value=\"\">Seleziona un Gruppo</option>');\n        $('#import_gruppo').prop(\"disabled\", true);\n        $(\"#import_gruppo_button\").prop(\"disabled\", true);\n      }\n    });\n  });\n\n  // importa i l'iter/le agevolazioni/il corrispettivo minimo da un altro piano in fase di creazione/modifica del piano\n  $(\"#import_piano_button\").on('click', function(){\n    var import_iter_affrancazione = document.getElementById('copia-iter-affrancazione').checked;\n    var import_iter_valore_ui = document.getElementById('copia-iter-valore-ui').checked;\n    var import_agevolazioni = document.getElementById('copia-agevolazioni').checked;\n    var import_corrispettivo_minimo = document.getElementById('copia-corrispettivo-minimo').checked;\n    var import_corrispettivo_massimo = document.getElementById('copia-corrispettivo-massimo').checked;\n    var import_formule = document.getElementById('copia-formule').checked;\n    var piano = $(\"#import_piano\").val();\n    $.ajax({\n      url: \"/importa_piano\",\n      method: \"GET\",\n      dataType: \"json\",\n      data: {id: piano},\n      error: function (xhr, status, error) {\n        console.error('AJAX Error: ' + status + \" \" + error);\n      },\n      success: function (piano) {\n        if(import_iter_affrancazione){\n          $(\"#piano_giorni_scadenza_istruttorio_affrancazione\").val(piano.giorni_scadenza_istruttorio_affrancazione);\n          $(\"#piano_giorni_scadenza_accettazione\").val(piano.giorni_scadenza_accettazione);\n          $(\"#piano_giorni_sospensione_affrancazione\").val(piano.giorni_sospensione_affrancazione);\n          $(\"#piano_giorni_scadenza_invio_pagamento\").val(piano.giorni_scadenza_invio_pagamento);\n          $(\"#piano_giorni_scadenza_trasmissione_corrispettivo\").val(piano.giorni_scadenza_trasmissione_corrispettivo);\n          $(\"#piano_giorni_scadenza_pagamento\").val(piano.giorni_scadenza_pagamento);\n        }\n        if(import_iter_valore_ui){\n          $(\"#piano_giorni_scadenza_istruttorio_vendita\").val(piano.giorni_scadenza_istruttorio_vendita);\n          $(\"#piano_giorni_scadenza_stipula_atto\").val(piano.giorni_scadenza_stipula_atto);\n          $(\"#piano_giorni_sospensione_vendita\").val(piano.giorni_sospensione_vendita);\n          $(\"#piano_giorni_scadenza_invio_atto\").val(piano.giorni_scadenza_invio_atto);\n          $(\"#piano_giorni_scadenza_trasmissione_vair\").val(piano.giorni_scadenza_trasmissione_vair);\n        }\n        if(import_agevolazioni){\n          var i = 0;\n          for(let agevolazione of piano.agevolazione){\n            if($(\"#agevolazione-\" + i).hasClass(\"visually-hidden\")){\n              $('#agevolazione-' + i).removeClass(\"visually-hidden\");\n              $(\"#nuova_agevolazione-\" + (i - 1)).addClass(\"visually-hidden\");\n              $(\"#elimina_agevolazione-\" + (i - 1)).removeClass(\"visually-hidden\");\n            }\n            else{\n              $(\"#nuova_agevolazione-\" + i).addClass(\"visually-hidden\");\n              $(\"#elimina_agevolazione-\" + i).removeClass(\"visually-hidden\");\n            }\n            $(\"#piano_agevolazione_attributes_\" + i + \"_percentuale\").val(agevolazione.percentuale);\n            $(\"#piano_agevolazione_attributes_\" + i + \"_descrizione\").val(agevolazione.descrizione)\n\n            i++;\n          }\n        }\n        if(import_corrispettivo_minimo){\n          var indiciMinimi = { peep: 0, mq: 0, fisso: 0 };\n          for(let minimo of piano.valore_minimo_corrispettivo){\n            var gruppo = minimo.fisso ? \"fisso\" : ($(\"#piano_tipologia\").val() == \"0\" ? \"peep\" : \"mq\");\n            var i = indiciMinimi[gruppo];\n            var riga = $(\"#valore_minimo_\" + gruppo + \"-\" + i);\n            var indiceParam = gruppo == \"fisso\" ? 30 + i : i;\n\n            if(riga.hasClass(\"visually-hidden\")){\n              riga.removeClass(\"visually-hidden\");\n              $(\"#nuovo_valore_minimo_\" + gruppo + \"-\" + (i - 1)).addClass(\"visually-hidden\");\n              $(\"#elimina_valore_minimo_\" + gruppo + \"-\" + (i - 1)).removeClass(\"visually-hidden\");\n            }\n            else{\n              $(\"#nuovo_valore_minimo_\" + gruppo + \"-\" + i).addClass(\"visually-hidden\");\n              $(\"#elimina_valore_minimo_\" + gruppo + \"-\" + i).removeClass(\"visually-hidden\");\n            }\n\n            $(\"#piano_valore_minimo_corrispettivo_attributes_\" + indiceParam + \"_valore\").val(minimo.valore);\n            $(\"#piano_valore_minimo_corrispettivo_attributes_\" + indiceParam + \"_tipo_convenzione\").val(minimo.tipo_convenzione);\n            $(\"#piano_valore_minimo_corrispettivo_attributes_\" + indiceParam + \"_tipo_convenzione\").prop('checked', minimo.tipo_convenzione == 'diritto');\n            $(\"#piano_valore_minimo_corrispettivo_attributes_\" + indiceParam + \"_data\").val(minimo.data);\n            $(\"#piano_valore_minimo_corrispettivo_attributes_\" + indiceParam + \"_descrizione\").val(minimo.descrizione);\n            $(\"#piano_valore_minimo_corrispettivo_attributes_\" + indiceParam + \"__destroy\").val(0);\n\n            indiciMinimi[gruppo]++;\n          }\n        }\n        if(import_corrispettivo_massimo){\n          var i = 0;\n          for(let massimo of piano.valore_massimo_corrispettivo){\n            if($(\"#valore_massimo-\" + i).hasClass(\"visually-hidden\")){\n              $('#valore_massimo-' + i).removeClass(\"visually-hidden\");\n              $(\"#nuovo_valore_massimo-\" + (i - 1)).addClass(\"visually-hidden\");\n              $(\"#elimina_valore_massimo-\" + (i - 1)).removeClass(\"visually-hidden\");\n            }\n            else{\n              $(\"#nuovo_valore_massimo-\" + i).addClass(\"visually-hidden\");\n              $(\"#elimina_valore_massimo-\" + i).removeClass(\"visually-hidden\");\n            }\n            $(\"#piano_valore_massimo_corrispettivo_attributes_\" + i + \"_valore\").val(massimo.valore);\n            $(\"#piano_valore_massimo_corrispettivo_attributes_\" + i + \"_tipo_convenzione\").val(massimo.tipo_convenzione);\n            if(massimo.tipo_convenzione == 'diritto')\n              $(\"#piano_valore_massimo_corrispettivo_attributes_\" + i + \"_tipo_convenzione\").prop('checked', true);\n            $(\"#piano_valore_massimo_corrispettivo_attributes_\" + i + \"_data\").val(massimo.data);\n            $(\"#piano_valore_massimo_corrispettivo_attributes_\" + i + \"_descrizione\").val(massimo.descrizione);\n\n            i++;\n          }\n        }\n        if(import_formule){\n          for(let formula of piano.formula_affrancazione){\n            $(\"select[id^='piano_formula_affrancazione_id_']\").children(\"option[value='\" + formula.id + \"']\").prop(\"selected\", true);\n          }\n        }\n      }\n    });\n  });\n\n  // nella creazione/modifica di un piano, quando cambia la formula ne mostra il testo\n  $(\"select[name^='piano[formula_affrancazione]']\").on('change', function(){\n    var id = $(this).attr('id').split(\"_\")[4];\n    let value = Number($(this).val());\n    if(value == '')\n      $(\"#piano_formula_affrancazione_testo_\" + id).text(\"\");\n    else{\n      $.ajax({\n        url: \"/dettagli_formula\",\n        method: \"GET\",\n        dataType: \"json\",\n        data: {id: value},\n        error: function (xhr, status, error) {\n          console.error('AJAX Error: ' + status + \" \" + error);\n        },\n        success: function (formula) {\n          $(\"#piano_formula_affrancazione_testo_\" + id ).text(formula.testo);\n        }\n      });\n    }\n  });\n\n  // abilita/disabilita la selezione degli elementi da copiare per i comparti\n  $(\"#import_comparto\").on('change', function(){\n    let id = $(\"#import_comparto\").val();\n    let filtro = $(\"#import_comparto\").attr('filtro');\n\n    if(this.value != ''){\n      $(\"[name='copia-comparto']\").prop(\"disabled\", false);\n      $(\"#import_comparto_button\").prop(\"disabled\", false);\n      $(\"#import_comparto_button\").addClass(\"eln-full-green-button\");\n    }\n    else{\n      $(\"[name='copia-comparto']\").prop(\"disabled\", true);\n      $(\"#import_comparto_button\").prop(\"disabled\", true);\n      $(\"#import_comparto_button\").removeClass(\"eln-full-green-button\");\n      $(\"#import_gruppo\").empty();\n      $(\"#import_gruppo\").append('<option value=\"\">Seleziona un Gruppo</option>');\n      $(\"#import_gruppo\").prop(\"disabled\", true);\n      $(\"#import_gruppo_button\").prop(\"disabled\", true);\n      return;\n    }\n\n    $.ajax({\n      url: \"/gruppi\",\n      method: \"GET\",\n      dataType: \"json\",\n      data: {comparto_id: id, filtro: filtro},\n      error: function (xhr, status, error) {\n          console.error('AJAX Error: ' + status + \" \" + error);\n      },\n      success: function (gruppi) {\n        if ($(\"#import_comparto\").val() !== id)\n          return;\n\n        $(\"#import_gruppo\").empty();\n        $(\"#import_gruppo\").append('<option value=\"\">Seleziona un Gruppo</option>');\n        for(var gruppo of gruppi)\n          $(\"#import_gruppo\").append('<option value=\"'+gruppo.id+'\">'+gruppo.denominazione+'</option>');\n        $('#import_gruppo').prop(\"disabled\", false);\n        $(\"#import_gruppo_button\").prop(\"disabled\", true);\n      }\n    });\n  });\n\n  // importa le agevolazioni/il corrispettivo minimo da un altro comparto in fase di creazione/modifica del comparto\n  $(\"#import_comparto_button\").on('click', function(){\n    var import_agevolazioni = document.getElementById('copia-agevolazioni').checked;\n    var import_corrispettivo_minimo = document.getElementById('copia-corrispettivo-minimo').checked;\n    var import_corrispettivo_massimo = document.getElementById('copia-corrispettivo-massimo').checked;\n    var comparto = $(\"#import_comparto\").val();\n    $.ajax({\n      url: \"/importa_comparto\",\n      method: \"GET\",\n      dataType: \"json\",\n      data: {id: comparto},\n      error: function (xhr, status, error) {\n        console.error('AJAX Error: ' + status + \" \" + error);\n      },\n      success: function (comparto) {\n        if(import_agevolazioni){\n          var i = 0;\n          for(let agevolazione of comparto.agevolazione){\n            if($(\"#agevolazione-\" + i).hasClass(\"visually-hidden\")){\n              $('#agevolazione-' + i).removeClass(\"visually-hidden\");\n              $(\"#nuova_agevolazione-\" + (i - 1)).addClass(\"visually-hidden\");\n              $(\"#elimina_agevolazione-\" + (i - 1)).removeClass(\"visually-hidden\");\n            }\n            else{\n              $(\"#nuova_agevolazione-\" + i).addClass(\"visually-hidden\");\n              $(\"#elimina_agevolazione-\" + i).removeClass(\"visually-hidden\");\n            }\n            $(\"#comparto_agevolazione_attributes_\" + i + \"_percentuale\").val(agevolazione.percentuale);\n            $(\"#comparto_agevolazione_attributes_\" + i + \"_descrizione\").val(agevolazione.descrizione)\n\n            i++;\n          }\n        }\n        if(import_corrispettivo_minimo){\n          var indiciMinimi = { peep: 0, mq: 0, fisso: 0 };\n          for(let minimo of comparto.valore_minimo_corrispettivo){\n            var gruppo = minimo.fisso ? \"fisso\" : ($(\"#valore_minimo_mq-0\").length ? \"mq\" : \"peep\");\n            var i = indiciMinimi[gruppo];\n            var prefissoRiga = gruppo == \"peep\" ? \"valore_minimo\" : \"valore_minimo_\" + gruppo;\n            var indiceParam = gruppo + \"_\" + i;\n            var riga = $(\"#\" + prefissoRiga + \"-\" + i);\n\n            if(riga.hasClass(\"visually-hidden\")){\n              riga.removeClass(\"visually-hidden\");\n              $(\"#nuovo_\" + prefissoRiga + \"-\" + (i - 1)).addClass(\"visually-hidden\");\n              $(\"#elimina_\" + prefissoRiga + \"-\" + (i - 1)).removeClass(\"visually-hidden\");\n            }\n            else{\n              $(\"#nuovo_\" + prefissoRiga + \"-\" + i).addClass(\"visually-hidden\");\n              $(\"#elimina_\" + prefissoRiga + \"-\" + i).removeClass(\"visually-hidden\");\n            }\n\n            $(\"#comparto_valore_minimo_corrispettivo_attributes_\" + indiceParam + \"_valore\").val(minimo.valore);\n            $(\"#comparto_valore_minimo_corrispettivo_attributes_\" + indiceParam + \"_tipo_convenzione\").val(minimo.tipo_convenzione);\n            $(\"#comparto_valore_minimo_corrispettivo_attributes_\" + indiceParam + \"_tipo_convenzione\").prop('checked', minimo.tipo_convenzione == 'diritto');\n            $(\"#comparto_valore_minimo_corrispettivo_attributes_\" + indiceParam + \"_data\").val(minimo.data);\n            $(\"#comparto_valore_minimo_corrispettivo_attributes_\" + indiceParam + \"_descrizione\").val(minimo.descrizione);\n            $(\"#comparto_valore_minimo_corrispettivo_attributes_\" + indiceParam + \"__destroy\").val(0);\n\n            indiciMinimi[gruppo]++;\n          }\n        }\n        if(import_corrispettivo_massimo){\n          var i = 0;\n          for(let massimo of comparto.valore_massimo_corrispettivo){\n            if($(\"#valore_massimo-\" + i).hasClass(\"visually-hidden\")){\n              $('#valore_massimo-' + i).removeClass(\"visually-hidden\");\n              $(\"#nuovo_valore_massimo-\" + (i - 1)).addClass(\"visually-hidden\");\n              $(\"#elimina_valore_massimo-\" + (i - 1)).removeClass(\"visually-hidden\");\n            }\n            else{\n              $(\"#nuovo_valore_massimo-\" + i).addClass(\"visually-hidden\");\n              $(\"#elimina_valore_massimo-\" + i).removeClass(\"visually-hidden\");\n            }\n            $(\"#comparto_valore_massimo_corrispettivo_attributes_\" + i + \"_valore\").val(massimo.valore);\n            $(\"#comparto_valore_massimo_corrispettivo_attributes_\" + i + \"_tipo_convenzione\").val(massimo.tipo_convenzione);\n            if(massimo.tipo_convenzione == 'diritto')\n              $(\"#comparto_valore_massimo_corrispettivo_attributes_\" + i + \"_tipo_convenzione\").prop('checked', true);\n            $(\"#comparto_valore_massimo_corrispettivo_attributes_\" + i + \"_data\").val(massimo.data);\n            $(\"#comparto_valore_massimo_corrispettivo_attributes_\" + i + \"_descrizione\").val(massimo.descrizione);\n\n            i++;\n          }\n        }\n      }\n    });\n  });\n\n  // aggiunge una riga vuota per inserire una nuova agevolazione in fase di creazione/modifica di un piano/comparto\n  $(\"[name='nuova_agevolazione']\").on('click', function(){\n    var n_riga = Number($(this).attr('id').split(\"-\")[1]);\n    var n_nuova_riga = n_riga + 1;\n    $('#agevolazione-'+n_nuova_riga).removeClass(\"visually-hidden\");\n    $(\"#nuova_agevolazione-\"+n_riga).addClass(\"visually-hidden\");\n    $(\"#elimina_agevolazione-\"+n_riga).removeClass(\"visually-hidden\")\n  });\n\n  // rimuove un'agevolazione in fase di creazione/modifica di un piano/comparto\n  $(\"[name='elimina_agevolazione']\").on('click', function(){\n    var n_riga = Number($(this).attr('id').split(\"-\")[1]);\n    $('#agevolazione-'+n_riga).addClass(\"visually-hidden\");\n    $(this).children().tooltip('hide');\n    $(\"[name$='[agevolazione_attributes][\" + n_riga + \"][_destroy]']\").val(1);\n  });\n\n  // aggiunge una riga vuota per inserire una nuovo valore minimo in fase di creazione/modifica di un piano/comparto/gruppo\n  $(\"[name='nuovo_valore_minimo']\").on('click', function(){\n    var prefix = $(this).attr('id').split(\"-\")[0].replace(\"nuovo_\", \"\");\n    var n_riga = Number($(this).attr('id').split(\"-\")[1]);\n    var n_nuova_riga = n_riga + 1;\n    $('#' + prefix + '-' + n_nuova_riga).removeClass(\"visually-hidden\");\n    $(\"#nuovo_\" + prefix + \"-\" + n_riga).addClass(\"visually-hidden\");\n    $(\"#elimina_\" + prefix + \"-\" + n_riga).removeClass(\"visually-hidden\")\n  });\n\n  // rimuove un valore minimo in fase di creazione/modifica di un piano/comparto/gruppo\n  $(\"[name='elimina_valore_minimo']\").on('click', function(){\n    var prefix = $(this).attr('id').split(\"-\")[0].replace(\"elimina_\", \"\");\n    var n_riga = Number($(this).attr('id').split(\"-\")[1]);\n    var riga = $('#' + prefix + '-' + n_riga);\n    riga.addClass(\"visually-hidden\");\n    $(this).children().tooltip('hide');\n    riga.find(\"[name$='[_destroy]']\").val(1);\n  });\n\n  // aggiunge una riga vuota per inserire una nuovo valore massimo in fase di creazione/modifica di un piano/comparto/gruppo\n  $(\"[name='nuovo_valore_massimo']\").on('click', function(){\n    var n_riga = Number($(this).attr('id').split(\"-\")[1]);\n    var n_nuova_riga = n_riga + 1;\n    $('#valore_massimo-'+n_nuova_riga).removeClass(\"visually-hidden\");\n    $(\"#nuovo_valore_massimo-\"+n_riga).addClass(\"visually-hidden\");\n    $(\"#elimina_valore_massimo-\"+n_riga).removeClass(\"visually-hidden\")\n  });\n\n  // rimuove un valore massimo in fase di creazione/modifica di un piano/comparto/gruppo\n  $(\"[name='elimina_valore_massimo']\").on('click', function(){\n    var n_riga = Number($(this).attr('id').split(\"-\")[1]);\n    $('#valore_massimo-'+n_riga).addClass(\"visually-hidden\");\n    $(this).children().tooltip('hide');\n    $(\"[name$='[valore_massimo_corrispettivo_attributes][\" + n_riga + \"][_destroy]']\").val(1);\n  });\n\n\n  function updateCodiceAttoDetails() {\n    var codiceId = $(\"#atto_codice_atto\").val();\n    var $selected = $(\"#atto_codice_atto_datalist option\").filter(function() {\n      return String($(this).data(\"id\")) === String(codiceId);\n    }).first();\n\n    if(codiceId === \"\" || $selected.length === 0){\n      $(\"#atto_codice\").text(\"\");\n      $(\"#atto_specie\").text(\"\");\n      return;\n    }\n\n    $(\"#atto_codice\").text($selected.attr(\"data-codice\") || \"\");\n    $(\"#atto_specie\").text($selected.attr(\"data-specie\") || \"\");\n  }\n\n  function updateNotaioDetails() {\n    var notaioId = $(\"#atto_notaio_id\").val();\n    var $selected = $(\"#atto_notaio_id_datalist option\").filter(function() {\n      return String($(this).data(\"id\")) === String(notaioId);\n    }).first();\n\n    if(notaioId === \"\" || $selected.length === 0){\n      $(\"#notaio_codice_fiscale\").text(\"\");\n      $(\"#notaio_sede\").text(\"\");\n      $(\"#modifica_notaio_button\").addClass(\"d-none\");\n      return;\n    }\n\n    $(\"#notaio_codice_fiscale\").text($selected.attr(\"data-codice-fiscale\") || \"\");\n    $(\"#notaio_sede\").text($selected.attr(\"data-sede\") || \"\");\n    $(\"#modifica_notaio_button\").removeClass(\"d-none\");\n  }\n\n  function enableDatalistSelection(inputSelector, hiddenSelector, datalistSelector, detailUpdater) {\n    var $input = $(inputSelector);\n    var $hidden = $(hiddenSelector);\n    var $options = $(datalistSelector).find(\"option\");\n\n    if($input.length === 0 || $hidden.length === 0)\n      return;\n\n    function syncSelection() {\n      var value = $.trim($input.val()).toLowerCase();\n      var $match = $options.filter(function() {\n        return $.trim($(this).attr(\"value\")).toLowerCase() === value;\n      }).first();\n\n      if($match.length > 0)\n        $hidden.val($match.data(\"id\"));\n      else\n        $hidden.val(\"\");\n\n      if(typeof detailUpdater === \"function\")\n        detailUpdater();\n    }\n\n    $input.on(\"input change\", function() {\n      syncSelection();\n    });\n\n    return {\n      refresh: function(selectedId, selectedLabel, attributes) {\n        var $match = $options.filter(function() {\n          return String($(this).data(\"id\")) === String(selectedId);\n        }).first();\n\n        if($match.length === 0 && selectedLabel) {\n          $match = $(\"<option>\", { value: selectedLabel })\n            .attr(\"data-id\", selectedId);\n\n          $.each(attributes || {}, function(key, value) {\n            $match.attr(\"data-\" + key, value);\n          });\n\n          $(datalistSelector).append($match);\n          $options = $(datalistSelector).find(\"option\");\n        }\n\n        $input.val(selectedLabel || \"\");\n        $hidden.val(selectedId || \"\");\n        if(typeof detailUpdater === \"function\")\n          detailUpdater();\n      },\n      isValid: function() {\n        return $.trim($input.val()) === \"\" || $.trim($hidden.val()) !== \"\";\n      },\n      clear: function() {\n        $input.val(\"\");\n        $hidden.val(\"\");\n        if(typeof detailUpdater === \"function\")\n          detailUpdater();\n      }\n    };\n  }\n\n  var codiceAttoSelection = enableDatalistSelection(\"#atto_codice_atto_label\", \"#atto_codice_atto\", \"#atto_codice_atto_datalist\", updateCodiceAttoDetails);\n  var notaioSelection = enableDatalistSelection(\"#atto_notaio_id_label\", \"#atto_notaio_id\", \"#atto_notaio_id_datalist\", updateNotaioDetails);\n\n  // quando un codice_atto viene selezionato, ne mostra i dettagli negli elementi a fianco\n  $(\"#atto_codice_atto_label\").on('change', function(){\n    updateCodiceAttoDetails();\n  });\n\n  updateCodiceAttoDetails();\n\n  // aggiunge una riga vuota per inserire un nuovo valore al MQ massimo per il corrispettivo\n  // in fase di creazione/modifica di un comparto\n  $(\"[name='nuovo_valore']\").on('click', function(){\n    var n_riga = Number($(this).attr('id').split(\"-\")[1]);\n    var n_nuova_riga = n_riga + 1;\n    $('#valore-'+n_nuova_riga).removeClass(\"visually-hidden\");\n    $(\"#nuovo_valore-\"+n_riga).addClass(\"visually-hidden\");\n    $(\"#elimina_valore-\"+n_riga).removeClass(\"visually-hidden\")\n  });\n\n  // rimuove un valore al MQ massimo per il corrispettivo in fase di creazione/modifica di un comparto\n  $(\"[name='elimina_valore']\").on('click', function(){\n    var n_riga = Number($(this).attr('id').split(\"-\")[1]);\n    $('#valore-'+n_riga).addClass(\"visually-hidden\");\n    $(this).children().tooltip('hide');\n    $(\"[name$='[valore_attributes][\" + n_riga + \"][_destroy]']\").val(1);\n  });\n\n  // mostra l'input per inserire un nuovo rogante (notaio) nella creazione/modifica di un atto\n  $(\"[name='nuovo_notaio']\").on('click', function(){\n    $('#crea_notaio').removeClass(\"d-none\");\n    $('#inserisci_notaio').addClass(\"d-none\");\n    $('#atto_notaio_id').prop(\"disabled\", true);\n  });\n\n  // crea un nuovo notaio, lo aggiunge alla lista dei notai e lo seleziona\n  $(\"#crea_notaio_submit\").on('click', function(event){\n    event.preventDefault();\n    var nominativo = $(\"#crea_notaio\").find(\"#notaio_nominativo\").val();\n    var codice_fiscale = $(\"#crea_notaio\").find(\"#notaio_codice_fiscale\").val();\n    var sede = $(\"#crea_notaio\").find(\"#notaio_sede\").val();\n    $.ajax({\n      url: \"/crea_notaio\",\n      method: \"POST\",\n      dataType: \"json\",\n      headers: csrfHeaders(),\n      data: {notaio: {nominativo: nominativo, codice_fiscale: codice_fiscale, sede: sede, notaio_manuale: true}},\n      error: function (xhr, status, error) {\n          console.error('AJAX Error: ' + status + \" \" + error);\n          alert(\"Impossibile salvare il rogante.\");\n      },\n      success: function (dati_notaio) {\n        $('#crea_notaio').addClass(\"d-none\");\n        $('#inserisci_notaio').removeClass(\"d-none\");\n        $('#atto_notaio_id').prop(\"disabled\", false);\n        if(notaioSelection)\n          notaioSelection.refresh(dati_notaio.id, dati_notaio.nominativo, {\n            \"codice-fiscale\": dati_notaio.codice_fiscale,\n            \"sede\": dati_notaio.sede\n          });\n      }\n    });\n  });\n\n  // mostra l'input per modificare un rogante (notaio) nella creazione/modifica di un atto\n  $(\"[name='modifica_notaio']\").on('click', function(){\n    $('#modifica_notaio').removeClass(\"d-none\");\n    $('#inserisci_notaio').addClass(\"d-none\");\n    $('#notaio_nominativo').val($(\"#atto_notaio_id_label\").val());\n    $(\"#modifica_notaio\").find('#notaio_codice_fiscale').val($(\"#notaio_codice_fiscale\").text());\n    $(\"#modifica_notaio\").find('#notaio_sede').val($(\"#inserisci_notaio\").find(\"#notaio_sede\").text());\n    $('#notaio_id').val($(\"#atto_notaio_id\").val());\n    $('#atto_notaio_id').prop(\"disabled\", true);\n    $('#atto_notaio_id_label').prop(\"disabled\", true);\n  });\n\n  // modifica un notaio esistente\n  $(\"#modifica_notaio_submit\").on('click', function(event){\n    event.preventDefault();\n    var nominativo = $(\"#modifica_notaio\").find(\"#notaio_nominativo\").val();\n    var codice_fiscale = $(\"#modifica_notaio\").find(\"#notaio_codice_fiscale\").val();\n    var sede = $(\"#modifica_notaio\").find(\"#notaio_sede\").val();\n    var id = $(\"#modifica_notaio\").find(\"#notaio_id\").val();\n    $.ajax({\n      url: \"/modifica_notaio\",\n      method: \"PATCH\",\n      dataType: \"json\",\n      headers: csrfHeaders(),\n      data: {notaio: {nominativo: nominativo, codice_fiscale: codice_fiscale, sede: sede, id: id}},\n      error: function (xhr, status, error) {\n          console.error('AJAX Error: ' + status + \" \" + error);\n          alert(\"Impossibile modificare il rogante.\");\n      },\n      success: function (dati_notaio) {\n        $('#modifica_notaio').addClass(\"d-none\");\n        $('#inserisci_notaio').removeClass(\"d-none\");\n        $('#atto_notaio_id').prop(\"disabled\", false);\n        $('#atto_notaio_id_label').prop(\"disabled\", false);\n        if(notaioSelection)\n          notaioSelection.refresh(dati_notaio.id, dati_notaio.nominativo, {\n            \"codice-fiscale\": dati_notaio.codice_fiscale,\n            \"sede\": dati_notaio.sede\n          });\n      }\n    });\n  });\n\n  // permette di tornare all'elenco dei notai nella creazione/modifica di un atto\n  $(\"[name='elenco_notai']\").on('click', function(){\n    $('#crea_notaio').addClass(\"d-none\");\n    $('#modifica_notaio').addClass(\"d-none\");\n    $('#inserisci_notaio').removeClass(\"d-none\");\n    $('#atto_notaio_id').prop(\"disabled\", false);\n    $('#atto_notaio_id_label').prop(\"disabled\", false);\n  });\n\n  // quando un notaio viene selezionato, ne mostra i dettagli negli elementi a fianco e ne abilita la modifica\n  $(\"#atto_notaio_id_label\").on('change', function(){\n    updateNotaioDetails();\n  });\n\n  updateNotaioDetails();\n\n  // elimina i parametri vuoti in fase di creazione di un atto\n  $(\"#crea_atto_submit\").on('click', function(){\n    if(codiceAttoSelection && !codiceAttoSelection.isValid()) {\n      $(\"#atto_codice_atto_label\")[0].setCustomValidity(\"Seleziona un codice atto dall'elenco.\");\n      $(\"#atto_codice_atto_label\")[0].reportValidity();\n      return;\n    }\n    $(\"#atto_codice_atto_label\")[0].setCustomValidity(\"\");\n    if(notaioSelection && !notaioSelection.isValid()) {\n      $(\"#atto_notaio_id_label\")[0].setCustomValidity(\"Seleziona un rogante dall'elenco.\");\n      $(\"#atto_notaio_id_label\")[0].reportValidity();\n      return;\n    }\n    $(\"#atto_notaio_id_label\")[0].setCustomValidity(\"\");\n    if($(\"#atto_codice_atto\").val() == '')\n      $(\"#atto_codice_atto\").remove();\n    if($(\"#atto_notaio_id\").val() == '')\n      $(\"#atto_notaio_id\").remove();\n    $(\"#crea_atto\").trigger('submit');\n  });\n  // elimina i parametri vuoti in fase di modifica di un atto\n  $(\"#modifica_atto_submit\").on('click', function(){\n    if(codiceAttoSelection && !codiceAttoSelection.isValid()) {\n      $(\"#atto_codice_atto_label\")[0].setCustomValidity(\"Seleziona un codice atto dall'elenco.\");\n      $(\"#atto_codice_atto_label\")[0].reportValidity();\n      return;\n    }\n    $(\"#atto_codice_atto_label\")[0].setCustomValidity(\"\");\n    if(notaioSelection && !notaioSelection.isValid()) {\n      $(\"#atto_notaio_id_label\")[0].setCustomValidity(\"Seleziona un rogante dall'elenco.\");\n      $(\"#atto_notaio_id_label\")[0].reportValidity();\n      return;\n    }\n    $(\"#atto_notaio_id_label\")[0].setCustomValidity(\"\");\n    if($(\"#atto_codice_atto\").val() == '')\n      $(\"#atto_codice_atto\").remove();\n    if($(\"#atto_notaio_id\").val() == '')\n      $(\"#atto_notaio_id\").remove();\n    $(\"#modifica_atto\").trigger('submit');\n  });\n\n  function attoFilterOption(field, text, value) {\n    return $(\"<option>\", { value: text }).attr(\"data-value\", value);\n  }\n\n  function escapeHtml(text) {\n    return $(\"<div>\").text(text == null ? '' : text).html();\n  }\n\n  function csrfHeaders() {\n    return { \"X-CSRF-Token\": $(\"meta[name=csrf-token]\").attr(\"content\") };\n  }\n\n  function disabledAttoIds() {\n    var disabledIds = ($(\"#atti_table\").data(\"disabled-atto-ids\") || '').toString();\n\n    if(disabledIds === '')\n      return [];\n\n    return $.map(disabledIds.split(','), function(value) {\n      var parsed = Number($.trim(value));\n      return Number.isNaN(parsed) ? null : parsed;\n    });\n  }\n\n  function showAttoStatusColumn() {\n    return $(\"#atti_table\").data(\"show-status-column\") === true || $(\"#atti_table\").attr(\"data-show-status-column\") === 'true';\n  }\n\n  function attoRowIdPrefix() {\n    return $(\"#atti_table\").data(\"row-id-prefix\") || \"atto_numero\";\n  }\n\n  function renderAttoRows(elenco_atti) {\n    var html = '';\n    var disabledIds = disabledAttoIds();\n    var showStatus = showAttoStatusColumn();\n    var colspan = showStatus ? 6 : 5;\n\n    $.each(elenco_atti, function(i, atto){\n      var notaioNominativo = '';\n      var notaioSede = '';\n      var attoDisabilitato = disabledIds.includes(Number(atto.id));\n      var rowClasses = 'btn-reveal-trigger fs--1';\n      if(typeof atto.notaio !== 'undefined' && atto.notaio !== null){\n        notaioNominativo = atto.notaio.nominativo || '';\n        notaioSede = atto.notaio.sede || '';\n      }\n      if(!attoDisabilitato)\n        rowClasses += \" selectable-row\";\n      else\n        rowClasses += \" table-secondary text-muted\";\n\n      html += \"\" +\n        \"<tr class='\" + rowClasses + \"' id='\" + attoRowIdPrefix() + \"-\" + atto.id + \"' data-disabled='\" + attoDisabilitato + \"'>\" +\n          \"<td>\" + escapeHtml(atto.repertorio) + \"</td>\" +\n          \"<td>\" + escapeHtml(atto.raccolta) + \"</td>\" +\n          \"<td>\" + escapeHtml(atto.data_formattata) + \"</td>\" +\n          \"<td>\" + escapeHtml(notaioNominativo) + \"</td>\" +\n          \"<td>\" + escapeHtml(notaioSede) + \"</td>\" +\n          (showStatus ? \"<td>\" + (attoDisabilitato ? \"<span class='eln-red-text'>Gia collegato</span>\" : \"\") + \"</td>\" : \"\") +\n        \"</tr>\";\n    });\n\n    if(html === ''){\n      html = \"<tr class='fs--1'><td colspan='\" + colspan + \"' class='text-center text-muted'>Nessun atto trovato</td></tr>\";\n    }\n\n    $(\"#atti_table tbody\").html(html);\n  }\n\n  function clearAttoFilterDatalists() {\n    $(\"#repertorio_datalist\").empty();\n    $(\"#raccolta_datalist\").empty();\n    $(\"#data_validita_datalist\").empty();\n    $(\"#notaio_datalist\").empty();\n  }\n\n  function rebuildAttoFilterDatalists(elenco_atti) {\n    var repertorioOptions = {};\n    var raccoltaOptions = {};\n    var dataValiditaOptions = {};\n    var notaioOptions = {};\n\n    $.each(elenco_atti, function(i, atto){\n      if(atto.repertorio)\n        repertorioOptions[atto.repertorio] = atto.repertorio;\n      if(atto.raccolta)\n        raccoltaOptions[atto.raccolta] = atto.raccolta;\n      if(atto.data && atto.data_formattata)\n        dataValiditaOptions[atto.data_formattata] = atto.data;\n      if(typeof atto.notaio !== 'undefined' && atto.notaio !== null && atto.notaio.nominativo)\n        notaioOptions[atto.notaio.nominativo] = atto.notaio.id;\n    });\n\n    $(\"#repertorio_datalist\").empty();\n    $.each(Object.keys(repertorioOptions).sort(), function(i, key){\n      $(\"#repertorio_datalist\").append(attoFilterOption(\"repertorio\", key, repertorioOptions[key]));\n    });\n\n    $(\"#raccolta_datalist\").empty();\n    $.each(Object.keys(raccoltaOptions).sort(), function(i, key){\n      $(\"#raccolta_datalist\").append(attoFilterOption(\"raccolta\", key, raccoltaOptions[key]));\n    });\n\n    $(\"#data_validita_datalist\").empty();\n    $.each(Object.keys(dataValiditaOptions).sort(function(a, b){\n      var aSplit = a.split('/');\n      var bSplit = b.split('/');\n      return new Date(aSplit[2], aSplit[1] - 1, aSplit[0]) - new Date(bSplit[2], bSplit[1] - 1, bSplit[0]);\n    }), function(i, key){\n      $(\"#data_validita_datalist\").append(attoFilterOption(\"data_validita\", key, dataValiditaOptions[key]));\n    });\n\n    $(\"#notaio_datalist\").empty();\n    $.each(Object.keys(notaioOptions).sort(), function(i, key){\n      $(\"#notaio_datalist\").append(attoFilterOption(\"notaio\", key, notaioOptions[key]));\n    });\n  }\n\n  function syncAttoFilterHiddenValues() {\n    $(\".atto-filter-input\").each(function(){\n      var $input = $(this);\n      var typedValue = $.trim($input.val());\n      var target = $input.data(\"target\");\n      var $matchedOption = $(\"#\" + $input.attr(\"list\") + \" option\").filter(function(){\n        return $(this).val() === typedValue;\n      }).first();\n\n      if(typedValue === '' || $matchedOption.length === 0)\n        $(\"#\" + target).val('');\n      else\n        $(\"#\" + target).val($matchedOption.data(\"value\"));\n\n      $input.get(0).setCustomValidity('');\n    });\n  }\n\n  function restoreInitialAttoRows() {\n    var $tableBody = $(\"#atti_table tbody\");\n    var initialHtml = $tableBody.data(\"initial-html\");\n    if(typeof initialHtml !== 'undefined')\n      $tableBody.html(initialHtml);\n  }\n\n  function applyAttoFilters() {\n    var repertorio = $(\"#repertorio_input\").val();\n    var raccolta = $(\"#raccolta_input\").val();\n    var dataValidita = $(\"#data_validita_input\").val();\n    var notaio = $(\"#notaio_input\").val();\n    var requestId;\n\n    if(window.attoFiltersRequest && window.attoFiltersRequest.readyState !== 4)\n      window.attoFiltersRequest.abort();\n\n    window.attoFiltersRequestId = (window.attoFiltersRequestId || 0) + 1;\n    requestId = window.attoFiltersRequestId;\n\n    if($.trim(repertorio) === '' && $.trim(raccolta) === '' && $.trim(dataValidita) === '' && $.trim(notaio) === ''){\n      restoreInitialAttoRows();\n      clearAttoFilterDatalists();\n      syncAttoFilterHiddenValues();\n      return;\n    }\n\n    window.attoFiltersRequest = $.ajax({\n      url: \"/elenco_atti\",\n      method: \"GET\",\n      dataType: \"json\",\n      data: {repertorio: repertorio, raccolta: raccolta, data_validita: dataValidita, notaio: notaio},\n      error: function (xhr, status, error) {\n          if(status === 'abort')\n            return;\n          console.error('AJAX Error: ' + status + \" \" + error);\n      },\n      success: function (elenco_atti) {\n        if(requestId !== window.attoFiltersRequestId)\n          return;\n\n        renderAttoRows(elenco_atti);\n        rebuildAttoFilterDatalists(elenco_atti);\n        syncAttoFilterHiddenValues();\n      }\n    });\n  }\n\n  var applyAttoFiltersTimeout = null;\n\n  $(document).on('input', \".atto-filter-input\", function(){\n    clearAttoFilterDatalists();\n    clearTimeout(applyAttoFiltersTimeout);\n    applyAttoFiltersTimeout = setTimeout(function(){\n      applyAttoFilters();\n    }, 200);\n  });\n\n  $(document).on('change blur', \".atto-filter-input\", function(){\n    syncAttoFilterHiddenValues();\n    applyAttoFilters();\n  });\n\n  $(document).off('submit.confirmEmptyAttoSelection', '.confirm-empty-atto-selection-form');\n  $(document).on('submit.confirmEmptyAttoSelection', '.confirm-empty-atto-selection-form', function(event){\n    let conferma = $(this).data('confirm-empty-selection');\n    let attoSelezionato = $(this).find(\"[id$='_convenzione_finale_id']\").filter(function() {\n      return $(this).val() !== '';\n    }).length > 0;\n\n    if (!attoSelezionato && conferma && !confirm(conferma)) {\n      event.preventDefault();\n    }\n  });\n\n  if($(\".atto-filter-input\").length > 0 && $(\"#atti_table tbody\").length > 0)\n    $(\"#atti_table tbody\").data(\"initial-html\", $(\"#atti_table tbody\").html());\n\n  // selezionando un atto, ne apre il dettaglio\n  $(document).on('click', \".selectable-row[id^='atto_numero']\", function(){\n    if ($(this).data('disabled') === true || $(this).attr('data-disabled') === 'true')\n      return;\n\n    let id = Number($(this).attr('id').split(\"-\")[1]);\n    $.ajax({\n      url: \"/dati_atto\",\n      method: \"GET\",\n      dataType: \"json\",\n      data: {atto: id},\n      error: function (xhr, status, error) {\n          console.error('AJAX Error: ' + status + \" \" + error);\n      },\n      success: function (dati_atto) {\n        $(\"[id^='atto_numero-']\").removeClass(\"table-active\");\n        $(\"#atto_numero-\" + dati_atto.id).addClass(\"table-active\");\n        $(\"#repertorio_selezionato\").text(dati_atto.repertorio);\n        $(\"#raccolta_selezionata\").text(dati_atto.raccolta);\n        let data = new Date(dati_atto.data)\n        $(\"#data_validita_selezionata\").text(formatDate(new Date(dati_atto.data)));\n        if(dati_atto.codice_atto_id == null){\n          $(\"#codice_selezionato\").text('');\n          $(\"#specie_selezionata\").text('');\n          $(\"#descrizione_selezionata\").text('');\n        }\n        else{\n          $(\"#codice_selezionato\").text(dati_atto.codice_atto.codice);\n          $(\"#specie_selezionata\").text(dati_atto.codice_atto.specie);\n          $(\"#descrizione_selezionata\").text(dati_atto.codice_atto.decodifica);\n        }\n        if(dati_atto.notaio_id == null){\n          $(\"#notaio_selezionato\").text('');\n          $(\"#codice_fiscale_selezionato\").text('');\n          $(\"#sede_selezionata\").text('');\n        }\n        else{\n          $(\"#notaio_selezionato\").text(dati_atto.notaio.nominativo);\n          $(\"#codice_fiscale_selezionato\").text(dati_atto.notaio.codice_fiscale);\n          $(\"#sede_selezionata\").text(dati_atto.notaio.sede);\n        }\n        $(\"#numero_selezionato\").text(dati_atto.numero);\n        $(\"#progressivo_selezionato\").text(dati_atto.progressivo);\n        $(\"#anno_selezionato\").text(dati_atto.anno);\n        if (dati_atto.data_registrazione != null)\n          $(\"#data_registrazione_selezionata\").text(formatDate(new Date(dati_atto.data_registrazione)));\n        else\n          $(\"#data_registrazione_selezionata\").text('');\n        $(\"#atto_selezionato\").removeClass(\"d-none\");\n        $(\"#gruppo_atto_id\").val(dati_atto.id);\n        $(\"#scheda_atto_id\").val(dati_atto.id);\n        $(\"li.next\").children(\"button\").removeClass(\"d-none\");\n        $(\"#iter_affrancazione_convenzione_finale_id\").val(dati_atto.id);\n        $(\"#iter_calcolo_valore_ui_convenzione_finale_id\").val(dati_atto.id);\n        $(\"#iter_requisiti_acquirenti_convenzione_finale_id\").val(dati_atto.id);\n        $(\"#no-atto\").prop(\"checked\", false);\n        $(\"#gruppo-con-atto\").removeClass(\"d-none\");\n      }\n    });\n  });\n\n  function syncSchedeTableContainerMaxHeight(){\n    const dettaglioAtto = $(\"#atto_selezionato\");\n    const schedeTableContainer = $(\"#schede_table_container\");\n\n    if(dettaglioAtto.length === 0 || schedeTableContainer.length === 0)\n      return;\n\n    if(dettaglioAtto.hasClass(\"d-none\")){\n      schedeTableContainer.css(\"max-height\", \"\");\n      return;\n    }\n\n    schedeTableContainer.css(\"max-height\", dettaglioAtto.outerHeight() + \"px\");\n  }\n\n  function mostraDettaglioGestioneAtti(){\n    $(\"#gestione_atti_ricerca\").addClass(\"d-none\");\n    $(\"#gestione_atti_dettaglio\").removeClass(\"d-none\");\n  }\n\n  function mostraRicercaGestioneAtti(){\n    $(\"#gestione_atti_dettaglio\").addClass(\"d-none\");\n    $(\"#gestione_atti_ricerca\").removeClass(\"d-none\");\n    $(\"#atto_selezionato\").addClass(\"d-none\");\n    $(\"#elenco_schede\").addClass(\"d-none\");\n    $(\"#elenco_immobili\").addClass(\"d-none\");\n    $(\"#atti_table_container\").addClass(\"gestione-atti-table-expanded\");\n    $(\"#schede_table_container\").css(\"max-height\", \"\");\n    $(\"#schede_table_body\").empty();\n    $(\"#terreni_table_body\").empty();\n    $(\"#fabbricati_table_body\").empty();\n    $(\"#intestati_table_body\").empty();\n    $(\"[id^='scheda_numero-']\").removeClass(\"table-active\");\n  }\n\n  // selezionando un atto nella gestione atti, ne apre il dettaglio completo\n  $(document).on('click', \".selectable-row[id^='atto_completo_numero']\", function(){\n    let id = Number($(this).attr('id').split(\"-\")[1]);\n    $.ajax({\n      url: \"/dati_atto_completo\",\n      method: \"GET\",\n      dataType: \"json\",\n      data: {atto: id},\n      error: function (xhr, status, error) {\n          console.error('AJAX Error: ' + status + \" \" + error);\n      },\n      success: function (dati_atto) {\n        var atto = dati_atto.atto;\n        var notaio = dati_atto.notaio;\n        var codice_atto = dati_atto.codice_atto;\n        var schede = dati_atto.schede;\n        var documento = dati_atto.documento;\n        var eliminabile = dati_atto.eliminabile;\n        var motiviNonEliminabile = dati_atto.motivi_non_eliminabile || [];\n        $(\"#elenco_immobili\").addClass(\"d-none\");\n        $(\"[id^='atto_completo_numero-']\").removeClass(\"table-active\");\n        $(\"#atto_completo_numero-\" + atto.id).addClass(\"table-active\");\n        $(\"#modifica_atto_link\").prop(\"href\", \"/vincoli/atto/\" + atto.id + \"/edit\");\n        $(\"#repertorio_selezionato\").text(atto.repertorio);\n        $(\"#raccolta_selezionata\").text(atto.raccolta);\n        let data = new Date(atto.data)\n        $(\"#data_validita_selezionata\").text(formatDate(new Date(atto.data)));\n        if(codice_atto == null){\n          $(\"#codice_selezionato\").text('');\n          $(\"#specie_selezionata\").text('');\n          $(\"#descrizione_selezionata\").text('');\n        }\n        else{\n          $(\"#codice_selezionato\").text(codice_atto.codice);\n          $(\"#specie_selezionata\").text(codice_atto.specie);\n          $(\"#descrizione_selezionata\").text(codice_atto.decodifica);\n        }\n        if(notaio == null){\n          $(\"#notaio_selezionato\").text('');\n          $(\"#codice_fiscale_selezionato\").text('');\n          $(\"#sede_selezionata\").text('');\n        }\n        else{\n          $(\"#notaio_selezionato\").text(notaio.nominativo);\n          $(\"#codice_fiscale_selezionato\").text(notaio.codice_fiscale);\n          $(\"#sede_selezionata\").text(notaio.sede);\n        }\n        $(\"#numero_selezionato\").text(atto.numero);\n        $(\"#progressivo_selezionato\").text(atto.progressivo);\n        $(\"#anno_selezionato\").text(atto.anno);\n        if (atto.data_registrazione != null)\n          $(\"#data_registrazione_selezionata\").text(formatDate(new Date(atto.data_registrazione)));\n        else\n          $(\"#data_registrazione_selezionata\").text('');\n        $(\"#atto_selezionato\").removeClass(\"d-none\");\n        $(\"#atti_table_container\").removeClass(\"gestione-atti-table-expanded\");\n        if(documento !== null && documento.url){\n          $(\"#documento_atto_link\").prop(\"href\", documento.url).prop(\"title\", documento.filename || \"Apri documento allegato\").removeClass(\"d-none\");\n          $(\"#rimuovi_documento_atto_link\").prop(\"href\", \"/vincoli/rimuovi_documento_atto/\" + atto.id + \"?atto=\" + atto.id).removeClass(\"d-none\");\n        }\n        else{\n          $(\"#documento_atto_link\").prop(\"href\", \"\").addClass(\"d-none\");\n          $(\"#rimuovi_documento_atto_link\").prop(\"href\", \"\").addClass(\"d-none\");\n        }\n\n        if($(\"#elimina_atto_link\").length){\n          $(\"#elimina_atto_link\").prop(\"href\", \"/vincoli/atto/\" + atto.id);\n          if(eliminabile){\n            $(\"#elimina_atto_link\").removeClass(\"disabled\").attr(\"aria-disabled\", \"false\").prop(\"title\", \"Elimina atto\");\n            $(\"#elimina_atto_hint\").text('').addClass(\"d-none\");\n          }\n          else{\n            $(\"#elimina_atto_link\").addClass(\"disabled\").attr(\"aria-disabled\", \"true\").prop(\"title\", \"Atto non eliminabile\");\n            $(\"#elimina_atto_hint\").text(\"Questo atto non pu\u00F2 essere eliminato perch\u00E9 risulta ancora collegato a \" + motiviNonEliminabile.join(\"; \")).removeClass(\"d-none\");\n          }\n        }\n\n        if(schede.length > 0)\n          $(\"#elenco_schede\").removeClass(\"d-none\");\n        else\n          $(\"#elenco_schede\").addClass(\"d-none\");\n        var html = \"\";\n        $.each(schede, function(i, scheda){\n          html += \"\" +\n            \"<tr class='btn-reveal-trigger fs--2 selectable-row' id='scheda_numero-\" + scheda.scheda_id + \"'>\" +\n              \"<td>\" + escapeHtml(scheda.piano) + \"</td>\" +\n              \"<td>\" + escapeHtml(scheda.comparto) + \"</td>\" +\n              \"<td>\" + escapeHtml(scheda.gruppo) + \"</td>\" +\n              \"<td>\" + escapeHtml(scheda.scheda) + \"</td>\" +\n            \"</tr>\";\n        });\n        $(\"#schede_table_body\").html(html);\n        mostraDettaglioGestioneAtti();\n        syncSchedeTableContainerMaxHeight();\n      }\n    });\n  });\n\n  $(document).on('click', \"#torna_a_ricerca_atti\", function(){\n    mostraRicercaGestioneAtti();\n  });\n\n  $(document).on('click', \"#elimina_atto_link.disabled\", function(event){\n    event.preventDefault();\n  });\n\n  //\n  $(\"#schede_table_body\").on('click', \"tr[id^='scheda_numero-']\", function(){\n    let id_scheda = Number($(this).attr('id').split(\"-\")[1]);\n    let id_atto = Number($(\".table-active[id^='atto_completo_numero-']\").attr('id').split(\"-\")[1]);\n    $.ajax({\n      url: \"/dati_immobili_da_scheda_e_atto\",\n      method: \"GET\",\n      dataType: \"json\",\n      data: {atto: id_atto, scheda: id_scheda},\n      error: function (xhr, status, error) {\n          console.error('AJAX Error: ' + status + \" \" + error);\n      },\n      success: function (dati_immobili) {\n        var terreno = dati_immobili.terreno;\n        var caratteristica = null;\n        if(terreno !== null)\n          var caratteristica = dati_immobili.terreno.caratteristica_corrente;\n        var fabbricati = dati_immobili.fabbricati;\n        var intestati = dati_immobili.intestati;\n\n        $(\"[id^='scheda_numero-']\").removeClass(\"table-active\");\n        $(\"#scheda_numero-\" + id_scheda).addClass(\"table-active\");\n\n        if(terreno !== null || fabbricati.length > 0)\n          $(\"#elenco_immobili\").removeClass(\"d-none\");\n        else\n          $(\"#elenco_immobili\").addClass(\"d-none\");\n\n        if(terreno !== null){\n          var qualita = caratteristica.qualita || \"\";\n          var html = \"\" +\n            \"<tr class='fs--1 align-middle text-center'>\" +\n              \"<td>1</td>\" +\n              \"<td>\" + escapeHtml(terreno.foglio) + \"</td>\" +\n              \"<td>\" + escapeHtml(terreno.numero) + \"</td>\" +\n              \"<td>\" + escapeHtml(terreno.subalterno) + \"</td>\" +\n              \"<td>\" + escapeHtml(qualita.charAt(0).toUpperCase() + qualita.slice(1)) + \"</td>\" +\n              \"<td>\" + escapeHtml(caratteristica.classe) + \"</td>\" +\n              \"<td>\" + escapeHtml(caratteristica.ettari) + \"&emsp;\" + escapeHtml(caratteristica.are) + \"&emsp;\" + escapeHtml(caratteristica.centiare) + \"</td>\" +\n              \"<td>\" + escapeHtml(caratteristica.reddito_dominicale_euro) + \"\u20AC</td>\" +\n              \"<td>\" +\n                \"<a class='btn btn-link' target='_blank' href='/stampa_visura/\" + caratteristica.terreno_id + \".pdf?tipo_immobile=terreno'>\"+\n                  \"<span class='eln-red-text bi bi-journal-text fs-1' data-bs-toggle='tooltip' title='' data-bs-original-title='Visura' aria-label='Visura'></span>\" +\n                \"</a>\" +\n              \"</td>\" +\n            \"</tr>\";\n          $(\"#terreni_table_body\").html(html);\n        }\n\n        html = \"\";\n        $.each(fabbricati, function(i, fabbricato){\n          var subalterno = fabbricato.identificativo.subalterno\n          if(subalterno === null)\n            subalterno = 0\n          html +=\n            \"<tr class='fs--1 align-middle text-center'>\" +\n              \"<td>1</td>\" +\n              \"<td>\" + escapeHtml(fabbricato.identificativo.foglio) + \"</td>\" +\n              \"<td>\" + escapeHtml(fabbricato.identificativo.numero) + \"</td>\" +\n              \"<td>\" + escapeHtml(subalterno) + \"</td>\" +\n              \"<td>\" + escapeHtml(fabbricato.caratteristica.categoria_catastale) + \"</td>\" +\n              \"<td>\" + escapeHtml(fabbricato.caratteristica.classe) + \"</td>\" +\n              \"<td>\" + escapeHtml(fabbricato.caratteristica.superficie) + \"</td>\" +\n              \"<td>\" + escapeHtml(fabbricato.caratteristica.rendita_euro) + \" \u20AC</td>\" +\n              \"<td>\" +\n                \"<a class='btn btn-link' target='_blank' href='/stampa_visura/\" + fabbricato.caratteristica.fabbricato_id + \".pdf?tipo_immobile=fabbricato'>\"+\n                  \"<span class='eln-red-text bi bi-journal-text fs-1' data-bs-toggle='tooltip' title='' data-bs-original-title='Visura' aria-label='Visura'></span>\" +\n                \"</a>\" +\n              \"</td>\" +\n            \"</tr>\";\n        });\n        $(\"#fabbricati_table_body\").html(html);\n        html = \"\";\n        $.each(intestati, function(i, intestato){\n          var nascita = intestato.nascita\n          if(nascita === null || nascita === ' il ')\n            nascita = \"-\";\n          html +=\n            \"<tr class='fs--1 align-middle text-center'>\" +\n              \"<td>\" + escapeHtml(intestato.nominativo) + \"</td>\" +\n              \"<td>\" + escapeHtml(intestato.codice_fiscale) + \"</td>\" +\n              \"<td>\" + escapeHtml(nascita) + \"</td>\" +\n            \"</tr>\";\n        });\n        $(\"#intestati_table_body\").html(html);\n\n      }\n    });\n  });\n\n  // elimina l'atto selezionato in fase di creazione/modifica dell'atto del gruppo\n  $(\"#no-atto\").on('change', function(){\n    if(this.checked){\n      $(\"#repertorio_selezionato\").text('');\n      $(\"#raccolta_selezionata\").text('');\n      $(\"#data_validita_selezionata\").text('');\n      $(\"#codice_selezionato\").text('');\n      $(\"#specie_selezionata\").text('');\n      $(\"#descrizione_selezionata\").text('');\n      $(\"#notaio_selezionato\").text('');\n      $(\"#codice_fiscale_selezionato\").text('');\n      $(\"#sede_selezionata\").text('');\n      $(\"#numero_selezionato\").text('');\n      $(\"#progressivo_selezionato\").text('');\n      $(\"#anno_selezionato\").text('');\n      $(\"#data_registrazione_selezionata\").text('');\n      $(\"#atto_selezionato\").addClass(\"d-none\");\n      $(\"#gruppo_atto_id\").val('');\n      $(\"#gruppo-con-atto\").addClass(\"d-none\");\n    }\n\n  });\n\n  // mostra/nasconde il corrispettivo minimo di propriet\u00E0/superficie quando viene\n  // modificata la tipologia del gruppo\n  const updateGruppoAdcConstraint = function() {\n    const adcInput = $(\"#gruppo_ADC\");\n    if (!adcInput.length) return;\n\n    const vincoliInfiniti = $(\"#gruppo_flg_convenzione_pre92\").is(\":checked\");\n    const tipologiaConvenzione = $(\"input[name='gruppo[tipologia_convenzione]']:checked\").val();\n    const adcMin = vincoliInfiniti && tipologiaConvenzione == \"0\" ? 0 : 1;\n\n    adcInput.attr(\"min\", adcMin);\n    if (adcMin === 1 && (adcInput.val() === \"\" || Number(adcInput.val()) <= 0)) {\n      adcInput.val(1);\n    }\n  };\n\n  $(\"input[name='gruppo[tipologia_convenzione]']:radio\").on('change', function(){\n    if (this.value == 1) {\n      $(\"#corrispettivo-minimo-diritti\").removeClass(\"d-none\");\n      $(\"#corrispettivo-minimo-proprieta\").addClass(\"d-none\");\n      $(\"#gruppo_flg_convenzione_pre92_row\").addClass(\"d-none\");\n      $(\"#gruppo_flg_convenzione_pre92\").prop( \"checked\", false );\n      $(\"[name^='gruppo[valore_minimo_corrispettivo_attributes]'][name$='[tipo_convenzione]']\").val(\"diritto\");\n      $(\"[name^='gruppo[valore_massimo_corrispettivo_attributes]'][name$='[tipo_convenzione]']\").val(\"diritto\");\n    }\n    else if (this.value == 0) {\n      $(\"#corrispettivo-minimo-diritti\").addClass(\"d-none\");\n      $(\"#corrispettivo-minimo-proprieta\").removeClass(\"d-none\");\n      $(\"#gruppo_flg_convenzione_pre92_row\").removeClass(\"d-none\");\n      $(\"[name^='gruppo[valore_minimo_corrispettivo_attributes]'][name$='[tipo_convenzione]']\").val(\"proprieta\");\n      $(\"[name^='gruppo[valore_massimo_corrispettivo_attributes]'][name$='[tipo_convenzione]']\").val(\"proprieta\");\n    }\n    updateGruppoAdcConstraint();\n  });\n\n  $(\"input[name='gruppo[tipologia_schede]']:radio\").on('change', updateGruppoTipologiaSchedeWarning);\n  $(\"#gruppo_flg_convenzione_pre92\").on(\"change\", updateGruppoAdcConstraint);\n  updateGruppoAdcConstraint();\n  updateGruppoTipologiaSchedeWarning();\n\n  // abilita/disabilita la selezione degli elementi da copiare per i piani\n  $(\"#import_gruppo\").on('change', function(){\n    if(this.value != ''){\n      $(\"#import_gruppo_button\").prop(\"disabled\", false);\n      $(\"#import_gruppo_button\").addClass(\"eln-full-green-button\");\n      let id = $(\"#import_gruppo\").val();\n      $(\"#scheda_gruppo_id\").val(id);\n    }\n    else{\n      $(\"#import_gruppo_button\").prop(\"disabled\", true);\n      $(\"#import_gruppo_button\").removeClass(\"eln-full-green-button\");\n    }\n    let id = $(\"#import_gruppo\").val();\n    if(id != '')\n      $.ajax({\n        url: \"/atto_gruppo\",\n        method: \"GET\",\n        dataType: \"json\",\n        data: {gruppo_id: id},\n        error: function (xhr, status, error) {\n            console.error('AJAX Error: ' + status + \" \" + error);\n        },\n        success: function (atto) {\n          if (atto !== null)\n            $(\"#atto_acquisto_destinazione\").text(\"Rep. n. \" + atto.repertorio + \" - Racc. n. \" + atto.raccolta + \" - Data: \" + formatDate(new Date(atto.data)));\n        }\n      });\n  });\n\n  // importa i i requisiti acquirenti da un altro gruppo in fase di creazione/modifica del gruppo\n  $(\"#import_gruppo_button\").on('click', function(){\n    let id = $(\"#import_gruppo\").val();\n    $.ajax({\n      url: \"/importa_gruppo\",\n      method: \"GET\",\n      dataType: \"json\",\n      data: {gruppo_id: id},\n      error: function (xhr, status, error) {\n          console.error('AJAX Error: ' + status + \" \" + error);\n      },\n      success: function (gruppo) {\n        var righeRequisiti = $(\"tr[id^='requisito-']\");\n        var i = righeRequisiti.toArray().findIndex((el, index) => {\n          return $(\"#gruppo_requisito_acquirente_attributes_\" + index + \"_descrizione_breve\").val() == '';\n        });\n        if (i < 0)\n          i = righeRequisiti.length;\n        for(let requisito of gruppo.requisito_acquirente){\n          if (i >= righeRequisiti.length) {\n            console.warn('Import requisiti interrotto: righe disponibili esaurite');\n            break;\n          }\n          if($(\"#requisito-\" + i).hasClass(\"visually-hidden\")){\n            $('#requisito-' + i).removeClass(\"visually-hidden\");\n            $(\"#nuovo_requisito-\" + (i - 1)).addClass(\"visually-hidden\");\n            $(\"#elimina_requisito-\" + (i - 1)).removeClass(\"visually-hidden\");\n          }\n          else{\n            $(\"#nuovo_requisito-\" + i).addClass(\"visually-hidden\");\n            $(\"#elimina_requisito-\" + i).removeClass(\"visually-hidden\");\n          }\n          $(\"#gruppo_requisito_acquirente_attributes_\" + i + \"_descrizione_breve\").val(requisito.descrizione_breve);\n          $(\"#gruppo_requisito_acquirente_attributes_\" + i + \"_descrizione\").val(requisito.descrizione)\n          $(\"#gruppo_requisito_acquirente_attributes_\" + i + \"__destroy\").val(0);\n\n          i++;\n        }\n      }\n    });\n  });\n\n  // aggiunge una riga vuota per inserire una nuova agevolazione in fase di creazione/modifica di un gruppo\n  $(\"[name='nuovo_requisito']\").on('click', function(){\n    var n_riga = Number($(this).attr('id').split(\"-\")[1]);\n    var n_nuova_riga = n_riga + 1;\n    $('#requisito-'+n_nuova_riga).removeClass(\"visually-hidden\");\n    $(\"#gruppo_requisito_acquirente_attributes_\" + n_nuova_riga + \"__destroy\").val(0);\n    $(\"#nuovo_requisito-\"+n_riga).addClass(\"visually-hidden\");\n    $(\"#elimina_requisito-\"+n_riga).removeClass(\"visually-hidden\")\n  });\n\n  // rimuove un requisito acquirente in fase di creazione/modifica di un gruppo\n  $(\"[name='elimina_requisito']\").on('click', function(){\n    var n_riga = Number($(this).attr('id').split(\"-\")[1]);\n    $('#requisito-'+n_riga).addClass(\"visually-hidden\");\n    $(this).children().tooltip('hide');\n    $(\"[name$='[requisito_acquirente_attributes][\" + n_riga + \"][_destroy]']\").val(1);\n  });\n\n  // in fase di creazione della scheda modifica la label riassuntiva che\n  // ricapitola il nome della scheda creata, in base a quello presente nel campo di input\n  $(\"form#crea_gruppo\").find(\"#gruppo_denominazione\").on('change', function(){\n    $(\"#nome_gruppo_creato\").text($(\"form#crea_gruppo\").find(\"#gruppo_denominazione\").val());\n  });\n\n  // crea il gruppo quando si arriva in fondo al wizard\n  $(\"#crea_gruppo_submit\").on('click', function(event){\n    event.preventDefault();\n    $(\"#crea_gruppo\").append($(\"input[id*='requisito_acquirente'], textarea[id*='requisito_acquirente']\"));\n    $(\"#crea_gruppo\").trigger('submit');\n  });\n\n  // in fase di creazione del gruppo modifica la label riassuntiva che\n  // ricapitola il nome del gruppo creato, in base a quello presente nel campo di input\n  $(\"form#crea_scheda\").find(\"#scheda_nominativo\").on('input change', function(){\n    $(\"#nome_scheda_creata\").text($(\"form#crea_scheda\").find(\"#scheda_nominativo\").val());\n  });\n\n  // crea la scheda quando si arriva in fondo al wizard\n  $(\"#crea_scheda_submit\").on('click', function(event){\n    event.preventDefault();\n    $(\"#crea_scheda\").trigger('submit');\n  });\n\n  // abilita la funzione per spostare una scheda in un gruppo diverso\n  $(\"#sposta_scheda\").on('click', function(){\n    if(this.checked){\n      $(\"#import_piano\").attr(\"disabled\", false);\n      $(\"#scheda_gruppo_id\").attr(\"disabled\", false);\n    }\n    else{\n      $(\"#import_piano\").attr(\"disabled\", true);\n      $(\"#import_comparto\").attr(\"disabled\", true);\n      $(\"#import_gruppo\").attr(\"disabled\", true);\n      $(\"#scheda_gruppo_id\").attr(\"disabled\", true);\n    }\n  });\n\n  // abilita i singoli passaggi in fase di creazione/modifica di una richiesta.\n  // sia per valore ui, che per affrancazione\n  $(\"[id|='crea-passaggio']\").on('change', function(){\n    var passaggio = $(this).attr('id').split(\"-\")[2];\n    if(this.checked){\n      $(\"#passaggio-\"+passaggio+\" :input\").attr(\"disabled\", false);\n    }\n    else{\n      $(\"#passaggio-\"+passaggio+\" :input\").attr(\"disabled\", true);\n    }\n  });\n\n  // abilita/disabilita la selezione di un requisito degli acquirenti nella gestione dei vincoli\n  $(\"[name^='requisito_'][name$='_check']\").on('change', function(){\n    var requisito = $(this).attr('name').split(\"_\")[1];\n    if(this.checked)\n      $(\"[name$='stato_\" + requisito + \"']\").attr(\"disabled\", false);\n    else\n      $(\"[name$='stato_\" + requisito + \"']\").attr(\"disabled\", true);\n  });\n\n  // selezionando una richiesta di calcolo valore unit\u00E0 immobiliare, ne apre il dettaglio\n  $(\"[id^='mostra-richiesta-valore-ui']\").on('click', function(){\n    let id = Number($(this).attr('id').split(\"-\")[4]);\n    $.ajax({\n      url: \"/dati_richiesta_calcolo_valore_ui\",\n      method: \"GET\",\n      dataType: \"json\",\n      data: {richiesta: id},\n      error: function (xhr, status, error) {\n          console.error('AJAX Error: ' + status + \" \" + error);\n      },\n      success: function (dati_richiesta) {\n        $(\"[id^='richiesta_calcolo_']\").removeClass(\"table-active\");\n        $(\"#richiesta_calcolo_\" + dati_richiesta.id).addClass(\"table-active\");\n        $(\"#elimina_richiesta_calcolo_valore_ui\").parent(\"form\").prop('action', '/vincoli/iter_calcolo_valore_ui/' + dati_richiesta.id)\n        var action = 'blocca_richiesta';\n        var tooltip = 'Concludi Richiesta';\n        var icon = 'bi-unlock-fill';\n        if(dati_richiesta.chiusa){\n          action = 'sblocca_richiesta';\n          tooltip = 'Riapri Richiesta';\n          icon = 'bi-lock-fill';\n        }\n        $(\"#concludi_richiesta_calcolo_valore_ui\").prop('href', '/vincoli/iter_calcolo_valore_ui/' + dati_richiesta.id + '/' + action);\n        $(\"#concludi_richiesta_calcolo_valore_ui\").siblings(\"p\").text(tooltip);\n        $(\"#concludi_richiesta_calcolo_valore_ui > span\").prop('tooltip', tooltip);\n        if(dati_richiesta.chiusa){\n          $(\"#concludi_richiesta_calcolo_valore_ui > span\").addClass('bi-lock-fill');\n          $(\"#concludi_richiesta_calcolo_valore_ui > span\").removeClass('bi-unlock-fill');\n        }\n        else{\n          $(\"#concludi_richiesta_calcolo_valore_ui > span\").removeClass('bi-lock-fill');\n          $(\"#concludi_richiesta_calcolo_valore_ui > span\").addClass('bi-unlock-fill');\n        }\n        $(\"#richiesta-calcolo-soggetto-referente\").text(dati_richiesta.soggetto_referente);\n        $(\"#modifica-richiesta-valore-ui\").prop(\"href\", \"/vincoli/iter_calcolo_valore_ui/\"+dati_richiesta.id+\"/edit\");\n\n        $(\"[id^='valore-ui-presenza-']\").prop(\"checked\", false);\n        $(\"[id^='valore-ui-protocollo-']\").text(\"\");\n        $(\"[id^='valore-ui-data-']\").text(\"\");\n        $(\"[id^='valore-ui-data-scadenza-']\").text(\"\");\n        $(\"[id^='valore-ui-file-']\").text(\"\");\n\n        for(let passaggio of dati_richiesta.passaggio_iter){\n          if(passaggio.data !== null){\n            $(\"#valore-ui-presenza-\" + passaggio.nome_passaggio).prop(\"checked\", true);\n            $(\"#valore-ui-protocollo-\" + passaggio.nome_passaggio).text(passaggio.protocollo);\n            $(\"#valore-ui-data-\" + passaggio.nome_passaggio).text(formatDate(new Date(passaggio.data)));\n            let data_scadenza = passaggio.data_scadenza === null ? '' : formatDate(new Date(passaggio.data_scadenza))\n            $(\"#valore-ui-data-scadenza-\" + passaggio.nome_passaggio).text(data_scadenza);\n            $(\"#valore-ui-file-\" + passaggio.nome_passaggio).text(\"\");\n          }\n          if(passaggio.data_scadenza !== null){\n            $(\"#valore-ui-data-scadenza-\" + passaggio.nome_passaggio).text(formatDate(new Date(passaggio.data_scadenza)));\n          }\n        }\n        if(typeof dati_richiesta.calcolo_valore_ui !== 'undefined'){\n          calcolo = dati_richiesta.calcolo_valore_ui;\n          $(\"#valore_ui_valore_iniziale_richiesta\").text(Number(calcolo.valore_iniziale).toFixed(2));\n          $(\"#valore_ui_data_valore_iniziale_richiesta\").text(formatDate(new Date(calcolo.data_valore_iniziale)));\n          $(\"#valore_ui_superficie_richiesta\").text(Number(calcolo.superficie).toFixed(2));\n          $(\"#valore_ui_percentuale_ISTAT_richiesta\").text(Number(calcolo.percentuale_ISTAT).toFixed(2));\n          $(\"#valore_ui_data_ISTAT_richiesta\").text(formatDate(new Date(calcolo.data_ISTAT)));\n          $(\"#valore_ui_percentuale_vetusta_richiesta\").text(Number(calcolo.percentuale_vetusta).toFixed(2));\n          $(\"#valore_ui_migliorie_richiesta\").text(Number(calcolo.migliorie).toFixed(2));\n          $(\"#valore_ui_totale_richiesta\").text(Number(calcolo.totale).toFixed(2));\n          $(\"#valore_ui_valore_massimo_locazione_richiesta\").text(Number(calcolo.totale * calcolo.percentuale_locazione / 100).toFixed(2));\n          $(\"#valore_ui_percentuale_locazione_richiesta\").text(Number(calcolo.percentuale_locazione).toFixed(2));\n          $(\"#valore_ui_data_calcolo_richiesta\").text(formatDate(new Date(calcolo.data_calcolo)));\n          $(\"#modifica-calcolo-ui-richiesta\").attr('href', '/calcolo_valore_ui/'+calcolo.id+'/edit');\n          $(\"#calcolo-richiesta-calcolo-ui\").removeClass(\"d-none\");\n          $(\"#nuovo_valore_ui\").addClass(\"d-none\");\n        }\n        else{\n          $(\"#nuovo_valore_ui\").attr('href', '/vincoli/scheda/' + dati_richiesta.scheda_id + '/calcolo_valore_ui/new?iter_id=' + dati_richiesta.id);\n          $(\"#nuovo_valore_ui\").removeClass(\"d-none\");\n          $(\"#calcolo-richiesta-calcolo-ui\").addClass(\"d-none\");\n        }\n\n        // per popolare i requisiti acquirenti, non ne conosco il numero a priori e\n        // non \u00E8 fisso, quindi dal javascript mi creo l'html necessario una volta ottenuti\n        // i dati della risposta\n        $(\"#aggiungi_richiesta_requisiti\").attr('href', '/vincoli/iter_calcolo_valore_ui/' + dati_richiesta.id + '/elenco_requisiti_acquirenti')\n        $(\"#requisiti-acquirenti\").find(\"a\").attr('href', '/iter_valore_ui_requisiti_acquirenti/' + dati_richiesta.id)\n        $(\"[name^='requisito']\").remove();\n\n        var cnt = 0\n        $(\"#elenco_richieste_requisiti_acquirenti_collegate > tbody\").empty();\n        var requisito = \"\";\n        $.each(dati_richiesta.iter_requisiti_acquirenti, function(i, richiesta_requisiti){\n          var id_requisiti = richiesta_requisiti.id;\n          var protocollo = richiesta_requisiti.richiesta_protocollo.protocollo;\n          var data = formatDate(new Date(richiesta_requisiti.richiesta_data.data));\n          var richiedente = richiesta_requisiti.soggetto_referente;\n          var richiesta_unica;\n          if(data == formatDate(new Date(dati_richiesta.passaggio_iter[0].data)) && protocollo == dati_richiesta.passaggio_iter[0].protocollo)\n            richiesta_unica = 'checked';\n          else\n            richiesta_unica = '';\n          var apri = '<a role=\"button\" href=\"/vincoli/scheda/' + dati_richiesta.scheda_id + '?iter_requisiti_acquirenti=' + id_requisiti + '&tab=vincoli&vincoli=requisiti\" class=\"eln-green-text px-2\">Apri</a>';\n          var elimina_o_scollega = '';\n          if(richiesta_unica == '')\n            elimina_o_scollega = '<a class=\"eln-yellow-text px-2\" data-turbo-method=\"put\" href=\"/vincoli/iter_calcolo_valore_ui/' + id_requisiti + '/scollega_richiesta_requisiti_acquirenti\">Scollega</a>';\n          else\n            elimina_o_scollega = '<a class=\"eln-red-text px-2\" data-turbo-method=\"delete\" href=\"/vincoli/iter_requisiti_acquirenti/' + id_requisiti + '?iter_calcolo=' + dati_richiesta.id + '\">Elimina</a>';\n\n          requisito += \"<tr>\" +\n                          \"<td class='fs--1 text-end'>\" + protocollo + \"</td>\" +\n                          \"<td class='fs--1'>\" + data + \"</td>\" +\n                          \"<td class='fs--1 text-start'>\" + richiedente + \"</td>\" +\n                          \"<td class='fs--1 text-center'><input type='checkbox' \" + richiesta_unica + \" disabled></td>\" +\n                          \"<td class='fs--1 text-center'>\" + apri + \" \" + elimina_o_scollega + \"</td>\" +\n                       \"</tr>\";\n          cnt += 1;\n        });\n        $(\"#elenco_richieste_requisiti_acquirenti_collegate > tbody\").html(requisito);\n        if(cnt > 0)\n          $(\"#requisiti-acquirenti-collegati\").removeClass(\"d-none\");\n        else\n          $(\"#requisiti-acquirenti-collegati\").addClass(\"d-none\");\n\n\n        if(typeof dati_richiesta.convenzione_finale !== 'undefined'){\n          var convenzione_finale = dati_richiesta.convenzione_finale;\n          $(\"#atto_compravendita_calcolo_repertorio\").text(convenzione_finale.repertorio);\n          $(\"#atto_compravendita_calcolo_raccolta\").text(convenzione_finale.raccolta);\n          $(\"#atto_compravendita_calcolo_data\").text(formatDate(new Date(convenzione_finale.data)));\n          $.ajax({\n            url: \"/dati_notaio\",\n            method: \"GET\",\n            dataType: \"json\",\n            data: {notaio: convenzione_finale.notaio_id},\n            error: function (xhr, status, error) {\n                console.error('AJAX Error: ' + status + \" \" + error);\n            },\n            success: function (dati_notaio) {\n              $(\"#atto_affrancazione_rogante\").text(dati_notaio.nominativo);\n            }\n          });\n          $(\"#atto_compravendita_calcolo_numero\").text(convenzione_finale.numero);\n          $(\"#atto_compravendita_calcolo_progressivo\").text(convenzione_finale.progressivo);\n          $(\"#atto_compravendita_calcolo_anno\").text(convenzione_finale.anno);\n          $(\"#atto_compravendita_calcolo_data_registrazione\").text(formatDate(new Date(convenzione_finale.data_registrazione)));\n          $(\"#elimina_atto_compravendita_calcolo\").find('form').prop(\"action\", \"/vincoli/iter_calcolo_valore_ui/\" + dati_richiesta.id + \"/convenzione_finale\");\n          $(\"#elimina_atto_compravendita_calcolo\").removeClass(\"d-none\");\n          $(\"#nuovo_atto_compravendita_calcolo\").addClass(\"d-none\");\n          $(\"#atto-compravendita-calcolo\").removeClass('d-none');\n        }\n        else{\n          $(\"#nuovo_atto_compravendita_calcolo\").attr('href', '/vincoli/iter_calcolo_valore_ui/' + dati_richiesta.id + '/convenzione_finale');\n          $(\"#nuovo_atto_compravendita_calcolo\").removeClass(\"d-none\");\n          $(\"#elimina_atto_compravendita_calcolo\").addClass(\"d-none\");\n          $(\"#atto-compravendita-calcolo\").addClass('d-none');\n        }\n        $(\"#richiesta-calcolo-valore-ui\").removeClass(\"d-none\");\n      }\n    });\n  });\n\n  // calcola/ricalcola il valore massimo (V.A.I.R.) in crea/modifica richiesta\n  $(\"#calcola_valore_massimo\").on('click', function(){\n    let data_calcolo = $(\"[name*='calcolo_valore_ui'][name$='[data_calcolo]']\").val();\n    let valore_iniziale = $(\"[name*='calcolo_valore_ui'][name$='[valore_iniziale]']\").val();\n    let superficie = $(\"[name*='calcolo_valore_ui'][name$='[superficie]']\").val();\n    let istat = $(\"[name*='calcolo_valore_ui'][name$='[percentuale_ISTAT]']\").val();\n    let vetusta = $(\"[name*='calcolo_valore_ui'][name$='[percentuale_vetusta]']\").val();\n    let migliorie = $(\"[name*='calcolo_valore_ui'][name$='[migliorie]']\").val();\n    $.ajax({\n      url: \"/calcola_valore_massimo\",\n      method: \"GET\",\n      dataType: \"json\",\n      data: {data_calcolo: data_calcolo, valore_iniziale: valore_iniziale,\n        superficie: superficie, istat: istat, vetusta: vetusta, migliorie: migliorie},\n      error: function (xhr, status, error) {\n          console.error('AJAX Error: ' + status + \" \" + error);\n      },\n      success: function (totale) {\n        $(\"#totale_valore_ui\").text(number_format(totale));\n        $(\"[name*='calcolo_valore_ui'][name$='[totale]']\").val(totale);\n      }\n    });\n  });\n\n  // quando modifico il calcolo del valore massimo, disabilito il pulsante di salvataggio\n  $(\"input[name*='calcolo_valore_ui_attributes'], input[name*='iter_requisiti_acquirenti[calcolo_valore_ui]']\").on(\"keydown\", function(){\n    $(\"#calcolo_ui_submit\").prop(\"disabled\", true);\n    $(\"#iter_vincoli_submit\").prop(\"disabled\", true);\n  })\n\n  // calcola/ricalcola il canone di locazione in crea/modifica richiesta\n  $(\"#calcola_canone_locazione\").on('click', function(){\n    let percentuale_locazione = $(\"[name*='calcolo_valore_ui'][name$='[percentuale_locazione]']\").val();\n    let totale = $(\"[name*='calcolo_valore_ui'][name$='[totale]']\").val();\n    var valore_locazione = totale * Number(percentuale_locazione) / 100;\n    $(\"#canone-locazione-valore\").text(number_format(valore_locazione));\n    $(\"#calcolo_ui_submit\").prop(\"disabled\", false);\n    $(\"#iter_vincoli_submit\").prop(\"disabled\", false);\n  });\n\n  // selezionando una richiesta dei requisiti acquirenti, ne apre il dettaglio\n  $(\"[id^='mostra-richiesta-requisiti-acquirenti']\").on('click', function(){\n    let id = Number($(this).attr('id').split(\"-\")[4]);\n    $.ajax({\n      url: \"/dati_richiesta_requisiti\",\n      method: \"GET\",\n      dataType: \"json\",\n      data: {richiesta: id},\n      error: function (xhr, status, error) {\n          console.error('AJAX Error: ' + status + \" \" + error);\n      },\n      success: function (dati_richiesta) {\n        $(\"[id^='richiesta_requisiti_acquirenti_']\").removeClass(\"table-active\");\n        $(\"#richiesta_requisiti_acquirenti_\" + dati_richiesta.id).addClass(\"table-active\");\n        $(\"#elimina_richiesta_requisiti_acquirenti\").parent(\"form\").prop('action', '/vincoli/iter_requisiti_acquirenti/' + dati_richiesta.id)\n        var action = 'blocca_richiesta';\n        var tooltip = 'Concludi Richiesta';\n        var icon = 'bi-unlock-fill';\n        if(dati_richiesta.chiusa){\n          action = 'sblocca_richiesta';\n          tooltip = 'Riapri Richiesta';\n          icon = 'bi-lock-fill';\n        }\n        $(\"#concludi_richiesta_requisiti_acquirenti\").prop('href', '/vincoli/iter_requisiti_acquirenti/' + dati_richiesta.id + '/' + action);\n        $(\"#concludi_richiesta_requisiti_acquirenti\").siblings(\"p\").text(tooltip);\n        $(\"#concludi_richiesta_requisiti_acquirenti > span\").prop('tooltip', tooltip);\n        if(dati_richiesta.chiusa){\n          $(\"#concludi_richiesta_requisiti_acquirenti > span\").addClass('bi-lock-fill');\n          $(\"#concludi_richiesta_requisiti_acquirenti > span\").removeClass('bi-unlock-fill');\n        }\n        else{\n          $(\"#concludi_richiesta_requisiti_acquirenti > span\").removeClass('bi-lock-fill');\n          $(\"#concludi_richiesta_requisiti_acquirenti > span\").addClass('bi-unlock-fill');\n        }\n        $(\"#richiesta-requisiti-soggetto-referente\").text(dati_richiesta.soggetto_referente);\n        $(\"#modifica-richiesta-requisiti-acquirenti\").prop(\"href\", \"/vincoli/iter_requisiti_acquirenti/\"+dati_richiesta.id+\"/edit\");\n\n        $(\"[id^='requisiti-acquirenti-presenza']\").prop(\"checked\", false);\n        $(\"[id^='requisiti-acquirenti-protocollo']\").text(\"\");\n        $(\"[id^='requisiti-acquirenti-data']\").text(\"\");\n        $(\"[id^='requisiti-acquirenti-data-scadenza']\").text(\"\");\n        $(\"[id^='requisiti-acquirenti-file']\").text(\"\");\n\n        for(let passaggio of dati_richiesta.passaggio_iter){\n          if(passaggio.data !== null){\n            $(\"#requisiti-acquirenti-presenza-\" + passaggio.nome_passaggio).prop(\"checked\", true);\n            $(\"#requisiti-acquirenti-protocollo-\" + passaggio.nome_passaggio).text(passaggio.protocollo);\n            $(\"#requisiti-acquirenti-data-\" + passaggio.nome_passaggio).text(formatDate(new Date(passaggio.data)));\n            let data_scadenza = passaggio.data_scadenza === null ? '' : formatDate(new Date(passaggio.data_scadenza))\n            $(\"#requisiti-acquirenti-data-scadenza-\" + passaggio.nome_passaggio).text(data_scadenza);\n            $(\"#requisiti-acquirenti-file-\" + passaggio.nome_passaggio).text(\"\");\n          }\n          if(passaggio.data !== null){\n            $(\"#requisiti-acquirenti-data-scadenza-\" + passaggio.nome_passaggio).text(formatDate(new Date(passaggio.data_scadenza)));\n          }\n        }\n        if(dati_richiesta.requisito_acquirente_iter_requisiti_acquirenti.length > 0){\n          $(\"#nuovo_requisiti_acquirenti\").addClass(\"d-none\");\n          $(\"#modifica_requisiti_acquirenti\").attr('href', '/vincoli/iter_requisiti_acquirenti/' + dati_richiesta.id + '/modifica_requisiti?empty=false');\n          $(\"#richiesta_requisiti_acquirenti_dettaglio\").empty();\n          var lista_requisiti  = '';\n          $.each(dati_richiesta.requisito_acquirente_iter_requisiti_acquirenti, function(index, requisito){\n            let checked_true = checked_false = checked_nil = toggle_option_slider_class = '';\n            let stato = requisito.stato\n            if(stato === true){\n              checked_true = 'checked=\"true\"'\n              toggle_option_slider_class = 'toggle_option_slider_true'\n            }\n            else if(stato === false){\n              checked_false = 'checked=\"true\"'\n              toggle_option_slider_class = 'toggle_option_slider_false'\n            }\n            else if(stato === null){\n              checked_nil = 'checked=\"true\"';\n              toggle_option_slider_class = 'toggle_option_slider_nil'\n            }\n            lista_requisiti += \"\" +\n              \"<div class='row' name='requisito\" + index + \"'>\" +\n                \"<div class='fs--1 col-1'>\" +\n                  \"<div class='wrapper'>\" +\n                    \"<div class='toggle_radio text-start'>\" +\n                      \"<input type='radio' class='toggle_option' id='false_requisito_\" + index + \"' name='iter_valore_ui[requisito_acquirente_iter_valore_ui_attributes][\" + index + \"][stato]' disabled \" + checked_false + \">\" +\n                      \"<input type='radio' class='toggle_option' id='nil_requisito_\" + index + \"' name='iter_valore_ui[requisito_acquirente_iter_valore_ui_attributes][\" + index + \"][stato]' disabled \" + checked_nil + \">\" +\n                      \"<input type='radio' class='toggle_option' id='true_requisito_\" + index + \"' name='iter_valore_ui[requisito_acquirente_iter_valore_ui_attributes][\" + index + \"][stato]' disabled \" + checked_true + \">\" +\n                      \"<label for='false_requisito_\" + index + \"'></label>\" +\n                      \"<label for='nil_requisito_\" + index + \"'></label>\" +\n                      \"<label for='true_requisito_\" + index + \"'></label>\" +\n                      \"<div class='toggle_option_slider \" + toggle_option_slider_class + \"'>\" +\n                      \"</div>\" +\n                    \"</div>\" +\n                  \"</div>\" +\n                \"</div>\" +\n                \"<span class='fs--1 col-4'>\" + dati_richiesta.requisito_acquirente[index].descrizione_breve + \"</span>\" +\n                \"<span class='fs--1 col'>\" + dati_richiesta.requisito_acquirente[index].descrizione + \"</span>\" +\n              \"</div>\";\n          });\n          $(\"#richiesta_requisiti_acquirenti_dettaglio\").html(lista_requisiti);\n          $(\"#richiesta_requisiti_acquirenti_reddito_massimo\").text(dati_richiesta.reddito_massimo === null ? '-' : number_format(dati_richiesta.reddito_massimo) + \" \u20AC\");\n          $(\"#richiesta_requisiti_acquirenti_reddito_nucleo_familiare\").text(dati_richiesta.reddito_nucleo_familiare === null ? '-' : number_format(dati_richiesta.reddito_nucleo_familiare) + \" \u20AC\");\n          $(\"#nuovo_soggetto_acquirente\").attr('href', '/vincoli/crea_soggetto_acquirente_da_catasto/' + dati_richiesta.id);\n          var lista_acquirenti = \"\";\n          $.each(dati_richiesta.iter_requisiti_soggetto_acquirente, function(index, rel){\n            var nominativo = '';\n            var codice_fiscale = '';\n            var nascita = '';\n            var tipo_soggetto = '';\n            if(rel.soggetto_acquirente_type == 'SoggettoAcquirenteFisico'){\n              nominativo = rel.soggetto_acquirente.cognome + \" \" + rel.soggetto_acquirente.nome;\n              codice_fiscale = rel.soggetto_acquirente.codice_fiscale;\n              nascita = rel.soggetto_acquirente.comune + \" \" + formatDate(new Date(rel.soggetto_acquirente.data_nascita));\n              tipo_soggetto = '_fisico';\n            }\n            else{\n              nominativo = rel.soggetto_acquirente.denominazione;\n              codice_fiscale = rel.soggetto_acquirente.partita_IVA;\n              nascita = rel.soggetto_acquirente.codice_comune_sede;\n              tipo_soggetto = '_giuridico';\n            }\n            var modifica = '';\n            if(rel.soggetto_acquirente.soggetto_id > 0){\n              modifica = '<span class=\"fs-3 bi-link-45deg eln-regular-text\">';\n            }\n            else{\n              modifica_url = '/vincoli/soggetti_acquirenti/' + rel.soggetto_acquirente_id + '/' + rel.iter_requisiti_acquirenti_id + '/modifica_soggetto' + tipo_soggetto\n              modifica = '<a href=\"' + modifica_url + '\">' +\n                          '<span class=\"fs-2 bi-pencil-square eln-green-text\"></span>'+\n                        '</a>';\n            }\n            elimina_url = '/vincoli/soggetti_acquirenti/' + rel.soggetto_acquirente_id + '/' + rel.iter_requisiti_acquirenti_id + '/scollega_soggetto' + tipo_soggetto\n            var elimina = '<a href=\"' + elimina_url + '\"  class=\"ps-2\">' +\n                            '<span class=\"fs-2 bi-trash eln-red-text\"></span>' +\n                          '</a>';\n            lista_acquirenti += \"\" +\n              \"<tr>\" +\n                \"<td class='fs--1'>\" + nominativo + \"</td>\" +\n                \"<td class='fs--1'>\" + codice_fiscale + \"</td>\" +\n                \"<td class='fs--1'>\" + nascita + \"</td>\" +\n                \"<td class='fs--1 text-end'>\" + modifica + elimina + \"</td>\" +\n              \"</tr>\";\n          });\n          $(\"#table_soggetti_acquirenti tbody\").html(lista_acquirenti);\n          $(\"#requisiti-acquirenti-richiesta-requisiti\").removeClass(\"d-none\");\n        }\n        else{\n          $(\"#requisiti-acquirenti-richiesta-requisiti\").addClass(\"d-none\");\n          $(\"#nuovo_requisiti_acquirenti\").attr('href', '/vincoli/iter_requisiti_acquirenti/' + dati_richiesta.id + '/modifica_requisiti?empty=true');\n          $(\"#nuovo_requisiti_acquirenti\").removeClass(\"d-none\");\n        }\n        if(typeof dati_richiesta.iter_calcolo_valore_ui !== 'undefined'){\n          iter_calcolo_valore_ui = dati_richiesta.iter_calcolo_valore_ui;\n          calcolo = iter_calcolo_valore_ui.calcolo_valore_ui;\n          if(typeof calcolo !== 'undefined'){\n            $(\"#valore_ui_valore_iniziale_richiesta_collegata\").text(Number(calcolo.valore_iniziale).toFixed(2));\n            $(\"#valore_ui_data_valore_iniziale_richiesta_collegata\").text(formatDate(new Date(calcolo.data_valore_iniziale)));\n            $(\"#valore_ui_superficie_richiesta_collegata\").text(Number(calcolo.superficie).toFixed(2));\n            $(\"#valore_ui_percentuale_ISTAT_richiesta_collegata\").text(Number(calcolo.percentuale_ISTAT).toFixed(2));\n            $(\"#valore_ui_data_ISTAT_richiesta_collegata\").text(formatDate(new Date(calcolo.data_ISTAT)));\n            $(\"#valore_ui_percentuale_vetusta_richiesta_collegata\").text(Number(calcolo.percentuale_vetusta).toFixed(2));\n            $(\"#valore_ui_migliorie_richiesta_collegata\").text(Number(calcolo.migliorie).toFixed(2));\n            $(\"#valore_ui_totale_richiesta_collegata\").text(Number(calcolo.totale).toFixed(2));\n            $(\"#valore_ui_valore_massimo_locazione_richiesta_collegata\").text(Number(calcolo.totale * calcolo.percentuale_locazione / 100).toFixed(2));\n            $(\"#valore_ui_percentuale_locazione_richiesta_collegata\").text(Number(calcolo.percentuale_locazione).toFixed(2));\n            $(\"#valore_ui_data_calcolo_richiesta_collegata\").text(formatDate(new Date(calcolo.data_calcolo)));\n            //$(\"#visualizza_richiesta_calcolo_valore_ui\").attr('href', '/calcolo_valore_ui/'+calcolo.id+'/edit');\n            $(\"#calcolo-ui-collegato\").removeClass(\"d-none\");\n            $(\"#aggiungi_richiesta_calcolo\").addClass(\"d-none\");\n            $(\"#aggiungi_richiesta_calcolo\").attr('href', '');\n\n            var id_calcolo = iter_calcolo_valore_ui.id;\n            var protocollo = iter_calcolo_valore_ui.richiesta_protocollo.protocollo;\n            var data = formatDate(new Date(iter_calcolo_valore_ui.richiesta_data.data));\n            var richiesta_unica = data == formatDate(new Date(dati_richiesta.passaggio_iter[0].data)) && protocollo == dati_richiesta.passaggio_iter[0].protocollo\n            if(richiesta_unica){\n              $(\"#elimina_richiesta_calcolo\").attr(\"href\", \"/vincoli/iter_calcolo_valore_ui/\" + id_calcolo + \"?iter_requisiti=\" + dati_richiesta.id)\n              $(\"#elimina_richiesta_calcolo\").removeClass(\"d-none\");\n              $(\"#scollega_richiesta_calcolo\").attr(\"href\", \"\")\n              $(\"#scollega_richiesta_calcolo\").addClass(\"d-none\");\n            }\n            else{\n              $(\"#elimina_richiesta_calcolo\").attr(\"href\", \"\")\n              $(\"#elimina_richiesta_calcolo\").addClass(\"d-none\");\n              $(\"#scollega_richiesta_calcolo\").attr(\"href\", \"/vincoli/iter_requisiti_acquirenti/\" + dati_richiesta.id + \"/scollega_richiesta_calcolo\")\n              $(\"#scollega_richiesta_calcolo\").removeClass(\"d-none\");\n            }\n          }\n        }\n        else{\n          $(\"#calcolo-ui-collegato\").addClass(\"d-none\");\n          $(\"#aggiungi_richiesta_calcolo\").attr('href', '/vincoli/iter_requisiti_acquirenti/' + dati_richiesta.id + '/elenco_richieste_calcolo');\n          $(\"#elimina_richiesta_calcolo\").attr(\"href\", \"\");\n          $(\"#scollega_richiesta_calcolo\").attr(\"href\", \"\");\n          $(\"#aggiungi_richiesta_calcolo\").removeClass(\"d-none\");\n          $(\"#elimina_richiesta_calcolo\").addClass(\"d-none\");\n          $(\"#scollega_richiesta_calcolo\").addClass(\"d-none\");\n          //$(\"#requisiti-acquirenti\").find(\"a\").attr('href', '/iter_valore_ui_requisiti_acquirenti/' + dati_richiesta.id)\n        }\n\n        if(typeof dati_richiesta.convenzione_finale !== 'undefined'){\n          var convenzione_finale = dati_richiesta.convenzione_finale;\n          $(\"#atto_compravendita_requisiti_repertorio\").text(convenzione_finale.repertorio);\n          $(\"#atto_compravendita_requisiti_raccolta\").text(convenzione_finale.raccolta);\n          $(\"#atto_compravendita_requisiti_data\").text(formatDate(new Date(convenzione_finale.data)));\n          $.ajax({\n            url: \"/dati_notaio\",\n            method: \"GET\",\n            dataType: \"json\",\n            data: {notaio: convenzione_finale.notaio_id},\n            error: function (xhr, status, error) {\n                console.error('AJAX Error: ' + status + \" \" + error);\n            },\n            success: function (dati_notaio) {\n              $(\"#atto_compravendita_requisiti_rogante\").text(dati_notaio.nominativo);\n            }\n          });\n          $(\"#atto_compravendita_requisiti_numero\").text(convenzione_finale.numero);\n          $(\"#atto_compravendita_requisiti_progressivo\").text(convenzione_finale.progressivo);\n          $(\"#atto_compravendita_requisiti_anno\").text(convenzione_finale.anno);\n          $(\"#atto_compravendita_requisiti_data_registrazione\").text(formatDate(new Date(convenzione_finale.data_registrazione)));\n          $(\"#elimina_atto_compravendita_requisiti\").find('form').prop(\"action\", \"/vincoli/iter_requisiti_acquirenti/\" + dati_richiesta.id + \"/convenzione_finale\");\n          $(\"#elimina_atto_compravendita_requisiti\").removeClass(\"d-none\");\n          $(\"#nuovo_atto_compravendita_requisiti\").addClass(\"d-none\");\n          $(\"#atto-compravendita-requisiti\").removeClass('d-none');\n        }\n        else{\n          $(\"#nuovo_atto_compravendita_requisiti\").attr('href', '/vincoli/iter_requisiti_acquirenti/' + dati_richiesta.id + '/convenzione_finale');\n          $(\"#nuovo_atto_compravendita_requisiti\").removeClass(\"d-none\");\n          $(\"#elimina_atto_compravendita_requisiti\").addClass(\"d-none\");\n          $(\"#atto-compravendita-requisiti\").addClass('d-none');\n        }\n        $(\"#richiesta-requisiti-acquirenti\").removeClass(\"d-none\");\n      }\n    });\n  });\n\n (function () {\n    const $container = $(\"#iter-container\");\n    if (!$container.length) return;\n\n    const $submit = $(\"#submit\");\n    const NS = \".affrProg\";\n\n    // Evita doppi bind (Turbo / partial / re-render)\n    $container.off(\"change\" + NS + \" input\" + NS);\n\n    const getSteps = () =>\n      $container.find(\"div[id^='passaggio-']\").filter(function () {\n        return this.id !== \"passaggio-pagamento\";\n      });\n\n    const valTrim = ($el) => $.trim(($el.val() || \"\") + \"\");\n\n    const stepFields = ($step) => ({\n      $p: $step.find(\"input[name$='[protocollo]']\"),\n      $d: $step.find(\"input[name$='[data]']\"),\n    });\n\n    const isCompiled = ($step) => {\n      const { $p, $d } = stepFields($step);\n      return valTrim($p) !== \"\" && valTrim($d) !== \"\";\n    };\n\n    const isEmpty = ($step) => {\n      const { $p, $d } = stepFields($step);\n      return valTrim($p) === \"\" && valTrim($d) === \"\";\n    };\n\n    const isPartial = ($step) => !isEmpty($step) && !isCompiled($step);\n\n    const setStepDisabled = ($step, disabled) => {\n      // non tocchiamo hidden\n      $step\n        .find(\"input, select, textarea\")\n        .not(\"[type='hidden']\")\n        .prop(\"disabled\", disabled);\n    };\n\n    const getNextStep = ($steps, $step) => {\n      const idx = $steps.index($step);\n      if (idx === -1) return $();\n      return $steps.eq(idx + 1);\n    };\n\n    const contiguousOkFromStep4 = ($steps) => {\n      // stepId 1..3 esclusi => partiamo da index 3 (stepId 4)\n      let gap = false;\n\n      for (let i = 3; i < $steps.length; i++) {\n        const compiled = isCompiled($steps.eq(i));\n\n        if (!compiled) gap = true;\n        if (gap && compiled) return false; // buco seguito da compilato => non contiguo\n      }\n\n      return true;\n    };\n\n    // ---- presenza_calcolo (boolean) ----\n    // Supporta valori tipo: \"true\"/\"false\", \"1\"/\"0\", \"on\"/\"off\"\n    // Se l'elemento non esiste, default: true (non blocca nulla)\n    const boolFromInput = ($el) => {\n      if (!$el.length) return true;\n      const v = (String($el.val() ?? \"\")).toLowerCase();\n      return v === \"true\" || v === \"1\" || v === \"on\" || v === \"yes\";\n    };\n\n    const presenzaCalcolo = () => boolFromInput($(\"#presenza_calcolo\"));\n    const toggleDisabledNotice = ($step, visible) => {\n      $step\n        .closest(\".js-iter-step\")\n        .find(\".js-step-disabled-notice[data-disabled-reason='presenza-calcolo']\")\n        .toggleClass(\"d-none\", !visible);\n    };\n\n    // Valuta la sequenza dei passaggi iter, abilitando i campi compilabili e bloccando il submit solo quando l'ordine non e' valido.\n    const evaluate = () => {\n      const $steps = getSteps();\n      if (!$steps.length) return;\n\n      let submitDisabled = false;\n\n      const $step1 = $steps.eq(1);\n      const $step2 = $steps.eq(2);\n      const $step3 = $steps.eq(3);\n\n      const s1 = $step1.length ? isCompiled($step1) : false;\n      const s2 = $step2.length ? isCompiled($step2) : false;\n      const s3 = $step3.length ? isCompiled($step3) : false;\n      const richiestaCompilata = $steps.eq(0).length ? isCompiled($steps.eq(0)) : false;\n\n      $steps.toArray().forEach((step) => setStepDisabled($(step), false));\n      $steps.toArray().forEach((step) => toggleDisabledNotice($(step), false));\n\n      if ($steps.toArray().some((step) => isPartial($(step)))) submitDisabled = true;\n\n      // Regola generale: se step corrente incompleto:\n      // - se successivo vuoto => disabilita successivo\n      // - se successivo non vuoto => non disabilitare i campi, ma disabilita submit\n      $steps.toArray().forEach(function(step) {\n        const $cur = $(step);\n        const $next = getNextStep($steps, $cur);\n        if (!$next.length) return;\n\n        const idx = $steps.index($cur);\n\n        const curCompiled = isCompiled($cur);\n        const curEmpty = isEmpty($cur);\n        if (curCompiled) {\n          setStepDisabled($next, false);\n        } else {\n          // Caso speciale: se sospensione e ripresa sono vuote,\n          // la trasmissione deve restare compilabile subito dopo la richiesta.\n          if (idx === 2 && !s1 && curEmpty) {\n            setStepDisabled($next, false);\n            return;\n          }\n\n          if (isEmpty($next)) {\n            setStepDisabled($next, true);\n          } else {\n            submitDisabled = true;\n          }\n        }\n      });\n\n      // Dopo la richiesta, sospensione e trasmissione sono entrambe abilitate.\n      // Se viene inserita la sospensione, la trasmissione resta bloccata finche' non c'e' la ripresa.\n      // Se viene inserita direttamente la trasmissione, la sospensione si blocca.\n      if ($step3.length) {\n        const trasmissioneDiretta = richiestaCompilata && !s1 && !s2;\n        const trasmissioneDopoRipresa = s1 && s2;\n        setStepDisabled($step3, !(trasmissioneDiretta || trasmissioneDopoRipresa));\n      }\n\n      if ($step1.length && $step3.length) {\n        if (s3 && !s1) setStepDisabled($step1, true);\n        if (!s3) setStepDisabled($step1, false);\n      }\n\n      if ($step2.length) {\n        if (s1 && !s2) {\n          setStepDisabled($step2, false);\n          if ($step3.length && isEmpty($step3)) setStepDisabled($step3, true);\n        } else if (!s1 && isEmpty($step2)) {\n          setStepDisabled($step2, true);\n        }\n      }\n\n      // Se e' compilata la trasmissione e la sospensione e' presente,\n      // allora la ripresa deve essere compilata; se sospensione e' assente,\n      // trasmissione e' valida anche con ripresa vuota.\n      if ($step3.length && s3 && s1 && !s2) submitDisabled = true;\n\n      // Pulsante conferma:\n      // riabilitato se contigui da step 4 ok + nessun vincolo precedente\n      if (!contiguousOkFromStep4($steps)) submitDisabled = true;\n\n      // ---- REGOLA EXTRA: se presenza_calcolo \u00E8 false, disabilita SEMPRE il passaggio 4 ----\n      // (seguo la tua convenzione attuale: passaggio 4 -> eq(4))\n      if (!presenzaCalcolo()) {\n        const $step4 = $steps.eq(3);\n        if ($step4.length) {\n          setStepDisabled($step4, true);\n          toggleDisabledNotice($step4, true);\n        }\n      }\n\n      // Se non c'e' il calcolo collegato, la trasmissione resta bloccata\n      // e mostriamo il motivo direttamente nello step.\n      if (!presenzaCalcolo() && $step3.length) {\n        setStepDisabled($step3, true);\n        toggleDisabledNotice($step3, true);\n      }\n\n      if ($submit.length) $submit.prop(\"disabled\", submitDisabled);\n    };\n\n    // Listener: input + change su protocollo/data\n    $container.on(\n      \"input\" + NS + \" change\" + NS,\n      \"input[name$='[protocollo]'], input[name$='[data]']\",\n      evaluate\n    );\n\n    // Se cambia il boolean, ricalcolo lo stato\n    $(document).off(\"change\" + NS, \"#presenza_calcolo\");\n    $(document).on(\"change\" + NS, \"#presenza_calcolo\", evaluate);\n\n    // Stato iniziale\n    evaluate();\n  })();\n\n  // nella gestione iter, quando modifico una data, ottengo la nuova scadenza\n  $(\"[name*='iter_'][name$='[data]']\").on('change', function(){\n    var data = new Date(this.value);\n    var inputName = $(this).attr('name');\n    var passaggioContainer = $(this).closest(\"[id^='passaggio-']\");\n    var passaggio = passaggioContainer.length ? passaggioContainer.attr('id').replace('passaggio-', '') : null;\n    var form = $(this).closest(\"form\");\n\n    var setScadenza = function(targetPassaggio, baseDate, giorni){\n      if(!targetPassaggio || !baseDate || isNaN(baseDate)){\n        return;\n      }\n      var scadenza = baseDate.addDays(giorni);\n      var targetContainer = form.find(\"#passaggio-\" + targetPassaggio);\n      if(targetContainer.length === 0){\n        return;\n      }\n      targetContainer.find(\"[id^='scadenza-']\").text(formatDate(new Date(scadenza)));\n      targetContainer.find(\"input[name$='[data_scadenza]']\").val(scadenza);\n    };\n\n    var clearScadenza = function(targetPassaggio){\n      var targetContainer = form.find(\"#passaggio-\" + targetPassaggio);\n      if(targetContainer.length === 0){\n        return;\n      }\n      targetContainer.find(\"[id^='scadenza-']\").text(\"\");\n      targetContainer.find(\"input[name$='[data_scadenza]']\").val(\"\");\n    };\n\n\n    var giorniScadenza = function(index){\n      return Number($(\"#giorni_scadenza_\" + index).val());\n    };\n\n    var dataRichiesta = function(){\n      return new Date(form.find(\"#passaggio-richiesta [name$='[data]']\").val());\n    };\n\n    var dataSospensione = function(){\n      return new Date(form.find(\"#passaggio-sospensione [name$='[data]']\").val());\n    };\n\n    if(inputName.includes(\"iter_affrancazione\")){\n      if(passaggio === \"richiesta\"){\n        setScadenza(\"trasmissione\", data, giorniScadenza(0));\n      } else if(passaggio === \"sospensione\"){\n        // se ho inserito/modificato la sospensione: calcolo scadenza ripresa\n        if (!isNaN(data)) {\n          setScadenza(\"ripresa\", data, giorniScadenza(1));\n        } else {\n          clearScadenza(\"ripresa\");\n          // se ho rimosso la data sospensione: ricalcolo trasmissione come da richiesta\n          var richiesta = dataRichiesta();\n          if (!isNaN(richiesta)) {\n            setScadenza(\"trasmissione\", richiesta, giorniScadenza(0));\n          }\n        }\n      } else if(passaggio === \"ripresa\"){\n        var sospensione = dataSospensione();\n        var richiesta = dataRichiesta();\n        if(!isNaN(sospensione) && !isNaN(richiesta)){\n          if (!isNaN(data)) {\n            var giorni = giorniScadenza(0) + dateDiffInDays(new Date(sospensione), new Date(data));\n            setScadenza(\"trasmissione\", richiesta, giorni);\n          } else {\n            setScadenza(\"trasmissione\", richiesta, giorniScadenza(0));\n          }\n        }\n      } else if(passaggio === \"ricevuta_corrispettivo\"){\n        setScadenza(\"accettazione\", data, giorniScadenza(4));\n      } else if(passaggio === \"accettazione\"){\n        setScadenza(\"invio_dati\", data, giorniScadenza(5));\n      } else if(passaggio === \"ricevuta_dati\"){\n        setScadenza(\"pagamento\", data, giorniScadenza(6));\n      }\n    }\n\n    if(inputName.includes(\"iter_calcolo_valore_ui\") || inputName.includes(\"iter_requisiti_acquirenti\")){\n      if(passaggio === \"richiesta\"){\n        setScadenza(\"trasmissione\", data, giorniScadenza(0));\n      } else if(passaggio === \"sospensione\"){\n        if (!isNaN(data)) {\n          setScadenza(\"ripresa\", data, giorniScadenza(1));\n        } else {\n          clearScadenza(\"ripresa\");\n\n          var richiestaVendita = dataRichiesta();\n          if (!isNaN(richiestaVendita)) {\n            setScadenza(\"trasmissione\", richiestaVendita, giorniScadenza(0));\n          }\n        }\n      } else if(passaggio === \"ripresa\"){\n        var sospensioneVendita = dataSospensione();\n        var richiestaVendita = dataRichiesta();\n        if(!isNaN(sospensioneVendita) && !isNaN(richiestaVendita)){\n          if (!isNaN(data)) {\n            var giorniVendita = giorniScadenza(0) + dateDiffInDays(new Date(sospensioneVendita), new Date(data));\n            setScadenza(\"trasmissione\", richiestaVendita, giorniVendita);\n          } else {\n            setScadenza(\"trasmissione\", richiestaVendita, giorniScadenza(0));\n          }\n        }\n      } else if(passaggio === \"ricevuta_valore\" || passaggio === \"ricevuta_esito\"){\n        setScadenza(\"stipula_atto\", data, giorniScadenza(5));\n      } else if(passaggio === \"stipula_atto\"){\n        setScadenza(\"ricevuta_atto\", data, giorniScadenza(6));\n      }\n    }\n  });\n\n  // selezionando una richiesta di affrancazione, ne apre il dettaglio\n  $(\"[id^='mostra-richiesta-affrancazione']\").on('click', function(){\n    let id = Number($(this).attr('id').split(\"-\")[3]);\n    $.ajax({\n      url: \"/dati_richiesta_affrancazione\",\n      method: \"GET\",\n      dataType: \"json\",\n      data: {richiesta: id},\n      error: function (xhr, status, error) {\n          console.error('AJAX Error: ' + status + \" \" + error);\n      },\n      success: function (dati_richiesta) {\n        $(\"[id^='richiesta_affrancazione_']\").removeClass(\"table-active\");\n        $(\"#richiesta_affrancazione_\" + dati_richiesta.id).addClass(\"table-active\");\n        $(\"#elimina_richiesta_affrancazione\").parent(\"form\").prop('action', '/vincoli/iter_affrancazione/' + dati_richiesta.id);\n        var action = 'blocca_richiesta';\n        var tooltip = 'Concludi Richiesta';\n        var icon = 'bi-unlock-fill';\n        if(dati_richiesta.chiusa){\n          action = 'sblocca_richiesta';\n          tooltip = 'Riapri Richiesta';\n          icon = 'bi-lock-fill';\n        }\n        $(\"#concludi_richiesta_affrancazione\").prop('href', '/vincoli/iter_affrancazione/' + dati_richiesta.id + '/' + action);\n        $(\"#concludi_richiesta_affrancazione\").siblings(\"p\").text(tooltip);\n        $(\"#concludi_richiesta_affrancazione > span\").prop('tooltip', tooltip);\n        if(dati_richiesta.chiusa){\n          $(\"#concludi_richiesta_affrancazione > span\").addClass('bi-lock-fill');\n          $(\"#concludi_richiesta_affrancazione > span\").removeClass('bi-unlock-fill');\n        }\n        else{\n          $(\"#concludi_richiesta_affrancazione > span\").removeClass('bi-lock-fill');\n          $(\"#concludi_richiesta_affrancazione > span\").addClass('bi-unlock-fill');\n        }\n        $(\"#richiesta-affrancazione-soggetto-referente\").text(dati_richiesta.soggetto_referente);\n        $(\"#modifica-richiesta-affrancazione\").prop(\"href\", \"/vincoli/iter_affrancazione/\" + dati_richiesta.id + \"/edit\");\n        $(\"[id^='affrancazione-presenza']\").prop(\"checked\", false);\n        $(\"[id^='affrancazione-protocollo']\").text(\"\");\n        $(\"[id^='affrancazione-data']\").text(\"\");\n        $(\"[id^='affrancazione-data-scadenza']\").text(\"\");\n        $(\"[id^='affrancazione-file']\").text(\"\");\n\n        var scadenza_pagamento = ''\n        for(let passaggio of dati_richiesta.passaggio_iter){\n          if(passaggio.data !== null){\n            $(\"#affrancazione-presenza-\" + passaggio.nome_passaggio).prop(\"checked\", true);\n            $(\"#affrancazione-protocollo-\" + passaggio.nome_passaggio).text(passaggio.protocollo);\n            $(\"#affrancazione-data-\" + passaggio.nome_passaggio).text(formatDate(new Date(passaggio.data)));\n            let data_scadenza = passaggio.data_scadenza === null ? '' : formatDate(new Date(passaggio.data_scadenza))\n            $(\"#affrancazione-data-scadenza-\" + passaggio.nome_passaggio).text(data_scadenza);\n            $(\"#affrancazione-file-\" + passaggio.nome_passaggio).text(\"\");\n            if(passaggio.nome_passaggio == 'pagamento')\n              scadenza_pagamento = data_scadenza;\n          }\n          if(passaggio.data_scadenza !== null){\n            $(\"#affrancazione-data-scadenza-\" + passaggio.nome_passaggio).text(formatDate(new Date(passaggio.data_scadenza)));\n          }\n        }\n        if(typeof(dati_richiesta.calcolo_affrancazione) !== \"undefined\"){\n          calcolo = dati_richiesta.calcolo_affrancazione;\n          var dettagliCalcoloAffrancazioneVisibili = dati_richiesta.dettagli_calcolo_affrancazione_visibili !== false;\n          $(\"#affrancazione_cc48_richiesta\").text(number_format(calcolo.cc48));\n          $(\"#affrancazione_crv_richiesta\").text(number_format(calcolo.crv));\n          $(\"#affrancazione_totale_richiesta\").text(number_format(calcolo.totale));\n          if(!dettagliCalcoloAffrancazioneVisibili){\n            $(\"#corrispettivo-affrancazione-alert-richiesta\").addClass(\"d-none\");\n            $(\"#calcolo-affrancazione\").removeClass(\"d-none\");\n            $(\"#nuovo_corrispettivo_affrancazione\").addClass(\"d-none\");\n            $.ajax({\n              url: \"/limite_minimo_massimo_affrancazione\",\n              method: \"GET\",\n              dataType: \"json\",\n              data: {richiesta: id},\n              error: function (xhr, status, error) {\n                  console.error('AJAX Error: ' + status + \" \" + error);\n              },\n              success: function (limiti) {\n                let avvisoLimite = limiti.avviso_limite || {};\n                $('#corrispettivo-affrancazione-alert-richiesta').popover(\"dispose\");\n                if(avvisoLimite.presente){\n                  $('#corrispettivo-affrancazione-alert-richiesta').attr('data-bs-content', avvisoLimite.contenuto);\n                  $('#corrispettivo-affrancazione-alert-richiesta').popover({ trigger: 'hover', html: true, container: 'body', placement: 'top' });\n                  $(\"#corrispettivo-affrancazione-alert-richiesta\").removeClass(\"d-none\");\n                }\n                else{\n                  $(\"#corrispettivo-affrancazione-alert-richiesta\").addClass(\"d-none\");\n                }\n              }\n            });\n          }\n          else{\n            $(\"#affrancazione_superficie_totale_terreno_richiesta\").text(number_format(calcolo.superficie_totale_terreno));\n          $(\"#affrancazione_valore_acquistro_terreno_richiesta\").text(number_format(calcolo.valore_acquisto_terreno));\n          $(\"#affrancazione_valore_acquisto_terreno_totale_richiesta\").text(number_format(calcolo.superficie_totale_terreno * calcolo.valore_acquisto_terreno));\n          $(\"#affrancazione_percentuale_ISTAT_richiesta\").text(number_format(calcolo.percentuale_ISTAT));\n          $(\"#affrancazione_data_ISTAT_richiesta\").text(formatDate(new Date(calcolo.data_ISTAT)));\n          let valore_acquistro_terreno_rivalutato = Number(calcolo.valore_acquisto_terreno * (1 + calcolo.percentuale_ISTAT / 100));\n          $(\"#affrancazione_valore_acquistro_terreno_rivalutato_richiesta\").text(number_format(valore_acquistro_terreno_rivalutato));\n          $(\"#affrancazione_valore_acquisto_terreno_rivalutato_totale_richiesta\").text(number_format(valore_acquistro_terreno_rivalutato * calcolo.superficie_totale_terreno));\n          $(\"#affrancazione_valore_venale_richiesta\").text(number_format(calcolo.valore_venale));\n          $(\"#affrancazione_valore_venale_totale_richiesta\").text(number_format(calcolo.valore_venale * calcolo.superficie_totale_terreno));\n          $(\"#affrancazione_percentuale_abbattimento_richiesta\").text(number_format(calcolo.percentuale_abbattimento_valore_venale));\n          var data_inizio_convenzione = $(\"#data_inizio_convenzione\").text();\n          data_inizio_convenzione = new Date(data_inizio_convenzione.split(\"/\")[2] + \"-\" + data_inizio_convenzione.split(\"/\")[1] + \"-\" + data_inizio_convenzione.split(\"/\")[0])\n          $(\"#affrancazione_atc_richiesta\").text(dateDiffInYears(data_inizio_convenzione, new Date(calcolo.data_calcolo)))\n          $(\"#affrancazione_data_calcolo_richiesta\").text(formatDate(new Date(calcolo.data_calcolo)));\n          $(\"#modifica-affrancazione-richiesta\").attr('href', '/calcolo_affrancazione/'+calcolo.id+'/edit')\n          let totale_non_limitato = calcolo.totale_non_limitato;\n          let stt = calcolo.superficie_totale_terreno;\n          let data_calcolo = calcolo.data_calcolo;\n          $.ajax({\n            url: \"/limite_minimo_massimo_affrancazione\",\n            method: \"GET\",\n            dataType: \"json\",\n            data: {richiesta: id, data_calcolo: data_calcolo},\n            error: function (xhr, status, error) {\n                console.error('AJAX Error: ' + status + \" \" + error);\n            },\n            success: function (limiti) {\n              if(totale_non_limitato < limiti.limite_minimo){\n                let content;\n                if(limiti.pip){\n                  content = \"<div class='text-center eln-green-text'>\" +\n                              \"<div>Corrispettivo minimo fisso PIP applicato a questa scheda</div>\" +\n                              \"<div class='text-800'>Soglia applicata: \" + number_format(limiti.limite_minimo) + \" \u20AC</div>\" +\n                              \"<div class='text-800'>Minimo fisso: \" + number_format(limiti.limite_minimo_fisso) + \" \u20AC</div><br>\" +\n                              \"<div>Tot. corrispettivo calcolato</div>\" +\n                              \"<div class='text-800'>\" + number_format(totale_non_limitato) + \" \u20AC</div>\" +\n                            \"</div>\";\n                }\n                else{\n                  content = \"<div class='text-center eln-green-text'>\" +\n                              \"<div>Corrispettivo minimo per questa scheda</div>\" +\n                              \"<div class='text-800'>\" + number_format(limiti.limite_minimo) + \" \u20AC</div><br><div>Tot. corrispettivo calcolato</div>\" +\n                              \"<div class='text-800'>\" + number_format(totale_non_limitato) + \" \u20AC</div>\" +\n                            \"</div>\";\n                }\n                $('#corrispettivo-affrancazione-alert-richiesta').popover(\"dispose\");\n                $('#corrispettivo-affrancazione-alert-richiesta').attr('data-bs-content',content);\n                $('#corrispettivo-affrancazione-alert-richiesta').popover({ trigger: 'hover', html: true, container: 'body', placement: 'top' });\n                $(\"#corrispettivo-affrancazione-alert-richiesta\").removeClass(\"d-none\");\n              }\n              else if(limiti.pip && limiti.limite_minimo_mq_totale > 0 && totale_non_limitato < limiti.limite_minimo_mq_totale){\n                let content = \"<div class='text-center eln-green-text'>\" +\n                                \"<div>Corrispettivo minimo PIP al mq</div>\" +\n                                \"<div class='text-800'>\" + number_format(limiti.limite_minimo_mq) + \" \u20AC/mq</div>\" +\n                                \"<div class='text-800'>Soglia al mq: \" + number_format(limiti.limite_minimo_mq_totale) + \" \u20AC</div><br>\" +\n                                \"<div>Tot. corrispettivo calcolato</div>\" +\n                                \"<div class='text-800'>\" + number_format(totale_non_limitato) + \" \u20AC</div>\" +\n                              \"</div>\";\n                $('#corrispettivo-affrancazione-alert-richiesta').popover(\"dispose\");\n                $('#corrispettivo-affrancazione-alert-richiesta').attr('data-bs-content',content);\n                $('#corrispettivo-affrancazione-alert-richiesta').popover({ trigger: 'hover', html: true, container: 'body', placement: 'top' });\n                $(\"#corrispettivo-affrancazione-alert-richiesta\").removeClass(\"d-none\");\n              }\n              else if(limiti.limite_massimo > 0 && totale_non_limitato > Number(limiti.limite_massimo * stt)){\n                let content = \"<div class='text-center eln-green-text'>\" +\n                                \"<div>Valore massimo di cessione comma 48.2 L.448/98</div>\" +\n                                \"<div class='text-800'>\" + number_format(limiti.limite_massimo) + \" \u20AC/mq</div>\" +\n                                \"<br>\" +\n                                \"<div>Tot. corrispettivo calcolato: <span class='text-800'>\" + number_format(totale_non_limitato) + \" \u20AC</span></div>\" +\n                                \"<div class='text-800'>\" + number_format(limiti.limite_massimo * stt) + \" \u20AC/mq</div>\" +\n                                \"</div>\";\n                $('#corrispettivo-affrancazione-alert-richiesta').popover(\"dispose\");\n                $('#corrispettivo-affrancazione-alert-richiesta').attr('data-bs-content',content);\n                $('#corrispettivo-affrancazione-alert-richiesta').popover({ trigger: 'hover', html: true, container: 'body', placement: 'top' });\n                $(\"#corrispettivo-affrancazione-alert-richiesta\").removeClass(\"d-none\");\n              }\n              else{\n                $(\"#corrispettivo-affrancazione-alert-richiesta\").addClass(\"d-none\");\n              }\n            }\n          });\n            $(\"#calcolo-affrancazione\").removeClass(\"d-none\");\n            $(\"#nuovo_corrispettivo_affrancazione\").addClass(\"d-none\");\n          }\n        }\n        else{\n          $(\"#nuovo_corrispettivo_affrancazione\").attr('href', '/vincoli/scheda/' + dati_richiesta.scheda_id + '/calcolo_affrancazione/new?iter_id=' + dati_richiesta.id);\n        }\n\n        $(\"#agevolazioni\").find(\"a\").attr('href', '/iter_affrancazione_agevolazioni/' + dati_richiesta.id);\n        $(\"#agevolazioni\").find(\"a\").addClass(\"d-none\");\n        $(\"[name^='agevolazione']\").remove();\n        var lista_agevolazioni = \"\";\n        var percentuale_agevolazione = 0;\n        dati_richiesta.agevolazione.forEach(function(value, index, array){\n          let checked = ''\n          var applicata = false\n          for (let value_1 of dati_richiesta.agevolazione_iter_affrancazione) {\n            if(value.id == value_1.agevolazione_id)\n              applicata = value_1.applicata;\n          }\n          if(applicata == true){\n            checked = 'checked=\"true\"';\n            percentuale_agevolazione += value.percentuale;\n          }\n\n          lista_agevolazioni += \"\" +\n            \"<div class='row' name='agevolazione\" + index + \"'>\" +\n              \"<div class='fs--1 col-2'>\" +\n                \"<div class='form-check'>\" +\n                  \"<input class='' type='checkbox' value='' id='stato_agevolazione_\" + index + \"' \" + checked + \" >\" +\n                  \"<label class='ps-2 form-check-label' for='stato_agevolazione_\" + index + \"'>\" + value.percentuale + \"%</label>\" +\n                \"</div>\" +\n              \"</div>\" +\n              \"<span class='fs--1 col'>\" + value.descrizione + \"</span>\" +\n            \"</div>\";\n        });\n        $(\"#scheda-gestione-affrancazioni-lista-agevolazioni\").html(lista_agevolazioni);\n        $(\"[id^='stato_agevolazione_']\").prop(\"disabled\", true);\n        var totale_corrispettivo = 0;\n        if(typeof(dati_richiesta.calcolo_affrancazione) !== \"undefined\"){\n          var totale_corrispettivo = dati_richiesta.calcolo_affrancazione.totale;\n          $(\"#agevolazioni\").find(\"a\").removeClass(\"d-none\");\n        }\n        $(\"#totale-corrispettivo-richiesta\").text(totale_corrispettivo === null ? '-' : number_format(totale_corrispettivo));\n        $(\"#totale-sconti-richiesta\").text(number_format(percentuale_agevolazione));\n        $(\"#totale-corrispettivo-scontato-richiesta\").text(totale_corrispettivo === null ? '-' : number_format(totale_corrispettivo * (1 - percentuale_agevolazione / 100)));\n\n        if(typeof dati_richiesta.pagamento !== 'undefined'){\n          var pagamento = dati_richiesta.pagamento;\n          $(\"#nuovo_pagamento_affrancazione\").addClass(\"d-none\");\n          $(\"#pagamenti\").find(\"a\").attr('href', '/affrancazioni_pagamenti/' + pagamento.id + '/edit')\n          var totale_calcolato = dati_richiesta.calcolo_affrancazione.totale || 0;\n          var totale_scontato = dati_richiesta.calcolo_affrancazione.totale_scontato;\n          if(totale_scontato == null)\n            totale_scontato = totale_calcolato;\n          var fattore_sconto = totale_calcolato === 0 ? 1 - percentuale_agevolazione / 100 : totale_scontato / totale_calcolato;\n          if(fattore_sconto < 0)\n            fattore_sconto = 0;\n          var totale_cc48 = dati_richiesta.calcolo_affrancazione.cc48 || 0;\n          var totale_cc48_scontato = Math.max(totale_cc48 * fattore_sconto, 0);\n          var totale_pagamento = pagamento.solo_trasformazione ? totale_cc48_scontato : totale_scontato;\n          $(\"#affrancazione_totale_pagamento\").text(number_format(totale_pagamento));\n          $(\"#affrancazione_totale_pagamento\").text(number_format(totale_scontato));\n          $(\"#affrancazione_data_pagamento\").text(formatDate(new Date(pagamento.data)));\n          $(\"#affrancazione_reversale_pagamento\").text(pagamento.reversale);\n          $(\"#affrancazione_file_pagamento\").text(\"\");\n          if(pagamento.tipo_pagamento == 2){\n            $.ajax({\n              url: \"/rateizzazione_affrancazione\",\n              method: \"GET\",\n              dataType: \"json\",\n              data: {pagamento_id: pagamento.id},\n              error: function (xhr, status, error) {\n                  console.error('AJAX Error: ' + status + \" \" + error);\n              },\n              success: function (rateizzazione) {\n                if(rateizzazione.acconto !== null){\n                  $(\"#affrancazione_acconto_flg_pagamento\").prop(\"checked\", true);\n                  $(\"#affrancazione_acconto_pagamento\").text(number_format(rateizzazione.acconto));\n                }\n                $(\"#affrancazione_pagamento_rateizzazione_data_inizio\").text(formatDate(new Date(rateizzazione.data_inizio_rateizzazione)));\n                var importoRateizzazione = Math.max(totale_pagamento - rateizzazione.acconto, 0);\n                $(\"#affrancazione_pagamento_rateizzazione_importo\").text(number_format(importoRateizzazione));\n                $(\"#affrancazione_pagamento_rateizzazione_tasso_annuale\").text(number_format(rateizzazione.tasso_annuale) + \" %\");\n                $(\"#affrancazione_pagamento_rateizzazione_interessi\").text(number_format(rateizzazione.interessi));\n                var tipo_rate = tipo_rate_text(rateizzazione.tipo_rate);\n                $(\"#affrancazione_pagamento_rateizzazione_tipo_rate\").text(tipo_rate);\n                $(\"#affrancazione_pagamento_rateizzazione_da_restituire\").text(number_format(rateizzazione.totale));\n                $(\"#affrancazione_pagamento_rateizzazione_numero_rate\").text(rateizzazione.numero_rate);\n                $(\"#affrancazione_pagamento_rateizzazione_rata_periodica\").text(number_format(rateizzazione.rata_periodica));\n                rateizzazione.rata.sort(dynamicSort(\"data_rata\"));\n                rateizzazione.rata.forEach(function(rata, index, array){\n                  $(\"#importo_rata_\" + index).text(number_format(rata.importo_rata) + \" \u20AC\");\n                  $(\"#quota_interessi_\" + index).text(number_format(rata.quota_interessi) + \" \u20AC\");\n                  $(\"#quota_capitale_\" + index).text(number_format(rata.quota_capitale) + \" \u20AC\");\n                  $(\"#debito_estinto_\" + index).text(number_format(rata.debito_estinto) + \" \u20AC\");\n                  $(\"#capitale_residuo_\" + index).text(number_format(rata.capitale_residuo) + \" \u20AC\");\n                  $(\"#data_rata_\" + index).text(formatDate(new Date(rata.data_rata)));\n                  if(rata.pagato == \"1\")\n                    $(\"#pagato_\" + index).prop(\"checked\", true);\n                  else\n                    $(\"#pagato_\" + index).prop(\"checked\", false);\n                  if(rata.data_pagamento !== null && typeof rata.data_pagamento !== 'undefined')\n                  $(\"#data_pagamento_\" + index).text(formatDate(new Date(rata.data_pagamento)));\n                  $(\"#file_\" + index).text();\n\n                  $(\"#rata_\" + index).removeClass(\"d-none\");\n                });\n                $(\"#pagamento_rateizzato\").removeClass(\"d-none\");\n\n              }\n            });\n          }\n          $(\"#affrancazione_solo_trasformazione\").prop(\"checked\", pagamento.solo_trasformazione);\n          if(pagamento.solo_trasformazione){\n            $(\"#genera_scheda_in_proprieta\").children(\"a\").prop('href', '/copia_scheda/' + dati_richiesta.scheda_id);\n            $(\"#genera_scheda_in_proprieta\").removeClass(\"d-none\");\n          }\n          else{\n            $(\"#genera_scheda_in_proprieta\").children(\"a\").prop('href', '');\n            $(\"#genera_scheda_in_proprieta\").addClass(\"d-none\");\n          }\n\n          $(\"#elimina_pagamento_affrancazione\").find(\"form\").prop('action', '/affrancazioni_pagamenti/' + pagamento.id);\n          $(\"#elimina_pagamento_affrancazione\").removeClass(\"d-none\");\n          $(\"#nuovo_pagamento_affrancazione\").addClass(\"d-none\");\n          $(\"#pagamenti\").removeClass('d-none');\n        }\n        else{\n          if(typeof dati_richiesta.calcolo_affrancazione !== \"undefined\"){\n            $(\"#nuovo_pagamento_affrancazione\").attr('href', '/vincoli/iter_affrancazione/' + dati_richiesta.id + '/affrancazioni_pagamenti/new');\n            $(\"#nuovo_pagamento_affrancazione\").removeClass(\"d-none\");\n          }\n          $(\"#elimina_pagamento_affrancazione\").addClass(\"d-none\");\n        }\n        if(typeof dati_richiesta.convenzione_finale !== 'undefined'){\n          var convenzione_finale = dati_richiesta.convenzione_finale;\n          $(\"#atto_affrancazione_repertorio\").text(convenzione_finale.repertorio);\n          $(\"#atto_affrancazione_raccolta\").text(convenzione_finale.raccolta);\n          $(\"#atto_affrancazione_data\").text(formatDate(new Date(convenzione_finale.data)));\n          $.ajax({\n            url: \"/dati_notaio\",\n            method: \"GET\",\n            dataType: \"json\",\n            data: {notaio: convenzione_finale.notaio_id},\n            error: function (xhr, status, error) {\n                console.error('AJAX Error: ' + status + \" \" + error);\n            },\n            success: function (dati_notaio) {\n              $(\"#atto_affrancazione_rogante\").text(dati_notaio.nominativo);\n            }\n          });\n          $(\"#atto_affrancazione_numero\").text(convenzione_finale.numero);\n          $(\"#atto_affrancazione_progressivo\").text(convenzione_finale.progressivo);\n          $(\"#atto_affrancazione_anno\").text(convenzione_finale.anno);\n          $(\"#atto_affrancazione_data_registrazione\").text(formatDate(new Date(convenzione_finale.data_registrazione)));\n          $(\"#atto_affrancazione_data_svincolo_vendita\").text(formatDate(new Date(convenzione_finale.data).addYears(5)))\n          $(\"#elimina_atto_affrancazione\").find('form').prop(\"action\", \"/vincoli/iter_affrancazione/\" + dati_richiesta.id + \"/convenzione_finale\");\n          $(\"#elimina_atto_affrancazione\").removeClass(\"d-none\");\n          $(\"#atto-affrancazione\").removeClass('d-none');\n          $(\"#nuovo_atto_affrancazione\").addClass(\"d-none\");\n        }\n        else{\n          $(\"#nuovo_atto_affrancazione\").attr('href', '/vincoli/iter_affrancazione/' + dati_richiesta.id + '/convenzione_finale');\n          $(\"#nuovo_atto_affrancazione\").removeClass(\"d-none\");\n          $(\"#elimina_atto_affrancazione\").addClass(\"d-none\");\n          $(\"#atto-affrancazione\").addClass('d-none');\n        }\n        $(\"#richiesta-affrancazione\").removeClass(\"d-none\");\n      }\n    });\n  });\n\n  // calcola/ricalcola il corrispettivo di affrancazione\n  $(\"#calcola_corrispettivo_affrancazione\").on('click', function(){\n    let data_calcolo = $(\"[name*='calcolo_affrancazione'][name$='[data_calcolo]']\").val();\n    let stt = $(\"[name*='calcolo_affrancazione'][name$='[superficie_totale_terreno]']\").val();\n    let vat = $(\"[name*='calcolo_affrancazione'][name$='[valore_acquisto_terreno]']\").val();\n    let istat = $(\"[name*='calcolo_affrancazione'][name$='[percentuale_ISTAT]']\").val();\n    let vv = $(\"[name*='calcolo_affrancazione'][name$='[valore_venale]']\").val();\n    let perc_vv = $(\"[name*='calcolo_affrancazione'][name$='[percentuale_abbattimento_valore_venale]']\").val();\n    let millesimi = $(\"[name*='calcolo_affrancazione'][name$='[millesimi]']\").val();\n    let calcolo_id = $(\"#calcolo_id\").val();\n    let adc = $(\"#adc\").val();\n    let atc = $(\"#atc\").val();\n    $.ajax({\n      url: \"/calcola_corrispettivo_affrancazione\",\n      method: \"GET\",\n      dataType: \"json\",\n      data: {data_calcolo: data_calcolo, superficie_totale_terreno: stt, id: calcolo_id,\n        valore_acquisto_terreno: vat, istat: istat, valore_venale: vv,\n        percentuale_abbattimento_valore_venale: perc_vv, millesimi: millesimi,\n        adc: adc, atc: atc},\n\n      error: function (xhr, status, error) {\n          console.error('AJAX Error: ' + status + \" \" + error);\n      },\n      success: function (risultati) {\n        var totale = 0;\n        $(\"#valore_acquisto_terreno_totale\").text(number_format(vat * stt));\n        $(\"#valore_acquisto_terreno_rivalutato_totale\").text(number_format(vat * (1 + istat / 100) * stt));\n        $(\"#valore_venale_totale\").text(number_format(vv * stt));\n        $(\"#valore_acquisto_terreno_rivalutato\").val(number_format(vat * (1 + istat / 100)));\n        $(\"#valore_acquisto_terreno_rivalutato\").text(number_format(vat * (1 + istat / 100)));\n        if(risultati.length == 6){\n          $(\"#totale_cc48\").text(number_format(risultati[0]));\n          $(\"[name*='calcolo_affrancazione'][name$='[cc48]']\").val(risultati[0]);\n          $(\"#totale_crv\").text(number_format(risultati[1]));\n          $(\"[name*='calcolo_affrancazione'][name$='[crv]']\").val(risultati[1]);\n          $(\"[name*='calcolo_affrancazione'][name$='[totale_non_limitato]']\").val(risultati[2]);\n          $(\"[name='atc']\").val(risultati[5]);\n          $(\"[name='atc']\").text(risultati[5]);\n          if(risultati[2] < risultati[3]){\n            let content = \"<div class='text-center eln-green-text'>\" +\n                            \"<div>Corrispettivo minimo per questa scheda</div>\" +\n                            \"<div class='text-800'>\" + number_format(risultati[3]) + \" \u20AC</div><br><div>Tot. corrispettivo calcolato</div>\" +\n                            \"<div class='text-800'>\" + number_format(risultati[2]) + \" \u20AC</div>\" +\n            \"</div>\";\n            $('#corrispettivo-affrancazione-alert').popover(\"dispose\");\n            $('#corrispettivo-affrancazione-alert').attr('data-bs-content',content);\n            $('#corrispettivo-affrancazione-alert').popover({ trigger: 'hover', html: true, container: 'body', placement: 'top' });\n            $(\"#corrispettivo-affrancazione-alert\").removeClass(\"d-none\");\n            totale = risultati[3];\n          }\n          else if(risultati[4] > 0 && risultati[2] > Number(risultati[4] * stt)){\n            let content = \"<div class='text-center eln-green-text'>\" +\n                            \"<div>Valore massimo di cessione comma 48.2 L.448/98</div>\" +\n                            \"<div class='text-800'>\" + number_format(risultati[4]) + \" \u20AC/mq</div>\" +\n                            \"<br>\" +\n                            \"<div>Tot. corrispettivo calcolato: <span class='text-800'>\" + number_format(risultati[2]) + \" \u20AC</span></div>\" +\n                            \"<div class='text-800'>\" + number_format(risultati[4] * stt) + \" \u20AC/mq</div>\" +\n                            \"</div>\";\n            totale = Number(risultati[4] * stt);\n            $('#corrispettivo-affrancazione-alert').popover(\"dispose\");\n            $('#corrispettivo-affrancazione-alert').attr('data-bs-content',content);\n            $('#corrispettivo-affrancazione-alert').popover({ trigger: 'hover', html: true, container: 'body', placement: 'top' });\n            $(\"#corrispettivo-affrancazione-alert\").removeClass(\"d-none\");\n          }\n          else{\n            totale = risultati[2];\n            $(\"#corrispettivo-affrancazione-alert\").addClass(\"d-none\");\n          }\n        }\n        if(risultati.length == 7){\n          // PIP: [cc662, crv662, totale, minimo_fisso, minimo_mq_totale, minimo_mq, atc]\n          $(\"#totale_cc48\").text(number_format(risultati[0]));\n          $(\"[name*='calcolo_affrancazione'][name$='[cc48]']\").val(risultati[0]);\n          $(\"#totale_crv\").text(number_format(risultati[1]));\n          $(\"[name*='calcolo_affrancazione'][name$='[crv]']\").val(risultati[1]);\n          $(\"[name*='calcolo_affrancazione'][name$='[totale_non_limitato]']\").val(risultati[2]);\n          $(\"[name='atc']\").val(risultati[6]);\n          $(\"[name='atc']\").text(risultati[6]);\n          if(risultati[3] > 0 && risultati[2] < Number(risultati[3])){\n            let content = \"<div class='text-center eln-green-text'>\" +\n                            \"<div>Corrispettivo minimo fisso PIP applicato a questa scheda</div>\" +\n                            \"<div class='text-800'>\" + number_format(risultati[3]) + \" \u20AC</div><br><div>Tot. corrispettivo calcolato</div>\" +\n                            \"<div class='text-800'>\" + number_format(risultati[2]) + \" \u20AC</div>\" +\n            \"</div>\";\n            $('#corrispettivo-affrancazione-alert').popover(\"dispose\");\n            $('#corrispettivo-affrancazione-alert').attr('data-bs-content',content);\n            $('#corrispettivo-affrancazione-alert').popover({ trigger: 'hover', html: true, container: 'body', placement: 'top' });\n            $(\"#corrispettivo-affrancazione-alert\").removeClass(\"d-none\");\n            totale = Number(risultati[3]);\n          }\n          else if(risultati[4] > 0 && risultati[2] < Number(risultati[4])){\n            let content = \"<div class='text-center eln-green-text'>\" +\n                            \"<div>Corrispettivo minimo PIP al mq</div>\" +\n                            \"<div class='text-800'>\" + number_format(risultati[5]) + \" \u20AC/mq</div>\" +\n                            \"<div class='text-800'>Soglia al mq: \" + number_format(risultati[4]) + \" \u20AC</div><br>\" +\n                            \"<div>Tot. corrispettivo calcolato</div>\" +\n                            \"<div class='text-800'>\" + number_format(risultati[2]) + \" \u20AC</div>\" +\n            \"</div>\";\n            $('#corrispettivo-affrancazione-alert').popover(\"dispose\");\n            $('#corrispettivo-affrancazione-alert').attr('data-bs-content',content);\n            $('#corrispettivo-affrancazione-alert').popover({ trigger: 'hover', html: true, container: 'body', placement: 'top' });\n            $(\"#corrispettivo-affrancazione-alert\").removeClass(\"d-none\");\n            totale = risultati[2];\n          }\n          else{\n            totale = risultati[2];\n            $(\"#corrispettivo-affrancazione-alert\").addClass(\"d-none\");\n          }\n        }\n        $(\"#totale_affrancazione\").text(number_format(totale));\n        $(\"[name*='calcolo_affrancazione'][name$='[totale]']\").val(totale.toFixed(2));\n        $(\"#calcolo_affrancazione_submit\").prop(\"disabled\", false);\n        $(\"#iter_affrancazione_submit\").prop(\"disabled\", false);\n      }\n    });\n  });\n\n  // quando modifico il calcolo dell'affrancazione, disabilito il pulsante di salvataggio\n  $(\"input[name*='calcolo_affrancazione']\").on(\"keydown\", function(){\n    if($(this).attr('name') != 'calcolo_affrancazione_totale_manuale_valore'){\n      $(\"#calcolo_affrancazione_submit\").prop(\"disabled\", true);\n      $(\"#iter_affrancazione_submit\").prop(\"disabled\", true);\n    }\n  })\n\n  // mostra e abilita il totale manuale quando selezionato, altrimenti lo nasconde e mantiene il calcolo automatico.\n  $(\"#calcolo_affrancazione_totale_manuale, #iter_affrancazione_calcolo_affrancazione_attributes_totale_manuale\").on('change', function(){\n    if(this.checked){\n      $(\"#totale-manuale-affrancazione-container\").removeClass(\"d-none\");\n      $(\"#calcolo_affrancazione_totale_manuale_valore\").prop(\"disabled\", false);\n      $(\"#calcolo_affrancazione_totale_manuale_valore\").prop(\"required\", true);\n      $(\"#calcolo_affrancazione_submit\").prop(\"disabled\", false);\n    }\n    else{\n      $(\"#totale-manuale-affrancazione-container\").addClass(\"d-none\");\n      $(\"#calcolo_affrancazione_totale_manuale_valore\").prop(\"disabled\", true);\n      $(\"#calcolo_affrancazione_totale_manuale_valore\").prop(\"required\", false);\n      $(\"#calcolo_affrancazione_submit\").prop(\"disabled\", true);\n    }\n  });\n\n  // aggiorna i campi nascosti quando l'importo manuale viene cambiato senza ricalcolare.\n  $(\"#calcolo_affrancazione_totale_manuale_valore\").on('input', function(){\n    if($(\"#calcolo_affrancazione_totale_manuale, #iter_affrancazione_calcolo_affrancazione_attributes_totale_manuale\").is(\":checked\")){\n      let totale_manuale = $(this).val().replace(',', '.');\n      $(\"#totale_affrancazione\").text(number_format(Number(totale_manuale)));\n      $(\"[name*='calcolo_affrancazione'][name$='[totale]']\").val(totale_manuale);\n      $(\"[name*='calcolo_affrancazione'][name$='[totale_non_limitato]']\").val(totale_manuale);\n      $(\"#calcolo_affrancazione_submit\").prop(\"disabled\", false);\n      $(\"#iter_affrancazione_submit\").prop(\"disabled\", false);\n    }\n  });\n\n  // in fase di creazione di una richiesta del corrispettivo di affrancazione\n  // abilita/disabilita la creazione del calcolo del corrispettivo\n  $(\"#corrispettivo_incluso\").on('change', function(){\n    if(this.checked){\n      $(\"#calcolo_corrispettivo_richiesta\").removeClass(\"d-none\");\n      $(\"[name^='iter_affrancazione[calcolo_affrancazione_attributes]']\").prop('required', true);\n      $(\"#iter_affrancazione_calcolo_affrancazione_attributes_totale_manuale\").prop('required', false);\n    }\n    else{\n      $(\"#calcolo_corrispettivo_richiesta\").addClass(\"d-none\");\n      $(\"[name^='iter_affrancazione[calcolo_affrancazione_attributes]']\").prop('required', false);\n    }\n  });\n\n  // in fase di creazione di una richiesta dei vincoli\n  // abilita/disabilita la creazione del calcolo del valore massimo di vendita\n  $(\"#calcolo_incluso\").on('change', function(){\n    if(this.checked){\n      $(\"#calcolo_valore_ui_richiesta\").removeClass(\"d-none\");\n      $(\"[name^='iter_calcolo_valore_ui[calcolo_valore_ui_attributes]']\").prop('required', true);\n    }\n    else{\n      $(\"#calcolo_valore_ui_richiesta\").addClass(\"d-none\");\n      $(\"[name^='iter_calcolo_valore_ui[calcolo_valore_ui_attributes]']\").prop('required', false);\n    }\n  });\n\n  // in fase di creazione di una richiesta dei vincoli\n  // abilita/disabilita l'inserimento dei requisti degli acquirenti\n  $(\"#requisiti_inclusi\").on('change', function(){\n    if(this.checked)\n      $(\"#requisiti_acquirenti_richiesta\").removeClass(\"d-none\");\n    else\n      $(\"#requisiti_acquirenti_richiesta\").addClass(\"d-none\");\n  });\n\n  // filtra le richieste dei requisiti acquirenti basandosi su protocolo, data e\n  // soggetto referente\n  $(\"[name='filtro_richieste_requisiti']\").on('change', function(){\n    var protocollo = $(\"#protocollo\").val();\n    var data = $(\"#data\").val();\n    var soggetto_referente = $(\"#soggetto_referente\").val();\n    var scheda_id = $(\"#scheda_id\").val();\n    $.ajax({\n      url: \"/elenco_richieste_requisiti\",\n      method: \"GET\",\n      dataType: \"json\",\n      data: {protocollo: protocollo, data: data, soggetto_referente: soggetto_referente, scheda_id: scheda_id},\n      error: function (xhr, status, error) {\n          console.error('AJAX Error: ' + status + \" \" + error);\n      },\n      success: function (elenco_richieste) {\n       $(\"#requisiti_acquirenti_table tbody\").children(\"tr\").addClass(\"d-none\");\n        $.each(elenco_richieste, function(i, richiesta){\n          $(\"#richiesta_requisit-\"+ richiesta.id).removeClass(\"d-none\");\n          $(\"#protocollo\").children(\"option[value='\"+richiesta.passaggio_iter[0].repertorio+\"']\").removeClass(\"d-none\");\n          $(\"#data\").children(\"option[value='\"+richiesta.passaggio_iter[0].data+\"']\").removeClass(\"d-none\");\n          $(\"#soggetto_referente\").children(\"option[value='\"+richiesta.soggetto_referente+\"']\").removeClass(\"d-none\");\n        })\n        $(\"#protocollo\").children(\"option[value='']\").removeClass(\"d-none\");\n        $(\"#data\").children(\"option[value='']\").removeClass(\"d-none\");\n        $(\"#soggetto_referente\").children(\"option[value='']\").removeClass(\"d-none\");\n      }\n    });\n  });\n\n  // quando seleziono una richiesta dei requisiti acquirenti ne mostro il dettaglio\n  $(\".selectable-row[id^='richiesta_requisiti']\").on('click', function(){\n    let id = Number($(this).attr('id').split(\"-\")[1]);\n    $.ajax({\n      url: \"/dati_richiesta_requisiti\",\n      method: \"GET\",\n      dataType: \"json\",\n      data: {richiesta: id},\n      error: function (xhr, status, error) {\n          console.error('AJAX Error: ' + status + \" \" + error);\n      },\n      success: function (dati_richiesta) {\n        let requisiti_string = '';\n        $.each(dati_richiesta.requisito_acquirente_iter_requisiti_acquirenti, function(index, requisito){\n          let checked_true = checked_false = checked_nil = toggle_option_slider_class = '';\n          let stato = requisito.stato\n          if(stato === true){\n            checked_true = 'checked=\"true\"'\n            toggle_option_slider_class = 'toggle_option_slider_true'\n          }\n          else if(stato === false){\n            checked_false = 'checked=\"true\"'\n            toggle_option_slider_class = 'toggle_option_slider_false'\n          }\n          else if(stato === null){\n            checked_nil = 'checked=\"true\"';\n            toggle_option_slider_class = 'toggle_option_slider_nil'\n          }\n          requisiti_string += \"\" +\n            \"<div class='row' name='requisito\" + index + \"'>\" +\n              \"<div class='fs--1 col-1'>\" +\n                \"<div class='wrapper'>\" +\n                  \"<div class='toggle_radio text-start'>\" +\n                    \"<input type='radio' class='toggle_option' id='false_requisito_\" + index + \"' name='iter_requisito_acquirente[requisito_acquirente_iter_requisito_acquirente][\" + index + \"][stato]' disabled \" + checked_false + \">\" +\n                    \"<input type='radio' class='toggle_option' id='nil_requisito_\" + index + \"' name='iter_requisito_acquirente[requisito_acquirente_iter_requisito_acquirente][\" + index + \"][stato]' disabled \" + checked_nil + \">\" +\n                    \"<input type='radio' class='toggle_option' id='true_requisito_\" + index + \"' name='iter_requisito_acquirente[requisito_acquirente_iter_requisito_acquirente][\" + index + \"][stato]' disabled \" + checked_true + \">\" +\n                    \"<label for='false_requisito_\" + index + \"'></label>\" +\n                    \"<label for='nil_requisito_\" + index + \"'></label>\" +\n                    \"<label for='true_requisito_\" + index + \"'></label>\" +\n                    \"<div class='toggle_option_slider \" + toggle_option_slider_class +\"'>\" +\n                    \"</div>\" +\n                  \"</div>\" +\n                \"</div>\" +\n              \"</div>\" +\n              \"<span class='fs--1 col-4'>\" + dati_richiesta.requisito_acquirente[index].descrizione_breve + \"</span>\" +\n              \"<span class='fs--1 col'>\" + dati_richiesta.requisito_acquirente[index].descrizione + \"</span>\" +\n            \"</div>\";\n        });\n        $(\"#lista_requisiti_acquirenti_selezionati\").html(requisiti_string);\n        $(\"#reddito_massimo_selezionato\").text(dati_richiesta.reddito_massimo);\n        $(\"#reddito_nucleo_familiare_selezionato\").text(dati_richiesta.reddito_nucleo_familiare);\n        $(\"#iter_requisiti_acquirenti\").val(dati_richiesta.id);\n        $(\"#requisiti_acquirenti_selezionati\").removeClass(\"d-none\");\n      }\n    });\n  });\n\n  // filtra le richieste dei calcoli del valore ui basandosi su protocolo, data e\n  // soggetto referente\n  $(\"[name='filtro_richieste_calcoli']\").on('change', function(){\n    var protocollo = $(\"#protocollo\").val();\n    var data = $(\"#data\").val();\n    var soggetto_referente = $(\"#soggetto_referente\").val();\n    var scheda_id = $(\"#scheda_id\").val();\n    $.ajax({\n      url: \"/elenco_richieste_calcolo_ui\",\n      method: \"GET\",\n      dataType: \"json\",\n      data: {protocollo: protocollo, data: data, soggetto_referente: soggetto_referente, scheda_id: scheda_id},\n      error: function (xhr, status, error) {\n          console.error('AJAX Error: ' + status + \" \" + error);\n      },\n      success: function (elenco_richieste) {\n        $(\"#richieste_calcolo_table tbody\").children(\"tr\").addClass(\"d-none\");\n        $.each(elenco_richieste, function(i, richiesta){\n          $(\"#richiesta_requisit-\"+ richiesta.id).removeClass(\"d-none\");\n          $(\"#protocollo\").children(\"option[value='\"+richiesta.passaggio_iter[0].repertorio+\"']\").removeClass(\"d-none\");\n          $(\"#data\").children(\"option[value='\"+richiesta.passaggio_iter[0].data+\"']\").removeClass(\"d-none\");\n          $(\"#soggetto_referente\").children(\"option[value='\"+richiesta.soggetto_referente+\"']\").removeClass(\"d-none\");\n        })\n        $(\"#protocollo\").children(\"option[value='']\").removeClass(\"d-none\");\n        $(\"#data\").children(\"option[value='']\").removeClass(\"d-none\");\n        $(\"#soggetto_referente\").children(\"option[value='']\").removeClass(\"d-none\");\n      }\n    });\n  });\n\n  // quando seleziono una richiesta di calcolo del valore masismo di vendita ne mostro il dettaglio\n  $(\".selectable-row[id^='richiesta_calcolo']\").on('click', function(){\n    let id = Number($(this).attr('id').split(\"-\")[1]);\n    $.ajax({\n      url: \"/dati_richiesta_calcolo_valore_ui\",\n      method: \"GET\",\n      dataType: \"json\",\n      data: {richiesta: id},\n      error: function (xhr, status, error) {\n          console.error('AJAX Error: ' + status + \" \" + error);\n      },\n      success: function (dati_richiesta) {\n        var calcolo = dati_richiesta.calcolo_valore_ui\n        if(typeof calcolo !== 'undefined'){\n          $(\"#valore_ui_data_calcolo\").text(formatDate(new Date(calcolo.data_calcolo)));\n          $(\"#valore_ui_valore_iniziale\").text(number_format(calcolo.valore_iniziale));\n          $(\"#valore_ui_data_valore_iniziale\").text(formatDate(new Date(calcolo.data_valore_iniziale)));\n          $(\"#valore_ui_superficie\").text(number_format(calcolo.superficie));\n          $(\"#valore_ui_percentuale_ISTAT\").text(number_format(calcolo.percentuale_ISTAT));\n          $(\"#valore_ui_data_ISTAT\").text(formatDate(new Date(calcolo.data_ISTAT)));\n          $(\"#valore_ui_percentuale_vetusta\").text(number_format(calcolo.percentuale_vetusta));\n          $(\"#valore_ui_migliorie\").text(number_format(calcolo.migliorie));\n          $(\"#valore_ui_totale\").text(number_format(calcolo.totale));\n          $(\"#valore_ui_valore_massimo_locazione\").text(number_format(calcolo.valore_locazione));\n          $(\"#valore_ui_percentuale_locazione\").text(number_format(calcolo.percentuale_locazione));\n\n          $(\"#iter_calcolo_valore_ui\").val(dati_richiesta.id);\n          $(\"#richiesta_selezionata\").removeClass(\"d-none\");\n        }\n      }\n    });\n  });\n\n  // in modifica agevolazioni quando seleziono un'agevolazione modifico il corrispettivo scontato\n  $(\"[name^='iter_affrancazione[agevolazione_iter_affrancazione_attributes]'][name$='[applicata]']\").on('change', function(){\n    let totale_agevolazioni = Number($(\"#totale_percentuale_agevolazioni\").val());\n    if(this.checked)\n      totale_agevolazioni += Number($(this).val());\n    else\n      totale_agevolazioni -= Number($(this).val());\n    let totale_corrispettivo = Number($(\"#totale_corrispettivo_affrancazione\").val());\n    let totale_corrispettivo_scontato = Number(totale_corrispettivo * (1 - totale_agevolazioni / 100));\n    $(\"#totale_percentuale_agevolazioni_formattato\").text(number_format(totale_agevolazioni));\n    $(\"#totale_corrispettivo_affrancazione_scontato_formattato\").text(number_format(totale_corrispettivo_scontato));\n    $(\"#totale_percentuale_agevolazioni\").val(totale_agevolazioni);\n    $(\"#totale_corrispettivo_affrancazione_scontato\").val(totale_corrispettivo_scontato);\n  });\n\n  // quando cambio tipo pagamento nelle affrancazioni, mi cambia il contenuto da visualizzare\n  $(\"input[name='pagamento[tipo_pagamento]']:radio\").on('change', function(){\n    if (this.value == 1) {\n      $(\"#pagamento_rateizzato_acconto_label\").text(\"\");\n      $(\"#pagamento_unico_label\").removeClass(\"d-none\");\n      $(\"#pagamento_rateizzato_label\").addClass(\"d-none\");\n      $(\"[name^='pagamento[rateizzazione_attributes]']\").prop(\"disabled\", true);\n      $(\"#pagamento_rateizzato\").addClass(\"d-none\");\n    }\n    else if (this.value == 2) {\n      $(\"#pagamento_rateizzato_acconto_label\").text(\"Acconto\");\n      $(\"#pagamento_unico_label\").addClass(\"d-none\");\n      $(\"#pagamento_rateizzato_label\").removeClass(\"d-none\");\n      $(\"[name^='pagamento[rateizzazione_attributes]']\").prop(\"disabled\", false);\n      $(\"[name^='pagamento[rateizzazione_attributes]'][name$='[pagato]']\").prop(\"disabled\", true);\n      $(\"#pagamento_rateizzato\").removeClass(\"d-none\");\n    }\n  });\n\n  function aggiornaTotalePagamentoAffrancazione(){\n    const container = $(\"#valore_acquisto_terreno_rivalutato_totale\");\n    const checkbox = $(\"#pagamento_solo_trasformazione\");\n    if (container.length === 0 || checkbox.length === 0)\n      return;\n\n    const totaleScontato = Number(container.data(\"totale-scontato\"));\n    const totaleCc48 = Number(container.data(\"cc48-scontato\"));\n    const soloTrasformazione = checkbox.is(\":checked\");\n    let nuovoTotale = soloTrasformazione ? totaleCc48 : totaleScontato;\n    if (isNaN(nuovoTotale))\n      nuovoTotale = 0;\n\n    container.text(number_format(nuovoTotale) + \" \u20AC\");\n\n    const hiddenTotale = $(\"#totale_corrispettivo\");\n    if (hiddenTotale.length)\n      hiddenTotale.val(nuovoTotale.toFixed(2));\n\n    const label = $(\"#corrispettivo_label\");\n    if (label.length){\n      const labelFull = label.data(\"labelFull\");\n      const labelSolo = label.data(\"labelSolo\");\n      if (soloTrasformazione && labelSolo)\n        label.text(labelSolo);\n      else if (labelFull)\n        label.text(labelFull);\n    }\n\n    const accontoField = $(\"#pagamento_rateizzazione_attributes_acconto\");\n    if (accontoField.length){\n      accontoField.attr(\"max\", nuovoTotale);\n      if (!accontoField.prop(\"disabled\")){\n        let accontoVal = Number(accontoField.val());\n        if (isNaN(accontoVal))\n          accontoVal = 0;\n        if (accontoVal > nuovoTotale){\n          accontoVal = nuovoTotale;\n          accontoField.val(nuovoTotale.toFixed(2));\n        }\n\n        const importo = Math.max(nuovoTotale - accontoVal, 0);\n        const importoElement = $(\"#rateizzazione_importo\");\n        if (importoElement.length)\n          importoElement.text(number_format(importo) + \" \u20AC\");\n\n        const totaleField = $(\"#pagamento_rateizzazione_attributes_totale\");\n        if (totaleField.length)\n          totaleField.val(\"\");\n        const rataField = $(\"#pagamento_rateizzazione_attributes_rata_periodica\");\n        if (rataField.length)\n          rataField.val(\"\");\n        const interessiField = $(\"#pagamento_rateizzazione_attributes_interessi\");\n        if (interessiField.length)\n          interessiField.val(\"\");\n\n        const totaleDisplay = $(\"#rateizzazione_totale\");\n        if (totaleDisplay.length)\n          totaleDisplay.text(number_format(0) + \" \u20AC\");\n        const rataDisplay = $(\"#rateizzazione_rata_periodica\");\n        if (rataDisplay.length)\n          rataDisplay.text(number_format(0) + \" \u20AC\");\n        const interessiDisplay = $(\"#rateizzazione_interessi\");\n        if (interessiDisplay.length)\n          interessiDisplay.text(number_format(0) + \" \u20AC\");\n      }\n    }\n  }\n\n  $(document).on(\"change\", \"#pagamento_solo_trasformazione\", aggiornaTotalePagamentoAffrancazione);\n  aggiornaTotalePagamentoAffrancazione();\n\n  // calcola il piano di rateizzazione dei pagamenti delle affrancazioni\n  $(\"#calcola_rateizzazione_affrancazione\").on('click', function(){\n    var totale_corrispettivo = $(\"#totale_corrispettivo\").val();\n    var acconto = $(\"#pagamento_rateizzazione_attributes_acconto\").val();\n    var tasso_annuale = $(\"#pagamento_rateizzazione_attributes_tasso_annuale\").val();\n    var numero_rate = $(\"#pagamento_rateizzazione_attributes_numero_rate\").val();\n    var numero_rate_annuale = $(\"#pagamento_rateizzazione_attributes_tipo_rate\").val();\n    var data_prima_rata = new Date($(\"#pagamento_rateizzazione_attributes_data_inizio_rateizzazione\").val());\n    var importo = totale_corrispettivo - acconto;\n    var tasso_ricalcolato = tasso_annuale / 100 / numero_rate_annuale;\n    var rata = 0;\n    if(tasso_ricalcolato != 0)\n      rata = importo * ((tasso_ricalcolato + 1)**numero_rate)*tasso_ricalcolato/(((tasso_ricalcolato + 1)**numero_rate) -1);\n    else\n      rata = importo / numero_rate;\n    var totale = rata * numero_rate;\n    var interessi = totale - importo;\n\n    $(\"#rateizzazione_importo\").text(number_format(importo));\n    $(\"#rateizzazione_interessi\").text(number_format(interessi));\n    $(\"#pagamento_rateizzazione_attributes_interessi\").val(interessi);\n    $(\"#rateizzazione_totale\").text(number_format(totale));\n    $(\"#pagamento_rateizzazione_attributes_totale\").val(totale);\n    $(\"#rateizzazione_rata_periodica\").text(number_format(rata));\n    $(\"#pagamento_rateizzazione_attributes_rata_periodica\").val(rata);\n\n    var debito_residuo = importo;\n    var totale_rate = 0;\n    var totale_interessi = 0;\n    var totale_capitale = 0;\n    var debito_estinto = 0;\n\n    $(\"[name='rata']\").toArray().forEach((el) => {\n      let id = Number(el.id.split('_')[1]);\n      if(id < numero_rate){\n        let interesse_rata = debito_residuo * tasso_ricalcolato;\n        let capitale = rata - interesse_rata;\n        totale_rate += rata;\n        totale_interessi += interesse_rata;\n        totale_capitale += capitale;\n        debito_estinto += capitale;\n        debito_residuo -= capitale;\n        $(\"#importo_rata_\" + id).text(number_format(rata));\n        $(\"#pagamento_rateizzazione_attributes_rata_attributes_\" + id + \"_importo_rata\").val(rata);\n        $(\"#quota_interessi_\" + id).text(number_format(interesse_rata));\n        $(\"#pagamento_rateizzazione_attributes_rata_attributes_\" + id + \"_quota_interessi\").val(interesse_rata);\n        $(\"#quota_capitale_\" + id).text(number_format(capitale));\n        $(\"#pagamento_rateizzazione_attributes_rata_attributes_\" + id + \"_quota_capitale\").val(capitale);\n        $(\"#debito_estinto_\" + id).text(number_format(debito_estinto));\n        $(\"#pagamento_rateizzazione_attributes_rata_attributes_\" + id + \"_debito_estinto\").val(debito_estinto);\n        $(\"#capitale_residuo_\" + id).text(number_format(debito_residuo));\n        $(\"#pagamento_rateizzazione_attributes_rata_attributes_\" + id + \"_capitale_residuo\").val(debito_residuo);\n        $(\"#data_rata_\" + id).text(formatDate(data_prima_rata));\n        $(\"#pagamento_rateizzazione_attributes_rata_attributes_\" + id + \"_data_rata\").val(data_prima_rata);\n        data_prima_rata = data_prima_rata.addMonths(12/numero_rate_annuale);\n        $(this).removeClass('d-none');\n      }\n      else{\n        $(\"[name='pagamento[rateizzazione_attributes][rata_attributes][\" + id + \"][_destroy]']\").val(1);\n        $(this).addClass('d-none');\n      }\n\n    });\n  });\n\n  // per eliminare una rata pagata, setto la sua data a nil\n  $(\"#elimina_pagamento_rata_affrancazione\").on('click', function(){\n    $(\"#rata_data_pagamento\").val(\"\");\n    $(\"#inserimento_pagamento_rata\").trigger('submit');\n  });\n\n  // nella schermata di selezione della stampa della scheda, abilita/disabilita\n  // le richieste del valore ui\n  $(\"[name='stampa_richieste_vincoli']\").on('change', function(){\n    if(this.checked){\n      $(\"#stampa_richieste_vincoli_div\").removeClass(\"d-none\");\n      $(\"[name='tipo_stampa_vincoli']\").prop(\"disabled\", false);\n      if($(\"[name='tipo_stampa_vincoli']:checked\").val() == 'singola'){\n        $(\"[name='stampa_gestione_iter_vincoli']\").prop(\"disabled\", false);\n        $(\"[name='stampa_calcolo_vincoli']\").prop(\"disabled\", false);\n        $(\"[name='stampa_requisiti_acquirenti']\").prop(\"disabled\", false);\n        $(\"[name='stampa_atto_compravendita']\").prop(\"disabled\", false);\n        $(\"[name='richiesta_vincoli_selezionata']\").prop(\"disabled\", false);\n      }\n    }\n    else{\n      $(\"#stampa_richieste_vincoli_div\").addClass(\"d-none\");\n      $(\"[name='tipo_stampa_vincoli']\").prop(\"disabled\", true);\n      $(\"[name='stampa_gestione_iter_vincoli']\").prop(\"disabled\", true);\n      $(\"[name='stampa_calcolo_vincoli']\").prop(\"disabled\", true);\n      $(\"[name='stampa_requisiti_acquirenti']\").prop(\"disabled\", true);\n      $(\"[name='stampa_atto_compravendita']\").prop(\"disabled\", true);\n      $(\"[name='richiesta_vincoli_selezionata']\").prop(\"disabled\", true);\n    }\n  });\n\n  // nella schermata di selezione della stampa della scheda, mostra/nasconde\n  // la selezione della richiesta da stampare\n  $(\"[name='tipo_stampa_vincoli'\").on('change', function(){\n    var val = this.value;\n    if (val == 'singola'){\n      $(\"[name='stampa_gestione_iter_vincoli']\").prop(\"disabled\", false);\n      $(\"[name='stampa_calcolo_vincoli']\").prop(\"disabled\", false);\n      $(\"[name='stampa_requisiti_acquirenti']\").prop(\"disabled\", false);\n      $(\"[name='stampa_atto_compravendita']\").prop(\"disabled\", false);\n      $(\"[name='richiesta_vincoli_selezionata']\").prop(\"disabled\", false);\n      $(\"#elenco_richieste_ui_div\").removeClass(\"d-none\");\n    }\n    else{\n      $(\"[name='stampa_gestione_iter_vincoli']\").prop(\"disabled\", true);\n      $(\"[name='stampa_calcolo_vincoli']\").prop(\"disabled\", true);\n      $(\"[name='stampa_requisiti_acquirenti']\").prop(\"disabled\", true);\n      $(\"[name='stampa_atto_compravendita']\").prop(\"disabled\", true);\n      $(\"[name='richiesta_vincoli_selezionata']\").prop(\"disabled\", true);\n      $(\"#elenco_richieste_ui_div\").addClass(\"d-none\");\n    }\n  });\n\n  // nella schermata di selezione della stampa della scheda, mostra/nasconde\n  // le tabelle delle richieste dei requisiti acquirenti e/o dei calcoli di valore unit\u00E0 immobiliare\n  $(\"[name='tipo_richiesta_vincoli'\").on('change', function(){\n    var val = this.value;\n    if (val == 'calcolo'){\n      $(\"#richieste_requisiti_acquirenti_table_container\").addClass(\"d-none\");\n      $(\"#richieste_requisiti_acquirenti_filtri\").addClass(\"d-none\");\n      $(\"#richieste_calcolo_ui_table_container\").removeClass(\"d-none\");\n      $(\"#richieste_calcolo_ui_filtri\").removeClass(\"d-none\");\n    }\n    else{\n      $(\"#richieste_requisiti_acquirenti_table_container\").removeClass(\"d-none\");\n      $(\"#richieste_requisiti_acquirenti_filtri\").removeClass(\"d-none\");\n      $(\"#richieste_calcolo_ui_filtri\").addClass(\"d-none\");\n      $(\"#richieste_calcolo_ui_table_container\").addClass(\"d-none\");\n    }\n  });\n\n  // nella schermata di selezione della stampa della scheda,\n  // filtra l'elenco delle richieste di calcolo da selezionare e le dropdown\n  $(\"[name='richieste_calcolo_ui_filtri']\").on('change', function(){\n    var protocollo = $(\"#protocollo_valore_ui\").val();\n    var data = $(\"#data_valore_ui\").val();\n    var soggetto_referente = $(\"#soggetto_referente_valore_ui\").val();\n    var scheda_id = $(\"#scheda_id\").val();\n    if($(this).attr('id') !== 'protocollo_valore_ui')\n      $(\"#protocollo_valore_ui\").children(\"option\").addClass(\"d-none\");\n    if($(this).attr('id') !== 'data_valore_ui')\n      $(\"#data_valore_ui\").children(\"option\").addClass(\"d-none\");\n    if($(this).attr('id') !== 'soggetto_referente_valore_ui')\n      $(\"#soggetto_referente_valore_ui\").children(\"option\").addClass(\"d-none\");\n    $.ajax({\n      url: \"/elenco_richieste_ui\",\n      method: \"GET\",\n      dataType: \"json\",\n      data: {protocollo: protocollo, data: data, soggetto_referente: soggetto_referente, scheda_id: scheda_id},\n      error: function (xhr, status, error) {\n          console.error('AJAX Error: ' + status + \" \" + error);\n      },\n      success: function (elenco_richieste) {\n        $(\"#richieste_calcolo_ui_table tbody\").children(\"tr\").addClass(\"d-none\");\n        $.each(elenco_richieste, function(i, richiesta){\n          $(\"#richiesta_valore_ui_numero-\"+ richiesta.id).removeClass(\"d-none\");\n          $(\"#protocollo_valore_ui\").children(\"option[value='\"+richiesta.passaggio_iter[0].protocollo+\"']\").removeClass(\"d-none\");\n          $(\"#data_valore_ui\").children(\"option[value='\"+formatDate(new Date(richiesta.passaggio_iter[0].data))+\"']\").removeClass(\"d-none\");\n          $(\"#soggetto_referente_valore_ui\").children(\"option[value='\"+richiesta.soggetto_referente+\"']\").removeClass(\"d-none\");\n        });\n        $(\"#protocollo_valore_ui\").children(\"option[value='']\").removeClass(\"d-none\");\n        $(\"#data_valore_ui\").children(\"option[value='']\").removeClass(\"d-none\");\n        $(\"#soggetto_referente_valore_ui\").children(\"option[value='']\").removeClass(\"d-none\");\n      }\n    });\n  });\n\n  // nella schermata di selezione della stampa della scheda,\n  // filtra l'elenco delle richieste dei requisiti da selezionare e le dropdown\n  $(\"[name='richieste_requisiti_filtro']\").on('change', function(){\n    var protocollo = $(\"#protocollo_requisiti_acquirenti\").val();\n    var data = $(\"#data_requisiti_acquirenti\").val();\n    var soggetto_referente = $(\"#soggetto_referente_requisiti_acquirenti\").val();\n    var scheda_id = $(\"#scheda_id\").val();\n    if($(this).attr('id') !== 'protocollo_requisiti_acquirenti')\n      $(\"#protocollo_requisiti_acquirenti\").children(\"option\").addClass(\"d-none\");\n    if($(this).attr('id') !== 'data_requisiti_acquirenti')\n      $(\"#data_requisiti_acquirenti\").children(\"option\").addClass(\"d-none\");\n    if($(this).attr('id') !== 'soggetto_referente_requisiti_acquirenti')\n      $(\"#soggetto_referente_requisiti_acquirenti\").children(\"option\").addClass(\"d-none\");\n    $.ajax({\n      url: \"/elenco_richieste_requisiti\",\n      method: \"GET\",\n      dataType: \"json\",\n      data: {protocollo: protocollo, data: data, soggetto_referente: soggetto_referente, scheda_id: scheda_id},\n      error: function (xhr, status, error) {\n          console.error('AJAX Error: ' + status + \" \" + error);\n      },\n      success: function (elenco_richieste) {\n        $(\"#richieste_requisiti_acquirenti_table tbody\").children(\"tr\").addClass(\"d-none\");\n        $.each(elenco_richieste, function(i, richiesta){\n          $(\"#richiesta_requisiti_acquirenti_numero-\"+ richiesta.id).removeClass(\"d-none\");\n          $(\"#protocollo_requisiti_acquirenti\").children(\"option[value='\"+richiesta.passaggio_iter[0].protocollo+\"']\").removeClass(\"d-none\");\n          $(\"#data_requisiti_acquirenti\").children(\"option[value='\"+formatDate(new Date(richiesta.passaggio_iter[0].data))+\"']\").removeClass(\"d-none\");\n          $(\"#soggetto_referente_requisiti_acquirenti\").children(\"option[value='\"+richiesta.soggetto_referente+\"']\").removeClass(\"d-none\");\n        });\n        $(\"#protocollo_requisiti_acquirenti\").children(\"option[value='']\").removeClass(\"d-none\");\n        $(\"#data_requisiti_acquirenti\").children(\"option[value='']\").removeClass(\"d-none\");\n        $(\"#soggetto_referente_requisiti_acquirenti\").children(\"option[value='']\").removeClass(\"d-none\");\n      }\n    });\n  });\n\n  // nella schermata di selezione della stampa della scheda, mostra/nasconde\n  // i dettagli dellla richiesta di calcolo selezionata\n  $(\".selectable-row[id^='richiesta_valore_ui_numero']\").on('click', function(){\n    let id = Number($(this).attr('id').split(\"-\")[1]);\n\n    $(\"#protocollo_vincoli_selezionato\").text($(this).children(\"[name='protocollo']\").text());\n    $(\"#data_vincoli_selezionato\").text($(this).children(\"[name='data']\").text());\n    $(\"#soggetto_referente_vincoli_selezionato\").text($(this).children(\"[name='soggetto_referente']\").text());\n\n    $(\"#richiesta_vincoli_selezionata\").removeClass(\"d-none\");\n    $(\"[name='richiesta_vincoli_selezionata']\").val(id);\n  });\n\n  // nella schermata di selezione della stampa della scheda, mostra/nasconde\n  // i dettagli dellla richiesta dei requisiti selezionata\n  $(\".selectable-row[id^='richiesta_requisiti_acquirenti_numero']\").on('click', function(){\n    let id = Number($(this).attr('id').split(\"-\")[1]);\n\n    $(\"#protocollo_vincoli_selezionato\").text($(this).children(\"[name='protocollo']\").text());\n    $(\"#data_vincoli_selezionato\").text($(this).children(\"[name='data']\").text());\n    $(\"#soggetto_referente_vincoli_selezionato\").text($(this).children(\"[name='soggetto_referente']\").text());\n\n    $(\"#richiesta_vincoli_selezionata\").removeClass(\"d-none\");\n    $(\"[name='richiesta_vincoli_selezionata']\").val(id);\n  });\n\n  // nella schermata di selezione della stampa della scheda, abilita/disabilita\n  // le richieste del valore affrancazione\n  $(\"[name='stampa_richieste_affrancazione']\").on('change', function(){\n    if(this.checked){\n      $(\"#stampa_richieste_affrancazione_div\").removeClass(\"d-none\");\n      $(\"[name='tipo_stampa_affrancazione']\").prop(\"disabled\", false);\n      if($(\"[name='tipo_stampa_affrancazione']:checked\").val() == 'singola'){\n        $(\"[name='stampa_gestione_iter_affrancazione']\").prop(\"disabled\", false);\n        $(\"[name='stampa_calcolo_affrancazione']\").prop(\"disabled\", false);\n        $(\"[name='stampa_agevolazioni']\").prop(\"disabled\", false);\n        $(\"[name='stampa_pagamenti']\").prop(\"disabled\", false);\n        $(\"[name='stampa_atto_affrancazione']\").prop(\"disabled\", false);\n        $(\"[name='richiesta_affrancazione_selezionata']\").prop(\"disabled\", false);\n      }\n    }\n    else{\n      $(\"#stampa_richieste_affrancazione_div\").addClass(\"d-none\");\n      $(\"[name='tipo_stampa_affrancazione']\").prop(\"disabled\", true);\n      $(\"[name='stampa_gestione_iter_affrancazione']\").prop(\"disabled\", true);\n      $(\"[name='stampa_calcolo_affrancazione']\").prop(\"disabled\", true);\n      $(\"[name='stampa_agevolazioni']\").prop(\"disabled\", true);\n      $(\"[name='stampa_pagamenti']\").prop(\"disabled\", true);\n      $(\"[name='stampa_atto_affrancazione']\").prop(\"disabled\", true);\n      $(\"[name='richiesta_affrancazione_selezionata']\").prop(\"disabled\", true);\n    }\n  });\n\n  // nella schermata di selezione della stampa della scheda, mostra/nasconde\n  // la selezione della richiesta da stampare\n  $(\"[name='tipo_stampa_affrancazione']\").on('change', function(){\n    var val = this.value;\n    if (val == 'singola'){\n      $(\"[name='stampa_gestione_iter_affrancazione']\").prop(\"disabled\", false);\n      $(\"[name='stampa_calcolo_affrancazione']\").prop(\"disabled\", false);\n      $(\"[name='stampa_agevolazioni']\").prop(\"disabled\", false);\n      $(\"[name='stampa_pagamenti']\").prop(\"disabled\", false);\n      $(\"[name='stampa_atto_affrancazione']\").prop(\"disabled\", false);\n      $(\"[name='richiesta_affrancazione_selezionata']\").prop(\"disabled\", false);\n      $(\"#elenco_richieste_affrancazione_div\").removeClass(\"d-none\");\n    }\n    else{\n      $(\"[name='stampa_gestione_iter_affrancazione']\").prop(\"disabled\", true);\n      $(\"[name='stampa_calcolo_affrancazione']\").prop(\"disabled\", true);\n      $(\"[name='stampa_agevolazioni']\").prop(\"disabled\", true);\n      $(\"[name='stampa_pagamenti']\").prop(\"disabled\", true);\n      $(\"[name='stampa_atto_affrancazione']\").prop(\"disabled\", true);\n      $(\"[name='richiesta_affrancazione_selezionata']\").prop(\"disabled\", true);\n      $(\"#elenco_richieste_affrancazione_div\").addClass(\"d-none\");\n    }\n  });\n\n  // nella schermata di selezione della stampa della scheda,\n  // filtra l'elenco delle richieste da selezionare e le dropdown\n  $(\"[name='filtro_richieste_affrancazione']\").on('change', function(){\n    var protocollo = $(\"#protocollo_affrancazione\").val();\n    var data = $(\"#data_affrancazione\").val();\n    var soggetto_referente = $(\"#soggetto_referente_affrancazione\").val();\n    var scheda_id = $(\"#scheda_id\").val();\n    if($(this).attr('id') !== 'protocollo')\n      $(\"#protocollo_affrancazione\").children(\"option\").addClass(\"d-none\");\n    if($(this).attr('id') !== 'data')\n      $(\"#data_affrancazione\").children(\"option\").addClass(\"d-none\");\n    if($(this).attr('id') !== 'soggetto_referente')\n      $(\"#soggetto_referente_affrancazione\").children(\"option\").addClass(\"d-none\");\n    $.ajax({\n      url: \"/elenco_richieste_affrancazione\",\n      method: \"GET\",\n      dataType: \"json\",\n      data: {protocollo: protocollo, data: data, soggetto_referente: soggetto_referente, scheda_id: scheda_id},\n      error: function (xhr, status, error) {\n          console.error('AJAX Error: ' + status + \" \" + error);\n      },\n      success: function (elenco_richieste) {\n        $(\"#richieste_affrancazione_table tbody\").children(\"tr\").addClass(\"d-none\");\n        $.each(elenco_richieste, function(i, richiesta){\n          $(\"#richiesta_affrancazione_numero-\"+ richiesta.id).removeClass(\"d-none\");\n          $(\"#protocollo_affrancazione\").children(\"option[value='\"+richiesta.passaggio_iter[0].protocollo+\"']\").removeClass(\"d-none\");\n          $(\"#data_affrancazione\").children(\"option[value='\"+formatDate(new Date(richiesta.passaggio_iter[0].data))+\"']\").removeClass(\"d-none\");\n          $(\"#soggetto_referente_affrancazione\").children(\"option[value='\"+richiesta.soggetto_referente+\"']\").removeClass(\"d-none\");\n        });\n        $(\"#protocollo_affrancazione\").children(\"option[value='']\").removeClass(\"d-none\");\n        $(\"#data_affrancazione\").children(\"option[value='']\").removeClass(\"d-none\");\n        $(\"#soggetto_referente_affrancazione\").children(\"option[value='']\").removeClass(\"d-none\");\n      }\n    });\n  });\n\n  // nella schermata di selezione della stampa della scheda, mostra/nasconde\n  // i dettagli dellla richiesta selezionata\n  $(\".selectable-row[id^='richiesta_affrancazione_numero']\").on('click', function(){\n    let id = Number($(this).attr('id').split(\"-\")[1]);\n\n    $(\"#protocollo_affrancazione_selezionato\").text($(this).children(\"[name='protocollo']\").text());\n    $(\"#data_affrancazione_selezionato\").text($(this).children(\"[name='data']\").text());\n    $(\"#soggetto_referente_affrancazione_selezionato\").text($(this).children(\"[name='soggetto_referente']\").text());\n\n    $(\"#richiesta_affrancazione_selezionata\").removeClass(\"d-none\");\n    $(\"[name='richiesta_affrancazione_selezionata']\").val(id);\n  });\n\n  // quando nella ricerca avanzata cambio tipo di soggetto, abilito/disabilito\n  // i relativi campi\n  $(\"[name='tipo_soggetto']\").on('change', function(){\n    if(this.value == 'fisico'){\n      $(\"#denominazione\").prop('disabled', true);\n      $(\"#partita_IVA\").prop('disabled', true);\n      $(\"#denominazione\").val(\"\");\n      $(\"#partita_IVA\").val(\"\");\n      $(\"#cognome\").prop('disabled', false);\n      $(\"#nome\").prop('disabled', false);\n      $(\"#codice_fiscale\").prop('disabled', false);\n    }\n    else{\n      $(\"#denominazione\").prop('disabled', false);\n      $(\"#partita_IVA\").prop('disabled', false);\n      $(\"#cognome\").prop('disabled', true);\n      $(\"#nome\").prop('disabled', true);\n      $(\"#codice_fiscale\").prop('disabled', true);\n      $(\"#cognome\").val(\"\");\n      $(\"#nome\").val(\"\");\n      $(\"#codice_fiscale\").val(\"\");\n    }\n  });\n\n  // gestisce la ricerca avanzata\n  $(\"#ricerca_vincoli_form\").on('submit', function(){\n    const form = $(this);\n    const submitButton = $(\"#ricerca-vincoli-submit\");\n    const feedbackContainer = $(\"#ricerca-vincoli-feedback\");\n    const feedbackBox = $(\"#ricerca-vincoli-feedback-box\");\n    const escapeHtml = function(value) {\n      return $(\"<div>\").text(value || \"\").html();\n    };\n    const activeFields = form.find(\":input\")\n      .filter(function() {\n        if (!this.name || this.disabled)\n          return false;\n        if (this.name === \"tipo_soggetto\")\n          return false;\n        if (this.type === \"submit\" || this.type === \"button\")\n          return false;\n        if ((this.type === \"radio\" || this.type === \"checkbox\") && !this.checked)\n          return false;\n        return $.trim($(this).val()).length > 0;\n      });\n\n    feedbackContainer.addClass(\"d-none\");\n    feedbackBox.removeClass(\"alert-danger alert-info alert-warning alert-success\");\n    if (activeFields.length === 0) {\n      feedbackBox.addClass(\"alert-warning\").text(\"Inserisci almeno un filtro prima di avviare la ricerca.\");\n      feedbackContainer.removeClass(\"d-none\");\n      $(\"#risultati-ricerca\").addClass(\"d-none\").empty();\n      $(\"#rimuovi-filtri-ricerca\").addClass(\"d-none\");\n      return false;\n    }\n\n    submitButton.prop(\"disabled\", true).text(\"Ricerca in corso...\");\n    feedbackBox.addClass(\"alert-info\").text(\"Ricerca in corso...\");\n    feedbackContainer.removeClass(\"d-none\");\n    $.ajax({\n      url: form.attr(\"action\"),\n      method: \"GET\",\n      dataType: \"json\",\n      data: form.serialize(),\n      error: function (xhr, status, error) {\n        console.error('AJAX Error: ' + status + \" \" + error);\n        feedbackBox.removeClass(\"alert-info alert-warning alert-success\").addClass(\"alert-danger\")\n          .text(\"Errore durante la ricerca. Riprova.\");\n        submitButton.prop(\"disabled\", false).text(\"Visualizza risultati\");\n      },\n      success: function (schede) {\n        var piano = '';\n        var comparto = '';\n        var gruppo = '';\n        var html = '';\n        if (schede.length === 0) {\n          html = '<div class=\"row\">' +\n                   '<span class=\"fs--1 text-800\">Nessuna scheda trovata con i filtri selezionati.</span>' +\n                 '</div>';\n          feedbackBox.removeClass(\"alert-danger alert-info alert-warning\").addClass(\"alert-success\")\n            .text(\"Nessun risultato trovato.\");\n        } else {\n          html = '<div class=\"row\">' +\n                   '<span class=\"fs-0 eln-red-text\">Elenco schede (' + schede.length + ')</span>' +\n                 '</div>';\n          $.each(schede, function(i, scheda){\n            if (piano != scheda.nome_piano || comparto != scheda.nome_comparto || gruppo != scheda.nome_gruppo){\n              if (i != 0)\n                html += '</tbody>' +\n                    '</table>';\n              html += '<div class=\"row mt-3\">' +\n                          '<span class=\"fs--1 eln-green-text\">Piano: ' + escapeHtml(scheda.nome_piano) + ' - Comparto: ' + escapeHtml(scheda.nome_comparto) + ' - Gruppo: ' + escapeHtml(scheda.nome_gruppo) + '</span>' +\n                        '</div>' +\n                        '<table class=\"table table-striped table-hover eln-bg eln-data-table\">' +\n                          '<thead class=\"\">' +\n                            '<tr class=\"btn-reveal-trigger\">' +\n                              '<th class=\"sticky-top eln-bg fs--1 text-800\">Identificativo Unit\u00E0</th>' +\n                            '</tr>' +\n                          '</thead>' +\n                          '<tbody class=\"bg-white\">';\n            }\n            html += '<tr>' +\n                    '<td class=\"fs--1\"><a href=\"/vincoli/scheda/' + scheda.id + '?tab=generali\" class=\"eln-regular-text\">' + escapeHtml(scheda.nominativo) + '</a></td>' +\n                  '</tr>';\n            piano = scheda.nome_piano;\n            comparto = scheda.nome_comparto;\n            gruppo = scheda.nome_gruppo;\n          });\n          html += '</tbody>' +\n                    '</table>';\n          feedbackBox.removeClass(\"alert-danger alert-info alert-warning\").addClass(\"alert-success\")\n            .text(\"Ricerca completata: \" + schede.length + \" risultati.\");\n        }\n        $(\"#risultati-ricerca\").html(html);\n        $(\"#risultati-ricerca\").removeClass('d-none');\n        $(\"#rimuovi-filtri-ricerca\").removeClass('d-none');\n        submitButton.prop(\"disabled\", false).text(\"Visualizza risultati\");\n      }\n    });\n    return false;\n  });\n\n  // gestisce la ricerca normale per nominativo\n  $(\"#vincoli-ricerca-submit\").on('click', function(){\n    $(\"#vincoli-ricerca-form\").trigger('submit');\n  })\n\n  // rimuove i filtri applicati alla ricerca e nasconde i risultati\n  $(\"#rimuovi-filtri-ricerca-submit\").on('click', function(){\n    const ricercaForm = $(\"#ricerca_vincoli_form\").get(0);\n    if (ricercaForm) {\n      ricercaForm.reset();\n      $(ricercaForm).find(\"input[type='text'], input[type='date'], input[type='number'], textarea\").val(\"\");\n      $(\"#ricerca-vincoli-feedback\").addClass(\"d-none\");\n      $(\"#ricerca-vincoli-feedback-box\").removeClass(\"alert-danger alert-info alert-warning alert-success\").text(\"\");\n      $(\"#ricerca-vincoli-submit\").prop(\"disabled\", false).text(\"Visualizza risultati\");\n      $(\"#tipo_soggetto_ricerca_vincoli_fisico\").trigger(\"change\");\n      $(\"#risultati-ricerca\").addClass('d-none').empty();\n    }\n\n    const controlloForm = $(\"#controllo_intestati_form\").get(0);\n    if (controlloForm) {\n      controlloForm.reset();\n      $(\"#import_comparto\").empty().append('<option value=\"\">Seleziona un Comparto</option>').prop(\"disabled\", true);\n      $(\"#import_gruppo\").empty().append('<option value=\"\">Seleziona un Gruppo</option>').prop(\"disabled\", true);\n      $(\"#controllo_intestati_update_form_inner\").empty();\n      $(\"#risultati-filtro-controllo-intestati\").addClass('d-none');\n    }\n\n    const controlloConvenzioniScaduteForm = $(\"#controllo_convenzioni_scadute_form\").get(0);\n    if (controlloConvenzioniScaduteForm) {\n      controlloConvenzioniScaduteForm.reset();\n      $(\"#import_comparto\").empty().append('<option value=\"\">Seleziona un Comparto</option>').prop(\"disabled\", true);\n      $(\"#import_gruppo\").empty().append('<option value=\"\">Seleziona un Gruppo</option>').prop(\"disabled\", true);\n      $(\"#controllo_convenzioni_scadute_update_form_inner\").empty();\n      $(\"#risultati-filtro-controllo-convenzioni-scadute\").addClass('d-none');\n    }\n\n    $(\"#rimuovi-filtri-ricerca\").addClass('d-none');\n  });\n\n\n  // gestisce il controllo intestati\n  $(\"#controllo_intestati_form\").on('submit', function(){\n    var piano = $(\"#import_piano\").val();\n    var comparto = $(\"#import_comparto\").val();\n    var gruppo = $(\"#import_gruppo\").val();\n    $(\"#piano\").val(piano);\n    $(\"#comparto\").val(comparto);\n    $(\"#gruppo\").val(gruppo);\n    $.ajax({\n      url: \"/vincoli/filtro_controllo_intestati\",\n      method: \"GET\",\n      dataType: \"json\",\n      data: {piano: piano,\n             comparto: comparto,\n             gruppo: gruppo},\n      error: function (xhr, status, error) {\n          console.error('AJAX Error: ' + status + \" \" + error);\n      },\n      success: function (response) {\n        $(\"#controllo_intestati_update_form_inner\").html(response.html);\n        $(\"#risultati-filtro-controllo-intestati\").removeClass('d-none');\n        $(\"#rimuovi-filtri-ricerca\").removeClass('d-none');\n      }\n    });\n    return false;\n  });\n\n  // salva gli aggiornamenti del controllo intestati\n  $(\"#controllo-intestati-submit\").on('click', function(){\n    $(\"#controllo_intestati_update_form\").trigger('submit');\n  });\n\n  // nel controllo intestati, quando viene inserito o rimosso un check, cambia la label\n  $(\"#controllo_intestati_update_form_inner\").on('click', \"input[name^='controllo_forzato_flg']\", function(){\n    var scheda_id = $(this).prop('name').split(\"[\")[1].split(\"]\")[0];\n    if(this.checked)\n      $(\"#scheda_\" + scheda_id + \"_label\").html('<label class=\"bi bi-check2-circle eln-light-green-text\"></label>');\n    else{\n      var status = $(this).attr('data-status');\n      let label = '<label></label>';\n      switch (status){\n        case \"true\":\n          label = '<label class=\"bi bi-check2-circle eln-light-green-text\"></label>';\n          break;\n        case \"false\":\n          label = '<label class=\"bi bi-x-circle eln-red-text\"></label>';\n          break;\n        case \"null\":\n          label = '<label class=\"bi bi-exclamation-triangle eln-yellow-text\"></label>';\n          break;\n\n      }\n      $('#scheda_' + scheda_id + '_label').html(label);\n    }\n  });\n\n  // gestisce il controllo delle convenzioni scadute\n  $(\"#controllo_convenzioni_scadute_form\").on('submit', function(){\n    var piano = $(\"#import_piano\").val();\n    var comparto = $(\"#import_comparto\").val();\n    var gruppo = $(\"#import_gruppo\").val();\n    $(\"#piano\").val(piano);\n    $(\"#comparto\").val(comparto);\n    $(\"#gruppo\").val(gruppo);\n    $.ajax({\n      url: \"/vincoli/filtro_controllo_convenzioni_scadute\",\n      method: \"GET\",\n      dataType: \"json\",\n      data: {piano: piano,\n             comparto: comparto,\n             gruppo: gruppo},\n      error: function (xhr, status, error) {\n          console.error('AJAX Error: ' + status + \" \" + error);\n      },\n      success: function (response) {\n        $(\"#controllo_convenzioni_scadute_update_form_inner\").html(response.html);\n        $(\"#risultati-filtro-controllo-convenzioni-scadute\").removeClass('d-none');\n        $(\"#rimuovi-filtri-ricerca\").removeClass('d-none');\n      }\n    });\n    return false;\n  });\n\n  // salva gli aggiornamenti del controllo convenzioni scadute\n  $(\"#controllo-convenzioni-scadute-submit\").on('click', function(){\n    $(\"#controllo_convenzioni_scadute_update_form\").trigger('submit');\n  });\n\n  // prepara i fabbricati per collegarli ad una scheda\n  var suggerimentiFabbricatiTimeout;\n  $(\"#scheda_codice\").on(\"input\", function() {\n    var query = $(this).val().trim();\n    var sezione = $(\"#scheda_sezione\").val();\n    var datalist = $(\"#codiceDatalistOptions\");\n\n    clearTimeout(suggerimentiFabbricatiTimeout);\n\n    if (query.length < 2) {\n      datalist.empty();\n      return;\n    }\n\n    suggerimentiFabbricatiTimeout = setTimeout(function() {\n      $.ajax({\n        url: \"/vincoli/suggerimenti_fabbricati\",\n        method: \"GET\",\n        dataType: \"json\",\n        data: { q: query, sezione: sezione },\n        success: function(risposta) {\n          datalist.empty();\n          $.each(risposta.codici || [], function(_, codice) {\n            datalist.append($(\"<option>\", { value: codice, text: codice }));\n          });\n        },\n        error: function(xhr, status, error) {\n          console.error('AJAX Error: ' + status + \" \" + error);\n        }\n      });\n    }, 250);\n  });\n\n  $(\"#collega_fabbricato_scheda\").on('click', function(){\n    var id = $(\"#scheda_id\").val();\n    var codice = $(\"#scheda_codice\").val();\n    var sezione = $(\"#scheda_sezione\").val();\n\n    function appendFabbricatoRow(fabbricato, tbody) {\n      var index = tbody.find('tr').length + 1;\n      var tr = '<tr class=\"fs--2\" id=\"riga-fabbricato-' + fabbricato.fabbricato_id + '\">';\n      tr += \"<td class='text-center'>\" + index + \"</td>\";\n      tr += \"<td class='text-center'>\" + fabbricato.sezione + \"</td>\";\n      tr += \"<td class='text-center'>\" + fabbricato.identificativo_corrente.foglio + \"</td>\";\n      tr += \"<td class='text-center'>\" + fabbricato.identificativo_corrente.numero + \"</td>\";\n      tr += \"<td class='text-center'>\" + fabbricato.identificativo_corrente.subalterno + \"</td>\";\n      tr += \"<td class='text-center'>\" + fabbricato.caratteristica_corrente.categoria_catastale + \"</td>\";\n      tr += \"<td class='text-center'>\" + fabbricato.caratteristica_corrente.classe + \"</td>\";\n      tr += \"<td class='text-end'>\" + fabbricato.caratteristica_corrente.superficie + \" m<sup>2</<sup></td>\";\n      tr += \"<td class='text-end'>\" + number_format(fabbricato.caratteristica_corrente.rendita_euro) + \" \u20AC</td>\";\n      tr += \"<td class='text-center'><a name='elimina_fabbricato_scheda_\" + fabbricato.fabbricato_id + \"'>\" +\n                  \"<span class='fs-1 bi-trash eln-red-text' data-bs-toggle='tooltip' title='Elimina collegamento'></span>\" +\n                  \"<input name='scheda[fabbricato][\" + (fabbricato.fabbricato_id) + \"][_destroy]' type='hidden' value='0' autocomplete='off'>\" +\n                \"</a></td>\";\n      tr += '</tr>';\n      tbody.append(tr);\n    }\n\n    $.ajax({\n      url: \"/vincoli/collega_fabbricato\",\n      method: \"GET\",\n      dataType: \"json\",\n      data: {id: id,\n             codice: codice,\n             sezione: sezione},\n      error: function (xhr, status, error) {\n        console.error('AJAX Error: ' + status + \" \" + error);\n      },\n      success: function (fabbricato) {\n        if(fabbricato.messaggio == 'incompleto'){\n          alert('Per collegare i fabbricati specifica foglio, mappale, subalterno e sezione catastale (se presente).');\n        }\n        else if(fabbricato.messaggio == 'zero'){\n          alert('Il fabbricato non esiste in catasto.');\n        }\n        else {\n          var tbody = $(\"#fabbricati_table_body\");\n          var fabbricati = fabbricato.fabbricati || [fabbricato];\n          $.each(fabbricati, function(_, fabbricatoCorrente) {\n            appendFabbricatoRow(fabbricatoCorrente, tbody);\n          });\n        }\n      }\n    });\n  });\n\n/*\n  // abilita/disabilita il bottone che permette di cercare un fabbricato\n  $(\"[name^='ricerca-fabbricato']\").on('change', function(){\n    var foglio = $(\"#ricerca-fabbricato-foglio\").val();\n    var numero = $(\"#ricerca-fabbricato-numero\").val();\n    $(\"#ricerca-fabbricato-submit\").prop('disabled', true);\n    if(foglio != '' && numero != '')\n      $(\"#ricerca-fabbricato-submit\").prop('disabled', false);\n  });\n\n  // ricerca un fabbricato dati foglio-numero/subalterno\n  $(\"#ricerca-fabbricato-submit\").on('click', function(){\n    var foglio = $(\"#ricerca-fabbricato-foglio\").val();\n    var numero = $(\"#ricerca-fabbricato-numero\").val();\n    var subalterno = $(\"#ricerca-fabbricato-subalterno\").val();\n    var id = $(\"#scheda_id\").val();\n    var codice = foglio + \"-\" + numero + \"-\" + subalterno;\n    var sezione = $(\"#scheda_sezione\").val();\n    $.ajax({\n      url: \"/vincoli/collega_fabbricato\",\n      method: \"GET\",\n      dataType: \"json\",\n      data: {id: id,\n             codice: codice,\n             sezione: sezione},\n      error: function (xhr, status, error) {\n        console.error('AJAX Error: ' + status + \" \" + error);\n      },\n      success: function (fabbricato) {\n        if(fabbricato.messaggio == 'multi'){\n          alert('La ricerca ha individuato pi\u00F9 di un fabbricato, \u00E8 necessario specificare il subalterno.');\n        }\n        else if(fabbricato.messaggio == 'zero'){\n          alert('Il fabbricato non esiste in catasto.');\n        }\n        else{\n          index = $(\"#fabbricati_table tr\").length;\n          var tbody = $(\"#fabbricati_table_body\");\n          var tr = '<tr class=\"fs--2\" id=\"riga-fabbricato-' + fabbricato.fabbricato_id + '\">';\n          tr += \"<td class='text-center'>\" + index + \"</td>\";\n          tr += \"<td class='text-center'>\" + fabbricato.sezione + \"</td>\";\n          tr += \"<td class='text-center'>\" + fabbricato.identificativo_corrente.foglio + \"</td>\";\n          tr += \"<td class='text-center'>\" + fabbricato.identificativo_corrente.numero + \"</td>\";\n          tr += \"<td class='text-center'>\" + fabbricato.identificativo_corrente.subalterno + \"</td>\";\n          tr += \"<td class='text-center'>\" + fabbricato.caratteristica_corrente.categoria_catastale + \"</td>\";\n          tr += \"<td class='text-center'>\" + fabbricato.caratteristica_corrente.classe + \"</td>\";\n          tr += \"<td class='text-end'>\" + fabbricato.caratteristica_corrente.superficie + \" m<sup>2</<sup></td>\";\n          tr += \"<td class='text-end'>\" + number_format(fabbricato.caratteristica_corrente.rendita_euro) + \" \u20AC</td>\";\n          tr += \"<td class='text-center'><a name='elimina_fabbricato_scheda_\" + fabbricato.fabbricato_id + \"'>\" +\n                      \"<span class='fs-1 bi-trash eln-red-text' data-bs-toggle='tooltip' title='Elimina collegamento'></span>\" +\n                      \"<input name='scheda[fabbricato][\" + (fabbricato.fabbricato_id) + \"][_destroy]' type='hidden' value='0' autocomplete='off'>\" +\n                    \"</a></td>\";\n          tr += '</tr>';\n          tbody.append(tr);\n        }\n      }\n    });\n  });*/\n\n\n  // elimina un fabbricato collegato ad una scheda\n  $(\"#fabbricati_table_body\").on('click', \"a\", function(){\n    var id = $(this).prop('name').split(\"_\")[3];\n    $(\"[id^='riga-fabbricato-\" + id + \"']\").addClass(\"visually-hidden\");\n    $(\"[name='scheda[fabbricato][\" + id + \"][_destroy]'\").val(1);\n  });\n\n  // quando collego un atto alla scheda e lo definisco come attuale,\n  // compilo il rispettivo campo\n  $(\"#atto_scheda_attuale\").on('click', function(){\n    $(\"#attuale\").val(this.checked);\n  });\n\n  // mostro la form degli intestati fisici o giuridici quando collego un intestato\n  $(\"[name='tipo_intestato']\").on('change', function(){\n    if(this.value == 'fisico'){\n      $(\"#dati_intestato_fisico\").removeClass(\"d-none\");\n      $(\"#dati_intestato_giuridico\").addClass(\"d-none\");\n    }\n    else if(this.value == 'giuridico'){\n      $(\"#dati_intestato_fisico\").addClass(\"d-none\");\n      $(\"#dati_intestato_giuridico\").removeClass(\"d-none\");\n    }\n  });\n\n  // quando un intestato viene selezionato, ne mostra i dettagli\n  $(\"[id^='soggetti_'] tbody\").on('click', \".selectable-row[id^='soggetto']\", function(){\n    let id = Number($(this).attr('id').split(\"-\")[1]);\n    let type = $(this).attr('id').split(\"_\")[1];\n    if(type == 'fisico')\n      $.ajax({\n        url: \"/dati_soggetto_fisico\",\n        method: \"GET\",\n        dataType: \"json\",\n        data: {id: id},\n        error: function (xhr, status, error) {\n          console.error('AJAX Error: ' + status + \" \" + error);\n        },\n        success: function (dati_soggetto) {\n          let nome_comune = ''\n          if(dati_soggetto.comune !== null)\n            nome_comune = dati_soggetto.comune.nome;\n          $(\"#cognome_selezionato\").text(dati_soggetto.cognome);\n          $(\"#nome_selezionato\").text(dati_soggetto.nome);\n          $(\"#codice_fiscale_selezionato\").text(dati_soggetto.codice_fiscale);\n          $(\"#data_nascita_selezionata\").text(formatDate(new Date(dati_soggetto.data_nascita)));\n          $(\"#luogo_nascita_selezionato\").text(nome_comune);\n          $(\"#codice_ente_nascita_selezionato\").text(dati_soggetto.codice_comune_nascita);\n          $(\"#sesso_selezionato\").text(dati_soggetto.sesso);\n          $(\"#soggetto_fisico\").val(dati_soggetto.soggetto_id);\n          $(\"#soggetto_fisico_selezionato\").removeClass(\"d-none\");\n\n          $(\"#denominazione_selezionata\").text('');\n          $(\"#partita_IVA_selezionata\").text('');\n          $(\"#sede_selezionata\").text('');\n          $(\"#codice_ente_sede_selezionato\").text('');\n          $(\"#soggetto_giuridico\").val('');\n          $(\"#soggetto_giuridico_selezionato\").addClass(\"d-none\");\n\n        }\n      });\n    else\n      $.ajax({\n        url: \"/dati_soggetto_giuridico\",\n        method: \"GET\",\n        dataType: \"json\",\n        data: {id: id},\n        error: function (xhr, status, error) {\n          console.error('AJAX Error: ' + status + \" \" + error);\n        },\n        success: function (dati_soggetto) {\n          $(\"#denominazione_selezionata\").text(dati_soggetto.denominazione);\n          $(\"#partita_IVA_selezionata\").text(dati_soggetto.partita_IVA);\n          $(\"#sede_selezionata\").text(dati_soggetto.comune.nome);\n          $(\"#codice_ente_sede_selezionato\").text(dati_soggetto.codice_comune_sede);\n          $(\"#soggetto_giuridico\").val(dati_soggetto.soggetto_id);\n          $(\"#soggetto_giuridico_selezionato\").removeClass(\"d-none\");\n\n          $(\"#cognome_selezionato\").text('');\n          $(\"#nome_selezionato\").text('');\n          $(\"#codice_fiscale_selezionato\").text('');\n          $(\"#data_nascita_selezionata\").text('');\n          $(\"#luogo_nascita_selezionato\").text('');\n          $(\"#codice_ente_nascita_selezionato\").text('');\n          $(\"#sesso_selezionato\").text('');\n          $(\"#soggetto_fisico\").val('');\n          $(\"#soggetto_fisico_selezionato\").addClass(\"d-none\");\n        }\n      });\n  });\n\n  // filtra la lista di soggetti in base ai parametri passati nel collegamento degli intestati\n  $(\"[name=filtro_intestati]\").on('change', function(){\n    var cognome = $(\"#cognome\").val();\n    var nome = $(\"#nome\").val();\n    var codice_fiscale = $(\"#codice_fiscale\").val();\n    var denominazione = $(\"#denominazione\").val();\n    var partita_IVA = $(\"#partita_IVA\").val();\n    var tipo_soggetto = $(\"[name='tipo_intestato']:checked\").val()\n    if(tipo_soggetto == 'fisico'){\n      if($(this).attr('id') !== 'cognome')\n        $(\"#cognome\").children(\"option\").addClass(\"d-none\");\n      if($(this).attr('id') !== 'nome')\n        $(\"#nome\").children(\"option\").addClass(\"d-none\");\n      if($(this).attr('id') !== 'codice_fiscale')\n        $(\"#codice_fiscale\").children(\"option\").addClass(\"d-none\");\n\n      $.ajax({\n        url: \"/elenco_soggetti_fisici\",\n        method: \"GET\",\n        dataType: \"json\",\n        data: {cognome: cognome, nome: nome, codice_fiscale: codice_fiscale},\n        error: function (xhr, status, error) {\n            console.error('AJAX Error: ' + status + \" \" + error);\n        },\n        success: function (elenco_soggetti) {\n          $(\"#soggetti_fisici_table tbody\").empty();\n          $(\"#soggetti_giuridici_table tbody\").empty();\n          $.each(elenco_soggetti, function(i, soggetto){\n            let nome_comune = ''\n            if(soggetto.comune !== null)\n              nome_comune = soggetto.comune.nome;\n            var html = \"\" +\n              '<tr class=\"btn-reveal-trigger fs--1 selectable-row\" id=\"soggetto_fisico_numero-' + soggetto.soggetto_id + '\">' +\n                '<td>' + soggetto.cognome + ' ' + soggetto.nome + '</td>' +\n                '<td>' + soggetto.codice_fiscale + '</td>' +\n                '<td>' + formatDate(new Date(soggetto.data_nascita)) + ' a ' + nome_comune + '</td>' +\n              '</tr>';\n            $(\"#soggetti_fisici_table tbody\").append(html);\n            $(\"#soggetti_fisici_table_container\").removeClass(\"d-none\");\n            $(\"#cognome\").children(\"option[value='\"+soggetto.cognome+\"']\").removeClass(\"d-none\");\n            $(\"#nome\").children(\"option[value='\"+soggetto.nome+\"']\").removeClass(\"d-none\");\n            $(\"#codice_fiscale\").children(\"option[value='\"+soggetto.codice_fiscale+\"']\").removeClass(\"d-none\");\n          });\n        }\n      });\n    }\n    else{\n      if($(this).attr('id') !== 'denominazione')\n        $(\"#denominazione\").children(\"option\").addClass(\"d-none\");\n      if($(this).attr('id') !== 'partita_IVA')\n        $(\"#partita_IVA\").children(\"option\").addClass(\"d-none\");\n\n      $.ajax({\n        url: \"/elenco_soggetti_giuridici\",\n        method: \"GET\",\n        dataType: \"json\",\n        data: {denominazione: denominazione, partita_IVA: partita_IVA},\n        error: function (xhr, status, error) {\n            console.error('AJAX Error: ' + status + \" \" + error);\n        },\n        success: function (elenco_soggetti) {\n          $(\"#soggetti_fisici_table tbody\").empty();\n          $(\"#soggetti_giuridici_table tbody\").empty();\n          $.each(elenco_soggetti, function(i, soggetto){\n            var html = \"\" +\n              '<tr class=\"btn-reveal-trigger fs--1 selectable-row\" id=\"soggetto_giuridico_numero-' + soggetto.soggetto_id + '\">' +\n                '<td>' + soggetto.denominazione + '</td>' +\n                '<td>' + soggetto.partita_IVA + '</td>' +\n                '<td>' + soggetto.comune.nome + '</td>' +\n              '</tr>';\n            $(\"#soggetti_giuridici_table tbody\").append(html);\n            $(\"#soggetti_giuridici_table_container\").removeClass(\"d-none\");\n            $(\"#denominazione\").children(\"option[value='\"+soggetto.denominazione+\"']\").removeClass(\"d-none\");\n            $(\"#partita_IVA\").children(\"option[value='\"+soggetto.partita_IVA+\"']\").removeClass(\"d-none\");\n          });\n        }\n      });\n    }\n  });\n\n  // Nelle simulaizoni, quando viene selezionata una checkbox, seleziona/deseleziona tutti gli elementi sottostanti\n  $(\"[simulazione='true']\").on('change', function(){\n    var tipo = $(this).attr('name').split('[')[0];\n    var id = $(this).attr('name').split('[')[1].split(']')[0];\n    $(\"#\" + tipo + \"_\" + id + \" input:checkbox\").prop('checked', this.checked);\n    $(\"#\" + tipo + \"_\" + id + \" input[type='number']\").prop('disabled', !this.checked);\n    $(\"select[name^='piano[\" + id + \"]']\").prop('disabled', !this.checked);\n    $(\"input[name^='\" + tipo + \"[\" + id + \"]'][type='number']\").prop('disabled', !this.checked);\n\n    while(tipo != 'piano'){\n      // deve essere eseguito in loop fino al livello del piano, poi fermarsi\n      var parent = $(\"[name='\" + tipo + \"[\" + id + \"][check]']\").parent().parent().parent().attr(\"id\");\n      var tipo = parent.split('_')[0];\n      var id = parent.split('_')[1];\n      if($(\"#\" + parent + \" input:checkbox:checked\").length == 0){\n        // rimuovo la spunta della checkbox anche dal parent\n        $(\"[name='\" + tipo + \"[\" + id + \"][check]']\").prop('checked', false);\n        $(\"[name^='\" + tipo + \"[\" + id + \"][vv]']\").prop('disabled', true);\n        $(\"[name^='\" + tipo + \"[\" + id + \"][perc]']\").prop('disabled', true);\n      }\n      else if($(\"#\" + parent + \" input:checkbox:checked\").length == $(\"#\" + parent + \" input:checkbox\").length){\n        // metto la spunta della checkbox anche nel parent\n        $(\"[name='\" + tipo + \"[\" + id + \"][check]']\").prop('checked', true);\n        $(\"[name^='\" + tipo + \"[\" + id + \"][vv]']\").prop('disabled', false);\n        $(\"[name^='\" + tipo + \"[\" + id + \"][perc]']\").prop('disabled', false);\n      }\n    }\n  });\n\n  function aggiornaSchedeSimulazione(){\n    var mostraSchede = $(\"#simulazioni_mostra_schede\").is(\":checked\");\n    $(\".simulazione-input-row\").each(function(){\n      var rigaScheda = $(this).hasClass(\"simulazione-input-row-scheda\") || $(this).find(\"input[type='checkbox'][name^='scheda[']\").length > 0;\n      $(this).toggleClass(\"simulazione-input-row-scheda-nascosta\", rigaScheda && !mostraSchede);\n    });\n  }\n\n  function aggiornaFiltroSimulazioni(){\n    var filtro = ($(\"#simulazioni_filtro\").val() || '').toLowerCase().trim();\n    $(\".simulazione-input-row\").each(function(){\n      var testo = $(this).children().first().text().toLowerCase();\n      $(this).toggleClass(\"simulazione-input-row-filtrata\", filtro != '' && testo.indexOf(filtro) === -1);\n    });\n  }\n\n  $(\"#simulazioni_mostra_schede\").on('change', aggiornaSchedeSimulazione);\n  $(\"#simulazioni_filtro\").on('input', aggiornaFiltroSimulazioni);\n  aggiornaSchedeSimulazione();\n\n  function aggiornaBodyFullscreenSimulazioni(){\n    var fullscreenAttivo = $(\"#simulazioni_calcolo\").hasClass(\"simulazioni-fullscreen\") ||\n      $(\".simulazioni-page-card\").hasClass(\"simulazioni-input-fullscreen\");\n    $(\"body\").toggleClass(\"simulazioni-fullscreen-active\", fullscreenAttivo);\n  }\n\n  function impostaInputFullscreenSimulazioni(attivo){\n    var pulsante = $(\"#simulazioni_input_fullscreen_toggle\");\n    $(\".simulazioni-page-card\").toggleClass(\"simulazioni-input-fullscreen\", attivo);\n\n    if(attivo){\n      pulsante.find(\".bi\").removeClass(\"bi-arrows-fullscreen\").addClass(\"bi-fullscreen-exit\");\n      pulsante.find(\".simulazioni-input-fullscreen-label\").text(\"Riduci\");\n    }\n    else{\n      pulsante.find(\".bi\").removeClass(\"bi-fullscreen-exit\").addClass(\"bi-arrows-fullscreen\");\n      pulsante.find(\".simulazioni-input-fullscreen-label\").text(\"Allarga\");\n    }\n    aggiornaBodyFullscreenSimulazioni();\n  }\n\n  function impostaRisultatiFullscreenSimulazioni(attivo){\n    var pulsante = $(\"#simulazioni_fullscreen_toggle\");\n    $(\"#simulazioni_calcolo\").toggleClass(\"simulazioni-fullscreen\", attivo);\n\n    if(attivo){\n      pulsante.find(\".bi\").removeClass(\"bi-arrows-fullscreen\").addClass(\"bi-fullscreen-exit\");\n      pulsante.find(\".simulazioni-fullscreen-label\").text(\"Esci\");\n    }\n    else{\n      pulsante.find(\".bi\").removeClass(\"bi-fullscreen-exit\").addClass(\"bi-arrows-fullscreen\");\n      pulsante.find(\".simulazioni-fullscreen-label\").text(\"Schermo intero\");\n    }\n    aggiornaBodyFullscreenSimulazioni();\n  }\n\n  $(\"#simulazioni_input_fullscreen_toggle\").on('click', function(){\n    impostaInputFullscreenSimulazioni(!$(\".simulazioni-page-card\").hasClass(\"simulazioni-input-fullscreen\"));\n  });\n\n  // nelle simulazioni formula permette di cambiare la simulazione visualizzata\n  $(\"#simulazione_btn_1, #simulazione_btn_2, #simulazione_btn_3\").on('click', function(){\n    var n_sim = $(this).prop('id').split('_')[2];\n    $(\"#simulazione_btn_1\").removeClass(\"eln-light-green-full-button\");\n    $(\"#simulazione_btn_2\").removeClass(\"eln-yellow-full-button\");\n    $(\"#simulazione_btn_3\").removeClass(\"eln-grey-full-button\");\n    $(\"#simulazione_btn_1\").removeClass(\"eln-light-green-empty-button\");\n    $(\"#simulazione_btn_2\").removeClass(\"eln-yellow-empty-button\");\n    $(\"#simulazione_btn_3\").removeClass(\"eln-grey-empty-button\");\n    switch(n_sim){\n      case \"1\":\n        $(\"#simulazione_btn_1\").addClass(\"eln-light-green-full-button\");\n        $(\"#simulazione_btn_2\").addClass(\"eln-yellow-empty-button\");\n        $(\"#simulazione_btn_3\").addClass(\"eln-grey-empty-button\");\n        $(\"input[name$='[vv][1]'], input[name$='[perc][1]']\").parent().removeClass(\"d-none\");\n        $(\"input[name$='[vv][2]'], input[name$='[perc][2]']\").parent().addClass(\"d-none\");\n        $(\"input[name$='[vv][3]'], input[name$='[perc][3]']\").parent().addClass(\"d-none\");\n        $(\"[name='simulazione_1']\").removeClass(\"d-none\");\n        $(\"[name='simulazione_2']\").addClass(\"d-none\");\n        $(\"[name='simulazione_3']\").addClass(\"d-none\");\n        $(\"#simulazione_1_pdf\").removeClass(\"d-none\");\n        $(\"#simulazione_2_pdf\").addClass(\"d-none\");\n        $(\"#simulazione_3_pdf\").addClass(\"d-none\");\n        break;\n      case \"2\":\n        $(\"#simulazione_btn_1\").addClass(\"eln-light-green-empty-button\");\n        $(\"#simulazione_btn_2\").addClass(\"eln-yellow-full-button\");\n        $(\"#simulazione_btn_3\").addClass(\"eln-grey-empty-button\");\n        $(\"input[name$='[vv][1]'], input[name$='[perc][1]']\").parent().addClass(\"d-none\");\n        $(\"input[name$='[vv][2]'], input[name$='[perc][2]']\").parent().removeClass(\"d-none\");\n        $(\"input[name$='[vv][3]'], input[name$='[perc][3]']\").parent().addClass(\"d-none\");\n        $(\"[name='simulazione_1']\").addClass(\"d-none\");\n        $(\"[name='simulazione_2']\").removeClass(\"d-none\");\n        $(\"[name='simulazione_3']\").addClass(\"d-none\");\n        $(\"#simulazione_1_pdf\").addClass(\"d-none\");\n        $(\"#simulazione_2_pdf\").removeClass(\"d-none\");\n        $(\"#simulazione_3_pdf\").addClass(\"d-none\");\n        break;\n      case \"3\":\n        $(\"#simulazione_btn_1\").addClass(\"eln-light-green-empty-button\");\n        $(\"#simulazione_btn_2\").addClass(\"eln-yellow-empty-button\");\n        $(\"#simulazione_btn_3\").addClass(\"eln-grey-full-button\");\n        $(\"input[name$='[vv][1]'], input[name$='[perc][1]']\").parent().addClass(\"d-none\");\n        $(\"input[name$='[vv][2]'], input[name$='[perc][2]']\").parent().addClass(\"d-none\");\n        $(\"input[name$='[vv][3]'], input[name$='[perc][3]']\").parent().removeClass(\"d-none\");\n        $(\"[name='simulazione_1']\").addClass(\"d-none\");\n        $(\"[name='simulazione_2']\").addClass(\"d-none\");\n        $(\"[name='simulazione_3']\").removeClass(\"d-none\");\n        $(\"#simulazione_1_pdf\").addClass(\"d-none\");\n        $(\"#simulazione_2_pdf\").addClass(\"d-none\");\n        $(\"#simulazione_3_pdf\").removeClass(\"d-none\");\n        break;\n    }\n  });\n\n  $(\"#simulazioni_fullscreen_toggle\").on('click', function(){\n    impostaRisultatiFullscreenSimulazioni(!$(\"#simulazioni_calcolo\").hasClass(\"simulazioni-fullscreen\"));\n  });\n\n  $(document).on('keydown', function(event){\n    if(event.key === 'Escape' && $(\"#simulazioni_calcolo\").hasClass(\"simulazioni-fullscreen\")){\n      impostaRisultatiFullscreenSimulazioni(false);\n    }\n    if(event.key === 'Escape' && $(\".simulazioni-page-card\").hasClass(\"simulazioni-input-fullscreen\")){\n      impostaInputFullscreenSimulazioni(false);\n    }\n  });\n\n  // esegue la/le simulazioni\n  $(\"#simulazione_submit\").on('click', function(){\n    var simulazione_1 = [];\n    var simulazione_2 = [];\n    var simulazione_3 = [];\n    var schede_ids = [];\n    var tipo_simulazione = window.location.pathname.split('/')[2].split('_')[1];\n    var url = 'simulazioni_valore_venale_simula'\n    if(tipo_simulazione == 'formula')\n      url = 'simulazioni_formula_simula';\n    // per ogni checkbox spuntata vado a prendere gli input del vv e della perc di tutte e tre le simulazioni\n    $(\"#simulazioni_show input[type='checkbox']:checked\").each(\n      function(index){\n        var checkbox = $(this);\n        var tipo = checkbox.attr('id').split('_')[0];\n        var id = checkbox.attr('id').split('_')[1];\n        var i = 1;\n        while(i <= 3){\n          var vvInput = $(\"#\" + tipo + \"_\" + id + \"_vv_\" + i);\n          var percInput = $(\"#\" + tipo + \"_\" + id + \"_perc_\" + i);\n          var formulaInput = $(\"#\" + tipo + \"_\" + id + \"_formula_\" + i + \"_id\");\n          var vv = vvInput.val() || '';\n          var perc = percInput.val() || '';\n          var formula = formulaInput.val() || '';\n          var valoreVenaleModificato = tipo != 'scheda' ? (vv != '' || perc != '') : (vv != (vvInput.attr('value') || '') || perc != (percInput.attr('value') || ''));\n          if((tipo_simulazione == 'valore' && valoreVenaleModificato) || (tipo_simulazione != 'valore' && (vv != '' || perc != '' || formula != ''))){\n            let element = {tipo: tipo, id: id, vv: vv, perc: perc, formula: formula}\n            switch(i){\n            case 1:\n              simulazione_1.push(element);\n              break;\n            case 2:\n              simulazione_2.push(element);\n              break;\n            case 3:\n              simulazione_3.push(element);\n              break;\n            }\n          }\n          i += 1;\n        }\n        if(tipo == 'scheda')\n          schede_ids.push(id);\n      }\n    );\n    simulazioni = {simulazione_1: simulazione_1, simulazione_2: simulazione_2, simulazione_3: simulazione_3};\n    var AUTH_TOKEN = $('meta[name=csrf-token]').attr('content');\n    $.ajax({\n      url: \"/vincoli/\" + url + \"?&authenticity_token=\" + AUTH_TOKEN,\n      method: \"POST\",\n      dataType: tipo_simulazione == 'valore' ? 'html' : 'json',\n      data: {simulazioni: simulazioni, schede_ids: schede_ids},\n      error: function (xhr, status, error) {\n          console.error('AJAX Error: ' + status + \" \" + error);\n      },\n      success: function (simulazioni) {\n        if(tipo_simulazione == 'valore'){\n          var inputFullscreenAttivo = $(\".simulazioni-page-card\").hasClass(\"simulazioni-input-fullscreen\");\n          $(\"#simulazioni_calcolo_table\").html(simulazioni);\n          impostaInputFullscreenSimulazioni(false);\n          $(\"#simulazioni_show\").addClass('d-none');\n          $(\"#simulazioni_toolbar\").addClass('d-none');\n          $(\"#simulazioni_calcolo\").removeClass('d-none');\n          $(\"#simulazioni_stampe\").removeClass('d-none');\n          $(\"#simulazione_1_pdf, #simulazione_2_pdf, #simulazione_3_pdf\").removeClass('d-none');\n          impostaRisultatiFullscreenSimulazioni(inputFullscreenAttivo);\n          return;\n        }\n\n        function euro(value){\n          return number_format(value || 0) + ' \u20AC';\n        }\n\n        function riga(nome, livello, valori){\n          var classi = {\n            piano: 'eln-red-text fw-bold',\n            comparto: 'eln-red-text ps-3',\n            tipologia: 'eln-regular-text ps-4',\n            gruppo: 'eln-red-text ps-5',\n            scheda: 'eln-regular-text ps-6'\n          };\n          var html = '<tr>' +\n            '<td class=\"fs--1 ' + classi[livello] + '\">' + nome + '</td>';\n\n          for(var i = 0; i < 3; i++){\n            html += '<td class=\"fs--2 text-end\">' + euro(valori.cc48[i]) + '</td>' +\n              '<td class=\"fs--2 text-end\">' + euro(valori.crv[i]) + '</td>' +\n              '<td class=\"fs--2 text-end\">' + euro(valori.totale[i]) + '</td>';\n          }\n\n          return html + '</tr>';\n        }\n\n        function sommaPerTipologia(gruppi){\n          var totali = {\n            DS: {cc48: [0,0,0], crv: [0,0,0], totale: [0,0,0], label: 'Superficie - Singoli'},\n            DP: {cc48: [0,0,0], crv: [0,0,0], totale: [0,0,0], label: 'Superficie - Pluriunit\u00E0'},\n            PS: {cc48: [0,0,0], crv: [0,0,0], totale: [0,0,0], label: 'Propriet\u00E0 - Singoli'},\n            PP: {cc48: [0,0,0], crv: [0,0,0], totale: [0,0,0], label: 'Propriet\u00E0 - Pluriunit\u00E0'}\n          };\n\n          $.each(gruppi, function(i, gruppo){\n            for(var indice = 0; indice < 3; indice++){\n              totali[gruppo.tipologia_gruppo].cc48[indice] += gruppo.cc48[indice];\n              totali[gruppo.tipologia_gruppo].crv[indice] += gruppo.crv[indice];\n              totali[gruppo.tipologia_gruppo].totale[indice] += gruppo.totale[indice];\n            }\n          });\n\n          return totali;\n        }\n\n        var html = '<table class=\"table table-sm table-bordered align-middle mb-0\">' +\n          '<thead>' +\n            '<tr class=\"bg-700 text-light\">' +\n              '<th class=\"fs--2 align-middle\" rowspan=\"2\">Piano-Comparto-Gruppo-Scheda</th>' +\n              '<th class=\"fs--2 text-center\" colspan=\"3\">Simulazione 1</th>' +\n              '<th class=\"fs--2 text-center\" colspan=\"3\">Simulazione 2</th>' +\n              '<th class=\"fs--2 text-center\" colspan=\"3\">Simulazione 3</th>' +\n            '</tr>' +\n            '<tr class=\"bg-300\">' +\n              '<th class=\"fs--2 text-end\">Cc48</th><th class=\"fs--2 text-end\">CRV</th><th class=\"fs--2 text-end\">Totale</th>' +\n              '<th class=\"fs--2 text-end\">Cc48</th><th class=\"fs--2 text-end\">CRV</th><th class=\"fs--2 text-end\">Totale</th>' +\n              '<th class=\"fs--2 text-end\">Cc48</th><th class=\"fs--2 text-end\">CRV</th><th class=\"fs--2 text-end\">Totale</th>' +\n            '</tr>' +\n          '</thead><tbody>';\n\n        $.each(simulazioni, function(i, piano){\n          html += riga(piano.piano, 'piano', piano);\n          $.each(piano.comparti, function(i, comparto){\n            html += riga(comparto.comparto, 'comparto', comparto);\n            var totali_tipologie = sommaPerTipologia(comparto.gruppi);\n            comparto.gruppi.sort(dynamicSort(\"tipologia_gruppo\"));\n            var tipologia_gruppo_old = '';\n\n            $.each(comparto.gruppi, function(i, gruppo){\n              if(gruppo.tipologia_gruppo != tipologia_gruppo_old)\n                html += riga(totali_tipologie[gruppo.tipologia_gruppo].label, 'tipologia', totali_tipologie[gruppo.tipologia_gruppo]);\n\n              html += riga(gruppo.gruppo, 'gruppo', gruppo);\n              $.each(gruppo.schede, function(i, scheda){\n                html += riga(scheda.scheda, 'scheda', scheda);\n              });\n              tipologia_gruppo_old = gruppo.tipologia_gruppo;\n            });\n          });\n        });\n        html += '</tbody></table>';\n        var inputFullscreenAttivo = $(\".simulazioni-page-card\").hasClass(\"simulazioni-input-fullscreen\");\n        $(\"#simulazioni_calcolo_table\").html(html);\n        impostaInputFullscreenSimulazioni(false);\n        $(\"#simulazioni_show\").addClass('d-none');\n        $(\"#simulazioni_toolbar\").addClass('d-none');\n        $(\"#simulazioni_calcolo\").removeClass('d-none');\n        $(\"#simulazioni_stampe\").removeClass('d-none');\n        $(\"#simulazione_1_pdf, #simulazione_2_pdf, #simulazione_3_pdf\").removeClass('d-none');\n        impostaRisultatiFullscreenSimulazioni(inputFullscreenAttivo);\n      }\n    });\n  });\n\n  // nelle simulazioni dell aformula, quando cambia la formula ne mostra il testo\n  $(\"select[name^='piano'][name*='[formula]']\").on('change', function(){\n    var id = $(this).attr('id').split(\"_\")[1];\n    var n_sim = $(this).attr('id').split(\"_\")[3];\n    let value = Number($(this).val());\n    if(value == '')\n      $(\"[name='piano[\" + id + \"][formula_string][\" + n_sim + \"]']\").text(\"\");\n    else{\n      $.ajax({\n        url: \"/dettagli_formula\",\n        method: \"GET\",\n        dataType: \"json\",\n        data: {id: value},\n        error: function (xhr, status, error) {\n          console.error('AJAX Error: ' + status + \" \" + error);\n        },\n        success: function (formula) {\n          $(\"[name='piano[\" + id + \"][formula_string][\" + n_sim + \"]']\").text(formula.testo);\n        }\n      });\n    }\n  });\n\n  // nelle stampe mostra/nasconde i campi dei vincoli/affrancazione nella creazione della stampa/template\n  function campiStampaAttivi() {\n    if($(\"#stampe_vincoli_tipologia_dati_affrancazione\").is(':checked'))\n      return $(\"input[name*='affrancazione'][class*='campo_stampa']\");\n\n    return $(\"input[name*='vincoli'][class*='campo_stampa']\");\n  }\n\n  function filtroIterSelezionato() {\n    const tipologiaDati = $(\"input[name='stampe_vincoli[tipologia_dati]']:checked\").val();\n    const nomeCampo = tipologiaDati == 'affrancazione' ? 'passaggio_iter_affrancazione' : 'passaggio_iter_vincoli';\n    const valore = $(\"input[name='\" + nomeCampo + \"']:checked\").val();\n\n    return typeof valore !== 'undefined' && valore !== 'nessuno';\n  }\n\n  function aggiornaCampiStampaDisponibili() {\n    const campiAttivi = campiStampaAttivi();\n    const campiStepIter = campiAttivi.filter(\"[data-step-iter='true']\");\n    const righeStepIter = campiStepIter.closest(\"tr\");\n    var tipo_file = $(\"input[name='stampe_vincoli[tipologia_file]']:checked\").val();\n    var tipo_estrazione = $(\"input[name='stampe_vincoli[tipologia_estrazione]']:checked\").val();\n\n    if(tipo_estrazione == 'numerica'){\n      campiAttivi.filter(\":checked\").prop('checked', false);\n      campiAttivi.prop('disabled', true);\n    }\n    else{\n      campiAttivi.prop('disabled', false);\n\n      if(tipo_estrazione == 'sintetica'){\n      campiAttivi.filter(\"[sommabile='false']\").prop('checked', false);\n      campiAttivi.filter(\"[sommabile='false']\").prop('disabled', true);\n      }\n\n      if(!filtroIterSelezionato()){\n        campiStepIter.prop('checked', false);\n        campiStepIter.prop('disabled', true);\n        righeStepIter.addClass('text-muted opacity-50 campo-step-iter-disabilitato');\n        righeStepIter.attr('title', 'Disponibile solo selezionando un filtro iter');\n      }\n      else{\n        righeStepIter.removeClass('text-muted opacity-50 campo-step-iter-disabilitato');\n        righeStepIter.removeAttr('title');\n      }\n\n      var n_selezionati = campiAttivi.filter(\":checked\").length;\n      if(tipo_file == 'pdf' && n_selezionati >= 6)\n        campiAttivi.filter(\":not(:disabled)\").not(\":checked\").prop('disabled', true);\n    }\n\n    var n_selezionati = campiAttivi.filter(\":checked\").length;\n    if(tipo_file == 'csv')\n      if(n_selezionati <= 6)\n        $(\"#stampe_vincoli_tipologia_file_pdf\").prop('disabled', false);\n      else\n        $(\"#stampe_vincoli_tipologia_file_pdf\").prop('disabled', true);\n  }\n\n  $(\"#stampe_vincoli_tipologia_dati_affrancazione:radio, #stampe_vincoli_tipologia_dati_vincoli:radio\").on('change', function(){\n    if(this.value == 'vincoli'){\n      $(\"#campi_affrancazione_stampe\").addClass('d-none');\n      $(\"input[name='passaggio_iter_affrancazione']\").prop('disabled', true);\n      $(\"input[name='passaggio_iter_vincoli']\").prop('disabled', false);\n      $(\"input[name*='affrancazione'][class*='campo_stampa']:checked\").prop('checked', false);\n      $(\"#stampe_vincoli_tipologia_file_pdf\").prop('disabled', false);\n      $(\"#campi_vincoli_stampe\").removeClass('d-none');\n      $(\"#stampe_vincoli_tipologia_periodo_storica\").prop('disabled', true);\n      $(\"#stampe_vincoli_tipologia_periodo_attualita\").prop('checked', true);\n      $(\"#passaggio_iter_affrancazione_nessuno\").prop('checked', true);\n      aggiornaCampiStampaDisponibili();\n    }\n    else if(this.value == 'affrancazione'){\n      $(\"#campi_affrancazione_stampe\").removeClass('d-none');\n      $(\"input[name='passaggio_iter_vincoli']\").prop('disabled', true);\n      $(\"input[name='passaggio_iter_affrancazione']\").prop('disabled', false);\n      $(\"input[name*='vincoli'][class*='campo_stampa']:checked\").prop('checked', false);\n      $(\"#stampe_vincoli_tipologia_file_pdf\").prop('disabled', false);\n      $(\"#campi_vincoli_stampe\").addClass('d-none');\n      $(\"#stampe_vincoli_tipologia_periodo_storica\").prop('disabled', true);\n      $(\"#stampe_vincoli_tipologia_periodo_attualita\").prop('checked', true);\n      $(\"#passaggio_iter_vincoli_nessuno\").prop('checked', true);\n      aggiornaCampiStampaDisponibili();\n    }\n  });\n\n  // nella creazione di un template, quando seleziono un passaggio dell'iter,\n  // sblocco la relativa select e blocco le altre. Inoltre consente di selezionare la stampa storica\n  $(\"input[name^='passaggio_iter_vincoli'], input[name^='passaggio_iter_affrancazione']\").on('change', function(){\n    var id = this.id;\n    $(\"select[name^='passaggio_iter_']\").prop('disabled', true);\n    $(\"[name='\" + id + \"_option']\").prop('disabled', false);\n    if(id != 'passaggio_iter_vincoli_nessuno' && id != 'passaggio_iter_affrancazione_nessuno')\n      $(\"#stampe_vincoli_tipologia_periodo_storica\").prop('disabled', false);\n    else\n      $(\"#stampe_vincoli_tipologia_periodo_storica\").prop('disabled', true);\n    aggiornaCampiStampaDisponibili();\n  });\n\n  // nella creazione di un template di stampa, quando passo dalla tipologia PDF a\n  // quella CSV sblocco i campi selezionabili\n  // nella creazione/modifica di un template di stampa,\n  // quando seleziono la stampa dettagliata permetto la selezione di tutti i campi,\n  // quando seleziono la stampa sintetica permetto la selezione dei soli campi sommabili,\n  // quando seleziono la stampa per identificativo permetto la selezione di tutti i campi\n  // quando seleziono la stampa numerica disabilito la selezione dei campi\n  $(\"input[name='stampe_vincoli[tipologia_estrazione]'], input[name='stampe_vincoli[tipologia_file]'], input[class*='campo_stampa']\").on('change', function(){\n    aggiornaCampiStampaDisponibili();\n  })\n\n  aggiornaCampiStampaDisponibili();\n\n  // selezionando un template di stampa, permette di proseguire coi filtri\n  function selezionaTemplateStampa(riga) {\n    $(\".selectable-row[id='stampa_speciale-indirizzi-intestati'], .selectable-row[id^='stampa_numero']\").removeClass(\"table-active\");\n    riga.addClass(\"table-active\");\n    $(\"#stampe_generali_form\").attr(\"action\", riga.attr(\"data-form-action\"));\n    $(\"#stampa_selezionata_nome\").text(riga.attr(\"data-nome-stampa\"));\n    $(\"#stampa_selezionata_formato\").text(riga.attr(\"data-formato-stampa\"));\n    $(\".stampe-vincoli-selected\").toggleClass(\"stampe-vincoli-selected-csv\", riga.attr(\"data-formato-stampa\") == \"CSV\");\n    $(\"#stampe_generali_feedback\").addClass(\"d-none\").text(\"\");\n\n    if(riga.attr(\"data-richiede-periodo\") == \"true\")\n      $(\"#periodo_di_verifica\").removeClass(\"d-none\");\n    else\n      $(\"#periodo_di_verifica\").addClass(\"d-none\");\n\n    $(\"#filtri_stampe\").removeClass(\"d-none\");\n    $(\"#filtri_stampe_placeholder\").addClass(\"d-none\");\n  }\n\n  $(\".selectable-row[id='stampa_speciale-indirizzi-intestati'], .selectable-row[id^='stampa_numero']\").on('click', function(){\n    selezionaTemplateStampa($(this));\n  });\n\n  $(\".selectable-row[id='stampa_speciale-indirizzi-intestati'], .selectable-row[id^='stampa_numero']\").on('keydown', function(event){\n    if(event.key == \"Enter\" || event.key == \" \"){\n      event.preventDefault();\n      selezionaTemplateStampa($(this));\n    }\n  });\n\n  // dopo aver selezionato una stampa permette di filtrare per piano\n  $(\"input[name='piano_scope'][type='radio']\").on('change', function(){\n    if(this.value == 'tutti'){\n        $(\"select[id='piano']\").prop('disabled', true).val(''); // Disabilita e resetta la select\n        $(\"input[name='comparto_scope'][type='radio'][value='singolo']\").prop('disabled', true).prop('checked', false);\n        $(\"input[name='comparto_scope'][type='radio'][value='tutti']\").prop('checked', true);\n        $(\"select[id='comparto']\").prop('disabled', true).val(''); // Disabilita e resetta anche la select comparto\n    }\n    else {\n        $(\"select[id='piano']\").prop('disabled', false);\n\n        if($(\"select[id='piano']\").val() !== ''){\n            $(\"input[name='comparto_scope'][type='radio'][value='singolo']\").prop('disabled', false);\n        } else {\n            $(\"input[name='comparto_scope'][type='radio'][value='singolo']\").prop('disabled', true).prop('checked', false);\n            $(\"input[name='comparto_scope'][type='radio'][value='tutti']\").prop('checked', true);\n            $(\"select[id='comparto']\").prop('disabled', true).val('');\n        }\n    }\n  });\n\n  // Quando cambia la select 'piano', controlla se abilitare il radio 'comparto'\n  $(\"select[id='piano']\").on('change', function(){\n      if($(this).val() !== ''){\n          $(\"input[name='comparto_scope'][type='radio'][value='singolo']\").prop('disabled', false);\n      } else {\n          $(\"input[name='comparto_scope'][type='radio'][value='singolo']\").prop('disabled', true).prop('checked', false);\n          $(\"input[name='comparto_scope'][type='radio'][value='tutti']\").prop('checked', true);\n          $(\"select[id='comparto']\").prop('disabled', true).val('');\n      }\n  });\n\n  // Quando cambia il radio 'comparto', controlla se abilitare la select 'comparto'\n  $(\"input[name='comparto_scope'][type='radio']\").on('change', function(){\n      if($(this).val() == 'singolo' && $(this).is(':checked')){\n          $(\"select[id='comparto']\").prop('disabled', false);\n      } else {\n          $(\"select[id='comparto']\").prop('disabled', true).val('');\n      }\n  });\n\n  $(\"#stampe_generali_form\").on('submit', function(){\n    let feedback = $(\"#stampe_generali_feedback\");\n    feedback.addClass(\"d-none\").text(\"\");\n\n    if($(\"input[name='piano_scope'][value='singolo']\").is(\":checked\") && $(\"#piano\").val() === \"\"){\n      feedback.text(\"Seleziona un piano oppure scegli 'Tutti i piani'.\").removeClass(\"d-none\");\n      return false;\n    }\n\n    if($(\"input[name='comparto_scope'][value='singolo']\").is(\":checked\") && $(\"#comparto\").val() === \"\"){\n      feedback.text(\"Seleziona un comparto oppure scegli 'Tutti i comparti'.\").removeClass(\"d-none\");\n      return false;\n    }\n\n    if(!$(\"#peep_check\").is(\":checked\") && !$(\"#pip_check\").is(\":checked\")){\n      feedback.text(\"Seleziona almeno una tipologia di piano.\").removeClass(\"d-none\");\n      return false;\n    }\n\n    if(!$(\"#proprieta_check\").is(\":checked\") && !$(\"#superficie_check\").is(\":checked\")){\n      feedback.text(\"Seleziona almeno una tipologia di convenzione.\").removeClass(\"d-none\");\n      return false;\n    }\n  });\n});\n", "$(document).on(\"turbo:load\", () => {\n  const treeview = window.elinkSidebarTreeview;\n\n  // quando apro un elemento, mi apre la treeview nel punto corretto\n  var url = document.URL;\n  var tokens = url.split(\"/\");\n  var modulo = tokens[3];\n  if(modulo == 'catasto' && treeview){\n    treeview.clearHighlights();\n    var posizione_attuale = tokens[4].split(\"?\")[0];\n\n    // Normalizza i due casi\n    if(posizione_attuale === 'esegui_ricerca_soggetto' || posizione_attuale === 'immobili_per_soggetto'){\n      posizione_attuale = 'ricerca_soggetto';\n    }\n\n    // Normalizza i due casi\n    if(posizione_attuale === 'esegui_ricerca_immobile'){\n      posizione_attuale = 'ricerca_immobile';\n    }\n\n    let element = $(\"li[id^='catasto'][id$='\" + posizione_attuale.split(\"?\")[0] + \"']\");\n    if(element.length)\n      treeview.openAncestors(element);\n\n    const currentButton = treeview.findNodeButton(element);\n    if(currentButton.length)\n      treeview.expandButton(currentButton);\n\n  }\n\n\t// quando nella ricerca per immobile si cambia tra terreni e fabbricati cambia\n\t// la parte visualizzata e disabilita i campi non necessari\n\t$(\"[name='tipologia_catasto']\").change(function(){\n\t\tif($(this).val() == 1){\n\t\t\t$(\"[name='ricerca-dettagli-terreno']\").addClass(\"d-none\");\n\t\t\t$(\"[name='ricerca-dettagli-fabbricato']\").removeClass(\"d-none\");\n\t\t\t$(\"[name='ricerca-dettagli-terreno'] *\").prop('disabled', true);\n\t\t\t$(\"[name='ricerca-dettagli-fabbricato'] *\").prop('disabled', false);\n\t\t\t$(\"#numero_fabbricato\").prop('disabled', true);\n\t\t\t$(\"#subalterno_fabbricato\").prop('disabled', true);\n\t\t}\n\t\telse{\n\t\t\t$(\"[name='ricerca-dettagli-terreno']\").removeClass(\"d-none\");\n\t\t\t$(\"[name='ricerca-dettagli-fabbricato']\").addClass(\"d-none\");\n\t\t\t$(\"[name='ricerca-dettagli-terreno'] *\").prop('disabled', false);\n\t\t\t$(\"[name='ricerca-dettagli-fabbricato'] *\").prop('disabled', true);\n\t\t\t$(\"#numero_terreno\").prop('disabled', true);\n\t\t\t$(\"#subalterno_terreno\").prop('disabled', true);\n\t\t}\n\t});\n\n\t// quando viene selezionato un foglio per i terreni, vengono caricati e abilitati i mappali\n\t$(\"#foglio_terreno\").change(function(){\n\t\tvar sezione = $(\"#sezione\").val();\n\t\tvar foglio = $(\"#foglio_terreno\").val();\n\t\t$.ajax({\n      url: \"/mappali_terreni\",\n      method: \"GET\",\n      dataType: \"json\",\n      data: {sezione: sezione, foglio: foglio},\n      error: function (xhr, status, error) {\n          console.error('AJAX Error: ' + status + \" \" + error);\n      },\n      success: function (mappali) {\n        $(\"#numero_terreno\").empty();\n        $(\"#numero_terreno\").append('<option value=\"\">Mapp.</option>');\n        for(var mappale of mappali)\n          $(\"#numero_terreno\").append('<option value=\"'+mappale.numero+'\">'+mappale.numero+'</option>');\n        $('#numero_terreno').prop(\"disabled\", false);\n        $(\"#subalterno_terreno\").empty();\n        $(\"#subalterno_terreno\").append('<option value=\"\">Sub.</option>');\n        $('#subalterno_terreno').prop(\"disabled\", true);\n      }\n    });\n\t});\n\t// quando viene selezionato un mappale per i terreni, vengono caricati e abilitati i subalterni\n\t$(\"#numero_terreno\").change(function(){\n\t\tvar sezione = $(\"#sezione\").val();\n\t\tvar foglio = $(\"#foglio_terreno\").val();\n\t\tvar mappale = $(\"#numero_terreno\").val();\n\t\t$.ajax({\n      url: \"/subalterni_terreni\",\n      method: \"GET\",\n      dataType: \"json\",\n      data: {sezione: sezione, foglio: foglio, mappale: mappale},\n      error: function (xhr, status, error) {\n          console.error('AJAX Error: ' + status + \" \" + error);\n      },\n      success: function (subalterni) {\n        $(\"#subalterno_terreno\").empty();\n        $(\"#subalterno_terreno\").append('<option value=\"\">Sub.</option>');\n        for(var subalterno of subalterni)\n          $(\"#subalterno_terreno\").append('<option value=\"'+subalterno.subalterno+'\">'+subalterno.subalterno+'</option>');\n        $('#subalterno_terreno').prop(\"disabled\", false);\n      }\n    });\n\t});\n\n\t// quando viene selezionato un foglio per i fabbricati, vengono caricati e abilitati i mappali\n\t$(\"#foglio_fabbricato\").change(function(){\n\t\tvar sezione = $(\"#sezione\").val();\n\t\tvar foglio = $(\"#foglio_fabbricato\").val();\n\t\t$.ajax({\n      url: \"/mappali_fabbricati\",\n      method: \"GET\",\n      dataType: \"json\",\n      data: {sezione: sezione, foglio: foglio},\n      error: function (xhr, status, error) {\n          console.error('AJAX Error: ' + status + \" \" + error);\n      },\n      success: function (mappali) {\n        $(\"#numero_fabbricato\").empty();\n        $(\"#numero_fabbricato\").append('<option value=\"\">Mapp.</option>');\n        for(var mappale of mappali)\n          $(\"#numero_fabbricato\").append('<option value=\"'+mappale.numero+'\">'+mappale.numero+'</option>');\n        $('#numero_fabbricato').prop(\"disabled\", false);\n        $(\"#subalterno_fabbricato\").empty();\n        $(\"#subalterno_fabbricato\").append('<option value=\"\">Sub.</option>');\n        $('#subalterno_fabbricato').prop(\"disabled\", true);\n      }\n    });\n\t});\n\t// quando viene selezionato un mappale per i fabbricati, vengono caricati e abilitati i subalterni\n\t$(\"#numero_fabbricato\").change(function(){\n\t\tvar sezione = $(\"#sezione\").val();\n\t\tvar foglio = $(\"#foglio_fabbricato\").val();\n\t\tvar mappale = $(\"#numero_fabbricato\").val();\n\t\t$.ajax({\n      url: \"/subalterni_fabbricati\",\n      method: \"GET\",\n      dataType: \"json\",\n      data: {sezione: sezione, foglio: foglio, mappale: mappale},\n      error: function (xhr, status, error) {\n          console.error('AJAX Error: ' + status + \" \" + error);\n      },\n      success: function (subalterni) {\n        $(\"#subalterno_fabbricato\").empty();\n        $(\"#subalterno_fabbricato\").append('<option value=\"\">Sub.</option>');\n        for(var subalterno of subalterni)\n          $(\"#subalterno_fabbricato\").append('<option value=\"'+subalterno.subalterno+'\">'+subalterno.subalterno+'</option>');\n        $('#subalterno_fabbricato').prop(\"disabled\", false);\n      }\n    });\n\t});\n\n  // quando nella ricerca per soggetto si cambia tra fisico e giuridico cambia\n  // la parte visualizzata e disabilita i campi non necessari\n  $(\"[name='tipologia_soggetti']\").change(function(){\n    if($(this).val() == 1){ // giuridico\n      $(\"[name='ricerca-dettagli-soggetto-fisico']\").addClass(\"d-none\");\n      $(\"[name='ricerca-dettagli-soggetto-giuridico']\").removeClass(\"d-none\");\n      $(\"[name='ricerca-dettagli-soggetto-fisico'] *\").prop('disabled', true);\n      $(\"[name='ricerca-dettagli-soggetto-giuridico'] *\").prop('disabled', false);\n    }\n    else{ // fisico\n      $(\"[name='ricerca-dettagli-soggetto-fisico']\").removeClass(\"d-none\");\n      $(\"[name='ricerca-dettagli-soggetto-giuridico']\").addClass(\"d-none\");\n      $(\"[name='ricerca-dettagli-soggetto-fisico'] *\").prop('disabled', false);\n      $(\"[name='ricerca-dettagli-soggetto-giuridico'] *\").prop('disabled', true);\n    }\n  });\n\n  // quando nel risultato della ricerca degli immobili per soggetto passo dai\n  // fabbricati ai terreni\n  $(\"#terreni_soggetto_button\").on('click', function(){\n    $(\"[name='terreni_soggetto']\").removeClass('d-none');\n    $(\"[name='fabbricati_soggetto']\").addClass('d-none');\n    $(\"#terreni_soggetto_button\").removeClass('eln-green-text');\n    $(\"#terreni_soggetto_button\").addClass('eln-red-text text-decoration-underline');\n    $(\"#fabbricati_soggetto_button\").removeClass('eln-red-text text-decoration-underline');\n    $(\"#fabbricati_soggetto_button\").addClass('eln-green-text');\n  });\n\n  // quando nel risultato della ricerca degli immobili per soggetto passo dai\n  // terreni ai fabbricati\n  $(\"#fabbricati_soggetto_button\").on('click', function(){\n  $(\"[name='fabbricati_soggetto']\").removeClass('d-none');\n  $(\"[name='terreni_soggetto']\").addClass('d-none');\n  $(\"#fabbricati_soggetto_button\").removeClass('eln-green-text');\n  $(\"#fabbricati_soggetto_button\").addClass('eln-red-text text-decoration-underline');\n  $(\"#terreni_soggetto_button\").removeClass('eln-red-text text-decoration-underline');\n  $(\"#terreni_soggetto_button\").addClass('eln-green-text');\n  });\n\n  $(\".per-page-select\").on(\"change\", function() {\n    $(this).closest(\"form\").trigger(\"submit\");\n  });\n});\n", "$(document).on(\"turbo:load\", () => {\n\tjQuery.fn.flexdatalist=function(e,t){\"use strict\";var i=function(e,t){e.each((function(){var e=$(this),i=e.data(),a=i.flexdatalist,r=i.aliascontainer;r&&(e.removeClass(\"flexdatalist-set\").attr({style:null,tabindex:null}).val(a&&a.originalValue&&!t?a.originalValue:\"\").removeData(\"flexdatalist\").removeData(\"aliascontainer\").off(),r.remove())}))};if(\"string\"==typeof e&&\"reset\"!==e){if(\"object\"==typeof this[0]&&void 0!==this[0].fvalue){var a=this[0];if(\"destroy\"===e)i(this,t);else if(\"value\"===e){if(void 0===t)return a.fvalue.get();a.fvalue.set(t)}else if(\"add\"===e){if(void 0===t)return a.debug(\"Missing value to add!\");a.fvalue.add(t)}else if(\"toggle\"===e){if(void 0===t)return a.debug(\"Missing value to toggle!\");a.fvalue.toggle(t)}else if(\"remove\"===e){if(void 0===t)return a.debug(\"Missing value to remove!\");a.fvalue.remove(t)}else if(\"disabled\"===e){if(void 0===t)return a.fdisabled();a.fdisabled(t)}else if(\"string\"==typeof e){if(void 0===t)return a.options.get(e);a.options.set(e,t)}return this}e={_option:t}}this.length>0&&void 0!==this[0].fvalue&&i(this);var r=$.extend({url:null,data:[],params:{},relatives:null,chainedRelatives:!1,cache:!0,cacheLifetime:60,minLength:3,groupBy:!1,selectionRequired:!1,focusFirstResult:!1,textProperty:null,valueProperty:null,visibleProperties:[],iconProperty:\"thumb\",searchIn:[\"label\"],searchContain:!1,searchEqual:!1,searchByWord:!1,searchDisabled:!1,searchDelay:400,normalizeString:null,multiple:null,disabled:null,maxShownResults:100,removeOnBackspace:!0,noResultsText:'No results found for \"{keyword}\"',toggleSelected:!1,allowDuplicateValues:!1,redoSearchOnFocus:!0,requestType:\"get\",requestContentType:\"x-www-form-urlencoded\",requestHeaders:null,resultsProperty:\"results\",keywordParamName:\"keyword\",searchContainParamName:\"contain\",limitOfValues:0,valuesSeparator:\",\",debug:!0},e);return this.each((function(e){var t=$(this),i=this,a=null,s=[],n=\"flex\"+e,l=null,o=null;this.init=function(){var e=this.options.init();this.set.up(),l.on(\"focusin\",(function(e){i.action.redoSearchFocus(e),i.action.showAllResults(e),o&&o.addClass(\"focus\")})).on(\"input keydown\",(function(e){9===i.keyNum(e)&&i.results.remove(),i.action.keypressValue(e,188),i.action.backSpaceKeyRemove(e)})).on(\"input keyup\",(function(e){i.action.keypressValue(e,13),i.action.keypressSearch(e),i.action.copyValue(e),i.action.backSpaceKeyRemove(e),i.action.showAllResults(e),i.action.clearValue(e),i.action.removeResults(e),i.action.inputWidth(e)})).on(\"focusout\",(function(e){o&&o.removeClass(\"focus\"),i.action.clearText(e),i.action.clearValue(e)})),window.onresize=function(e){i.position()},this.cache.gc(),e.selectionRequired&&i.fvalue.clear(!0,!0),this.fvalue._load(e.originalValue,(function(a,r){i.fdisabled(e.disabled),t.trigger(\"init:flexdatalist\",[e])}),!0)},this.action={keypressValue:function(e,t){var a=i.keyNum(e),r=l[0].value,s=i.options.get();if(r.length>0&&a===t&&!s.selectionRequired&&s.multiple){r=l[0].value;e.preventDefault(),e.stopPropagation(),i.fvalue.extract(r),i.results.remove()}},keypressSearch:function(e){var t=i.keyNum(e),r=l.val(),s=r.length,n=i.options.get();clearTimeout(a),(!t||13!==t&&(t<37||t>40))&&(a=setTimeout((function(){(0===n.minLength&&s>0||n.minLength>0&&s>=n.minLength)&&i.data.load((function(e){i.search.get(r,e,(function(e){i.results.show(e)}))}))}),n.searchDelay))},redoSearchFocus:function(e){var t=i.fvalue.get(),a=i.options.get(),r=l.val();a.redoSearchOnFocus&&(r.length>0&&a.multiple||r.length>0&&0===t.length)&&this.keypressSearch(e)},copyValue:function(e){if(13!==i.keyNum(e)){var t=l.val(),a=i.fvalue.get(!0),r=i.options.get();r.multiple||r.selectionRequired||t.length===a.length||i.fvalue.extract(t)}},backSpaceKeyRemove:function(e){var t=i.options.get();if(t.removeOnBackspace&&t.multiple){var a=l.val(),r=l.data(\"_remove\");8===i.keyNum(e)&&(0===a.length?r?(i.fvalue.remove(r),l.data(\"_remove\",null)):l.data(\"_remove\",l.parents(\"li:eq(0)\").prev()):l.data(\"_remove\",null))}},showAllResults:function(e){var t=l.val();\"\"===(t=$.trim(t))&&0===i.options.get(\"minLength\")&&i.data.load((function(e){i.results.show(e)}))},inputWidth:function(e){if(i.options.get().multiple){var a=l.val(),r=parseInt(l.css(\"fontSize\").replace(\"px\",\"\")),s=t.innerWidth(),n=(a.length+1)*r;n>=40&&n<=s&&(l[0].style.width=n+\"px\")}},clearText:function(e){var t=i.fvalue.get(),a=i.options.get();!a.multiple&&a.selectionRequired&&0===t.length&&(l[0].value=\"\")},clearValue:function(e){i.fvalue.get();var t=l.val(),a=i.options.get();!a.multiple&&a.selectionRequired&&t.length<=a.minLength&&i.fvalue.clear()},removeResults:function(e){var t=l.val(),a=i.options.get();a.minLength>0&&t.length<a.minLength&&i.results.remove()}},this.set={up:function(){l=this.getAlias(),i.options.get(\"multiple\")?o=this.multipleInput(l):l.insertAfter(t),this.accessibility(l),t.attr(\"autofocus\")&&l.trigger(\"focus\"),t.data(\"aliascontainer\",o||l).addClass(\"flexdatalist flexdatalist-set\").css({position:\"absolute\",top:-14e3,left:-14e3}).attr(\"tabindex\",-1);var e=t.attr(\"id\"),a=l.attr(\"id\");$('label[for=\"'+e+'\"]').attr(\"for\",a),this.chained()},getAlias:function(){var e=t.attr(\"id\")?t.attr(\"id\")+\"-flexdatalist\":n;return $('<input type=\"text\">').attr({class:t.attr(\"class\"),name:t.attr(\"name\")?\"flexdatalist-\"+t.attr(\"name\"):null,id:e,placeholder:t.attr(\"placeholder\")}).addClass(\"flexdatalist-alias \"+e).removeClass(\"flexdatalist\").attr(\"autocomplete\",\"off\")},multipleInput:function(e){return o=$('<ul tabindex=\"1\">').addClass(\"flexdatalist-multiple \"+n).css({\"border-color\":t.css(\"border-left-color\"),\"border-width\":t.css(\"border-left-width\"),\"border-style\":t.css(\"border-left-style\"),\"border-radius\":t.css(\"border-top-left-radius\"),\"background-color\":t.css(\"background-color\")}).insertAfter(t).on(\"click\",(function(){$(this).find(\"input\").trigger(\"focus\")})),$('<li class=\"input-container\">').addClass(\"flexdatalist-multiple-value\").append(e).appendTo(o),o},chained:function(){var e=i.options.get();if(e.relatives&&e.chainedRelatives){var t=function(t){e.relatives.each((function(){var e=i.isEmpty($(this).val()),t=i.isEmpty(i.value);!e&&t||i.fvalue.clear(),i.fdisabled(e)}))};e.relatives.on(\"change\",(function(){t()})),t()}},accessibility:function(e){var i={\"aria-autocomplete\":\"list\",\"aria-expanded\":\"false\",\"aria-owns\":(t.attr(\"id\")?t.attr(\"id\")+\"-flexdatalist\":n)+\"-results\"};e.attr(i)}},this.fvalue={get:function(e){var t=i.value;return!i.options.get().multiple&&!this.isJSON()||e?t:this.toObj(t)},set:function(e,a){return i.fdisabled()||(a||this.clear(!0),this._load(e)),t},add:function(e){return i.options.get(\"multiple\")&&this.set(e,!0),this},toggle:function(e){return i.fdisabled()||this.multiple.toggle(e),this},remove:function(e){if(!i.fdisabled()){e=this.toObj(e),t.trigger(\"before:flexdatalist.remove\",[e]);var a=[];if(i.isArray(e))$.each(e,(function(e,t){var r=i.fvalue.multiple.remove(t);r&&a.push(r)}));else{var r=this.multiple.remove(e);r&&a.push(r)}t.trigger(\"after:flexdatalist.remove\",[e,a]).trigger(\"change:flexdatalist\",[a,i.options.get()]).trigger(\"change\")}return this},_load:function(e,t,a){var r=i.options.get().valueProperty,s=this.toStr(e),n=this.get(!0);if(t=t||$.noop,0!=s.length||0!=n.length){if(e=this.toObj(e),!i.isEmpty(e)&&!i.isEmpty(r)&&\"*\"!==r)return i.isObject(r)||(r=r.split(\",\")),void i.data.load((function(a){i.isObject(e)?i.isArray(e)||(e=[e]):e=e.split(\",\");for(var s=[],n=0;n<e.length;n++)for(var l=e[n],o=0;o<a.length;o++)for(var u=a[o],c=0;c<r.length;c++){var f=r[c];l=i.isDefined(l,f)?l[f]:l;i.isDefined(u,f)&&l===u[f]&&s.push(u)}s.length>0&&i.fvalue.extract(s,!0),t(e)}),e);t(e),i.fvalue.extract(e,a)}else t(e)},extract:function(e,a){var r=i.options.get(),s=[];a||t.trigger(\"before:flexdatalist.value\",[e,r]),i.isArray(e)?$.each(e,(function(e,t){s.push(i.fvalue._extract(t))})):s=i.fvalue._extract(e),a||t.data(\"result_selected\",e).trigger(\"after:flexdatalist.value\",[s,r]).trigger(\"change:flexdatalist\",[s,r]).trigger(\"change\")},_extract:function(e){var t=this.text(e),a=this.value(e);if(i.options.get().multiple){if(!i.isEmpty(t)){if(i.isDup(t))return;s.push(t),this.multiple.add(a,t)}}else this.single(a,t);return{value:a,text:t}},single:function(e,t){t&&t!==l.val()&&(l[0].value=t),i.value=e},multiple:{add:function(e,t){var a=this;this.li(e,t).on(\"click\",(function(){a.toggle($(this))})).find(\".fdl-remove\").on(\"click\",(function(){i.fvalue.remove($(this).parent())})),this.push(e),l[0].value=\"\",this.handleLimit()},push:function(e,t){var a=i.fvalue.get();a.includes(e)||(e=i.fvalue.toObj(e),a.push(e),e=i.fvalue.toStr(a),i.value=e)},toggle:function(e){var a=i.options.get();if(a.toggleSelected){var r=this.findLi(e);if(r){var s=r.data(),n=r.hasClass(\"disabled\")?\"enable\":\"disable\",l=[{value:s.value,text:s.text,action:n},a];t.trigger(\"before:flexdatalist.toggle\",l),\"enable\"===n?r.removeClass(\"disabled\"):r.addClass(\"disabled\");var u=[];o.find(\"li.toggle:not(.disabled)\").each((function(){var e=$(this);u.push(e.data(\"value\"))})),u=i.fvalue.toStr(u),i.value=u,t.trigger(\"after:flexdatalist.toggle\",l).trigger(\"change:flexdatalist\",l).trigger(\"change\")}}},remove:function(e){var t=this.findLi(e);if(t){var a=i.fvalue.get(),r=t.index(),n=t.data(),l={value:n.value,text:n.text};return a.splice(r,1),a=i.fvalue.toStr(a),i.value=a,t.remove(),i.fvalue.multiple.handleLimit(),s.splice(r,1),this.handleLimit(),l}},removeAll:function(){var e=i.fvalue.get(),a=i.options.get();t.trigger(\"before:flexdatalist.remove.all\",[e,a]),o.find(\"li:not(.input-container)\").remove(),i.value=\"\",s=[],this.handleLimit(),t.trigger(\"after:flexdatalist.remove.all\",[e,a])},li:function(e,t){var a=o.find(\"li.input-container\"),r=i.options.get();return $(\"<li>\").addClass(\"value\"+(r.toggleSelected?\" toggle\":\"\")).append('<span class=\"text\">'+t+\"</span>\").append('<span class=\"fdl-remove\">&times;</span>').data({text:t,value:i.fvalue.toStr(e)}).insertBefore(a)},handleLimit:function(){var e=this.isAtLimit(),t=o.find(\"li.input-container\");e?t.hide():t.show()},isAtLimit:function(){var e=i.options.get(\"limitOfValues\");return e>0&&e==s.length},findLi:function(e){if(e instanceof jQuery)0===e.length&&(e=null);else{var t=e;e=null,o.find(\"li:not(.input-container)\").each((function(){var i=$(this);if(i.data(\"value\")===t)return e=i,!1}))}return e},isEmpty:function(){return this.get().length>0}},value:function(e){var t=e,a=i.options.get(),r=a.valueProperty;if(i.isObject(e))if(this.isJSON()||this.isMixed())if(delete e.name_highlight,i.isArray(r)){for(var s={},n=0;n<r.length;n++){var l=i.getPropertyValue(e,r[n]);l&&(s[r[n]]=l)}t=this.toStr(s)}else t=this.toStr(e);else t=i.isDefined(e,r)?i.getPropertyValue(e,r):i.isDefined(e,a.searchIn[0])?i.getPropertyValue(e,a.searchIn[0]):null;return t},text:function(e){var t=e,a=i.options.get();return i.isObject(e)&&(t=i.getPropertyValue(e,a.searchIn[0]),t=i.isDefined(e,a.textProperty)?i.getPropertyValue(e,a.textProperty):this.placeholders.replace(e,a.textProperty,t)),t=i.escapeHtml(t)},placeholders:{replace:function(e,t,a){if(i.isObject(e)&&\"string\"==typeof t){var r=this.parse(t);if(!i.isEmpty(e)&&r)return $.each(r,(function(a,r){i.isDefined(e,r)&&(t=t.replace(a,i.getPropertyValue(e,r)))})),t}return a},parse:function(e){var t=e.match(/\\{.+?\\}/g);if(!t)return!1;var i={};return t.map((function(e){i[e]=e.slice(1,-1)})),i}},clear:function(e,a){var r=i.value,n=i.options.get();return n.multiple&&this.multiple.removeAll(),i.value=\"\",e&&(l[0].value=\"\"),\"\"===r||a||t.trigger(\"change:flexdatalist\",[{value:\"\",text:\"\"},n]).trigger(\"clear:flexdatalist\",[{value:\"\",text:\"\"},n]).trigger(\"change\"),s=[],this},toObj:function(e){if(\"object\"!=typeof e){var t=i.options.get();i.isEmpty(e)||!i.isDefined(e)?e=t.multiple?[]:this.isJSON()?{}:\"\":this.isCSV()?e=(e=e.toString().split(t.valuesSeparator)).map((function(e){return e.trim()})):(this.isMixed()||this.isJSON())&&this.isJSON(e)?e=JSON.parse(e):\"number\"==typeof e&&(e=e.toString())}return e},toStr:function(e){return\"string\"!=typeof e&&(i.isEmpty(e)||!i.isDefined(e)?e=\"\":\"number\"==typeof e?e=e.toString():this.isCSV()?e=e.join(i.options.get(\"valuesSeparator\")):(this.isJSON()||this.isMixed())&&(e=JSON.stringify(e))),$.trim(e)},isJSON:function(e){if(void 0!==e){if(i.isObject(e))e=JSON.stringify(e);else if(\"string\"!=typeof e)return!1;return 0===e.indexOf(\"{\")||0===e.indexOf(\"[{\")}var t=i.options.get().valueProperty;return i.isObject(t)||\"*\"===t},isMixed:function(){var e=i.options.get();return!e.selectionRequired&&\"*\"===e.valueProperty},isCSV:function(){return!this.isJSON()&&i.options.get(\"multiple\")}},this.data={load:function(e,i){var a=this,r=[];t.trigger(\"before:flexdatalist.data\"),this.url((function(i){r=r.concat(i),a.static((function(i){r=r.concat(i),a.datalist((function(i){r=r.concat(i),t.trigger(\"after:flexdatalist.data\",[r]),e(r)}))}))}),i)},static:function(e){var t=i.options.get();if(\"string\"==typeof t.data){var a=t.data,r=i.cache.read(a,!0);if(r)return void e(r);this.remote({url:a,success:function(r){t.data=r,e(r),i.cache.write(a,r,t.cacheLifetime,!0)}})}else\"object\"!=typeof t.data&&(t.data=[]),e(t.data)},datalist:function(e){var a=t.attr(\"list\"),r=[];i.isEmpty(a)||$(\"#\"+a).find(\"option\").each((function(){var e=$(this),t=e.val(),i=e.text();r.push({label:i.length>0?i:t,value:t})})),e(r)},url:function(e,a){var r=l.val(),s=i.options.get(),n=s.keywordParamName,o=s.searchContainParamName,u=i.fvalue.get(),c=this.relativesData();if(i.isEmpty(s.url))return e([]);var f={};\"post\"===s.requestType&&($.each(s,(function(e,t){0!=e.indexOf(\"_\")&&\"data\"!=e&&(f[e]=t)})),delete f.relatives);var d=i.cache.keyGen({relative:c,load:a,keyword:r,contain:s.searchContain},s.url),h=i.cache.read(d,!0);if(h)e(h);else{var p=\"function\"==typeof s.params?s.params.call(t[0],r):s.params,g=$.extend(c,p,{load:a,selected:u,original:s.originalValue,options:f});g[n]=r,g[o]=s.searchContain,this.remote({url:s.url,data:g,success:function(t){l.val().length>=r.length&&e(t),i.cache.write(d,t,s.cacheLifetime,!0)}})}},remote:function(e){var a=this,r=i.options.get();t.hasClass(\"flexdatalist-loading\")||(t.addClass(\"flexdatalist-loading\"),\"json\"===r.requestContentType&&(e.data=JSON.stringify(e.data)),$.ajax($.extend({type:r.requestType,dataType:\"json\",headers:r.requestHeaders,contentType:\"application/\"+r.requestContentType+\"; charset=UTF-8\",complete:function(){t.removeClass(\"flexdatalist-loading\")}},e,{success:function(t){t=a.extractRemoteData(t),e.success(t)}})))},extractRemoteData:function(e){var t=i.options.get(),a=i.isDefined(e,t.resultsProperty)?e[t.resultsProperty]:e;return\"string\"==typeof a&&0===a.indexOf(\"[{\")&&(a=JSON.parse(a)),a&&a.options&&i.options.set($.extend({},t,a.options)),i.isObject(a)?a:[]},relativesData:function(){var e=i.options.get(\"relatives\"),t={};return e&&(t.relatives={},e.each((function(){var e=$(this),i=e.attr(\"name\").split(\"][\").join(\"-\").split(\"]\").join(\"-\").split(\"[\").join(\"-\").replace(/^\\|+|\\-+$/g,\"\");t.relatives[i]=e.val()}))),t}},this.search={get:function(e,a,r){var s=a;if(!i.options.get().searchDisabled&&!(s=i.cache.read(e))){if(t.trigger(\"before:flexdatalist.search\",[e,a]),!i.isEmpty(e)){s=[];for(var n=this.split(e),l=0;l<a.length;l++){var o=a[l];i.isDup(o)||(o=this.matches(o,n))&&s.push(o)}}i.cache.write(e,s,2),t.trigger(\"after:flexdatalist.search\",[e,a,s])}r(s)},matches:function(e,t){var a=$.extend({},e),r=[],s=i.options.get(),n=s.searchIn;if(t.length>0)for(var l=0;l<n.length;l++){var o=n[l];if(i.isDefined(e,o)&&e[o]){for(var u=e[o].toString(),c=u,f=this.split(u),d=0;d<t.length;d++){var h=t[d];this.find(h,f)&&(r.push(h),c=this.highlight(h,c))}c!==u&&(a[o+\"_highlight\"]=this.highlight(c))}}return!(0===r.length||s.searchByWord&&r.length<t.length-1)&&a},highlight:function(e,t){return t?(e=e.replace(/[.*+?^${}()|[\\]\\\\]/g,\"\\\\$&\"),t.replace(new RegExp(e,i.options.get(\"searchContain\")?\"ig\":\"i\"),\"|:|$&|::|\")):(e=e.split(\"|:|\").join('<span class=\"highlight\">')).split(\"|::|\").join(\"</span>\")},find:function(e,t){for(var a=i.options.get(),r=0;r<t.length;r++){var s=t[r];if(s=this.normalizeString(s),e=this.normalizeString(e),a.searchEqual)return s==e;if(a.searchContain?s.indexOf(e)>=0:0===s.indexOf(e))return!0}return!1},split:function(e){if(\"string\"==typeof e&&(e=[$.trim(e)]),i.options.get(\"searchByWord\"))for(var t=0;t<e.length;t++){var a=$.trim(e[t]);if(a.indexOf(\" \")>0){var r=a.split(\" \");$.merge(e,r)}}return e},normalizeString:function(e){if(\"string\"==typeof e){var t=i.options.get(\"normalizeString\");return\"function\"==typeof t&&(e=t(e)),(e=e.normalize(\"NFD\").replace(/[\\u0300-\\u036f]/g,\"\")).toUpperCase()}return e}},this.results={show:function(e){var a=this,r=i.options.get();if(this.remove(!0),e)if(0!==e.length){var s=this.container();r.groupBy?(e=this.group(e),Object.keys(e).forEach((function(t,n){var l=e[t],o=r.groupBy,u=i.results.highlight(l[0],o,t);$(\"<li>\").addClass(\"group\").append($(\"<span>\").addClass(\"group-name\").html(u)).append($(\"<span>\").addClass(\"group-item-count\").text(\" \"+l.length)).appendTo(s);a.items(l,s)}))):this.items(e,s);var n=s.find(\"li:not(.group)\");n.on(\"click\",(function(e){var s=$(this).data(\"item\");s&&(i.fvalue.extract(s),a.remove(),t.trigger(\"select:flexdatalist\",[s,r]))})).on(\"hover\",(function(){n.removeClass(\"active\"),$(this).addClass(\"active\").trigger(\"active:flexdatalist.results\",[$(this).data(\"item\")])}),(function(){$(this).removeClass(\"active\")})),r.focusFirstResult&&n.filter(\":first\").addClass(\"active\")}else this.empty(r.noResultsText)},empty:function(e){if(!i.isEmpty(e)){var a=this.container(),r=l.val();e=e.split(\"{keyword}\").join(r),$(\"<li>\").addClass(\"item no-results\").append(e).appendTo(a),t.trigger(\"empty:flexdatalist.results\",[e])}},items:function(e,a){var r=i.options.get(\"maxShownResults\");t.trigger(\"show:flexdatalist.results\",[e]);for(var s=0;s<e.length&&!(r>0&&r===s);s++)this.item(e[s],s,e.length).appendTo(a);t.trigger(\"shown:flexdatalist.results\",[e])},item:function(e,a,r){var s=$(\"<li>\").attr({role:\"option\",tabindex:\"-1\",\"aria-posinset\":a+1,\"aria-setsize\":r}).data(\"item\",e).addClass(\"item\"),n=i.options.get(),l=n.visibleProperties;for(a=0;a<l.length;a++){var o=l[a];if(o.indexOf(\"{\")>-1){var u=i.fvalue.placeholders.replace(e,o),c=i.fvalue.placeholders.parse(o);f=$(\"<span>\").addClass(\"item item-\"+Object.values(c).join(\"-\")).html(u+\" \")}else{if(n.groupBy&&n.groupBy===o||!i.isDefined(e,o))continue;var f={};if(o===n.iconProperty)f=$(\"<img>\").addClass(\"item item-\"+o).attr(\"src\",e[o]);else{var d=i.results.highlight(e,o);f=$(\"<span>\").addClass(\"item item-\"+o).html(d+\" \")}}f.appendTo(s)}return t.trigger(\"item:flexdatalist.results\",[s,e]),s},container:function(){var e=t;o&&(e=o);var a=$(\"ul.flexdatalist-results\");return 0===a.length&&(a=$(\"<ul>\").addClass(\"flexdatalist-results \").appendTo(\"body\").attr({id:l.attr(\"id\")+\"-results\",role:\"listbox\"}).css({\"border-color\":e.css(\"border-left-color\"),\"border-width\":\"1px\",\"border-bottom-left-radius\":e.css(\"border-bottom-left-radius\"),\"border-bottom-right-radius\":e.css(\"border-bottom-right-radius\")}).data({target:o||l,input:t}),i.position(l)),a},group:function(e){for(var t=[],a=i.options.get(\"groupBy\"),r=0;r<e.length;r++){var s=e[r];if(i.isDefined(s,a)){var n=s[a];i.isDefined(t,n)||(t[n]=[]),t[n].push(s)}}return t},highlight:function(e,t,a){return i.isDefined(e,t+\"_highlight\")?e[t+\"_highlight\"]:i.isDefined(e,t)?e[t]:a},active:function(e){},remove:function(e){var i=\"ul.flexdatalist-results\";e&&(i=\"ul.flexdatalist-results li\"),t.trigger(\"remove:flexdatalist.results\"),$(i).remove(),t.trigger(\"removed:flexdatalist.results\")}},this.cache={write:function(e,t,a,r){if(i.cache.isSupported()){e=this.keyGen(e,void 0,r);var s={value:t,timestamp:i.unixtime(),lifetime:a||!1};localStorage.setItem(e,JSON.stringify(s))}},read:function(e,t){if(i.cache.isSupported()){e=this.keyGen(e,void 0,t);var a=localStorage.getItem(e);if(a){var r=JSON.parse(a);if(!this.expired(r))return r.value;localStorage.removeItem(e)}}return null},delete:function(e,t){i.cache.isSupported()&&(e=this.keyGen(e,void 0,t),localStorage.removeItem(e))},clear:function(){if(i.cache.isSupported()){for(var e in localStorage)(e.indexOf(n)>-1||e.indexOf(\"global\")>-1)&&localStorage.removeItem(e);localStorage.clear()}},gc:function(){if(i.cache.isSupported())for(var e in localStorage)if(e.indexOf(n)>-1||e.indexOf(\"global\")>-1){var t=localStorage.getItem(e);t=JSON.parse(t),this.expired(t)&&localStorage.removeItem(e)}},isSupported:function(){if(i.options.get(\"cache\"))try{return\"localStorage\"in window&&null!==window.localStorage}catch(e){return!1}return!1},expired:function(e){if(e.lifetime){var t=i.unixtime()-e.timestamp;return e.lifetime<=t}return!1},keyGen:function(e,t,i){\"object\"==typeof e&&(e=JSON.stringify(e));var a,r,s=void 0===t?2166136261:t;for(a=0,r=e.length;a<r;a++)s^=e.charCodeAt(a),s+=(s<<1)+(s<<4)+(s<<7)+(s<<8)+(s<<24);return(i?\"global\":n)+(\"0000000\"+(s>>>0).toString(16)).substr(-8)}},this.options={init:function(){var e=$.extend({},r,t.data(),{multiple:null===r.multiple?t.is(\"[multiple]\"):r.multiple,disabled:null===r.disabled?t.is(\"[disabled]\"):r.disabled,originalValue:i.value});return this.set(e),e},get:function(e){var a=t.data(\"flexdatalist\");return e?i.isDefined(a,e)?a[e]:null:a||{}},set:function(e,a){var r=this.get();return i.isDefined(r,e)&&i.isDefined(a)?r[e]=a:i.isObject(e)&&(r=this._normalize(e)),t.data(\"flexdatalist\",r),t},_normalize:function(e){if(e.searchIn=i.csvToArray(e.searchIn),e.relatives=e.relatives&&$(e.relatives).length>0?$(e.relatives):null,e.textProperty=null===e.textProperty?e.searchIn[0]:e.textProperty,e.visibleProperties=i.csvToArray(e.visibleProperties,e.searchIn),\"*\"===e.valueProperty&&e.multiple&&!e.selectionRequired)throw new Error(\"Selection must be required for multiple, JSON fields!\");return e}},this.position=function(){var e=$(\"ul.flexdatalist-results\"),t=e.data(\"target\");e.length>0&&e.css({width:t.outerWidth()+\"px\",top:t.offset().top+t.outerHeight()+\"px\",left:t.offset().left+\"px\"})},this.fdisabled=function(e){if(this.isDefined(e)){if(t.prop(\"disabled\",e),l.prop(\"disabled\",e),o){o.css(\"background-color\",t.css(\"background-color\"));var i=o.find(\"li .fdl-remove\"),a=o.find(\"li.input-container\");e?(o.addClass(\"disabled\"),i.length>0&&a.hide(),i.hide()):(o.removeClass(\"disabled\"),a.show(),i.show())}this.options.set(\"disabled\",e)}return this.options.get(\"disabled\")},this.isDup=function(e){return!this.options.get(\"allowDuplicateValues\")&&(s.length>0&&s.indexOf(this.fvalue.text(e))>-1)},this.keyNum=function(e){return e.which||e.keyCode},this.isEmpty=function(e){return!i.isDefined(e)||(null===e||!0!==e&&(0===this.length(e)||\"\"===$.trim(e)))},this.isObject=function(e){return e&&\"object\"==typeof e},this.length=function(e){return this.isObject(e)?Object.keys(e).length:\"number\"==typeof e||\"number\"==typeof e.length?e.toString().length:0},this.isDefined=function(e,t){var i=void 0!==e;return i&&void 0!==t?void 0!==this.getPropertyValue(e,t):i},this.isArray=function(e){return\"[object Array]\"===Object.prototype.toString.call(e)},this.unixtime=function(e){var t=new Date;return e&&(t=new Date(e)),Math.round(t.getTime()/1e3)},this.csvToArray=function(e,t){return 0===e.length?t:\"string\"==typeof e?e.split(i.options.get(\"valuesSeparator\")):e},this.getPropertyValue=function(e,t){if(e&&\"string\"==typeof t){for(var i=t.split(\".\");i.length&&(e=e[i.shift()]););return e}},this.escapeHtml=function(e){return e.replace(/&/g,\"&amp;\").replace(/</g,\"&lt;\").replace(/>/g,\"&gt;\").replace(/\"/g,\"&quot;\").replace(/'/g,\"&#039;\")},this.debug=function(e,a){var r=i.options.get();r.debug&&(a||(a={}),e=\"Flexdatalist: \"+e,console.warn(e),console.log($.extend({inputName:t.attr(\"name\"),options:r},a)),console.log(\"--- /flexdatalist ---\"))},this.init()}))},jQuery((function(e){e(document).data(\"flexdatalist\")||e(document).on(\"mouseup\",(function(t){var i=e(\".flexdatalist-results\"),a=i.data(\"target\");a&&a.is(\":focus\")||i.is(t.target)||0!==i.has(t.target).length||i.remove()})).on(\"keydown\",(function(t){var i=e(\".flexdatalist-results\"),a=i.find(\"li\"),r=a.filter(\".active\"),s=r.index(),n=a.length,l=t.which||t.keyCode;if(0!==n)if(27!==l){if(13===l)t.preventDefault(),r.trigger(\"click\");else if(40===l||38===l){t.preventDefault(),40===l?r=s<n&&r.nextAll(\".item\").first().length>0?r.removeClass(\"active\").nextAll(\".item\").first().addClass(\"active\"):a.removeClass(\"active\").filter(\".item:first\").addClass(\"active\"):38===l&&(r=s>0&&r.prevAll(\".item\").first().length>0?r.removeClass(\"active\").prevAll(\".item\").first().addClass(\"active\"):a.removeClass(\"active\").filter(\".item:last\").addClass(\"active\")),r.trigger(\"active:flexdatalist.results\",[r.data(\"item\")]);var o=(0===r.prev().length?r:r.prev()).position().top;i.animate({scrollTop:o+i.scrollTop()},100)}}else i.remove()})).data(\"flexdatalist\",!0),jQuery(\"input.flexdatalist:not(.flexdatalist-set):not(.autodiscover-disabled)\").flexdatalist()})),function(e){var t=e.fn.val;e.fn.val=function(e){var i=this.length>0&&void 0!==this[0].fvalue;return void 0===e?i?this[0].fvalue.get(!0):t.call(this):i?this[0].fvalue.set(e):t.call(this,e)}}(jQuery);\n\t//# sourceMappingURL=jquery.flexdatalist.min.js.map\n});\n"],
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAO;AAAP;AAAA;AAAA,MAAO,mBAAQ;AAAA,QACb,QAAQ,OAAO,YAAY,cAAc,UAAU;AAAA,QACnD,WAAW,OAAO,cAAc,cAAc,YAAY;AAAA,MAC5D;AAAA;AAAA;;;ACHA,MAcO;AAdP;AAAA;AAAA;AAcA,MAAO,iBAAQ;AAAA,QACb,OAAO,UAAU;AACf,cAAI,KAAK,SAAS;AAChB,qBAAS,KAAK,KAAK,IAAI,CAAC;AACxB,6BAAS,OAAO,IAAI,iBAAiB,GAAG,QAAQ;AAAA,UAClD;AAAA,QACF;AAAA,MACF;AAAA;AAAA;;;ACrBA,MAKM,KAEA,cAEA,mBAkHC;AA3HP;AAAA;AAAA;AAKA,MAAM,MAAM,MAAM,IAAI,KAAK,EAAE,QAAQ;AAErC,MAAM,eAAe,WAAS,IAAI,IAAI,QAAQ;AAE9C,MAAM,oBAAN,MAAwB;AAAA,QACtB,YAAY,YAAY;AACtB,eAAK,sBAAsB,KAAK,oBAAoB,KAAK,IAAI;AAC7D,eAAK,aAAa;AAClB,eAAK,oBAAoB;AAAA,QAC3B;AAAA,QAEA,QAAQ;AACN,cAAI,CAAC,KAAK,UAAU,GAAG;AACrB,iBAAK,YAAY,IAAI;AACrB,mBAAO,KAAK;AACZ,iBAAK,aAAa;AAClB,6BAAiB,oBAAoB,KAAK,mBAAmB;AAC7D,2BAAO,IAAI,gDAAgD,KAAK,YAAY,kBAAkB;AAAA,UAChG;AAAA,QACF;AAAA,QAE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rest", "__decorate", "__param", "__metadata", "__awaiter", "__generator", "__exportStar", "__values", "__read", "__spread", "__spreadArrays", "__spreadArray", "__await", "__asyncGenerator", "__asyncDelegator", "__asyncValues", "__makeTemplateObject", "__importStar", "__importDefault", "__classPrivateFieldGet", "__classPrivateFieldSet", "__createBinding", "exports", "e", "m", "error", "v", "extend", "len", "create", "bind", "fn", "slice", "throttle", "x", "max", "min", "trim", "str", "isArray", "indexOf", "Util.setOptions", "Util.create", "Util.extend", "i", "init", "Util.isArray", "Util.splitWords", "Util.falseFn", "index", "Util.stamp", "e", "Point", "round", "points", "min2", "max2", "Util.formatNum", "zoom", "scale", "Util.wrapNum", "center", "len2", "Browser", "canvas", "svg", "div", "DomEvent.preventDefault", "DomEvent.getPropagationPath", "now", "handlers", "TRANSITION_END", "get", "getStyle", "style", "hasClass", "addClass", "Util.trim", "filter", "setTransform", "offset", "getPosition", "DomEvent.on", "DomEvent.off", "type", "Util.indexOf", "preventDefault", "stop", "DomUtil.getPosition", "Util.requestAnimFrame", "DomUtil.setPosition", "Util.cancelAnimFrame", "Map", "Util.bind", "DomUtil.TRANSITION", "DomUtil.TRANSITION_END", "DomUtil.addClass", "log", "start", "error", "DomUtil.remove", "DomUtil.create", "DomEvent.getMousePosition", "DomUtil.get", "position", "DomUtil.getStyle", "remove", "isHover", "DomEvent.isExternalTarget", "DomUtil.preventOutline", "left", "right", "DomUtil.removeClass", "DomUtil.TRANSFORM", "transform", "DomUtil.setTransform", "map", "control", "DomEvent.disableClickPropagation", "DomEvent.disableScrollPropagation", "DomUtil.empty", "DomEvent.stop", "Scale", "Handler", "Draggable", "preventOutline", "DomUtil.hasClass", "DomUtil.disableImageDrag", "DomUtil.disableTextSelection", "DomUtil.getSizedParentNode", "DomUtil.getScale", "DomUtil.enableImageDrag", "DomUtil.enableTextSelection", "edge", "LineUtil._getBitCode", "LineUtil._getEdgeIntersection", "LineUtil.isFlat", "centroid", "dot", "dist", "Layer", "layers", "point", "marker", "icon", "shadow", "latLng", "DomUtil.setOpacity", "Path", "Circle", "top", "bottom", "Polyline", "LineUtil._sqClosestPointOnSegment", "LineUtil.polylineCenter", "LineUtil.clipSegment", "LineUtil.simplify", "LineUtil.pointToSegmentDistance", "LineUtil._flat", "Polygon", "PolyUtil.polygonCenter", "PolyUtil.clipPolygon", "features", "getFeature", "DomUtil.toFront", "DomUtil.toBack", "DomEvent.stopPropagation", "popup", "Tooltip", "tooltip", "Util.throttle", "compare", "x2", "translate", "latLngBounds", "Util.template", "Util.emptyImageUrl", "Renderer", "m", "order", "keys", "DomEvent.getWheelDelta", "debounce", "define", "__awaiter", "thisArg", "_arguments", "P", "generator", "Promise", "resolve", "reject", "fulfilled", "value", "step", "next", "e", "rejected", "result", "done", "then", "apply", "Point", "x", "y", "this", "t", "SuppressedError", "prototype", "clone", "p", "_add", "_sub", "_multByPoint", "_divByPoint", "k", "_mult", "_div", "a", "_rotate", "_rotateAround", "m", "_matMult", "unit", "_unit", "perp", "_perp", "round", "_round", "mag", "Math", "sqrt", "other", "distSqr", "dx", "dy", "angle", "atan2", "b", "angleWithSep", "cos", "sin", "constructor", "convert", "Array", "isArray", "Error", "UnitBezier", "p1x", "p1y", "p2x", "p2y", "cx", "bx", "ax", "cy", "by", "ay", "unitbezier", "sampleCurveX", "sampleCurveY", "sampleCurveDerivativeX", "solveCurveX", "epsilon", "i", "x2", "abs", "d2", "t0", "t1", "solve", "supportsOffscreenCanvas", "offscreenCanvasDistorted", "offscreenCanvasSupported", "OffscreenCanvas", "getContext", "createImageBitmap", "isOffscreenCanvasDistorted", "size", "context", "willReadFrequently", "base", "fillStyle", "fillRect", "floor", "data", "getImageData", "EPSILON", "ARRAY_TYPE", "Float32Array", "create", "out", "glMatrix.ARRAY_TYPE", "identity", "length", "z", "fromValues", "add", "scale", "cross", "az", "bz", "len", "transformMat4", "w", "fromEuler", "order", "arguments", "halfToRad", "PI", "sx", "sy", "sz", "cz", "vec3.create", "vec3.fromValues", "mat3.create", "EXTENT", "pixelsToTileUnits", "tile", "pixelValue", "tileSize", "pow", "tileID", "overscaledZ", "ensureError", "String", "mod", "n", "lerp", "mix", "easeCubicInOut", "t2", "t3", "bezier", "defaultEasing", "clamp", "min", "max", "wrap", "d", "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", "frame", "timestamp", "format", "startsWith", "swapBR", "Uint8ClampedArray", "copyTo", "destRowOffset", "offset", "stride", "sourceLeft", "sourceTop", "rect", "layout", "tmp", "close", "offscreenCanvas", "offscreenCanvasContext", "subscribe", "target", "listener", "options", "addEventListener", "unsubscribe", "removeEventListener", "degreesToRadians", "degrees", "radiansToDegrees", "touchableEvents", "touchstart", "touchmove", "touchmoveWindow", "touchend", "touchcancel", "pointableEvents", "dblclick", "click", "mouseover", "mouseout", "mousedown", "mousemove", "mousemoveWindow", "mouseup", "mouseupWindow", "contextmenu", "wheel", "ABORT_ERROR", "AbortError", "messageOrError", "super", "name", "stack", "isAbortError", "error", "throwIfAborted", "signal", "aborted", "reason", "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", "status", "statusText", "body", "getReferrer", "_a", "worker", "referrer", "window", "location", "protocol", "parent", "href", "makeRequest", "requestParameters", "abortController", "includes", "test", "protocolLoadFn", "response", "type", "ArrayBuffer", "actor", "sendAsync", "targetMapId", "fetch", "Request", "AbortController", "Object", "hasOwn", "request", "method", "credentials", "headers", "cache", "referrerPolicy", "parsePromise", "has", "set", "Blob", "ok", "blob", "arrayBuffer", "json", "text", "cacheControl", "get", "expires", "etag", "_b", "mustQueue", "xhr", "XMLHttpRequest", "open", "responseType", "setRequestHeader", "Accept", "withCredentials", "onerror", "onload", "JSON", "parse", "err", "getResponseHeader", "abort", "send", "sameOrigin", "inComingUrl", "urlObj", "URL", "locationObj", "host", "_addEventListener", "listenerList", "push", "_removeEventListener", "index", "splice", "Event", "ErrorEvent", "Evented", "_listeners", "off", "_oneTimeListeners", "once", "event", "properties", "listens", "listeners", "slice", "oneTimeListeners", "_eventedParent", "_eventedParentData", "fire", "_d", "_c", "_e", "v8Spec", "$version", "$root", "version", "required", "values", "metadata", "center", "centerAltitude", "zoom", "bearing", "default", "period", "units", "pitch", "roll", "state", "light", "sky", "projection", "terrain", "sprite", "glyphs", "transition", "layers", "source", "source_vector", "vector", "tiles", "bounds", "scheme", "xyz", "tms", "minzoom", "maxzoom", "attribution", "promoteId", "volatile", "encoding", "mvt", "mlt", "source_raster", "raster", "source_raster_dem", "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", "expression", "interpolated", "parameters", "layout_fill", "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", "exponential", "interval", "categorical", "colorSpace", "rgb", "lab", "hcl", "function_stop", "anchor", "position", "color", "intensity", "exaggeration", "paint_fill", "paint_line", "paint_circle", "paint_heatmap", "paint_symbol", "overridable", "paint_raster", "resampling", "linear", "nearest", "paint_hillshade", "standard", "basic", "combined", "igor", "multidirectional", "paint_background", "duration", "delay", "constant", "interpolation", "interpolation_name", "syntax", "overloads", "refProperties", "deref", "forEach", "deepEqual", "keys", "addCommand", "commands", "command", "addSource", "sourceId", "after", "args", "removeSource", "sourcesRemoved", "updateSource", "canUpdateGeoJSON", "before", "prop", "hasOwnProperty", "diffLayerPropertyChanges", "layerId", "klass", "pluckId", "indexById", "group", "ValidationError", "identifier", "__line__", "extendBy", "inputs", "ExpressionParsingError", "Scope", "bindings", "NullType", "kind", "NumberType", "StringType", "BooleanType", "ColorType", "ProjectionDefinitionType", "ObjectType", "ValueType", "CollatorType", "FormattedType", "PaddingType", "ColorArrayType", "NumberArrayType", "ResolvedImageType", "VariableAnchorOffsetCollectionType", "array", "itemType", "N", "typeToString", "valueMemberTypes", "checkSubtype", "expected", "memberType", "isValidType", "provided", "allowedTypes", "some", "isValidNativeType", "verifyType", "sample", "Xn", "Zn", "deg2rad", "rad2deg", "constrainAngle", "rgbToLab", "r", "g", "alpha", "xyz2lab", "rgb2xyz", "l", "labToRgb", "isNaN", "lab2xyz", "xyz2rgb", "object", "getOwn", "parseHex", "hex", "parseInt", "padEnd", "parseAlpha", "asPercentage", "validateNumbers", "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", "interpolateNumber", "from", "to", "interpolateArray", "Color", "premultiplied", "overwriteGetter", "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", "spaceKey", "hue0", "chroma0", "light0", "alphaF", "hue1", "chroma1", "light1", "alphaT", "hue", "chroma", "dh", "transparent", "Collator", "caseSensitive", "diacriticSensitive", "locale", "sensitivity", "collator", "Intl", "usage", "lhs", "rhs", "compare", "resolvedLocale", "resolvedOptions", "VERTICAL_ALIGN_OPTIONS", "FormattedSection", "fontStack", "textColor", "verticalAlign", "Formatted", "sections", "unformatted", "isEmpty", "section", "fromString", "Padding", "val", "stringify", "NumberArray", "ColorArray", "parsed_val", "colors", "interpolate", "RuntimeError", "toJSON", "anchors", "Set", "VariableAnchorOffsetCollection", "anchorValue", "offsetValue", "toValues", "fx", "fy", "tx", "ty", "ResolvedImage", "available", "ProjectionDefinition", "validateRGBA", "isValue", "mixed", "item", "typeOf", "valueToString", "Literal", "expectedType", "evaluate", "eachChild", "outputDefined", "types$1", "string", "number", "boolean", "Assertion", "parsed", "ctx", "fn", "every", "arg", "types", "Coercion", "Boolean", "parseColor", "pad", "coll", "num", "geometryTypes", "EvaluationContext", "globals", "feature", "featureState", "formattedSection", "_parseColorCache", "Map", "availableImages", "canonical", "geometryType", "geometry", "canonicalID", "cached", "ParsingContext", "registry", "isConstantFunc", "path", "scope", "errors", "part", "_isConstant", "expr", "concat", "_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", "Case", "branches", "Slice", "beginIndex", "endIndex", "findStopLessThanOrEqualTo", "lastIndex", "currentValue", "nextValue", "lowerIndex", "upperIndex", "currentIndex", "Step", "labelKey", "valueKey", "stopCount", "getDefaultExportFromCjs", "__esModule", "hasRequiredUnitbezier", "unitbezierExports", "requireUnitbezier", "Interpolate", "operator", "lower", "upper", "exponentialInterpolation", "controlPoints", "rest", "interpolationFactor", "outputLower", "outputUpper", "lowerValue", "upperValue", "difference", "progress", "interpolateFactory", "padding", "numberArray", "colorArray", "variableAnchorOffsetCollection", "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", "undefined", "FormatExpression", "firstArg", "nextTokenMayBeObject", "font", "lastExpression", "content", "evaluatedContent", "ImageExpression", "evaluatedImageName", "Length", "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", "defaultCompare", "sd", "swap", "classifyRings", "maxRings", "ccw", "area", "calculateSignedArea", "compareAreas", "sum", "FE", "E2", "RAD", "CheapRuler", "lat", "coslat", "w2", "kx", "ky", "minX", "minY", "minI", "minT", "minDist", "sqDist", "deg", "compareDistPair", "getRangeSize", "range", "isRangeSafe", "threshold", "splitRange", "isLine", "size1", "getBBox", "coords", "getPolygonBBox", "isValidBBox", "bboxToBBoxDistance", "ruler", "distance", "pointToLineDistance", "nearestPoint", "pointOnLine", "segmentToSegmentDistance", "dist1", "dist2", "lineToLineDistance", "line1", "range1", "line2", "range2", "dist", "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", "GlobalState", "globalState", "expressions$1", "at", "case", "coalesce", "let", "literal", "var", "within", "CompoundExpression", "_evaluate", "definition", "definitions", "availableOverloads", "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", "zoomAndFeatureDependent", "zoomDependent", "parseFn", "stop", "innerFun", "evaluateExponentialFunction", "evaluateIntervalFunction", "evaluateCategoricalFunction", "evaluateIdentityFunction", "hashedStops", "categoricalKeyType", "featureFunctions", "zoomStops", "featureFunctionStops", "interpolationType", "bind", "coalesce$1", "keyType", "interp", "evaluatedLower", "evaluatedUpper", "register", "typeof", "heatmapDensity", "elevation", "lineProgress", "accumulated", "ln2", "LN2", "pi", "E", "log10", "LN10", "ln", "log2", "asin", "acos", "ceil", "isSupportedScript", "upcase", "toUpperCase", "downcase", "split", "delim", "StyleExpression", "_warningHistory", "_evaluator", "_defaultValue", "_enumValues", "_globalState", "addGlobalState", "isExpression", "createExpression", "parser", "enum", "formatted", "projectionDefinition", "resolvedImage", "ZoomConstantExpression", "_styleExpression", "isStateDependent", "globalStateRefs", "findGlobalStateRefs", "evaluateWithoutErrorHandling", "ZoomDependentExpression", "createPropertyExpression", "expressionInput", "isFeatureConstantResult", "isZoomConstant", "zoomCurve", "findZoomCurve", "StylePropertyFunction", "specification", "_parameters", "_specification", "serialized", "childResult", "results", "childExpression", "isExpressionFilter", "filterSpec", "featureFilter", "needGeometry", "getGlobalStateRefs", "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", "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", "validateColor", "validateEnum", "validateFilter", "validateNonExpressionFilter", "validateProperty", "layerSpec", "layerType", "transitionMatch", "tokenMatch", "exec", "validatePaintProperty", "validateLayoutProperty", "validateLayer", "ref", "otherLayer", "sourceType", "validateString", "validateSource", "replace", "sourceName", "rasterDEM", "rasterDEMSpec", "rootType", "isCustomEncoding", "customEncodingKeys", "encodingName", "mapExpr", "reduceExpr", "validateLight", "lightSpec", "validateSky", "skySpec", "validateTerrain", "terrainSpec", "validateSprite", "allSpriteIds", "allSpriteURLs", "isObjectLiteral", "anything", "validateState", "VALIDATORS", "projectionSpec", "fontFaces", "fontName", "fontValue", "fontValueType", "fontFaceSpec", "fontFace", "entries", "validate", "validateGlyphsUrl", "validateStyleMin", "sortErrors", "injectValidateSpec", "validator", "assign", "wrapCleanErrors", "inner", "paintProperty", "layoutProperty", "visibilitySpec", "VisibilityExpressionClass", "setValue", "_literalValue", "_compiledValue", "_globalStateRefs", "v8", "validateStyle", "emitValidationErrors", "emitter", "hasErrors", "TransferableGridIndex", "extent", "cells", "Int32Array", "start", "end", "subarray", "bboxesOffset", "bboxes", "insert", "_insertReadonly", "uid", "_forEachCell", "_insertCell", "cellIndex", "intersectionTest", "_queryCell", "seenUids", "cell", "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", "now", "floorZ", "lastIntegerZoom", "lastIntegerZoomTime", "lastZoom", "lastFloorZoom", "codePointAllowsIdeographicBreaking", "codePoint", "fromCodePoint", "codePointHasUprightVerticalOrientation", "charIsWhitespace", "char", "allowsVerticalWritingMode", "chars", "codePointAt", "allowsLetterSpacing", "charAllowsLetterSpacing", "sanitizedRegExpFromScriptCodes", "scriptCodes", "supportedPropertyEscapes", "code", "pe", "cursiveScriptRegExp", "charHasRotatedVerticalOrientation", "rtlScriptRegExp", "charInRTLScript", "charInSupportedScript", "canRenderRTL", "stringContainsRTLText", "rtlWorkerPlugin", "TIMEOUT", "applyArabicShaping", "processBidirectionalText", "processStyledBidirectionalText", "pluginStatus", "pluginURL", "loadScriptResolve", "getState", "rtlTextPlugin", "isParsed", "getRTLTextPluginStatus", "incomingState", "importScripts", "setState", "urlToLoad", "loadScriptPromise", "dontWaitForeverTimeoutPromise", "setTimeout", "race", "loadedState", "EvaluationParameters", "fadeDuration", "zoomHistory", "crossFadingFactor", "getCrossfadeParameters", "fraction", "fromScale", "toScale", "TRANSITION_SUFFIX", "PropertyValue", "normalizePropertyExpression", "isDataDriven", "possiblyEvaluate", "TransitionablePropertyValue", "prior", "TransitioningPropertyValue", "untransitioned", "Transitionable", "_properties", "_values", "defaultTransitionablePropertyValues", "getValue", "getTransition", "Transitioning", "transitioned", "begin", "finalValue", "defaultTransitioningPropertyValues", "PossiblyEvaluated", "hasTransition", "Layout", "defaultPropertyValues", "PossiblyEvaluatedPropertyValue", "isConstant", "defaultPossiblyEvaluatedValues", "DataConstantProperty", "interpolationFn", "interpolates", "DataDrivenProperty", "overrides", "interpolatedValue", "CrossFadedDataDrivenProperty", "evaluatedValue", "constantValue", "_calculate", "cameraVal", "mid", "CrossFadedProperty", "ColorRampProperty", "Properties", "overridableProperties", "defaultPropertyValue", "defaultTransitionablePropertyValue", "ERROR_PAINT_NOT_LAYOUT", "ERROR_LAYOUT_NOT_PAINT", "StyleLayer", "_featureFilter", "_visibilityExpression", "sourceLayer", "_unevaluatedLayout", "_transitionablePaint", "setPaintProperty", "setLayoutProperty", "_transitioningPaint", "_crossfadeParameters", "hasProperty", "getLayoutAffectingGlobalStateRefs", "globalStateRef", "propertyName", "getPaintAffectingGlobalStateRefs", "globalThis", "getVisibilityAffectingGlobalStateRefs", "recalculateVisibility", "_validate", "endsWith", "baseName", "setTransition", "transitionable", "isCrossFadedProperty", "wasDataDriven", "oldValue", "_handleSpecialPaintPropertyUpdate", "newValue", "_handleOverridablePaintPropertyUpdate", "roundMinZoom", "_evaluatedVisibility", "is3D", "isTileClipped", "hasOffscreenPass", "resize", "properties$9", "RasterStyleLayer", "viewTypes", "Int8", "Int8Array", "Uint8", "Uint8Array", "Int16", "Int16Array", "Uint16", "Uint16Array", "Int32", "Uint32", "Uint32Array", "Float32", "Struct", "structArray", "_structArray", "_pos1", "_pos2", "_pos4", "_pos8", "StructArray", "isTransferred", "capacity", "_trim", "byteLength", "bytesPerElement", "_refreshViews", "clear", "reserve", "oldUint8Array", "uint8", "freeBufferAfterUpload", "createLayout", "members", "alignment", "maxSize", "member", "typeSize", "BYTES_PER_ELEMENT", "memberOffset", "align", "components", "StructArrayLayout2i4", "int16", "v0", "emplace", "o2", "StructArrayLayout3i6", "StructArrayLayout4i8", "v3", "StructArrayLayout2i4i12", "v4", "v5", "StructArrayLayout2i4ub8", "o1", "StructArrayLayout2f8", "float32", "o4", "StructArrayLayout10ui20", "uint16", "v6", "v7", "v9", "StructArrayLayout8ui16", "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", "SymbolLineVertexArray", "TextAnchorOffsetStruct", "textAnchor", "textOffset0", "textOffset1", "TextAnchorOffsetArray", "FeatureIndexStruct", "FeatureIndexArray", "PosArray", "CircleLayoutArray", "FillLayoutArray", "FillExtrusionLayoutArray", "LineLayoutArray", "LineExtLayoutArray", "PatternLayoutArray", "DashLayoutArray", "SymbolLayoutArray", "SymbolDynamicLayoutArray", "SymbolOpacityArray", "CollisionBoxLayoutArray", "CollisionVertexArray", "TriangleIndexArray", "LineIndexArray", "SegmentVector", "segments", "_forceNewSegmentOnNextPrepare", "numVertices", "layoutVertexArray", "indexArray", "sortKey", "lastSegment", "MAX_VERTEX_ARRAY_LENGTH", "vertexLength", "createNewSegment", "vertexOffset", "primitiveOffset", "primitiveLength", "vaos", "prepareSegment", "forceNewSegmentOnNextPrepare", "destroy", "packUint8ToFloat", "patternAttributes", "dashAttributes", "murmur3", "exports", "seed", "remainder", "bytes", "h1", "h1b", "c1", "c2", "k1", "charCodeAt", "murmur2", "murmurhashJsModule", "FeaturePositionMap", "ids", "positions", "indexed", "getNumericId", "intId", "Float64Array", "numValue", "pivot", "Uniform", "gl", "Uniform1f", "uniform1f", "Uniform4f", "uniform4f", "UniformColor", "emptyMat4", "packColor", "ConstantBinder", "names", "uniformNames", "uniform", "constantOr", "CrossFadedConstantBinder", "patternFrom", "patternTo", "pixelRatioFrom", "pixelRatioTo", "posTo", "posFrom", "pixelRatio", "tlbr", "dashTo", "dashFrom", "uniformName", "SourceExpressionBinder", "PaintVertexArray", "paintVertexAttributes", "paintVertexArray", "newLength", "_setPaintValue", "paintVertexBuffer", "updateData", "createVertexBuffer", "CompositeExpressionBinder", "useIntegerZoom", "minColor", "maxColor", "currentZoom", "factor", "CrossFadedBinder", "zoomInPaintVertexArray", "zoomOutPaintVertexArray", "_setPaintValues", "getPositionIds", "positionIds", "getPositions", "attributes", "getVertexAttributes", "zoomInPaintVertexBuffer", "zoomOutPaintVertexBuffer", "CrossFadedPatternBinder", "imagePositions", "patterns", "midPos", "minMaxPos", "CrossFadedDasharrayBinder", "dashPositions", "dashes", "ProgramConfiguration", "filterProperties", "binders", "_buffers", "paintAttributeNames", "propType", "isCrossFaded", "StructArrayLayout", "layoutType", "cacheKey", "binder", "populatePaintArray", "setConstantPatternPositions", "setConstantDashPositions", "featureStates", "featureMap", "vtLayer", "dirty", "updatePaintArray", "defines", "getBinderAttributes", "attribute", "getBinderUniforms", "uniforms", "getPaintVertexBuffers", "locations", "getBinding", "binderUniforms", "setUniform", "crossfade", "patternVertexBuffer", "upload", "updatePaintBuffers", "ProgramConfigurationSet", "programConfigurations", "needsUpload", "_featureMap", "_bufferOffset", "populatePaintArrays", "updatePaintArrays", "binderType", "defaultLayouts", "composite", "layoutException", "MAX", "BITS", "MIN", "loadGeometry", "toEvaluationFeature", "VERTEX_MIN_VALUE", "addCircleVertex", "extrudeX", "extrudeY", "emplaceBack", "CircleBucket", "overscaling", "layerIds", "hasDependencies", "stateDependentLayerIds", "styleLayer", "bucketFeatures", "circleSortKey", "sortFeaturesByKey", "subdivide", "circleStyle", "granularity", "subdivisionGranularity", "evaluationFeature", "bucketFeature", "addFeature", "states", "stateDependentLayers", "uploadPending", "uploaded", "layoutVertexBuffer", "layoutAttributes", "indexBuffer", "createIndexBuffer", "extrudes", "verticesPerAxis", "vx", "vy", "polygonIntersectsPolygon", "polygonA", "polygonB", "polygonContainsPoint", "lineIntersectsLine", "polygonIntersectsBufferedPoint", "radius", "pointIntersectsBufferedLine", "polygonIntersectsMultiPolygon", "multiPolygon", "multiPolygonContainsPoint", "lineIntersectsBufferedLine", "lineA", "lineB", "a0", "a1", "lineSegmentIntersectsLineSegment", "b0", "b1", "radiusSquared", "distToSegmentSquared", "l2", "sub", "currentRing", "edgeIntersectsBox", "e1", "e2", "corners", "tl", "br", "dir", "getMaximumPaintValue", "bucket", "getMaxValue", "translateDistance", "translate", "queryGeometry", "translateAnchor", "pt", "translated", "_stripDuplicates", "filteredRing", "prevPoint", "equals", "intersectionTestMapMap", "intersectionTestMapViewport", "transform", "unwrappedTileID", "getElevation", "projectTileCoordinates", "signedDistanceFromCamera", "cameraToCenterDistance", "intersectionTestViewportMap", "adjustedSize", "projectPoint", "intersectionTestViewportViewport", "circleIntersection", "pitchAlignment", "pitchScale", "param", "tilePoint", "clipPoint", "properties$8", "CircleStyleLayer", "circleBucket", "queryIntersectsFeature", "translatedPolygon", "bearingInRadians", "transformedPolygon", "transformedSize", "HeatmapBucket", "properties$7", "createImage", "channels", "RangeError", "resizeImage", "newImage", "copyImage", "srcImg", "dstImg", "srcPt", "dstPt", "srcData", "dstData", "srcOffset", "dstOffset", "AlphaImage", "RGBAImage", "copy", "row", "col", "rLocation", "premultiplyAlpha", "renderColorRamp", "evaluationGlobals", "resolution", "clips", "renderPixel", "evaluationKey", "pxColor", "setPixel", "clip", "HEATMAP_FULL_RENDER_FBO_KEY", "HeatmapStyleLayer", "heatmapFbos", "_updateColorRamp", "colorRamp", "colorRampTexture", "delete", "isHidden", "properties$6", "HillshadeStyleLayer", "recalculate", "getIlluminationProperties", "direction", "altitude", "highlightColor", "shadowColor", "numIlluminationSources", "altitudeRadians", "directionRadians", "properties$5", "hasDataProperty", "Texture", "texture", "createTexture", "_ownedHandle", "update", "useMipmap", "bindTexture", "TEXTURE_2D", "pixelStoreUnpackFlipY", "pixelStoreUnpack", "wantPremultiply", "RGBA", "premultiply", "pixelStoreUnpackPremultiplyAlpha", "_uploadRawData", "_uploadDomImage", "_updateRawData", "_updateDomImage", "isSizePowerOfTwo", "generateMipmap", "setDefault", "texImage2D", "UNSIGNED_BYTE", "texSubImage2D", "minFilter", "LINEAR_MIPMAP_NEAREST", "LINEAR", "texParameteri", "TEXTURE_MAG_FILTER", "TEXTURE_MIN_FILTER", "TEXTURE_WRAP_S", "TEXTURE_WRAP_T", "deleteTexture", "DEMData", "dim", "_idx", "MIN_SAFE_INTEGER", "ele", "pixels", "unpack", "getUnpackVector", "packDEMData", "getPixels", "borderTile", "xMin", "xMax", "yMin", "yMax", "ox", "oy", "unpackVector", "minScale", "vScaled", "ColorReliefStyleLayer", "maxLength", "elevationStops", "colorStops", "colorRampExpression", "interpolater", "remappedColorRamp", "remapStepSize", "_colorRampChanged", "colorRampTextures", "_createColorRamp", "colorImage", "elevationImage", "elevationPacked", "elevationTexture", "colorTexture", "hasPattern", "patternDependencies", "patternProperty", "constantPattern", "addPatternDependencies", "patternFeature", "patternPropertyValue", "linkedList", "clockwise", "last", "insertNode", "removeNode", "filterPoints", "again", "steiner", "prev", "earcutLinked", "ear", "triangles", "invSize", "pass", "zOrder", "prevZ", "nextZ", "list", "numMerges", "inSize", "tail", "q", "pSize", "qSize", "isEarHashed", "isEar", "cureLocalIntersections", "splitEarcut", "x0", "y0", "pointInTriangleExceptFirst", "minZ", "maxZ", "intersects", "locallyInside", "isValidDiagonal", "splitPolygon", "compareXYSlope", "eliminateHole", "hole", "outerNode", "bridge", "hx", "hy", "qx", "mx", "my", "tanMin", "pointInTriangle", "sectorContainsSector", "bridgeReverse", "getLeftmost", "leftmost", "px", "py", "sign", "o3", "onSegment", "a2", "createNode", "b2", "an", "SubdivisionGranularityExpression", "baseZoomGranularity", "minGranularity", "_baseZoomGranularity", "_minGranularity", "zoomLevel", "SubdivisionGranularitySetting", "stencil", "noSubdivision", "NORTH_POLE_Y", "SOUTH_POLE_Y", "Subdivider", "_vertexBuffer", "_vertexDictionary", "_used", "_granularity", "_granularityCellSize", "_canonical", "xInt", "yInt", "_getKey", "inputIndices", "flattened", "indices", "corrected", "i0", "i1", "i2", "v0x", "v0y", "finalIndices", "numIndices", "primitiveIndex", "triangleIndices", "triangleVertices", "maxX", "maxY", "cellXmin", "cellXmax", "cellYmin", "cellYmax", "cellRow", "_scanlineGenerateVertexRingForCellRow", "scanlineTriangulateVertexRing", "cellRowYTop", "cellRowYBottom", "edgeIndex", "aX", "aY", "bX", "bY", "cX", "cY", "dirX", "dirY", "isParallelY", "isParallelX", "tTop", "tBottom", "tEnter", "tExit", "_vertexToIndex", "enterX", "exitX", "_generateIntraEdgeVertices", "_generateInterEdgeVertices", "leftX", "rightX", "edgeSubdivisionLeftCellX", "edgeSubdivisionRightCellX", "cellX", "dir2X", "dir2Y", "t2Top", "t2Bottom", "t2Enter", "t2Exit", "enter2X", "boundarySubdivisionLeftCellX", "boundarySubdivisionRightCellX", "isBoundaryLeftToRight", "isParallelX2", "dir3Y", "enter3X", "boundaryY", "subdividedLines", "subdivideVertexLine", "pathIndices", "_pointArrayToIndices", "lineIndices", "subdividedTriangles", "north", "south", "_fillPoles", "_ensureNoPoleVertices", "v1x", "poleY", "southEdge", "v1y", "v2x", "v2y", "_generatePoleQuad", "generateOutlineLines", "holeIndices", "vertex", "_initializeVertices", "earcutResult", "hasHoles", "outerLen", "queue", "cut", "_convertIndices", "_subdivideTrianglesScanline", "_generateOutline", "_handlePoles", "verticesFlattened", "indicesTriangles", "indicesLineList", "vertices", "oldIndices", "newIndices", "oldIndex", "subdividePolygon", "subdividePolygonInternal", "linePoints", "isRing", "addLastToFirstSegment", "cellSize", "finalLineVertices", "totalPoints", "pointIndex", "linePoint0", "linePoint1", "lineVertex0x", "lineVertex0y", "lineVertex1x", "lineVertex1y", "dirXnonZero", "dirYnonZero", "absDirX", "absDirY", "lastPointX", "lastPointY", "nextBoundaryX", "nextBoundaryY", "axisDistanceToBoundaryX", "axisDistanceToBoundaryY", "axisDistanceToEndX", "axisDistanceToEndY", "realDistanceToBoundaryX", "POSITIVE_INFINITY", "realDistanceToBoundaryY", "vertexBuffer", "leftmostIndex", "leftmostX", "ringVertexLength", "lastEdgeA", "lastEdgeB", "candidateIndexA", "candidateIndexB", "candidateAx", "candidateBx", "lastEdgeAx", "lastEdgeAy", "lastEdgeBy", "pickA", "nx", "ny", "fillLargeMeshArrays", "addVertex", "segmentsTriangles", "vertexArray", "triangleIndexArray", "segmentsLines", "lineIndexArray", "lineList", "hasLines", "triangleSegment", "triangleIndex", "lineIndicesStart", "lineSegment", "actualVertexIndices", "totalVerticesCreated", "count", "currentSegmentCutoff", "getOrCreateLatestSegment", "baseVertex", "primitiveEndIndex", "i0needsVertexCopy", "i1needsVertexCopy", "i2needsVertexCopy", "actualIndex0", "copyOrReuseVertex", "actualIndex1", "actualIndex2", "currentLine", "lineVertex", "needsCopy", "newIndex", "FillBucket", "patternFeatures", "indexArray2", "segments2", "fillSortKey", "indexBuffer2", "subdivided", "getGranularityForZoomLevel", "properties$4", "FillStyleLayer", "outlineColor", "queryRadius", "centroidAttributes", "VectorTileFeature", "pbf", "_pbf", "_geometry", "_keys", "readFields", "readFeature", "readVarint", "lines", "cmd", "cmdLen", "readSVarint", "vtCoords", "projectLine", "tag", "signedArea", "VectorTileLayer", "_features", "readLayer", "readString", "readFloat", "readDouble", "readVarint64", "readBoolean", "VectorTile", "readTile", "FACTOR", "nz", "FillExtrusionBucket", "centroidVertexArray", "centroidVertexBuffer", "centroid", "sampleCount", "oldVertexCount", "processPolygon", "addedVertices", "centroidX", "centroidY", "isEntirelyOutside", "accumulatePointsToCentroid", "segmentReference", "isPolygon", "subdividedRing", "_generateSideFaces", "subdividedPolygon", "edgeDistance", "isBoundaryEdge", "bottomRight", "properties$3", "FillExtrusionStyleLayer", "pixelPosMatrix", "projectedQueryGeometry", "vec4.transformMat4", "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", "ARRAY_TYPES", "KDBush", "magic", "versionAndType", "ArrayType", "nodeSize", "numItems", "IndexArrayType", "arrayTypeIndex", "coordsByteSize", "idsByteSize", "padCoords", "_pos", "_finished", "finish", "numAdded", "axis", "qy", "r2", "select", "swapItem", "simplify", "sqTolerance", "maxSqDist", "minPosToMid", "getSqSegDist", "posToMid", "createFeature", "geom", "tags", "calcLineBBox", "optimizeLineMemory", "convertToInternal", "featureToInternal", "maxZoom", "projectX", "projectY", "convertLine", "convertLines", "polygonOut", "featureToGeoJSON", "geojsonFeature", "geometryToGeoJSON", "unprojectPoint", "unprojectPoints", "unprojectX", "unprojectY", "AxisType", "minAll", "maxAll", "clipped", "X", "clipPointFeature", "clipLineStringFeature", "clipMultiLineStringFeature", "clipPolygonFeature", "clipMultiPolygonFeature", "newGeom", "addPoint", "clipLine", "clipLines", "newPolygon", "trackMetrics", "newSlice", "intersect", "intersectX", "intersectY", "segLen", "exited", "merged", "shiftFeatureCoords", "newFeatures", "newGeometry", "shiftPointCoords", "shiftLineCoords", "newCoords", "newLine", "getUpdatedFeatures", "vtFeatures", "changeGeometry", "changeProps", "removeAllProperties", "removeProperties", "addOrUpdateProperties", "vtFeature", "applyPropertyUpdates", "updated", "defaultClusterOptions", "minZoom", "minPoints", "reduce", "props", "ClusterTileIndex", "trees", "clusterProps", "lng", "createIndex", "_affected", "clusterOptions", "initialize", "time", "timerId", "fround", "tree", "createTree", "timeEnd", "getClustersInternal", "minLng", "minLat", "maxLng", "maxLat", "easternHem", "westernHem", "limitZoom", "flatData", "clusters", "getClusterFeature", "clusterId", "originId", "getOriginId", "originZoom", "getOriginZoom", "clusterError", "children", "getClusterGeoJSON", "limit", "leaves", "appendLeaves", "z2", "transformed", "addTileFeatures", "skipped", "getChildren", "point_count", "cluster_id", "isCluster", "getClusterProperties", "nextData", "neighborIds", "numPointsOrigin", "numPoints", "neighborId", "wx", "wy", "clusterPropIndex", "numPoints2", "original", "abbrev", "propIndex", "point_count_abbreviated", "GEOJSONVT_CLIP_START", "GEOJSONVT_CLIP_END", "createTile", "numSimplified", "numFeatures", "tileFeature", "addLine", "isOuter", "transformTile", "transformPointFeature", "transformNonPointFeature", "transformPoint", "nonPoint", "TileIndex", "total", "stats", "tileCoords", "splitTile", "debug", "affected", "invalidateTiles", "rootTile", "toID", "_clusterId", "_limit", "_offset", "z0", "indexMaxZoom", "indexMaxPoints", "zoomSteps", "k2", "k3", "k4", "bl", "tr", "Y", "removedLookup", "tileMinX", "tileMaxX", "tileMinY", "tileMaxY", "defaultOptions", "updateable", "lineLayoutAttributes", "lineLayoutAttributesExt", "COS_HALF_SHARP_CORNER", "MAX_LINE_DISTANCE", "LINE_DISTANCE_BUFFER_BITS", "LineBucket", "lineClipsArray", "gradients", "layoutVertexArray2", "maxLineLength", "hasLineDasharray", "lineSortKey", "addLineDashDependencies", "layoutVertexBuffer2", "layoutAttributesExt", "cap", "miterLimit", "roundLimit", "lineClips", "lineFeatureClips", "scaledDistance", "totalDistance", "updateScaledDistance", "sharpCornerOffset", "SHARP_CORNER_OFFSET", "currentVertex", "prevVertex", "nextVertex", "prevNormal", "nextNormal", "joinNormal", "cosAngle", "cosHalfAngle", "miterLength", "approxAngle", "isSharpCorner", "lineTurnsLeft", "prevSegmentLength", "newPrevVertex", "updateDistance", "addCurrentVertex", "middleVertex", "currentJoin", "mult", "bevelLength", "offsetA", "offsetB", "extrude", "addHalfVertex", "nextSegmentLength", "newCurrentVertex", "normal", "endLeft", "endRight", "rightY", "up", "linesofarScaled", "dasharrayProperty", "dasharray", "minKey", "midKey", "maxKey", "dashDependencies", "properties$2", "LineFloorwidthProperty", "lineFloorwidthProperty", "LineStyleLayer", "gradientVersion", "gradientExpression", "stepInterpolant", "lineBucket", "getLineWidth", "halfWidth", "lineOffset", "newRings", "rawRing", "newRing", "nextPoint", "unitNormalAB", "unitNormalBC", "bisectorDir", "multiLine", "lineWidth", "lineGapWidth", "symbolLayoutAttributes", "dynamicLayoutAttributes", "collisionVertexAttributes", "collisionBoxLayout", "collisionCircleLayout", "transformTextInternal", "toLocaleUpperCase", "toLocaleLowerCase", "transformText", "ONE_EM", "verticalizedCharacterMap", "$", "breakable", "breakableBefore", "getGlyphAdvance", "glyphMap", "spacing", "layoutTextSize", "glyph", "metrics", "advance", "imagePosition", "imageName", "displaySize", "calculateBadness", "targetWidth", "penalty", "isLastBreak", "raggedness", "calculatePenalty", "nextCodePoint", "penalizableIdeographicBreak", "evaluateBreak", "breakIndex", "breakX", "potentialBreaks", "bestPriorBreak", "bestBreakBadness", "potentialBreak", "breakBadness", "badness", "priorBreak", "leastBadBreaks", "lastLineBreak", "TaggedString", "sectionIndex", "imageSectionID", "defaultFontStack", "addImageSection", "addTextSection", "verticalizePunctuation", "prevChar", "premature", "Symbol", "nextChars", "nextChar", "hasZeroWidthSpaces", "leadingWhitespace", "leadingLength", "trailingWhitespace", "trailingLength", "unicodeIndex", "getMaxScale", "maxImageWidth", "maxImageHeight", "getSection", "nextImageSectionCharCode", "getNextImageSectionCharCode", "fromCharCode", "maxWidth", "potentialLineBreaks", "determineAverageLineWidth", "currentX", "nextNextChars", "nextNextChar", "ideographicBreak", "totalWidth", "SHIFT_LEFT_32", "SHIFT_RIGHT_32", "utf8TextDecoder", "TextDecoder", "Pbf", "buf", "dataView", "DataView", "readField", "startPos", "skip", "readFixed32", "getUint32", "readSFixed32", "getInt32", "readFixed64", "readSFixed64", "getFloat32", "getFloat64", "isSigned", "toNum", "decode", "b3", "bytesPerSequence", "readBytes", "readPackedEnd", "writeVarint", "realloc", "setInt32", "low", "high", "lsb", "lead", "makeRoomForExtraLength", "setFloat32", "setFloat64", "writeTag", "writeRawMessage", "writeMessage", "writePackedVarint", "writePackedSVarint", "writePackedBoolean", "writePackedFloat", "writePackedDouble", "writePackedFixed32", "writePackedSFixed32", "writePackedFixed64", "writePackedSFixed64", "writeBytes", "writeFixed32", "writeSFixed32", "writeFixed64", "writeSFixed64", "writeSVarint", "writeString", "writeFloat", "writeDouble", "writeVarintField", "extraLen", "writeBoolean", "readFontstacks", "readMessage", "readFontstack", "bitmap", "readGlyph", "potpack", "boxes", "box", "spaces", "space", "ImagePosition", "paddedRect", "stretchX", "stretchY", "textFitWidth", "textFitHeight", "IMAGE_PADDING", "ImageAtlas", "icons", "iconPositions", "patternPositions", "haveRenderCallbacks", "bins", "addImages", "bin", "images", "hasRenderCallback", "imageManager", "dispatchRenderCallbacks", "updatedImages", "patchUpdatedImage", "getImage", "WritingMode", "shapeText", "glyphPositions", "lineHeight", "textJustify", "allowVerticalPlacement", "layoutTextSizeThisZoom", "logicalInput", "fromFeature", "lineBreaks", "determineLineBreaks", "toCodeUnitIndex", "untaggedLines", "processedLines", "elapsedChars", "lineBreakPoints", "lineBreak", "positionedLines", "shaping", "iconsInText", "verticalizable", "maxLineHeight", "justify", "layoutTextSizeFactor", "lineIndex", "lineMaxScale", "positionedLine", "positionedGlyphs", "imageOffset", "lineShapingSize", "calculateLineContentSize", "isLineVertical", "positionedGlyph", "getSectionIndex", "sectionAttributes", "shapeTextSection", "shapeImageSection", "baselineOffset", "justifyLine", "currentLineHeight", "horizontalAlign", "getAnchorAlignment", "blockHeight", "lineCount", "shiftX", "shiftY", "maxGlyphSize", "getMaxImageSize", "horizontalLineContentHeight", "verticalLineContentWidth", "getVerticalAlignFactor", "rectAndMetrics", "glyphPosition", "verticalAlignFactor", "lastPositionedGlyph", "lineIndent", "shapeIcon", "iconOffset", "iconAnchor", "applyTextFit", "shapedIcon", "iconLeft", "iconTop", "iconWidth", "iconHeight", "contentAspectRatio", "newIconWidth", "newIconHeight", "fitIconToText", "shapedText", "textFit", "fontScale", "collisionPadding", "textLeft", "textRight", "textTop", "textBottom", "SIZE_PACK_FACTOR", "MAX_PACKED_SIZE", "MAX_GLYPH_ICON_SIZE", "getSizeData", "tileZoom", "layoutSize", "minSize", "getOverlapMode", "overlapProp", "allowOverlapProp", "overlap", "shaderOpacityAttributes", "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", "unevaluatedLayoutValues", "textSizeData", "iconSizeData", "canOverlap", "sortFeaturesByY", "writingModes", "wm", "sourceID", "createArrays", "icon", "glyphOffsetArray", "lineVertexArray", "symbolInstances", "textAnchorOffsets", "textAlongLine", "doesAllowVerticalWritingMode", "verticalChar", "textFont", "textField", "iconImage", "hasText", "hasIcon", "symbolSortKey", "iconDependencies", "stacks", "glyphDependencies", "resolvedTokens", "getValueAndResolveTokens", "factory", "sectionFont", "calculateGlyphDependencies", "leftIndex", "rightIndex", "mergedFeatures", "mergedIndex", "mergeFromRight", "leftKey", "rightKey", "mergeFromLeft", "onRight", "hasDebugData", "textCollisionBox", "iconCollisionBox", "destroyDebugData", "sumForwardLength", "sumBackwardLength", "tileUnitDistanceFromAnchor", "arrays", "quads", "alongLine", "labelAnchor", "glyphOffsetArrayStart", "tex", "pixelOffsetTL", "pixelOffsetBR", "glyphOffset", "boxAnchorPoint", "symbolInstance", "_addCollisionDebugVertex", "startIndex", "isText", "addCollisionDebugVertices", "generateCollisionDebugBuffers", "addDebugCollisionBoxes", "textStartIndex", "textEndIndex", "verticalTextStartIndex", "verticalTextEndIndex", "iconStartIndex", "iconEndIndex", "verticalIconStartIndex", "verticalIconEndIndex", "collisionArrays", "textBox", "textFeatureIndex", "verticalTextBox", "verticalTextFeatureIndex", "iconBox", "iconFeatureIndex", "verticalIconBox", "verticalIconFeatureIndex", "_deserializeCollisionBoxesForSymbol", "hasTextData", "hasIconData", "hasTextCollisionBoxData", "hasIconCollisionBoxData", "iconOrText", "placedSymbolIndex", "placedSymbol", "vertexIndex", "sortedAngle", "symbolInstanceIndexes", "rotatedYs", "featureIndexes", "aIndex", "bIndex", "symbolInstanceIndex", "symbolInstanceEnd", "symbolInstanceStart", "getSortedSymbolIndexes", "featureSortOrder", "textIndices", "addIndicesForPlacedSymbol", "MAX_GLYPHS", "properties$1", "runtimeType", "getOverride", "o", "hasOverride", "FormatSectionOverride", "defaultValue", "SymbolStyleLayer", "deduped", "_setPaintOverrides", "unevaluated", "hasPaintOverride", "overridden", "override", "styleExpression", "hasOverrides", "checkSections", "checkExpression", "BackgroundStyleLayer", "CustomStyleLayer", "implementation", "onAdd", "painter", "onRemove", "renderingMode", "prerender", "updateTransitions", "ThrottledInvoker", "methodToThrottle", "_methodToThrottle", "_triggered", "_channel", "MessageChannel", "port2", "onmessage", "trigger", "port1", "postMessage", "remove", "addEventDefaultOptions", "earthRadius", "LngLat", "toArray", "lngLat", "rad", "lat1", "lat2", "lon", "earthCircumference", "circumferenceAtLatitude", "latitude", "mercatorXfromLng", "mercatorYfromLat", "mercatorZfromAltitude", "lngFromMercatorX", "latFromMercatorY", "altitudeFromMercatorZ", "MercatorCoordinate", "lngLatLike", "toLngLat", "toAltitude", "meterInMercatorCoordinateUnits", "getMercCoords", "CanonicalTileID", "calculateTileKey", "quadkey", "mask", "dz", "UnwrappedTileID", "OverscaledTileID", "terrainRttPosMatrix32f", "targetZ", "zDifference", "isOverscaled", "withWrap", "sourceMaxZoom", "wrapped", "overscaleFactor", "toUnwrapped", "getTilePoint", "tileOffsetX", "tileOffsetY", "newX", "newY", "newCanonicalY", "newCanonicalX", "newWrap", "Bounds", "amount", "expandBy", "empty", "DictionaryCoder", "strings", "_stringToNumber", "_numberToString", "GeoJSONFeature", "vectorTileFeature", "_vectorTileFeature", "_x", "_y", "_z", "Vector", "_name", "dataBuffer", "sizeOrNullabilityBuffer", "_size", "nullabilityBuffer", "getValueFromBuffer", "FixedSizeVector", "Int32FlatVector", "DoubleFlatVector", "SequenceVector", "baseValueBuffer", "delta", "Int32SequenceVector", "baseValue", "of", "Int32ConstVector", "_index", "FeatureTable", "_geometryVector", "_idVector", "_propertyVectors", "_extent", "idVector", "geometryVector", "propertyVectors", "propertyVectorsMap", "numGeometries", "getFeatures", "getGeometries", "idValue", "containsMaxSafeIntegerValues", "propertyColumn", "columnName", "propertyValue", "IntWrapper", "increment", "LogicalLevelTechnique", "PhysicalLevelTechnique", "masks", "bitWidth", "MASKS", "BLOCK_SIZE", "greatestMultiple", "bswap32", "PAGE_SIZE", "aligned", "normalizePageSize", "BYTE_CONTAINER_SIZE", "createDecoderWorkspace", "byteContainer", "dataToBePacked", "MAX_BIT_WIDTH", "dataPointers", "byteContainerI32", "byteOffset", "exceptionSizes", "unpackBlock256", "inValues", "inPos", "outPos", "ip", "in0", "in1", "in2", "in3", "in4", "in5", "in6", "in7", "inputWordIndex", "bitOffset", "currentWord", "lowBits", "highBits", "readBlockHeader", "byteContainerLen", "bytePosIn", "block", "exceptionCount", "applyBlockExceptions", "blockOutPos", "workspace", "maxBits", "exceptionBitWidth", "afterHeaderPos", "exceptionValues", "exceptionPointers", "exPtr", "exSize", "decodePage", "thisSize", "pageStart", "whereMeta", "packedStart", "packedEnd", "byteSize", "metaInts", "byteContainerStart", "bitmapPos", "numFullInts", "intView", "lastVal", "inExcept", "roundedUp", "wordsNeeded", "exceptionStream", "fastUnpack32", "blocks", "tmpInPos", "run", "header", "in8", "in9", "in10", "in11", "in12", "in13", "in14", "in15", "valueMask", "decodeVarintInt32", "bufferOffset", "numValues", "dst", "decodeVarintInt64", "BigUint64Array", "decodeVarintInt64Value", "BigInt", "decodeVarintFloat64Value", "decodeZigZagInt32Value", "encoded", "decodeZigZagInt64Value", "decodeZigZagFloat64Value", "decodeUnsignedRleInt32", "encodedData", "numRuns", "numTotalValues", "decodedValues", "runLength", "decodeUnsignedRleInt64", "decodeUnsignedRleFloat64", "decodeZigZagDeltaInt32", "sz0", "data2", "data3", "data4", "decodeZigZagDeltaInt64", "BigInt64Array", "fastInverseDelta", "PhysicalStreamType", "DictionaryType", "OffsetType", "LengthType", "VectorType", "GEOMETRY_TYPE", "SINGLE_PART_GEOMETRY_TYPE", "VertexBufferType", "decodeStreamMetadata", "streamMetadata", "stream_type", "physicalStreamType", "logicalStreamType", "DATA", "dictionaryType", "OFFSET", "offsetType", "LENGTH", "lengthType", "encodings_header", "llt1", "llt2", "plt", "sizeInfo", "logicalLevelTechnique1", "logicalLevelTechnique2", "physicalLevelTechnique", "decompressedCount", "MORTON", "mortonInfo", "numBits", "coordinateShift", "RLE", "NONE", "rleInfo", "runs", "numRleValues", "BitVector", "byteIndex", "getBuffer", "unpackNullable", "dataStream", "presentBits", "counter", "decodeSignedInt32Stream", "scalingData", "DELTA", "rleMetadata", "previousValue", "COMPONENTWISE_DELTA", "decodedData", "decodePhysicalLevelTechnique", "decodeUnsignedInt32Stream", "decodeLengthStreamToOffsetBuffer", "deltaSum", "prevValue", "offsets", "FAST_PFOR", "encodedBytes", "expectedValueCount", "encodedByteLength", "inputByteOffset", "encodedWordCount", "encodedWordBuffer", "requiredWordCount", "encodedWords", "numCompleteInts", "hasTrailingBytes", "numInts", "absoluteOffset", "u32", "remaining", "decoded", "decoderWorkspace", "alignedLength", "outLength", "finalOut", "tmpOutPos", "inLength", "expectedCount", "wordIndex", "finalWordIndex", "outPos0", "targetOut", "accumulator", "accumulatorShift", "byte", "initialEncodedWordCapacity", "VARINT", "dataOffset", "decodeUnsignedConstInt32Stream", "decodeSequenceInt32Stream", "decodeSequenceInt64Stream", "decodeUnsignedInt64Stream", "asUintN", "decodeUnsignedConstInt64Stream", "getVectorType", "varintWidth", "CONST", "FLAT", "SEQUENCE", "savedOffset", "peekOffset", "Int64FlatVector", "Int64SequenceVector", "decodeZOrderCurve", "mortonCode", "decodeMorton", "coordinate", "decodeDictionaryEncodedLineStringOrRing", "vertexBufferType", "vertexOffsets", "closeLineString", "mortonSettings", "getLineStringOrRing", "GeometryVector", "_vertexBufferType", "_topologyVector", "_vertexOffsets", "_mortonSettings", "topologyVector", "partOffsetCounter", "ringOffsetsCounter", "geometryOffsetsCounter", "geometryCounter", "vertexBufferOffset", "vertexOffsetsOffset", "geometryOffsets", "partOffsets", "ringOffsets", "nonOffset", "containsPolygon", "containsPolygonGeometry", "POINT", "MULTIPOINT", "LINESTRING", "POLYGON", "numRings", "shell", "MULTILINESTRING", "numLineStrings", "lineStrings", "MULTIPOLYGON", "numPolygons", "numRingVertices", "ConstGeometryVector", "_numGeometries", "_geometryType", "containsSingleGeometryType", "FlatGeometryVector", "_geometryTypes", "GpuVector", "_triangleOffsets", "_indexBuffer", "triangleOffsets", "topology", "allRings", "createConstGpuVector", "ConstGpuVector", "createFlatGpuVector", "FlatGpuVector", "decodeGeometryColumn", "numStreams", "geometryTypeMetadata", "geometryStreamMetadata", "GEOMETRIES", "PARTS", "RINGS", "TRIANGLES", "VERTEX", "INDEX", "VEC_2", "geometryTypeVector", "geometryLengths", "partLengths", "ringLengths", "decodeRootLengthStream", "decodeLevel1LengthStream", "rootOffsetBuffer", "level1OffsetBuffer", "level2LengthBuffer", "level2BufferOffsets", "previousOffset", "level1OffsetBufferCounter", "level2OffsetBufferCounter", "level2LengthBufferCounter", "numParts", "level1LengthBuffer", "level1BufferOffsets", "level1LengthCounter", "rootLengthStream", "bufferId", "rootBufferOffsets", "rootLengthCounter", "isLineStringPresent", "level1BufferCounter", "level1LengthBufferCounter", "BooleanFlatVector", "dataVector", "FloatFlatVector", "Int64ConstVector", "decodeBooleanRle", "numBooleans", "numBytes", "valueOffset", "streamEndPos", "endValueOffset", "numLiterals", "dataStreamSize", "bitVector", "decodeString", "VariableSizeVector", "offsetBuffer", "StringFlatVector", "StringDictionaryVector", "dictionaryBuffer", "StringFsstDictionaryVector", "symbolOffsetBuffer", "symbolTableBuffer", "decodedDictionary", "symbolLengthBuffer", "offsetToLengthBuffer", "symbols", "symbolLengths", "compressedData", "symbolOffsets", "symbolLength", "symbolOffset", "lengthBuffer", "decodePropertyColumn", "columnMetadata", "propertyColumnNames", "column", "nullable", "presentStreamMetadata", "streamDataStart", "presentVector", "physicalType", "scalarColumn", "dataStreamMetadata", "vectorType", "isNullabilityBuffer", "constValue", "dictionaryLengthStream", "offsetStream", "dictionaryStream", "symbolLengthStream", "symbolTableStream", "plainLengthStream", "plainDataStream", "PRESENT", "presentData", "presentStream", "lengthStream", "DICTIONARY", "SYMBOL", "dictType", "FSST", "SINGLE", "SHARED", "sparseOffsetStream", "valueIndex", "_numFeatures", "encodedValues", "currentPos", "newOffset", "newBuf", "fb", "scalarType", "dictionaryOffsetBuffer", "dictionaryStreamDecoded", "childFields", "complexType", "stringDictionaryVectors", "childField", "scalarField", "offsetStreamMetadata", "decodeColumnType", "typeCode", "columnScope", "scalarCol", "longID", "complexCol", "columnTypeHasName", "columnTypeHasChildren", "hasStreamCount", "isGeometryColumn", "textDecoder", "view", "decodeField", "childCount", "complexField", "decodeColumn", "decodeEmbeddedTileSetMetadata", "meta", "table", "columnCount", "columns", "featureTables", "decodeIdColumn", "idDataStreamMetadata", "idWithinMaxSafeInteger", "scalarTypeMetadata", "logicalType", "idDataType", "MLTVectorTileFeature", "_featureData", "pointRing", "MLTVectorTileLayer", "featureTable", "MLTVectorTile", "geometryScaling", "blockLength", "blockEnd", "featureTableMetadata", "propertyVector", "acc", "FeatureWrapper", "rawGeo", "GEOJSON_TILE_LAYER_NAME", "writeLayer", "jsonPrefix", "writeStringField", "keycache", "valuecache", "writeFeature", "writeValue", "writeProperties", "writeGeometry", "keyIndex", "zigzag", "writeBooleanField", "writeDoubleField", "writeSVarintField", "FeatureIndex", "grid3D", "featureIndexArray", "loadVTLayers", "vtLayers", "Protobuf", "rawTileData", "sourceLayerCoder", "styleLayers", "serializedLayers", "sourceFeatureState", "queryPadding", "fromPoints", "matching", "query", "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", "layerResult", "symbolFeatureIndexes", "filterParams", "symbolFeatureIndex", "sourceLayerId", "serializedProperties", "styleLayerProperties", "clippedLines", "clippedLine", "p0", "clipGeometryOnAxis", "clipLineInternal", "intersectionPoint", "intersectionPointX", "intersectionPointY", "pos1", "pos2", "lastPos", "Anchor", "checkMaxAngle", "labelLength", "windowSize", "maxAngle", "anchorDistance", "recentCorners", "recentAngleDelta", "angleDelta", "angleTo", "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", "rotate", "boxStartIndex", "circleDiameter", "rotateRadians", "boxEndIndex", "findPoleOfInaccessibility", "polygonRings", "precision", "cellQueue", "Queue", "compareMax", "Cell", "centroidCell", "bestCell", "minDistSq", "SQRT2", "TextAnchorEnum", "INVALID_TEXT_OFFSET", "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", "addToLineVertexArray", "textCollisionFeature", "iconCollisionFeature", "verticalTextCollisionFeature", "verticalIconCollisionFeature", "placedTextSymbolIndices", "verticalTextRotation", "iconQuads", "verticalIconQuads", "sizeData", "compositeIconSizes", "addSymbols", "justifications", "justification", "textRotate", "singleLine", "addTextVertices", "horizontalOnly", "getCollisionCircleHeight", "prevHeight", "addToSortKeyRanges", "subdividedLine", "anchorIsTooClose", "poi", "placementTypes", "placedIconIndex", "glyphQuads", "textureRect", "rectBuffer", "GLYPH_PBF_BORDER", "rotateVerticalGlyph", "halfAdvance", "sdf", "builtInOffset", "verticalizedLabelOffset", "textureScale", "isDoubleResolution", "verticalRotation", "xHalfWidthOffsetCorrection", "halfWidthOffsetCorrection", "verticalOffsetCorrection", "compositeTextSizes", "placementType", "horizontalShaping", "repeatDistance", "compareText", "otherAnchors", "azimuthal", "polar", "userAgent", "navigator", "safari", "mapId", "resolveRejects", "tasks", "taskQueue", "abortControllers", "messageHandlers", "invoker", "process", "subscription", "receive", "globalScope", "handler", "random", "cancelMessage", "origin", "sourceMapId", "buffers", "messageToPost", "transfer", "SPECIAL_ORIGINS", "origins", "isSameOrigin", "hasSpecialOrigin", "processTask", "task", "resolveReject", "completeTask", "responseMessage", "a00", "a01", "a02", "a03", "a10", "a11", "a12", "a13", "a20", "a21", "a22", "a23", "a30", "a31", "a32", "a33", "aDeltaY", "aDeltaX", "bDeltaY", "bDeltaX", "denominator", "aInterpolation", "tlX", "tlY", "brX", "brY", "inViewportPixelUnitsUnits", "sinA", "cosA", "document", "createElement", "muted", "onloadstart", "crossOrigin", "appendChild", "$0", "$1", "$2", "$3", "maxAge", "L", "tileIDs", "edgeTiles", "aWrap", "bWrap", "reset", "removedData", "timeout", "clearTimeout", "expiryTimeout", "dataWrapper", "_getAndRemoveByKey", "dataIndex", "filterFn", "removed", "entry", "uSizeT", "uSize", "plane", "dotDirectionPlane", "qz", "qw", "vz", "tz", "plane0", "plane1", "plane2", "det", "cross12", "vec3.cross", "cross20", "cross01", "vec3.scale", "vec3.add", "degreesA", "degreesB", "diff1", "diff2", "vec1x", "vec1y", "vec2x", "vec2y", "length1", "length2", "radiansA", "radiansB", "styleKey", "removeOrAddSourceCommands", "beforeLayers", "beforeOrder", "afterOrder", "beforeIndex", "afterIndex", "tracker", "clean", "beforeLayer", "afterLayer", "insertBeforeLayerId", "lastIndexOf", "layerObject", "render", "uniform1i", "fovy", "aspect", "near", "far", "nf", "b00", "b01", "b02", "b03", "b04", "b05", "b06", "b07", "b08", "b09", "b10", "b11", "mat4.identity", "rotation", "quat.fromEuler", "omega", "cosom", "sinom", "scale0", "scale1", "aw", "bw", "glMatrix.EPSILON", "xx", "yx", "yy", "zx", "zy", "zz", "wz", "xAngle", "hypot", "oldRangeMin", "oldRangeMax", "newRangeMin", "newRangeMax", "uniformMatrix4fv", "uniform3f", "uniform2f", "lr", "bt", "uniform4fv", "uniform1fv", "eventType", "lnglat", "fromLngLat", "customProtocol", "loadFn", "cachedKeys", "groups", "iconsNeedLinear", "keepUpright", "textSize", "fontstack", "unformattedText", "spacingIfAllowed", "addVerticalShapingForPointLabelIfNeeded", "sdfIcons", "showCollisionBoxes", "clippedGeometry", "maxEntries", "oldestKey", "imgBitmap", "origWidth", "origHeight", "drawImage", "imgData", "clearRect", "a3", "a4", "a5", "a6", "a7", "a8", "a9", "a14", "a15", "b4", "b5", "b6", "b7", "b8", "b9", "b12", "b13", "b14", "b15", "zoomSnap", "inv", "lastPoint", "currentPoint", "pointVect", "vec2.fromValues", "lastPointVec", "domEvent", "targetWindow", "ownerDocument", "defaultView", "MouseEvent", "WheelEvent", "initializeIndex", "tileIndex", "getTile", "diff", "dataDiff", "removeAll", "removeFeatures", "removeIds", "addFeatures", "oldFeaturesMap", "keepFeatures", "oldFeatures", "updatedFeatures", "filterUpdate", "updateIndex", "predicate", "getData", "wasCluster", "getClusterExpansionZoom", "getLeaves", "img", "Image", "revokeObjectURL", "requestAnimationFrame", "createObjectURL", "StyleLayerIndex", "layerConfigs", "keyCache", "_layerConfigs", "_layers", "removedIds", "layerConfig", "createStyleLayer", "familiesBySource", "groupByLayout", "sourceGroup", "sourceLayerFamilies", "GlyphAtlas", "stackPositions", "WorkerTile", "collectResourceTiming", "returnDependencies", "inFlightDependencies", "layerIndex", "buckets", "layerFamilies", "encode", "family", "recalculateLayers", "createBucket", "populate", "getGlyphsPromise", "getIconsPromise", "getPatternsPromise", "getDashesPromise", "iconMap", "patternMap", "glyphAtlas", "imageAtlas", "performSymbolLayout", "glyphAtlasImage", "WorkerTileState", "loading", "loaded", "parsing", "clearLoaded", "RequestPerformance", "measure", "performance", "mark", "resourceTimingData", "getEntriesByName", "clearMarks", "clearMeasures", "VectorTileFeatureOverzoomed", "pointsArray", "VectorTileLayerOverzoomed", "layerName", "_myFeatures", "VectorTileOverzoomed", "toVirtualVectorTile", "virtualVectorTile", "fromVectorTileJs", "vectorTile", "rawData", "sliceVectorTileLayer", "maxZoomTileID", "targetTileID", "featureWrappers", "clipGeometry", "VectorTileWorkerSource", "tileState", "overzoomedTileResultCache", "BoundedLRUCache", "ex", "errorMessage", "overzoomParameters", "overzoomRequest", "timing", "_startRequestTiming", "workerTile", "startLoading", "tileResponse", "getArrayBuffer", "finishLoading", "_getEtagUnmodifiedResult", "tileResult", "loadVectorTile", "_getOverzoomTile", "_getExpiryData", "resourceTiming", "_finishRequestTiming", "markLoaded", "parseState", "setParsing", "_parseWorkerTile", "clearParsing", "etagUnmodified", "timingData", "maxZoomVectorTile", "cachedOverzoomTile", "overzoomedVectorTile", "slicedTileLayer", "addLayer", "overzoomedVectorTileResult", "getLoaded", "consumeParsing", "removeLoaded", "RasterDEMTileWorkerSource", "rawImageData", "imagePixels", "dem", "GeoJSONWorkerSource", "createGeoJSONIndexFunc", "createGeoJSONIndex", "_createGeoJSONIndex", "_geoJSONIndex", "geoJSONTile", "GeoJSONWrapper", "loadResult", "_pendingRequest", "loadAndProcessGeoJSON", "abandoned", "_reloadLoadedTile", "loadTile", "getJSON", "_filterGeoJSON", "_getFilterPredicate", "updateCluster", "updateClusterOptions", "geojsonVtOptions", "getSuperclusterOptions", "_params", "getClusterChildren", "getClusterLeaves", "GeoJSONVT", "mapExpressions", "reduceExpressions", "propertyNames", "mapExpression", "mapExpressionParsed", "reduceExpressionParsed", "pointProperties", "Worker", "Actor", "layerIndexes", "workerSources", "demWorkerSources", "externalWorkerSourceTypes", "globalStates", "registerWorkerSource", "WorkerSource", "addProtocol", "removeProtocol", "registerRTLTextPlugin", "setMethods", "registerMessageHandler", "_getDEMWorkerSource", "removeTile", "_getWorkerSource", "loadData", "reloadTile", "abortTile", "_mapId", "_syncRTLPluginState", "_setImages", "_getLayerIndex", "_getGlobalState", "workerSource", "ws", "syncState", "_getAvailableImages", "linkEl", "reducedMotionQuery", "reducedMotionOverride", "browser", "win", "frameId", "paintStartTimestamp", "cancelAnimationFrame", "getImageCanvasContext", "canvas", "resolveURL", "hardwareConcurrency", "prefersReducedMotion", "matchMedia", "matches", "timeManager", "_frozenAt", "getCurrentTime", "restoreNow", "isFrozen", "ImageRequest", "DOM", "tagName", "className", "container", "el", "namespaceURI", "createElementNS", "disableDrag", "docStyle", "selectProp", "userSelect", "enableDrag", "preventDefault", "stopPropagation", "suppressClickInternal", "suppressClick", "element", "getBoundingClientRect", "offsetWidth", "offsetHeight", "boundingClientRect", "clientX", "clientLeft", "clientY", "clientTop", "getScale", "getPoint", "touches", "touch", "html", "DOMParser", "parseFromString", "scripts", "querySelectorAll", "script", "innerHTML", "nodes", "node", "removeAttributes", "elem", "isPossiblyDangerous", "removeAttribute", "documentElement", "imageRequestQueue", "currentParallelImageRequests", "throttleControlCallbackHandleCounter", "throttleControlCallbacks", "resetRequestQueue", "addThrottleControl", "callback", "handle", "removeThrottleControl", "callbackHandle", "processQueue", "supportImageRefresh", "accept", "onError", "onSuccess", "doImageRequest", "itemInQueue", "canUseHTMLImageElement", "getImagePromise", "getImageUsingHtmlImage", "HTMLImageElement", "arrayBufferToImageBitmap", "arrayBufferToImage", "maxImageRequests", "numImageRequests", "topItemInQueue", "fetchPriority", "RequestManager", "transformRequestFn", "_transformRequestFn", "transformRequest", "coerceSpriteToArray", "resultArray", "dedupArray", "normalizeSpriteURL", "extension", "pathname", "renderStyleImage", "userImage", "ImageManager", "callbackDispatchedThisFrame", "requestors", "atlasImage", "atlasTexture", "removeImage", "isLoaded", "promiseResolve", "_getImagesForIds", "spriteData", "valid", "_validateStretch", "_validateContent", "oldImage", "listImages", "_reject", "hasAllDependencies", "getPixelSize", "pattern", "_updatePatternAtlas", "CLAMP_TO_EDGE", "beginFrame", "updateImage", "cloneImages", "clonedImages", "INF", "alphaTable", "edt", "gridSize", "edt1d", "qr", "defaultStack", "GlyphManager", "requestManager", "localIdeographFontFamily", "lang", "glyphsPromises", "_getAndCacheGlyphsPromise", "updatedGlyphs", "requests", "_charUsesLocalIdeographFontFamily", "_drawGlyph", "_downloadAndCacheRangePromise", "loadGlyphRange", "_warnOnMissingGlyphRange", "padStart", "codePointUsesLocalIdeographFontFamily", "usesLocalIdeographFontFamily", "tinySDFKey", "_createTinySDF", "draw", "isControl", "glyphWidth", "glyphHeight", "glyphLeft", "glyphTop", "glyphAdvance", "fontFamilies", "fontFamily", "CSS", "escape", "TinySDF", "fontSize", "cutoff", "fontWeight", "_fontWeight", "fontStyle", "_fontStyle", "weightsByName", "thin", "hairline", "regular", "medium", "semibold", "demibold", "bold", "heavy", "weight", "tinySDF", "ideographTinySDF", "urlTemplate", "parseGlyphPbf", "_createCanvas", "textBaseline", "textAlign", "gridOuter", "gridInner", "actualBoundingBoxAscent", "actualBoundingBoxDescent", "actualBoundingBoxLeft", "actualBoundingBoxRight", "measureText", "fillText", "imgIdx", "LightPositionProperty", "sphericalToCartesian", "lightProperties", "Light", "lightOptions", "_transitionable", "setLight", "_transitioning", "getLight", "Sky", "setSky", "getSky", "LineAtlas", "nextRow", "dashEntry", "addDash", "lineAtlasWidth", "isDash", "zeroLength", "currentDashLength", "dashLength", "halfStretch", "currIndex", "distLeft", "distRight", "signedDistance", "distMiddle", "distEdge", "dash", "getDashRanges", "addRoundDash", "addRegularDash", "ALPHA", "REPEAT", "PRELOAD_POOL_ID", "WorkerPool", "active", "workers", "workerCount", "numActive", "terminate", "isPreloaded", "availableLogicalProcessors", "globalWorkerPool", "globalDispatcher", "getGlobalWorkerPool", "isSafari", "Dispatcher", "workerPool", "actors", "currentActor", "acquire", "promises", "getActor", "mapRemoved", "release", "unregisterMessageHandler", "getGlobalDispatcher", "getPixelPosMatrix", "mat4.create", "mat4.translate", "mat4.scale", "calculatePosMatrix", "mat4.multiply", "queryRenderedFeatures", "tileManager", "has3DLayer", "maxPitchScaleFactor", "tilesIn", "sortTilesIn", "renderedFeatureLayers", "tileIn", "wrappedTileID", "queryResults", "featureWrapper", "convertFeatureToMapFeature", "wrappedIDLayerMap", "wrappedIDLayers", "tileFeatures", "wrappedIDFeatures", "idA", "idB", "getFeatureState", "loadTileJson", "tileJSON", "frameAsync", "pick", "vector_layers", "vectorLayerIds", "LngLatBounds", "sw", "ne", "setSouthWest", "setNorthEast", "_ne", "_sw", "sw2", "ne2", "getCenter", "getSouthWest", "getNorthEast", "getNorthWest", "getWest", "getNorth", "getSouthEast", "getEast", "getSouth", "containsLongitude", "thisSpan", "otherSpan", "thisWest", "thisEast", "otherWest", "otherEast", "thisWraps", "otherWraps", "latAccuracy", "lngAccuracy", "adjustAntiMeridian", "TileBounds", "validateBounds", "level", "VectorTileSource", "dispatcher", "eventedParent", "reparseOverscaled", "_loaded", "_options", "_collectResourceTiming", "setEventedParent", "load", "sourceDataChanged", "dataType", "_tileJSONRequest", "_requestManager", "_ownerWindow", "tileBounds", "sourceDataType", "contains", "setSourceProperty", "getPixelRatio", "_getOverzoomParameters", "messageType", "reloadPromise", "_afterTileLoadWorkerResponse", "unmodified", "_zoomLevelsToOverscale", "scaledTo", "maxZoomTileUrl", "_refreshExpiredTiles", "setExpiryData", "loadVectorData", "catch", "unloadVectorData", "RasterTileSource", "roundZoom", "getTileTexture", "saveTileTexture", "RasterDEMTileSource", "neighboringTiles", "_getNeighboringTiles", "readImageNow", "needsHillshadePrepare", "needsTerrainPrepare", "pxw", "nxw", "backfilled", "demTexture", "fbo", "getFeatureId", "mergeFeatureDiffs", "findIndex", "diffToHashed", "hashed", "extractCoordinates", "flatMap", "getCoordinatesFromGeometry", "getGeoJSONBounds", "GeoJSONSource", "_removed", "_isUpdatingWorker", "_pendingWorkerUpdate", "_data", "workerOptions", "_pixelsToTileUnits", "_getClusterMaxZoom", "_hasPendingWorkerUpdate", "effectiveClusterMaxZoom", "isInteger", "_updateWorkerData", "waitForCompletion", "updatePromise", "prevDiff", "nextDiff", "nextUpdate", "prevUpdate", "getBounds", "_getLoadGeoJSONParameters", "_dispatchWorkerUpdate", "optionsPromise", "affectedGeometries", "_applyDiffToSource", "shouldReloadTileOptions", "_getShouldReloadTileOptions", "eventData", "_applyResourceTiming", "seenIds", "existing", "affectedBounds", "lngMin", "latMin", "lngMax", "latMax", "ImageSource", "flippedWindingOrder", "newCoordinates", "_request", "_finishLoading", "finally", "setCoordinates", "cornerCoords", "dMax", "terrainTileRanges", "_getOverlappingTileRanges", "prepare", "newTilesLoaded", "MAX_TILE_ZOOM", "minTileX", "minTileY", "maxTileX", "maxTileY", "minTileXWrapped", "maxTileXWrapped", "minWrap", "maxWrap", "VideoSource", "_onPlayingHandler", "triggerRepaint", "getVideo", "loop", "play", "pause", "seconds", "seekableRange", "seekable", "currentTime", "readyState", "paused", "CanvasSource", "animate", "HTMLCanvasElement", "getElementById", "_hasInvalidDimensions", "_playing", "getCanvas", "registeredSources", "getSourceType", "RTLPluginLoadedEventName", "RTLMainThreadPlugin", "statusToSend", "broadcast", "clearRTLTextPlugin", "url_1", "deferred", "_requestImport", "_syncState", "lazyLoad", "rtlMainThreadPlugin", "rtlMainThreadPluginFactory", "FadingRoles", "FadingDirections", "Tile", "timeAdded", "fadeEndTime", "fadeOpacity", "uniqueId", "uses", "expirationTime", "hasSymbolBuckets", "dependencies", "rtt", "rttFingerprint", "expiredRequestCount", "symbolLayer", "hasData", "holdingForSymbolFade", "setCrossFadeLogic", "fadingRole", "fadingDirection", "fadingParentID", "resetFadeLogic", "selfFading", "wasRequested", "justReloaded", "latestFeatureIndex", "latestRawTileData", "latestEncoding", "getLayer", "lId", "imageAtlasTexture", "glyphAtlasTexture", "patchUpdatedImages", "patternsLoaded", "parsedCC", "parseCacheControl", "getTime", "isExpired", "getExpiryTimeout", "hasLayer", "sourceLayerStates", "symbolFadeHoldUntil", "symbolFadeFinished", "clearSymbolFadeHold", "namespace", "dep", "namespaces", "SourceFeatureState", "stateChanges", "deletedStates", "revision", "featureId", "newState", "ft", "reconciledState", "featureDeletions", "setFeatureState", "inViewTiles", "featuresChanged", "layerStates", "maxMercatorHorizonAngle", "projectToWorldCoordinates", "MAX_VALID_LATITUDE", "unprojectFromWorldCoordinates", "getMercatorHorizon", "calculateTileMatrix", "zoomScale", "unwrappedX", "worldMatrix", "cameraMercatorCoordinateFromCenterAndRotation", "centerMercator", "dMercator", "cameraDirectionFromPitchBearing", "pitchRadians", "bearingRadians", "isTileVisible", "frustum", "tileBoundingVolume", "frustumTest", "intersectsFrustum", "planeTest", "intersectsPlane", "integralOfCosXByP", "createCalculateTileZoomFunction", "maxZoomLevelsOnScreen", "tileCountMaxMinRatio", "requestedCenterZoom", "distanceToTile2D", "distanceToTileZ", "distanceToCenter3D", "cameraVerticalFOV", "pitchTileLoadingBehavior", "scaleZoom", "centerPitch", "tileCountPitch0", "highestPitch", "tileCount", "thisTilePitch", "distanceToTile3D", "thisTileDesiredZ", "defaultCalculateTileZoom", "coveringZoomLevel", "coveringTiles", "getCameraFrustum", "getClippingPlane", "cameraCoord", "screenPointToMercatorCoordinate", "getCameraPoint", "centerCoord", "pitchInRadians", "detailsProvider", "getCoveringTilesDetailsProvider", "allowVariableZoom", "desiredZ", "nominalZ", "numTiles", "cameraPoint", "centerPoint", "distanceToCenter2d", "distanceZ", "distanceToCenter3d", "newRootTile", "fullyVisible", "renderWorldCopies", "allowWorldCopies", "it", "boundingVolume", "getTileBoundingVolume", "intersectResult", "distToTile2d", "distanceToTile2d", "calculateTileZoom", "fov", "getWrap", "distanceSq", "vec2.sqrLen", "tileDistanceToCamera", "EXTENT_BOUNDS", "isRasterType", "updateFadingAncestor", "idealTile", "retain", "maxFadingAncestorLevels", "sourceMinZoom", "rasterFadeDuration", "idealID", "Base", "Incoming", "minAncestorZ", "ancestorZ", "ancestorID", "ancestorTile", "getLoadedTile", "Parent", "Departing", "updateFadingDescendents", "idealChildren", "hasFader", "updateFadingChildren", "childID", "childIDs", "foundFader", "childTile", "updateFadingEdge", "edgeTileIDs", "setSelfFadeLogic", "fillBorder", "borderId", "backfillBorder", "InViewTiles", "_tiles", "wrapDelta", "unwrapTo", "getAllTiles", "sorted", "compareTileId", "getTileById", "isRenderable", "renderables", "getAllIds", "isIdRenderable", "a_", "b_", "rotatedA", "rotatedB", "TileManager", "on", "_dataHandler", "_sourceErrored", "_source", "_inViewTiles", "_outOfViewCache", "TileCache", "_unloadTile", "_timers", "_maxTileCacheSize", "_maxTileCacheZoomLevels", "_rasterFadeDuration", "_maxFadingAncestorLevels", "_state", "_didEmitContent", "_updated", "clearTiles", "_sourceLoaded", "used", "usedForTerrain", "getSource", "_paused", "resume", "shouldReload", "_shouldReloadOnResume", "reload", "_tileLoaded", "unloadTile", "coalesceChanges", "getIds", "getRenderableIds", "parentZ", "parentTile", "shouldReloadTile", "_reloadTile", "_loadTile", "previousState", "refreshedUponExpiration", "_setTileReloadTimer", "initializeTileState", "getTileByID", "retainTileMap", "idealTilesWithoutData", "loadedDescendents", "_getLoadedDescendents", "incomplete", "targetID", "descendents", "maxCoveringZoom", "maxOverzooming", "candidates", "topZoom", "topIDs", "_areDescendentsComplete", "targetTileIDs", "isChildOf", "generationIDs", "generationZ", "widthInTiles", "heightInTiles", "viewDependentMaxSize", "setMaxSize", "_prevLng", "handleWrapJump", "_resetTileReloadTimers", "idealTileIDs", "updateCacheSize", "getVisibleUnwrappedCoordinates", "unwrapped", "hasTile", "_addTerrainIdealTiles", "noPendingDataEmissions", "_updateRetainedTiles", "isRaster", "getEdgeTiles", "_cleanUpRasterTiles", "_cleanUpVectorTiles", "_removeTile", "setSymbolHoldDuration", "_fadeDuration", "ancestors", "parent2", "releaseSymbolFadeTiles", "_addTile", "tileIdsWithoutData", "_retainLoadedChildren", "checked", "minCoveringZoom", "maxUnderzooming", "parentWasRequested", "parentId", "cancelPendingTileRequestsWhileZooming", "getAndRemove", "setTile", "_clearTileReloadTimer", "tileIds", "tid", "deleteTileById", "_abortTile", "pointQueryGeometry", "tileResults", "cameraPointQueryGeometry", "getCameraQueryGeometry", "project", "transformBbox", "tileSpaceBounds", "tileSpaceQueryGeometry", "tileSpaceCameraQueryGeometry", "checkWrap", "shrinkBy", "covers", "populateCache", "updateState", "removeFeatureState", "tileKey", "setDependencies", "hasDependency", "areTilesLoaded", "PathInterpolator", "points_", "padding_", "_distances", "paddedLength", "distOfCurrentIdx", "distToTarget", "idxOfPrevPoint", "distOfPrevIdx", "segmentLength", "segmentT", "overlapAllowed", "overlapA", "overlapB", "allowed", "GridIndex", "boxCells", "circleCells", "xCellCount", "yCellCount", "circleKeys", "boxKeys", "circles", "xScale", "yScale", "boxUid", "circleUid", "keysLength", "_insertBoxCell", "_insertCircleCell", "hitTest", "overlapMode", "_query", "_queryCellCircle", "queryArgs", "boxCell", "circleCell", "_circleAndRectCollide", "_circlesCollide", "_convertToXCellCoord", "_convertToYCellCoord", "r1", "bothRadii", "circleX", "circleY", "halfRectWidth", "distX", "halfRectHeight", "distY", "fastInvertTransformMat4", "sXYSqInv", "sZSqInv", "s0", "s4", "s8", "s1", "s5", "s9", "s2", "s6", "s10", "tmpMat4", "getPitchedLabelPlaneMatrix", "rotateWithMap", "vecSouth", "vecEast", "getTileSkewVectors", "skew", "mat2.create", "getGlCoordMatrix", "pitchWithMap", "pixelsToClipSpaceMatrix", "cosRoll", "rollInRadians", "sinRoll", "cosPitch", "cosBearing", "sinBearing", "vec2.create", "vecSouthLen", "vec2.length", "vec2.zero", "vec2.scale", "vecEastLen", "projectWithMatrix", "xyTransformMat4", "isOccluded", "getPerspectiveRatio", "isVisible", "clippingBuffer", "updateLineLabels", "pitchedLabelPlaneMatrix", "pitchedLabelPlaneMatrixInverse", "rotateToLine", "viewportWidth", "viewportHeight", "translation", "partiallyEvaluatedSize", "symbolSize.evaluateSizeForZoom", "placedSymbols", "aspectRatio", "useVertical", "hideGlyphs", "tileAnchorPoint", "projectionContext", "projectionCache", "projections", "cachedAnchorPoint", "anyProjectionOccluded", "anchorPos", "projectTileCoordinatesToClipSpace", "perspectiveRatio", "symbolSize.evaluateSizeForFeature", "pitchScaledFontSize", "getPitchedTextCorrection", "placeUnflipped", "placeGlyphsAlongLine", "flip", "notEnoughRoom", "needsFlipping", "placeFirstAndLastGlyph", "glyphEndIndex", "lineEndIndex", "firstGlyphOffset", "getoffsetX", "lastGlyphOffset", "firstPlacedGlyph", "placeGlyphAlongLine", "lastPlacedGlyph", "requiresOrientationChange", "firstPoint", "placedGlyphs", "firstAndLastGlyph", "projectFromLabelPlaneToClipSpace", "orientationChange", "glyphIndex", "placedGlyph", "projectTileCoordinatesToLabelPlane", "tileVertexIndex", "tileSegmentEnd", "getx", "gety", "projectedVertex", "projectTruncatedLineSegmentToLabelPlane", "clipSpaceA", "clipSpaceB", "singleGlyph", "previousTilePoint", "currentTilePoint", "previousProjectedPoint", "minimumLength", "unitVertexToBeProjected", "projectedUnitVertex", "projectedUnitSegment", "projectLineVertexToLabelPlane", "syntheticVertexArgs", "previousLineVertexIndex", "distanceFromAnchor", "previousVertex", "absOffsetX", "translatedX", "translatedY", "transformToOffsetNormal", "segmentVector", "findOffsetIntersectionPoint", "prevToCurrentOffsetNormal", "offsetPreviousVertex", "offsetCurrentVertex", "currentToNextOffsetNormal", "offsetNextSegmentBegin", "offsetNextSegmentEnd", "findLineIntersection", "anchorSegment", "combinedOffsetX", "offsetIntersectionPoint", "currentSegmentDistance", "pathVertices", "currentLineSegment", "prevToCurrent", "segmentAngle", "hiddenGlyphAttributes", "viewportPadding", "CollisionIndex", "ignoredGrid", "pitchFactor", "screenRightBoundary", "screenBottomBoundary", "gridRightBoundary", "gridBottomBoundary", "perspectiveRatioCutoff", "collisionBox", "textPixelRatio", "collisionGroupPredicate", "simpleProjectionMatrix", "projectedPoint", "projectAndGetPerspectiveRatio", "tileToViewport", "projectedBox", "_projectCollisionBox", "pointX", "pointY", "allPointsOccluded", "occluded", "unplaceable", "isInsideGrid", "placeable", "offscreen", "isOffscreen", "showCollisionCircles", "circlePixelDiameter", "textPixelPadding", "placedCollisionCircles", "tileUnitAnchorPoint", "labelPlaneFontScale", "collisionDetected", "inGrid", "entirelyOffscreen", "screenPlaneMin", "screenPlaneMax", "interpolator", "projectedPath", "circleDist", "screenSpacePath", "projectPathToScreenSpace", "minPoint", "maxPoint", "seg", "numCircles", "circlePosition", "centerX", "centerY", "hitTestCircle", "inverseLabelPlaneMatrix", "invDetXY", "backProjected", "longestUnoccludedStart", "longestUnoccludedLength", "currentUnoccludedStart", "currentUnoccludedLength", "viewportQueryGeometry", "gridPoint", "seenFeatures", "featureKey", "bucketInstanceId", "intersectionTests.polygonIntersectsPolygon", "ignorePlacement", "collisionGroupID", "collisionCircles", "insertCircle", "getViewportMatrix", "vecEastX", "vecEastY", "vecSouthX", "vecSouthY", "translatedAnchorX", "translatedAnchorY", "projectedEast", "toEastX", "basePointX", "basePointY", "distanceMultiplier", "offsetXmin", "offsetXmax", "offsetXhalf", "offsetYmin", "offsetYmax", "offsetYhalf", "offsetsArray", "anyPointVisible", "getAABB", "OpacityState", "prevState", "placed", "skipFade", "opacity", "JointOpacityState", "placedText", "placedIcon", "JointPlacement", "RetainedQueryData", "CollisionGroups", "crossSourceCollisions", "maxGroupID", "collisionGroups", "ID", "nextGroupID", "calculateVariableLayoutShift", "Placement", "prevPlacement", "collisionIndex", "placements", "opacities", "variableOffsets", "stale", "commitTime", "retainedQueryData", "collisionCircleArrays", "collisionBoxArrays", "placedOrientations", "sortAcrossTiles", "symbolBucket", "getBucket", "bucketFeatureIndex", "pixelsToTiles", "translationText", "translatePosition", "translationIcon", "projection.getPitchedLabelPlaneMatrix", "holdingForFade", "partiallyEvaluatedTextSize", "collisionGroup", "textAnchorOffset", "textOverlapMode", "orientation", "placedGlyphBoxes", "placeCollisionBox", "prevAnchor", "markUsedJustification", "markUsedOrientation", "bucketPart", "seenCrossTileIDs", "textOptional", "iconOptional", "textAlwaysOverlap", "iconOverlapMode", "iconAlwaysOverlap", "zOrderByViewportY", "alwaysShowText", "alwaysShowIcon", "deserializeCollisionBoxes", "_getTerrainElevationFunc", "getFastPathSimpleProjectionMatrix", "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", "attemptAnchorPlacement", "prevOrientation", "prevOffset", "placeCollisionCircles", "placeIconFeature", "iconWithoutText", "textWithoutIcon", "hasIconBox", "insertCollisionBox", "insertCollisionCircles", "storeCollisionData", "symbolIndexes", "boxArray", "realCollisionBox", "circleArray", "placedAnchor", "autoIndex", "indexes", "horizontalIndexes", "zoomAtLastRecencyCheck", "placementChanged", "prevZoomAdjustment", "zoomAdjustment", "symbolFadeChange", "prevOpacities", "prevOffsets", "prevOrientations", "jointPlacement", "prevOpacity", "jointOpacity", "lastPlacementChangeTime", "updateBucketOpacities", "duplicateOpacityState", "textAllowOverlap", "iconAllowOverlap", "hasVariablePlacement", "hasValue", "defaultOpacityState", "addOpacities", "PACKED_HIDDEN_OPACITY", "boxArrays", "opacityState", "horizontalHidden", "verticalHidden", "packedOpacity", "packOpacity", "symbolHidden", "textSymbolIndexes", "useHorizontal", "realBoxes", "variableOffset", "updateCollisionVertices", "verticalIconUsed", "sortFeatures", "durationAdjustment", "setStale", "notUsed", "realBox", "shift25", "shift24", "shift17", "shift16", "shift9", "shift8", "shift1", "targetBit", "opacityBits", "LayerPlacement", "_sortAcrossTiles", "_currentTileIndex", "_currentPartIndex", "_seenCrossTileIDs", "_bucketParts", "placement", "shouldPausePlacement", "bucketParts", "getBucketParts", "placeLayerBucketPart", "PauseablePlacement", "forceFullPlacement", "_currentPlacementIndex", "_forceFullPlacement", "_showCollisionBoxes", "_done", "isDone", "layerTiles", "startTime", "placementZoom", "isSymbolStyleLayer", "_inProgressLayer", "continuePlacement", "commit", "roundingFactor", "TileLayerIndex", "_symbolsByKey", "symbolInstancesByKey", "instances", "crossTileIDs", "childTileID", "localX", "localY", "localZ", "yWorld", "yOffset", "newTileID", "zoomCrossTileIDs", "scaledSymbolCoord", "getScaledCoordinates", "thisTileSymbol", "getCrossTileIDsLists", "CrossTileIDs", "maxCrossTileID", "generate", "CrossTileSymbolLayerIndex", "usedCrossTileIDs", "zoomIndexes", "newZoomIndex", "removeBucketCrossTileIDs", "childIndex", "findMatches", "parentIndex", "removedBucket", "currentIDs", "tilesChanged", "CrossTileSymbolIndex", "maxBucketInstanceId", "bucketsInCurrentPlacement", "symbolBucketsChanged", "currentBucketIDs", "addBucket", "removeStaleBuckets", "usedLayers", "usedLayerMap", "usedLayer", "clippingMaskFrag", "shaders", "prelude", "projectionMercator", "projectionGlobe", "backgroundPattern", "clippingMask", "heatmapTexture", "collisionCircle", "colorRelief", "depth", "fillOutline", "fillOutlinePattern", "fillPattern", "fillExtrusion", "fillExtrusionPattern", "hillshadePrepare", "lineGradient", "linePattern", "lineSDF", "lineGradientSDF", "symbolIcon", "symbolSDF", "symbolTextAndIcon", "terrainDepth", "terrainCoords", "projectionErrorMeasurement", "atmosphere", "fragmentSource", "vertexSource", "re", "vertexAttributes", "fragmentUniforms", "vertexUniforms", "shaderUniforms", "fragmentPragmas", "operation", "attrType", "unpackType", "staticAttributes", "staticUniforms", "Mesh", "posAttributes", "MercatorShaderDefine", "MercatorShaderVariantKey", "MercatorProjection", "_cachedMesh", "useSubdivision", "shaderVariantName", "shaderDefine", "shaderPreludeCode", "vertexShaderPreludeCode", "useGlobeControls", "transitionState", "latitudeErrorCorrectionRadians", "_tileID", "_hasBorder", "_allowPoles", "_usage", "tileExtentArray", "tileExtentBuffer", "tileExtentSegments", "simpleSegment", "quadTriangleIndices", "quadTriangleIndexBuffer", "_value", "EdgeInsets", "normalizeCenter", "lngRange", "getTileZoom", "TransformHelper", "callbacks", "applyConstrain", "_constrainOverride", "_callbacks", "defaultConstrain", "_tileSize", "_renderWorldCopies", "_minZoom", "_maxZoom", "_minPitch", "minPitch", "_maxPitch", "maxPitch", "constrainOverride", "setMaxBounds", "_width", "_height", "_center", "_elevation", "_zoom", "_tileZoom", "_scale", "_bearingInRadians", "_fovInRadians", "_pitchInRadians", "_rollInRadians", "_unmodified", "_edgeInsets", "_minElevationForCurrentTile", "_autoCalculateNearFarZ", "thatI", "constrain", "forceOverrideZ", "_latRange", "latRange", "_lngRange", "minElevationForCurrentTile", "fovInRadians", "_cameraToCenterDistance", "_nearZ", "nearZ", "_farZ", "farZ", "autoCalculateNearFarZ", "constrainInternal", "_calcMatrices", "_pixelsToClipSpaceMatrix", "clipSpaceToPixelsMatrix", "_clipSpaceToPixelsMatrix", "pixelsToGLUnits", "_pixelsToGLUnits", "setZoom", "setPitch", "centerOffset", "_rotationMatrix", "rotationMatrix", "constrainedZoom", "pixelsPerMeter", "_pixelPerMeter", "clearNearFarZOverride", "getMaxBounds", "_constraining", "setCenter", "calcMatrices", "alt", "cameraBearing", "cameraPitch", "distanceToCenter", "clampedElevation", "_distanceToCenterFromAltElevationPitch", "camMercator", "metersPerMercUnit", "iter", "mercUnitsPerPixel", "originalPixelsPerMeter", "originalCenterMercator", "originalCenterPixelX", "originalCenterPixelY", "originalCenterPixelZ", "dCamPixel", "camPixelX", "camPixelY", "camPixelZ", "distanceToCenterPixels", "mercUnitsPerMeter", "dzNormalized", "altitudeAGL", "getCameraAltitude", "getCameraLngLat", "pixelPerMeter", "overscaledTileID", "Aabb", "min_", "max_", "qMin", "vec3.clone", "qMax", "fullyInside", "planes", "planeIntersection", "aabb", "distMin", "distMax", "MercatorCoveringTilesDetailsProvider", "distanceX", "distanceY", "parentWrap", "minElevation", "maxElevation", "minMax", "getMinMaxElevation", "zfov", "maxConstantZoomPitch", "prepareNextFrame", "Frustum", "invProj", "horizonPlane", "flippedNearFar", "frustumPlanePointIndices", "frustumCoords", "vec4.mul", "nearPlanePointsIndices", "nearPlanePointsOffset", "farPlanePointsOffset", "maxDist", "cornerRayLengths", "cornerRayNormalizedDirections", "vec3.sub", "vec3.length", "rayPlaneIntersection", "nearPlaneNormalized", "nearPlaneA", "nearPlaneB", "vec3.normalize", "vec3.dot", "idealFarPlaneDistanceFromNearPlane", "horizonPlaneLen", "vec3.len", "normalizedHorizonPlane", "vec4.scale", "projectedViewDirection", "projectedViewLength", "horizonCircleRadius", "horizonCircleCenter", "pointFurthestOnHorizonCircle", "pointPlaneSignedDistance", "idealCornerRayLength", "targetLength", "frustumPlanes", "NEGATIVE_INFINITY", "MercatorTransform", "_helper", "setMinZoom", "setMaxZoom", "setMinPitch", "setMaxPitch", "setRenderWorldCopies", "setBearing", "setRoll", "setFov", "setElevation", "setMinElevationForCurrentTile", "setPadding", "interpolatePadding", "isPaddingEqual", "setConstrainOverride", "overrideNearFarZ", "_error", "_posMatrixCache", "_alignedPosMatrixCache", "_fogMatrixCacheF32", "almost180", "scaleY", "scaleX", "screenWidth", "screenHeight", "originalX", "originalY", "modifiedX", "modifiedY", "newPoint", "h2", "wrappedX", "_coveringTilesDetailsProvider", "that", "cameraPosition", "_cameraPosition", "projectionMatrix", "_projectionMatrix", "modelViewProjectionMatrix", "_viewProjMatrix", "inverseProjectionMatrix", "_invProjMatrix", "mercatorMatrix", "_mercatorMatrix", "utl", "utr", "ubl", "ubr", "w0", "w1", "extraWorldCopy", "fromInvProjectionMatrix", "_invViewProjMatrix", "screenPointToLocation", "getElevationForLngLatZoom", "recalculateZoomAndCenter", "screenPointToMercatorCoordinateAtZ", "loc", "newCenter", "coordinatePoint", "getElevationForLngLat", "_pixelMatrix3D", "pointCoordinate", "mercatorZ", "coord0", "coord1", "_pixelMatrixInverse", "z1", "pixelMatrix", "_pixelMatrix", "useFloat32", "posMatrixKey", "matrices", "f32", "f64", "tileMatrix", "_alignedProjMatrix", "fogMatrix", "_fogMatrix", "calculateCenterFromCameraLngLatAlt", "cameraToSeaLevelDistance", "limitedPitchRadians", "cameraToLowestPointDistance", "lowestPlane", "groundAngle", "fovAboveCenter", "topHalfSurfaceDistance", "horizon", "horizonAngle", "minFovCenterToHorizonRadians", "fovCenterToHorizon", "topHalfSurfaceDistanceHorizon", "topHalfMinDistance", "_calculateNearFarZIfNeeded", "mat4.perspective", "mat4.clone", "mat4.rotateZ", "mat4.rotateX", "mat4.invert", "cameraPos", "xShift", "yShift", "angleCos", "angleSin", "alignedM", "_clearMatrixCaches", "applyTerrainMatrix", "mercatorTileCoordinates", "getMercatorTileCoordinates", "tilePosMatrix", "mainMatrix", "createIdentityMat4f32", "tileMercatorCoords", "clippingPlane", "projectionTransition", "fallbackMatrix", "getPixelScale", "getCircleRadiusCorrection", "_textAnchorX", "_textAnchorY", "_p", "modelAsMercatorCoordinate", "createIdentityMat4f64", "applyGlobeMatrix", "projectionData", "getProjectionData", "projectionMatrixScaled", "createMat4f64", "cameraBoundsWarning", "updateRotation", "useSlerp", "startRotation", "rollPitchBearingToQuat", "startEulerAngles", "endRotation", "endEulerAngles", "quat.slerp", "eulerAngles", "getRollPitchBearing", "cameraForBoxAndBearing", "edgePadding", "nwWorld", "neWorld", "seWorld", "swWorld", "nwRotatedWorld", "neRotatedWorld", "seRotatedWorld", "swRotatedWorld", "upperRight", "lowerLeft", "rotatedPaddingOffset", "offsetAtFinalZoom", "div", "MercatorCameraHelper", "pan", "offsetLength", "pixelsToHorizon", "easingOffset", "easingCenter", "deltas", "bearingDelta", "pitchDelta", "rollDelta", "zoomDelta", "preZoomAroundLoc", "around", "setLocationAtPoint", "startZoom", "startPadding", "optionsZoom", "doPadding", "isZooming", "pointAtOffset", "offsetAsPoint", "locationAtOffset", "endZoom", "finalScale", "easeFunc", "rollPitchBearingEqual", "aroundPoint", "speedup", "elevationCenter", "constrained", "targetCenter", "targetZoom", "pixelPathLength", "scaleOfZoom", "scaleOfMinZoom", "minZoomPreConstrain", "centerFactor", "ColorMode", "blendFunction", "blendColor", "Replace", "disabled", "unblended", "alphaBlended", "CCW", "CullFaceMode", "enable", "mode", "frontFace", "backCCW", "frontCCW", "DepthMode", "depthFunc", "depthMask", "depthRange", "func", "ReadOnly", "ReadWrite", "KEEP", "StencilMode", "fail", "depthFail", "isWebGL2", "WebGL2RenderingContext", "ProjectionErrorMeasurement", "awaitingQuery", "_readbackQueue", "renderContext", "_readbackWaitFrames", "_measureWaitFrames", "_texWidth", "_texHeight", "_measuredError", "_updateCount", "_lastReadbackFrame", "_cachedRenderContext", "_texFormat", "_texType", "_fullscreenTriangle", "_resultBuffer", "activeTexture", "TEXTURE1", "NEAREST", "_fbo", "createFramebuffer", "colorAttachment", "_pbo", "createBuffer", "bindBuffer", "PIXEL_PACK_BUFFER", "bufferData", "STREAM_READ", "deleteBuffer", "normalizedMercatorY", "expectedAngleY", "currentFrame", "frameNumberIssued", "_tryReadback", "_renderErrorTexture", "_bindFramebuffer", "bindFramebuffer", "framebuffer", "outputExpected", "useProgram", "u_input", "u_output_expected", "readBuffer", "COLOR_ATTACHMENT0", "readPixels", "sync", "fenceSync", "SYNC_GPU_COMMANDS_COMPLETE", "flush", "waitResult", "clientWaitSync", "WAIT_FAILED", "TIMEOUT_EXPIRED", "getBufferSubData", "_parseRGBA8float", "EXTENT_STENCIL_BORDER", "createTileMesh", "forceIndicesSize", "quadsPerAxisX", "generateBorders", "quadsPerAxisY", "extendToNorthPole", "extendToSouthPole", "verticesPerAxisX", "verticesPerAxisY", "endX", "endY", "vertexCount", "indexCount", "overflows16bitIndices", "use32bitIndices", "vertexId", "indexId", "uses32bitIndices", "granularitySettingsGlobe", "VerticalPerspectiveProjection", "_tileMeshCache", "_errorCorrectionUsable", "_errorMeasurementLastValue", "_errorCorrectionPreviousValue", "_errorMeasurementLastChangeTime", "_errorMeasurement", "_errorQueryLatitudeDegrees", "expectedResult", "updateErrorLoop", "hasBorder", "allowPoles", "_getMesh", "_getMeshKey", "mesh", "tileMesh", "GlobeProjection", "setProjection", "_mercatorProjection", "_verticalPerspectiveProjection", "currentProjectionSpecValue", "useGlobeRendering", "currentProjection", "updateGPUdependent", "getMeshFromTileID", "setErrorQueryLatitudeDegrees", "getGlobeCircumferencePixels", "getGlobeRadiusPixels", "projectTileCoordinatesToSphere", "inTileX", "inTileY", "tileIdX", "tileIdY", "tileIdZ", "sphericalX", "sphericalY", "vec", "angularCoordinatesToSurfaceVector", "lngRadians", "latRadians", "latitudeDegrees", "sphereSurfacePointToCoordinates", "surface", "latDegrees", "lengthXZ", "projX", "acosZ", "lngDegrees", "planetScaleAtLatitude", "getZoomAdjustment", "oldLat", "newLat", "oldCircumference", "newCircumference", "computeGlobePanCenter", "panDelta", "rotatedPanDelta", "normalizedGlobeZoom", "lngSpeed", "remapSaturate", "panningDegreesPerPixel", "integrateSecX", "xHalf", "interpolateLngLatForGlobe", "deltaLng", "deltaLat", "interpolatedLat", "samplePointStart", "samplePointEnd", "valueT", "valueStart", "valueEnd", "BoundingVolumeCache", "boundingVolumeFactory", "_cachePrevious", "_cache", "_hadAnyChanges", "_boundingVolumeFactory", "swapBuffers", "oldCache", "cachedPrevious", "ConvexVolume", "halfSize", "angles", "axisX", "vec3.transformQuat", "axisY", "axisZ", "boxPointCount", "boxPlaneCount", "frustumPlaneCount", "frustumPointCount", "boxPointsPassed", "frustumPointsPassed", "pointCount", "positivePoints", "distanceToTileSimple", "distanceToTileWrapX", "tileCornerX", "tileCornerY", "tileCornerToPointX", "GlobeCoveringTilesDetailsProvider", "_boundingVolumeCache", "_computeTileBoundingVolume", "_bv", "tileMercatorSize", "smallestDistance", "_parentWrap", "tileX", "distanceCurrent", "distanceLeft", "distanceRight", "distanceSmallest", "fromAabb", "extremesPoints", "aabbMin", "aabbMax", "centerEast", "axisEast", "axisWest", "upDownMinMax", "findAxisMinMax", "northSouthMinMax", "planeUp", "planeDown", "planeNorth", "planeSouth", "planeEast", "planeWest", "threePlaneIntersection", "VerticalPerspectiveTransform", "_cachedClippingPlane", "createVec4f64", "_globeViewProjMatrix32f", "_globeViewProjMatrixNoCorrection", "_globeViewProjMatrixNoCorrectionInverted", "_globeProjMatrixInverted", "createVec3f64", "_globeLatitudeErrorCorrectionRadians", "constrainedLat", "globeLatitudeErrorCorrectionRadians", "globeRadiusPixels", "distanceCameraToB", "distanceCameraToA", "distanceAtoC", "tangentPlaneDistanceToC", "vectorCtoCamX", "vectorCtoCamY", "vectorCtoCamLength", "planeVector", "vec3.rotateZ", "vec3.rotateX", "vec3.rotateY", "isSurfacePointVisible", "sphereX", "sphereY", "spherePos", "axisRight", "axisDown", "normalized", "textAnchorX", "textAnchorY", "mercator", "canonicalTileID", "angular", "vectorMultiplier", "globeMatrix", "globeMatrixUncorrected", "scaleVec", "mat4.rotateY", "zero", "_computeClippingPlane", "_cachedFrustum", "_unwrappedTileID", "_coords", "xMid", "yMid", "testPoints", "projectedPoints", "unprojectScreenPoint", "mostEast", "mostWest", "mostNorth", "mostSouth", "dLng", "differenceOfAnglesDegrees", "dLat", "boundsArray", "isSurfacePointOnScreen", "vecToPixelCurrent", "vecToTarget", "vec3.zero", "rotatedPixelVector", "vecToTargetXZLengthSquared", "targetXSquared", "intersectionA", "intersectionB", "lngA", "angleToRotateBetweenVectors2D", "lngB", "vecToTargetLngA", "latA", "vecToTargetLngB", "latB", "isValidA", "isValidB", "validLng", "validLat", "centerLngRadians", "centerLatRadians", "distanceOfAnglesRadians", "newLng", "_projectSurfacePointToScreen", "_terrain", "rayOrigin", "rayDirection", "getRayDirectionFromPixel", "rayPlanetIntersection", "ray", "rayNormalized", "originDotDirection", "scaledDir", "discriminant", "tMin", "tMax", "intersection", "sphereSurface", "directionDotPlaneXyz", "distanceToIntersection", "distantPoint", "distanceFromPlane", "horizonDisk", "relativeToCenter", "clamped", "vec3.scaleAndAdd", "globeData", "GlobeTransform", "constrainTransform", "isGlobeRendering", "_globeness", "globeness", "errorCorrectionValue", "_verticalPerspectiveTransform", "_mercatorTransform", "currentTransform", "mercatorProjectionData", "verticalPerspectiveProjectionData", "isLocationOccluded", "transformLightDirection", "mercatorCorrection", "verticalCorrection", "calculateFogMatrix", "lngLatToCameraDepth", "locationToScreenPoint", "isPointOnMapSurface", "getMatrixForModel", "mercatorData", "getProjectionDataForCustomLayer", "VerticalPerspectiveCameraHelper", "panCenter", "zoomPixel", "zoomLoc", "oldZoomPreZoomDelta", "actualZoomDelta", "dLngRaw", "distanceToClosestPoint", "closestPoint", "distanceFromSurface", "distanceFactor", "radiusFactor", "oldCenterLat", "oldZoom", "heuristicCenter", "exactCenter", "interpolationFactorLongitude", "interpolationFactorRadius", "heuristicFactor", "lngExactToHeuristic", "latExactToHeuristic", "_preZoomAroundLoc", "xLeft", "xRight", "yTop", "yBottom", "flipEastWest", "lngWest", "lngEast", "latNorth", "latSouth", "lngMid", "latMid", "clonedTr", "testVectors", "vecToCenter", "smallestNeededScale", "getLesserNonNegativeNonNull", "solveVectorScale", "startingLat", "constrainedCenter", "startCenter", "preConstrainCenter", "clampedPoint", "endCenterWithShift", "endZoomWithShift", "normalizedStartZoom", "normalizedEndZoom", "interpolatedZoom", "vecA", "vecB", "radians", "circumference", "normalizedTargetZoom", "normalizedOptionsMinZoom", "normalizedMinZoom", "_pointAtOffset", "interpolatedCenter", "toCenter", "targetDimension", "targetValue", "columnXorY", "columnZ", "vecDotXY", "vecDotZ", "toCenterDotXY", "toCenterDotZ", "GlobeCameraHelper", "globe", "_globe", "_mercatorCameraHelper", "_verticalPerspectiveCameraHelper", "currentHelper", "handlePanInertia", "handleMapControlsRollPitchBearingZoom", "handleMapControlsPan", "handleJumpToCenterZoom", "handleEaseTo", "handleFlyTo", "evented", "_emitValidationErrors", "emptyStyle", "Style", "_rtlPluginLoaded", "tileManagers", "_getMapId", "getGlyphs", "getImages", "getDashes", "glyphLang", "_container", "glyphManager", "lineAtlas", "crossTileSymbolIndex", "_setInitialValues", "_resetUpdates", "_validateLayer", "_spritesImagesIds", "_order", "_availableImages", "_serializedLayers", "stylesheet", "_changed", "_updatedLayers", "_updatedSources", "_changedImages", "_glyphsDidChange", "_updatedPaintProps", "_layerOrderChanged", "pauseablePlacement", "_checkLoaded", "_applyGlobalStateChanges", "getGlobalState", "newStylesheetState", "changedGlobalStateRefs", "sourceIdsToReload", "globalStateChange", "layoutAffectingGlobalStateRefs", "paintAffectingGlobalStateRefs", "visibilityAffectingGlobalStateRefs", "_updatePaintProperty", "_updateLayer", "_reloadSource", "previousStyle", "_loadStyleRequest", "_load", "_frameRequest", "loadEmpty", "nextState", "transformStyle", "_loadSprite", "setLoaded", "setURL", "_createLayers", "_setProjectionInternal", "setTerrain", "dereferencedLayers", "derefLayers", "setGlobalState", "styledLayer", "isRasterStyleLayer", "setRasterFadeDuration", "isUpdate", "completion", "_spriteRequest", "originalSprite", "spriteArray", "jsonsMap", "imagesMap", "jsonRequestParameters", "imageRequestParameters", "spriteName", "spriteId", "imagesToRemove", "imageId", "addImage", "_unloadSprite", "returnClone", "serializedLayersDictionary", "_serializedAllLayers", "toPush", "allLayerIds", "hasTransitions", "changed", "updatedIds", "_removedLayers", "_updateWorkerLayers", "action", "_clearSource", "_updateTilesForChangedImages", "_updateTilesForChangedGlyphs", "managersUsedBefore", "changedImages", "reloadTilesForDependencies", "_serializeByIds", "serializedStyle", "changes", "diffStyles", "operations", "_getOperationsToPerform", "unimplemented", "styleChangeOperation", "removeLayer", "setFilter", "setLayerZoomRange", "setGeoJSONSourceData", "setGlyphs", "setSprite", "_afterImageUpdated", "isSourceLoaded", "geojsonSource", "setData", "validateCustomStyleLayer", "getLayersOrder", "getLayoutProperty", "getPaintProperty", "getTerrain", "myStyleSheet", "sourceResults", "isLayer3D", "features3D", "sourceResult", "layerFeatures", "topmost3D", "includedSources", "layersAsSet", "paramsStrict", "renderedSymbols", "queryRenderedSymbols", "bucketQueryData", "queryData", "bucketSymbols", "lookupSymbolFeatures", "layerSymbols", "sortedA", "symbolFeature", "_flattenAndSortRenderedFeatures", "dataTiles", "dataID", "querySourceFeatures", "_update", "getProjection", "resolvedProjection", "skyOptions", "projectionObjects", "transformConstrain", "transformOptions", "globeProjection", "cameraHelper", "migrateProjection", "_generateCollisionBoxes", "placementCommitted", "isLessThan", "layerBucketsChanged", "pruneUnusedLayers", "stillRecent", "updateLayerOpacities", "_releaseSymbolFadeTiles", "getGlyphsUrl", "glyphsUrl", "getDash", "spriteToAdd", "updatedSprite", "internalSpriteRepresentation", "find", "getSprite", "rasterBoundsAttributes", "VertexArrayObject", "boundProgram", "boundLayoutVertexBuffer", "boundPaintVertexBuffers", "boundIndexBuffer", "boundVertexOffset", "boundDynamicVertexBuffer", "vao", "program", "paintVertexBuffers", "dynamicVertexBuffer", "dynamicVertexBuffer2", "dynamicVertexBuffer3", "paintBuffersDiffer", "boundDynamicVertexBuffer2", "boundDynamicVertexBuffer3", "freshBind", "bindVertexArray", "dynamicDraw", "numNextAttributes", "numAttributes", "createVertexArray", "enableAttributes", "setVertexAttribPointers", "currentNumAttributes", "deleteVertexArray", "terrainUniformValues", "eleDelta", "isGlobeMode", "u_texture", "u_ele_delta", "u_fog_matrix", "u_fog_color", "u_fog_ground_blend", "u_fog_ground_blend_opacity", "calculateFogBlendOpacity", "u_horizon_color", "u_horizon_fog_blend", "u_is_globe_mode", "projectionObjectToUniformMap", "getTokenizedAttributesAndUniforms", "token", "Program", "configuration", "fixedUniforms", "showOverdrawInspector", "hasTerrain", "projectionPrelude", "projectionDefine", "extraDefines", "createProgram", "staticAttrInfo", "dynamicAttrInfo", "allAttrInfo", "preludeUniformsInfo", "projectionPreludeUniformsInfo", "staticUniformsInfo", "dynamicUniformsInfo", "uniformList", "allUniformsInfo", "unshift", "fragmentShader", "createShader", "FRAGMENT_SHADER", "isContextLost", "failedToCreate", "shaderSource", "compileShader", "getShaderParameter", "COMPILE_STATUS", "getShaderInfoLog", "attachShader", "vertexShader", "VERTEX_SHADER", "uniformLocations", "bindAttribLocation", "linkProgram", "getProgramParameter", "LINK_STATUS", "getProgramInfoLog", "deleteShader", "uniformLocation", "getUniformLocation", "terrainUniforms", "u_depth", "Uniform1i", "u_terrain", "u_terrain_dim", "u_terrain_matrix", "UniformMatrix4f", "u_terrain_unpack", "u_terrain_exaggeration", "projectionUniforms", "u_projection_matrix", "u_projection_tile_mercator_coords", "u_projection_clipping_plane", "u_projection_transition", "u_projection_fallback_matrix", "getUniforms", "drawMode", "depthMode", "stencilMode", "colorMode", "cullFaceMode", "uniformValues", "currentProperties", "dynamicLayoutBuffer", "dynamicLayoutBuffer2", "dynamicLayoutBuffer3", "setDepthMode", "setStencilMode", "setColorMode", "setCullFace", "TEXTURE2", "depthTexture", "TEXTURE3", "fieldName", "setUniforms", "primitiveSize", "LINES", "LINE_STRIP", "drawElements", "UNSIGNED_SHORT", "patternUniformValues", "tileRatio", "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.fromRotation", "vec3.transformMat3", "transformedLightPos", "lightColor", "u_lightpos", "u_lightpos_globe", "u_lightintensity", "u_lightcolor", "u_vertical_gradient", "u_opacity", "u_fill_translate", "fillExtrusionPatternUniformValues", "u_height_factor", "fillPatternUniformValues", "fillOutlineUniformValues", "drawingBufferSize", "u_world", "fillOutlinePatternUniformValues", "circleUniformValues", "radiusCorrectionFactor", "extrudeScale", "globeExtrudeScale", "u_camera_to_center_distance", "u_scale_with_map", "u_pitch_with_map", "u_device_pixel_ratio", "u_extrude_scale", "u_globe_extrude_scale", "u_translate", "collisionUniformValues", "u_pixel_extrude_scale", "collisionCircleUniformValues", "u_viewport_size", "debugUniformValues", "scaleRatio", "u_color", "u_overlay", "u_overlay_scale", "heatmapUniformValues", "u_intensity", "heatmapTextureUniformValues", "textureUnit", "colorRampUnit", "mat4.ortho", "u_matrix", "drawingBufferWidth", "drawingBufferHeight", "u_color_ramp", "hillshadeUniformValues", "accent", "illumination", "u_latrange", "getTileLatRange", "u_exaggeration", "u_altitudes", "u_azimuths", "u_accent", "u_method", "u_highlights", "u_shadows", "hillshadeUniformPrepareValues", "u_dimension", "u_zoom", "u_unpack", "colorReliefUniformValues", "colorRampSize", "u_elevation_stops", "u_color_stops", "u_color_ramp_size", "lineUniformValues", "ratioScale", "u_translation", "calculateTranslation", "u_ratio", "u_units_to_pixels", "lineGradientUniformValues", "u_image_height", "linePatternUniformValues", "tileZoomRatio", "calculateTileRatio", "lineSDFUniformValues", "u_tileratio", "u_crossfade_from", "u_crossfade_to", "u_mix", "u_lineatlas_width", "u_lineatlas_height", "lineGradientSDFUniformValues", "u_image_dash", "rasterUniformValues", "parentTL", "parentScaleBy", "fade", "u_tl_parent", "u_scale_parent", "u_buffer_scale", "u_fade_t", "u_image0", "u_image1", "u_brightness_low", "u_brightness_high", "u_saturation_factor", "saturation", "u_contrast_factor", "contrast", "u_spin_weights", "spinWeights", "u_coords_top", "u_coords_bottom", "symbolIconUniformValues", "rotateInShader", "isAlongLine", "isVariableAnchor", "labelPlaneMatrix", "glCoordMatrix", "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_pitched_scale", "symbolSDFUniformValues", "isHalo", "u_gamma_scale", "u_is_halo", "u_is_plain", "symbolTextAndIconUniformValues", "texSizeSDF", "texSizeIcon", "u_texsize_icon", "u_texture_icon", "backgroundUniformValues", "backgroundPatternUniformValues", "imagePosA", "getPattern", "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", "emptyUniforms", "__", "programUniforms", "Uniform3f", "Uniform2f", "UniformFloatArray", "UniformColorArray", "u_terrain_coords_id", "u_sun_pos", "u_atmosphere_blend", "u_globe_position", "u_globe_radius", "u_inv_proj_matrix", "u_sky_color", "u_horizon", "u_horizon_normal", "u_sky_horizon_blend", "u_sky_blend", "IndexBuffer", "unbindVAO", "bindElementBuffer", "ELEMENT_ARRAY_BUFFER", "DYNAMIC_DRAW", "STATIC_DRAW", "bufferSubData", "AttributeType", "VertexBuffer", "bindVertexBuffer", "ARRAY_BUFFER", "attribIndex", "enableVertexAttribArray", "vertexAttribPointer", "BaseValue", "getDefault", "ClearColor", "clearColor", "ClearDepth", "clearDepth", "ClearStencil", "clearStencil", "ColorMask", "colorMask", "DepthMask", "StencilMask", "stencilMask", "StencilFunc", "ALWAYS", "stencilFunc", "StencilOp", "stencilOp", "StencilTest", "STENCIL_TEST", "disable", "DepthRange", "DepthTest", "DEPTH_TEST", "DepthFunc", "LESS", "Blend", "BLEND", "BlendFunc", "ONE", "ZERO", "blendFunc", "BlendColor", "BlendEquation", "FUNC_ADD", "blendEquation", "CullFace", "CULL_FACE", "CullFaceSide", "BACK", "cullFace", "FrontFace", "ProgramValue", "ActiveTextureUnit", "TEXTURE0", "Viewport", "BindFramebuffer", "FRAMEBUFFER", "BindRenderbuffer", "bindRenderbuffer", "RENDERBUFFER", "BindTexture", "BindVertexBuffer", "BindElementBuffer", "BindVertexArray", "getExtension", "bindVertexArrayOES", "PixelStoreUnpack", "pixelStorei", "UNPACK_ALIGNMENT", "PixelStoreUnpackPremultiplyAlpha", "UNPACK_PREMULTIPLY_ALPHA_WEBGL", "PixelStoreUnpackFlipY", "UNPACK_FLIP_Y_WEBGL", "FramebufferAttachment", "ColorAttachment", "setDirty", "framebufferTexture2D", "DepthAttachment", "framebufferRenderbuffer", "DEPTH_ATTACHMENT", "DepthStencilAttachment", "DEPTH_STENCIL_ATTACHMENT", "FRAMEBUFFER_NOT_COMPLETE_ERROR", "Framebuffer", "hasDepth", "hasStencil", "depthAttachment", "checkFramebufferStatus", "FRAMEBUFFER_COMPLETE", "renderbuffer", "deleteRenderbuffer", "deleteFramebuffer", "Context", "stencilTest", "depthTest", "blend", "cullFaceSide", "extTextureFilterAnisotropic", "extTextureFilterAnisotropicMax", "getParameter", "MAX_TEXTURE_MAX_ANISOTROPY_EXT", "maxTextureSize", "MAX_TEXTURE_SIZE", "HALF_FLOAT", "extColorBufferHalfFloat", "RGBA16F", "RGBA16F_EXT", "RGB16F", "RGB16F_EXT", "extTextureHalfFloat", "HALF_FLOAT_OES", "storageFormat", "rbo", "createRenderbuffer", "renderbufferStorage", "COLOR_BUFFER_BIT", "DEPTH_BUFFER_BIT", "STENCIL_BUFFER_BIT", "createVertexArrayOES", "deleteVertexArrayOES", "quadTriangles", "drawCollisionDebug", "tileBatches", "circleCount", "circleOffset", "colorModeForRenderPass", "getTerrainData", "circleProgram", "vertexData", "CollisionCircleLayoutArray", "batch", "circleIdx", "collision", "quadCount", "triCount", "QuadTriangleArray", "idx", "identityMat4", "calculateVariableRenderShift", "renderTextSize", "getShiftedAnchor", "projectedAnchorPoint", "transformAngle", "pitchedTextShiftCorrection", "translatedAnchor", "adjustedShift", "tileAnchorShifted", "east", "updateVariableAnchorsForBucket", "tileScale", "updateTextFitIcon", "dynamicTextLayoutVertexArray", "dynamicIconLayoutVertexArray", "placedTextShifts", "tileAnchor", "projectedAnchor", "evaluateSizeForFeature", "pitchedTextCorrection", "shiftedAnchor", "placedIcons", "getSymbolProgramName", "drawLayerSymbols", "rotationAlignment", "isRenderingToTexture", "hasSortKey", "getDepthModeForSublayer", "tileRenderState", "pitchedTextRescaling", "programConfiguration", "evaluateSizeForZoom", "terrainData", "atlasInterpolation", "atlasInterpolationIcon", "atlasTextureIcon", "rotating", "zooming", "iconScaled", "glCoordMatrixForShader", "hasVariableAnchors", "shaderVariableAnchor", "uLabelPlaneMatrix", "hasHalo", "oldSegments", "haloWidth", "isGlyphOverlap", "segmentState", "drawSymbolElements", "prepareHeatmapTerrain", "isRenderingGlobe", "createHeatmapFbo", "renderHeatmapTerrain", "getColorRampTexture", "rasterBoundsBuffer", "rasterBoundsSegments", "numType", "internalFormat", "updateGradientTexture", "layerGradient", "textureResolution", "potentialOverzoom", "nextPowerOfTwo", "gradient", "bindImagePatternTextures", "bindDasharrayTextures", "programChanged", "bindGradientTextures", "gradientTexture", "bindGradientAndDashTextures", "updatePatternPositionsInProgram", "drawFillTiles", "isOutline", "fillPropertyName", "programName", "propertyFillTranslate", "propertyFillTranslateAnchor", "translateForUniforms", "stencilModeForClipping", "drawExtrusionTiles", "renderHillshade", "stencilModes", "useBorder", "moving", "textureMaxSize", "renderColorRelief", "textureFilter", "firstTile", "getColorRampTextures", "TEXTURE4", "textureStride", "pixelData", "drawTiles", "flipCullfaceMode", "minTileZ", "rasterOpacity", "isTerrain", "parentTopLeft", "fadeValues", "getFadeProperties", "tileOpacity", "parentTileOpacity", "anisotropicFilterPitch", "texParameterf", "TEXTURE_MAX_ANISOTROPY_EXT", "fadeMix", "defaults", "timeSinceParent", "doFadeIn", "opacity1", "opacity2", "timeSinceTile", "topColor", "btmColor", "leftColor", "rightColor", "centerColor", "drawHorizontalLine", "drawDebugSSRect", "drawVerticalLine", "SCISSOR_TEST", "scissor", "drawDebugTile", "tileRawData", "tileSizeKb", "tileIdText", "initDebugOverlayCanvas", "debugOverlayCanvas", "ctx2d", "shadowBlur", "strokeStyle", "strokeText", "debugOverlayTexture", "debugBuffer", "debugSegments", "tileBorderIndexBuffer", "drawTerrain", "renderOptions", "getDepthModeFor3D", "getTerrainMesh", "renderToTexture", "getTexture", "getMeshFrameDelta", "getMesh", "webglDrawFunctions", "renderPass", "pixelToTileScale", "strokeWidth", "strokeOpacity", "segmentsRenderStates", "styleTranslate", "styleTranslateAnchor", "segmentsState", "hasRenderableParent", "viewportBuffer", "viewportSegments", "programId", "prevProgram", "constantDasharray", "atlas", "opaquePassEnabledForLayer", "LEQUAL", "depthRangeFor3D", "stencilModeFor3D", "renderTexture", "stencilBorderless", "stencilBorders", "stencilConfigForOverlapTwoPass", "getStencilConfigForOverlapAndUpdateStencilID", "isPatternMissing", "skyUniforms", "mercatorHorizon", "skyBlend", "sunPos", "vec3.transformMat4", "atmosphereBlend", "globeRadius", "invProjMatrix", "globePosition", "customLayerArgs", "shaderData", "variantName", "vertexShaderPrelude", "defaultProjectionData", "setCustomLayerDefaults", "setBaseState", "debugPadding", "getRenderableTiles", "getFramebuffer", "devicePixelRatio", "getCoordsTexture", "coordsIndex", "Painter", "drawFunctions", "_tileTextures", "terrainFacilitator", "depthDirty", "coordsDirty", "renderTime", "setup", "numSublayers", "depthEpsilon", "debugArray", "rasterBoundsArray", "RasterBoundsArray", "rasterBoundsArrayPosOnly", "rasterBoundsBufferPosOnly", "rasterBoundsSegmentsPosOnly", "viewportArray", "tileLineStripIndices", "LineStripIndexArray", "stencilClearMode", "tileExtentMesh", "nextStencilID", "currentStencilSource", "stencilRefs", "_renderTileMasks", "_tileClippingMaskIDs", "tileStencilRefs", "useBorders", "stencilRef", "REPLACE", "_renderTilesDepthBuffer", "NOTEQUAL", "EQUAL", "stencilValues", "zToStencilMode", "GEQUAL", "zToStencilModeHigh", "zToStencilModeLow", "GREATER", "_showOverdrawInspector", "CONSTANT_COLOR", "currentLayer", "opaquePassCutoff", "coordsAscending", "coordsDescending", "coordsDescendingSymbol", "getVisibleCoordinates", "reverse", "maybeDrawDepth", "prepareForRender", "renderLayer", "_renderTileClippingMasks", "globeDepthRendered", "showTileBoundaries", "selectedSource", "vectorSources", "otherSources", "considerSource", "showPadding", "requireExact", "prevMatrix", "currMatrix", "doUpdate", "mat4.exactEquals", "mat4.equals", "anyTilesAfterTime", "mat4.copy", "maybeDrawCoords", "isCircleStyleLayer", "isHeatmapStyleLayer", "isLineStyleLayer", "isFillStyleLayer", "isFillExtrusionStyleLayer", "isHillshadeStyleLayer", "isColorReliefStyleLayer", "isBackgroundStyleLayer", "isCustomStyleLayer", "textures", "MAX_TEXTURE_POOL_SIZE_PER_BUCKET", "forceSimpleProjection", "useTerrain", "deleteProgram", "overLimit", "throttle", "lastCallArgs", "pending", "later", "Hash", "hashName", "_getCurrentHash", "hash", "_hashName", "keyval", "parts", "_onHashChange", "_isValidHash", "_map", "dragRotate", "isEnabled", "touchZoomRotate", "getBearing", "jumpTo", "_updateHashUnthrottled", "getHashString", "history", "replaceState", "_removeHash", "currentHash", "baseHash", "targetHash", "replaceString", "_updateHash", "encodeURIComponent", "mapFeedback", "getZoom", "getPitch", "found", "getMinZoom", "getMaxZoom", "getMinPitch", "getMaxPitch", "defaultInertiaOptions", "linearity", "easing", "defaultPanInertiaOptions", "deceleration", "maxSpeed", "defaultZoomInertiaOptions", "defaultBearingInertiaOptions", "defaultPitchInertiaOptions", "defaultRollInertiaOptions", "HandlerInertia", "_inertiaBuffer", "settings", "_drainInertiaBuffer", "inertia", "panInertiaOptions", "pinchAround", "easeOptions", "calculateEasing", "finalPan", "computedEaseOptions", "extendDuration", "evaluateZoomSnap", "getZoomSnap", "unproject", "noMoveStart", "inertiaDuration", "inertiaOptions", "speed", "MapMouseEvent", "_defaultPrevented", "defaultPrevented", "originalEvent", "mousePos", "MapTouchEvent", "changedTouches", "touchPos", "getCanvasContainer", "lngLats", "curr", "MapWheelEvent", "MapEventHandler", "_clickTolerance", "clickTolerance", "_mousedownPos", "_firePreventable", "mapEvent", "isActive", "BlockableMapEventHandler", "_delayContextMenu", "_ignoreContextMenu", "_contextMenuEvent", "TransformProvider", "_requestedCameraState", "BoxZoomHandler", "_tr", "_el", "getContainer", "boxZoom", "_boxZoomEnd", "boxZoomEnd", "_enabled", "_active", "shiftKey", "button", "_startPos", "_lastPos", "_box", "classList", "_fireEvent", "cameraAnimation", "fitScreenCoordinates", "keyCode", "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", "isValidStartEvent", "startMove", "isValidMoveEvent", "movePoint", "_move", "isValidEndEvent", "getClickTolerance", "LEFT_BUTTON", "RIGHT_BUTTON", "BUTTONS_FLAGS", "LEFT_BUTTON$1", "RIGHT_BUTTON$1", "MouseMoveStateManager", "_correctEvent", "checkCorrectEvent", "_eventButton", "flag", "buttons", "OneFingerTouchMoveStateManager", "_firstTouch", "targetTouches", "_isOneFingerTouch", "_isSameTouchEvent", "MouseOrTouchMoveStateManager", "mouseMoveStateManager", "oneFingerTouchMoveStateManager", "onMouseEvent", "onTouchEvent", "TouchEvent", "_executeRelevantHandler", "dragStart", "dragMove", "dragEnd", "TouchPanHandler", "_touches", "_sum", "touchesCount", "cooperativeGestures", "_calculateTransform", "_shouldBePrevented", "notifyGestureBlocked", "touchPointSum", "touchDeltaSum", "touchDeltaCount", "TwoFingersTouchHandler", "_firstTwoTouches", "_start", "getTouchById", "_aroundCenter", "getZoomDelta", "lastDistance", "TwoFingersTouchZoomHandler", "_zoomRate", "_zoomThreshold", "zoomRate", "zoomThreshold", "_distance", "_startDistance", "getBearingDelta", "angleWith", "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", "ctrlKey", "metaKey", "zoomDir", "bearingDir", "pitchDir", "xDir", "yDir", "easeId", "easeOut", "disableRotation", "enableRotation", "wheelZoomDelta", "wheelZoomRate", "ScrollZoomHandler", "triggerRenderFrame", "_onTimeout", "initialEvent", "_type", "_delta", "_lastValue", "_triggerRenderFrame", "_defaultZoomRate", "_wheelZoomRate", "_finishTimeout", "_zooming", "isBypassed", "deltaMode", "DOM_DELTA_LINE", "deltaY", "timeDelta", "_lastWheelEventTime", "_timeout", "_lastWheelEvent", "_needsRerender", "_aroundPoint", "renderFrame", "_lastExpectedZoom", "externalZoomChange", "_startZoom", "_targetZoom", "currentSnapped", "_easing", "_smoothOutEasing", "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", "mouseRoll", "_pitchWithRotate", "pitchWithRotate", "_rollEnabled", "rollEnabled", "_mouseRotate", "_mousePitch", "_mouseRoll", "TwoFingersTouchZoomRotateHandler", "touchZoom", "touchRotate", "tapDragZoom", "_touchZoom", "_touchRotate", "_tapDragZoom", "setZoomRate", "setZoomThreshold", "CooperativeGesturesHandler", "_bypassKey", "_setupUI", "mapCanvasContainer", "desktopMessage", "_getUIString", "mobileMessage", "desktopDiv", "textContent", "mobileDiv", "setAttribute", "_destroyUI", "gestureType", "isMoving", "drag", "RenderFrameEvent", "hasChange", "HandlerManager", "_ownerDocument", "handleWindowEvent", "handleEvent", "eventName", "_updatingCamera", "inputEvent", "mergedHandlerResult", "eventsInProgress", "activeHandlers", "handlerName", "_handlers", "_blockedByActive", "isPointableEvent", "isTouchableEvent", "_getMapTouches", "isTouchableOrPointableType", "mergeHandlerResult", "deactivatedHandlers", "_previousActiveHandlers", "_changes", "_stop", "_inertia", "_fireEvents", "_handlersById", "_bearingSnap", "bearingSnap", "_eventsInProgress", "_addDefaultHandlers", "passive", "capture", "listenerOptions", "interactive", "tapZoom", "doubleClickZoom", "touchPitch", "aroundCenter", "minPixelCenterThreshold", "rotateDegreesPerPixelMoved", "getAngleDelta", "pitchDegreesPerPixelMoved", "rollDegreesPerPixelMoved", "dragPan", "scrollZoom", "keyboard", "allowEndAnimation", "isRotating", "myName", "handlerResult", "_applyChanges", "combinedEventsInProgress", "combinedDeactivatedHandlers", "change", "_updateMapTransform", "combinedResult", "_getTransformForUpdate", "_terrainMovement", "deltasForHelper", "_handleMapControls", "_applyUpdatedTransform", "record", "_elevationFreeze", "newEventsInProgress", "wasMoving", "nowMoving", "startEvents", "endEvents", "originalEndEvent", "stillMoving", "finishedMoving", "getCenterClampedToGround", "inertialEase", "_onMoveEnd", "shouldSnapToNorth", "essential", "resetNorth", "freezeElevation", "_requestFrame", "_renderTaskQueue", "_frameId", "Camera", "_renderFrameCallback", "_easeStart", "_easeOptions", "_onEaseFrame", "_easeFrameId", "_requestRenderFrame", "_moving", "_zoomSnap", "newTransform", "newCameraHelper", "getCenterElevation", "_centerClampedToGround", "centerClampedToGround", "panTo", "zoomTo", "getVerticalFieldOfView", "snap", "getPadding", "rotateTo", "getRoll", "_cameraForBoxAndBearing", "defaultPadding", "_fitInternal", "cameraForBounds", "calculatedOptions", "flyTo", "bearingChanged", "pitchChanged", "rollChanged", "zoomChanged", "altitudeFrom", "altitudeTo", "fromMercator", "toMercator", "distance3D", "groundDistance", "cameraLngLat", "cameraAlt", "centerInfo", "startBearing", "startPitch", "startRoll", "_normalizeBearing", "currently", "_rotating", "pitching", "_pitching", "rolling", "_rolling", "easeHandler", "_padding", "_easeId", "_prepareEase", "_prepareElevation", "_ease", "_updateElevation", "_fireMoveEvents", "interruptingEaseId", "_finalizeElevation", "_afterEase", "_elevationCenter", "_elevationStart", "_elevationTarget", "getMinTileElevationForLngLatZoom", "pitch1", "transformCameraUpdate", "cameraAltitude", "minAltitude", "newCamera", "calculateCameraOptionsFromTo", "modifiers", "_elevateCameraIfInsideTerrain", "finalTransform", "modifier", "nextTransform", "wasZooming", "wasRotating", "wasPitching", "wasRolling", "coercedOptions", "curve", "flyToHandler", "rho", "u1", "rho2", "zoomOutFactor", "descent", "sinh", "cosh", "r0", "u", "S", "screenSpeed", "maxDuration", "isEasing", "allowGestures", "_cancelRenderFrame", "_onEaseEnd", "onEaseEnd", "handlers", "currentBearing", "defaultAttributionControlOptions", "compact", "customAttribution", "AttributionControl", "_toggleAttribution", "_updateData", "_updateAttributions", "_updateCompact", "_compact", "_updateCompactMinimize", "getDefaultPosition", "_compactButton", "_setElementTitle", "_innerContainer", "_attribHTML", "title", "attributions", "styleOwner", "owner", "styleId", "attrib", "attribHTML", "sanitize", "_editLink", "LogoControl", "containerChildren", "rel", "display", "TaskQueue", "_queue", "_id", "_cleared", "_currentlyRunning", "cancelled", "running", "pos3dAttributes", "TerrainTileManager", "_lastTilesetChange", "_renderableTilesKeys", "_sourceTileCache", "deltaZoom", "destruct", "_getTerrainCoordsForTileRanges", "_getTerrainCoordsForRegularTile", "terrainTileID", "mat", "_isWithinTileRanges", "dx2", "dy2", "searchForDEM", "findTileInCaches", "getByKey", "canonicalTileRanges", "Terrain", "_meshCache", "qualityFactor", "meshSize", "_demMatrixCache", "_coordsTextureSize", "_fboCoordsTexture", "_fboDepthTexture", "_emptyDemTexture", "_emptyDepthTexture", "_coordsTexture", "normalizeCoordinates", "vec2.transformMat4", "isInBoundsForZoomLngLat", "_getOverscaledTileIDFromLngLatZoom", "terrainCoveringTiles", "getDEMElevation", "_emptyDemUnpack", "_emptyDemMatrix", "sourceTile", "getSourceTile", "matrixKey", "demMatrix", "mat4.fromScaling", "DEPTH_COMPONENT16", "fbHeight", "coordsSize", "tileId", "globeEnabled", "northPole", "southPole", "Pos3dArray", "meshSize2", "offsetTop", "offsetBottom", "offsetBottomEdge", "northY", "northZ", "southY", "southZ", "offsetLeft", "offsetRight", "mercatorCoordinate", "tileY", "RenderPool", "_context", "_objects", "_recentlyUsed", "_stamp", "DEPTH_STENCIL", "stamp", "inUse", "getOrCreateFreeObject", "_createObject", "freeAllObjects", "freeObject", "isFull", "LAYERS_TO_TEXTURES", "RenderToTexture", "pool", "getObjectForId", "_stacks", "_prevType", "_rttTiles", "_renderableTiles", "_renderableLayerIds", "_coordsAscending", "getTerrainCoords", "_rttFingerprints", "fingerprint", "isLastLayer", "useObject", "stampObject", "defaultLocale", "packageJSON", "attributionControl", "maplibreLogo", "refreshExpiredTiles", "canvasContextAttributes", "antialias", "preserveDrawingBuffer", "powerPreference", "failIfMajorPerformanceCaveat", "desynchronized", "contextType", "trackResize", "maxTileCacheSize", "maxTileCacheZoomLevels", "reduceMotion", "maxCanvasSize", "experimentalZoomLevelsToOverscale", "_idleTriggered", "_crossFadingFactor", "_controls", "_lostContextStyle", "_contextLost", "_getStyleAndImages", "_contextRestored", "setStyle", "_setupPainter", "_resizeInternal", "_onMapScroll", "scrollTop", "scrollLeft", "_onWindowOnline", "_interactive", "_canvasContextAttributes", "_trackResize", "_crossSourceCollisions", "_locale", "_overridePixelRatio", "_maxCanvasSize", "setAnisotropicFilterPitch", "_imageQueueHandle", "_resolveContainer", "maxBounds", "_setupContainer", "_setupResizeObserver", "_hash", "addTo", "fitBounds", "fitBoundsOptions", "shouldConstrainUsingMercatorTransform", "_localIdeographFontFamily", "_validateStyle", "addControl", "logoPosition", "_resizeTransform", "setGlobalStateProperty", "control", "controlElement", "positionContainer", "_controlPositions", "insertBefore", "firstChild", "ci", "fireMoving", "_containerDimensions", "clampedPixelRatio", "_getClampedPixelRatio", "_resizeCanvas", "maxCanvasWidth", "maxCanvasHeight", "canvasWidth", "canvasHeight", "zoomBefore", "pitchBefore", "getAnisotropicFilterPitch", "_anisotropicFilterPitch", "getRenderWorldCopies", "mousein", "existingLayers", "delegates", "delegate", "delegatedListener", "_delegatedListeners", "layerIdsOrListener", "_createDelegatedListener", "_saveDelegatedListener", "_removeDelegatedListener", "geometryOrOptions", "isGeometry", "_diffStyle", "_updateStyle", "setTransformRequest", "_diffStyleRequest", "_remove", "loadURL", "loadJSON", "_lazyInitEmptyStyle", "_updateDiff", "getStyle", "isStyleLoaded", "_terrainDataCallback", "thisLayer", "freeRtt", "refreshTiles", "existingImage", "imageData", "beforeId", "moveLayer", "getFilter", "addSprite", "removeSprite", "spriteUrl", "_canvasContainer", "_canvas", "clientWidth", "clientHeight", "initialResizeEventCaptured", "throttledResizeCallback", "redraw", "ResizeObserverClass", "ResizeObserver", "_resizeObserver", "observe", "HTMLElement", "nodeType", "canvasContainer", "dimensions", "controlContainer", "_controlContainer", "positionName", "premultipliedAlpha", "webglcontextcreationerrorDetailObject", "requestedAttributes", "statusMessage", "msg", "newProjection", "_styleDirty", "_sourcesDirty", "updateStyle", "paintStartTimeStamp", "crossFading", "globeRenderingChanged", "setTransitionState", "_updateSources", "_placementDirty", "_f", "_updatePlacement", "somethingDirty", "_repaint", "_fullyLoaded", "_render", "disconnect", "loseContext", "_showTileBoundaries", "_showPadding", "repaint", "_vertices", "getCameraTargetElevation", "showCompass", "showZoom", "visualizePitch", "visualizeRoll", "MouseRotateWrapper", "_rotatePitchHandler", "offTemp", "supportsGeolocation", "smartWrap", "priorPos", "useNormalWrap", "originalLngLat", "anchorTranslate", "applyAnchorClass", "prefix", "Marker", "_onClick", "_onKeyPress", "togglePopup", "_onMapClick", "targetElement", "_element", "_popup", "isFullyLoaded", "_lngLat", "_flatPos", "_rotationAlignment", "_rotation", "_pitchAlignment", "_subpixelPositioning", "_anchor", "_updateOpacity", "_onMove", "_isDragging", "_pointerdownPos", "_positionDelta", "setLngLat", "pointerEvents", "_onUp", "_addDragHandler", "_color", "_draggable", "draggable", "subpixelPositioning", "setOpacity", "opacityWhenCovered", "_defaultMarker", "svg", "createNS", "defaultHeight", "defaultWidth", "setAttributeNS", "markerLarge", "page1", "shadow", "ellipses", "rx", "ry", "ellipse", "bgPath", "border", "borderPath", "maki", "circleContainer", "circle1", "circle2", "hasAttribute", "setDraggable", "_opacityTimeout", "getLngLat", "getElement", "popup", "_originalTabIndex", "markerHeight", "markerRadius", "linearOffset", "getAttribute", "getPopup", "_opacityWhenCovered", "isOpen", "force", "targetOpacity", "_opacity", "toggle", "terrainDistance", "depthAtPoint", "metersToCenter", "elevationToCenter", "terrainDistanceCenter", "centerIsInvisible", "getOffset", "shouldBeDraggable", "isDraggable", "getRotation", "getRotationAlignment", "getPitchAlignment", "positionOptions", "enableHighAccuracy", "maximumAge", "trackUserLocation", "showAccuracyCircle", "showUserLocation", "numberOfWatches", "noTimeout", "updateScale", "optWidth", "globeWidth", "maxMeters", "distanceTo", "maxFeet", "setScale", "maxDistance", "pow10", "multiplier", "closeButton", "closeOnClick", "focusAfterOpen", "locationOccludedOpacity", "focusQuerySelector", "normalizeOffset", "cornerOffset", "convertedOffset", "_onFullscreenChange", "fullscreenElement", "webkitFullscreenElement", "shadowRoot", "_fullscreen", "_handleFullscreenChange", "_onClickFullscreen", "_isFullscreen", "_exitFullscreen", "_requestFullscreen", "_pseudo", "pseudo", "_fullscreenchange", "_fullscreenButton", "_updateTitle", "_getTitle", "_prevCooperativeGesturesEnabled", "_togglePseudoFullScreen", "exitFullscreen", "webkitCancelFullScreen", "requestFullscreen", "webkitRequestFullscreen", "_onSuccess", "_isOutOfMapMaxBounds", "_setErrorState", "_updateMarker", "_finish", "_lastKnownPosition", "_watchState", "_geolocateButton", "_updateCamera", "_dotElement", "longitude", "accuracy", "newBounds", "geolocateSource", "_accuracyCircleMarker", "_userLocationDotMarker", "_accuracy", "_updateCircleRadiusIfNeeded", "_onUpdate", "_onError", "_geolocationWatchID", "_clearWatch", "_timeoutId", "_onMoveStart", "fromResize", "ResizeObserverEntry", "_finishSetupUI", "supported", "_circleElement", "_setup", "forceRecalculation", "permissions", "geolocation", "checkGeolocationSupport", "clearWatch", "userLocation", "screenPosition", "userLocationWith100Px", "pixelsToMeters", "toFixed", "watchPosition", "getCurrentPosition", "_toggleProjection", "_updateGlobeIcon", "_globeButton", "_updateZoomButtons", "isMax", "isMin", "_zoomInButton", "_zoomOutButton", "_rotateCompassArrow", "_compassIcon", "_setButtonTitle", "_createButton", "zoomIn", "zoomOut", "_compass", "resetNorthPitch", "_handler", "_content", "_onClose", "_trackPointer", "_tip", "_closeButton", "cursor", "anchorComponents", "offsetedPos", "closeOnMove", "_focusFirstElement", "trackPointer", "setDOMContent", "createTextNode", "frag", "createDocumentFragment", "temp", "getMaxWidth", "htmlNode", "hasChildNodes", "removeChild", "_createCloseButton", "firstFocusable", "querySelector", "focus", "setUnit", "_toggleTerrain", "_updateTerrainIcon", "_terrainButton", "SourceType", "workerUrl", "numRequests", "setNow", "lazy", "setRTLTextPlugin", "maplibregl", "global", "window", "slice", "push", "indexOf", "hasOwn", "isFunction", "isWindow", "document", "toType", "version", "jQuery", "selector", "len", "copy", "clone", "length", "isArrayLike", "arr", "invert", "pop", "sort", "documentElement", "rquickExpr", "escape", "e", "find", "m", "i", "tokenize", "keys", "cache", "fn", "assert", "matches", "node", "compare", "start", "dir", "hash", "tokens", "base", "map", "filter", "elem", "self", "init", "add", "value", "deferred", "process", "error", "Data", "getData", "data", "count", "scale", "nodeName", "div", "handlers", "box", "name", "end", "Animation", "index", "stop", "max", "location", "val", "settings", "completed", "position", "offset", "top", "method", "type", "elementMap", "Map", "Data", "set", "element", "key", "instance", "has", "instanceMap", "get", "size", "console", "error", "Array", "from", "keys", "remove", "delete", "MAX_UID", "MILLISECONDS_MULTIPLIER", "TRANSITION_END", "parseSelector", "selector", "window", "CSS", "escape", "replace", "match", "id", "toType", "object", "undefined", "Object", "prototype", "toString", "call", "toLowerCase", "getUID", "prefix", "Math", "floor", "random", "document", "getElementById", "getTransitionDurationFromElement", "transitionDuration", "transitionDelay", "getComputedStyle", "floatTransitionDuration", "Number", "parseFloat", "floatTransitionDelay", "split", "triggerTransitionEnd", "dispatchEvent", "Event", "isElement", "jquery", "nodeType", "getElement", "length", "querySelector", "isVisible", "getClientRects", "elementIsVisible", "getPropertyValue", "closedDetails", "closest", "summary", "parentNode", "isDisabled", "Node", "ELEMENT_NODE", "classList", "contains", "disabled", "hasAttribute", "getAttribute", "findShadowRoot", "documentElement", "attachShadow", "getRootNode", "root", "ShadowRoot", "noop", "reflow", "offsetHeight", "getjQuery", "jQuery", "body", "DOMContentLoadedCallbacks", "onDOMContentLoaded", "callback", "readyState", "addEventListener", "push", "isRTL", "dir", "defineJQueryPlugin", "plugin", "$", "name", "NAME", "JQUERY_NO_CONFLICT", "fn", "jQueryInterface", "Constructor", "noConflict", "execute", "possibleCallback", "args", "defaultValue", "executeAfterTransition", "transitionElement", "waitForTransition", "durationPadding", "emulatedDuration", "called", "handler", "target", "removeEventListener", "setTimeout", "getNextActiveElement", "list", "activeElement", "shouldGetNext", "isCycleAllowed", "listLength", "index", "indexOf", "max", "min", "namespaceRegex", "stripNameRegex", "stripUidRegex", "eventRegistry", "uidEvent", "customEvents", "mouseenter", "mouseleave", "nativeEvents", "Set", "makeEventUid", "uid", "getElementEvents", "bootstrapHandler", "event", "hydrateObj", "delegateTarget", "oneOff", "EventHandler", "off", "type", "apply", "bootstrapDelegationHandler", "domElements", "querySelectorAll", "domElement", "findHandler", "events", "callable", "delegationSelector", "values", "find", "normalizeParameters", "originalTypeEvent", "delegationFunction", "isDelegated", "typeEvent", "getTypeEvent", "addHandler", "wrapFunction", "relatedTarget", "handlers", "previousFunction", "removeHandler", "Boolean", "removeNamespacedHandlers", "namespace", "storeElementEvent", "handlerKey", "entries", "includes", "on", "one", "inNamespace", "isNamespace", "startsWith", "elementEvent", "slice", "keyHandlers", "trigger", "jQueryEvent", "bubbles", "nativeDispatch", "defaultPrevented", "isPropagationStopped", "isImmediatePropagationStopped", "isDefaultPrevented", "evt", "cancelable", "preventDefault", "obj", "meta", "value", "_unused", "defineProperty", "configurable", "normalizeData", "JSON", "parse", "decodeURIComponent", "normalizeDataKey", "chr", "Manipulator", "setDataAttribute", "setAttribute", "removeDataAttribute", "removeAttribute", "getDataAttributes", "attributes", "bsKeys", "dataset", "filter", "pureKey", "charAt", "getDataAttribute", "Config", "Default", "DefaultType", "Error", "_getConfig", "config", "_mergeConfigObj", "_configAfterMerge", "_typeCheckConfig", "jsonConfig", "constructor", "configTypes", "property", "expectedTypes", "valueType", "RegExp", "test", "TypeError", "toUpperCase", "VERSION", "BaseComponent", "_element", "_config", "DATA_KEY", "dispose", "EVENT_KEY", "propertyName", "getOwnPropertyNames", "_queueCallback", "isAnimated", "getInstance", "getOrCreateInstance", "eventName", "getSelector", "hrefAttribute", "trim", "map", "sel", "join", "SelectorEngine", "concat", "Element", "findOne", "children", "child", "matches", "parents", "ancestor", "prev", "previous", "previousElementSibling", "next", "nextElementSibling", "focusableChildren", "focusables", "el", "getSelectorFromElement", "getElementFromSelector", "getMultipleElementsFromSelector", "enableDismissTrigger", "component", "method", "clickEvent", "tagName", "EVENT_CLOSE", "EVENT_CLOSED", "CLASS_NAME_FADE", "CLASS_NAME_SHOW", "Alert", "close", "closeEvent", "_destroyElement", "each", "data", "DATA_API_KEY", "CLASS_NAME_ACTIVE", "SELECTOR_DATA_TOGGLE", "EVENT_CLICK_DATA_API", "Button", "toggle", "button", "EVENT_TOUCHSTART", "EVENT_TOUCHMOVE", "EVENT_TOUCHEND", "EVENT_POINTERDOWN", "EVENT_POINTERUP", "POINTER_TYPE_TOUCH", "POINTER_TYPE_PEN", "CLASS_NAME_POINTER_EVENT", "SWIPE_THRESHOLD", "endCallback", "leftCallback", "rightCallback", "Swipe", "isSupported", "_deltaX", "_supportPointerEvents", "PointerEvent", "_initEvents", "_start", "touches", "clientX", "_eventIsPointerPenTouch", "_end", "_handleSwipe", "_move", "absDeltaX", "abs", "direction", "add", "pointerType", "navigator", "maxTouchPoints", "ARROW_LEFT_KEY", "ARROW_RIGHT_KEY", "TOUCHEVENT_COMPAT_WAIT", "ORDER_NEXT", "ORDER_PREV", "DIRECTION_LEFT", "DIRECTION_RIGHT", "EVENT_SLIDE", "EVENT_SLID", "EVENT_KEYDOWN", "EVENT_MOUSEENTER", "EVENT_MOUSELEAVE", "EVENT_DRAG_START", "EVENT_LOAD_DATA_API", "CLASS_NAME_CAROUSEL", "CLASS_NAME_SLIDE", "CLASS_NAME_END", "CLASS_NAME_START", "CLASS_NAME_NEXT", "CLASS_NAME_PREV", "SELECTOR_ACTIVE", "SELECTOR_ITEM", "SELECTOR_ACTIVE_ITEM", "SELECTOR_ITEM_IMG", "SELECTOR_INDICATORS", "SELECTOR_DATA_SLIDE", "SELECTOR_DATA_RIDE", "KEY_TO_DIRECTION", "interval", "keyboard", "pause", "ride", "touch", "wrap", "Carousel", "_interval", "_activeElement", "_isSliding", "touchTimeout", "_swipeHelper", "_indicatorsElement", "_addEventListeners", "cycle", "_slide", "nextWhenVisible", "hidden", "_clearInterval", "_updateInterval", "setInterval", "_maybeEnableCycle", "to", "items", "_getItems", "activeIndex", "_getItemIndex", "_getActive", "order", "defaultInterval", "_keydown", "_addTouchEventListeners", "img", "endCallBack", "clearTimeout", "swipeConfig", "_directionToOrder", "_setActiveIndicatorElement", "activeIndicator", "newActiveIndicator", "elementInterval", "parseInt", "isNext", "nextElement", "nextElementIndex", "triggerEvent", "_orderToDirection", "slideEvent", "isCycling", "directionalClassName", "orderClassName", "completeCallBack", "_isAnimated", "clearInterval", "carousel", "slideIndex", "carousels", "EVENT_SHOW", "EVENT_SHOWN", "EVENT_HIDE", "EVENT_HIDDEN", "CLASS_NAME_COLLAPSE", "CLASS_NAME_COLLAPSING", "CLASS_NAME_COLLAPSED", "CLASS_NAME_DEEPER_CHILDREN", "CLASS_NAME_HORIZONTAL", "WIDTH", "HEIGHT", "SELECTOR_ACTIVES", "parent", "Collapse", "_isTransitioning", "_triggerArray", "toggleList", "elem", "filterElement", "foundElement", "_initializeChildren", "_addAriaAndCollapsedClass", "_isShown", "hide", "show", "activeChildren", "_getFirstLevelChildren", "startEvent", "activeInstance", "dimension", "_getDimension", "style", "complete", "capitalizedDimension", "scrollSize", "getBoundingClientRect", "selected", "triggerArray", "isOpen", "top", "bottom", "right", "left", "auto", "basePlacements", "start", "end", "clippingParents", "viewport", "popper", "reference", "variationPlacements", "placements", "beforeRead", "read", "afterRead", "beforeMain", "main", "afterMain", "beforeWrite", "write", "afterWrite", "modifierPhases", "getNodeName", "getWindow", "isHTMLElement", "isShadowRoot", "applyStyles", "effect", "getBasePlacement", "round", "getUAString", "isLayoutViewport", "x", "getLayoutRect", "isTableElement", "getDocumentElement", "getParentNode", "getTrueOffsetParent", "getContainingBlock", "getOffsetParent", "getMainAxisFromPlacement", "within", "mathMax", "mathMin", "withinMaxClamp", "getFreshSideObject", "mergePaddingObject", "expandToHashMap", "toPaddingObject", "arrow", "popperOffsets", "len", "center", "offset", "getVariation", "unsetSides", "roundOffsetsByDPR", "dpr", "mapToStyles", "position", "computeStyles", "passive", "resize", "hash", "getOppositePlacement", "getOppositeVariationPlacement", "getWindowScroll", "getWindowScrollBarX", "getViewportRect", "getDocumentRect", "isScrollParent", "getScrollParent", "listScrollParents", "rectToClientRect", "getInnerBoundingClientRect", "getClientRectFromMixedType", "getClippingParents", "getClippingRect", "computeOffsets", "detectOverflow", "computeAutoPlacement", "allPlacements", "placement", "getExpandedFallbackPlacements", "flip", "_loop", "_i", "checks", "getSideOffsets", "isAnySideFullyClipped", "distanceAndSkiddingToXY", "distance", "getAltAxis", "preventOverflow", "getHTMLElementScroll", "getNodeScroll", "isElementScaled", "getCompositeRect", "sort", "orderModifiers", "debounce", "mergeByName", "merged", "DEFAULT_OPTIONS", "areValidElements", "popperGenerator", "defaultModifiers", "defaultOptions", "createPopper", "options", "m", "state", "noopFn", "ESCAPE_KEY", "TAB_KEY", "ARROW_UP_KEY", "ARROW_DOWN_KEY", "RIGHT_MOUSE_BUTTON", "EVENT_KEYDOWN_DATA_API", "EVENT_KEYUP_DATA_API", "CLASS_NAME_DROPUP", "CLASS_NAME_DROPEND", "CLASS_NAME_DROPSTART", "CLASS_NAME_DROPUP_CENTER", "CLASS_NAME_DROPDOWN_CENTER", "SELECTOR_DATA_TOGGLE_SHOWN", "SELECTOR_MENU", "SELECTOR_NAVBAR", "SELECTOR_NAVBAR_NAV", "SELECTOR_VISIBLE_ITEMS", "PLACEMENT_TOP", "PLACEMENT_TOPEND", "PLACEMENT_BOTTOM", "PLACEMENT_BOTTOMEND", "PLACEMENT_RIGHT", "PLACEMENT_LEFT", "PLACEMENT_TOPCENTER", "PLACEMENT_BOTTOMCENTER", "autoClose", "boundary", "display", "popperConfig", "Dropdown", "_popper", "_parent", "_menu", "_inNavbar", "_detectNavbar", "showEvent", "_createPopper", "focus", "_completeHide", "destroy", "update", "hideEvent", "Popper", "referenceElement", "_getPopperConfig", "_getPlacement", "parentDropdown", "isEnd", "_getOffset", "popperData", "defaultBsPopperConfig", "modifiers", "enabled", "_selectMenuItem", "clearMenus", "openToggles", "context", "composedPath", "isMenuTarget", "dataApiKeydownHandler", "isInput", "isEscapeEvent", "isUpOrDownEvent", "getToggleButton", "stopPropagation", "EVENT_MOUSEDOWN", "className", "clickCallback", "rootElement", "Backdrop", "_isAppended", "_append", "_getElement", "_emulateAnimation", "backdrop", "createElement", "append", "EVENT_FOCUSIN", "EVENT_KEYDOWN_TAB", "TAB_NAV_FORWARD", "TAB_NAV_BACKWARD", "autofocus", "trapElement", "FocusTrap", "_isActive", "_lastTabNavDirection", "activate", "_handleFocusin", "_handleKeydown", "deactivate", "elements", "shiftKey", "SELECTOR_FIXED_CONTENT", "SELECTOR_STICKY_CONTENT", "PROPERTY_PADDING", "PROPERTY_MARGIN", "ScrollBarHelper", "getWidth", "documentWidth", "clientWidth", "innerWidth", "width", "_disableOverFlow", "_setElementAttributes", "calculatedValue", "reset", "_resetElementAttributes", "isOverflowing", "_saveInitialAttribute", "overflow", "styleProperty", "scrollbarWidth", "manipulationCallBack", "setProperty", "_applyManipulationCallback", "actualValue", "removeProperty", "callBack", "EVENT_HIDE_PREVENTED", "EVENT_RESIZE", "EVENT_CLICK_DISMISS", "EVENT_MOUSEDOWN_DISMISS", "EVENT_KEYDOWN_DISMISS", "CLASS_NAME_OPEN", "CLASS_NAME_STATIC", "OPEN_SELECTOR", "SELECTOR_DIALOG", "SELECTOR_MODAL_BODY", "Modal", "_dialog", "_backdrop", "_initializeBackDrop", "_focustrap", "_initializeFocusTrap", "_scrollBar", "_adjustDialog", "_showElement", "_hideModal", "handleUpdate", "scrollTop", "modalBody", "transitionComplete", "_triggerBackdropTransition", "event2", "_resetAdjustments", "isModalOverflowing", "scrollHeight", "clientHeight", "initialOverflowY", "overflowY", "isBodyOverflowing", "paddingLeft", "paddingRight", "alreadyOpen", "CLASS_NAME_SHOWING", "CLASS_NAME_HIDING", "CLASS_NAME_BACKDROP", "scroll", "Offcanvas", "blur", "completeCallback", "ARIA_ATTRIBUTE_PATTERN", "DefaultAllowlist", "a", "area", "b", "br", "col", "code", "dd", "div", "dl", "dt", "em", "hr", "h1", "h2", "h3", "h4", "h5", "h6", "i", "li", "ol", "p", "pre", "s", "small", "span", "sub", "sup", "strong", "u", "ul", "uriAttributes", "SAFE_URL_PATTERN", "allowedAttribute", "attribute", "allowedAttributeList", "attributeName", "nodeName", "nodeValue", "attributeRegex", "some", "regex", "sanitizeHtml", "unsafeHtml", "allowList", "sanitizeFunction", "domParser", "DOMParser", "createdDocument", "parseFromString", "elementName", "attributeList", "allowedAttributes", "innerHTML", "content", "extraClass", "html", "sanitize", "sanitizeFn", "template", "DefaultContentType", "entry", "TemplateFactory", "getContent", "_resolvePossibleFunction", "hasContent", "changeContent", "_checkContent", "toHtml", "templateWrapper", "_maybeSanitize", "text", "_setContent", "arg", "templateElement", "_putElementInTemplate", "textContent", "DISALLOWED_ATTRIBUTES", "CLASS_NAME_MODAL", "SELECTOR_TOOLTIP_INNER", "SELECTOR_MODAL", "EVENT_MODAL_HIDE", "TRIGGER_HOVER", "TRIGGER_FOCUS", "TRIGGER_CLICK", "TRIGGER_MANUAL", "EVENT_INSERTED", "EVENT_CLICK", "EVENT_FOCUSOUT", "AttachmentMap", "AUTO", "TOP", "RIGHT", "BOTTOM", "LEFT", "animation", "container", "customClass", "delay", "fallbackPlacements", "title", "Tooltip", "_isEnabled", "_timeout", "_isHovered", "_activeTrigger", "_templateFactory", "_newContent", "tip", "_setListeners", "_fixTitle", "enable", "disable", "toggleEnabled", "_leave", "_enter", "_hideModalHandler", "_disposePopper", "_isWithContent", "shadowRoot", "isInTheDom", "ownerDocument", "_getTipElement", "_isWithActiveTrigger", "_getTitle", "_createTipElement", "_getContentForTemplate", "_getTemplateFactory", "tipId", "setContent", "_initializeOnDelegatedTarget", "_getDelegateConfig", "attachment", "phase", "triggers", "eventIn", "eventOut", "_setTimeout", "timeout", "dataAttributes", "dataAttribute", "SELECTOR_TITLE", "SELECTOR_CONTENT", "Popover", "_getContent", "EVENT_ACTIVATE", "CLASS_NAME_DROPDOWN_ITEM", "SELECTOR_DATA_SPY", "SELECTOR_TARGET_LINKS", "SELECTOR_NAV_LIST_GROUP", "SELECTOR_NAV_LINKS", "SELECTOR_NAV_ITEMS", "SELECTOR_LIST_ITEMS", "SELECTOR_LINK_ITEMS", "SELECTOR_DROPDOWN", "SELECTOR_DROPDOWN_TOGGLE", "rootMargin", "smoothScroll", "threshold", "ScrollSpy", "_targetLinks", "_observableSections", "_rootElement", "_activeTarget", "_observer", "_previousScrollData", "visibleEntryTop", "parentScrollTop", "refresh", "_initializeTargetsAndObservables", "_maybeEnableSmoothScroll", "disconnect", "_getNewObserver", "section", "observe", "observableSection", "height", "offsetTop", "scrollTo", "behavior", "IntersectionObserver", "_observerCallback", "targetElement", "_process", "userScrollsDown", "isIntersecting", "_clearActiveClass", "entryIsLowerThanPrevious", "targetLinks", "anchor", "decodeURI", "_activateParents", "listGroup", "item", "activeNodes", "node", "spy", "HOME_KEY", "END_KEY", "CLASS_DROPDOWN", "SELECTOR_DROPDOWN_MENU", "NOT_SELECTOR_DROPDOWN_TOGGLE", "SELECTOR_TAB_PANEL", "SELECTOR_OUTER", "SELECTOR_INNER", "SELECTOR_INNER_ELEM", "SELECTOR_DATA_TOGGLE_ACTIVE", "Tab", "_setInitialAttributes", "_getChildren", "innerElem", "_elemIsActive", "active", "_getActiveElem", "_deactivate", "_activate", "relatedElem", "_toggleDropDown", "nextActiveElement", "preventScroll", "_setAttributeIfNotExists", "_setInitialAttributesOnChild", "_getInnerElement", "isActive", "outerElem", "_getOuterElement", "_setInitialAttributesOnTargetPanel", "open", "EVENT_MOUSEOVER", "EVENT_MOUSEOUT", "CLASS_NAME_HIDE", "autohide", "Toast", "_hasMouseInteraction", "_hasKeyboardInteraction", "_clearTimeout", "_maybeScheduleHide", "isShown", "_onInteraction", "isInteracting", "viewport", "count", "clamp", "min", "max", "left", "top", "center", "start", "colors", "x", "map", "selector", "round", "filter", "error", "features", "HTMLElement", "FrameLoadingStyle", "_a", "_b", "location", "left", "right", "selector", "FetchMethod", "error", "FormSubmissionState", "FormEnctype", "cookie", "x", "clone", "TimingMetric", "VisitState", "SystemStatusCode", "session", "visit", "PageStage", "position", "parentNode", "elementList", "render", "e", "element", "document", "createConsumer", "mixin", "m", "x", "left", "right", "application", "map", "error", "e", "filter", "fetch", "set", "selector", "match", "oldValue", "tokens", "left", "right", "length", "error", "_a", "constructor", "dependencies", "extend", "application", "element", "filter", "read", "write", "tslib", "Browser", "Env", "env", "extend", "indexOf", "map", "len", "extend", "indexOf", "len", "MapPolyfill", "HashMap", "visit", "keys", "offset", "extend", "add", "clone", "x", "out", "v1", "v2", "m", "Param", "e", "Draggable", "x", "Eventful", "len", "sum", "out", "out", "marker", "x", "_calcOut", "e", "out", "box", "addEventListener", "removeEventListener", "GestureMgr", "len", "dist", "clone", "copy", "create", "mul", "scale", "out", "m", "out2", "Point", "x", "len", "m", "out", "BoundingRect", "x", "m", "create", "scale", "clamp", "nearZero", "EmptyProxy", "HoveredResult", "x", "Handler", "storage", "out", "PI2", "x1", "compare", "start", "left", "right", "length", "offset", "m", "start2", "Storage", "roots", "len", "indexOf", "requestAnimationFrame", "EPSILON", "roots", "extrema", "out", "x1", "x2", "x", "points", "Clip", "lerp", "Entry", "LinkedList", "LRU", "map", "len", "out", "L", "color", "lerp", "extend", "stop", "color", "EPSILON", "isAroundZero", "transform", "m", "scale", "transform", "x", "out", "len", "len2", "Track", "extend", "isGradient", "mathMin", "start", "Animator", "self", "clip", "i", "Animation", "clip", "self", "FakeGlobalEvent", "addEventListener", "removeEventListener", "DOMHandlerScope", "HandlerDomProxy", "devicePixelRatio", "EPSILON", "isNotAroundZero", "create", "Transformable", "m", "mul", "copy", "out", "x", "v2", "transform", "start", "x", "adjustTextY", "len", "out", "distance", "x", "Element", "e", "m", "backgroundColor", "extend", "indexOf", "len", "self", "reverse", "target", "animator", "Group", "nextSibling", "indexOf", "tmpRect", "transform", "backgroundColor", "len", "ZRender", "storage", "start", "end", "x", "roots", "mathMin", "mathMax", "mathAbs", "clamp", "parsePercent", "x", "e", "log", "sum", "max", "len", "round", "littleThan", "lg", "error", "printableStr", "interpolateNumber", "len", "map", "len", "_a", "indexOf", "error", "getAttribute", "getKey", "keys", "interpolateNumber", "ListIterator", "start", "end", "extend", "fn", "storage", "i", "indexOf", "AreaStyleMixin", "out", "len", "extend", "RichTextToken", "RichTextLine", "tokens", "RichTextContentBlock", "line", "lineWidth", "lineHeight", "tokens", "out", "adjustTextY", "PRIMARY_STATES_KEYS", "Displayable", "m", "x", "transform", "extend", "tmpRect", "mathMin", "mathMax", "start", "points", "min", "max", "left", "right", "top", "bottom", "x1", "x2", "cubicExtrema", "cubicAt", "x", "quadraticExtremum", "quadraticAt", "min", "max", "min2", "max2", "mathMin", "mathMax", "mathCos", "mathSin", "mathAbs", "PI2", "PathProxy", "devicePixelRatio", "dpr", "x", "x1", "x2", "len", "offset", "e", "x3", "x1", "x", "_a", "_b", "containStroke", "x1", "x2", "x", "containStroke", "x1", "x2", "x", "PI2", "PI2", "containStroke", "x", "x1", "x", "dir", "CMD", "PI2", "EPSILON", "x1", "x2", "x", "dir", "len", "containStroke", "Path", "extend", "isDarkMode", "x", "containStroke", "_super", "Sub", "TSpan", "ZRImage", "x", "round", "x1", "x2", "position", "RectShape", "Rect", "x", "ZRText", "m", "tmpRect", "transform", "extend", "adjustTextY", "hasShadow", "tokens", "x", "self", "indexOf", "extend", "e", "isSeries", "error", "count", "_a", "dispatcher", "isDisabled", "WH", "XY", "applyTransform", "mergePath", "subPixelOptimize", "subPixelOptimizeLine", "subPixelOptimizeRect", "CMD", "mathSqrt", "m", "len", "L", "x", "mathSqrt", "mathSin", "mathCos", "PI", "x1", "x2", "PI", "mathCos", "mathSin", "mathSqrt", "CMD", "len", "SVGPath", "m", "extend", "Sub", "CircleShape", "Circle", "EllipseShape", "Ellipse", "x", "PI", "PI2", "mathSin", "mathCos", "mathAbs", "mathSqrt", "mathMax", "mathMin", "x1", "x2", "len", "buildPath", "_a", "SectorShape", "Sector", "buildPath", "RingShape", "Ring", "x", "PI2", "points", "v1", "v2", "min", "max", "len", "clone", "sum", "add", "buildPath", "points", "len", "PolygonShape", "Polygon", "buildPath", "PolylineShape", "Polyline", "buildPath", "subPixelOptimizeOutputShape", "LineShape", "Line", "x1", "x2", "subPixelOptimizeOutputShape", "BezierCurveShape", "BezierCurve", "x1", "x2", "ArcShape", "Arc", "x", "CompoundPath", "scale", "Gradient", "offset", "color", "LinearGradient", "x", "x2", "RadialGradient", "x", "mathMin", "mathMax", "mathAbs", "_intersectCtx", "_minTv", "_maxTv", "OrientedBoundingRect", "transform", "x", "x2", "self", "out", "min", "max", "IncrementalDisplayable", "x", "XY", "WH", "layout", "mergePath", "m", "subPixelOptimizeLine", "subPixelOptimizeRect", "subPixelOptimize", "mul", "applyTransform", "transform", "invert", "mathAbs", "points", "x", "mathMax", "mathMin", "x2", "extend", "x1", "copy", "create", "max", "min", "el", "labelStatesTexts", "extend", "TextStyleMixin", "LineStyleMixin", "ItemStyleMixin", "Model", "indexOf", "len", "e", "m", "x", "normalizeCssArray", "color", "m", "CoordinateSystemManager", "isSeries", "error", "_a", "each", "x", "viewRect", "center", "parsePercent", "_a", "normalizeCssArray", "left", "top", "right", "bottom", "error", "out", "transform", "merge", "copy", "ComponentModel", "defaultOption", "indexOf", "extend", "count", "start", "len", "idxResult", "val", "PaletteMixin", "inner", "error", "GlobalModel", "theme", "optionPreprocessorFuncs", "extend", "cmpts", "i", "cmpt", "ExtensionAPI", "OptionManager", "optionPreprocessorFuncs", "len", "error", "each", "isObject", "len", "set", "seriesType", "option", "v1", "sum", "SourceImpl", "len", "DefaultDataProvider", "out", "_a", "extend", "offset", "start", "end", "storage", "min", "max", "count", "error", "out", "DataFormatMixin", "color", "isSeries", "len", "error", "define", "Task", "start", "end", "end", "e", "FilterOrderComparator", "SortOrderComparator", "order", "FilterEqualityComparator", "ExternalSource", "len", "extend", "errMsg", "end", "DataStore", "offset", "len", "start", "end", "dim", "sum", "left", "right", "count", "min", "max", "min2", "max2", "SourceManager", "errMsg", "datasetModel", "subMarkupText", "extend", "_a", "color", "TooltipMarkupStyleCreator", "isValueMultipleLine", "inner", "SeriesModel", "dist", "color", "tmpArr", "_a", "_b", "len", "ComponentView", "Component_default", "inner", "inner", "ChartView", "error", "inner", "fn", "debounce", "inner", "getStyle", "color", "data", "extend", "PI", "Scheduler", "opt", "seriesType", "create", "e", "color", "ECEventProcessor", "query", "extend", "data", "i", "symbolPropName", "seriesType", "extend", "WeakMap", "x", "out", "color", "innerColor", "parsePercent", "x", "x2", "min", "_a", "scale", "x", "m", "dpr", "len", "dpr", "pattern", "keys", "cache", "i", "warn", "x", "left", "y", "width", "height", "scale", "decal", "error", "version", "MessageCenter", "ECharts", "theme", "e", "error", "self", "mathMin", "mathMax", "instances", "x", "extend", "chart", "view", "Component_default", "_a", "backgroundColor", "actionInfo", "updateZ", "storage", "_super", "init", "dispose", "getAttribute", "indexOf", "registerCustomSeries", "seriesType", "fn", "indexOf", "registerMap", "getMap", "DataDiffer", "map", "DimensionUserOuput", "SeriesDimensionDefine", "extend", "inner", "SeriesDataSchema", "hash", "inner", "isObject", "map", "CtorInt32Array", "SeriesData", "_a", "start", "end", "extend", "len", "layout", "merge", "helper_exports", "createTextStyle", "dataStack", "resultItem", "coordDim", "resultDimIdx", "extend", "i", "count", "map", "CoordSysInfo", "fetch", "scale", "contain", "ScaleCalculator", "normalize", "normalize", "scale", "base", "Scale", "start", "end", "OrdinalMeta", "map", "OrdinalScale", "contain", "len", "IntervalScale", "contain", "count", "min", "max", "seriesType", "key", "min", "scale", "parsePercent", "offset", "seriesType", "valueAxis", "data", "count", "x", "x", "TimeScale", "settings", "indexOf", "contain", "out", "levelTicks", "i", "mathPow", "LogScale", "base", "start", "end", "_a", "ScaleRawExtentInfo", "scale", "min", "max", "scale", "scale", "min", "max", "error", "AxisModelCommonMixin", "dataStack", "scale", "Model", "createTextStyle", "Component_default", "seriesType", "indexOf", "EPSILON", "isAroundEqual", "contain", "points", "x", "points", "transform", "min", "max", "len", "x1", "Region", "center", "GeoJSONPolygonGeometry", "GeoJSONLineStringGeometry", "points", "GeoJSONRegion", "min", "max", "points", "len", "contain", "x", "transform", "GeoSVGRegion", "center", "mul", "features", "x", "number_exports", "parsePercent", "graphic_exports", "mergePath", "format_exports", "normalizeCssArray", "util_exports", "extend", "indexOf", "cache", "tickValue", "Axis", "scale", "min", "max", "start", "end", "clamp", "len", "littleThan", "Model", "View", "Component_default", "PI2", "CMD", "distance", "x", "out", "x1", "x2", "dist", "points", "len", "labelLayout", "out", "offset", "transform", "len", "XY", "WH", "delta", "start", "end", "i", "item", "rect", "dir", "points", "keys", "LabelManager", "transform", "parsePercent", "indexOf", "LineSeriesModel", "len", "Symbol", "extend", "idx", "scale", "SymbolDraw", "el", "valueAxis", "len", "mathMin", "mathMax", "x", "points", "start", "dir", "ECPolylineShape", "ECPolyline", "len", "CMD", "roots", "x2", "x3", "ECPolygonShape", "ECPolygon", "points", "len", "x", "points2", "points", "x", "_a", "_b", "min2", "max2", "len", "reference", "color", "lerp", "stop", "categoryAxis", "isPointNull", "LineView", "start", "end", "dataIndex", "distance", "inner", "i", "el", "offset", "seriesType", "data", "points", "offset", "x", "sum", "count", "max", "min", "seriesType", "valueAxis", "dpr", "BaseBarSeriesModel", "offset", "BarSeriesModel", "SausageShape", "SausagePath", "PI2", "out", "opts", "distance", "mathCos", "mathSin", "x", "rotate", "mathMax", "mathMin", "BarView", "layout", "scale", "len", "x", "x2", "extend", "isRadial", "position", "LagePathShape", "LargePath", "points", "install", "PI2", "seriesType", "_a", "viewRect", "sum", "dir", "endAngle", "layout", "seriesType", "RADIAN", "dir", "i", "dx", "len", "layout", "dist", "out", "viewRect", "label", "labelLine", "parsePercent", "linePoints", "x1", "x2", "PI", "rotate", "selectState", "PiePiece", "layout", "extend", "offset", "PieView", "extend", "LegendVisualProvider", "getRawData", "PieSeriesModel", "seriesType", "install", "ScatterSeriesModel", "LargeSymbolPathShape", "LargeSymbolPath", "points", "x", "LargeSymbolDraw", "len", "e", "ScatterView", "GridModel", "CartesianAxisModel", "_impl", "defaultOption", "AxisModel", "Cartesian", "scale", "Cartesian2D", "start", "end", "m", "clamp", "out", "x", "Axis2D", "scale", "position", "asc", "clamp", "registerAction", "_a", "PI", "AxisBuilderSharedContext", "layout", "mul", "create", "len", "AxisBuilder", "PI", "pt1", "pt2", "extend", "subPixelOptimizeLine", "create", "PI", "labelLayout", "layout", "PI", "labelLayout", "labelInner", "pt1", "pt2", "subPixelOptimizeLine", "inner", "_a", "layout", "layout", "layout", "scale", "_a", "min", "max", "Grid", "len", "scale", "axis", "_a", "indexOf", "isCategory", "XY", "WH", "mathMax", "error", "indexOf", "scale", "AxisView", "Component_default", "inner", "x", "CartesianAxisView", "subPixelOptimizeLine", "scale", "CartesianXAxisView", "CartesianYAxisView", "GridView", "Component_default", "install", "inner", "distance", "layout", "install", "points", "RadarView", "createSymbol", "data", "points", "color", "extend", "RadarSeriesModel", "len", "RadarModel", "scale", "RadarView", "colorIndex", "points", "splitAreas", "mergePath", "splitLines", "Component_default", "RadarView_default", "IndicatorAxis", "scale", "Radar", "x", "center", "parsePercent", "install", "RadarView_default", "install", "inner", "e", "RoamController", "_a", "extend", "e", "x", "scale", "settings", "tmpRect", "e", "x", "center", "SVGParser", "x", "x1", "x2", "stop", "offset", "points", "numberReg", "transform", "type", "value", "create", "scale", "mul", "GeoSVGResource", "_a", "e", "points", "points", "GeoJSONResource", "e", "MapDraw", "clip", "points", "_a", "e", "x", "extend", "x", "MapView", "layout", "offset", "MapSeries", "len", "center", "sum", "min", "max", "len", "data", "offset", "layout", "View", "x", "parsePercent", "center", "copy", "create", "dummyTransformable", "out", "transform", "Geo", "map", "x", "geoCoord", "out", "getCoordSys", "getCoordSys", "x1", "center", "parsePercent", "viewRect", "geoCoord", "GeoCreator", "extend", "GeoModel", "center", "GeoView", "e", "Component_default", "registerMap", "install", "actionInfo", "install", "init", "separation", "TreeEdgeShape", "TreePath", "parsePercent", "TreeView", "layout", "symbolNeedsDraw", "points", "min", "max", "e", "center", "rotate", "_a", "x1", "x2", "inner", "extend", "TreeNode", "order", "len", "layout", "merge", "Tree", "len", "parentNode", "indexOf", "TreeSeriesModel", "center", "separation", "layout", "separation", "init", "x", "extend", "install", "decalPaletteScope", "TreemapSeriesModel", "extend", "sum", "Breadcrumb", "x", "points", "AnimationWrap", "count", "len", "Group", "Rect", "inner", "TreemapView", "indexOf", "getKey", "storage", "willDeleteEls", "extend", "e", "x", "m", "create", "scale", "isDisabled", "group", "bg", "content", "thisLayout", "depth", "parentNode", "each", "isObject", "VisualMapping", "abs", "len", "out", "color", "isCategory", "inner", "extend", "color", "mathMax", "mathMin", "each", "parsePercent", "each", "extend", "mathMax", "mathMin", "len", "sort", "sum", "scale", "layout", "install", "extend", "normalize", "symbolType", "symbolSize", "extend", "length", "len", "keys", "clone", "points", "layout", "PI", "count", "_a", "clone", "sum", "extend", "scaleAndAdd", "center", "clone", "i", "e", "n", "edges", "e", "points", "extend", "viewRect", "createViewCoordSys", "min", "max", "StraightLineShape", "CurveShape", "ECLinePath", "createSymbol", "points", "Line", "distance", "parentNode", "percent", "tangent", "dir", "Line_default", "LineDraw", "Line_default", "makeSeriesScope", "el", "quadraticAt", "mathAbs", "center", "scale", "quadraticSubdivide", "clone", "inner", "GraphView", "forceLayout", "layout", "e", "self", "x", "sub", "extend", "Graph", "len", "e", "GraphNode", "GraphEdge", "layout", "merge", "indexOf", "GraphSeriesModel", "self", "extend", "center", "install", "ChordPiece", "layout", "extend", "ChordPathShape", "ChordEdge", "layout", "extend", "color", "RADIAN", "ChordView", "layout", "center", "parsePercent", "ChordSeriesModel", "RADIAN", "_a", "dir", "install", "PointerShape", "PointerPath", "mathCos", "mathSin", "x", "center", "parsePercent", "GaugeView", "sector", "getColor", "percent", "i", "distance", "rotate", "showPointer", "endAngle", "extend", "value", "GaugeSeriesModel", "install", "FunnelPiece", "layout", "labelLayout", "FunnelView", "FunnelSeriesModel", "sum", "sort", "len", "layout", "points", "x1", "x2", "viewRect", "x", "parsePercent", "min", "max", "idx", "offset", "start", "end", "install", "ParallelView", "makeSeriesScope", "add", "points", "ParallelSeriesModel", "opacityAccessPath", "ParallelView", "extend", "Component_default", "e", "dist", "ParallelView_default", "ParallelModel", "ParallelAxis", "scale", "dist", "extend", "each", "mathMin", "mathMax", "mathFloor", "mathCeil", "round", "PI", "Parallel", "isCategory", "layout", "restrict", "position", "transform", "create", "start", "end", "applyTransform", "len", "ParallelAxisModel", "len", "mathMin", "mathMax", "mathPow", "BrushController", "panelOpts", "getKey", "e", "transform", "trigger", "dist", "trigger", "mathMax", "x", "x2", "min", "mathMin", "max", "getTransform", "map", "dir", "points", "e", "base", "e", "ParallelAxisView", "extend", "Component_default", "install", "ParallelView_default", "install", "SankeyPathShape", "SankeyPath", "SankeyView", "x1", "x2", "layout", "createGridClipShape", "SankeySeriesModel", "layout", "center", "x", "node", "sum", "len", "center", "install", "WhiskerBoxCommonMixin", "extend", "BoxplotSeriesModel", "BoxplotView", "BoxPathShape", "BoxPath", "points", "each", "indexOf", "parsePercent", "base", "offset", "end2", "axisDimVal", "dataIndex", "ends", "start", "min", "max", "install", "extend", "CandlestickView", "createNormalBox", "createLarge", "NormalBoxPathShape", "NormalBoxPath", "transInit", "color", "points", "LargeBoxPathShape", "LargeBoxPath", "x", "CandlestickSeriesModel", "data", "axisDimVal", "ends", "start", "subPixelOptimize", "lowestVal", "highestVal", "points", "offset", "parsePercent", "install", "color", "EffectSymbol", "EffectScatterView", "clone", "EffectScatterSeriesModel", "install", "EffectLine", "Line_default", "color", "points", "idx", "quadraticAt", "quadraticDerivativeAt", "Polyline", "points", "Polyline_default", "EffectPolyline", "Polyline_default", "points", "len", "start", "LargeLinesPathShape", "LargeLinesPath", "count", "x1", "x2", "x", "containStroke", "points", "LargeLineDraw", "e", "error", "points", "offset", "len", "LinesView", "Polyline_default", "Line_default", "LinesSeriesModel", "out", "offset", "len", "count", "x", "normalize", "data", "symbolType", "symbolSize", "install", "HeatmapLayer", "normalize", "brush", "len", "x", "offset", "color", "len", "HeatmapView", "start", "end", "layout", "x", "x2", "points", "HeatmapSeriesModel", "install", "PictorialBarView", "updateCommon", "layout", "isAnimationEnabled", "valueAxis", "parsePercent", "extend", "path", "index", "position", "PictorialBarSeriesModel", "install", "ThemeRiverView", "self", "process", "layout", "x", "createGridClipShape", "createGridClipShape", "ThemeRiverSeriesModel", "count", "dist", "parsePercent", "base", "m", "max", "sum", "install", "SunburstPiece", "layout", "extend", "cornerRadius", "rotate", "extend", "SunburstView", "self", "newChildren", "oldChildren", "getKey", "removeNode", "virtualRoot", "e", "SunburstSeriesModel", "completeTreeValue", "sum", "RADIAN", "seriesType", "center", "parsePercent", "sort", "initChildren", "sum", "dir", "renderNode", "startAngle", "angle", "rStart", "rEnd", "node", "color", "extend", "install", "CustomSeriesModel", "dataToCoordSize", "dataToCoordSize", "dataToCoordSize", "radius", "clamp", "out", "extend", "indexOf", "indexOf", "isPath", "CustomChartView", "el", "Clz", "errMsg", "updateZ", "prepareResult", "getItemModel", "style", "indexOf", "mergeChildren", "install", "inner", "clone", "bind", "BaseAxisPointer", "updateProps", "e", "normalizeCssArray", "position", "transform", "create", "applyTransform", "CartesianAxisPointer", "layout", "transform", "AxisPointerModel", "inner", "each", "e", "dispatchAction", "AxisPointerView", "e", "dispatchAction", "Component_default", "valueAxis", "inner", "dispatchAction", "extend", "dist", "key", "install", "install", "PolarAxisPointer", "pointerShapeBuilder", "position", "transform", "create", "applyTransform", "labelLayout", "pointerShapeBuilder", "PolarModel", "PolarAxisModel", "AngleAxisModel", "RadiusAxisModel", "RadiusAxis", "scale", "clamp", "inner", "AngleAxis", "scale", "clamp", "cache", "Polar", "clamp", "out", "dir", "RADIAN", "EPSILON", "x", "getCoordSys", "center", "parsePercent", "_a", "start", "end", "AngleAxisView", "scale", "RADIAN", "mergePath", "len", "selfBuilderAttrs", "RadiusAxisView", "layout", "axisElementBuilders", "RADIAN", "mergePath", "getSeriesStackId", "getAxisKey", "seriesType", "valueAxis", "len", "parsePercent", "offset", "PolarView", "Component_default", "install", "layout", "selfBuilderAttrs", "SingleAxisView", "layout", "axisElementBuilders", "subPixelOptimizeLine", "mergePath", "scale", "SingleAxisModel", "AxisModel_default", "SingleAxis", "scale", "position", "clamp", "Single", "isCategory", "out", "getCoordSys", "create", "XY", "WH", "SingleAxisPointer", "pointerShapeBuilder", "layout", "position", "transform", "SingleView", "Component_default", "install", "AxisModel_default", "CalendarModel", "CalendarView", "self", "date", "points", "position", "x", "rotate", "extend", "start", "parsePercent", "Component_default", "Calendar", "m", "cellSize", "clamp", "out", "getCoordSys", "start", "end", "install", "XY", "out", "clamp", "len", "mathMax", "mathMin", "layout", "WH", "MatrixDim", "error", "self", "dimModelData", "XY", "count", "len", "layout", "WH", "mathMax", "MatrixBodyCorner", "self", "error", "idx", "locatorRange", "parsed", "extend", "x", "x", "MatrixModel", "xDim", "yDim", "MatrixDimensionModel", "round", "MatrixView", "xDim", "yDim", "Component_default", "XY", "_a", "Matrix", "out", "error", "getCoordSys", "XY", "WH", "clamp", "mathMin", "mathMax", "install", "extend", "GraphicComponentModel", "inner", "GraphicComponentView", "createEl", "parsePercent", "indexOf", "Component_default", "inner", "createEl", "extend", "install", "indexOf", "DataZoomAxisInfo", "DataZoomModel", "axisModels", "axisDim", "SelectDataZoomModel", "DataZoomView", "Component_default", "SelectDataZoomView", "each", "asc", "AxisProxy", "scale", "install", "ToolboxFeature", "ToolboxModel", "normalizeCssArray", "ToolboxView", "features", "viewRect", "Component_default", "SaveAsImage", "defaultOption", "MagicType", "defaultOption", "seriesType", "categoryAxis", "indexOf", "categoryAxis", "valueAxis", "series", "trim", "DataView", "self", "addEventListener", "e", "defaultOption", "extend", "each", "inner", "clear", "RestoreOption", "clear", "defaultOption", "BrushTargetManager", "parseFinder", "indexOf", "clamp", "getSize", "each", "DataZoomFeature", "handlers", "ecModel", "has", "each", "defaultOption", "install", "TooltipModel", "len", "getComputedStyle", "backgroundColor", "indexOf", "x", "translate", "color", "normalizeCssArray", "out", "TooltipHTMLContent", "self", "e", "position", "getComputedStyle", "arrow", "transform", "parentNode", "TooltipRichContent", "makeStyleCoord", "self", "x", "out", "TooltipView", "e", "dispatchAction", "makeDispatchAction", "extend", "x", "html", "trigger", "parsePercent", "Component_default", "position", "offset", "install", "map", "each", "keys", "has", "len", "value", "contain", "points", "x", "fn", "len", "indexOf", "BrushView", "Component_default", "BrushModel", "BrushFeature", "defaultOption", "install", "TitleModel", "TitleView", "Component_default", "install", "TimelineModel", "count", "SliderTimelineModel", "TimelineView", "Component_default", "TimelineAxis", "scale", "PI", "SliderTimelineView", "viewRect", "getViewRect", "m", "create", "scale", "createScaleByModel", "extend", "position", "e", "trigger", "applyTransform", "dist", "color", "install", "inner", "MarkerModel", "extend", "MarkPointModel", "getAxisInfo", "indexOf", "dataFilter", "inner", "MarkerView", "markerModel", "updateZ", "Component_default", "_a", "left", "top", "parsePercent", "x", "MarkPointView", "color", "extend", "dataFilter", "install", "MarkLineModel", "inner", "valueAxis", "getAxisInfo", "extend", "dataFilter", "parsePercent", "x", "MarkLineView", "createList", "install", "MarkAreaModel", "inner", "lt", "rb", "isInfinity", "dataFilter", "parsePercent", "x", "MarkAreaView", "points", "createList", "color", "layout", "extend", "install", "LegendModel", "selector", "indexOf", "curry", "each", "Group", "LegendView", "selector", "seriesModel", "_this", "style", "legendIcon", "extend", "itemGroup", "rotate", "Component_default", "len", "out", "install", "ScrollableLegendModel", "mergeAndNormalizeLayoutParams", "mergeAndNormalizeLayoutParams", "Group", "WH", "XY", "ScrollableLegendView", "selector", "self", "offset", "intersect", "start", "install", "install", "InsideZoomModel", "inner", "dispatchAction", "e", "x", "InsideZoomView", "e", "scale", "install", "SliderZoomModel", "Rect", "SliderZoomView", "location", "group", "indexOf", "parsePercent", "offset", "applyTransform", "e", "center", "x", "map", "install", "install", "isCategory", "defaultOption", "mapVisual", "isArray", "each", "asc", "linearMap", "VisualMapModel", "isCategory", "base", "controller", "getColorVisual", "ContinuousModel", "getColorVisual", "count", "VisualMapView", "normalizeCssArray", "Component_default", "linearMap", "each", "mathMin", "mathMax", "ContinuousView", "position", "getCursor", "e", "scale", "extend", "applyTransform", "color", "x", "self", "global", "transform", "points", "len", "value", "each", "has", "installed", "installCommon", "install", "installCommon", "PiecewiseModel", "isCategory", "has", "getColorVisual", "color", "max", "index", "PiecewiseVisualMapView", "install", "installCommon", "install", "ThumbnailBridgeImpl", "ThumbnailModel", "error", "ThumbnailView", "updateZ", "viewRect", "mul", "e", "x", "offset", "Component_default", "extend", "updateZ", "install", "inner", "defaultOption", "paletteDecal", "specifiedDecal", "extend", "indexOf", "install", "RegExpEvaluator", "ConstConditionInternal", "AndConditionInternal", "OrConditionInternal", "NotConditionInternal", "RelationalConditionInternal", "ConditionalExpressionParsed", "len", "order", "len", "i", "install", "DatasetModel", "DatasetView", "Component_default", "install", "mathSin", "mathCos", "PI", "PI2", "SVGPathRebuilder", "x", "x2", "x3", "isAroundZero", "e", "mathRound", "updateAttr", "_a", "el", "extend", "transform", "len", "animators", "animator", "i", "percent", "round", "isImageLike", "m", "isAroundZero", "mul", "points", "x", "x", "brush", "_a", "color", "len", "offset", "isImageLike", "parentNode", "map", "SVGPainter", "storage", "extend", "viewport", "brush", "backgroundColor", "out", "len", "_a", "color", "install", "dpr", "Layer", "dpr", "devicePixelRatio", "i", "self", "x", "width", "height", "CanvasPainter", "storage", "extend", "devicePixelRatio", "len", "_a", "k", "layer", "start", "dpr", "backgroundColor", "indexOf", "Painter_default", "install", "Painter_default", "install", "color", "init", "install", "start", "valueAxis", "categoryAxis", "color", "count", "init", "createPopper", "end", "start", "start", "end", "name", "style", "max", "min", "round", "round", "x", "getLayoutRect", "getComputedStyle", "getComputedStyle", "window", "min", "max", "keys", "toPaddingObject", "popperOffsets", "len", "getLayoutRect", "min", "max", "center", "offset", "effect", "x", "dpr", "round", "popper", "position", "getComputedStyle", "end", "effect", "resize", "window", "hash", "x", "max", "x", "getComputedStyle", "getComputedStyle", "clippingParents", "getComputedStyle", "max", "min", "reference", "len", "start", "end", "popperOffsets", "offset", "placements", "placement", "placements", "placement", "start", "len", "_loop", "_i", "checks", "offset", "distance", "x", "popperOffsets", "len", "offset", "min", "max", "start", "getLayoutRect", "round", "map", "sort", "fn", "merged", "defaultModifiers", "defaultOptions", "createPopper", "reference", "popper", "options", "m", "getLayoutRect", "fn", "state", "effect", "noopFn", "createPopper", "defaultModifiers", "createPopper", "elementMap", "Map", "set", "element", "key", "instance", "has", "instanceMap", "get", "size", "console", "error", "Array", "from", "keys", "remove", "delete", "MAX_UID", "MILLISECONDS_MULTIPLIER", "TRANSITION_END", "parseSelector", "selector", "window", "CSS", "escape", "replace", "match", "id", "toType", "object", "undefined", "Object", "prototype", "toString", "call", "toLowerCase", "getUID", "prefix", "Math", "floor", "random", "document", "getElementById", "getTransitionDurationFromElement", "transitionDuration", "transitionDelay", "getComputedStyle", "floatTransitionDuration", "Number", "parseFloat", "floatTransitionDelay", "split", "triggerTransitionEnd", "dispatchEvent", "Event", "isElement", "jquery", "nodeType", "getElement", "length", "querySelector", "isVisible", "getClientRects", "elementIsVisible", "getPropertyValue", "closedDetails", "closest", "summary", "parentNode", "isDisabled", "Node", "ELEMENT_NODE", "classList", "contains", "disabled", "hasAttribute", "getAttribute", "findShadowRoot", "documentElement", "attachShadow", "getRootNode", "root", "ShadowRoot", "noop", "reflow", "offsetHeight", "getjQuery", "jQuery", "body", "DOMContentLoadedCallbacks", "onDOMContentLoaded", "callback", "readyState", "addEventListener", "push", "isRTL", "dir", "defineJQueryPlugin", "plugin", "$", "name", "NAME", "JQUERY_NO_CONFLICT", "fn", "jQueryInterface", "Constructor", "noConflict", "execute", "possibleCallback", "args", "defaultValue", "executeAfterTransition", "transitionElement", "waitForTransition", "durationPadding", "emulatedDuration", "called", "handler", "target", "removeEventListener", "setTimeout", "getNextActiveElement", "list", "activeElement", "shouldGetNext", "isCycleAllowed", "listLength", "index", "indexOf", "max", "min", "namespaceRegex", "stripNameRegex", "stripUidRegex", "eventRegistry", "uidEvent", "customEvents", "mouseenter", "mouseleave", "nativeEvents", "Set", "makeEventUid", "uid", "getElementEvents", "bootstrapHandler", "event", "hydrateObj", "delegateTarget", "oneOff", "EventHandler", "off", "type", "apply", "bootstrapDelegationHandler", "domElements", "querySelectorAll", "domElement", "findHandler", "events", "callable", "delegationSelector", "values", "find", "normalizeParameters", "originalTypeEvent", "delegationFunction", "isDelegated", "typeEvent", "getTypeEvent", "addHandler", "wrapFunction", "relatedTarget", "handlers", "previousFunction", "removeHandler", "Boolean", "removeNamespacedHandlers", "namespace", "storeElementEvent", "handlerKey", "entries", "includes", "on", "one", "inNamespace", "isNamespace", "startsWith", "elementEvent", "slice", "keyHandlers", "trigger", "jQueryEvent", "bubbles", "nativeDispatch", "defaultPrevented", "isPropagationStopped", "isImmediatePropagationStopped", "isDefaultPrevented", "evt", "cancelable", "preventDefault", "obj", "meta", "value", "_unused", "defineProperty", "configurable", "normalizeData", "JSON", "parse", "decodeURIComponent", "normalizeDataKey", "chr", "Manipulator", "setDataAttribute", "setAttribute", "removeDataAttribute", "removeAttribute", "getDataAttributes", "attributes", "bsKeys", "dataset", "filter", "pureKey", "charAt", "getDataAttribute", "Config", "Default", "DefaultType", "Error", "_getConfig", "config", "_mergeConfigObj", "_configAfterMerge", "_typeCheckConfig", "jsonConfig", "constructor", "configTypes", "property", "expectedTypes", "valueType", "RegExp", "test", "TypeError", "toUpperCase", "VERSION", "BaseComponent", "_element", "_config", "Data", "DATA_KEY", "dispose", "EVENT_KEY", "propertyName", "getOwnPropertyNames", "_queueCallback", "isAnimated", "getInstance", "getOrCreateInstance", "eventName", "getSelector", "hrefAttribute", "trim", "map", "sel", "join", "SelectorEngine", "concat", "Element", "findOne", "children", "child", "matches", "parents", "ancestor", "prev", "previous", "previousElementSibling", "next", "nextElementSibling", "focusableChildren", "focusables", "el", "getSelectorFromElement", "getElementFromSelector", "getMultipleElementsFromSelector", "enableDismissTrigger", "component", "method", "clickEvent", "tagName", "EVENT_CLOSE", "EVENT_CLOSED", "CLASS_NAME_FADE", "CLASS_NAME_SHOW", "Alert", "close", "closeEvent", "_destroyElement", "each", "data", "DATA_API_KEY", "CLASS_NAME_ACTIVE", "SELECTOR_DATA_TOGGLE", "EVENT_CLICK_DATA_API", "Button", "toggle", "button", "EVENT_TOUCHSTART", "EVENT_TOUCHMOVE", "EVENT_TOUCHEND", "EVENT_POINTERDOWN", "EVENT_POINTERUP", "POINTER_TYPE_TOUCH", "POINTER_TYPE_PEN", "CLASS_NAME_POINTER_EVENT", "SWIPE_THRESHOLD", "endCallback", "leftCallback", "rightCallback", "Swipe", "isSupported", "_deltaX", "_supportPointerEvents", "PointerEvent", "_initEvents", "_start", "touches", "clientX", "_eventIsPointerPenTouch", "_end", "_handleSwipe", "_move", "absDeltaX", "abs", "direction", "add", "pointerType", "navigator", "maxTouchPoints", "ARROW_LEFT_KEY", "ARROW_RIGHT_KEY", "TOUCHEVENT_COMPAT_WAIT", "ORDER_NEXT", "ORDER_PREV", "DIRECTION_LEFT", "DIRECTION_RIGHT", "EVENT_SLIDE", "EVENT_SLID", "EVENT_KEYDOWN", "EVENT_MOUSEENTER", "EVENT_MOUSELEAVE", "EVENT_DRAG_START", "EVENT_LOAD_DATA_API", "CLASS_NAME_CAROUSEL", "CLASS_NAME_SLIDE", "CLASS_NAME_END", "CLASS_NAME_START", "CLASS_NAME_NEXT", "CLASS_NAME_PREV", "SELECTOR_ACTIVE", "SELECTOR_ITEM", "SELECTOR_ACTIVE_ITEM", "SELECTOR_ITEM_IMG", "SELECTOR_INDICATORS", "SELECTOR_DATA_SLIDE", "SELECTOR_DATA_RIDE", "KEY_TO_DIRECTION", "interval", "keyboard", "pause", "ride", "touch", "wrap", "Carousel", "_interval", "_activeElement", "_isSliding", "touchTimeout", "_swipeHelper", "_indicatorsElement", "_addEventListeners", "cycle", "_slide", "nextWhenVisible", "hidden", "_clearInterval", "_updateInterval", "setInterval", "_maybeEnableCycle", "to", "items", "_getItems", "activeIndex", "_getItemIndex", "_getActive", "order", "defaultInterval", "_keydown", "_addTouchEventListeners", "img", "endCallBack", "clearTimeout", "swipeConfig", "_directionToOrder", "_setActiveIndicatorElement", "activeIndicator", "newActiveIndicator", "elementInterval", "parseInt", "isNext", "nextElement", "nextElementIndex", "triggerEvent", "_orderToDirection", "slideEvent", "isCycling", "directionalClassName", "orderClassName", "completeCallBack", "_isAnimated", "clearInterval", "carousel", "slideIndex", "carousels", "EVENT_SHOW", "EVENT_SHOWN", "EVENT_HIDE", "EVENT_HIDDEN", "CLASS_NAME_COLLAPSE", "CLASS_NAME_COLLAPSING", "CLASS_NAME_COLLAPSED", "CLASS_NAME_DEEPER_CHILDREN", "CLASS_NAME_HORIZONTAL", "WIDTH", "HEIGHT", "SELECTOR_ACTIVES", "parent", "Collapse", "_isTransitioning", "_triggerArray", "toggleList", "elem", "filterElement", "foundElement", "_initializeChildren", "_addAriaAndCollapsedClass", "_isShown", "hide", "show", "activeChildren", "_getFirstLevelChildren", "startEvent", "activeInstance", "dimension", "_getDimension", "style", "complete", "capitalizedDimension", "scrollSize", "getBoundingClientRect", "selected", "triggerArray", "isOpen", "ESCAPE_KEY", "TAB_KEY", "ARROW_UP_KEY", "ARROW_DOWN_KEY", "RIGHT_MOUSE_BUTTON", "EVENT_KEYDOWN_DATA_API", "EVENT_KEYUP_DATA_API", "CLASS_NAME_DROPUP", "CLASS_NAME_DROPEND", "CLASS_NAME_DROPSTART", "CLASS_NAME_DROPUP_CENTER", "CLASS_NAME_DROPDOWN_CENTER", "SELECTOR_DATA_TOGGLE_SHOWN", "SELECTOR_MENU", "SELECTOR_NAVBAR", "SELECTOR_NAVBAR_NAV", "SELECTOR_VISIBLE_ITEMS", "PLACEMENT_TOP", "PLACEMENT_TOPEND", "PLACEMENT_BOTTOM", "PLACEMENT_BOTTOMEND", "PLACEMENT_RIGHT", "PLACEMENT_LEFT", "PLACEMENT_TOPCENTER", "PLACEMENT_BOTTOMCENTER", "autoClose", "boundary", "display", "offset", "popperConfig", "reference", "Dropdown", "_popper", "_parent", "_menu", "_inNavbar", "_detectNavbar", "showEvent", "_createPopper", "focus", "_completeHide", "destroy", "update", "hideEvent", "Popper", "referenceElement", "_getPopperConfig", "createPopper", "_getPlacement", "parentDropdown", "isEnd", "_getOffset", "popperData", "defaultBsPopperConfig", "placement", "modifiers", "options", "enabled", "_selectMenuItem", "clearMenus", "openToggles", "context", "composedPath", "isMenuTarget", "dataApiKeydownHandler", "isInput", "isEscapeEvent", "isUpOrDownEvent", "getToggleButton", "stopPropagation", "EVENT_MOUSEDOWN", "className", "clickCallback", "rootElement", "Backdrop", "_isAppended", "_append", "_getElement", "_emulateAnimation", "backdrop", "createElement", "append", "EVENT_FOCUSIN", "EVENT_KEYDOWN_TAB", "TAB_NAV_FORWARD", "TAB_NAV_BACKWARD", "autofocus", "trapElement", "FocusTrap", "_isActive", "_lastTabNavDirection", "activate", "_handleFocusin", "_handleKeydown", "deactivate", "elements", "shiftKey", "SELECTOR_FIXED_CONTENT", "SELECTOR_STICKY_CONTENT", "PROPERTY_PADDING", "PROPERTY_MARGIN", "ScrollBarHelper", "getWidth", "documentWidth", "clientWidth", "innerWidth", "width", "_disableOverFlow", "_setElementAttributes", "calculatedValue", "reset", "_resetElementAttributes", "isOverflowing", "_saveInitialAttribute", "overflow", "styleProperty", "scrollbarWidth", "manipulationCallBack", "setProperty", "_applyManipulationCallback", "actualValue", "removeProperty", "callBack", "EVENT_HIDE_PREVENTED", "EVENT_RESIZE", "EVENT_CLICK_DISMISS", "EVENT_MOUSEDOWN_DISMISS", "EVENT_KEYDOWN_DISMISS", "CLASS_NAME_OPEN", "CLASS_NAME_STATIC", "OPEN_SELECTOR", "SELECTOR_DIALOG", "SELECTOR_MODAL_BODY", "Modal", "_dialog", "_backdrop", "_initializeBackDrop", "_focustrap", "_initializeFocusTrap", "_scrollBar", "_adjustDialog", "_showElement", "_hideModal", "handleUpdate", "scrollTop", "modalBody", "transitionComplete", "_triggerBackdropTransition", "event2", "_resetAdjustments", "isModalOverflowing", "scrollHeight", "clientHeight", "initialOverflowY", "overflowY", "isBodyOverflowing", "paddingLeft", "paddingRight", "alreadyOpen", "CLASS_NAME_SHOWING", "CLASS_NAME_HIDING", "CLASS_NAME_BACKDROP", "scroll", "Offcanvas", "blur", "completeCallback", "position", "ARIA_ATTRIBUTE_PATTERN", "DefaultAllowlist", "a", "area", "b", "br", "col", "code", "dd", "div", "dl", "dt", "em", "hr", "h1", "h2", "h3", "h4", "h5", "h6", "i", "li", "ol", "p", "pre", "s", "small", "span", "sub", "sup", "strong", "u", "ul", "uriAttributes", "SAFE_URL_PATTERN", "allowedAttribute", "attribute", "allowedAttributeList", "attributeName", "nodeName", "nodeValue", "attributeRegex", "some", "regex", "sanitizeHtml", "unsafeHtml", "allowList", "sanitizeFunction", "domParser", "DOMParser", "createdDocument", "parseFromString", "elementName", "attributeList", "allowedAttributes", "innerHTML", "content", "extraClass", "html", "sanitize", "sanitizeFn", "template", "DefaultContentType", "entry", "TemplateFactory", "getContent", "_resolvePossibleFunction", "hasContent", "changeContent", "_checkContent", "toHtml", "templateWrapper", "_maybeSanitize", "text", "_setContent", "arg", "templateElement", "_putElementInTemplate", "textContent", "DISALLOWED_ATTRIBUTES", "CLASS_NAME_MODAL", "SELECTOR_TOOLTIP_INNER", "SELECTOR_MODAL", "EVENT_MODAL_HIDE", "TRIGGER_HOVER", "TRIGGER_FOCUS", "TRIGGER_CLICK", "TRIGGER_MANUAL", "EVENT_INSERTED", "EVENT_CLICK", "EVENT_FOCUSOUT", "AttachmentMap", "AUTO", "TOP", "RIGHT", "BOTTOM", "LEFT", "animation", "container", "customClass", "delay", "fallbackPlacements", "title", "Tooltip", "_isEnabled", "_timeout", "_isHovered", "_activeTrigger", "_templateFactory", "_newContent", "tip", "_setListeners", "_fixTitle", "enable", "disable", "toggleEnabled", "_leave", "_enter", "_hideModalHandler", "_disposePopper", "_isWithContent", "shadowRoot", "isInTheDom", "ownerDocument", "_getTipElement", "_isWithActiveTrigger", "_getTitle", "_createTipElement", "_getContentForTemplate", "_getTemplateFactory", "tipId", "setContent", "_initializeOnDelegatedTarget", "_getDelegateConfig", "attachment", "phase", "state", "triggers", "eventIn", "eventOut", "_setTimeout", "timeout", "dataAttributes", "dataAttribute", "SELECTOR_TITLE", "SELECTOR_CONTENT", "Popover", "_getContent", "EVENT_ACTIVATE", "CLASS_NAME_DROPDOWN_ITEM", "SELECTOR_DATA_SPY", "SELECTOR_TARGET_LINKS", "SELECTOR_NAV_LIST_GROUP", "SELECTOR_NAV_LINKS", "SELECTOR_NAV_ITEMS", "SELECTOR_LIST_ITEMS", "SELECTOR_LINK_ITEMS", "SELECTOR_DROPDOWN", "SELECTOR_DROPDOWN_TOGGLE", "rootMargin", "smoothScroll", "threshold", "ScrollSpy", "_targetLinks", "_observableSections", "_rootElement", "_activeTarget", "_observer", "_previousScrollData", "visibleEntryTop", "parentScrollTop", "refresh", "_initializeTargetsAndObservables", "_maybeEnableSmoothScroll", "disconnect", "_getNewObserver", "section", "observe", "observableSection", "hash", "height", "offsetTop", "scrollTo", "top", "behavior", "IntersectionObserver", "_observerCallback", "targetElement", "_process", "userScrollsDown", "isIntersecting", "_clearActiveClass", "entryIsLowerThanPrevious", "targetLinks", "anchor", "decodeURI", "_activateParents", "listGroup", "item", "activeNodes", "node", "spy", "HOME_KEY", "END_KEY", "CLASS_DROPDOWN", "SELECTOR_DROPDOWN_MENU", "NOT_SELECTOR_DROPDOWN_TOGGLE", "SELECTOR_TAB_PANEL", "SELECTOR_OUTER", "SELECTOR_INNER", "SELECTOR_INNER_ELEM", "SELECTOR_DATA_TOGGLE_ACTIVE", "Tab", "_setInitialAttributes", "_getChildren", "innerElem", "_elemIsActive", "active", "_getActiveElem", "_deactivate", "_activate", "relatedElem", "_toggleDropDown", "nextActiveElement", "preventScroll", "_setAttributeIfNotExists", "_setInitialAttributesOnChild", "_getInnerElement", "isActive", "outerElem", "_getOuterElement", "_setInitialAttributesOnTargetPanel", "open", "EVENT_MOUSEOVER", "EVENT_MOUSEOUT", "CLASS_NAME_HIDE", "autohide", "Toast", "_hasMouseInteraction", "_hasKeyboardInteraction", "_clearTimeout", "_maybeScheduleHide", "isShown", "_onInteraction", "isInteracting", "echarts_exports", "Component_default", "dispose", "format_exports", "graphic_exports", "helper_exports", "init", "number_exports", "registerCustomSeries", "util_exports", "version", "CMD", "len", "x", "x0", "y0", "x1", "y1", "startAngle", "endAngle", "cx", "cy", "rx", "ry", "dir", "x2", "out", "scale", "count", "crossProduct2d", "x1", "x2", "lineLineIntersect", "dir", "dir2", "len", "points", "min", "max", "x", "pt0", "pt1", "out", "sub", "clone", "m", "scale", "left", "x1", "x2", "len", "_a", "centroid", "len2", "offset", "toArr", "tmpArr", "m", "x", "_a", "tmpArr", "m", "x1", "x2", "x3", "fromList", "i", "from", "len", "fromIsMany", "animateIndex", "animateCount", "count", "_a", "newEl", "removeEl", "len", "extend", "newItem", "el", "_a", "oldData", "ScaleBreakContextImpl", "init", "parse", "error", "fixRoundingError", "brk", "color", "i", "isAxisHorizontal", "XY", "WH", "transform", "layout2", "layout", "min", "max", "extend", "create", "mul", "registerAction", "scale", "rotate", "install", "jquery", "fn", "camelize", "e", "m", "color", "getColor", "min", "max", "e", "e", "defaultOptions", "mapOptions", "map", "count", "min", "max", "points", "L", "map", "location", "e", "theme", "color", "e", "e", "actions", "quantity", "e", "min", "e", "DATA_KEY", "e", "count", "e", "i", "e", "e", "isDarkThemeAllowed", "e", "e", "e", "e", "month", "tooltipFormatter", "e", "e", "tooltipFormatter", "e", "tooltipFormatter", "tooltipFormatter", "e", "tooltipFormatter", "tooltipFormatter", "tooltipFormatter", "e", "e", "error", "tokens", "error", "piano", "comparto", "id", "giorni", "calcolo", "escapeHtml", "url", "simulazioni", "html", "i", "tokens", "error", "e", "t", "i", "a", "r", "s", "n", "l", "o", "echarts_exports", "L", "maplibregl"]
}
